[time-nuts] Re: Clock Display on Linux: Update

Brooke Clarke brooke at pacific.net
Thu Dec 9 02:20:41 UTC 2021


Hi Adam:

Years ago I built a hardware clock display settable to 1 ms based on a PIC 16F88 microcontroller.  The idea was to 
attach these to frequency standards thus making them into precision clocks.
https://www.prc68.com/I/PRC68COM.shtml#07092006
There are some tricks to writing PIC assembly code in such a way that the number of instructions is always the same.  
TVB has also done some PIC coding.

-- 
Have Fun,

Brooke Clarke
https://www.PRC68.com
axioms:
1. The extent to which you can fix or improve something will be limited by how well you understand how it works.
2. Everybody, with no exceptions, holds false beliefs.

-------- Original Message --------
> Thanks to everyone who responded to my first thread about getting a
> good clock display on a Linux system. I want to try out some of those ideas
> that give a higher-end accuracy, but in the meantime I've hacked together
> some basic stuff in Python that is accurate within a few ms.
>
> The main problem with GUI stuff in Python is that sleep() functions, or
> their implementations in various GUI libraries, can definitely not be
> trusted. In fact, I tested tkinter's after() function, which functions like
> your basic sleep() function in between display updates, and it drifts on
> the order of 500ppm (i.e. every two seconds it loses/gains a ms), which is
> quite bad.
>
> The key to getting a good clock which is consistently accurate to system
> time within as little as 5ms (and therefore if system time is accurate
> to +/- 10ms with NTP you have an overall accuracy of 15ms, at worst), is
> just to adjust the clock periodically based on the offset from the display
> updates to the system time. In other words, every ten seconds or so,
> instead of doing sleep(1000), you can just sleep(1000 - offset). (The units
> here are ms). This worked for me quite well.
>
> +/- 5ms is quite sufficient for a system which itself is only accurate
> within 10ms with NTP. Now, I just need to figure out how to get a good
> display going for a higher accuracy device, in particular a PPS-Raspberry
> Pi setup I am trying to get working.
>
> I'm sure some people here have done something similar, but I figured I'd
> share.
>
> Adam
> _______________________________________________
> time-nuts mailing list -- time-nuts at lists.febo.com -- To unsubscribe send an email to time-nuts-leave at lists.febo.com
> To unsubscribe, go to and follow the instructions there.
>





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