cancel
Showing results for 
Search instead for 
Did you mean: 

GPIO current in Standby mode

BKarl
Associate II

I try to run a LED with GPIO during Standby-mode. The GPIO Pin is configured as pull-up.

When the MCU changes form Run-mode to Standby-mode the LED brightness reduces.

The voltage is constant, so I think there is not enough current provided.

Is it possible to configure the GPIO current availability in Standby-mode ?

Or am I making another mistake?

Hardware:

EVAL- Board: Nucleo STM32L476RG

Circuit connection: PB13(GREEN_EN_Pin) --> LED --> resistor --> GND

Code:

 /*Configure GPIO pin : GREEN_EN_Pin */

 GPIO_InitStruct.Pin = GREEN_EN_Pin;

 GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;

 GPIO_InitStruct.Pull = GPIO_PULLUP;

 GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;

 HAL_GPIO_Init(GREEN_EN_GPIO_Port, &GPIO_InitStruct);

HAL_GPIO_WritePin(GPIOB, GREEN_EN_Pin, GPIO_PIN_SET);

HAL_PWREx_EnableGPIOPullUp(PWR_GPIO_B, GREEN_EN_Pin);

HAL_PWREx_EnablePullUpPullDownConfig();

//go to Standby

HAL_RTCEx_DeactivateWakeUpTimer(&hrtc);

__HAL_PWR_CLEAR_FLAG(PWR_FLAG_WU);

__HAL_PWR_CLEAR_FLAG(PWR_FLAG_WU);

HAL_RTCEx_SetWakeUpTimer_IT(&hrtc, 10000, RTC_WAKEUPCLOCK_RTCCLK_DIV16);

HAL_PWR_EnterSTANDBYMode();

thanks

regards

Bernhard

3 REPLIES 3
Uwe Bonnes
Principal III

On most ST families, GPIO gets high-z when in standby. Some families have registers to control standby behaviour. Reread the reference manual regarding GPIO.

Tomas SIRUCEK
Associate II

Hi,

like was mentioned before, pins go to high impedance state in standby mode on most ST microcontrollers. But pins keep their pull resistor settings in standby. And since You activated pull-up on that pin, when in standby pin goes from OUTPUT to HI-Z, but PULL-UP stays. That is why You LED is still ON, but with lower brightness, because pull resistors have much higher resistance then switching transistors.

I hope it is clear now. Have a nice day.

BKarl
Associate II

yes now it is clear, thank you very much