Remote-processing RPC-220 Manual de usuario Pagina 18

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 47
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 17
WRITING, DEBUGGING, AND SAVING PROGRAMS SECTION 3
Page 3-7
SAVING YOUR PROGRAM TO FLASH
Your program is saved to flash EPROM when
development is done or when you wish to make sure a
program works proper ly.
Usually, but not always, the monitor is replaced. T his
means the save to flash feature will be gone UNLESS
you put it in your program. See "WRITING CODE
FOR U PDA TES" below for taking care of this situation.
You can put code or data in a portion of the flash using
the monitor save command. Howe ver, if you over write
starting at address 0 to a bout 1900H , the monitor is
effectively destroyed.
The ' S' command transfer s the actual prom burning
routine RAM starting at address 0xff00 and executes
from there. M ake sure none of your program is located
in this area.
While pr ogram ming is in pr ogress, the letter ' P' is
printed for every 512 bytes program med (about 100
milli-seconds). The letter ' V' is printed on the next line
for every 512 bytes verified. If there is a verify error, a
letter 'E' is printed at the 512 byte block it was verifying
and the programming process stops.
After verifying good, code jumps to address 0. You
may want to press reset to simulate pow er on conditions.
Saving Process
You can use the monitor code (mon220.hex) to get a feel
for saving code. Save this code to an EP ROM address
not used (such as 0x4000). Then use the DP com mand
to view the contents of the EPROM.
The saving process consists of 2 steps:
First, down load code to RAM using the ' R' command.
Do not specify an offset. Begin saving at address 0.
Second, save to flash by e xecuting the ' S' command. Its
syntax is:
S RAM address, EPROM address, length
All parameters are in hex format. RAM and EPROM
address are usua lly 0. T he only real figuring to do is
length. A quick w ay to check is fir st ' F' ill RAM with
all 0' s from 0 to 0x7fff. Down load the code. T hen use
the ' DX' comm and to view your code. W hen data is all
0' s, you can take the highest address and use it as your
length.
NOTE: The flash E PRO M is pr ogram med in 64 byte
blocks. The saving routine stops when the
length is reached. FF' s are pr ogram med in
locations not specified to round out the block.
NOTE: Since the flash EPROM is programm ed in 64
byte blocks, you should star t on an even byte
boundary. An ' even' boundary is 0xXX00,
0xXX40, 0xXX80, or 0xXXc0.
WRITING CODE FOR UPDATES
There are tw o ways to field update code . O ne method is
listed in the /LOADE R directory. There, a loader
program always resides in memory. You just set a line
low and the loader program is invoked. Programs are
stored starting at address 400H. Review the readme files
for more inform ation.
The second way is to embed a save routine in your code.
This is discussed further below.
A sample routine in FLASH \PFLASH.C is complete
code to prompt the field person to download and burn a
new program . It r eceives Intel H ex code, puts it to
RAM, uploads the flash burn program into RAM, and
runs it. How you get to this routine is up to you. You
could check a line status or check a password through
the serial port or any number of different means.
In-circuit Reprogramming
The general strategy is to temporar ily go into
development mode. The ROM code puts programming
code in RAM, sets the development mode bit, and jumps
to it. Sample code is under the "flash" directory.
Most likely new code is transferred through the serial
port. You should allow for some character code or
sequence to put the card into programming mode. Using
the "FLASH. C" program as an example, the code
receives lines of hex, buffers them, and programs the
flash 64 bytes at a time. After program ming, the code
resets the development bit and jumps to CPU address 0.
You cannot read or execute from flash while it is writing
new data into itself. Ther efore, you must suspend all
other processes. M ake sure you turn off interrupts.
Vista de pagina 17
1 2 ... 13 14 15 16 17 18 19 20 21 22 23 ... 46 47

Comentarios a estos manuales

Sin comentarios