Datasheet

Table Of Contents
2011-2013 Microchip Technology Inc. DS40001609C-page 153
PIC16(L)F1508/9
17.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
17.1 Comparator Overview
A single comparator is shown in Figure 17-2 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.
The comparators available for this device are listed in
Table 17-1.
FIGURE 17-1: COMPARATOR MODULE SIMPLIFIED BLOCK DIAGRAM
TABLE 17-1: AVAILABLE COMPARATORS
Device C1 C2
PIC16(L)F1509 ●●
PIC16(L)F1508 ●●
Rev. 10-000027A
8/5/2013
000
CxIN0-
CxIN1-
CxIN2-
CxIN3-
00
01
10
11
CxIN+
FVR_buffer2
DAC_out
+
CxVN
CxVP
CxPCH<1:0>
CxNCH<2:0>
2
3
CxON
(1)
CxON
(1)
CxON
(1)
CxSP CxHYS
Interrupt
Rising
Edge
Q1
CxINTP
CxINTN
CxOUT
MCxOUT
CxOUT_async
DQ
0
1
CxSYNC
set bit
CxIF
TRIS bit
CxOUT
CxOUT_sync
to
peripherals
CxOE
-
Interrupt
Falling
Edge
Note 1: When CxON = 0, all multiplexer inputs are disconnected and the Comparator will produce a ‘0’ at the output.
FVR_buffer2
CxPOL
Cx
(From Timer1 Module) T1CLK
001
010
011
100
DQ
to
peripherals