
161
8008H–AVR–04/11
ATtiny48/88
16. Analog Comparator
The Analog Comparator compares the input values on the positive pin AIN0 and negative pin
AIN1. When the voltage 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 com-
parator output rise, fall or toggle. A block diagram of the comparator and its surrounding logic is
.
The ADC Power Reduction bit, PRADC, must be disabled in order to use the ADC input multi-
plexer. This is done by clearing the PRADC bit in the Power Reduction Register, PRR. See
Figure 16-1. Analog Comparator Block Diagr
am(2) Notes:
placement.
16.1
Analog Comparator Multiplexed Input
It is possible to select any of the ADC[7:0] pins to replace the negative input to the Analog Com-
parator. 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[2:0] in ADMUX
select the input pin to replace the negative input to the Analog Comparator, as shown in
Table16-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 16-1.
Analog Comparator Multiplexed Input
ACME
ADEN
MUX[2:0]
Analog Comparator Negative Input
0
x
xxx
AIN1
1
xxx
AIN1
1
0
000
ADC0
1
0
001
ADC1