Hi
I have tested my input capture on my ATMEGA32 and it went well as I used a square signal to ICP pin so that ATMEGA32 can count the number of positive (rising) pulse per second. This time, I want to use sine waveform, so I decided to use analog comparator with input capture. I use AN0 and ANI as input and 2.5V reference voltage respectively.
ACSR = (0 << ACD) | // Enable ACD (0 << ACBG) | // Disable (1 << ACIE) | // Enable Interrupt (1 << ACIC) | // Enable AC with Input Capture (1 << ACIS1) | (1 << ACISO); // Rising Interrupt
I am about to include the above code in the my exisitng code. Is there anything I may miss out in term of analog comparator?
MM