Pages: [1]   Go Down
Author Topic: 16 bit shift register parallel out...?  (Read 1197 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 9
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Offline Offline
Faraday Member
**
Karma: 66
Posts: 2588
Now, More Than Ever
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Logged

"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?"

Offline Offline
Newbie
*
Karma: 0
Posts: 9
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

Australia
Offline Offline
Jr. Member
**
Karma: 2
Posts: 65
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 9
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Australia
Offline Offline
Jr. Member
**
Karma: 2
Posts: 65
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 549
Posts: 27425
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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);
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Pages: [1]   Go Up
Jump to: