[time-nuts] Cheap jitter measurements
kb8tq at n1k.org
Tue Apr 10 10:54:16 EDT 2018
> On Apr 10, 2018, at 9:59 AM, Dan Kemppainen <dan at irtelemetrics.com> wrote:
> 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 <https://msdn.microsoft.com/en-us/library/windows/desktop/dn553408(v=vs.85).aspx>
NTP already looks at incoming pulses and reports what it thinks is going on with them. The desire here
is to get a pulse *out* of the device. Then you can toss it into a conventional set of gear. From the data
you can independently evaluate what’s going on.
So more or less:
1) Generate pulse
2) Work out when the pulse went out
3) Compare that to what NTP thinks is going on
4) Generate a message to describe the delta in time
No, not trivial ….
> 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.
> time-nuts mailing list -- time-nuts at febo.com
> To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
> and follow the instructions there.
More information about the time-nuts