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.

Concerto M3-Side PWM Problem

Hello,

I have been trying to get PWM output from E3 and B5 pins.  I couldn't find detailed information about M3 side PWM configuration. I read the similar posts in this forum and write the code according to them. Below you can see my code. Can you check the code?


Regards.


SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOE);
GPIOPinConfigure(GPIO_PE3_CCP1);
GPIOPinTypeTimer(GPIO_PORTE_BASE, GPIO_PIN_3);
GPIOPadConfigSet(GPIO_PORTE_BASE, GPIO_PIN_3, GPIO_PIN_TYPE_STD_WPU);

SysCtlPeripheralEnable(SYSCTL_PERIPH_TIMER0);
TimerDisable(TIMER0_BASE,TIMER_BOTH);
TimerConfigure(TIMER0_BASE, TIMER_CFG_16_BIT_PAIR | TIMER_CFG_B_PWM);
TimerConfigure(TIMER0_BASE, TIMER_CFG_B_PWM);

TimerControlLevel(TIMER0_BASE, TIMER_B, true);
TimerLoadSet(TIMER0_BASE, TIMER_B, SysCtlClockGet(SYSTEM_CLOCK_SPEED)/pwm_on);
TimerMatchSet(TIMER0_BASE, TIMER_B, SysCtlClockGet(SYSTEM_CLOCK_SPEED)/pwm_off);

TimerEnable(TIMER0_BASE, TIMER_B);

SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOB);
GPIOPinConfigure(GPIO_PB5_CCP2);
GPIOPinTypeTimer(GPIO_PORTB_BASE, GPIO_PIN_5);
GPIOPadConfigSet(GPIO_PORTB_BASE, GPIO_PIN_5, GPIO_PIN_TYPE_STD_WPU);


SysCtlPeripheralEnable(SYSCTL_PERIPH_TIMER1);
TimerDisable(TIMER1_BASE,TIMER_BOTH);
TimerConfigure(TIMER1_BASE, TIMER_CFG_16_BIT_PAIR | TIMER_CFG_A_PWM);
TimerConfigure(TIMER1_BASE, TIMER_CFG_A_PWM);

TimerControlLevel(TIMER1_BASE, TIMER_A, true);
TimerLoadSet(TIMER1_BASE, TIMER_A, SysCtlClockGet(SYSTEM_CLOCK_SPEED)/pwm_on);
TimerMatchSet(TIMER1_BASE, TIMER_A, SysCtlClockGet(SYSTEM_CLOCK_SPEED)/pwm_off);

TimerEnable(TIMER1_BASE, TIMER_A);