I am working on a project where I am monitoring 12 events and simply keeping a count of each.
What I want to do is that, this count gets saved to eeprom. If I use EEPROM too often then I might run out of eeprom read/wr cycles!
So what I want to do is, write to EEPROM only if I see the power dying and maybe write to EEPROM every 15 minutes.
Do you guys have any idea how I can write to eeprom on power faliure detection? I can detect power faliure, but how do I "keep it on" just long enough to write 12-15 bytes of data to EEPROM?
Edit: I read this https://www.avrfreaks.net/index.p...
and that is where I got this idea., but cant understand how can I keep it running enough to write my state to eeprom. i.e. How to do this:
[Power faliure is easy to detect and you can save the machine state without any problems with a large capacitor on the input and output of the regulator.]