On Thu, 7 Feb 2008, Eduardo Garcia wrote: > Hello Sergio, > > Yes, it really seems what can solve my problem. I will research more about > state machines. > > Could you point me any reference, book, link or anything else? > > Thanks, > Eduardo Garcia > Hi Eduardo, There are some tools around that will let you draw state diagrams and generate code from them. Most of these are not optimised for small MCUs. They generate C or C++ code which you then need to compile into an executable. There is a version of ZMech that will generate optimised PIC (14 bit core) assembler. It supports direct interactive debugging of the generated state machine executable (you can toggle a virtual input and watch the path the state machine takes on the diagram, see a change in a virtual output and trace the code execution via the built-in simulator - all at the same time). You can see a bit more about ZMech here: http://www.xcprod.com/titan/ZMECH_PIC and a bit more interesting PIC related stuff here: http://www.xcprod.com/titan/ZMECH-DOC/generate/state-machine/block-indx.html Regards Sergio Masci http://www.xcprod.com/titan/XCSB Optimising Structured PIC BASIC compiler FREE for personal non-commercial use -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist