English
Language : 

PIC24FJ128GC010 Datasheet, PDF (184/472 Pages) Microchip Technology – 16-Bit Flash Microcontrollers with 12-Bit Pipeline A/D, Sigma-Delta A/D, USB On-The-Go and XLP Technology
PIC24FJ128GC010 FAMILY
11.1.1 I/O PORT WRITE/READ TIMING
One instruction cycle is required between a port direction
change or port write operation and a read operation of
the same port. Typically, this instruction would be a NOP.
11.1.2 OPEN-DRAIN CONFIGURATION
In addition to the PORTx, LATx and TRISx registers for
data control, each port pin can also be individually
configured for either a digital or open-drain output. This
is controlled by the Open-Drain Control register, ODCx,
associated with each port. Setting any of the bits
configures the corresponding pin to act as an
open-drain output.
The open-drain feature allows the generation of
outputs higher than VDD (e.g., 5V) on any desired
digital only pins by using external pull-up resistors. The
maximum open-drain voltage allowed is the same as
the maximum VIH specification.
11.1.3 GPIO FUNCTIONS ON THE USB PINS
When the USB module is enabled, the USB module
controls the RG2/RG3/RF7 port pins. General purpose
input/output and related interrupt-on-change function-
ality can be made available on the RG2/RG3/RF7 pins
when the USB module is disabled and the UTRDIS
(U1CNFG2<0>) bit is set. Additionally, for general
purpose digital input function on RF7/VBUS, the ANSF7
bit must be cleared.
11.2 Configuring Analog Port Pins
(ANSx)
The ANSx and TRISx registers control the operation of
the pins with analog function. Each port pin with analog
function is associated with one of the ANSx bits (see
Register 11-1 through Register 11-7), which decides if
the pin function should be analog or digital. Refer to
Table 11-1 for detailed behavior of the pin for different
ANSx and TRISx bit settings.
When reading the PORTx register, all pins configured as
analog input channels will read as cleared (a low level).
11.2.1
ANALOG INPUT PINS AND
VOLTAGE CONSIDERATIONS
The voltage tolerance of pins used as device inputs is
dependent on the pin’s input function. Most input pins are
able to handle DC voltages of up to 5.5V, a level typical
for digital logic circuits. However, several pins can only
tolerate voltages up to VDD. Voltage excursions beyond
VDD on these pins should always be avoided.
Table 11-2 summarizes the different voltage tolerances.
Refer to Section 37.0 “Electrical Characteristics” for
more details.
TABLE 11-1: CONFIGURING ANALOG/DIGITAL FUNCTION OF AN I/O PIN
Pin Function
ANSx Setting
TRISx Setting
Comments
Analog Input
1
Analog Output
1
Digital Input
0
Digital Output
0
1
It is recommended to keep ANSx = 1.
1
It is recommended to keep ANSx = 1.
1
Firmware must wait at least one instruction cycle
after configuring a pin as a digital input before a valid
input value can be read.
0
Make sure to disable the analog output function on
the pin if any is present.
DS30009312B-page 184
 2012-2013 Microchip Technology Inc.