piclist 2001\04\26\060855a >
Thread: Interrupts in a PIC16F84
www.piclist.com/techref/microchip/ints.htm?key=interrupt
picon face BY : Bob Ammerman email (remove spam text)



----- Original Message -----
From: "Tony Nixon" <@spam@Tony.Nixonspam_OUTspamspamENG.MONASH.EDU.AU>
To: <PICLISTEraseMEspamspam_OUTMITVMA.MIT.EDU>
Sent: Thursday, April 26, 2001 2:22 AM
Subject: Re: [PIC]: Interrupts in a PIC16F84


{Quote hidden}

Sorry, no. The GIE is automatically disabled on entry to the ISR and
reenabled by the RETFIE instruction.


Now, to qualify this a bit:

The PIC will automatically disable GIE during the interrupt handler and
reenable it during the RETFIE. It _is_ possible to deliberately reenable
interrupts in your interrupt handler but this is pretty ugly (you have to
have multiple save areas and decide which one applies to a given invocation
of the interrupt).

Here is pseudocode for a is a reasonable way to go at it if you are
expecting a lot of interrupts. This avoids repeatedly handling interrupts
and saving/restoring context:

interrupt_handler:
   save context

check_next:
   if RB0/INT interrupt
       clear RB0/INT flag
       handle RB0/INT condition
       goto check_next
   endif

   if TMR interrupt
       clear TMR interrupt flag
       handle TMR condition
       goto check_next
   endif

   restore context
   RETFIE

Bob Ammerman
RAm Systems
(contract development of high performance, high function, low-level
software)

--
http://www.piclist.com hint: To leave the PICList
@spam@piclist-unsubscribe-requestspamEraseMEmitvma.mit.edu


<006101c0ce38$c25ae0c0$13e9c540@CDS> 7bit

See also: www.piclist.com/techref/microchip/ints.htm?key=interrupt
Reply You must be a member of the piclist mailing list (not only a www.piclist.com member) to post to the piclist. This form requires JavaScript and a browser/email client that can handle form mailto: posts.
Subject (change) Interrupts in a PIC16F84

month overview.

new search...