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 to our daily design challenges for embedded systems. While traffic lights or microwave oven are great starters, examples for real hardware devices using I2C, SPI, UART and DMA would be interesting.
So far, using this G-scale hobby train as a model, we have looked at the Train state machine for high-level speed control (shuttling) and the GpioIn state machine for low-level interrupt handling (buttons and hall-effect sensor). In upcoming posts, we will check out the design of other state machines, as well as how existing one may evolve with ease to adapt to ever-changing requirements.