27220 Parallax Inc, 27220 Datasheet - Page 146

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_595x2:
Behind the Scenes
The 74HC595 has a serial output pin (9) that allows the cascading of multiple devices
for more outputs – the serial output from one 595 feeds the serial input of the next
device in line. This works by moving the data in QH to the QH’ output (9) on a new
clock pulse. When connecting cascaded 595s, the Clock and Latch pins should be
tied together to keep all devices synchronized.
In our program we must be concerned with the order of shifted values when working
with cascaded devices.
through each register until the data is loaded into the correct device.
illustration below the value intended for 595-2 is output first and will be shifted
through 595-1.
After the data has been output to all shift registers in the chain, the Latch pulse is
applied to transfer the new data to the 74HC595 output pins.
LOOP UNTIL (pattern = %00000001)
GOTO Main
SHIFTOUT SerData, Clock, MSBFIRST, [counter]
SHIFTOUT SerData, Clock, MSBFIRST, [pattern]
PULSOUT Latch, 5
RETURN
GOSUB Out_595x2
PAUSE DelayTime
pattern = pattern >> 1
Subsequent SHIFTOUT sequences will "push" the data
' shift pattern right
' send counter to 595-2
' send pattern to 595-1
' latch outputs
In the

Related parts for 27220