74hc595
Mctmark
Posts: 5
Could someone please tell me the Digikey part number of the proper 74HC595 I would use in this example· http://www.parallax.com/dl/docs/books/sw/exp/sw23b.pdf·and I am also unclear from this programing example of how I would address a individual LED output via the 74HC595.
For example, lets say I have two 74HC595 and I want to turn on a particular LED out of the 16 to choose from. How do I program the BS2 to turn on or off a particular LED in this example http://www.parallax.com/dl/docs/books/sw/exp/sw23b.pdf.
Thanks
For example, lets say I have two 74HC595 and I want to turn on a particular LED out of the 16 to choose from. How do I program the BS2 to turn on or off a particular LED in this example http://www.parallax.com/dl/docs/books/sw/exp/sw23b.pdf.
Thanks
Comments
UPDATE: Good ol' Parallax stocks the '595 -- http://www.parallax.com/detail.asp?product_id=602-00009
Post Edited (PJ Allen) : 6/23/2007 4:39:06 AM GMT
If you have 16 LEDs connected to the two 74HC595 shift registers you must have a word variable that you’re shifting out to them. You change the bits in the word variable and shift it out to change individual LEDs. I hope this helps. Take care.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
Make sure you get the package you want (dip or pdip if you don't want surface mount). Should be around $0.50 and no minimum order.
Buy some other stuff while you're there because shipping is going to be about $7 no matter what.
(they sell Parallax stuff also)
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Rick
The MAX3100 from Maxim is a serial communications port (UART) that only needs an external crystal to be complete. It attaches to a microprocessor (like a Stamp) via an SPI interface which requires 4 I/O pins and is controlled with SHIFTIN and SHIFTOUT statements. You can use more than one MAX3100 in which case 3 of the 4 I/O pins can be shared.
To expand the INPUTS (unlike the 74HC595 which allows for more OUTPUTS for LEDs, etc. serially), you can use the 74HC165 to allow up to 8 inputs (or you can cascade more 74HC165's for more inputs) into the BS2.
has one port to talk to the stamp. Its an old chip but works well.
http://forums.parallax.com/showthread.php?p=561893
Thanks
Hello,
If you have 16 LEDs connected to the two 74HC595 shift registers you must have a word variable that you’re shifting out to them. You change the bits in the word variable and shift it out to change individual LEDs. I hope this helps. Take care.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
The StampWorks 2 file is more than 2.43 MB which exceeds the 2 MB·file limit·size·of the forum. However, if you have less than 3 74HC595s used, then simply use my schematic and don't connect the other 74HC595s.
' {$STAMP BS2}
' {$PBASIC 2.5}
' 74HC595 example wit 2 chip daisy chain
Ds· CON 2····················· 'Display Data Pin
St· CON 1····················· 'Display Latch Pin
Sh· CON 0····················· 'Clock Pin
x······ VAR Nib
result· VAR Word
DO
FOR x = 0 TO 15
result=DCD x····························· 'set bit
SHIFTOUT Ds,Sh,MSBFIRST,[noparse][[/noparse]result\16]······ 'output to 2 daisy chained· 74HC595
PULSOUT St,5····························· 'latch display
PAUSE 1000······························· 'pasue fo 1sec
next
loop
Reposted I had forgot the ' after Q7'
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Have Fun
TR
Post Edited (TechnoRobbo) : 8/8/2007 11:58:45 PM GMT
The Stamp Works Manual contains examples of not only controlling one 74HC595 but of daisy chaining them as well. The circuit schematics are included and there are source code downloads on the bottom of the page, as well as a PDF of the book. Take care.
http://www.parallax.com/detail.asp?product_id=27297
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
I am interested in daisy chaining 4 74hc595's to turn on a bank of LEDs.
This is what I have so far:
This turns on all the LEDs except for the one on the 595's PIN15.
Trying to turn the lights off again, using %00000000 with MSBFIRST or LSBFIRST doesn't work.
This of course is for one 595.
I just am not understanding the arguments needed in the SHIFTOUT to make this work.
thanks for any help.
Knowing how DataOut, Clock, Latch and pattern are defined will probably be helpful in troubleshooting your problem. Also, how is the 74x595 wired up?
Regards,
Bruce Bates
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
There's nothing like a new idea and a warm soldering iron.
Bruce, here are my program definitions:
attached is the schematic I used to hook up the 595.
pwillard, thanks for the tip on the 8574. I'd like to understand the 595 setup first, but I can see the 8574 maybe simpler in execution.
Cats are getting skinned.
glenn
'
[noparse][[/noparse] I/O Definitions ]
Clock·········· PIN···· 0······················ ' shift clock (74HC595.11)
SerData········ PIN···· 1······················ ' serial data (74HC595.14)
Latch·········· PIN···· 2······················ ' output latch (74HC595.12)
'
[noparse][[/noparse] Constants ]
DelayTime······ CON···· 200
DelayTime1······ CON··· 200
'
[noparse][[/noparse] Variables ]
pattern········ VAR···· Word··················· ' zig-zag pattern
'
[noparse][[/noparse] Initialization ]
Reset:
· LOW Latch···································· ' make output and low
'
[noparse][[/noparse] Program Code ]
Main:
·· GOSUB Out_595······························ ' put pattern on 74x595·· 1
··· PAUSE DelayTime···························· ' hold
···· pattern = %00000000
···· GOSUB Out_595······························· ' put pattern on 74x595··· 2
··· PAUSE DelayTime···························· ' hold
···· pattern = %00000010
·· GOSUB Out_595······························· ' put pattern on 74x595··· 2
··· PAUSE DelayTime···························· ' hold
···· pattern = %00000100
·· GOSUB Out_595······························· ' put pattern on 74x595··· 3
··· PAUSE DelayTime···························· ' hold
···· pattern = %00001000
··· GOSUB Out_595······························ ' put pattern on 74x595··· 4
··· PAUSE DelayTime···························· ' hold
···· pattern = %00010000
··· GOSUB Out_595······························ ' put pattern on 74x595··· 5
··· PAUSE DelayTime···························· ' hold
···· pattern = %00100000
···· GOSUB Out_595····························· ' put pattern on 74x595···· 6
··· PAUSE DelayTime···························· ' hold
···· pattern = %01000000
··· GOSUB Out_595······························ ' put pattern on 74x595·· 7
··· PAUSE DelayTime···························· ' hold
···· pattern = %10000000
· GOTO Main
'
[noparse][[/noparse] Subroutines ]
Out_595:
· SHIFTOUT SerData, Clock, MSBFIRST, [noparse][[/noparse]pattern]· ' send pattern to '595
· PULSOUT Latch, 5····························· ' latch outputs
· RETURN
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
There's nothing like a new idea and a warm soldering iron.
Also, placing a 0.1uF cap across Power and Ground (as close as possible to the pins) on the 74HC595's wouldn't hurt either.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.
Out_595:
SHIFTOUT SerData, Clock, MSBFIRST, [noparse][[/noparse]pattern] ' send pattern to '595
PULSOUT Latch, 5 ' latch outputs
RETURN
Here is an example of part of a program:
'
[noparse][[/noparse] I/O Definitions ]
Clock PIN 0 ' shift clock (74HC595.11)
SerData PIN 1 ' serial data (74HC595.14)
Latch PIN 2 ' output latch (74HC595.12)
'
[noparse][[/noparse] Constants ]
DelayTime CON 200
'
[noparse][[/noparse] Variables ]
pattern VAR Word ' zig-zag pattern
'
[noparse][[/noparse] Initialization ]
Reset:
LOW Latch ' make output and low
'
[noparse][[/noparse] Program Code ]
Main:
GOSUB Out_595 ' put pattern on 74x595 1
PAUSE DelayTime ' hold
pattern = %00000000
GOSUB Out_595 ' put pattern on 74x595 2
PAUSE DelayTime ' hold
pattern = %00000010
GOSUB Out_595 ' put pattern on 74x595 2
PAUSE DelayTime ' hold
pattern = %00000100
GOSUB Out_595 ' put pattern on 74x595 3
PAUSE DelayTime ' hold
pattern = %00001000
GOSUB Out_595 ' put pattern on 74x595 4
PAUSE DelayTime ' hold
pattern = %00010000
GOSUB Out_595 ' put pattern on 74x595 5
PAUSE DelayTime ' hold
pattern = %00100000
GOSUB Out_595 ' put pattern on 74x595 6
PAUSE DelayTime ' hold
pattern = %01000000
GOSUB Out_595 ' put pattern on 74x595 7
PAUSE DelayTime ' hold
pattern = %10000000
GOTO Main
'
[noparse][[/noparse] Subroutines ]
Out_595:
SHIFTOUT SerData, Clock, MSBFIRST, [noparse][[/noparse]pattern] ' send pattern to '595
PULSOUT Latch, 5 ' latch outputs
RETURN
Make an array to hold the data for each '595:
Then change your Out_595 routine to:
Now in the main program just update the pattern array to change the pin states, then call Out_595 again.
Let us know if this works for ya.
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
www.hittconsulting.com
·
Thanks very much