STM32 power management, stm32 Inverter Power Supply
(1) 3-minute Model
① Sleep mode ② stop mode ③ standby mode
1. Sleep mode: Cortex-M3 kernel (can be understood as the CPU) stop working, CPU power 1.8V, peripherals in the operation, wake up from the original position after execution
2. Shutdown mode: all clocks are stopped, and the CPU power is 1.8V disconnected. After waking up, the system runs from the original position.
3. standby mode: the clock is completely disconnected, and the CPU power is 1.8V. The program is re-executed after waking up.
Image reference:
CPU: Emperor
CPU power 1.8 V: Queen
Peripherals: General
So:
1. Sleep mode: Only the Emperor goes to bed
2. Stop Mode: Emperor, General goes to bed
3. standby mode: the Emperor, the queen, and the general are all sleeping.
(Principle: if the queen does not go to bed, the program can be retained and executed from the original location after being awakened)
(2) program introduction (database functions)
1. Sleep mode
while(1)
{
/* wait interrupt */
LED1( ON );
Delay(0xFFFFF);
LED1( OFF );
LED2( ON );
Delay(0xFFFFF);
LED2( OFF );
LED3( ON );
Delay(0xFFFFF);
LED3( OFF );
__WFI();
}
_ WFI (); enters sleep mode, and the wake-up is interrupted at will. No clock is configured after the wake-up.
2. Stop Mode
①/* Pwr is required to use its peripheral clock */
#include "stm32f10x_pwr.h"
②/* Enable the clock of the Power Management Unit */
RCC_APB1PeriphClockCmd(RCC_APB1Periph_PWR, ENABLE);
③ Enter the Stop Mode
PWR_EnterSTOPMode(PWR_Regulator_LowPower,PWR_STOPEntry_WFI);
④ Wake-up: External interruption
Because the General is asleep (and the peripheral clock is off, it needs to be reconfigured), the HSE needs to be restarted after waking up.
SYSCLKConfig_STOP ();
void SYSCLKConfig_STOP (void)
{
ErrorStatus HSEStartUpStatus;
/ * Enable HSE * /
RCC_HSEConfig (RCC_HSE_ON);
/ * Wait for HSE to be ready * /
HSEStartUpStatus = RCC_WaitForHSEStartUp ();
if (HSEStartUpStatus == SUCCESS)
{
/ * Enable PLL * /
RCC_PLLCmd (ENABLE);
/ * Wait for the PLL to be ready * /
while (RCC_GetFlagStatus (RCC_FLAG_PLLRDY) == RESET)
{
}
/ * Select PLL as the system clock source * /
RCC_SYSCLKConfig (RCC_SYSCLKSource_PLLCLK);
/ * Wait for the PLL to be selected as the system clock source * /
while (RCC_GetSYSCLKSource ()! = 0x08)
{
}
}
}
3. standby mode
①/* Pwr is required to use its peripheral clock */
#include "stm32f10x_pwr.h"
②/* Enable the clock of the Power Management Unit */
RCC_APB1PeriphClockCmd(RCC_APB1Periph_PWR, ENABLE);
③ Enter the standby mode
/ * Enable the wake-up function of the WKUP pin, WKUP is the second function, you don't need to configure its output mode (not too clear) * /
PWR_WakeUpPinCmd (ENABLE);
/ * Enter standby mode * /
PWR_EnterSTANDBYMode ();
④ Wake up, reset wake up, PA0 wake up on the rising edge
⑤ Detect whether to reset and wake up or PA0 on the rising edge
If (PWR_GetFlagStatus (PWR_FLAG_WU) = SET) {printf ("\ r \ n PA0 rising edge wake up \ r \ n ");} else printf ("\ r \ n others \ r \ n ");
Because the standby wake-up program is executed from the beginning, you do not need to configure more clock functions.
STM32 series (Cortex-M3) Power Control Research graduation design, a variety of guidance, I am white
First, is the single-chip microcomputer controlled by STM32 defined by the teacher or selected by myself? I think power control over STM32 is too cool. A lot of stc 51 can do well, just select an AD. You said speed? No problem! What if your instructor asked you to use STM32? Then I'm speechless. I can only say that your mentor really has a bit of brains...
Then, in a variety of circumstances, choose STM32 to complete the configuration, now the time is almost the same, I am buying a piece of STM32
Learning board, of course, let's talk about it.
Finally, I learned it by myself. I guess your program is certainly not difficult. Big deal with STM32 for sampling, and then feedback control. Add at most one screen for UI, or a low-level digital tube (it is estimated that the teacher loves this port, with screen, he does not understand ).
Is the STM32 Power Supply connected internally?
I also met, the 64-pin encapsulation is also like this, but not all connections, one of them is isolated