Remote Technologies RPC-320 manual Saving Programs, Saving a Program, Eprom, W3 autorun jumper

Page 12

SAVING PROGRAMS

INTRODUCTION

Program s are stored in an EPRO M in socket U6. You can store one or mor e program s, depending upon EPROM size. A BASIC program can call another when a 512K byte EPROM is used.

Maximum program size that can be run at any one time is about 62K, not including space for variables. 32K bytes is the maximum program size when a 29C256 IC type is used to save a program .

A conservative rule to determine program memory requirements is one line requires 40 bytes. 32K bytes would stor e 800 lines of co de. Your application cou ld 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 RPBASIC-52 can run at one time is about 60K (including room for some variable storage). T he table below shows the maximum capacity, maximum number of program lines, program size at one time, and number of program s for an EPROM type.

EPROM

Max

Prog

Max

No.

type

Cap.

lines

Bytes

Progs

29C256

30K

400

32K

1

29C040

509K

12400

62K

8

One program can call another using the EXECUTE n command. n is from 0 to 7, depending upon the EPROM type.

NOTE: When a program calls another, the old program is completely replaced. All variables and arrays are clear ed (set to 0).

To keep variables, you m ust save them before calling the new progr am. When the new program is running, these variables are restored. Use PEEK and P OKE to read and save numbers and strings. See Chapter 5, STORING VARIABLES IN RAM for more inform ation.

Binary data is saved and read from the EPR OM using BSAVE a nd BLOA D com mands. The EP ROM has a limited number of write cycles (about 1000), so wr iting information should be kept to a minimum .

SECTION 3

Aflash 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). A program is not run fr om EPROM . It is transferred to RAM and run from there. Prog ram s in RAM can be m odified. They ar e saved to EPROM for execution later .

The RPC -320 can autorun on power up or r eset by removing jumper (W9). W hen autorun is on, the program in EPROM segment 0 is loaded into RAM and begins to execute immediately.

Figure 3-1

W3 autorun jumper

This chapter discusses saving programs to EPR OM (U 6) and program autoexecution.

SAVING A PROGRAM

For this example, assume you wanted to save the following program:

20 FOR N= 0 TO 2

30PRINT "Hello ",

40NEXT

50PRINT

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

Page 3-1 RPC -320

Image 12
Contents REV TrademarksRevision Table of Contents Sect ION 11 Watchdog Timer Description External ResetInterrupt Characteristics Sect ION 13 Multi Mode Counter DescriptionSoftware Revision History Overview SectionDescription Manual OrganizationSymbols and Term inology Technical SupportOverview Section System layoutOperating Precautions IntroductionEquipment Using a PC Using a TerminalFirst Time Operation Uploading and Downloading ProgramsEditing programs and program ming hints Where to GO from Here TroubleshootingSaving Programs Saving a ProgramEprom W3 autorun jumperAutorunning Preventing AutorunLoading a Program Changing Eprom SizeCommands Alternate EpromsBload BsaveSerial Ports COM0 Serial PortCOM1 Serial Port Serial Ports Section RS-422/485 Operating InformationRS-422/485 Termination network Accessing Serial Buffers Two wire RS-485Multidrop Network Accessing COM0 and COM1 Disabling CONTROL-CSerial Port PIN OUT RXD CTS Battery Backup Checking the batteryRAM Memory Changing MemoryReserved Memory Storing Variables in RAMAssembly Language Interface Block Data TransferDigital and Opto Ports Digital I/O PortsDigital Por t J3 Digital I/O Commands Digital Port P6High Current Port L8 Optically Isolated InputHigh Current Output Interfacing to switches and other devices Interfacing Digital I/O to an opto-module rackDigital I/ O prog ramm ing exam ple Ls e Width Modulation PWM Digital and Opto Ports Section Conne ctor pin ou t J3Config Line CountLine Line BSetting Date and Time DateM E Section Connecting Displays Writing to the DisplayProgramming Example Display Connector PIN OUT Display TypesKeypad Port Program explanationKeypad Port PIN OUT J5 Connecting Analog Inputs Analog InputInitialization Overvoltage conditionsDifferential Mode Examples u sing CON FIG AINAcquiring Analog Data Temperature Measurement Noise NotesAnalog Input Section Data logging on a timer tick Measuring Higher VoltagesConverting Analog Measurements AmplifiersMeasuring 4-20 mA current loops Calibration Watchdog Timer External ResetInterrupt Characteristics Optically Isolated InterruptProgram Example Optically isolated and TTL interrup ts Programming GNDLoad GateCOU NT0 Power Management Further Power ReductionPower Management Section Program Examp leElectrical Specifications Technical InformationMechanical Specifications Memory and I/O Bank MAPJumper Descriptions Bank