This article will verify the low power consumption current of STM32L32 in stop mode.
The STM32L152RE chip introduction on the ST official website clearly states that this chip can reach 560nA in stop mode, nanoamperes! And it can also support 16 external interrupt wake-up.
It’s really that powerful! Let’s verify it below.
The NUCLEO-L152 board is used for verification, and CubeMx is used to generate engineering code.
Select the STM32L152RE chip in CubeMx and set the pinout as follows:
As shown in the figure above, simply set PC13, PB9, PB5, PB4, PD2, PA12, PB15, and PB1 as external interrupts.
In order to achieve the lowest power consumption, the clock tree uses the chip's internal clock HSI:
Under configuration, set all GPIO to pull-down, PC13 is a button on the NUCLEO board, set it to pull-up.
Generate code. The main function is slightly modified:
int main(void)
{
/* USER CODE BEGIN 1 */
/* USER CODE END 1 */
/* MCU Configuration----------------------------------------------------------*/
/* Reset of all peripherals, Initializes the Flash interface and the Systick. */
HAL_Init();
/* Configure the system clock */
SystemClock_Config();
/* Initialize all configured peripherals */
MX_GPIO_Init();
/* USER CODE BEGIN 2 */
HAL_PWREx_EnableUltraLowPower();
HAL_PWREx_EnableFastWakeUp();
/* USER CODE END 2 */
/* Infinite loop */
/* USER CODE BEGIN WHILE */
while (1)
{
/* USER CODE END WHILE */
/* USER CODE BEGIN 3 */
HAL_PWR_EnterSTOPMode(PWR_LOWPOWERREGULATOR_ON, PWR_STOPENTRY_WFI);
/* Configures system clock after wake-up from STOP: enable HSI, PLL and select
PLL as system clock source (HSI and PLL are disabled automatically in STOP mode) */
SystemClockConfig_STOP();
HAL_Delay(200);
}
/* USER CODE END 3 */
}
The SystemClockConfig_STOP function is configured as follows:
static void SystemClockConfig_STOP(void)
{
RCC_ClkInitTypeDef RCC_ClkInitStruct = {0};
RCC_OscInitTypeDef RCC_OscInitStruct = {0};
/* Enable Power Control clock */
__HAL_RCC_PWR_CLK_ENABLE();
/* The voltage scaling allows optimizing the power consumption when the device is
clocked below the maximum system frequency, to update the voltage scaling value
regarding system frequency refer to product datasheet. */
__HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1);
/* Poll VOSF bit of in PWR_CSR. Wait until it is reset to 0 */
while (__HAL_PWR_GET_FLAG(PWR_FLAG_VOS) != RESET) {};
/* Get the Oscillators configuration according to the internal RCC registers */
HAL_RCC_GetOscConfig(&RCC_OscInitStruct);
/* After wake-up from STOP reconfigure the system clock: Enable HSI and PLL */
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI;
RCC_OscInitStruct.HSEState = RCC_HSE_OFF;
RCC_OscInitStruct.HSIState = RCC_HSI_ON;
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSI;
RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT;
RCC_OscInitStruct.PLL.PLLMUL = RCC_PLL_MUL6;
RCC_OscInitStruct.PLL.PLLDIV = RCC_PLL_DIV3;
if(HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)
{
Error_Handler();
}
/* Select PLL as system clock source and configure the HCLK, PCLK1 and PCLK2
clocks dividers */
RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_SYSCLK;
RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
if(HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_1) != HAL_OK)
{
Error_Handler();
}
}
After compiling and burning, use the ammeter to test:
0.3uA! It seems that what he said is true, 300nA, press the button and find that the current becomes larger, as shown below:
The current becomes 11mA, which is the working current, indicating that the external interrupt is effective.
The STM32L152 is really good in terms of low power consumption! The measured current in stop mode is 300nA, which is lower than the 560nA shown in the manual. It seems that ST is still relatively conservative.
Previous article:How to use CubeMx to create a file system project based on SD card
Next article:STM32L152 IAP transplantation notes
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- What is the difference between Solder Mask and Paste Mask?
- Xiaomi Mijia Electric Toothbrush Disassembly
- Blood pressure monitor principle
- EEWORLD University ---- Fuse types and tests
- 【New Year's Festival Competition】Photo Summary
- [Littelfuse Live Review] SiC MOSFET and Schottky Diode Product Introduction and Related Applications (including PPT, QA)
- LCD segment screen photolithography is bad---floating glue
- Share Keil's background color and font configuration files and VS Code
- Arm Cortex-M low power modes basics
- I would like to ask you about the problem when starting MINI6410