How to configure pins for UART on PIC32MX470F512L


#1

I was reading through this tutorial about configuring and using the UART peripheral, however, I am stuck on one certain aspect. Which pins do you use for TX and RX (also for CTS and RTS even though they aren’t used)? I am assuming that using the PPS is required, however, I see nothing about this in the example code. If PPS is required, what is the correct sequence for locking and unlocking the PPS? Any help is appreciated!

https://www.digikey.com/eewiki/display/microcontroller/Getting+Started+with+the+PIC32+and+MPLAB+X


#2

PPS is definitely required. Input pins have a default mapping (whatever you see listed for 0x0), while output pins default to a disconnected state. Tables 12-1 and 12-2 starting on page 140 of the datasheet break down the pin mapping information. Section 12.3.6 (pg 142) talks more about the locking the configs.

That being said, I’ve found the easiest way to work with PPS on PIC devices is using Microchip’s Code Configurator plugin for MPLAB. It gives you a table showing all the available pin options and if you have any conflicts. It also makes it easier to set up all the configuration registers for that peripheral.


#3

Thanks for your response. The code configurator was helpful!