Chapter 3 saving and linking programs – Remote Processing RPC-2350 User Manual

Page 16

Advertising
background image

CHAPTER 3

SAVING AND LINKING PROGRAMS

3-1

Figure 3-1 Flash location and jumpers

CHAPTER SYNOPSIS

Ž

Saving progr ams to Flash

Ž

Retrieving pr ogram s from F lash

Ž

L o a d a n d r u n t w o p r o gr a m s

Ž

Autorun on reset or power up

Ž

Installing 128K or 512K F lash

DESCRIPTION

SAVING AND LINKING PROGRA MS CHAPTE R 3

T w o to 8 pr o g ra m s ca n be s to r e d i n s o ck e t U 3 . U 3
normally has a 29C010A Flash type EPROM, which
stores 2 progr ams. Its capacity is 128K bytes.

U3 sock et can acce pt a 29C0 40A type E PRO M. This
type has 512K byte capacity and can store up to 8
program s.

You can store two to eight programs up to a maxim um
size of about 33 K bytes each . A genera l rule to
determine progr am storage requirem ents is one line
requires 40 bytes. 32K bytes would store over 800 lines
of code. Your application could be significantly more or
less, depending upon the number of commands / line,
comments, and print statements. Another indication of
program size is to use the file length as saved on a PC
disk.

The 29C 010A (12 8K) Flas h can stor e 2 progr ams w hile
the 29C040A (512K) stores up to 8 pr ogram s.

Despite the fact you have 128K or 512K RAM installed,
the maxim um pr ogram size CA MBA SIC can run is
about 33K (leaving room for variable storage).
Programs can be chained, however. When programs are
chained, variables from one prog ram can be used in
another.

Data can be saved to and retrieved from this device
using the SAVE and LOA D comm ands. The m aximum
amount of data that can be accessed is limited by the size
of your program less the Flash size.

The Flash EPROM is non-volatile (retaining data even
when power is disconnected), having an unlimited
numbe r of re ad cycles an d a limited nu mber of write
cycles (about 1, 000 to 10,0 00). U sing 1,000 c ycles as a
limit, you can w rite to F lash once a da y for abo ut 3
years before “wearing out” the device.

A pro gram is not run fr om E PRO M. It is transfer red to
RAM and run from there . Pr ograms in RAM are run

and can be modified. The y can be saved to EPROM for
execution later.

The RPC -2350 is set to autorun on power up or reset by
installing a jumper (W 11). W hen autorun is on, the
progr am in E PRO M is loade d into RAM and begins to
execute immediately.

The EP ROM is write-protected w ith a software lock, so
accidental writes on pow er-on or -off are almost
impossible. You cannot disable the lock except when
executing the SAVE comm and.

SAVING A PROGRAM

To save a program , set jumper W 11. You m ay set the
jumper even if the power is on. Remember to discharge
any static electricity before installing or removing the
jumper. For this example, assume you wanted to save
t he f ol lo w in g pr o g ra m :

10 FOR N = 0 TO 2
20 PRINT "Hello ";
30 NEXT
40 PRINT

If this progr am is not alr eady in, type it in now (o r, if
you prefer, use your own progr am).

You can save your program to any one of two locations:
0 or 1. Prog ram s saved to location 0 will autom atically
run at power up. Syntaxes to save a program are:

SAVE
SAVE program

Advertising