0

I've been playing around with an arduino and a few sensors when I came across this amazing communication protocol I2C with which a master can communicate with all of the sensors (or slaves in a more general term) on the bus. So far so good. I was wondering is it safe and convenient enough to build the whole hardware around I2C given that all the devices on the I2C bus need to have a unique address?

Let's say there's a product line where multiple slaves can connect to the bus (emphasis on CAN and not MUST). How shall I/we solve the problem of assigning a unique address to each slave individually?

I found out this thread where the same problem is addressed but it lacks any working examples. More precisely, can someone add a working example where a setup involving arduino(s) is using SMBus ARP protocol to assign address to all the slaves.

EDIT: I found this thread as well but not just it lacks any working example but requires a lot deeper understanding of the circuit which did not make sense given my use case is not to get into the design of the circuit at this micro-level.

dravit
  • 141
  • 4
  • How about? http://www.gammon.com.au/forum/?id=10896#i2csummary – Tony Stewart EE75 Apr 14 '21 at 19:43
  • Are you specifically referring to I2C or SMBUS? SMBUS is an extension to I2C. I2C does not have ARP. – Justme Apr 14 '21 at 23:38
  • What you will find amazing about I2C is that lockup is a valid state. You’ll need timeouts and retries. – Kartman Apr 15 '21 at 04:00
  • @Tony the link you've shared is on I2C, where the slaves have an address. Tony Justme what I am looking for is a way to dynamically assign addresses to the slaves. While SMBus is an extension of I2C, I couldn't find a working example of it used in a situation where address assignment to slave is dynamic and not preloaded. – dravit Apr 15 '21 at 05:12
  • How will a protocol uniquely address a target without isolating it or a predetermined address? CDMA/RB? – Tony Stewart EE75 Apr 15 '21 at 15:30
  • @Tony check this out https://electronics.stackexchange.com/questions/85646/i2c-automatic-address-assignment – dravit Apr 15 '21 at 17:01
  • Contention detection/multiple access with a Random Back off algorithm and host reversal . Nice – Tony Stewart EE75 Apr 15 '21 at 17:50

0 Answers0