Categories: Hookup Guide-8051

Keypad Hookup Guide-AT89S8253

Keypad

Keypad, which is quite a familiar term nowadays, is nothing but a block of buttons with symbols, alphabets and numerals labeled. Or else, it can be regarded as an assembly of digits and symbols allowing the user to enter the numeric values, symbols or alphabets. They are normally used for user-friendly applications including calculators, push-button phones and digital door locks. The keypad labels include alphabets, numeric digits or symbols in accordance with the purpose of the device. For example, a computer system uses an alphanumeric keypad whereas a telephone system uses numeric ones with a limited number of symbols. Also, one can make a keypad which can enter images and illustrations as per the requirement.

Keypads are mainly used where a data entry operation is required since they are regarded as the most efficient and reliable input devices. One can find applications of keyboards in gadgets and complex systems starting from the cell phones to the systems used in the space mission.

OpenLab keypad is a 4×4 matrix type and has 8 pins to connect with ATmega32 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 ATmega32 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 J38 is the input to the micro-controller inside the OpenLab. J39 is the default connector for keypad interfacing. Connect J39 to J18 using an FRC cable as depicted in the image below.

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 provides 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.
Share