Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to configure GPIO to save the most energy in STM32 low power mode

2025-01-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

This article will explain in detail how to configure GPIO in STM32 low-power mode to save energy, and the content quality of the article is high, so the editor will share it with you for reference. I hope you will have some understanding of the relevant knowledge after reading this article.

STM32 low-power mode how to configure the most energy-saving GPIO, here summed up four points, personal testing is effective (based on the STM32L011 chip LL library), can reduce hundreds of microamperes. 1 configure unused GPIO as analog input mode GPIO always has an input channel, which can be digital or analog, and if you do not need to read GPIO data, it is configured as analog input first. When programming the Ithumb O port as an analog configuration:

The output buffer is turned off

Schmidt trigger input is disabled, so each analog value of the Imax O pin consumes zero. The output of the Schmidt trigger is forced to a constant value (0).

Pull-up and pull-down resistors are turned off by hardware

Configure the infrequently used GPIO for analog output, as shown in the following routine (LL library):

GPIO_InitStruct.Mode = LL_GPIO_MODE_ANALOG

2 adjust the speed of GPIO

Rise time, fall time and maximum frequency can be configured with GPIOx_OS

The PEEDR register is configured. This adjustment has an impact on EMI (electromagnetic interference) and SSO (simultaneous switching output) because of the high peak switching current. Therefore, it is necessary to balance GPIO performance with noise. Usually the GPIO can be configured in low speed mode, but the serial port with high baud rate needs to be configured in high speed mode, so the rise and fall time of each GPIO signal must adapt to the minimum compatible with the frequency of the related signal and the capacitive load of the circuit board.

Configure the less commonly used GPIO in low-speed mode, as shown in the following routine (LL library):

GPIO_InitStruct.Speed = LL_GPIO_SPEED_FREQ_LOW

three

Disable register clock when GPIO is not in use

If a GPIO group does not need to be used for a long time, disable its clock.

Disable the uncommonly used GPIO register clock, as shown in the following routine (LL library):

LL_IOP_GRP1_DisableClock (LL_IOP_GRP1_PERIPH_GPIOA | LL_IOP_GRP1_PERIPH_GPIOB)

four

Avoid hanging unused pins

When entering low power mode, all pin signals must be connected to the VDD or grounded.

If the GPIO is connected to an external receiver (external component input), you must use PP or PU/PD to force the GPIO signal value.

When the GPIO is connected to the drive (external component output or bus), the driver must provide a valid level (VDD or ground). If the driver level is not defined, you must use PU/PD to force the signal on the GPIO. For practical reasons, use input in low power mode when GPIO is input (analog or digital) in running mode

PU/PD may be easier; when GPIO is output in run mode, output PP is used. This avoids managing changes when entering or exiting stop mode.

Configure the less commonly used GPIO to be high, as shown in the following routine (LL library):

LL_GPIO_SetOutputPin (GPIOA,LL_GPIO_PIN_ALL); LL_GPIO_SetOutputPin (GPIOB,LL_GPIO_PIN_ALL); this is all about how to configure GPIO in STM32 low-power mode to save energy. I hope the above content can be helpful to you and learn more. If you think the article is good, you can share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report