I2C Address
1101 Views - Created 19/06/2020
19/06/2020
Posted by:
Bertjan
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?
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.
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
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 f00: -- -- -- -- -- -- -- -- -- -- -- -- --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
22/06/2020
Posted by:
Bertjan
thank you for the explanation. but can you tell me where the read/write bit is in this?
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.
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.