On Mon, 25 May 1998 11:16:46 +1000 Dennis Plunkett writes: >25/5/'98 > > >Hello there everyone, > >Quick question for you all (I don't have my data book) on the F84, >under >external interrupt control:- Does the PIC complete the current >instruction >and increment the PC before entering the interrupt routine? The real question you're asking is "Does any of the main program execute if an interrupt condition exists immediately following the end of the ISR? (consecutive interrupts)" The book doesn't say much that would answer the question. I suggest trying it. Simply write a short main program that toggles a port pin and an ISR that pulses another port pin. You can force interrupts to occur constantly by merely setting an interrupt enable bit and the interrupt flag bit, then neglecting to clear the flag bit in the ISR. The PIC will re-interrupt immediately after the RETFIE instruction sets the GIE bit again. I don't know for sure, but probably no main program instructions will execute. An instruction may be fetched but then the interrupt logic will kick in and skip it. If this is the case, single-stepping could still be implemented with some external hardware to cause an interrupt at the right times to let just one instruction execute. Connect a counter to count xtal cycles and toggle the INT pin. Use another pin to reset the counter. Just before leaving the ISR, reset the counter. The interrupt would occur shortly after that. I think a count of 16 xtal cycles (4 PIC instructions) would be sufficient. _____________________________________________________________________ You don't need to buy Internet access to use free Internet e-mail. Get completely free e-mail from Juno at http://www.juno.com Or call Juno at (800) 654-JUNO [654-5866]