View previous topic :: View next topic |
Author |
Message |
padbol
Joined: 25 Apr 2011 Posts: 11 Location: Belgium
|
[Solved] Internal Eeprom data retention |
Posted: Thu May 31, 2012 3:13 am |
|
|
Hello,
I'm experiencing a disturbing issue using the internal eeprom of a 18F4550 PIC.
First I writed a value that I read before displaying it. And it works.
Code: |
float MaxTemp;
WriteEeprom_Float(0x04,29.5);
MaxTemp = ReadEeprom_Float(0x04);
printf("\fTemp %2.1f",MaxTemp);
while(1);
|
Secondly, I remove the writing sentence to read the previous value again which doesn't work.
Code: |
float MaxTemp;
//WriteEeprom_Float(0x04,29.5);
MaxTemp = ReadEeprom_Float(0x04);
printf("\fTemp %2.1f",MaxTemp);
while(1);
|
(*) Read/Write Eeprom_Float(...) is written like this : http://www.ccsinfo.com/faq.php?page=write_eeprom_not_byte
Read value seems to be empty after powering down the device.
Is there any operation to do telling the microcontroler to retain datas written into its eeprom? Or something else? Does someone can tell me where am I wrong?
It's driving me crazy.
I really thank you for your help _________________ - Be the change you want to see in the world (Gandhi) -
Last edited by padbol on Thu May 31, 2012 3:39 am; edited 1 time in total |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19540
|
|
Posted: Thu May 31, 2012 3:20 am |
|
|
Surely, the key is that you are not just 'powering down the device', but reprogramming it to write the new code.
There should be an option in whatever programmer you are using to not erase the EEPROM. Otherwise it'll be cleared when you write the code.
Best Wishes |
|
|
padbol
Joined: 25 Apr 2011 Posts: 11 Location: Belgium
|
|
Posted: Thu May 31, 2012 3:29 am |
|
|
Ttelmah wrote: | Surely, the key is that you are not just 'powering down the device', but reprogramming it to write the new code.
There should be an option in whatever programmer you are using to not erase the EEPROM. Otherwise it'll be cleared when you write the code.
Best Wishes |
Great! Thank you! That's right
I changed it here : Programmer / Settings / Program memory tab : "Preserve eeprom on program" _________________ - Be the change you want to see in the world (Gandhi) - |
|
|
|