Remote-processing RPC-220 Instrukcja Użytkownika Strona 19

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 47
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 18
WRITING, DEBUGGING, AND SAVING PROGRAMS SECTION 3
Page 3-8
WRITING FOR C
Mem ory Models
Most C compilers have different memory models. They
are usually referred to as SMALL, COM PAC T, and
LARGE. The D unfield com piler has 5 m odels while
Keil has 3. The differ ences betw een the memor y models
have to do with where and how much data is stored and
how they are accessed. When selecting a memory
model, do not select one where code and data are
overlapped into a single 64K address space.
Do not use the SMALL or CO MPA CT models in the
Dunfield compiler. The TINY, MEDIUM, and LARGE
models are OK.
Memory Use
Most pr ogram s written for 8051 C PUs require relatively
little RAM for control (data logging does require a lot
more). C compilers use both internal and external RAM
to store variables. Internal RAM is faster to access,
although there is much less of it. You have about 32K
of external RAM for var iable space during development.
Set up your compiler so external RAM star ts at address
0x0000. During development, you can use up to address
0x7FBF. Addresses 0x7FC 0 to 0x7FFF are used by the
monitor. A ddresse s 0x8000 to 0xF FF F is where cod e is
executed in RAM . A ll of RAM in segmen ts 1-7 is
available for data storag e, although this is not directly
supported by the compiler.
The RP C-220 can access up to 512K of RA M. This is
done by selecting a RAM segment the reading or writing
to it. See MEM220. C under M EM220 directory,
functions speek, spoke, spokew, speekw for exam ple
access.
Other Considerations for Writing and Saving
Programs
Starting address
All demonstration programs use a starting address of
0x8000. You can put programs into RAM anywhere
from 0x8000 to 0xff00 (the last 256 bytes are used by the
SAVE com mand).
Interrupts
The monitor ROM vectors all interrupts to RAM.
Simply add 0x8000 to the C PU' s interrupt base addr ess.
When an interrupt is serviced, the monitor ROM vectors
off to RAM. The jump code in RAM then jumps to the
appropriate location. When compiling for the final
version, the jump codes in RAM ar e replaced with
vector addresses only.
Reprogramming
See "WRITING C ODE FOR U PDATES" above for
more information.
USING DEMONSTRATION PROGRAMS
Demo programs and batch files were written for
Dunfield Development systems C compiler. A freeware
assembler, ASM51, is included and is in the root
directory. If you use another compiler you must modify
the code accordingly.
Demonstration programs are in separate director ies.
Each directory has source, output (hex), and batch files
for C. All are ready to run.
Batch and sour ce files assum e the Dun field comp iler is
used. Switches used in the command line may not work
with other compilers or assemblers. When you order a
compiler or development system from us, we will send
you library and include files to make the start up code.
In general, startup code was modified to instruct the
compiler where to begin assem bly and include interru pts
particular to the CPU type used.
PROGRAMS LARGER THAN 32K
The largest program that can be developed on the
RPC-220 is 32K. This is because the RAM allocated for
development is 32K and the flash EPROM is 32K.
It is possible to develop and put up to 64K of code in the
RPC-220. You must do three things to make this happen:
1 Use an EPROM em ulator. Rem ove the flash from
U3 and install the emulator. Set the emulator for a
64K EPROM (27C512). Make sure you m ake the
modifications described in 2 below.
2 Cut a trace (write line) on the circuit side to Jumper
W5. Refer to Figure 3-3 below.
Przeglądanie stron 18
1 2 ... 14 15 16 17 18 19 20 21 22 23 24 ... 46 47

Komentarze do niniejszej Instrukcji

Brak uwag