STM32 Learning Note Standby Wakeup

Source: Internet
Author: User
Tags reset


Turn on STM32 's Chinese reference Manual, with detailed labeling of the STM32 low-power mode.

1, sleep mode (CORTEX™-M3 core stop, all peripherals including cortex-m3 core peripherals, such as Nvic, System clock (SysTick) and so on are still running)

2. Stop mode (all clocks are stopped)

3, Standby mode (this is a detailed description of the model, but also the lowest power mode)


In this blog, we use the rising edge of the wkup pin to wake up the MCU, so we'll cover the implementation of standby wakeup in detail:


So how do we get into Standby mode, and how to wake up again.



The following three steps are described below:

1, COTEX_M3 System control register in the Sleepdeep bit:



2. PDDs bit in power control register (PWR_CR): Bit of register:



3. Ewup bit in power control/status register (PWR_CSR)

At this point, we have completed the task of entering standby mode through these three steps,





Continue to the exit Standby mode: or the picture above:

Here we use one of the ways to wake up: The rising edge of the wkup pin wakes up.


The specific program references the wake-up experiment code of the Atom brother.

switch from normal operation mode to Standby mode: Press and hold the Wkup key external interrupt 0 interrupt is triggered execution interrupt service function check_up () function starts detection if time does not exceed 3s return 0 then work in normal operation mode if hold time exceeds 3s return value is 1 enter Standby mode Our program at the beginning of the operation is not a button pressed, so there is no rising edge, the initialization function in the condition is established, thus entering the standby mode.


switch from Standby mode to normal operation mode: The moment you hold the Wkup key will have a rising edge while this rising edge performs a wake-up function but does not perform an external interrupt 0 interrupt service function in standby mode The CPU is not working Code execution from standby mode is equivalent to post-reset execution, so the program executes again from the beginning (which is important) and then executes to the CHECK_UP () function to detect if the time of the keyboard is not more than 3s or if it is in standby mode to join more than 3s return value of 1 condition is not established will switch to normal mode so the conclusion is that the interrupt service of the external interrupt 0 will not run from start to finish when the standby mode is switched to normal mode of operation. Remember: Wake up just said to need to rise along, and did not say to enter the interrupt,


So the effect of the implementation is:

1, if it is normal operation, first execute the interrupt program, determine whether 3 seconds, decide whether to standby.
2, if the standby state, the first reset and initialization, determine whether 3 seconds, determine whether to power on.


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.