Pages: [1]   Go Down
Author Topic: Brownout Detection  (Read 1432 times)
0 Members and 1 Guest are viewing this topic.
Hurley, NY
Offline Offline
Jr. Member
**
Karma: 0
Posts: 86
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Here's a question for those who understand AVR chips inside and out.  I've read that these chips have "brownout detection," though I've never found a good reference for how this is supposed to work.  I'm wondering if brownout detection is entirely a hardware thing or if it is a state that can be read and acted upon by software (possibly requiring an end-run around the normal Arduino environment).  Here's why I'm interested:

My current Arduino project has a "shutdown routine" wherein it writes certain data to EEPROM just before it goes dead (this is mostly to keep the EEPROM from being written to too often and exceeding its 100,000 write cycle limit, although it could have other useful features as well, depending on the answer to this question.)

If brownout detection can be read by software, it would be possible for the Arduino to execute its brief shutdown routine whenever power failed, since there is always enough power left in its discharging capacitors for it to run for a few seconds following a power failure.  This brief source of power quickly falls to a level triggering brownout detection and then, if I can read this from software, I run my shutdown routine.  Please tell me if this makes no sense at all.  Thanks!
Logged

Las Vegas, NV
Offline Offline
God Member
*****
Karma: 0
Posts: 507
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Take a look at section 10.5 (page 48) of the mega168 datasheet.

http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf

- Ben
Logged


0
Offline Offline
Newbie
*
Karma: 0
Posts: 44
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Provided you read to the end of the description you will see that the internal brown-out detection looks at the actual Vcc on the CPU and generates an internal reset when it is too low.

To do what you have described you need to monitor the incoming supply BEFORE the capacitors are storing the energy, possibly using one of the multitude of detector/reset generator chips on the market.

John
Logged

Pages: [1]   Go Up
Jump to: