
WRITE - BASIC Stamp Command Reference
Page 330
•
BASIC Stamp Programming Manual 2.0b
•
www.parallaxinc.com
WRITE 100, 245
--or--
WRITE 100, 245
The EEPROM is organized as a sequential set of byte-sized memory
locations. The WRITE command only stores byte-sized values into
EEPROM. This does not mean that you can't write word-sized values,
however. A word consists of two bytes, called a low-byte and a high-byte.
If you wanted to write a word-sized value, you'll need to use two WRITE
commands and a word-size value or variable (along with some handy
modifiers). For example,
SYMBOL Value = W0 'The full word-sized variable
SYMBOL Value_Low = B0 'B0 happens to be the low-byte of W0
SYMBOL Value_High = B1 'B1 happens to be the high-byte of W0
Value = 1125
WRITE 0, Value_Low
WRITE 1, Value_High
--or--
Value VAR WORD
WRITE 0, Value.LOWBYTE
WRITE 1, Value.HIGHBYTE
When this program runs, the two WRITE commands will store the low-
byte and high-byte of the number 1125 into EEPROM.
EEPROM differs from RAM, the memory in which variables are stored, in
several respects:
1. Writing to EEPROM takes more time than storing a value in a
variable. Depending on many factors, it may take several
milliseconds for the EEPROM to complete a write. RAM storage is
nearly instantaneous.
2. The EEPROM can only accept a finite number of write cycles per
location before it wears out. Table 5.94 indicates the guaranteed
number of writes before failure. If a program frequently writes to
the same EEPROM location, it makes sense to estimate how long it
W
RITING WORD VALUES VS
.
BYTE
VALUES
.
1
2
e
2
sx
2
p
2
1
2
e
2
sx
2
p
2
S
PECIAL NOTES FOR
EEPROM
USAGE
.
Summary of Contents for BASIC Stamp 1
Page 1: ...BASIC Stamp Programming Manual Version 2 0c...
Page 34: ...Quick Start Guide Page 32 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Page 340: ...ASCII Chart Page 338 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Page 342: ...Reserved Words Page 340 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Page 346: ...Conversion Formatters Page 344 BASIC Stamp Programming Manual 2 0b www parallaxinc com...