Bruce Partridge wrote : > I can't think of any other way to do this > other than to simulate multitasking with interrupts. Yes, but while *inside* an ISR, you are actualy single-tasking all the way until you exit the ISR. That's why one should try to leave the ISR as soon as possible, to be able to serve other tasks. And if there are syncronizing problems (such as reading and writing the value bytes) this can be solved by disabling GIE for a moment during the read. The writes to these bytes are done while "single-tasking" inside the ISR, so there is no syncronizing problem there. > Basically, I am using the interrupt to simulate > pre-emptive multitasking. Nice, but I'm not sure that's the most effective way to run a PIC. Jan-Erik. -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body