cancel
Showing results for 
Search instead for 
Did you mean: 

Using an STM RTC_OUT line for enabling/disabling the main power MOSFET on a board, which idles in VBAT mode when not in use

TB
Associate III

Hi guys -

I am designing a motor control board around an STM32G474. Main power (for driving the voltage regulators, motor drivers, and ultimately the STM itself) will be provided by a large LiPo. Backup power (VBAT, to keep the RTC on the STM, and its external 32.7680 kHz MEMS oscillator, going when the STM is disconnected from main power) will be from an ML1220 coin cell.

I would like to shut down entirely the main power on the board for extended periods of time. I would like to use the RTC on the STM to enable/disable (using an RTC_OUT line) the main power MOSFET controller (a TI LM74700-Q1) on the board at scheduled times (or, when a restart button is pressed, or when a wakeup signal is received over the LPUART channel), and then to disable this main power MOSFET controller when the motor control board can again be turned off.

For this to work, I think I have two main questions:

  1. When the STM is in VBAT mode, at wake-up time, is the RTC_OUT1 line on the STM sufficiently powerful to enable an external IC (the main power MOSFET controller)? Perhaps this is a question of how much current this STM pin can source when in VBAT mode, versus the peak current that the enable pin on the external IC would require?
  2. When switching the STM from VBAT mode into RUN mode, and then (later) when switching the STM from RUN mode back to VBAT mode, will the RTC_OUT1 line maintain its commanded state, or will it flicker back and forth (during boot, or during a proper shutdown) until the corresponding transition is complete?

Flickering the enable pin of the main power MOSFET controller would clearly be problematical. I have seen some GPIOs on some MCUs not reliably maintain a desired state during boot, so you can imagine why I'm a bit nervous about this entire idea.

Any additional thoughts y'all might have on this general idea, or related web resources you could point me at, would of course be greatly welcomed.

Thanks in advance,

Tom

1 ACCEPTED SOLUTION

Accepted Solutions
TDK
Guru

Ah, okay. So RTC_OUT1 is connected as an alarm which goes high after a certain amount of time. System reset does not affect the RTC domain, and the RTC defines what happens on PC13 if it's configured that way, so likely there is a solution. I bet you could switch that pin from RTC to GPIO keeping its value high once the system sets up. Set the pin as high, and then configure it as GPIO and then un-override its function as an RTC pin.

If you feel a post has answered your question, please click "Accept as Solution".

View solution in original post

8 REPLIES 8
TDK
Guru

Do you want RTC_OUT1 to be driven high even while the device is in VBAT mode? Or just to wake up the device and enable the external power at the same time?

Enable pins are typically very high impedance and even a weak pullup (think 100 kOhm or more) be the STM32 should be sufficient to keep it high.

Would it be a possible to use RTC/LPUART/whatever as the wakeup, and then once the chip is awake, drive a pin high to enable external power?

The various sleep/shutdown modes are very configurable, so likely there is a solution to fit your needs.

If you feel a post has answered your question, please click "Accept as Solution".
TB
Associate III

Hi TDK - I can't get the device out of VBAT mode (i.e., "wake up" the STM) until I power up the main board, which energizes its voltage regulators and provides main power to the STM. So there is a bit of chicken and egg thing going here. When it is time to wake up from VBAT mode (which usually happens on a schedule, due to the RTC on the STM reaching a certain wake time), RTC_OUT1 will need to drive the enable pin to turn on the main power MOSFET controller, and a short time later 3.3V will flow to the STM and it will boot up automatically. RTC_OUT1 needs to maintain a steady value throughout the boot process; I am a bit worried on that point - I don't know whether it fluctuates during boot or not...

TDK
Guru

Ah, okay. So RTC_OUT1 is connected as an alarm which goes high after a certain amount of time. System reset does not affect the RTC domain, and the RTC defines what happens on PC13 if it's configured that way, so likely there is a solution. I bet you could switch that pin from RTC to GPIO keeping its value high once the system sets up. Set the pin as high, and then configure it as GPIO and then un-override its function as an RTC pin.

If you feel a post has answered your question, please click "Accept as Solution".
TB
Associate III

"System reset does not affect the RTC domain" - that is totally what I wanted to hear. 🙂 ok, good, we will go forward with this plan then. Thanks so much for the sanity check!

While I am quite confident it would work in the way you've outlined, why don't you make a preliminary experiment using a Nucleo board (provided VBAT can be brought out on it)?

I believe you always can draw a couple of mA from the pins even in VBAT mode; the question is, whether the output voltage of relatively small coin cell (especially partially depleted) won't drop too much under a sudden relatively heavy load.

JW

Hi JW - thank you so much for your feedback. Yes, we just got our STM32G474 nucleo board and will be attempting to test this out. After checking into my question #1 a bit further, the ML1220 cell can also put out 2 mA (see here: https://www.abcde.de/data/ml1220.pdf) and the enable pin of the TI LM74700-Q1 only requires 0.005 mA (see page 5 of https://www.ti.com/lit/ds/symlink/lm74700-q1.pdf), so from the current perspective I think we are ok. We plan to check and recharge the 3V ML1220 as necessary whenever we are in run mode (from the regulated 3.3V line), so hopefully we will largely avoid substantial depletion of the coin cell. As soon as we are booted, as suggested by TDK, we will convert pin PC13 over to a GPIO (running off main power), and then check the ML1220 and recharge it if necessary.

I do have a bit of concern about voltage levels though (not current capacity). A 3V ML1220 spends most of its operational life at 2.5V +/- 0.1V (see page 4 of https://media.digikey.com/pdf/Data%20Sheets/Panasonic%20Inustrial/ML_Serie.pdf). The LM747 datasheet lists the "enable input high threshold" as 1.06V (min), 2V (typ), 2.6V (max), which is a curiously (and, inconveniently) big range. So if my battery is around 2.5V (or a bit less), and the enable input of a particular LM747 really does require 2.6V to kick in, I could have a problem. Anyway, this is a TI issue, not an STM issue, so I'll take that question up with them (see https://e2e.ti.com/support/power-management/f/196/t/907891).

Did you ever get this to work? I'm faced with the same problem of enabling the main switching regulator when the user pushes the power pushbutton.

Dedicated on-off controllers cost almost as much as an entire MCU! So for now, I've designed a poor man's on-off controller via an external SR latch using a logic IC and some transistors. I'm using AAA batteries, so the current consumption of my on-off controller isn't as critical as when using a coin cell.

It would be great if MCUs would incorporate this sort of on-off control as built-in.

Can you please start a new thread, stating what exactly is your hardware, and what are the expectations.

JW