English
Language : 

PIC16LF1824T39A_12 Datasheet, PDF (163/418 Pages) Microchip Technology – 20-Pin Flash Microcontrollers with XLP Technology
PIC16LF1824T39A
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 VIN+ is
less than the analog voltage at VIN-, the output of the
comparator is a digital low level. When the analog
voltage at VIN+ is greater than the analog voltage at
VIN-, the output of the comparator is a digital high level.
FIGURE 19-1:
SINGLE COMPARATOR
VIN+
+
VIN-
–
Output
VIN-
VIN+
Output
Note:
The black areas of the output of the
comparator represents the uncertainty
due to input offsets and response time.
FIGURE 19-2:
COMPARATOR MODULE SIMPLIFIED BLOCK DIAGRAM
CxNCH<1:0>
2
CxON(1)
Interrupt
CxINTP
det
C12IN0-
0
Set CxIF
C12IN1-
C12IN2-
C12IN3-
CXIN+
DAC_output
FVR Buffer2
1
MUX
2 (1)
3
0
MUX
1 (1)
2
CxVN -
+
CxVP
Cx(2)
CxHYS
CxSP
CXPOL
Interrupt
det
CxINTN
DQ
Q1 EN
CXOUT
MCXOUT
To Data Bus
async_CxOUT
To ECCP PWM Logic
3
VSS
CxON(1)
CXSYNC
CXOE TRIS bit
CXPCH<1:0>
2
0
DQ
1
(from Timer1)
T1CLK
CXOUT
sync_CxOUT To Timer1,
SR Latch
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.
 2012 Microchip Technology Inc.
Preliminary
DS41657A-page 163