Skip to main content
Visitor II
June 26, 2023
Solved

How to configure and connect LSM6DSM ( STEVAL-MKI189v1) in 3-wire mode ??

  • June 26, 2023
  • 1 reply
  • 2435 views

Hi mates,

Today I came with some interesting observation, I Was working with LSM6DSM sensor interface with Arduino and writing the driver code for same. I was able to achieve 4 - wire communication between Arduino and Gyro using a logic level shifter. But, I am not able to achieve same, for 3 wire. My connections for 3-wire or like this,

BGGopal_0-1687771439369.png

Also I have Updated the 3-wire config register in the 70h register, I am Enabling SIM_OIS, 500dps [ FS1-0], and OIS, so I am writing 0x25 in 70h. What I am receiving is 0xFFs as the device ID, and -1 , -1 , -1 as x, y and Z value.

Also when I short MOSI and MISO with 2.2k resistor, my device ID is detected as 0x80h and getting a -32640, -32640, -32640 as x, y and Z value.

, So , i am not sure what else i am missing here, so basically my question is , how to connect LSM6DSM in 3-wire mode. If any help provided by any will be helpful. @Federica Bossi 

Thanks and Regards

 

 

 

    This topic has been closed for replies.
    Best answer by Federica Bossi

    Hi @BGGopal ,

    Here my answers to your questions:

    1. If the microcontroller support it, it's advisable to configure the SPI in half-duplex and avoid the resistor entirely between miso and mosi.
    2. You should check with the oscilloscope before and after the resistor to check how much the signal is dropping but with the information given I think you can increase the value 

    If my reply answered your question, please click on Accept as Solution at the bottom of this post. This will help other users with the same issue to find the answer faster :)

    1 reply

    Technical Moderator
    June 26, 2023

    Hi @BGGopal ,

    This is not the best way to connect SPI3w to Arduino, by the way if you want to use these configuration, I suggest you to increase the value of the pull up resistances.

    If this solves your problem, please mark my answer as "Best Answer" by clicking on the "Accept as Solution" button, this can be helpful for Community users to find this solution faster.

    BGGopalAuthor
    Visitor II
    June 27, 2023

    @Federica Bossi wrote:

    Hi @BGGopal ,

    This is not the best way to connect SPI3w to Arduino, by the way if you want to use these configuration, I suggest you to increase the value of the pull up resistances.

    If this solves your problem, please mark my answer as "Best Answer" by clicking on the "Accept as Solution" button, this can be helpful for Community users to find this solution faster.


    Thank you for the response. 

    1. Then what is the best way to connect SPI3w to Arduino. Leaving the MOSI floating , just did not detect the presence of the Gyro LSM6DSM. 

    2. Increasing the resistance , will that lose the data ?.

    PF the diagram for your understanding.

    BGGopal_0-1687841009517.png

     

    Thanks and regards

    Bala Guga Gopal S

    Technical Moderator
    June 27, 2023

    Hi @BGGopal ,

    Here my answers to your questions:

    1. If the microcontroller support it, it's advisable to configure the SPI in half-duplex and avoid the resistor entirely between miso and mosi.
    2. You should check with the oscilloscope before and after the resistor to check how much the signal is dropping but with the information given I think you can increase the value 

    If my reply answered your question, please click on Accept as Solution at the bottom of this post. This will help other users with the same issue to find the answer faster :)