HELP for programming µc

Status
Not open for further replies.
imemkeycode = imemkeycode * 100;
imemkeycode = imemkeycode + eeprom_read(addr++);

what's mean this two staterments???
 

If data in eeprom is 1234. 12 is stored at address 0x0001 and 34 is stored at address 0x0000. First you retrieve value at address 0x0001 and multiply it with 100 and you get 1200. Then you get the value 34 and add it to 1200 and get 1234. The above code is wrong. It is my mistake. First read addr++ and then read addr.

method to write to eeprom.

1234

1234/100 = 12
1234%100 = 34

12 = 0Ch
34 = 22h

0x0000 = 22h
0x0001 = 0Ch
 
Last edited:

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…