18.4.1 Analog Comparator Control and Status Register
Name: | ACSRA |
Offset: | 0x1F |
Reset: | 0 |
Bit | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | |
ACD | ACBG | ACO | ACI | ACIE | ACIC | ACISn[1:0] | |||
Access | R/W | R/W | R | R/W | R/W | R/W | R/W | R/W | |
Reset | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
Bit 7 – ACD Analog Comparator Disable
Bit 6 – ACBG Analog Comparator Bandgap ENABLE
When this bit is set, 1.1V bandgap reference voltage is enabled. When ACPMUX bit is also set, bandgap reference voltage is applied to the positive input of analog comparator. It is advised that bandgap reference is first enabled by writing one to ACBG bit and then selected by writing one to ACPMUX bit to allow the stabilization of voltage.
Bit 5 – ACO Analog Comparator Output
Bit 4 – ACI Analog Comparator Interrupt Flag
Bit 3 – ACIE Analog Comparator Interrupt Enable
Bit 2 – ACIC Analog Comparator Input Capture Enable
Bits 1:0 – ACISn[1:0] Analog Comparator Interrupt Mode Select [n = 1:0]
These bits determine which comparator events that trigger the Analog Comparator interrupt.
ACIS1 | ACIS0 | Interrupt Mode |
---|---|---|
0 | 0 | Comparator Interrupt on Output Toggle. |
0 | 1 | Reserved |
1 | 0 | Comparator Interrupt on Falling Output Edge. |
1 | 1 | Comparator Interrupt on Rising Output Edge. |
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.