Friday, August 28, 2009

State machines - standard to code

Under the idea that a picture, or maybe three, is worth a thousand words, I thought I would provide an example of why the state machines need not be all that large. (And I hope Blogspot will leave them large enough to read.) Here is a snippet of the MS/TP Master Node State Machine from BACnet-2008:

Now for my PIC12 project I first wrote the code in C and tested that.

Then, because the PIC12 was a small processor with a number of limitations including a very small (4 level?) stack, I hand-coded from C into assembly:

No comments:

Post a Comment