35.4.1.1 SDO Drive/Tri-State

The TRIS bit associated with the SDO pin controls whether the SDO pin will tri-state. When this TRIS bit is cleared, the pin will always be driving to a level, even when the SPI module is inactive. When the SPI module is inactive (either due to the host not clocking the SCK line or the SS being false), the SDO pin will be driven to the value of the LAT bit associated with the SDO pin. When the SPI module is active, its output is determined by both TXR and whether there is data in the transmit FIFO.

When the TRIS bit associated with the SDO pin is set, the pin will only have an output level driven to it when TXR = 1 and the Client Select input is true. In all other cases, the pin will be tri-stated.

Table 35-3. Client Mode Transmit
TRISxn(1)TXRSSTXBESDO State
00FALSE0Output level determined by LATxn(2)
00FALSE1Output level determined by LATxn(2)
00TRUE0

Outputs the oldest byte in the TXFIFO.
Does not remove data from the TXFIFO.

00TRUE1Outputs the most recently received byte
01FALSE0Output level determined by LATxn(2)
01FALSE1Output level determined by LATxn(2)
01TRUE0

Outputs the oldest byte in the TXFIFO.
Removes transmitted byte from the TXFIFO.
Decrements occupancy of TXFIFO.

01TRUE1

Outputs the most recently received byte.
Sets the TXUIF bit.

10FALSE0Tri-stated
10FALSE1Tri-stated
10TRUE0Tri-stated
10TRUE1Tri-stated
11FALSE0Tri-stated
11FALSE1Tri-stated
11TRUE0

Outputs the oldest byte in the TXFIFO.
Removes transmitted byte from the TXFIFO.
Decrements occupancy of TXFIFO.

11TRUE1

Outputs the most recently received byte.
Sets the TXUIF bit

.
Note:
  1. TRISxn is the bit in the TRISx register corresponding to the pin that SDO has been assigned with PPS.
  2. LATxn is the bit in the LATx register corresponding to the pin that SDO has been assigned with PPS.