Sharing the clock pin on shift registers

Is it ok to share the clock pin on 4 separate shift registers? 2 are SN74HC595DR's (shift out controlling LED's) and the other 2 are CD4021BPWR's (shift in listening to button presses). I know you can connect 2 or more of the same, but how about multiple, different registers? Trying to save atmega328 pins for a stand alone project. Also, if it's ok to do this what about the latch pins? Not that I think I would want to share that, just curious on that one.

Whatever data was clocked in will be clocked out, if you're OK with that then it's OK to do that.

I've "shared" (connected in parallel) the clock pin to 20 TPIC6B595 shift registers across 2 boards. Your few parts will be fine.

If you're using SPI to send data out & read data back, you can share the latch pin too. Data will go out in MOSI while you read data back in on MISO. If you don't want the data out to appear to change, just write the same data out again:

digitalWrite(SSpin, LOW); dataIn = SPI.transfer(dataOut); // data clocked in from MISO while data is clocked out on MOSI digitalWrite(SSpin, HIGH);

Nick Gammon has a great writeup on how SPI works to do that. Make sure you have 0.1uF (100nF) caps on the Vcc pin for each shift register.

http://www.youtube.com/watch?v=6fVbJbNPrEU

http://hackaday.com/2013/02/07/learn-shift-registers-without-involving-a-microcontroller/

Once you watch the video, everything will make sense

The fan-out of an Arduino pin is large, since it can handle upto 40mA it should be able to drive dozens of CMOS gates happily if the wiring isn't too long.

Every family of logic chips has a specified "fanout" - the number of inputs a single output can drive without needing boosting/buffering. Usually it is at least 10, one seldom has to worry about it.

CrossRoads: I've "shared" (connected in parallel) the clock pin to 20 TPIC6B595 shift registers across 2 boards. Your few parts will be fine.

Ok, but those are all the same registers. I want to use 2 separate types.

I guess my question is, the 2 types arent going to interfere with each other? Which I guess they wouldn't because the clock pins are inputs (on the ic)

cjdelphi: http://www.youtube.com/watch?v=6fVbJbNPrEU

http://hackaday.com/2013/02/07/learn-shift-registers-without-involving-a-microcontroller/

Once you watch the video, everything will make sense

Yup i've been watching Kevin's videos for a while now. He's a good teacher.

No, the clocks won't interfere, as they are inputs.