cancel
Showing results for 
Search instead for 
Did you mean: 

How do I configure the MEMS Microphones as input for STM32F746-DISCO ?

Somekind
Associate

Good evening to you all,

I’m a first year engineer student in electronics and I’m on a personal project with my STM32F746NG-DISCO.

Long story short, we’re making a beacon coverage prototype in the canope of Guyana (in areas of interest) to hinder illegal gold panning.

The idea is to use our board’s 2 MEMS microphones to detect a sound, low-pass filter it, FFT it and then make it mathematically useable (but it’s another story).

The first step is already bugging us. It seems impossible for me to get the right documentation on those MEMS microphones. They are connected to the CODEC of the board, that’s for sure but how do I even “talk�? to the codec using the STM32CubeIDE ?

I think we are not looking the right direction or we are too disoriented by our lack of knowledge and experience.

I would like to know how those darn MEMS microphones work, where to see the data (apparently with SAI) and how to configure them first (apparently with SPI) or just having a clearer picture of how to use them the correct way.

Thank you a lot for those who want to help us, this has been bugging us for about a month now…

Have a nice evening,

Sincerely, Theo

1 ACCEPTED SOLUTION

Accepted Solutions
Eleon BORLINI
ST Employee

Hi Theo @Théo Akbas​ ,

that's an interesting application, indeed! Can you please add more details about your application in the Message section (top right of the page, near your profile image)?

As concerns your question, I would suggest you to start from existing projects running on ST platforms, such as the BlueTile (STEVAL-BCN002V1B) or the Bluecoin (STEVAL-BCNKT01V1), that are ready-to-use, even if not running on STM32F7.

For STM32F7-related projects, I suggest you to start from the X-CUBE-MEMSMIC1 firmware function pack, and especially the examples in the folder \Projects\STM32F746ZG-Nucleo\Demonstration\CCA02M2\Microphones_Streaming. It is based on the X-NUCLEO-CCA02M2 board, but can be generalized. As explained there:

[...] the microphones are routed to nucleo I2S peripheral (the first and the second) and SPI peripheral (the third and the fourth). In this scenario the microphones acquisition works in this way: a precise clock is generated by I2S peripheral while SPI is configured in slave mode and is fed by the same timing signal generated by I2S. This clock is then halved by a timer and given in input to the microphones: the SPI and I2S peripherals are working at a frequency that is twice the microphone frequency, so that they can read data on both the rising and falling edge of the microphone clock, thus reading the bits of two microphones each. A software step of demuxing is required in order to separate the signal from the two microphones and allows further processing like PDM to PCM conversion. 

As a side note, it is not necessary to connect the digital MEMS microphones to a codec, since the STM32F7 embeds the peripherals to directly acquire the MEMS microphone PDM bitstream.

-Eleon

View solution in original post

4 REPLIES 4
Eleon BORLINI
ST Employee

Hi Theo @Théo Akbas​ ,

that's an interesting application, indeed! Can you please add more details about your application in the Message section (top right of the page, near your profile image)?

As concerns your question, I would suggest you to start from existing projects running on ST platforms, such as the BlueTile (STEVAL-BCN002V1B) or the Bluecoin (STEVAL-BCNKT01V1), that are ready-to-use, even if not running on STM32F7.

For STM32F7-related projects, I suggest you to start from the X-CUBE-MEMSMIC1 firmware function pack, and especially the examples in the folder \Projects\STM32F746ZG-Nucleo\Demonstration\CCA02M2\Microphones_Streaming. It is based on the X-NUCLEO-CCA02M2 board, but can be generalized. As explained there:

[...] the microphones are routed to nucleo I2S peripheral (the first and the second) and SPI peripheral (the third and the fourth). In this scenario the microphones acquisition works in this way: a precise clock is generated by I2S peripheral while SPI is configured in slave mode and is fed by the same timing signal generated by I2S. This clock is then halved by a timer and given in input to the microphones: the SPI and I2S peripherals are working at a frequency that is twice the microphone frequency, so that they can read data on both the rising and falling edge of the microphone clock, thus reading the bits of two microphones each. A software step of demuxing is required in order to separate the signal from the two microphones and allows further processing like PDM to PCM conversion. 

As a side note, it is not necessary to connect the digital MEMS microphones to a codec, since the STM32F7 embeds the peripherals to directly acquire the MEMS microphone PDM bitstream.

-Eleon

Somekind
Associate

Good afternoon @Eleon BORLINI,

First of all, thank you a lot for your response, every help is welcome ! And sorry for the delay, the semester's exams arrive fast !

We indeed had in mind to use already existing projects but the prominent amount of information on different sites is overwhelming, even more when we meet to progress in our project only once a week... So we thank you a lot for the path you've cleared for us. We have installed the X-CUBE-MEMSMIC1 firmware and we shall investigate further next friday ! (Also thank you for the bit of important information in brief).

I will contact you via messages tonight or tomorrow (I've booked my whole weekend of study sessions...) for further explanations with pleasure ! If you wish, we can keep you up to date on the progress we make in our project.

We thank you again for your comeback, it is greatly appreciated.

Sincerely, Theo

Thanks Theo, keep me please updated about your project's next steps!

-Eleon

KnarfB
Principal III

You may start with the reference examples in https://github.com/STMicroelectronics/STM32CubeF7/tree/master/Projects/STM32746G-Discovery/Examples/BSP and related folders.

hth

KnarfB