2023-07-27 05:42 AM
Hi,
I have spent the last 2 weeks working on a project with the STM32F102CBT6 that includes the MP34DT06J MEMS microphone, but so far I have been unable to get it to output a valid PDM data stream. I have tried using both the SPI1 in master receive mode, as well as generating a 2MHz clock signal using the TIM2 channel 2 PWM functionality, but in both cases reading the DOUT pin of the mic shows an occasional spike, but no real data. There is the exception that within the 1st 20ms of powering up the device it appears to be outputting data, but then it returns to a seemingly idle state. For the mic I've connected pin 1 to 3.3V, pin 2 to ground, pin 3 to pin PB3 of the STM, and pin 4 to pin PB4 of the MCU. Has anyone run into this problem before?
2023-07-28 02:47 AM
Hi @TomLillie ,
Welcome to ST Community!
Just some questions to better understand your problem: can you share with us a screenshot of the clock and data acquired with the oscilloscope? Have you already tested another microphone?
Finally, did you use the libraries in X-CUBE-MEMSMIC1?
2023-07-31 05:09 AM
Hi, here is the response when running the device with a 2MHz clock. I seem to only be getting a response every 30 to 40 us, so when I capture the data and apply a decimation factor I'm left with a particularly small data set, which when played through audacity just sounds like noise. However, when I initially start up the device I'm getting a much denser output (see osc_3), and the device seems to operate quite normally for about 25ms, before returning to an idle state, as shown in osc_1 and osc_2. I'm at a bit of a loss as to why I'm getting such erratic behavior, are there any obvious errors that I should be checking for?
2023-07-31 05:12 AM
I have been using the STM32Cube PDM2PCM software library, with the pdmtopcm_glo.h file.
2023-08-01 01:45 AM
Hi @TomLillie ,
just to check: did you set the connections between Vdd and GND as in the figure 4 of the datasheet?
also, can you try to increase or decrease the clk frequency and share the resulting signal?
Niccolò
2023-08-01 03:07 AM
2023-08-01 03:08 AM
2023-08-01 03:09 AM
2023-08-03 02:10 AM
Hi @TomLillie ,
I see some issues in the schematic:
you put 100 nF and 10 uF from Vdd to GND, while the recommended is 100 nF and 1 uF
also, the 10k R from LR to GND should not be useful
I'm not sure if the reason for your problem can be that, but maybe you can also keep track of the Vdd line to check if the mic is powered up or not during operations
Niccolò