When using General-Purpose Timers as a 16-bit timer (GPTMA), the register access from setting the timer count to enabling the timer count is very slow, and the overhead of timer control increases.
It takes 1.8μsec for the following 3 steps (system clock is 16.0MHz)
TIMER0_ICR.WORD.UWDATA_LO = (unsigned short)TIMER_ICR_TATOCINT; // GPTMRIS TimerA T/O Clear
HWREG(TIMER0_BASE + TIMER_O_TAILR) = (unsigned long)timer_count; // GPTMCC ALTCLK:0(MOSC)
TIMER0_CTL.WORD.UWDATA_LO = (unsigned short)TIMER_CTL_TAEN; //GPTMCTL TAEN:1
Could you tell me if there is any reason for this?