| |||||
Technical Support Support Resources
Product Information | ISD51: DEBUGGING RTX51 TINY APPLICATIONS, PART 2Information in this article applies to:
QUESTIONWhen running a program under control of ISD51 with software breakpoints, the program execution speed is reduced considerably. But timer 0, which is used by RTX51 Tiny, runs at its inherent speed, and overflows some hundred times per second, causing the program to constantly call the timer 0 interrupt service routine. This makes debugging of RTX51 Tiny applications with ISD51 almost impossible. Is there a way to avoid this problem (except by using Flash Breakpoints)? ANSWERThe timer 0 interrupt routine used by RTX51 Tiny reduces its interrupt priority which causes this problem (this can be seen in the HW_TIMER_CODE macro in the file Conf_tny.A51). The following change in ISD51.H stops timer 0 while ISD51 is executing:
sbit TR0 = TCON ^ 4;
:
:
SerialInterrupt:
CLR TR0 ; added instruction: stop timer 0
When leaving the ISD51 interrupt service routine, timer 0 must be started again. This is done by replacing any RETI instructions in ISD51.A51 by:
SETB TR0 ; added instruction: activate timer 0
RETI
With these changes, timer 0 still runs several times faster, compared with the user program, but sufficiently slow for debugging purposes. MORE INFORMATION
SEE ALSOLast Reviewed: Friday, July 15, 2005 | ||||