STM32F4 I2S clock configuration for stereo PDM
Hi guys,
I have an STM32F412 discovery board and am attempting to find the best solution for connecting 8xPDM microphones in 4xStereo pairs and writing the resulting WAV to USB.
The method I'm currently attempting is:
- Use 4xI2S peripherals, each with 2xPDM mics
- Each I2S peripheral samples at double the rate (i want 16Khz so I use 32khz)
- I2Sx_CK goes to TIMx_CHxIN, which halves the clock and TIMx_CHxOUT goes to the PDM mics
- I perform manual de-interleaving of the bits and then use PDM2PCM library
My problem is that I can get a mono mic working no problems, but as soon as I try a stereo PDM configuration I get garbage (even if only 1 mic is connected) and after trying many other things I'm starting to suspect the problem is with my clock/timer setup.
After reviewing AN5027 (interfacing with PDM mics), I noticed it says for stereo I must use PLLR for the I2S clock source, not PLLI2SR (see table below).

I'm trying to follow the recommendations in the table for 16Khz Stereo, but I can't work out how to set this in a way that doesn't cause havoc with all the other peripherals and MCU?
I've got my attempt at clock setup, using PLLR instead of PLLI2SR for "I2S1 Clock Mux".

Does anyone have advice on how to interpret this requirement and setup my clock config to suit stereo PDM, USB and a good (>80Mhz hopefully) MCU supply clock?
Thanks
