Gpio Software Guidelines For Power Optimization; Configure Unused Gpio Input As Analog Input; Adapt Gpio Speed; Disable Gpio Register Clock When Not In Use - ST STM32 Application Note

Microcontroller gpio hardware settings and low-power consumption
Hide thumbs Also See for STM32:
Table of Contents

Advertisement

AN4899
7

GPIO software guidelines for power optimization

7.1

Configure unused GPIO input as analog input

GPIO always have an input channel, which can be either digital or analog.
If it is not necessary to read the GPIO data, prefer the configuration as analog input. This
saves the consumption of the input Schmitt trigger.
7.2

Adapt GPIO speed

The rise time, fall time and maximum frequency are configurable using the
GPIOx_OSPEEDR configuration register. Such adjustment has an impact on the EMI
(electromagnetic interferences) and SSO ( simultaneous switching output) due to higher
switching current peak. A compromise has to be done between GPIO performance versus
noise. The rise time and fall time of each GPIO signal must be adapted to the minimal value
compatible with the associated signal frequency and board capacitive load.
In order to help users to control the signal integrity in their applications, the IBIS model of
the selected STM32 GPIO pin is available and can be downloaded from STMicroelectronics
web site at www.st.com.
7.3

Disable GPIO register clock when not in use

If a GPIO bank does not need to be used for a long period, disable its clock by using the
HAL_RCC_GPIOx_CLK_DISABLE() function.
7.4

Configure GPIO when entering low-power modes

When entering low-power mode, all pin signals must be tied either to V
If the GPIO is connected to an external receiver (external component input), the GPIO
signal value must be forced using either a PP or a PU/PD.
When the GPIO is connected to a driver (external component output or bus), the driver must
provide a valid level (either V
GPIO must be forced by using PU/PD.
For practical reasons, it may be easier to use input PU/PD in low-power mode when the
GPIO is an input (analog or digital) in Run mode; and output PP when the GPIO is an output
in Run mode. This avoids to manage the changes when entering or exiting Stop modes.
7.5

Shutdown exit mode

Note:
This section applies only to the microcontrollers in the STM32L4 Series, STM32L4+ Series,
STM32L5 Series, and STM32U5 Series.
When exiting from Shutdown mode, the GPIOs are reconfigured to their default values at
Power On Reset. This can create extra system consumption before they can be
reprogrammed to their correct value. If this is an issue for the application, the Standby mode
must be used instead of the Shutdown mode.
GPIO software guidelines for power optimization
or ground). If the driver level is undefined, the signal on the
DD
AN4899 Rev 3
or to ground.
DD
27/31
30

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the STM32 and is the answer not in the manual?

Table of Contents