Go Down

Topic: 16 bit shift register parallel out...? (Read 1 time) previous topic - next topic

ze3one

Hello, I'm having problem understanding how to plug a shift register to arduino, I would like 16 output with 0/1 state with the fewest pin possible.

Is this one correct for the use I want to do?

http://eshop.engineering.uiowa.edu/NI/pdfs/00/95/DS009585.pdf

If yes, how do I plug in to my arduino ( I have a atmega 1280 )

thank you guys

Runaway Pancake

http://www.arduino.cc/en/Tutorial/ShiftOut

"Hello, I must be going..."
"You gotta fight -- for your right -- to party!"
Don't react - Read.
"Who is like unto the beast? who is able to make war with him?"

ze3one

Using the second diagram with 16 led and that codehttp://arduino.cc/en/Tutorial/ShftOut22 it will use only 3 pin two control 16 output with 0/1 state. Is that right?

milamber

Yes. If you set it up as per example 2 you will have 16 outputs using 3 control pins. Be aware that there is an error in the tutorial. The Capacitor that is shown SHOULD NOT be included. There should be NO capacitor on the latch pin.

The example should give you the basics of how to "Shift" data into the registers and how to format that data.

Once you understand the basics you should be able to modify this code, or write new code, to achieve the effect you are after.

On an advanced note, if you need to shift the information faster there is a method to do this using SPI. But for simple lighting effects the ShiftOut function should be fine.

ze3one

Thanks for the information, For my project, I will do a 8*8*8 LEDs cube with 8 layer of 8 by 8 LEDs (anode in \\, cathode in \\), then I'll mutiplex two layer of transistors 8*8, one npn and one pnp, so like that I would be able to light each LED one by one by powering one npn and one pnp. So two 74hc595 for the npn, same thing for pnp. Does shift out gonna be enough fast so we can see all LEDs light at the same time? I know it seem complex, I can post a draft schematic.

milamber

I haven't done anything with LED Cubes but 8x8x8 means 512 LEDs. All of which have to be multiplexed and updated constantly. It may be that ShiftOut won't be fast enough for that purpose.

There are people on here who have made cubes, maybe one of them could chime in.

CrossRoads

I would use SPI.transfer to send data to a cube, way faster than software based shiftout.
Use SCK and MOSI pins, with SS for the shift register latch pin.

digitalWrite (SS, LOW);
SPI.transfer (byte1);
SPI.transfer (byte2);
digitalWrite (SS, HIGH);
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

Go Up