2018-08-13 01:51 PM
I am using a STM32L1 MCU and I want to use the PDM to PCM conversion library, so I downloaded X-CUBE-MEMSMIC1, in the audio PDM lib folder I found libPDMFilter_CM3_Keil.lib.
In the release note I read this lib is for 16KHz PCM data sampling rate, So my questions are:
Thank you in advance
2018-08-14 12:11 AM
Hi J Lee, i am actually struggling with PDM->PCM library from ST fro the past few days. Can't get it to work. You can see my post here: https://community.st.com/s/question/0D50X00009cf4vsSAA/reading-pdm-data-from-mp34dt05a-with-stm32f407-i2s
I wrote document numbers in my post that has the information how to use that library. If you get it working corectly, please let my know.
2018-08-14 02:21 AM
Hello @Community member ,
Have a look to this user manual UM2372, it maybe helpful.
With Regards,
Imen.
2018-08-14 06:26 PM
@Imen DAHMEN
Thank you very much for your help, actually I am using cube MX to configure the I2S interface and I am using STM32L152RE-NUCLEO board, it seems in the clk config section, there's no specifed i2S clk config module ( see the screeshot in attatchment), so in this case how can I configure the i2s clock? Can I consider APB1_Prepherial_CLK as the I2S clk since I2S use PB1x pins?
I tried to measure the PDM sampling rate by measuring elapsed time in keil in this case, I don't know if it's fesiable?
Thank you very much
2018-10-29 04:25 AM
Hello @Community member ,
Regarding the question about I2S clock, It's true that STM32L1 has not a dedicated audio PLL:
I2S peripheral receive the clock from AHB clock. The clock tree shown in the image is a good choice for this use case.
The clock is then generated by I2S and it depends on the I2S peripheral configuration: in general, to target 1 channel recording with a PDM sampling frequency equal to PDM_CLK (for example 1.28 MHz), a good choice for the I2S parameters is:
hAudioInI2s.Instance = SPI2
hAudioInI2s.Init.DataFormat = I2S_DATAFORMAT_16B;
hAudioInI2s.Init.AudioFreq = (PDM_CLK / 32);
hAudioInI2s.Init.CPOL = I2S_CPOL_HIGH;
hAudioInI2s.Init.MCLKOutput = I2S_MCLKOUTPUT_DISABLE;
hAudioInI2s.Init.Mode = I2S_MODE_MASTER_RX;
hAudioInI2s.Init.Standard = I2S_STANDARD_MSB;
Kind Regards,
Imen.