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

PSiCC2 on

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, PDF (see below)
Complete PDF download Download complete book in PDF from SourceForge
Also available from Most online book sellers, such as,
and many others

PSiCC2 Chinese Translation

Chinese Translation

The complete Chinese translation in PDF is available for download 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 collection 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.)

EFM32-SLSTK3401A board

To demonstrate modern embedded systems programming with QP, the accompanying code includes examples for the inexpensive ARM Corterx-M4F-based EFM32-SLSTK3401A evaluation kit (also known as Pearl Gecko Starter Kit) form Silicon Labs.

The complete EFM32-SLSTK3401A development kit with cables and development tools on a flash drive is available for $29.99 from many online distributors, such as DigiKey, ARROW, or MOUSER. Once on the distributor's website, you need to search for "SLSTK3401A".

NOTE: The EFM32-SLSTK3401A 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.