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

EEPROM problem with each Programming of 18F Microchip

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



Joined: 04 Apr 2005
Posts: 63

View user's profile Send private message Send e-mail

EEPROM problem with each Programming of 18F Microchip
PostPosted: Mon Aug 04, 2008 10:18 am     Reply with quote

Using CCS, is there a way to preserve the data in EEPROM each time I program my 18F chip?
I cannot seem to find a flag to preserve the EEPROM on each programming cycle.

My problem is each time I re-program my chip, I lose all the EEPROM data on the chip from previous data collections.

I really don't want to download the code before each programming.
I would like to make small corrections to the code and upload the code only.
Ttelmah
Guest







PostPosted: Mon Aug 04, 2008 10:26 am     Reply with quote

Nothing to do with CCS C. This is down to your programmer...
Some have an option to not perform a full erase unless necessary. If you select this, and don't include any EEPROM data in the code, then the EEPROM will be saved. Otherwise you will need to read the EEPROM, into a data file, and write it back after the code is loaded.

Best Wishes
jahan



Joined: 04 Apr 2005
Posts: 63

View user's profile Send private message Send e-mail

PostPosted: Mon Aug 04, 2008 11:31 am     Reply with quote

Ttelmah:

In my code, I'm actually not writing to EEPROM during initial programming process.
The actual program once executed will store information in EEPROM.

Each time I run the program, during the initialization, the system reads 0x1 to see if it should be running or not.

If I read location 0x1 thru my LCD, it shows 1 (running).
It has been set using a button to turn the system ON and saved the value in location 0x1 of EEPROM.

If I reprogram the microchip, the LCD shows value 255 at location 0x1 (not 0x1) which was set before reprogramming the chip.
Ttelmah
Guest







PostPosted: Mon Aug 04, 2008 11:35 am     Reply with quote

Nothing to do with CCS C. This is down to your programmer...
Some have an option to not perform a full erase unless necessary. If you select this, and don't include any EEPROM data in the code, then the EEPROM will be saved. Otherwise you will need to read the EEPROM, into a data file, and write it back after the code is loaded.

Best Wishes
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Aug 04, 2008 11:37 am     Reply with quote

How to preserve EEPROM upon programming:

With ICD2:
http://www.ccsinfo.com/forum/viewtopic.php?t=33108


With ICD-U40 :
http://www.ccsinfo.com/forum/viewtopic.php?t=30621
Ttelmah
Guest







PostPosted: Mon Aug 04, 2008 11:38 am     Reply with quote

Sorry about the double post, the system hung for a long while, then came up with invalid confirmation code, but had accepted the post...
255, is the value you get from an _erased_ location. Hence my comment still applies. Your programmer is erasing the chip (some allow you to select not to do this). It is not CCS C doing this, but your programmer.

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