[time-nuts] Cheap jitter measurements

Bob kb8tq kb8tq at n1k.org
Mon Apr 9 16:08:50 EDT 2018


> On Apr 9, 2018, at 2:19 PM, Achim Gratz <Stromeko at nexgo.de> wrote:
> Bob kb8tq writes:
>>> Similarly, the box should be able to give me a pulse at a known time.
>> how do you set up NTP to do that?
> Not at all, that must be done in the kernel if you want any accuracy at
> all.  But you could modify an existing device driver (for the LPT port)
> to use GPIO instead to give you a PPS out (you'll probably want some
> offset to the true second so it doesn't interfere with the PPS input).
> I think it'd be best to combine a highres timer with some spin-loop to
> keep that PPS pulse closer to the clock (it's been done that way for
> other timing critical stuff before, not really a new idea).  Or, if it's
> only slightly offset from the PPS in anyway, you could piggyback onto
> the PPS reception.
>> In both cases (pulse in and pulse out) the first step is to ask NTP
>> “when was that?”. You still have a pretty big chunk of NTP in the
>> middle of the process …. If NTP only “knows” what is happening (or can
>> control what is happening) to +/- 300 ns. The guts of your data will
>> be limited to the same 300 ns.
> That's not quite how that works.  The resolution theoretically goes down
> to nanoseconds and is ultimately limited by the timer clock.  In the
> case of the rasPi that means about 52ns, but this is swamped by the
> jitter of the interrupt latency.  But you can feed NTP better timestamps
> if you figure out how to get them; on the Beaglebone you can use the RPU
> (Dan Drown has been measuring some latencies that way), on the rasPi you
> could use the VC4 (this is tricky business due to insufficient
> documentation, but the hardware should be capable of scanning the GPIO
> at 250MHz) or even an external TICC.

Somewhere in the NTP algorithm, there is a “zero error” estimate. GPS modules
have the same thing buried in them. A GPS module (like NTP as described
above) can only *express* a PPS modulo some clock rate. GPS modules get
around this with a firmware hack. They simply tell you what the error was. It is a
simple way to get out of the “I need a 10 GHz clock source” problem. No need
for FPGA’s or any other guck. You just do an estimate and report it. It then would
work on any hardware and let you do the sort of measurements we’re talking about.

Now - *can* that be done with NTP??  Who knows….


> The other option is to use an MCU (or an FPGA) w/ Ethernet and hardware
> timestamping to build a single-purpose NTP stratum-1 box.
> Regards,
> Achim.
> -- 
> +<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+
> SD adaptation for Waldorf rackAttack V1.04R1:
> http://Synth.Stromeko.net/Downloads.html#WaldorfSDada
> _______________________________________________
> 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 mailing list