CHAPTER 5 PORT FUNCTIONS
User’s Manual U15109EJ3V0UD
145
(1) Function of P1 pins
Port 1 is an 8-bit I/O port for which I/O settings can be controlled in 1-bit units. I/O settings are controlled via the
port 1 mode register (PM1).
In output mode, the values set to each bit are output to port 1 (P1). The port 1 function register (PF1) can be
used to specify whether P10 and P12 are normal outputs or N-ch open-drain outputs.
When using this port in input mode, the pin statuses can be read by reading P1. Also, the values of P1 (output
latch) can be read by reading P1 while in output mode.
Clear P1 and the PM1 register to 0 when using alternate-function pins as outputs. The logical sum (ORed result)
of the port output and the alternate-function pin is output from the pins.
When a reset is input, the settings are initialized to input mode.
(2) Control registers
(a) Port 1 mode register (PM1)
PM1 can be read/written in 8- or 1-bit units.
After reset:
FFH
R/W
Address: FFFFF022H
7
6
5
4
3
2
1
0
PM1
PM17
PM16
PM15
PM14
PM13
PM12
PM11
PM10
PM1n
Control of I/O mode (n = 0 to 7)
0
Output mode
1
Input mode
(b) Port 1 function register (PF1)
PF1 can be read/written in 8- or 1-bit units.
After reset:
00H
R/W
Address: FFFFF0A2H
7
6
5
4
3
2
1
0
PF1
0
0
0
0
0
PF12
0
PF10
PF1n
Control of normal output/N-ch open-drain output (n = 0, 2)
0
Normal output
1
N-ch open-drain output