[time-nuts] Another Arduino GPSDO

Lars Walenius lars.walenius at hotmail.com
Sat Mar 29 08:43:59 EDT 2014

>Eric Williams wrote:
>I just saw Lars' postings on his design and thought I'd throw mine in since
>I've been working on a similar low-end goal but doing it a different way.
 >Not really an Arduino, either, but it's based on an AVR processor and
>should be portable to an Arduino. 

Good to see someone else experimenting and sharing it (same for Bob Stewart!)  

Do you use the Arduino bootloader and environment (code)? 

>I don't consider it a PLL because I have no way to measure phase
>differences within a cycle.

I prefer to use time instead of phase as it is confusing to use phase with two different clock speeds (5MHz /1Hz). I also should say that it took me a while to figure out that Bob Stewart’s graphs showed a range of 100ns for an ADC range of about 400 (100-500). Maybe using both TIC value and ns scales would be good (or explained in a header or the file name).

I consider HP5328, 5334, 5335, 5370 etc counters in time interval mode to be very similar to my and your TIC or what Bob Camp recently named TDC. TIC is an acronym for Time Interval Counter and TDC Time to Digital Counter. In fact I used a 5328A as TIC in my first trials to do a GPSDO long ago.

Having a clock of 5 MHz and counter to 5000 for me is the same as a TIC range of 5000 with an input frequency of 1 kHz. Think of a counter in time interval mode with start from the 1PPS and stop from a 1 kHz (1ms) clock. It doesn´t matter if it is an analog integrator+ADC with 5000 “bits” (counts) or a digital counter with a 5MHz clock the resolution will be 200nsecs. In my Arduino GPSDO you will find two TIC´s, one analog and one digital. The analog has a clock of 1MHz and a range of about 1000 (slightly less than 10bits) so the resolution is about 1ns and range 1uS. The other is like yours with a 5MHz clock to Timer 1. As I also count overflows the range is 5000000 (+-2500000) and up to 1sec (uses something like a modulo 5000000 in the program). This also gives a resolution of 200ns as yours.  I decided to have some overlap between the analog and digital TIC as the synchronization to the clock in the ATmega328 is a problem. This gives some margin between the ranges of the analog and digital TIC.

A note maybe more to those working with an analog TIC with a simple RC net: In my Arduino GPSDO the ADC value and ns is about the same. For low ADC values 1LSB is about 0.88ns and for high values 1.12ns. The range I see from the ADC for 1000ns is 15-1005 (after fine trimming of the R). The relatively small deviation from 1ns/LSB is due to that I only use about 20% of the RC range due to the 1.1V ref instead of 5V ref.  From the beginning I used the 5V ref and about 600 out of the 1024 range. This gave a factor of 2.5 in resolution change over the range. For a normal deviation of +-10-100nS (depending on different GPS receivers) the TIC range is also a parameter for the linearity. With a 1000ns TIC range the linearity around +-50ns from the midpoint is very good. A TIC range of 100nS +-50ns cover all of the range. But in a GPSDO the nonlinearity may not be a problem at all (especially if you correct for it). Most probably the nonlinearity only gives a small time offset as the values that are above the midpoint have a slight different gain to the ones below.


More information about the time-nuts mailing list