[time-nuts] First success with very simple, very low cost GPSDO, under $8
albertson.chris at gmail.com
Wed Apr 9 17:54:28 UTC 2014
On Wed, Apr 9, 2014 at 9:39 AM, Orin Eman <orin.eman at gmail.com> wrote:
> On Wed, Apr 9, 2014 at 2:08 AM, Hal Murray <hmurray at megapathdsl.net>
> The order the interrupt routine updates the counter shouldn't matter since
> it's atomic as far as the mainline code is concerned.
In my case it's the other way around, the 16 bit counter is updated by
pin-5 and it is "atomic" It is done in the chip's hardware.
Actaully I don't care much about an "off by one" count because the problem
is corrected in the next second. If I happen to miss a count one second
the very next second this shows up as an extra count. I notice that
something like this happens every few hundred seconds.
The PI controller algorithm is very simple and acts as a kind of filter.
It all works in integer math and the DAC is only 16-bits so this kind of
error s "lost between the bits". I don't care if the DAC's value is off
by .04 because it can only be set on full counts.
The goal was to keep the first version of the code SIMPLE. One problem I
want to avoid is where I measure a board with a micrometer and then cut it
with an axe. When you know you are cutting an axe, you don't even need a
Later I add some sophistication back in and measure the effect. Heck at
this point I have a capacitor based TIC that I am completely IGNORING.
The point is to see what each added layer of complexity buys.
Redondo Beach, California
More information about the Time-nuts_lists.febo.com