|
|
View previous topic :: View next topic |
Author |
Message |
td Guest
|
preserve eeprom data |
Posted: Sun Oct 23, 2005 8:24 pm |
|
|
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
|
|
Posted: Mon Oct 24, 2005 6:58 am |
|
|
Uncheck the box that programs the eeprom |
|
|
TD Guest
|
|
Posted: Mon Oct 24, 2005 1:57 pm |
|
|
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
|
|
Posted: Mon Oct 24, 2005 2:20 pm |
|
|
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. |
|
|
|
|
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
|