Skip to main content
Visitor II
October 1, 2018
Question

LIS3DSH Pedometer State Machine

  • October 1, 2018
  • 8 replies
  • 1626 views

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

    This topic has been closed for replies.

    8 replies

    ST Employee
    October 1, 2018

    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

    ierturkAuthor
    Visitor II
    October 1, 2018

    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

    ierturkAuthor
    Visitor II
    October 2, 2018

    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

    ST Employee
    October 2, 2018

    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.

    ierturkAuthor
    Visitor II
    October 2, 2018

    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

    ST Employee
    October 2, 2018

    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.

    ierturkAuthor
    Visitor II
    October 2, 2018

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

    Regards

    ierturkAuthor
    Visitor II
    October 3, 2018

    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