 Hello, and welcome to this introduction to microphones. In this video, I'm going to cover the details of PDM microphone acquisition using the SAI interface on STM32. Like the I2S, the serial audio interface is a peripheral that is also used to transmit and receive digital audio data. The PDM protocol implemented can be seen as an extension of the I2S, which allows handling multiple channels. Its flexibility makes it possible to interface with basically all the audio devices and formats. We still have three signals, a word select or frame select, a bit clock and a data line. As you can see from the picture, in each frame you can fit more than two channels. SAI peripheral can be configured to follow the I2S standard. In this case, the microphone acquisition is exactly the same as for I2S, and we are going to use just two signals, the clock and the data. Let's start with a quick recap about the I2S mode. A single digital microphone can be connected to the SAI block when it's configured in an I2S mode, exactly as we saw in the previous video. The SAI is configured in master receiver mode and provides the clock to the digital microphone. Audio samples are acquired through the serial data pin. Data acquired in this way can be directly converted to the PCM format using the PDM to PCM library for STM32. There are no more constraints on the configuration of the left-right pin as long as the SAI clock polarity is configured correctly. We can also exploit the SAI in I2S mode to acquire two digital microphones. The two main aspects of this configuration are the microphones are configured with opposite left-right pins and share a common data line. The SAI peripheral operates at twice the microphone frequency in order to read the data provided by both microphones which share the same data line. Given a target frequency for the microphones equal to PDM clock, the SAI block will work at twice that frequency. The clock signal is then given as input to an STM32 timer which divides it by two to deliver the target PDM clock to the microphones. In this way, the SAI peripheral working at PDM clock times two will be able to read both the right microphone data on the rising edge and the left microphone data on the folding edge. Also, the software stage of bit interleaving to byte interleaving is the same as described for the I2S peripheral in the previous video. On some STM32, the SAI peripheral may include a PDM block specific for digital microphones acquisition, which gives some advantages when more than one microphone is needed. The PDM interface is able to generate the clock for the microphones and acquire the data on several data lines, on both edges of the clock, without the need of an additional timer to help the clock as in the I2S case. Please note that with SAI, the PDM to PCM conversion library is always needed. The PDM interface helps in the acquisition of multiple microphones, but it does not perform PDM to PCM conversion in hardware. Up to eight microphones can be connected to the PDM interface of the SAI peripheral. Each couple of microphones configured with opposite left-right pin share the same data line. The clock to the microphone can be common for all the microphones, allowing synchronized acquisition, different for each pair of microphones. There are two main advantages in using the PDM interface to read microphone data. The first one is that it can read on both edges of the clock. So it's no longer necessary to use different clock speeds for the microphones and the acquisition peripheral, and the timer is no longer needed. The second advantage is that it arranges PDM data in the output buffer in a flexible way. Data output arrangement can be configured. Its flexibility enables the adoption of the standard STM32 PDM to PCM conversion library without the need of the additional software demoxing step. As an example, you can find the SAI with PDM interface on some STM32H7 or some STM32WP. 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.