Recognising connection ports in a USB network

Hi, I was working on my project using serial communication, but I was suggested to switch to I2C, so while I try to make my first attempts with this kind of communication, I would like to know if it will be worth.

I have an Arduino master which communicate with the computer, this Arduino is supposed to be connected with other 4 Arduino slave trough a numbered system of 4 custom ports. there will be port 1, 2, 3 and 4 and each of the 4 Arduino can be connected to only one of these.

In the following text "port" refers to any combination of pins which allow one component to connect to the (in this case I2C) network, forgive me if there is a better term.

Now my problem is the following: how do I understand which Arduino has been connected to a specific port when using I2C? When I was using a serial communication I simply use the 4 couples of Tx and Rx from my Arduino Mega, should I implement 4 BUS communications so the master can recognise from which port the data is coming? Or should I include in the pins for the connection with the BUS something which make the slave Arduino aware of its position?

You will find a picture attached which will help to better understand my problem, thanks!

Why not have each slave identify itself as part of your protocol. The other way is to enumerate the ports.

The thing is that each Arduino only know "who" he is, but not on which port it is connected, so identifying itself I think would be necessary but not be enough, while enumerating the ports, seems a appealing option, but I am not sure I understood what it is about..
How can I give an identity to the port, a bunch of anonymous wires that can not be programmed? Thanks for the answer!

PS. I have no Idea how to upvote you, give me a moment to understand the new UI xD

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