How to Use 2 I2C ports simultaneously for Arduino Due or Arduino UNO R4

Hello,

I want to use 2 I2C lines and 1 SPI simultaneously for my requirement. I found Arduino DUE and Arduino UNO R4 has 2 I2C lines and 1 SPI.

I am new to Arduino. Would like to know if Arduino DUE and Arduino UNO R4 supports 2 I2C lines and SPI communication at same time. If not, please let me know which Arduino variant can support this requirement.

Hello,

Take a look at: https://www.infineon.com/dgdl/Infineon-Component_I2C_V3.0-Software%20Module%20Datasheets-v03_05-EN.pdf?fileId=8ac78c8c7d0d8da4017d0e952b3f1fbe

Specially:

Both I2C and SPI are a bus. You can connect multiple devices to the same bus.

For I2C, the device that you talk to is determined by the address of the device.
For SPI, the device that you talk to is determined by the chip select of that device.

1 Like

Do you really need a two I2c buses or just look for possibility to connect a several i2c devices?

My I2C master is different controller. I have requirement to connect 2 devices externally which communicates to master over I2C. Since I want Arduino to simulate these devices, can I use single Arduino as slave - differentiate based on address from master - and perform action in Arduino or I need to have 2 separate Arduino device

  1. Since Arduino DUE and Arduino UNO R4 supports 2 ports, can I use 1 Arduino device and use both I2C ports simultaneously as 2 external devices.
  2. If I have requirement to use 2both the I2C ports from Arduino, is it possible? Does Arduino library supports this?

My requirement is to use both the I2C ports from Arduino Due or R4 at same time. Does the Arduino library supports this?

Could you explain more? Why do you need this? Is it a school/university assignment?

It is for my POC.

I would like to know if I can use both I2C ports from Due or R4 as 2 slave devices simultaneously.
I read in one of the post default I2C can be used. For second I2C some pull register to be connected. So I am worried if Due or R4 supports my requirement using both the ports together. Whether Arduino library (Wire1 & wire2) APIs can be used same time?

It is not a matter of library or Arduino itself - it depends on how this library written on defined MCU. I don't know about Due or R4, but on STM32 you can use i2c1 and i2c2 simultaneously.

You ask if you can use the two I2C interfaces at the same time as a Slave.
I have a question for you: Can those boards be a reliable I2C Slave for even a single I2C bus ?

The Master might not support clock pulse stretching. That is needed when a processor acts as a I2C Slave.

In theory, it could work. But I'm afraid that there are too many problems and that it will not work.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.