In my (never-ending) meter counter, I used a "micro-routine task sweeper" [I invented the name, not the concept! 8)]. Anyway, it's a trivial solution, I think. I used the 16f84. All timers are maintained by an Interrupt timer. Resources are managed through semaphores (which are also used to signal end of delays.). Tasks are made to be short. The execution time must be smaller than the maximum latency to answer to a given event. (This is not very annoying, anyway). Since, memory is short, all variables are global. Typical cycles are not closed, but can be. It all depends on the timing constraints (maximum atomic execution time for each task.). Tasks are polled in the main cycle. Since resources are handled through semaphores, tasks can be quite ignorant of what other tasks do. This is quite useful to change code. It worked quite well, and allowed for easy change of code, as I added (and still add) features, and correct bugs. For instance: PORTB is shared between displays and keyboard. Display_number is called, and checks the semaphore. Is PORTB free? No, return. Yes, set flag, display value, start timer (display). Read_keyboard is called. Is PORTB free? No, return. Yes, set flag, read keyboard, start timer (debounce). Bye, Nuno. Michael Shiloh wrote: > > I am very interested in this as a project. I've worked with some trivial > Multitasking executives in the past, and I currently work at Wind River > Systems, writers of a very popular real time OS for embedded applications. > I would very much like to kick around ideas, to develop code, and to test > ideas. Granted, vxWorks (what we sell) is made for 32 bit high end processors, > so I will have to rethink for the PIC world, but I still think I can > contribute to the project. > > If there are objections to using this forum I'd be happy to set up a > mailing list elsewhere for this as a project. > > I'm also happy to discuss this privately, if you wish > Michael Shiloh > Wind River Systems > 510-749-2171 > michaels@wrs.com > alternate email at > michael@srl.org -- ---- ~~~~~~~ ------- Nuno Filipe Freitas Pedrosa -- ~~~~ ~~ ----- SIEMENS S.A. Portugal TEL: +351 1 4242454 - ~~~~ ~~ ---- mailto:Nuno.Pedrosa@icn.siemens.de - ~~~~ ~~ ---- "MSWindows - Best run on a SlideShow" =======================================================================