RL78/G1P
CHAPTER 4 PORT FUNCTIONS
R01UH0895EJ0100 Rev.1.00
79
Nov 29, 2019
4.2.4 Port 4
Port 4 is an I/O port with an output latch. Port 4 can be set to the input mode or output mode using port mode register
4 (PM4). When the P40 pin is used as an input port, use of an on-chip pull-up resistor can be specified in 1-bit units by
pull-up resistor option register 4 (PU4).
This port can also be used for data I/O for a flash memory programmer/debugger.
Reset signal generation sets port 4 to input mode.
Table 4-7. Settings of Registers When Using Port 4
Name I/O PM4
Alternate Function Setting
Remark
P40 Input 1
Output 0
Caution When a tool is connected, the P40 pin cannot be used as a port pin.
Remark
: don’t
care
PM4
: Port mode register 4
Figure 4-12 shows a block diagram of port 4.
Figure 4-12. Block Diagram of P40
P40/TOOL0
RD
WR
PORT
WR
PM
PM4
P4
WR
PU
V
DD
P-ch
PU4
PM40
PU40
Output latch
(P40)
In
ternal
b
u
s
Alternate
function
Se
le
ct
o
r
Alternate
function
Se
le
ct
o
r
P4:
Port register 4
PU4:
Pull-up resistor option register 4
PM4:
Port mode register 4
RD: Read
signal
WR
: Write
signal