Datasheet

Table Of Contents
25. AC - Analog Comparator
25.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 in the figure below.
Figure 25-1. Analog Comparator Block Diagram
(2)
ACBG
BANDGAP
REFERENCE
ADC MULTIPLEXER
OUTPUT
ACME
ADEN
(1)
Note: 
1. See Table Analog Comparator Multiplexed Input in next section.
2. Refer to the Pin Configuration and the Port D Pins Alternate Functions Table.
Related Links
Pin Configurations on page 13
Alternate Functions of Port D on page 86
25.2. Analog Comparator Multiplexed Input
It is possible to select any of the ADC7: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 SFIOR) is set and the ADC is
switched off (ADEN in ADCSRA is zero), MUX2:0 in ADMUX select the input pin to replace the negative
input to the Analog Comparator, as shown in the table below. If ACME is cleared or ADEN is set, AIN1 is
applied to the negative input to the Analog Comparator.
Table 25-1. Analog Comparator Multiplexed Input
ACME ADEN MUX[2:0] Analog Comparator Negative Input
0 x xxx AIN1
1 1 xxx AIN1
Atmel ATmega32A [DATASHEET]
Atmel-8155I-ATmega32A_Datasheet_Complete-08/2016
253