cancel
Showing results for 
Search instead for 
Did you mean: 

LCD Driver Consuming more power in stop 2 mode

Sumukha
Associate II

Post edited by ST moderator to be inline with the community rules especially with the code sharing. In next time please use </> button to paste your code. Please read this post: How to insert source code

The LCD Driver in stm32u083rc is consuming more power in stop 2 mode, it is taking more current at every interval (interval is of refresh rate , if refresh rate is 128Hz then the spikes come at  (1/128 = 7.8ms))

currently we are entering low power mode like this 

void lowpwrmode_EnterLowPowerMode (void)
{
// LOG_INFO_UART("Entering Stopmode2 \r \n");
HAL_CRC_MspDeInit(&hcrc); //CRC
HAL_SPI_MspDeInit(&hspi1); //SPI
HAL_CRYP_MspDeInit(&hcryp); //AES
HAL_UART_MspDeInit(&hlpuart2); //LPUART
HAL_LPTIM_MspDeInit(&hlptim3); //Buzzer
HAL_DAC_MspDeInit(&hdac1); //DAC
HAL_I2C_MspDeInit(&hi2c2); //I2C

//SysTick Timer
HAL_SuspendTick();

//CLear Wakeup Flags
__HAL_PWR_CLEAR_FLAG(PWR_FLAG_WU);
    
HAL_PWREx_EnablePullUpPullDownConfig();

//Disable Debug
HAL_DBGMCU_DisableDBGStopMode();
HAL_PWREx_EnableUltraLowPowerMode();

//Enter Stop2 Mode
HAL_PWREx_EnterSTOP2Mode(PWR_STOPENTRY_WFI);

HAL_ResumeTick();
// HAL_I2C_MspInit(&hi2c2);
custom_StopGpioInit();
HAL_GPIO_WritePin(GPIOC, GPIO_PIN_3, GPIO_PIN_SET); // LDO Enable

// HAL_GPIO_WritePin(GPIOA, Flash_PWR_Pin, GPIO_PIN_SET); // Flash PWR
// HAL_GPIO_WritePin(GPIOB, WP_Pin, GPIO_PIN_SET); // WP Pin

}  
 
the below i have attached the power consumption in graph we can see the spikes clearly
 
5 REPLIES 5
Sumukha
Associate II

Post edited by ST moderator to be inline with the community rules especially with the code sharing. In next time please use </> button to paste your code. Please read this post: How to insert source code

I am using stm32u083rc and using stop2 mode, clock for LCD is LSE (32.768 KHz) no backlight, and we need LCD to be On all the time, we cannot disable it , currently in stop2 mode the base average current with LCD enabled is 5.7uA, and with LCD Disabled the current is 2uA. so because of those spikes when LCD is enabled it is increasing the base current to 5.7uA. we are keeping LSE on during stop2 mode. we are putting unused GPIO to analog mode and driving necessary pins to known levels using pullup or pulldown during stop mode .

The major doubt is regarding the current spikes going up-to 20-25uA based on the refresh rate interval selected for LCD ( though the average current is 5-6uA only)

the current configuration of LCD is 

void MX_LCD_Init(void)
{

/* USER CODE BEGIN LCD_Init 0 */

/* USER CODE END LCD_Init 0 */

/* USER CODE BEGIN LCD_Init 1 */

/* USER CODE END LCD_Init 1 */
hlcd.Instance = LCD;
hlcd.Init.Prescaler = LCD_PRESCALER_16;
hlcd.Init.Divider = LCD_DIVIDER_16;
hlcd.Init.Duty = LCD_DUTY_1_4;
hlcd.Init.Bias = LCD_BIAS_1_3;
hlcd.Init.VoltageSource = LCD_VOLTAGESOURCE_INTERNAL;
hlcd.Init.Contrast = LCD_CONTRASTLEVEL_0;
hlcd.Init.DeadTime = LCD_DEADTIME_0;
hlcd.Init.PulseOnDuration = LCD_PULSEONDURATION_1;
hlcd.Init.BlinkMode = LCD_BLINKMODE_OFF;
hlcd.Init.BlinkFrequency = LCD_BLINKFREQUENCY_DIV1024;
hlcd.Init.MuxSegment = LCD_MUXSEGMENT_DISABLE;
if (HAL_LCD_Init(&hlcd) != HAL_OK)
{
Error_Handler();
}
/* USER CODE BEGIN LCD_Init 2 */

/* USER CODE END LCD_Init 2 */

}
Sumukha
Associate II

Screenshot 2025-09-30 101723.png

Screenshot 2025-09-30 101935.png

  

Hello @Sumukha ,

If you are using a STM32U0 device why are you posting it in MPU forum?

This thread needs to be moved to the correct forum board.

And please use </> to share your code.

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.
Sumukha
Associate II

Merged threads. Please don't duplicate threads for the same question.

 

Hi everyone,
I’m working on an STM32U083RC and facing a low-power issue related to the LCD driver when the MCU is in STOP2 mode.

USE CASE

  • The LCD must remain ON all the time — we cannot disable it during STOP2 mode.

  • The LCD clock source is LSE (32.768 kHz).

  • No backlight is used.

  •   All unused GPIOs are configured in analog mode.

  • The required pins are driven to known levels (with pull-ups or pull-downs) during STOP2 mode.

  • LSE is kept ON during STOP2.

Current Consumption at base average current

  • STOP2 with LCD Disabled: ~2 µA average

  • STOP2 with LCD Enabled: ~5.7 µA average

  • When LCD is enabled, there are current spikes of 20–25 µA at regular intervals (depending on the LCD refresh rate).

    • For example, with a refresh rate of 128 Hz, spikes occur approximately every 7.8 ms (1/128).

  • The base current increase is mainly due to these spikes. 

 

//LCD Configuration
void MX_LCD_Init(void)
{
    hlcd.Instance = LCD;
    hlcd.Init.Prescaler = LCD_PRESCALER_16;
    hlcd.Init.Divider = LCD_DIVIDER_16;
    hlcd.Init.Duty = LCD_DUTY_1_4;
    hlcd.Init.Bias = LCD_BIAS_1_3;
    hlcd.Init.VoltageSource = LCD_VOLTAGESOURCE_INTERNAL;
    hlcd.Init.Contrast = LCD_CONTRASTLEVEL_0;
    hlcd.Init.DeadTime = LCD_DEADTIME_0;
    hlcd.Init.PulseOnDuration = LCD_PULSEONDURATION_1;
    hlcd.Init.BlinkMode = LCD_BLINKMODE_OFF;
    hlcd.Init.BlinkFrequency = LCD_BLINKFREQUENCY_DIV1024;
    hlcd.Init.MuxSegment = LCD_MUXSEGMENT_DISABLE;

    if (HAL_LCD_Init(&hlcd) != HAL_OK)
    {
        Error_Handler();
    }
}
//entering low power mode 
void lowpwrmode_EnterLowPowerMode(void)
{
    HAL_CRC_MspDeInit(&hcrc);
    HAL_SPI_MspDeInit(&hspi1);
    HAL_CRYP_MspDeInit(&hcryp);
    HAL_UART_MspDeInit(&hlpuart2);
    HAL_LPTIM_MspDeInit(&hlptim3);
    HAL_DAC_MspDeInit(&hdac1);
    HAL_I2C_MspDeInit(&hi2c2);

    HAL_SuspendTick();
    __HAL_PWR_CLEAR_FLAG(PWR_FLAG_WU);

    HAL_PWREx_EnablePullUpPullDownConfig();
    HAL_DBGMCU_DisableDBGStopMode();
    HAL_PWREx_EnableUltraLowPowerMode();

    HAL_PWREx_EnterSTOP2Mode(PWR_STOPENTRY_WFI);

    HAL_ResumeTick();
    custom_StopGpioInit();
    HAL_GPIO_WritePin(GPIOC, GPIO_PIN_3, GPIO_PIN_SET); // LDO Enable
}

 

Power Measurement Graph

Screenshot 2025-09-30 101723.pngScreenshot 2025-09-30 101935.png


You can clearly see periodic current spikes corresponding to the LCD refresh intervals. The average current remains around 5–6 µA, but these periodic spikes are preventing us from reducing the base consumption further.

MAIN QUESTION / DOUBT IS?

Is this spike behavior expected from the LCD driver on STM32U0 in STOP2 mode?
Are there any configuration tweaks (LCD prescaler/divider, bias, duty, voltage source, etc.) or low-power tricks to minimize these periodic current spikes while keeping the LCD ON?

Viktor POHORELY
ST Employee

Hello,

spikes are expected behavior - LCD is behaving as set of capacitors, with each refresh of LCD leads to charging them. This is the main reason for spikes in the consumption of current. It depends mainly on the parameters of LCD glass.

Working with voltage, bias etc. may slightly change this consumption, but it could be on cost of brightness, contrast etc.