27100 Parallax Inc, 27100 Datasheet - Page 17

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 make an I/O pin output a high or a low?
Last Revised On: 7/21/00
As with setting I/O pin directions, there are many ways to set the I/O pin states. The most readable and intuitive
method is to use the HIGH and LOW commands. For example:
will first set I/O pin 5 to output mode and then set it to a high (+5V) state. The second line will first set I/O pin 6 to
output mode and then set it to a low (0V) state. Notice that these commands automatically set the pin direction for
you; it’s not necessary to manually set the pins to output when using the HIGH and LOW commands. Keep in
mind that if a pin is set to input, its logical state, high or low, remains the same internally within the BASIC Stamp
but will no longer affect the voltage on the I/O pin.
Another method for setting the pin state is to use the predefined variable OUTS (or PINS in the BASIC Stamp I)
or any one of its derivatives. The following code is functionally equivalent to the first example:
Notice here that we had to explicitly define the I/O pins as outputs first. If we had left the pins as inputs, the OUT5
and OUT6 lines would have changed the state of the pins internally, but those changes would not appear externally
from the BASIC Stamp. OUT0 through OUT15 (or PIN0 through PIN7 on the BASIC Stamp I) are bit variables
which control the logical state of the corresponding I/O pin. OUTS is a 16-bit variable (PINS is an 8-bit variable
on the BASIC Stamp I) in which each bit represents the state of the corresponding I/O pin. A ‘1’ bit means high
and a ‘0’ bit means low. The advantage of this method of declaring pin states is that multiple pin states can be
defined at once:
The above line of code defines I/O pins 7, 6, 4 and 0 as inputs and 5, 3, 2 and 1 as outputs. And sets I/O pins 7,
6, 5, 4, 2 and 0 to logical 0’s and I/O pins 3 and 1 to logical 1’s. Only pins 5, 3, 2 and 1 will output the voltage set
in the OUTS variable because they are the only pins defined as outputs by the DIRS variable. Review the BASIC
Stamp manual for more examples of this.
HIGH 5
LOW 6
DIR5 = 1
DIR6 = 1
OUT5 = 1
OUT6 = 0
DIRS = %00101110
OUTS = %00001010
PROGRAMMING INFORMATION
Page: 17

Related parts for 27100