cancel
Showing results for 
Search instead for 
Did you mean: 

FSM#2: How to… structure your FSM: a general overview

Eleon BORLINI
ST Employee

From theory, we define a Finite State Machine (FSM) as an abstract machine that can be in exactly one of a finite number of states at any given time, and is composed of a START state, a STOP state and a series of states, conditions and transitions. But how is this definition practically implemented in LSM6DSO sensor?

For the LSM6DSO sensor, FSM is intended to detect a specific gesture: there are up to 16 independent state machines, both XL and G (and external MAG sensor) data can be used, and a number of interrupts and source registers for the event detection management are available.

The activity recognition spans from Free Fall, to Glance, to Flip up and down, passing through Pickup, Shake and Wrist Tilt.

If you are interested in a detailed explanation of the LSM6DSO FSM structure, that enables you to develop your own machine, please follow the next posts!

0690X000006DB8mQAG.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

3 REPLIES 3
mElec
Associate

Hi, is the mag the only external sensor that can be attached to LSM6DSO? I would like to make some test with pressure sensor. Does it work for ST component only?

Eleon BORLINI
ST Employee

Hi Master, up to 4 sensor can be connected to the LSM6DSO via I2C: you can connect any external devices through the available 6-axis auxiliary I2C interface, be it a magnetometer, a pressure sensor or any other I2C device (both ST or not).

The LSM6DSO is in I2C master configuration and works as a sensor hub: after properly setting the external sensor(s), the LSM6DSO triggers the data acquisition from it and starts acquiring the data coming from the slave (or the slaves). Two data storage strategies are available: you can use a proper memory bank (par. 7.2.8 for the detailed registers) for a continuous or synchronous acquisition (triggered by DRDY through INT2 pin); or you can store the data inside the FIFO (regs from 0x0E to 0x11) and manage them together with the standard axl and gyro.

For details, you can refer to chapter 7 of the below-linked AN5192:

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

You said "up to 4 sensor can be connected to the LSM6DSO", but FSM only can choose to use extern sensor or not.

How can I choose a certain exteran sensor to use in FSM.