Hello,
I am initializing a timer as below:
MAP_SysCtlPeripheralEnable(SYSCTL_PERIPH_TIMER0); MAP_IntMasterEnable(); MAP_TimerConfigure(TIMER0_BASE, TIMER_CFG_PERIODIC); MAP_TimerLoadSet(TIMER0_BASE, TIMER_A, ui32SysClkFreq / 50); TimerIntRegister(TIMER0_BASE, TIMER_A, Timer0IntHandler); MAP_IntEnable(INT_TIMER0A); MAP_TimerIntEnable(TIMER0_BASE, TIMER_TIMA_TIMEOUT); MAP_TimerEnable(TIMER0_BASE, TIMER_A);
Which calls Timer0IntHandler 50 times a second. Is there anyway I can adjust the frequency of the timer? I have looked at the peripheral library documentation and found:
Which says "if the timer is running then the value is immediately loaded into the timer" - so its period can be adjustied while running? Am I wrong?
Also, having a new load value set would mean the counter should reset, so the timers remainder ms restarts?
I am looking for a way to adjust the frequency minimally within +/- 1% on the fly, without having resetting the remainder time. Maybe I could add or substract from it?
Any ideas greatly appreciated.
Best Regards,
C.A.