2020-07-06 01:27 PM
Hello :smiling_face_with_smiling_eyes:
I'm using the microphones on the X-NUCLEO-CCA02M2 Digital MEMS microphones expansion board based on MP34DT01-M for STM32 Nucleo. This card is plugged on nucleo stm32h743zi2
My problem is that I have to interface two microphones in stereo using a timer and the SPI and then stream the data via USB and i dont know how to do it.
Someone can tell me what is the configuration to adopt on cubeMX for the TIMER and SPI setup
Here's what I want to do:
And also what HAL functions I need to include in my program.
If someone have explanations, it would be very nice :smiling_face_with_smiling_eyes:
2020-07-07 02:45 AM
Hi @UTANG.1 , did you already check the X-CUBE-MEMSMIC1 examples? For example, the project in folder path: Projects\STM32F746ZG-Nucleo\Demonstration\CCA02M2\Microphones_Streaming, although not directly implemented on STM32H7 MCU. As reported in the description of the library:
[...] 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.
I add STM32H7 tag for broader audience and help. Regards
2020-07-07 09:37 AM
Thank you for your response,
I have taken a closer look at this project and I understand my problem better. But there's something I never understand about this type of project. In the project datasheet (X-CUBE-MEMSMIC1) as well as in many other projects I see this.
Easy portablility across different MCU families ? What does that mean exactly ? stmh7 is included?
Or is it just about the nuclear maps listed at the bottom of the picture?
These libraries (CCA02M1_AUDIO_H + CCA02M1_AUDIO_C) from the project (X-CUBE-MEMSMIC1) are they usable for an stmh7 map if not how to adapt them (if possible).
If I create a project with cubeMX with an h7 nucleo and I add these libraries and update the peripherals (SPI/I2S) it will work?
U.TANG
2020-07-07 09:38 AM
@Eleon BORLINI
2020-07-09 02:10 AM
Hi @UTANG.1 , this option:
>> If I create a project with cubeMX with an h7 nucleo and I add these libraries and update the peripherals (SPI/I2S) it will work?
should work. Changing the core STM32 hw will however change also the physical pins declarations in the code libraries. But i believe that our STM32 MCUs colleague are more expert about this topic...
Regards