2020-04-22 01:18 AM
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
2020-04-22 02:17 AM
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.
2020-04-23 11:51 AM
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.
2020-05-02 09:43 AM
yes now it is clear, thank you very much