
96
ATtiny40 [DATASHEET]
8263B–AVR–01/2013
Bit 3 – ACIE: Analog Comparator Interrupt Enable
When the ACIE bit is written logic one and the I-bit in the Status Register is set, the Analog Comparator interrupt is
activated. When written logic zero, the interrupt is disabled.
Bit 2 – ACIC: Analog Comparator Input Capture Enable
When written logic one, this bit enables the input capture function in Timer/Counter1 to be triggered by the Analog
Comparator. The comparator output is then directly connected to the input capture front-end logic, making the
comparator utilize the noise canceler and edge select features of the Timer/Counter1 Input Capture interrupt.
When written logic zero, no connection between the Analog Comparator and the input capture function exists. To
make the comparator trigger the Timer/Counter1 Input Capture inter-rupt, the ICIE1 bit in the Timer Interrupt Mask
Register (TIMSK) must be set.
Bits 1:0 – ACIS[1:0]: Analog Comparator Interrupt Mode Select
These bits determine which comparator events that trigger the Analog Comparator interrupt. The different settings
When changing the ACIS1/ACIS0 bits, the Analog Comparator Interrupt must be disabled by clearing its Interrupt
Enable bit in the ACSR Register. Otherwise an interrupt can occur when the bits are changed.
14.2.2
ACSRB – Analog Comparator Control and Status Register B
Bit 7 – HSEL: Hysteresis Select
When this bit is written logic one, the hysteresis of the analog comparator is enabled. The level of hysteresis is
selected by the HLEV bit.
Bit 6 – HLEV: Hysteresis Level
When enabled via the HSEL bit, the level of hysteresis can be set using the HLEV bit, as shown in
Table 14-3. Bit 5 – ACLP
This bit is reserved for QTouch, always write as zero.
Table 14-2.
ACIS1/ACIS0 Settings
ACIS1
ACIS0
Interrupt Mode
0
Comparator Interrupt on Output Toggle.
01
Reserved
1
0
Comparator Interrupt on Falling Output Edge.
1
Comparator Interrupt on Rising Output Edge.
Bit
7
6543210
HSEL
HLEV
ACLP
–
ACCE
ACME
ACIRS1
ACIRS0
ACSRB
Read/Write
R/W
R
R/W
Initial Value
0
0000000
Table 14-3.
Selecting Level of Analog Comparator Hysteresis
HSEL
HLEV
Hysteresis of Analog Comparator
0
X
Not enabled
1
020 mV
150 mV