> From jnewport@MAIL.ORION.ORG Wed Jun 24 12:12:45 1998 > X-SMAP-Received-From: outside > X-Comment: mitvma.mit.edu: Mail was sent by orions0.orion.org > X-Sender: jnewport@orionc0 > MIME-Version: 1.0 > Date: Wed, 24 Jun 1998 13:14:41 -0500 > From: "Jonathan M. Newport" > Subject: after I return from an interupt... > To: PICLIST@MITVMA.MIT.EDU > > sorry, I'm kind of new to this, but say I've got something in a continuous > loop like: > > circle goto circle > > waiting for an interupt. when the isr is finished and I use the retfie > command, will it increment the program counter to execute the instruction > after this one? No, you return to the same loop. > or if it doesn't is there a way that I can increment the > program counter myself? thanks No, you can't change the content of an item on the stack. But you can just re-enable interrupts at the end of your interrupt handler, and do a goto to the instruction after the circle instruction, as long as you don't need any addresses on the stack. But if circle is in a subroutine that you need to return from, you can't use this hack. By the way, unless you disable the watchdog timer, this loop will eventually cause a watch- dog reset unless you clear the watchdog timer in the interrupt routine and have the interrupt occur often enough. Usaully what people do is have the interrupt routine send a flag for the base level reoutine to continue. For example bcf some_status_byte,0; circle btfss some_status_byte,0; goto circle and in the interrupt routine: ... bsf some_status_byte,0; ... > > Jonathan Newport >