RA8816
Preliminary Version 1.6
144x65 Character/Graphic LCD Driver
[07h] Key-scan Control Register (KEYR) (Write Only)
RW
DB7
DB6
DB5
DB4
KSTB_SE
L
DB3
DB2
IRE
DB1
KF1/
DB0
KF0/
0
KSB
KDB1
KDB0
K_AUTO
KSTB1
KSTB0
KSB: Key-scan control. 0 Î Key-scan disable. 1 Î Key-scan enable.
KDB[1..0]: Setup the de-bounce times of Key-scan in Auto-Mode. The one time means the time that Key-
scan for one loop.
Table 5-7
KDB1 KDB0
Times
8
0
0
1
1
0
1
0
1
16
32
64
KSTB_SEL: In non-Auto-mode, 0 Î the DB[1..0] are defined as KF[1..0]. 1 Î The DB[1..0] are defined as
KSTB[1..0] 。In Auto-Mode, the DB[1..0] is also defined as KF[1..0].
K_AUTO: Setup the scan mode. 1 Î Auto-Mode. The RA8816 will auto detect the key and store the code
into AKD[6..0] for MPU reading. 0 Î Non-Auto-Mode. The RA8816 will not store the code to
AKD[6..0]. The MPU has to read data from KSTB[1..0] and KSD[4..0] to make sure which key
was pressed. Of course, MPU could know if not only one key pressed at the same time In Non-
Auto-Mode.
IRE: Setup the Interrupt of Key-scan. 0 Î Hardware Interrupt disable while key was pressed. 1 Î
Generate hardware interrupt while key was pressed.
KF[1..0]: Setup the frequency of Key-scan.
Table 5-8
Key-scan Cycle Time
KF1
KF0
Pulse Width
(4x5)
0
0
1
1
0
1
0
1
256us
512us
1.024ms
2.048ms
4.096ms
9.182ms
1.024ms
2.048ms
KSTB[1..0]: In Non-Auto-Mode, These two bits are used to setup the strobe for the Row of key matrix. If
any key pressed, the MPU can read data from KSTB[1..0] and KSD[4..0] to make sure which
key was pressed. The strobe data are also readable from Bit[6..5] of register KSDR.
[07h] Key-scan Data Register (KSDR) (Read Only)
If K_AUTO = 0:
RW
1
DB7
DB6
DB5
DB4
DB3
DB2
DB1
DB0
SIRQ
KSTB1
KSTB0
KSD4
KSD3
KSD2
KSD1
KSD0
SIRQ: Indicate the interrupt of Key-scan. This bit was clear when REG[0Fh] bit 1 write “0”.
KSTB[1..0]: These two bit show which pin of KST[3..0] active.
KSD[4..0]: KIN Return Data. These bits are used in Non-Auto-Mode. The MPU can read data from
KSTB[1..0] and KSD[4..0] to make sure which key was pressed.
RAiO TECHNOLOGY INC.
16/68
www.raio.com.tw