Datasheet

203
ATmega48/88/168 Automotive [DATASHEET]
7530K–AVR–07/14
20. 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 comparator output rise, fall
or toggle. A block diagram of the comparator and its surrounding logic is shown in Figure 20-1.
The power reduction ADC bit, PRADC, in Section 7.7.1 “Power Reduction Register - PRR” on page 35 must be disabled by
writing a logical zero to be able to use the ADC input MUX.
Figure 20-1. Analog Comparator Block Diagram
(2)
Notes: 1. See Table 20-2 on page 205.
2. Refer to Figure 1-1 on page 3 and Table 10-9 on page 69 for analog comparator pin placement.
20.1 ADC Control and Status Register B – ADCSRB
Bit 6 – ACME: Analog Comparator Multiplexer Enable
When this bit is written logic one and the ADC is switched off (ADEN in ADCSRA is zero), the ADC multiplexer
selects the negative input to the analog comparator. When this bit is written logic zero, AIN1 is applied
to the negative input of the analog comparator. For a detailed description of this bit, see
Section 20.3 “Analog Comparator Multiplexed Input” on page 205.
Bandgap
Reference
Interrupt
Select
AIN0
VCC
ACIS1
ADC Multiplexer
Output
(1)
ACIS0 ACIC
ACO
ACIE
Analog
Comparator
IRQ
ACI
To T/C1 Capture
Trigger MUX
ACBG
ACME
ADEN
ACD
+
-
AIN1
Bit 7 6543210
–ACME ADTS2 ADTS1 ADTS0 ADCSRB
Read/Write R R/W R R R R/W R/W R/W
Initial Value0 0000000