Jinx, I know it is not OK but what could it happen if within ISR there's a GOTO to a Loop that makes microcontroller never goes back to the ISR so as to get to the RETFIE??? And if I enter a ISR, can that ISR be interrupted by a second ISR before former ISR gets to the RETFIE??? I think I've messed it up!! :o) On 9/7/07, Jinx wrote: > > > Something happens at the ISR and subrrutine called Loop has > > to be executed, which is within MAIN. If this loop is entered, > > microcontroller never gets out of this interrupt rutine > > Hi Carol, > > You can call any routine from within the ISR and as long as it's > terminated with a return it should work. The stack stores the > return/retfie addresses in LOFO (last on, first off) fashion. So > the most recent call (the call from within the ISR) will be completed > by PC going back into the ISR, then the retfie at the end of the ISR, > returning PC to the main loop > > The ISR is basically a called routine, terminated with a return (plus > GIE is automatically re-enabled), although it's generally h/w driven > > Where it's easy to come unstuck is using a branch or goto instead > of a return or not clearing an IF > > -- > http://www.piclist.com PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist > -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist