i2c device fixed address portion

westaust55

Moderator
After noting that some were not clear on how/why the i2c slave device addressing is assigned I thought I would provide this description.

This discussion is primarily limited to the 7-bit slave addressing scheme.

The most significant four bits of the slave address are the “device type identifier”. This fixed part (first 4 bits) of the i2c 7-bit device slave address is defined by the I2C bus committee and is assigned based on device type.

The bit combination %11110xx of the slave address is reserved for 10-bit addressing and %11111xx is reserved for future purposes.

Bleow are some device type identifier that I am currently aware of:

for the IO Expanders group this is %0100xxxx
be they PCF8574, MCP23016, MCP23017, etc

A known exception is the %0111xxxx for Alternate slave address such as for the PCF8574A to permit up to 16 devices on a single i2c bus.


For the Digital Potentiometer devices %0101xxxx
eg DS1803

For the memory device group this is %1010xxxx
eg 24LCxxx (EEPROM), FM24Cxxx (F-RAM), PCF8570 (RAM), etc

For clock devices use %1101000x (only one RTC device permitted per i2c bus)
eg DS1307, DS1337, DS1338, etc

The SPE03 speech module uses %1100 010x (only one SPE03 device permitted per i2c bus)

The CMPS03 compass module used%110000x (only one CMPS03 device permitted per i2c bus)


The SRF08 Ultrasonic range finder module uses %1110xxxx and $1111xxxx (a arange of addresses is setable through registers)

The Dallas DS1625 Digital Thermometer and thermostat uses %1001xxxx
 
Last edited:

hippy

Technical Support
Staff member
The general rule is "do not use %0000xxx or %1111xxx" because these are reserved or have special purposes, so PICAXE I2C Slave devices can use any number bertween $10 and $EF inclusive.

Any of those I2C device addresses can be used providing there are not two devices on the bus with the same address.

A good habit to get into is defining I2C device adresses with SYMBOL commands at the top of code and using those symbol names in the rest of the program. That makes it very easy to change the addresses when necessary.
 
Top