399
8331B–AVR–03/12
Atmel AVR XMEGA AU
Figure 30-1.
Analog comparator overview.
30.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.
30.3.1
Pin Inputs
Any of analog input pins on the port can be selected as input to the analog comparator.
30.3.2
Internal Inputs
Three internal inputs are available for the analog comparator:
• Output from the DAC
• Bandgap reference voltage
• Voltage scaler, which provides a 64-level scaling of the internal V
CC
voltage
30.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.
30.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
+
-
Voltage
Scaler
ACnMUXCTRL
+
-
ACnCTRL
Interrupt
Mode
Enable
Enable
Hysteresis
Hysteresis
DAC
Bandgap
AC1OUT
WINCTRL
Interrupt
Sensititivity
Control
&
Window
Function
Events
Interrupts
AC0OUT
Pin Input
Pin Input
Pin Input
Pin Input