MCUXpresso SDK Documentation

i2s_dma_transfer

i2s_dma_transfer#

Overview#

The I2S example project uses one I2S interface to continuously playback the sine wave to output.

Supported Boards#

EVK-MIMXRT595
Hardware requirements
  • Micro USB cable

  • EVK-MIMXRT595 board

  • Personal Computer

  • headphones with 3.5 mm stereo jack

  • source of sound (line output to 3.5 mm stereo jack)

Board settings

To make example work, connections needed to be as follows: JP7-1 <—> JP7-2 JP8-1 <—> JP8-2 JP27, JP28, JP29 1-2 connected.

Prepare the Demo
  1. Connect headphones to Audio HP / Line-Out connector (J4).

  2. Connect a micro USB cable between the PC host and the CMSIS DAP USB port on the board

  3. Open a serial terminal with the following settings:

    • 115200 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  4. Download the program to the target board.

  5. Launch the debugger in your IDE to begin running the demo.

Running the demo

Headphones will play a sine wave sound. This demo outputs 450HZ sine wave audio signal. The log below shows example output of the I2S driver demo in the terminal window:

Configure codec
Configure I2S
Setup looping playback of sine wave
EVK-MIMXRT685
Hardware requirements
  • Micro USB cable

  • EVK-MIMXRT685 board

  • Personal Computer

  • headphones with 3.5 mm stereo jack

  • source of sound (line output to 3.5 mm stereo jack)

Board settings

To make example work, connections needed to be as follows: JP7-1 <–> JP7-2 JP8-1 <–> JP8-2

Prepare the Demo
  1. Connect headphones to Audio HP / Line-Out connector (J4).

  2. Connect source of sound(from PC or Smart phone) to Audio Line-In connector (J3).

  3. Connect a micro USB cable between the PC host and the CMSIS DAP USB port (J5) on the board

  4. Open a serial terminal with the following settings:

    • 115200 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  5. Download the program to the target board.

  6. Launch the debugger in your IDE to begin running the demo.

Running the demo

Headphones will play a sine wave sound. This demo outputs 450HZ sine wave audio signal. The log below shows example output of the I2S driver demo in the terminal window:

Configure codec
Configure I2S
Setup looping playback of sine wave
LPCXpresso51U68
Hardware requirements
  • Mini/micro USB cable

  • LPCXpresso51U68 board

  • NXP Mic/Audio/Oled (MAO) shield

  • Personal Computer

  • headphones with 3.5 mm stereo jack

  • source of sound (line output to 3.5 mm stereo jack)

Board settings

No special settings are required on LPCXpresso51U68 board. MAO shield should be mounted to LPCXpresso51U68 board. MAO shield - JP3 1-2 have to be connected.

Prepare the Demo
  1. Connect headphones to Audio HP / Line-Out connector of MAO shield.

  2. Connect a micro USB cable between the PC host and the CMSIS DAP USB port (J6) on the board

  3. Open a serial terminal with the following settings (See Appendix A in Getting started guide for description how to determine serial port number):

    • 115200 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  4. Download the program to the target board.

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

Running the demo

Headphones will play a sine wave sound. This demo outputs 450HZ sine wave audio signal. The log below shows example output of the I2S driver demo in the terminal window:

Configure codec
Configure I2S
Setup looping playback of sine wave
LPCXpresso54628
Hardware requirements
  • Micro USB cable

  • LPCXpresso54628 board

  • Personal Computer

  • headphones with 3.5 mm stereo jack

  • source of sound (line output to 3.5 mm stereo jack)

Board settings

No special settings are required on LPCXpresso54628 board.

Prepare the Demo
  1. Connect headphones to Audio HP / Line-Out connector.

  2. Connect a micro USB cable between the host PC and the LPC-Link USB port (J8) on the target board.

  3. Open a serial terminal with the following settings:

    • 115200 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  4. Download the program to the target board.

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

Running the demo

Headphones will play a sine wave sound. This demo outputs 450HZ sine wave audio signal. The log below shows example output of the I2S driver demo in the terminal window:

Configure codec
Configure I2S
Setup looping playback of sine wave
LPCXpresso54S018
Hardware requirements
  • Micro USB cable

  • LPCXpresso54S018 board

  • Personal Computer

  • headphones with 3.5 mm stereo jack

  • source of sound (line output to 3.5 mm stereo jack)

Board settings

No special settings are required on LPCXpresso54S018 board.

Prepare the Demo
  1. Connect headphones to Audio HP / Line-Out connector.

  2. Connect a micro USB cable between the host PC and the LPC-Link USB port (J8) on the target board.

  3. Open a serial terminal with the following settings:

    • 115200 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  4. Download the program to the target board.

  5. Launch the debugger in your IDE to begin running the demo.

Running the demo

This demo is an external flash plain load demo, ROM will copy image in external flash to SRAMX to run:

  1. Build the demo to generate a bin file. Note: If need to generate bin file using MCUXpresso IDE, below steps need to be followed: Set in example Properties->C/C++ Build->Settings->Build steps->Post-build steps->Edit enbable arm-none-eabi-objcopy -v -O binary “&{BuildArtifactFileName}” “&{BuildArtifactFileBaseName}.bin”

      This plainload example linked the vector table to 0x00000000, but program to external flash 0x10000000.
    
  2. Program the bin file to external on board flash via SEGGER J-FLASH Lite(V6.22 or higher):

    a. Open SEGGER J-FLASH Lite, select device LPC54S018.

    b. Click the ‘Erase Chip’ to erase the extrenal flash.(if can not success, press SW4 button and reset the board, and try to erase again)

    c. Select the bin data file, set the ‘.bin/Erase Start’ address to 0x10000000, then click ‘Program Device’ Note: Please use above way to program the binary file built by armgcc tool chain to external flash. For IAR, KEIL, MCUXpresso IDE, you can use the IDE tool to program the external flash. Headphones will play a sine wave sound. This demo outputs 450HZ sine wave audio signal. The log below shows example output of the I2S driver demo in the terminal window:

Configure codec
Configure I2S
Setup looping playback of sine wave
LPCXpresso54S018M
Hardware requirements
  • Micro USB cable

  • LPCXpresso54S018M board

  • Personal Computer

  • headphones with 3.5 mm stereo jack

  • source of sound (line output to 3.5 mm stereo jack)

Board settings

No special settings are required on LPCXpresso54S018M board.

Prepare the Demo
  1. Connect headphones to Audio HP / Line-Out connector.

  2. Connect a micro USB cable between the host PC and the LPC-Link USB port (J8) on the target board.

  3. Open a serial terminal with the following settings:

    • 115200 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  4. Download the program to the target board.

  5. Launch the debugger in your IDE to begin running the demo.

Running the demo

This demo is an external flash plain load demo, ROM will copy image in external flash to SRAMX to run:

  1. Build the demo to generate a bin file. Note: If need to generate bin file using MCUXpresso IDE, below steps need to be followed: Set in example Properties->C/C++ Build->Settings->Build steps->Post-build steps->Edit enbable arm-none-eabi-objcopy -v -O binary “&{BuildArtifactFileName}” “&{BuildArtifactFileBaseName}.bin”

      This plainload example linked the vector table to 0x00000000, but program to external flash 0x10000000.
    
  2. Program the bin file to external on board flash via SEGGER J-FLASH Lite(V6.22 or higher):

    a. Open SEGGER J-FLASH Lite, select device LPC54S018M.

    b. Click the ‘Erase Chip’ to erase the extrenal flash.(if can not success, press SW4 button and reset the board, and try to erase again)

    c. Select the bin data file, set the ‘.bin/Erase Start’ address to 0x10000000, then click ‘Program Device’ Note: Please use above way to program the binary file built by armgcc tool chain to external flash. For IAR, KEIL, MCUXpresso IDE, you can use the IDE tool to program the external flash. Headphones will play a sine wave sound. This demo outputs 450HZ sine wave audio signal. The log below shows example output of the I2S driver demo in the terminal window:

Configure codec
Configure I2S
Setup looping playback of sine wave
LPCXpresso55S16
Hardware requirements
  • Mini/micro USB cable

  • LPCXpresso55S16 board

  • Personal Computer

  • headphones with 3.5 mm stereo jack

  • source of sound (line output to 3.5 mm stereo jack)

Board settings

The jumper setting: Default jumpers configuration does not work, you will need to add JP20 and JP21 (JP22 optional for ADC use)

Prepare the Demo
  1. Connect headphones to Audio HP / Line-Out connector.

  2. Connect a micro USB cable between the PC host and the CMSIS DAP USB port (P6) on the board

  3. Open a serial terminal with the following settings :

    • 115200 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  4. Download the program to the target board.

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

Running the demo

Headphones will play a sine wave sound. This demo outputs 450HZ sine wave audio signal. The log below shows example output of the I2S driver demo in the terminal window:

Configure I2C
Configure codec
Configure I2S
Setup looping playback of sine wave

Modify i2s_interrupt_transfer.c to change condition to call StartDigitalLoopback() instead of StartSoundPlayback() function. Headphones will play what is input into Audio Line-In connector. Terminal window will show:

Configure codec
Configure I2S
Setup digital loopback
LPCXpresso55S28
Hardware requirements
  • Mini/micro USB cable

  • LPCXpresso55S28 board

  • Personal Computer

  • headphones with 3.5 mm stereo jack

  • source of sound (line output to 3.5 mm stereo jack)

Board settings
Prepare the Demo

Note: MCUXpresso IDE project default debug console is semihost

  1. Connect headphones to Audio HP / Line-Out connector.

  2. Connect a micro USB cable between the PC host and the CMSIS DAP USB port (P6) on the board

  3. Open a serial terminal with the following settings :

    • 115200 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  4. Download the program to the target board.

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

Running the demo

Headphones will play a sine wave sound. This demo outputs 450HZ sine wave audio signal. The log below shows example output of the I2S driver demo in the terminal window:

Configure I2C
Configure codec
Configure I2S
Setup looping playback of sine wave

Modify i2s_interrupt_transfer.c to change condition to call StartDigitalLoopback() instead of StartSoundPlayback() function. Headphones will play what is input into Audio Line-In connector. Terminal window will show:

Configure codec
Configure I2S
Setup digital loopback
LPCXpresso55S36
Hardware requirements
  • Mini/micro USB cable

  • LPCXpresso55S36 board

  • Personal Computer

  • headphones with 3.5 mm stereo jack

  • source of sound (line output to 3.5 mm stereo jack)

Board settings

Short JP50 1-2,JP53 1-2

Prepare the Demo
  1. Connect headphones to Audio HP / Line-Out connector.

  2. Connect a micro USB cable between the PC host and the CMSIS DAP USB port (J1) on the board

  3. Open a serial terminal with the following settings :

    • 115200 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  4. Download the program to the target board.

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

Running the demo

Headphones will play a sine wave sound. The log below shows example output of the I2S driver demo in the terminal window:

Configure WM8904 codec
Configure I2S
Setup looping playback of sine wave
LPCXpresso55S69
Hardware requirements
  • Mini/micro USB cable

  • LPCXpresso55s69 board

  • Personal Computer

  • headphones with 3.5 mm stereo jack

  • source of sound (line output to 3.5 mm stereo jack)

Board settings
Prepare the Demo

Note: MCUXpresso IDE project default debug console is semihost

  1. Connect headphones to Audio HP / Line-Out connector.

  2. Connect a micro USB cable between the PC host and the CMSIS DAP USB port (P6) on the board

  3. Open a serial terminal with the following settings :

    • 115200 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  4. Download the program to the target board.

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

Running the demo

Headphones will play a sine wave sound. This demo outputs 450HZ sine wave audio signal. The log below shows example output of the I2S driver demo in the terminal window:

Configure I2C
Configure codec
Configure I2S
Setup looping playback of sine wave

Modify i2s_interrupt_transfer.c to change condition to call StartDigitalLoopback() instead of StartSoundPlayback() function. Headphones will play what is input into Audio Line-In connector. Terminal window will show:

Configure codec
Configure I2S
Setup digital loopback
MIMXRT685-AUD-EVK
Hardware requirements
  • Micro USB cable

  • MIMXRT685-AUD-EVK board

  • Personal Computer

  • headphones with 3.5 mm stereo jack

Board settings
Prepare the Demo
  1. Connect headphones to J4.

  2. Connect a micro USB cable between the PC host and the CMSIS DAP USB port (J5) on the board

  3. Open a serial terminal with the following settings:

    • 115200 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  4. Download the program to the target board.

  5. Launch the debugger in your IDE to begin running the demo.

Running the demo

Headphones will play a sine wave sound. This demo outputs 450HZ sine wave audio signal. The log below shows example output of the I2S driver demo in the terminal window:

Configure codec
Configure I2S
Setup looping playback of sine wave
RD-RW612-BGA
Hardware requirements
  • Micro USB cable

  • RD-RW612-BGA board

  • Personal Computer

  • headphones with 3.5 mm stereo jack

Board settings

Connect JP50, JP51; Disconnect JP9, JP11

Prepare the Demo
  1. Connect headphones to Audio HP connector (J4).

  2. Connect a micro USB cable between the PC host and the MCU-Link USB port (J7) on the board

  3. Open a serial terminal with the following settings:

    • 115200 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  4. Download the program to the target board.

  5. Launch the debugger in your IDE to begin running the demo.

Running the demo

Headphones will play a sine wave sound. The log below shows example output of the I2S driver demo in the terminal window:

Configure codec
Configure I2S
Setup looping playback of sine wave