using 4 74hc164 to control 8x8 matrix of rgb LEDs

hi i am trying to control an 8x8 matrix of rgb leds using 4 74hc164 shift registers. the problem i’m having is that only one of the shift registers are outputting at one time. the code im using is:

digitalWrite(latch,LOW);
shiftOut(data1,clock,MSBFIRST,0x80);
shiftOut(data2,clock,MSBFIRST,0x80);
digitalWrite(latch,HIGH);

but there is only input coming from the second shift out. it is as though the first shift out is being overwritten by the second one. all the shift registers are working individually. im using separate data pins for each shift register but a common clock.

any advise would be appreciated. Thanks

qhb10153: digitalWrite(latch,LOW);   shiftOut(data1,clock,MSBFIRST,0x80);   shiftOut(data2,clock,MSBFIRST,0x80);   digitalWrite(latch,HIGH);

I'm curious....which pins do you have connected to "latch" (On Arduino, and on Shift Register)??

(Please, no help from others on this one.)

any advise would be appreciated. Thanks

• Use code tags. • Post all of your code

Poor choice of parts: http://www.ti.com/lit/ds/symlink/sn74hc164.pdf ±4-mA Output Drive at 5 V Continuous current through VCC or GND . . ±50 mA

Better choice is CD74AC164 http://www.ti.com/lit/ds/symlink/cd74ac164.pdf

"Latch" in this case doesn't really apply as these are single stage shift registers and not a 2-stage as in 74HC595 (which is also not a good LED driver with 70mA limit) or TPIC6B595, which much better for sinking current from common anode parts.)

@1chicagoDave- I've made my own latch using a transistor so that voltage is supplied when the pin is set to high, as the 74hc164 has no latch pin

@crossRoads - I'm using the 74hc164 shift registers to control transistors not the actual LEDs. I have an external power supply to provide more current.

You have MR/ connected to +5, and 0.1uF caps from VCC pin to Gnd? You're controlling 8 anodes, 24 cathodes? Or 8 cathodes, 24 anodes? Doesn't seem like you have enough control with just 2 shiftouts.

I have 8 anodes and 24 cathodes. I only have two shift outs there but I know that I should need 4 of them to control al 32 bits. Sorry I'm quite new to this kind of thing. What is MR? I'm not using any capacitors, should I be using them? The problem is that I don't seem to be getting output from more than one of the shift registers. I've tested the outputs using a multimeter and when the second shiftOut is called, there is no output from the first shift register. Do you know if this should happen or should this work by using 74hc164 shift registers?

"MR/" is "master reset not"(i.e. active low). You can't leave it floating, it must be tied high or controlled by an arduino pin. With high speed digital electronics, decoupling capacitors on the power pins are critical for correct operation. A shift register is a shift register - data shifted in should appear at the output.

In this case, what prevents the 2nd shift register from having data clocked in? You have separate data pins, I imagine you are forcing the data pins low but the clock is still occurring, so 0's are getting clocked in. If you used just 1 data pin and daisy chained the data - Q7 from one to a data in on the next with the 2nd data in held high on all of them - you should see the 4 bytes get moved right along.

CrossRoads: In this case, what prevents the 2nd shift register from having data clocked in? You have separate data pins, I imagine you are forcing the data pins low but the clock is still occurring, so 0's are getting clocked in. .

Right. I used two '164s on my first 4x4x4 led cube. Probably not ideal, but...I ended up making it work by using two data pins AND two clock pins.

Hope this makes the usage clear:

Thanks for the advice, I will give it a try