Author Topic: Micro, Switcher, and self shut down  (Read 2901 times)

0 Members and 1 Guest are viewing this topic.

Offline mcTopic starter

  • Regular Contributor
  • *
  • Posts: 155
  • Country: scotland
Micro, Switcher, and self shut down
« on: May 22, 2012, 11:37:44 am »
Just need a quick sanity check here.

My latest project design uses 2 LiPos, a TI TPS54231 switcher to provide 5V from the LiPos, and an ATmega (exact model not decided yet).
What I'm aiming is as complete power down as possible, when the Atmega is told to power off. My main reason is I want this to be a sealed unit without any manual switch, to avoid accidental power offs, and it's likely to lie unused for several months at a time, so I don't want the LiPos to drain if not kept charged.

The TPS54231 has an EN pin, that when pulled below 1.25V places it into shutdown, with power use in the uA range. So if I tie the EN pin to ground via a resistor it remains in shut down.
To power up, I have a push switch that connects LiPo power to the EN pin via a resistor (value selected to avoid the EN being pulled above the maximum allowed 5V), which pulls the EN pin above 1.25 and the TPS54231 wakes and puts out 5V.
This powers up the ATmega, which is then programmed to apply power to the EN pin.

At power off, the ATmega removes power from the EN pin, and the TPS54231 enters shutdown.
Even if the ATmega power down isn't clean, it should enter reset, which places it's pins in Hi-Z/Tri-state, so shouldn't power the TPS backup.

Now in my mind that all sounds like it will work, however have I missed anything?
 

Offline Psi

  • Super Contributor
  • ***
  • Posts: 10270
  • Country: nz
Re: Micro, Switcher, and self shut down
« Reply #1 on: May 22, 2012, 12:16:57 pm »
Sounds perfectly fine to me.

You will want to enable the atmega watchdog timer and brownout detector.
Then when the ATMega starts have it wait 40ms before setting output high to the EN pin.
(short enough to expire while the finger is still on the button but a long time in electrical terms)
This way, if the watchdog or brownout activate at any point during operation the 40ms will give some time for the TPS54231 to shutdown and voltage to dissipate without the micro starting up again and re-enable the EN pin.

To get a clean reset when you want to shutdown on purpose, just deliberately let the watchdog fail.


Another separate issue, some lithium batteries have awful self discharge rates. So you don't want to get cheap china ones.
I have a extended laptop battery made of them.

It works really well for powering the laptop. I get 6 hours at idle with screen on!
But... If i charge the battery up to 100% and remove it from the laptop for a month it will self discharge down to 50% in that time.
« Last Edit: May 22, 2012, 12:44:08 pm by Psi »
Greek letter 'Psi' (not Pounds per Square Inch)
 

Offline mcTopic starter

  • Regular Contributor
  • *
  • Posts: 155
  • Country: scotland
Re: Micro, Switcher, and self shut down
« Reply #2 on: May 22, 2012, 06:22:52 pm »
Cheers for the check, and suggestions.
I've spent more time on figuring out power supplies for this project, than I have writing code for it now, so it's good be finally getting the hardware design dealt with.

As for the LiPo's, I'm not too worried about self-disharge, as they'll get charged before being used. I'm more worried about things not powering down correctly, as this project may sit unused for several months at a time, so I don't want the batteries to die due to being over-discharged from something not shutting down correctly.
 

Offline Psi

  • Super Contributor
  • ***
  • Posts: 10270
  • Country: nz
Re: Micro, Switcher, and self shut down
« Reply #3 on: May 22, 2012, 11:36:10 pm »
I would probably use lithium batteries with a build in over/under charge protection circuit.
Easy to get and simple.
Greek letter 'Psi' (not Pounds per Square Inch)
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf