50.5.13.8 I2STPD Host with Multiple Client Transmit Operation (TPDFMT=100)

When in this mode (TPD_EN=1) all the configured SPI’s FIFO(s) can be written by a single write to the HOST SPI and by utilizing the spi_ixs_buff_bus_in/out [31:0] bus to fill the client FIFOs.

In I2STPD Mode CLK and LRC system operation, the Client will feed through the CLK and LRC from the inputs (driven from device Host) to their respective Outputs. In addition the client will control the output enables as needed. This unique Microchip I2STPD mode all the SPI’s in this configured in the device for this mode, look like Clients to a System. The device SPI Host drives its output CLK and the LRC to the device clients (pds_sck_in, pds_ssn_fsync_in driven from the device Host and not from ports).

The SPI’s APBM interface needs to be configured in the I2STPD mode so that a single APB write will be utilized to fill all the configured SPI FIFO’s at the same time.

I2STPD Standard Mode (TPDMOD=00, TPD_EN=1)

In I2STPD mode, the transmitter drives the audio data’s MSB on the first falling edge of SCK after an LRC transition. The receiver samples the MSB on the second rising edge of SCK. The left channel data transmits while LRC is low and the right channel transmits while LRC is high. A frame transmits left channel first then right channel. In the I2STPD configuration all the SPI’s (host and clients) must be configured with the same justification to ensure proper operation.

To be I2S compliant, the configuration bits in SPIxCTRL_* registers for each SPI in the system must be set as follows: TPD_EN=1, TPDMOD=00, FRMPOL=0, CPOL=1, CPHA = 1, FRMSYPW=0001, FRMCNT=001, AUDFMT[2:0]=100, FRMCOINC=0.

MSTEN=as need per SPI case, SLV_MS_B_UPPR=as need per SPI case, MSB_SLV_EN[4:0]=as need per SPI case.

Left Justified (TPDMOD=01TPDFMT=100, DATFMT_LR=0)

In Left Justified mode, the transmitter drives the audio data’s MSB on the SCK edge that is coincident with an LRC transition. The receiver samples the MSB on the next SCK edge. In the I2STPD configuration all the SPI’s (host and clients) must be configured with the same justification to ensure proper operation.

Right Justified (TPDMOD=10 TPD_EN=1, DATFMT_LR=1)

In Right Justified mode, the transmitter drives the audio data’s MSB on the SCK edge that is coincident with an LRC transition. In the I2STPD configuration all the SPI’s (host and clients) must be configured with the same justification to ensure proper operation.

Host SCK and LRC Clock Generation

AUDWD_MODE[1,0] defines the relationship between LRC and SCK and rising/falling edge sampling. The frame is 64-bits SCK (frame pulse is 32-bits SCK) which is 64x the frequency of LRC.

Since LRC toggles at the sample rate (Fs), SCK’s frequency must be derived from it. Only For the I2STPD Host SPI setup SPIxBRG, divide the desired sample rate by the GCLK or MCLK frequency (whichever is being used). Then, divide the resulting number by the frame size (64). Program this value into SPIxBRG. If a whole number is not the result, error will be present in your actual sample rate. The I2STPD clients are not generating the SCK or LRC but using them from the I2STPD Host SPI.