The HSM Communicator

The HSM Communicator illustrates the use of hierarchical state machines (HSMs).

Hierarchical State Machines are indicated whenever the process to be managed involves loosely connected, highly coherent, sub-processes. Our communications example here is one such situation. Another might be the management of an external FLASH part through a QSPI interface.

To be most useful, sub-machines should be thought of as sub-routines. Just as sub-routines might be created for “readability,” a sub-machine might clarify an FSM design by encapsulating events which always go together. And, just as with sub-routines, a sub-machine might encapsulate a process that must be repeated in response to an event, regardless of what else might have been going on at the time.

Here, one thinks again, of a communications example: establishing a Bluetooth Low Energy (BLE) connection in a noisy environment, when that connection involves some “higer-level” sequence of steps. A sub-machine that knows how to recover from a signal loss at any time can help the higher-level machine continue through the “higher-level” sequence essentially without regard to the signal loss.