|
|
View previous topic :: View next topic |
Author |
Message |
deepakomanna
Joined: 06 Mar 2007 Posts: 92 Location: Pune,India
|
how to write data in internal EEPROM of 16f913 |
Posted: Tue Jul 10, 2007 5:03 am |
|
|
Dear Sir,
here i am using 16f913, MPLAB 7.5 Ver. & CCS PCM C Compiler, Version 3.249, 34534.
Here i want to store data in internal EEPROM every 6 minute.
So how to write & read data .If write fails how to
check wheather data is written. And if that location is damaged then how can i check
that meory location is damaged.
plz reply . _________________ Thank You,
With Best Regards,
Deepak. |
|
|
Ttelmah Guest
|
|
Posted: Tue Jul 10, 2007 6:13 am |
|
|
Generate a checksum, and store this as well.
Then if the checksum does not match the data, you have a problem, and it becomes a matter of diagnosing the nature of the problem.
One test would then be to write a 'new' set at this point, and if the new set works, then the odds are the original problem was a power fail.
However consider a different approach.
Store the data in RAM.
Add a 'power fail' detector, that signals the processor when the external supply fails.
Add sufficient capacitance on the internal supply line, to maintain the supply, and write all the bytes _after_ a power fail is indicated.
This way, the data is only written when the power fails, and you know there is enough time to do this.
Even at one write every six minutes, the minimum write 'life' of the EEPROM, would get used in just over a year. Better to design to avoid this...
I do this on a motor controller unit counting pages on high speed printing presses. I store the data, as an 8,4 Hamming code, written after power failure. This allows recovery if bits are lost in the storage. Some of these units started working over ten years ago, and have never lost a count, in some cases pushing over 60000 rev/hour.
Best Wishes |
|
|
|
|
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
|