Part Number: TI-RTOS-MCU
Other Parts Discussed in Thread: SYSBIOS
Hi:
When I use tirtos's timer on develop board(J721EXSOMG01EVM, cortex-R5F MCU),I find it's period is not correct according to my settings,so I want to know how to set and caculate the timer's period,Thanks!
My code just like this:
/*******************************************************************/
int main(void)
{
#ifdef UART_ENABLED
AppUtils_Init();
#endif
Error_Block eb;
Timer_Params timerParams;
Timer_Handle timer;
Error_init(&eb);
/* Initialize the timer params */
Timer_Params_init(&timerParams);
timerParams.extFreq.lo = 50000000;
timerParams.extFreq.hi = 0;
timerParams.period = 5000000;
timerParams.periodType = ti_sysbios_interfaces_ITimer_PeriodType_MICROSECS;
timerParams.runMode = ti_sysbios_interfaces_ITimer_RunMode_CONTINUOUS;
timerParams.startMode = ti_sysbios_interfaces_ITimer_StartMode_AUTO;
timer = Timer_create(Timer_ANY, App_TimerFxn, &timerParams, &eb);
if(NULL == timer)
{
BIOS_exit(0);
}
BIOS_start(); /* does not return */
return(0);
}
static Void App_TimerFxn(UArg a0)
{
AppUtils_Printf(APP_UTILS_PRINT_MSG_NORMAL, "Hello world!\r\n");
}
/*******************************************************************/when i set:
when i set:
timerParams.extFreq.lo = 50000000;
timerParams.extFreq.hi = 0;
timerParams.period = 5000000;
App_TimerFxn() will be executed about 1 seconds.
when i set:
timerParams.extFreq.lo = 25000000;
timerParams.extFreq.hi = 0;
timerParams.period = 5000000;
App_TimerFxn() will be executed about 0.5 seconds.
when i set:
timerParams.extFreq.lo = 25000000;
timerParams.extFreq.hi = 0;
timerParams.period = 2500000;
App_TimerFxn() will be executed about 0.25 seconds.
