Smart Trains
-
ST 15 Seeing Statecharts Run
Software development is fun when the system works exactly as designed, including both nominal and off-nominal paths. It would be less so if something didn’t work and we had to reconstruct a mental…
-
ST 14 Keeping Edge Cases at the Center
In an earlier post, we looked at the stopping mechanism of the Train state machine. In particular, the substate AutoMotorRest stops the train gradually by sending the event MOTOR_RUN_REQ with the target speed…
-
ST 13 Async Design Is a Rugged Terrain. Statecharts May Help.
This is a series of blog posts about asynchronous software design using statecharts. While there are quite a few resources on basic statechart notations and tools, there aren’t really many realistic examples applicable…
-
ST 12 A Neat Diagram Yields a Neat Design
We are continuing our journey on this garden model train named Hierarki to explore model-based software design. In this post, we illustrate some cool features of statecharts with GpioIn, a state-based driver for…
-
ST 11 Hierarchical Refinement of Statechart (GpioIn)
In the previous post, we showed how we modeled a GPIO interrupt pin with a hierarchical state machine (HSM) named GpioIn. Its simple design enforces the following properties: With infinite number of waveforms…
-
ST 10 The Simplest Model-based Device Driver
Our journey on model-based software design continues with the Hierarki model train. In previous post, we explained how we partition the embedded software into multiple hierarchical state machines (HSMs) and looked into the…
-
ST 9 An Objected-oriented Architecture for Embedded Systems
This is the object diagram showing the main software components, or objects, of this G-scale model train. For embedded systems, an object-oriented architecture is very useful in encapsulating hardware resources. To a microcontroller,…
-
ST 8 Dual Roles of Hierarchy in Software Architecture
In the previous post we looked at the state hierarchy of the Train state machine which automatically drives a model train between two stations. It receives an ARRIVING event from the hall-effect sensor…
-
ST 7 Hierarchical State Design as a Recursive Partitioning Problem
The first step of statechart design is to identify states of a component. You need a distinct state when: The second point is particularly interesting. For algorithm design, the focus is on the…
-
ST 6 Stop the Train – A Case Study of the Power of Visual Language
In the previous post, we introduced statechart as a method for designing asynchronous systems such as this G-scale model train named Hierarki. To see why statecharts are useful, let’s look at two safety-critical…