Skip to main content
Visitor II
October 26, 2021
Solved

How to connect MKI197V1 to NUCLEO-F756ZGT via I2C but without an expansion board.

  • October 26, 2021
  • 3 replies
  • 1966 views

The problem is that the address of the device is unknown, I tried 0xD4, D5, D6, D7, A6 and many others, zero reaction.

To check, I use the function:

#define SENSOR_ADDRESS 0xD4

if (HAL_I2C_IsDeviceReady(&hi2c1, SENSOR_ADDRESS, 2, 10) == HAL_OK)

 {

  HAL_GPIO_TogglePin(Green_led_GPIO_Port, Green_led_Pin);

 }

0693W00000FDuTAQA1.png 

    This topic has been closed for replies.
    Best answer by AGile.2

    HI @Eleon BORLINI​ ,

    It was possible to connect, my mistake was that I did not apply +3.3V to SDA and SCL.0693W00000GXUheQAH.pngThanks for the help:)

    3 replies

    Visitor II
    October 27, 2021

    Hi, if you use the I2C you have to set at least the CS to GND (pin19). Suggestion is to follow also the recommendation of the datasheet.

    https://www.st.com/resource/en/datasheet/lsm6dsox.pdf

    AGile.2Author
    Visitor II
    October 27, 2021

    Hi, thanks for the answer.

    Most likely the opposite, CS to 10693W00000FDxanQAD.pngbut unfortunately there is still no response from the sensor.

    Another question arose, should the interrupt be received on the INT2 port or not? maybe this is the problem

    ST Employee
    October 28, 2021

    Hi @AGile.2​ ,

    right, the CS has to be tied to Vdd in the I2C.

    The INT lines are output lines, so they generate interrupts that have to be usually managed by the application processor.

    You might try with a 7-bit address, for example 0x6A or 0x6B, from the table:

    0693W00000GVnreQAD.png-Eleon

    AGile.2Author
    Visitor II
    October 28, 2021

    Hi, I've tried both with no success.

    I downloaded the library from ST for LSM6DSOX, although it also uses the HAL library, but just in case I use it. The Examples have a code snippet like this:

    lsm6dsox_device_id_get (& dev_ctx, & whoamI);

      if (whoamI! = LSM6DSOX_ID)

       while (1);

    int32_t lsm6dsox_device_id_get (stmdev_ctx_t * ctx, uint8_t * buff)

    {

      int32_t ret;

      ret = lsm6dsox_read_reg (ctx, LSM6DSOX_WHO_AM_I, buff, 1);

      return ret;

    }

    So the function returns me whoamI = 0, which could what does it mean? the sensor is new, checked the voltage everything is ok, 3.3v.

    ST Employee
    November 3, 2021

    Hi @AGile.2​ ,

    Can you please share the scope pattern of the I2C signals?

    -Eleon