beautypg.com

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

Page 10

background image

SAVING PROGRAMS

CHAPTER 3

Page 8

RPC-150

Figure 3-1 Autorun jumper

INTRODUCTION

P r o gr a m s a r e st or e d in s oc k et U 3. A n o pt io n al r ea l t im e
clock mo dule, a DS-12 16EM may also b e installed in
U3. See Chapter 7 for calendar/clock installation and
operation.

You can store one program up to a maximum size of
about 28K bytes. A general 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 mor e 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.

An EPR OM is non-volatile flash type technology, having
an unlimited number of read cycles and a limited number
of write cycles (about 10,000). A program is not run
from EP ROM . It is transferred to RA M and run fr om
there. P rogram s in RAM ar e run and can be modified.
They can be saved to EPROM for auto execution later.

The RPC-150 can be set to autorun on power up or reset
by installing jumper (W 1[17-18]). When autor un is on,
the program in EP ROM is loaded 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 comma nd. T o save param eters,
you must use battery backed RAM and save data to U1.

SAVING A PROGRAM

To save a program , set jumper W 1[3-4] and [17-18].
You may set the jumper even if the power is on.
Remember to discharge any static electricity before
installing or removing the jumper. For this example,
a s su m e yo u wa n te d to s av e th e fo 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 (o r, if
you prefer, use your own progr am).

Type in the following command:

SAVE

CAM BASIC will compile the program , progr am the
EPR OM, and verify 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 EPROM . If the program does not write to the
EPROM, an error message will appear:

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 EP ROM (from
above).

2.

Make sure jumper W1 [3-4] and [17-18] are
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
ERROR) and display the error message.

PREVENTING AUTORUN

When troubleshooting a program , it' s not always
convenient fo r an autoe xecute file to r un. This is