STM32l476 LOW POWER DESIGN - Part 1:Power scaling
Overview:
The STM32L476 is a low-power MCU based on the ARM Cortex-M4 architecture. A single-precision floating point unit (FPU) in the Cortex-M4 core supports all Arm® single-precision data-processing instructions and data types. It also has a complete set of DSP instructions and a memory protection unit (MPU) to boost programme security. It is ideal for ultra-low power applications. This blog aims to demonstrate to you the low-power design of the STM32L476 controller. We will use STM32l476 Nucleo Board and CUBE MX environment for project setup as our power measurement tool is Nordic Power Profile kit 2.
STM32L476 Low Power Features:
Will test these low-power features to see how they affect power consumption. This is the first phase, which will focus on power scaling. In subsequent posts, I will go into the low-power modes and other features.
Power Profiler Kit II:
The Power Profiler Kit II (PPK2) is a low-cost, flexible instrument for measuring your designs' real-time power usage. The PPK2 monitors power consumption by either powering the external board or acting as an ampere metre. It monitors current from 500 nA to 1 A and provides a thorough picture of the user application's current profile.
For more details on Nucleo Board and Power Profiler Kit 2 please refer to the datasheet links provided at the end of the blog, also visit the GitHub page for the firmware files.
Hardware details:
- Target Board: Nucleo-l476RGV
- Power Measurement Tools: Nordic Power Profile Kit 2
STM32L476 Power Supply Overview:
image source: https://www.st.com/resource/en/datasheet/stm32l476je.pdf
The internal digital power VCORE is supplied via an inbuilt linear voltage regulator. The power supply for digital peripherals and memories is known as VCORE.
Voltage Regulator
Except for the Standby circuitry and the backup domain, all digital circuitries are powered by two inbuilt linear voltage regulators. The software can tune the main regulator output voltage (VCORE) to two different power ranges (Range 1 and Range 2) to minimise consumption based on the system's highest operating frequency.
Depending on the application mode, the VCORE supply is given by either the main regulator (MR) or the low-power regulator (LPR).
- Both regulators are enabled in Run, Sleep, and Stop 0 modes, and the main regulator (MR) gives full power to the VCORE domain (core, memories and digital peripherals).
- The main regulator is turned off in low-power run and low-power sleep modes, and the low-power regulator (LPR) feeds low power to the VCORE domain while keeping the contents of the registers, SRAM1 and SRAM2.
- In Stop 1 and Stop 2 modes, the main regulator is off and the low-power regulator (LPR) supplies low power to the VCORE domain, preserving the contents of the registers, SRAM1 and SRAM2.
- In Standby mode, with SRAM2 content retained (the RRS bit set in the PWR CR3 register), the main regulator (MR) is turned off, and the low-power regulator (LPR) supplies only SRAM2. The core, digital peripherals (with the exception of standby circuitry and backup domain), and SRAM1 are all turned off.
- Both regulators are turned off in Standby mode. Except for the Standby circuitry and the backup domain, the contents of the registers, SRAM1 and SRAM2 are lost.
- In Shutdown mode, both regulators are powered off. When exiting from Shutdown mode, a power-on reset is generated. Consequently, the contents of the registers, SRAM1 and SRAM2 are lost, except for the backup domain.
Dynamic voltage scaling management:
Dynamic voltage scaling is a power management technique which consists of increasing or decreasing the voltage utilised for the digital peripherals (VCORE), according to the application performance and power consumption needs.
Dynamic voltage scaling to increase VCORE is known as over-volting. It allows for improvement in the device's performance.
Dynamic voltage scaling to decrease VCORE is known as under-volting. It is performed to save power, particularly in laptops and other mobile devices where the energy comes from a battery and is thus limited.
The main regulator has two configurable voltage ranges, which are outlined below:
- Range 1: High-performance range
- Range 2: Low-power range
write and erase operations are still available.
Now let's implement the dynamic voltage scaling methods and will check the measurements will create a project using Cube MX Tool and build the project in cube ide.
The user-led connected to PA_5 on the Nucleo board will be used to blink in seconds interval and also will print some messages on the UART.
The clock source is selected HSI (High-Speed Internal) which will provide the 16Mhz clock to the CPU Core. As we are using a Nucleo board input supply is 5Vs.
First will check the power consumption in Range 1 then Range 2.
As we can see in the above image when we are operating the CPU in range 1 in RUN Mode we are getting an average current of 3.98ma. Also in between, we can see the current is getting dropped due to delays introduced in LED's toggling.
Let's set the CPU in Range 2 by utilising the HAL API, as illustrated below.
/** Configure the main internal regulator output voltage
*/
if (HAL_PWREx_ControlVoltageScaling(PWR_REGULATOR_VOLTAGE_SCALE2) != HAL_OK)
{
Error_Handler();
}
Note: For the entire firmware please don't forget to visit the GitHub link provided at the bottom of the page.
The above API will be called inside SystemClock_Config() function.
As we can see the average currents get a drop to 3.6ma as we shift the regulator output voltage in Range 2.
Now let's try to offload the CPU means we don't blink the LEDs and stop the UART Transmitting and basically will exclude the peripherals to check only the CPU Core consumption in RUN Mode. Just will comment LED blinking and UART Transmit part from the code.
As we see in the above image the current comes to around 2.2ma when we stop using the Peripherals.
To reach a conclusion, we can compare the measured values with the CUBE MX Tool. In CUBE MX Tool there is a power calculator tool where we can calculate the power consumption for our application. By selecting the appropriate configurations and system peripherals.
Thank You to visit our blogs in further parts will check the different sleep modes of the STM32L476 and also see more ways to reduce the power consumption of the MCU like clock gating etc.
References:
Comments
Post a Comment