2:43AM
Junior Member level 1
- Joined
- Feb 6, 2010
- Messages
- 15
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1,281
- Location
- Midwest USA
- Activity points
- 1,419
For an 8051 microcontroller, is this possible?
My code uses the external interrupt 0 to branch out a main program and go into a lengthy subroutine, then again branching out into an appopriate sub-main program based on values in the accumulator. At this point, the micro is where it should be, running the code as long as it's supposed to. However, I want to have the external interrupt 0 reset and available to branch out again, if required.
The RETI instruction would indeed reset the interrupt and allow the micro to take action for future interrupts. However, placing a RETI anywhere in the subroutine or subsequent sub-main programs would cause the micro to go back to the main program where the Program Counter originally left off. I don't want that!
Is it possible to reset a flag or something to reset an interrupt and allow it to be used again WITHOUT using the RETI instruction?
Thanks for any help!
My code uses the external interrupt 0 to branch out a main program and go into a lengthy subroutine, then again branching out into an appopriate sub-main program based on values in the accumulator. At this point, the micro is where it should be, running the code as long as it's supposed to. However, I want to have the external interrupt 0 reset and available to branch out again, if required.
The RETI instruction would indeed reset the interrupt and allow the micro to take action for future interrupts. However, placing a RETI anywhere in the subroutine or subsequent sub-main programs would cause the micro to go back to the main program where the Program Counter originally left off. I don't want that!
Is it possible to reset a flag or something to reset an interrupt and allow it to be used again WITHOUT using the RETI instruction?
Thanks for any help!