2018-02-23 06:01 AM
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.2018-02-23 06:17 AM
So what debugging have you done?
2018-02-23 08:08 AM
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...
2018-02-23 08:12 AM
Looks like CS (chip select) is not enabled or sensor internal register address embedded in data sent to the sensor is wrong
2018-02-23 08:58 AM
Have you actually looked at the SPI lines on an oscilloscope to see what's happening ?
2018-02-23 09:01 AM
I'm have not oscilloscope..
:(
2018-02-23 10:22 AM
Similar question just posted:
2018-02-23 11:21 AM
You're pretty much stuck when it comes to hardware debugging, then.
2018-02-23 12:13 PM
Check wiring. CS needs to be set to 0 when want to read / write through SPI.
2018-02-23 12:20 PM
It's stm32f4-disco..