Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Interrupts....

Status
Not open for further replies.

asp1987

New Member
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...
 
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.
 
You have to be careful with that, nested interupts can get out of control fast and cause stack overflows.
 
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.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top