245
ATmega16M1/32M1/64M1 [DATASHEET]
8209E–AVR–11/2012
23.3
Use of ADC amplifiers
Thanks to AMPCMP0 configuration bit, Comparator 0 positive input can be connected to Amplifier O output. In that
Thanks to AMPCMP1 configuration bit, Comparator 1 positive input can be connected to Amplifier 1 output. In that
Thanks to AMPCMP2 configuration bit, Comparator 2 positive input can be connected to Amplifier 2 output. In that
23.4
Register description
Each analog comparator has its own control register. A dedicated register has been designed to consign the out-
puts and the flags of the four analog comparators.
23.4.1
AC0CON – Analog Comparator 0 Control Register
Bit 7 – AC0EN: Analog Comparator 0 Enable Bit
Set this bit to enable the analog Comparator 0.
Clear this bit to disable the analog Comparator 0.
Bit 6 – AC0IE: Analog Comparator 0 Interrupt Enable bit
Set this bit to enable the analog Comparator 0 interrupt.
Clear this bit to disable the analog Comparator 0 interrupt.
Bit 5:4 – AC0IS[1:0]: Analog Comparator 0 Interrupt Select bit
These two bits determine the sensitivity of the interrupt trigger.
Bit 3 – ACCKSEL: Analog Comparator Clock Select
Set this bit to use the PLL output as comparator clock.
Clear this bit to use the CLK
IO as comparator clock.
Bit 2:0 – AC0M[2:0]: Analog Comparator 0 Multiplexer register
These three bits determine the input of the negative input of the analog comparator.
Bit
7
654
3
2
1
0
AC0EN
AC0IE
AC0IS1
AC0IS0
ACCKSEL
AC0M2
AC0M1
AC0M0
AC0CON
Read/write
R/W
Initial value
0
Table 23-1.
Interrupt sensitivity selection.
AC0IS[1:0]
Description
00
Comparator Interrupt on output toggle
01
Reserved
10
Comparator interrupt on output falling edge
11
Comparator interrupt on output rising edge