CHAPTER 5 PORT FUNCTIONS
User’s Manual U15109EJ3V0UD
158
(1) Functions of P4 and P5 pins
Ports 4 and 5 are 8-bit I/O ports for which I/O settings can be controlled in 1-bit units. I/O settings are controlled
via port 4 mode register (PM4) and port 5 mode register (PM5).
In output mode, the values set to each bit are output to port 4 and port 5 (P4 and P5).
When using these ports in input mode, the pin statuses can be read by reading P4 and P5. Also, the values of
P4 and P5 (output latch) can be read by reading P4 and P5 while in output mode.
A software pull-up function is not implemented.
When using the alternate-function AD0 to AD15 pins, set the pin functions via the memory expansion mode
register (MM). This does not affect the PM4 and PM5 registers.
When a reset is input, the settings are initialized to input mode.
(2) Control registers
(a) Port 4 mode register and port 5 mode register (PM4 and PM5)
PM4 and PM5 can be read/written in 8- or 1-bit units.
After reset:
FFH
R/W
Address: FFFFF028H, FFFFF02AH
7
6
5
4
3
2
1
0
PMn
PMn7
PMn6
PMn5
PMn4
PMn3
PMn2
PMn1
PMn0
(n = 4, 5)
PMnx
Control of I/O mode (n = 4, 5, x = 0 to 7)
0
Output mode
1
Input mode