Joined: 10 Feb 2011 Posts: 241 Location: Vancouver, BC
mysql_write() & EEADR
Posted: Fri Mar 09, 2012 4:21 pm
Hi,
I was wondering if the compiler function write_ and read_eeprom() set EEADR to an unused address as it is recommended in the errata of various PIC controllers. I've seen messed up values in my EEPROM and started to do some research and I found that spurious writes can happen on power down and to avoid getting your data corrupted, set EEADR to an unused location after every each read or write cycle. Now I was wondering if the compiler functions do so already or if it's smarter to write my own read and write function and set the EEADR manually to an unused location...
Any hints & tips are appreciated!
Thanks,
Ron
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
Posted: Fri Mar 09, 2012 4:46 pm
Make a short test program with just a call to read_eeprom() and
write_eeprom() in main(). Set the .LST file format to "Symbolic" in the
Project Build Options menu. Then compile it and look at the .LST file.
You should be able to see what the compiler is doing with the EEADR register.
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