emergency shut down power supply

Go To Last Post
2 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I'm thinking about implementing a data acquisition system for recording very rare events over a long time span. I'd like to make it robust in the event of power failure (whether deliberately cut by the user or due to some unexpected event.) Options for storing the data include some form of external flash memory (e.g. SD card), the uC's own unused flash memory and the uC's EEPROM.

The questions I have are:

1. Am I correct in understanding that the EEPROM may be written one byte at a time?

2. An SD card or the AVR's flash memory has to be written to a block at a time (correct?).

(I'm trying to figure out if I can write event data immediately as they occur or if I have to buffer it.)

3. What ideas would you suggest for detecting that the main power has failed and switching over to a short-term backup supply (like a cap, perhaps)? The backup supply would only have to power the AVR long enough so it could save any unsaved data to the nonvolatile memory.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Both #1 and #2 are correct; EEPROM is byte-addressed, while the SD card uses block transfers of 512 bytes. However, since modern SD cards have ungodly amounts of blocks in them, you might still be able to use the SD card as the events occur - just store one event per block and you'll still have plenty of space.

As for #3, there have been a few threads on that in the past. I think one of the solutions did involve a cap, plus a low-drop diode to isolate the supply once the power is cut. From there, I think the supply-side was connected to an external interrupt pin or ADC for monitoring.

- Dean :twisted:

Make Atmel Studio better with my free extensions. Open source and feedback welcome!