Forum Index
power down detection?

 
Author Message
rpb



Joined: 08 Apr 2009

Posted: 19 December 2009, 3:52 AM    Post subject: power down detection?

anyone know a way of detecting a pending power shutdown?

I want to store the current config ( write a few bytes to eeprom) as the power is coming off reliably?

assume i can hold the vcc bleedoff time constant to something that will slowly (enuf 2 get off a few writes) after flipping the power switch off.

problem is, how to detect early enough to get the bytes out the end of the barrel before device specs are violated, and do it without any significant processing resources (an interrupt?) during normal ops?

ohhh.... and another trivial thing- i already have virtually all the i/o pins committed...

using NATIVE device.
Back to top
dkinzer
Site Admin


Joined: 03 Sep 2005
Location: Portland, OR

Posted: 19 December 2009, 4:42 AM    Post subject: Re: power down detection?

rpb wrote:
problem is, how to detect early enough to get the bytes out the end of the barrel before device specs are violated, and do it without any significant processing resources (an interrupt?) during normal ops?
If you add a large capacitor (sometimes called a "super cap") between the power source and the device, isolated with a diode, you can detect that the power supplying the capacitor has dropped while still having time to do some work.

The size of the capacitor can be determined by the equation I = C * dV/dt, representing the fact that the voltage on a capacitor will decay proportionally to the current being drawn from it. If your circuit consumes 100mA and you can tolerate a 500mV drop for 100mS, you'd need a 20mF capacitor (20,000uF).

That's small for a "super cap". Here is one that is 1F, 50 times that size:
http://www.allelectronics.com/make-a-store/item/CBC-17/1-FARAD-5.5-VOLT-SUPER-CAP-/-/1.html

Of course, if you have no inputs available you're pretty much out of luck.
Back to top
mikep



Joined: 24 Sep 2005
Location: Austin, TX

Posted: 19 December 2009, 5:10 AM    Post subject:

If you have control over how the power is applied then you can implement a "soft" power switch. It works by your application recognizing when the (pushbutton) switch has been activated, doing an orderly shutdown and then turns off the power using a power MOSFET such as Vishay TP0101K. I mention this MOSFET because it is the one I have seen before in this type of application. See page 18-20 in this project: http://www.circuitcellar.com/AVR2004/wentries/A3721.zip.
Back to top
Display posts from previous:   
Page 1 of 1

 



ZBasic Microcontrollers Home
All content Copyright © 2005, 2006, 2007, 2008, 2009, 2010 Elba Corp. All Rights Reserved.
Opinions expressed in posts are those of the author and not necessarily those of Elba Corp.
Powered by phpBB © 2001, 2005 phpBB Group