“The title is slightly misleading :-) What it really is, and this is a TL;DR too:
PPS via Arduino into the I2C pins of a VGA connector of a Linux-running-PC which then gets interfaced to NTPd.
As described above, there’s an Arduino to which I connected a PPS source. This PPS source (“Pulse Per Second”) gives a pulse every second. For my experiment I used a simple TCXO (temperature compensated crystal oscillator, a 10MHz TCXO with a PicDiv to make that into a PPS signal) but a GPS with a PPS pin is preferred.
On the Arduino runs a custom script. This script waits for an I2C request to which it should respond in a short time (else the requester times out). The Arduino then waits for 50us (50 microseconds) in a loop until the PPS signal comes in (e.g. the GPS pulls the pin high). If the signal is received, a ‘!’ is sent back, else some other character.
The Linux PC tries to find a baseline for the PPS offset by frequently polling the Arduino. When the first signal was received, then that is used and a sleep of 990ms to minimize the polling. Every time a PPS comes in, the timestamp is send to NTP via a “shared memory segment”.”