English
Language : 

ATTINY40_14 Datasheet, PDF (94/204 Pages) ATMEL Corporation – 8-bit Atmel tinyAVR Microcontroller
14. Analog Comparator
The analog comparator compares the input values on the positive pin AIN0 and negative pin AIN1. When the volt-
age on the positive pin AIN0 is higher than the voltage on the negative pin AIN1, the Analog Comparator Output,
ACO, is set. 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 sur-
rounding logic is shown in Figure 14-1.
Figure 14-1. Analog Comparator Block Diagram
BANDGAP
REFERENCE
ACBG
VCC
ACD
AIN0
+
_
AIN1
ACIE
INTERRUPT
SELECT
ACIS1 ACIS0
ANALOG
COMPARATOR
IRQ
ACI
ACME
ADC MULTIPLEXER
OUTPUT (1)
HSEL
HLEV
ACIC
To T/C1 Capture
Trigger MUX
ACO
Notes: 1. See Table 14-1 on page 95.
See Figure 1-1 on page 2 and Table 10-9 on page 54 for Analog Comparator pin placement.
The ADC Power Reduction bit, PRADC, must be disabled in order to use the ADC input multiplexer. This is done
by clearing the PRADC bit in the Power Reduction Register, PRR. See “PRR – Power Reduction Register” on page
27 for more details.
When the supply voltage is below 2.7V, it is recommended to disable the ADC Power Reduction bit, PRADC, in
order to use AIN0, AIN1, or a bandgap reference as an analog comparator input.
14.1
Analog Comparator Multiplexed Input
When the Analog to Digital Converter (ADC) is configurated as single ended input channel, 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. If the Analog Comparator Multiplexer Enable bit (ACME in ADCSRB) is set, MUX bits in ADMUX
select the input pin to replace the negative input to the analog comparator.
ATtiny40 [DATASHEET]
94
8263B–AVR–01/2013