All About Circuits Forum  

Go Back   All About Circuits Forum > Software, Microcomputing, and Communications Forums > Embedded Systems and Microcontrollers

Notices

Embedded Systems and Microcontrollers Discussion forum for projects and working with embedded systems and microcontrollers (FPGAs, PICs, AVRs). Get help with hardware issues and embedded programming.

Reply   Post New Thread
 
Thread Tools Display Modes
  #1  
Old 04-09-2012, 10:25 AM
Jeeny Jeeny is offline
New Member
 
Join Date: Apr 2012
Posts: 5
Send a message via MSN to Jeeny Send a message via Yahoo to Jeeny Send a message via Skype™ to Jeeny
Default code

kindly helping me to solve this: differential between PETFIE & RETURN
for pic18f4580
thx...
Reply With Quote
  #2  
Old 04-09-2012, 07:37 PM
chrisw1990 chrisw1990 is offline
Senior Member
 
Join Date: Oct 2011
Location: UK, Near Brighton
Posts: 543
Default

you mean RETFIE?
__________________
if in doubt.. use a hammer.
Reply With Quote
  #3  
Old 04-09-2012, 07:40 PM
chrisw1990 chrisw1990 is offline
Senior Member
 
Join Date: Oct 2011
Location: UK, Near Brighton
Posts: 543
Default

IF i am right, you mean RETFIE, find the info here: different processor but the point is RETFIE is assembly and return is C.
RETFIE
return
__________________
if in doubt.. use a hammer.
Reply With Quote
  #4  
Old 04-09-2012, 07:55 PM
t06afre's Avatar
t06afre t06afre is offline
Senior Member
 
Join Date: May 2009
Posts: 5,807
Default

Quote:
Originally Posted by Jeeny View Post
kindly helping me to solve this: differential between PETFIE & RETURN
for pic18f4580
thx...
The datasheet is the PIC programmer best friend. Download it from here http://ww1.microchip.com/downloads/e...doc/39637c.pdf See section 25 for the instrction set. If you still need help free feel to ask
Reply With Quote
The Following User Says Thank You to t06afre For This Useful Post:
Jeeny (04-10-2012)
  #5  
Old 04-12-2012, 03:13 PM
Jon Wilder's Avatar
Jon Wilder Jon Wilder is offline
Junior Member
 
Join Date: Oct 2011
Posts: 23
Default

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.
Reply With Quote
Reply   Post New Thread

Tags


Similar Threads
Thread Thread Starter Forum Replies Last Post
Generating a Unique Code in Data Stream Brownout Programmer's Corner 13 03-22-2012 11:25 PM
My first PCB R!f@@ General Electronics Chat 97 10-30-2011 04:22 AM
SIGILL at perfectly good native code m00ni Embedded Systems and Microcontrollers 1 02-07-2011 12:38 PM
Generate Morse Code by Mplab. Need Help! morgan Homework Help 1 07-25-2010 12:08 AM
HEX code TO assembly code pic16f84a servo motor code longcrystal Embedded Systems and Microcontrollers 4 04-10-2010 06:15 PM

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 03:12 AM.


User-posted content, unless source quoted, is licensed under a Creative Commons Public Domain License.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.