Other Parts Discussed in Thread: SYSBIOS
Tool/software: TI-RTOS
Hi,
Can someone share how to configure a timer to fire at 1kHz with zero latency ?
This is what I tried without success. The ROV give me an exception.
#include <ti/sysbios/family/arm/lm4/Timer.h> #include <ti/sysbios/hal/Hwi.h>
Error_Block erroB; Error_init(&erroB); Timer_Params timer0Params; Hwi_Params hwi0Params; Hwi_Params_init(&hwi0Params); Timer_Params_init(&timer0Params); timer0Params.periodType=Timer_PeriodType_COUNTS; timer0Params.runMode=Timer_RunMode_CONTINUOUS; timer0Params.startMode=Timer_StartMode_AUTO; uint32_t nominalPeriod=0; nominalPeriod=480000/10; // 1khz timer0Params.period=nominalPeriod; //hwi0Params.__fxns=foo; //hwi0Params.eventId=64; hwi0Params.priority=0; //hwi0Params.enableInt=TRUE; //hwi0Params.useDispatcher=FALSE; timer0Params.hwiParams=&hwi0Params; timer0Hdl = Timer_create(Timer_ANY, timer0Hwi, &timer0Params, &erroB);
Thanks in advance
PL