cancel
Showing results for 
Search instead for 
Did you mean: 

LSM6DSV16X: wrong WHO_AM_I read on SPI interface

rafael_daciuk
Associate II

Hello,

I am trying to interface a Nordic MCU to a LSM6DSV16X, but I cannot get the communication to work.

I am using 2 dev kits for this test setup, a nRF5340-DK and a STEVAL$MKI227KAA I got from the STEVAL-MKI227KA. VDD/VDD_IO are both 3V, CS/SPC/SDI/SDO are all used and connected correctly. SPC frequency is 1MHz and the SPI interface is set to Mode 0.

Even the WHO_AM_I register is read wrong from the start. The code has a 10ms delay at startup, then it tries to read the WHO_AM_I register to verify the chip ID, but instead of reading 0x70 as expected I get 0x60, as shown on the oscilloscope screenshot below (CS is yellow, SPC is red, SDI is blue, and SDO is green) . This screenshot was taken by triggering on the first falling edge of the CS pin after switching the board from OFF to ON, so no previous interaction on the SPI bus has occurred. The screenshot shows that the MCU sends 0x8F to the IMU, requesting a read of register 0x0F (WHO_AM_I), to which the IMU responds with 0x60.

SDS00001.png

I did test the STEVAL$MKI227KAA board with a STEVAL-MKI109V3 and Unico-GUI, and everything seemed to be working fine there (no errors shown on Unico-GUI, WHO_AM_I read as 0x70, accel and gyro reading ok).

What could be happening here?

Thank you,

Rafael

1 REPLY 1
Federica Bossi
ST Employee

Hi @rafael_daciuk ,

Welcome to ST Community!

I think there are some non compatibility with the SPI master. You can try to increase the power-on time before the first SPI reading, then try to SPI-read a second time and share here a screenshot.

You could also try to change in SPI mode 3 and check the WhoAmI and compare the communication with MKI109V3 and with the nordic.

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.