English
Language : 

PIC32MX440F256H-80I Datasheet, PDF (548/646 Pages) Microchip Technology – 64/100-Pin General Purpose and USB 32-Bit Flash Microcontrollers
PIC32MX3XX/4XX
24.4 Comparator Outputs
The comparator output is read through the CMSTAT
register and the COUT bit (CM2CON<8> or
CM1CON<8>). This bit is read-only. The comparator
output may also be directed to an I/O pin via the
CxOUT bit; however, the COUT bit is still valid when
the signal is routed to a pin. For the comparator output
to be available on the CxOut pin, the associated TRIS
bit for the output pin must be configured as an output.
When the COUT signal is routed to a pin the signal is
the unsynchronized output of the comparator.
The output of the comparator has a degree of uncer-
tainty. The uncertainty of each of the comparators is
related to the input offset voltage and the response
time, as stated in the specifications. The lower portion
of Figure 24-2 provides a graphical representation of
this uncertainty.
The comparator output bit, COUT, provides the latched
sampled value of the comparator’s output- when the
register was read. There are two common methods
used to detect a change in the comparator output:
• Software polling
• Interrupt generation
24.4.1 CHANGING THE POLARITY OF
COMPARATOR OUTPUTS
The polarity of the comparator outputs can be changed
using the CPOL bit (CMxCON<13>). CPOL appears
below the comparator Cx on the left side of Figure 24-1.
24.5 Analog Input Connection
Considerations
A simplified circuit for an analog input is shown in
Figure 24-3. 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 current. See the device data sheet for input
voltage limits. If a pin is to be shared by two or more
analog inputs that are to be used simultaneously, the
loading effects of all the modules involved must be
taken into consideration. This loading may reduce the
accuracy of one or more of the modules connected to
the common pin. This may also require a lower source
impedance than is stated for a single module with
exclusive use of a pin in Analog mode.
Notes:
When reading the PORT register, all pins
configured as analog inputs will read as a
‘0’. Pins configured as digital inputs will
convert an analog input according to the
Schmitt Trigger input specification.
Analog levels on any pin defined as a
digital input may cause the input buffer to
consume more current than is specified.
FIGURE 24-3:
COMPARATOR ANALOG INPUT MODEL
RS < 10k
AIN
VA
CPIN
5 pF
VDD
RIC
ILEAKAGE
±500 nA
VSS
Comparator
Input
Legend: CPIN
=
LEAKAGE =
RIC
=
RS
=
VA
=
Input Capacitance
Leakage Current at the pin due to various junctions
Interconnect Resistance
Source Impedance
Analog Voltage
DS61143E-page 546
Preliminary
© 2008 Microchip Technology Inc.