cancel
Showing results for 
Search instead for 
Did you mean: 

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

AA.21
Associate II

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 

13 REPLIES 13
AA.21
Associate II

@AScha.3​ @Community member​ 

Hi,

I have tried the DMA method also. It didn't play song in the speaker. But this time the song is played in 8khz,16khz,32khz, but the song speed is very slow.

 I put in the actual frequency 44.1khz in i2s communication that time noise produced in the speaker, and it couldn't hearable.

I read the STM32WL-RAK-3172 reference manual. In that manual list out the frequencies based on the I2S communication (PLL clock configurations). I tried to the set the PLL clock in cube IDE clock configuration, but I didn't able to set the PLLQ clock source. 

Forcefully I tried to set the PLLQ Clock, but the -warning is shown in the configuration.

If I enable the PLL CLOCK, that time I2S didn't worked. I can't see any output in the serial monitor, if enable the PLL clock.

0693W00000aJAxyQAG.png0693W00000aJB04QAG.pngSome warning is stated in that reference manual. I attached the warning massage screenshot below:

0693W00000aJB1vQAG.pngSo I changed the I2S clock same like in APB clocks.

0693W00000aJArIQAW.png​That time also the song didn't play in actual CD drive frequency 44.1khz.It only noise sound is produced in the speaker.

I also attached the DMA configuration below:

0693W00000aJB2yQAG.png

I have been working for a long time in the I2S protocol.

Kindly help solve this problem.

AA.21
Associate II

@AScha.3​ @Community member​ 

Any updates on the questions I asked?

LCE
Principal

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.

  • 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 "Accept as Solution".