Time stamping Data - Jitter/Spike in Time Stamp

Hi All,

I’m having some timing issues with timestamps which are being assigned to my incoming data packets read through serial. The data is coming in at 600Hz. And I am time stamping the data via the ClockCycles command ( ideally each time stamp is 1.67 ms apart – This is what I am graphing on Matlab ) . In the past I used to use the clock_gettime( CLOCK_REALTIME, &t1) command but was not able to get the resolution that I needed i.e my timestamps were 2+ ms apart .

The problem I am getting is that periodically I get spikes or jitter in the timestamp (the interval increases between to 5-10 ms).

I’m still relatively new to this could someone please explain to me this phenomena ?
I have read the tick tock articles on the QNX website … Is this Jitter/Spike something which I cannot get rid of ?

Cheers

It’s all about thread/process/event priority. If you use ClockCycles() unless you have a multi cpu/core machine, it’s very precise.

Well At the moment my thread priority is set to 24. which is set via
pthread_setschedparam.

24 makes it higher then all system processes, but not interrupt hence 5-10 jitter ms is a lot. Note that setting the thread priority may not be sufficient it’s the event that it handles that matters.