AVR w/ asynchronous counter?

Hi all, I'd like to make a very simple frequency counter (should be single chip ideally), let's say to max 25 MHz more or less, 6 digits resolution. A PIC microcontroller, using an internal counter with asynchronous external clock is one possible solution. However, I would greatly prefer to use an AVR microcontroller here as I already have lots of code and experience with them. On the selector guide of the atmel site, there isn't a way to filter for asyncrhonous (to the main clock) counter input and the majority of the AVRs I have seen have only a synchronous option for the external clock to the timers, and that's not suitable for an easy job as a frequency counter. Does anyone know if atmel ever made a similar thing on any 8 bit AVR? I'd avoid reading all possible datasheets to search for it. Thanks in advance

Frank

Reply to
frank
Loading thread data ...

If memory serves, Atmel does have a counter with an asychronous input on one/some of the avr devices. I'd check the 44/88/168/328 family first, then the new avr's, avrx?

Hul

frank wrote:

Reply to
Hul Tytus

asynchronous on the AVR world means you can clock one of the counter with a separate oscillator or crystal, but it means also it must always be a few times slower than the main cpu clock. And, if you use the external oscillator for the counter, you must use an internal cpu clock, since both clocks would use the same pins (either one or the other).

I'm definitely going to a different soultion.

Frank

Reply to
frank

Don't just guess about the frequency here - find out what you actually need. Also consider duty cycle (minimum high and low times). 25 MHz is near the boundary of what is possible with many types of microcontroller

- you might find that reducing that to 20 MHz or 15 MHz gives you a much wider selection. A couple of T-flipflops before the microcontroller will reduce the frequency to a much more friendly level, and clean up the signal and its duty cycle.

For AVRs, you might find the ATxmega E series can handle this - the custom logic may be able to give you the flip-flops. (I haven't used the part myself, and don't know the details.). But still, an external flip-flop chip would let you use the smallest and cheapest microcontroller around.

Reply to
David Brown

If you distrust the builtin counter because it loses pulses, consider using a 74HC193 as prescaler, with some GPIO pins to get those LSB bits back. At the appointed gate time, gate the UP clock pin off, read the count most-significant bits from your internal counter, and pulse the DOWN clock into the '193 until the BORROW tells you that the prescaler's four bits are now empty. It takes two GPIO pins, three if you let your gate source be synchronous to the AVR. As a minor benefit, the timer can capture clocks faster than the AVR.

tells you it's empty.

Reply to
whit3rd

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.