[time-nuts] Precise timing through USB was Re: Raspberry Pi NTP server

jimlux jimlux at earthlink.net
Tue Jul 14 13:44:58 UTC 2020


On 7/13/20 4:37 PM, Hal Murray wrote:
> 
>> Is there any way for a USB device to synchronise with the CPU clock (perhaps
>> via the USB framing) so that a special-purpose device could timestamp the PPS
>> occurrence with respect to CPU time ?
> 
> If you were designing a special purpose device, just add a counter to measure
> the time from the PPS until the CPU reads the info.
> 
> Suppose you could control the USB timing.  Each sample doesn't give you a number, only a yes/no or rather a before/after.  It might work if you ask a bit after you expect the PPS and the next second ask a bit before.  The question is how small can you make a "bit".
> 
> 

If you're willing to make new hardware and device drivers, I think it 
could be done in a "USB in, USB out" kind of box. Think of a "USB 
diagnostic bus analyzer" that provides accurate timing of the USB 
activity.

The FTDI type devices are fairly simple, that is, the electrical latency 
through the device between "detect change on modem control line" and 
"status available via USB transaction is fairly constant (perhaps not in 
hydrogen maser standpoints, but probably better than a microsecond)

So your device gets a rough sync on the 1pps, and starts to slide the 
timing of the USB transaction around to keep it "on the edge" with the 
1pps. An internal clock remembers the offset, etc. And somehow you 
relate that to the time of the USB bus transaction from the host.


Of course, the OP just wanted to take a USB-only GPS and get *better* 
timing precision than the 1 millisecond they were getting, with no 
additional hardware.




More information about the Time-nuts_lists.febo.com mailing list