27220 Parallax Inc, 27220 Datasheet - Page 155

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 ]-----------------------------------------------------
Get_165:
Put_595:
Behind the Scenes
This program is a fairly simple combination of the previous experiments – with one
critical detail: the placement of a 4.7 kΩ resistor between the 74HC165 data output
pin and the 74HC595 data input pin. The reason that this is required is the 74HC165
data output pin is just that, an output, and if that pin were connect directly to the
BASIC Stamp a data collision could occur (when the BASIC Stamp puts the serial
data pin in output mode for SHIFTOUT) that would cause a short circuit.
resistor provides a load that safely limits the current between the BASIC Stamp had
the 74HC165.
The resistor also gives the BASIC Stamp a load to drive its output across, so no
matter what the state of the 74HC165 output pin, the data input of the 74HC595 will
always be correct. Do not leave the 4.7 kΩ resistor out of the circuit; otherwise your
BASIC Stamp module could be damaged. Notice that the serial data line is made an
input (floating) at the end of the Put_595 subroutine.
between the BASIC Stamp and the 74HC165 when the pins are in opposite states.
PULSOUT Load, 5
SHIFTIN SerData, Clock, MSBPRE, [xInputs]
RETURN
SHIFTOUT SerData, Clock, MSBFIRST, [xInputs]
PULSOUT Latch, 5
INPUT SerData
RETURN
' load inputs
' shift them in
' send inputs to 595
' latch 595 outputs
' float data I/O line
This stops current flow
The

Related parts for 27220