AVR 8-bit Microcontrollers
AVR128: Setup and Use of the AVR Analog
Comparator
APPLICATION NOTE
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.
Atmel-0934C-Setup-and-Use-of-the-AVR-Analog-Comparator_AVR128_Application Note-07/2016