USB to DSP using i2s on xcore-200 MC Topic is solved

Technical discussions related to any XMOS development kit or reference design. Eg XK-1A, sliceKIT, etc.
alexjaw
Active Member
Posts: 35
Joined: Wed Jan 24, 2018 9:13 am

USB to DSP using i2s on xcore-200 MC

Post by alexjaw »

I wonder if it's possible to connect an external codec to the xcore-200 mc dev board (https://www.xmos.com/support/boards?product=18334) using i2s with the codec as i2s master? In my case the external codec is a custom audio-board equipped with DSP, DAC and ADC. The audio-board has been successfully used for bi-directional i2s with Raspberry Pi, audio-board as i2s master.

The present application is to use xmos to handle usb audio (and dsd over usb) and to pass the audio data to the audio-board for processing. I have tried the following:
Compiled and downloaded the pre-defined configuration - app_usb_aud_xk_216_mc_2i10o10xxxxxx_slave.xe. Have connected the xcore pins SCLK, LRCLK and xDAC_SD1 to the corresponding pins on the audio-board. With i2s enabled on the audio-board, SCLK=6.1MHz and LRCLK=96kHz. Evidently, I have missed something since the xcore also outputs clock signals on startup, xcore SCLK=12.3MHz , LRCLK=192kHz. I thought that _slave at the end of the app, app_usb_aud_xk_216_mc_2i10o10xxxxxx_slave.xe, meant that the application is expecting external clock signals on SCLK and LRCLK.

Anyone that have experience of connecting xcore-200 mc and external codec, where the codec is the master?
View Solution
User avatar
infiniteimprobability
Verified
XCore Legend
Posts: 1140
Joined: Thu May 27, 2010 10:08 am

Post by infiniteimprobability »

You can do it.. howver _slave means xcore is slave. It actually sets CODEC_MASTER=1 so yes you will still see clocks because the DAC generates them.

What you need to do is undefine CODEC_MASTER and redefine to 0 in audiohw.xc and that should mean both the DAC/ADC and xcore on board are all slave (or just comment out the release reset line and I2C setup so the DAC/ADC disappear altogether).

There is a caveat - unless you make a HW mod (to feed in external MCLK to the MC board), you will need to use the MCLK generated on board the MC board to supply your other audio subsystem. It's nominally 24.576MHz/22.5792MHz so fairly standard.

There may be other ways to do this but I used the above configuration just this week and it worked fine.
Engineer at XMOS
alexjaw
Active Member
Posts: 35
Joined: Wed Jan 24, 2018 9:13 am

Post by alexjaw »

"There is a caveat - unless you make a HW mod"

If I keep the clock on my board, can I connect my clock to the MCLK pin on the xcore-200 mc board or do I need to do something more in HW or SW?

...and thank's for your response!
User avatar
infiniteimprobability
Verified
XCore Legend
Posts: 1140
Joined: Thu May 27, 2010 10:08 am

Post by infiniteimprobability »

Take a look at the schematic - https://www.xmos.com/support/boards?product=18334

You'll see that test point is driven from the clock mux. So lowest intrusiveness would be to get an ext clock in at R77 I think..
Engineer at XMOS