cancel
Showing results for 
Search instead for 
Did you mean: 

Anyone familiar with Audio codecs, specifically the audio codec( WM8994 ) on the STM32F7 discovery board?

sjpatel1992
Associate II
Posted on July 19, 2015 at 21:44

Hi All! I am having a hard time making the communication between the audio codec and the microprocessor to work.

I was able to configure the audio codec to output the audio picked up by two digital mics directly to the headphone jack through the digital sidetone path. Now, I would like to send the mic data to the micro controller to do some signal processing.

 However, I don't really know how the audio codec outputs the raw digital mic data through AIF1 interface so that I can properly configure the SIA2 to receive it. I know the data coming from the digital mics is in PDM format. 

Here is how I have configured the audio codec

AIF1 is set to operate as a slave.

Audio Protocol ----> I2S Standard

Sampling Rate ----> 48kHz

Data Size -----> 16 bits

Disabled Timeslot 0 and enabled Timeslot 1 to receive the mic data.

On the Microcontroller side, I have configured he SAI2 as follows

SAI2_BlockA -- Master TX

SAI2_BlockB -- Slave RX ( Synchronus with BlockA)

MCLK -- ~13 Mhz

BCLK --  ~3 Mhz

Total Slots -- 4

Frame Length -- 64

Data Size(bits) -- 16 

Please let me know if more details are required. Thanks

2 REPLIES 2
briancavanagh91
Associate II
Posted on October 22, 2015 at 19:07

Posted on February 19, 2016 at 01:01

The MIC PDM format is converted by the ADC chip (the WM) into a TDM signal (similar to I2S). The onboard ADC/DAC uses 4 time slots (your are right).

On the SAI configuration you have to configure to have 4 time slots but just 1 and 3 are active (I guess, the other pair is for selecting Line In).

There should be actually examples, the BSP supports it already.

The WM chip is not a ''simple'' I2S chip, it is a TDM chip. The same for the Line Out or Speaker Out. This chip has 4 time slots for in and out and you have to configure the SAIs accordingly (also 4 slots but mark which slots are active accordingly).