cancel
Showing results for 
Search instead for 
Did you mean: 

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

AGile.2
Associate II

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 

1 ACCEPTED SOLUTION

Accepted Solutions

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

View solution in original post

7 REPLIES 7
JWu.12
Associate III

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.2
Associate II

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

Eleon BORLINI
ST Employee

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

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.

Hi @AGile.2​ ,

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

-Eleon

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

HI @AGile.2​ ,

that's correct! Glad to see you solved the issue.

-Eleon