VCO control with AVR tiny/mega?

Dec 18, 2006 21 Replies

There's an interesting frequency counter using a PIC [ :) ] that is reported to work up to 50MHz.

formatting link

--Rocky

That would be the best approach.

The main problem with Freq Meters in uC, is most have sampled timer-clk pins, which places a low ceiling on the Fin. (PICs are one exception)

Even those with PLLs on faster timers, do not think to sample the TIN pins at that faster clk, instead using CPU CLK [ My reading of the AT90PWM data has this drawback ]

So, you need to get the 15MHz VCO down to both a HW and SW compatible frequency.

You can work out the gate times, take a cheap/small HC4060 :

15MHz = 66.66'ns period, or 1092.266' us from a 4060 15.000500MHz = is 1092.230 us from a 4060 dT here is 36.4ns per ~millisecond

If we take a simple round number, and assume the AVR can capture to

100ns, (10MHz) you will need to take these ~1ms interrupts from the 4060 output, and use at least 4 of them (~4ms), to see that % delta.

If your target is 50ms then this sounds do-able. Above ~6ms the 16 bit timers will overflow, [another complication:) ] but you are now slow enough to manage that in SW.

With this capture method, you do not loose information across captures, so you could, for example, every 1ms INT, do a rapid check of coarse tolerance (couple of Khz), and correct for large steps quite quickly, and then over the 50ms timebase, fine tune down to one part in

500,000 which is well inside your 500Hz

-jg

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required