Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

STM32F4 stereo MEMS mic

I've been working on audio project with STM32F4 discovery and I noticed one thing, all I2S standards only work with one microphone (depending which edge the standard uses separate bits). For exmpl. with Philips, MSB or LSB standards which are using falling edges as bit triggers, only catches the grounded L/R mic, and if I use PCM standard which uses rising edges as bit triggers, only catches the High L/R mic. I can't find a way to catch both MEMS mic samples in one period. Is the STM32F4 not capable of using to mics at once without external IC's?

like image 207
MattJ Avatar asked Oct 05 '15 06:10

MattJ


2 Answers

Just a follow up to the same question. One way of getting data from both of the microphones is making the microphone clock twice as smaller. You can do that by routing the I2S generated clock to a timer (which is set to output capture mode) at the ETR pin. Then using the timer you can divide it as you want. In this case twice. The timers output clock goes to both mics and their data is connected to the I2S data line (the same which is generating the clock). At the end you get I2S working twice as fast compared to the mics.

Here is an example with four microphone. (In your case just remove the SPI)

enter image description here

For more information read up on this.

http://www2.st.com/content/ccc/resource/technical/document/user_manual/f5/06/94/40/a6/01/49/ae/DM00187405.pdf/files/DM00187405.pdf/jcr:content/translations/en.DM00187405.pdf

like image 91
MattJ Avatar answered Oct 16 '22 19:10

MattJ


You can try to use I2S2 and I2S3, the second to generate the clock for the mics and the first to generate the clock for sampling the pdm values (at a double rate), sharing the same PLL the clock should be synchronized. Doing so I think you can get the pdm bits by reading the recv register of the I2S2 but I also think that the bits from the 2 mics will be interleaved (a bit from mic 1, another from mic 2 and so on).

like image 1
boorat Avatar answered Oct 16 '22 19:10

boorat