MOTOROLA
KEYPAD PORT
MMC2001
14-2
REFERENCE MANUAL
14.2 KPP Pin Description
Sixteen pins are dedicated to the KPP. Keypads of any configuration up to eight rows
and eight columns are supported through software configuration of the peripheral
pins. Any pins not used for the keypad are available for general-purpose input/output.
The registers are configured such that the pins can be treated as an I/O port up to 16
bits wide.
14.2.1 Input Pins
Any of the 16 pins associated with the KPP can be configured as inputs by writing
zeros to the appropriate bits in the KDDR. Additionally, the least significant eight bits
(ROW inputs) corresponding to KDDR[7:0] have internal pull-ups that are enabled
when the pin is used as an input.
14.2.2 Output Pins
Any of the 16 pins associated with the KPP can be configured as outputs by writing
the appropriate bits in the KDDR to one. Additionally, the pins representing the eight
most significant bits (KDDR[15:8]) can be designated as open drain outputs by writing
a one into the appropriate bits in KPCR. The pins representing the lower eight bits
(KDDR[7:0]) are always totem-pole style drive when configured as outputs.
14.3 KPP Programming Model
14.3.1 Keypad Control Register (KPCR)
The keypad control register (KPCR) determines which of the eight possible column
strobes are to be open drain when configured as outputs and which of the eight row
sense lines are considered in generating an interrupt to the CPU.
Table 14-1 Keypad Port Column Modes
KDDR[15:8]
KPCR[15:8]
Pin Function
0
x
Input
1
0
Totem-Pole Output
1
1
Open-Drain Output
Table 14-2 Keypad Port Address Map
Address
Use
Access
10003000
Keypad Control Register (KPCR)
Supervisor Only
10003002
Keypad Status Register (KPSR)
Supervisor Only
10003004
Keypad Data Direction Register (KDDR)
Supervisor Only
10003006
Keypad Data Register (KPDR)
Supervisor Only
10003008
to
10003FFF
Reserved
Supervisor Only
Freescale Semiconductor,
I
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
nc.
..