2024-03-03 01:21 PM
Hi,
I have been trying to get acceleration data from an Adafruit LSM6DSO32 with the STM32 Nucleo board F446RE via i2c. I used the STMems_Standard_C_drivers (GitHub - STMicroelectronics/lsm6dso32-pid at 308cf0e4de0db190c453f3e211b0c40990f1f39b) in order to set the IMU properly. I also use the STM32CubeIDE app to programme the MCU.
Despite many efforts, the Nucleo board is not able to recognise the IMU (I checked that a test buffer that prints whether the device is recognised using the whoami register (please refer to the 7z folder attached)), though I double checked the slave address of the components and the connections (please see attached image (IMG_0605.jpg). Could you please help me solve that problem?
You can find enclosed a copy of the STM32CubeIDE project.
Best regards,
Audric
Solved! Go to Solution.
2024-03-08 06:38 AM
Hi @atamby187 ,
Welcome to ST Community!
I see two possible issues in your code:
2024-03-08 06:38 AM
Hi @atamby187 ,
Welcome to ST Community!
I see two possible issues in your code:
2024-05-08 07:52 AM
Hi Frederica Bossi,
Thank you for helping solve this problem.
The problem was with the i2c address of the Adafuit IMU which is 0xD4 (0x6A << 1) and not 0x6A as seen on Adafruit website.
Best regards,
Audric
2024-05-08 08:26 AM - edited 2024-05-08 08:29 AM
@atamby187 wrote:The problem was with the i2c address of the Adafuit IMU which is 0xD4 (0x6A << 1) and not 0x6A as seen on Adafruit website.
An I2C address is just 7 bits, so Adafruit are correct to say that the I2C address is 0x6A = 110 1010
The value 0xD4 is made up of the address plus the R/W bit: 1101 0100 = 0xD4
This is a frequent cause of confusion:
As shown in the ST datasheet, the value 0xD4 is the "SAD+R/W" - ie, Slave ADdress plus the R/W bit:
2024-05-08 08:49 AM
Hi Andrew,
Thank you for the clarification. I am quite new in electronics.
Best regards,
Audric.