jumanji
Joined: 09 Jun 2011 Posts: 13
|
very confused about data eeprom on 16F1823 [solved] |
Posted: Tue Apr 03, 2012 3:03 pm |
|
|
I am working with data eeprom for the first time and I am very confused about what I am seeing. If I use this directive:
Code: |
#rom getenv("EEPROM_ADDRESS")={1,2,3,4,5}
|
and run my code and then go look in the "EEPROM" window in MPLAB I see that the first 5 bytes show up exactly like I would expect based on the directive above.
However, if in my program I run this code segment to write 2 bytes of data to eeprom and then read them back
Code: |
write_eeprom(0x00, counter_lowbyte);
write_eeprom(0x01, counter_highbyte);
//test eeprom to make sure values are being written
a = read_eeprom(0x00);
b = read_eeprom(0x01);
|
and then look at the values of 'a' and 'b' then it appears that everything worked fine. However, if I look in the "EEPROM" table in MPLAB it still shows the original 5 values and no other locations in the table are disturbed. Even if I shut that window down and load it again no values are changed.
Can someone explain to me why my code tells me that the eeprom writes worked but the table does not? thanks |
|