cancel
Showing results for 
Search instead for 
Did you mean: 

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

BGGopal
Associate II

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

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

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 :)

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

View solution in original post

4 REPLIES 4
Federica Bossi
ST Employee

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.

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

@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

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 :)

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

Ciao @Federica Bossi 

 

Thanks for the response and your help. I will check on the same, as you have suggested.