Practical UML Statecharts in C/C++, 2nd Edition:
Event-Driven Programming for Embedded Systems

PSiCC2 book

The most popular book about UML statecharts and event-driven programming for embedded systems by Quantum Leaps' Miro Samek. This ultimate resource describes all the related concepts and provides a detailed design study of QP frameworks version 4.0.

Publication Date October 1, 2008
Publisher Newnes
ISBN-10 0750687061
ISBN-13 978-0750687065
Available Formats Paperback, Kindle
Available from Most online book sellers, such as,
and many others
Sample Excerpts in PDF

Chinese Translation

Chinese Translation

The complete Chinese translation is available from SourceForge.

Resources and Tools for the Book

The following sections provide the links for downloading all the software and tools used in the book as well as other resources.

  NOTE This book edition covers QP 4.0. Please see Updates+Errata for updates to more recent QP versions.


Updates + Errata

Cross-referenced error corrections and changes made to the QP frameworks since the publication of the book. The PDF document is searchable by page number, section number, and update type. Last updated for QP 4.3.00 (09-Jan-2012).

QP Frameworks

QP Frameworks

QP is is a family of lightweight, open source, active object frameworks described in the book, which are like modern real-time operating systems for executing event-driven active objects (encapsulated hierarchical state machines). The downloads below contain the QP framework source code and all examples described in the book.

QM Tool

QM Modeling Tool

Since the publication of the book, a new modeling tool called QM (QP Modeler) has been developed to support graphical modeling based on the QP frameworks. QM provides intuitive diagramming environment for state machines (UML statecharts) and automatically generates production-quality C or C++ code.

Qtools Collection

Qtools Collection

The QTools Collection contains various open source tools for working with the QP frameworks, such as: (1) QSPY host application, (2) QCLEAN for cleanup of source code files, (3) QFSGEN for generating ROM-based file systems for embedded web servers, and (4) QUDP for testing UDP connectivity. The Qtools for Windows provides also the free open-source C/C++ GNU compiler for Windows (MinGW) as well as the GNU make for Windows and related file utilities (rm, touch, etc.)

EK-TM4C123GXL board

To demonstrate modern embedded systems programming with QP, the accompanying code includes examples for the inexpensive ARM Corterx-M4F-based EK-TM4C123GXL evaluation kit (also known as Tiva-C Series Launchpad) form Texas Instruments.

The complete EK-TM4C123GXL development kit with cables and development tools on CD-ROM is available for $12.99 from many online distributors, such as DigiKey, ARROW, or MOUSER. Once on the distributor's website, you need to search for "EK-TM4C123GXL".

NOTE: The EK-TM4C123GXL board is the replacement for the EK-LM3S811 board, which has been discontinued.


DOS Replaced with Windows

All examples for the legacy 16-bit DOS in the book are replaced in the latest QP frameworks with examples for Windows. This includes the "Fly 'n' Shoot" game example (Chapters 1 and 12), which runs as a Windows GUI application. The Windows examples are located in the directory <qpx>/examples/win32/, where <qpx> denotes the directory into which you have installed QP/C, QP/C++, or QP-nano.

  The free open-source C/C++ compiler for Windows (MinGW) is included in the Qtools Collection.


Visio Stencil

All diagrams in the book have been prepared in Microsoft Visio-2003. The Visio stencil used to make the diagrams is available for a free download below. The Software-UML.vss stencil should work with the newer versions of Visio.