Port 2 - Renesas RL78/G1P Hardware User Manual

16-bit single-chip microcontroller
Hide thumbs Also See for RL78/G1P:
Table of Contents

Advertisement

RL78/G1P

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, (+ side and – side) reference voltage input, and D/A
converter output.
To use P20/ANI0, P21/ANI1, P22/ANI2/ANO0, P23/ANI3/ANO1, P24/ANI4 to P27/ANI7 as digital input pins or digital
output pins, use these pins as following order.
P27  P26  P25  P21  P20  P22  P23  P24
To use P20 and P21 as A/D converter analog input and (+ side and – side) reference voltage input when P20/ANI0,
P21/ANI1, P22/ANI2/ANO0, P23/ANI3/ANO1, P24/ANI4 to P27/ANI7 is used as analog I/O pins, use these pins starting
from the next pin of P20 or P21.
In other case, use these pins as following order.
P24  P23  P22  P20  P21  P25  P26  P27
Name
P2n
Input
Output
Remarks 1. PM2: Port mode register 2
ADPC: A/D port configuration register
2. n = 0 to 7
Table 4-4. Setting Functions of P20/ANI0, P21/ANI1, P24/ANI4 to P27/ANI7 Pins
ADPC Register
Digital I/O selection
Analog input selection
P20/ANI0, P21/ANI1, P24/ANI4 toP27/ANI7 are set in the analog input mode when the reset signal is generated.
R01UH0895EJ0100 Rev.1.00
Nov 29, 2019
Table 4-3. Settings of Registers When Using Port 2
I/O
PM2n
ADPC
1
1
0
1
PM2 Register
Input mode
Output mode
Input mode
Output mode
Alternate Function Setting
ADS Register
Selects ANI.
Does not select ANI.
Selects ANI.
Does not select ANI.
CHAPTER 4 PORT FUNCTIONS
Remark
To use P2n as a port, use these
pins from a higher bit.
P20/ANI0, P21/ANI1,
P24/ANI4 to P27/ANI7 Pins
Digital input
Digital output
Analog input (to be converted)
Analog input (not to be converted)
Setting prohibited
70

Advertisement

Table of Contents
loading

Table of Contents