19.4.2.2 Client Mode

The SPI module can be configured in Audio Protocol Client mode by setting the MSTEN bit = 0 (SPIxCON1[5]) and the AUDEN bit = 1 (SPIxCON1[31]).

A few characteristics of Client mode are:

  • This mode enables the device to receive SCKx and LRCK pulses as long as the ON bit (SPIxCON1[15]) = 1.
  • The SPI module drives zeros out of SDOx, but does not shift data out or in (SDIx) until the module receives the LRCK (i.e., the edge that precedes the left channel).
  • Once the module receives the leading edge of LRCK, it starts receiving data if DISSDI (SPIxCON1[4]) = 0 and the serial data shifts out continuously, even when the TX FIFO is empty.

Figure 19-19 shows the interface between a SPI module in Audio Client Interface mode to a codec host device.

Figure 19-19. Codec Device as Host Generates Required Clock via External Crystal

Figure 19-20 shows the interface between an SPI module in Audio Client Interface mode to a codec host device, in which the host clock is being derived from the SPI reference clock out function.

Figure 19-20. Codec Device as Host Derives MCLK from dsPIC33A Reference Clock Out