
CHAPTER 16 KEYBOARD INTERFACE UNIT (KIU)
User’s Manual U14272EJ3V0UM
320
16.2.5 Reading scanned data
Scanned data is read from the SCANIN(7:0) pins. When a SCANOUT pin has been driven as low and the
keyboard settling time specified by the T1CNT(4:0) bits has been elapsed, the KIU latches scanned data from the
SCANIN pins and stores into one of the internal key data registers.
16.2.6 Interrupts and status reporting
The KIU provides scan status indication that may be polled by the CPU core and may also generate interrupt
requests to request keyboard servicing. Scan status indication is provided through the SSTAT(1:0) bits of the
KIUSCANS register. These bits are decoded as follows:
SSTAT1
SSTAT0
KIU scan sequencer status
0
0
Stopped
0
1
Waiting for key press
1
0
Scanning (T1CNT or T3CNT)
1
1
During scan interval (WINTVL)
The KIU generates 3 types of maskable interrupt requests. KIU interrupt pending status is reported through the
KDATLOST, KDATRDY, and KEYDOWN bits of the KIUINT register. All interrupt requests generated by the KIU
should be considered asynchronous and must be externally qualified with TClock.
The key data lost interrupt request (KDATLOST bit) signals that a data from the SCANIN line written to the key
data register corresponding to the SCANOUT0 pin before the previous data value is read by the CPU core. This
interrupt source can be masked through the MSKKDATLOST bit of the MKIUINTREG register.
The key data ready interrupt request (KDATRDY bit) signals one complete scan operation has been completed.
This interrupt request is generated during a write of a data from the SCANIN line to the key data register
corresponding to the last SCANOUT pin. This interrupt request source can be masked through the MSKKDATRDY bit
of the MKIUINTREG register.
The key down interrupt request (KEYDOWN bit) signals a key press event has been detected. This interrupt
request is generated in synchronization with the rising edge of the 32.768 kHz clock when the keyboard interface is
idle and any SCANIN pin is sampled as low during a period of time from a rising edge to a falling edge of the 32.768
kHz clock. This interrupt request source can be masked through the MSKKDOWNINT bit of the MKIUINTREG
register.
The MSKKDATLOST, MSKKDATRDY, and MSKKDOWNINT bits only prevent interrupt requests from being
generated on the kiuintr signal (internal). These mask bits do not disable interrupt request event detection nor do they
disable interrupt status reporting in the KIUINT register.