I2C SPI USB CAN eSPI Cable Testing View All Videos Quick Start Guides Software Downloads App Notes White Papers User Manuals Knowledge Base Sales Support About Us
Products Blog Sales Support Contact Search
How to Identify the I2C Slave Addressing Standard for Developers
Staff Writer

It is common for embedded device developers and engineers to have questions about what slave address is needed to communicate with a given I2C (Inter-Integrated Circuit) device. There is no one-size-fits-all answer to this question. Some I2C slave devices use 7-bit addressing, some use 8-bit addressing, some use 10-bit addressing, and there are also reserved addresses.

In this piece, we will explain what I2C slave addressing is, why it is important for developers, how to identify different I2C slave addressing formats, and provide some information on where you can learn more or find tools related to I2C development and debugging. We’ll also provide some pro-tips for working with Total Phase devices and I2C addresses throughout this article.

What is I2C Slave Addressing?

I2C slave addressing is an important part of enabling communication between I2C master device(s) and slave device(s). The process for an I2C master device to read from an I2C slave device or write to an I2C slave device begins with the I2C master sending a START condition followed by the I2C address of the target slave. I2C slave addressing is a specific data format by which I2C slave devices can be uniquely identified to enable them for data transmission.

What does I2C Slave Address mean for developers?

At this point, you may be asking “what kind of impact does I2C slave address have for developers?”, and that is a very valid question. The answer is simple: in order to properly interface with an I2C slave device, you need to know the I2C address scheme. If you do not know the correct I2C address, you’re going to have difficulty getting an I2C master and I2C slave device to communicate and your I2C development and I2C debugging efforts can hit a roadblock fast.

Why the confusion about I2C Slave Addressing?

The root cause of much of the confusion surrounding I2C slave addressing is the use of 7-bit, 8-bit, and 10-bit addresses. The I2C specification published by NXP Semiconductors only calls for two I2C address types for Standard Mode I2C: 7-bit and 10-bit. 7-bit was used first and 10-bit was added as an extension. 8-bit I2C address schemes also exist because some vendors include the read/write bit. Additionally, there are a select number of reserved addresses used for specific purposes.

All this comes together to create a market where knowing the right address byte for an I2C slave device isn’t always easy or intuitive. In the section below, we’ll help you identify and understand each of the different I2C address types. For a deeper dive on the I2C specification, check out the I2C-bus Specification and User Manual from NXP.

What are the different types of I2C Slave addressing?

As mentioned above, there are 7-bit, 8-bit, and 10-bit I2C address types as well as a set of I2C address blocks that are reserved. Here are examples and tips for identifying and working with each type.

7-bit I2C Slave Address

A 7-bit I2C address includes a 7-bit slave address in the first 7 bits of a byte. The eighth bit (the bit in the Least Significant Bit position) is the read/write flag. A 0 in the eighth bit indicates a write and a 1 in the eighth bit signifies a read. See the image below for an example:

Pro-tip: Consistent with the I2C address specification, all Total Phase I2C products follow the standard 7-bit I2C address format for I2C slave devices. When using the Aardvark I2C/SPI Host Adapter, the associated software can automatically correct the read/write bit based on the type of transaction that is being carried out. With the Beagle I2C/SPI Protocol Analyzer, the slave address and read/write transaction type are listed in two discrete columns.

8-bit I2C Slave Address

As mentioned, 8-bit addresses are not in the official I2C specification. Instead of including the entire address and read/write a bit in one address byte, they use 8-bits for the I2C address of the slave device and 1 bit for the read/write flag. You can see an example of this in the image below:

Pro-tip: When using Total Phase products, only use the first 7 bits as the slave address.

A simple means of checking if a specific I2C slave device is using an 8-bit address is to check the range of the address. A 7-bit address should always fall between 0x07 (7) and 0x78 (120). Generally, if your address is outside of this range, the vendor of the I2C slave device has likely assigned an 8-bit I2C address.

10-bit I2C Slave Address

10-bit I2C addresses are compliant with the Standard Mode I2C specification and are compatible with 7-bit I2C address types. What this means is I2C slave devices with 7-bit and 10-bit I2C address types can be mixed on the same communication bus. 10-bit I2C address types can be identified by the special reserved address (more on reserved I2C addresses in the next section) that identifies it as a 10-bit address. A 10-bit I2C address for a slave device will always start with an 111 10XX indicator, making them easy to identify. The image below provides an example of this I2C address formatting:

It is important to note that the eighth bit of the 10-bit address remains as the read/write flag.

It is this formatting that enables 10-bit addresses to retain compatibility with 7-bit I2C addresses. The compatibility between 7-bit and 10-bit addresses was one of the driving factors in our decision to use 7-bit addressing for all of our I2C products. Using 7-bit addressing helps ensure 10-bit addresses are handled correctly as well.

Pro-tip: If an Aardvark I2C/SPI Host Adapter is used and a 10-bit address is specified, the software can automatically confirm the correct bits are sent without any special configuration from the user. The Beagle I2C/SPI Protocol Analyzer is also similarly capable of automatically detecting and displaying information from 10-bit slave address I2C devices correctly.

Reserved addresses

As mentioned above, the I2C spec calls out a set of reserved addresses that are used for specific purposes. The table below from the I2C-bus Specification and User Manual from NXP explain each of these reserved addresses that must not be used for any other purposes:

Summary

While the different types of I2C address formats can be confusing at first, understanding and identifying them is not difficult once you understand the formats. 7-bit addresses use the first 7-bits as the I2C slave address and the eighth bit as a read/write flag. 10-bit addresses use the first 7-bits for a special address indicator and also use the eighth bit for the read/write flag before sending the rest of the address in the next byte. 7-bit and 10-bit devices can be used on the same communications bus. 8-bit addresses use all 8-bits of a single byte for the slave address and then send the read/write flag in a subsequent byte. When using 8-bit I2C slave devices with Total Phase products, it is important to remember to only use the first 7-bits of the I2C address.

Looking for products to help with I2C development and debugging? Contact the experts!

Now that you are familiar with I2C slave address, you may be ready to dive into I2C development or debugging. Here at Total Phase, we offer a variety of products to help enable you to be efficient and effective in your efforts. For example, theBeagle I2C/SPI Protocol Analyzer is useful for engineers in lab environments or in the field and supports the SPI (Serial Peripheral Interface) and MDIO (Management Data Input/Output) protocols in addition to I2C. Alternatively, the Aardvark I2C/SPI Host Adapter is a fast and powerful adapter that connects via USB and is compatible with Windows, Mac OS X, and Linux.  To help you compare and select the right product for your projects, check out our I2C/SPI Product Guideor if you need expert assistance to select the right tools, contact us today!