
95
ATtiny40 [DATASHEET]
8263B–AVR–01/2013
14.2
Register Description
14.2.1
ACSRA – Analog Comparator Control and Status Register
Bit 7 – ACD: Analog Comparator Disable
When this bit is written logic one, the power to the Analog Comparator is switched off. This bit can be set at any
time to turn off the Analog Comparator. This will reduce power consumption in Active and Idle mode. When chang-
ing the ACD bit, the Analog Comparator Interrupt must be disabled by clearing the ACIE bit in ACSR. Otherwise an
interrupt can occur when the bit is changed.
Bit 6 – ACBG: Analog Comparator Bandgap Select
When this bit is set, a fixed, internal bandgap reference voltage replaces the positive input to the Analog Compara-
tor. When this bit is cleared, AIN0 is applied to the positive input of the Analog Comparator.
Bit 5 – ACO: Analog Comparator Output
The output of the Analog Comparator is synchronized and then directly connected to ACO. The synchronization
introduces a delay of 1 - 2 clock cycles.
Bit 4 – ACI: Analog Comparator Interrupt Flag
This bit is set by hardware when a comparator output event triggers the interrupt mode defined by ACIS1 and
ACIS0. The Analog Comparator interrupt routine is executed if the ACIE bit is set and the I-bit in SREG is set. ACI
is cleared by hardware when executing the corresponding interrupt handling vector. Alternatively, ACI is cleared by
writing a logic one to the flag.
Table 14-1.
Analog Comparator Multiplexed Input
ACME
MUX[3:0]
Analog Comparator Negative Input
0
XXXX
AIN1
1
0000
ADC0
1
0001
ADC1
1
0010
ADC2
1
0011
ADC3
1
0100
ADC4
1
0101
ADC5
1
0110
ADC6
1
0111
ADC7
1
1000
ADC8
1
1001
ADC9
1
1010
ADC10
1
1011
ADC11
Bit
765
432
10
ACD
ACBG
ACO
ACI
ACIE
ACIC
ACIS1
ACIS0
ACSRA
Read/Write
R/W
R
R/W
Initial Value
0
N/A
0