Skip to main content
AA.21
Associate III
Mar 10, 2023 2:20 PM UTC
Question

Hearing the voices not clear when i transmit the signal via I2S in the STM32WLE5JC

I used STM32WLE5JC control for playing the song via I2S. I have used SPI2 (alternat function of I2S) in the STM32WLE5JC. I can read the song in SD card and transmit the signal to the I2S in the I2S module (MAX98357A). The signal is transmitted to the I2S module and speaker ready to play. But I set the I2S exact hearable frequency(44.1khz) in the I2S initialization, that time noise is produced by the speaker. When I set the 8khz,11.025khz the song played slowly in the speaker. I am using MAX98357A mentioned frequency in the STM32WLE5JC, but no result.

I have attached the system clock & I2S configuration:

0693W00000aIgNCQA0.png0693W00000aIgNvQAK.png 

This topic has been closed for replies.

13 replies

AA.21
AA.21Author
Associate III
Mar 21, 2023 4:06 AM UTC

@AScha.3​ @Community member​ 

Any updates on the questions I asked?

AScha.3
Super User
Mar 21, 2023 8:58 AM UTC
  • as LCE said: wrong DMA -> DAC ; set DMA -> I2S ...better chance to work.
  • got PLL ON ? for 48MHz clk or so .
  • in I2S (in Cube) can set the sample rate you want; did you set it there?
If you feel a post has answered your question, please click on " Best Answer ".
LCE
Principal III
Mar 21, 2023 6:37 AM UTC

Your DMA is for the DAC peripheral, which has nothing to do with I2S, as far as I know.

Clock:

Take a calculator and modify the given values to get closer:

For example, take 8 MHz HSE, then set M = 2, PLLN = 79, PLLQ = 14,

then you should get 22.57 MHz.

In the I2S peripheral you have to set the prescaler accordingly, depending on its oversampling factor.