47.5.12.7 Streaming Data Support

Due to the nature of audio data, it is often more important to keep the data channel actively transmitting or receiving to guarantee 100% time accurate data. This is especially true for streaming audio feeds that may be bursty or have packet drop. When this is the case the SPIxTXB may underrun frequently causing software to get involved with fixing the underrun.

Ignore Transmit Underrun (IGNTUR)

For cases when software does not care or need to know about the underrun condition, IGNTUR = 1 provides the serial engine the ability to ignore the underrun. When an underrun does occur, the SPI still sets the SPIxSTAT.SPITUR flag and obeys SPITUREN. Once SPITUR is set, it remains so until software clears it or SPIxCTRL_*.ENABLE = 0.

During the underrun condition, the SPI logic loads the SPIxSR with zeros instead of data from the SPIxTXB and continues to transmit. This allows gaps in audio data to sound like white space. Logic samples the underrun condition on channel boundaries, so transmission of zero data can start with either the left or right audio channel. When the condition clears (i.e., SPIxTXB is not empty), logic loads the audio data from the transmit buffer into the SPIxSR on the next LRC frame boundary.

Since recovery from the underrun condition occurs on the LRC frame boundary, software must make sure that the left and right audio data is always transferred to the FIFO in pairs. If the FIFO underruns between the left and right channel, left and right data could be swapped when the underrun condition clears. Generally, this should not be a problem since this feature is not meant to mask system performance problems but assist in recovery of streaming data packet delays.

Ignore Receive Overflow

Ignoring receive overflow is seldom beneficial, since it usually means there is a general performance problem in the system that software must handle properly. However, the SPI does implement the IGNROV bit.

Alternately, receive overflow can be prevented by using DISSDI when the system does not need to receive audio data. DISSDI can be changed on-the-fly and the receive register starts a receive on the leading LRC edge.