cancel
Showing results for 
Search instead for 
Did you mean: 

LIS3DSH Pedometer State Machine

ierturk
Associate III

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

8 REPLIES 8
Miroslav BATEK
ST Employee

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.

https://www.st.com/content/st_com/en/products/embedded-software/mcus-embedded-software/stm32-embedded-software/stm32cube-expansion-packages/x-cube-mems1.html

ierturk
Associate III

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

ierturk
Associate III

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

Miroslav BATEK
ST Employee

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.

ierturk
Associate III

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

Miroslav BATEK
ST Employee

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.

ierturk
Associate III

Ok. Thanks. I'll check it again, and let you know. It will be good, if you get state machine of pedometer.

Regards

ierturk
Associate III

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