u/active-objectin r/embedded • Recommends
On “Do you use HSM (Hierarcical State Machines)?”
#statemachines#fsm#hierarchicalstatemachines
74K subscribers • 20 videos on Hallway
Intermediate. Assumes working knowledge.
28K views5 years ago2 recommendations
Systems programmingSoftware designCEmbedded systemsDesign patterns
Miro Samek demonstrates how to design a domain-specific language for state machines and implement it optimally in C.
This lesson continues the subject of STATE MACHINES. Today you will learn 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 the 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 for 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 projects: - 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) ------- Resources: Companion web page for this video course: state-machine.com/quickstart GitHub repository for projects for this video course: github.com/QuantumLeaps/modern-embedded-programming-course Transcript of this lesson: state-machine.com/course/lesson39.txt Music credits: -------------- The background music comes from: bensound.com/royalty-free-music/track/straightWhat people say. Highly recommended as part of an essential playlist explaining state machines and hierarchical state machines in embedded systems.
u/active-objectin r/embedded • Recommends
On “Do you use HSM (Hierarcical State Machines)?”
u/active-objectin r/embedded • Recommends
On “Looking for good c++ code”
u/active-objectin r/embedded • Recommends
On “How to handle multitasking in baremetal?”
u/NotBooleanin r/embedded • Recommends
On “Finite State Machines”
u/active-objectin r/embedded • Recommends
On “State Machines in embedded?”
u/active-objectin r/embedded • Recommends
On “Is preemptive RTOS costing you too much?”
u/active-objectin r/embedded • Recommends
On “Event driven state machines”
u/active-objectin r/embedded • Mentions
On “Optimal State Machine Implementation in C”
u/active-objectin r/embedded • Mentions
On “Do you use HSM (Hierarcical State Machines)?”
u/active-objectin r/embedded • Mentions
On “I wrote StateSmith with embedded devs (like me) in mind. It compiles diagrams to FSM C or C++. Below sim uses arduino, but any platform works. Would you use it? Why/not? Feedback welcome!”