> DEBUG_ROLL=TIMERS[ID].ROLLOVERS_LEFT; > > ** Interrupt occurs here ** > > DEBUG_ELAPSED=TIMERS[ID].ELAPSED; > DEBUG_TIME=TIMERS[ID].TIME; > > When the return from interrupt occurs, ID is now 0. So the code ends up > indexing the wrong element of the array... Sounds like the interrupt is trashing some state. Is the interrupt routine saving/restoring FSR? Take a look at the assembly code generated for the lines above and see what resources it uses. ***************************************************************** Olin Lathrop, embedded systems consultant in Devens Massachusetts (978) 772-3129, olin@embedinc.com, http://www.embedinc.com -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu