PIC Microcontrollers: Know It All

Chapter 12: Keypad Scanning

Overview

Keypads are an excellent way of entering data into the microcontroller. The keys are usually numbered, but they could be labeled as function keys for example, in a remote control handset in a TV to adjust the sound or color, etc. As well as remote controls, keypads find applications in burglar alarms, door entry systems, calculators, microwave ovens, etc. So there is no shortage of applications for this section.

Keypads are usually arranged in a matrix format to reduce the number of I/O connections. A 12-key keypad is arranged in a 3 4 format requiring 7 connections. A 16-key keypad is arranged in a 4 4 format requiring 8 connections.

Consider the 12-key keypad. This is arranged in 3 columns and 4 rows as shown in Table 12.1. There are 7 connections to the keypad C1, C2, C3, R1, R2, R3 and R4.

Table 12.1: 12-key Keypad

Column1, C1

Column2, C2

Column3, C3

Row1, R1

1

2

3

Row2, R2

4

5

6

Row3, R3

7

8

9

Row4, R4

*

0

#

This connection to the microcontroller is shown in Fig. 12.1. The keypad works in the following way: If key 6 is pressed, then B2 will be joined to B4. For key 1, B0 would be joined to B3, etc., as shown in Fig. 12.1. The microcontroller would set B0 low and scan B3, B4, B5 and B6 for a low to see if keys 1, 4, 7 or * had been pressed.


Figure 12.1: Keypad...

UNLIMITED FREE
ACCESS
TO THE WORLD'S BEST IDEAS

SUBMIT
Already a GlobalSpec user? Log in.

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.

Customize Your GlobalSpec Experience

Category: Industrial Keypads
Finish!
Privacy Policy

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.