Once in an interrupt, and then in a high-level interrupt, can both interrupts be cancelled?
Submitted By: Craig Steiner FAQ Last Modified: 07/10/06
- Not really. Once you're in an interrupt, the only way to exit is to execute a RETI instruction to tell the MCU that you are done. If you are in an interrupt and are interrupted by a higher level interrupt, you are then two levels deep and a total of two RETIs will be necessary to exit both interrupts. While you can force your way out of the two interrupts prematurely by playing with the stack, this is quite dangerous and generally not a recommended programming practice. Remember, you can't use RET to exit an interrupt--you must use RETI.
Add Information to this FAQ: If you have additional information or alternative solutions to this question, you may add to this FAQ by clicking here.