Automatic Keyboard Scan Mode (Auto Scan Mode); Manual Keyboard Scan Mode (Manual Scan Mode); Key Press Detection - NEC VR4181 mPD30181 User Manual

64-/32-bit microprocessor hardware
Table of Contents

Advertisement

The following table illustrates the relationship between these bits:
ASTOP
ASTART
0
0
X
X
0
X
1
X
0
1
1
1

16.2.1 Automatic keyboard scan mode (Auto Scan mode)

Automatic Scan mode is enabled through the ASTART and ASTOP bits of the KIUSCANREP register. When the
ASTART bit is set to 1, keyboard scanning starts automatically following a key down interrupt request. When the
ASTOP bit is set to 1, keyboard scanning stops automatically after no valid keyboard data (i.e. all SCANIN lines are
high level) has been read for the number of scan cycles specified by the STPREP(5:0) bits of the KIUSCANREP
register.

16.2.2 Manual keyboard scan mode (Manual Scan mode)

Manual Scan mode is enabled through the MSTART and MSTOP bits of the KIUSCANREP register. Software
initiates a keyboard scan operation by setting the MSTART bit to 1 and terminates keyboard scanning by setting the
MSTOP bit to 1. When software sets the MSTOP bit to 1, the KIU will complete the current scan operation before
disabling the scan logic.

16.2.3 Key press detection

All SCANIN lines are sampled by the KIU on the rising edge of the 32.768 kHz clock. When any SCANIN line is
sampled as low during a period of time from a rising edge to a falling edge of the 32.768 kHz clock, a key down
interrupt request is generated. If the ASTART bit of the KIUSCANREP register is set to 1 at this time, the KIU begins
scanning the keyboard.
318
CHAPTER 16 KEYBOARD INTERFACE UNIT (KIU)
Table 16-1. Settings of Keyboard Scan Mode
MSTART
MSTOP
0
0
Scanning disabled
X
1
Scanning stopped
1
0
Manual Scan mode.
Scan operation starts as soon as a setting of the MSTART bit is
detected by the scan sequencer and stops when the MSTOP bit is
set to 1.
1
0
Manual Scan with Auto Stop mode.
Scan operation starts as soon as a setting of the MSTART bit is
detected by the scan sequencer and stops when no valid keyboard
data has been read for STPREP(5:0) times of consecutive scan
cycles.
0
0
Auto Scan with Manual Stop mode.
Scan operation starts as soon as a key press is detected by the scan
sequencer and stops when the MSTOP bit is set to 1.
0
0
Auto Scan mode.
Scan operation starts as soon as a key press is detected by the scan
sequencer and stops when no valid keyboard data has been read for
STPREP(5:0) times of consecutive scan cycles.
User's Manual U14272EJ3V0UM
Operation

Advertisement

Table of Contents
loading

Table of Contents