Microchip Technology MA330025-1 Data Sheet
dsPIC33EPXXX(GP/MC/MU)806/810/814 and PIC24EPXXX(GP/GU)810/814
DS70616G-page 218
2009-2012 Microchip Technology Inc.
11.5
I/O Helpful Tips
1.
under “Injection Current”, have internal
protection diodes to V
DD
and V
SS
and V
DD
and V
SS
power rails, may affect the ADC
accuracy by four to six counts.
2.
I/O pins that are shared with any analog input pin,
(i.e., ANx, see
(i.e., ANx, see
), are always analog pins by default
after any Reset. Consequently, configuring a pin
as an analog input pin, automatically disables the
digital input pin buffer and any attempt to read the
digital input level by reading PORTx or LATx will
always return a ‘0’, regardless of the digital logic
level on the pin. To use a pin as a digital I/O pin on
a shared analog pin (see
as an analog input pin, automatically disables the
digital input pin buffer and any attempt to read the
digital input level by reading PORTx or LATx will
always return a ‘0’, regardless of the digital logic
level on the pin. To use a pin as a digital I/O pin on
a shared analog pin (see
), the user application needs
to configure the Analog Pin Configuration registers
in the I/O ports module (i.e., ANSELx) by setting
the appropriate bit that corresponds to that I/O port
pin to a ‘0’.
in the I/O ports module (i.e., ANSELx) by setting
the appropriate bit that corresponds to that I/O port
pin to a ‘0’.
3.
Most I/O pins have multiple functions. Referring to
the device pin diagrams in the data sheet, the
priorities of the functions allocated to any pins are
indicated by reading the pin name from left to right.
The left most function name takes precedence
over any function to its right in the naming conven-
tion. For example: AN16/T2CK/T7CK/RC1; this
indicates that AN16 is the highest priority in this
example and will supersede all other functions to
its right in the list. Those other functions to its right,
even if enabled, would not work as long as any
other function to its left was enabled. This rule
applies to all of the functions listed for a given pin.
Dedicated peripheral functions are always higher
priority than remappable functions. I/O pins are
always the lowest priority.
the device pin diagrams in the data sheet, the
priorities of the functions allocated to any pins are
indicated by reading the pin name from left to right.
The left most function name takes precedence
over any function to its right in the naming conven-
tion. For example: AN16/T2CK/T7CK/RC1; this
indicates that AN16 is the highest priority in this
example and will supersede all other functions to
its right in the list. Those other functions to its right,
even if enabled, would not work as long as any
other function to its left was enabled. This rule
applies to all of the functions listed for a given pin.
Dedicated peripheral functions are always higher
priority than remappable functions. I/O pins are
always the lowest priority.
4.
Each pin has an internal weak pull-up resistor and
pull-down resistor that can be configured using the
CNPUx and CNPDx registers, respectively. These
resistors eliminate the need for external resistors
in certain applications. The internal pull-up is up to
~(V
pull-down resistor that can be configured using the
CNPUx and CNPDx registers, respectively. These
resistors eliminate the need for external resistors
in certain applications. The internal pull-up is up to
~(V
DD
-0.8), not V
DD
. This value is still above the
minimum V
IH
of CMOS and TTL devices.
5.
When driving LEDs directly, the I/O pin can source
or sink more current than what is specified in the
V
or sink more current than what is specified in the
V
OH
/I
OH
and V
OL
/I
OL
DC characteristic specifica-
tion. The respective I
OH
and I
OL
current rating only
applies to maintaining the corresponding output at
or above the V
or above the V
OH
and at or below the V
OL
levels.
However, for LEDs, unlike digital inputs of an
externally connected device, they are not gov-
erned by the same minimum V
externally connected device, they are not gov-
erned by the same minimum V
IH
/V
IL
levels. An I/O
pin output can safely sink or source any current
less than that listed in the absolute maximum
rating section of the data sheet. For example:
less than that listed in the absolute maximum
rating section of the data sheet. For example:
V
OH
= 2.4v @ I
OH
= -8 mA and V
DD
= 3.3V
The maximum output current sourced by any 8 mA
I/O pin = 12 mA.
LED source current < 12 mA is technically
permitted. Refer to the V
I/O pin = 12 mA.
LED source current < 12 mA is technically
permitted. Refer to the V
OH
/I
OH
graphs in
additional information.
6.
The Peripheral Pin Select (PPS) pin mapping rules
are as follows:
a) Only one “output” function can be active on a
are as follows:
a) Only one “output” function can be active on a
given pin at any time regardless if it is a dedi-
cated or remappable function (one pin, one
output).
cated or remappable function (one pin, one
output).
b)
It is possible to assign a “remappable output”
function to multiple pins and externally short or
tie them together for increased current drive.
function to multiple pins and externally short or
tie them together for increased current drive.
c)
If any “dedicated output” function is enabled
on a pin, it will take precedence over any
remappable “output” function.
on a pin, it will take precedence over any
remappable “output” function.
d) If any “dedicated digital” (input or output)
function is enabled on a pin, any number of
“input” remappable functions can be mapped
to the same pin.
“input” remappable functions can be mapped
to the same pin.
e) If any “dedicated analog” function(s) are
enabled on a given pin, “digital input(s)” of any
kind will all be disabled, although a single “dig-
ital output”, at the user’s cautionary discretion,
can be enabled and active as long as there is
no signal contention with an external analog
input signal. For example, it is possible for the
ADC to convert the digital output logic level, or
to toggle a digital output on a comparator or
ADC input, provided there is no external
analog input, such as for a built-in self test.
kind will all be disabled, although a single “dig-
ital output”, at the user’s cautionary discretion,
can be enabled and active as long as there is
no signal contention with an external analog
input signal. For example, it is possible for the
ADC to convert the digital output logic level, or
to toggle a digital output on a comparator or
ADC input, provided there is no external
analog input, such as for a built-in self test.
f)
Any number of “input” remappable functions
can be mapped to the same pin(s) at the
same time, including any pin with a single out-
put from either a dedicated or remappable
“output”.
can be mapped to the same pin(s) at the
same time, including any pin with a single out-
put from either a dedicated or remappable
“output”.
Note:
Although it is not possible to use a digital
input pin when its analog function is
enabled, it is possible to use the digital I/O
output function, TRISx = 0x0, while the
analog function is also enabled. However,
this is not recommended, particularly if the
analog input is connected to an external
analog voltage source, which would
create signal contention between the
analog signal and the output pin driver.
input pin when its analog function is
enabled, it is possible to use the digital I/O
output function, TRISx = 0x0, while the
analog function is also enabled. However,
this is not recommended, particularly if the
analog input is connected to an external
analog voltage source, which would
create signal contention between the
analog signal and the output pin driver.