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 CCS Technical Support

preserve eeprom data

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







preserve eeprom data
PostPosted: Sun Oct 23, 2005 8:24 pm     Reply with quote

hello all, i wanted to know how i could preserve the eeprom data when i am reprogramming my pic18f252 microcontroller. i am using PICstartplus programmer with MPLAB. thanks much...

TD
Mark



Joined: 07 Sep 2003
Posts: 2838
Location: Atlanta, GA

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

PostPosted: Mon Oct 24, 2005 6:58 am     Reply with quote

Uncheck the box that programs the eeprom Idea
TD
Guest







PostPosted: Mon Oct 24, 2005 1:57 pm     Reply with quote

thanks for your reply.

I unchecked the Program Data EEPROM and it works !

Okay this is what I followed. After enabling the programmer > Erase Flash Device > Program for downloading the 1st program

I wrote to the eeprom and checked it as well and it seems to be fine.

Code:
Code:

   // would have received the characters to store in data eeprom from   
   // RS 232 input but here i am just showing some character
    write_eeprom(20,'1');
    write_eeprom(21,'5');
    write_eeprom(22,'2');
    write_eeprom(23,'5');

    v1 = read_eeprom(20) - 0x30;
    v2 = read_eeprom(21) - 0x30;
    v3 = read_eeprom(22)- 0x30;
    v4 = read_eeprom(23) - 0x30;

    if( 1 == v1 && 5 == v2 && 2 == v3 && 5 == v4)
       Output_high(Pin_C5);
    else
       Output_high(Pin_C3);

So the data eeprom at 20, 21, 22, 23 had '1,'5','2','5' since the proper LED was ON.

Now I reprogram the pic without erasing the eeprom. I compile/run the new code and then Enabled the programmer. And then clicked on Program/verify and unchecked DATA EEPROM > click program. thanks much

ps: I am sorry I posted this in another thread as well as part of another question[/code]
TD
Guest







PostPosted: Mon Oct 24, 2005 2:20 pm     Reply with quote

It does not work if I follow the procedure I had written in the above message. Please let me where I am making a mistake.
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