Yahoo Groups archive

AVR-Chat

Index last updated: 2026-04-28 22:41 UTC

Message

Re: [AVR-Chat] EEPROM write and power failure

2008-04-28 by James Wagner

On Apr 27, 2008, at 6:38 PM, Tim Gilbert wrote:

> We're doing an instrument that needs to store a variable in EEPROM.  
> It is a statistical certainty that, at some point, the power will  
> fail just as the software starts to write the data. Any idea's how  
> to handle this?
>
> Of course, we'll have the BOD enabled but I don't know (in fact  
> really doubt) that it will save the day.
>
> Thanks,
>
> Tim Gilbert
> JEM Innovation Inc.
> 303-926-9053 (office)
> 303-437-4342 (cell)
> 720-890-8582 (fax)
> www.jeminnovation.com
> www.pdksolutions.com
>
> [Non-text portions of this message have been removed]
>
>
> 
Use the ADC to measure the primary source voltage. Use a largish-cap  
isolated by a diode. The cap should be big enough to hold up the micro  
long enough to write to the EEPROM. When the ADC tells you that the  
power is "failing", then drop everything and write to the EEPROM.

BOD only tells you after the fact!

Jim Wagner
Oregon Research Electronics



[Non-text portions of this message have been removed]

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.