I2S and I2C over multibit ports Topic is solved

Technical discussions around xCORE processors (e.g. xcore-200 & xcore.ai).
maxter
Member
Posts: 14
Joined: Fri Jun 14, 2024 9:55 am

I2S and I2C over multibit ports

Post by maxter »

I am new to the XMOS world and I started working on a USB audio project based on the XU316 XCORE.AI platform which will have 8 analogue audio inputs (i.e. 4 I2S channels) and 2 master I2C domains.
I was wondering if would it be possible to use a multibit port instead of individual pins for the I2S and I2C channels.
  • For I2C I see there is a i2c_master_single_port module, but it's comment says
    This function implements an I2C master bus using a single port. It is only supported on xCORE-200 devices.
  • For I2S I see in the library there is i2s_frame_master_4b module, but in lib_xua it seems to use only individual pins for the I2S ports, am I missing something?
View Solution
Joe
Verified
Experienced Member
Posts: 66
Joined: Sun Dec 13, 2009 1:12 am

Post by Joe »

Hi,

Yes there is support for both I2S and I2C on multi bit ports.

"This function implements an I2C master bus using a single port. It is only supported on xCORE-200 devices." This will have been written when xcore-200 was the newest device. It should now be taken to mean xcore-200 or newer devices. Do you have a link to where that comment is? I can raise an issue to get it updated.

We don't have any xmos boards that use i2s on a multi-bit port to my knowledge which is why the support isn't in lib_xua. The reason for that is we typically use 1-bit ports as they are more flexible and can support things like TDM protocols which aren't supported on a multi bit port.

For your application if you are short of pins you could also consider using TDM mode (which allows 8 channels per data pin) as this is natively supported by the sw_usb_audio firmware. You can use the multi bit port version of lib_i2s but it might involve more integration time etc.

Cheers,
Joe
XMOS hardware grey beard.
maxter
Member
Posts: 14
Joined: Fri Jun 14, 2024 9:55 am

Post by maxter »

Hi Joe,
many thanks for your quick reply :)
Joe wrote: Thu Jun 27, 2024 12:36 pm Hi,

Yes there is support for both I2S and I2C on multi bit ports.

"This function implements an I2C master bus using a single port. It is only supported on xCORE-200 devices." This will have been written when xcore-200 was the newest device. It should now be taken to mean xcore-200 or newer devices. Do you have a link to where that comment is? I can raise an issue to get it updated.
It's in https://github.com/xmos/lib_i2c/blob/de ... /api/i2c.h, lines 410, 411.

Am I right assuming that having in my design 2 I2C domains, i.e. 2 independent sets of devices each on an I2C bus, I'll need to instantiate 2 i2c_masters or 2 i2c_master_single_port interfaces, one for each domain?
Is there any known restriction on such a design? can both reside on the same tile?
Joe wrote: Thu Jun 27, 2024 12:36 pm We don't have any xmos boards that use i2s on a multi-bit port to my knowledge which is why the support isn't in lib_xua. The reason for that is we typically use 1-bit ports as they are more flexible and can support things like TDM protocols which aren't supported on a multi bit port.

For your application if you are short of pins you could also consider using TDM mode (which allows 8 channels per data pin) as this is natively supported by the sw_usb_audio firmware. You can use the multi bit port version of lib_i2s but it might involve more integration time etc.

Cheers,
Joe
Thanks for the clarification; this was more a curiosity than a real need: we have been able to fit all our I2S channels on pins, so we'll happily use the current lib_xua :)
Joe
Verified
Experienced Member
Posts: 66
Joined: Sun Dec 13, 2009 1:12 am

Post by Joe »

Thanks for the link.

Yes you'd need two i2c_master instances. There are no restrictions that I'm aware of assuming you have sufficient resources. They can be on the same tile or different tiles.

Incidentally if it's of interest we have two separate I2C domains on the xcore.ai MC audio board due to an address conflict. We used an I2C switch on the board to connect to one or the other I2C buses. This might work for you depending on your requirements.
XMOS hardware grey beard.
maxter
Member
Posts: 14
Joined: Fri Jun 14, 2024 9:55 am

Post by maxter »

Joe wrote: Thu Jun 27, 2024 2:41 pm Thanks for the link.

Yes you'd need two i2c_master instances. There are no restrictions that I'm aware of assuming you have sufficient resources. They can be on the same tile or different tiles.
Thanks :)
Joe wrote: Thu Jun 27, 2024 2:41 pm Incidentally if it's of interest we have two separate I2C domains on the xcore.ai MC audio board due to an address conflict. We used an I2C switch on the board to connect to one or the other I2C buses. This might work for you depending on your requirements.
Yeah, I saw that, but since we have enough free pins/ports available it was decided to go for 2 independent I2C domains (instead of using a I2C switch).