Part Number: TM4C123GH6PM
I wanted to create a continuous rectangular output from processor TM4C123GH6PM using Timer 2 and on port B1.
Output frequency: 20 KHz
Duty cycle: 80%
I have below library functions called but not getting any output.. Please let me any additions/deletions required. Or provide pointers to refer.
TimerConfigure(TIMER2_BASE, (TIMER_CFG_SPLIT_PAIR | TIMER_CFG_A_PWM | TIMER_CFG_B_PERIODIC));
ulCount = SYSTEM_CLOCK / 20000;
TimerLoadSet(TIMER2_BASE, TIMER_A, ulCount);
TimerMatchSet(TIMER2_BASE, TIMER_A, (ulCount * (15 - 12)) / 15);
TimerEnable(TIMER2_BASE, TIMER_A);
GPIOPinConfigure(GPIO_PB1_T2CCP1);
GPIOPinWrite(RELAY_PORT, RELAY_PIN, RELAY_PIN);
Thank you