In response to: > Andrew E. Kalman, Ph.D. > Salvo(TM), The RTOS that runs in tiny places(TM) > As a data point, Salvo on a PIC16C77 doing fully priority-and > event-based cooperative multitasking context-switches at around 2500 > context switches/sec with a 4MHz crystal / 1us instruction cycle. > That's written entirely in C. I didn't say it wasn't possible, only that it was not a good idea. Your own statement confirms this if I understand it right. I assume by 2500 context switches you mean that the tasks are doing nothing but immediately yeilding the processor to the next task. If so, that means it takes Salvo 400 instruction cycles to switch between tasks. This sounds VERY high. I have occasionally used macros for this on the 16C family, and I doubt they even take 40 instructions. I imagine this huge discrepancy comes from the fact that you are writing a general RTOS that has to be ready for anything, whereas my macros do just what I need them to and otherwise get out of the way as quickly as possible. What this really points out is the absurdity of trying to use an RTOS on processors like the 16xxx PIC family. Your statement "fully priority-and event-based cooperative multitasking context-switches" might leave some people with the wrong impression. Since the software can't access the stack on the 16xxx family, there must be some restrictions on your tasks. I imagine you can't "call" YIELD inside a subroutine, right? Or do you get around the stack access problem in a different way that results in different restritions? ******************************************************************** Olin Lathrop, embedded systems consultant in Littleton Massachusetts (978) 742-9014, olin@embedinc.com, http://www.embedinc.com -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.