Matthew Miller
2017-10-14 20:47:42 UTC
Hi everyone,
I've still been working on a wireless sensor network. The receiver is
complete and while working on the sensor nodes it seemed that a finite
state machine would be a good way to organize the code (this is being
done in asm). There's a lot of boiler plate code though and I went off
on a tangent to solve that problem.
What I ended up with is using scxmlgui to draw the state machine and
use a python program to generate the assembly and include files from
the XML description. The process works pretty well. After designing
the state machine, the only implementation detail are the routines for
each state and updating the event variable.
I'm using this with a 16F88, but modification for 18F is possible. The
code is at:
http://matthew-miller.name/pic-fsm/pic_fsm_gen.tar.gz
There's a state machine XML specification and I started out crafting
the XML by hand (not too fun). But I found the scxmlgui program and
it's a fairly good graphical designer. Hopefully this will be a useful
idea to folks.
Take care.
Matthew
I've still been working on a wireless sensor network. The receiver is
complete and while working on the sensor nodes it seemed that a finite
state machine would be a good way to organize the code (this is being
done in asm). There's a lot of boiler plate code though and I went off
on a tangent to solve that problem.
What I ended up with is using scxmlgui to draw the state machine and
use a python program to generate the assembly and include files from
the XML description. The process works pretty well. After designing
the state machine, the only implementation detail are the routines for
each state and updating the event variable.
I'm using this with a 16F88, but modification for 18F is possible. The
code is at:
http://matthew-miller.name/pic-fsm/pic_fsm_gen.tar.gz
There's a state machine XML specification and I started out crafting
the XML by hand (not too fun). But I found the scxmlgui program and
it's a fairly good graphical designer. Hopefully this will be a useful
idea to folks.
Take care.
Matthew
--
http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist
http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist