I2S implementation in 8-bit MCU

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

I2S implementation in 8-bit MCU

Jump to solution
1,304 Views
PW_CTL
Contributor III

Is there any implementation of the I2S protocol? It seems similar to SPI, but with the left/right sync signal (which would be implemented easily probably). I2S is half-duplex and SPI is full-duplex.

 

Thanks.

Labels (1)
0 Kudos
1 Solution
445 Views
rocco
Senior Contributor II

It would be rather difficult to implement I2S with the SPI, unless you intend to run it at slower than audio speeds. Although you could probably get the I2S SCLK and SDATA to behave using the SPI, you also need a synchronous LRCLK, and many codecs also need MCLK. The problem would be generating these other signals synchronized with the SPI signals. Timing for LRCLK is pretty critical.

 

Another issue would be making sure the SPI transmit continuously, as a rock-steady SCLK / MCLK is necessary for the conversions inside the codec.

 

And then there is the issue of the clock-rate. You would need to run your processor at a clock-rate that could give you a valid SCLK frequency for the audio format you select, like 1,411.2 kHz. for CD audio.

 

It could more easily be done with an external state-machine.

View solution in original post

0 Kudos
2 Replies
446 Views
rocco
Senior Contributor II

It would be rather difficult to implement I2S with the SPI, unless you intend to run it at slower than audio speeds. Although you could probably get the I2S SCLK and SDATA to behave using the SPI, you also need a synchronous LRCLK, and many codecs also need MCLK. The problem would be generating these other signals synchronized with the SPI signals. Timing for LRCLK is pretty critical.

 

Another issue would be making sure the SPI transmit continuously, as a rock-steady SCLK / MCLK is necessary for the conversions inside the codec.

 

And then there is the issue of the clock-rate. You would need to run your processor at a clock-rate that could give you a valid SCLK frequency for the audio format you select, like 1,411.2 kHz. for CD audio.

 

It could more easily be done with an external state-machine.

0 Kudos
445 Views
PW_CTL
Contributor III

Ok, It seems more difficult than I thought. Even with a codec without MCLK, and getting the LRCLK signal from the PWM module, I wonder how to keep the SPI transmiting continuisly...   

 

Probably it is a good chance to try one of the new Kinetis with I2S. 

 

Thanks for your reply.

0 Kudos