Multichannel USB Audio Interface: Extend the XK-AUDIO-316-MC-AB channel amount.

New to XMOS and XCore? Get started here.
Marf
New User
Posts: 3
Joined: Sat Nov 25, 2023 4:10 pm

Multichannel USB Audio Interface: Extend the XK-AUDIO-316-MC-AB channel amount.

Post by Marf »

Hi, I'm not very experienced in MCU programming but I started using a XK-AUDIO-316-MC-AB to evaluate the build of an audio interface. I got everything set up and working so far for the 8in and 8out channels including midi. I also managed to get it running in TDM mode as I guess I will need that if I want to address more than 8 channels. Works perfectly so far.
Now I want to extend the input channel amount to 16 channels (first step, later perhaps more channels) and I start to struggle in different ways:
- How can I implement 2 more PCM1865 ADCs to get 8 the additional channels as the PCM1865 can only have two different i2c addresses? Do I need to use an additional i2c mux (as it is also used for "talking" to the clock chips) or is there another way to implement that? As far as I understand the code, I need to configure all ADCs by i2c and this seems to be implemented for only the two fixed addresses currently. Do I have to add the MUX and code to control it myself? (which should not be a serious problem, but I ask, if I have probably missed anything here?)
- The Makefile already offers setups up to 32 in and out channels, but how do I need to alter the hardware accordingly? Is there any further documentation I missed? Is it possible to test the software with only the 2 soldered pcm1865 and altering the jumper settings? (I guess no).
- Can anyone recommend a setup for developing and testing a 16ch in version?
- Do I understand correctly, that in TDM mode all channels (even up to 32) of the (up to 8) PCM1865 are streamed sequencially via just one X_ADC_Dn (e.g. X_ADC_D0) setting the accordingly offset for each PCM? Or is that also done in parallel (8 streams per X_ADC_Dn using e.g. X_ADC_D0 for ch 1-8 and X_ADC_D1 for ch 9-16 and so on)?
I hope, I could manage it even with my quite basic knowledge.
Thanks a lot in advance for any help!


User avatar
vergil19
Member++
Posts: 21
Joined: Thu Jan 20, 2022 3:54 am

Post by vergil19 »

If you just want to obtain more channels, you can use the same I2C address for multiple PCM1865s. This way, when the MCU sends an I2C control command, they will all respond to your register configuration. Since you are using different data paths, you only need to connect them to different MCU pins in sequence (here, it's the 1-bit port of XU316), which should solve this problem.

Regarding multiple channels, such as 32 channels, you can use 4 TDM8s to form this array. So your second idea is correct.
Marf
New User
Posts: 3
Joined: Sat Nov 25, 2023 4:10 pm

Post by Marf »

Thank you very much, I thought, the i2c communication could be disturbed if more than one slave responds (I‘ve read that somewhere). But if it works, it would solve the problem as long as I won‘t need a different setup for each individual ADC as e.g. gain control.
Would it be possible to simulate the 16 channels by connecting the TDM data line to two of the MCU inputs by additional jumper setting on the test board? Then, the Software side would work with 16 channels and it would theoretically reflect the input of ADC ch1 to MCU ch 1 and 9, ADC input ch 2 on MCU ch 2 and 10 and so on? This would be great for developing the firmware before building a custom PCB with additional ADCs …
Marf
New User
Posts: 3
Joined: Sat Nov 25, 2023 4:10 pm

Post by Marf »

OK, I just tired it and it worked: Split the TDM 8 stream of the two ADCs to two MCU inputs in parallel by setting an additional jumper and alter the firmware to use 16 in channels: Works as expected. Cool. This helps me a lot.
User avatar
vergil19
Member++
Posts: 21
Joined: Thu Jan 20, 2022 3:54 am

Post by vergil19 »

Great to hear it just worked! I think if you want to control it seperately, an additional control unit like mux should be added into hardware design. So we just ignored the i2c responds here and made sure our configuration being set correctly :)