cancel
Showing results for 
Search instead for 
Did you mean: 

Problems Communicating with Specific Registers in the LSM6DSO while using SPI

JFrec.1
Associate

Hi ST Community,

We have been trying to test and adapt the LSM6DSO evaluation board (STEVAL-MKI196V1) for a project but have run into difficulties communicating with it using SPI.

It functions and behaves as expected when placed onto a Profi-Mems board (STEVAL-MKI109V3) and configured within the Unico GUI. We connected it successfully to a Nucleo-L031K6 board and were able to read and write to all registers using I2C. When we decided to communicate instead with SPI, we ran into difficulties.

We have limited communication with the LSM6DSO: we are able to successfully read the WHO_AM_I (0Fh) register with a value of 0x6C as expected and write to the FUNC_CFG_ACCESS (01h) register to enable and disable access to embedded function registers. However, we are unable to correctly communicate with the CTRL1_XL (10h) and CTRL2_G (11h) registers to set the accelerometer and gyroscope. We are able to read and write values less than 0x0E to each of the registers but anything greater than this doesn't seem to be received correctly: for instance, 0x2C is written to one of these registers but 0x18 is read back.

The LSM6DSO continues to function within Unico and can be configured and communicated with using I2C, leading us to believe that there's something we're missing regarding the SPI communication. We're operating in SPI Mode 0 with a Baud Rate of 125KBits/s and a data size of 8 bits. We have tried operating with Vdd = VddIO = 1.8V, Vdd = VddIO = 3.3V, and Vdd =3.3V and VddIO = 1.8V with this problem persisting in each iteration.

How should we address this issue and how might we proceed in troubleshooting this it?

Thank You!

1 ACCEPTED SOLUTION

Accepted Solutions
JFrec.1
Associate

Figured it out, this was caused by SPI difficulties with the L031K6 board that have been resolved.

View solution in original post

1 REPLY 1
JFrec.1
Associate

Figured it out, this was caused by SPI difficulties with the L031K6 board that have been resolved.