Datasheet
27. Analog Comparator (AC)
27.1 Overview
The analog comparator evaluates 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 below.
The power reduction ADC bit in the Power Reduction Register (PRR.PRADC) must be written to '0' in
order to be able to use the ADC input MUX.
Figure 27-1. Analog Comparator Block Diagram
ACBG
BANDGAP
REFERENCE
ADC MULTIPLEXER
OUTPUT
ACME
ADEN
(1)
AIN0
AIN1
INTERRUPT
SELECT
ACIS1
ACIS0
ACIC
ACIE
ACO
TO T/C1 CAPTURE
TRIGGER MUX
ACI
ANALOG
COMPARATOR
IRQ
ACD
VCC
Note: Refer to the Pin Configuration and the I/O Ports description for Analog Comparator pin placement
Related Links
18. I/O-Ports
14.12.3 PRR
14. Power Management and Sleep Modes
14.11 Minimizing Power Consumption
27.2 Analog Comparator Multiplexed Input
It is possible to select any of the ADC[7: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 in the ADC Control and Status
Register B (ADCSRB.ACME) is '1' and the ADC is switched off (ADCSRA.ADEN=0), the three least
significant analog channel selection bits in the ADC Multiplexer Selection register (ADMUX.MUX[2:0])
select the input pin to replace the negative input to the analog comparator, as shown in the table below.
When ADCSRB.ACME=0 or ADCSRA.ADEN=1, AIN1 is applied to the negative input of the analog
comparator.
ATmega48PA/88PA/168PA
Analog Comparator (AC)
© 2018 Microchip Technology Inc.
Datasheet Complete
DS40002011A-page 309