Part Number: MSP430F5419A
Other Parts Discussed in Thread: MSP430WARE
Hello,
I have an RGB LED connected to P4.1/TB0.1 for Red, P4.2/TB0.2 for Green, and P4.3/TB0.3 for Green. I've successfully used Timer_B_outputPWM to output PWM on one output, but how do I configure Timer B to output PWM on all three channels. Initialization code:
void halTimerInitRgbLedPwm()
{
rgbLedPwmParam.clockSource = TIMER_B_CLOCKSOURCE_SMCLK; //4Mhz
rgbLedPwmParam.clockSourceDivider = TIMER_B_CLOCKSOURCE_DIVIDER_1; //TACLK = 4MHz
rgbLedPwmParam.timerPeriod = RGB_LED_PWM_TIMER_PERIOD;
rgbLedPwmParam.compareRegister = TIMER_B_CAPTURECOMPARE_REGISTER_1;
rgbLedPwmParam.compareOutputMode = TIMER_B_OUTPUTMODE_RESET_SET;
rgbLedPwmParam.dutyCycle = 0;
Timer_B_outputPWM(TIMER_B0_BASE, &rgbLedPwmParam);
}
Once configured I realize I can use Timer_B_setCompareValue() to set the duty cycle for a given capture/compare register, but how do I configure all three outputs to be PWM?
Thanks,
Derek