If the micro supports analogue inputs then you can use a single pin and a resistor network to give different voltages for each key, not recommended though. Much better way is to have an active serial keypad. If you have 2 port pins you can really use any clock+data protocol. Probably I2C is a good option, then you could use something like a PCF8574 expander chip on the keypad, this would give you a 4x4 matrix. You could even use standard serial and one port pin if you had a small micro decoder on keypad instead, pic etc.