Presentation is loading. Please wait.

Presentation is loading. Please wait.

Keypad Source: http://www.edsim51.com/8051Notes/interfacing.html#keypad under http://www.edsim51.com/8051Notes/interfacing.html under http://www.edsim51.com/8051Notes/index.html.

Similar presentations


Presentation on theme: "Keypad Source: http://www.edsim51.com/8051Notes/interfacing.html#keypad under http://www.edsim51.com/8051Notes/interfacing.html under http://www.edsim51.com/8051Notes/index.html."— Presentation transcript:

1 Keypad Source: under under

2 4 X 4 keypad In the default state (all switches open) there is no connection between the rows and columns. When a switch is pressed a connection between the switch's row and the switch's column is made.

3 Hardware Decoder for Keypad
The decoder scans the keypad. When a key is pressed, the 4-bit code for the key appears on the four output lines and the data available line (DA) goes LOW. The microcontroller will be interrupted by DA. The ISR could then read the 4 LSBs of P1 and process the data.

4 Software Decoder for Keypad
Scanning a row is achieved by applying 0 V to the port pin for that row and 5 V to the other three rows, then scanning each individual column to see if one of them is LOW. If it is, then the key at the junction between the current row and column being scanned is the pressed key. Sequence of scanning: Clear row 1, set other 3 Scan column 1 Scan column 2 Scan column 3 Scan column 4 Clear row 2, set other 3 Clear row 3, set other 3 Clear row 4, set other 3

5 Row 3 Row 2 Row 1 Row 0 Col. 3 Col. 2 Col. 1 Col. 0
Sequence of scanning: Clear row 0, set other 3 Scan column 0 Scan column 1 Scan column 2 Scan column 3 Clear row 1, set other 3 Clear row 2, set other 3 Clear row 3, set other 3 Row 3 Row 2 Row 1 Row 0 Col Col Col Col. 0


Download ppt "Keypad Source: http://www.edsim51.com/8051Notes/interfacing.html#keypad under http://www.edsim51.com/8051Notes/interfacing.html under http://www.edsim51.com/8051Notes/index.html."

Similar presentations


Ads by Google