Part Number: TDA4VM
TI Expert
I use TimerP to create a timer with a cycle of 50us. I find that the cycle is accurate most of the time, but the actual cycle often changes to 33us, 45us, or even 100us. Why is this?
The following is the code for creating a timer:
TimerP_Params_init(&timerParams);
timerParams.periodType = TimerP_PeriodType_MICROSECS;
timerParams.startMode = TimerP_StartMode_USER;
timerParams.runMode = TimerP_RunMode_CONTINUOUS;
//timerParams.intfreqLo = 19200000;
//timerParams.intfreqHi = 0;
//timerParams.extfreqLo = 19200000;
//timerParams.extfreqHi = 0;
timerParams.period = 50;
UssTimerhandle = TimerP_create(TimerP_ANY, (TimerP_Fxn)timerIoSetIsr,&timerParams);
static void timerIoSetIsr(void)
{
isrcur_time = appLogGetGlobalTimeInUsec;
timearry[pos_i] = isrcur_time - isrpre_time;
isrpre_time = isrcur_time;
uintptr_t key = HwiP_disable();
if(UssTimerhandle != NULL)
{
... ...
Gpio statuc switching
... ...
}
pos_i++;
HwiP_restore(key);
}
Print the value of timearray [], which can have 33us, 45us, or even 100us, etc