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.

  • \$\begingroup\$ How about? gammon.com.au/forum/?id=10896#i2csummary \$\endgroup\$ Apr 14 at 19:43
  • \$\begingroup\$ Are you specifically referring to I2C or SMBUS? SMBUS is an extension to I2C. I2C does not have ARP. \$\endgroup\$
    – Justme
    Apr 14 at 23:38
  • \$\begingroup\$ What you will find amazing about I2C is that lockup is a valid state. You’ll need timeouts and retries. \$\endgroup\$
    – Kartman
    Apr 15 at 4:00
  • \$\begingroup\$ @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. \$\endgroup\$
    – dravit
    Apr 15 at 5:12
  • \$\begingroup\$ How will a protocol uniquely address a target without isolating it or a predetermined address? CDMA/RB? \$\endgroup\$ Apr 15 at 15:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.