[time-nuts] Time stamping with a PICPET

Chris Albertson albertson.chris at gmail.com
Sat Oct 26 15:02:43 EDT 2013


Good idea but you assume NTP could generate a pule with better accuracy
then it can measure them.   That is likely not true.  On a modern system we
can mures puss with about +/- 2 uSec jitter.  We can not export a clock
with that level of precision.

The reason is that all the normal outputs get queued while the DCD
interrupt works better than you'd think.    Also we don't need to fix it
because the weal link is transferring tine OUT of the system over the
network


On Sat, Oct 26, 2013 at 1:37 AM, Tom Van Baak <tvb at leapsecond.com> wrote:

> > What kind of accuracy do the picket's have.   You can log pulses using
> the
> > PPS system on bare PC hardware and get the time of the pulse logged to
> > within about 2 uSec.  Simply connect the pulse to DCD line of a real
> serial
> > port.
> >
> > If you need better than 2 uSec then yes you need external hardware.
>
> The current version of picPET is 400 ns resolution given a 10 MHz clock.
> It was designed for applications needing millisecond- to microsecond-level
> accuracy. Not bad for a $1 8-pin chip.
>
> > If those pickets are much better than 2 uSec then they make a GREAT front
> > end for a NTP server.  Question: how do you transfer accurate time into
> the
> > PIC?
>
> They are a form of T2D or TDC (time to digital converter) or TSC
> (continuous time-stamping counter) for making zero-dead time measurements,
> not real-time clocks for the purpose of maintaining time of day, or day or
> year.
>
> If all you need is a 1PPS source use a GPS timing receiver, or a GPSDO
> with 1 PPS output, or a 10 MHz external clock and a picDIV divider. See
> http://leapsecond.com/pic/ for many different dividers.
>
> ----
>
> As far as NTP is concerned, I wonder if you've ever considered turning the
> tables on how it works. AFAIK, NTP gets an external time reference (e.g.,
> 1PPS) as an interrupt. With modern computers, this is horrible. There are
> far too may layers of h/w jitter (pipelines, multiple levels of cache, TLB
> misses, etc.) and s/w jitter (interrupt handling, spinlocks, interrupt
> masking, priority levels, etc.).
>
> For best timing, perhaps a better solution is not to have NTP receive a
> 1PPS as *input* and try to pretend to measure it internally in s/w but for
> NTP to *output* a 1PPS and measure that externally with sub-microsecond h/w
> (like a picPET).
>
> That bypasses all the jitter associated with asynchronous events;
> replacing it instead with a synchronous event. If NTP takes an internal s/w
> timestamp before and after the pulse is output, and you obtain (via serial
> port) the timestamp reading made by external h/w you can then correct the
> NTP paper clock, with far less h/w and s/w jitter.
>
> The mental shift is to stop treating a PC+NTP as a precise clock and pulse
> measurement instrument and start treating a PC+NTP as a precise clock and
> pulse generation instrument.
>
> /tvb
>
> _______________________________________________
> 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.
>



-- 

Chris Albertson
Redondo Beach, California


More information about the time-nuts mailing list