cancel
Showing results for 
Search instead for 
Did you mean: 

Can a low power timer (LPTIM) drive an RGB LED in STOP mode?

DerekR
Senior

MCU: STM32L4R9ZGJ6

Hardware: Custom battery powered board

LED: ARGB1313HS

Desired LED functionality: Blink, on/off, fade in/out ("Breathing")

Hello,

I am familiar with a regular timer and how they can drive a RGB LED using multiple channels (CCx registers) from the same timer. Unfortunately, it doesn't appear this works in STOP low power mode since the PWM will be clock gated.

Question 1: Can all legs (3 pins) of an RGB LED be driven by a low power timer (LPTIM) in STOP mode? It looks like a low power timer (LPTIM) can only drive 1 GPIO in CubeMX.

Question 2: If the answer above is 'no', then what is the most power efficient way to PWM a 3 legged RGB LED?

Thanks,

Derek

1 ACCEPTED SOLUTION

Accepted Solutions

Correct, LPTIM can only output one PWM channel. By the way, the AN4865 describes some use cases for the LPTIM.

Unfortunately, I don't know of any way to output three independent PWMs with the STM32L4R9 in STOP mode. However, this could be done with external hardware, e.g. a small auxiliary Ultra Low Power MCU, for which the STM32L010 could be suitable, taking its clock from the master MCU.

Hope that helps?

Regards

/Peter

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

View solution in original post

5 REPLIES 5
Peter BENSCH
ST Employee

Why not just run the STM32L4R9 in low-power run mode at e.g. 100kHz, then it draws only 0.21mA at 25°C, while your RGB LED ARGB1313HS draws about 60mA at 100% duty cycle (RGB=on)?

Regards

/Peter

In order 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.
DerekR
Senior

Hey Peter,

The STM is also doing a bunch of other stuff such as driving an AMOLED touch display using TouchGFX, playing audio, reading various sensors over I2C/SPI/UART, etc. The HCLK is running at 120 MHz.

Thanks,

Derek

@Peter BENSCH​ 

Can you confirm that the LPTIM can only drive one GPIO? I only see one compare register in the datasheet (LPTIM_CMP). Any other way to PWM a RGB LED in STOP mode?

Thanks,

Derek

Correct, LPTIM can only output one PWM channel. By the way, the AN4865 describes some use cases for the LPTIM.

Unfortunately, I don't know of any way to output three independent PWMs with the STM32L4R9 in STOP mode. However, this could be done with external hardware, e.g. a small auxiliary Ultra Low Power MCU, for which the STM32L010 could be suitable, taking its clock from the master MCU.

Hope that helps?

Regards

/Peter

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

That's what I suspected and needed to know, thanks! It seems the only option for using the STM32L4R9 MCU only is to use one of the low power sleep modes that doesn't clock gate the PWM peripheral.

Thanks,

Derek