cancel
Showing results for 
Search instead for 
Did you mean: 

LIS2HH12 does not respond on SPI

TSnym.2
Associate

Hi,

I'm trying to get the LIS2HH12 accelerometer to work via SPI. The message I'm sending seems correct to me, and all the timings are within the minimum and maximum specifications that I have found in the datasheet. I have tried multiple SPI configurations without much luck. Below is what I get on the my logic analyzer.


_legacyfs_online_stmicro_images_0693W00000bkhGXQAY.pngI have managed to talk to this exact chip on this board via I2C via bodge wires. The SPI driver I'm using is part of TI-RTOS.

1 ACCEPTED SOLUTION

Accepted Solutions
Federica Bossi
ST Employee

Hi @TSnym.2​ ,

Welcome to ST Community 🙂

The single SPI read is performed with 16 clock pulses with low CS signal. 

In the image there is one pulse of CS then the first byte transmitted, try to avoid it.

Check the SPI configuration it should be:

  • data size= 8bit
  • polarity =HIGH
  • Phase =second edge
  • spi first bit =MSB

If this solves your problem, please mark my answer as "Best Answer" by clicking on the "Select as Best" button, this can be helpful for Community users to find this solution faster. 

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.

View solution in original post

2 REPLIES 2
Federica Bossi
ST Employee

Hi @TSnym.2​ ,

Welcome to ST Community 🙂

The single SPI read is performed with 16 clock pulses with low CS signal. 

In the image there is one pulse of CS then the first byte transmitted, try to avoid it.

Check the SPI configuration it should be:

  • data size= 8bit
  • polarity =HIGH
  • Phase =second edge
  • spi first bit =MSB

If this solves your problem, please mark my answer as "Best Answer" by clicking on the "Select as Best" button, this can be helpful for Community users to find this solution faster. 

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.
TSnym.2
Associate

Hi Federica,

Thank you for the response. I can confirm that little bump on the chip select line between the two bytes does cause a problem. I'm not sure why the TI-RTOS SPI driver does that. I fixed it by just taking manual control of the the CS line.