Keypad-Interfacing - KEYPAD and 7-SEGMENT DISPLAY INTERFACING WITH 8051 IN EDSIM51(These notes are based on the 4x4 Keypad and can be customized for 4x3

Keypad-Interfacing - KEYPAD and 7-SEGMENT DISPLAY...

This preview shows page 1 - 3 out of 8 pages.

KEYPAD and 7-SEGMENT DISPLAY INTERFACING WITH 8051 IN EDSIM51 (These notes are based on the 4x4 Keypad and can be customized for 4x3 Keypad as we did in the laboratory session.) Page 1 of 8 KEYPADS are assembled in a matrix form, as illustrated below. The above diagram shows a 4 X 4 keypad - 16 switches configured in 4 columns and 4 rows. 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. Keypad Decoder Many keypads are built with an onboard decoder that scans the keypad and, if a key is pressed, returns a number identifying the key. Alternatively, a keypad decoder chip can be purchased separately and interfaced with a keypad. The diagram below shows a 4 X 3 keypad interfaced with such a decoder.
Image of page 1
KEYPAD and 7-SEGMENT DISPLAY INTERFACING WITH 8051 IN EDSIM51 (These notes are based on the 4x4 Keypad and can be customized for 4x3 Keypad as we did in the laboratory session.) Page 2 of 8 The steps are: Scan row 1 Scan row 2 Scan row 3 Scan row 4 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. Clear row 1, set other 3 o Scan column 1 o Scan column 2 o Scan column 3 o Scan column 4 Clear row 2, set other 3 o Scan column 1 o Scan column 2 o Scan column 3 o Scan column 4 Clear row 3, set other 3 o Scan column 1 o Scan column 2 o Scan column 3 o Scan column 4 Clear row 4, set other 3 o Scan column 1 o Scan column 2 o Scan column 3 o Scan column 4 For example, let's say the key being pressed is key 6. When scanning the first row, P1.0 will be cleared while the other 3 rows (P1.1, P1.2 and P1.3) are set, as detailed in the diagram below.
Image of page 2
Image of page 3

You've reached the end of your free preview.

Want to read all 8 pages?

  • Spring '14
  • Hooks
  • 7-SEGMENT DISPLAY INTERFACING, Scan column

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture