English
Language : 

PIC16F676-I Datasheet, PDF (40/132 Pages) Microchip Technology – 14-Pin, Flash-Based 8-Bit CMOS Microcontrollers
PIC16F630/676
6.1 Comparator Operation
A single comparator is shown in Figure 6-1, along with
the relationship between the analog input levels and
the digital output. When the analog input at VIN+ is less
than the analog input VIN-, the output of the comparator
is a digital low level. When the analog input at VIN+ is
greater than the analog input VIN-, the output of the
comparator is a digital high level. The shaded areas of
the output of the comparator in Figure 6-1 represent
the uncertainty due to input offsets and response time.
Note:
To use CIN+ and CIN- pins as analog
inputs, the appropriate bits must be
programmed in the CMCON (19h) register.
The polarity of the comparator output can be inverted
by setting the CINV bit (CMCON<4>). Clearing CINV
results in a non-inverted output. A complete table
showing the output state versus input conditions and
the polarity bit is shown in Table 6-1.
TABLE 6-1: OUTPUT STATE VS. INPUT
CONDITIONS
Input Conditions
VIN- > VIN+
VIN- < VIN+
VIN- > VIN+
VIN- < VIN+
CINV
0
0
1
1
COUT
0
1
1
0
FIGURE 6-1:
SINGLE COMPARATOR
VIN+
+
VIN-
–
Output
VIN-
VIN+
Output
Note: CINV bit (CMCON<4>) is clear.
DS40039F-page 40
 2010 Microchip Technology Inc.