or
Sign in to turn on 1-Click ordering.
 
 
Express Checkout with PayPhrase
What's this? | Create PayPhrase
Sorry!
More Buying Choices
26 used & new from $42.35

Have one to sell? Sell yours here
 
   
Practical UML Statecharts in C/C++, Second Edition: Event-Driven Programming for Embedded Systems
 
 
Tell the Publisher!
I’d like to read this book on Kindle

Don’t have a Kindle? Get your Kindle here.
 
  

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

~ (Author)
Key Phrases: single inheritance, programmable interrupt controller, dining philosopher problem, Real-Time Framework Implementation, Reference Manual, Preemptive Run-to-Completion Kernel (more...)
5.0 out of 5 stars  See all reviews (7 customer reviews)

List Price: $49.95
Price: $44.95 & this item ships for FREE with Super Saver Shipping. Details
You Save: $5.00 (10%)
o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o
In Stock.
Ships from and sold by Amazon.com. Gift-wrap available.

Want it delivered Tuesday, November 10? Choose One-Day Shipping at checkout. Details
19 new from $42.35 7 used from $59.22

Frequently Bought Together

Customers buy this book with Real Time UML Workshop for Embedded Systems (Embedded Technology) by Bruce Powel Douglass

Practical UML Statecharts in C/C++, Second Edition: Event-Driven Programming for Embedded Systems + Real Time UML Workshop for Embedded Systems (Embedded Technology)
  • This item: Practical UML Statecharts in C/C++, Second Edition: Event-Driven Programming for Embedded Systems by Miro Samek

    In Stock.
    Ships from and sold by Amazon.com.
    This item ships for FREE with Super Saver Shipping. Details

  • Real Time UML Workshop for Embedded Systems (Embedded Technology) by Bruce Powel Douglass

    In Stock.
    Ships from and sold by Amazon.com.
    This item ships for FREE with Super Saver Shipping. Details


Customers Who Bought This Item Also Bought

Practical Statecharts in C/C++: Quantum Programming for Embedded Systems with CDROM

Practical Statecharts in C/C++: Quantum Programming for Embedded Systems with CDROM

by Miro Samek
MicroC OS II: The Real Time Kernel (With CD-ROM)

MicroC OS II: The Real Time Kernel (With CD-ROM)

by Jean J. Labrosse
4.7 out of 5 stars (27)  $72.76
Embedded Linux Primer: A Practical Real-World Approach

Embedded Linux Primer: A Practical Real-World Approach

by Christopher Hallinan
4.9 out of 5 stars (12)  $28.34
USB Complete: The Developer's Guide (Complete Guides series)

USB Complete: The Developer's Guide (Complete Guides series)

by Jan Axelson
4.0 out of 5 stars (54)  $34.62
The Definitive Guide to the ARM Cortex-M3 (Embedded Technology)

The Definitive Guide to the ARM Cortex-M3 (Embedded Technology)

by Joseph Yiu
3.5 out of 5 stars (8)  $47.65
Explore similar items

Editorial Reviews

Book Description

Streamline your embedded code projects with just one book - Miro Samek presents UML statecharts - a practical, time-saving design methodology!


Product Description

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.
This 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

Product Details


More About the Author

Miro Samek
Discover books, learn about writers, read author blogs, and more.

Visit Amazon's Miro Samek Page

Inside This Book (learn more)

What Do Customers Ultimately Buy After Viewing This Item?

Practical UML Statecharts in C/C++, Second Edition: Event-Driven Programming for Embedded Systems
93% buy the item featured on this page:
Practical UML Statecharts in C/C++, Second Edition: Event-Driven Programming for Embedded Systems 5.0 out of 5 stars (7)
$44.95
Practical Statecharts in C/C++: Quantum Programming for Embedded Systems with CDROM
2% buy
Practical Statecharts in C/C++: Quantum Programming for Embedded Systems with CDROM 4.1 out of 5 stars (21)
Programming Embedded Systems: With C and GNU Development Tools, 2nd Edition
2% buy
Programming Embedded Systems: With C and GNU Development Tools, 2nd Edition 3.9 out of 5 stars (7)
$42.33
An Embedded Software Primer
1% buy
An Embedded Software Primer 4.3 out of 5 stars (29)
$33.84

Tags Customers Associate with This Product

 (What's this?)
Click on a tag to find related items, discussions, and people.
 
(3)
(2)
(1)

Your tags: Add your first tag
 

Sell a Digital Version of This Book in the Kindle Store

If you are a publisher or author and hold the digital rights to a book, you can sell a digital version of it in our Kindle Store. Learn more

 

Customer Reviews

7 Reviews
5 star:
 (7)
4 star:    (0)
3 star:    (0)
2 star:    (0)
1 star:    (0)
 
 
 
 
 
Average Customer Review
5.0 out of 5 stars (7 customer reviews)
 
 
 
 
Share your thoughts with other customers:
Most Helpful Customer Reviews

 
6 of 6 people found the following review helpful:
5.0 out of 5 stars Required reading for "old school" embedded systems programmers!, December 29, 2008
By Rob Wehrli (Knoxville, TN) - See all my reviews
(REAL NAME)   
If you are an accomplished or aspiring embedded systems programmer and resort to the "superloop" as your foremost implementation method, you absolutely MUST read this book.

While not new concepts to the industry, the concepts presented in Miro's book are certainly not commonplace in many of the embedded systems code I've seen over many years in the industry.

While UML makes for a clean, now defacto standard for presenting concepts, the real beauty in Miro's book is the use of a readily-available frameworks for immediately adopting the many lessons-learned and provided in the book. These complete, well written and excellently coded frameworks are available under the GPL and an alternate, low-cost license for those who wish to keep their code private.

For strong C programmers, the implementation of the frameworks is a delight as one reads through the code and is treated to an incredibly simple, lightweight and extremely powerful system that will forever put an end to your future plans to "superloop" again--albeit for any system where C (or C++) is adequately supported by the hardware. For anyone admitting that "we've always done superloop and it has always worked in the past," get ready for a real-time, highly responsive system that actually IS event driven and thrives in as little as a few bytes of RAM and perhaps a K of ROM.

For those who must hold on to the "superloop is king" mindset, consider the consequences of adding to your superloop an entirely new set of features and how that may affect the timing through your loop. I started with the "dining philosophers" example code discussed in the book and ported it to my own board (using a Reneasa H8S-2166 microcontroller) and augmented the code to be responsive to external events (mechanical switches). This required software debouncing. While my "example" was somewhat "trivial" in terms of what the functionality actually did, it is, in my opinion, extremely typical of changing requirements of both new and legacy code in the day-to-day evolution of embedded systems programming.

My changes to the example code were to implement a "bike light" feature set. That is, whenever a switched was pressed, the bike light--if off--would illuminate. An LED on the board was used for this purpose. Pressed again, the light would blink. Pressed and held for 1 second while on or blinking, the light would turn off.

The typical implementation in superloop would often require a considerate approach to ensure that the new functionality was "injected" into the "right" part of the loop, so as to be of minimal impact to other areas of critical timing code. If any kind of action within the new code delayed the loop processing, then the whole of the superloop could come under further scrutiny and therefore cause more pain as one trials and tests system responsiveness on a number of potential new fronts.

Atop of this new functionality, the frameworks-provided QSpy code instrumentation system, which allows one to have a stream of information about the system states and transitions, was ported to use a UART on the H8S. Imagine adding all of this new functionality in a traditional superloop body of code. Now, imagine adding it in a matter of perhaps two hours using the frameworks AND not adversely impacting the "legacy" application code at all!

One of the most beautiful aspects of these frameworks is the ability to focus strictly on the code necessary for the task at hand instead of the entire system as a whole. The frameworks substantially frees the programmer from having to manually manage system responsiveness typical of the superloop.

Using UML to design and document an embedded system is relatively new to many embedded systems programmers. Miro also provides a free download stencil set for MS Visio for easily implementing statecharts, which should help those interested in pursuing the many benefits of the technology included in this book.

I first met Miro at a developer's conference in San Diego, CA. One thing that comes out in his book and his discussions of this exciting technology is his passion for it. I was very interested in it, as he was displaying his software running on a very resource constrained microcontroller--all in about 40 bytes of RAM or a bit less.

Drawn to his topic by his enthusiasm, I admired the frameworks even more as I began looking at the implementation and design of the code. The entire C bundle, with royalty-free 'private commerical use' license, one of either cooperative or preemptive schedulers (both are provided), event processor, code instrumentation support and more is all for under $2K. Of course, one may explore the entire frameworks for the cost of only a free download before ever making a licensing decision for a given product.

Combined with the low-cost solution of using such powerful frameworks in conjunction with learning the valuable content of this book, teams everywhere can exploit the years of experience and very robust, capable code in a matter of hours instead of weeks, months and even years of doing things the "old school" way using superloops and other facilities instead of truly event-driven designs.

This book and the free QF download are your entry into the 21st century of embedded systems programming. Because the code is provided in C, porting is rather easy and running on embedded systems and desktop systems is practical and easy. I was able to build and run the code as provided without modifications on my Linux, Mac and Windows systems and on the H8S and a Microchip PIC 24 with only a minimalist porting effort of about a half a day in each case. Imagine being able to run an entire real-time system that features excellent extensibility while freeing you from the rigors of managing superloop timing on your own hardware all within a few hours. Then, spend a couple of hours extending the system without impacting the rest of it? Lather, rinse, repeat...it is truly that simple and robust.

Best of all, this book will open your eyes to modern methods and concepts for programming event-driven embedded systems. That is, systems that respond to internal and external events that naturally occur in all embedded systems designs. It is my firm belief that after reading this book and exploring the code on your own, you'll discover why I so heartily endorse it and now share the passion Miro has for this wonderful, very lightweight but robust, complete solution for modern embedded systems programming.
Comment Comment | Permalink | Was this review helpful to you? Yes No (Report this)



 
4 of 4 people found the following review helpful:
5.0 out of 5 stars Dr. Miro Samek does it again with this new 2nd edition!, June 13, 2009
By Thanh Tieu (Los Angeles, CA USA) - See all my reviews
(REAL NAME)   
I first met Dr. Samek at the Embedded Systems Conference in San Francisco, CA. I was drawn in by how simple his QP infrastructure was. Immediately upon reading the 1st edition of his book, I was able to get an embedded system up and running. Not only was the source code helpful, but the examples in the book provided real world applications. With this new 2nd edition, there are even more real world examples to learn from. In addition, the examples are utilizing many different MCU's - e.g. MSP430, ARM Cortex-M3, 80x86, etc.

I have used QP during the last few years both in the professional arena and as a hobbyist. Still today, the state machine framework is executing flawlessly. The concept of having decoupled state machines used to be mainly in academia while industry was more observant of the typical main() + ISR environments. But the trend is moving more toward event driven programming. UML in general can be rather convoluted with nomenclature and semantics that leave the developer questioning what they are getting themselves into. But with QP, the framework is simplified to the point where the developer only focuses on the actual application and need not worry about the underlying kernel, queuing mechanisms, tasks, etc. However, if the developer decides to understand what is executing 'under the hood' per se, the book goes through in detail all the intricacies of the infrastructure.

Furthermore, the GNU GPL provides a great way for new comers to view the source code and see what the platform is all about.

I will not repeat all the details of the book as previous reviewers have. However, I will note that this book is as comprehensive as can be for any embedded engineer who is interested in developing in a revolutionizing environment. Kudos to Dr. Samek!
Comment Comment | Permalink | Was this review helpful to you? Yes No (Report this)



 
4 of 4 people found the following review helpful:
5.0 out of 5 stars An Indispensable Embedded Systems Classic!, December 18, 2008
This book took me from being a C programming novice, to writing 1000s of lines of embedded control systems code, that has been running reliably for several years, with just one bug - my own! This book has been an indispensable resource to me in my work.

Embedded systems programming can be such a perilous task, riddled with potential pitfalls an mistakes that can lead to potentially catastrophic bugs that are virtually impossible to track down. Throughout the text, important practical lessons and good design practices are shared, based on years of real-world experience, which can save novices from countless hours of painful debugging.

The book is amazingly thorough, not only showing you "how", but also teaching you "why". All of the details of the framework and its implementation are clearly described, and the source code is available in the book and online, ready for immediate use on real applications.

Samek does a truly masterful job of constructing an extremely lean yet very powerful framework for safe embedded systems programming. The approach is based on both on proven practical and solid academic foundations, such as: actor oriented programming, UML statecharts, publish-subscribe, design patterns, realtime operating systems, design by contract, etc.

This second edition contains a lot of new material, including: new support for software tracing in event driven systems, along with interfaces to Matlab; a new chapter on QP-nano, an ultra-lightweight event driven infrastructure, that can run on low-end 8- and 16-bit MCUs; the first chapter, which introduces the main ideas and techniques in the book via real-time fly&shoot game was so much fun to read; and numerous new explanations. In addition, the emphasis has shifted from C++ to C, with C++ codes available online. The first edition hit the markets around 2002, and became and instant classic; this second edition will no doubt continue that trend.

- H.H., (Xerox) PARC.
Comment Comment (1) | Permalink | Was this review helpful to you? Yes No (Report this)


Share your thoughts with other customers: Create your own review
 
 
 
Most Recent Customer Reviews

5.0 out of 5 stars Critical Read for all Software Developers, not Just Embedded Systems Developers
Reading the other reviews, one might get the impression that this book is mostly geared to embedded systems. Read more
Published 2 months ago by Jonathan Kaye

5.0 out of 5 stars This is a really good book
Many years ago Finite State Machine concept saved my life in an embedded software project. Thanks to this practical experience I realized how powerful the state machine concept... Read more
Published 5 months ago by Cezary Zieniewicz

5.0 out of 5 stars framework-based software tracing
I had the pleasure to get my hands on this book before my talk at the Embedded World Conference about debugging and avoiding bugs [[... Read more
Published 7 months ago by Robert Berger

5.0 out of 5 stars Many years , one book ! ..simply a best seller book ...
For guys, like me, who has spent the last years searching, and coding at the same time!, for a way to generate powefull realtime, scalable, elegant, cost eefctive (memories size)... Read more
Published 9 months ago by Ricardo D. Raupp

Only search this product's reviews



Customer Discussions

This product's forum
Discussion Replies Latest Post
Companion websites 0 January 2009
See all discussions...  
Start a new discussion
Topic:
First post:
Prompts for sign-in
 


Active discussions in related forums
Search Customer Discussions
   




Product Information from the Amapedia Community

Beta (What's this?)


Look for Similar Items by Category


Look for Similar Items by Subject

 

Feedback

If you need help or have a question for Customer Service, contact us.
 Would you like to update product info or give feedback on images?
Is there any other feedback you would like to provide?

Your comments can help make our site better for everyone.


Your Recent History

 (What's this?)

After viewing product detail pages or search results, look here to find an easy way to navigate back to pages you are interested in.