cancel
Showing results for 
Search instead for 
Did you mean: 

Please help using LSM330D

suriko
Associate
Posted on May 03, 2013 at 06:25

I am trying to get a gyroscope raw data using I2C. DEN_G is connected to MCU's GPIO and I set the register to use level trigger mode. I think I2C slave address is correct because when I read WHO_AM_I_G register I get 212 which is the same as default data in the datasheet. I do get a correct accel data but when I read the gyro data the data doesn't change when I move the chip. The gyro data is just a random variant number.

So I checked CTRL setting register from register address 0x20 to 0x2D(Using multi byte read). All the CTRL registers had a same data as I set them. But I found out that when I disable the Y,Z-axis data(only enabling X) the OUT_Y_L,H OUT_Z_L,H still has a data. I think I am not reading the incorrect OUT X,Y,Z register because I used multi byte read method from 0x20 to 0x2D.(0x28~0x2D are OUT_X,Y,Z address).

So can anyone give me an advice why setting CTRL register doesn't work? Is it a hardware problem? or do I have to clear some bits to get a gyro data after I read accel data?

Thank you

1 REPLY 1
chris
Associate
Posted on May 06, 2013 at 03:39

Hi,

I had a similar problem. You may have missed the 3rd paragraph in section 6.1.1 of the datasheet, which basically states that you need to set the most significant bit of the register address you want to start reading from for a multibyte read. The MSB enables autoincrement of the register address, without this a multibyte read just reads the same address repeatedly.

Hope thats of some help.