State machine versus RTOS for microcontrollers

梦想与她 提交于 2019-12-03 16:27:48

You may also be interested in Miro Samek's book "Practical UML Statecharts in C/C++". Note that Miro is founder and president of Quantum Leaps, so this book goes hand-in-hand with the tool.

It seems that Miro has a lot invested in state-chart development over RTOS development, having written the book and blogged on the subject extensively. He started the thread on LinkedIn's Real-Time Embedded Engineering group titled "Is an RTOS really the best way to design embedded systems?" - plenty of opinions on the subject there!.

I am not sure that the two are necessarily distinct; it is often useful (and frequently done) to implement individual RTOS threads as state-machines. He makes some good points in his blog "I Hate RTOSes, but his reasoning is largely based around poor application design than RTOS technology itself. Just as C or C++ can be dangerous when used ill-advisedly, so to can an RTOS. What I typically see is applications with too few threads with poor cohesion and tight coupling, but I am sure that Miro will be tearing his hair out at the thought that the solution is more threads!

UML 2.2 specified 14 types of diagram, state-machine being just one, so there is no need to learn UML in its entirety. It is used in this case because it is a well defined model with clear syntax and semantics, suitable for defining behavioural detail. State-machine diagrams (or state-charts) are probably the easiest UML behavioural diagrams to understand, and have the most clearly defined semantics of any UML diagram.

I did not try the tool but if you get UML diagrams then it is always better for your project documentation. Code generation from UML is now pretty good using Class diagrams and I suppose it could be the same for the other diagrams.

Janusz Dobrowolski

One approach which may satisfy your needs is presented on http://www.StateSoft.org It uses very small but functionally complete subset of UML – if you look at the set of graphical API’s at State Machine Gallery, you will learn needed subset of UML SM notation intuitively in matter of minutes. For the efficiency of embedded system memory usage highly optimized table is produces. Depending if you use C or C++, you choose compact table executer.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!