evanwi92
Electrical
- Feb 23, 2016
- 4
Hi,
It's my first post on here. Thanks for the support!
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 attached schematic):
- 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.
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!
Evan
It's my first post on here. Thanks for the support!
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 attached schematic):
- 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.
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!
Evan