Datasheet

2010-2012 Microchip Technology Inc. DS41419D-page 177
PIC16(L)F1824/1828
19.0 COMPARATOR MODULE
Comparators are used to interface analog circuits to a
digital circuit by comparing two analog voltages and
providing a digital indication of their relative magnitudes.
Comparators are very useful mixed signal building
blocks because they provide analog functionality
independent of program execution. The analog
comparator module includes the following features:
Independent comparator control
Programmable input selection
Comparator output is available internally/externally
Programmable output polarity
Interrupt-on-change
Wake-up from Sleep
Programmable Speed/Power optimization
•PWM shutdown
Programmable and fixed voltage reference
19.1 Comparator Overview
A single comparator is shown in Figure 19-1 along with
the relationship between the analog input levels and
the digital output. When the analog voltage at V
IN+ is
less than the analog voltage at V
IN-, the output of the
comparator is a digital low level. When the analog
voltage at V
IN+ is greater than the analog voltage at
V
IN-, the output of the comparator is a digital high level.
FIGURE 19-1: SINGLE COMPARATOR
FIGURE 19-2: COMPARATOR MODULE SIMPLIFIED BLOCK DIAGRAM
Note 1: When CxON = 0, all multiplexer inputs are disconnected and the Comparator will produce a ‘0’ at the output.
2: Output of comparator can be frozen during debugging.
MUX
Cx
(2)
0
1
2
3
CxON
(1)
CxNCH<1:0>
2
0
1
CXPCH<1:0>
C12IN1-
C12IN2-
C12IN3-
CXIN+
MUX
-
+
CxVN
CxVP
CXOUT
To ECCP PWM Logic
Q1
D
EN
Q
C
XPOL
MCXOUT
Set CxIF
0
1
CXSYNC
CXOE
CXOUT
DQ
DAC_output
FVR Buffer2
C12IN0-
2
CxSP
CxHYS
det
Interrupt
det
Interrupt
CxINTN
CxINTP
To D a ta Bus
2
3
VSS
TRIS bit
CxON
(1)
(1)
(1)
(from Timer1)
T1CLK
To Timer1,
async_CxOUT
SR Latch
sync_CxOUT