![](http://datasheet.mmic.net.cn/370000/UPD30181GM-66-8ED_datasheet_16743710/UPD30181GM-66-8ED_317.png)
User’s Manual U14272EJ3V0UM
317
CHAPTER 16 KEYBOARD INTERFACE UNIT (KIU)
16.1 General
The Keyboard Interface Unit (KIU) provides the interface between the V
R
4181 and an external matrix type
keyboard. This unit supports key matrix of 8 x 8.
The interface to the keyboard consists of SCANOUT (3-state output) and SCANIN (input) lines. The SCANOUT
lines are used to search the matrix for pressed keys. The SCANIN lines are used to sense key press events and are
read after each SCANOUT line being at low level to locate the pressed key.
SCANOUT and SCANIN lines are allocated by programming CompactFlash pins to support this function during the
power-on. If those pins are set as for keyboard interface, CompactFlash interface cannot be used.
16.2 Functional Description
When the keyboard is idle, the SCANOUT lines are all driven to 0 volts and the SCANIN lines are pulled to V
DD
by
external 4.7 k
resistors. When any key in the matrix is pressed, at least one SCANIN input is driven as low and
signals a key press event to the KIU.
Once the key press event has been detected, the KIU may be programmed to generate a key down interrupt
request, and to begin scanning the keyboard automatically or to wait until software enables the scan operation.
Keyboard scanning is performed by sequentially driving one SCANOUT line as low while the others remain high
impedance, and reading the state of the SCANIN lines and storing into keyboard data registers inside the KIU. Once
the last SCANOUT line has been driven as low and the SCANIN lines read the KIU may generate a Keyboard Data
Ready interrupt request to inform system software that one keyboard scan operation has been completed.
The KIU repeats this scan process until no further keys have been detected or until software disables the scan
operation. At this point the KIU enters to the keyboard idle state or key press wait state.