
272
8210C–AVR–09/11
Atmel AVR XMEGA D
Figure 22-1.
Analog comparator overview.
22.3
Input Sources
Each analog comparator has one positive and one negative input. Each input may be chosen
from a selection of analog input pins and internal inputs such as a V
CC
voltage scaler. The digital
output from the analog comparator is one when the difference between the positive and the neg-
ative input voltage is positive, and zero otherwise.
22.3.1
Pin Inputs
Any of analog input pins on the port can be selected as input to the analog comparator.
22.3.2
Internal Inputs
Two internal inputs are available for the analog comparator:
• Bandgap reference voltage
• Voltage scaler, which provides a 64-level scaling of the internal V
CC
voltage
22.4
Signal Compare
In order to start a signal comparison, the analog comparator must be configured with the pre-
ferred properties and inputs before the module is enabled. The result of the comparison is
continuously updated
and available for application software and the event system.
22.5
Interrupts and Events
The analog comparator can be configured to generate interrupts when the output toggles, when
the output changes from zero to one (rising edge), or when the output changes from one to zero
ACnMUXCTRL
ACnCTRL
Interrupt
Mode
Enable
Enable
Hysteresis
Hysteresis
AC1OUT
WINCTRL
Interrupt
Sensititivity
Control
&
Window
Function
Events
Interrupts
AC0OUT
Pin Input
Pin Input
Pin Input
Pin Input
Voltage
Scaler
Bandgap
+
AC0
-
+
AC1
-