To load 365 in an eeprom location at programming time it would be:
or
This comes from breaking down the bits in the bytes of the word variable
decimal 365 = 0000 0001 0110 1101 binary
Since there are 8 bits to a byte, we now know that byte0 is 0110 1101b and byte1 is 0000 0001b. Convert these to decimal and you get 109 and 1 respectively. Both commands will accomplish the same thing.
You can also use:
Code:
write address, variable.Byte1
write address, variable.Byte0
and
Code:
read address, variable.Byte1
read address, variable.Byte0
This way can be done anywhere in the program. The DATA command is used to pre-load the eeprom location at time of programming.
Bookmarks