[time-nuts] First success with very simple, very low cost GPSDO, under $8
celephicus at gmail.com
Wed Apr 9 20:04:42 UTC 2014
Another point with the software is that your handler for the PPS just reads
the counter. This gives an offset between the PPS edge and the value read,
as your software takes time to respond to the interrupt and read the
counter. In your code, it doesn't matter as you only have one interrupt.
However, if you have another interrupt enabled, this could run after the
PPS pulse but before the handler runs, giving you a very rare jitter.
A better way would be to use the input capture feature to read the timer
into a capture register. Then the interrupt handler has until the next edge
to read the capture register.
Just an idea, you might be able to assign the interrupt priority for the
PPS edge to a priority above all others to avoid this problem, but this is
getting complex. Simpler to handle it by hardware. To debug jitter, you
could make your mainline set an output line, and watch the delay between
the PPS and the line on a CRO set on infinite persistance, just to check if
Tom Harris <celephicus at gmail.com>
On 9 April 2014 13:05, Chris Albertson <albertson.chris at gmail.com> wrote:
> I just had some success with a new GPSDO based very much on Lars Walenius'
> I cut his design and his software down to make it even more simple and cost
> less. The controller is now well under $8. The software is also much
> simpler and easy to read even if you are not a "software guy".
> Lars' design and software will out perform mine. There is no question on
> that. But my goal was to first build a VERY low cost and more importantly
> easy to understand and replicate GPSDO. In this first version of the GPSDO
> I did not implement the TIC. I only count how many cycles occur from the
> local oscillator between PPS pulses and then use a PI control to adjust the
> Performance. I am open to suggestions on how I can characterize the
> performance. This project is being designed for a beginner who would not
> have exotic test equipment. I would call the performance "not as bad as
> you might guess". I have had the output of this GSPDP and the 10MHz signal
> from a Trimble Thunderbolt both up on my Tek 365 100MHz dual channel scope
> for about 26 hours and they seem to more or less keep in phase. The GPSDO
> waveform drifts one way then the other. I can see the short term stability
> is good only to about the E-9 level but of course being locked to a GPS it
> has very good long term stability. And this with about $8 worth of parts
> and build in about one hour. (Not counting the power supply (a plug-in wall
> wort type), OCXO and GPS) Also the controller software is intentionally
> simplified. The E-9 is an estimate. I'm looking for a good way to measure
> it with simple tools.
> Plans: I will add features and sophistication one step at a time and I
> will try to document the process. Even as I add more my goal is still (1)
> an understandable design that anyone can build with no special tools or
> equipment and (2) cost. With equal importance to each. The next step is
> too add some refinements to the software, different modes and so one. But
> this stripped down version will be the "introduction" for a tutorial on
> GPSDO design.
> Goals: I want to document this as a design others can build. Even if they
> are new to all of this. I also want to keep the software open and easy to
> modify in the hope that others will actually modify it and post their mods
> here for kind of peer review
> Parts list: 74HC390, Aruindo "pro mini", two small electrolytic caps and
> three resisters. That's it.
> The Mini is $3.71 with free shipping the 74hc390 was $1. Other parts where
> in the junk box.
> A software listing is attached. I used some of Lars' code but added a few
> ideas of my own and removed 80% of the functionality in preference to
> clarity. I'm not 100% done. I know I can make if more readable.
> Chris Albertson
> Redondo Beach, California
> time-nuts mailing list -- time-nuts at febo.com
> To unsubscribe, go to
> and follow the instructions there.
More information about the Time-nuts_lists.febo.com