74hc595n shift register error

I want to put in series 2 74hc595N . I made the schematic from here:

When I send a value the first register sends it also to the second one. I have same value on both. I change them (master/slave) but the result is the same. What I am doing wrong because several days ago I made it and it worked.... I can't figure it out.

Albert's ice cream parlor

Albert, Bob, Charlene, and Daisy are lined up in alphabetical order.

Albert is in the role of the CPU, scooping the ice cream. First he scoops out the date-raisin ice cream and hands it to Bob -- even though Bob hates raisins! Then Albert scoops out the chocolate-chip ice cream, and also hands it to Bob. Finally, Albert scoops out a brown cow float, and also hands it to Bob.

Bob, Charlene, and Daisy are in the role of the '595 daisy chain queue. It works like a conveyor belt. If everything works out right, Daisy gets the date-raisin ice cream, Charlene gets the chocolate-chip ice cream, and Bob gets the brown cow float.

Occasionally the CPU drives a positive-going transition on the "latch pin", also called a "storage register clock pin", on pin 12 of the '595. This is like Albert yelling out, "All done. Enjoy the ice cream in front of you!"

Then everyone is happy. (Even Bob, who hates raisins, is happy).

hardware

It looks like your hardware is fine -- the CPU MOSI output (in your case the Arduino pin 2) is connected to the MOSI input of the first '595 pin 14; and the daisy-chain MISO output from the first '595 pin 9 is connected to the MOSI input of the second '595 pin 14.

software

I'm pretty sure we're seeing a minor programming bug or a minor conceptual bug: Why do some people think that "255" is something special?

It sounds like the software is sending 8 bits to the first '595 chip just fine.

Every time you send a byte to the first '595 with shiftRegister.send(), whatever data is currently in that first '595 gets pushed out of it and into the second '595. That's the way daisy-chaining shift registers is supposed to work. The second '595 in the chain is always active.

Often we have a long chain of '595 chips, and we only want to update the value in the first one in the chain. The only way to do that with the normal daisy-chain configuration is for the program in the CPU to remember every value in every '595 chip, and re-send all the values. The johnny-five shift-register program probably needs to do something like:

var first_595 = 24;
var second_595 = 10;
var third_595 = 5;
// ...
// Always send all three values, in this order:
shiftRegister.send(third_595);
shiftRegister.send(second_595);
shiftRegister.send(first_595);


Some people find it a little backwards that the first value the CPU pushes out is the value for the last '595 chip in the chain; and the last value the CPU pushes out is the value for the first '595 chip directly connected to the CPU.

What can I say? That's the way Albert's ice cream parlor works.

You're sending the same serial data to both. Don't do that. Instead connect the serial out of the first to the serial in of the second.

• i connected q7' ( 9 pin) to data pin on second ( 14 pin). – Val Valli Dec 7 '14 at 11:37
• And you're sending two different bytes in a row? – Ignacio Vazquez-Abrams Dec 7 '14 at 11:38
• no. i send just a value. like 24.... until 255 the second one shouldn't be active... – Val Valli Dec 7 '14 at 11:39
• Are you sending it as one byte or as two? – Ignacio Vazquez-Abrams Dec 7 '14 at 11:40
• i don't know i use johnny five (node.js) to do that. is like shiftRegister.send(24); – Val Valli Dec 7 '14 at 11:41

This question shows a schematic for connecting multiple 595s in series or parallel. If you want those chips to be connected in series then Q0-Q7 should only go to the first chip and Q7' from the first chip to data pin of the second chip. In your schematic Q0-Q7 are connected to both 595 chips.

On the software side you need to send to bytes. First one sets the values to the 2nd chip in series and the second byte to the 1st chip. (It's like bits being passed on from chip to chip.) Then you need to throw the latch to get those values set on 595s outputs.

More often than not, something is connected wrong, there is a bad connection or even more likely a simple error in the software.