Introduction
This application note serves as an example on how to set up and use the Atmel®
AVR® On-chip Analog Comparator. The following program examples are
given in the assembly file “avr200.asm”:
- Detect a positive edge on the comparator output by polling the ACO-bit in the Analog Comparator Control and Status Register – ACSR.
- Detect a positive edge on the comparator output by polling the Analog Comparator Interrupt Flag – ACI in ACSR.
- Initialize interrupt on comparator output toggle. An interrupt routine which increments a 16-bit counter each time it is executed is given as an example.