TDM16 for a DJ reference design

Technical questions regarding the XTC tools and programming with XMOS.
genap
Experienced Member
Posts: 99
Joined: Sat Aug 31, 2013 11:23 pm

TDM16 for a DJ reference design

Post by genap »

Hello,

I have a project where I need to use 16 input and 4 output audio on a XS1-U8A.
To save IO pins I want to use TDM16 for both input and output.

I am having problems with configuring the project for TDM16.
I am using reference design sw_usb_audio_6.12.6 with target xp_skc_su1.xn

I haven't worked with audio yet, just trying to test output LRCLK and BCLK for TDM in master mode.

I've added definition

Code: Select all

  #define I2S_MODE_TDM    1
to the customdefines.h file.

When I configure the project for TDM8 (8 adc, 8 dac), everything is fine.
It builds ok and I see correct output sync signals.

But when I am trying to configure for TDM16, it gives me errors

Code: Select all

   .../main.xc:55:17: error: use of undeclared identifer `PORT_I2S_DAC1' 
   .../main.xc:55:17: error: use of undeclared identifer `PORT_I2S_ADC1' 
I've found the reason - it thinks that there are 2 ADC and 2 DAC wires.
When I checked, I've found the following definition in devicedefines.h:

Code: Select all

    #ifdef I2S_MODE_TDM
        #define I2S_CHANS_PER_FRAME 8
Based on this amount of wires is calculated.

So I2S_CHANS_PER_FRAME is fixed at 8.
I know that I am not supposed to edit devicedefines.h, but I tried to set amount of channels to 16.
In this case it builds ok, but output BCLK is at 12.288 MHz instead of 24.576 MHz,
and LRCLK is 24 KHz instead of 48.

Please advice me on possible resolution of this problem.

Thank you,
Gennady


User avatar
Ross
XCore Expert
Posts: 966
Joined: Thu Dec 10, 2009 9:20 pm
Location: Bristol, UK

Post by Ross »

Hi,

I2S_CHANNELS_PER_FRAME set to anything but 8 isn't really supported.

It should be reasonably simple to get it up and running though - what are you interfacing to?
genap
Experienced Member
Posts: 99
Joined: Sat Aug 31, 2013 11:23 pm

Post by genap »

Hi Ross,

I have 2 XS1-U8As in a project.
Both are interfaced to DSP. It would be easier for me to use DSP as a master,
but as far as I understand, running XMOS as a slave will be more complicated.
So I am going to use DSP as a slave, and both XMOS ICs in master mode.
IC1:
I need 14 ADC inputs and 4 DAC outputs.
In order to save IO pins I want to use one pair of LRCLK / BCLK signals,
so I would like to run audio as TDM16 (USB - 16 IN / 16 OUT) and just disregard
unused channels on a PC side.
IC2:
6 ADC inputs. So I need TDM8 audio (USB - 8 IN).

Will appreciate any input on this subject.

Thank you,
Gennady