Specifications

128
3706C–MICRO–2/11
AT89LP3240/6440
Figure 19-2. Equivalent Analog Input Model
19.2 Internal Reference Voltage
The negative input terminal of each comparator may be connected to an internal voltage refer-
ence by cha nging the RFB
1-0
or RFA
1-0
bits in AREF. The internal reference voltage, V
AREF
, is
set to 1.3 V ±5%. The voltage reference also provides two additional voltage levels approxi-
mately 100 mV above and below V
AREF
. These levels may be used to configure the comparators
as an internally referenced window comparator with up to four input channels. Changing the ref-
erence input must follow the same routine used for changing the positive input as described in
“Analog Input Muxesabove.
19.3 Comparator Interrupt Debouncing
The comparator output is normally sampled every clock cycle. The conditions on the analog
inputs may be such that the comparator output will toggle excessively. This is especially true if
applying slow moving analog inputs. Three debouncing modes are provided to filter out this
noise for edge-triggered interrupts. In debouncing mode, the comparator uses Timer 1 to modu-
late it
s sampling time when CxC
1-0
= 00B. When a relevant transition occurs, the comparator
waits until two Timer 1 overflows have occurred before resampling the output. If the new sample
agrees with the expected value, CFx is set. Otherwise, the event is ignored. The filter may be
tuned by adjusting the time-out period of Timer 1. Because Timer 1 is free running, the
debouncer must wait for two overflows to guarantee that the sampling delay is
at least 1 time-out
period. Therefore, after the initial edge event, the interrupt may occur between 1 and 2 time-out
periods later. See Figure 19-3. When the comparator clock is provided by one of the timer over-
flows, i.e. CxC
1-0
!= 00B, any change in the comparator output must be valid after 4 samples to
be accepted as an edge event.
Figure 19-3. Negative Edge with Debouncing Example
AINn
C
CMP
<
0.3 pF
R
IN
=
10 kΩ
C
PIN
=
10 pF
R
MUX
=
10 kΩ
Comparator Out
Timer 1 Overflow
CFx
Start Start
Compare
(rejected)
Compare
(accepted)