Kinetis SDK v.1.2 Demo Applications User's Guide  Rev. 0
Freescale Semiconductor, Inc.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Flexio I2S Example with other methods

Overview

The FlexIO I2S example project is a demonstration program that uses the KSDK software. This example plays back a period of sound stored in the Flash. This example involves four methods:

Supported Platforms

This Tower System module is supported by the FlexIO I2S example:

System Requirement

Hardware requirements

Toolchain requirements

Software requirements

Getting Started

Hardware settings

This example requires connecting the FLEXIO pins with the SAI pins so that the I2S signals can route to the TWR-SGTL5000 board. Connect FlexIO pins to the SAI pins. Note that the default uses the FlexIO pin0 ~ pin3:

Flexio Pins Connects To SAI Pins
Flexio Pin0 -> SAI TxData
Flexio Pin1 -> SAI RxData
Flexio Pin2 -> SAI SCLK
Flexio Pin3 -> SAI FS

Make these connections between the FlexIO pins and SAI pins by using external wires:

TWR-KL43Z48

Flexio Pins Connects To SAI Pins
Pin Name Board Location Pin Name Board Location
PTD2/FLEXIO_PIN2 (*) Primary Elevator B45 -> SAI SCLK (*) Primary Elevator A22
PTD3/FLEXIO_PIN3 (*) Primary Elevator B44 -> SAI Fs (*) Primary Elevator A23
PTD0/FLEXIO_PIN0 Primary Elevator B46 -> SAI TxData Primary Elevator A25
PTD0/FLEXIO_PIN1 Primary Elevator B48 -> SAI TxData Primary Elevator A24

Prepare the example

  1. Connect a USB cable between the PC host and the OpenSDA USB port on the board.
  2. Insert all board into TWR-ELEV.
  3. Insert headphone into J7 port in TWR-SGTL5000 board.
  4. Open a serial terminal with these settings:
    • 115200 baud rate
    • 8 data bits
    • No parity
    • One stop bit
    • No flow control
  5. Download the program to the target board.
  6. Either press the reset button on your board or launch the debugger in your IDE to begin running the example.

Run the example

These instruction are repeatedly displayed/shown on the terminal window:

Master Interrupt testing passed!
Master DMA testing passed!
Slave Interrupt testing passed!
Slave DMA testing passed!

Users can hear the sine wave sound in the headphones. <note> Because the FlexIO does not have the MCLK, the example has to use the MCLK in the TWR-SGTL5000 board to make the codec work correctly. The clock, which is not a part of the FlexIO clock source, is not accurate. This issue causes the clock mismatch between the FlexIO and the sgtl5000 codec. As a result, when the FlexIO i2s is the master, it has a certain amount of noise.