Pages: [1]   Go Down
Author Topic: I2C device address changed [SOLVED]  (Read 164 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 4
Keep moving forward and always learn :)
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
« Last Edit: May 06, 2014, 07:27:33 am by jokes_finder » Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 619
Posts: 33975
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Massachusetts, USA
Offline Offline
Tesla Member
***
Karma: 208
Posts: 8821
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

Offline Offline
Newbie
*
Karma: 0
Posts: 4
Keep moving forward and always learn :)
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks smiley

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.
Logged

Pages: [1]   Go Up
Jump to: