2022-07-13 06:45 AM
In an aplication using STM32L0 I need to enter the STOP mode when I realize the AC mains disappears and the uC must be powered by a battery.
So before entering the STOP I obvioulsy deinit all the peripherals used till then and put the pins in analog mode as suggested. Doing so I have about 4.8uA.
Too much for my applications. So I investigated further and discovered with my great surprise that if I skip:
__HAL_RCC_LCD_CLK_DISABLE();
in HAL_LCD_MspDeInit() things go better I can falls to 2.6uA.
I don't understand why disabling the clock of LCD should take much current!!!
This is what I do;
....
HAL_LCD_Clear(&hlcd);
HAL_LCD_UpdateDisplayRequest(&hlcd);
HAL_TIM_Base_Stop_IT(&htim6);
HAL_I2C_MspDeInit(&hi2c1);
HAL_ADC_DeInit(&hadc);
HAL_TIM_Base_DeInit(&htim6);
HAL_TIM_Base_DeInit(&htim7);
HAL_LCD_DeInit(&hlcd);
GPIO_DeInit (); // Set all the GPIO pins as Analog
HAL_RTCEx_DeactivateWakeUpTimer(&hrtc);
HAL_SuspendTick();
__disable_irq();
HAL_PWREx_EnableUltraLowPower();
HAL_PWREx_EnableFastWakeUp(); // don't change much
__HAL_PWR_CLEAR_FLAG(PWR_FLAG_WU);
HAL_PWR_EnterSTOPMode(PWR_LOWPOWERREGULATOR_ON,PWR_STOPENTRY_WFI);
....
Maybe someone can explain this weird behavoiur?
Thanks
2022-07-13 07:49 AM
"I don't understand why disabling the clock of LCD should take much current"
Is the current being consumed by the STM32 itself, or something external?
2022-07-13 07:52 AM
The decrease from 4.8uA to 2.6uA was only due to the fimware modification.
Bye
2022-07-13 09:15 AM
yes, but what is actually drawing that current?
Is the current being consumed by the STM32 itself, or something external - eg, the LCD?
Is the LCD still powered-up?
maybe you've left microcontroller pins in an "unfortunate" state which causes leakage to other parts of the system ...
2022-07-14 01:12 AM
The step-up LCD controller has been turned off and all the LCD dedicated pins are configured as analog.
The key point is that function: skipping that function and letting the LCD clock ON consumes
decrease unexplainabl by more than 50%.