
SERIAL EEPROM CHAPTER 13
Page 34 RPC-30
DESCRIPTION
The serial EEPROM is a 128 byte, non-volatile device
that stores your programs parameters. Strings, integers,
and floating point numbers can be saved to EEPROM.
Information such as calibration constants, recipes, RS-
485 address, or other "soft" inform ation that may change
over time should be stored in the serial EEPROM.
The LOAD # and SAVE # commands are used to get
and store data to and from the EE PROM . The syntax is:
SAVE #address
LOAD #address
Where address is the location in RAM. address is in the
range of &8000 to &FFFF . Take ca re to make sure you
are not POKEing into program or reserved memory
addresses. Use the SYS(1) and SYS(2) functions to the
addresses for free space. LOA D and SA VE effectively
require 128 bytes of free RAM . The L OAD # com mand
reads 128 bytes from the serial EEPROM and transfers
this information starting at the address specified.
An EEPROM is more secure than battery backed RAM
because it is more difficult to write to it. Several
microprocessor instructions must take place before a
byte is changed. RAM , on the other hand, requir es only
a momentary pulse to modify its memor y.
Each byte can be written to 10,000 times and read from
any number of times. The EEPROM could be updated
once a day for over 27 year s before this limit is
exceeded.
Do not constantly store information to the EEPROM.
That is, do not continuously write to it once a second as
part of your program . This is one electronic part you
can "wear out".
PROGRAM EXAMPLE
The following program example saves and retrieves a
string and a number to the serial EEPROM.
100 'Save to EEPROM
110 'Put string of known length to RAM
120 A$ = ">03"
130 C = 14.35
140 POKE$ &E000,A$
150 'Put a number to RAM
160 FPOKE &E020,C
170 'Save to EEPROM
180 SAVE #&E000
200 'Load from EEPROM
210 LOAD #&E000
220 'Now put info in variables
230 B$ = PEEK$(&E000)
240 D = FPEEK(&E000)
When saving strings, the amou nt of mem ory r equired is
1 + the string length. Floating point numbers require 6
bytes, integers r equire only 1 byte. You may find it
desirable to make a "memory" map of the data types you
wish to save. You can " stack" different kinds of data
next to each other (strings, integers, floating point
numbers) so long as you know where you are saving and
retrieving them.
Kommentare zu diesen Handbüchern