3 ms·
How is the allocation of addresses done typically? Are they always hardcoded? Is the same chip then available with different addresses (different SKU)?
by fh973 6y ago
How is the allocation of addresses done typically? Are they always hardcoded? Is the same chip then available with different addresses (different SKU)?
- aulin 6y agomost common practice I've seen at least with typical arduino/rpi sensors is fixed address for the same chip, sometimes you can change one or two bits so you can have two/four of the same kind in the same bus, sometimes you have address conflicts with similar devices from the same manufacturer (e.g. bosch bme680, bme280 and bmp180).
- pantalaimon 6y agoTypically addresses are only 7 bit (10 bit are possible but not all devices support that). So you either have way to set the address using resistors / address lines or you have some config more where you set the configuration for the sensors one by one (Cypress touch sensors had this)
- magicalhippo 6y ago> Is the same chip then available with different addresses This is sometimes done, though more commonly in my experience is there are some input pins which the chip uses to determine the actual address. This might be as simple as one to three inputs which should be connected to ground or supply voltage to encode the last bits of the address. Other chips are a bit more creative, and allows you to, in addition to ground and supply, tie the address pins to the I2C clock and data pins. This allows it to generate four combinations from per address pin.
- moftz 6y agoPeople have already touched on setting the addresses using the pins but sometimes you can just buy near identical I2C parts that have slightly different part numbers because the range of user-selectable addresses is different.
- xondono 6y agoFor I2C addresses are hardcoded, with some chips leaving some bits to be set by hardware configuration. Far more interesting in that regard is the SMBus, that is compatible in most cases with I2C but can handle things like address resolution.