cancel
Showing results for 
Search instead for 
Did you mean: 

SAI - no signal on MCLK pin

SLasn.1
Associate II

Hi 🙂

I am using SAI in TDM-8 mode, my MCU is a STM32F446RE. I want to use a PCM1681 but so far I am simply analysing the outputs. Everything seems to work fine apart from the MCLK output pin which gives me nada.

I followed what is explained in the RM0390 (https://www.st.com/resource/en/reference_manual/dm00135183-stm32f446xx-advanced-armbased-32bit-mcus-stmicroelectronics.pdf) section 28.3.8 "SAI clock generator" (pages 941 & 942).

In particular:

0693W000002lgQSQAY.png

with:

  • sai_x_ker_ck = SAI clock set in Clock Configuration in CubeMX
  • MCLK_x = sai_x_ker_ck / (clockDivider * 2) or = sai_x_ker_ck if clockDivider=0
  • SCK = MCLK * frame_length / 256

In my case I need 8 slots of 32 bits each per audio sample, so my frames are 256 bits long, so I have SCK=MCLK=256fs. And because I want the best accuracy possible for fs=44.1kHz, the best I could get was 0.22% with a sai_x_ker_ck of 11.289474MHz which is almost 256fs.

So in my case I have sai_x_ker_ck = MCLK = SCK, and I found that in this case the MCLK pin is not outputting. Is then the idea is simply to connect both the SCK and MCLK pins of my DAC (PCM1681) to the SCK pin of the MCU?

Thank you!

Simon

PS: in case you are wondering I am pretty sure that sai_x_ker_ck=MCLK=SCK is the reason why the MCLK is not outputting, I can get it to output fine if I reduce the frame to 128bit (then I have sai_x_ker_ck = MCLK = SCK * 2), or if I double sai_x_ker_ck (then I have MCLK = SCK = sai_x_ker_ck / 2), in this case MCLK=SCK but strangely they are opposite phase)

11 REPLIES 11

Confirming this worked for me as well. Thank you!

Yep, thats what I ended up doing. Worked.