[time-nuts] Frequency counters
Hal Murray
hmurray at megapathdsl.net
Fri Aug 20 20:31:07 UTC 2010
> I want to find a frequency counter that will read to 1 hz precision up to a
> minimum of 30 Mhz that I can clock using the output from my Efratom 101 Rb
> frequency standard. I am quite happy to make one if there is a suitable
> design out there. Any suggestions?
Do you want to read the answer with your eyes, or get it into a computer?
Most of the older HP counters have HP-IB/GP-IB.
I think you could build everything you need in a small FPGA. I'm thinking of
something like this:
Assuming a reference clock, generate a pulse every second.
Count cycles on your unknown clock.
On each second pulse, copy the cycle-counter to another register and reset
the counter.
That gives you the number of cycles in the previous second.
If you count in decimal rather than binary, it's simple to send out the
digits as ASCII. With a bit more work, you could feed them to a small LCD
display.
One complication is avoiding metastability. My straw man would be to run
the internal logic at 100 MHz (derived from the 10 MHz reference) and just
run the input signal through a classic pair of FFs.
I pulled 100 MHz out of the air. It's a nice round number. It might be
too fast for a simple design with 8 digits in the counter chain. This whole
problem is easily pipelined so you can run it at close to the max toggle rate
in your chip, but that adds complexity.
In the simplest version of the synchronizer, the receiving clock has to run
at over 2X the sending clock. Then the receiving logic just looks for rising
edges in the input data stream. You can gain a factor of 2 if you divide the
sending clock by 2 and look for either rising or falling edges. That would
let you run the main clock at 40 MHz which might be slow enough to avoid
having to think about pipelines.
You can probably to do the whole thing in software if you pick a chip with
the right counter/timer blocks. I'd have to check the fine print on the data
sheet carefully to see how fast the counter/timers will go. Some of them
have prescalers so the counter can watch a fast signal, but if you divide the
input signal too much you won't be able to get your 1 Hz resolution. But
maybe you can count for several seconds...
--
These are my opinions, not necessarily my employer's. I hate spam.
More information about the Time-nuts_lists.febo.com
mailing list