Thanks for your comments Tamas. I read the mid-range manual and checked for errata. The the usual save/restore context code is in place and the ISR exits with retfie. I just took the TMR1IE disable/enable code out of my completed code, and found it works fine! The first revision had the strange bug, but not any more. I tried to reproduce what I had seen, but could not. My best guess is that in the old code the RP0 bit was not reset by preceding code on the first ISR pass as it should have been. Kevin Timmerman At 05:33 AM 8/1/2006, you wrote: >Kevin, > >I think the interrupt stuff is more precise documented in the "PICmicro >MID-Range MCU Family" documentation (310??a.pdf, interrupts are discussed in >31008a.pdf). > >They said you do not have to do such tricks, just clear the TMR1IF at the >end of the handler. They advise that you have a good structure of your ISR >like this: > >1. save the state of the MCU (W register + STATUS & whatever you need) >2. poll which interrupt occurs and jump to the relevant handler routine >3. at the end of the handler clear the interrupt flag so that you are >ready for the next interrupt to be occur >4. restore state of the MCU >5. return from the interrupt > >If timer interrupt occures while you are staying at the ISR it will >automatically carry on (no recursive interrupt) until you return with >RETFIE(which re enables interrupts). At that point after 1 cycle the timer >interrupt calles your ISR, so that the timer interrupt will not lost. Your >polling routine tells you which interrupt occured so will jump to your timer >ISR... > >If you touch the GIE by yourself all the interrupts in the queue will be >lost! u -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist