Remote Processing RPC-2350 User Manual

Page 30

Advertising
background image

DATA MEMORY

CHAPTER 5

5-4

structure it is 28.

Next, assign variable names to the offsets in memory
data begins.

N a m e

Pointing to

Value

DSET

Date string

0

TSET

Time string

9

TPSET

Temperature

18

PSET

T i ck ti m e

22

LSET

Level

26

This is simply done by making a variable equal to a
number. F or example,

PSET = 22

NOTE: The word “ SET” does not have any

significance other than naming the variable.

You w ill need a pointer to track the n umber of data sets
(structur es) saved. You will also have to chec k this
pointer to make sure you are not exceeding the
maximum amount of memory. Use one of the protected
variables (A%-Z% ) as the pointer. This way, if power
disappears, the pointer is still in tact. Protected
variables can also be used to keep track of the segment
used to store data in.

A sample C AMBA SIC line to store data is:

FPOKE A%*28TPSET,value,B%

This example uses A% as the pointer and B% to track
the segment number. ‘TPSET ’ and B% could just as
easily be constants.

This structure will save 2340 elements in 64K of RAM.
Therefore, you should test A% for a limit of 2340 once
each loop.

A 512K RAM can store up to 7 segments. Therefore,
B% is checked fo r a value o f 8 or m ore at the e nd of this
loop.

If your data requirements are more than available RAM,
you can stor e some in F lash. You will ha ve to first w rite
the data to RAM first, then save to flash.

Flash is also used to save critical information. However,
Flash will “ wear out” after 1, 000 to 10,0 00 writes.

You will probably have to make an initial guess at your

program size. As a practical fact, no m ore than about
34K of program can r un at one time. This leaves about
30K in the fir st Flash seg ment and at least this amo unt in
the 2nd. Use the SA VE co mma nd to transf er data to
Flash.

You can start saving at address &8400 and not interfere
with the first program. If you SAVE to segment 9 and
are using graphics on the RPC-2350G, larger fonts are
stored starting at address &AC00. P ut a limit check at
this addres s. W hen a 512K F lash is installed, segmen ts
2 - 7 a r e av a il a bl e , if th e r e a r e no o th e r pr o g ra m s in th e m .

The SYS(0) function returns your progr am size. Y ou
can use this figure to determine where you can start
saving in Flash. Be sure to round up to the next page
boundary (last two bytes of the address) to &00 when
determ ining your data start of a ddress. This is to
account for the Flash block size.

All cases limit maximum address to &F FFF in any one
segmen t. Be sur e to read “ Conside rations for saving to
Flash” below for more inform ation.

Since each situation is unique, call Remote Pr ocessing
technical support at 303 690 1588 to discuss your
problem further.

Considerations f or saving to Flash
The RPC-2350G uses &5A00 bytes in the Flash EPROM
to store gr aphics fonts. The fonts a re stor ed starting in
segmen t 9, ad dress & AC0 0. T his is high enough in
mem ory so no CAM BASIC progr am w ill interfer e with
it. Only if you use medium and large size fonts on the
RPC-2350G will you have to consider this as an upper
memor y limit for storing data. Consider installing a
512K byte flash and saving to segments 2-7.

Flash EPR OM is wr itten to in blocks, or sectors of 128
(29C010A installed) or 256 (29C040A installed) bytes
each. T his means if you want to save just 1 byte, 128 or
256 bytes are used. You m ust pay attention to sector
size for two reasons. F irst, a sector is the minimum
number of bytes written. If a program r equires only 35
bytes to be saved, a full sector is written. If you had the
following in your code:

1000 SAVE 1,5,1,&1000,35
.
.
.
2000 SAVE 1,42,1,&1025,35

Advertising