
SAVING CODE AND DATA BASIC SECTION 3
Page 3-1
Figure 3-1 Flash EPROM location
INTRODUCTION
SAVING CODE AND DATA IN BASIC SECTION 3
Code and data are saved to external Flash at U6 only.
Some of the internal Flash/EE PROM to the ADUC 812
CPU is used when running RPBASIC-52. Contact
Remote Processing for more details. Data is usually
saved to the 512K RAM, but can be saved to Flash for
secure storage or when RAM is not enough.
One BASIC progr am can call another using the
EXEC UTE command.
Despite the fact you have a 512K RAM installed, the
maximum pr ogram size RPBA SIC-52 can run at one
time is about 60K (including r oom for some variable
storage). However, up to 7 programs can be chained.
Chained programs can run another program.
One program can call another using the EXECUTE n
command. n is from 1 to 7.
NOTE: When a program calls another, the old program
is completely replaced. All variables and
arrays are cleared (set to 0).
To keep variables, you m ust save them before calling the
new progr am. When the new program is running, these
variables may be restored. Use PEE K and POKE type
commands to read and save numbers and strings. See
SECTION 5, STORING VARIABLES IN RAM for more
information. The demonstration programs EXECn.BAS
show how a variable is stored in RAM.
A Flash EPROM is non-volatile (retaining data even
when power is disconnected), having an unlimited
number of read cycles and a limited number of write
cycles.
A program is not run fr om EPROM. It is transferred to
RAM and run from there. Programs in RAM can be
modified. They can be saved to E PRO M for auto
execution later.
NOTE: Starting sometime in 2012, the flash EPROM
type will change from the Atmel 29C040A to a
traditional flash. Saving and loading programs
will rem ain the same. H owever , any data
stored in the same segment as a program will
be erased when stor ing a new program. This is
important if storing m enu strings and constants
in the same flash segment as the program.
The RPC-210 can be set to autorun on power up or reset
by grounding J7-17 (usually to J7-15). When autorun is
on, the progr am in EPRO M segm ent 1 is loaded into
RAM and begins to execute immediately.
SAVING A PROGRAM
For this example, assume you wanted to save the
following program:
20 FOR N=0 TO 2
30 PRINT "Hello ",
40 NEXT
50 PRINT
If this progr am is not alr eady in, type it in now (or , if
you prefer, use your own program).
Type in the following command:
SAVE
RPBASIC-52 responds with:
Saving 35 bytes
-OK
The time it takes save a program depends upon the
length and complexity of the program and Flash EPROM
type. Programming rate is roughly 10000 bytes/second.
If the program is not successfully saved to EPROM, an
error message will appear.
Saving a program overw rites the pr evious one. Ther e is
no way to recover the old one since both occupy the
same space.
Using SAVE without any parameters is the same as
typing SAVE 1.
Commentaires sur ces manuels