Electronic – PIC32 How to find group number for peripheral

pic

From my last question I made a mistake on thinking SCK was under PPS control. I see that now but I still don't understand how to figure out group number for a function with PPS by reading the datasheet.

Let's say I want to bring out MOSI, or I think that's SDO2 in PIC land. On my board it's connected to Pin 22, SDO2_RPB11. And I'm still using a PIC32MX210F016B.

Using their macro: PPSOutput(2, RPA1, SDO1);

I have to specify a group as the first input, then pin, then function. For some reason I'm not seeing where the datasheet specifies what group to use.

I'm guessing by reading the pps.h header that it's something like this:

PPSOutput(2, RPB11, SDO2);

I'm not sure though that does compile.

Best Answer

In my opinion that 'Group Number' parameter is pretty poorly documented.

How I've figured it out is to look at the PPS Pin Selection table for either inputs or outputs (tables 11-1 & 11-2 in your datasheet).
Then, for inputs find the input function or for outputs find the pin you're interested in from the left-most column and then look over to the right-most column of the table.
You'll see they're 'grouped' - so for example:
- INT4, T2CK, IC4, SS1, REFCLKI are all in Group 1
- INT3, T3CK, IC3, U1CTS, U2RX, SDI1 are in Group 2
- etc ...