Site Map | Contact Us
Quantum Leaps - innovating embedded systems Toll-free: 1-866-450-LEAP
QP state machine frameworks for embedded systems


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

buy from amazon.com
PSiCC2 and Development Kits from Luminary Micro and TI
Author: Miro Samek
ISBN-10: 0750687061
ISBN-13: 978-0750687065
Category: Embedded Systems / Programming / Software
Publisher: Newnes (imprint of Elsevier)
Published: October 1, 2008
Paperback: 728 pages
Cover Price: $49.95

Read excerpts in PDF... Read excerpts in PDF
Accompanying code
Related tools and resources
About the book...
About the audience...
About the Author...
Choose the best online deal...
amazon.com
BestBookDeal.com
FetchBook.info
BooksPrice.com
Buy from Elsevier

Accompanying Code


 LICENSING

The software accompanying the book Practical UML Statecharts in C/C++, Second Edition (ISBN: 0750687061) may be distributed and modified under the terms of the GNU General Public License version 2 (GPL2) as published by the Free Software Foundation. Please note that GPL2 Section 2(b) requires that all works based on this software must also be made publicly available under the terms of the GPL2 ("Copyleft").

Alternatively, this software may be distributed and modified under the terms of Quantum Leaps commercial licenses, which expressly supersede the GPL2 open source license and are specifically designed for licensees interested in retaining the proprietary status of their code.


Self-extracting Self-extracting Windows executable (19.3MB)
  • QP/C v4.0.02
  • QP/C++ v4.0.02
  • QP-nano v4.0.02
  • Hyper-linked Reference Manuals in HTML and .CHM formats
  • all examples described in the book
  • Visio Stencil for drawing UML diagrams
ZIP Platform-independent ZIP (19.2MB)
  • QP/C v4.0.02
  • QP/C++ v4.0.02
  • QP-nano v4.0.02
  • Hyper-linked Reference Manuals in HTML and .CHM formats
  • all examples described in the book
  • Visio Stencil for drawing UML diagrams
to topTop of page

Related tools and resources

The following table provides the links for downloading all the tools used in the book as well as other resources.

Download free Borland Turbo C++ 1.01 Much of the code accompanying the book is highly portable C or C++ independent really on any particular CPU, operating system, or compiler. However, to focus the discussion, most of the executable examples provided in the code run in a DOS-console under any variant of Windows. The legacy 16-bit DOS has been chosen as a demonstration platform because it allows programming a standard x86-based PC at the bare-metal level. Without leaving your desktop, you can work with interrupts, directly manipulate CPU registers, and directly access the I/O space. No other modern 32-bit development environment for the standard PC allows this much so easily.

The additional advantage of the legacy DOS platform is the availability of mature and free tools. To that end, the examples are compiled with the legacy Borland Turbo C++ 1.01 toolset, which is available for a free download from Borland.

QP state machine frameworks
QP state machine frameworks for Cortex-M3
To demonstrate modern embedded systems programming with QP, the book includes examples for ARM Corterx-M3. The book describes the QP port to Cortex-M3 with the cooperative kernel in Chapter 8, but the port to the preemptive QK kernel is not explained. The Quantum Leaps Application Note "QP and ARM Cortex-M3" describes in detail all aspects of using QP with ARM Cortex-M3 processors.

EKI-LM3S811 kit To demonstrate modern embedded systems programming with QP, the accompanying code includes examples for the inexpensive ARM Corterx-M3-based Stellaris EKI-LM3S811 evaluation kit form Luminary Micro. The Cortex-M3 examples use the exact same source code as the DOS counterparts, and differ only in the Board Support Package (BSP).

Download free IAR EWARM KickStart The Cortex-M3 examples require the 32KB-limited KickStart edition of the IAR EWARM toolset version 5.11, which is included in the Stellaris kit and is also available for a free download from IAR.

Linux Cygwin Some examples in this book run on Linux, as well as any other POSIX-compliant operating system, such as BSD, QNX, Max OS X, or Solaris. You can also build the Linux examples on Windows under Cygwin.
eZ430-F2013 kit To demonstrate really small, ultra-low power embedded system, Chapter 12 of the book describes QP-nano examples for the inexpensive MSP430-based eZ430-F2013 USB Stick from Texas Instruments. The MSP430 examples use the free 4KB-limited KickStart edition of the IAR EW430 toolset.

Micium uC/OS-II The book uses the Micrium µC/OS-II as an example for porting QP to a conventional RTOS. µC/OS-II has been chosen, because it is superbly documented in the excellent book "MicroC-OS-II The Real Time Kernel" by Jean J. Labrosse.

Visual Basic Calculator Example Chapter 2 of the book discusses the Visual Basic calculator sample application that shipped in millions of copies with Microsoft Visual Basic. The provided ZIP file contains the calculator source code, the executable, and the Visual Basic DLL required to run the example.

Download free QP Development Kits QP Development Kits contain QP ports to various CPUs, operating systems, and compilers. Please keep checking this webpage, as new ports are added frequently.

Free support and discussion Search our free support discussion forum on SourceForge.net for answers or post your questions to the QP community.

to topTop of page

About the book...

Practical UML Statecharts in C/C++, Second Edition bridges the gap between high-level abstract concepts of the Unified Modeling Language (UML) and the actual programming aspects of modern hierarchical state machines (UML statecharts). The book describes a lightweight, open source, event-driven infrastructure, called QP that enables direct manual coding UML statecharts and concurrent event-driven applications in C or C++ without big tools.

The book is presented in two parts. In Part I, you get a practical description of the relevant state machine concepts starting from traditional finite state automata to modern UML state machines followed by state machine coding techniques and state-machine design patterns, all illustrated with executable examples. In Part II, you find a detailed design study of a generic real-time framework indispensable for combining concurrent, event-driven state machines into robust applications. Part II begins with a clear explanation of the key event-driven programming concepts such as inversion of control (Hollywood Principle), blocking versus non-blocking code, run-to-completion (RTC) execution semantics, the importance of event queues, dealing with time, and the role of state machines to maintain the context from one event to the next. This background is designed to help software developers in making the transition from the traditional sequential to the modern event-driven programming, which can be one of the trickiest paradigm shifts.

The lightweight QP event-driven infrastructure goes several steps beyond the traditional real-time operating system (RTOS). In the simplest configuration, QP runs on bare-metal microprocessor, microcontroller, or DSP completely replacing the RTOS. QP can also work with almost any OS/RTOS to take advantage of the existing device drivers, communication stacks, and other middleware. The accompanying website to this book contains complete open source code for QP, ports to popular processors and operating systems, including 80x86, ARM Cortex-M3, MSP430, and Linux, as well as all examples described in the book.

Focuses on core concepts rather than tools which are always changing allowing the reader to continue to use this information with various projects
Provides a complete, ready-to-use, open source software architecture for small and large embedded systems
Includes an extensive example using the ARM Cortex-M3 throughout the book highlighting issues programmers and architects encounter in everyday life
to topTop of page

About the audience...

Practical UML Statecharts in C/C++, Second Edition is intended for the following software developers interested in event-driven programming and modern state machines:

Due to the code-centric approach, this book will primarily appeal to software developers tasked with creating actual, working code, as opposed to just modeling. This book does not provide yet another CASE tool. Instead, this book is about practical, maintainable coding techniques for UML state machines, and about combining concurrent state machines into robust event-driven systems by means of a real-time framework.

to topTop of page

About the Author...

Dr. Miro Samek is founder and president of Quantum Leaps, an open source company providing lightweight, state machine-based, event-driven application frameworks for embedded systems. He is the author of Practical Statecharts in C/C++ (CMP Books, 2002), has written numerous articles for magazines, including a column for C/C++ Users Journal, is a regular speaker at the Embedded Systems Conferences, and serves on the editorial review board of the Embedded Systems Design magazine. For a number of years, he worked in various Silicon Valley companies as an embedded software architect and before that he worked as an embedded software engineer at GE Medical Systems (now GE Healthcare). Dr. Samek earned his Ph.D. in nuclear physics at GSI (Darmstadt, Germany).

Miro Samek

to topTop of page

Last updated: November 15, 2008