Harold Hallikainen wrote: > So... that's the way I did multitasking, but not on a PIC! On the > PIC, I just have a state variable for each task. Each task always > starts with a jump table to get to where it left off. Not as clean as > storing the PC... You can implement restricted cooperative multitasking on a PIC 16, with the restriction being that TASK_YIELD be a macro that may only be invoked from top level code (not in any subroutines), and that the data stack be empty at the time. See the CMD module of the HOS project at http://www.embedinc.com/pic for an example. ****************************************************************** Embed Inc, Littleton Massachusetts, (978) 742-9014. #1 PIC consultant in 2004 program year. http://www.embedinc.com/products -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist