About Us Knowledge Base Community Forum Electronics Toolbox FAQ Shipping & Delivery

Community Forum

Share your projects and post your questions

Search
Register or Sign In
Forum

I2C Address

118 Views - Created 25 days ago

25 days ago

Posted by:
Bertjan

Users Avatar

when i look at the datasheet of the MCP3424, i see that the address is 1101 A2 A1 A0 R/nW. So for reading at adr0=0 and adr1=0 it will be 1101 0001 = 0xD1. But in all the examples there is 0x68. What am i missing?

25 days ago

Posted by:
andrew

Users Avatar

Location:
United Kingdom

Users Twitter  Users Website  

I2C addresses are normally shown as a 7-bit number with the end read/write bit omitted. 

In the case of the MCP3424 the address 1101 A2 A1 A0 would be 0b1101000 or 0x68 when A0, A1 and A2 are connected to ground.

Most I2C libraries and programs like i2cdetect will use the 7-bit number so for example with the command "sudo i2cdetect -y 1" using the ADC Pi you get the following response.

     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- 68 69 -- -- -- -- -- --
70: -- -- -- -- -- -- -- --

We have a tutorial in our knowledge base that explains how i2c addresses work, you can find it at https://www.abelectronics.co.uk/kb/article/1090/i2c-part-1---introducing-i2c

AB Electronics UK Tech Support

22 days ago

Posted by:
Bertjan

Users Avatar

thank you for the explanation. but can you tell me where the read/write bit is in this?

22 days ago

Posted by:
andrew

Users Avatar

Location:
United Kingdom

Users Twitter  Users Website  

The read/write bit comes at the end of the 7-bit address to make an 8-bit byte.  With the read/write bit included the address 0x68 would read as 0xD0 or 0xD1 in a logic analyser.

AB Electronics UK Tech Support

Note: documents in Portable Document Format (PDF) require Adobe Acrobat Reader 5.0 or higher to view, download Adobe Acrobat Reader or other PDF reading software for your computer or mobile device.