 Hello and welcome to this introduction to microphones. In this video we'll do an overview of the STM32 peripherals available for MEMS microphones acquisition and we will discuss the most common strategies. Several STM32 peripherals can be used for the acquisition of a MEMS digital microphone. A first distinction to be made is between the peripherals that can acquire the microphone, but PDM-2PCM conversion is performed in software, and those peripherals that have PDM-2PCM filtering capabilities in hardware. I2S, SPI and SAI belong to the first group. They are able to acquire the PDM data, but the conversion is then made in software, using the STM32 PDM-2PCM software library. SAI can be always used as an I2S interface, but on some STM32 it also embeds a specific PDM interface for multi-channel PDM acquisition. The FSDM, on the other hand, can both acquire and convert to PCM. User doesn't even see the PDM data, since the peripherals will provide the PCM samples directly. A good practice to put in place when dealing with microphone acquisition and processing is the use of DMA. DMA will move PDM or PCM samples autonomously from the peripheral to the memory, leaving the core peripheral processing. A double buffer is usually adopted in this case, given a frame size we want to process, for example 1 or 10 milliseconds of audio. We use a buffer, which is twice the frame size. And with the circular mode active, the DMA will continuously fill this buffer, restarting from the beginning when it reaches the end. Interrupts are activated and generated when half of the buffer is full or when the buffer is completely full. In this way, we can process the first frame when the DMA is filling the second, and process the second part when the DMA is brought into the first one. As we saw in the previous videos, precise clock generation, which sets the PDM sampling frequency, is critical to obtain the correct PCM frequency, especially when dealing with the software conversion library, which has limited choice of decimation ratios. The clock is generated by the clock generator of the peripheral, but it strongly depends on the frequency used as its input. We can make a distinction here. Some of the peripherals we are using have kernel clock possibility. This means that their clock generator will be fed with a specific frequency, different from the APB clock. This comes usually from a PLL or a specific external input, and allows a precise division by the clock generator, and ultimately a more accurate frequency. This solution is also the most flexible, since it allows having an audio clock that is completely separated from the APB and core clock. Other peripherals can only generate a clock derived from their APB clock. In those cases, care must be taken with the output frequency. I2S, SAI, SPI version 2, and DFSDM are usually peripherals with kernel clock possibility. SPI version 1 is a peripheral with APB clock input. You can refer to the reference manual of the specific STM32 for further information on the specific structure of the clock tree. A good practice to put in place would be to measure the actual microphone clock with an oscilloscope, and verify that the frequency is the expected one. Please note that in the case of I2S, or SAI, used in I2S mode, the sampling frequency parameter you set in the HAL libraries, or in the STM32 QMX, is not the frequency of the bit clock we are going to give to the microphones. The frequency for the PDM microphone is obtained by multiplying the sampling frequency parameter by the number of channels and the channels bit length used in the I2S setting. For SAI peripherals used with PDM interface, specific configuration of the clock is needed. Please refer to the reference manual of your part number for further information. Here are some useful references you can find on ST.com. More videos in this video series can be found on the ST Microelectronics YouTube channel.