cancel
Showing results for 
Search instead for 
Did you mean: 

STM32 SAI in TDM-4 Mode

SYako
Associate III

Hi, Im trying to connect adau1772 using TDM-4 Protocol to an STM32 MCU (L462RE).

Question 1: How to configure SAI as TDM-4, is my configuration wrong?

Question 2: Correct callback which occures when data packed is received?

Question 3: adau1772 is putting 24bit per channel, so 24*4 is 96bit per frame, How do I set 96 as frame length for SAI?

5 REPLIES 5

I don't use SAI with TDM, but may be this post could help https://community.st.com/s/question/0D50X0000B7ZnpmSQC/problem-with-sai-and-tdm

JW

Thank you, I found out that my configuration was wrong. but what about Q2 (Question 2: Correct callback which occures when data packed is received?)?

Also Is that a problem that real audio freq is not exactly 48kHz?

In case someone need TDM-4 configuration for adau1772 I'm attaching picture of my new config.

0690X00000BucITQAZ.png

Piranha
Chief II

> my configuration was wrong

That was because you've not read the codec's datasheet. Chapter "SERIAL DATA INPUT/OUTPUT PORTS" describes supported protocols pretty clearly.

> Correct callback which occures when data packed is received?

What's the problem with looking at the respective API functions and reading more about those in *.c file or HAL documentation?

> Also Is that a problem that real audio freq is not exactly 48kHz?

No.

Hello @SYako​,

currently I’m also struggling with the STM32 to run with an ADXL317 in TDM4 Mode, I think the naming and documentation of the parameters is not ideal, given the complexity. If you could document your settings and describing why you did picked them and the effects, that would be absolutely awesome.

@Piranha​ , if you are an I2S/SAI/TDM-God, please help us "mortals", write a whitepaper,…  we all get stuck sometimes or have a hard time getting into a new topic. 😉

Thanks a lot everybody,

Best Regards,

Seppel

I'm the god of reading the reference manuals and datasheets! The SAI chapter is pretty clear and detailed in the STM32 reference manuals. Read those and then come back with a specific questions, if you still have some.