English
Language : 

GMS81C5108 Datasheet, PDF (73/102 Pages) Hynix Semiconductor – HYNIX SEMICONDUCTOR INC. 8-BIT SINGLE-CHIP MICROCONTROLLERS
GMS81C5108
18. KEY SCAN
The key-scan block consists of key scan mode register
(KSMR) and R1 pull-up register (R1PU). When the key
scan interrupt is used, key scan mode register KSMR (ad-
dress 0F0H) should be set properly as shown in Figure 18-
1. The pins which is to be used as key scan input should be
set by KSMR and the strobe output pins should be set as
open drain. The strobe output pins could be selected from
among R0[7:0], R1[7:0], R2[3:0] and R3[3:0].
If the “L” signal is input to any one or more of key scan in-
put pins, the KSIF request flag is set to “1”. This generates
an interrupt request. It also can be used in the way of re-
lease from STOP mode.
VDD
R1PU[7:0]
KSMR
R10/KS0
R11/KS1
R12/KS2
R13/KS3
R14/KS4
R15/KS5
R16/KS6
R17/KS7
Key Scan
Interrupt
KSIF
KSMR (Key Scan Mode Register)
R/W
R/W
R/W
R/W
R/W
R/W
R/W
R/W
Bit :
7
6
5
4
3
2
1
0
KS7
KS6
KS5
KS4
KS3
KS2
KS1
KS0
0 : Port Function (I/O) Selection
1 : Key Scan Input Selection
Figure 18-1 Key Scan Interrupt Block Diagram
ADDRESS : 0F0H
RESET VALUE : 00H
Usage of Key Scan
When key board scanning, it is recommended that set the
output strobe to “L” first and then read R1 port after 60us
delay time. Because the rising time of the output strobe
port from “L” to “H” is so long. The Figure 18-2 explain
this reason.
;Program Example,
LDM R3,#0000_1110b ;R3<0> Port set to low
CALL Delay_60us
;60us time delay routine
LDA R1
;read R1 port
R3<0>
60µs
R3<1>
If the rising time is so long, the key scanning could be
detected double key with R3<0> and R3<1>.
60µs
R1 Port Read Timing
Figure 18-2 Key Scan Timing
70
JUNE 2001 Ver 1.0