Remote Processing RPC-150 User Manual
Page 14

DATA MEMORY
CHAPTER 5
Page 12
RPC-150
Figure 5-1 Data memory
INTRODUCTION
The RP C-150 is a vailable with 3 2 of RAM . R AM is in
socket U1. RA M may be battery backed by installing a
DS-1213C in socket U1. RAM is installed on top of U1.
Battery life depends upon RAM power consum ption,
temperature, and amount of time the board is operating.
Generally, a battery life from 5 to 10 years can be
expected.
This chapter discusses installing a battery backup for
RAM , saving and retrieving variables, and running
assembly language programs. Figure 5-1 shows the
location of U1.
If program and data are battery backed, the UNNEW
c o m m an d m ay b e u s ed to r e st or e th e pr o g ra m .
Variables used by the Basic program are clear ed,
however. Data POKE d into RAM is saved.
BATTERY BACKUP
A Dallas Semiconductor DS-1213C is used to battery
backup RAM when power is off. Battery life depends
upon RAM size, type, and time the RPC-150 has power
applied to it. You can expect the battery to last between
5 to 10 years at 25°C. Battery life decreases by 1/2 at
5 0 °C .
To install a DS-1213C, r emove the RAM chip in U1,
install the DS-1213C, and install the RAM chip on top of
the module.
STORING VARIABLES IN RAM
The term "var iables" in this context includes numb ers,
strings, arr ays, recipes, and formulas as applied to your
application.
Program s, CA MBASIC variables, and variables you
POKE and P EEK to are fr om 8000H to FF FFH . The
progr am and b asic numb er var iables (A, B(15), ect.)
are ' on top' of the prog ram and are cleared on reset.
String variables (e.g. c$) are below the stack. The stack
requires 255 bytes and string space will depend upon
how much you C LEAR ed on power up. If you do not
use the CLEAR statement, assume 500 bytes are
available for strings. Data you peek and poke to must be
between the end of num ber variab les and start of strings.
The procedure to determ ine the 'safe' area to Poke
variables follows. First, download and run your
progr am. What you want to do is for ce the basic to
allocate space for most all of the variables in your
p r o gr a m . N e xt , e xi t y o ur p r og r a m a n d p e r fo r m a
PRIN T SYS (2), SYS(1) in the imme diate mod e. T his
will print out the address for the bottom of the stack and
top of the program with variables. Subtract the number
used in your CLEAR statement from the first number
printed. If you did not use the CL EAR statement,
subtract 50 0. In case your progr am did no t execute
completely, you may w ant to add 500 to the second
number. This range is where you can PO KE to.
Many times you will start with a very small program and
add to it. In this case the above procedure is not
adequate. The best w ay to handle this situa tion is to
figure out the number of bytes used for string variables
in the program. This determined by the CLEAR
statement. If you do not use the CLEAR statement, then
you can figure the bottom of the stack and string space
start at address 0FD00H. When you start using POKE
statements, assign new variab les BELOW this address.
To put it another way, count down and not up as you add
POKE locations. Remember when using string and
floating point POKEs the address specified is the starting
address and will go up.
PEEK and PO KE commands store and retrieve values
from memor y. For example:
20 POKE 60000, A
puts the value of A into address 60000.
Use the PEEK statement to retrieve the variable: