81
CHAPTER 4 PORT FUNCTIONS
Preliminary User’s Manual U16035EJ1V0UM
4.2.5 Port 4
Port 4 is an 8-bit I/O port with output latch. The P40 to P47 pins can specify the input mode/output mode in 1-
bit units with port mode register 4 (PM4). An on-chip pull-up resistor of P40 to P47 pins can be used for them in 1-
bit units with pull-up resistor option register 4 (PU4).
The interrupt request flag (KRIF) can be set to 1 by detecting falling edges.
RESET input sets port 4 to input mode.
Figures 4-8 and 4-9 show a block diagram of port 4 and block diagram of the falling edge detector, respectively.
Caution
When using the falling edge detection interrupt (INTKR), be sure to set the memory expansion
mode register (MEM) to 01H.
Figure 4-8. Block Diagram of P40 to P47
RD
P40/AD0 to
P47/AD7
P-ch
WR
PU
WR
PORT
WR
PM
PU40 to PU47
Output latch
(P40 to P47)
PM40 to PM47
Selector
V
DD0
Internal bus
Selector
Memory expansion
mode register
(MEM)
PU:
Pull-up resistor option register
PM: Port mode register
RD: Port 4 read signal
WR: Port 4 write signal
Figure 4-9. Block Diagram of Falling Edge Detector
P40
P41
P42
P43
P44
P45
P46
P47
INTKR
Falling edge detector
“1” when MEM = 01H