Typical Keypad Configuration And Scanning Sequence - Motorola M-CORE MMC2001 Series Reference Manual

Table of Contents

Advertisement

Pulled Down Row
Pulled Down Row
The path of the zero pull down
that reaches the wrong row and so
generates a ghost key press
Figure 14-7 Decoding Wrong Three Key Presses

14.4.7 Typical Keypad Configuration and Scanning Sequence

1. Configure keypad
a. Enable number of rows in keypad (KPCR[7:0]).
b. Write zeros to KPDR[15:8].
c. Configure keypad columns as open-drain (KPCR[15:8]).
d. Configure columns as output, rows as input (KDDR[15:0]).
e. Clear the KPKD status flag and synchronizer chain.
f. Set the KDIE control bit, and clear the KRIE control bit (avoid false release
events).
(now in standby mode, awaiting a keypress...)
2. Keypress interrupt detected
3. Begin keypad scanning routine
a. Disable keypad interrupts.
b. Write ones to KPDR[15:8], setting column data to ones.
c. Configure columns as totem-pole outputs.
d. Configure columns as open-drain.
e. Write a single column to zero, and write others to one.
f. Sample row inputs and save data. Multiple key presses can be detected on a
single column.
g. Repeat steps b to f for remaining columns.
h. Return all columns to zero in preparation for standby mode.
MMC2001
REFERENCE MANUAL
Freescale Semiconductor, Inc.
Column Pulled
Down
KEYPAD PORT
For More Information On This Product,
Go to: www.freescale.com
Column not
Pulled Down
Three Real
Key Presses
Ghost Key
Press
MOTOROLA
14-9

Advertisement

Table of Contents
loading

Table of Contents