Electronic – How to read decade counter with minimum pins

gpioswitches

I just obtained some of these counters for a project:

enter image description here

They have five connections for each slice labelled C, 1, 2, 4, and 8. As you increment the digit, the pins for the appropriate binary encoding are tied to the common pin.

I was hoping that I could tie all of the 1,2,4,8 pins together between all 5 digits, and then alternate which common pin was powered as I read the four common pins. That would let me read the whole unit with 9 pins.

Unfortunately the binary encoding causes connections on digits I am not reading to interfere with the digit I am interested in. I can't think of a good way to isolate the signals without just making 5×5=25 connections to my microcontroller, which I simply don't have io for. Is there a way to read this thing with fewer pins?

Best Answer

Diodes!

schematic

simulate this circuit – Schematic created using CircuitLab

There's actually Hex and Dec counters like yours with that already built in (except the 4 resistors).

You pull one common low in this set-up (most common internal-diode scheme, so I drew that), usually with a MOSFET or Bipolar small signal device. If the corresponding switch is closed, the bit will read 0, if not, it WILL read 1.

You can of course easily flip this to be positive logic.

Small signal diodes come in 0603 and 0402 even, so if you'd want to do this on a volume board design, you could nearly invisibly integrate it into the row of pads where the counter connects.