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.