Microchip Technology MA160014 Data Sheet

Page of 560
 2010-2012 Microchip Technology Inc.
DS41412F-page 311
PIC18(L)F2X/4XK22
18.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.
The comparators are very useful mixed signal building
blocks because they provide analog functionality
independent of the 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
• Selectable Hysteresis
18.1
 Comparator Overview
A single comparator is shown in 
 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 18-1:
SINGLE COMPARATOR      
+
V
IN
+
V
IN
-
Output
Output
V
IN
+
V
IN
-
Note:
The black areas of the output of the
comparator represents the uncertainty
due to input offsets and response time.