Multiple devices on same I2C bus

How do I handle 2 devices on the same I2C bus with TinyCLR I2C drivers?

Can I just create 2 different I2CDevices with I2CController.GetDevice(I2CSettings)?

Yes, one controller, multiple devices.

I am currently doing this in a project that I am actively working on. Each device is working as expected one exception in my case and this is threading. I was accessing each device from different threads and occasionally, I encountered a CLR_TIMEOUT exception from one of these devices depending on the state of the bus. To solve, I put both devices in the same thread and it seems to go away, well at least for the moment.

So, yes. I can attest that multiple devices (different address) works on the same I2c bus.

I don’t see why there is an exception, could you please show a simple project?

Maybe check / replace your I2C slave? I used to have the issue one of the slave device is fried and constantly pulling SCL low - it would cause the timeout.

Some good readings:

I do not believe this is an issue within TinyCLR. I have a couple of Pololu Jrk motor controllers and depending on how quickly I write between these devices and/or any other devices on the bus, these seem to hold the line a bit longer causing the timeout error. My resolution is to sleep for 10ms after reading or writing to any of these motor controllers. My intent was to give some insight of what could occur on the I2c bus with multiple devices.