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

Write Program EEPROM issue

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







Write Program EEPROM issue
PostPosted: Wed May 24, 2006 2:22 pm     Reply with quote

I am writing an eeprom slot in the program memory, specifically address 0x02610. After writing the eeprom the first time, I read it back and verify that the slot was correctly written. The second time I write to the slot and attempt to read it back, however, the wrong value is returned. Is there something I am doing wrong?

It's a pic18f2620

code snippet is pretty simple:

#define AIR_CALIB_BYTE_ADDR1 0x02610

//write :
write_program_eeprom(AIR_CALIB_BYTE_ADDR1,airPressureMultiplierEEPROM);

//read:
valueReadBack = read_program_eeprom(AIR_CALIB_BYTE_ADDR1);
Ttelmah
Guest







PostPosted: Wed May 24, 2006 2:36 pm     Reply with quote

Read the manual....
The write_program_eeprom function, _does not erase_. If you are writing a second time, you need to erase the block first.

Best Wishes
Seth
Guest







PostPosted: Wed May 24, 2006 2:48 pm     Reply with quote

I seem to recall reading somewhere on this site that the function write_program_eeprom performs the erase as part of its functionality. I guess I am wrong on that assumption.


I've figured out a work around.
Ttelmah
Guest







PostPosted: Wed May 24, 2006 2:55 pm     Reply with quote

Write_program_memory, does erase (but remember a whole block has to be erased). Write_program_eeprom doesn't. Look in the manual under 'write_program_memory', which explains the differences.

Best Wishes
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