stamp.peripheral.io
Class SR74xx595

java.lang.Object
  |
  +--stamp.peripheral.io.SR74xx595

public class SR74xx595
extends Object

This class provides an interface to the 74xx595 serial-in/parallel-out shift register.

74xx595 Pin Connections:
(1) Qb output - bit 1 of output data
(2) Qc output - bit 2 of output data
(3) Qd output - bit 3 of output data
(4) Qe output - bit 4 of output data
(5) Qg output - bit 5 of output data
(6) Qg output - bit 6 of output data
(7) Qh output - bit 7 of output data
(8) Ground (Vss)
(9) SQh (serial output to next 74xx595)
(10) Reset (normally connected to Vdd)
(11) Shift clock (connects to defined clock output from Javelin)
(12) Latch clock(connects to defined latch outp from Javelin)
(13) Output enable (normally connected to Vss to allow outputs)
(14) Serial data input (connects to defined data output from Javelin)
(15) Qa output - bit 0 of output data
(16) Vdd (+5 volts)

Design Note: Latch pin (74xx595.12) should be pulled low to Vss through a 10K resistor to prevent false output latching during Javelin start-up.

Usage:

SR74xx595 leds = new SR74xx595(CPU.pin0, CPU.pin1, CPU.pin2);

Note that the data pin is an output; be careful when sharing this pin with other devices that expect it to be an input (i.e., 74xx165).


Constructor Summary
SR74xx595(int dataPin, int clockPin, int latchPin)
          Creates 75xx595 serial-in/parallel-out shift register object.
 
Method Summary
 void out(int value)
          Sends and latches data to 74xx595.
 void outNoLatch(int value)
          Sends data to 74xx595 without latching to outputs.
 
Methods inherited from class java.lang.Object
equals
 

Constructor Detail

SR74xx595

public SR74xx595(int dataPin,
                 int clockPin,
                 int latchPin)
Creates 75xx595 serial-in/parallel-out shift register object.
Parameters:
dataPin - 74xx595 serial data (74xx595.pin14)
clockPin - 74xx595 shift clock (74xx595.pin11)
latchPin - 74xx595 output latch (74xx595.pin12)
Method Detail

out

public void out(int value)
Sends and latches data to 74xx595.
Parameters:
value - 8-bit value to send

outNoLatch

public void outNoLatch(int value)
Sends data to 74xx595 without latching to outputs.

This method is used when multiple 74xx595s are daisy-chained together. When using multiple devices, the first data out is for the device furthest from the Javelin.

Parameters:
value - 8-bit value to send