22.6.4. I2S Master
22.6.4.1. Overview
The I2S master example shows i2s controller as i2s master with DMA to communicate with i2s slave between board and board. I2S master reads audio data from I2S slave, and plays through DAO.
22.6.4.2. Workflow
Configure system audio clock
Configure I2S Master:
Enable MCLK output
Set FIFO threshold
Configure DMA request
Configure sampling rate and bit width
Configure I2S_DAO and DAO:
Configure sampling rate and bit width
Configure DMA transfer:
Set source address to I2S_MASTER receive FIFO
Set destination address to I2S_DAO transmit FIFO
Configure fixed address mode
Enable DMA interrupt
Start transfer:
Enable I2S Master
Enable I2S_DAO and DAO
Start DMA transfer
22.6.4.3. Known Issues
When using DAO to play some audio, it may generate noise.
22.6.4.4. Hardware Setup
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
Connect a speaker to the DAO interface on the development board
22.6.4.5. Running the Example
When the example runs successfully:
Terminal output:
I2S Master example
You can hear a piece of audio about a brief introduction of HPMicro
22.6.4.6. Debugging Tips
Check if I2S connections are correct
Verify if DMA transfer is working properly