Skip to main content
Visitor II
May 12, 2017
Question

How can I read acceleration data from LSM330?

  • May 12, 2017
  • 3 replies
  • 2608 views
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.
    This topic has been closed for replies.

    3 replies

    Visitor II
    May 12, 2017
    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

    Visitor II
    May 15, 2017
    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?  

    Visitor II
    May 15, 2017
    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.

    Visitor II
    May 16, 2017
    Posted on May 16, 2017 at 10:58

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

    ST Employee
    May 17, 2017
    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. 

    Visitor II
    May 18, 2017
    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

    ST Employee
    May 25, 2017
    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.