> interrupt: > save STATUS to primary save area > save PCLATH to primary save area > set PCLATH to zero > is it the high priority interrupt ? > YES: > save additional stuff, like FSR perhaps to primary area > handle the interrupt > restore state from primary save area > RETFIE > NO: > move saved STATUS, PCLATH to secondary save area > save additional stuff, like FSR perhaps to secondary area > determine which interrupt it is and jump to handler routine > END > > Each low priority interrupt handler routine: > clear the interrupt condition > re-enble interrupts > handle the interrupt > goto restore_low_priority_interrupt > > restore_low_priority_interrupt: > restore additional stuff like FSR from secondary save area > restore PCLATH and STATUS from secondary save area > RETURN I just read my earlier response and realized that this is wrong. You do need a separate save area for each low priority interrupt, since a low priority interrupt could be interrupted by another low priority interrupt in this scheme. ******************************************************************** Olin Lathrop, embedded systems consultant in Littleton Massachusetts (978) 742-9014, olin@embedinc.com, http://www.embedinc.com -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu