4-way switching pins on ATtiny261?

I've got an ATtiny261 that I'm looking to put quite a few features on - among them are a MPU6050 gyroscope/accelerometer and a micro-SD card reader to store and play short audio files. However, I find myself running short on GPIO pins for other parts of the project, and I want to know if there's any way to simplify this.

I have a bunch of two-way inputs that I could use a digital switch of some type to control, but the 8-bit shift registers I've seen are overkill for my needs and I'm very space-limited (think a 1-inch diameter circle as the total size of my circuitboard).

Is there any form of lower-bit shift register that can switch between three to four different outputs and only takes a single GPIO pin on the ATtiny?

Failing that, would I run into any problems if I tied the clock and reset pins together for shift registers like these (4 Bit Shift Register)?

I cannot get you math to fit. You need 3 pins to control a shift register (Load, Clock, Data), using a 4 bit resister would only get your one pin extra?

There exist I2C IO expanders that only need two pins for control and can share the two pins with other I2C devices. But the chips uses some real estate.
Datasheet for I2C IO expander

Another idea may be a analog mux/switch, they exist in some very small packages with a 2-1 switch, using two of them would get you one extra IO (Two small chips may be easier to place on the PCB than one larger).

Failing that, would I run into any problems if I tied the clock and reset pins together for shift registers like these

Yes every clock pulse would reset the shift register so the outputs would always be zero. However just connect the reset pin high and feed the shift register four pulses, reset is not needed.

Grumpy_Mike:
Yes every clock pulse would reset the shift register so the outputs would always be zero. However just connect the reset pin high and feed the shift register four pulses, reset is not needed.

Whoops! Should've clarified - I meant that multiple shift registers would have a common clock pin and a common reset pin. They'd have three to four output pins and as few input pins as possible.

As I said before you don’t need the reset pin. Having a longer shift register than four bits will save you on output pins from the Arduino.

Does this look correct? RCK is tied to +VCC for both shift registers, and all other pins on the ATtiny are shared.

Also, I notice that the MPU6050 I'm planning to attach also requires the MOSI/MISO pins, and the SD card reader probably will too. Is it okay to share the ATtiny's pins for all of these, or should I do something special to separate them? My knowledge on pin functionality is a little rusty...

Does this look correct?

No.

It is very hard to see on this diagram as the resolution is poor and not all the wiring is shown, please see the how to use this forum sticky post for details about posting pictures.

I would have expected the serial out of one shift register to be connected to the serial in if the second. Not sure because if the resolution but it looks like both the serial inputs are connected to the same pin. This means the two shift registers will always have the same outputs.

Yes, you need a separate chip enable pin on both the shift registers and the SD card in order to Shamir those other pins. However, that might disturb the operation of the SD card by forcing an open file to be closed.

Grumpy_Mike:
Yes, you need a separate chip enable pin on both the shift registers and the SD card in order to Shamir those other pins.

Hmmm. That iPad gets you every time!

I am sure it is getting worse.

Decided to use only one shift register anyway, as it seems like that gives me just enough pins.

I still need to figure out a way to read .wav files off of an SD card attached to the ATtiny - I’m guessing this isn’t possible through the shift register? Also, I found this tutorial (Toying with ATTiny84 and SD card in Arduino IDE – Martin's corner on the web) about hooking up an SD card reader to an ATtiny through Arduino software - would this work for my purposes?

Current circuit schematic is attached (hopefully this is a larger image).