Re: About Remappable pins
1. If i were to connect PIN5 from the controller (RG7/ AN18/ RPI119) to DI, PIN8 (RG9/AN16/RPI121) to CS, PIN4 (RG6/AN19/RP118) to SCLK and PIN6 (RG8/AN17/RP120) to DO, would i be able to use the SPI2 protocol, if i were to switch these pins?
2. How do i remap pins? Following the example on page 116, this should change the input pin
RPINR22 = 0x7700; // 111 0111 // Connect the SDI2 input RPI119
but how do i remap the output pins and enable them?
Inputs and outputs work differently.
For inputs, you write to a register dedicated to an input function (e.g. RPINR22 is for SDI2), and write a value to say which pin it takes the input from. It is possible for multiple peripherals to all use the same pin as input.
For outputs, you write to a register dedicated to a pin, and write a value to select which output function is connected to that pin. It is possible to have multiple pins all outputting the same signal.
To get a useful answer, always state which PIC you are using!