2024-08-15 07:21 AM
Hi all, i decided to write a simple program on my stm32 board (B-L475E-IOT01A), here are some of the setting of my peripheral:
i read input data from channel 2 sampling data on rising edge
The clock frequency at which the microphone is outputting PDM bits is 80 Mhz (by clock tree) divided by 40 using the internal prescaler
for the filtering on pdm signal i choose (by using the table) sinc3 with FOSR = 32, so that my output data is represented on a 16 bit signed integer.
the dma mode is circular and i use one bufffer for dma and the other buffer for pcm samples, the samples are mono so the audio buffer contains only one channel samples
here is a snippet of my code, i didnt include half buffer and full buffer callbacks, they just update the associated flags.
The problem with this program is that, the audio buf data is always negative (which i suppose is wrong because we are talking about some pcm waveform). What am i doing wrong?
2024-08-16 06:03 AM - edited 2024-08-16 06:06 AM
Hello @danieldeiana,
There are several potential issues that might cause incorrect data in the audio buffer. To address these, you should refer to the STM32L4 Reference Manual, which provides detailed information about the DFSDM peripheral and its configuration.
Also, you should:
I hope my answer has helped you. When your question is answered, please select this topic as solution that answered you, it will help others find that answer faster.
Thanks for your contribution.
Dor_RH