Skip to main content
ST Employee
February 8, 2019
Question

FSM#14: How to… test your FSM: basic PEDOMETER, the last algorithm example - Part 2

  • February 8, 2019
  • 0 replies
  • 564 views

Here below the second part of the algorithm describing the basic PEDOMETER. The picture here below shows the second and last part of the related FSM code: it is dedicated to recognize when the debouncing phase is over (n INCR command), and to count the further steps until the algorithm resets. In attachment you can find the state machine code to upload on your Unico tool.

Input data are the axl output stream (select ODR >= 26Hz)

Masks selects as interesting orientation the overall resultant v+ (MASK_C=0x02),

Thresholds are set to 1.1g (TH1) and 1.2g (TH2)

Timeout have been selected and tuned as 3sec (short counter, TI3) and 0xFFFF (long counter, T4)

Output of this section of the code is when a step and a debounce phase steps are detected

This is the last technical poos about FSM, so... Enjoy it!

0690X000006DSIsQAO.png

Link: https://www.st.com/content/ccc/resource/technical/document/application_note/group0/56/95/d6/a1/34/4c/49/6d/DM00517282/files/DM00517282.pdf/jcr:content/translations/en.DM00517282.pdf

    This topic has been closed for replies.