Remote-processing RPC-330 Manuale Utente Pagina 20

  • Scaricare
  • Aggiungi ai miei manuali
  • Stampa
  • Pagina
    / 48
  • Indice
  • SEGNALIBRI
  • Valutato. / 5. Basato su recensioni clienti
Vedere la pagina 19
RAM MEMORY SECTION 5
Page 5-3 RPC-330
Figure 5-2 RPBASIC-52 memory map
The highest address in a 32K RAM system is 7FFFH.
Many times it is desirable to store an array containing a
"mixed" set of variables. Suppose you needed to save an
array m ade up of the following elements:
Bytes Type Description
1 Byte Job counter
2 Word Analog output offset
6 Floating Correction factor
20 String Job name
Total number of byes required for each array is 30 (add
1 for a < CR> at the end of the string).
The Job counter is incremented ever y time it is
completed. Analog output offset is an output constant or
other var iable used to initialize the outputs. Job name is
used with the display to identify a job.
For this example, suppose there are 20 of these arrays
that need to be set up. A program fragment is as
follows:
100 STRING 400,20 Initialize 20 string arrays
300 NO = 12 Element to fill
310 CF = 23.432 Correction factor
320 JC = JC + 1 Job counter
330 AC = 25 Analog offset
350 GOSUB 1000
500 NO = 5 Element to retrieve
510 GOSUB 2000 Retrieve variables
This subroutine stores variables CF, JC, A C, and string
$(1) into an array starting in segment 1, address 0.
1000 POKEB1, 30*NO, JC
1010 POKEW1,30*NO+ 1,AC
1020 POKEF1,30*NO+ 3,CF
1030 POKE$1, 30*NO+ 9,$(1)
1040 RETURN
Subroutine 2000 - 2040 retrieves data into variables CF,
JC and AC.
2000 JC = PEEKB(1,30*NO)
2010 AC = PEEKW (1,30*NO+ 1)
2020 CF = PEEKF (1,30*NO+ 3)
2030 $(1) = PEEK$(1, 30*NO+ 9)
2040 RETURN
You can store and retrieve strings and other kinds of
variables in this way. There are many variations of
PEEK and POKE statements. Refer to the RPBASIC-52
Software Supplement in this manual for additional
information and examples. A list of commands appears
at the end of this section.
BLOCK DATA TRANSFER
Blocks of data are transferred to and from RAM and
flash EPROM using BLOAD and BSAVE commands.
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 can be
moved is limited by the RAM and EPR OM sizes.
Transfers from EPROM to RAM , using BLOAD, take
approximately 23.5 m s/1000 bytes. T ransfers from
RAM to EPROM , using BSAVE, are even longer at 100
ms/1000 bytes using a 512K byte EPROM. T his time is
even longer when smaller EPROM s are used (due to the
programming algorithm).
Serial port, tick timer, and external interrupts are
enabled dur ing these transfers. However, responses to
ONT ICK or ONIT R are delayed by the time it takes to
transfer data. W hen ONTIC K or ONITR must be
serviced faster, transfer data in sm aller blocks.
Refer to BLOAD and BSAVE in Appendix A for more
information.
Vedere la pagina 19
1 2 ... 15 16 17 18 19 20 21 22 23 24 25 ... 47 48

Commenti su questo manuale

Nessun commento