cancel
Showing results for 
Search instead for 
Did you mean: 

How to use MP45DT02 microphone on STM32F4 Discovery Board with STM32CubeMx?

BMoha.19.45
Associate II

Hi. I am working on MP45DT02 microphone on STM32F4 discovery board by using STM32CubeMx. I read manuals about how to use this microphone with STM32F4 discovery board and done my settings based on the figures on these manuals. However, at the end I just get some noise. Please, can somebody notify me what is my problem? (I send each byte with uart to Python which are in Hex format and then convert them on decimal and sound them on matlab. But, I think my problem is on code related with MCU)

1 REPLY 1
Eleon BORLINI
ST Employee

​Hi @BMoha.19.45​ , our experts point out the following comments about the your code:

  • PDM and PCM buffers are only 2 bytes long, should be much longer;
  • If you use the UART at 9600 speed, you will be able to send audio stream only at a maximum frequency of 600Hz (in the 16-bit case). Moreover, consider that the UART is quite tricky to be used, because the data stream is saved when you open the host terminal, and you will have a stream 1-byte misaligned.
  • You should check the I2S frequency and the DMA settings: it's very important to match the clock tree to get sensible data (and not random and uncorrelated data)

I suggest you to start from an existing example code, taking it i.e. from the X-CUBE-MEMSMIC1 libraries or the discovery f407.

Regards