Remote Technologies RPC-320 manual Block Data Transfer, Assembly Language Interface

Page 22

RAM MEMORY

510 GOSUB 2000

Retrieve variables

This subroutine stores variables CF, JC, and AC into an array starting in segment 1, address 0.

1000 POK EB1, 30*NO, JC

1010 POKEW1,30*NO+ 1,AC

1020 POKEF1,30*NO+ 3,CF

1030 POKE$1, 30*NO+ 9,$(0)

1040 RETURN

Subroutine 2000 - 2040 retrieves data into variables CF, JC and AC .

2000 JC =

PEEKB(1,30*NO)

2010

AC =

PEEKW (1,30*N O+ 1)

2020

$(1) =

PEEK$(1, 30*NO+ 9)

2030 CF =

PEEKF (1,30*N O+ 3)

2040 RETURN

You can store and retrie ve strings a nd variab les in this way. Ther e are many variations of PEEK and POKE statements. Refer to the RPBASIC -52 Software Supplement in this manual for additional information and examp les. A list of comm ands appea rs at the end of this chapter .

BLOCK DATA TRANSFER

Blocks of data are transferred to and from RA M and flash EPR OM u sing BLOAD and BSAVE comma nds. Block transfers are useful for loading and storing data, look-up tables, text, etc. U p to 65,535 bytes can be moved from RAM to EPROM or EPROM to RAM at one time. The absolute number of bytes that are moved is limited by the RAM and EPR OM sizes.

Transfers from EPRO M to RAM , using BLOA D, take approximately 23.5 m s/1000 bytes. T ransfers from RAM to EPROM , using BSAVE , are even longer at 100 ms/ 1000 bytes usin g a 512K byte EPR OM . T his time is even longer when smaller E PROM s are used (due to the program ming algorithm).

Serial port, tick timer, and external interrupts are enabled dur ing these tra nsfers. Howe ver, response s to ONT ICK or ONIT R are d elayed by the time it takes to transfer data. W hen ONTIC K or ONIT R must be serviced faster, transfer data in sm aller blocks.

Refer to BLOAD and BSAVE in Appendix A for more information.

SECTION 5

ASSEMBLY LANGUAGE INTERFACE

Assembly language program s must be placed in the RPBASIC-52 E PROM . W hen using RPBASIC-52, progr ams shou ld start at addr ess 6000H or higher up to 7FFFH .

RPBASIC is norm ally in a 32K byte EPROM (27C256). A 64K byte EPROM (27C512) may be used in socket U4 provided the following modification is made: Cut the trace between W11 pins 1 and 2 on the circuit side. (Jumper W11 is under socket U4. P in 1 is designated by the square pad.) Solder a jumpe r between W11 pin 2 and 3.

Docum ented assem bly language interface calls listed in the Intel MCS BASIC -52 Users Manual will not work with RPBASIC-52. This is because RPBASIC-52 has been reassembled and code shifted around.

The RP-10 adapter boar d is used to run and debug assembly and C code. This board plugs into RAM socket U5 and RPBASIC socket U4. It does not use the Basic at all.

COMMANDS

The following is a list of RPBASIC-52 commands used w it h R A M .

Comm and

Function

BLOAD

Transfers data from EPROM to RAM

BSAVE

Transfers data from RAM to EPROM

CALL

Calls an assembly language routine

CBY

Return s code m emor y data

DBY

Returns or assigns internal memory

MTOP

Sets top of RAM memory

PEEK B

Return s a byte

PEEK F

Returns a floating point number

PEEK W Returns a 16 bit value

PEEK $

Returns a string

POKE B

Stores a by te

POKE F Stores a floating point number

POKE W Stores a 16 bit value

POKE $

Stores a string

XBY

Returns or assigns external memory

Page 5-3 RPC -320

Image 22
Contents Trademarks REVRevision Table of Contents Interrupt Characteristics Sect ION 11 Watchdog Timer DescriptionExternal Reset Sect ION 13 Multi Mode Counter DescriptionSoftware Revision History Description OverviewSection Manual OrganizationSymbols and Term inology Technical SupportOverview Section System layoutIntroduction Operating PrecautionsEquipment First Time Operation Using a PCUsing a Terminal Uploading and Downloading ProgramsEditing programs and program ming hints Where to GO from Here TroubleshootingEprom Saving ProgramsSaving a Program W3 autorun jumperLoading a Program AutorunningPreventing Autorun Changing Eprom SizeBload CommandsAlternate Eproms BsaveCOM0 Serial Port Serial PortsCOM1 Serial Port RS-422/485 Operating Information Serial Ports SectionRS-422/485 Termination network Two wire RS-485 Accessing Serial BuffersMultidrop Network Disabling CONTROL-C Accessing COM0 and COM1Serial Port PIN OUT RXD CTS RAM Memory Battery BackupChecking the battery Changing MemoryReserved Memory Storing Variables in RAMAssembly Language Interface Block Data TransferDigital I/O Ports Digital and Opto PortsDigital Por t J3 High Current Port L8 Digital I/O CommandsDigital Port P6 Optically Isolated InputHigh Current Output Interfacing Digital I/O to an opto-module rack Interfacing to switches and other devicesDigital I/ O prog ramm ing exam ple Ls e Width Modulation PWM Digital and Opto Ports Section Conne ctor pin ou t J3Line Config LineCount Line BDate Setting Date and TimeM E Section Writing to the Display Connecting DisplaysProgramming Example Display Connector PIN OUT Display TypesKeypad Port Program explanationKeypad Port PIN OUT J5 Initialization Connecting Analog InputsAnalog Input Overvoltage conditionsExamples u sing CON FIG AIN Differential ModeAcquiring Analog Data Temperature Measurement Noise NotesAnalog Input Section Data logging on a timer tick Measuring Higher VoltagesAmplifiers Converting Analog MeasurementsMeasuring 4-20 mA current loops Calibration Watchdog Timer External ResetOptically Isolated Interrupt Interrupt CharacteristicsProgram Example Optically isolated and TTL interrup ts Load ProgrammingGND GateCOU NT0 Power Management Further Power ReductionPower Management Section Program Examp leElectrical Specifications Technical InformationJumper Descriptions Mechanical SpecificationsMemory and I/O Bank MAP Bank