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

Bill Hawkins bill at iaxs.net
Wed Sep 23 00:25:48 EDT 2015


Group,

Seems to me that what's needed here is a current source for linear volts
vs. time and the cmos switching to control the duration of the capacitor
charge while the phase flip-flop is on. When it turns off, it interrupts
the processor and isolates the capacitor so it acts as a sample-and-hold
device. The processor can take its own sweet time reading the capacitor
voltage (although this sets minimum limits on the pulse duration). When
the reading has been captured, the micro toggles a FF that shorts the
capacitor with a cmos switch. The short is removed when the phase FF
toggles on.

This is a lot of analog circuitry, but it will operate as fast as the
parts are capable of switching and not at the whim of whatever the micro
is doing.

Hope that's useful. Probably already been done.

Bill Hawkins 


-----Original Message-----
From: Magnus Danielson
Sent: Tuesday, September 22, 2015 3:32 PM

Jim,

I had the intent to try this, but never got around doing it. Thanks for
reminding me. Please share any enhancements.

I did exchange some emails with Lars, but as that project never got off
the ground, it faded out.

Cheers,
Magnus


On 09/21/2015 10:02 PM, Jim Harman wrote:
> Hi Can,
>
> For a simple analog solution, you might try a 74HC4046 phase detector 
> followed by a diode and RC network as used in Lars Walenius' GPSDO, 
> described here in the archives:
>
> https://www.febo.com/pipermail/time-nuts/2014-February/082820.html
>
> The phase detector produces a pulse whose width equals the time 
> difference between the two pulses. The RC network converts this to a 
> voltage proportional to the time difference, which you then measure 
> with the MCU's A/D converter. Using the rising edge of the signal at 
> pin 14 as the interrupt source triggers the A/D converter at the end 
> of the pulse, which corresponds to the peak of the analog signal.. The

> 1 meg resistor discharges the capacitor between pulses.
>
> Lars' code also includes a filtering algorithm which does a nice job 
> of controlling one of the oscillators to match the 1-PPS generated by
the GPS.
> I have enhanced this if you are interested.
>



More information about the time-nuts mailing list