Datasheet

Table Of Contents
265
ATmega640/V-1280/V-1281/V-2560/V-2561/V [DATASHEET]
2549Q–AVR–02/2014
25. AC – Analog Comparator
The Analog Comparator compares the input values on the positive pin AIN0 and negative pin AIN1. When the volt-
age on the positive pin AIN0 is higher than the voltage on the negative pin AIN1, the Analog Comparator output,
ACO, is set. The comparator’s output can be set to trigger the Timer/Counter1 Input Capture function. In addition,
the comparator can trigger a separate interrupt, exclusive to the Analog Comparator. The user can select Interrupt
triggering on comparator output rise, fall or toggle. A block diagram of the comparator and its surrounding logic is
shown in Figure 25-1.
The Power Reduction ADC bit, PRADC, in “PRR0 – Power Reduction Register 0” on page 55 must be disabled by
writing a logical zero to be able to use the ADC input MUX.
Figure 25-1. Analog Comparator Block Diagram
(2)
Note: 1. See Table 25-1.
2. Refer to Figure 1-1 on page 2 and Table 13-5 on page 76 for Analog Comparator pin placement.
25.1 Analog Comparator Multiplexed Input
It is possible to select any of the ADC15:0 pins to replace the negative input to the Analog Comparator. The ADC
multiplexer is used to select this input, and consequently, the ADC must be switched off to utilize this feature. If the
Analog Comparator Multiplexer Enable bit (ACME in ADCSRB) is set and the ADC is switched off (ADEN in ADC-
SRA is zero), MUX5 and MUX2:0 in ADMUX select the input pin to replace the negative input to the Analog
Comparator, as shown in Table 25-1. If ACME is cleared or ADEN is set, AIN1 is applied to the negative input to
the Analog Comparator.
ACBG
BANDGAP
REFERENCE
ADC MULTIPLEXER
OUTPUT
ACME
ADEN
(1)
Table 25-1. Analog Comparator Mulitiplexed Input
ACME ADEN MUX5 MUX2:0 Analog Comparator Negative Input
0 x x xxx AIN1
1 1 x xxx AIN1
100000 ADC0
100001 ADC1
100010 ADC2
100011 ADC3