|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--stamp.peripheral.io.SR74xx595
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 |
public SR74xx595(int dataPin, int clockPin, int latchPin)
dataPin
- 74xx595 serial data (74xx595.pin14)clockPin
- 74xx595 shift clock (74xx595.pin11)latchPin
- 74xx595 output latch (74xx595.pin12)Method Detail |
public void out(int value)
value
- 8-bit value to sendpublic void outNoLatch(int value)
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.
value
- 8-bit value to send
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |