Electronics-Related.com
Forums

AVR w/ asynchronous counter?

Started by frank September 25, 2016
On Monday, September 26, 2016 at 1:31:46 AM UTC-7, frank wrote:
> Hul Tytus <ht@panix.com> wrote: > > 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? > > 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).
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.
On Sun, 25 Sep 2016 14:57:11 -0400, rickman wrote:

> I do freq counters in FPGAs where I have total control over the logic of > the freq counter. A low end CPLD could do this job easily.
This, if you can make it work together with everything else.