2023-03-10 06:20 AM
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:
2023-03-16 10:27 PM
@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.
Some warning is stated in that reference manual. I attached the warning massage screenshot below:
So I changed the I2S clock same like in APB clocks.
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:
I have been working for a long time in the I2S protocol.
Kindly help solve this problem.
2023-03-20 09:06 PM
@AScha.3 @Community member
Any updates on the questions I asked?
2023-03-20 11:37 PM
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.
2023-03-21 01:58 AM