English
Language : 

PIC24EP256GU810-I Datasheet, PDF (210/622 Pages) Electronic Film Capacitors, Inc. – 16-Bit Microcontrollers and Digital Signal Controllers with High-Speed PWM, USB and Advanced Analog
dsPIC33EPXXX(GP/MC/MU)806/810/814 and PIC24EPXXX(GP/GU)810/814
11.4 Peripheral Pin Select
A major challenge in general purpose devices is provid-
ing the largest possible set of peripheral features while
minimizing the conflict of features on I/O pins. The chal-
lenge is even greater on low pin-count devices. In an
application where more than one peripheral needs to
be assigned to a single pin, inconvenient workarounds
in application code or a complete redesign may be the
only option.
Peripheral Pin Select configuration provides an
alternative to these choices by enabling peripheral set
selection and their placement on a wide range of I/O
pins. By increasing the pinout options available on a
particular device, users can better tailor the device to
their entire application, rather than trimming the
application to fit the device.
The Peripheral Pin Select configuration feature oper-
ates over a fixed subset of digital I/O pins. Users may
independently map the input and/or output of most dig-
ital peripherals to any one of these I/O pins. Peripheral
Pin Select is performed in software and generally does
not require the device to be reprogrammed. Hardware
safeguards are included that prevent accidental or
spurious changes to the peripheral mapping once it has
been established.
11.4.1 AVAILABLE PINS
The number of available pins is dependent on the
particular device and its pin count. Pins that support the
Peripheral Pin Select feature include the designation
“RPn” or “RPIn” in their full pin designation, where “RP”
designates a remappable function for input or output
and “RPI” designates a remappable functions for input
only, and “n” is the remappable pin number.
11.4.2 AVAILABLE PERIPHERALS
The peripherals managed by the Peripheral Pin Select
are all digital only peripherals. These include general
serial communications (UART and SPI), general pur-
pose timer clock inputs, timer-related peripherals (input
capture and output compare) and interrupt-on-change
inputs.
In comparison, some digital-only peripheral modules are
never included in the Peripheral Pin Select feature. This
is because the peripheral’s function requires special I/O
circuitry on a specific port and cannot be easily con-
nected to multiple pins. These modules include I2C and
the PWM. A similar requirement excludes all modules
with analog inputs, such as the ADC Converter.
A key difference between remappable and non-
remappable peripherals is that remappable peripherals
are not associated with a default I/O pin. The peripheral
must always be assigned to a specific I/O pin before it
can be used. In contrast, non-remappable peripherals
are always available on a default pin, assuming that the
peripheral is active and not conflicting with another
peripheral.
When a remappable peripheral is active on a given I/O
pin, it takes priority over all other digital I/O and digital
communication peripherals associated with the pin.
Priority is given regardless of the type of peripheral that
is mapped. Remappable peripherals never take priority
over any analog functions associated with the pin.
11.4.3
CONTROLLING PERIPHERAL PIN
SELECT
Peripheral Pin Select features are controlled through
two sets of SFRs: one to map peripheral inputs and one
to map outputs. Because they are separately con-
trolled, a particular peripheral’s input and output (if the
peripheral has both) can be placed on any selectable
function pin without constraint.
The association of a peripheral to a peripheral-selectable
pin is handled in two different ways, depending on
whether an input or output is being mapped.
11.4.4 INPUT MAPPING
The inputs of the Peripheral Pin Select options are
mapped on the basis of the peripheral. That is, a control
register associated with a peripheral dictates the pin it
will be mapped to. The RPINRx registers are used to
configure peripheral input mapping (see Register 11-1
through Register 11-22). Each register contains sets of
7-bit fields, with each set associated with one of the
remappable peripherals (see Table 11-1). Programming
a given peripheral’s bit field with an appropriate 7-bit
value maps the RPn/RPIn pin with the corresponding
value to that peripheral (see Table 11-2). For any given
device, the valid range of values for any bit field corre-
sponds to the maximum number of Peripheral Pin
Selections supported by the device.
For example, Figure 11-2 illustrates remappable pin
selection for the U1RX input.
FIGURE 11-2:
U1RX REMAPPABLE INPUT
U1RXR<6:0>
0
RP0
1
RP1
2
U1RX Input
RP3
to Peripheral
n
RPn/RPIn
Note:
For input only, Peripheral Pin Select functionality
does not have priority over TRISx settings.
Therefore, when configuring RPn/RPIn pin for
input, the corresponding bit in the TRISx register
must also be configured for input (set to ‘1’).
DS70616G-page 210
 2009-2012 Microchip Technology Inc.