It turns out there's a handy Arduino library for time. And it will ingest GPS or NTP, etc., as well as run off the internal clock.

One strategy, then, is:
Set the "clock" in the Arduino

then, periodically (once a minute or hour)
        look up the date and time
        calculate "rate"
        set tick rate for external clock driver

Then you have a thing which generates 1pps ticks at the desired rate.
Right now, I have a little interrupt loop that runs once a second(adjusted by rate) do it.

One could also calculate "solar time" (as UTC + EOT offset) repeatedly (after all, there's nothing else for the Arduino to do) and whenever the seconds changes, send a tick to the clock.

This technique doesn't try to keep the integral of ticks aligned with "UTC + EOT offset", though. If the tick rate were slightly off (roundoff errors in the math, most likely), then there will be some relative drift.

So, periodically, one would need to reset both the analog clock AND the Arduino clock to bring them back to proper alignment.

I suppose that periodically, one could compare "number of ticks sent" with "UTC + EOT offset" and try to compensate (by dropping ticks or adding them).




_______________________________________________
time-nuts mailing list -- [email protected]
To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
and follow the instructions there.

Reply via email to