A matrix keypad uses rows and column arrangement of keys to reduce the required number of I/O pins for interfacing with a microcontroller. This article shows how you can use a 555 Timer IC to interface a keypad with just 2 connections. The 555 timer is configured in astable multivibrator where the output frequency changes with each key press. Based on how many times the Timer module overflows, the information about the pressed key is determined.
2-Wire Keypad Interface with a 555 Timer – [Link]