Searching \ for 'question on RETFIE instruction.' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/index.htm?key=question+retfie
Search entire site for: 'question on RETFIE instruction.'.

Truncated match.
PICList Thread
'question on RETFIE instruction.'
1999\10\30@041424 by Mathew Cohen

flavicon
face
Hi All,

Why when I put the RETFIE instruction after my interupt routine does the
program go bak and loop through the interupt routine over and over. I
thought it should return the PC back to were it was before the interupt.


Thanks in advance

Mathew Cohen

1999\10\30@055619 by Thomas C. Sefranek

face picon face
Mathew Cohen wrote:

> Hi All,
>
> Why when I put the RETFIE instruction after my interupt routine does the
> program go bak and loop through the interupt routine over and over. I
> thought it should return the PC back to were it was before the interupt.
>

It does, but did you CLEAR the source of the IRQ in your IRQ service
routine?
(Usually the flag register.)
If not, your code may runs the process all over again.

>
> Thanks in advance
>
> Mathew Cohen

--
Thomas C. Sefranek  WA1RHP
ARRL Instructor, Technical Specialist, VE Contact.
http://www.harvardrepeater.org
http://hamradio.cmcorp.com/inventory/Inventory.html

1999\10\30@131820 by Robin Abbott

flavicon
face
Matthew

Almost certainly you have not cleared the interrupt cause flag . Usually you
clear the interrupt flag, sometimes (e.g. UART TX) you actually have to
disable the interrupt.

e.g. To clear Timer 0 interrupt flag

bcf INTCON,T0IF

Robin Abbott - spam_OUTrobin.abbottTakeThisOuTspamfored.co.uk

**************************************************************************
*
* Forest Electronic Developments
* http://www.fored.co.uk
*
**************************************************************************

----- Original Message -----
From: Mathew Cohen <.....mathewKILLspamspam@spam@EVERYTHINGIT.NET>
To: <PICLISTspamKILLspamMITVMA.MIT.EDU>
Sent: 30 October 1999 09:07
Subject: question on RETFIE instruction.


{Quote hidden}

1999\10\30@132455 by Harold M Hallikainen

picon face
On Sat, 30 Oct 1999 18:07:50 +1000 Mathew Cohen <.....mathewKILLspamspam.....EVERYTHINGIT.NET>
writes:
> Hi All,
>
> Why when I put the RETFIE instruction after my interupt routine does
> the
> program go bak and loop through the interupt routine over and over.
> I
> thought it should return the PC back to were it was before the
> interupt.
>

       Did you remember to clear the interrupt flag on the device that caused
the interrupt?  There may also be some OTHER device causing an interrupt
that you are not looking at.  Make sure you enable interrupts only on
devices you are actually using, and to clear the flag in the routine
(except on some devices that clear automatically, such as the USART that
clears when you read the data or status register, as I recall).

Harold


___________________________________________________________________
Get the Internet just the way you want it.
Free software, free e-mail, and free Internet access for a month!
Try Juno Web: dl.http://www.juno.com/dynoget/tagj.

1999\10\31@141535 by John Considine

flavicon
face
You must clear the interrupt bit that caused the interrupt in the first
place.  For example, lets say you have TMR0 enables INTCON<5>. When the
timmer overflows it sets the TOIF flag <2>.  You must clear this flag in the
interrupt routine or when it goes back out of the interrupt by the RETFIE
then it goes right back in because the TOIF flag is set. So do a bcf
INTCON, 2 in the interrupt routine.

Mathew Cohen wrote:

> Hi All,
>
> Why when I put the RETFIE instruction after my interupt routine does the
> program go bak and loop through the interupt routine over and over. I
> thought it should return the PC back to were it was before the interupt.
>
> Thanks in advance
>
> Mathew Cohen

More... (looser matching)
- Last day of these posts
- In 1999 , 2000 only
- Today
- New search...