Rahatzi:
Yes, I am using 4 8 bit shift registers. The schematic I posted was only an example I found that I was using to wire the 4 shift registers that I am using. And yes, I am working with 32bits
My plan is to drive the high side with only three pins. (clock, clear serial).
The code I posted works with only 8 bits, and since I am a little programming impaired, I am having a hard time figuring out control the 25 individual LED's with 32bits, using 4 cascaded 74hc164's.
Thanks
Yeah, with 32 bits at your disposal you can connect 5 to the NPN transistors and use the other 25 as the top side drivers, leaving 2 unused. Better idea.
So, if you send 4 bytes at your registers using shiftout, then that is all they need to be able to drive your setup. For example, to light all the pins on layer 1 you might send this:
bit 31 ........................................... bit 0
xx111111 11111111 11111111 11100001
The idea being that bits 0-4 are connected to the NPN transistors which control your layers. They are the common cathodes of all LEDs on that layer so each is connected to 25 LEDs. All are off except bit 0 which is 1 and enables on your first layer by connecting it to ground. Bits 5-29 are the common anodes of your LED "columns". Each is connected to 5 LEDs. Putting a bit 1 on a column enables it by connecting it to +V. When a column in a layer is connected both ways, it illuminates (put resistors on the columns!) Bits 30 and 31 do not matter and can go either way.
So, I am terrible and I would probably bitbang this instead of using shiftout. But my understanding of shiftout is you send the bytes FF, FF, FF, and then C1 and it would have this effect. I am choosing to represent the Xs as 1s.
To illuminate all 25 LEDs on the second layer using this scheme it would be FF FF FF C2, third layer FF FF FF C4, fourth layer FF FF FF C8, fifth layer FF FF FF D0.
To do this dynamically and pick and choose which columns you want to illuminate, you will have to use bitwise arithmetic to pick and choose the bits within those bytes to send. You will have to do some reading on this subject. This is a good start:
http://playground.arduino.cc/Code/BitMath
Also, remember to refresh the layers at about 100Hz, so 500 times per second through the cube. This is easy to achieve.