Electronic – Remapping a pin to SPI peripheral

microchippic

I wish to use SPI on a pin that it seems by default is not SPI, however I believe is remappable to SCL.

I am using a PIC32MZ2048EFH144 with Harmony. I have made the following assumptions:

  • Pin 6 Can be remapped to SDO
  • Pin 14 Can be remapped to SCK

I am attempting to confirm that this is the case, and so far I have.

  1. Looked at the datasheet and found that both pins are RPn pins (page 9)

6 – EBIA6/AN22/RPC1/PMA6/RC1

14 – AN14/C1IND/RPG6/SCK2/RG6

At the bottom of that page is states:

Note 1: The RPn pins can be used by remappable peripherals. See Table 1 for the available peripherals and Section 12.4 “Peripheral Pin
Select (PPS)” for restrictions

Where section 12.4.2 Discusses that SPI is a remappable peripheral, as I believed, and can be remapped onto any pin with an "RP" designation

I wanted to give my thought process before asking my questions as I am new to Microchip development and therefore would like to know:

  1. Are my assumptions correct, and can I go forward with the thought of remapping the pins to SPI
  2. is there specific advice on remapping SPI pins that I should be aware of?

Best Answer

The SCL pin is from the I2C module. Do you mean the SDO or SDI pins?

In any case, if you have a look at the datasheet table 1-9, page 26 describes the SPI pinout and unfortunately, the SCK pin cannot be re-mapped but SCK2 is available on pin 14 for the 144 pin devices. As for the SDI and SDO pins, you also have to be careful as not all pins can be remapped to them however in table 12-2 we see that RPC1 can become the SDI pin for a few SPI modules and in table 12-3 we see that RPC1 could also become the SDO pin for a few SPI modules.