|
|
View previous topic :: View next topic |
Author |
Message |
John5788
Joined: 08 Apr 2009 Posts: 9
|
PIC24H, retain pin state after power off? |
Posted: Fri Aug 07, 2009 4:28 pm |
|
|
Is there a way for the pins to retain their states after the power goes off on the device?
Ex: I do an output_low(PIN_A1), next the power gets cut off. I'd like to see the continuity between PIN_A1 and ground when I check with multimeter.
should I just do a soft pulldown to ground in hardware to get the desired affect? my goal is to turn a specific circuit on after the power has been cut, using a PNP transistor. |
|
|
bkamen
Joined: 07 Jan 2004 Posts: 1615 Location: Central Illinois, USA
|
|
Posted: Fri Aug 07, 2009 10:33 pm |
|
|
You would have to do an interrupt that's somehow connected to the power input letting you know power was about to keel over.
With the interrupt, you'd save the current state of the pins for the next power up.
The last time I saw this, the input to the interrupt was the INPUT of the local voltage regulator (divided down with protection for the interrupt input)... the regulator had a nice big cap on it to keep the CPU going just long enough so the interrupt could fire, the settings could save and life would be good.
In the case of a PIC, this could be the LowVoltage Detection input or INT0
how's that get you started?
-ben _________________ Dazed and confused? I don't think so. Just "plain lost" will do. :D |
|
|
Ttelmah Guest
|
|
Posted: Sat Aug 08, 2009 5:01 am |
|
|
Power off, no.
The answer already posted, is talking about how to have the chip _re-start_ to the same condition as when power was removed.
The fets, that give the outputs on the PIC, need voltages to drive their gates. Remove the voltages, and they go off. There will be clamping effects from the diodes inside the chip, but not what was being output on the pins. No normal solid state output, can keep it's state without voltage being present. In some cases, you can get this 'effect', by having capacitors inside the device to hold the required voltage, but for normal electronics, the voltage needs to be there.
So, PIC outputs need voltage to work. However _power_ drawn by the PIC, is dependant on the speed the chip is being clocked. You can basically stop the clock on a PIC, leave voltage applied to it and it's outputs, will hold their programmed state. Current drawn like this, falls to nA. You can power a PIC, with it's clock basically stopped, for years, off a small lithium cell. This is the heart of the 'sleep' operation of the PIC.
So, 'power off' (removing the supply from the PIC), no. However 'power down' (making the PIC almost stop using any power), yes. This is how PICs are run in devices like TV remote controls. Sitting with their clock 'stopped', till they see an input change.
Best Wishes |
|
|
Guest
|
|
Posted: Sat Aug 08, 2009 8:20 am |
|
|
You can use a latching relay to keep the state with power removed - or some scheme with external FET's and a super Capacitor or battery to keep drains high or low when the normal power is removed.
HTH - Steve H. |
|
|
bkamen
Joined: 07 Jan 2004 Posts: 1615 Location: Central Illinois, USA
|
|
Posted: Sat Aug 08, 2009 11:12 am |
|
|
Anonymous wrote: | You can use a latching relay to keep the state with power removed - or some scheme with external FET's and a super Capacitor or battery to keep drains high or low when the normal power is removed.
|
Latching relays -- such a blast! but those would work too! :D _________________ Dazed and confused? I don't think so. Just "plain lost" will do. :D |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|