Specifications
130
3706C–MICRO–2/11
AT89LP3240/6440
Notes:1.CONA must be cleared to 0 before changing CSA[1-0].
2. Debouncing modes require the use of Timer 1 to generate the sampling delay.
Table 19-1. ACSRA – Analog Compara tor A Control & Status Register
ACSRA = 97H Reset Value = 0000 0000B
Not Bit Addressable
CSA1 CSA0
CONA CFA CENA CMA2 CMA1 CMA0
Bit76543210
Symbol Function
CSA [1-0] Comparator A Positive Input Channel Select
(1)
CSA1 CSA0 A+ Channel
0 0 AIN0 (P2.4)
0 1 AIN1 (P2.5)
1 0 AIN2 (P2.6)
1 1 AIN3 (P2.7)
CONA Comparator A Input Connect. When CONA = 1 the analog input pins are connected to the comparator. When CONA = 0
the analog input pins are disconnected from the comparator. CONA must be cleared to 0 before changing CSA[1-0] or
RFA[1-0].
CFA Comparator A Interrupt Flag. Set when the comparator output meets the conditions specified by the CMA [2-0] bits and
CENA is set. The flag must be cleared
by software. The interrupt may be enabled/disabled by setting/clearing bit 6 of IE.
CENA Comparator A Enable. Set this bit to enable the comparator. Clearing this bit will force the comparator output low and
prevent further events from setting CFA. When CENA = 1 the analog input pins, P2.4—P2.7, have their digital inputs
disabled if they are configured in input-only mode.
CMA [2-0] Comparator A Interrupt Mode
CMA2
CMA1 CMA0 Interrupt Mode
000Negative (Low) level
001Positive edge
010Toggle with debouncing
(2)
011Positive edge with debouncing
(2)
100Negative edge
101Toggle
110Negative edge with debouncing
(2)
111Positive (High) level