Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Categories > Micro Controllers


Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc.

Reply
 
LinkBack Thread Tools Display Modes
Old 6th February 2007, 06:12 PM   (permalink)
Default Where to disable the GIE bit on a PIC interrupt?

Where in an Interrupt should you disable the GIE bit?
(or do you have to?)
Code:
         org      0x004             ;IRQ routines
Push     bcf      INTCON, GIE       ;Bx
         movwf    W_Stack             ;Bx given multiple banks, and no global memory 
         swapf    STATUS,W     ;Bx The swapf instruction, unlike the movf, affects NO status bits, which is why it is used here.
         clrf     STATUS             ;Bx point to bank 0 and clear all the flags
__________________
Bill
Smart Kits build Smart People

http://www.blueroomelectronics.com
blueroomelectronics is offline  
Old 6th February 2007, 07:08 PM   (permalink)
Default

I don't use assembly very much, but I was under the impression it gets cleared automatically, otherwise it would get stuck in an infinite loop if you didn't immediately clear it.

looking at the datasheet for the 16F88 for example, it does say on the first page about interrupts that the GIE bit gets cleared, and that the instruction RETFIE automatically sets it again when exiting the ISR.
__________________
EEgeek.net
evandude is offline  
Old 7th February 2007, 04:27 AM   (permalink)
Default

You're right, it was from having to force GIE off from the old days.
__________________
Bill
Smart Kits build Smart People

http://www.blueroomelectronics.com
blueroomelectronics is offline  
Reply

Bookmarks

Thread Tools
Display Modes



Similar Threads
Title Starter Forum Replies Latest
Interrupt routines [re: 8051] mstechca Micro Controllers 5 20th April 2006 10:31 AM
how to give 120degree phase shift i've written a code esconele Micro Controllers 18 16th February 2006 01:49 PM
HANDLING THE INTERRUPT. alamy Micro Controllers 6 26th March 2005 04:37 PM
interrupt on portb change spirosd Micro Controllers 5 10th January 2005 02:47 PM
Interrupt on GP Change problem Dan East Micro Controllers 2 22nd May 2004 06:12 PM



All times are GMT. The time now is 07:26 AM.


Electronic Circuits  |  Learning Electronics
Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.

eXTReMe Tracker