2025-07-15 3:11 AM
Hello.
I am working with the STM32U083 and LIS2HH12TR communication via SPI.
Did the SPI settings configuration in mode 3 and build a simple project in cube ide to identify and read the accelerometer data.
The project also does the conversion in mg of the acceleration for all axis.
When I move the axis I was expecting the values to change but there is no change as in picture below: (Debug data via uart ).
Does anyone come out with this kind of problem ?
Could it be sensor (accelerometer) damage, a soldering problem, or something else?
Following the terminal log:
Please support.
Thankyou
2025-07-15 6:21 AM
Unlikely that all readings for all axes are exactly the same. Perhaps a code bug. Doesn't feel like a hardware issue.
2025-07-15 6:27 AM
@EngHwho wrote:Could it be sensor (accelerometer) damage, a soldering problem, or something else?
Thankyou
As @TDK , I'd guess most likely a coding issue.
Have you tried logging just the raw data direct from the accelerometer?
Have you looked at the data on the bus with an analyser?
2025-07-15 9:09 AM
Hello. First, thank you for the quick reply. I am a hardware PCB layout Engineer and have very low knowledge and experience in building firmware. I have to do it now because at least I want to test that the SPI bus connections are ok and read just for testing purposes the X, Y, Z axis.
So far, the WhoamI register, as you saw on the terminal log I can read. How can I get some very simple code to test the Axis of this accelerometer? Can you advise me on a link or something?
I tried from gitHub but the code was written for another platform and even "by my code modification(I am not sure how good I was)", could not successfully accomplish the task.
I will appreciate any support.
Thankyou
2025-07-15 9:48 AM
Perhaps take a look at C-Driver-MEMS ?
via: https://www.st.com/en/mems-and-sensors/lis2hh12.html#tools-software
2025-07-15 10:12 AM
Some options: