English
Language : 

PIC16F1508 Datasheet, PDF (153/422 Pages) Microchip Technology – 20-Pin Flash, 8-Bit Microcontrollers with XLP Technology
PIC16(L)F1508/9
17.2.5 COMPARATOR OUTPUT POLARITY
Inverting the output of the comparator is functionally
equivalent to swapping the comparator inputs. The
polarity of the comparator output can be inverted by
setting the CxPOL bit of the CMxCON0 register.
Clearing the CxPOL bit results in a non-inverted output.
Table 17-2 shows the output state versus input
conditions, including polarity control.
TABLE 17-2: COMPARATOR OUTPUT
STATE VS. INPUT CONDITIONS
Input Condition CxPOL
CxOUT
CxVN > CxVP
0
0
CxVN < CxVP
0
1
CxVN > CxVP
1
1
CxVN < CxVP
1
0
17.2.6 COMPARATOR SPEED/POWER
SELECTION
The trade-off between speed or power can be opti-
mized during program execution with the CxSP control
bit. The default state for this bit is ‘1’ which selects the
Normal-Speed mode. Device power consumption can
be optimized at the cost of slower comparator propaga-
tion delay by clearing the CxSP bit to ‘0’.
17.3 Analog Input Connection
Considerations
A simplified circuit for an analog input is shown in
Figure 17-3. Since the analog input pins share their
connection with a digital input, they have reverse
biased ESD protection diodes to VDD and VSS. The
analog input, therefore, must be between VSS and VDD.
If the input voltage deviates from this range by more
than 0.6V in either direction, one of the diodes is for-
ward biased and a latch-up may occur.
A maximum source impedance of 10 k is recommended
for the analog sources. Also, any external component
connected to an analog input pin, such as a capacitor or
a Zener diode, should have very little leakage current to
minimize inaccuracies introduced.
Note 1: When reading a PORT register, all pins
configured as analog inputs will read as a
‘0’. Pins configured as digital inputs will
convert as an analog input, according to
the input specification.
2: Analog levels on any pin defined as a
digital input, may cause the input buffer to
consume more current than is specified.
FIGURE 17-3:
ANALOG INPUT MODEL
Rs < 10K
Analog
Input
pin
VDD
VT  0.6V
VA
CPIN
5 pF
VT  0.6V
RIC
ILEAKAGE(1)
To Comparator
Vss
Legend:
CPIN = Input Capacitance
ILEAKAGE = Leakage Current at the pin due to various junctions
RIC
= Interconnect Resistance
RS
= Source Impedance
VA
= Analog Voltage
VT
= Threshold Voltage
Note 1: See Section 29.0 “Electrical Specifications”.
 2011-2013 Microchip Technology Inc.
DS40001609B-page 153