74hc595 problems daisychaining
remmi870
Posts: 79
i am having problems with two hc595's running them in tandem, the clock and latch are paralled between the two and i run the output from the first chip to the second. the first chip wil work standing alone, i can get the chip to count up, but if i add the second chip and connect the latch pin to the first chip i get a erractic output and eventual all the pins go high, is the second chip damaged or is there something im missing?
Comments
Can you provide a schematic?
What are the RESET lines doing? ... as well as the OUTPUT Enable lines?
"... i run the output from the first chip to the second... " - Just to confirm, this should be from pin 9 of the first stage to pin 14 of the second stage.
Do you have a decoupling cap of .1uF to .01uF across pins 8 and 16 of each chip?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.
http://www.parallax.com/dl/docs/books/sw/exp/sw23b.pdf
See the attached drawing (disregaurd the SX adaptation note) and the BS2 counter code. This is set up for 3 cascaded 74HC595 chips but you can take out the 3rd set if you only want 2.
Post Edited (T&E Engineer) : 2/4/2009 2:06:36 PM GMT
Explain a little more of what you want to do, and I will see if I can help (or other forum user too).
Let's break it down and start with the FORWARD subroutine to start:
Step 1 - pattern1=%00000001
Step 2 - Shift that bit into the first 74HC595's output pin 15
Step 3 - Wait and delay so you can see the LED on at pin 15
Step 4 - Shift that bit to the left now so pattern1=%00000010
Step 5 - Loop though the remaining 7 bits from pattern1 into the 74HC595.
What you see at this point is a single LED turning on and off across the 8 output pins of the first 74HC595.
Step 6 - Take the overflow from pin 9 of the 1st 74HC595 and input that into the Data in (pin 14)·on the 2nd 74HC595
Step 7 - This process continues as the data now gets shifted as the next 8 bits get pushed through the first 74HC595 into the 2nd 74HC595
What you see at this point is a single LED turning on and off across the 8 output pins of the second 74HC595. At the end of this, the 2 sets of 8 bits have been shifted through (2) 74HC595s. Remember the shifting caused previsous bits to have 0's in them (meaning the LEDs are off - except for the final LED in the chain staying on).
Step 6 - Take the overflow from pin 9 of the·2nd 74HC595 and input that into the Data in (pin 14) on the·3rd 74HC595
Step 7 - This process continues as the data now gets shifted as the next 8 bits get pushed through the·2nd 74HC595 into the·3rd 74HC595
What you see at this point is a single LED turning on and off across the 8 output pins of the·third 74HC595. At the end of this, the·3 sets of 8 bits have been shifted through (3) 74HC595s. Remember the shifting caused previsous bits to have 0's in them (meaning the LEDs are off - except for the final LED in the chain staying on).
For the BACKWARD routine, the pattern1 (e.g. %10000000) gets shifted to the right this time to make the single LED to turn on in the reverse direction.
The MAIN: program repeats itself with the FORWARD and BACKWARD routines running over and over which gives the LED display a moving display of a LED going from left to right and back to left again to be repeated over and over.
Does this make more sense now?
You’re not limited to only pushing out 16 bits. That limitation is for a single variable and allows for variable bits to be sent out as individual groups. To send out 24 bits to your 3 shift registers you would use something like the following. Note that each variable is an 8-bit byte and three are being shifted out prior to latching the '595.· I hope this helps. Take care.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Engineering
SHIFTOUT Data, clock, MSBFIRST, [noparse][[/noparse] 22045\16, 22045\16, etc.......]
this should give me every other pin two 595's at a time but what is the maximum amount of pairs i can shift at a time?
JonnyMac on the SX forum helped me write some 74HC595 cascaded code for the SX28. With this, I should not run out of memory until I reach about 800 LEDs. If I used an SX48, since it has twice the RAM as the SX28, I should be able to have 1600 LEDs in theory at least. However, in my application I only need to use about 128 LEDs.