[time-nuts] Using GPS 1PPS for accurate period measurement
df6jb at ulrich-bangert.de
Fri Dec 2 08:01:15 EST 2011
supposed your micro features latch inputs by which the internal counter
values can be latched in hardware then
a) use two counters @ your system clock rate to latch their values with the
TCXO's PPS and the GPS's PPS
b) extend the 8/16 bit counters in software to at least 32 bit so that you
do not suffer from counter overflow problems
c) declare one of them as the "start" counter and the other as the "stop"
d) whenever the "stop" signal happens to appear read the two latches and the
counter software extensions and compute the time difference between start
This in total makes you a time interval counter with a 62.5 ns resolution
which nicely fits the GPS's jitter of 20 ns to 100 ns depending on the
quality of your GPS receiver.
Collect as many measurements as is necessary for the intended resolution and
accuracy. Actually you are measuring the phase difference between the two
sources so expect the measured values to change in time even with small
frequency differences of the sources. Compute how the phase changes over
time with a linear last squares fit of a line to your data points. The slope
of this line gives you the frequency differenc between the two sources.
This is exactly how a prof would do it with the exception that he would have
a higher resolution time interval counter available. With n measurements
used for the fit you may expect a sqrt(n) improvement for all non-systematic
erros of your arrangement.
> -----Ursprungliche Nachricht-----
> Von: time-nuts-bounces at febo.com
> [mailto:time-nuts-bounces at febo.com] Im Auftrag von Tom Harris
> Gesendet: Freitag, 2. Dezember 2011 01:41
> An: time-nuts at febo.com
> Betreff: [time-nuts] Using GPS 1PPS for accurate period measurement
> I finally have a need to ask a question about time measurement!
> I want to measure the accuracy of a 1Hz signal from a real time clock
> (RTC) chip with an integrated TXCO allegedly good for +/-
> 2ppm accuracy. My employer is too tight to buy a good
> frequency counter, but I do have a GPS module outputting
> 1PPS. If I use a little micro running at 16MHz from a
> jellybean crystal to measure the period of the 1PPS signal
> from the GPS concurrently with measuring the period of my
> test signal, will I be able to get accuracy of sub ppm? My
> resolution for a single period is 62.5 ppb, but this is a lot
> different to accuracy. I could easily count multiple periods,
> as I do not need fast results. My thought is that the 16MHz
> will have jitter and a pronounced drift, but that as the
> measurements of my reference and signal are done nearly
> concurrently, the errors will be very small.
> The need for this is that the RTC chip for a product has the
> engaging property of shifting it's frequency by several ppm
> after being soldered to the board, and I need to characterise
> this to get accurate timing for the product.
> Tom Harris <celephicus at gmail.com>
> time-nuts mailing list -- time-nuts at febo.com
> To unsubscribe, go to
> and follow the instructions there.
More information about the time-nuts