3 Jun 2013

How to interfacing I/O with Matrix Type Keypad

Most of microprocessor applications require a keypad for users to enter numbers and commands. But interfacing of I/O matrix type keypad is not easy . Here i write about How to interfacing I/O with Matrix Type Keypad .



Figure 2 shows the internal structure of the 4 x 3 matrix keypad. The keypad consists of an array of momentary pushbuttons switch or key. Each row and each column of the pushbutton are connected to a common line. There are 3 column line and 4 row line. Each pushbutton has two terminals; one is connected to a column line and other to a row line. When the key is pressed, the adjacent row and column are connected. For example if key ‘8’ is pressed, row 2 and column 1 will connect to each other. Table 1
below shows the combinations of other key pressed.


  

The usual way to interface a keypad to a microprocessor is by connecting input/output (I/O) port bits to row and column connections on the keypad. The keypad is wired in a matrix arrangement so that when a key is pressed one row is shorted to one column. It’s relatively easy to write a routine to scan the keypad, detect key presses, and determine which key was pressed. Another alternative is to use the 74C922 keypad encoder chip.
This device accepts input from a 16- keypad, performs all of the required scanning and debouncing, and outputs a “data available” (DA) bit and 4 output bits representing the number of the key pressed from 0 to 15. Figure 3 show the connections between 4 x 3 matrix keypad with 74C922.

Circuit Diagram