Pages: [1]   Go Down
Author Topic: Wiring multiple shift registers to Arduino (but not chaining)  (Read 1277 times)
0 Members and 1 Guest are viewing this topic.
Maryland, USA
Offline Offline
Full Member
***
Karma: 0
Posts: 162
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

After playing with two shift registers this weekend and getting them to work in series with the ATmega's hardware SPI, I started thinking of how I could go about wiring multiple shift registers in parallel--meaning driving them with different latch pins but the same SPI clock and data pins.  I don't have any particular projects in mind but I mainly wanted to think this through to see if I understand the electronics theory correctly.

http://www.sparkfun.com/datasheets/IC/SN74HC595.pdf

If I'm reading the datasheet right, then writing to the MOSI and SCK pins will program all shift registers simultaneously, but only the shift register that sees a low-to-high transition on its RCLK (latch pin) will commit the new values.  Is this an acceptable way to run it (rewriting all registers' values every time but only latching the one you need)?  I suppose there's nothing wrong with that, just seems odd. (and I wouldn't feel comfortable controlling something mission critical like that, not that I'm making anything mission critical though LOL)

An alternate configuration I thought about would be making it so the SCK pin has to pass through a PNP transistor (1 per shift register chip) before reaching each shift register's SRCLK pin, and that PNP transistor's base will go to the latch pin for that relevant shift register--the result being that each shift register will only see the SCK signal if its corresponding latch pin is set LOW, thus making the latch pin an effective selector pin too.  Does this sound right?  Just want confirmation if I'm following the logic correctly.

I'm guessing the transistors for each shift register would be wired with Base->Latch pin on arduino, Emitter->SCK pin on Arduino, Collector->SRCLK pin on the shift register.  I suppose a suitable resistor would be needed on the Base too? or maybe not... and would I need a pull-down resistor on the shift register's SRCLK pin?
« Last Edit: May 09, 2011, 11:29:35 am by spirilis » 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

"writing to the MOSI and SCK pins will program all shift registers simultaneously, but only the shift register that sees a low-to-high transition on its RCLK (latch pin) will commit the new values."

Yes!

Transistor enabling of the control would work, but is not needed if you have pins for the RCLK.
Maybe a better way would be just a simple OR gate, all conveniently packaged for multiple shift register usage. If Latch is Low, output is allowed to follow SCK input, otherwise output sits High. No resistors, just drop a 14-pin package in the board for control of 4 SCKs.

If you wanted to expand the  RCLK even more, you could run 3 address lines into a 3 to 8 selector chip (or 4 into a 4 to 16), and use have the selected output follow RCK and branch out even more.

Many ways exist.  Go with the simplest.
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.

Maryland, USA
Offline Offline
Full Member
***
Karma: 0
Posts: 162
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hah that is awesome.  Thanks!

After reading ideas like this, the limited pins on the ATmega8 don't seem so limited...
Logged

Pages: [1]   Go Up
Jump to: