2017-12-05 01:19 PM
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?
2017-12-05 11:09 PM
question might be stupid, but did you set SPI datasize to 8bit?
2017-12-12 03:15 AM
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?
2017-12-13 01:49 AM
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?
2017-12-14 05:18 PM
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.
2017-12-15 01:58 AM
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.
2017-12-26 08:00 PM
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
2018-01-17 11:26 PM
Hi,
I solved the problem by adding a 100 ohm resistor in series on the MISO line...
2018-01-18 06:54 AM
OK, good. I confirms my assumption that there was ringing on the edges.