We often get inquiries from our customers about what slave address to use in order to communicate with their I2C slave device. A lot of this confusion stems from the fact that different vendors follow different slave address conventions.
In this post we will clarify the slave address standard used by all Total Phase products and to help developers determine what slave address they should use.
The I2C specification from NXP (formerly Philips) actually specifies two different slave addressing schemes. Standard Mode I2C makes use of 7-bit addressing. 10-bit addressing was later added as an extension to standard mode I2C.
In 7-bit addressing procedure, the slave address is transferred in the first byte after the Start condition. The first seven bits of the byte comprise the slave address. The eighth bit is the read/write flag where 0 indicates a write and 1 indicates a read.
All I2C products from Total Phase, follow this standard convention. The slave address used should only be the top seven bits. In the case of the Aardvark I2C/SPI Host Adapter, the software will automatically append the correct read/write bit depending on the transaction to be performed. In the case of the Beagle I2C/SPI Protocol Analyzer, the slave address and the type of transaction are displayed in two different columns.
The I2C specification has reserved two sets of eight addresses, 1111XXX and 0000XXX. These addresses are used for special purposes. The following table has been taken from the I2C Specifications (2000).
Slave Address | R/W Bit | Description |
000 0000 | 0 | General call address |
000 0000 | 1 | START byte(1) |
000 0001 | X | CBUS address(2) |
000 0010 | X | Reserved for different bus format (3) |
000 0011 | X | Reserved for future purposes |
000 01XX | X | Hs-mode master code |
111 10XX | X | 10-bit slave addressing |
111 11XX | X | Reserved for future purposes |
Some vendors incorrectly provide 8-bit addresses which include the read/write bit. Often, you can determine if this is the case because they will provide one address for writing to the slave device and another to reading from the slave. In this situations, use the top seven bits of the address only.
Another way to determine if a vendor is using 8-bit addresses instead of 7-bit addresses is to see if the slave address falls within the correct range. All 7-bit addresses should be greater than 0x07 and less than 0x78 (120). If your slave address is outside this range, chances are your vendor has specified an 8-bit address.
One of the reasons that Total Phase decided to use 7-bit addressing for all of its products was to ensure that 10-bit addressing could be properly handled.
10-bit addressing was designed to be compatible with 7-bit addressing, allowing developers to mix two types of devices on a single bus. When communicating with a 10-bit addressed device, the special reserved address is used to indicate that 10-bit addressing is being used.
If a 10-bit address is specified when using the Aardvark I2C/SPI Host Adapter, its software will take care of sending the correct bits. The developer does not need to perform any special steps to send the correct address data. The Beagle I2C/SPI Protocol Analyzer will also automatically detect 10-bit slave addresses in the captured data and display the information correctly.
See also how to trigger on slave address.