PIC32MX3XX/4XX
12.1 Parallel I/O (PIO) Ports
All port pins have three registers (TRIS, LAT and
PORT) that are directly associated with their operation.
The maximum input voltage allowed on the input pins
is the same as the maximum V IH specification. Refer to
specification details.
TRIS is a data direction or tri-state control register that
determines whether a digital pin is an input or an out-
put. Setting a TRISx register bit = 1 configures the cor-
responding I/O pin as an input; setting a TRISx register
bit = 0 configures the corresponding I/O pin as an out-
Note:
Analog levels on any pin that is defined as
a digital input (including the ANx pins) may
cause the input buffer to consume current
that exceeds the device specifications.
put. All port I/O pins are defined as inputs after a device
Reset. Certain I/O pins are shared with analog
peripherals and default to analog inputs after a device
Reset.
PORT is a register used to read the current state of the
signal applied to the port I/O pins. Writing to a PORTx
register performs a write to the port’s latch, LATx
register, latching the data to the port’s I/O pins.
LAT is a register used to write data to the port I/O pins.
The LATx latch register holds the data written to either
the LATx or PORTx registers. Reading the LATx latch
register reads the last value written to the
corresponding port or latch register.
12.1.3 ANALOG INPUTS
Certain pins can be configured as analog inputs used
by the ADC and Comparator modules. Setting the cor-
responding bits in the AD1PCFG register = 0 enables
the pin as an analog input pin and must have the corre-
sponding TRIS bit set = 1 (input). If the TRIS bit is
cleared = 0 (output), the digital output level (V OH or
V OL ) will be converted. Any time a port I/O pin is config-
ured as analog, its digital input is disabled and the cor-
responding PORTx register bit will read ‘ 0 ’. The
AD1PCFG Register has a default value of 0x0000;
therefore, all pins that share ANx functions are analog
(not digital) by default.
Not all port I/O pins are implemented on some devices,
therefore, the corresponding PORTx, LATx and TRISx
12.1.4
DIGITAL OUTPUTS
register bits will read as zeros.
Pins are configured as digital outputs by setting the cor-
12.1.1
CLR, SET AND INV REGISTERS
responding TRIS register bits = 0 . When configured as
digital outputs, these pins are CMOS drivers or can be
Every I/O module register has a corresponding CLR
(clear), SET (set) and INV (invert) register designed to
provide fast atomic bit manipulations. As the name of
the register implies, a value written to a SET, CLR or
INV register effectively performs the implied operation,
but only on the corresponding base register and only
bits specified as ‘ 1 ’ are modified. Bits specified as ‘ 0 ’
are not modified.
Reading SET, CLR and INV registers returns undefined
values. To see the affects of a write operation to a SET,
CLR or INV register, the base register must be read.
configured as open drain outputs by setting the corre-
sponding bits in the ODCx Open-Drain Configuration
register.
The open-drain feature allows the generation of
outputs higher than V DD (e.g., 5V) on any desired 5V
tolerant pins by using external pull-up resistors. The
maximum open-drain voltage allowed is the same as
the maximum V IH specification.
See the “Pin Diagrams” section for the available pins
and their functionality.
12.1.5
ANALOG OUTPUTS
Note:
12.1.2
Using a PORTxINV register to toggle a bit
is recommended because the operation is
performed in hardware atomically, using
fewer instructions as compared to the tra-
ditional read-modify-write method shown
below:
PORTC ^= 0x0001;
DIGITAL INPUTS
Certain pins can be configured as analog outputs, such
as the CV REF output voltage used by the comparator
module. Configuring the Comparator Reference mod-
ule to provide this output will present the analog output
voltage on the pin, independent of the TRIS register
setting for the corresponding pin.
12.1.6 INPUT CHANGE NOTIFICATION
The input change notification function of the I/O ports
Pins are configured as digital inputs by setting the cor-
responding TRIS register bits = 1 . When configured as
inputs, they are either TTL buffers or Schmitt Triggers.
Several digital pins share functionality with analog
inputs and default to the analog inputs at POR. Setting
the corresponding bit in the AD1PCFG register = 1
enables the pin as a digital pin.
DS61143G - page 102
(CNx) allows devices to generate interrupt requests in
response to change of state on selected pin.
Each CNx pin also has a weak pull-up, which acts as a
current source connected to the pin. The pull-ups are
enabled by setting corresponding bit in CNPUE register.
? 2010 Microchip Technology Inc.
相关PDF资料
MA320011 MODULE PLUG-IN PIC32MX220F32D
MA330024 MODULE PLUG-IN DSPIC33F 100TQFP
MA330027 MODULE PLUG-IN DSPIC33F 100TQFP
MA330029 MODULE PLUG-IN DSPIC33FJ16GP102
MA9D00-42 DSUB CONN W/DIAGNOSTIC PORT STRT
MAI ADAPTER PUSH-ON/M-SWTCH ATTCHMNT
MAV0020RP VARISTOR ARRY 2ELEMENT 120V 0405
MAX11503EVKIT+ KIT EVAL FOR MAX11503
相关代理商/技术参数
MA320002-2 制造商:Microchip Technology Inc 功能描述: 制造商:Microchip Technology Inc 功能描述:PIC32MX4XX 100 TO 100-PIN USB PIM - Boxed Product (Development Kits) 制造商:Microchip Technology Inc 功能描述:MODULE PLUG-IN PIC32MX4XX 制造商:Microchip Technology Inc 功能描述:PIC32MX4 100PIN USB PLUG IN 制造商:Microchip Technology Inc 功能描述:PIC32MX450 100 Pin to 100 Pin USB Plug in Module 制造商:Microchip Technology Inc 功能描述:Daughter Cards & OEM Boards PIC32 MX450 100-Pin USB PIM 制造商:Microchip Technology Inc 功能描述:PIC32MX4xx 100 to 100-Pin USB PIM, Plug-in Modules
MA320003 功能描述:子卡和OEM板 PIC32MX USB/CAN PIM RoHS:否 制造商:BeagleBoard by CircuitCo 产品:BeagleBone LCD4 Boards 用于:BeagleBone - BB-Bone - Open Source Development Kit
MA320011 功能描述:子卡和OEM板 PIC32MX250F128D PIM RoHS:否 制造商:BeagleBoard by CircuitCo 产品:BeagleBone LCD4 Boards 用于:BeagleBone - BB-Bone - Open Source Development Kit
MA320012 制造商:Microchip Technology Inc 功能描述:PIC32MZ2048EC 100-100PIN PIM - Boxed Product (Development Kits) 制造商:Microchip Technology Inc 功能描述:MOD PIM PIC32MZ2048EC 100PIN 制造商:Microchip Technology Inc 功能描述:100 to 100 Pin Plug-In Module for PIC32MZ EC Series 制造商:Microchip Technology Inc 功能描述:PIC32MZ2048EC 100-100pin PIM - demonstrate the capabilities of the PIC32MZ EC fa
MA3200-H 制造商:PANASONIC 制造商全称:Panasonic Semiconductor 功能描述:Silicon planar type
MA3200-L 制造商:PANASONIC 制造商全称:Panasonic Semiconductor 功能描述:Silicon planar type
MA3200-M 制造商:PANASONIC 制造商全称:Panasonic Semiconductor 功能描述:Silicon planar type
MA3200W 制造商:PANASONIC 制造商全称:Panasonic Semiconductor 功能描述:Silicon planer type