cancel
Showing results for 
Search instead for 
Did you mean: 

LSM6DSL: WHO AM I Value not valid.

stefan schoenbauer
Associate II
Posted on December 05, 2017 at 22:19

I want to access the LSM6DSL via SPI. And I ´m always recieving 0x40, when I read the WHO AM I register. I expect 0x6A. I am sending 0x8F to read the WHO AM I register.. Any Idea why I am not recieving the right value?

8 REPLIES 8
ChrisH
Associate III
Posted on December 06, 2017 at 08:09

question might be stupid, but did you set SPI datasize to 8bit?

Kit Jiang
Associate II
Posted on December 12, 2017 at 12:15

Hi all,

     I got the same problem during read WHO AM I regiester, and I am sure that 8bit SPI set.

     Below is the time frames capture by LA. You can see that some jitters in SDO but the result of WHO AM I

     was 0x40.

     Do anybody can help this issue?

0690X00000609CFQAY.png
Posted on December 13, 2017 at 09:49

I guess there is ringing on the clock edges and the sensor sends the data very quickly which you don't see on the logic analyzer. Actually you can see the short spike. Can you please decrease the clock speed and/or reduce the speed of GPIO pin which is used for SPI signals?

Posted on December 15, 2017 at 01:18

Hi

Batek.Miroslav

Batek.Miroslav

Thank you for reply. But the clock was just about 500KHz and the spec announce they can accept 8MHz.

By the way, even MCU can detect the jitter, the result will not be 0x6A as spec announce.

Actually, I have reduce to 200KHz, but the result was the same.

Posted on December 15, 2017 at 09:58

In the picture above I see that the ckock frequency is ~2MHz.

What is the distance between MCU and the sensor?

Is the sensor somehow configured before you read the who_am_i. If yes can you please send the configuration.

Kit Jiang
Associate II
Posted on December 27, 2017 at 05:00

Hi All,

   I found the root cause.

   If VCC input set as 1.8V, SPI_MISO would output correct.

   If VCC input set over 2.2V, SIP_MISO would output as wrong data.

   Below 2 picture with the same code to read register 0x0F (WHO AM I)

   VCC 1.8V output 0x6A but VCC 2.2V output 0x40 

stefan schoenbauer
Associate II
Posted on January 18, 2018 at 08:26

Hi,

I solved the problem by adding a 100 ohm resistor in series on the MISO line...

Posted on January 18, 2018 at 14:54

OK, good. I confirms my assumption that there was ringing on the edges.