Peripheral Pin Select (PPS) allows you to select what pins will be used by certain digital peripherals. It also allows better flexibility for parts with multiple functions multiplexed onto single pins. The PPS configuration feature operates over a fixed subset of digital I/O pins. You may independently map the input and/or output of most digital peripherals to any one of these I/O pins. PPS is performed in software and generally does not require the device to be reprogrammed.
The number of available pins is dependent on the particular device and its pin count. Pins that support the PPS feature include the designation, RPn, in their full pin designation, where RP designates a remappable peripheral and n is the remappable pin number.
The RPINRx registers are used to configure peripheral input mapping. The RPORx registers are used to control output mapping. In the devices' datasheet, there are tables that describe the registers used for mapping the input/output pins. Each register has a function associated with it. This is added in the code to map the desired peripheral to the pin.
Additional information about I/O pins can be found in the Microchip Developer Help I/O Ports page.
PPS Selection in MPLAB® Code Configurator (MCC)
You should check if MCC supports the device. Visit www.microchip.com/mcc and go to the 'Current Download' tab. You should read the 'Release Notes' documentation which indicates if the device is already supported by the latest version of MCC.
MCC Graphical User Interface (GUI) is user-friendly. Configuring PPS for devices is as easy as deciding which pin the peripheral functionality will connect to, which will then click on the I/O lock accordingly.
Make sure to verify if the pins involved are correctly set as input or output, open-drain or not, or pull-up or pull-down or neither on the GPIO section of the MCC GUI.
PPS Lock
The PPS includes a mode in which all input and output selections can be locked to prevent inadvertent changes. PPS selections are locked by setting the PPSLOCKED bit of the PPSLOCK register. Setting and clearing this bit requires a special sequence as an extra precaution against inadvertent changes. Examples of setting and clearing the PPSLOCKED bit can be found in each device datasheet as this sequence might be slightly different from one device to another.
If PPS lock sequence is used more than once, PPS1WAY configuration bit must be set as 'OFF'. Using the PPS1WAY configuration bit, the PPS settings can be locked in. When this bit is set, the PPSLOCKED bit can only be cleared and set one time after a device reset. This allows for clearing the PPSLOCKED bit so that the input and output selections can be made during initialization. When the PPSLOCKED bit is set after all selections have been made, it will remain set and cannot be cleared until after the next device reset event.