Discussion in 'Embedded Systems and Microcontrollers' started by Jeeny, Apr 9, 2012.
kindly helping me to solve this: differential between PETFIE & RETURN
you mean RETFIE?
IF i am right, you mean RETFIE, find the info here: different processor but the point is RETFIE is assembly and return is C.
The datasheet is the PIC programmer best friend. Download it from here http://ww1.microchip.com/downloads/en/devicedoc/39637c.pdf See section 25 for the instrction set. If you still need help free feel to ask
RETURN is used for subroutines. RETFIE is used to return from interrupts (RETurn From IntErrupt).
When an interrupt source on a PIC generates an interrupt, the GIE bit in INTCON gets cleared by hardware, which disables all unmasked interrupts. The instruction counter then jumps to the interrupt vector address in program ROM and executes the interrupt handler code that resides there.
Upon executing an RETFIE instruction at the end of the interrupt handler, the GIE bit gets set, which re-enables all unmasked interrupts. If you use RETURN instead of RETFIE, it will still return from the interrupt, but interrupts will not get re-enabled.