2015-07-19 12:44 PM
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 codecAIF1 is set to operate as a slave.Audio Protocol ----> I2S StandardSampling Rate ----> 48kHzData Size -----> 16 bitsDisabled Timeslot 0 and enabled Timeslot 1 to receive the mic data.On the Microcontroller side, I have configured he SAI2 as followsSAI2_BlockA -- Master TXSAI2_BlockB -- Slave RX ( Synchronus with BlockA)MCLK -- ~13 MhzBCLK -- ~3 MhzTotal Slots -- 4Frame Length -- 64Data Size(bits) -- 16 Please let me know if more details are required. Thanks2015-10-22 10:07 AM
2016-02-18 04:01 PM
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).