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
.
Содержание BASIC Stamp 2e
Страница 1: ...BASIC Stamp Programming Manual Version 2 0c...
Страница 30: ...Introduction to the BASIC Stamps Page 28 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 34: ...Quick Start Guide Page 32 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 90: ...BUTTON BASIC Stamp Command Reference Page 88 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 118: ...END BASIC Stamp Command Reference Page 116 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 128: ...FREQOUT BASIC Stamp Command Reference Page 126 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 196: ...NAP BASIC Stamp Command Reference Page 194 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 206: ...OWIN BASIC Stamp Command Reference Page 204 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 214: ...OWOUT BASIC Stamp Command Reference Page 212 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 216: ...PAUSE BASIC Stamp Command Reference Page 214 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 226: ...POLLMODE BASIC Stamp Command Reference Page 224 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 232: ...POLLOUT BASIC Stamp Command Reference Page 230 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 236: ...POLLRUN BASIC Stamp Command Reference Page 234 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 240: ...POLLWAIT BASIC Stamp Command Reference Page 238 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 262: ...RCTIME BASIC Stamp Command Reference Page 260 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 274: ...RUN BASIC Stamp Command Reference Page 272 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 310: ...SEROUT BASIC Stamp Command Reference Page 308 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 324: ...STOP BASIC Stamp Command Reference Page 322 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 340: ...ASCII Chart Page 338 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 342: ...Reserved Words Page 340 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 346: ...Conversion Formatters Page 344 BASIC Stamp Programming Manual 2 0b www parallaxinc com...