EasyManuals Logo
Home>Renesas>Computer Hardware>RL78/G13

Renesas RL78/G13 User Manual

Renesas RL78/G13
1092 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #204 background imageLoading...
Page #204 background image
RL78/G13 CHAPTER 4 PORT FUNCTIONS
R01UH0146EJ0100 Rev.1.00 185
Sep 22, 2011
4.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 input.
To use P20/ANI0 to P27/ANI7 as digital input pins, set them in the digital I/O 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 upper bit.
To use P20/ANI0 to P27/ANI7 as digital output pins, set them in the digital I/O mode by using the ADPC register and in
the output mode by using the PM2 register.
To use P20/ANI0 to P27/ANI7 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-5. Settings of Registers When Using Port 2
Pin Name
Name I/O
PM2× ADPC Alternate Function Setting Remark
Input 1 01 to n+1H
−
P2n
Output 0 01 to n+1H
To use P2n as a port, use these
pins from a higher bit.
Remark ×: don’t care
PM2×: Port mode register 2
ADPC: A/D port configuration register
Table 4-6. Setting Functions of P20/ANI0 to P27/ANI7 Pins
ADPC Register PM2 Register ADS Register P20/ANI0 to P27/ANI7 Pins
Input mode
−
Digital input Digital I/O selection
Output mode
−
Digital output
Selects ANI. Analog input (to be converted) Input mode
Does not select ANI. Analog input (not to be converted)
Selects ANI.
Analog input selection
Output mode
Does not select ANI.
Setting prohibited
All P20/ANI0 to P27/ANI7 are set in the analog input mode when the reset signal is generated.
<R>

Table of Contents

Other manuals for Renesas RL78/G13

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Renesas RL78/G13 and is the answer not in the manual?

Renesas RL78/G13 Specifications

General IconGeneral
BrandRenesas
ModelRL78/G13
CategoryComputer Hardware
LanguageEnglish

Related product manuals