MCUXpresso SDK Documentation

sai_edma_tdm

sai_edma_tdm#

Overview#

The sai_edma_tdm example shows how to use sai edma driver with TDM format data:

In this example, one sai instance playbacks the audio data stored in the sdcard using EDMA channel.

Supported Boards#

EVKB-IMXRT1050
Hardware requirements
  • Mini/micro USB cable

  • EVKB-IMXRT1050 board

  • Personal Computer

  • Headphone(OMTP standard) or speaker

  • cs42448 audio board

  • sdcard(formatted with FAT32 format).

Board settings

CS42448 Audio board: Install J5 2-3, J3 2-3, J4 2-3, J2, J13, J14.

To make example work, connections needed to be as follows: CS42448 audio board rt1050 evk board J1-2 -> GND J1-23 -> SAI1_TX_BCLK(BCLK) J1-16 -> SAI1_TX_SYNC(SYNC) J1-17 -> SAI1_TXD(TX) J1-4 -> 3V3 J1-21 -> J22 pin8(power enable) J1-10 -> 5v J1-13 -> I2C1_SCL(scl) J1-15 -> I2C1_SDA(sda) J1-1 -> SAI1_MCLK(MCLK) J1-7 -> J22 pin7(codec reset)

Prepare the Demo
  1. Connect a USB cable between the host PC and the OpenSDA USB port on the target board.

  2. Open a serial terminal with the following settings:

    • 115200 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  3. Download the program to the target board.

  4. connect CS42448 audio board to evk board.

  5. Decompression the 8_TDM.zip and put 8_TDM.wav into the sdcard(formatted with FAT32 format).

  6. Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.

Running the demo

When the demo runs successfully, you can hear

Line 1&2 output: “Front Left”, “Front Right” Line 3&4 output: “Centre”, tone Line 5&6 output: “Back Left”, “Back Right” Line 7&8 output: “Auxiliary Left”, “Auxiliary Right”

and the log would be seen on the OpenSDA terminal like:

SAI edma TDM example started.

Please insert a SDCARD into board, make sure the sdcard is format to FAT32 format and put the 8_TDM.wav file into the sdcard.

Card inserted.

8_TDM.wav File is available

Codec Init Done.

Start play 8_TDM.wav file.

SAI TDM EDMA example finished.
MIMXRT1060-EVKB
Hardware requirements
  • Micro USB cable

  • EVKB-MIMXRT1060 board

  • Personal Computer

  • Headphone or speaker

  • SDCARD

  • CS42448 audio board

Board settings

Make sure resistors R368/R347/R349/R365/R363 are removed. Insert the CS42448 audio board into J23 Uninstall J41

Prepare the Demo
  1. Connect a USB cable between the host PC and the OpenSDA USB port on the target board.

  2. Open a serial terminal with the following settings:

    • 115200 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  3. Download the program to the target board.

  4. Insert the headphones into the headphone jack of CS42448 audio board line output.

  5. Prepare a FAT32 format sdcard and copy the 8_TDM.wav into sdcard and then Insert the sdcard into J22.

  6. Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.

Running the demo

When the demo runs successfully, you can hear

Line 1&2 output: “Front Left”, “Front Right” Line 3&4 output: “Centre”, tone Line 5&6 output: “Back Left”, “Back Right” Line 7&8 output: “Auxiliary Left”, “Auxiliary Right”

and the log would be seen on the OpenSDA terminal like:

SAI edma TDM example started.

8_TDM.wav File is available

Codec Init Done.

Start play 8_TDM.wav file.

SAI TDM EDMA example finished.
MIMXRT1170-EVKB
Hardware requirements
  • Micro USB cable

  • MIMXRT1170-EVKB board

  • Personal Computer

  • Headphone or speaker

  • SDCARD

  • CS42448 audio board

Board settings

1.Please mount resistors below, R2008,R2022,R2011,R2021,R2009,R2010,R2012,R2016,R1998,R2013,R2014, R2018,R2017,R2000

2.Remove the resistors below: R2001,R2002,R2003,R2004,R2005,R2006 and R2007.

3.Insert AUDIO board into J76.

Prepare the Demo
  1. Connect a USB cable between the host PC and the OpenSDA USB port on the target board.

  2. Open a serial terminal with the following settings:

    • 115200 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  3. Download the program to the target board.

  4. Insert the CS42448 audio board into J76.

  5. Insert the headphones into the headphone jack of CS42448 audio board line output.

  6. Prepare a FAT32 format sdcard and copy the 8_TDM.wav into sdcard and then Insert the sdcard into J22.

  7. Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.

Running the demo

When the demo runs successfully, you can hear

Line 1&2 output: “Front Left”, “Front Right” Line 3&4 output: “Centre”, tone Line 5&6 output: “Back Left”, “Back Right” Line 7&8 output: “Auxiliary Left”, “Auxiliary Right”

and the log would be seen on the OpenSDA terminal like:

SAI edma TDM example started.

8_TDM.wav File is available

Codec Init Done.

Start play 8_TDM.wav file.

SAI TDM EDMA example finished.
MIMXRT1060-EVKC
Hardware requirements
  • Micro USB cable

  • MIMXRT1060-EVKC board

  • Personal Computer

  • Headphone or speaker

  • SDCARD

  • CS42448 audio board

Board settings

No special settings are required.

Prepare the Demo
  1. Connect a USB cable between the host PC and the OpenSDA USB port on the target board.

  2. Open a serial terminal with the following settings:

    • 115200 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  3. Download the program to the target board.

  4. Insert the CS42448 audio board into J23.

  5. Insert the headphones into the headphone jack of CS42448 audio board line output.

  6. Prepare a FAT32 format sdcard and copy the 8_TDM.wav into sdcard and then Insert the sdcard into J22.

  7. Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.

Running the demo

When the demo runs successfully, you can hear

Line 1&2 output: “Front Left”, “Front Right” Line 3&4 output: “Centre”, tone Line 5&6 output: “Back Left”, “Back Right” Line 7&8 output: “Auxiliary Left”, “Auxiliary Right”

and the log would be seen on the OpenSDA terminal like:

SAI edma TDM example started.

8_TDM.wav File is available

Codec Init Done.

Start play 8_TDM.wav file.

SAI TDM EDMA example finished.
MIMXRT1040-EVK
Hardware requirements
  • Mini/micro USB cable

  • EVKB-MIMXRT1040 board

  • Personal Computer

  • Headphone(OMTP standard)

  • SDCARD

  • CS42448 audio board

  • Headphone or speaker

Board settings

1.Please mount resistor R480.

2.Please remove the jumper J41.

3.Insert AUDIO board into J23.

Prepare the Demo
  1. Connect a USB cable between the host PC and the OpenSDA USB port on the target board.

  2. Open a serial terminal with the following settings:

    • 115200 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  3. Download the program to the target board.

  4. Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.

Running the demo

When the demo runs successfully, you can hear

Line 1&2 output: “Front Left”, “Front Right” Line 3&4 output: “Centre”, tone Line 5&6 output: “Back Left”, “Back Right” Line 7&8 output: “Auxiliary Left”, “Auxiliary Right”

and the log would be seen on the OpenSDA terminal like:

SAI edma TDM example started.

8_TDM.wav File is available

Codec Init Done.

Start play 8_TDM.wav file.

SAI TDM EDMA example finished.
MIMXRT1180-EVK
Hardware requirements
  • Micro USB cable

  • MIMXRT1180-EVK board

  • Personal Computer

  • Headphone or speaker

  • SDCARD

  • CS42448 audio board

  • Power adapter

Board settings

1.Remove Jumper J99 and remove R1084 resistor. (If use MCU-LINK JLINK firmware, please also remove R82 resistor)

2.Insert AUDIO board into J47.

  1. Switch Jumper J1 to 1-2, insert power adapter on J2 and power on the board by SW1. (Since the power consumption exceeds the USB power supply capacity when using CS42448 audio board, an external power supply must be used)

Prepare the Demo
  1. Connect a USB cable between the host PC and the OpenSDA USB port on the target board.

  2. Open a serial terminal with the following settings:

    • 115200 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  3. Download the program to the target board.

  4. Insert the CS42448 audio board into J47.

  5. Insert the headphones into the headphone jack of CS42448 audio board line output.

  6. Prepare a FAT32 format sdcard and copy the 8_TDM.wav into sdcard and then Insert the sdcard into J15.

  7. Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.

Running the demo

When the demo runs successfully, you can hear

Line 1&2 output: “Front Left”, “Front Right” Line 3&4 output: “Centre”, tone Line 5&6 output: “Back Left”, “Back Right” Line 7&8 output: “Auxiliary Left”, “Auxiliary Right”

and the log would be seen on the OpenSDA terminal like:

SAI edma TDM example started.

8_TDM.wav File is available

Codec Init Done.

Start play 8_TDM.wav file.

SAI TDM EDMA example finished.