This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMS320F28374S: Timestamping Zero latency interrupts

Part Number: TMS320F28374S
Other Parts Discussed in Thread: SYSBIOS

My team is looking into using delta times between our high speed zero-latency interrupt to help identify system health as these should be occurring at a defined rate. We are trying to timestamp at about 1/10000 of the system clock frequency. The other threads in our system can utilize the SYSBIOS timestamp module. From my understanding, SYSBIOS API calls are not recommended. Given that, is there a recommended way to timestamp zero-latency interrupts? Our current SYSBIOS implementation utilizes Clocks and TimestampProvider thus all the timers are used.

Timer 0 and 1 = SYSBIOS Clock (ti.sysbios.knl.Clock with 1ms tick period) and SYSBIOS TimestampProvider (ti.sysbios.family.c28.TimestampProvider with default settings)

Timer 2 = SYSBIOS

Given this, how could I get a system tick count without causing instability? Would use of the TimestampProvider API be safe in a zero-latency interrupt? If not, can I utilize the same registers used by the TimestampProvider as I only expect to read it?  Is there a better/alternative option? 

Perhaps we could consider utilizing the driverlib cputimer instead of the SYSBIOS Timestamp module. If so, would there be anything that I'd need to be wary of if we followed that path?

Would utlizing ECaps be a possiblity?

  • I think that caution not to call SYS/BIOS functions mainly applies to functions that may have an impact on the scheduler. It might depend on what functions you plan on calling, but for example TimestampProvider_get32() in the case where the TimeStamp provider is not sharing the Clock timer seems to boil down to a read of few CPU timer registers and should be pretty harmless to call.

    I do agree that replacing the TimerstampProvider with just directly accessing the CPU Timer using driverlib drivers is also an option. I expect you could find a way to use the ECAP counter or a spare PWM as generic timers as well.

    Whitney

  • Thanks Whitney. Timestamps work fine in the zero-latency. I do have a follow up issue that I posted.