cancel
Showing results for 
Search instead for 
Did you mean: 

Need help on I2S mono audio capture

bola
Associate II
Posted on March 21, 2013 at 19:44

I have an application where I have a digital mic/codec (maxim codec chip) combination transmitting PCM 16-bit samples over I2S to an STM32F217. I am trying to use DMA to capture this audio stream, however I only wish to capture one single channel on I2S. I am using mono mode. 

I am using 16bit data mode, 8KHz sample rate..

STM32 I2S configured for PCM mode.

Is there a way to configure the I2S DMA mono capture instead of stereo capture?

Is that I need to configure I2S interface for receiving only one channel data (Right channel or left channel), ignoring other channel?

#stm32-i2s-codec-audio-capture #stm32-i2s-codec-audio-capture
3 REPLIES 3
Posted on March 21, 2013 at 22:04

If it's in PCM mode it should just grab a stream of data, if you are clocking 32-bits across the interface, you're going to receive 32-bits, and you'll need to step over the data you don't want. If you just have 16-bits, you'll get that.

What do you have it capturing now? Review that.
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
bola
Associate II
Posted on March 22, 2013 at 20:18

Thanks for the reply.

I am using a codec chip which connected to MIC. I am using only right MIC and there is no MIC at left channel.

As per Codec chip, it sends 32 bits of data, where <0 - 15> bits will be left channel data, <16-31> bits will be containing right channel data.

With STM32 MCU, I need to ignore first 16 bits, which is noise of left channel, and should capture only <16-31> bits, which is the valid  data.

I am using I2S DMA for capturing data.

How to configure I2S for above mentioned scenario? 

Posted on March 22, 2013 at 21:04

I'm not invested in your development, and I don't see a spec cited for the codec or mic devices.

Worst case, you'll need to configure it in a 32-bit PCM mode, and then discard every other 16-bit word in software. I'm not sure the STM32 hardware is capable of decimating the unused channel for you, if it were my problem I'd experiment.
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..