Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I guess very few systems have better absolute time than a few microseconds. Those systems are probably exclusively found in HFT and experimental physics.

This past week I tried synchronizing the time of an embedded Linux board with a GPS PPS signal via GPIO. Turns out the kernel interrupt handler already delays the edge by 20 us compared to busy polling the state of the pin. Stuff then gets hard to measure at sub microsecond scales.



From https://news.ycombinator.com/item?id=44054783 :

> "Re: ntpd-rs and higher-resolution network time protocols {WhiteRabbit (CERN), SPTP (Meta)} and NTP NTS : https://news.ycombinator.com/item?id=40785484 :

>> "RFC 8915: Network Time Security for the Network Time Protocol" (2020)


Yes, I'm aware of some of these developments. Impressive stuff, just not the level of precision on achieves tinkering for a few days with a basic gnss receiver.


If your board’s SOC has a general purpose timer (GPT) then you can often have it count cycles of a hardware clock and store the value every interrupt pulse from a GPIO. I designed a GPS disciplined oscillator like this where we had an ADC generate a tuning voltage for a 100 MHz OCXO (which was a reference clock for microwave converters) which we divided down to 10 kHz and fed into the GPT, along with the 1pps from a GPS module, and the control loop would try to adjust it until we got 10K clock cycles for every pulse. This kind of synchronisation gets very accurate over a few minutes.

Even just triggering an GPT from an GPS PPS input counting cycles of an internal clock you could use a GPT to work out the error in the clock, and you only need to query it once a second.


Sorry that should be “had a DAC generate the turning voltage”, not ADC!


10 MHz reference oscillators that are GPS locked are quite common. They're very useful in RF contexts where they're quite easy to find.


Sure, I was specifically talking about computer system clocks. Also with an oscillator _absolute_ time offset doesn't matter, unless you want to synchronize the phase of distributed oscillators and then things quickly get non-trivial again.


> the phase of distributed oscillators

What do you imagine the clock in your computer is made out of?


Intel Ethernet pps input pin works much much better for this. See how the open timecard mini folks do it. Easy to get sub microsecond even on cheap embedded. Most m.2 of Intel chipsets expose it (for example) as well.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: