Keypad Interfacing With 8051
Keypad Interfacing With 8051
Dr.C.Suganthi Evangeline
4X4 Matrix Keypad
Scanning of Keys-Before Key press
•If one of the column bits has a zero, this means that a key press
has occurred.
•For example, if C1:C4 = 1011, this means that a key in the C2
column has been pressed.
•After detecting a key press, microcontroller will go through the
process of identifying the key.
Process of Identifying the Key
Starting from the top row, the microcontroller will ground it by providing a low
to row R1 only.
Now read the columns, if the data read is all 1s, no key in that row is pressed and
the process continues for the next row.
So, now ground the next row, R2. Read the columns, check for any zero and this
process continues until the row is identified.
E.g. In above case we will get row 2 in which column is not equal to 1111.
So, after identification of the row in which the key has been pressed we can easily
find out the key by row and column value.