Datasheet

dsPIC33EPXXXGM3XX/6XX/7XX
DS70000689D-page 166 2013-2014 Microchip Technology Inc.
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-29). Each register contains sets of
7-bit fields, with each set associated with one of the
remappable peripherals. Programming a given periph-
eral’s bit field with an appropriate 7-bit value maps the
RPn pin with the corresponding value to that peripheral.
For any given device, the valid range of values for any
bit field corresponds 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:
REMAPPABLE INPUT FOR
U1RX
11.4.4.1 Virtual Connections
dsPIC33EPXXXGM3XX/6XX/7XX devices support
virtual (internal) connections to the output of the
op amp/comparator module (see Figure 26-1 in
Section 26.0 “Op Amp/Comparator Module”) and
the PTG module (see Section 25.0 “Peripheral
Trigger Generator (PTG) Module”).
In addition, dsPIC33EPXXXGM3XX/6XX/7XX devices
support virtual connections to the filtered QEIx module
inputs: FINDX1, FHOME1, FINDX2 and FHOME2
(see Figure 17-1 in Section 17.0 “Quadrature
Encoder Interface (QEI) Module”).
Virtual connections provide a simple way of inter-
peripheral connection without utilizing a physical pin.
For example, by setting the FLT1R<6:0> bits of the
RPINR12 register to the value of ‘b0000001, the
output of the analog comparator, C1OUT, will be
connected to the PWM Fault 1 input, which allows the
analog comparator to trigger PWM Faults without the
use of an actual physical pin on the device.
Virtual connection to the QEIx module allows
peripherals to be connected to the QEIx digital filter
input. To utilize this filter, the QEIx module must be
enabled and its inputs must be connected to a physical
RPn pin. Example 11-2 illustrates how the input
capture module can be connected to the QEIx digital
filter.
EXAMPLE 11-2: CONNECTING IC1 TO THE HOME1 QEI1 DIGITAL FILTER INPUT ON PIN 43
RP0
RP1
RP3
0
1
2
U1RX Input
U1RXR<6:0>
to Peripheral
RPn
n
Note: For input only, Peripheral Pin Select func-
tionality does not have priority over TRISx
settings. Therefore, when configuring an
RPn pin for input, the corresponding bit in
the TRISx register must also be configured
for input (set to ‘1’).
RPINR15 = 0x2500; /* Connect the QEI1 HOME1 input to RP37 (pin 43) */
RPINR7 = 0x009; /* Connect the IC1 input to the digital filter on the FHOME1 input */
QEI1IOC = 0x4000; /* Enable the QEI digital filter */
QEI1CON = 0x8000; /* Enable the QEI module */