
SAVING PROGRAMS CHAPTER 3
Page 8 RPC-150
Figure 3-1 Autorun jumper
INTRODUCTION
Programs are stored in socket U3. An optional real time
clock module, a DS-1216EM may also be 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 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.
An EPROM 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 RAM and run from
there. Programs in RAM are 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 (W1[17-18]). When autorun 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 command. 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,
assume you wanted to save the following program:
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 program).
Type in the following command:
SAVE
CAM BASIC will compile the program , progr am the
EPROM, and verify its contents.
Compile...Write...Verify
The time it takes to do all of this depends upon the
length and complexity of the progr am. Gener ally, it w ill
be from 1 to 20 seconds. The ready prom pt (> ) will
appear when the program has been successfully saved to
the EPROM . If the program does not write to the
EPROM, an error message will appear:
<Fail @ xxxx
Saving a program overw rites the pr evious one. Ther e is
no way to recover it since both occupy the same space.
AUTORUNNING
To autorun a program:
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 should
autoexecute. If there are any errors, the program will
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 for an autoexecute file to r un. This is
Comentarios a estos manuales