Datasheets»Microchip Technology»PIC16F87XATI/SP Datasheet

PIC16F87XATI/SP Datasheet - Page 136

Download or read online Microchip Technology PIC16F87XATI/SP 28/40/44-Pin Enhanced Flash Microcontrollers pdf datasheet.



Page
136 of 234
prevnext
PIC16F87XA
12.1
Comparator Configuration
There are eight modes of operation for the compara-
tors. The CMCON register is used to select these
modes. Figure 12-1 shows the eight possible modes.
The TRISA register controls the data direction of the
comparator pins for each mode. If the Comparator
FIGURE 12-1:
COMPARATOR I/O OPERATING MODES
Comparators Reset
CM2:CM0 = 000
A
V
-
IN
RA0/AN0
Off (Read as ‘0’)
C1
V
+
A
IN
RA3/AN3
A
V
-
IN
RA1/AN1
Off (Read as ‘0’)
C2
V
+
A
IN
RA2/AN2
Two Independent Comparators
CM2:CM0 = 010
A
V
-
IN
RA0/AN0
C1OUT
C1
V
+
A
IN
RA3/AN3
A
V
-
IN
RA1/AN1
C2
C2OUT
V
+
A
IN
RA2/AN2
Two Common Reference Comparators
CM2:CM0 = 100
A
V
-
IN
RA0/AN0
C1OUT
C1
V
+
A
IN
RA3/AN3
A
V
-
IN
RA1/AN1
C2OUT
C2
V
+
D
IN
RA2/AN2
One Independent Comparator with Output
CM2:CM0 = 001
A
V
-
IN
RA0/AN0
C1OUT
C1
V
+
A
IN
RA3/AN3
RA4/T0CKI/C1OUT
D
V
-
IN
RA1/AN1
Off (Read as ‘0’)
C2
V
+
D
IN
RA2/AN2
A = Analog Input, port reads zeros always. D = Digital Input. CIS (CMCON<3>) is the Comparator Input Switch.
DS39582C-page 136
mode is changed, the comparator output level may not
be valid for the specified mode change delay shown in
Section 17.0 “Electrical Characteristics”.
Note:
Comparator interrupts should be disabled
during a Comparator mode change.
Otherwise, a false interrupt may occur.
Comparators Off (POR Default Value)
CM2:CM0 = 111
D
V
-
IN
RA0/AN0
Off (Read as ‘0’)
C1
V
+
D
IN
RA3/AN3
D
V
-
IN
RA1/AN1
Off (Read as ‘0’)
C2
V
+
D
IN
RA2/AN2
Two Independent Comparators with Outputs
CM2:CM0 = 011
A
V
-
IN
RA0/AN0
C1OUT
C1
V
+
A
IN
RA3/AN3
RA4/T0CKI/C1OUT
A
V
-
IN
RA1/AN1
C2OUT
C2
V
+
A
IN
RA2/AN2
RA5/AN4/SS/C2OUT
Two Common Reference Comparators with Outputs
CM2:CM0 = 101
A
V
-
IN
RA0/AN0
C1OUT
C1
V
+
A
IN
RA3/AN3
RA4/T0CKI/C1OUT
A
V
-
IN
RA1/AN1
C2OUT
C2
V
+
D
IN
RA2/AN2
RA5/AN4/SS/C2OUT
Four Inputs Multiplexed to Two Comparators
CM2:CM0 = 110
A
RA0/AN0
CIS = 0
V
-
IN
A
CIS = 1
RA3/AN3
C1
V
+
IN
A
RA1/AN1
CIS = 0
V
-
IN
A
CIS = 1
RA2/AN2
C2
V
+
IN
CV
REF
 2001-2013 Microchip Technology Inc.
C1OUT
C2OUT
From Comparator
V
Module
REF

Comments to this Datasheet