Parallax BASIC Stamp 2e Programming Manual page 49

Table of Contents

Advertisement

4: BASIC Stamp Architecture – Memory Organization
Table 4.2: BS2, BS2e, BS2sx and
BS2p RAM Organization. Note:
There are 16 words, consisting of
two bytes each for a total of 32
bytes. All bits are individually
addressable through modifiers and
the bits within the upper three
words are also individually
addressable though the pre-defined
names shown.
the BASIC Stamp cannot change its state. A pin that is an output is set to
the state indicated by the corresponding bit of the OUTS register.
When the BASIC Stamp is powered up, or reset, all memory locations are
cleared to 0, so all pins are inputs (DIRS = %0000000000000000). Also, if
the PBASIC program sets all the I/O pins to outputs (DIRS =
%1111111111111111), then they will initially output low, since the output
latch (OUTS) is cleared to all zeros upon power-up or reset, as well.
Word Name
Byte Names
INL
INS
INH
OUTL
OUTS
OUTH
DIRL
DIRS
DIRH
B0
W0
B1
B2
W1
B3
B4
W2
B5
B6
W3
B7
B8
W4
B9
B10
W5
B11
B12
W6
B13
B14
W7
B15
B16
W8
B17
B18
W9
B19
B20
W10
B21
B22
W11
B23
B24
W12
B25
Note: All registers are word, byte, nibble and bit addressable
The INS variable always shows the state of the I/O pins themselves,
regardless of the direction of each I/O pin. We call this, "reading the
pins". If a pin was set to an input mode (within DIRS) and an external
BASIC Stamp Programming Manual 2.0c • www.parallaxinc.com • Page 47
Nibble Names
Bit Names
INA, INB
IN0 – IN7
INC, IND
IN8 – IN15
OUTA, OUTB
OUT0 – OUT7
OUTC, OUTD
OUT8 – OUT15
DIRA, DIRB
DIR0 – DIR7
DIRC, DIRD
DIR8 – DIR15
Special Notes
Input pins
Output pins
I/O pin direction control

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the BASIC Stamp 2e and is the answer not in the manual?

Table of Contents