Beruflich Dokumente
Kultur Dokumente
ΑΝΑΛΟΓΙΚΟΣ ΣΥΓΚΡΙΤΗΣ
The Analog Comparator compares AIN0 and AIN1. When the voltage on AIN0
is higher than the voltage on AIN1, the Analog Comparator Output, ACO, is
set. The comparator’s output can be set to trigger the Timer/Counter1 Input
Capture function. In addition, the comparator can trigger a separate interrupt,
exclusive to the Analog Comparator.
6.2. Ακροδέκτες αναλογικού συγκριτή
• AIN1/OC3A – Port E, Bit 3
AIN1 – Analog Comparator Negative input. This pin is directly connected to
the negative input of the Analog Comparator.
SFIOR
ADCSRA
6.3.1. Analog comparator Control and Status register - ACSR
These bits determine the comparator events that trigger the Analog
Comparator interrupt (ACI).
The different settings are shown in Table 93.
wait_edge2:
sbi ACSR,ACIS0
sbi ACSR,ACIS1 ;enable interrupt on
; rising output edge
sbi ACSR,ACI ;write a "1" to the
;ACI flag to clear it
we2_1:;----------------------- user code goes here
sbis ACSR,ACI ;if ACI is low ACI