English
Language : 

PIC16F627A_05 Datasheet, PDF (64/180 Pages) Microchip Technology – Flash-Based, 8-Bit CMOS Microcontrollers with nanoWatt Technology
PIC16F627A/628A/648A
10.1 Comparator Configuration
There are eight modes of operation for the
comparators. The CMCON register is used to select
the mode. Figure 10-1 shows the eight possible
modes. The TRISA register controls the data direction
of the comparator pins for each mode.
If the Comparator mode is changed, the comparator
output level may not be valid for the specified mode
change delay shown in Table 17-2.
Note 1: Comparator interrupts should be disabled
during a Comparator mode change,
otherwise a false interrupt may occur.
2: Comparators can have an inverted
output. See Figure 10-1.
FIGURE 10-1:
COMPARATOR I/O OPERATING MODES
Comparators Reset (POR Default Value)
CM<2:0> = 000
RA0/AN0
A
RA3/AN3/CMP1 A
VIN-
VIN+ C1
Comparators Off
CM<2:0> = 111
RA0/AN0
D
Off (Read as ‘0’) RA3/AN3/CMP1 D
VIN-
VIN+ C1
Off (Read as ‘0’)
RA1/AN1
A
RA2/AN2/VREF A
VIN-
VIN+ C2
Two Independent Comparators
CM<2:0> = 100
RA0/AN0
A
RA3/AN3/CMP1 A
VIN-
VIN+ C1
RA1/AN1
A
VIN-
RA2/AN2/VREF
A
VIN+ C2
Two Common Reference Comparators
CM<2:0> = 011
RA0/AN0
A
RA3/AN3/CMP1 D
VIN-
VIN+ C1
Off (Read as ‘0’)
C1VOUT
RA1/AN1
D
RA2/AN2/VREF D
VIN-
VIN+ C2
Off (Read as ‘0’)
VSS
Four Inputs Multiplexed to Two Comparators
CM<2:0> = 010
RA0/AN0
A
RA3/AN3/CMP1 A
CIS = 0 VIN-
CIS = 1 VIN+ C1
C1VOUT
C2VOUT
RA1/AN1
A
RA2/AN2/VREF A
CIS = 0 VIN-
CIS = 1 VIN+ C2
C2VOUT
C1VOUT
From VREF
Module
Two Common Reference Comparators with Outputs
CM<2:0> = 110
RA0/AN0
A
RA3/AN3/CMP1 D
VIN-
VIN+ C1
C1VOUT
RA1/AN1
A
RA2/AN2/VREF A
VIN-
VIN+ C2
One Independent Comparator
CM<2:0> = 101
RA0/AN0
D
RA3/AN3/CMP1 D
VIN-
VIN+ C1
VSS
RA1/AN1
A
RA2/AN2/VREF A
VIN-
VIN+ C2
C2VOUT
RA1/AN1
RA2/AN2/VREF
A
VIN-
A
VIN+ C2
C2VOUT
RA4/T0CKI/CMP2 Open Drain
Three Inputs Multiplexed to Two Comparators
CM<2:0> = 001
Off (Read as ‘0’)
RA0/AN0
A
RA3/AN3/CMP1 A
CIS = 0 VIN-
CIS = 1 VIN+ C1
C1VOUT
C2VOUT
RA1/AN1
A
RA2/AN2/VREF A
VIN-
VIN+ C2
C2VOUT
A = Analog Input, port reads zeros always.
D = Digital Input.
CIS (CMCON<3>) is the Comparator Input Switch.
DS40044D-page 62
© 2005 Microchip Technology Inc.