CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

very confused about data eeprom on 16F1823 [solved]

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
jumanji



Joined: 09 Jun 2011
Posts: 13

View user's profile Send private message

very confused about data eeprom on 16F1823 [solved]
PostPosted: Tue Apr 03, 2012 3:03 pm     Reply with quote

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
jumanji



Joined: 09 Jun 2011
Posts: 13

View user's profile Send private message

PostPosted: Tue Apr 03, 2012 3:16 pm     Reply with quote

nevermind. I just found the bit in the help section that says the EEPROM window is not refreshed unless you go into the "Debugger" tab in Mplab and do a 'Read'.

I do this and wala! There is my data just like it should be!
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group