Go Down

Topic: I2C device address changed [SOLVED] (Read 206 times) previous topic - next topic

jokes_finder

May 06, 2014, 01:53 pm Last Edit: May 06, 2014, 02:27 pm by jokes_finder Reason: 1
Hello all,

I have a little problem here. I have purchased LSM303DHL which is a tilt compensated compass sensor. It's a module that consists of a compass and an accelerometer and communicates with the micro-controller over I2C communication protocol. The datasheet specifies that the address of the compass is 0x1E and the address of the accelerometer is 0x18 (This is also specified by the application note). I have built a sketch to fetch the compass readings only and it did work. However, trying to establish a communication with the accelerometer failed. After some debugging I came to realize that the accelerometer device address is 0x19 (I ran I2C scanner to know the connected devices). Well, I find this confusing!! can the accelerometer have different address other than the specified in the datasheet? I need some explanation for this issue if you please.

Sorry for my bad English. It's not my first language.
Thanks in advance.
Regards,
Ahmad.

Grumpy_Mike

Read the data sheet, the logic level on pin4 determins the least significant bit of the address.

johnwasser

The "Addr" input to the board will switch the accelerometer address from 0x18 (LOW or open) to 0x19 (HIGH).  Perhaps that changed somehow.

The magnetometer address defaults to 0x1E.
Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

jokes_finder

Thanks :)

After reading the answers and getting back to the datasheet, I found the post is trivial. That being said, I think, for noobs like me, the post isn't bad for future search.

Thanks again. I found your answers useful for better understanding of electronix and datasheets.

Regards,
Ahmad.

Go Up