74HC595 strange behavior with decoupling capacitor

Hello

Everything connected on the breadboard with the arduino UNO,
74hc595 chip with 8x resistors and diodes, pins data, clock, latch are connected to the arduine
pullup/pulldown on the two input pins that are not connected to the arduino

Now the strange part, I had connected a decoupling capacitor 0.1 uF across VCC and GND on the chip because I think you're supposed to do that? When I tested the circuit I had some problems, I slowed the program down so I could see what happened and it would seem that everytime the arduino sent a "1" this would light up 2 leds :confused:

However if I remove the capacitor the circuit seems to work perfectly! what's causing this, is it because of the breadboard and long wires, wrong capacitors? Is it really necessary to add a decoupling capacitor on this type of chip,

Yes, decoupling capacitors are mandatory for fast logic chips.

What's happening is the clock pulses are bouncing about on the long wires because they are not
terminated. This creates a double clock pulse. Without the decoupling cap the chip malfunctions,
which happens to look like its working better, but that was just luck.

There are two basic approaches to handling the reflections on the long lines, stopping the
reflections and reducing the bandwidth enough that the timescale of the bounces is outside
the passband.

I suggest trying this first:

At the 595 clock input add a 270 ohm resistor to ground and another 270 ohm to Vcc. This will
roughly terminate the line (which is what by the way?).

You could alternatively use 150 ohm just to ground, but that stresses the Arduino output pin more.

The other signals are less likely to be an issue since double pulses shouldn't matter on them, but
they can be terminated too.

Please describe your long cable...

OK thanks! that's what I suspected I wanted to know why it doesn't work like it's supposed to

I was probably unclear, the wires are just jumper wires on the board maybe 10cm, they are only long compared to if they had been traces on a printed circuit board, but I have seen strange things happen this breadboard before that's why I'm suspicious about the wiring I'll try and terminate the clock input with resistors and see what happens, I'll try with a new capacitor as well

Also the ground for the circuit is connected to one of of the gnd's next to the 3.3V and 5V pins on the board, I noticed there is also a ground pin right next to the output pins I'm using (13, 12 , 8 ) I would assume all the ground pins are common ground on the board

Termination is not needed for 10cm breadboard wiring.
Decoupling of VCC close to the chip is always needed.

Post a clear picture of your breadboard.
Leo..

Wawa:
Termination is not needed for 10cm breadboard wiring.
Decoupling of VCC close to the chip is always needed.

Post a clear picture of your breadboard.
Leo..

Ok it's new to me I guess this is what we are talking about

for me it sounds like something you would normally put on a long cable,

Anyway I added the two resistors as Mark suggested and this worked with the capacitor
I have taken it apart now so I can't take a picture but I'm rebuilding it later and will add a second 74hc595 so I'll see if the problem is still there :slight_smile: