Remote-processing RPC-2350 Manuel d'utilisateur Page 30

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 83
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 29
DATA MEMORY CHAPTER 5
5-4
structure it is 28.
Next, assign variable names to the offsets in memory
data begins.
Name Pointing to Value
DSET Date string 0
TSET Time string 9
TPSET Temperature 18
PSET Tick time 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 will 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 AMBASIC 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 end 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,000 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 run at one time. This leaves about
30K in the first Flash segment and at least this amount in
the 2nd. Use the SA VE command to transfer 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. Put a limit check at
this address. W hen a 512K F lash is installed, segments
2-7 are available, if there are no other programs in them.
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
segment. Be sur e to read “ Considerations 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
segment 9, address & AC0 0. T his is high enough in
memory so no CAM BASIC program will interfere with
it. Only if you use medium and large size fonts on the
RPC-2350G will you have to consider this as an upper
memory limit for storing data. Consider installing a
512K byte flash and saving to segments 2-7.
Flash EPROM is written to in blocks, or sectors of 128
(29C010A installed) or 256 (29C040A installed) bytes
each. This means if you want to save just 1 byte, 128 or
256 bytes are used. You must pay attention to sector
size for two reasons. F irst, a sector is the minimum
number of bytes written. If a program requires 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
Vue de la page 29
1 2 ... 25 26 27 28 29 30 31 32 33 34 35 ... 82 83

Commentaires sur ces manuels

Pas de commentaire