Saving programs chapter 3 – Remote Processing RPC-30 User Manual

Page 12

Advertising
background image

SAVING PROGRAMS

CHAPTER 3

Page 10

RPC-30

Figure 3-1 Autorun jumper

INTRODUCTION

Program s are stored in EEP ROM in socket U8. You
can store one program up to a maximum size of about
28K bytes. A gener al rule to determine program storage
requirements is one line requires 40 bytes. 28K bytes
would store over 700 lines of code. Your application
could be significantly more or less, depending upon the
number of comm ands/line, com ments, and pr int
statements.

Despite the fact you may have a 128K or 512K RAM
installed, the maximum progr am size CAMBASIC can
run is about 28K (leaving room for variable storage).
Only one program can be stored on the EEPROM.
Program s cannot be chained.

An EEPR OM is non-volatile (retaining data even when
power is disconnected), having an unlimited number of
read cycles and a limited number of wr ite cycles (about
10, 000). A prog ram is not run fr om E EPR OM . It is
transfer red to R AM and run f rom there. Prog ram s in
RAM ar e run and can be modified. They can be saved
to EEPROM for auto execution later.

The RPC-30 can be set to autorun on power up or reset
by installing a jumper (W 3). W hen autorun is on, the
progr am in E EPR OM is loaded into RA M and begins to
execute immediately.

The RPC -30 has two EEPR OMs. One is used for
progr am stor age. This is the one under disc ussion in this
chapter. T he other is a serial EEPRO M used to save
various C AM BASIC and user param eters and is
discussed in Chapter 13.

The EEP ROM is write-protected with 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 comma nd. T o save param eters,
you must u se the seria l EEP ROM or RA M, which is
battery backed.

SAVING A PROGRAM

T o sa v e a p ro g ra m in E E P RO M , t he a ut or u n j um p er W 3
must be installed. Also, you need a program to save.

For this example, assume you wanted to save the
f o ll ow i ng p r og r a 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 (or , if
you prefer, use your own progr am).

Type in the following command:

SAVE

CAM BASIC will compile the program , progr am the
EEP ROM , and ve rify its contents.

Compile...Write...Verify

The time it takes to do all of this depends upon the
length and co mplexity of the progr am. Gener ally, it w ill
be from 1 to 20 second s. T he read y prom pt (> ) will
appear when the p rogr am has b een succes sfully saved to
the EEPRO M. If the program does not write to the
EEPROM, an error message will appear:

Fail @ xxxx

Saving a pr ogram overw rites the pr evious one. Ther e is
no way to recover it since both occupy the same space.

AUTORUNNING

T o a ut or u n a p r o gr a m :

1.

Make sure there is a program in EE PROM (from
above).

2.

Make sure the autorun jumpe r W3 is installed.

If you push the reset button , the progr am shou ld
autoexecu te. If th ere ar e any er rors , the progr am w ill
stop (assuming you have not trapped them with ON

Advertising