bidakung
Posts: 1
Joined: Sat Mar 16, 2013 7:38 pm

I2C Address problem

Sat Mar 16, 2013 7:49 pm

I have wired the ds1621 with raspberry pi. When i try this command

Code: Select all

i2cdetect -y 1
then address of I2C device is shown

Code: Select all

     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 4f
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
then when i try another i2cdetect command, the address was changed

Code: Select all

     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- 48 -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
i don't know why the address was randomly changed(in the range of 0x48 to 0x4f). My code is about to read temperature from a fixed address, sometime it failed to read because of i2c address was changed

User avatar
FTrevorGowen
Forum Moderator
Forum Moderator
Posts: 5623
Joined: Mon Mar 04, 2013 6:12 pm
Location: Bristol, U.K.
Contact: Website

Re: I2C Address problem

Mon Mar 18, 2013 7:09 pm

bidakung wrote: I have wired the ds1621 with raspberry pi.
...
i don't know why the address was randomly changed(in the range of 0x48 to 0x4f).
...
Random address changes on an i2c device usually occur if one or more of its A0 - A2 address pins have not been connected to 0v or Vcc (ie. logic low or high). In this state the input pin(s) is/are "floating" and its/their logic state can appear to change. If you have made connections, check for poor (dry) joints.
I don't know what the "base address" of a ds1621 should be (ie. that when A0 - A2 are tied to 0v) but, for example, the MCP23017 port expander chip has a base address of 0x20 and, in another forum post was being detected at address 0x20 ... 0x2F IIRC because its address pins were untied.
Trev.
Still running Raspbian Jessie or Stretch on some older Pi's (an A, B1, 2xB2, B+, P2B, 3xP0, P0W, 2xP3A+, P3B+, P3B, B+, and a A+) but Buster on the P4B's. See: https://www.cpmspectrepi.uk/raspberry_pi/raspiidx.htm

Return to “Interfacing (DSI, CSI, I2C, etc.)”