SM59A16U1
8-Bit Micro-controller
64KB with ISP Flash
& 6K+256B RAM embedded
16. KBI – Keyboard Interface
Keyboard interface (KBI) can be connected to an 8 x n matrix keyboard or any similar devices. It has 8 inputs with
programmable interrupt capability on either high or low level. These 8 inputs are through P2 or P0 and can be the
external interrupts to leave from the idle and stop modes. As shown in Fig. 16-1 and Fig. 16-2 , The 8 inputs are
independent from each other but share the same interrupt vector 5Bh.
Input
circuitry
KBI0
Input
circuitry
KBI1
Input
circuitry
KBI2
Input
KBI3
circuitry
OR
Input
circuitry
Input
circuitry
Input
circuitry
Input
KBI4
KBI5
KBI6
KBI7
KBIIF: KBI interrupt flag
IEKBI: KBI interrupt enable
circuitry
Fig. 16-1: keyboard interface block diagram
250KHz
KBIx
0
1
De-bounce
KBF.x
KBD[1:0]
KBLS.x
KBE.x
Fig. 16-2: keyboard input circuitry
KBI
Description
Dir.
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
RST
The relevant registers of the KBI function
P4UR
AUX
Auxiliary register
91h
BRGS
-
P4SPI
P4IIC P0KBI
-
DPS
00H
1
KBI function
KBI level
selection
KBLS
93h KBLS7 KBLS6 KBLS5 KBLS4 KBLS3 KBLS2 KBLS1 KBLS0
00H
KBE
KBF
KBI input enable
KBI flag
KBI De-bounce
control register
94h
95h
KBE7
KBF7
KBDE
N
KBE6
KBF6
KBE5
KBF5
KBE4
KBF4
KBE3
KBF3
KBE2
KBF2
KBE1
KBF1
KBE0
KBF0
00H
00H
KBD
96h
-
KBD1
KBD0
00H
Mnemonic: AUX
Specifications subject to change without notice contact your sales representatives for the most recent information.
ISSFD-M071 Ver A SM59A16U1 04/12/2013
Address: 91h
- 108 -