NUC970 Technical Reference Manual
Publication Release Date: Dec. 15, 2015
- 1233 -
Revision V1.30
NUC97
0
T
E
CHNIC
A
L
RE
F
E
RE
N
CE
MA
NUA
L
5.33.4 Basic Configuration
The KPI pin functions are configured in SYS_MFP_GPHL and SYS_MFP_GPHH register.
The KPI peripheral clock can be enabled in KPI (CLK_PCLKEN1[25]). The KPI engine clock
source is selected by KPI_S (CLK_DIVCTL7[15]) and KPI engine clock divider is determined by
KPI_N (CLK_DIVCTL7[14:8]).
5.33.5 Functional Description
Keypads are often used as a primary input device for embedded microcontrollers. The keypads
actually consist of a number of switches, connected in a row/column arrangement as shown in
Figure.
ROW0
ROW0
ROW1
ROW1
ROW2
ROW2
ROW3
ROW3
COL0
COL0
COL1
COL1
COL2
COL2
COL3
COL3
Figure 5.33-2 Keypad Connection
In order for the microcontroller to scan the keypad, it outputs a nibble to force one (only one) of
the rows low and then reads the columns to see if any buttons in that column have been pressed.
The columns are pulled up by the internal weak pull-up resistor.
KPIR[3:0]
KPIR[3:0]
NUC9xx
NUC9xx
KPIC[7:0]
KPIC[7:0]
ROW[3:0]
ROW[3:0]
ROW[7:0]
ROW[7:0]
4 x 8
Keypad Matrix
4 x 8
Keypad Matrix
Figure 5.33-3 Keypad Interface
Consequently, as long as no buttons are pressed, the microcontroller sees a logic high on each of