2018-09-30 09:46 PM
Hi,
We are trying to develop a pedometer based on LIS3DSH. We already have a
STM32F4 (F407) discovery board equipped with LIS3DSH. As stated in the document
"Application Guidelines for LIS3DSH State Machine", there is an
application "Pedometer Based on State Machine".
If anyone has the code, would you please share.
Regards,
ierturk
2018-10-01 01:44 AM
I would recommend you software pedometer library (MotionPM) , the accuracy will be better than pedometer based on state machine. You can find this library in the X-CUBE-MEMS1 package.
2018-10-01 04:56 AM
Hi Miroslav,
Thanks for your prompt reply. I've already checked it. But if you have the state machine version of pedometer please share it. Because we try to reduce current consumption of whole system, and accuracy is is not our primary goal.
Thanks in advance.
Regards,
ierturk
2018-10-02 07:31 AM
Hi Miroslav,
I have tried the MotionPM library on the STM32F4 discovery board, but not succeeded. When the library initialize function called, other custom initialization is overridden by the library. So there is no way to use the library. Also there is no details in the documents.
Regards,
ierturk
2018-10-02 07:36 AM
What you mean by "custom initialization is overridden by the library"?
The library needs enabled clock for CRC unit, so please be sure the clock is enabled.
I'm also trying to get the configuration for the state machine for pedometer.
2018-10-02 07:56 AM
Hi Miroslav, the custom initialization is my initialization for the interrupts. For example external interrupt EXTI9:5 is enabled before and after library initialization (MotionPM_Initialize). Some of them comes from CubeMX. Also CRC is enabled. But I don't understand the "clock".
Regards
2018-10-02 08:03 AM
The library is HW independent (except CRC) it doesn't operate with any interrupt. There must be something wrong in your project.
Basically enable CRC means enable clock signal for the CRC unit. You can check the Pedometer application in X-CUBE-MEMS1.
2018-10-02 08:33 AM
Ok. Thanks. I'll check it again, and let you know. It will be good, if you get state machine of pedometer.
Regards
2018-10-02 08:45 PM
Hi Miroslav, It seems the MotionPM library runs. However, in case of the Update function is called, the other interrupt source (in my case it comes from an RF module) ceases to run for some reason. I think I have a timing problem. Regarding the accuracy of the library, I have no idea at the moment.
Regards