
RL78/G1P
CHAPTER 10 D/A CONVERTER
R01UH0895EJ0100 Rev.1.00
304
Nov 29, 2019
10.3.5 Port mode register 2 (PM2)
When using ANO0/ANI2/P22 and ANO1/ANI3/P23 pins as analog input ports, set bits PM22 and PM23 to 1.
If bits PM22 and PM23 are set to 0, these pins cannot be used as analog input ports.
The PM2 register can be set by a 1-bit or 8-bit memory manipulation instruction.
Reset signal generation sets this register to FFH.
Caution If a pin is set as an analog input port, not the pin level but 0 is always read.
Figure 10-6. Format of Port Mode Register 2 (PM2)
Address: FFF22H After reset: FFH R/W
Symbol
7 6 5 4 3 2 1 0
PM2
PM27
PM26
Note
PM25
Note
PM24
Note
PM23
PM22
PM21
PM20
PM2n
P2n pin I/O mode selection (n = 0 to 7)
0
Output mode (output buffer on)
1
Input mode (output buffer off)
Note
These are not provided in 24-pin products.
The function of the ANO0/ANI2/P22 to ANO1/ANI3/P23 pins can be selected by using the A/D port configuration
register (ADPC), the D/A converter mode register (DAM), the analog input channel specification register (ADS), and the
PM2 register.
Table 10-2. Setting Functions of ANO0/ANI2/P22 to ANO1/ANI3/P23 Pins
ADPC
PM2
DAM
ADS
Functions of ANO0/ANI2/P22 to ANO1/ANI3/P23
Pins
Digital I/O selection Input mode
Digital input
Output mode
Digital output
Analog I/O selection Input mode
Enables D/A
conversion operation
Selects ANI.
Setting prohibited
Does not
select ANI.
Analog output
Stops D/A conversion
operation
Selects ANI.
Analog input (to be converted)
Does not
select ANI.
Analog input (not to be converted)
Output mode Enables D/A
conversion operation
Selects ANI.
Setting prohibited
Does not
select ANI.
Stops D/A conversion
operation
Selects ANI.
Does not
select ANI.