[OT] I2S questions

Hello :stuck_out_tongue:

I’m designing a WAV player based on the LPC23xx chip and I’ve few design questions regarding I2S interface.

The data flow is :

SD-CARD (WAV) => LPC23xx => I2S => TAS3103 DSP => I2S => DAC

I would like to use both USB and I2S module and there is a conflict for clock timing : USB requiert a 48MHz fixed whereas I2S has to handle both 48KHz-like (12, 24, 48,96KHz) and 44.1KHz-like (11.025, 22.05, 44.1KHz) frequencies (thus, a different choice of crystal)…

Using a 12MHz crystal, the CPU runs at 60MHz and USB runs at 48MHz. For WAV file recorded at 44.1KHz, 16-bit, stereo, the bitrate is : 44100 x 2 x 16 = 1,411200 MHz. The divider to apply would be 60/1.411200 = 42.5 => with a 42 divider, the error is about 1.20%, which is pretty acceptable. However, the error is more important using others samples rates (2.3% at 48Khz-like). So using ARM I2S as master is not the right solution because of USB conflict timings.

I see only two solutions :

  1. ARM I2S as slave, DAC as slave and TAS3103 as master. I don’t know if the TAS can handle all the sample rates based on a choosen crystal value (12.288MHz for instance) : no problem about 24KHz, 48KHz, 96KHz derrived from 12.288MHz clock but what about 44.1KHz which derrive theorically from 11.2896MHz for instance…

  2. ARM 2S as slave, DAC as slave, TAS as slave : an external clock as master provides either 12.288MHz or 11.2896MHz (or 24.576MHz and 22.5792MHz) and LPC generates with timer/capture inputs both LRCLK and BCLK according to the word length (16/32-bit) and sample rate of the WAV file to play. The choice of the clock depends on the sample rate of WAV file (read in the header) and is remoted by LPC itself. I think a PLL chip can be used as master clock.

note : I found a DAC TLV320DAC23 from TI that can provide all samples rates based on 12MHz crystal (USB mode compatibility). However, I don’t know if this chip generate the right MCLK on MCKO according to the selected sample rate and word format in the register settings, or if MCKO is only a divisor of crystal value = 12MHz, 6MHz… etc… I’m a little confused about that… In the first case, I can set the DAC as master, TAS as slave and ARM I2S as slave as well.

What do you think ? If you have any suggestions or tips/idea … :idea: :roll:

Thanks :stuck_out_tongue:

David