0
\$\begingroup\$

In the i2c protocol, I would like to know how the slave & master address are assigned. Most of the internet doc talk about how the protocol work, but i wasn't able to find doc about i2c slave & master addressing.

For instance, I want to communicate between my tm4c129 LP and a SparkFun light sensor datasheet. In the tivaware datasheet ( TI drivers), they set the master address as 0x3B.

Could I set an other legal address for that master device?

Same goes for the light sensor, the datasheet refer the device address has either 0x39 , 0x29 or 0x49? Can i change the slave address or it is build in the IC of the PCB?

\$\endgroup\$
2
\$\begingroup\$

The I2C address is set within the chip itself. There may be pins exposed to select an alternate address within a range, but there is no way to give it a completely different range short of reimplementing it from scratch.

\$\endgroup\$
  • \$\begingroup\$ And I guess, you need to pay Phillips to have an address? Also, if you have the same device multiple times and you want to connect all of them on the same i2c bus, you would need some sort of Demux to communicate with the right one? \$\endgroup\$ – MathieuL Jul 11 '15 at 14:42
  • \$\begingroup\$ You need a licence to create hardware that implements I2C, but you can take any address you like (although using a common address will gain you no favor among system designers). A I2C hub can be used to split a single I2C bus into multiple virtual buses, each with its own isolated address space. \$\endgroup\$ – Ignacio Vazquez-Abrams Jul 11 '15 at 14:49
  • 1
    \$\begingroup\$ One note, as an I2C master in a single master system, the master address is pretty much irrelevant. \$\endgroup\$ – vicatcu Jul 11 '15 at 16:02
  • 1
    \$\begingroup\$ @MathieuL - with 7 bit addressing, there are only 127 (don't use 0000000b) possible addresses. Obviously, each device cannot have a unique address. \$\endgroup\$ – DoxyLover Jul 11 '15 at 17:15
  • 1
    \$\begingroup\$ I2C address conflicts are a common problem. Recently, Linear Technology came out with LTC4316, which is an I2C address translator IC. \$\endgroup\$ – Nick Alexeev Jul 12 '15 at 4:10

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.