Remote Processing RPC-220 User Manual

Page 17

Advertising
background image

WRITING, DEBUGGING, AND SAVING PROGRAMS

SECTION 3

Page 3-6

If the download pr ocess gets stuck, y ou can press
the < esc> key at any tim e after the download is
aborted. Y ou can also press the reset button.
Pressing the < esc> key at any time during the
download pr ocess aborts the re ceiving process.

G G O T O R un P r og r a m
Once a program is downloaded into RAM and
breakpoints are optionally set, it is executed using
the 'G ' command. T he application program has
complete control. The only w ay to stop exec ution is
to press the reset sw itch or the progr am hits a
breakpoint. Comm and syntax is:

G [address]

When GO TO is executed, r egister values from the
last break or reset are loaded first. T hen the
program is executed. This way you can stop
program execution, examine registers, and continue.
Register s may be modified b efore e xecuting. This is
done using the MX command. Register values are
stored beginning at the address shown when a Break
is executed. Values are stored in the same order as
they are displayed.

Using G into an interrupt section may be tricky,
depending upon its type. The problem is when
i nt e rr u p ts a re r e -e n ab le d , it m ay e xe c ut e t he s am e
program you executed a break. Unless your program
is recursive, variables may be unreliable.

B Set / C lear Bre akpoint

A program may be interrupted and the contents of
certain register s displayed when a specified addr ess
is reached. Up to 8 breakpoints, numbered 0-7, are
allowed. Comm and syntax is:

B number[,address]

number is from 0 to 7. A num ber larger than 7
aborts the command. If address is 0 or left out, the
contents of R AM at the brea kpoint num ber is
restored to its original values. This is the same as
clearing a break point.

This com mand w orks by r eplacing 3 by tes in
externa l RAM mem ory at add ress and r eplacing it
with a CALL to the monitor break point handler.
When a break point is encountered, interrupts are
turned off and contents of registers A, B, DPTR,
P1, P3, P SW, SP, and R 0-R7 are saved and
displayed. Additionally, the address where the break

occurred is also displayed. RAM at the break point
address is not restor ed until a ' B number ' is
executed.

As a general rule, external memory is not affected
by a push button reset or break point. Thus, if your
program hangs up you may restore a break point
and replace it at a new address. T he following
illustrates an example. Suppose your code begins as
8000H and you want to set break points at 8112H
and 8215H. Execute the following com mands:

B 0, 8112
B 1, 8215
G 8000

When the code at either 8112H or 8215H is reached, the
break point message is displayed.

**Break Register information at address 7FC0
A B R0 R1 R2 R3 R4 R5 R6 R7 PS SP DPTR PC
03 00 98 00 00 00 00 00 00 21 41 4F 2147 2112

Both breakpoints are still active. To continue execution
from this point you must enter:

B 0

You m ay then enter a new br eak point or ' G 2112' to
continue.

When a break point is set, 3 bytes from the original
program is stored in RAM. Additionally, the break
address is also stored.

When a progr am break is executed, certain registers and
I/O conditions are set to a known state. See "REGISTER
USAGE AND INITIALIZATION" above for more
information. Y ou may modify these registers using the
MX comm and. Values for registers are in order as
displayed abo ve. The star ting addre ss for the r egisters is
displayed when a break is encountered. T he above
examples is 7FC0.

S Save to flash EPROM
This command is described in detail below.

Advertising