$24
In this lab, you will learn how use the MEMS microphones on the board, and send the stereo audio output to earphones via the MCU’s on-chip DAC. In particular, you will:
Learn about Pulse Density Modulation (PDM), which is the output format of the microphones. Learn how to use the MCU’s on-chip Digital Filter for Sigma-Delta Modulators (DFSDM) to convert the PDM signal into a standard audio signal of desired resolution and sampling fre-
quency.
Send the stereo audio input from the microphone to the headphones via the DAC.
Enable interrupts and DMA for input data to the DFSDM and output data to the DAC, thereby reducing the load on software.
Grading
60 % Microphone data acquisition via DFSDM (can be demonstrated via printing to USART). 20 % Audio heard correctly on headphones via DAC.
30 % DMA and interrupt setup for both DFSDM and DAC.
MEMS microphone and PDM signals
STM has provided the data-sheet for the on-board MEMS microphones. There are two microphones on the board, enabling stereo audio. You can refer to the board user manual to learn about the configuration and pin connections of the microphones.
The microphones provide serial audio data in PDM format, which is essentially highly over-sampled low resolution (1-bit) audio. Since there is only one bit of resolution, PDM can also be called digital audio.
This section only provides background information on the microphone and PDM audio, but it is important that you study the information so that you are able to clearly understand the DFSDM conversion in the next section in order to succeed in this lab.
DFSDM
The on-chip DFSDM modules are able to directly connect to the PDM output data, and produce an audio signal that has a higher resolution and a lower sampling frequency. You will find this and this reference useful to understand how to enable the DFSDM and interface it with the microphones. You will additionally need to refer to the HAL documentation and the MCU reference manual in order to fully understand how to configure the DFSDM.
Putting it all together
In this lab, we only require that you demonstrate that you are able to produce a stereo audio signal sampled at 16 KHz and with the resolution of at least 12 bits from the microphones, and are able to hear it on the headphones. The design choices of choosing the supply frequency to the microphones and the filter parameters for the DFSDM are up to you, and these choices will of-course impact the final sampling frequency and resolution of the signal. Moreover, you must be able to demonstrate that you are able to provide PDM data to the DFSDM and filtered audio data to the DAC via inter-rupts and DMA.
You may use the STM Cube application to create your project to work in. A base-project will also be provided, with most of the essential components set up. You will learn how to use your base-project in the tutorial.