
35
Mitsubishi microcomputers
M30240 Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Specifications REV. G
Specifications in this manual are tentative and subject to change
Key input interrupt
1.2.14 Key input interrupt
If the direction register of any of pin of Port0 or Port1 is set for input and a falling edge is input to that
port, a key-input interrupt is generated. A key-input interrupt can also be used as a key-on wakeup
function for cancelling the wait mode or stop mode.
Figure 1.18 shows the block diagram of the key-input
interrupt.
Figure 1.18: Block diagram of key input interrupt
1.2.14.1 Enable/Disable
The key-input interrupt can be enabled and disabled using the key-input interrupt register (004D16).
The key-input interrupt is affected by the interrupt priority level (IPL) and the interrupt enable flag (I
flag).
1.2.14.2 Occurrence timing of the key-input interrupt
With key-input interrupt acceptance enabled, ports P0 and P1, which are set to input, become key-
input interrupt pins (KI0 through KI15). A key-input interrupt occurs when a falling edge is input to a
key-input interrupt pin. At this moment, the level of other key-input interrupt pins must be “H”. No in-
terrupt occurs when the level of any other key-input interrupt pins is “L”.
1.2.14.3 How to determine a key-input interrupt
A key-input interrupt occurs when a falling edge is input to one of 16 pins, but each pin has the same
vector address.Therefore, read the input level of ports P0 and P1 in the key-input interrupt routine to
determine the interrupted pin.
1.2.14.4 Related registers
Figure 1.19 shows the memory map of key-input interrupt-related registers
Figure 1.19: Memory Map of key input interrupt related registers
pull-up select bit
Port P1i
direction register
Port P1i/KIj
(Pull-up transistor)
i=0~7; j=8~15
Port PXi
Port P0i
pull-up select bit
Port P0i
direction register
Port P0i/KIj
(Pull-up transistor)
i=0; j=0~7
KI15
KI0
Interrupt control circuit
Key input interrupt control circuit
Key input
interrupt request
(address 004D16)
Address
Register name
Acronym
004E16
004D16 Key input interrupt register
KUPIC
03E016
03E116
03E216
03E316
03E416
Port 0
P0
Port 1
P1
03FA16
03FB16
03FC16
03FD16
03FE16
Pull-up control register 1
PUR1
03FF16
Port 0 direction register
Port 1 direction register
PD0
PD1
Pull-up control register 0
PUR0
~