View previous topic :: View next topic |
Author |
Message |
jrbrown59
Joined: 27 Sep 2011 Posts: 3 Location: USA, midwest
|
Internal EEPROM issues |
Posted: Tue Sep 27, 2011 6:58 am |
|
|
We have been using the 16F886 for a few years now and are having issues with the internal EEPROM randomly changing data.
Has anyone else experienced this and if so, how did you solve it. |
|
|
asmboy
Joined: 20 Nov 2007 Posts: 2128 Location: albany ny
|
|
Posted: Tue Sep 27, 2011 7:25 am |
|
|
how do you know the problem is in eeprom storage?
do you checksum your data and detect errors that way ?
when an error occurs - does it affect ALL stored values or just SOME?
do you UPDATE EEPROM frequently ?
in situations where i stored initial data like serial numbers, calibration etc - and protected with checksums - but have NOT overwritten frequently - i have never heard of a failure to read accurately.
checking data integrity and adding a fallback is the first line of defense.
a more complete narration of your conditions would help |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
|
jrbrown59
Joined: 27 Sep 2011 Posts: 3 Location: USA, midwest
|
|
Posted: Tue Sep 27, 2011 7:17 pm |
|
|
We have used compiler from 4.052 up through 4.121.
The eeprom data is validated with a checksum and a copy of the data is mirrored in the upper half of the eeprom. At startup, the lower memory is checked against the checksum and if not correct, the upper section is checked. If that checksum is correct, the upper section is copied to the lower section. If both checksums are incorrect then an error is flagged.
When we get a returned system with this error, I compare the upper and lower eeprom sections and it is usually just one byte in error.
I notice that when using the write_eeprom() function supplied with the compiler, when the GIE bit is cleared, the compiler does not re-read the bit to confirm it was cleared, as the data sheets suggest.
We have written our own routine that checks that the GIE has been cleared and also verify the written data. |
|
|
|