cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F4-Discovery's Microphone

dfranch6
Associate
Posted on November 04, 2012 at 20:08

Hi,

I want to do a very simple project using FreeRTOS alongside with STM32F4-Discovery. I want to create a task to read from a microphone, another one will filter the mic's data and a final task would output the filtered data to the headphone output.

I decided to start by the input side and, for so, I took a look at the audio playback and record demo that came with the kit.

But it is actually confusing me more than helping.

I wanted to simply get the data from the mic and store it in a buffer. But it seems that I must use the SPI interruption. I wanted to make it simpler than that.

Also, I tried copying waverecorder's functions to my project but I am having a really hard time with the pdm filter. 

The linker always complains that it can't find the functions defined in pdm_filter.h, even though I have added pdm_filter.h and libPDM_filter_IAR.a to my project.

I have looked on the internet and on forums for help, but I couldn't get much of it. Also, the documentation is not clear enough on this aspects.

Thanks in advance

 

#stm32f4-discovery-microphone
2 REPLIES 2
Posted on November 05, 2012 at 09:21

''I want to do a very simple project using FreeRTOS...''

 

 

Not quit sure what you mean by that - do you want to do a very simple project, or do you want to use FreeRTOS?

''I wanted to simply get the data from the mic and store it in a buffer. But it seems that I must use the SPI interruption. I wanted to make it simpler than that.''

Using the SPI interrupt is pretty fundamental - so it looks like this is where you need to focus your initial efforts...

M0NKA
Senior
Posted on November 05, 2012 at 10:43

Hi,

The thing you want to implement i think is called block processing. In my short(few weeks)

experience with the STM32F4 i think it is fast enough to do lots of processing real time

in the interrupt code. You need to use off course hardware FPU and the provided FIR filters

from the DSP library. My discovery board handles with ease 2 x 63 tap FIRs for both audio channels + sqrtf() in software. Maybe you have really complex processing, in this case you need block processing, but this will not be exactly real time.

BR