27220 Parallax Inc, 27220 Datasheet - Page 142

BOOK STAMPWORKS

27220

Manufacturer Part Number
27220
Description
BOOK STAMPWORKS
Manufacturer
Parallax Inc
Datasheet

Specifications of 27220

Accessory Type
Booklet
Product
Microcontroller Accessories
Lead Free Status / RoHS Status
Not applicable / Not applicable
For Use With/related Products
StampWorks
Lead Free Status / RoHS Status
Lead free / RoHS Compliant, Not applicable / Not applicable
' -----[ Subroutines ]-----------------------------------------------------
Out_595:
Behind the Scenes
The BASIC Stamp is extraordinarily flexible in its ability to redefine the direction
(input or output) of its I/O pins, yet very few applications require this flexibility. For
the most part, microcontroller applications will define pins as either inputs or outputs
at initialization and the definitions will remain unchanged through the program.
We can use the fact that outputs are outputs and conserve valuable BASIC Stamp
I/O pins at the same time by using a simple component called a serial-in, parallel-out
shift register. In this experiment, the 74HC595 shift register is used. With just three
BASIC Stamp I/O pins, this program is able to control eight LEDs.
The 74HC595 converts a synchronous serial data stream to eight parallel outputs.
Synchronous serial data actually has two components: the serial data and a serial
clock. The BASIC Stamp’s SHIFTOUT instruction handles the details of the data and
clock lines and writes data to a synchronous device, in this case, the 74HC595. The
figure below illustrates the relationship between the clock and data signals for the
value $AF.
SHIFTOUT SerData, Clock, MSBFIRST, [pattern]
PULSOUT Latch, 5
RETURN
' send pattern to '595
' latch outputs

Related parts for 27220