SAI transfer 16 bit words with 32 bit wide frame sync

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

SAI transfer 16 bit words with 32 bit wide frame sync

Jump to solution
1,548 Views
benedek_kupper
Contributor III

We are in a situation where we need to use 32 bit wide frame sync (as this is the format that the codec expects), but the audio data itself is in 16 bits/frame format. I assumed that this configuration would be possible to manage in the SAI, by configuring the Frame Sync width to 32 bits, and the data word widths to 16 bits. The MCUXpresso Config Tool however marks this as an invalid setting.

Could someone tell us if this configuration is possible to achieve with iMXRT1010 SAI, and if so, with what configuration settings? I'd also like to know what should be the correct First Bit Shifted value, in order to shift the 16-bit data to the highest 16 bits of the frame.

Thanks in advance.

Labels (1)
0 Kudos
1 Solution
1,442 Views
benedek_kupper
Contributor III

In the meantime we have managed to make it work as we need it:

  1. We keep the widths at 32 in the configurator, and change the first bit shifted to 48 (it should be 16, as we're shifting up the 16-bit samples to the MSB, but that value isn't allowed, it works with 32+16 though).
  2. Then we need to manually change the sai_edma_handle_t's bytesPerFrame to 2 (which is sizeof(uint16_t)) after calling the peripheral init function.

I hope this will help fellow developers until the drivers/configurator is updated to support this mode.

 

 

View solution in original post

6 Replies
1,532 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi benedek_kupper,

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

   You mentioned: the MCUXpresso Config Tool however marks this as an invalid setting.

    Please give me a screenshot of the invalid settings from your side.

   Please also let me know your detail RT chip part number, and the MCUXpresso Config tool version, I will check it at first, then analyze more details.

 

Waiting for your update information!


Best Regards,
Kerry
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-----------------------------------------------------------------------------

0 Kudos
1,521 Views
benedek_kupper
Contributor III

We're using MIMXRT1011 chip. Here's the screenshot of the configurator showing the erroneous setting (and also the tool versions):

0 Kudos
1,468 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi benedek_kupper,

  So sorry for my later reply, because of our Chinese National day from 10.1 to 10.8, today we are back to work, and I check it on my side, please configure it like me, do you still have issues?

 

image.png

 

Wish it helps you!
If you still have questions about it, please kindly let me know!
Best Regards,
Kerry
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-----------------------------------------------------------------------------

 

0 Kudos
1,462 Views
benedek_kupper
Contributor III

Your configuration is for transferring 32 bit samples, but I have 16 bit samples, so I cannot use this configuration. (It would result in two samples being merged into one.)

0 Kudos
1,455 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi benedek_kupper,

   If use your configuration, I find it has the issue like the following:

image.png

Frame sync width must be less than or equal to the first data word width in the frame.

In the RM, TCSR[TE] register:

image.png

It also has the first word sync width limit.

So,I think your this type configuration is not supported by the RT1010.

Wish it helps you!

If you still have questions about it, please kindly let me know!

Best Regards,

Kerry

-------------------------------------------------------------------------------

Note:

- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored

Please open a new thread and refer to the closed one, if you have a related question at a later point in time.

-----------------------------------------------------------------------------

0 Kudos
1,443 Views
benedek_kupper
Contributor III

In the meantime we have managed to make it work as we need it:

  1. We keep the widths at 32 in the configurator, and change the first bit shifted to 48 (it should be 16, as we're shifting up the 16-bit samples to the MSB, but that value isn't allowed, it works with 32+16 though).
  2. Then we need to manually change the sai_edma_handle_t's bytesPerFrame to 2 (which is sizeof(uint16_t)) after calling the peripheral init function.

I hope this will help fellow developers until the drivers/configurator is updated to support this mode.