Multiple uses of Arduino pins?

I am designing a sensor circuit using a Tiny Lily, which is an Atmega 328 supporting only eight I/O pins. First, I read in some initial setup data from a DIP switch, using a parallel-to-serial shift register (TTL 74166). Once these initial values are read in, the shift register is no longer needed.

However, operating the shift register requires use of five Arduino pins, and I would like to press several of those pins into use for other tasks after the initial read-in is finished. The shift register has a Clear pin, which when pulled high, stops further SR activity.
The logic diagram of the SR indicates that the three input pins to the SR go into a "don't care" state when Clear is pulled high.

So once the SR is disabled, it would seem like I could reuse the pins, although I may lose 1-2 ma. to the SR when using the pins for something else. But Arduinos can source or sink 40 ma. per pin, so I would assume that this scheme would work. But I've been fooled many times before.

Has anybody out there played with this, and if so, any insights?

Thanks in advance for any thoughts.

John Doner

jrdoner:
The logic diagram of the SR indicates that the three input pins to the SR go into a "don't care" state when Clear is pulled high.

So once the SR is disabled, it would seem like I could reuse the pins

Correct.

jrdoner:
I may lose 1-2 ma. to the SR when using the pins for something else.

Hopefully less than that. Input pins usually have a very high resistance.

There's no reason it won't work so long as all the other stuff doesn't interfere with the initial read of the shift register.

If the SR outputs are tristate you'll only lose uA or less I would think. Whatever the leakage current is it's not enough to even consider.

You do have to look at what this other circuitry will do when you toggle all the SR pins, if it's just LEDs maybe you will be happy with the flickering, if it's some form of clocked logic that might be a problem.

40mA is the absolute max and should never be used, 20mA is safer and there's a limit on the entire packages as well.


Rob