22.6.5. I2S Slave

22.6.5.1. Overview

I2S slave example shows i2s controller as slave with DMA communicate with master between board and board. I2S slave sends a piece of audio data in a loop to master.

22.6.5.2. Workflow

  1. Configure system audio clock:

    • Use external MCLK, BCLK and FCLK

  2. Configure I2S Slave:

    • Set FIFO threshold

    • Configure DMA request

    • Configure sample rate and bit width

    • Configure as slave mode

  3. Configure DMA transfer:

    • Set source address to audio data buffer

    • Set destination address to I2S_SLAVE transmit FIFO

    • Configure source address increment mode

    • Configure destination address fixed mode

    • Enable DMA interrupt

  4. Start transfer:

    • Enable I2S Slave

    • Start DMA transfer

    • Send audio data in loop

22.6.5.3. Known Issues

None

22.6.5.4. Board Setting

  • Connect I2S Pins between the two boards:

    • Connect Master FCLK with Slave FCLK

    • Connect Master BCLK with Slave BCLK

    • Connect Master RXD with Slave TXD

    • Connect GND together between boards

22.6.5.5. Running the Example

When the example runs successfully:

  1. Terminal output:

I2S Slave Demo
  1. I2S Slave will continuously send audio data to I2S Master

22.6.5.6. Debugging Tips

  1. Check if I2S connections are correct

  2. Verify if DMA transfer is working properly