cancel
Showing results for 
Search instead for 
Did you mean: 

Obtain 48kHz sample rate from SAI on STM32L5

JTedot
Associate II

Is it possible to obtain a (theoretical) 48kHz sample rate with 0% error on the STML5's SAI peripheral? So far the clock configuration tool in STM32CubeIDE has been unable to do so.

Research led me here, but this is not applicable to a slower clocking board like the L5. From what I know, the SAI-clock should be at least 1:1 with the bit-clock, which's speed can be calculated with this formula:

clk = sample_rate * resolution * n_frames

Where sample_rate is 48kHz, resolution is 32bit and n_frames is 2, one left, one right, equating to 3.072 MHz for the bit-clock. However, inserting this into the clock config tool fails, as the closest number to that is 4Mhz and even that is far off from the desired sample rate, with an error of -67%. Why is that? Is accurate sampling on the L5 possible? Other devices and DSP depend on accurate data.

clock-tree:

0693W00000Kd9V6QAJ.png

SAI-config:

0693W00000Kd9W9QAJ.png

1 REPLY 1
JTedot
Associate II

Great, wrong picture, which i cant edit out. here's the right one:0693W00000Kd9ZNQAZ.png