Other Parts Discussed in Thread: CC2530
Hello,
I need to use PWM for 3/4 Channels for controlling RGBW LED's and for this I have done the configuration specified by Yikai in the following link:
But here I need to understand the PWM as it is not working because the timer_init function has only following things in the default code.
void HalTimer1Init (halTimerCBack_t cBack)
{
//not used for now
(void) cBack;
//
// Enable GPT0
//
SysCtrlPeripheralEnable(SYS_CTRL_PERIPH_GPT0);
//
// Configure Timer0A for PWM use
//
TimerConfigure(GPTIMER0_BASE, GPTIMER_CFG_SPLIT_PAIR |
GPTIMER_CFG_A_PWM);
//
// Set Duty cycle and enable
//
TimerLoadSet(GPTIMER0_BASE, GPTIMER_A, PWM_PERIOD);
TimerMatchSet(GPTIMER0_BASE, GPTIMER_A, PWM_PERIOD);
TimerEnable(GPTIMER0_BASE, GPTIMER_A);
//
// Set duty cycle to 0
//
TimerMatchSet(GPTIMER0_BASE, GPTIMER_A, 0);
}
Now here for CC2538 there no mutiple channels for single timer, there are only 4 Timers that can be used for PWM.
For this please let me know how do I do the configurations?