All information contained in these materials, including products and product specifications,
represents information on the product at the time of publication and is subject to change by
Renesas Electronics Corp. without notice. Please review the latest information publish ed by
Renesas Electronics Corp. through various means, including the Renesas Electronics Corp.
website (http://www.renesas.com).
www.renesas.com
Dec 2016Rev. 1.20
Page 2
Notice
1. Descriptions of circuits, software and other related information in this document are provided only to illustrate the operation of
semiconductor products and application examples. You are fully responsible for the incorporation of these circuits, software,
and information in the design of your equipment. Renesas Electronics assumes no responsibility for any losses incurred by you
or third parties arising from the use of these circuits, software, or information.
2. Renesas Electronics has used reasonable care in preparing the information included in this document, but Renesas Electronics
does not warrant that such information is error free. Renesas Electronics assumes no liability whatsoever for any damages
incurred by you resulting from errors in or omissions from the information included herein.
3. Renesas Electronics does not assume any liability for infringement of patents, copyrights, or other intellectual property rights of
third parties by or arising from the use of Renesas Electronics products or technical information described in this document. No
license, express, implied or otherwise, is granted hereby under any patents, copyrights or other intellectual property rights of
Renesas Electronics or others.
4. You should not alter, modify, copy, or otherwise misappropriate any Renesas Electronics product, whether in whole or in part.
Renesas Electronics assumes no responsibility for any losses incurred by you or third parties arising from such alteration,
modification, copy or otherwise misappropriation of Renesas Electronics product.
5. Renesas Electronics products are classified according to the following two quality grades: “Standard” and “High Quality”. The
recommended applications for each Renesas Electronics product depends on the product’s quality grade, as indicated below.
“Standard”: Computers; office equipment; communications equipment; test and measurement equipment; audio and visual
equipment; home electronic appliances; machine tools; personal electronic equipment; and industrial robots etc.
Renesas Electronics products are neither intended nor authorized for use in products or systems that may pose a direct threat to
human life or bodily injury (artificial life support devices or systems, surgical implantations etc.), or may cause serious property
damages (nuclear reactor control systems, military equipment etc.). You must check the quality grade of each Renesas
Electronics product before using it in a particular application. You may not use any Renesas Electronics product for any
application for which it is not intended. Renesas Electronics shall not be in any way liable for any damages or losses incurred
by you or third parties arising from the use of any Renesas Electronics product for which the product is not intended by Renesas
Electronics.
6. You should use the Renesas Electronics products described in this document within the range specified by Renesas Electronics,
especially with respect to the maximum rating, operating supply voltage range, movement power voltage range, heat radiation
characteristics, installation and other product characteristics. Renesas Electronics shall have no liability for malfunctions or
damages arising out of the use of Renesas Electronics products beyond such specified ranges.
7. Although Renesas Electronics endeavors to improve the quality and reliability of its products, semiconductor products have
specific characteristics such as the occurrence of failure at a certain rate and malfunctions under certain use conditions. Further,
Renesas Electronics products are not subject to radiation resistance design. Please be sure to implement safety measures to
guard them against the possibility of physical injury, and injury or damage caused by fire in the event of the failure of a Renesas
Electronics product, such as safety design for hardware and software including but not limited to redundancy, fire control and
malfunction prevention, appropriate treatment for aging degradation or any other appropriate measures. Because the evaluation
of microcomputer software alone is very difficult, please evaluate the safety of the final products or systems manufactured by
you.
8. Please contact a Renesas Electronics sales office for details as to environmental matters such as the environmental compatibility
of each Renesas Electronics product. Please use Renesas Electronics products in compliance with all applicable laws and
regulations that regulate the inclusion or use of controlled substances, including without limitation, the EU RoHS Directive.
Renesas Electronics assumes no liability for damages or losses occurring as a result of your noncompliance with applicable laws
and regulations.
9. Renesas Electronics products and technology may not be used for or incorporated into any products or systems whose
manufacture, use, or sale is prohibited under any applicable domestic or foreign laws or regulations. You should not use
Renesas Electronics products or technology described in this document for any purpose relating to military applications or use
by the military, including but not limited to the development of weapons of mass destruction. When exporting the Renesas
Electronics products or technology described in this document, you should comply with the applicable export control laws and
regulations and follow the procedures required by such laws and regulations.
10. It is the responsibility of the buyer or distributor of Renesas Electronics products, who distributes, disposes of, or otherwise
places the product with a third party, to notify such third party in advance of the contents and conditions set forth in this
document, Renesas Electronics assumes no responsibility for any losses incurred by you or third parties as a result of
unauthorized use of Renesas Electronics products.
11. This document may not be reproduced or duplicated in any form, in whole or in part, without prior written consent of Renesas
Electronics.
12. Please contact a Renesas Electronics sales office if you have any questions regarding the information contained in this document
or Renesas Electronics products, or if you have any other inquiries.
(Note 1) “Renesas Electronics” as used in this document means Renesas Electronics Corporation and also includes its majority-
owned subsidiaries.
(Note 2) “Renesas Electronics product(s)” means any product developed or manufactured by or for Renesas Electronics.
(2012.4)
Page 3
NOTES FOR CMOS DEVICES
(1) VOLTAGE APPLICATION WAVEFORM AT INPUT PIN: Waveform distortion due to input noise or a
reflected wave may cause malfunction. If the input of the CMOS device stays in the area between VIL
(MAX) and VIH (MIN) due to noise, etc., the device may malfunction. T ake care to prevent chattering noise
from entering the device when the input level is fixed, and also in the tra nsition period when the input level
passes through the area between VIL (MAX) and VIH (MIN).
(2) HANDLING OF UNUSED INPUT PINS: Unconnected CMOS device inputs can be c ause of malfunction. If
an input pin is unconnected, it is possible that an internal input level may be generate d due to noise, etc.,
causing malfunction. CMOS devices behave differently than Bipolar or NMOS devices. Input levels of
CMOS devices must be fixed high or low by using pull-up or pull-do wn circuitry. Each unused pin should be
connected to VDD or GND via a resistor if there is a possibility that it will be an output pin. All handling
related to unused pins must be judged separately for each device and according to related specifications
governing the device.
(3) PRECAUTION AGAINST ESD: A strong electric field, when exposed to a MOS device, can cause
destruction of the gate oxide and ultimately degrade the device operation. Steps must be taken to stop
generation of static electricity as much as possible, and quickly dissipate it when it has occurred.
Environmental control must be adequate. When it is dry, a humidifier should be used. It is recommended
to avoid using insulators that easily build up static electricity. Semiconductor devices must be stored and
transported in an anti-static container, static shielding bag or conductive material. All test and measurement
tools including work benches and floors should be grounded. The operator should be gr oun ded usin g a wrist
strap. Semiconductor devices must not be touched with bare hands. Similar precautions need to be taken
for PW boards with mounted semiconductor devices.
(4) STATUS BEFORE INITIALIZATION: Power-on does not necessarily define the initial status of a MOS
device. Immediately after the power source is turned ON, devices with reset functions have not yet been
initialized. Hence, power-on does not guarantee output pin levels, I/O settings or contents of registers. A
device is not initialized until the reset signal is received. A reset operation must be executed immediately
after power-on for devices with reset functions.
(5) POWER ON/OFF SEQUENCE: In the case of a device that uses different power supplies for the internal
operation and external interface, as a rule, switch on the e xternal power suppl y after switching on th e internal
power supply. When switching the power supply off, as a rule, switch off the external power supply and then
the internal power supply. Use of the reverse po wer on/off sequences may result in the application of an
overvoltage to the internal elements of the device, causing malfunction and degr adation of internal elements
due to the passage of an abnormal current. The correct po wer on/off sequence must be judged separately
for each device and according to related specifications governing the device.
(6) INPUT OF SIGNAL DURING POWER OFF STATE : Do not input signals or an I/O pull-up power supply
while the device is not powered. The current injection that results from input of such a signal or I/O pull-up
power supply may cause malfunction and the abnormal current that passes in the device at this time may
cause degradation of internal elements. Input of signals during the power off state must be judged
separately for each device and according to related specifications governing the device.
Page 4
How to Use This Manual
ReadersThis manual is intended for user engineers who wish to understand the functions of the
RL78/G1H and design and develop application systems and programs for these devices.
PurposeThis manual is intended to give users an understanding of the functions described in the
Organization below.
OrganizationThe RL78/G1H manual is separated into two parts: this manual and the software edition
(common to the RL78 family).
How to Read This Manual
RL78/G1H
User’s Manual
Hardware
(This Manual)
• Pin functions
• Internal block functions
• Interrupts
• Other on-chip peripheral functions
• Electrical specifications
It is assumed that the readers of this manual have general knowledge of electrical engineering,
logic circuits, and microcontrollers.
• To gain a general understanding of functions:
→ Read this manual in the order of the CONTENTS. The mark “<R>” shows major revised
points. The revised points can be easily searched by copying an “<R>” in the PDF file and
specifying it in the “Find what:” field.
• How to interpret the register format:
→ For a bit number enclosed in angle brackets, the bit name is defined as a reserved word
• CPU functions
• Instruction set
• Explanation of each instruction
RL78 Family
User’s Manual
Software
in the assembler, and is defined as an sfr variable using the #pragma sfr directive in the
compiler.
• To know details of the RL78/G1H Microcontroller instructions:
→ Refer to the separate document RL78 Family User's Manual Software (R01US0015E).
Page 5
ConventionsData significance:Higher digits on the left and lower digits on the right
Active low representations:×××
Note:Footnote for item marked with Note in the text
APPENDIX AREVISION HISTORY .................................................................................................. 910
A.1Major Revisions in This Edition ............................................................................................ 910
A.2Revision History of Preceding Editions ................................................................................. 912
Index - 12
Page 19
RL78/G1H
RENESAS MCU
R01UH0575EJ0120
Dec 22, 2016
CHAPTER 1 OUTLINE
RL78/G1H is a microcontroller equipped with the low-power-consumption RF transceiver compatible with the SubGHzband wireless communication. The wireless communication in the SubGHz band is best for the smart meter
communication part, HEMS controller, wireless sensor network, etc.
1.1Features
Ultra-low power consumption technology
• Standby function of MCU: HALT mode, STOP mode, SNOOZE mode
• Standby function of RF unit: DLE mode, SLEEP mode
• RF operation transmission current: 21 mA (TYP.) (RF; 100 kbps, 2FSK, +10 dBm, 3.0 V/
at STOP mode of MCU)
• Minimum instruction execution time: Can be changed from high speed (0.03125 μs: @ 32 MHz operation with highspeed on-chip oscillator) to ultra-low speed (30.5 μs: @ 32.768 kHz operation with subsystem clock)
R01UH0575EJ0120 Rev. 1.20Page 8 of 920
Dec 22, 2016
Page 27
RL78/G1HCHAPTER 1 OUTLINE
<R>
1.6Outline of Functions
(1/2)
ItemR5F11FLJR5F11FLKR5F11FLL
Code flash memory (KB)256 KB384 KB512 KB
Data flash memory (KB)8 KB8 KB8 KB
RAM (KB)
24 KB32 KB
Address space1 MB
Main system clockHigh-speed system
clock
High-speed on-chip
oscillator clock (f
X1 (crystal/ceramic) oscillator, external main system clock input (EXCLK)
HS (high-speed main) mode: 1 to 20 MHz (V
HS (high-speed main) mode: 1 to 16 MHz (V
LS (low-speed main) mode: 1 to 8 MHz (V
HS (high-speed main) mode: 1 to 32 MHz (V
IH)
HS (high-speed main) mode: 1 to 16 MHz (V
LS (low-speed main) mode: 1 to 8 MHz (V
Voltage detector• Rising edge: 1.88 V to 3.13 V (10 stages)
• Falling edge: 1.84 V to 3.06 V (10 stages)
On-chip debug functionProvided
Power supply voltageV
Operating ambient temperatureT
DD = 1.8 to 3.6 V
A = -40 to +85 °C (A: Consumer applications, D: Industrial applications)
Package64-pin HVQFN (9
MAIN = 20 MHz operation)
SUB = 32.768 kHz operation)
pin
Note 3
× 9), (0.5 mm pitch)
Note 1.This is about 47 KB when the self-programming function is used (For details, see CHAPTER 4).
Note 2.When using the RF transceiver, pins which a user uses for external connection between the MCU and RF transceiver on
the board are included.
Note 3.The illegal instruction is generated when instruction code FFH is executed.
Reset by the illegal instruction execution is not issued by emulation with the in-circuit emulator or on-chip debug
emulator.
R01UH0575EJ0120 Rev. 1.20Page 10 of 920
Dec 22, 2016
Page 29
RL78/G1HCHAPTER 2 CONNECTION BETWEEN MCU AND RF TRANSCEIVER
CHAPTER 2 CONNECTION BETWEEN MCU AND RF TRANSCEIVER
2.1Connection Pins of MCU and RF Transceiver
Table 2 - 1 lists the pins connected inside the RL78/G1H. Table 2 - 2 lists the pins which need to be connected on the
board by the user.
These pins require initial settings for an appropriate mode/level before starting communication with the RF
transceiver.
Table 2 - 1 Internal Pin Connection
Pin Name
MCURF
P10OSCDRVSEL This is a switch signal that has the buffer drive capability for 48 MHz crystal
P11DONThis is an enable signal of DCDC converter of RF unit. It becomes active
P12RFRESETBHardware reset signal for the RF unit. RFRESETB=Low resets RF unit.
P13/SO20SINSerial interface used for internal communication between blocks. Since it is
P14/SI20
P15/SCK20SCLKThis is an operation clock of Serial interface for internal communication
P16SENThis is a communication enable control signal of Serial interface (RF unit) for
P30/INTP3
SOUT
INTOUT
unit
Note
oscillator.
The buffer size (current) of the oscillator becomes smaller when
OSCDRVSEL is High.
The buffer size (current) of the oscillator becomes larger when OSCDRVSEL
is Low. P10, which is an internal I/O pin of MCU, controls OSCDRVSEL.
(DCDC converter is operable) when DON is set to High. P11, which is an
internal I/O pin of MCU, controls DON.
RFRESETB is controlled by P12 which is an internal I/O port of the MCU.
dedicated to internal communication (MCU: output data, RF unit: input data),
it cannot be used for communication with external modules.
Serial interface used for internal communication between blocks. Since it is
dedicated to internal communication (MCU: input data, RF unit: output data),
it cannot be used for communication with external modules.
between blocks. Since it is dedicated to internal communication, it cannot be
used for communication with external modules.
internal communication between blocks.
It becomes active (Serial communication enabled) when SEN is Low. P16,
which is an internal I/O of MCU, controls SEN.
Note
Interrupt request signal from RF transceiver. If an interrupt source is
generated in RF unit, the status is output from INTOUT. MCU receives this
status at INTP3, and can execute the interrupt processing.
FunctionDirection
MCU to RF unit
MCU to RF unit
MCU to RF unit
MCU to RF unit
RF unit to MCU
MCU to RF unit
MCU to RF unit
RF unit to MCU
Note These pin outputs might be high impedance causing state of RF transceiver. These pins are required to fix by MCU in
this case. For details, see CHAPTER 18 RF TRANSCEIVER.
Table 2 - 2 Pins Externally Connected on User Board
Pin Name
MCURF unit
P130STANDBYThis is a power-down control signal of RF unit. RF unit becomes operable
when STANDBY is High. RF unit enters the SLEEP state when STANDBY
is Low. P130, which is an I/O pin of MCU, controls STANDBY. Connect
P130 and STANDBY externally (on the board).
FunctionDirection
MCU to RF unit
R01UH0575EJ0120 Rev. 1.20Page 11 of 920
Dec 22, 2016
Page 30
RL78/G1HCHAPTER 2 CONNECTION BETWEEN MCU AND RF TRANSCEIVER
2.2Communication Interface Between MCU and RF Transceiver
3-wire serial I/O (CSI) is used for the SPI interface for internal communication between the MCU and RF unit. For
data transfer between the MCU and RF unit, a transfer clock is output from the MCU to the RF unit and data is
transmitted and received. The operation of the 3-wire serial I/O (CSI) is shown in Table 2 - 3.
Table 2 - 3 3-Wire Serial IO Between MCU and RF Transceiver
ItemCSI20 (dedicated for internal communication)
Target channelChannel 0 of serial array unit 1 (SAU1)
Pins usedSCK20, SI20, SO20 (pins for communication/all on-chip dedicated internal pin), and P16 (pin for control
of the SEN pin/on-chip dedicated internal I/O pin)
Operation modeOnly transmission mode or transmission/reception mode is supported.
Master/slaveOnly master is supported.
InterruptTransfer end interrupt (in single-transfer mode) or buffer empty interrupt (in continuous transfer mode)
can be selected.
Error detection flagOverrun error detection flag (OVF20)
Transfer data lengthOnly 8-bit length is supported.
Transfer rateWithin the range that satisfies the AC characteristics of the electrical specifications
Data phaseOnly Type 1 is supported.
Clock phaseOnly Type 1 is supported.
Data directionOnly MSB first is supported.
CautionUse the RL78/G1D so that these conditions and the specifications of the AC characteristics (CHAPTER 31
ELECTRICAL SPECIFICATIONS) are satisfied.
R01UH0575EJ0120 Rev. 1.20Page 12 of 920
Dec 22, 2016
Page 31
RL78/G1HCHAPTER 2 CONNECTION BETWEEN MCU AND RF TRANSCEIVER
2.3Initial Settings of Unused Internal Pins of MCU
After reset release, the following internal pins of the MCU need to be set to output mode (set the port registers and
port mode registers to 0) by software.
P00, P01, P05, P06, P17, P23 to P27, P41 to P47, P50 to P57, P64 to P67, P73 to P74, P83 to P87
P101, P102, P110, P111, P145 to P147, P150 to P154
R01UH0575EJ0120 Rev. 1.20Page 13 of 920
Dec 22, 2016
Page 32
RL78/G1HCHAPTER 2 CONNECTION BETWEEN MCU AND RF TRANSCEIVER
XIN
XOUT
2.4Base Operation Clock of RF Unit
RF unit operation requires a 48 MHz clock. Table 2 - 4 shows clock resonator connection and Figure 2 - 1 shows the
clock configuration.
Table 2 - 4 Clock Resonator Connection (Using on-chip low-speed oscillator in the RF unit as a slow clock.)
Pin NameFuncion
XINBase clock of the RF unit.
XOUT
Figure 2 - 1 Clock Configuration
Connect a 48 MHz crystal resonator.
CautionThis figure only shows connection between the clock resonator pins and clock line.
R01UH0575EJ0120 Rev. 1.20Page 14 of 920
Dec 22, 2016
Page 33
RL78/G1HCHAPTER 2 CONNECTION BETWEEN MCU AND RF TRANSCEIVER
47 μF
1 μF
* Place the entire capacitor and
inductor elements close to the pin.
1 μF
1 μF
1 μF
1 μF
1 μF
1 μF
0.47 μF
10 μH
1.8 to 3.6 V
RF
MCU
VDDVCCDDCVCCRFDDCOUTREGIN
VREGO1
VREGO2
VREGO3
VSSDDCVSSAGNDRF2AGNDRF1
REGC
2.5Power Configuration
Power is supplied to both the MCU and RF unit. The RF unit includes a DC-DC converter. The power switched at
the DC-DC converter is output to the DDCOUT pin. The power is smoothed by an inductor and capacitor to step
down the voltage, and then supplied to the REGIN.
Figure 2 - 2 shows the power configuration of the RL78/G1H.
Figure 2 - 2 Power Configuration
R01UH0575EJ0120 Rev. 1.20Page 15 of 920
Dec 22, 2016
Page 34
RL78/G1HCHAPTER 2 CONNECTION BETWEEN MCU AND RF TRANSCEIVER
CautionThe multiple power supply smoothing capacitors may be connected to a pin depending on the
routing of the board wiring, noise, and others.
R01UH0575EJ0120 Rev. 1.20Page 18 of 920
Dec 22, 2016
Page 37
RL78/G1HCHAPTER 3 PIN FUNCTIONS
CHAPTER 3 PIN FUNCTIONS
3.1Port Functions
Pin I/O buffer power supplies depend on the pin. The relationship between these power supplies and the pins is
shown below.
Table 3 - 1 Pin I/O Buffer Power Supplies
Power SupplyCorresponding Pins
DD• P02 to P04, P10 to P16, P20 to P22, P30, P31, P40, P60 to P63, P70 to P72, P75 to P77,
V
P80 to P82, P120 to P124, P130, P137, P140 to P144, P155, P156
, REGC
VCCDDC
• RESET
• GPIO0 to GPIO4, STANDBY, MODE1, MODE2, INTOUT
R01UH0575EJ0120 Rev. 1.20Page 19 of 920
Dec 22, 2016
Page 38
RL78/G1HCHAPTER 3 PIN FUNCTIONS
Set in each port I/O, buffer, pull-up resistor is also valid for alternate functions.
(1/2)
Function
Name
P02
P03
Pin TypeI/O
Note 1
7-3-4
Note 1
8-3-4
I/OProhibit
P048-1-4Input portSCK10
Note 3
P10
P11
P12
P13
P14
P15
P16
—I/OInput port—Port 1.
Note 3
Note 3
Note 3
Note 3
Note 3
Note 3
P204-3-3I/OAnalog
P21ANI1/AV
P22ANI2
Note 3
P30
8-1-4I/OInput portINTP3Port 3.
P317-1-3TI03/TO03/INTP4
P407-1-3I/OInput portTOOL0Port 4.
P6012-1-2I/OInput portSCLA0Port 6.
P61SDAA0
P62
P63SDAA1
P707-1-3I/OInput portSCK21Port 7.
P717-1-4SI21
P727-1-3SO21
P75NTP9
P76INTP10
P77INTP11
After Reset
Release
Note 2
I/O
function
Alternate FunctionFunction
SO10/TxD1Port 0.
SI10/RxD1
3-bit I/O port.
Input/output can be specified in 1-bit units.
Use of an on-chip pull-up resistor can be specified by
a software setting at input port.
Input of P03 and P04 can be set to TTL input buffer.
Output of P02 to P04 can be set to N-ch open-drain
output (V
The digital I/O of P02 and P03 is prohibited at the
reset release
—
—
SO20
7-bit I/O port.
Input/output can be specified in 1-bit units.
Use of an on-chip pull-up resistor can be specified by
a software setting at input port.
SI20
SCK20
—
ANI0/AV
REFPPort 2.
REFM
3-bit I/O port.
Input/output can be specified in 1-bit units.
Can be set to analog input
2-bit I/O port.
Input/output can be specified in 1-bit units.
Use of an on-chip pull-up resistor can be specified by
a software setting at input port.
1-bit I/O port.
Input/output can be specified in 1-bit units.
Use of an on-chip pull-up resistor can be specified by
a software setting at input port.
4-bit I/O port.
Input/output can be specified in 1-bit units.
SCLA1
Output of P60 to P63 is N-ch open-drain output
(6 V tolerance).
6-bit I/O port.
Input/output can be specified in 1-bit units.
Use of an on-chip pull-up resistor can be specified by
a software setting at input port.
Output of P71 can be set to N-ch open-drain output
(V
DD tolerance).
DD tolerance).
Note 2
.
Note 4
.
Note 1.Input of A/D converter is not supported.
Note 2.Each pin can be specified as digital I/O port by setting port mode control register x (PMCx) (Can be specified in 1-bit
units).
Note 3.This pin is used for connection between the MCU and RF transceiver. For details, refer to CHAPTER 2 CONNECTION
BETWEEN MCU AND RF TRANSCEIVER
.
Note 4.Each pin can be specified as either digital or analog by setting the A/D port configuration register (ADPC).
R01UH0575EJ0120 Rev. 1.20Page 20 of 920
Dec 22, 2016
Page 39
RL78/G1HCHAPTER 3 PIN FUNCTIONS
(2/2)
Function
Name
P808-1-4I/OInput port—Port 8.
P81—
P827-1-4—
P1007-3-3I/OProhibit I/O—Port 10.
P1207-3-3I/OAnalog function ANI19Port 12.
P1212-2-1InputInput portX1
P122X2/EXCLK
P123XT1
P124XT2/EXCLKS
P130
P1372-1-2InputInput portINTP0
P1407-1-3I/OInput portPCLBUZ0/INTP6Port 14.
P141PCLBUZ1/INTP7
P1428-1-4SCK30
P143SI30/RxD3
P1447-1-4SO30/TxD3
P1554-3-3I/OAnalog function ANI13Port 15.
P156ANI14
RESET
Pin TypeI/O
Note 2
1-1-1OutputOutput port—Port 13.
2-1-1Input——Input-only pin for external reset.
After Reset
Release
Alternate FunctionFunction
3-bit I/O port.
Input/output can be specified in 1-bit units.
Use of an on-chip pull-up resistor can be specified by a software
setting at input port.
1-bit I/O port.
Input/output can be specified in 1-bit units.
Use of an on-chip pull-up resistor can be specified by a software
setting at input port.
The digital I/O of P100 is prohibited at reset release
1-bit I/O port and 4-bit input-only port.
P120 can be set to analog I/O.
For only P120, input/output can be specified.
For only P120, use of an on-chip pull-up resistor can be specified
by a software setting at input port.
1-bit output-only port and 1-bit input-only port.
5-bit I/O port.
Input/output can be specified in 1-bit units.
Use of an on-chip pull-up resistor can be specified by a software
setting at input port.
Input of P142 and P143 can be set to TTL input buffer.
Output of P142 to P144 can be set to N-ch open-drain output
DD tolerance).
(V
2-bit I/O port.
Input/output can be specified in 1-bit units.
Can be set to analog input
Connect to V
used.
DD directly or via a resistor when external reset is not
Note 3
.
Note 1
.
Note 1.Each pin can be specified as digital I/O port by setting port mode control register x (PMCx) (Can be specified in 1-bit
units).
Note 2.This pin is used for connection between the MCU and RF transceiver. For details, refer to CHAPTER 2 CONNECTION
BETWEEN MCU AND RF TRANSCEIVER
.
Note 3.Each pin can be specified as either digital or analog by setting the A/D port configuration register (ADPC).
R01UH0575EJ0120 Rev. 1.20Page 21 of 920
Dec 22, 2016
Page 40
RL78/G1HCHAPTER 3 PIN FUNCTIONS
3.2Functions other than port pins
Function NameI/OFunction
ANI0 to ANI2, ANI13, ANI14,
ANI19
INTP0, INTP3
Note
, INTP4, INTP6,
INTP7, INTP9 to INTP11
Input
Input
PCLBUZ0, PCLBUZ1OutputClock output/buzzer output
REGC
RESET
Input
RxD1, RxD3InputSerial data input pins of serial interface UART1 and UART3
TxD1, TxD3OutputSerial data output pins of serial interface UART1 and UART3
SCK10, SCK20
Note
, SCK21,
SCK30
SI10, SI20
SO10, SO20
Note
, SI21, SI30
Note
, SO21, SO30
Input
Output
SCLA0, SCLA1I/OSerial clock I/O pins of serial interface IICA0 and IICA1
SDAA0, SDAA1I/OSerial data I/O pins of serial interface IICA0 and IICA1
TI03InputThe pins for inputting an external count clock/capture trigger to 16-bit timer 03
TO03OutputTimer output pins of 16-bit timer 03
X1, X2—Resonator connection for main system clock
EXCLKInputExternal clock input for main system clock
XT1, XT2—Resonator connection for subsystem clock
EXCLKSInputExternal clock input for subsystem clock
TOOL0I/OData I/O for flash memory programmer/debugger
A/D converter analog input (see
Figure 13 - 30 Analog Input Pin Connection)
External interrupt request input
Valid edge specification: Rising edge, falling edge, or both rising and falling edges
Pin for connecting regulator output stabilization capacitance for internal operation.
Connect this pin to V
—
Also, use a capacitor with good characteristics, since it is used to stabilize internal
SS via a capacitor (0.47 to 1 μF).
voltage.
This is the active-low system reset input pin.
When the external reset pin is not used, connect this pin directly or via a resistor to
DD.
V
Serial clock I/O pins of serial interface CSI10, CSI20, CSI21, and CSI30
I/O
Serial data input pins of serial interface CSI10, CSI20, CSI21, and CSI30
Serial data output pins of serial interface CSI10, CSI20, CSI21, and CSI30
NoteThis pin is used for connection between the MCU and RF transceiver. For details, refer to CHAPTER 2 CONNECTION
BETWEEN MCU AND RF TRANSCEIVER
.
CautionAfter reset release, the relationships between P40/TOOL0 and the operating mode are as follows.
Table 3 - 2 Relationships Between P40/TOOL0 and Operation Mode After Reset Release
P40/TOOL0Operating mode
DDNormal operation mode
V
0 VFlash memory programming mode
For details, see 27.3 Programming Method.
Remark
A bypass capacitor about 0.1 μF must be connected for measures of noises and latch-up between VDD and VSS lines on
the shortest distance and with comparative thick wire.
R01UH0575EJ0120 Rev. 1.20Page 22 of 920
Dec 22, 2016
Page 41
RL78/G1HCHAPTER 3 PIN FUNCTIONS
3.3Connection of Unused Pins
Table 3 - 3 shows the Connection of Unused Pins.
<R>
Table 3 - 3 Connection of Unused Pins
Pin NameI/ORecommended Connection of Unused Pins
P02 to P04I/OInput: Independently connect to V
P20 to P22
Output: Leave open.
P31
P40/TOOL0Input: Independently connect to V
Output: Leave open.
P60 to P63Input: Independently connect to V
Output: Set the port’s output latch to 0 and leave the pins open, or set the port’s output latch to
1 and independently connect the pins to V
P70 to P72, P75 to P77Input: Independently connect to V
P80 to P82
Output: Leave open.
P100
P120
P121 to P124InputIndependently connect to V
P130Output Leave open.
P137InputIndependently connect to V
P140 to P144I/OInput: Independently connect to V
Output: Leave open.
P155, P156Input: Independently connect to V
Output: Leave open.
RESET
REGC—Connect to V
InputConnect to VDD directly or via a resistor.
SS via a capacitor (0.47 to 1 μF).
GPIO0/CLKOUTI/OInput: Leave open or independently connect to VCCDDC or VSSDDC via a resistor.
GPIO1/ANTSELOUT0
Output: Leave open.
GPIO2/ANTSELOUT1
GPIO3
GPIO4/ANTSW
DD or VSS via a resistor.
DD via a resistor, or leave open.
DD or VSS via a resistor.
DD or VSS via a resistor.
DD or VSS via a resistor.
DD or VSS via a resistor.
DD or VSS via a resistor.
DD or VSS via a resistor.
DD or VSS via a resistor.
RemarkFor how to handle the ports other than the above, see CHAPTER 5 PORT FUNCTIONS.
R01UH0575EJ0120 Rev. 1.20Page 23 of 920
Dec 22, 2016
Page 42
RL78/G1HCHAPTER 3 PIN FUNCTIONS
Output latch
(Pmn)
RD
WR
PORT
Internal bus
VDD
VSS
P-ch
N-ch
Pmn
RESETRESET
Alternate
function
Internal bus
RD
Pmn
3.4Pin Block Diagrams
For the pin types listed in 3.1 Port Functions, pin block diagrams are shown in Figures 3 - 1 to 3 - 13.
Figure 3 - 1 Pin Block Diagram of Pin Type 1-1-1
Figure 3 - 2 Pin Block Diagram of Pin Type 2-1-1
Figure 3 - 3 Pin Block Diagram of Pin Type 2-1-2
RemarkRefer to 3.1 Port Functions for alternate functions.
R01UH0575EJ0120 Rev. 1.20Page 24 of 920
Dec 22, 2016
Page 43
RL78/G1HCHAPTER 3 PIN FUNCTIONS
Alternate function
Alternate function
RD
RD
Clock generator
OSCSEL/
OSCSELS
CMC
EXCLK, OSCSEL/
EXCLKS, OSCSELS
CMC
N-chP-ch
P122/X2/EXCLK/Alternate function
P124/XT2/EXCLKS/Alternate function
P121/X1/Alternate function
P123/XT1/Alternate function
Internal bus
Figure 3 - 4 Pin Block Diagram of Pin Type 2-2-1
RemarkRefer to 3.1 Port Functions for alternate functions.
R01UH0575EJ0120 Rev. 1.20Page 25 of 920
Dec 22, 2016
Page 44
RL78/G1HCHAPTER 3 PIN FUNCTIONS
Internal bus
WRPORT
RDPORT
WRADPC
Output latch
(Pmn)
ADPC3 to ADPC0
N-ch
P-ch
A/D converter
PM register
(PMmn)
WRPM
PMS register
WRPMS
0: Analog input
1: Digital I/O
N-ch
P-ch
VDD
VSS
Pmn
1
0
1
0
ADPC
Figure 3 - 5 Pin Block Diagram of Pin Type 4-3-3
R01UH0575EJ0120 Rev. 1.20Page 26 of 920
Dec 22, 2016
Page 45
RL78/G1HCHAPTER 3 PIN FUNCTIONS
Internal bus
Alternate function
(SAU)
PM register
(PMmn)
PMS register
Output latch
(Pmn)
Alternate function
PU register
(PUmn)
RDPORT
WRPORT
WRPMS
WRPU
Alternate function
(other than SAU)
WRPM
Pmn
P-ch
P-ch
N-ch
V
DD
VSS
VDD
Schmitt2
1
0
1
0
Figure 3 - 6 Pin Block Diagram of Pin Type 7-1-3
Remark 1. Refer to 3.1 Port Functions for alternate functions.
Remark 2. SAU: Serial array unit
R01UH0575EJ0120 Rev. 1.20Page 27 of 920
Dec 22, 2016
Page 46
RL78/G1HCHAPTER 3 PIN FUNCTIONS
Internal bus
POM register
(POMmn)
PM register
(PMmn)
PMS register
Output latch
(Pmn)
Alternate function
PU register
(PUmn)
WRPORT
WRPMS
WRPU
Alternate function
(SAU)
WRPM
Pmn
P-ch
P-ch
N-ch
V
DD
VSS
VDD
Schmitt2
Alternate function
(other than SAU)
WRPOM
1
0
1
0
RDPORT
Figure 3 - 7 Pin Block Diagram of Pin Type 7-1-4
Remark 1. Refer to 3.1 Port Functions for alternate functions.
Remark 2. SAU: Serial array unit
R01UH0575EJ0120 Rev. 1.20Page 28 of 920
Dec 22, 2016
Page 47
RL78/G1HCHAPTER 3 PIN FUNCTIONS
Internal bus
PM register
(PMmn)
PU register
(PUmn)
PMC register
(PMCmn)
Alternate function
Output latch
(Pmn)
PMS register
Alternate function
(SAU)
VDD
P-ch
N-ch
V
SS
Pmn
P-ch
VDD
WRPU
WRPMC
RDPORT
WRPORT
WRPMS
Schmitt2
P-ch
N-ch
A/D converter
Alternate function
(other than SAU)
WRPM
1
0
1
0
Figure 3 - 8 Pin Block Diagram of Pin Type 7-3-3
Remark 1. Refer to 3.1 Port Functions for alternate functions.
Remark 2. SAU: Serial array unit
R01UH0575EJ0120 Rev. 1.20Page 29 of 920
Dec 22, 2016
Page 48
RL78/G1HCHAPTER 3 PIN FUNCTIONS
Internal bus
PM register
(PMmn)
PU register
(PUmn)
PMC register
(PMCmn)
Alternate function
Output latch
(Pmn)
PMS register
POM register
(POMmn)
VDD
P-ch
N-ch
V
SS
Pmn
P-ch
VDD
WRPU
WRPMC
RDPORT
WRPORT
WRPMS
Schmitt2
P-ch
N-ch
A/D converter
Alternate function
(SAU)
WRPM
Alternate function
(other than SAU)
WRPOM
1
0
1
0
Figure 3 - 9 Pin Block Diagram of Pin Type 7-3-4
Remark 1. Refer to 3.1 Port Functions for alternate functions.
Remark 2. SAU: Serial array unit
R01UH0575EJ0120 Rev. 1.20Page 30 of 920
Dec 22, 2016
Page 49
RL78/G1HCHAPTER 3 PIN FUNCTIONS
Internal bus
PU register
(PUmn)
PIM register
(PIMmn)
Alternate function
Output latch
(Pmn)
PMS register
PM register
(PMmn)
Alternate function
(SAU)
WRPMS
WRPORT
RDPORT
WRPIM
WRPU
VDD
P-ch
N-ch
V
SS
Pmn
P-ch
VDD
CMOS
TTL
Alternate function
(other than SAU)
WRPM
Schmitt2
1
0
1
0
Figure 3 - 10 Pin Block Diagram of Pin Type 8-1-3
Remark 1. Refer to 3.1 Port Functions for alternate functions.
Remark 2. SAU: Serial array unit
R01UH0575EJ0120 Rev. 1.20Page 31 of 920
Dec 22, 2016
Page 50
RL78/G1HCHAPTER 3 PIN FUNCTIONS
Internal bus
PU register
(PUmn)
PIM register
(PIMmn)
Alternate function
Output latch
(Pmn)
PMS register
PM register
(PMmn)
POM register
(POMmn)
WRPMS
WRPORT
RDPORT
WRPIM
WRPU
VDD
P-ch
N-ch
V
SS
Pmn
P-ch
VDD
CMOS
TTL
Alternate function
(SAU)
WRPM
Alternate function
(other than SAU)
WRPOM
Schmitt2
1
0
1
0
Figure 3 - 11 Pin Block Diagram of Pin Type 8-1-4
Remark 1. Refer to 3.1 Port Functions for alternate functions.
Remark 2. SAU: Serial array unit
R01UH0575EJ0120 Rev. 1.20Page 32 of 920
Dec 22, 2016
Page 51
RL78/G1HCHAPTER 3 PIN FUNCTIONS
CMOS
TTL
Pmn
Internal bus
PU register
(PUmn)
PIM register
(PIMmn)
PMC register
(PMCmn)
Alternate function
Output latch
(Pmn)
PMS register
PM register
(PMmn)
POM register
(POMmn)
P-ch
N-ch
A/D converter
P-ch
N-ch
VDD
VSS
P-ch
VDD
WRPU
WRPIM
WRPMC
RDPORT
WRPORT
WRPMS
Alternate function
(SAU)
WRPM
Schmitt2
Alternate function
(other than SAU)
WRPOM
1
0
1
0
Figure 3 - 12 Pin Block Diagram of Pin Type 8-3-4
Remark 1. Refer to 3.1 Port Functions for alternate functions.
Remark 2. SAU: Serial array unit
R01UH0575EJ0120 Rev. 1.20Page 33 of 920
Dec 22, 2016
Page 52
RL78/G1HCHAPTER 3 PIN FUNCTIONS
Internal bus
Output latch
(Pmn)
Alternate function
PMS register
Alternate function
(SAU)
PM register
(PMmn)
WRPORT
WRPMS
RDPORT
N-ch
VSS
Pmn
Schmitt1
Alternate function
(other than SAU)
WRPM
1
0
1
0
Figure 3 - 13 Pin Block Diagram of Pin Type 12-1-2
Remark 1. Refer to 3.1 Port Functions for alternate functions.
Remark 2. SAU: Serial array unit
R01UH0575EJ0120 Rev. 1.20Page 34 of 920
Dec 22, 2016
Figure 3 - 15 Pin Block Diagram of Pin GPIO0 to GPIO4
Figure 3 - 16 Pin Block Diagram of Pin INTOUT
INTOUT
Output enable
Data
R01UH0575EJ0120 Rev. 1.20Page 35 of 920
Dec 22, 2016
Page 54
RL78/G1HCHAPTER 4 CPU ARCHITECTURE
CHAPTER 4 CPU ARCHITECTURE
4.1Memory Space
Products in the RL78/G1H can access a 1 MB address space. Figures 4 - 1 to 4 - 3 show the memory maps.
R01UH0575EJ0120 Rev. 1.20Page 36 of 920
Dec 22, 2016
Page 55
RL78/G1HCHAPTER 4 CPU ARCHITECTURE
FFFFFH
FFEE0H
FFEDFH
F9F00H
F9EFFH
F3000H
F2FFFH
F1000H
F0FFFH
F0800H
F07FFH
F0000H
EFFFFH
40000H
3FFFFH
00000H
Data memory
space
Program
memory
space
FFF00H
FFEFFH
Special function register (SFR)
256 bytes
General-purpose register
32 bytes
RAM
Notes 1, 2
24 Kbytes
Mirror
27.75 Kbytes
Data flash memory
8 Kbytes
Reserved
Extended special function register
(2nd SFR)
2 Kbytes
Reserved
Code flash memory
256 Kbytes
00000H
01FFFH
010CEH
010CDH
010C4H
010C3H
010C0H
010BFH
01080H
0107FH
000CEH
000CDH
01000H
00FFFH
3FFFFH
000C4H
000C3H
000C0H
000BFH
00080H
0007FH
Boot cluster 0
Note 4
Boot cluster 1
Program area
Program area
CALLT table area
64 bytes
Vector table area
128 bytes
Option byte area
Note 3
4 bytes
CALLT table area
64 bytes
Vector table area
128 bytes
On-chip debug security
ID setting area
Note 3
10 bytes
Option byte area
Note 3
4 bytes
On-chip debug security
ID setting area
Note 3
10 bytes
Figure 4 - 1 Memory Map (R5F11FLJ)
Note 1.Do not allocate RAM addresses which are used as a stack area, a data buffer, a branch destination of vector interrupt
processing, and a DTC transfer destination/transfer source to the area FFE20H to FFEDFH when performing selfprogramming and rewriting the data flash memory.
Note 2.Instructions can be executed from the RAM area excluding the general-purpose register area.
Note 3.When boot swap is not used: Set the option bytes to 000C0H to 000C3H, and the on-chip debug security IDs to 000C4H
When boot swap is used:Set the option bytes to 000C0H to 000C3H and 010C0H to 010C3H, and the on-chip debug
Note 4.Writing boot cluster 0 can be prohibited depending on the setting of security (see 27.6 Security Settings).
Note 5.Use of the area FA300H to FA6FFH is prohibited when using the on-chip debugging trace function.
CautionWhile RAM parity error resets are enabled (RPERDIS = 0), be sure to initialize RAM areas where data access is to
proceed and the RAM area + 10 bytes when instructions are fetched from RAM areas, respectively.
Reset signal generation sets RAM parity error resets to enabled (RPERDIS = 0). For details, see 24.3.3 RAM parity
error detection function.
R01UH0575EJ0120 Rev. 1.20Page 37 of 920
Dec 22, 2016
to 000CDH.
security IDs to 000C4H to 000CDH and 010C4H to 010CDH.
Page 56
RL78/G1HCHAPTER 4 CPU ARCHITECTURE
FFFFFH
FFEE0H
FFEDFH
F7F00H
F7EFFH
F3000H
F2FFFH
F1000H
F0FFFH
F0800H
F07FFH
F0000H
EFFFFH
60000H
5FFFFH
00000H
Data memory
space
Program
memory
space
FFF00H
FFEFFH
Special function register (SFR)
256 bytes
General-purpose register
32 bytes
RAM
Notes 1, 2
32 Kbytes
Mirror
19.75 Kbytes
Data flash memory
8 Kbytes
Reserved
Extended special function register
(2nd SFR)
2 Kbytes
Reserved
Code flash memory
384 Kbytes
00000H
01FFFH
010CEH
010CDH
010C4H
010C3H
010C0H
010BFH
01080H
0107FH
000CEH
000CDH
01000H
00FFFH
5FFFFH
000C4H
000C3H
000C0H
000BFH
00080H
0007FH
Boot cluster 0
Note 4
Boot cluster 1
Program area
Program area
CALLT table area
64 bytes
Vector table area
128 bytes
Option byte area
Note 3
4 bytes
CALLT table area
64 bytes
Vector table area
128 bytes
On-chip debug security
ID setting area
Note 3
10 bytes
Option byte area
Note 3
4 bytes
On-chip debug security
ID setting area
Note 3
10 bytes
Figure 4 - 2 Memory Map (R5F11FLK)
Note 1.Do not allocate RAM addresses which are used as a stack area, a data buffer, a branch destination of vector interrupt
processing, and a DTC transfer destination/transfer source to the area FFE20H to FFEDFH when performing selfprogramming and rewriting the data flash memory.
Note 2.Instructions can be executed from the RAM area excluding the general-purpose register area.
Note 3.When boot swap is not used: Set the option bytes to 000C0H to 000C3H, and the on-chip debug security IDs to 000C4H
to 000CDH.
When boot swap is used:Set the option bytes to 000C0H to 000C3H and 010C0H to 010C3H, and the on-chip debug
security IDs to 000C4H to 000CDH and 010C4H to 010CDH.
Note 4.Writing boot cluster 0 can be prohibited depending on the setting of security (see 27.6 Security Settings).
CautionWhile RAM parity error resets are enabled (RPERDIS = 0), be sure to initialize RAM areas where data access is to
proceed and the RAM area + 10 bytes when instructions are fetched from RAM areas, respectively.
Reset signal generation sets RAM parity error resets to enabled (RPERDIS = 0). For details, see 24.3.3 RAM parity
error detection function.
R01UH0575EJ0120 Rev. 1.20Page 38 of 920
Dec 22, 2016
Page 57
RL78/G1HCHAPTER 4 CPU ARCHITECTURE
FFFFFH
FFEE0H
FFEDFH
F3F00H
F3EFFH
F3000H
F2FFFH
F1000H
F0FFFH
F0800H
F07FFH
F0000H
EFFFFH
80000H
7FFFFH
00000H
Data memory
space
Program
memory
space
FFF00H
FFEFFH
Special function register (SFR)
256 bytes
General-purpose register
32 bytes
RAM
Notes 1, 2
48 Kbytes
Mirror
3.75 Kbytes
Data flash memory
8 Kbytes
Reserved
Extended special function register
(2nd SFR)
2 Kbytes
Reserved
Code flash memory
512 Kbytes
00000H
01FFFH
010CEH
010CDH
010C4H
010C3H
010C0H
010BFH
01080H
0107FH
000CEH
000CDH
01000H
00FFFH
7FFFFH
000C4H
000C3H
000C0H
000BFH
00080H
0007FH
Boot cluster 0
Note 4
Boot cluster 1
Program area
Program area
CALLT table area
64 bytes
Vector table area
128 bytes
Option byte area
Note 3
4 bytes
CALLT table area
64 bytes
Vector table area
128 bytes
On-chip debug security
ID setting area
Note 3
10 bytes
Option byte area
Note 3
4 bytes
On-chip debug security
ID setting area
Note 3
10 bytes
Figure 4 - 3 Memory Map (R5F11FLL)
Note 1.Do not allocate RAM addresses which are used as a stack area, a data buffer, a branch destination of vector interrupt
processing, and a DTC transfer destination/transfer source to the area FFE20H to FFEDFH when performing selfprogramming and rewriting the data flash memory. Also, use of the area F3F00H to F4309H is prohibited, because this
area is used for each library.
Note 2.Instructions can be executed from the RAM area excluding the general-purpose register area.
Note 3.When boot swap is not used: Set the option bytes to 000C0H to 000C3H, and the on-chip debug security IDs to 000C4H
to 000CDH.
When boot swap is used:Set the option bytes to 000C0H to 000C3H and 010C0H to 010C3H, and the on-chip debug
security IDs to 000C4H to 000CDH and 010C4H to 010CDH.
Note 4.Writing boot cluster 0 can be prohibited depending on the setting of security (see 27.6 Security Settings).
Note 5.Use of the area F4300H to F46FFH is prohibited when using the on-chip debugging trace function.
CautionWhile RAM parity error resets are enabled (RPERDIS = 0), be sure to initialize RAM areas where data access is to
proceed and the RAM area + 10 bytes when instructions are fetched from RAM areas, respectively.
Reset signal generation sets RAM parity error resets to enabled (RPERDIS = 0). For details, see 24.3.3 RAM parity
error detection function.
R01UH0575EJ0120 Rev. 1.20Page 39 of 920
Dec 22, 2016
Page 58
RL78/G1HCHAPTER 4 CPU ARCHITECTURE
RemarkThe flash memory is divided into blocks (one block = 1 KB). For the address values and block numbers, see Tables 4 - 1
to 4 - 4 Correspondence Between Address Values and Block Numbers in Flash Memory.
Correspondence between the address values and block numbers in the flash memory are shown below.
Table 4 - 1 Correspondence Between Address Values and Block Numbers in Flash Memory (1/4)
Address Value
00000H to 003FFH00H08000H to 083FFH20H10000H to 103FFH40H18000H to 183FFH60H
00400H to 007FFH01H08400H to 087FFH21H10400H to 107FFH41H18400H to 187FFH61H
00800H to 00BFFH02H08800H to 08BFFH22H10800H to 10BFFH42H18800H to 18BFFH62H
00C00H to 00FFFH03H08C00H to 08FFFH23H10C00H to 10FFFH43H18C00H to 18FFFH63H
01000H to 013FFH04H09000H to 093FFH24H11000H to 113FFH44H19000H to 193FFH64H
01400H to 017FFH05H09400H to 097FFH25H11400H to 117FFH45H19400H to 197FFH65H
01800H to 01BFFH06H09800H to 09BFFH26H11800H to 11BFFH46H19800H to 19BFFH66H
01C00H to 01FFFH07H09C00H to 09FFFH27H11C00H to 11FFFH47H19C00H to 19FFFH67H
02000H to 023FFH08H0A000H to 0A3FFH28H12000H to 123FFH48H1A000H to 1A3FFH68H
02400H to 027FFH09H0A400H to 0A7FFH29H12400H to 127FFH49H1A400H to 1A7FFH69H
02800H to 02BFFH0AH0A800H to 0ABFFH2AH12800H to 12BFFH4AH1A800H to 1ABFFH6AH
02C00H to 02FFFH0BH0AC00H to 0AFFFH2BH12C00H to 12FFFH4BH1AC00H to 1AFFFH6BH
03000H to 033FFH0CH0B000H to 0B3FFH2CH13000H to 133FFH4CH1B000H to 1B3FFH6CH
03400H to 037FFH0DH0B400H to 0B7FFH2DH13400H to 137FFH4DH1B400H to 1B7FFH6DH
03800H to 03BFFH0EH0B800H to 0BBFFH2EH13800H to 13BFFH4EH1B800H to 1BBFFH6EH
03C00H to 03FFFH0FH0BC00H to 0BFFFH2FH13C00H to 13FFFH4FH1BC00H to 1BFFFH6FH
04000H to 043FFH10H0C000H to 0C3FFH30H14000H to 143FFH50H1C000H to 1C3FFH70H
04400H to 047FFH11H0C400H to 0C7FFH31H14400H to 147FFH51H1C400H to 1C7FFH71H
04800H to 04BFFH12H0C800H to 0CBFFH32H14800H to 14BFFH52H1C800H to 1CBFFH72H
04C00H to 04FFFH13H0CC00H to 0CFFFH33H14C00H to 14FFFH53H1CC00H to 1CFFFH73H
05000H to 053FFH14H0D000H to 0D3FFH34H15000H to 153FFH54H1D000H to 1D3FFH74H
05400H to 057FFH15H0D400H to 0D7FFH35H15400H to 157FFH55H1D400H to 1D7FFH75H
05800H to 05BFFH16H0D800H to 0DBFFH36H15800H to 15BFFH56H1D800H to 1DBFFH76H
05C00H to 05FFFH17H0DC00H to 0DFFFH37H15C00H to 15FFFH57H1DC00H to 1DFFFH77H
06000H to 063FFH18H0E000H to 0E3FFH38H16000H to 163FFH58H1E000H to 1E3FFH78H
06400H to 067FFH19H0E400H to 0E7FFH39H16400H to 167FFH59H1E400H to 1E7FFH79H
06800H to 06BFFH1AH0E800H to 0EBFFH3AH16800H to 16BFFH5AH1E800H to 1EBFFH7AH
06C00H to 06FFFH1BH0EC00H to 0EFFFH3BH16C00H to 16FFFH5BH1EC00H to 1EFFFH7BH
07000H to 073FFH1CH0F000H to 0F3FFH3CH17000H to 173FFH5CH1F000H to 1F3FFH7CH
07400H to 077FFH1DH0F400H to 0F7FFH3DH17400H to 177FFH5DH1F400H to 1F7FFH7DH
07800H to 07BFFH1EH0F800H to 0FBFFH3EH17800H to 17BFFH5EH1F800H to 1FBFFH7EH
07C00H to 07FFFH1FH0FC00H to 0FFFFH3FH17C00H to 17FFFH5FH1FC00H to 1FFFFH7FH
Block
Number
Address Value
Block
Number
Address Value
Block
Number
Address Value
Block
Number
R01UH0575EJ0120 Rev. 1.20Page 40 of 920
Dec 22, 2016
Page 59
RL78/G1HCHAPTER 4 CPU ARCHITECTURE
Table 4 - 2 Correspondence Between Address Values and Block Numbers in Flash Memory (2/4)
Address Value
20000H to 203FFH80H28000H to 283FFHA0H30000H to 303FFHC0H38000H to 383FFHE0H
20400H to 207FFH81H28400H to 287FFHA1H30400H to 307FFHC1H38400H to 387FFHE1H
20800H to 20BFFH82H28800H to 28BFFHA2H30800H to 30BFFHC2H38800H to 38BFFHE2H
20C00H to 20FFFH83H28C00H to 28FFFHA3H30C00H to 30FFFHC3H38C00H to 38FFFHE3H
21000H to 213FFH84H29000H to 293FFHA4H31000H to 313FFHC4H39000H to 393FFHE4H
21400H to 217FFH85H29400H to 297FFHA5H31400H to 317FFHC5H39400H to 397FFHE5H
21800H to 21BFFH86H29800H to 29BFFHA6H31800H to 31BFFHC6H39800H to 39BFFHE6H
21C00H to 21FFFH87H29C00H to 29FFFHA7H31C00H to 31FFFHC7H39C00H to 39FFFHE7H
22000H to 223FFH88H2A000H to 2A3FFHA8H32000H to 323FFHC8H3A000H to 3A3FFHE8H
22400H to 227FFH89H2A400H to 2A7FFHA9H32400H to 327FFHC9H3A400H to 3A7FFHE9H
22800H to 22BFFH8AH2A800H to 2ABFFHAAH32800H to 32BFFHCAH3A800H to 3ABFFHEAH
22C00H to 22FFFH8BH2AC00H to 2AFFFHABH32C00H to 32FFFHCBH3AC00H to 3AFFFHEBH
23000H to 233FFH8CH2B000H to 2B3FFHACH33000H to 333FFHCCH3B000H to 3B3FFHECH
23400H to 237FFH8DH2B400H to 2B7FFHADH33400H to 337FFHCDH3B400H to 3B7FFHEDH
23800H to 23BFFH8EH2B800H to 2BBFFHAEH33800H to 33BFFHCEH3B800H to 3BBFFHEEH
23C00H to 23FFFH8FH2BC00H to 2BFFFHAFH33C00H to 33FFFHCFH3BC00H to 3BFFFHEFH
24000H to 243FFH90H2C000H to 2C3FFHB0H34000H to 343FFHD0H3C000H to 3C3FFHF0H
24400H to 247FFH91H2C400H to 2C7FFHB1H34400H to 347FFHD1H3C400H to 3C7FFHF1H
24800H to 24BFFH92H2C800H to 2CBFFHB2H34800H to 34BFFHD2H3C800H to 3CBFFHF2H
24C00H to 24FFFH93H2CC00H to 2CFFFHB3H34C00H to 34FFFHD3H3CC00H to 3CFFFHF3H
25000H to 253FFH94H2D000H to 2D3FFHB4H35000H to 353FFHD4H3D000H to 3D3FFHF4H
25400H to 257FFH95H2D400H to 2D7FFHB5H35400H to 357FFHD5H3D400H to 3D7FFHF5H
25800H to 25BFFH96H2D800H to 2DBFFHB6H35800H to 35BFFHD6H3D800H to 3DBFFHF6H
25C00H to 25FFFH97H2DC00H to 2DFFFHB7H35C00H to 35FFFHD7H3DC00H to 3DFFFHF7H
26000H to 263FFH98H2E000H to 2E3FFHB8H36000H to 363FFHD8H3E000H to 3E3FFHF8H
26400H to 267FFH99H2E400H to 2E7FFHB9H36400H to 367FFHD9H3E400H to 3E7FFHF9H
26800H to 26BFFH9AH2E800H to 2EBFFHBAH36800H to 36BFFHDAH3E800H to 3EBFFHFAH
26C00H to 26FFFH9BH2EC00H to 2EFFFHBBH36C00H to 36FFFHDBH3EC00H to 3EFFFHFBH
27000H to 273FFH9CH2F000H to 2F3FFHBCH37000H to 373FFHDCH3F000H to 3F3FFHFCH
27400H to 277FFH9DH2F400H to 2F7FFHBDH37400H to 377FFHDDH3F400H to 3F7FFHFDH
27800H to 27BFFH9EH2F800H to 2FBFFHBEH37800H to 37BFFHDEH3F800H to 3FBFFHFEH
27C00H to 27FFFH9FH2FC00H to 2FFFFHBFH37C00H to 37FFFHDFH3FC00H to 3FFFFHFFH
Block
Number
Address Value
Block
Number
Address Value
Block
Number
Address Value
Block
Number
RemarkR5F11FLJ: Block numbers 00H to FFH
R01UH0575EJ0120 Rev. 1.20Page 41 of 920
Dec 22, 2016
Page 60
RL78/G1HCHAPTER 4 CPU ARCHITECTURE
Table 4 - 3 Correspondence Between Address Values and Block Numbers in Flash Memory (3/4)
Address Value
40000H to 403FFH100H48000H to 483FFH120H5
40400H to 407FFH101H48400H to 487FFH121H50400H to 507FFH141H58400H to 587FFH161H
40800H to 40BFFH102H48800H to 48BFFH122H50800H to 50BFFH142H58800H to 58BFFH162H
40C00H to 40FFFH103H48C00H to 48FFFH123H50C00H to 50FFFH143H58C00H to 58FFFH163H
41000H to 413FFH104H49000H to 493FFH124H51000H to 513FFH144H59000H to 593FFH164H
41400H to 417FFH105H49400H to 497FFH125H51400H to 517FFH145H59400H to 597FFH165H
41800H to 41BFFH106H49800H to 49BFFH126H51800H to 51BFFH146H59800H to 59BFFH166H
41C00H to 41FFFH107H49C00H to 49FFFH127H51C00H to 51FFFH147H59C00H to 59FFFH167H
42000H to 423FFH108H4A000H to 4A3FFH128H52000H to 523FFH148H5A000H to 5A3FFH168H
42400H to 427FFH109H4A400H to 4A7FFH129H52400H to 527FFH149H5A400H to 5A7FFH169H
42800H to 42BFFH10AH4A800H to 4ABFFH12AH52800H to 52BFFH14AH5A800H to 5ABFFH16AH
42C00H to 42FFFH10BH4AC00H to 4AFFFH12BH52C00H to 52FFFH14BH5AC00H to 5AFFFH16BH
43000H to 433FFH10CH4B000H to 4B3FFH12CH53000H to 533FFH14CH5B000H to 5B3FFH16CH
43400H to 437FFH10DH4B400H to 4B7FFH12DH53400H to 537FFH14DH5B400H to 5B7FFH16DH
43800H to 43BFFH10EH4B800H to 4BBFFH12EH53800H to 53BFFH14EH5B800H to 5BBFFH16EH
43C00H to 43FFFH10FH4BC00H to 4BFFFH12FH53C00H to 53FFFH14FH5BC00H to 5BFFFH16FH
44000H to 443FFH110H4C000H to 4C3FFH130H54000H to 543FFH150H5C000H to 5C3FFH170H
44400H to 447FFH111H4C400H to 4C7FFH131H54400H to 547FFH151H5C400H to 5C7FFH171H
44800H to 44BFFH112H4C800H to 4CBFFH132H54800H to 54BFFH152H5C800H to 5CBFFH172H
44C00H to 44FFFH113H
45000H to 453FFH114H4D000H to 4D3FFH134H55000H to 553FFH154H5D000H to 5D3FFH174H
45400H to 457FFH115H4D400H to 4D7FFH135H55400H to 557FFH155H5D400H to 5D7FFH175H
45800H to 45BFFH116H4D800H to 4DBFFH136H55800H to 55BFFH156H5D800H to 5DBFFH176H
45C00H to 45FFFH117H
46000H to 463FFH118H4E000H to 4E3FFH138H56000H to 563FFH158H5E000H to 5E3FFH178H
46400H to 467FFH119H4E400H to 4E7FFH139H56400H to 567FFH159H5E400H to 5E7FFH179H
46800H to 46BFFH11AH4E800H to 4EBFFH13AH56800H to 56BFFH15AH5E800H to 5EBFFH17AH
46C00H to 46FFFH11BH4EC00H to 4EFFFH13BH56C00H to 56FFFH15BH5EC00H to 5EFFFH17BH
47000H to 473FFH11CH4F000H to 4F3FFH13CH57000H to 573FFH15CH5F000H to 5F3FFH17CH
47400H to 477FFH11DH4F400H to 4F7FFH13DH57400H to 577FFH15DH5F400H to 5F7FFH17DH
47800H to 47BFFH11EH4F800H to 4FBFFH13EH57800H to 57BFFH15EH5F800H to 5FBFFH17EH
47C00H to 47FFFH11FH4FC00H to 4FFFFH13FH57C00H to 57FFFH15FH5FC00H to 5FFFFH17FH
Block
Number
Address Value
4CC00H to 4CFFFH
4DC00H to 4DFFFH
Block
Number
133H54C00H to 54FFFH153H
137H55C00H to 55FFFH157H
Address Value
0000H to 503FFH140H58000H to 583FFH160H
Block
Number
Address Value
5CC00H to 5CFFFH
5DC00H to 5DFFFH
Block
Number
173H
177H
RemarkR5F11FLK: Block numbers 00H to 17FH
R01UH0575EJ0120 Rev. 1.20Page 42 of 920
Dec 22, 2016
Page 61
RL78/G1HCHAPTER 4 CPU ARCHITECTURE
Table 4 - 4 Correspondence Between Address Values and Block Numbers in Flash Memory (4/4)
Address Value
60000H to 603FFH180H68000H to 683FFH1A0H70000H to 703FFH1C0H78000H to 783FFH1E0H
60400H to 607FFH181H68400H to 687FFH1A1H70400H to 707FFH1C1H78400H to 787FFH1E1H
60800H to 60BFFH182H68800H to 68BFFH1A2H70800H to 70BFFH1C2H78800H to 78BFFH1E2H
60C00H to 60FFFH183H68C00H to 68FFFH1A3H70C00H to 70FFFH1C3H78C00H to 78FFFH1E3H
61000H to 613FFH184H69000H to 693FFH1A4H71000H to 713FFH1C4H79000H to 793FFH1E4H
61400H to 617FFH185H69400H to 697FFH1A5H71400H to 717FFH1C5H79400H to 797FFH1E5H
61800H to 61BFFH186H69800H to 69BFFH1A6H71800H to 71BFFH1C6H79800H to 79BFFH1E6H
61C00H to 61FFFH187H69C00H to 69FFFH1A7H71C00H to 71FFFH1C7H79C00H to 79FFFH1E7H
62000H to 623FFH188H6A000H to 6A3FFH1A8H72000H to 723FFH1C8H7A000H to 7A3FFH1E8H
62400H to 627FFH189H6A400H to 6A7FFH1A9H72400H to 727FFH1C9H7A400H to 7A7FFH1E9H
62800H to 62BFFH18AH6A800H to 6ABFFH1AAH72800H to 72BFFH1CAH7A800H to 7ABFFH1EAH
62C00H to 62FFFH18BH6AC00H to 6AFFFH1ABH72C00H to 72FFFH1CBH7AC00H to 7AFFFH1EBH
63000H to 633FFH18CH6B000H to 6B3FFH1ACH73000H to 733FFH1CCH7B000H to 7B3FFH1ECH
63400H to 637FFH18DH6B400H to 6B7FFH1ADH73400H to 737FFH1CDH7B400H to 7B7FFH1EDH
63800H to 63BFFH18EH6B800H to 6BBFFH1AEH73800H to 73BFFH1CEH7B800H to 7BBFFH1EEH
63C00H to 63FFFH18FH6BC00H to 6BFFFH1AFH73C00H to 73FFFH1CFH7BC00H to 7BFFFH1EFH
64000H to 643FFH190H6C000H to 6C3FFH1B0H74000H to 743FFH1D0H7C000H to 7C3FFH1F0H
64400H to 647FFH191H6C400H to 6C7FFH1B1H74400H to 747FFH1D1H7C400H to 7C7FFH1F1H
64800H to 64BFFH192H6C800H to 6CBFFH1B2H74800H to 74BFFH1D2H7C800H to 7CBFFH1F2H
64C00H to 64FFFH193H
65000H to 653FFH194H6D000H to 6D3FFH1B4H75000H to 753FFH1D4H7D000H to 7D3FFH1F4H
65400H to 657FFH195H6D400H to 6D7FFH1B5H75400H to 757FFH1D5H7D400H to 7D7FFH1F5H
65800H to 65BFFH196H6D800H to 6DBFFH1B6H75800H to 75BFFH1D6H7D800H to 7DBFFH1F6H
65C00H to 65FFFH197H
66000H to 663FFH198H6E000H to 6E3FFH1B8H76000H to 763FFH1D8H7E000H to 7E3FFH1F8H
66400H to 667FFH199H6E400H to 6E7FFH1B9H76400H to 767FFH1D9H7E400H to 7E7FFH1F9H
66800H to 66BFFH19AH6E800H to 6EBFFH1BAH76800H to 76BFFH1DAH7E800H to 7EBFFH1FAH
66C00H to 66FFFH19BH6EC00H to 6EFFFH1BBH76C00H to 76FFFH1DBH7EC00H to 7EFFFH1FBH
67000H to 673FFH19CH6F000H to 6F3FFH1BCH77000H to 773FFH1DCH7F000H to 7F3FFH1FCH
67400H to 677FFH19DH6F400H to 6F7FFH1BDH77400H to 777FFH1DDH7F400H to 7F7FFH1FDH
67800H to 67BFFH19EH6F800H to 6FBFFH1BEH77800H to 77BFFH1DEH7F800H to 7FBFFH1FEH
67C00H to 67FFFH19FH6FC00H to 6FFFFH1BFH77C00H to 77FFFH1DFH7FC00H to 7FFFFH1FFH
Block
Number
Address Value
6CC00H to 6CFFFH
6DC00H to 6DFFFH
Block
Number
1B3H74C00H to 74FFFH1D3H
1B7H75C00H to 75FFFH1D7H
Address Value
Block
Number
Address Value
7CC00H to 7CFFFH
7DC00H to 7DFFFH
Block
Number
1F3H
1F7H
RemarkR5F11FLL: Block numbers 00H to 1FFH
R01UH0575EJ0120 Rev. 1.20Page 43 of 920
Dec 22, 2016
Page 62
RL78/G1HCHAPTER 4 CPU ARCHITECTURE
4.1.1Internal program memory space
The internal program memory space stores the program and table data.
The internal program memory space is divided into the following areas.
(1) Vector table area
The 128-byte area 00000H to 0007FH is reserved as a vector table area. The program start addresses for
branch upon reset or generation of each interrupt request are stored in the vector table area. Furthermore,
the interrupt jump address is a 64 K address of 00000H to 0FFFFH, because the vector code is assumed to
be 2 bytes.
Of the 16-bit address, the lower 8 bits are stored at even addresses and the higher 8 bits are stored at odd
addresses.
To use the boot swap function, set a vector table also at 01000H to 0107FH.
For details, see CHAPTER 19 INTERRUPT FUNCTIONS.
(2) CALLT instruction table area
The 64-byte area 00080H to 000BFH can store the subroutine entry address of a 2-byte call instruction
(CALLT). Set the subroutine entry address to a value in a range of 00000H to 0FFFFH (because an address
code is 2 bytes).
To use the boot swap function, set a CALLT instruction table also at 01080H to 010BFH.
(3) Option byte area
A 4-byte area of 000C0H to 000C3H can be used as an option byte area. Set the option byte at 010C0H to
010C3H when the boot swap is used. For details, see CHAPTER 26 OPTION BYTE.
(4) On-chip debug security ID setting area
A 10-byte area of 000C4H to 000CDH and 010C4H to 010CDH can be used as an on-chip debug security
ID setting area. Set the on-chip debug security ID of 10 bytes at 000C4H to 000CDH when the boot swap is
not used and at 000C4H to 000CDH and at 010C4H to 010CDH when the boot swap is used. For details,
see CHAPTER 28 ON-CHIP DEBUG FUNCTION.
R01UH0575EJ0120 Rev. 1.20Page 44 of 920
Dec 22, 2016
Page 63
RL78/G1HCHAPTER 4 CPU ARCHITECTURE
4.1.2Mirror area
The code flash area of 00000H to 0FFFFH or 10000H to 1FFFFH, to F0000H to FFFFFH (the code flash area to
be mirrored is set by the processor mode control register (PMC)).
By reading data from F0000H to FFFFFH, an instruction that does not have the ES register as an operand can
be used, and thus the contents of the code flash can be read with the shorter code. However, the code flash area
is not mirrored to the special function register (SFR), extended special function register (2nd SFR), RAM, data
flash memory, and use prohibited areas.
The mirror area can only be read and no instruction can be fetched from this area.
The following show examples.
The PMC register is described below.
• Processor mode control register (PMC)
This register sets the flash memory space for mirroring to area from F0000H to FFFFFH.
The PMC register can be set by a 1-bit or 8-bit memory manipulation instruction.
Reset signal generation sets this register to 00H.
Figure 4 - 4 Format of Configuration of Processor mode control register (PMC)
Address: FFFFEHAfter reset: 00HR/W
Symbol7654321<0>
PMC0000000MAA
MAASelection of flash memory space for mirroring to area from F0000H to FFFFFH
000000H to 0FFFFH is mirrored to F0000H to FFFFFH
110000H to 1FFFFH is mirrored to F0000H to FFFFFH
CautionAfter setting the PMC register, wait for at least one instruction and access the mirror area.
R01UH0575EJ0120 Rev. 1.20Page 45 of 920
Dec 22, 2016
Page 64
RL78/G1HCHAPTER 4 CPU ARCHITECTURE
4.1.3Internal data memory space
The internal RAM can be used as a data area and a program area where instructions are fetched (it is prohibited
to use the general-purpose register area for fetching instructions). Four general-purpose register banks
consisting of eight 8-bit registers per bank are assigned to the 32-byte area of FFEE0H to FFEFFH of the internal
RAM area.
The internal RAM is used as stack memory.
Caution 1. It is prohibited to use the general-purpose register (FFEE0H to FFEFFH) space for fetching
instructions or as a stack area.
Caution 2. Do not allocate RAM addresses which are used as a stack area, a data buffer, a branch
destination of vector interrupt processing, and a DTC transfer destination/transfer source to
the area FFE20H to FFEDFH when performing self-programming and rewriting the data flash
memory.
Caution 3. Use of the RAM areas of the following products is prohibited when performing self-
programming and rewriting the data flash memory, because these areas are used for each
library.
R5F11FLL: F3F00H to F4309H
Caution 4. The internal RAM area in the following products cannot be used as stack memory when using
the on-chip debugging trace function.
R5F11FLL: F4300H to F46FFH
4.1.4Special function register (SFR) area
On-chip peripheral hardware special function registers (SFRs) are allocated in the area FFF00H to FFFFFH (see
Tables 4 - 5 to 4 - 9 in 4.2.4 Special function registers (SFRs)).
CautionDo not access addresses to which SFRs are not assigned.
4.1.5Extended special function register (2nd SFR: 2nd Special Function
Register) area
On-chip peripheral hardware special function registers (2nd SFRs) are allocated in the area F0000H to F07FFH
(see Tables 4 - 10 to 4 - 16 in 4.2.5 Extended special function registers (2nd SFRs: 2nd Special Function
Registers)).
Caution 1. Do not access addresses to which extended SFRs are not assigned.
Caution 2. When accessing timer RJ counter register 0 (TRJ0) allocated in F0500H of the extended SFR
(2nd SFR), the CPU does not proceed to the next instruction processing but enters the wait
state for CPU processing. For this reason, if this wait state occurs, the number of instruction
execution clocks is increased by the number of wait clocks. The number of wait clocks for
access to timer RJ counter register 0 (TRJ0) is one clock for both writing and reading.
R01UH0575EJ0120 Rev. 1.20Page 46 of 920
Dec 22, 2016
Page 65
RL78/G1HCHAPTER 4 CPU ARCHITECTURE
FFFFFH
FFEE0H
FFEDFH
FFE20H
FFF00H
FFEFFH
Special function register (SFR)
256 bytes
General-purpose register
32 bytes
RAM
24K to 48 Kbytes
Register addressing
Short direct
addressing
Direct addressing
Register indirect addressing
Based addressing
Based indexed addressing
SFR addressing
F1000H
F0FFFH
F0800H
F07FFH
F0000H
EFFFFH
Mirror area
Data flash memory
8 Kbytes
Reserved
Extended special function register
(2nd SFR)
2 Kbytes
Reserved
FFF20H
FFF1FH
FFE1FH
00000H
Code flash memory
256K to 512 Kbytes
4.1.6Data memory addressing
Addressing refers to the method of specifying the address of the instruction to be executed next or the address of
the register or memory relevant to the execution of instructions.
Several addressing modes are provided for addressing the memory relevant to the execution of instructions for
the RL78/G1H, based on operability and other considerations. For areas containing data memory in particular,
special addressing methods designed for the functions of the special function registers (SFR) and generalpurpose registers are available for use. Figure 4 - 5 shows correspondence between data memory and
addressing.
Figure 4 - 5 Correspondence Between Data Memory and Addressing
R01UH0575EJ0120 Rev. 1.20Page 47 of 920
Dec 22, 2016
Page 66
RL78/G1HCHAPTER 4 CPU ARCHITECTURE
4.2Processor Registers
The RL78/G1H products incorporate the following processor registers.
4.2.1Control registers
The control registers control the program sequence, statuses and stack memory. The control registers consist of
a program counter (PC), a program status word (PSW) and a stack pointer (SP).
(1) Program counter (PC)
The program counter is a 20-bit register that holds the address information of the next program to be
executed.
In normal operation, PC is automatically incremented according to the number of bytes of the instruction to
be fetched. When a branch instruction is executed, immediate data and register contents are set.
Reset signal generation sets the reset vector table values at addresses 0000H and 0001H to the program
counter.
Figure 4 - 6 Format of Program Counter
190
PC
(2) Program status word (PSW)
The program status word is an 8-bit register consisting of various flags set/reset by instruction execution.
Program status word contents are stored in the stack area upon vectored interrupt request is acknowledged
or PUSH PSW instruction execution and are restored upon execution of the RETB, RETI and POP PSW
instructions.
Reset signal generation sets the PSW register to 06H.
Figure 4 - 7 Format of Program Status Word
70
PSWIEZRBS1ACRBS0ISP1ISP0CY
(a) Interrupt enable flag (IE)
This flag controls the interrupt request acknowledge operations of the CPU.
When 0, the IE flag is set to the interrupt disabled (DI) state, and all maskable interrupt requests are
disabled.
When 1, the IE flag is set to the interrupt enabled (EI) state and maskable interrupt requests
acknowledgment is controlled with an in-service priority flag (ISP1, ISP0), an interrupt mask flag for
various interrupt sources, and a priority specification flag.
The IE flag is reset (0) upon DI instruction execution or interrupt acknowledgment and is set (1) upon EI
instruction execution.
R01UH0575EJ0120 Rev. 1.20Page 48 of 920
Dec 22, 2016
Page 67
RL78/G1HCHAPTER 4 CPU ARCHITECTURE
(b) Zero flag (Z)
When the operation result is zero or equal, this flag is set (1). It is reset (0) in all other cases.
(c)Register bank select flags (RBS0, RBS1)
These are 2-bit flags to select one of the four register banks.
In these flags, the 2-bit information that indicates the register bank selected by SEL RBn instruction
execution is stored.
(d) Auxiliary carry flag (AC)
If the operation result has a carry from bit 3 or a borrow at bit 3, this flag is set (1). It is reset (0) in all other
cases.
(e) In-service priority flags (ISP1, ISP0)
This flag manages the priority of acknowledgeable maskable vectored interrupts. Vectored interrupt
requests specified lower than the value of ISP0 and ISP1 flags by the priority specification flag registers
(PRn0L, PRn0H, PRn1L, PRn1H, PRn2L, PRn2H) (see 19.3.3) can not be acknowledged. Actual
vectored interrupt requests acknowledgment is controlled by the interrupt enable flag (IE).
Remarkn = 0, 1
(f)Carry flag (CY)
This flag stores overflow and underflow upon add/subtract instruction execution. It stores the shift-out
value upon rotate instruction execution and functions as a bit accumulator during bit operation instruction
execution.
(3) Stack pointer (SP)
This is a 16-bit register to hold the start address of the memory stack area. Only the internal RAM area can
be set as the stack area.
R01UH0575EJ0120 Rev. 1.20Page 49 of 920
Dec 22, 2016
Page 68
RL78/G1HCHAPTER 4 CPU ARCHITECTURE
In stack addressing through a stack pointer, the SP is decremented ahead of write (save) to the stack
memory and is incremented after read (restore) from the stack memory.
Caution 1. Since reset signal generation makes the SP contents undefined, be sure to initialize the
SP before using the stack.
Caution 2.It is prohibited to use the general-purpose register (FFEE0H to FFEFFH) space for
fetching instructions or as a stack area.
Caution 3. Do not allocate RAM addresses which are used as a stack area, a data buffer, a branch
destination of vector interrupt processing, and a DTC transfer destination/transfer source
to the area FFE20H to FFEDFH when performing self-programming and rewriting the data
flash memory.
Caution 4. Use of the RAM areas of the following products is prohibited when performing self-
programming and rewriting the data flash memory, because these areas are used for
each library.
R5F11FLL: F3F00H to F4309H
Caution 5. The internal RAM area in the following products cannot be used as stack memory when
using the on-chip debugging trace function.
R5F11FLL: F4300H to F46FFH
R01UH0575EJ0120 Rev. 1.20Page 50 of 920
Dec 22, 2016
Page 69
RL78/G1HCHAPTER 4 CPU ARCHITECTURE
Register bank 0HL
DE
BC
AX
H
L
D
E
B
C
A
X
8-bit processing
1507
16-bit processing
0
Register bank 1
Register bank 2
Register bank 3
FFEE0H
FFEE8H
FFEF0H
FFEF8H
FFEFFH
4.2.2General-purpose registers
General-purpose registers are mapped at particular addresses (FFEE0H to FFEFFH) of the data memory. The
general-purpose registers consists of 4 banks, each bank consisting of eight 8-bit registers (X, A, C, B, E, D, L,
and H).
Each register can be used as an 8-bit register, and two 8-bit registers can also be used in a pair as a 16-bit
register (AX, BC, DE, and HL).
Register banks to be used for instruction execution are set by the CPU control instruction (SEL RBn). Because of
the 4-register bank configuration, an efficient program can be created by switching between a register for normal
processing and a register for interrupt processing for each bank.
CautionIt is prohibited to use the general-purpose register (FFEE0H to FFEFFH) space for fetching
instructions or as a stack area.
Figure 4 - 9 Configuration of General-Purpose Registers
(a) Function name
R01UH0575EJ0120 Rev. 1.20Page 51 of 920
Dec 22, 2016
Page 70
RL78/G1HCHAPTER 4 CPU ARCHITECTURE
Special function register
(SFR) 256 bytes
Extended special function register
(2nd SFR) 2 Kbytes
FFFFFH
00000H
Code flash memory
F0000H
EFFFFH
Data memory space
!addr16
!addr16
→ F 0000H - FFFFH
→
0H - FH 0000H - FFFFH
ES:!addr16
ES:!addr16
4.2.3ES and CS registers
The ES register and CS register are used to specify the higher address for data access and when a branch
instruction is executed (register direct addressing), respectively.
The default value of the ES register after reset is 0FH, and that of the CS register is 00H.
Figure 4 - 10 Configuration of ES and CS Registers
76543210
ES0000ES3ES2ES1ES0
76543210
CS0000CS3CS2CS1CS0
Though the data area which can be accessed with 16-bit addresses is the 64 Kbytes from F0000H to FFFFFH,
using the ES register as well extends this to the 1 Mbyte from 00000H to FFFFFH.
Figure 4 - 11 Extension of Data Area Which Can Be Accessed
R01UH0575EJ0120 Rev. 1.20Page 52 of 920
Dec 22, 2016
Page 71
RL78/G1HCHAPTER 4 CPU ARCHITECTURE
4.2.4Special function registers (SFRs)
Unlike a general-purpose register, each SFR has a special function.
SFRs are allocated to the FFF00H to FFFFFH area.
SFRs can be manipulated like general-purpose registers, using operation, transfer, and bit manipulation
instructions. The manipulable bit units, 1, 8, and 16, depend on the SFR type.
Each manipulation bit unit can be specified as follows.
• 1-bit manipulation
Describe as follows for the 1-bit manipulation instruction operand (sfr.bit).
When the bit name is defined: <Bit name>
When the bit name is not defined: <Register name>.<Bit number> or <Address>.<Bit number>
• 8-bit manipulation
Describe the symbol defined by the assembler for the 8-bit manipulation instruction operand (sfr). This
manipulation can also be specified with an address.
• 16-bit manipulation
Describe the symbol defined by the assembler for the 16-bit manipulation instruction operand (sfrp). When
specifying an address, describe an even address.
Tables 4 - 5 to 4 - 9 give lists of the SFRs. The meanings of items in the table are as follows.
• Symbol
This item indicates the address of a special function register. It is a reserved word in the assembler, and is
defined as an sfr variable using the #pragma sfr directive in the compiler. When using the assembler, debugger,
and simulator, symbols can be written as an instruction operand.
•R/W
This item indicates whether the corresponding SFR can be read or written.
R/W: Read/write enable
R: Read only
W: Write only
• Manipulable bit units
“√” indicates the manipulable bit unit (1, 8, or 16). “—” indicates a bit unit for which manipulation is not possible.
• After reset
This item indicates each register status upon reset signal generation.
CautionDo not access addresses to which SFRs are not assigned.
RemarkFor extended SFRs (2nd SFRs), see 4.2.5 Extended special function registers (2nd SFRs: 2nd
Special Function Registers).
R01UH0575EJ0120 Rev. 1.20Page 53 of 920
Dec 22, 2016
Page 72
RL78/G1HCHAPTER 4 CPU ARCHITECTURE
Table 4 - 5 Special Function Register (SFR) List (1/5)
Address
FFF00H Port register 0P0R/W
FFF01H Port register 1P1R/W
FFF02H Port register 2P2R/W
FFF03H Port register 3P3R/W
FFF04H Port register 4P4R/W
FFF05H Port register 5P5R/W
FFF06H Port register 6P6R/W
FFF07H Port register 7P7R/W
FFF08H Port register 8P8R/W
FFF0AH Port register 10P10R/W
FFF0BH Port register 11P11R/W
FFF0CH Port register 12P12R/W
FFF0DH Port register 13P13R/W
FFF0EH Port register 14P14R/W
FFF0FH Port register 15P15R/W
FFF14H Serial data register 12RXD3/
FFF15H———
FFF16H Serial data register 13RXD3SDR13R/W—
FFF17H———
FFF18H Timer data register 00TDR00R/W——
FFF19H
FFF1AH Timer data register 01TDR01L TDR01R/W—
FFF1BHTDR01H—
FFF1EH 10-bit A/D conversion result registerADCRR——
FFF1FH8-bit A/D conversion result
FFF20H Port mode register 0PM0R/W
FFF21H Port mode register 1PM1R/W
FFF22H Port mode register 2PM2R/W
FFF23H Port mode register 3PM3R/W
FFF24H
FFF25H
FFF26H Port mode register 6PM6R/W
FFF27H Port mode register 7PM7R/W
Special Function Register (SFR)
Name
register
Port mode register 4PM4R/W
Port mode register 5PM5R/W
SymbolR/W
SDR12R/W—
SIO30
ADCRHR—
Manipulable Bit Range
1-bit8-bit16-bit
√√—00H
√√—00H
√√—00H
√√—00H
√√—00H
√√—00H
√√—00H
√√—00H
√√—00H
√√—00H
√√—00H
√√—Undefined
√√—Undefined
√√—00H
√√—00H
√√0000H
√√0000H
√0000H
√√00H
√00H
√0000H
√—00H
√√—FFH
√√—FFH
√√—FFH
√√—FFH
√√—FFH
√√—FFH
√√—FFH
√√—FFH
After Reset
R01UH0575EJ0120 Rev. 1.20Page 54 of 920
Dec 22, 2016
Page 73
RL78/G1HCHAPTER 4 CPU ARCHITECTURE
Table 4 - 6 Special Function Register (SFR) List (2/5)
Address
FFF28H Port mode register 8PM8R/W
FFF2AH Port mode register 10PM10R/W
FFF2BH Port mode register 11PM11R/W
FFF2CH Port mode register 12PM12R/W
FFF2EH Port mode register 14PM14R/W
FFF2FH Port mode register 15PM15R/W
FFF30H A/D converter mode register 0ADM0R/W
FFF31H Analog input channel specification
FFF32H A/D converter mode register 1ADM1R/W
FFF38H External interrupt rising edge enable
FFF39H External interrupt falling edge enable
FFF3AH External interrupt rising edge enable
FFF3BH External interrupt falling edge enable
FFF44H Serial data register 02TXD1/
FFF45H———
FFF46H Serial data register 03RXD1SDR03R/W—
FFF47H———
FFF48H Serial data register 10SIO20SDR10R/W—
FFF49H———
FFF4AH Serial data register 11SIO21SDR11R/W—
FFF4BH———
FFF50H IICA shift register 0IICA0R/W—
FFF51H IICA status register 0IICS0R
FFF52H IICA flag register 0IICF0R/W
FFF54H IICA shift register 1IICA1R/W—
FFF55H IICA status register 1IICS1R
FFF56H IICA flag register 1IICF1R/W
FFF64H Timer data register 02TDR02R/W——
FFF65H
FFF66H Timer data register 03TDR03L TDR03R/W—
FFF67HTDR03H—
FFF70H Timer data register 10TDR10R/W——
FFF71H
Special Function Register (SFR)
Name
register
register 0
register 0
register 1
register 1
SymbolR/W
ADSR/W
EGP0R/W
EGN0R/W
EGP1R/W
EGN1R/W
SDR02R/W—
SIO10
Manipulable Bit Range
1-bit8-bit16-bit
√√—FFH
√√—FFH
√√—FFH
√√—FFH
√√—FFH
√√—FFH
√√—00H
√√—00H
√√—00H
√√—00H
√√—00H
√√—00H
√√—00H
√√0000H
√√0000H
√√0000H
√√0000H
√—00H
√√—00H
√√—00H
√—00H
√√—00H
√√—00H
√0000H
√√00H
√00H
√0000H
After Reset
R01UH0575EJ0120 Rev. 1.20Page 55 of 920
Dec 22, 2016
Page 74
RL78/G1HCHAPTER 4 CPU ARCHITECTURE
Table 4 - 7 Special Function Register (SFR) List (3/5)
Manipulable Bit Range
1-bit8-bit16-bit
After Reset
Address
Special Function Register (SFR)
Name
SymbolR/W
FFF72H Timer data register 11TDR11L TDR11R/W—
FFF73HTDR11H—
FFF74H Timer data register 12TDR12R/W——
FFF75H
FFF76H Timer data register 13TDR13L TDR13R/W—
FFF77HTDR13H—
FFF90H 12-bit interval timer control registerITMCR/W——
FFF91H
FFF92H Second count registerSECR/W—
FFF93H Minute count registerMINR/W—
FFF94H
FFF95H Week count registerWEEKR/W—√—00H
FFF96H Day count registerDAYR/W—
FFF97H Month count registerMONTHR/W—
FFF98H Year count registerYEARR/W—
FFF99H Watch error correction registerSUBCUDR/W—
FFF9AH Alarm minute registerALARMWMR/W—
FFF9BH Alarm hour registerALARMWHR/W—
FFF9CH Alarm week registerALARMWWR/W—
FFF9DH Real-time clock control register 0RTCC0R/W
FFF9EH Real-time clock control register 1RTCC1R/W
FFFA0H Clock operation mode control register CMCR/W—
FFFA1H Clock operation status control
FFFA2H Oscillation stabilization time counter
FFFA3H Oscillation stabilization time select
FFFA4H System clock control registerCKCR/W
FFFA5H Clock output select register 0CKS0R/W
FFFA6H Clock output select register 1CKS1R/W
Hour count registerHOUR
CSC
register
OSTC
status register
OSTS
register
R/W—
R/W
R
R/W
√√—00H
√√—00H
√√—C0H
√√—00H
—
√√—00H
√√—00H
√√—00H
√√00H
√00H
√0000H
√√00H
√00H
√0FFFH
√—00H
√—00H
√—
√—01H
√—01H
√—00H
√—00H
√—00H
√—12H
√—00H
√—00H
√—07H
12H
Note
NoteThe value of this register is 00H if the AMPM bit (bit 3 of real-time clock control register 0 (RTCC0)) is set to 1 after reset.
R01UH0575EJ0120 Rev. 1.20Page 56 of 920
Dec 22, 2016
Page 75
RL78/G1HCHAPTER 4 CPU ARCHITECTURE
Table 4 - 8 Special Function Register (SFR) List (4/5)
Manipulable Bit Range
1-bit8-bit16-bit
After Reset
Address
Special Function Register (SFR)
Name
SymbolR/W
00H
Note 1
Note 1
Note 1
Note 2
Reset by
LVD
FFFA8H Reset control flag registerRESF
FFFA9H Voltage detection registerLVIM
FFFAAH Voltage detection level registerLVIS
FFFABH Watchdog timer enable registerWDTE
FFFACH CRC input registerCRCINR/W—√—00H
FFFD0H Interrupt request flag register 2LIF2LIF2R/W
FFFD1H Interrupt request flag register 2HIF2HR/W
FFFD4H Interrupt mask flag register 2LMK2LMK2R/W
FFFD5H Interrupt mask flag register 2HMK2HR/W
FFFD8H Priority specification flag register 02LPR02LPR02 R/W
FFFD9H Priority specification flag register 02H PR02HR/W
FFFDCH Priority specification flag register 12LPR12LPR12 R/W
FFFDDH Priority specification flag register 12H PR12HR/W
Note 1.These values vary depending on the reset source.
Reset Source
Register
RESF TRAPCleared (0)Set (1)HeldHeld
WDTRFHeldSet (1)Held
RPERFHeldSet (1)Held
IAWRFHeldSet (1)
LVIRFHeldSet (1)
LVI MLVIS ENCl ear ed (0)Held
LVI OMSK He ld
LVI F
LVISCleared (00H/01H/81H)
RESET
Input
Reset by
POR
Reset by
Execution of
Illegal Instruction
R
R/W
R/W
R/W
Reset by
WDT
—
√√—
√√—
—√—
√√√00H
√√00H
√√√FFH
√√FFH
√√√FFH
√√FFH
√√√FFH
√√FFH
Reset by RAM
√—
parity error
Undefined
00H/01H/81H
9AH/1AH
Reset by illegalmemory access
Note 2.The reset value of the WDTE register is determined by the setting of the option byte.
R01UH0575EJ0120 Rev. 1.20Page 57 of 920
Dec 22, 2016
Page 76
RL78/G1HCHAPTER 4 CPU ARCHITECTURE
Table 4 - 9 Special Function Register (SFR) List (5/5)
Manipulable Bit Range
AddressSpecial Function Register (SFR) NameSymbolR/W
1-bit8-bit16-bit
After Reset
FFFE0H Interrupt request flag register 0LIF0LIF0R/W
FFFE1H Interrupt request flag register 0HIF0HR/W
FFFE2H Interrupt request flag register 1LIF1LIF1R/W
FFFE3H Interrupt request flag register 1HIF1HR/W
FFFE4H Interrupt mask flag register 0MK0LMK0R/W
FFFE5HMK0HR/W
FFFE6H Interrupt mask flag register 1MK1LMK1R/W
FFFE7HMK1HR/W
FFFE8H Priority specification flag register 00PR00L PR00R/W
FFFE9HPR00HR/W
FFFEAH Priority specification flag register 01PR01L PR01R/W
FFFEBHPR01HR/W
FFFECH Priority specification flag register 10PR10L PR10R/W
FFFEDHPR10HR/W
FFFEEH Priority specification flag register 11PR11L PR11R/W
FFFEFHPR11HR/W
FFFF0H Multiply and accumulation register (L)MACRLR/W——
FFFF1H
FFFF2H Multiply and accumulation register (H)MACRHR/W——
FFFF3H
FFFFEH Processor mode control registerPMCR/W
√√√00H
√√00H
√√√00H
√√00H
√√√FFH
√√FFH
√√√FFH
√√FFH
√√√FFH
√√FFH
√√√FFH
√√FFH
√√√FFH
√√FFH
√√√FFH
√√FFH
√√—00H
√0000H
√0000H
RemarkFor extended SFRs (2
nd
SFRs), see Tables 4 - 10 to 4 - 16Extended SFR (2
nd
SFR) List.
R01UH0575EJ0120 Rev. 1.20Page 58 of 920
Dec 22, 2016
Page 77
RL78/G1HCHAPTER 4 CPU ARCHITECTURE
4.2.5Extended special function registers (2nd SFRs: 2nd Special Function
Registers)
Unlike a general-purpose register, each extended SFR (2nd SFR) has a special function.
Extended SFRs are allocated to the F0000H to F07FFH area. SFRs other than those in the SFR area (FFF00H
to FFFFFH) are allocated to this area. An instruction that accesses the extended SFR area, however, is 1 byte
longer than an instruction that accesses the SFR area.
Extended SFRs can be manipulated like general-purpose registers, using operation, transfer, and bit
manipulation instructions. The manipulable bit units, 1, 8, and 16, depend on the SFR type.
Each manipulation bit unit can be specified as follows.
• 1-bit manipulation
Describe as follows for the 1-bit manipulation instruction operand (!addr16.bit)
When the bit name is defined: <Bit name>
When the bit name is not defined: <Register name>.<Bit number> or <Address>.<Bit number>
• 8-bit manipulation
Describe the symbol defined by the assembler for the 8-bit manipulation instruction operand (!addr16). This
manipulation can also be specified with an address.
• 16-bit manipulation
Describe the symbol defined by the assembler for the 16-bit manipulation instruction operand (!addr16). When
specifying an address, describe an even address.
Tables 4 - 10 to 4 - 16 give lists of the extended SFRs. The meanings of items in the table are as follows.
• Symbol
This item indicates the address of an extended SFR. It is a reserved word in the assembler, and is defined as
an sfr variable using the #pragma sfr directive in the compiler. When using the assembler, debugger, and
simulator, symbols can be written as an instruction operand.
•R/W
This item indicates whether the corresponding extended SFR can be read or written.
R/W: Read/write enable
R: Read only
W: Write only
• Manipulable bit units
“√” indicates the manipulable bit unit (1, 8, or 16). “—” indicates a bit unit for which manipulation is not possible.
• After reset
This item indicates each register status upon reset signal generation.
CautionDo not access addresses to which extended SFRs are not assigned.
RemarkFor SFRs in the SFR area, see 4.2.4 Special function registers (SFRs).
R01UH0575EJ0120 Rev. 1.20Page 59 of 920
Dec 22, 2016
Page 78
RL78/G1HCHAPTER 4 CPU ARCHITECTURE
Table 4 - 10 Extended Special Function Register (2nd SFR) List (1/7)
F00A8H High-speed on-chip oscillator frequency select
register
Note 1.The value after a reset is adjusted at the time of shipment.
Note 2.The value after a reset is a value set in FRQSEL2 to FRQSEL0 of the option byte (000C2H).
HOCODIVR/W—√—Undefined
Note 2
R01UH0575EJ0120 Rev. 1.20Page 60 of 920
Dec 22, 2016
Page 79
RL78/G1HCHAPTER 4 CPU ARCHITECTURE
Table 4 - 11 Extended Special Function Register (2nd SFR) List (2/7)
Manipulable Bit Range
1-bit8-bit16-bit
After Reset
Address
Extended Special Function Register
(2nd SFR) Name
SymbolR/W
F00F0H Peripheral enable register 0PER0R/W
F00F3H
F00F5H RAM parity error control registerRPECTLR/W
F00FEH BCD correction result registerBCDADJR—
F0104H Serial status register 02SSR02L SSR02R—
F0105H———
F0106H Serial status register 03SSR03L SSR03R—
F0107H———
F0108H Serial flag clear trigger register 00SIR00LSIR00R/W—
F0109H———
F010AH Serial flag clear trigger register 01SIR01LSIR01R/W—
F010BH———
F010CH Serial flag clear trigger register 02SIR02LSIR02R/W—
F010DH———
F010EH Serial flag clear trigger register 03SIR03LSIR03R/W—
F010FH———
F0114H Serial mode register 02SMR02R/W——
F0115H
F0116H Serial mode register 03SMR03R/W——
F0117H
F011CH Serial communication operation setting
F011DH
F011EH Serial communication operation setting
F011FH
F0120H Serial channel enable status register 0SE0LSE0R
F0121H———
Subsystem clock supply mode control
register
register 02
register 03
OSMC
SCR02R/W——
SCR03R/W——
R/W—
√√—00H
√√—00H
√√√0000H
√—00H
√—Undefined
√√0000H
√√0000H
√√0000H
√√0000H
√√0000H
√√0000H
√0020H
√0020H
√0087H
√0087H
R01UH0575EJ0120 Rev. 1.20Page 61 of 920
Dec 22, 2016
Page 80
RL78/G1HCHAPTER 4 CPU ARCHITECTURE
Table 4 - 12 Extended Special Function Register (2nd SFR) List (3/7)
Manipulable Bit Range
1-bit8-bit16-bit
After Reset
Address
Extended Special Function Register
(2nd SFR) Name
SymbolR/W
F0122H Serial channel start register 0SS0LSS0R/W
F0123H———
F0124H Serial channel stop register 0ST0LST0R/W
F0125H———
F0126H Serial clock select register 0SPS0LSPS0R/W—
F0127H———
F0128H Serial output register 0SO0R/W——
F0129H
F012AH Serial output enable register 0SOE0LSOE0R/W
F012BH———
F0134H Serial output level register 0SOL0LSOL0R/W—
F0135H———
F0140H Serial status register 10SSR10L SSR10R—
F0141H———
F0142H Serial status register 11SSR11L SSR11R—
F0143H———
F0144H Serial status register 12SSR12L SSR12R—
F0145H———
F0146H Serial status register 13SSR13L SSR13R—
F0147H———
F0148H Serial flag clear trigger register 10SIR10LSIR10R/W—
F0149H———
F014AH Serial flag clear trigger register 11SIR11LSIR11R/W—
F014BH———
F014CH Serial flag clear trigger register 12SIR12LSIR12R/W—
F014DH———
F014EH Serial flag clear trigger register 13SIR13LSIR13R/W—
F014FH———
F0150H Serial mode register 10SMR10R/W——
F0151H
F0152H Serial mode register 11SMR11R/W——
F0153H
F0154H Serial mode register 12SMR12R/W——
F0155H
F0156H Serial mode register 13SMR13R/W——
F0157H
F0158H Serial communication operation
F0159H
F015AH Serial communication operation
F015BH
setting register 10
setting register 11
SCR10R/W——
SCR11R/W——
√√√0000H
√√√0000H
√√√0000H
√√0000H
√0F0FH
√√0000H
√√0000H
√√0000H
√√0000H
√√0000H
√√0000H
√√0000H
√√0000H
√√0000H
√0020H
√0020H
√0020H
√0020H
√0087H
√0087H
R01UH0575EJ0120 Rev. 1.20Page 62 of 920
Dec 22, 2016
Page 81
RL78/G1HCHAPTER 4 CPU ARCHITECTURE
Table 4 - 13 Extended Special Function Register (2nd SFR) List (4/7)
Manipulable Bit Range
1-bit8-bit16-bit
After Reset
Address
Extended Special Function Register
(2nd SFR) Name
SymbolR/W
F015CH Serial communication operation
F015DH
F015EH Serial communication operation
F015FH
F0160H Serial channel enable status register 1SE1LSE1R
F0161H———
F0162H Serial channel start register 1SS1LSS1R/W
F0163H———
F0164H Serial channel stop register 1ST1LST1R/W
F0165H———
F0166H Serial clock select register 1SPS1LSPS1R/W—
F0167H———
F0168H Serial output register 1SO1R/W——
F0169H
F016AH Serial output enable register 1SOE1LSOE1R/W
F016BH———
F0174H Serial output level register 1SOL1LSOL1R/W—
F0175H———
F0180H Timer counter register 00TCR00R——
F0181H
F0182H Timer counter register 01TCR01R——
F0183H
F0184H Timer counter register 02TCR02R——
F0185H
F0186H Timer counter register 03TCR03R——
F0187H
F0190H Timer mode register 00TMR00R/W——
F0191H
F0192H Timer mode register 01TMR01R/W——
F0193H
F0194H Timer mode register 02TMR02R/W——
F0195H
F0196H Timer mode register 03TMR03R/W——
F0197H
F01A0H Timer status register 00TSR00L TSR00R—
F01A1H———
F01A2H Timer status register 01TSR01L TSR01R—
F01A3H———
F01A4H Timer status register 02TSR02L TSR02R—
F01A5H———
setting register 12
setting register 13
SCR12R/W——
SCR13R/W——
√√√0000H
√√√0000H
√√√0000H
√√√0000H
√0087H
√0087H
√√0000H
√0F0FH
√√0000H
√FFFFH
√FFFFH
√FFFFH
√FFFFH
√0000H
√0000H
√0000H
√0000H
√√0000H
√√0000H
√√0000H
R01UH0575EJ0120 Rev. 1.20Page 63 of 920
Dec 22, 2016
Page 82
RL78/G1HCHAPTER 4 CPU ARCHITECTURE
Table 4 - 14 Extended Special Function Register (2nd SFR) List (5/7)
Manipulable Bit Range
1-bit8-bit16-bit
After Reset
Address
Extended Special Function Register
(2nd SFR) Name
SymbolR/W
F01A6H Timer status register 03TSR03L TSR03R—
F01A7H———
F01B0H Timer channel enable status register 0TE0LTE0R
F01B1H———
F01B2H Timer channel start register 0TS0LTS0R/W
F01B3H———
F01B4H Timer channel stop register 0TT0LTT0R/W
F01B5H———
F01B6H Timer clock select register 0TPS0R/W——
F01B7H
F01B8H Timer output register 0TO0LTO0R/W—
F01B9H———
F01BAH Timer output enable register 0TOE0LTOE0R/W
F01BBH———
F01BCH Timer output level register 0TOL0LTOL0R/W—
F01BDH———
F01BEH Timer output mode register 0TOM0LTOM0R/W—
F01BFH———
F01C0H Timer counter register 10TCR10R——
F01C1H
F01C2H Timer counter register 11TCR11R——
F01C3H
F01C4H Timer counter register 12TCR12R——
F01C5H
F01C6H Timer counter register 13TCR13R——
F01C7H
F01D0H Timer mode register 10TMR10R/W——
F01D1H
F01D2H Timer mode register 11TMR11R/W——
F01D3H
F01D4H Timer mode register 12TMR12R/W——
F01D5H
F01D6H Timer mode register 13TMR13R/W——
F01D7H
F01E0H Timer status register 10TSR10L TSR10R/W—
F01E1H———
F01E2H Timer status register 11TSR11L TSR11R/W—
F01E3H———
F01E4H Timer status register 12TSR12L TSR12R/W—
F01E5H———
√√√0000H
√√√0000H
√√√0000H
√√√0000H
√√0000H
√0000H
√√0000H
√√0000H
√√0000H
√FFFFH
√FFFFH
√FFFFH
√FFFFH
√0000H
√0000H
√0000H
√0000H
√√0000H
√√0000H
√√0000H
R01UH0575EJ0120 Rev. 1.20Page 64 of 920
Dec 22, 2016
Page 83
RL78/G1HCHAPTER 4 CPU ARCHITECTURE
Table 4 - 15 Extended Special Function Register (2nd SFR) List (6/7)
Manipulable Bit Range
1-bit8-bit16-bit
After Reset
Address
Extended Special Function Register
(2nd SFR) Name
SymbolR/W
F01E6H Timer status register 13TSR13L TSR13R/W—
F01E7H———
F01F0H Timer channel enable status register 1TE1LTE1R/W—
RemarkFor SFRs in the SFR area, see Tables 4 - 5 to 4 - 9 SFR List.
Timer RJ counter register 0TRJ0
R/W——
√0000H
√—00H
√—00H
√—00H
√—00H
√—00H
√—00H
√—00H
√—00H
√—00H
√—00H
√—00H
√—00H
√—00H
√FFFFH
R01UH0575EJ0120 Rev. 1.20Page 66 of 920
Dec 22, 2016
Page 85
RL78/G1HCHAPTER 5 PORT FUNCTIONS
CHAPTER 5 PORT FUNCTIONS
5.1Port Functions
The RL78/G1H microcontrollers are provided with digital I/O ports, which enable variety of control operations.
In addition to the function as digital I/O ports, these ports have several alternate functions. For details of the alternate
functions, see CHAPTER 3 PIN FUNCTIONS.
The MCU internal pins described below must be set to output mode after reset release by using the software (set the
port register and port mode register to 0).
• P00, P01, P05, P06, P17, P23 to P27, P41 to P47, P50 to P57, P64 to P67, P73 to P74, P83 to P87, P101, P102,
P110, P111, P145 to P147, P150 to P154
R01UH0575EJ0120 Rev. 1.20Page 67 of 920
Dec 22, 2016
Page 86
RL78/G1HCHAPTER 5 PORT FUNCTIONS
5.2Port Configuration
Ports include the following hardware.
Table 5 - 1 Port Configuration
ItemConfiguration
Control registersPort mode registers (PM0 to PM8, PM10 to PM12, PM14, PM15)
Port registers (P0 to P8, P10 to P15)
Pull-up resistor option registers (PU0, PU1, PU3, PU4, PU7, PU8, PU10, PU12, PU14)
Port input mode registers (PIM0, PIM8, PIM14)
Port output mode registers (POM0, POM7, POM8, POM14)
Port mode control registers (PMC0, PMC10, PMC12, PMC14)
A/D port configuration register (ADPC)
R01UH0575EJ0120 Rev. 1.20Page 68 of 920
Dec 22, 2016
Page 87
RL78/G1HCHAPTER 5 PORT FUNCTIONS
5.2.1Port 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 (VDD 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.2Port 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.3Port 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.
Analog function selectionInput modeSelects ANI.Analog input (to be converted)
Does not select ANI.Analog input
Output modeSelects ANI.Setting prohibited
Does not select ANI.
P20/ANI0, P21/ANI1,
P22/ANI2 Pins
(not to be converted)
All P2 are set in the analog function mode when the reset signal is generated.
R01UH0575EJ0120 Rev. 1.20Page 69 of 920
Dec 22, 2016
Page 88
RL78/G1HCHAPTER 5 PORT FUNCTIONS
5.2.4Port 3
Port 3 is an I/O port with an output latch. Port 3 can be set to the input mode or output mode in 1-bit units using
port mode register 3 (PM3). When the P30, P31 pins are used as input ports, use of on-chip pull-up resistors can
be specified by pull-up resistor option register 3 (PU3).
This port can also be used for external interrupt request input.
Reset signal generation sets port 3 to input port.
P30 pin is used for internal connection between the MCU and RF transceiver. For details, see CHAPTER 2
CONNECTION BETWEEN MCU AND RF TRANSCEIVER. .
5.2.5Port 4
Port 4 is an I/O port with an output latch. Port 4 can be set to the input mode or output mode in 1-bit units using
port mode register 4 (PM4). When the P40 pin is used as an input port, use of an on-chip pull-up resistor can be
specified by pull-up resistor option register 4 (PU4).
This port can also be used for data I/O for a flash memory programmer/debugger.
Reset signal generation sets port 4 to input port.
5.2.6Port 6
Port 6 is an I/O port with an output latch. Port 6 can be set to the input mode or output mode in 1-bit units using
port mode register 6 (PM6).
The output of the P60 to P63 pins is N-ch open-drain output (6 V tolerance).
This port can also be used for serial interface data I/O and clock I/O.
Reset signal generation sets port 6 to input port.
5.2.7Port 7
Port 7 is an I/O port with an output latch. Port 7 can be set to the input mode or output mode in 1-bit units using
port mode register 7 (PM7). When used as an input port, use of an on-chip pull-up resistor can be specified in 1bit units by pull-up resistor option register 7 (PU7).
Output from the P71 pin can be specified as N-ch open-drain output (V
register 7 (POM7).
This port can also be used for serial interface data I/O, clock I/O, and external interrupt request input.
Reset signal generation sets port 7 to input port.
DD tolerance) using port output mode
5.2.8Port 8
Port 8 is an I/O port with an output latch. Port 8 can be set to the input mode or output mode in 1-bit units using
port mode register 8 (PM8). When used as an input port, use of an on-chip pull-up resistor can be specified in 1bit units by pull-up resistor option register 8 (PU8).
Input to the P80 and P81 pins can be specified through a normal input buffer or a TTL input buffer in 1-bit units
using port input mode register 8 (PIM8).
Output from the P80 to P82 pin can be specified as N-ch open-drain output (V
port output mode register 8 (POM8).
Reset signal generation sets port 8 to input port.
DD tolerance) in 1-bit units using
R01UH0575EJ0120 Rev. 1.20Page 70 of 920
Dec 22, 2016
Page 89
RL78/G1HCHAPTER 5 PORT FUNCTIONS
P130
Set by software
Reset signal
5.2.9Port 10
Port 10 is an I/O port with an output latch. Port 10 can be set to the input mode or output mode in 1-bit units using
port mode register 10 (PM10). When the P100 to P102 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 10 (PU10).
Set the P100 pin to digital I/O using port mode control register 10 (PMC10).
Reset signal generation sets P100 to prohibit digital I/O.
5.2.10Port 12
P120 is an I/O port with an output latch. Port 12 can be set to the input mode or output mode in 1-bit units using
port mode register 12 (PM12). When used as an input port, use of an on-chip pull-up resistor can be specified by
pull-up resistor option register 12 (PU12).
P121 to P124 are 4-bit input ports.
To use the P120 pin as a digital I/O port, set it to digital I/O using port mode control register 12 (PMC12).
This port can also be used for A/D converter analog input, resonator connection for the subsystem clock,
external clock input for the main system clock, and external clock input for the subsystem clock.
Reset signal generation sets P120 to analog function, and sets P121 to P124 to input port.
5.2.11Port 13
P130 is a 1-bit output-only port with an output latch. P137 is a 1-bit input-only port.
P130 is fixed an output port, and P137 is fixed an input ports.
This port can also be used for external interrupt request input.
Connect the P130 pin to STANDBY pin.
RemarkWhen reset is effected, P130 outputs a low level. If P130 is set to output a high level before reset is
effected, the output signal of P130 can be dummy-output as the CPU reset signal.
R01UH0575EJ0120 Rev. 1.20Page 71 of 920
Dec 22, 2016
Page 90
RL78/G1HCHAPTER 5 PORT FUNCTIONS
5.2.12Port 14
Port 14 is an I/O port with an output latch. Port 14 can be set to the input mode or output mode in 1-bit units using
port mode register 14 (PM14). When the P140 to P144 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 14 (PU14).
Input to the P142 and P143 pins can be specified through a normal input buffer or a TTL input buffer in 1-bit units
using port input mode register 14 (PIM14).
Output from the P142 to P144 pin can be specified as N-ch open-drain output (V
DD tolerance) in 1-bit units using
port output mode register 14 (POM14).
To use the P147 set it to digital I/O using port mode control register 14 (PMC14).
This port can also be used for clock/buzzer output, external interrupt request input, serial interface data I/O, and
clock I/O.
Reset signal generation sets port 14 to input port.
5.2.13Port 15
Port 15 is an I/O port with an output latch. Port 15 can be set to the input mode or output mode in 1-bit units using
port mode register 15 (PM15).
This port can also be used for A/D converter analog input.
To use P155/ANI13 and P156/ANI14 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 P155/ANI13 and P156/ANI14 as analog input pins, set them to analog function using the A/D port
configuration register (ADPC) and input mode using the PM15 register. Use these pins starting from the lower bit.
Table 5 - 3 Setting Functions of P155/ANI13 and P156/ANI14 Pins
ADPC RegisterPM15 RegisterADS Register
Digital I/O selectionInput mode—Digital input
Output mode—Digital output
Analog function selectionInput modeSelects ANI.Analog input (to be converted)
Does not select ANI.Analog input
Output modeSelects ANI.Setting prohibited
Does not select ANI.
P155/ANI13 and P156/ANI14
Pins
(not to be converted)
All P15 are set in the analog function mode when the reset signal is generated.
5.2.14GPIO port
GPIO port is an I/O port with an output latch. For GPIO port, SCI20 enables the mode setting and I/O.
For details, see CHAPTER 18 RF TRANSCEIVER.
R01UH0575EJ0120 Rev. 1.20Page 72 of 920
Dec 22, 2016
Page 91
RL78/G1HCHAPTER 5 PORT FUNCTIONS
5.3Registers Controlling Port Function
Port functions are controlled by the following registers.
• Port mode registers (PMxx)
• Port registers (Pxx)
• Pull-up resistor option registers (PUxx)
• Port input mode registers (PIMxx)
• Port output mode registers (POMxx)
• Port mode control registers (PMCxx)
• A/D port configuration register (ADPC)
R01UH0575EJ0120 Rev. 1.20Page 73 of 920
Dec 22, 2016
Page 92
RL78/G1HCHAPTER 5 PORT FUNCTIONS
Table 5 - 4 PMxx, Pxx, PUxx, PIMxx, POMxx, PMCxx registers and the bits (1/2)
Bit name
Port
Port 02PM02P02PU02—POM02PMC02
3PM03P03PU03PIM03POM03PMC03
4PM04P04PU04PIM04POM04—
Port 10PM10P10PU10———
1P M11P 11PU 11———
2PM12P12PU12———
3PM13P13PU13———
4PM14P14PU14———
5PM15P15PU15———
6PM16P16PU16———
Port 20PM20P20————
1PM21P21————
2PM22P22————
Port 30PM30P30PU30———
1PM31P31PU31———
Port 40PM40P40PU40———
Port 60PM60P60————
1PM61P61————
2PM62P62————
3PM63P63————
Port 70PM70P70PU70———
1PM71P71PU71—POM71—
2PM72P72PU72———
5PM75P75PU75———
6PM76P76PU76———
7PM77P77PU77———
Port 80PM80P80PU80PIM80POM80—
1PM81P81PU81PIM81POM81—
2PM82P82PU82—POM82—
Port 100PM100P100PU100——PMC100
Port 120PM120P120PU120——PMC120
1—P121————
2—P122————
3—P123————
4—P124————
Port 130—P130————
7—P137————
PMxx
register
Pxx
register
PUxx
register
PIMxx
register
POMxx
register
PMCxx
register
R01UH0575EJ0120 Rev. 1.20Page 74 of 920
Dec 22, 2016
Page 93
RL78/G1HCHAPTER 5 PORT FUNCTIONS
Table 5 - 5 PMxx, Pxx, PUxx, PIMxx, POMxx, PMCxx registers and the bits (2/2)
Bit name
Port
Port 140PM140P140PU140———
1PM141P141PU141———
2PM142P142PU142PIM142POM142—
3PM143P143PU143PIM143POM143—
4PM144P144PU144—POM144—
Port 155PM155P155————
6PM156P156————
PMxx
register
Pxx
register
PUxx
register
PIMxx
register
POMxx
register
PMCxx
register
R01UH0575EJ0120 Rev. 1.20Page 75 of 920
Dec 22, 2016
Page 94
RL78/G1HCHAPTER 5 PORT FUNCTIONS
5.3.1Port mode registers (PMxx)
These registers specify input or output mode for the port in 1-bit units.
These registers can be set by a 1-bit or 8-bit memory manipulation instruction.
Reset signal generation sets these registers to FFH.
When port pins are used as alternate-function pins, set the port mode register by referencing 5.5 Register
Settings When Using Alternate Function.
Figure 5 - 1 Format of Port mode register
Symbol76543210 Address After resetR/W
PM0
1
PM1 PM17
Note 1
PM2 PM27
Note 1
PM3
111111PM31
PM4 PM47
Note 1
PM5 PM57
Note 1
PM6 PM67
Note 1
PM7
PM77 PM76 PM75
PM8 PM87
Note 1
PM06
Note 1
PM16
Note 2
PM26
Note 1
PM46
Note 1
PM56
Note 1
PM66
Note 1
PM86
Note 1
PM05
Note 1
PM15
Note 2
PM25
Note 1
PM45
Note 1
PM55
Note 1
PM65
Note 1
PM85
Note 1
PM00
PM12
Note 2
PM01
Note 1
PM11
Note 2
Note 1
PM10
Note 2
FFF20HFFHR/W
FFF21HFFHR/W
PM22 PM21 PM20FFF22HFFHR/W
PM42
Note 1
PM52
Note 1
PM30
Note 3
PM41
PM40FFF24HFFHR/W
Note 1
PM51
PM50
Note 1
Note 1
FFF23HFFHR/W
FFF25HFFHR/W
PM72 PM71 PM70FFF27HFFHR/W
PM82 PM81 PM80FFF28HFFHR/W
PM04 PM03 PM02
PM14
PM13
Note 3
Note 2
PM24
PM23
Note 1
Note 1
PM44
PM43
Note 1
Note 1
PM54
PM53
Note 1
Note 1
PM64
PM63 PM62 PM61 PM60FFF26HFFHR/W
Note 1
PM73
PM74
Note 1
Note 1
PM84
PM83
Note 1
Note 1
PM10
PM11
11111
111111
PM102
Note 1
PM101
Note 1
PM 111
Note 1
PM100FFF2AHFFHR/W
PM110
Note 1
FFF2BHFFHR/W
PM121111111PM120FFF2CHFFHR/W
PM146
Note 1
PM145
PM144 PM143 PM142 PM141 PM140FFF2EHFFHR/W
Note 1
PM153
PM152
PM154
Note 1
Note 1
PM151
Note 1
Note 1
PM150
Note 1
FFF2FHFFHR/W
PM14 PM147
Note 1
PM15
1PM156 PM155
PMmnPmn pin I/O mode selection (m = 0 to 8, 10 to 12, 14, 15; n = 0 to 7)
0Output mode (the pin functions as an output port (output buffer on))
1Input mode (the pin functions as an input port (output buffer off))
R01UH0575EJ0120 Rev. 1.20Page 76 of 920
Dec 22, 2016
Page 95
RL78/G1HCHAPTER 5 PORT FUNCTIONS
Note 1.Control bits for internal pins. After reset release, be sure to set to output mode by software (set 0 to port
mode register).
Note 2.Control bits for internal connecting pins. After reset release, be sure to set to output mode by software (set 0
to port mode register).
Note 3.Control bits for internal connecting pins. After reset release, be sure to set to input mode by software (set 1 to
port mode register).
CautionBe sure to set bits that are not mounted to their initial values. For the register that has an instruction
to clear the bit to 0, clear it to 0.
R01UH0575EJ0120 Rev. 1.20Page 77 of 920
Dec 22, 2016
Page 96
RL78/G1HCHAPTER 5 PORT FUNCTIONS
5.3.2Port registers (Pxx)
These registers set the output latch value of a port.
If the data is read in the input mode, the pin level is read. If it is read in the output mode, the output latch value is
Note
read
These registers can be set by a 1-bit or 8-bit memory manipulation instruction.
Reset signal generation clears these registers to 00H.
NoteWhen P20 to P22, P120 are set to the analog function, if a port is read in input mode, the read value
.
is always 0, not the pin level.
R01UH0575EJ0120 Rev. 1.20Page 78 of 920
Dec 22, 2016
Page 97
RL78/G1HCHAPTER 5 PORT FUNCTIONS
Figure 5 - 2 Format of Port register
Symbol76543210 Address After resetR/W
P0
0
P1P17
Note 3
P2P27
Note 3
P06
Note 3
P05
Note 3
P04P03P02
Note 3
P16P15P14P13P12P11P10FFF01H00H (output latch)R/W
P26
Note 3
P25
Note 3
P24
Note 3
P23
Note 3
P22P21P20FFF02H00H (output latch)R/W
P01
P00
Note 3
FFF00H00H (output latch)R/W
P3000000P31P30FFF03H00H (output latch)R/W
P4P47
Note 3
P5P57
Note 3
P6P67
Note 3
P7
P77P76P75
P8P87
Note 3
P46
Note 3
P56
Note 3
P66
Note 3
P86
Note 3
P45
Note 3
P55
Note 3
P65
Note 3
P85
Note 3
P44
Note 3
P54
Note 3
P64
Note 3
P74
Note 3
P84
Note 3
P43
Note 3
P53
Note 3
P42
Note 3
P52
Note 3
P41
Note 3
P51
Note 3
P40FFF04H00H (output latch)R/W
P50
Note 3
FFF05H00H (output latch)R/W
P63P62P61P60FFF06H00H (output latch)R/W
P73
Note 3
Note 3
P72P71P70FFF07H00H (output latch)R/W
P83
P82P81P80FFF08H00H (output latch)R/W
P10
00000
P11
000000
P12
000P124P123P122P121P120FFF0CHUndefined
P13
P137000000P130FFF0DH
P14 P147
Note 3
P15
P146
Note 3
P145
Note 3
0P156P155
Pmn
Output data control (in output mode)Input data read (in input mode)
P144P143P142P141P140FFF0EH00H (output latch)R/W
P154
Note 3
P513
Note 3
Note 3
Note 3
P101
P102
Note 3
Note 3
P152
Note 3
P100FFF0AH00H (output latch)R/W
P110
P111
Note 3
P151
P150
Note 3
m = 0 to 8, 10 to 15; n = 0 to 7
FFF0BH00H (output latch)R/W
FFF0FH00H (output latch)R/W
0Output 0Input low level
1Output 1Input high level
Note 1.P121 to P124, and P137 are read-only.
Note 2.P137: Undefined
P130: 0 (output latch)
Note 3.Control bits for internal pins. After reset release, be sure to set 0 to port mode register.
Note 2
R/W
R/W
Note 1
Note 1
CautionBe sure to set bits that are not mounted to their initial values.
R01UH0575EJ0120 Rev. 1.20Page 79 of 920
Dec 22, 2016
Page 98
RL78/G1HCHAPTER 5 PORT FUNCTIONS
5.3.3Pull-up resistor option registers (PUxx)
These registers specify whether the on-chip pull-up resistors are to be used or not. On-chip pull-up resistors can
be used in 1-bit units only for the bits set to input mode (PMmn = 1 and POMmn = 0) for the pins to which the use
of an on-chip pull-up resistor has been specified in these registers. On-chip pull-up resistors cannot be
connected to bits set to output mode and bits used as alternate-function output pins, regardless of the settings of
these registers. Similarly, on-chip pull-up resistors cannot be connected to the pins used as alternate-function
output pins and the pins set to the analog function.
These registers can be set by a 1-bit or 8-bit memory manipulation instruction.
Reset signal generation clears these registers to 00H (Only PU4 is set to 01H).
Figure 5 - 3 Format of Pull-up resistor option register
Symbol76543210 Address After resetR/W
PU0000PU04 PU03 PU0200F0030H00HR/W
PU10PU16 PU15 PU14 PU13PU12 PU11 PU10F0031H00HR/W
PU3000000PU31PU30F0033H00HR/W
PU40000000PU40F0034H01HR/W
PU7 PU77 PU76 PU7500PU72 PU71 PU70F0037H00HR/W
PU800000PU82PU81PU80F0038H00HR/W
PU100000000PU100F003AH00HR/W
PU120000000PU120F003CH00HR/W
PU14000PU144 PU143 PU142 PU141 PU140F003EH00HR/W
PUmnPmn pin on-chip pull-up resistor selection (m = 0, 1, 3 to 8, 10 to 12, 14; n = 0 to 7)
0On-chip pull-up resistor not connected
1On-chip pull-up resistor connected
CautionBe sure to set bits that are not mounted to their initial values.
R01UH0575EJ0120 Rev. 1.20Page 80 of 920
Dec 22, 2016
Page 99
RL78/G1HCHAPTER 5 PORT FUNCTIONS
5.3.4Port input mode registers (PIMxx)
These registers set the input buffer in 1-bit units.
TTL input buffer can be selected during serial communication with an external device of the different potential.
Port input mode registers can be set by a 1-bit or 8-bit memory manipulation instruction.
Reset signal generation clears these registers to 00H.
Figure 5 - 4 Format of Port input mode register
Symbol76543210 Address After resetR/W
PIM0000PIM04PIM03000 F0040H00HR/W
PIM8000000PIM81PIM80F0048H00HR/W
PIM140000PIM143PIM14200 F004EH00HR/W
PIMmnPmn pin input buffer selection (m = 0, 1, 3 to 5, 8, 14; n = 0 to 7)
0Normal input buffer
1TTL input buffer
CautionBe sure to set bits that are not mounted to their initial values.
R01UH0575EJ0120 Rev. 1.20Page 81 of 920
Dec 22, 2016
Page 100
RL78/G1HCHAPTER 5 PORT FUNCTIONS
5.3.5Port output mode registers (POMxx)
These registers set the output mode in 1-bit units.
N-ch open-drain output (VDD tolerance) mode can be selected during serial communication with an external
device of the different potential.
In addition, POMxx register is set with PUxx register, whether or not to use the on-chip pull-up resistor.
These registers can be set by a 1-bit or 8-bit memory manipulation instruction.
Reset signal generation clears these registers to 00H.
CautionAn on-chip pull-up resistor is not connected to a bit for which N-ch open-drain output (V
DD
tolerance) mode (POMmn = 1) is set.
Figure 5 - 5 Format of Port output mode register
Symbol76543210 Address After resetR/W
POM0000POM04 POM03 POM0200F0050H00HR/W
POM7000000POM710 F0057H00HR/W
POM8
POM14000
00000POM82POM81POM80
POM144 POM143 POM142
POMmnPmn pin output mode selection (m = 0, 1, 3 to 5, 7, 8, 14; n = 0 to 5, 7)
0Normal output mode
1N-ch open-drain output (V
CautionBe sure to set bits that are not mounted to their initial values.
DD tolerance) mode
00F005EH00HR/W
F0058H00HR/W
R01UH0575EJ0120 Rev. 1.20Page 82 of 920
Dec 22, 2016
Loading...
+ hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.