This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CC2340R5: Driving RGB LED with PWM

Part Number: CC2340R5
Other Parts Discussed in Thread: SYSCONFIG,

Tool/software:

Hi,

In my schematic, I have a RGB LED connected to DIO2 (Blue), DIO15 (Red), DIO25 (Green). From SysConfig tool, It seems all of these channels are sharing a single LGPT2 timer but on different complementary channels. Is it possible to control the duty cycle for each color separately e.g. red 20% and green 50% ?  

Update:
I open a new PWM project for LP_EM_CC2340R5 dev kit (pwmled1) and configured the RED LED DIO14 pin as T1C2N (Timer 1, complementary channel 2 ) and the LED stays on indefinitely, instead of having a variable duty cycle. What do I need to change for it work on complementary channel ?

Thank you.

  • Hi,

    In provided PWM TI Driver, each PWM instance (e.g. CONFIG_PWM_0) has exactly one timer configuration, so any channel associated with this PWM will have the same duty cycle / frequency.

    To use the same LGPT (timer) with 3 different outputs, I recommend using LGPT driver instead of PWM driver.
    LGPT driver includes a function LGPTimerLPF3_setInitialChannelCompVal, which allows you to set different compare values for each of the 3 channel outputs.

    Thanks,
    Toby