27100 Parallax Inc, 27100 Datasheet - Page 22

BASIC STAMP REV DX MODULE

27100

Manufacturer Part Number
27100
Description
BASIC STAMP REV DX MODULE
Manufacturer
Parallax Inc
Type
Microcontrollerr
Datasheet

Specifications of 27100

Contents
Board
Product
Microcontroller Basic Stamps
Operating Supply Voltage
5 to 15 V
Board Size
63.5 mm x 38.1 mm x 12.7 mm
For Use With/related Products
BASIC Stamp®
Lead Free Status / RoHS Status
Lead free / RoHS Compliant

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
271000-51300730
Manufacturer:
DENSO
Quantity:
20 000
Part Number:
2710002
Quantity:
7
Part Number:
2710006
Quantity:
42
STAMP FAQS
How do I define aliases to specific bytes within a word array on the BASIC Stamp II, IIe
and IIsx?
Last Revised On: 7/21/00
The BASIC Stamp II, IIe and IIsx uses a very relaxed and flexible indexing scheme when it comes to arrays of
RAM space. When trying to define aliases in this way it is best to view the entire RAM space as one array of
word, byte, nibble and bit registers. The BASIC Stamp II, IIe and IIsx organizes variables in the RAM space from
largest entities (word declarations) to smallest entities (bit declarations), regardless of the order you define them, to
be most efficient. The relaxed nature of indexing allows a user to cross array boundaries at will, or by accident,
quite easily. For example, the following code defines two distinct byte variables:
Normally you would reference the Result and Temp variables by name, as in: Result = 10. Even though this variable
is not an array, you can still access it as such. The code: Result(0) = 10 is equivalent to the previous example. The
most interesting, and powerful, feature is that you can index beyond the boundaries of this byte variable, as in
Result(1) = 20. This statement actually modifies the byte of RAM immediately following the Result variable. The
next byte happens to have been defined as Temp, in this case, thus the variable Temp will now equal 20. By
carefully defining variables we can take advantage of this flexible feature to define byte sized aliases to specific
locations within a word array. Suppose we have the need for an array of three words in which the first three bytes
have a special meaning; we’d like to be able to easily manipulate those bytes as well as access the three distinct
word elements.
Remember: the BASIC Stamp II, IIe and IIsx will always organize RAM space from biggest elements to smallest.
In the example above we defined a single word variable called array (this becomes assigned to the very first word in
RAM space, word 0). The next two definitions create aliases to the first and second bytes of Array (no additional
RAM space is allocated here since we’re pointing at previously allocated space, byte 0 and byte 1). Next we
define a single byte variable (this becomes assigned to the first byte of RAM immediately following the Array
variable, byte 2). Finally, we define an array of three bytes (which are assigned to the next three bytes of RAM
immediately following the previous byte declaration, byte 3, byte 4 and byte 5). Visually, our RAM space now
appears like this:
Now, Array(0), Array(1) and Array(2) refer to the three words of our array and Special1, Special2 and Special3
refer to the first three bytes within our three byte array.
Result
Temp
Array
Special1
Special2
Special3
TheRest
Special 1 (Byte 0)
Special 3 (Byte 2)
TheRest(1) (Byte 4)
VAR
VAR
BYTE
BYTE
VAR WORD
VAR Array.LOWBYTE
VAR Array.HIGHBYTE
VAR BYTE
VAR BYTE(3)
Array (WORD 0)
WORD 1
WORD 2
PROGRAMMING INFORMATION
TheRest(0) (Byte 3)
TheRest(2) (Byte 5)
Special 2 (Byte 1)
Page: 22

Related parts for 27100