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

Page 10

Advertising
background image

SAVING PROGRAMS

CHAPTER 3

Page 8

Figure 3-1 W3 autorun jumper

INTRODUCTION

Program s are stored in an EEP ROM in socket U4. You
can store one prog ram up to 32K bytes. A gener al rule
to determine program memor y requirements is one line
requires 40 bytes. 32K bytes would store 800 lines of
code. Your application could be significantly more or
less, depending upon the number of commands/line,
comm ents, and pr int statements.

Despite the fact you may have a 128K or 512K RAM
installed, the maximum progr am size RPBASIC-52 can
run is about 60K (including room for variable storage).
Only one program can be stored on the EEPRO M, and
this is limited to about 32K.

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
1,0 00). 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 can be modified. They can be saved to EEPROM
for auto execution later.

The RPC-52 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 -52 has two EEPR OMs. One is used for
program storage (U4). This is the one under discussion
in this chapter . T he other is a serial E EPR OM used to
save various RPBASIC-52 and user parameters (U 7).
The serial EEP ROM is discussed in chapter 13.

This chapter discusses saving programs to EEPROM
(U4) and program autoexecution.

SAVING A PROGRAM

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
2 0 PR I N T " H e ll o " ,

30 NEXT
4 0 P RI N T

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

RPBASIC-52 r esponds with:

Saving 35 bytes
Verifying --- OK

The time it takes save a program depends upon the
length and complexity of the program. Program ming
rate is about 600 bytes/second. If the program does not
successfully sa ve to the EE PRO M, an err or m essage w ill
appear.

Saving a pr ogram overw rites the pr evious one. Ther e is
no way to recover the old one 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.

Install jumper W3.

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
especially tr ue if the pro gram has been co nfigured to
ignore the < ESC> or < Ctl-C> keys. To pr event
autorun , r emove jumper W3 befo re pow er up or reset.

LOADING A PROGRAM

Ther e are tim es when y ou may w ish to tempor arily
m o d if y or o th e r wi se te s t o u t a c ha n ge to a pr o g ra m .
Since the program is loaded into RAM in autorun,
modifications can be made without affecting the program
in EEPRO M. Use the LOAD command to transfer the
E E P RO M p ro gr a m t o R A M .

If you find out tha t modification s are not de sirable or did
not work, you can restore the original program to RAM
using the LOAD com mand.

Advertising