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.

controlling 4 RGB LEDs with PWM using MSP430F5438

Other Parts Discussed in Thread: MSP430F5438

I have a project in which I must control 4 RGB LEDs using PWM directly from the MSP430. They are separated in two groups of 2 LEDs (1 PWM connection controls one color element of two LEDs) which means I have 6 PWM connections to my uC (two for each color R, G or B). My uC is a MSP430F5438, having a Timer B with 6 CCRs, therefore able to provide 6 PWM hardware signals.

I just explained the left configuration, although I've got some suggestions that it could just be as in the right sketch (sorry for the horrible drawings):

They must light all with the same color, possibly blinking with 1 second frequency or so. My question is: how could I save as much power as possible managing/multiplexing the PWM signals and the two groups of LEDs? I thought about simple PWMs for all the 6 signals, or also using only 3 PWMs and multiplexing between the two groups (as shown in the sketches). I'm willing to use software ISR but I only have timer B available for that (to use together with the hardware PWM). Should also be a quick operation due to the rest of the program being relatively heavy. The use of a LED driver is out of question. Thanks.

  • Alexandre Guerra said:
    My question is: how could I save as much power as possible managing/multiplexing the PWM signals and the two groups of LEDs?

    That's like asking the passenger in your car to throw his shoes out the window to save gas. The 4 RGB LEDs are going to draw so much power (by at least a couple orders of magnitude) that you will never see any power savings on the MSP430 side of the equation, no matter what you do.

    I would go for simple and just use the 6 PWMs unless/until you have a different requirement preventing you from using all 6 TIMER_B CCRs.

  • ok, thanks!

    I'm still not sure if I'm going to need to control the two groups in different ways, but... Supposing all the LEDs should be on at the same time and with the same color, isn't it just simpler using 3 PWMs (since the power savings of multiplexing are insignificant)?

  • Alexandre Guerra said:
    Supposing all the LEDs should be on at the same time and with the same color, isn't it just simpler using 3 PWMs

    Of course, but from your earlier description, that wasn't clear.

    I must also ask how you are driving the LEDs... are you intending to hook the PWM output directly to the LED? Or are you driving a transistor that controls the LED current?

    Make sure you understand the current requirements of each LED segment versus the current drive capability of the MSP430 output pins.

  • Alright! Thank you once again.

    Yes, I'm driving a transistor controlling the current :)

**Attention** This is a public forum