Re: Saving A State to EEPROM on Power-Down
2012-12-12 by bayramdavies
--- In AVR-Chat@yahoogroups.com, "Benny Smith" <benny@...> wrote: > Does the 8-bit AVR (e.g. ATMega88PA) > have a means to sense the removal of > power and to execute a save-state > operation to EEPROM No. > I am using an on-board regulator to > supply 5 volts to the AVR. The > regulator has 200 msec or more of > hold-up time after power is removed. That's plenty of time. > I could certainly add hardware to > allow sensing a drop in Vcc below, > say, 4 volts, which could be used > to trigger the save-state operation. To take full advantage of the hold-up time, you should sense removal of power at the input to the regulator. By the time the output of the regulator falls to 4 volts, most of your hold-up time has probably passed. > But I would like to avoid adding > hardware. Then, what you need to figure is how quickly you can sense loss of power and how much time you can then guarantee that the supply will be in the operational range of the device. If you can do the required number of EEPROM writes in that time, you'll be OK, otherwise, not. Graham.