English
Language : 

PIC18LF24K Datasheet, PDF (461/594 Pages) –
PIC18(L)F26/45/46K40
32.0 COMPARATOR MODULE
Note:
The PIC18(L)F26/45/46K40 devices have
two comparators. Therefore, all informa-
tion in this section refers to both C1 and
C2.
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:
• Programmable input selection
• Programmable output polarity
• Rising/falling output edge interrupts
• Wake-up from Sleep
• CWG Auto-shutdown source
• Selectable voltage reference
• ADC Auto-trigger
• TMR1/3/5 Gate
• TMR2/4/6 Reset
• CCP Capture Mode Input
• DSM Modulator Source
• Input and Window signal to Signal Measurement
Timer
32.1 Comparator Overview
A single comparator is shown in Figure 32-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 32-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.
 2016 Microchip Technology Inc.
Preliminary
DS40001816C-page 461