8.6 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. Each register contains sets of 8-bit fields, with each set associated with one of the remappable peripherals. Programming a given peripheral’s bit field with an appropriate 8-bit index value maps the RPn pin with the corresponding value, or internal signal, to that peripheral. See Table 8-3 for a list of available inputs.
Configuring UART1 Input and Output Functions provides a configuration for bidirectional communication with flow control using UART1. The following input and output functions are used:
- Input Functions: U1RX, U1CTS
- Output Functions: U1TX, U1RTS
| RPINRx[15:8] or RPINRx[7:0] | Function | Available on Ports |
|---|---|---|
| 0 | VSS | Internal |
| 1 | Comparator 1 | Internal |
| 2 | Comparator 2 | Internal |
| 3 | Comparator 3 | Internal |
| 4-5 | RP4-RP5 | Reserved |
| 6 | PTG Trigger 26 | Internal |
| 7 | PTG Trigger 27 | Internal |
| 8 | APWM Event Out A | Internal |
| 9 | APWM Event Out B | Internal |
| 10 | APWM Event Out C | Internal |
| 11 | PWM Event Out C | Internal |
| 12 | PWM Event Out D | Internal |
| 13 | PWM Event Out E | Internal |
| 14 | RP14 | Reserved |
| 15 | Comparator 6 | Internal |
| 16-31 | RP16-RP31 | Reserved |
| 32 | RP32 | Port Pin RB0 |
| 33 | RP33 | Port Pin RB1 |
| 34 | RP34 | Port Pin RB2 |
| 35 | RP35 | Port Pin RB3 |
| 36 | RP36 | Port Pin RB4 |
| 37 | RP37 | Port Pin RB5 |
| 38 | RP38 | Port Pin RB6 |
| 39 | RP39 | Port Pin RB7 |
| 40 | RP40 | Port Pin RB8 |
| 41 | RP41 | Port Pin RB9 |
| 42 | RP42 | Port Pin RB10 |
| 43 | RP43 | Port Pin RB11 |
| 44 | RP44 | Port Pin RB12 |
| 45 | RP45 | Port Pin RB13 |
| 46 | RP46 | Port Pin RB14 |
| 47 | RP47 | Port Pin RB15 |
| 48 | RP48 | Port Pin RC0 |
| 49 | RP49 | Port Pin RC1 |
| 50 | RP50 | Port Pin RC2 |
| 51 | RP51 | Port Pin RC3 |
| 52 | RP52 | Port Pin RC4 |
| 53 | RP53 | Port Pin RC5 |
| 54 | RP54 | Port Pin RC6 |
| 55 | RP55 | Port Pin RC7 |
| 56 | RP56 | Port Pin RC8 |
| 57 | RP57 | Port Pin RC9 |
| 58 | RP58 | Port Pin RC10 |
| 59 | RP59 | Port Pin RC11 |
| 60 | RP60 | Port Pin RC12 |
| 61 | RP61 | Port Pin RC13 |
| 62 | RP62 | Port Pin RC14 |
| 63 | RP63 | Port Pin RC15 |
| 64 | RP64 | Port Pin RD0 |
| 65 | RP65 | Port Pin RD1 |
| 66 | RP66 | Port Pin RD2 |
| 67 | RP67 | Port Pin RD3 |
| 68 | RP68 | Port Pin RD4 |
| 69 | RP69 | Port Pin RD5 |
| 70 | RP70 | Port Pin RD6 |
| 71 | RP71 | Port Pin RD7 |
| 72 | RP72 | Port Pin RD8 |
| 73 | RP73 | Port Pin RD9 |
| 74 | RP74 | Port Pin RD10 |
| 75 | RP75 | Port Pin RD11 |
| 76 | RP76 | Port Pin RD12 |
| 77 | RP77 | Port Pin RD13 |
| 78 | RP78 | Port Pin RD14 |
| 79 | RP79 | Port Pin RD15 |
| 80 | RP80 | Port Pin RF0 |
| 81 | RP81 | Port Pin RF1 |
| 82 | RP82 | Port Pin RF2 |
| 83 | RP83 | Port Pin RF3 |
| 84 | RP84 | Port Pin RF4 |
| 85 | RP85 | Port Pin RF5 |
| 86 | RP86 | Port Pin RF6 |
| 87 | RP87 | Port Pin RF7 |
| 88 | RP88 | Port Pin RF8 |
| 89 | RP89 | Port Pin RF9 |
| 90 | RP90 | Port Pin RF10 |
| 91 | RP91 | Port Pin RF11 |
| 92 | RP92 | Port Pin RF12 |
| 93 | RP93 | Port Pin RF13 |
| 94 | RP94 | Port Pin RF14 |
| 95 | RP95 | Port Pin RF15 |
| 96 | RP96 | Port Pin RA5 |
| 97 | RP97 | Port Pin RA6 |
| 98 | RP98 | Port Pin RA7 |
| 99 | RP99 | Port Pin RA8 |
| 100-157 | RP100-RP157 | Reserved |
| 158 | DAC6 pwm_req_on | Internal |
| 159 | DAC6 pwm_req_off | Internal |
| 160 | DAC5 pwm_req_on | Internal |
| 161 | DAC5 pwm_req_off | Internal |
| 162 | DAC4 pwm_req_on | Internal |
| 163 | DAC4 pwm_req_off | Internal |
| 164 | DAC3 pwm_req_on | Internal |
| 165 | DAC3 pwm_req_off | Internal |
| 166 | DAC2 pwm_req_on | Internal |
| 167 | DAC2 pwm_req_off | Internal |
| 168 | DAC1 pwm_req_on | Internal |
| 169 | DAC1 pwm_req_off | Internal |
| 170-175 | RP170-RP175 | Reserved |
| 176 | RP176 | Virtual RPV0 |
| 177 | RP177 | Virtual RPV1 |
| 178 | RP178 | Virtual RPV2 |
| 179 | RP179 | Virtual RPV3 |
| 180 | RP180 | Virtual RPV4 |
| 181 | RP181 | Virtual RPV5 |
Configuring UART1 Input and Output Functions
//
*******************************************
// Unlock Registers
//*****************************************
__builtin_write_RPCON(0x0000);
//*****************************************
// Configure Input Functions (See Table 8-3)
// Assign U1Rx To Pin RP35
//***************************
_U1RXR = 35;
// Assign U1CTS To Pin RP36
//***************************
_U1CTSR = 36;
//*****************************************
// Configure Output Functions (See Table 8-6)
//*****************************************
// Assign U1Tx To Pin RP37
//***************************
_RP37 = 1;
//***************************
// Assign U1RTS To Pin RP38
//***************************
_RP38 = 2;
//*****************************************
// Lock Registers
//*****************************************
__builtin_write_RPCON(0x0800);
