Keypad
Keypads are a set of buttons arranged in a block usually embedded with alphabets, symbols, and numerals. It can be otherwise regarded as an assembly of digits and symbols which allow the user to enter numeric values, symbols or alphabets. The keypad is a widely used, efficient input method. Keypads are mainly used for user-friendly applications such as calculators, push-button phones and digital door locks.
According to the purpose of the device on which the keypad is attached, the keypad can include alphabets, numeric digits or symbols. A computer system uses an alphanumeric keypad where a telephone system uses numeric ones with a limited number of symbols. One can even make a keypad which can enter images and illustrations as per the requirement.
Keypads are used wherever a data entry operation is required as they have already proven to be the most efficient and reliable input devices. Keyboards are hence an integral part of the gadgets and complex systems starting from the cell phones to the systems used in the space mission.
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 modes. 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 modes.
It is easy to use and interface the keypad inside the OpenLab by simply plugging in the cable and burning the program. OpenLab uses a 4*4 matrix keypad with numbers, alphabets, and symbols which can be connected to PORT B by default with pull up or pull down mode selected by the user.
OpenLab keypad comes with 8 pins to connect with PIC microcontroller, so it will need an 8-bit port for interfacing. The keypad can be used in both pull up and pull down modes. J34 jumper helps to select the mode. J18 is the keypad port connector and it should be connected to any one of the port connectors.
Pin Arrangement
*Col – column pins, Row – row pins
From the above image, J18 is the connector which provides keypad output and J39 is the input to the microcontroller inside the OpenLab. J39 is the default connector for keypad interfacing. Connect J39 to J18 using an FRC cable.
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 pins on the row get 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.
Connecting the Pull-Up/ Pull Down
Pull-up and pull-down modes are used to minimize the noise in the circuit.The keypad used in the OpenLab works on both pull up and pull down modes. Pull up mode provide more noise immunity than pull-down mode.
Pull up and pull down modes can be selected by re-inserting the jumper later all the key-inputs are captured by the controller after burning the program by the end user.
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 a high or low comes while scanning, it means one pin on the row has got pressed. Find out the correct pin by reading the row pin number. Repeat the step after a short delay to filter out debouncing.
- Repeat the procedure to find out if other keys are pressed.