Datasheet
119
ATtiny25/45/85 [DATASHEET]
2586Q–AVR–08/2013
16. 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 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 sur-
rounding logic is shown in Figure 16-1.
Figure 16-1. Analog Comparator Block Diagram
Notes: 1. See Table 16-1 below.
See Figure 1-1 on page 2 and Table 10-5 on page 63 for Analog Comparator pin placement.
16.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[3: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 ADCSRA is zero),
MUX[1:0] in ADMUX select the input pin to replace the negative input to the Analog Comparator, as shown in Table
16-1. If ACME is cleared or ADEN is set, AIN1 is applied to the negative input to the Analog Comparator.
ACD
+
_
VCC
ACBG
ACI
ACO
ACIE
ACIS1 ACIS0
IN T ERRU P T
SEL ECT
ANALOG
COM PARATO R
IRQ
AIN0
AIN1
INTERNAL 1.1V
REF EREN C E
ADC MULTIPLEXER
OUTPUT
ACME
ADEN
(1)
Table 16-1. Analog Comparator Multiplexed Input
ACME ADEN MUX[1:0] Analog Comparator Negative Input
0x xxAIN1
11 xxAIN1
10 00ADC0
10 01ADC1
10 10ADC2
10 11ADC3