[time-nuts] algorithms and hardware for comparing clock pulses

Hal Murray hmurray at megapathdsl.net
Mon Sep 21 22:46:04 EDT 2015


altineller at gmail.com said:
>    I finally found a way to measure 1pps output from my DS3231's, with a mcu
> unit, and modify the aging register on the RTC, I have been able to sync
> between 2-3 microseconds between clocks by substracting and adding 0.1ppm to
> 12.8ppm, with 7 bit resolution. 

I'd expect you can do much better than that.

What are you using for a MCU?  Many of them have timer/counter units that 
latch a counter on the rising edge of a pin.  That avoids any problems with 
the interrupt response time.

Another way you can do it is to take an interrupt on the rising edge of one 
pulse and the falling edge of the other pulse.  Then you have to correct for 
the pulse width in software.  That introduces errors when the pulse width 
changes with temperature, but they are probably small.  I might trigger a 
scope on the rising edge and zoom in on the trailing edge and see how much it 
moved around when I hit the unit under test with heat or cold.


-- 
These are my opinions.  I hate spam.





More information about the time-nuts mailing list