Week : 10
Title : Keypad Interfacing with 8051 microcontroller
Objectives : To know how to interface keypad with 8051 microcontroller
Contents / Procedures :
Keypad
is organized as a matrix of switches in rows and column. This project will
uses a 4X3 matrix keypad and a 16x2 LCD for displaying the output of
keypad. The
circuit diagram below shows the connection of keypad with the controller.
Port
P2 of the microcontroller is used to send the data for displaying on
the LCD. P1^1, P1^2, P1^3 pins of microcontroller is connected to RS,
RW, EN pins of LCD respectively. Port P0 is used to scan input from the
keypad (refer circuit diagram for connection).The
concept of interfacing keypad with the MCU is simple. Every number is
assigned two unique parameters, i.e., row and column number (n(R, C) for
example 6 (2, 3)). Hence every time a key is pressed the number is
identified by detecting the row and column number of the key pressed. Initially
all the rows are set to zero by the controller and the columns are
scanned to check if any key is pressed. In case no key is pressed the
output of all the columns will be high.
Whenever
a key is pressed the row and column corresponding to the key will get
short, resulting in the output of the corresponding column goes to go
low (since all the rows zero). This gives the column number
of the pressed key.
Once
the column number is detected, the controller set’s all the rows to
high. Now one by one each row is set to zero by controller and the
earlier detected column is checked if it becomes zero. The row
corresponding to which the column gets zero is the row number of the
digit.
Result / Analysis :
The
above process is very fast and even if the switch is pressed for a very
small duration of time the controller can detect the key which is
pressed. The controller displays the number corresponding to the row and
column on the LCD.
Conclusion :
Block Diagram of keypad interface with microcontroller with LCD for displaying the output keypad
No comments:
Post a Comment
Note: only a member of this blog may post a comment.