Categories: Features Features-8051 Features-ARM Features-AVR Features-PIC

Keypad

OpenLab contains a keypad which is 4×4 matrix type and has 8 pins to connect with PIC Microcontroller, so it will use an 8-bit port for interfacing. The keypad can be used in both pull up and pull down mode. J18 is the Keypad Port connector and it should be connected to any one of the port connectors. J34 helps to select pull up and pull down mode.

Keypad section in OpenLab

The default port is Port B (J39) and is optional to connect to the default port.

The keypad has 4 rows (4, 5, 6, 7 bits) and 4 columns (0, 1, 2, 3 bits) for representing 16 keys. First 4 pins connected to the columns and next 4 pins connected to the rows.

Pin arrangement

Keypad

1

2

3

4

5

6

7

8

Pin Name

Col 1

Col 2

Col 3

Col 4

Row 1

Row 2

Row 3

Row 4

*Col – Column pins, Row – Row pins

Operation – without pull up/pull down mode

  • Connect the J18 connector to J39 or other ports in breadboard area
  • Configure first 4 pins (columns in the keypad) as outputs and last 4 pins (rows in the keypad) as inputs
  • Make the first column as high and scan the entire row pins. If there is a high, then some pin on the row got pressed. Find out the correct pin using the row pins. Repeat the step after a short delay to filter out debouncing.
  • Repeat the procedure to find out other rows.

Operation – Pull up/Pull down mode

  • Connect the J18 connector to J39 or other ports in breadboard area
  • Select the mode by shunting the jumper on J34
  • Configure first 4 pins (columns in the keypad) as outputs and last 4 pins (rows in the keypad) as inputs
  • If the mode selected is Pull up, scan for High and if the mode selected is Pull down, scan for Low. If there is a high/low, then one pin on the row got pressed. Find out the correct pin by reading the row pins. Repeat the step after a short delay to filter out debouncing.
  • Repeat the procedure to find out other rows.
Share