PWM configuration not working!
I need to configure MR3 as period and MR0 as duty cycle
(50 % on time 50 % off time continuous pulse)
Is there any correction in my configuration below
int main(void)
{
SYSCON->SYSAHBCLKCTRL0 |= 1 << 25 ; // Enables clock for CTIMER0.
SYSCON->PRESETCTRL0 |= 1 << 25; // CTIMER reset control // Clear the CTIMER reset.
SYSCON->SYSAHBCLKCTRL0 |= 1<<7; //Enables clock for switch matrix
SWM0->PINASSIGN.PINASSIGN4 = (0X18) << 24 ; //0X18;// P0_24 PIN SELECTED
SYSCON->SYSAHBCLKCTRL0 &= ~(1<<7); //DISABLE clock for switch matrix.
CTIMER->TCR |= 1 << 1; //The Timer Counter and the Presale Counter are synchronously reset on the next positive edge of the APB bus clock
CTIMER->PR = 0X00; //Presale counter value
CTIMER->MCR |= 1 << 9 | 1 << 10 | 1 << 27 | 1 << 0 | 1 << 1;
CTIMER->MR[3] =10000;//Timer counter match value
CTIMER->MSR[3]=10000; //Timer counter match shadow value
CTIMER->MR[0] =5000;//Timer counter match value
CTIMER->MSR[0]=5000; //Timer counter match shadow value
CTIMER->PWMC |= 1<<3;//PWM. PWM mode is enabled for CTIMER_MAT0.
CTIMER->TCR |= 1<<0 ;//Enabled. The Timer Counter and Presale Counter are enabled
while(1);
}