cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to communicate with LSM6DSL via SPI

Thomas L.
Associate III

I have a custom setup which contains a microcontroller (non-ST) and a LSM6DSL (actually this is mounted on a STEVAL-MKI178V2) for evaluation purposes. I tried to communicate with the LSM6DSL via SPI (4-wire, tried both 1MHz and 100kHz) using the command 0x8f to READ the WHO_AM_I register (thanks for implementing that!). Yet, I get back a 0x40 and not a 0xa6. I then observed the signals in a logic analyzer (salae Logic8) and also the logic analyzer decodes the transfer as 0x40 so the software works as expected.

I then further observed the signals on the scope and the MOSI signals are perfectly fine (no overshoot, nice edges). There are 100Ohm resistance between the SCK, MOSI, MISO lines.

BUT: The signal on the MISO is just plain ugly. At first it seems like another device is trying to actively drive the signal so I thought this was related to the microcontroller. But even after disconnecting the MISO trace I can still see this behaviour. The first few bytes look like the clock is driving the signal a bit (approx. 0.3V, down to 0V, up to 0.6V, down to 0.3V, ...), then there is a pulse which is detected as the 0x40 bit, then the signal is low. I forgot to make a screenshot but will add this when I have access to the setup.

According to the datasheet the device should be in 4-wire SPI mode after booting. The supply is 3.28V for VDD and VDDIO. SCx and SDx pins have been connected to VDD.

I can talk to the device using I2C just fine, no issues there but I'd prefer SPI. Is there something which must be set to allow for a normal 4-wire SPI setup? I read in the forums that someone had the same issue, then supplied the board with 1.8V and it worked. Any ideas?

Here a some pictures from what I see:

0693W00000VOVQRQA5.jpg0693W00000VOVQvQAP.png

1 REPLY 1
ABayl.2
Associate II

Hi @TLi.7nder​ . Did you communicate with SPI ?