Datasheet
24. AC - Analog Comparator
24.1. Overview
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 below.
The Power Reduction ADC bit in the Power Reduction Register (0.PRADC) must be written to '0' in order
to be able to use the ADC input MUX.
Figure 24-1. Analog Comparator Block Diagram
ACBG
BANDGAP
REFERENCE
ADC MULTIPLEXER
OUTPUT
ACME
ADEN
(1)
Note: Refer to the Pin Configuration and the I/O Ports description for Analog Comparator pin placement
Related Links
I/O-Ports on page 95
Power Management and Sleep Modes on page 56
Minimizing Power Consumption on page 59
Pinout on page 13
24.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.
Atmel ATmega644A [DATASHEET]
Atmel-42716C-ATmega644A_Datasheet_Complete-10/2016
297