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 1st October 2007, 05:50 AM   (permalink)
Question Interrupts....

Suppose an interrupt occurs and a table is called initially in the ISR..The
table directs the micro to do an appropriate action defined within the ISR itself..
During its execuiton we have cleared both RBIF and INTF flags to allow more interrupts.. Now suppose we are still in the ISR(doing that 'appropriate' action)..

1.Will another interrupt cause the PC to direct at the table?
2.Or is it necessary that our program has to be out of the ISR(using retfie) to enable further interrupts?
Thanks in advance...
asp1987 is offline  
Old 1st October 2007, 06:37 AM   (permalink)
Default

The GIE bit is cleared when an ISR is entered and is set when the retfie is executed. This makes it impossible for another interrupt to happen. You can allow re-entrant interrupts by setting the GIE bit in your ISR but you have to copy the w_temp variables etc into shadow locations first.

BTW, this assumes 16F series chip.

Mike.
Pommie is offline  
Old 1st October 2007, 06:58 AM   (permalink)
Default

You have to be careful with that, nested interupts can get out of control fast and cause stack overflows.
__________________
"Because I be what I be. I would tell you what you want to know if I
could, mum, but I be a cat, and no cat anywhere ever gave anyone a
straight answer, har har."
Sceadwian is offline  
Old 1st October 2007, 09:11 AM   (permalink)
Default

I would strongly suggest NOT doing it!.

It's also fairly important to make ISR's as short and fast as possible, and preferably NOT to call subroutines within them - as the limited stack size means it's easy to overflow the stack, with disasterous results.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is online now  
Old 1st October 2007, 12:33 PM   (permalink)
Default

Thanks a lot.....
asp1987 is offline  
Reply

Bookmarks

Thread Tools
Display Modes



Similar Threads
Title Starter Forum Replies Latest
Interrupts 16F88 andrew12345678 Micro Controllers 4 13th September 2007 12:38 PM
Interrupts latency atferrari Micro Controllers 21 15th June 2007 01:37 AM
Status of a comparator affecting interrupts. 2camjohn Micro Controllers 7 19th July 2005 12:14 PM
Interrupts or not interrupts ? That is the question ! ZERS Micro Controllers 9 1st March 2005 08:26 PM
PIC18F452 & ADC --> no interrupts : is it right ? ZERS Micro Controllers 8 6th April 2004 10:32 AM



All times are GMT. The time now is 09:18 PM.


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

eXTReMe Tracker