Datasheet

295
ATmega16U4/32U4 [DATASHEET]
Atmel-7766J-USB-ATmega16U4/32U4-Datasheet_04/2016
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 in this case 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 interrupt, the ICIE1
bit in the Timer Interrupt Mask Register (TIMSK1) must be set.
Bits 1, 0 – ACIS1, ACIS0: Analog Comparator Interrupt Mode Select
These bits determine which comparator events that trigger the Analog Comparator interrupt. The different
settings are shown in the table below.
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.
23.2 Analog Comparator Multiplexed Input
It is possible to select any of the ADC13..0 pins to replace the negative input to the Analog Comparator. The
ADC multiplexer is used to select this input, and consequently, the ADC must be switched off to utilize this
feature. If the Analog Comparator Multiplexer Enable bit (ACME in ADCSRB) is set and the ADC is switched off
(ADEN in ADCSRA is zero), and MUX2..0 in ADMUX select the input pin to replace the negative input to the
Analog Comparator, as shown in the table. If ACME is cleared or ADEN is set, the Bandgap reference is applied
to the negative input to the Analog Comparator.
Table 23-1. ACIS1/ACIS0 Settings
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
Table 23-2. Analog Comparator Multiplexed Input
ACME ADEN MUX2..0 Analog Comparator Negative Input
0 x xxx Bandgap Ref.
1 1 xxx Bandgap Ref.
1 0 000 ADC0
1 0 001 ADC1
1 0 010
N/A
1 0 011
1 0 100 ADC4
1 0 101 ADC5
1 0 110 ADC6
1 0 111 ADC7