Quantcast
Channel: Forums - Recent Threads
Viewing all articles
Browse latest Browse all 262198

Concerto M3 timer PWM 16 bit mode - Prescaler not working !

$
0
0

Hello,

I am working with the Concerto F28M35H52C1. 

I have a problem with the timer PWM mode in the M3.

For some unknown reason the prescaler doesn't work and has no effect on the output signal at all.

Here is my code:

SysCtlClockConfigSet( SYSCTL_SYSDIV_1 | SYSCTL_M3SSDIV_2 | SYSCTL_USE_PLL | (SYSCTL_SPLLIMULT_M & 0xA));

SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOC);

GPIOPinConfigure(GPIO_PC5_CCP1);

GPIOPinTypeTimer(GPIO_PORTC_BASE, GPIO_PIN_5);

SysCtlPeripheralEnable(SYSCTL_PERIPH_TIMER0);

TimerDisable(TIMER0_BASE,TIMER_B);

TimerConfigure(TIMER0_BASE, TIMER_CFG_16_BIT_PAIR | TIMER_CFG_B_PWM);

TimerControlLevel(TIMER0_BASE, TIMER_B, true);

TimerLoadSet(TIMER0_BASE, TIMER_B, SysCtlClockGet()/4000);

TimerPrescaleSet(TIMER0_BASE,TIMER_B, 2);

TimerMatchSet(TIMER0_BASE, TIMER_B, SysCtlClockGet()/8000);

TimerPrescaleMatchSet(TIMER0_BASE,TIMER_B, 2);

TimerEnable(TIMER0_BASE, TIMER_B);

The output signal has 4KHz frequency, if I write the prescaler lines or not, they have no effect at all.

Any idea ?


Viewing all articles
Browse latest Browse all 262198

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>