Electronic – Detecting which pins are inputs or outputs

detectiondigital-logicintegrated-circuit

I have an idea to make a device with a generic ZIF socket which can be used to identify any chip you place into it and once identified run a suite of tests to verify that the chip is functional. I hope to target most of the 74xx line of ICs.

My idea is basically connect each pin of the socket to an IO pin on my MCU. 74xx series chips shouldn't draw enough current that I can't power them from a decent I/O port, so odd power pin arrangements or differing pin counts shouldn't be a problem.. For simple chips it should be fairly trivial to drive the input pins and check the output pins, once I know what chip it is. Further complications arise when I get into open-collector outputs, tri-state outputs, schmitt triggers, etc…, but maybe those will need separate questions.

Here is where I am stuck now: Is there a good way to detect which pins are inputs and outputs without driving any more lines than necessary? I will most likely start with all of my IO pins as inputs. I can use the microcontroller's weak pull-ups to drive floating lines up, so I know that any pin that is zero is definitely an output from the ic. I can use that info to narrow down my possibilities, but I doubt that will be enough. Any guessing by driving pins without knowing what are inputs and outputs seems like a good way to cause a short.

I was thinking maybe if I added a slightly stronger external pulldown behind a serial analog switch or something maybe I could turn on pull downs and check which are now high to get a better picture of what are inputs and outputs, but I don't know how well that would work, since it might change the inputs to the ic under test.

I read somewhere on here that the traditional way to detect high impedance is to put equal resistors to ground and power and measure the center with adc, but I don't have enough analog inputs for that to seem feasable.

Best Answer

What you are trying to do is a bit more complicated than you seem to realize. For general unknown I/O pins, it looks like you will need two microcontroller pins. One pin will be a output with maybe 5 kΩ in series. The other pin is a input connected directly to the test chip pin. This allows you to drive the pin high and low, and to leave it undriven. But in all cases you can see what the digital level is with the other microcontroller pin. With this setup, you can detect all the possible digital cases of the pin under test driving high, driving low, or high impedance.

If you stipulate that this test setup is only for digital logic chips and only at the same power voltage as the micrcontroller, then there is no need for analog.

Power and ground pins are another matter, however. These pins need to be tied solidly high or low during operation. In the arbitrary case you will need both low and high side switches on every pin since any of them could be power or ground. This gets messy fast.

I don't want to rain on your idea for a personal project, but frankly this strikes me as quite hard to get right and not much use if you do. 74xxx discrete logic is rarely used nowadays, and when I do need to identify chips I don't find reading the number off the chip all that bad.

How about a capacitor meter? Those little suckers aren't labeled anymore.

Related Topic