cancel
Showing results for 
Search instead for 
Did you mean: 

STM32 STOP mode with LCD

MVill.6
Associate II

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

This discussion is locked. Please start a new topic to ask your question.
4 REPLIES 4

"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?

0693W000008xsqBQAQ.png

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.
MVill.6
Associate II

The decrease from 4.8uA to 2.6uA was only due to the fimware modification.

Bye

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 ...

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.
MVill.6
Associate II

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%.