![]() | ![]() | ![]() |
| | |||||||
| Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc. |
| | LinkBack | Thread Tools | Display Modes |
| | (permalink) |
| 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 | |
| |
| | (permalink) |
| 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 | |
| |
| | (permalink) |
| You're right, it was from having to force GIE off from the old days. | |
| |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
| |
| | ||||
| 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 |