Optimal State Machine Implementation in C
This new video lesson about state machines explains the "optimal" state machine implementation in C.
You will start with designing a simple "domain specific language" (DSL) for specifying state machines and then you will turn it into a C program. You will then generalize the implementation into a reusable "event processor" to include this optimal state machine implementation strategy directly in the Micro-C-AO active object framework that you've been building in this segment of lessons.
This lesson includes quite a bit of coding with the intent to give you some "pair programming" experience as you witness gradual transformation of the design into C.
Also, you will see and compare other state machine DSL based on the SMC (State Machine Compiler).
Finally, you will see a technique of measuring code execution speed on ARM Cortex-M CPUs by means of the Cycle Counter register in the DWT (Data Watchpoint and Trace) hardware block.
This lesson comes with two project downloads (see https://www.state-machine.com/video-course/#Videos ):
- the "optimal" implementation of the TimeBomb state machine and the updated uC/AO active object framework.
- the implementation of the TimeBomb state machine based on the SMC (State Machine Compiler)
Posted Jul 27, 2021, 8:24 PM UTC
the optimal state machine uses the PC :)