
WRITING, DEBUGGING, AND SAVING PROGRAMS SECTION 3
Page 3-1
Figure 3-1 Code Memory Map
INTRODUCTION
WRITING, DEBUGGING AND SAVING SECTION 3
The RP C-220 is programm ed in C or assembly
languages. Virtually any 8051 type compiler and
assembler may be used to generate code. An assembler
is provided on the application disk. This section
provides information to set up your compiler/ assembler.
OPERATING MODES
The RPC-220 executes code in one of two modes called
development and normal. The defining difference
between the two modes is how the memory map
changes. In norm al mode, the C PU accesses its code
from U3 flash EPROM exclusively. All of RAM in U4
is accessed using MOVX type commands. In
development mode, code is also accessed from RAM
starting at address 0x8000.
I/O mode accesses devices (RTC, expansion port, and
flash EPROM ). This mode is accessed by setting the
I/O bit (CPU port P4.0) low.
During development mode (CPU port P4.1 low), RAM
from address 0x8000 to 0xffff can, but does not have to,
execute code. This memory can be accessed as I/O
using MOVX com mands.
When setting up your compiler or assembler to develop
code, set the ORG (originate) to 8000H. The monitor
vectors interrupts to base address + 8000H. For
example, when there is a serial interrupt the CPU
vectors to address 0x23. The monitor has a jump
instruction to address 0x8023.
When you are done writing code, simply change the
ORG to address 0 and re-compile or assemble.
Detailed Description
Development/nor mal and I/O m odes are controlled by
two lines directly from the CP U. On power up or reset,
these lines go high, placing the card in normal operating
mode capable of accessing external RAM. When the
DEV L line (por t P4. 1) goes low, the card is in
development mode. When the I/O line (port P4.0) goes
low, non-RAM devices are accessed. These lines are
mutually exclusive, except when programming the flash
EPROM.
Development mode simply allows CPU code to be
accessed from RAM at addresses 0x8000 to 0xffff.
MOVX type commands always access all of RAM
(assuming the I/O control line is high). U3 flash
EPROM is accessed as code from addr ess 0x0000 to
0x7fff.
The I/O control line complicates things just a bit. The
purpose of this line is to allow access to non-RAM
devices (such as the real time clock and expansion
boards) while still allowing full access to RAM. The
PEE L in U6 controls RAM , I/ O, and flash access. It is
designed to allow code access in the memory map
(Figur e 3-1 below ), RAM and I/O at the same time. This
is how code runs from RA M while accessing the RTC. It
also allows RAM to be modified in the code area.
Generally, the I/O control and development/normal lines
operate independently. T he only time both lines oper ate
together is during flash programming.
MEMORY MAPS
Memor y maps are controlled by one of two bits on the
CPU port. Port P4. 1 controls development/normal
mode. On power up or reset, this line goes high placing
the board in normal mode. A low configures the board
for development mode.
Port P4.0 selects between RAM and other I/O such as
the RTC, expansion port, and flash EPROM . On power
up or reset, this line goes high allowing access to RAM.
A low maps out the RAM for MOVX type instructions
only. Code can be accessed if the development m ode is
selected (P4. 1 is low). W hen P4. 0 is low, the flash
eprom, expansion port, and RTC are accessible using
MOV X type comm ands.
During normal mode, up to 64K is accessible by making
a PCB modification and replacing U3 with a 27C512
type EPROM. As delivered, 32K of code is accessible.
See Program s larger than 32K later in this section.
The memory map changes, depending upon the status of
the development and I/O control lines. Figure 3-1 shows
the code map during development mode.
Komentáře k této Příručce