Datasheet
136
8197C–AVR–05/11
ATtiny261A/461A/861A
14. AC – Analog Comparator
The analog comparator compares the input values on the selectable positive pin (AIN0, AIN1 or
AIN2) and selectable negative pin (AIN0, AIN1 or AIN2). When the voltage on the positive pin is
higher than the voltage on the negative pin, the Analog Comparator Output, ACO, is set. 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 com-
parator and its surrounding logic is shown in Figure 14-1.
Figure 14-1. Analog Comparator Block Diagram
Notes: 1. See Table 14-1 on page 136.
See Figure 1-1 on page 2 and Table 10-3 on page 62 for Analog Comparator pin placement.
14.1 Analog Comparator Multiplexed Input
When the Analog to Digital Converter (ADC) is configurated as single ended input channel, it is
possible to select any of the ADC[10:0] pins to replace the negative input to the analog compar-
ator. 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 ADCSRA is zero), MUX[5:0] in ADMUX
select the input pin to replace the negative input to the analog comparator, as shown in Table
14-1. If ACME is cleared or ADEN is set, either AIN0, AIN1 or AIN2 is applied to the negative
input to the analog comparator.
ACBG
BANDGAP
REF EREN C E
IN T ERRU P T
SEL ECT
ANALOG
COM PARATO R
IRQ
ACI
ACIE
VCC
ACD
ACO
ACIS1
+
_
ACIS0
ADC MULTIPLEXER
OUTPUT
ACME
ADEN
(1)
MUX
AIN0
AIN1
AIN2
ACM[2:0]
HSEL
HLEV
Table 14-1. Analog Comparator Multiplexed Input
ACME ADEN MUX[5:0] ACM[2:0] Positive Input Negative Input
0 x xxxxxx 000 AIN0 AIN1
0 x xxxxxx 001 AIN0 AIN2
0 x xxxxxx 010 AIN1 AIN0
0 x xxxxxx 011 AIN1 AIN2