cancel
Showing results for 
Search instead for 
Did you mean: 

FSM#3: How to… structure your FSM: the most important details

Eleon BORLINI
ST Employee

But how is structured, in detail, a FSM program? Basically, there is a data section, composed of a fixed part (same size for all the FSMs), and a variable part (size is specific for each FSM), and an instructions section, composed of conditions and commands. Both data and instruction sections registers details can be found at the link below.

As regards data section, the fixed part is made of 6 bytes at the beginning of each FSM where the user must specify the amount of resources he will use in the instructions section and some parameters useful to the interpreter. Some examples: ODR, HW configurations, etc (see p.23 in the attached link). The variable data section is composed by a variable number of bytes after the fixed data section where the user allocates the necessary space for the resources. Some examples: thresholds, hysteresis, masks, etc (see p.25 of the attached link).

The instruction section is another variable number of bytes after the variable data section where the user can define the algorithm by using available commands and conditions. Some examples: NOP (no operation), Tx (timer number x), GNTH1(negative threshold 1), etc (see p.31 of the attached link).

By now, these definitions could appear quite abstract, but if you follow the posts, you will find some practical examples and applications :smiling_face_with_smiling_eyes:

0690X000006DCIsQAO.png

Link: https://www.st.com/content/ccc/resource/technical/document/application_note/group1/df/fb/3f/a8/29/9f/44/73/DM00537590/files/DM00537590.pdf/jcr:content/translations/en.DM00537590.pdf

0 REPLIES 0