I have a STM32H735G-DK Discovery board and would like to record audio from the onboard digital MEMS microphone, a MP34DT01TR-M which provides PDM audio.

It would seem to me the simplest way to do this is via SPI. This seems supported by the ST Application Note. However, the board schematic seems to show the mic is hardwired to the SAI peripheral pins, and not connected to the SPI peripheral pins, and thus requires using the SAI peripheral.

Is that correct? Is there a way I can use the SPI peripheral?

If you ask: Why not just use SAI? I am not familiar with SAI and have not used it before. However, the MCU manual seems to show it very complicated and, what's more, doesn't give the raw PDM, or a decimated PCM, but rather encodes it into a whole new format called TDM, which it doesn't really define clearly. If I have to use SAI - I need to understand a. setting up the SAI registers and b. converting TDM back to PDM (so I can then convert it to PCM, which I thankfully know how to do.)

  • \$\begingroup\$ TDM is a framing format, not data format. TDM is like multichannel I2S, or I2S can be tought as two-channel TDM. The data bits that are in those data slots can be PCM or PDM data. I guess the SAI does give you raw PDM or can convert it to PCM. What type of samples you want, the original PDM from mic or more a more sensible PCM format? \$\endgroup\$
    – Justme
    Commented Oct 26, 2023 at 20:41
  • \$\begingroup\$ @Justme My ultimate goal is PCM. But if I get PDM, I can use filter+decimation to get the PCM I need. \$\endgroup\$ Commented Oct 26, 2023 at 20:59
  • \$\begingroup\$ @Justme I posted a follow up question re frame synchro at electronics.stackexchange.com/questions/686835/… \$\endgroup\$ Commented Oct 27, 2023 at 18:45

2 Answers 2


It does not seem possible to use the SAI pins with SPI because the alternate function for those pins do not match what you need for SPI. Look at picture below (the table is from the datasheet and the schematic from the link in your post). A side note... ST provides a pdm2pcm library (I have not used it though).

STM32H735xG PE4 PE5


I recently did a project with a PDM microphone on a STM32L4R5. My research left me with these conclusions:

  1. It was unclear whether the SPI peripheral supports PDM data collection because the STM32L4R5 documentation mentions PDM only in association with the SAI and DFSDM peripherals.
  2. The SAI peripheral supports PDM data collection and STMicro provides a software library that converts the PDM data to PCM data.
  3. The DFSDM peripheral can do the PDM to PCM conversion in hardware, unloading this duty from the software and making the software library unnecessary.

I ended up using the DFSDM peripheral and I suspect it's the best/easiest solution.

It's not clear to me whether you can use the DFSDM peripheral on your Discovery board based on the alternate pin functions shown in the other answer. The MIC_DATA to DFSDM1_DATIN3 looks good and promising. But I used a DFSDM_CKOUT signal from the microcontroller to drive the mic. And it looks like DFSDM1_CKIN3 is for input to the microcontroller, not output. Does that DNF solder bridge take the MIC_CLK signal to a DFSDM1_CKOUT signal?


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.