> Well, the nature of my app is that everything is scheduled, so the main > routine is just loop:goto loop. > ... > I pretty much invented my own scheduling routine. > Couldn't find zippo on the subject @ Microchip. Suggestions eagerly > accepted. I like to use a different approach. The interrupt routine handles anything that is time-critical. The main code handles the less time critical tasks by running in a loop looking for any of a list of things that need service. Quite often the interrupt routine handles some immediate issue, then sets a flag for the main routine to handle the rest of the issue when it gets around to it. For example, the interrupt routine might service the UART receive condition and put the incoming byte into a FIFO. Them main code looks for the FIFO being non-empty and handles an input byte when there is one. Meanwhile more byte can come in from the UART and the interrupt is free to service other high priority issues. For an example, see HAL_MAIN.ASPIC at http://www.embedinc.com/pic/hal.htm. ******************************************************************** Olin Lathrop, embedded systems consultant in Littleton Massachusetts (978) 742-9014, olin@embedinc.com, http://www.embedinc.com -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads