Not built in. And the BOD (Brown Out Detector) won't help because when that detects that the voltage is too low, it locks out the EEPROM write. What you need to do is measure the voltage at the input of the voltage regulator (with ADC or comparator, probably through a voltage divider). The 200ms should give you time to write a few bytes. Jim Wagner Oregon Research Electronics ----- Original Message ----- From: "Benny Smith" <benny@inch-worm.com> To: AVR-Chat@yahoogroups.com Sent: Wednesday, December 12, 2012 12:15:56 PM Subject: [AVR-Chat] RE: Saving A State to EEPROM on Power-Down 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 before the supply voltage drops below the critical level necessary to change the EEPROM? 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. 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. But I would like to avoid adding hardware. I am using an ADC input to the AVR to sense a thermistor voltage. That voltage does not change very quickly. However, a drop in Vcc would immediately be reflected as a drop in the thermistor voltage and, providing that the AVR was still alive, the save-state operation might work. Any ideas? Thanks, Benny Smith Inchworm Solutions LLC Santa Rosa, CA [Non-text portions of this message have been removed] [Non-text portions of this message have been removed]
Message
Re: [AVR-Chat] RE: Saving A State to EEPROM on Power-Down
2012-12-12 by Jim Wagner
Attachments
- No local attachments were found for this message.