28.3.2.3 Synchronous Client 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 and RXxPPS registers. Both selections may 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 PIE3 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 Host clocks at the CKx pin.