FRDM-KL43Z FlexIO I2S Interrupt Tx Demo with MCUXpresso IDE

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

FRDM-KL43Z FlexIO I2S Interrupt Tx Demo with MCUXpresso IDE

FRDM-KL43Z FlexIO I2S Interrupt Tx Demo with MCUXpresso IDE

Test Environment:

FRDM-KL43Z Rev. A

MCUXpresso IDE v10.2.0

MCUXpresso SDK for FRDM-KL43Z V2.4.1(2018-06-18)

  • Create new project in MCUXpresso IDE

select [New project...], there will pop the SDK Wizard panel, then select [frdmkl43z]:

pastedImage_2.png

pastedImage_3.png

pastedImage_4.png

Then, click [Next] will enter into [Configure the project] panel, we can set the [Project name] and select [flexio_i2s] in [driver]:

pastedImage_6.png

Click [Finish], the new project was created.

In general, the project is based on [hello_world] project with board default console available.

In [Project Explorer], we could find the <fsl_flexio_i2s.c> & <fsl_flexio_i2s.h> & <fsl_flexio.c> & <fsl_flexio.h> files in drivers folder:

pastedImage_7.png

  • Edit the code

The application note AN5397 detailed introduce how FlexIO emulate I2S bus communication.

The MCUXpresso SDK <flexio_i2s> driver using the AN5397 showed second solution to use two timers and two shifters.

Please check here to get more detailed info.

The I2S signal was below, we need to use four FlexIO pins to provide: BCLK, Fss, TxData & RxData.

pastedImage_1.png

In <pin_mux.c> file, it need to config pin function, we use

PTD7 pin provide I2S BCLK clock;

PTD6 pin as I2S Frame_sync pin;

PTD5 pin as Tx data pin;

PTD6 pin as Rx data pin;

pastedImage_1.png

In <frdmkl43z_flexio_i2s_interrupt_tx.c>,  config flexio_i2s and config the audio frame format:

pastedImage_2.png

pastedImage_3.png

Please check attached source code for the detailed project info.

  • Test result

From the actual measured I2S signal, it shows the 8 bytes was sent out:

pastedImage_4.png

Attachments
No ratings
Version history
Last update:
‎08-17-2018 06:46 PM
Updated by: