Skip to main content
Visitor II
May 17, 2023
Solved

i am using lsm6dsm (@steval-mki189v evaluation board) for OIS application, data sheets says, auxiliary spi can be used for the purpose, also through the primary spi we can read the data parallely, like connecting host processor and camera module in m

  • May 17, 2023
  • 5 replies
  • 2562 views

but i am not able to read the data in slave module, how to connect this with the host and camera module processor and read the data, is there any settings have to be mentioned.? if any one information about this it will be helpful.

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

    Ciao @BGGopal​ ,

    Each slave should have a dedicated CS (this is the SPI), if Arduino 2 is a slave, it cannot read as a master. There should be only one master which is Arduino1 and two slaves which are LSM6DSM and Arduino 2 but each with its own CS.

    From Arduino1 should start a CS1 and a CS2 that go to the two slaves.

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

    5 replies

    Technical Moderator
    May 17, 2023

    Hi @BGGopal​ ,

    Welcome to ST Community!

    In order to enable the OIS chain you need to set register 70h bit OIS_EN_SPI2:


    _legacyfs_online_stmicro_images_0693W00000bkHwHQAU.pngThen set Full scale and ODR depending on the Mode you choose:

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

    BGGopalAuthor
    Visitor II
    May 23, 2023

    Hi @Federica Bossi​ 

    Thanks for your response. I totally get your response for how to enable the OIS chain by setting the register in 70h.

    But I am interested in this diagram below. (at the end)

    In the application note AN4987 , section 8.2 it states that

    ```

    The primary I2C/SPI (3/4-wire) interface is always available and the gyroscope output values can be read in registers 22h to 27h with full scale and ODR selectable through the CTRL2_G register

    ```

    So, i am trying to connect two processors , to the LSM6DSM, through one I wanted to enabling the OIS ( through auxillary spi) and through other controller i wanted to read the the values. I tried using 2 Arduino UNO boards, so how to do this.

    I followed the connection setup given below, but still I couldn't get the output. How to make the connection for this process and is there any other settings to be made for reading in primary spi.


    _legacyfs_online_stmicro_images_0693W00000bkgXlQAI.png 

    Thanks and Regards

    Technical Moderator
    May 26, 2023

    Hi @BGGopal​ ,

    Am I correct in saying that you want to read the OIS data through the primary interface? if this is the case, it is not possible, the OIS data are accessible only from the auxiliary SPI, you can still read the data coming from the gyroscope via the registers OUTX_G OUTY_G OUTZ_G.

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

    BGGopalAuthor
    Visitor II
    May 31, 2023

    Hi @Federica Bossi​ 

    Again Thank you for Your response. I got that, I can't read the OIS data through Primary SPI.

    Is it possible to connect multiple Slaves in Auxiliary SPI, in my application (demands), from I have one master (Arduino 1) and 2 slave device( LSM6DSM & 'Arduino 2 ') , I want to enable OIS operation via master (Arduino 1) to slave device( LSM6DSM) and read the OIS Gyro value in Slave device (Arduino 2). Is it possible to connect and read the OIS value as given in circuit below. I have been trying on this. Please suggest or guide me if anything I might be missing


    _legacyfs_online_stmicro_images_0693W00000blEC3QAM.png

    Technical Moderator
    June 1, 2023

    Ciao @BGGopal​ ,

    Each slave should have a dedicated CS (this is the SPI), if Arduino 2 is a slave, it cannot read as a master. There should be only one master which is Arduino1 and two slaves which are LSM6DSM and Arduino 2 but each with its own CS.

    From Arduino1 should start a CS1 and a CS2 that go to the two slaves.

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

    BGGopalAuthor
    Visitor II
    June 26, 2023

    Thank You @Federica Bossi , i was able read the same using a Bi-directional Logic level converter, Because arduino was on 5v and sensor was on 3.3v. And from your suggestion, used diff cs pin. 

    BGGopalAuthor
    Visitor II
    June 26, 2023

    @Federica Bossi , but now i am wondering how to configure and connect the device for 3wire mode. Any way i will open that as a new thread. 

    Thanks and Regards

    @BGGopal