cancel
Showing results for 
Search instead for 
Did you mean: 

STM32L496ZG SAI1 - Wrong SAI1_FS_A

TTimm
Associate II

I have to read out a Mems-Mic (SPH0645LM4H-B).

The Data Format is I2S, 24-bit, 2’s compliment, MSB first.

One Cannel (L/R) needs 32 clocks -> Framlenght = 64

Samplerate 48kHz, real 46,875kHz, Clock 3.072MHZ.

Seems OK.

BUT: the FS-Signal Duty_Cycle is wrong!

Should be 1:1

In the Attachment you can see my SAI1_Init-Settings.

Whats wrong ?

Or to do to get a correct FS_Signal?

Kind Regards

Runout

2 REPLIES 2

Read out and check the SAI registers content. You probably want to concentrate on SAI_xFRCR.FSALL, look it up in the Reference Manual. I don't understand the Cube gibberish, but maybe it's related to ActiveFrameLength in the init struct.

JW

TTimm
Associate II

Hi Jan,

thank for your advice.

hsai_BlockA1.FrameInit.FrameLength = 64;

hsai_BlockA1.FrameInit.ActiveFrameLength = 32;

is correct.

To HAL o nor to HAL...

The "wording" is horrible.

Differs between CubeMx, HAL_Driver and MCU-Register.

Kind Regards Thomas

(maybe there are further questions...)