Using SAI1 to drive 3 audio outputs with 2 TX_Data

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

Using SAI1 to drive 3 audio outputs with 2 TX_Data

Jump to solution
3,369 Views
DigitalBrain
Contributor I

Hello, I'm running RT1024 on a custom board.
SAI1 is configured as an I2S master to control 1 PCM4104. This DAC is capable of driving 4 output channels, it drives 2 channels per logic state of LRCK:

DigitalBrain_0-1733853392160.png

when LRCK is high, CH1 reproduces whatever comes to DATA0 and CH3 reproduces whatever comes to DATA1.

I'm trying to play sounds taking the "evkmimxrt1024_sai_interrupt_transfer" example and changing SAI3 to SAI1 with the next configuration:

DigitalBrain_1-1733853467091.png


The routine is as follows:
-Initialize clocks
-Initialize SAI1
-Create SAI_TransferTxCreateHandle

 

STATE_EMITTING_RIGHT
-Turn on LED1
-Configure SAI as left justified, monoright and channel 1 (I leave this channel 1 as the example but don't fully understand why is this value), asynchronous mode, master.
-Configure the SAI_TransferTxSetConfig
-Set the BCK with SAI_TxSetBitClockRate
-Reproduces sound with SAI_TransferSendNonBlocking
-Turn off LED1

STATE_EMITTING_LEFT
-Turn on LED2 and LED3
-Configure SAI as left justified, monoleft and channel 1 (I leave this channel 1 as the example but don't fully understand why is this value), asynchronous mode, master.
-Configure the SAI_TransferTxSetConfig
-Set the BCK with SAI_TxSetBitClockRate
-Reproduces sound with SAI_TransferSendNonBlocking
-Turn off LED2 and LED3

Then repeats alternating playing sound between left and right.


Results:
So far, debugging with MCUxpresso I've been able to reproduce sounds through channel 1 (left) and channel 2 (right).

Issues:
1)This doesn't work all the time, if I try to toggle both LED2 and LED3, the program reproduces 10 times the sound on the left and 9 times on the right and then completely freezes. If I remove writing1&writing0 to LED2 or LED3, the program has no freezing, it alternates reproducing sounds left&right without problem.
1.1) In order to reproduce sounds, I need to run the program through MCUXpresso debugging mode. If I run the program without it, volume goes very low and it only reproduces sound through monoLeft. This doesn't make any sense to me. I'm using the same code I tested on another custom board with the same RT1024 and the same audio DAC, but using SAI3 instead of SAI1


2)I see the audio data coming out from TX_DATA0 but not from TX_DATA1. How could I get data to come out from TX_DATA1 pin too?

I've attached the main programming code files for further detail.

Please, any help would be appreciated!!
Thanks!!



0 Kudos
Reply
1 Solution
3,178 Views
mayliu1
NXP Employee
NXP Employee

Hi @DigitalBrain 

 

I think DEMO_SAI_CHANNEL depend on your needs, what I show you is just a demo.

You can also set saiChannelMask, this param can also set multiple SAI channel.

mayliu1_1-1735296067458.png

function -> SAI_TransferTxSetConfig will call SAI_TxSetConfig

mayliu1_2-1735296153019.png

In SAI_TxSetConfig function , saiChannelMask  set TCR3 register.

 

BR

mayliu

View solution in original post

0 Kudos
Reply
13 Replies
3,335 Views
mayliu1
NXP Employee
NXP Employee

Hi @DigitalBrain ,

Thank you for your interest in the NXP MIMXRT product, I would  like to provide service for you.

Question:
1)This doesn't work all the time, if I try to toggle both LED2 and LED3, the program reproduces 10 times the sound on the left and 9 times on the right and then completely freezes. If I remove writing1&writing0 to LED2 or LED3, the program has no freezing, it alternates reproducing sounds left&right without problem.

Answer: 

I have download your code, but there are no LED1,LED2,LED3 definition.

when the project freezing, Please check Register, Fault, Peripherals->SAI status.

mayliu1_1-1733971150320.png

You can also read SAI status in your code project.

mayliu1_2-1733971457550.png

Question:

1.1) In order to reproduce sounds, I need to run the program through MCUXpresso debugging mode. If I run the program without it, volume goes very low and it only reproduces sound through monoLeft. This doesn't make any sense to me. I'm using the same code I tested on another custom board with the same RT1024 and the same audio DAC, but using SAI3 instead of SAI1
Answer: 

If the volume changed, I suggest you double check Audio format.

Question:

2)I see the audio data coming out from TX_DATA0 but not from TX_DATA1. How could I get data to come out from TX_DATA1 pin too?

Answer: If you want to use TX_DATA0 and TX_DATA1 of SAI1 , please refer to the content of Section 34.5.1.7 "Transmit Configuration 3 (TCR3)" in the MIMXRT1024RM. You should set the Transmit Enable (TCE) bit in Transmit Configuration 3 (TCR3) when initializing the SAI1.

mayliu1_4-1733972318070.png

 

Wish it helps you.
If you still have question about it, please kindly let me know.

 

BR

mayliu

 

0 Kudos
Reply
3,295 Views
DigitalBrain
Contributor I

Hello @mayliu1 

initialization is as follows:

SAI_Init(DEMO_SAI);
SAI_TransferTxCreateHandle(DEMO_SAI, &txHandle, callback, NULL);
SAI_TxSetChannelFIFOMask(DEMO_SAI,3);

I thought that adding the last line would be enough to transmit through TX_DATA1 but it wasn't. What am I missing?


Thanks!!

0 Kudos
Reply
3,281 Views
mayliu1
NXP Employee
NXP Employee

Hi @DigitalBrain ,

Thanks for your reply.

Could you check your SAI1 TCR3 register value.

You can check MCUXpresso IDE -> Peripherals -> SAI1 -> TCR3->TCE

mayliu1_1-1735011387354.png

Wish it helps you.
If you still have question about it, please kindly let me know.

BR

mayliu

0 Kudos
Reply
3,254 Views
DigitalBrain
Contributor I

Hello, @mayliu1 

Thanks for your reply. These are the values:

DigitalBrain_0-1735208746335.png

TCE is set to 0x1. 

Maybe I need to use a different function to transmit through TX_DATA1?
Currently I'm using:

sai_handle_t txHandle = {0};
sai_transfer_t xfer;
SAI_TransferSendNonBlocking(SAI1, &txHandle, &xfer);

I understood this function would send the same data at the same time through all the enabled TX_DATA channels. Is it correct?


Thanks!!

0 Kudos
Reply
3,242 Views
mayliu1
NXP Employee
NXP Employee

Hi, @DigitalBrain 

 

Thanks for your update information.

I notice that your TCE is 1,  I don't think it is a right value.

TCE should be 0x03(0b0011) if you want both channel1 and channel 2  working.

mayliu1_0-1735211471634.png

 

Please double check your config function.

 

BR

mayliu

0 Kudos
Reply
3,240 Views
DigitalBrain
Contributor I

Hello, @mayliu1 

That's true. I've set it to 3:
SAI_TxSetChannelFIFOMask(SAI1,3);


DigitalBrain_0-1735213166427.png

but after executing the function, the register gets set to 0x1 instead of 0x3.

For some reason, I'm not being able to set it to 0x3

0 Kudos
Reply
3,236 Views
DigitalBrain
Contributor I

Furthermore, even placing the value directly to 0x3 gets 0x1 as result

void SAI_TxSetChannelFIFOMask(I2S_Type *base, uint8_t mask)
{
base->TCR3 &= ~I2S_TCR3_TCE_MASK;
base->TCR3 |= I2S_TCR3_TCE(0x3);
}

0 Kudos
Reply
3,218 Views
mayliu1
NXP Employee
NXP Employee

Hi @DigitalBrain 

Thanks for your update information.

I did a validation on my side, I can set TCE as 0x03, Please refer to what I did.

mayliu1_0-1735265076973.png

1: First , I think you should set your SAI  TX DATA1 .

Please note that the GPIO TX DATA1  is not real connect, your code should be based on your customed board. The modified configurations I made are just for giving you a demonstration. Please develop your code strictly base on your customed board.

mayliu1_1-1735265147286.png

 

2: Second, you need call SAI_TxSetChannelFIFOMask(DEMO_SAI, 0x03) in your project

I import SDK demo "evkmimxrt1020_sai_interrupt_transfer" , and use MIMXRT1020-EVK board .

mayliu1_2-1735265253628.png

 

Wish it helps you.
If you still have question about it, please kindly let me know.

If you have other question, Please create a new case, Thanks.

 

BR

mayliu

0 Kudos
Reply
3,193 Views
DigitalBrain
Contributor I

Hello, @mayliu1 

Thanks for your input!

Could you please  show me the value you set for DEMO_SAI_CHANNEL?

If I do the following:

#define DEMO_SAI_CHANNEL (0) //Now it doesn't matter as 3 is being hardcoded
SAI_TxSetChannelFIFOMask(DEMO_SAI,5);
SAI_GetLeftJustifiedConfig(&saiConfig, DEMO_AUDIO_BIT_WIDTH, kSAI_MonoRight,3);

The register sets to 3, seems like the value that matters is the sent on SAI_GetLeftJustifiedConfig

Also, how is it possible to select the data to transfer through TX_DATA0 and TX_DATA1 ?

Thanks!

0 Kudos
Reply
3,179 Views
mayliu1
NXP Employee
NXP Employee

Hi @DigitalBrain 

 

I think DEMO_SAI_CHANNEL depend on your needs, what I show you is just a demo.

You can also set saiChannelMask, this param can also set multiple SAI channel.

mayliu1_1-1735296067458.png

function -> SAI_TransferTxSetConfig will call SAI_TxSetConfig

mayliu1_2-1735296153019.png

In SAI_TxSetConfig function , saiChannelMask  set TCR3 register.

 

BR

mayliu

0 Kudos
Reply
3,068 Views
DigitalBrain
Contributor I

Hello @mayliu1 

Thanks for your reply!!

Utilizing kSAI_Channel#Mask got me to transmit data through TX_DATA1, however I'm wondering how is it possible to control which data is sent to each of the TX_DATAX.

For example, is it necessary to reconfigure all each time I want to transmit through audio jack1, audiojack2 audiojack3?


Right now, I need to run all of this routine each time I want to transmit through a jack:

SAI_GetLeftJustifiedConfig(&saiConfig, AUDIO_BIT_WIDTH, kSAI_MonoRight,kSAI_Channel0Mask);
saiConfig.syncMode    = SAI_TX_SYNC_MODE;
saiConfig.masterSlave = SAI_MASTER_SLAVE;
SAI_TransferTxSetConfig(SAI_MODULE, &txHandle, &saiConfig);
 
/* set bit clock divider */
SAI_TxSetBitClockRate(SAI_MODULE, AUDIO_MASTER_CLOCK, AUDIO_SAMPLE_RATE, AUDIO_BIT_WIDTH,
  AUDIO_DATA_CHANNEL);
 
GPIO_PinWrite(BOARD_INITPINS_LED_IZDA_GPIO, BOARD_INITPINS_LED_IZDA_PIN, 1);
/*  xfer structure */
temp          = (uint32_t)music;
xfer.data     = (uint8_t *)temp;
xfer.dataSize = MUSIC_LEN;
isFinished = false;
 
status_t result_IZDA = SAI_TransferSendNonBlocking(SAI_MODULE, &txHandle, &xfer);
/* Wait until finished */
while (isFinished != true)
{
}
 
GPIO_PinWrite(BOARD_INITPINS_LED_IZDA_GPIO, BOARD_INITPINS_LED_IZDA_PIN, 0);
 
delay_msec(800);


Then, if I want to transmit through audiojack 2 I do all the same just changing kSAI_MonoRight to kSAI_MonoLeft.

And finally, if I want to transmit through audiojack3 (this is the one connected to TX_DATA1) I do all the same changing to kSAI_MonoLeft, kSAI_Channel1Mask . This time kSAI_Channel1Mask because (as far as I understand) will transmit through TX_DATA1


Thanks!!
0 Kudos
Reply
3,044 Views
mayliu1
NXP Employee
NXP Employee

Hi @DigitalBrain ,

 

Thanks for your update information.

Sorry I don't know the corresponding relationship between audio jack1, audiojack2 ,jack3  with your SAI interface.

But I can tell you that SAI_GetClassicI2SConfig, SAI_GetLeftJustifiedConfig, SAI_GetRightJustifiedConfig all can support 2 slot.

Please modify your code, set sai_mono_stereo_t as kSAI_Stereo. 

mayliu1_0-1736504277923.png

I also suggest you can refer to this link.

https://www.nxp.com/docs/en/application-note/AN12090.pdf

If you still have question, Please create a new case, I will do my best to help you.

BR

mayliu

0 Kudos
Reply
2,999 Views
DigitalBrain
Contributor I

Thanks @mayliu1 !!

I've checked your previous answer as the solution as now data comes out through TX_DATA1. Also, I'll create a new case to troubleshoot the actual control of the data as suggested

Thanks again!!

0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2011263%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EUsing%20SAI1%20to%20drive%203%20audio%20outputs%20with%202%20TX_Data%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2011263%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%2C%20I'm%20running%20RT1024%20on%20a%20custom%20board.%3CBR%20%2F%3ESAI1%20is%20configured%20as%20an%20I2S%20master%20to%20control%201%20PCM4104.%20This%20DAC%20is%20capable%20of%20driving%204%20output%20channels%2C%20it%20drives%202%20channels%20per%20logic%20state%20of%20LRCK%3A%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22DigitalBrain_0-1733853392160.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22DigitalBrain_0-1733853392160.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F315122iDF77D912B5180B79%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22DigitalBrain_0-1733853392160.png%22%20alt%3D%22DigitalBrain_0-1733853392160.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3Ewhen%20LRCK%20is%20high%2C%20CH1%20reproduces%20whatever%20comes%20to%20DATA0%20and%20CH3%20reproduces%20whatever%20comes%20to%20DATA1.%3CBR%20%2F%3E%3CBR%20%2F%3EI'm%20trying%20to%20play%20sounds%20taking%20the%20%22evkmimxrt1024_sai_interrupt_transfer%22%20example%20and%20changing%20SAI3%20to%20SAI1%20with%20the%20next%20configuration%3A%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22DigitalBrain_1-1733853467091.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22DigitalBrain_1-1733853467091.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F315123iA15EE22402488DFE%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22DigitalBrain_1-1733853467091.png%22%20alt%3D%22DigitalBrain_1-1733853467091.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CBR%20%2F%3EThe%20routine%20is%20as%20follows%3A%3CBR%20%2F%3E-Initialize%20clocks%3CBR%20%2F%3E-Initialize%20SAI1%3CBR%20%2F%3E-Create%20SAI_TransferTxCreateHandle%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%3CSTRONG%3ESTATE_EMITTING_RIGHT%3CBR%20%2F%3E%3C%2FSTRONG%3E-Turn%20on%20LED1%3CBR%20%2F%3E-Configure%20SAI%20as%20left%20justified%2C%20monoright%20and%20channel%201%20(I%20leave%20this%20channel%201%20as%20the%20example%20but%20don't%20fully%20understand%20why%20is%20this%20value)%2C%20asynchronous%20mode%2C%20master.%3CBR%20%2F%3E-Configure%20the%26nbsp%3BSAI_TransferTxSetConfig%3CBR%20%2F%3E-Set%20the%20BCK%20with%26nbsp%3BSAI_TxSetBitClockRate%3CBR%20%2F%3E-Reproduces%20sound%20with%26nbsp%3BSAI_TransferSendNonBlocking%3CBR%20%2F%3E-Turn%20off%20LED1%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSTRONG%3ESTATE_EMITTING_LEFT%3CBR%20%2F%3E%3C%2FSTRONG%3E-Turn%20on%20LED2%20and%20LED3%3CBR%20%2F%3E-Configure%20SAI%20as%20left%20justified%2C%20monoleft%20and%20channel%201%20(I%20leave%20this%20channel%201%20as%20the%20example%20but%20don't%20fully%20understand%20why%20is%20this%20value)%2C%20asynchronous%20mode%2C%20master.%3CBR%20%2F%3E-Configure%20the%26nbsp%3BSAI_TransferTxSetConfig%3CBR%20%2F%3E-Set%20the%20BCK%20with%26nbsp%3BSAI_TxSetBitClockRate%3CBR%20%2F%3E-Reproduces%20sound%20with%26nbsp%3BSAI_TransferSendNonBlocking%3CBR%20%2F%3E-Turn%20off%20LED2%20and%20LED3%3C%2FP%3E%3CP%3EThen%20repeats%20alternating%20playing%20sound%20between%20left%20and%20right.%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSTRONG%3EResults%3A%3C%2FSTRONG%3E%3CBR%20%2F%3ESo%20far%2C%20debugging%20with%20MCUxpresso%20I've%20been%20able%20to%20reproduce%20sounds%20through%20channel%201%20(left)%20and%20channel%202%20(right).%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSTRONG%3EIssues%3A%3C%2FSTRONG%3E%3CBR%20%2F%3E1)This%20doesn't%20work%20all%20the%20time%2C%20if%20I%20try%20to%20toggle%20both%20LED2%20and%20LED3%2C%20the%20program%20reproduces%2010%20times%20the%20sound%20on%20the%20left%20and%209%20times%20on%20the%20right%20and%20then%20completely%20freezes.%20If%20I%20remove%20writing1%26amp%3Bwriting0%20to%20LED2%20or%20LED3%2C%20the%20program%20has%20no%20freezing%2C%20it%20alternates%20reproducing%20sounds%20left%26amp%3Bright%20without%20problem.%3CBR%20%2F%3E1.1)%20In%20order%20to%20reproduce%20sounds%2C%20I%20need%20to%20run%20the%20program%20through%20MCUXpresso%20debugging%20mode.%20If%20I%20run%20the%20program%20without%20it%2C%20volume%20goes%20very%20low%20and%20it%20only%20reproduces%20sound%20through%20monoLeft.%20This%20doesn't%20make%20any%20sense%20to%20me.%20I'm%20using%20the%20same%20code%20I%20tested%20on%20another%20custom%20board%20with%20the%20same%20RT1024%20and%20the%20same%20audio%20DAC%2C%20but%20using%20SAI3%20instead%20of%20SAI1%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E2)I%20see%20the%20audio%20data%20coming%20out%20from%20TX_DATA0%20but%20not%20from%20TX_DATA1.%20How%20could%20I%20get%20data%20to%20come%20out%20from%20TX_DATA1%20pin%20too%3F%3CBR%20%2F%3E%3CBR%20%2F%3EI've%20attached%20the%20main%20programming%20code%20files%20for%20further%20detail.%3CBR%20%2F%3E%3CBR%20%2F%3EPlease%2C%20any%20help%20would%20be%20appreciated!!%3CBR%20%2F%3EThanks!!%3C%2FP%3E%3CP%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2028456%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20Using%20SAI1%20to%20drive%203%20audio%20outputs%20with%202%20TX_Data%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2028456%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EThanks%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F239163%22%20target%3D%22_blank%22%3E%40mayliu1%3C%2FA%3E%26nbsp%3B!!%3CBR%20%2F%3E%3CBR%20%2F%3EI've%20checked%20your%20previous%20answer%20as%20the%20solution%20as%20now%20data%20comes%20out%20through%20TX_DATA1.%20Also%2C%20I'll%20create%20a%20new%20case%20to%20troubleshoot%20the%20actual%20control%20of%20the%20data%20as%20suggested%3CBR%20%2F%3E%3CBR%20%2F%3EThanks%20again!!%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2025714%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20Using%20SAI1%20to%20drive%203%20audio%20outputs%20with%202%20TX_Data%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2025714%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F242687%22%20target%3D%22_blank%22%3E%40DigitalBrain%3C%2FA%3E%26nbsp%3B%2C%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3EThanks%20for%20your%20update%20information.%3C%2FP%3E%0A%3CP%3E%3CSPAN%3ESorry%20I%20don't%20know%20the%20corresponding%20relationship%20between%20audio%20jack1%2C%20audiojack2%20%2Cjack3%26nbsp%3B%20with%20your%20SAI%20interface.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EBut%20I%20can%20tell%20you%20that%26nbsp%3BSAI_GetClassicI2SConfig%2C%20SAI_GetLeftJustifiedConfig%2C%20SAI_GetRightJustifiedConfig%20all%20can%20support%202%20slot.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EPlease%20modify%20your%20code%2C%20set%20sai_mono_stereo_t%20as%20kSAI_Stereo.%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22mayliu1_0-1736504277923.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22mayliu1_0-1736504277923.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F318960i5F2B69DDFD3B5322%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22mayliu1_0-1736504277923.png%22%20alt%3D%22mayliu1_0-1736504277923.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EI%20also%20suggest%20you%20can%20refer%20to%20this%20link.%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fwww.nxp.com%2Fdocs%2Fen%2Fapplication-note%2FAN12090.pdf%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fwww.nxp.com%2Fdocs%2Fen%2Fapplication-note%2FAN12090.pdf%3C%2FA%3E%3C%2FP%3E%0A%3CP%3EIf%20you%20still%20have%20question%2C%20Please%20create%20a%20new%20case%2C%20I%20will%20do%20my%20best%20to%20help%20you.%3C%2FP%3E%0A%3CP%3EBR%3C%2FP%3E%0A%3CP%3Emayliu%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2024222%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20Using%20SAI1%20to%20drive%203%20audio%20outputs%20with%202%20TX_Data%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2024222%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F239163%22%20target%3D%22_blank%22%3E%40mayliu1%3C%2FA%3E%26nbsp%3B%3CBR%20%2F%3E%3CBR%20%2F%3EThanks%20for%20your%20reply!!%3CBR%20%2F%3E%3CBR%20%2F%3EUtilizing%20kSAI_Channel%23Mask%20got%20me%20to%20transmit%20data%20through%20TX_DATA1%2C%20however%20I'm%20wondering%20how%20is%20it%20possible%20to%20control%20which%20data%20is%20sent%20to%20each%20of%20the%20TX_DATAX.%3CBR%20%2F%3E%3CBR%20%2F%3EFor%20example%2C%20is%20it%20necessary%20to%20reconfigure%20all%20each%20time%20I%20want%20to%20transmit%20through%20audio%20jack1%2C%20audiojack2%20audiojack3%3F%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3ERight%20now%2C%20I%20need%20to%20run%20all%20of%20this%20routine%20each%20time%20I%20want%20to%20transmit%20through%20a%20jack%3A%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%3CDIV%3E%3CSPAN%3ESAI_GetLeftJustifiedConfig(%26amp%3BsaiConfig%2C%20AUDIO_BIT_WIDTH%2C%20%3CSTRONG%3EkSAI_MonoRight%3C%2FSTRONG%3E%2C%3CSTRONG%3EkSAI_Channel0Mask%3C%2FSTRONG%3E)%3B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3EsaiConfig.syncMode%26nbsp%3B%20%26nbsp%3B%20%3D%20SAI_TX_SYNC_MODE%3B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3EsaiConfig.masterSlave%20%3D%20SAI_MASTER_SLAVE%3B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3ESAI_TransferTxSetConfig(SAI_MODULE%2C%20%26amp%3BtxHandle%2C%20%26amp%3BsaiConfig)%3B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%2F*%20set%20bit%20clock%20divider%20*%2F%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3ESAI_TxSetBitClockRate(SAI_MODULE%2C%20AUDIO_MASTER_CLOCK%2C%20AUDIO_SAMPLE_RATE%2C%20AUDIO_BIT_WIDTH%2C%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%26nbsp%3B%20AUDIO_DATA_CHANNEL)%3B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3EGPIO_PinWrite(BOARD_INITPINS_LED_IZDA_GPIO%2C%20BOARD_INITPINS_LED_IZDA_PIN%2C%201)%3B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%2F*%26nbsp%3B%20xfer%20structure%20*%2F%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3Etemp%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%3D%20(uint32_t)music%3B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3Exfer.data%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%3D%20(uint8_t%20*)temp%3B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3Exfer.dataSize%20%3D%20MUSIC_LEN%3B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3EisFinished%20%3D%20false%3B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3Estatus_t%20result_IZDA%20%3D%20SAI_TransferSendNonBlocking(SAI_MODULE%2C%20%26amp%3BtxHandle%2C%20%26amp%3Bxfer)%3B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%2F*%20Wait%20until%20finished%20*%2F%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3Ewhile%20(isFinished%20!%3D%20true)%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%7B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%7D%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3EGPIO_PinWrite(BOARD_INITPINS_LED_IZDA_GPIO%2C%20BOARD_INITPINS_LED_IZDA_PIN%2C%200)%3B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3Edelay_msec(800)%3B%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3EThen%2C%20if%20I%20want%20to%20transmit%20through%20audiojack%202%20I%20do%20all%20the%20same%20just%20changing%26nbsp%3B%3CSTRONG%3EkSAI_MonoRight%3C%2FSTRONG%3E%26nbsp%3Bto%20%3CSTRONG%3EkSAI_MonoLeft.%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FSTRONG%3EAnd%20finally%2C%20if%20I%20want%20to%20transmit%20through%20audiojack3%20(this%20is%20the%20one%20connected%20to%20TX_DATA1)%20I%20do%20all%20the%20same%20changing%20to%26nbsp%3B%3CSTRONG%3EkSAI_MonoLeft%2C%20kSAI_Channel1Mask%3C%2FSTRONG%3E%20.%20This%20time%20kSAI_Channel1Mask%20because%20(as%20far%20as%20I%20understand)%20will%20transmit%20through%20TX_DATA1%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3EThanks!!%3C%2FDIV%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2020040%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20Using%20SAI1%20to%20drive%203%20audio%20outputs%20with%202%20TX_Data%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2020040%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F242687%22%20target%3D%22_blank%22%3E%40DigitalBrain%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3EI%20think%26nbsp%3B%3CSPAN%3EDEMO_SAI_CHANNEL%20depend%20on%20your%20needs%2C%20what%20I%20show%20you%20is%20just%20a%20demo.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EYou%20can%20also%20set%26nbsp%3BsaiChannelMask%2C%20this%20param%20can%20also%20set%20multiple%20SAI%20channel.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22mayliu1_1-1735296067458.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22mayliu1_1-1735296067458.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F317494i6A3CC7B5CA4B49F3%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22mayliu1_1-1735296067458.png%22%20alt%3D%22mayliu1_1-1735296067458.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3Efunction%20-%26gt%3B%20SAI_TransferTxSetConfig%20will%20call%26nbsp%3BSAI_TxSetConfig%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22mayliu1_2-1735296153019.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22mayliu1_2-1735296153019.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F317495iA67E04A381FB49A1%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22mayliu1_2-1735296153019.png%22%20alt%3D%22mayliu1_2-1735296153019.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EIn%26nbsp%3B%3CSPAN%3ESAI_TxSetConfig%20function%20%2C%26nbsp%3BsaiChannelMask%26nbsp%3B%20set%20TCR3%20register.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3E%3CSPAN%3EBR%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3Emayliu%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2020008%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20Using%20SAI1%20to%20drive%203%20audio%20outputs%20with%202%20TX_Data%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2020008%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%2C%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F239163%22%20target%3D%22_blank%22%3E%40mayliu1%3C%2FA%3E%26nbsp%3B%3CBR%20%2F%3E%3CBR%20%2F%3EThanks%20for%20your%20input!%3CBR%20%2F%3E%3CBR%20%2F%3ECould%20you%20please%26nbsp%3B%20show%20me%20the%20value%20you%20set%20for%20DEMO_SAI_CHANNEL%3F%3CBR%20%2F%3E%3CBR%20%2F%3EIf%20I%20do%20the%20following%3A%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSTRONG%3E%23define%20DEMO_SAI_CHANNEL%20(0)%20%2F%2FNow%20it%20doesn't%20matter%20as%203%20is%20being%20hardcoded%3C%2FSTRONG%3E%3CBR%20%2F%3E%3CSTRONG%3ESAI_TxSetChannelFIFOMask(DEMO_SAI%2C5)%3B%3C%2FSTRONG%3E%3CBR%20%2F%3E%3CSTRONG%3ESAI_GetLeftJustifiedConfig(%26amp%3BsaiConfig%2C%20DEMO_AUDIO_BIT_WIDTH%2C%20kSAI_MonoRight%2C3)%3B%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FSTRONG%3EThe%20register%20sets%20to%203%2C%20seems%20like%20the%20value%20that%20matters%20is%20the%20sent%20on%20SAI_GetLeftJustifiedConfig%3CBR%20%2F%3E%3CBR%20%2F%3EAlso%2C%20how%20is%20it%20possible%20to%20select%20the%20data%20to%20transfer%20through%20TX_DATA0%20and%20TX_DATA1%20%3F%3CBR%20%2F%3E%3CBR%20%2F%3EThanks!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2019822%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20Using%20SAI1%20to%20drive%203%20audio%20outputs%20with%202%20TX_Data%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2019822%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F242687%22%20target%3D%22_blank%22%3E%40DigitalBrain%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThanks%20for%20your%20update%20information.%3C%2FP%3E%0A%3CP%3EI%20did%20a%20validation%20on%20my%20side%2C%20I%20can%20set%20TCE%20as%200x03%2C%20Please%20refer%20to%20what%20I%20did.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22mayliu1_0-1735265076973.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22mayliu1_0-1735265076973.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F317429iA75E7F925AF24C9D%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22mayliu1_0-1735265076973.png%22%20alt%3D%22mayliu1_0-1735265076973.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E1%3A%20First%20%2C%20I%20think%20you%20should%20set%20your%20SAI%26nbsp%3B%20TX%20DATA1%20.%3C%2FP%3E%0A%3CP%3EPlease%20note%20that%20the%20GPIO%26nbsp%3BTX%20DATA1%26nbsp%3B%20is%20not%20real%20connect%2C%20your%20code%20should%20be%20based%20on%20your%20customed%20board.%20%3CSPAN%3EThe%20modified%20configurations%20I%20made%20are%20just%20for%20giving%20you%20a%20demonstration.%20Please%20develop%20your%20code%20strictly%20base%20on%20your%20customed%20board.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22mayliu1_1-1735265147286.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22mayliu1_1-1735265147286.png%22%20style%3D%22width%3A%20353px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F317430i08E6F6611D5FBEAF%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22mayliu1_1-1735265147286.png%22%20alt%3D%22mayliu1_1-1735265147286.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3E2%3A%20Second%2C%20you%20need%20call%20%3CSPAN%3ESAI_TxSetChannelFIFOMask(DEMO_SAI%2C%200x03)%20in%20your%20project%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EI%20import%20SDK%20demo%20%22evkmimxrt1020_sai_interrupt_transfer%22%20%2C%20and%20use%20MIMXRT1020-EVK%20board%20.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22mayliu1_2-1735265253628.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22mayliu1_2-1735265253628.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F317431i7F106471457554E3%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22mayliu1_2-1735265253628.png%22%20alt%3D%22mayliu1_2-1735265253628.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3EWish%20it%20helps%20you.%3CBR%20%2F%3EIf%20you%20still%20have%20question%20about%20it%2C%20please%20kindly%20let%20me%20know.%3C%2FP%3E%0A%3CP%3EIf%20you%20have%20other%20question%2C%20Please%20create%20a%20new%20case%2C%20Thanks.%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3EBR%3C%2FP%3E%0A%3CP%3Emayliu%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2019715%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20Using%20SAI1%20to%20drive%203%20audio%20outputs%20with%202%20TX_Data%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2019715%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EFurthermore%2C%20even%20placing%20the%20value%20directly%20to%200x3%20gets%200x1%20as%20result%3CBR%20%2F%3E%3CBR%20%2F%3Evoid%20SAI_TxSetChannelFIFOMask(I2S_Type%20*base%2C%20uint8_t%20mask)%3CBR%20%2F%3E%7B%3CBR%20%2F%3Ebase-%26gt%3BTCR3%20%26amp%3B%3D%20~I2S_TCR3_TCE_MASK%3B%3CBR%20%2F%3Ebase-%26gt%3BTCR3%20%7C%3D%20I2S_TCR3_TCE(%3CSTRONG%3E0x3%3C%2FSTRONG%3E)%3B%3CBR%20%2F%3E%7D%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2019708%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20Using%20SAI1%20to%20drive%203%20audio%20outputs%20with%202%20TX_Data%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2019708%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%2C%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F239163%22%20target%3D%22_blank%22%3E%40mayliu1%3C%2FA%3E%26nbsp%3B%3CBR%20%2F%3E%3CBR%20%2F%3EThat's%20true.%20I've%20set%20it%20to%203%3A%3CBR%20%2F%3E%3CSTRONG%3ESAI_TxSetChannelFIFOMask(SAI1%2C3)%3B%3CBR%20%2F%3E%3C%2FSTRONG%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22DigitalBrain_0-1735213166427.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22DigitalBrain_0-1735213166427.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F317397i1A4FF070DD98E69E%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22DigitalBrain_0-1735213166427.png%22%20alt%3D%22DigitalBrain_0-1735213166427.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3Ebut%20after%20executing%20the%20function%2C%20the%20register%20gets%20set%20to%200x1%20instead%20of%200x3.%3CBR%20%2F%3E%3CBR%20%2F%3EFor%20some%20reason%2C%20I'm%20not%20being%20able%20to%20set%20it%20to%200x3%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2019701%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20Using%20SAI1%20to%20drive%203%20audio%20outputs%20with%202%20TX_Data%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2019701%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%2C%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F242687%22%20target%3D%22_blank%22%3E%40DigitalBrain%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3EThanks%20for%20your%20update%20information.%3C%2FP%3E%0A%3CP%3EI%20notice%20that%20your%20TCE%20is%201%2C%26nbsp%3B%20I%20don't%20think%20it%20is%20a%20right%20value.%3C%2FP%3E%0A%3CP%3ETCE%20should%20be%200x03(0b0011)%20if%20you%20want%20both%20channel1%20and%20channel%202%26nbsp%3B%20working.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22mayliu1_0-1735211471634.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22mayliu1_0-1735211471634.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F317396i8A3AE7780DEF7D59%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22mayliu1_0-1735211471634.png%22%20alt%3D%22mayliu1_0-1735211471634.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3EPlease%20double%20check%20your%20config%20function.%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3EBR%3C%2FP%3E%0A%3CP%3Emayliu%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2019699%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20Using%20SAI1%20to%20drive%203%20audio%20outputs%20with%202%20TX_Data%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2019699%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%2C%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F239163%22%20target%3D%22_blank%22%3E%40mayliu1%3C%2FA%3E%26nbsp%3B%3CBR%20%2F%3E%3CBR%20%2F%3EThanks%20for%20your%20reply.%20These%20are%20the%20values%3A%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22DigitalBrain_0-1735208746335.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22DigitalBrain_0-1735208746335.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F317395iF51D7134D73787FB%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22DigitalBrain_0-1735208746335.png%22%20alt%3D%22DigitalBrain_0-1735208746335.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3ETCE%20is%20set%20to%200x1.%26nbsp%3B%3CBR%20%2F%3E%3CBR%20%2F%3EMaybe%20I%20need%20to%20use%20a%20different%20function%20to%20transmit%20through%20TX_DATA1%3F%3CBR%20%2F%3ECurrently%20I'm%20using%3A%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSTRONG%3Esai_handle_t%20txHandle%20%3D%20%7B0%7D%3B%3C%2FSTRONG%3E%3CBR%20%2F%3E%3CSTRONG%3Esai_transfer_t%20xfer%3B%3C%2FSTRONG%3E%3CBR%20%2F%3E%3CSTRONG%3ESAI_TransferSendNonBlocking(SAI1%2C%20%26amp%3BtxHandle%2C%20%26amp%3Bxfer)%3B%3C%2FSTRONG%3E%3CBR%20%2F%3E%3CBR%20%2F%3EI%20understood%20this%20function%20would%20send%20the%20same%20data%20at%20the%20same%20time%20through%20all%20the%20enabled%20TX_DATA%20channels.%20Is%20it%20correct%3F%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3EThanks!!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2018826%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20Using%20SAI1%20to%20drive%203%20audio%20outputs%20with%202%20TX_Data%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2018826%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F242687%22%20target%3D%22_blank%22%3E%40DigitalBrain%3C%2FA%3E%26nbsp%3B%2C%3C%2FP%3E%0A%3CP%3EThanks%20for%20your%20reply.%3C%2FP%3E%0A%3CP%3ECould%20you%20check%20your%20SAI1%20TCR3%20register%20value.%3C%2FP%3E%0A%3CP%3EYou%20can%20check%20MCUXpresso%20IDE%20-%26gt%3B%20Peripherals%20-%26gt%3B%20SAI1%20-%26gt%3B%20TCR3-%26gt%3BTCE%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22mayliu1_1-1735011387354.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22mayliu1_1-1735011387354.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F317137i57CF26B68DDC8D3A%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22mayliu1_1-1735011387354.png%22%20alt%3D%22mayliu1_1-1735011387354.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EWish%20it%20helps%20you.%3CBR%20%2F%3EIf%20you%20still%20have%20question%20about%20it%2C%20please%20kindly%20let%20me%20know.%3C%2FP%3E%0A%3CP%3EBR%3C%2FP%3E%0A%3CP%3Emayliu%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2018664%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20Using%20SAI1%20to%20drive%203%20audio%20outputs%20with%202%20TX_Data%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2018664%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F239163%22%20target%3D%22_blank%22%3E%40mayliu1%3C%2FA%3E%26nbsp%3B%3CBR%20%2F%3E%3CBR%20%2F%3Einitialization%20is%20as%20follows%3A%3CBR%20%2F%3E%3CBR%20%2F%3ESAI_Init(DEMO_SAI)%3B%3CBR%20%2F%3ESAI_TransferTxCreateHandle(DEMO_SAI%2C%20%26amp%3BtxHandle%2C%20callback%2C%20NULL)%3B%3CBR%20%2F%3E%3CSTRONG%3ESAI_TxSetChannelFIFOMask(DEMO_SAI%2C3)%3B%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FSTRONG%3EI%20thought%20that%20adding%20the%20last%20line%20would%20be%20enough%20to%20transmit%20through%20TX_DATA1%20but%20it%20wasn't.%20What%20am%20I%20missing%3F%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3EThanks!!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2012454%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20Using%20SAI1%20to%20drive%203%20audio%20outputs%20with%202%20TX_Data%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2012454%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F242687%22%20target%3D%22_blank%22%3E%40DigitalBrain%3C%2FA%3E%26nbsp%3B%2C%3C%2FP%3E%0A%3CP%3EThank%20you%20for%20your%20interest%20in%20the%20NXP%20MIMXRT%20product%2C%20I%20would%26nbsp%3B%20like%20to%20provide%20service%20for%20you.%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EQuestion%3A%3C%2FSTRONG%3E%3CBR%20%2F%3E%3CSPAN%3E1)This%20doesn't%20work%20all%20the%20time%2C%20if%20I%20try%20to%20toggle%20both%20LED2%20and%20LED3%2C%20the%20program%20reproduces%2010%20times%20the%20sound%20on%20the%20left%20and%209%20times%20on%20the%20right%20and%20then%20completely%20freezes.%20If%20I%20remove%20writing1%26amp%3Bwriting0%20to%20LED2%20or%20LED3%2C%20the%20program%20has%20no%20freezing%2C%20it%20alternates%20reproducing%20sounds%20left%26amp%3Bright%20without%20problem.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EAnswer%3A%26nbsp%3B%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3EI%20have%20download%20your%20code%2C%20but%20there%20are%20no%20LED1%2CLED2%2CLED3%20definition.%3C%2FP%3E%0A%3CP%3Ewhen%20the%20project%20freezing%2C%20Please%20check%20Register%2C%20Fault%2C%20Peripherals-%26gt%3BSAI%20status.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22mayliu1_1-1733971150320.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22mayliu1_1-1733971150320.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F315496i80D1B187CC237D67%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22mayliu1_1-1733971150320.png%22%20alt%3D%22mayliu1_1-1733971150320.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EYou%20can%20also%20read%20SAI%20status%20in%20your%20code%20project.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22mayliu1_2-1733971457550.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22mayliu1_2-1733971457550.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F315497i0000F8FAF38951A8%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22mayliu1_2-1733971457550.png%22%20alt%3D%22mayliu1_2-1733971457550.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EQuestion%3A%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3E1.1)%20In%20order%20to%20reproduce%20sounds%2C%20I%20need%20to%20run%20the%20program%20through%20MCUXpresso%20debugging%20mode.%20If%20I%20run%20the%20program%20without%20it%2C%20volume%20goes%20very%20low%20and%20it%20only%20reproduces%20sound%20through%20monoLeft.%20This%20doesn't%20make%20any%20sense%20to%20me.%20I'm%20using%20the%20same%20code%20I%20tested%20on%20another%20custom%20board%20with%20the%20same%20RT1024%20and%20the%20same%20audio%20DAC%2C%20but%20using%20SAI3%20instead%20of%20SAI1%3C%2FSPAN%3E%3CBR%20%2F%3E%3CSTRONG%3EAnswer%3A%26nbsp%3B%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EIf%20the%20volume%20changed%2C%20I%20suggest%20you%20double%20check%20Audio%20format.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3E%3CSPAN%3E%3CSTRONG%3EQuestion%3A%3C%2FSTRONG%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3E2)I%20see%20the%20audio%20data%20coming%20out%20from%20TX_DATA0%20but%20not%20from%20TX_DATA1.%20How%20could%20I%20get%20data%20to%20come%20out%20from%20TX_DATA1%20pin%20too%3F%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3E%3CSTRONG%3EAnswer%3A%26nbsp%3B%3C%2FSTRONG%3E%3C%2FSPAN%3E%3CSPAN%3EIf%20you%20want%20to%20use%20TX_DATA0%20and%20TX_DATA1%20of%20SAI1%20%2C%20please%20refer%20to%20the%20content%20of%20Section%2034.5.1.7%20%22Transmit%20Configuration%203%20(TCR3)%22%20in%20the%20MIMXRT1024RM.%20You%20should%20set%20the%20Transmit%20Enable%20(TCE)%20bit%20in%20Transmit%20Configuration%203%20(TCR3)%20when%20initializing%20the%20SAI1.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22mayliu1_4-1733972318070.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22mayliu1_4-1733972318070.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F315505iEF4CB4D91B3BFF83%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22mayliu1_4-1733972318070.png%22%20alt%3D%22mayliu1_4-1733972318070.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3EWish%20it%20helps%20you.%3CBR%20%2F%3EIf%20you%20still%20have%20question%20about%20it%2C%20please%20kindly%20let%20me%20know.%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3EBR%3C%2FP%3E%0A%3CP%3Emayliu%3C%2FP%3E%0A%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E