Remote Processing RPC-210 User Manual
Page 26

RAM
BASIC
SECTION 5
Page 5-1
Figure 5-1 RPBASIC-52 Mem ory Map
INTRODUCTION
RAM
S E C T IO N 5
512K of RAM is battery backed on the RPC-210. RAM
size is deter mined by the IC in U 5, w hich is solder ed in
at the time of production.
Battery to back up RAM life depends upon several
factors: RAM size, power consumption, am bient
temper ature, humidity, and amo unt of time the board is
operating. Generally, a battery life of about 3 to 5 years
can be expected. Operating the board at 50°C reduces
battery life by ½.
Maximum progr am and variable size is about 60K.
Additional R AM increase s the amou nt of space av ailable
for PEEK and PO KE storage.
This section s discusses savin g and re trieving va riables to
R A M .
SAVING AND READING RAM DATA
The following commands ar e used to read from and
w r it e t o R A M .
PEEKB
POKEB
PEEKW
POKEW
PEEKF
POKEF
PEEK$
POKE$
BLOAD
BSAVE
PEEK and POKE type com mands work on bytes (B
suffix, 8 bit length), words(W suffix, 2 bytes), floating
point numbers(F suffix,6 bytes ), or strings ($ suffix, set
by STRING command). A segment number,
correspo nding to a 64K block, along with an addre sses,
allows access to all RAM on a board. BLOAD and
BSAVE c an be though of as block transfe r comm ands.
BSAVE, however, writes to Flash EPRO M only.
Sample program ARRAY S.BAS show how to store and
retrieve “mixed” data types using RAM.
NOTE: Futur e version (Per haps starting in 2012) will
have an enhanded BSAVE com mand. The
newer BSA VE com mand will have an erase
flash sector capability. Contact R emote
Processing for mor e information.
PEEK segment limits are different on the RPC-210 than
those listed in the R PBASIC -52 man ual. segment limits
are 0-15 instead of 0-7. segment 8-15 accesses EPROM.
Writing and reading memory
See mem ory m ap figure 3-2. "D ata storag e area" is
segmen t 1 to 7 in RAM , 9 to 1 5 in EP ROM . A void
writing to segment 0.
PEEK and POKE type com mands store and retrieve
values from memory. For example:
20 POKEB1,12,A
puts the byte value of A into segment 1, addr ess 12.
Use the PEEK statement to retrieve the variable:
50 B = PEEKB(1,12)
Saving different data types
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 elem ents:
Bytes
Type
Description
1
Byte
Job counter
2
Word
Analog output offset
6
Floating point
Corr ection factor
20
String
J o b n a m e
Total number of byes required for each array is 30 (add
1 for a < CR> at the end of the string).
The Job c ounter is inc rem ented ever y time it is
completed. A nalog 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.