Isaac Marino Bavaresco wrote: >> A mechanism to ensure the state machine is called periodically. > > Call it from the main loop every iteration. If it doesn't have > anything to do it just returns and takes very little CPU time. Or make it a separate task. All task call TASK_YIELD periodically, which lets all other tasks run once. I don't mean anything fancy, just a simple cooperative round-robin tasking system. Such a system is available in my PIC development environment. See QQQ_TASK.ASPIC and TASK.INS.ASPIC in the SOURCE > PIC directory after installation. ******************************************************************** Embed Inc, Littleton Massachusetts, http://www.embedinc.com/products (978) 742-9014. Gold level PIC consultants since 2000. --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .