2024-03-13 08:39 AM
Hi everyone,
Based on the drivers from ST GitHub, I developed my own one, but I can't understand why it's not working. I can communicate with the accelerometer and I can read the registers, but I don't know why i am having troubles to read the acceleration data correctly.
It would be nice if someone knows if it's because I'm not writing to the correct registers at the start-up, or because I'm not reading correctly the acceleration data, so the status register is not cleaned.
Thanks!!
I attach below the link to my .zip file of all my project
2024-03-13 08:48 AM
> I don't know why i am having troubles to read the acceleration data correctly.
What troubles are you having? Since you can read registers, what acceleration values are you seeing and what values are you expecting? Perhaps an issue interpreting twos-complement data.
2024-03-13 08:53 AM
It's easier to browse code directly in the repo's
Accelerometers need to be enabled in LIS3DH_CTRL_REG1
Check WHO AM I, enable temperature sensor and accelerometers enable/scaling
2024-03-22 07:32 AM
I am utilizing an H563ZI board. I consistently receive identical values for acceleration across all axes, which is not expected behavior. Furthermore, these values remain constant without variation. Additionally, my attempts to utilize the driver provided on GitHub have also yielded unsuccessful results.
Attached are screenshots illustrating the debug output of our program. Figure 1 depicts consistent values for acceleration across all axes, while Figure 2 showcases the initialization registers where we suspect the issue may lie, particularly in the inadequate initialization of certain bits.
Figure1: acceleration data
Figure 2: initialization
2024-03-22 07:39 AM
That's what I did (Refering to "Accelerometers need to be enabled in LIS3DH_CTRL_REG1"), but I don't know why it's not working.... My initialization registers are:
And on the other hand, I already attempted to utilize the driver provided on GitHub, but have also yielded unsuccessful results. Do you have/know any full project created with cubeIDE for the LIS3DH sensor?