2021-10-26 07:14 AM
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);
}
Solved! Go to Solution.
2021-11-14 02:02 AM
HI @Eleon BORLINI ,
It was possible to connect, my mistake was that I did not apply +3.3V to SDA and SCL.Thanks for the help:)
2021-10-27 08:08 AM
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.
2021-10-27 10:38 AM
Hi, thanks for the answer.
Most likely the opposite, CS to 1but 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
2021-10-28 07:40 AM
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:
-Eleon
2021-10-28 08:47 AM
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.
2021-11-03 03:41 AM
Hi @AGile.2 ,
Can you please share the scope pattern of the I2C signals?
-Eleon
2021-11-14 02:02 AM
HI @Eleon BORLINI ,
It was possible to connect, my mistake was that I did not apply +3.3V to SDA and SCL.Thanks for the help:)
2021-11-14 11:52 PM
HI @AGile.2 ,
that's correct! Glad to see you solved the issue.
-Eleon