29.3.2.3 Synchronous Slave Transmission Setup

  1. Set the SYNC and SPEN bits and clear the CSRC bit.
  2. Select the transmit output pin by writing the appropriate values to the RxyPPS register and RXxPPS register. Both selections should enable the same pin.
  3. Select the clock input pin by writing the appropriate value to the CKxPPS register.
  4. Clear the ANSEL bit for the CKx pin (if applicable).
  5. Clear the CREN and SREN bits.
  6. If interrupts are desired, set the TXxIE bit of the PIEx register and the GIE and PEIE bits of the INTCON register.
  7. If 9-bit transmission is desired, set the TX9 bit.
  8. Enable transmission by setting the TXEN bit.
  9. If 9-bit transmission is selected, insert the Most Significant bit into the TX9D bit.
  10. Prepare for transmission by writing the Least Significant eight bits to the TXxREG register. The word will be transmitted in response to the Master clocks at the CKx pin.