English
Language : 

PIC16F946 Datasheet, PDF (98/274 Pages) Microchip Technology – 64-Pin Flash-Based, 8-Bit CMOS Microcontrollers with LCD Driver and nanoWatt Technology
PIC16F946
8.1 Comparator Operation
A single comparator is shown in Figure 8-1 along with
the relationship between the analog input levels and
the digital output. When the analog input at VIN+ is less
than the analog input VIN-, the output of the comparator
is a digital low level. When the analog input at VIN+ is
greater than the analog input VIN-, the output of the
comparator is a digital high level. The shaded areas of
the output of the comparator in Figure 8-1 represent
the uncertainty due to input offsets and response time.
Note:
To use CIN+ and CIN- pins as analog
inputs, the appropriate bits must be
programmed in the CMCON0 (9Ch)
register.
The polarity of the comparator output can be inverted
by setting the CxINV bits (CMCON0<5:4>). Clearing
CxINV results in a non-inverted output. A complete
table showing the output state versus input conditions
and the polarity bit is shown in Table 8-1.
TABLE 8-1: OUTPUT STATE VS. INPUT
CONDITIONS
Input Conditions
CINV
CxOUT
VIN- > VIN+
VIN- < VIN+
VIN- > VIN+
VIN- < VIN+
0
0
0
1
1
1
1
0
FIGURE 8-1:
VIN+
VIN-
SINGLE COMPARATOR
+
Output
–
VIVNI-N–
VVININ++
OOuuttppuutt
8.2 Analog Input Connection
Considerations
A simplified circuit for an analog input is shown in
Figure 8-2. Since the analog pins are connected to a
digital output, they have reverse biased 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 forward biased and a latch-up may occur. A
maximum source impedance of 10 kΩ is recommended
for the analog sources. Any external component
connected to an analog input pin, such as a capacitor
or a Zener diode, should have very little leakage.
FIGURE 8-2:
ANALOG INPUT MODEL
VDD
Rs < 10K
VT = 0.6V
RIC
AIN
VA
CPIN
5 pF
VT = 0.6V
Leakage
±500 nA
Vss
Legend: CPIN = Input Capacitance
VT = Threshold Voltage
ILEAKAGE= Leakage Current at the pin due to various junctions
RIC = Interconnect Resistance
RS = Source Impedance
VA = Analog Voltage
DS41265A-page 96
Preliminary
© 2005 Microchip Technology Inc.