cancel
Showing results for 
Search instead for 
Did you mean: 

FSM#7: How to… test your FSM – 4D orientation, an algorithm example

Eleon BORLINI
ST Employee

This example describes how to set up a Finite State Machine to enable the built-in detection of e.g. the orientation of a phone screen (4D orientation). The picture here below shows the steps of the dedicated FSM. Basically, to get FSM output data you have to define input data and parameters such as a mask (to select the axis and direction to be monitored for the interrupt detection), thresholds and timeout frame to manage the latency. Finally, in attachment you can find an algorithm example for the upload in Unico.

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

Mask selects as interesting orientation axis x+, x-, y+ and y- (0xF0)

Thresholds can be set to 0.8g both for x and for y (high threshold), and 0.2g for x and y (low threshold)

Timeout selectable (e.g. 0x0D = 520 ms)

Output is the OUTS register content for orientation (portrait up, portrait down, landscape left, landscape right)

0690X000006DGjiQAG.pngEnjoy!

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

0 REPLIES 0