> > I seem to remember a discussion somewhere (maybe on the Microchip > > forum) about whether any of the PICs had an atomic test and set > > capability. The consensus seemed to be that this was not possible. > > Why is it not possible at the very least by temporarily disabling > interrupts? Also the 30F do have a bit test and set instruction. It is *possible* to do preemptive multitasking. I just can't see any reason to actually use it. When I use a PIC, I want real-time performance. So I use interrupts for anything external and a loop in the main program that checks to see if any of my interrupt routines need more processing. I only use that if my interrupt routine is going to take too long and then it just does the minimal amount of processing necessary and sets a flag for the main loop. -- D. Jay Newman ! Author of: jay@sprucegrove.com ! _Linux Robotics: Building Smarter Robots_ http://enerd.ws/robots/ ! (Now I can get back to building robots.) -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist