Datasheet

© 2007 Microchip Technology Inc. DS40039E-page 39
PIC16F630/676
6.2 Comparator Configuration
There are eight modes of operation for the comparator.
The CMCON register, shown in Register 6-1, is used to
select the mode. Figure 6-2 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 a specified period of time.
Refer to the specifications in Section 12.0.
FIGURE 6-2: COMPARATOR I/O OPERATING MODES
Note: Comparator interrupts should be disabled
during a Comparator mode change. Other-
wise, a false interrupt may occur.
Comparator Reset (POR Default Value - low power) Comparator Off (Lowest power)
CM2:CM0 = 000 CM2:CM0 = 111
Comparator without Output Comparator w/o Output and with Internal Reference
CM2:CM0 = 010 CM2:CM0 = 100
Comparator with Output and Internal Reference Multiplexed Input with Internal Reference and Output
CM2:CM0 = 011 CM2:CM0 = 101
Comparator with Output Multiplexed Input with Internal Reference
CM2:CM0 = 001 CM2:CM0 = 110
A = Analog Input, ports always reads ‘0’
D = Digital Input
CIS = Comparator Input Switch (CMCON<3>)
RA1/CIN-
RA0/CIN+
Off (Read as '0')
A
A
RA2/COUT D
RA1/CIN-
RA0/CIN+
Off (Read as '0')
D
D
RA2/COUT D
RA1/CIN-
RA0/CIN+
COUT
A
A
RA2/COUT D
RA1/CIN-
RA0/CIN+
COUT
A
D
RA2/COUT D
From CVREF Module
RA1/CIN-
RA0/CIN+
COUT
A
D
RA2/COUT D
From CVREF Module
RA1/CIN-
RA0/CIN+
COUT
A
A
RA2/COUT D
From CVREF Module
CIS = 0
CIS = 1
RA1/CIN-
RA0/CIN+
COUT
A
A
RA2/COUT D
RA1/CIN-
RA0/CIN+
COUT
A
A
RA2/COUT D
From CVREF Module
CIS = 0
CIS = 1