27.3.1 Analog Comparator Control and Status Register
When addressing I/O registers as data space using LD and ST instructions, the provided offset must be used. When using the I/O specific commands IN and OUT, the offset is reduced by 0x20, resulting in an I/O address offset within 0x00 - 0x3F.
The device is a complex microcontroller with more peripheral units than can be supported within the 64 locations reserved in Opcode for the IN and OUT instructions. For the extended I/O space from 0x60 in SRAM, only the ST/STS/STD and LD/LDS/LDD instructions can be used.
Name: | ACSR |
Offset: | 0x50 |
Reset: | N/A |
Property: | When addressing as I/O Register: address offset is 0x30 |
Bit | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | |
ACD | ACBG | ACO | ACI | ACIE | ACIC | ACIS [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 Select
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 – ACIS [1:0] Analog Comparator Interrupt Mode Select
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.