Is there a way to prevent the debugger from single stepping into an interrupt routine. To disable interrupts help but it is awkward.
I can suggest you a "partial" solution, if the problem you are speaking of is regarding a cyclic interrupt such as a Timer Interrupt. We had this problem in the past: Mon51 was continuously interrupted by the Timer during debug, since Timer was running even if program was halted due to a breakpoint. After every step we continued to run into Timer Interrupt routine. We found a solution by means of the two Mon51 hooks called AFTER_GO and BEFORE_GO. If you look in INSTALL.A51, the Mon51 configuration file, you will find two declarations
PUBLIC BEFORE_GO ; DO SOME THINGS BEFORE STARTING USER PROGRAM PUBLIC AFTER_GO ; DO SOME THINGS AFTER TERMINATION OF USER PROGRAM
"BEFORE_GO is called by the monitor every time it passes control to your program AFTER_GO is called every time your program passes control back to Mon51, i.e. during a Breakpoint or during Single Step." I disassemble the mon51,I found mon51 never call BEFORE_GO and AFTER_GO,Why? my keil version is V7.1
I disassemble the mon51,I found mon51 never call BEFORE_GO and AFTER_GO,Why? my keil version is V7.1 Hmmm. We use it all the time for custom monitor configurations and it gets called. Have you tried it to see if it works? You could set a port bit in BEFORE_GO and reset the bit in AFTER_GO and use a scope or logic probe to verify. Jon
thanks Jon,I followed what you said,I can see it works. could you please tell me detail about mon51?thanks! my mail:tomsbao@hotmail.com