
CHAPTER 5 PORT FUNCTIONS
Page 69 of 920
5.2.1
Port 0
Port 0 is an I/O port with an output latch. Port 0 can be set to the input mode or output mode in 1-bit units using
port mode register 0 (PM0). When the P02 to P04 pins are 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 0 (PU0).
Input to the P03 and P04 pins can be specified through a normal input buffer or a TTL input buffer in 1-bit units
using port input mode register 0 (PIM0).
Output from the P02 to P04 pins can be specified as N-ch open-drain output (V
DD
tolerance) in 1-bit units using
port output mode register 0 (POM0).
To use P02 and P03 as digital input/output pins, set them in the digital I/O mode by using port mode control
register 0 (PMC0) (can be specified in 1-bit units).
This port can also be used for A/D converter analog input, serial interface data I/O, and clock I/O.
When reset signal is generated, the following configuration will be set.
• P04 pin......................................................................................... Input port
• P02 and P03 pins......................................................................... Digital I/O is prohibited.
5.2.2
Port 1
Port 1 is an I/O port with an output latch. Port 1 can be set to the input mode or output mode in 1-bit units using
port mode register 1 (PM1). When the P10 to P16 pins are 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 1 (PU1).
This port can also be used for serial interface data I/O, and clock output.
Reset signal generation sets port 1 to input mode.
P10 to P16 pins are used for internal connection between the MCU and RF transceiver. For details, see
CHAPTER 2 CONNECTION BETWEEN MCU AND RF TRANSCEIVER
.
5.2.3
Port 2
Port 2 is an I/O port with an output latch. Port 2 can be set to the input mode or output mode in 1-bit units using
port mode register 2 (PM2).
This port can also be used for A/D converter analog input and reference voltage (+ side and - side) input.
To use P20/ANI0, P21/ANI1, and P22/ANI2 as digital I/O pins, set them to digital I/O using the A/D port
configuration register (ADPC). Use these pins starting from the upper bit.
To use P20/ANI0, P21/ANI1, and P22/ANI2 as analog input pins, set them to analog function using the A/D port
configuration register (ADPC) and input mode using the PM2 register. Use these pins starting from the lower bit.
All pins are set in the analog function mode when the reset signal is generated.
All P2 are set in the analog function mode when the reset signal is generated.
Table 5 - 2 Setting Functions of P20/ANI0, P21/ANI1, P22/ANI2 Pins
ADPC Register
PM2 Register
ADS Register
P20/ANI0, P21/ANI1,
P22/ANI2 Pins
Digital I/O selection
Input mode
—
Digital input
Output mode
—
Digital output
Analog function selection
Input mode
Selects ANI.
Analog input (to be converted)
Does not select ANI.
Analog input
(not to be converted)
Output mode
Selects ANI.
Setting prohibited
Does not select ANI.
Summary of Contents for RL78/G1H
Page 941: ...R01UH0575EJ0120 RL78 G1H...