Turn-on circuitry: MCU startup time too long

Thread Starter


Joined Feb 23, 2016

This is my first post to AAC. I'm excited to get involved in such a cool community.

So I'm developing on an STM32F410RB Nucleo and have a need for a simple, pushbutton on/off switch for my project.

I'd like the pushbutton to be the single on/off switch, however the system will also need to be able to turn itself off. I would like to use a single power regulator for the whole system which include the MCU and plenty of power-hungry auxiliary components.

I was looking at latches and flip-flops that could sit above the power regulator, however I finally went with a simple design that works as follows (see schematic below):

- Initial pushbutton grounds series resistors (voltage divider) that lowers voltage on a P-FET that sits at battery voltage.
- this closes the FET and supplies Vbat to the power regulator (30v to 3V3)
- power regulator supplies voltage to MCU and aux components.
- first command for MCU is to push a GPIO high (for the purpose of latching the power on)
- the GPIO drives an N-FET that keeps the series resistor / voltage divider flowing which keeps the voltage low on the P-FET (keeps it closed).
- MCU chooses to stop GPIO and cut power anytime or when the external interrupt from another press of the pushbutton comes in (external interrupt on separate pin, parallel to first press circuitry).

I've tested the above process and it works well, however the MCU takes time to turn on and reach that first command in the main loop.

I'm having to wait 4-6 seconds before the MCU drives that GPIO to latch power on. This is obviously way too long to expect a user to hold the power on button.

I'm not sure if this is the minimum boot/start up time for an MCU or if that can be reduced.

Any information or help on the subject of getting an MCU to execute main loop quicker upon power-on would be greatly appreciated.

Thank you!




Joined Mar 14, 2008
Without seeing the program, it's difficult to suggest how to speed up the GPIO output.
What is the processor doing before it gets to the main program loop?

I don't see how your push-button (at JP7) can turn off the power. :confused:


Joined Jun 7, 2009
does your regulator not have an enable? It might be easier on your components to disable the regulator rather than switching power. Have you calculated your reset circuits time constant? The rest will be in programmatic control.


Joined Apr 24, 2011
I've done this with a regulator with an enable, it works well, but my controller is a Microchip PIC that turns on in a microsecond. Faster actually. The button is diode or-ed with a I/O pin, with some other things as the button was still needed for input as well as power, so the user never knew it was turning itself off.

One simple thing you could add is a capacitor that keeps R81 low for a while. You will be driving Q13 into the active (hi power) region for extended time so beware of that.

I give this thread another hour or so until someone suggests a '555.