1
\$\begingroup\$

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

figure1

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.

\$\endgroup\$
2
\$\begingroup\$

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.

\$\endgroup\$
0
\$\begingroup\$

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.

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

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.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.