Skip to main content
Konstantin Maslennikov
Associate II
February 23, 2018
Question

F407 and lis3dsh

  • February 23, 2018
  • 2 replies
  • 2354 views
Posted on February 23, 2018 at 15:01

I'm try use only registers for lis3dsh.

https://community.st.com/external-link.jspa?url=https%3A%2F%2Fgithub.com%2Fmas-kon%2FF407-LIS3DSH

- my code. This code sometimes is worked, but sometimes it stopped. Can any help my?

#cmsis #registers #lis3dsh

Note: this post was migrated and contained many threaded conversations, some content may be missing.
This topic has been closed for replies.

2 replies

Andrew Neil
Super User
February 23, 2018
Posted on February 23, 2018 at 15:17

So what debugging have you done?

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
Konstantin Maslennikov
Associate II
February 23, 2018
Posted on February 23, 2018 at 16:08

Anytime funtion 

uint8_t SPI1SendData(uint8_t data)

{

while (!(SPI1->SR & SPI_SR_TXE)){};

SPI1->DR = data;

while (!(SPI1->SR & SPI_SR_RXNE)){};

data = SPI1->DR;

return data;

}

return 0xFF.

:(

Why, I don,t know...

Bogdan Golab
Lead
February 23, 2018
Posted on February 23, 2018 at 16:12

Looks like CS (chip select) is not enabled or sensor internal register address embedded in data sent to the sensor is wrong

Andrew Neil
Super User
February 23, 2018
Posted on February 23, 2018 at 19:22

Similar question just posted:

https://community.st.com/0D50X00009XkgQkSAJ

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.