ShiftOut Problem with more than one Shift Register

Hi,

I followed the 2nd ShiftOut tutorial to hook up 2 x 74hc595 shift registers.
But for some reason, only one will work at a time.
I have everything hooked up as in the pictures.
I also tried the tutorial with 3 Shift Registers but I ran into the same problem. Only one register works.
They were tested individually, so I don't think any of them are broken.

Anybody have any ideas where connecting these chips can go wrong?

Cheers

  • B

Are you shifting out 8 x the number of Shift Registers of bits?

i.e.
2 Shift Registers, shift out 18 bits
3 Shift Registers, shift out 24 bits
etc.

If not, only the first SR in the chain will work.

2 Shift Registers, shift out 18 bits

I think that should be:-
2 Shift Registers, shift out 16 bits :wink:

anybody have any ideas where connecting these chips can go wrong?

If you don't chain them correctly, common clock, common load / Shift line, serial input of second shift register to bit 7 of the first shift register.

Oops!! :-[

I've had some weird results sometimes with Shift Registers in that they only work if one and only one of the ground connections on Pin 8 on one of the chips is disconnected. It seems to be quite random which chip though. No idea why this is the case as according to the datasheet the ground on that pin is necessary.

Vayner - it is easy when daisy chaining SR's, especially to Dot Matrix Units, to create a rats nest of wires. It is therefore essential you carefully connect everything up exactly as stated in the schematic. The ShiftOut Turoial on the website is good for learning about SR's. I recommend carefully colour coded jumper wires to make your life easier.

Thanks for the replies guys.
I've followed the examples exactly to even match the holes on the breadboard. I've even tried different lengths for the wires that hook up the daisy chain.

I suppose there's nothing you can do unless you see what is going on on my breadboard. I'll restart the example from scratch again and if it still fails I'll upload some pictures.

Cheeers

  • Bjorn

Are you using the tutorial code or your own code? If so post it up here so we can take a look at it.

try swapping the chips around to see if that makes any difference (in case 1 is faulty)

Although I'm almost sure I didn't do anything different, I did get better results by wiring up the second Register while the lights are running.
So I got the second shift register to work as it should.
Now I tried adding a third, doing exactly what I did to add the second.

But the third register isn't responding now. Shift register one and two still operate normally. (I switched them out to see if they work individually, they do)

When using this code and patch: little-scale: Talking to 3 595's via Max/MSP
I can control the first and second shift register, but the third remains unresponsive.

I checked with a multimeter if all the connections are ok. They seem to be fine. I suppose to debug this, it would be helpful to have one of those Arduino examples running while trying out the wire connections.

There's an example in the ShiftOut tutorial that says one line of code needs to be added to add another register. But I can't make out the change. Looks way more different than the hello world example.

Any ideas which line need to be added?

Thanks for the help.

  • Bjorn

Try disconnecting the ground on Pin 9 of Chip 3.

I assume you meant pin 8 or 13. Because those are the only ones with a ground attached. I tried both individually with no different results.
Chip 1 and 2 still work, Chip 3 doesn't.

I've snapped a few pics of what is going on on my breadboard. Sorry for the blurriness. Its shot with a webcam.




Cheers

  • B

I can't see any decoupling capacitors on the chips.

Thanks for the suggestion.
I tried a 1mf capacitor on the first connection from latch pin to ground, which changed nothing. Then tried it on the second and third. No changes and the first 2 chips still work. I also swapped them out again to rule out any defects.

I hoped I just missed something simple, but that doesn't seem to be the case. Any other ideas?

The code I'm using to try to address the 3rd chip comes from: little-scale: Three 595 shift registers

Cheers

  • Bjorn

maybe you allready checked but try to check if your wire on the 3 chip are ok with continuity on a multimeter because i am not sure for yours but my breadboard, the power row is cut in the middle so i can power the lower and upper part individually.... just check in case.... cause you dont seam to send power to the lower part..... and so the 3 chip....

I tried a 1mf capacitor on the first connection from latch pin to ground, which changed nothing.

Decoupling capacitors go across the power supply. Even if you thin they are doing nothing they should be used.
http://www.thebox.myzen.co.uk/Tutorial/De-coupling.html

Thanks. The tutorial goes a little over my head though.
I understand now why these are needed, but I can't make sense of where to place them.
In the ShiftOut tutorial its hooked up between the green wire and the ground. But this this tutorial mentions putting them on the power supply.
I'm a little confused and appreciate your help and patience.

I'll go read up some more.

Cheers

  • Bjorn

The shift out tutorial does not mention decoupling capacitors at all. That is poor. The capacitor shown in the tutorial is on the clock line and you should not need it. In fact I don't know what it is doing and it will stop the circuit working at it's full speed. It is not needed. I suspect it might be left over from a test where the clocking in was done by push button and this was included to stop contact bounce clocking it several times for one push. With a signal derived from a processor it is simply not needed and could prevent it from working.

Point is that when you have more than two chips you need power supply decoupling, normally at 0.1uF. It's not a case of "I tried it and it didn't make any difference so I removed it" you need it.

It is just like a seat belt on a car, well I drove to work and didn't need my seat belt so I am not wearing it again.

It turns out I made a stupid beginners mistake after all. The vertical strip for ground and power is divided into sections. But its done so subtly, I didn't notice. So basically the 3rd IC wasn't grounded and wasn't getting power.
So that is fixed.

I'll have to study up more on using that decoupling technique, because I'm still unsure were to place them. On most schematics I found, an IC is hooked up to a capacitor to the power input. But the IC's I'm working with have 2 power inputs. Vcc and Master Reclear.
I suppose Vcc is the one to connect.
So where do I connect it to? From Vcc to power (instead of a wire). Or placed in parallel from vcc to power with a wire?

Another topic I'll have to study up on is how to distribute power.
I got these 74HC595 because there were some arduino examples for them. I know there are better IC's to drive an LED matrix, but I gotta start somewhere.
My question here is: What do I need to learn to be able to get more power out of the Q0-Q7 pins on the 74hc595?

One of the first things I tried with Arduino was directly driving an LED Matrix using 18 Digital Pins. This worked smoothly and there was enough power supplied over the USB connection.
Currently while using 18 Pins of the 3 Shift Registers, I notice the matrix is getting less power. I want to learn how to get more power to those lights.

Thank you for all the help and sorry for the wild goose chase.
If anything it helped me learn why I need decoupling. I'm just a little lost on putting it into practice.

Cheers

  • Bjorn

595 Shift Registers only supply about 25mA. You can increase that by putting the outputs through a transistor array such as an ULN2003 or using a SR with a higher current output such as an A6821.

But the IC's I'm working with have 2 power inputs. Vcc and Master Reclear.

No it doesn't the MR which stands for Master Reset (not Reclear that is a George Bushissim) is a signal not a power supply. It is not needed in this implementation so it needs connecting to a logic one.

Anyway I can't understand why you can't see where to connect a decoupling capacitor.

ACROSS THE SUPPLY AT THE CHIP.

Can it be any simpler?

If the MC and Vcc are connected to the supply it makes no difference anyway which pin you connect it to as they are both at the +ve supply voltage.

I've used the Allegro "power" Shift registers in the past. They are a good 1-Chip solution.

The problem with Allegro chips... is finding vendors that carry them...

Grumpy_Mike is correct. Of course, that must be why he's grumpy. Place your decoupling cap from VCC to GND as close to the chip as possible. On the 595 those two pins are at opposite corners of the chip so you just have to pick one.