Hello all, Just browing around the piclist.com site a little.. According to http://www.sxlist.com/techref/microchip/multitasking.htm pre-emptive multitasking on a p16 core is not likely possible. However, I think that it should be able to be done, because, if I were to setup an interrupt to be every X cycles, and have a state variables for each task, in the interrupt I would be able to save the state of status and w, and goto to the next routine. Say the tasks are 1,2,3.. step 0: Begin running routine 1 step 1: Interrupt routine 1, goto routine 2, step 2: Interrupt routine 2, goto routine 3, step 3: Interrupt routine 3, goto routine 1, step 4: Interrupt routine 1, return to routine 3, step 5: Interrupt routine 3, return to routine 2, step 6: Interrupt routine 2, return to routine 1, step 7: repeat from step 1. Granted, this limits the call depth, but it should work nonetheless. The routines would receive equal amounts of time per second, but not the same position in time.. Like this: 123 132 123 132, they are out of sequence, for lack of a better explanation. -- andrew -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist