MMC2001
KEYPAD PORT
MOTOROLA
REFERENCE MANUAL
14-5
14.3.3 Keypad Data Direction Register (KDDR)
The bits in the keypad data direction register (KDDR) control the direction of the key-
pad port pins. The upper eight bits in the register affect the pins designated as col-
umn strobes, while the lower eight bits affect the row sense pins. Setting any bit in this
register configures the corresponding pin as an output. Clearing any bit in this regis-
ter configures the corresponding port pin as an input. For bits 7 to 0, an internal pull-
up is enabled if the corresponding bit is cleared. This register is cleared by reset, con-
figuring all pins as inputs.
The KDDR register is byte or halfword addressable.
Figure 14-4 Keypad Data Direction Register
KCDDx — Keypad Column x Data Direction
0 =
COLx pin is configured as input.
1 =
COLx pin is configured as output.
KRDDx — Keypad Row x Data Direction
0 =
ROWx pin is configured as input.
1 =
ROWx pin is configured as output.
14.3.4 Keypad Data Register (KPDR)
The 16-bit keypad data register is used to access the column and row data. Data writ-
ten to this register is stored in an internal latch, and for each pin configured as an out-
put, the stored data is driven onto the pin. A read of this register returns the value on
the pin for those bits configured as inputs. Otherwise, the value read is the value
stored in the register.
The KPDR register is byte or halfword addressable.
* Since pins default to inputs, reset value is determined by the logic level present on the pins at reset.
Figure 14-5 Keypad Data Register
KDDR — Keypad Data Direction Register
10003004
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
R
KCDD7 KCDD6 KCDD5 KCDD4 KCDD3 KCDD2 KCDD1 KCDD0 KRDD7 KRDD6 KRDD5 KRDD4 KRDD3 KRDD2 KRDD1 KRDD0
W
RESET:
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
KPDR — Keypad Data Register
10003006
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
R
KCD7
KCD6
KCD5
KCD4
KCD3
KCD2
KCD1
KCD0
KRD7
KRD6
KRD5
KRD4
KRD3
KRD2
KRD1
KRD0
W
RESET:
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
Freescale Semiconductor,
I
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
nc.
..