[time-nuts] GPSDO Alternatives

Hal Murray hmurray at megapathdsl.net
Fri Dec 7 04:35:01 UTC 2012

SAIDJACK at aol.com said:
> Then setting up a test system we noted that the timer can capture with
> 32MHz resolution which is good enough for a low-cost GPSDO implementation,
> but that they gated the input pin through a flip-flop running at CPU core
> speed, which was around 6MHz if I remember correctly. 

davidwhess at gmail.com said:
> The ATmega328 apparently has something similar going on since the datasheet
> says that the maximum external asynchronous clock frequency is 1/4 of the
> CPU frequency.  That is why I suggested synchronously clocking the CPU
> directly from the OCXO.  Atmel's datasheet is annoyingly vague about some
> matters and I assume the capture input works like it should. 

You have to do something appropriate when multiple clocks are involved or you 
get metastability issues.

I think the 1/4 limit is to allow the external pin to be used to clock the 
counter.  If you run the external signal through the standard pair of FFs to 
get a signal that is synchronous to your clock, 1/4 guarantees that you will 
see all transitions.  At 1/2, with the duty cycle slightly off 50-50, you 
might end up with hanging-bridge type cases where the output of the 
synchronizer always sees the same level.

Actually, metastability is hard to hit.  Most "metastability" issues are 
really just setup/hold bugs.

davidwhess at gmail.com said:
> I have also heard about many low cost ARM microcontrollers suffering from
> problems similar to the one you describe.  Apparently the ones that use an
> asynchronous interface between the CPU and peripherals either have slow
> interfaces or suffer from some odd problems.


Many years ago, I found that sort of bug in an ARM chip.  I forget which one. 
 It needed 2 crystals, one at 32 KHz and one at xx MHz.  The CPU could run at 
32 KHz, or PLLed to the fast crystal, or sleep.  While running at 32 KHz, it 
could turn on the fast osc and setup the PLL.  Reading the 32 KHz counter 
while running off the fast crystal would occasionally get bogus results.

These are my opinions.  I hate spam.

More information about the time-nuts mailing list