How to illustrate an interrupt-driven process?

kjgregory picture kjgregory · Jul 3, 2014 · Viewed 7.9k times · Source

This question is related to diagraming a software process. As an electrical engineer, much of the software I do is for embedded micro-controllers. In school, we learned to illustrate our algorithm using a flowchart. However, nowadays, many of my embedded projects are heavily interrupt-driven where the main process runs some basic algorithm a variety of interrupt sources provide its stimulus. So, my question is, what are some diagramming techniques that I can use to illustrate my process such that future developers can understand what I am doing easily and get involved in development?

Here are some key features that I am looking for:

  • Shows data structures and how data is passed between processes & interrupts
  • Shows conditions that cause each interrupt
  • Shows how data is gathered and passed through a downlink
  • Shows how command messages are received, parsed, and executed
  • Ideally is well suited for hierarchical breakdown into smaller processes with greater levels of detail

Answer

embedded.kyle picture embedded.kyle · Jul 3, 2014

I've always seen interrupt timing drawn as follows:

interrupt timing diagram

Or inline line so:

inline timing

But I prefer the former as it gives more room for annotation.


In response to your comment, perhaps a UML state machine diagram (with some adaptation) may be closer suited to your purpose:

UML state machine