State Machines
What are they, how do they work and how can I use them?
The eBook provided here takes you through the basics of what a state machine is, how it can be described by state diagrams and how to write code as a state machine. This eBook is a work in progress so far it contains:
Introduction to State Diagrams
Developing a state machine
Implementing state machines in software
Using groups of conditional statements
Table driven state machine
Benefits of using a small core dispatcher
Multiple interacting state machines
Table driven inefficiencies
Complete example of a table driven state machine
Critical event order
Step by step debugging using a state diagram
Reducing multiple states to a single state
The event queue
Generating events during an interrupt
Multiple interacting state machines (I2C multi-master)
If you find this eBook useful then please place a link to this web page on your web site. Not the eBook itself as it is still being updated and links to it may get broken.
Last updated: 2008-5-16