[time-nuts] Cheap jitter measurements

Dan Kemppainen dan at irtelemetrics.com
Tue Apr 10 09:59:04 EDT 2018


Hi,

Don't know how good they are, but there are two functions in the 
kernel32 lib in windows that are related to a cpu performance counter, 
QueryPerformanceCounter and QueryPerformanceFrequency. (Maybe Linux has 
similar?)

Anyway, on most systems the frequency reported is the raw cpu clock. 
(Couple of Ghz Range numbers, My current system is reporting 3,320,458 
Hz, windows7.) Supposedly these are low latency functions. It may not 
offer a perfect solution, but at least it gives you 'low latency' access 
to a high speed counter.

Maybe it's possible to timestamp incoming PPS pulses with this (assuming 
they're triggering an interrupt), and learn something neat.

Some of this is subject to change with windows versions:

https://msdn.microsoft.com/en-us/library/windows/desktop/dn553408(v=vs.85).aspx

Dan




On 4/10/2018 8:01 AM, time-nuts-request at febo.com wrote:
> kb8tq at n1k.org  said:
>> The kernel clock comes from the CPU clock. That CPU clock is phase locked to
>> a crystal. If you have a CPU that is driven by a VCXO that is a*very*
>> unusual CPU board.  The crystal runs at an arbitrary frequency. That gives
>> you edges that are unlikely to happen ���right on the second���.
> I was assuming the CPU clock was fast enough that reading a cycle-count
> register and converting to ns would be within a ns which is the resolution of
> the clock.
> 
> That's obviously not true for low end SOC type setups.  A Pi-1 runs at 700
> MHz.  The Pi 3 is up to 1.4 GHz.
> 
> 



More information about the time-nuts mailing list