BASIC stamp manual v2.2

5: BASIC Stamp Command Reference – GET
BASIC Stamp Syntax and Reference Manual 2.2 www.parallax.com Page 205
Table 5.28: Layout of SPRAM
Registers.
NOTE: Scratch Pad RAM can
only be accessed with the GET
and PUT commands. Scratch
Pad RAM cannot have variable
names assigned to it.
Location BS2e and BS2sx BS2p, BS2pe, and BS2px
0...62 General Purpose RAM General Purpose RAM
63
Bits 0-3: Active program
slot number.
General Purpose RAM
64..126 n/a General Purpose RAM
127 n/a
Bits 0-3, Active program slot #. Bits 4-7, program
slot for READ and WRITE operations.
128 n/a
Polled input trigger status of Main I/O pins 0-7
(0 = not triggered, 1 = triggered).
129 n/a
Polled input trigger status of Main I/O pins 8-15
(0 = not triggered, 1 = triggered).
130 n/a
Polled input trigger status of Auxiliary I/O pins
0-7 (0 = not triggered, 1 = triggered).
131 n/a
Polled input trigger status of Auxiliary I/O pins
8-15 (0 = not triggered, 1 = triggered).
132 n/a
Bits 0-3: Polled-interrupt mode, set by
POLLMODE
133 n/a
Bits 0-2: Polled-interrupt “run” slot, set by
POLLRUN.
134 n/a
Bit 0: Active I/O group; 0 = Main I/O,
1 = Auxiliary I/O.
135 n/a
Bit 0: Polled-output status (set by POLLMODE);
0 = disabled, 1= enabled.
Bit 1: Polled-input status; 0 = none defined,
1 = at least one defined.
Bit 2: Polled-run status (set by POLLMODE);
0 = disabled, 1 = enabled.
Bit 3: Polled-output latch status;
0 = real-time mode, 1 = latch mode.
Bit 4: Polled-input state;
0 = no trigger, 1 = triggered.
Bit 5: Polled-output latch state;
0 = nothing latched, 1 = signal latched.
Bit 6: Poll-wait state; 0 = No Event, 1 = Event
Occurred. (Cleared by POLLMODE only).
Bit 7: Polling status; 0 = not active, 1 = active.
Demo Program (GET_PUT1.bsx)
' GET_PUT1.bsx
' This example demonstrates the use of the GET and PUT commands. First,
' slot location is read using GET to display the currently running program
' number. Then a set of values are written (PUT) into locations 0 TO 9.
' Afterwards, program number 1 is RUN. This program is a BS2SX project
' consisting of GET_PUT1.BSX and GET_PUT2.BSX, but will run on the BS2e,
' BS2p, BS2pe and BS2px without modification.
' {$STAMP BS2sx, GET_PUT2.BSX}
' {$PBASIC 2.5}
NOTE: This is written for the BS2sx but
can be used with the BS2e, BS2p,
BS2pe and BS2px also. This program
uses conditional compilation
techniques; see Chapter 3 for more
information.