cancel
Showing results for 
Search instead for 
Did you mean: 

SAI - how to synchronize the data transmit between 2 blocks

SLasn.1
Associate II

Hi!

I am still playing with the SAI of my STM32F446RE. It has one SAI (SAI1) which has two blocks, A and B.

The idea is to use the two blocks synchronously in TDM mode to transmit in total 8 slots, 4 slots for each block.

I can get it to work fine, though I noticed the two blocks do not necessarily send the data at the same time - i.e. as soon as I put something in the DR registers it gets sent. I went through the datasheet and a few PDF presentations multiple times, but I still do not get how I can get the 2 blocks to send the data at the same time (for example I put 4 bytes in each block, then say "go" and the 8 bytes are sent together using the 8 slots - i.e. one frame).

I guess it is something to do with the FIFIO thresholds? I tried setting them to Full (in my case half full will be 4 bytes, so it will be perfect) but it does not change anything.

Could someone explain to me how I am supposed to configure the SAI blocks?

Thank you in advance!

Simon

PS: I am using CubeMX and the HAL lib.

10 REPLIES 10
jean
Senior

Hi @SLasn.1 !

Just found your very interesting thread about SAI and dual-line transmit. I'm new to SAI and it appears to be not the largely used library of STM32 users 🙂

Have you found a better solution to the zeros buffers?

PS: I've posted a related question in this thread, maybe you can confirm this idea can work, it seems quite similar to your use? https://community.st.com/t5/stm32-mcus-products/sai-transmission-to-external-dac-more-serial-data-outputs/m-p/655246 

Thanks!