Hi
So if I go with the AVR's internal comparator for reading in a sine wave is there a common way to handle hysteresis for this module?
As for hooking up the circuit on an Atmega88 does the following sound right?
Pins: AIN0 - 0 to 5 volt (dc offset sine wave) AIN1 - GND
Registers: ASCR Bit4 ACI: - this is the flag set when the comparator event occurs. Bit 3 ACIE: interrupt enable for the module Bits 1, 0 ? ACIS1, ACIS0: set to 11 for rising edge triggering
DIDR1 Bit 1, 0 ? AIN1D, AIN0D: AIN1, AIN0 Digital Input Disable so the digital inputs dont interfere with the comparator
Now I would just handle the timer interrupt and take the inverse of the elapsed time to recover frequency.
Scott