BASIC Stamp Architecture – Memory Organization
Page 46
•
BASIC Stamp Programming Manual 2.0b
•
www.parallaxinc.com
You may assign other names (symbols) to these RAM registers as shown
in section "Defining and Using Variables", below.
When the BS1 is powered up, or reset, all memory locations are cleared to
0, so all pins are inputs (DIRS = %00000000). Also, if the PBASIC program
sets all the I/O pins to outputs (DIRS = %11111111), then they will initially
output low, since the output latch (PINS) is cleared to all zeros upon
power-up or reset, as well.
Word Name
Byte Names
Bit Names
Special Notes
PORT
PINS
DIRS
PIN0 – PIN7
DIR0 – DIR7
I/O pins; bit addressable.
I/O pins directions; bit addressable.
W0
B0
B1
BIT0 – BIT7
BIT8 – BIT15
Bit addressable.
Bit addressable.
W1
B2
B3
W2
B4
B5
W3
B6
B7
W4
B8
B9
W5
B10
B11
W6
B12
B13
Used by GOSUB instruction.
Used by GOSUB instruction.
The BS2, BS2e, BS2sx and BS2p have 32 bytes of Variable RAM space
arranged as shown in Table 4.2. Of these, the first six bytes are reserved
for input, output, and direction control of the I/O pins. The remaining 26
bytes are available for general-purpose use as variables.
The word variable INS is unique in that it is read-only. The 16 bits of INS
reflect the state of I/O pins P0 through P15. It may only be read, not
written. OUTS contains the states of the 16 output latches. DIRS controls
the direction (input or output) of each of the 16 I/O pins.
A 0 in a particular DIRS bit makes the corresponding pin an input and a 1
makes the corresponding pin an output. So if bit 5 of DIRS is 0 and bit 6 of
DIRS is 1, then I/O pin 5 (P5) is an input and I/O pin 6 (P6) is an output.
A pin that is an input is at the mercy of circuitry outside the BASIC Stamp;
2
e
2
sx
2
p
2
RAM O
RGANIZATION
(BS2, BS2
E
,
BS2
SX
, BS2
P
).
T
HE
I
NPUT
/O
UTPUT
V
ARIABLES
.
Table 4.1: BS1 RAM Organization.
Note: There are eight words,
consisting of two bytes each for a
total of 16 bytes. The bits within the
upper two words are individually
addressable.
Содержание BASIC Stamp 1
Страница 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...