Phillip wrote : > I don't know about making sense but it does fix my problem. > I have two ISR's in my program. That are called from some common interrupt entry point ? Or how are they entered ? > One is a timer that expires so I can check/scan/de-bounce > button presses and the other receives characters on the > first serial port. The second is triggered by the USART interrupt, right ? > Below is the code of my timer/button ISR routine below. > Look at the first line. OK : > PIR2bits.TMR3IF = 0; //disable the timer3 interrupt The comment is wrong and shows a slight missunderstanding of the way interrupts works. "clear TMR3 interupt flag" is right. That does *NOT* "disable" anything. > If I comment it out my program will no longer work. Of course. > If I halt the debugger whilst it is commented out it stops in > this routine that is being called over and over... Of course. >....because the hardware is transferring control to this routine? > I do believe that it is doing a retfie (underneath) because I > don't enable PIR2bits.TMR3IF on exit and it works fine the next time. Again shows a missunderstanding of how interrupts work. the TMR3IF flag is set whenever the TMR3 overflows. Your code should only clear it (in the ISR). > So I don't believe you when you say that the hardware > disables interrupts during an ISR event... They are. *Read* the chapter on interrupts in the data sheet. > ..now I may be mixing my chickens with my ducks > because my button ISR is a low level ISR and the original > serial IRS was a high level... Are you using high/low interrupt priority ? That makes things a little more complex. Do you realy need that with only two interrupt sources ? > ...but disabling interrupts does fix them both. But you aren't "disabling interrupts" ! > as you can see I'm much clearer > on what fixed it > than what was going wrong.... No, you aren't. > > void detect_button_push_ISR(void) This can't be the main ISR. Doesn't that need some keyword in the function header saying "this is an ISR" ? Best Regards, Jan-Erik. -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist