cancel
Showing results for 
Search instead for 
Did you mean: 

How can I read acceleration data from LSM330?

orhun erol
Associate II
Posted on May 12, 2017 at 17:04

Hi;

I have stm32f103c8t6 mcu and LSM330 6DOF imu sensor. I try to read from LSM330TR imu sensor. I have a problem.

When I read gyro datas from imu, everything is OK. I can read them, but when I tried to read acc datas from imu, I can't read them. I think problem is in sensor or there is something out of sight.Could you help me solve this problem?What could the cause of the problem?

Note: this post was migrated and contained many threaded conversations, some content may be missing.
12 REPLIES 12
S.Ma
Principal
Posted on May 12, 2017 at 18:23

Using I2C or SPI 3 or 4 wire mode?

In the datasheet, each function has different I2C slave address:

0690X00000606zYQAQ.png

If using I2C, check if you can read each function WHO_AM_I register usually located around @0x0F

Posted on May 15, 2017 at 09:47

I'm using I2C intarface. In the circuit, SDO_A pin connect to VDD. So I use the 0x1D as address. When I read WHO_AM_I register, there is nothing changed. Again, I can't read anything. I wrote BW, Scale, ODR, axis and BDU for register settings.

What is the probability that I am missing something in the register settings?  

Posted on May 15, 2017 at 18:01

Usually the only typical possible pitfall is that the sub address bit 7 should be set to 1 to use autoincrement and then read more than a single byte. If the WHO_AM_I reading is not working, then don't know.

orhun erol
Associate II
Posted on May 16, 2017 at 10:58

Does anyone know how to solve this problem? Or someone who can help?

Miroslav BATEK
ST Employee
Posted on May 17, 2017 at 15:37

Do you have CS_A and CS_G both connected to '1' (Vdd_IO)? Can you share you schematic?

If you are not able to read even WHO_AM_I register the problem would be probably in I2C configuration or in the HW connection. Also capture of I2C communication from a logic analyzer would be helpful. 

Posted on May 18, 2017 at 13:36

Yes,I have and I could share my schematic. If the problem was from the i2c configuration, I do not think I could read gyroscope data or if the problem was from the HW conncetion, it should be in LSM330. In this status, what should I do ? How can i solve this issue ?

0690X000006072hQAA.png

Posted on May 25, 2017 at 12:31

The schematic seems OK to me.

I think the best option to investigate the issue it to capture the communication on scope or logic analyzer. 

As accelerometer and gyroscope share the same I2C, the problem you see is really strange, can you double check you use correct I2C address of the accelerometer.

Posted on May 25, 2017 at 14:58

I'm going to look with logic analyzer. I checked both of the addresses and the software is returning an Acknowledge Failure Error. Well about this sensor, are there a source code or are there different document from datasheet ? Can you share with me ? The problem might be in my software of accelerometer.

Posted on May 25, 2017 at 16:14

I share the image of the result I obtained when I observed the i2c communication from the logic analyzer. It's always giving me NAK.0690X00000606obQAA.png