cancel
Showing results for 
Search instead for 
Did you mean: 

STM32L4 Serial audio interface

bendkhilarwa
Associate III
Posted on September 08, 2017 at 14:46

Hello,

I want to implement an audio record based on STM32L4. To do that  I want to use the SAI peripheral. By Referring to the STM32L4 datasheet the SAI don't support a microphone interface. So, in such case shall I use an external microphone to be able to record audio data using the SAI? .

thanks for the help. 

2 REPLIES 2
Posted on September 12, 2017 at 21:01

SAI is a digital interface which can be switched to multiple protocols. If you want to connect an analog microphone, you need an external ADC or CODEC chip (usually supporting I2S protocol). Alternatively, you can connect an analog microphone (amplified appropriately) to some of the ADC inputs of L4.

Other option is to use a digital microphone and connect it using the DFSDM module.

Look at the

http://www.st.com/content/st_com/en/products/evaluation-tools/product-evaluation-tools/mcu-eval-tools/stm32-mcu-eval-tools/stm32-mcu-discovery-kits/32l496gdiscovery.html

board for inspiration - the two onboard microphones are digital connected to DFSDM; and there is an input from the TRRS 3.5mm jack to the CODEC's MIC input(s) to connect a headset's microphone.

JW

bendkhilarwa
Associate III
Posted on September 23, 2017 at 18:03

Hello,

thanks for your response,  

In the reality, I'm trying to connect Adafruit microphone using SAI of the STM32L4. This microphone uses I2S protocol, and delivers as output PCM 24 bits data,(The microphone includes Segma delta filter and a decimator which are used to convert PDM data to PCM data), over sampling rate fixed at 64 and Clock frequencies from 2.048Mhz to 4.096MHz are supported.

Until this step, I can receive audio data from the SAI, but I didn't know how to validate if they are well received or not. As solution, I'm trying to read the audio buffer using an other SAI + the WM8960 audio codec available in the STM32L4 board. But, I'm not hearing the real sounds that I have recorded. 

In that case, I want to ask if it's right to use the WM8960 codec to read this kind of audio data?

The data size and the sampling rate used by the microphone can impact on the codec choice.