ARM Technical Support Knowledge Articles

DEBUGGING RTX51 TINY APPLICATIONS, PART 2

Applies to: ISD51 In-System Debugger

Answer


Information in this article applies to:


QUESTION

When 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)?

ANSWER

The 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 ALSO

Article last edited on: 2005-07-15 09:59:05

Rate this article

[Bad]
|
|
[Good]
Disagree? Move your mouse over the bar and click

Did you find this article helpful? Yes No

How can we improve this article?

Link to this article
Copyright © 2011 ARM Limited. All rights reserved. External (Open), Non-Confidential