Datasheet
RL78/L12 CHAPTER 4 PORT FUNCTIONS
R01UH0330EJ0200 Rev.2.00 100
Dec 13, 2013
4.2.1 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 P17 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).
Input to the P10, P11, P15, and P16 pins can be specified through a normal input buffer or a TTL input buffer in 1-bit
units using port input mode register 1 (PIM1).
Output from the P10, P12, P15, and P17 pins can be specified as a normal CMOS output or N-ch open-drain output
(V
DD tolerance
Note 1
/EVDD tolerance
Note 2
) in 1-bit units using port output mode register 1 (POM1).
To use P13 and P14 as input pins, set them in the digital input mode or analog input mode by using port mode control
register 1 (PMC1) (can be specified in 1-bit units).
This port can also be used for serial interface data I/O, serial interface clock I/O, programming UART I/O, timer I/O,
segment output of the LCD controller/driver, external interrupt request input, and A/D converter analog input.
When reset signal is generated, the following configuration will be set.
• P10 to P12 and P05 to P07 pins ··· Input mode
• P13 and P14 pins ··· Analog input
Notes 1. 32-, 44-, 48-, and 52-pin products: V
DD tolerance
2. 64-pin products: EV
DD tolerance
4.2.2 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 input (+ side and - side).
To use P20/ANI0 to P21/ANI1 as digital input/output pins, set them in the digital I/O mode by using the A/D port
configuration register (ADPC). Use these pins starting from the upper bit.
To use P20/ANI0 to P21/ANI1 as analog input pins, set them in the analog input mode by using the A/D port
configuration register (ADPC) and in the input mode by using the PM2 register. Use these pins starting from the lower bit.
Table 4-2. Setting Functions of P20/ANI0 to P21/ANI1 Pins
ADPC Register PM2 Register ADS Register P20/ANI0 to P21/ANI1 Pins
Digital I/O selection Input mode
−
Digital input
Output mode
−
Digital output
Analog input 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.
All P20/ANI0 to P21/ANI1 are set in the analog input mode when the reset signal is generated.
<R>
<R>