PDA

View Full Version : The best way to record non-volatile data



johnson
- 15th July 2004, 21:24
Hi all,

I am implementing a counter system which will record down every count of an event into eeprom. The way I'm using is, whenever the even occurs, counter will incremented by one, and the value will be saved into eeprom. However, I realize that this way is a kinda wasting of time and resources (if i am not mistaken, there is a limitation for writting data into PIC's eeprom in number of time). Hence, I am thinking of another way, ie. whenever PIC detect the voltage supply is low, it will only backup the data into its eeprom instead of writting data continuously into eeprom (it will caused damage to eeprom). Is there anyway to implement it in Pic Basic? Thanks



cheers,

Squibcakes
- 19th July 2004, 05:58
Johnson,
How often doyou think this event would occur?
JS

johnson
- 19th July 2004, 07:10
the event occurs very often.......

Melanie
- 19th July 2004, 09:03
Simply be creative with the Power Supplies within your circuit. The supply to the PIC on it's OWN can be 'isolated' from the main supply to the rest of the circuitry through a Diode with a large Capacitor acting as a Reservoir connected on its output. Power-fail detect is taken to a PIC pin from before the Diode. This way the PIC can detect power fail (or Power-OFF) and will continue to function for a few seconds after main power is removed - certainly enough to save your variables into EEPROM. If additional ON time is required, increase the size of the Capacitor.