cancel
Showing results for 
Search instead for 
Did you mean: 

connect STR9 to audio codec

hoangminhson1985
Associate II
Posted on May 06, 2008 at 15:03

connect STR9 to audio codec

4 REPLIES 4
hoangminhson1985
Associate II
Posted on May 17, 2011 at 09:52

I want to connect STR9 to audio codec.how should i do ? STR9 have no I2S.

kais
Associate II
Posted on May 17, 2011 at 09:52

Hi,

We are already published an Application note showing how to connect I2S audio devices to the STR7/STR9 MCU.

Please refer to this link:

http://www.st.com/stonline/products/literature/an/14254.pdf

Regards,

Eris.

[ This message was edited by: eris on 26-04-2008 10:31 ]

hoangminhson1985
Associate II
Posted on May 17, 2011 at 09:52

Thank eris.

I wonder what bus interface should i use ? I2S,SPI or I2C.Help me to understand about bus interface and audio format interface.I2S audio format must follow I2S bus interface ? Because one audio codec has some type of bus interface (SPI,I2S,I2C),audio format interface (I2S,SPI,LSB,..)

martindavey9
Associate II
Posted on May 17, 2011 at 09:52

Hi,

Just an extra point on I2S...

I have done a few MP3 applications using this chip. Currently working on ogg-vorbis, but need to use RTOS and DSP libs to get speed up...

Anyway, I have managed to get the STR9 SPI to work as I2S using a Timer to generate L/R clock, and this enables you to output audio data using the DMA. I have tried this method on a BU9480F DAC and it works OK.

Basically:

Connect the output of the SPI clock to an external timer input, and set this timer to PWM mode using external input as clock.

Set the timer compare register to 16, so that when 16 clock pulses are received, the output of the PWM transitions (L>R).

Set the period to 32, so that the PWM output goes low again after 32 clock pulses (R>L).

Hence, the PWM output is your L/R clock.

It's simple and dirty, and I have some code if you want to try...

The only downside is if you have noise on your board, and the SPI/Timer lose sync there is no way to tell. So make sure your PCB is good.

BR's,

Martin.