Skip to main content
Visitor II
October 31, 2017
Solved

How to wireconnect LSM330DLC with SPI mode

  • October 31, 2017
  • 2 replies
  • 831 views
Posted on October 31, 2017 at 08:41

This is fundamental question, but I am confusing...

Please tell me what I think is right or wrong:

To communicate with LSM330DLC on SPI mode, the number of wiring between host and LSM330DLC is 5.

1 CS_A

2 CS_G

3 SCL_A/G(SPC)

4 SDA_A/G(SDI)

5 SDO_A & SDO_G tied togher(SDO)

The point I am comfusing most is the 5th wiring above.

Or must I use 2 pairs of SPI interface to use both Acc and Gyro?

    This topic has been closed for replies.
    Best answer by Miroslav BATEK
    Posted on October 31, 2017 at 14:05

    higuchi_hagemu

    ‌ you can connect it as you described and use only one SPI interface on your microcontroller.

    You can connect it like this:

    Sensor ... MCU

    CS_A ... GPIO1 or CS1

    CS_G ... GPIO2 or CS2

    SCL_A/G ... SCK

    SDA_A/G ... MOSI

    SDO_A & SDO_G (tied together) ... MISO

    2 replies

    Visitor II
    October 31, 2017
    Posted on October 31, 2017 at 10:37

    If you were planning to use a single SPI, it means no need to read data of both sensors at the same time.

    In this case, I would use the same SPI with different alternate functions GPIOs for the data line (the clock line can be the same). Recipe:

    Find an SPI with 2 MISO pins and 2 MOSI pins, 1 SCK and 2 GPIO for each CS.

    ST Employee
    October 31, 2017
    Posted on October 31, 2017 at 14:05

    higuchi_hagemu

    ‌ you can connect it as you described and use only one SPI interface on your microcontroller.

    You can connect it like this:

    Sensor ... MCU

    CS_A ... GPIO1 or CS1

    CS_G ... GPIO2 or CS2

    SCL_A/G ... SCK

    SDA_A/G ... MOSI

    SDO_A & SDO_G (tied together) ... MISO

    Visitor II
    November 1, 2017
    Posted on November 01, 2017 at 00:32

    Thank you.

    My brain become completely clear.

    I think that this sensor consists two separated SPI slave device into one package.

    I used to use MPU6050(I2C) and this one consists pure one I2C device,

    so I have confused.

    Thanks.