Data Sheet
Data Sheet
RL78/G13
16 User’s Manual: Hardware
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 published by
Renesas Electronics Corp. through various means, including the Renesas Electronics Corp.
website (http://www.renesas.com).
(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.
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. Take care to prevent chattering noise
from entering the device when the input level is fixed, and also in the transition 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 cause of malfunction. If
an input pin is unconnected, it is possible that an internal input level may be generated 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-down 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 grounded using 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 external power supply after switching on the 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 power on/off sequences may result in the application of an
overvoltage to the internal elements of the device, causing malfunction and degradation of internal elements
due to the passage of an abnormal current. The correct power 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.
How to Use This Manual
Readers This manual is intended for user engineers who wish to understand the functions of the
RL78/G13 and design and develop application systems and programs for these devices.
The target products are as follows.
Purpose This manual is intended to give users an understanding of the functions described in the
Organization below.
Organization The RL78/G13 manual is separated into two parts: this manual and the instructions edition
(common to the RL78 Microcontroller).
Conventions Data significance: Higher digits on the left and lower digits on the right
Active low representations: ××× (overscore over pin and signal name)
Note: Footnote for item marked with Note in the text
Caution: Information requiring particular attention
Remark: Supplementary information
Numerical representations: Binary ...×××× or ××××B
Decimal ...××××
Hexadecimal ...××××H
Related Documents The related documents indicated in this publication may include preliminary versions.
However, preliminary versions are not marked as such.
Caution The related documents listed above are subject to change without notice. Be sure to use the latest
version of each document when designing.
Other Documents
Document Name Document No.
RENESAS MICROCOMPUTER GENERAL CATALOG R01CS0001E
Semiconductor Device Mount Manual Note
Quality Grades on NEC Semiconductor Devices C11531E
NEC Semiconductor Device Reliability/Quality Control System C10983E
Guide to Prevent Damage for Semiconductor Devices by Electrostatic Discharge (ESD) C11892E
Caution The related documents listed above are subject to change without notice. Be sure to use the latest
version of each document when designing.
All trademarks and registered trademarks are the property of their respective owners.
EEPROM is a trademark of Renesas Electronics Corporation.
Windows, Windows NT and Windows XP are registered trademarks or trademarks of Microsoft Corporation in the
United States and/or other countries.
PC/AT is a trademark of International Business Machines Corporation.
SuperFlash is a registered trademark of Silicon Storage Technology, Inc. in several countries including the United States
and Japan.
Caution: This product uses SuperFlash® technology licensed from Silicon Storage Technology, Inc.
CONTENTS
CHAPTER 1 OUTLINE............................................................................................................................... 1
1.1 Features........................................................................................................................................... 1
1.2 Ordering Information...................................................................................................................... 3
1.3 Pin Configuration (Top View) ........................................................................................................ 6
1.3.1 20-pin products................................................................................................................................... 6
1.3.2 24-pin products................................................................................................................................... 7
1.3.3 25-pin products................................................................................................................................... 8
1.3.4 30-pin products................................................................................................................................... 9
1.3.5 32-pin products................................................................................................................................. 10
1.3.6 36-pin products................................................................................................................................. 11
1.3.7 40-pin products................................................................................................................................. 12
1.3.8 44-pin products................................................................................................................................. 13
1.3.9 48-pin products................................................................................................................................. 14
1.3.10 52-pin products............................................................................................................................... 16
1.3.11 64-pin products............................................................................................................................... 17
1.3.12 80-pin products............................................................................................................................... 19
1.3.13 100-pin products............................................................................................................................. 20
1.3.14 128-pin products............................................................................................................................. 22
1.4 Pin Identification........................................................................................................................... 23
1.5 Block Diagram .............................................................................................................................. 24
1.5.1 20-pin products................................................................................................................................. 24
1.5.2 24-pin products................................................................................................................................. 25
1.5.3 25-pin products................................................................................................................................. 26
1.5.4 30-pin products................................................................................................................................. 27
1.5.5 32-pin products................................................................................................................................. 28
1.5.6 36-pin products................................................................................................................................. 29
1.5.7 40-pin products................................................................................................................................. 30
1.5.8 44-pin products................................................................................................................................. 31
1.5.9 48-pin products................................................................................................................................. 32
1.5.10 52-pin products............................................................................................................................... 33
1.5.11 64-pin products............................................................................................................................... 34
1.5.12 80-pin products............................................................................................................................... 35
1.5.13 100-pin products............................................................................................................................. 36
1.5.14 128-pin products............................................................................................................................. 37
1.6 Outline of Functions..................................................................................................................... 38
Index-1
CHAPTER 2 PIN FUNCTIONS ............................................................................................................... 44
Index-2
CHAPTER 3 CPU ARCHITECTURE ...................................................................................................... 98
Index-3
4.2.8 Port 7.............................................................................................................................................. 211
4.2.9 Port 8.............................................................................................................................................. 218
4.2.10 Port 9............................................................................................................................................ 222
4.2.11 Port 10.......................................................................................................................................... 227
4.2.12 Port 11.......................................................................................................................................... 231
4.2.13 Port 12.......................................................................................................................................... 234
4.2.14 Port 13.......................................................................................................................................... 239
4.2.15 Port 14.......................................................................................................................................... 241
4.2.16 Port 15.......................................................................................................................................... 249
4.3 Registers Controlling Port Function ........................................................................................ 251
4.4 Port Function Operations .......................................................................................................... 270
4.4.1 Writing to I/O port ........................................................................................................................... 270
4.4.2 Reading from I/O port ..................................................................................................................... 270
4.4.3 Operations on I/O port .................................................................................................................... 270
4.4.4 Connecting to external device with different potential (1.8 V, 2.5 V, 3 V) ....................................... 271
4.5 Settings of Port Mode Register, and Output Latch When Using Alternate Function.......... 273
4.6 Cautions When Using Port Function..................................................................................... 279
4.6.1 Cautions on 1-Bit Manipulation Instruction for Port Register n (Pn) ............................................... 279
4.6.2 Cautions on the pin settings on the products other than 128-pin.................................................... 280
Index-4
6.1.1 Independent channel operation function ........................................................................................ 324
6.1.2 Simultaneous channel operation function....................................................................................... 325
6.1.3 8-bit timer operation function (channels 1 and 3 only).................................................................... 326
6.1.4 LIN-bus supporting function (channel 7 of unit 0 only) ................................................................... 327
6.2 Configuration of Timer Array Unit ............................................................................................ 328
6.3 Registers Controlling Timer Array Unit.................................................................................... 334
6.4 Basic Rules of Timer Array Unit ............................................................................................... 359
6.4.1 Basic rules of simultaneous channel operation function................................................................. 359
6.4.2 Basic rules of 8-bit timer operation function (channels 1 and 3 only) ............................................. 361
6.5 Operation Timing of Counter .................................................................................................... 362
6.5.1 Count clock (fTCLK) ....................................................................................................................... 362
6.5.2 Start timing of counter .................................................................................................................... 364
6.6 Channel Output (TOmn pin) Control ........................................................................................ 370
6.6.1 TOmn pin output circuit configuration............................................................................................. 370
6.6.2 TOmn Pin Output Setting ............................................................................................................... 371
6.6.3 Cautions on Channel Output Operation ......................................................................................... 372
6.6.4 Collective manipulation of TOmn bit............................................................................................... 378
6.6.5 Timer Interrupt and TOmn Pin Output at Operation Start ............................................................... 379
6.7 Independent Channel Operation Function of Timer Array Unit............................................. 380
6.7.1 Operation as interval timer/square wave output ............................................................................. 380
6.7.2 Operation as external event counter .............................................................................................. 386
6.7.3 Operation as frequency divider (channel 0 of unit 0 only) .............................................................. 391
6.7.4 Operation as input pulse interval measurement ............................................................................. 395
6.7.5 Operation as input signal high-/low-level width measurement........................................................ 399
6.7.6 Operation as delay counter ............................................................................................................ 403
6.8 Simultaneous Channel Operation Function of Timer Array Unit .......................................... 408
6.8.1 Operation as one-shot pulse output function .................................................................................. 408
6.8.2 Operation as PWM function............................................................................................................ 415
6.8.3 Operation as multiple PWM output function ................................................................................... 422
6.9 Cautions When Using Timer Array Unit................................................................................ 430
6.9.1 Cautions When Using Timer output................................................................................................ 430
Index-5
7.4.5 1 Hz output of real-time clock ......................................................................................................... 453
7.4.6 Example of watch error correction of real-time clock ...................................................................... 454
Index-6
11.6.8 Hardware trigger no-wait mode (scan mode, one-shot conversion mode) ................................... 514
11.6.9 Hardware trigger wait mode (select mode, sequential conversion mode) .................................... 515
11.6.10 Hardware trigger wait mode (select mode, one-shot conversion mode)..................................... 516
11.6.11 Hardware trigger wait mode (scan mode, sequential conversion mode) .................................... 517
11.6.12 Hardware trigger wait mode (scan mode, one-shot conversion mode) ...................................... 518
11.7 A/D Converter Setup Flowchart .............................................................................................. 519
11.7.1 Setting up software trigger mode.................................................................................................. 520
11.7.2 Setting up hardware trigger no-wait mode.................................................................................... 521
11.7.3 Setting up hardware trigger wait mode ......................................................................................... 522
11.7.4 Setup when using temperature sensor (example for software trigger mode and one-shot conversion
mode)........................................................................................................................................... 523
11.7.5 Setting up test mode .................................................................................................................... 524
11.8 SNOOZE Mode Function.......................................................................................................... 525
11.9 How to Read A/D Converter Characteristics Table............................................................... 528
11.10 Cautions for A/D Converter ................................................................................................... 530
Index-7
12.6.3 SNOOZE mode function............................................................................................................... 658
12.6.4 Calculating baud rate ................................................................................................................... 663
12.6.5 Procedure for processing errors that occurred during UART (UART0 to UART3) communication667
12.7 LIN Communication Operation ............................................................................................... 668
12.7.1 LIN transmission........................................................................................................................... 668
12.7.2 LIN reception ................................................................................................................................ 671
12.8 Operation of Simplified I2C (IIC00, IIC01, IIC10, IIC11, IIC20, IIC21, IIC30, IIC31)
Communication ....................................................................................................................... 677
12.8.1 Address field transmission............................................................................................................ 680
12.8.2 Data transmission......................................................................................................................... 686
12.8.3 Data reception .............................................................................................................................. 690
12.8.4 Stop condition generation............................................................................................................. 695
12.8.5 Calculating transfer rate ............................................................................................................... 696
12.8.6 Procedure for processing errors that occurred during simplified I2C (IIC00, IIC01, IIC10, IIC11,
IIC20, IIC21, IIC30, IIC31) communication .................................................................................. 698
Index-8
13.6 Timing Charts ........................................................................................................................... 769
Index-9
CHAPTER 17 KEY INTERRUPT FUNCTION ..................................................................................... 850
Index-10
22.3.3 RAM parity error detection function .............................................................................................. 909
22.3.4 RAM guard function...................................................................................................................... 910
22.3.5 SFR guard function ...................................................................................................................... 911
22.3.6 Invalid memory access detection function .................................................................................... 912
22.3.7 Frequency detection function ....................................................................................................... 914
22.3.8 A/D test function ........................................................................................................................... 916
25.1 Writing to Flash Memory by Using Flash Memory Programmer ......................................... 930
25.1.1 Programming Environment........................................................................................................... 932
25.1.2 Communication Mode .................................................................................................................. 932
25.2 Writing to Flash Memory by Using External Device (that Incorporates UART) ................. 933
25.2.1 Programming Environment........................................................................................................... 933
25.2.2 Communication Mode .................................................................................................................. 934
25.3 Connection of Pins on Board.................................................................................................. 935
25.3.1 P40/TOOL0 pin ............................................................................................................................ 935
25.3.2 RESET pin.................................................................................................................................... 935
25.3.3 Port pins ....................................................................................................................................... 936
25.3.4 REGC pin ..................................................................................................................................... 936
25.3.5 X1 and X2 pins ............................................................................................................................. 936
25.3.6 Power supply................................................................................................................................ 936
25.4 Data Flash ................................................................................................................................. 937
25.4.1 Data flash overview ...................................................................................................................... 937
25.4.2 Register controlling data flash memory ........................................................................................ 938
25.4.3 Procedure for accessing data flash memory ................................................................................ 939
25.5 Programming Method .............................................................................................................. 940
25.5.1 Controlling flash memory.............................................................................................................. 940
25.5.2 Flash memory programming mode............................................................................................... 941
25.5.3 Selecting communication mode.................................................................................................... 942
Index-11
25.5.4 Communication commands .......................................................................................................... 943
25.5.5 Description of signature data........................................................................................................ 944
25.6 Security Settings ...................................................................................................................... 945
25.7 Flash Memory Programming by Self-Programming ............................................................. 947
25.7.1 Boot swap function ....................................................................................................................... 949
25.7.2 Flash shield window function........................................................................................................ 951
Index-12
29.6 Peripheral Functions Characteristics................................................................................... 1008
29.6.1 Serial array unit .......................................................................................................................... 1008
29.6.2 Serial interface IICA ................................................................................................................... 1031
29.6.3 On-chip debug (UART)............................................................................................................... 1032
29.7 Analog Characteristics .......................................................................................................... 1032
29.7.1 A/D converter characteristics...................................................................................................... 1032
29.7.2 Temperature sensor characteristics ........................................................................................... 1036
29.7.3 POR circuit characteristics ......................................................................................................... 1036
29.7.4 LVD circuit characteristics .......................................................................................................... 1037
29.8 Data Memory STOP Mode Low Supply Voltage Data Retention Characteristics............. 1040
29.9 Flash Memory Programming Characteristics...................................................................... 1040
29.10 Timing Specs for Switching Modes.................................................................................... 1041
Index-13
RL78/G13 R01UH0146EJ0100
Rev.1.00
RENESAS MCU
Sep 22, 2011
CHAPTER 1 OUTLINE
1.1 Features
{ Minimum instruction execution time can be changed from high speed (0.03125 μs: @ 32 MHz operation with high-
speed on-chip oscillator) to ultra low-speed (30.5 μs: @ 32.768 kHz operation with subsystem clock)
{ General-purpose register: 8 bits × 32 registers (8 bits × 8 registers × 4 banks)
{ ROM: 16 to 512 KB, RAM: 2 to 32 KB, Data flash memory: −/4/8 KB
{ On-chip high-speed on-chip oscillator
• Select from 32 MHz (TYP.), 24 MHz (TYP.), 16 MHz (TYP.), 12 MHz (TYP.), 8 MHz (TYP.), 4 MHz (TYP.), and 1
MHz (TYP.)
{ On-chip single-power-supply flash memory (with prohibition of block erase/writing function)
{ Self-programming (with boot swap function/flash shield window function)
{ On-chip debug function
{ On-chip power-on-reset (POR) circuit and voltage detector (LVD)
{ On-chip watchdog timer (operable with the dedicated low-speed on-chip oscillator)
{ On-chip multiplier and divider/multiply-accumulator
• 16 bits × 16 bits = 32 bits (Unsigned or signed)
• 32 bits ÷ 32 bits = 32 bits (Unsigned)
• 16 bits × 16 bits + 32 bits = 32 bits (Unsigned or signed)
{ On-chip key interrupt function
{ On-chip clock output/buzzer output controller
{ On-chip BCD adjustment
{ I/O ports: 16 to 120 (N-ch open drain: 0 to 4)
{ Timer
• 16-bit timer: 8 to 16 channels
• Watchdog timer: 1 channel
• Real-time clock: 1 channel (Correction clock output)
• Interval timer: 1 channel
{ Serial interface
• CSI
• UART/UART (LIN-bus supported)
• I2C/Simplified I2C communication
{ Different potential interface: Can connect to a 2.5/3 V device when operating at 4.0 V to 5.5 V
{ 8/10-bit resolution A/D converter (VDD = EVDD =1.6 to 5.5 V): 6 to 26 channels
{ Standby function: HALT, STOP, SNOOZE mode
{ Power supply voltage: VDD = 1.6 to 5.5 V
{ Operating ambient temperature: TA = −40 to +85°C
Remark The functions mounted depend on the product. See 1.6 Outline of Functions.
R01UH0146EJ0100 Rev.1.00 1
Sep 22, 2011
RL78/G13 CHAPTER 1 OUTLINE
ROM flash 40 pins 44 pins 48 pins 52 pins 64 pins 80 pins 100 pins 128 pins
<R> Notes 1. This is about 3 KB when the self-programming function and data flash function are used. (For details, see CHAPTER 3)
<R> 2. This is about 19 KB when the self-programming function and data flash function are used. (For details, see CHAPTER 3)
<R> 3. This is about 31 KB when the self-programming function and data flash function are used. (For details, see CHAPTER 3)
R01UH0146EJ0100 Rev.1.00 2
Sep 22, 2011
RL78/G13 CHAPTER 1 OUTLINE
20 pins 20-pin plastic SSOP (7.62 mm Mounted R5F1006AASP, R5F1006CASP, R5F1006DASP, R5F1006EASP
(300)) Not mounted R5F1016AASP, R5F1016CASP, R5F1016DASP, R5F1016EASP
24 pins 24-pin plastic WQFN Mounted R5F1007AANA, R5F1007CANA, R5F1007DANA, R5F1007EANA
(fine pitch) (4 × 4) Not mounted R5F1017AANA, R5F1017CANA, R5F1017DANA, R5F1017EANA
44 pins 44-pin plastic LQFP (10 × 10) Mounted R5F100FAAFP, R5F100FCAFP, R5F100FDAFP, R5F100FEAFP,
R5F100FFAFP, R5F100FGAFP, R5F100FHAFP, R5F100FJAFP,
R5F100FKAFP, R5F100FLAFP
Not mounted R5F101FAAFP, R5F101FCAFP, R5F101FDAFP, R5F101FEAFP,
R5F101FFAFP, R5F101FGAFP, R5F101FHAFP, R5F101FJAFP,
R5F101FKAFP, R5F101FLAFP
R01UH0146EJ0100 Rev.1.00 3
Sep 22, 2011
RL78/G13 CHAPTER 1 OUTLINE
(2/3)
Pin count Package Data flash Part Number
64 pins 64-pin plastic LQFP (12 × 12) Mounted R5F100LCAFA, R5F100LDAFA, R5F100LEAFA, R5F100LFAFA,
R5F100LGAFA, R5F100LHAFA, R5F100LJAFA, R5F100LKAFA,
R5F100LLAFA
Not mounted R5F101LCAFA, R5F101LDAFA, R5F101LEAFA, R5F101LFAFA,
R5F101LGAFA, R5F101LHAFA, R5F101LJAFA, R5F101LKAFA,
R5F101LLAFA
64-pin plastic LQFP (fine pitch) Mounted R5F100LCAFB, R5F100LDAFB, R5F100LEAFB, R5F100LFAFB,
(10 × 10) R5F100LGAFB, R5F100LHAFB, R5F100LJAFB, R5F100LKAFB,
R5F100LLAFB
Not mounted R5F101LCAFB, R5F101LDAFB, R5F101LEAFB, R5F101LFAFB,
R5F101LGAFB, R5F101LHAFB, R5F101LJAFB, R5F101LKAFB,
R5F101LLAFB
R01UH0146EJ0100 Rev.1.00 4
Sep 22, 2011
RL78/G13 CHAPTER 1 OUTLINE
(3/3)
Pin count Package Data flash Part Number
80 pins 80-pin plastic LQFP (14 × 14) Mounted R5F100MFAFA, R5F100MGAFA, R5F100MHAFA,
R5F100MJAFA, R5F100MKAFA, R5F100MLAFA
Not mounted R5F101MFAFA, R5F101MGAFA, R5F101MHAFA,
R5F101MJAFA, R5F101MKAFA, R5F101MLAFA
100 pins 100-pin plastic LQFP (fine pitch) Mounted R5F100PFAFB, R5F100PGAFB, R5F100PHAFB, R5F100PJAFB,
(14 × 14) R5F100PKAFB, R5F100PLAFB
Not mounted R5F101PFAFB, R5F101PGAFB, R5F101PHAFB, R5F101PJAFB,
R5F101PKAFB, R5F101PLAFB
100-pin plastic LQFP (14 × 20) Mounted R5F100PFAFA, R5F100PGAFA, R5F100PHAFA, R5F100PJAFA,
R5F100PKAFA, R5F100PLAFA
Not mounted R5F101PFAFA, R5F101PGAFA, R5F101PHAFA, R5F101PJAFA,
R5F101PKAFA, R5F101PLAFA
128 pins 128-pin plastic LQFP (fine pitch) Mounted R5F100SHAFB, R5F100SJAFB, R5F100SKAFB, R5F100SLAFB
(14 × 20) Not mounted R5F101SHAFB, R5F101SJAFB, R5F101SKAFB, R5F101SLAFB
R01UH0146EJ0100 Rev.1.00 5
Sep 22, 2011
RL78/G13 CHAPTER 1 OUTLINE
P01/ANI16/TO00/RxD1 1 20 P20/ANI0/AVREFP
P00/ANI17/TI00/TxD1 2 19 P21/ANI1/AVREFM
P40/TOOL0 3 18 P22/ANI2
RESET 4 17 P147/ANI18
P137/INTP0 5 16 P10/SCK00/SCL00
P122/X2/EXCLK 6 15 P11/SI00/RxD0/TOOLRxD/SDA00
P121/X1 7 14 P12/SO00/TxD0/TOOLTxD
REGC 8 13 P16/TI01/TO01/INTP5/SO11
VSS 9 12 P17/TI02/TO02/SI11/SDA11
VDD 10 11 P30/INTP3/SCK11/SCL11
Caution Connect the REGC pin to Vss via a capacitor (0.47 to 1 μF).
R01UH0146EJ0100 Rev.1.00 6
Sep 22, 2011
RL78/G13 CHAPTER 1 OUTLINE
P11/SI00/RxD0/TOOLRxD/SDA00
P12/SO00/TxD0/TOOLTxD
P16/TI01/TO01/INTP5
P10/SCK00/SCL00
P147/ANI18
P22/ANI2
exposed die pad
18 17 16 15 14 13
P21/ANI1/AVREFM 19 12 P17/TI02/TO02/SO11
P20/ANI0/AVREFP 20 11 P50/INTP1/SI11/SDA11
P01/ANI16/TO00/RxD1 21 10 P30/INTP3/SCK11/SCL11
P00/ANI17/TI00/TxD1 22 9 P31/TI03/TO03/INTP4/PCLBUZ0
P40/TOOL0 23 8 P61/SDAA0
RESET 24 7 P60/SCLA0
1 2 3 4 5 6
P137/INTP0
P122/X2/EXCLK
P121/X1
REGC
VSS
VDD
Caution Connect the REGC pin to Vss via a capacitor (0.47 to 1 μF).
R01UH0146EJ0100 Rev.1.00 7
Sep 22, 2011
RL78/G13 CHAPTER 1 OUTLINE
A B C D E E D C B A
A B C D E
P40/TOOL0 RESET P01/ANI16/ P22/ANI2 P147/ANI18
5 TO00/RxD1 5
A B C D E
Caution Connect the REGC pin to Vss via a capacitor (0.47 to 1 μF).
R01UH0146EJ0100 Rev.1.00 8
Sep 22, 2011
RL78/G13 CHAPTER 1 OUTLINE
P20/ANI0/AVREFP 1 30 P21/ANI1/AVREFM
P01/ANI16/TO00/RxD1 2 29 P22/ANI2
P00/ANI17/TI00/TxD1 3 28 P23/ANI3
P120/ANI19 4 27 P147/ANI18
P40/TOOL0 5 26 P10/SCK00/SCL00/(TI07)/(TO07)
RESET 6 25 P11/SI00/RxD0/TOOLRxD/SDA00/(TI06)/(TO06)
P137/INTP0 7 24 P12/SO00/TxD0/TOOLTxD/(TI05)/(TO05)
P122/X2/EXCLK 8 23 P13/TxD2/SO20/(SDAA0)/(TI04)/(TO04)
P121/X1 9 22 P14/RxD2/SI20/SDA20/(SCLA0)/(TI03)/(TO03)
REGC 10 21 P15/PCLBUZ1/SCK20/SCL20/(TI02)/(TO02)
VSS 11 20 P16/TI01/TO01/INTP5/(RXD0)
VDD 12 19 P17/TI02/TO02/(TXD0)
P60/SCLA0 13 18 P51/INTP2/SO11
P61/SDAA0 14 17 P50/INTP1/SI11/SDA11
P31/TI03/TO03/INTP4/PCLBUZ0 15 16 P30/INTP3/SCK11/SCL11
Caution Connect the REGC pin to Vss via a capacitor (0.47 to 1 μF).
R01UH0146EJ0100 Rev.1.00 9
Sep 22, 2011
RL78/G13 CHAPTER 1 OUTLINE
P11/SI00/RxD0/TOOLRxD/SDA00/(TI06)/(TO06)
P14/RxD2/SI20/SDA20/(SCLA0)/(TI03)/(TO03)
P15/PCLBUZ1/SCK20/SCL20/(TI02)/(TO02)
P12/SO00/TxD0/TOOLTxD/(TI05)/(TO05)
P13/TxD2/SO20/(SDAA0)/(TI04)/(TO04)
P10/SCK00/SCL00/(TI07)/(TO07)
P16/TI01/TO01/INTP5/(RXD0)
P17/TI02/TO02/(TXD0)
exposed die pad
24 23 22 21 20 19 18 17
P147/ANI18 25 16 P51/INTP2/SO11
P23/ANI3 26 15 P50/INTP1/SI11/SDA11
P22/ANI2 27 14 P30/INTP3/SCK11/SCL11
P21/ANI1/AVREFM 28 13 P70
P20/ANI0/AVREFP 29 12 P31/TI03/TO03/INTP4/PCLBUZ0
P01/ANI16/TO00/RxD1 30 11 P62
P00/ANI17/TI00/TxD1 31 10 P61/SDAA0
P120/ANI19 32 9 P60/SCLA0
1 2 3 4 5 6 7 8
P40/TOOL0
RESET
P137/INTP0
P122/X2/EXCLK
P121/X1
REGC
VSS
VDD
Caution Connect the REGC pin to Vss via a capacitor (0.47 to 1 μF).
R01UH0146EJ0100 Rev.1.00 10
Sep 22, 2011
RL78/G13 CHAPTER 1 OUTLINE
6
5
4
3
2
1
A B C D E F F E D C B A
INDEX MARK
A B C D E F
P60/SCLA0 VDD P121/X1 P122/X2/EXCLK P137/INTP0 P40/TOOL0
6 6
A B C D E F
Caution Connect the REGC pin to Vss via a capacitor (0.47 to 1 μF).
R01UH0146EJ0100 Rev.1.00 11
Sep 22, 2011
RL78/G13 CHAPTER 1 OUTLINE
P11/SI00/RxD0/TOOLRxD/SDA00/(TI06)/(TO06)
P14/RxD2/SI20/SDA20/(SCLA0)/(TI03)/(TO03)
P15/PCLBUZ1/SCK20/SCL20/(TI02)/(TO02)
P12/SO00/TxD0/TOOLTxD/(TI05)/(TO05)
P13/TxD2/SO20/(SDAA0)/(TI04)/(TO04)
P10/SCK00/SCL00/(TI07)/(TO07)
P16/TI01/TO01/INTP5/(RXD0)
P17/TI02/TO02/(TXD0)
P51/INTP2/SO11
P147/ANI18
30 29 28 27 26 25 24 23 22 21
P26/ANI6 31 20 P50/INTP1/SI11/SDA11
P25/ANI5 32 exposed die pad 19 P30/INTP3/RTC1HZ/SCK11/SCL11
P24/ANI4 33 18 P70/KR0/SCK21/SCL21
P23/ANI3 34 17 P71/KR1/SI21/SDA21
P22/ANI2 35 16 P72/KR2/SO21
P21/ANI1/AVREFM 36 15 P73/KR3
P20/ANI0/AVREFP 37 14 P31/TI03/TO03/INTP4/PCLBUZ0
P01/TO00/RxD1 38 13 P62
P00/TI00/TxD1 39 12 P61/SDAA0
P120/ANI19 40 11 P60/SCLA0
1 2 3 4 5 6 7 8 9 10
P40/TOOL0
RESET
P124/XT2/EXCLKS
P123/XT1
P137/INTP0
P122/X2/EXCLK
P121/X1
REGC
VSS
VDD
Caution Connect the REGC pin to Vss via a capacitor (0.47 to 1 μF).
R01UH0146EJ0100 Rev.1.00 12
Sep 22, 2011
RL78/G13 CHAPTER 1 OUTLINE
P11/SI00/RxD0/TOOLRxD/SDA00/(TI06)/(TO06)
P14/RxD2/SI20/SDA20/(SCLA0)/(TI03)/(TO03)
P15/PCLBUZ1/SCK20/SCL20/(TI02)/(TO02)
P12/SO00/TxD0/TOOLTxD/(TI05)/(TO05)
P13/TxD2/SO20/(SDAA0)/(TI04)/(TO04)
P10/SCK00/SCL00/(TI07)/(TO07)
P16/TI01/TO01/INTP5/(RXD0)
P17/TI02/TO02/(TXD0)
P51/INTP2/SO11
P147/ANI18
P146
33 32 31 30 29 28 27 26 25 24 23
P27/ANI7 34 22 P50/INTP1/SI11/SDA11
P26/ANI6 35 21 P30/INTP3/RTC1HZ/SCK11/SCL11
P25/ANI5 36 20 P70/KR0/SCK21/SCL21
P24/ANI4 37 19 P71/KR1/SI21/SDA21
P23/ANI3 38 18 P72/KR2/SO21
P22/ANI2 39 17 P73/KR3
P21/ANI1/AVREFM 40 16 P31/TI03/TO03/INTP4/PCLBUZ0
P20/ANI0/AVREFP 41 15 P63
P01/TO00/RxD1 42 14 P62
P00/TI00/TxD1 43 13 P61/SDAA0
P120/ANI19 44 12 P60/SCLA0
1 2 3 4 5 6 7 8 9 10 11
P41/TI07/TO07
P40/TOOL0
RESET
P124/XT2/EXCLKS
P123/XT1
P137/INTP0
P122/X2/EXCLK
P121/X1
REGC
VSS
VDD
Caution Connect the REGC pin to Vss via a capacitor (0.47 to 1 μF).
R01UH0146EJ0100 Rev.1.00 13
Sep 22, 2011
RL78/G13 CHAPTER 1 OUTLINE
P140/PCLBUZ0/INTP6
P21/ANI1/AVREFM
P20/ANI0/AVREFP
P01/TO00/RxD1
P00/TI00/TxD1
P22/ANI2
P23/ANI3
P24/ANI4
P25/ANI5
P26/ANI6
P27/ANI7
P130
36 35 34 33 32 31 30 29 28 27 26 25
P120/ANI19 37 24 P147/ANI18
P41/TI07/TO07 38 23 P146
P40/TOOL0 39 22 P10/SCK00/SCL00/(TI07)/(TO07)
RESET 40 21 P11/SI00/RxD0/TOOLRxD/SDA00/(TI06)/(TO06)
P124/XT2/EXCLKS 41 20 P12/SO00/TxD0/TOOLTxD/(TI05)/(TO05)
P123/XT1 42 19 P13/TxD2/SO20/(SDAA0)/(TI04)/(TO04)
P137/INTP0 43 18 P14/RxD2/SI20/SDA20/(SCLA0)/(TI03)/(TO03)
P122/X2/EXCLK 44 17 P15/PCLBUZ1/SCK20/SCL20/(TI02)/(TO02)
P121/X1 45 16 P16/TI01/TO01/INTP5/(RXD0)
REGC 46 15 P17/TI02/TO02/(TXD0)
VSS 47 14 P51/INTP2/SO11
VDD 48 13 P50/INTP1/SI11/SDA11
1 2 3 4 5 6 7 8 9 10 11 12
P60/SCLA0
P61/SDAA0
P62
P63
P31/TI03/TO03/INTP4/(PCLBUZ0)
P75/KR5/INTP9/SCK01/SCL01
P74/KR4/INTP8/SI01/SDA01
P73/KR3/SO01
P72/KR2/SO21
P71/KR1/SI21/SDA21
P70/KR0/SCK21/SCL21
P30/INTP3/RTC1HZ/SCK11/SCL11
Caution Connect the REGC pin to Vss via a capacitor (0.47 to 1 μF).
R01UH0146EJ0100 Rev.1.00 14
Sep 22, 2011
RL78/G13 CHAPTER 1 OUTLINE
P140/PCLBUZ0/INTP6
P21/ANI1/AVREFM
P20/ANI0/AVREFP
P01/TO00/RxD1
P00/TI00/TxD1
P22/ANI2
P23/ANI3
P24/ANI4
P25/ANI5
P26/ANI6
P27/ANI7
P130
36 35 34 33 32 31 30 29 28 27 26 25
P120/ANI19 37 24 P147/ANI18
P41/TI07/TO07 38 exposed die pad 23 P146
P40/TOOL0 39 22 P10/SCK00/SCL00/(TI07)/(TO07)
RESET 40 21 P11/SI00/RxD0/TOOLRxD/SDA00/(TI06)/(TO06)
P124/XT2/EXCLKS 41 20 P12/SO00/TxD0/TOOLTxD/(TI05)/(TO05)
P123/XT1 42 19 P13/TxD2/SO20/(SDAA0)/(TI04)/(TO04)
P137/INTP0 43 18 P14/RxD2/SI20/SDA20/(SCLA0)/(TI03)/(TO03)
P122/X2/EXCLK 44 17 P15/PCLBUZ1/SCK20/SCL20/(TI02)/(TO02)
P121/X1 45 16 P16/TI01/TO01/INTP5/(RXD0)
REGC 46 15 P17/TI02/TO02/(TXD0)
VSS 47 14 P51/INTP2/SO11
VDD 48 13 P50/INTP1/SI11/SDA11
1 2 3 4 5 6 7 8 9 10 11 12
P60/SCLA0
P61/SDAA0
P62
P63
P31/TI03/TO03/INTP4/(PCLBUZ0)
P75/KR5/INTP9/SCK01/SCL01
P74/KR4/INTP8/SI01/SDA01
P73/KR3/SO01
P72/KR2/SO21
P71/KR1/SI21/SDA21
P70/KR0/SCK21/SCL21
P30/INTP3/RTC1HZ/SCK11/SCL11
Caution Connect the REGC pin to Vss via a capacitor (0.47 to 1 μF).
R01UH0146EJ0100 Rev.1.00 15
Sep 22, 2011
RL78/G13 CHAPTER 1 OUTLINE
P11/SI00/RxD0/TOOLRxD/SDA00/(TI06)/(TO06)
P14/RxD2/SI20/SDA20/(SCLA0)/(TI03)/(TO03)
P15/PCLBUZ1/SCK20/SCL20/(TI02)/(TO02)
P12/SO00/TxD0/TOOLTxD/(TI05)/(TO05)
P13/TxD2/SO20/(SDAA0)/(TI04)/(TO04)
P30/INTP3/RTC1HZ/SCK11/SCL11
P10/SCK00/SCL00/(TI07)/(TO07)
P16/TI01/TO01/INTP5/(RXD0)
P50/INTP1/SI11/SDA11
P17/TI02/TO02/(TXD0)
P51/INTP2/SO11
P147/ANI18
P146
39 38 37 36 35 34 33 32 31 30 29 28 27
P27/ANI7 40 26 P70/KR0/SCK21/SCL21
P26/ANI6 41 25 P71/KR1/SI21/SDA21
P25/ANI5 42 24 P72/KR2/SO21
P24/ANI4 43 23 P73/KR3/SO01
P23/ANI3 44 22 P74/KR4/INTP8/SI01/SDA01
P22/ANI2 45 21 P75/KR5/INTP9/SCK01/SCL01
P21/ANI1/AVREFM 46 20 P76/KR6/INTP10/(RXD2)
P20/ANI0/AVREFP 47 19 P77/KR7/INTP11/(TXD2)
P130 48 18 P31/TI03/TO03/INTP4/(PCLBUZ0)
P03/ANI16/RxD1 49 17 P63
P02/ANI17/TxD1 50 16 P62
P01/TO00 51 15 P61/SDAA0
P00/TI00 52 14 P60/SCLA0
1 2 3 4 5 6 7 8 9 10 11 12 13
P140/PCLBUZ0/INTP6
P120/ANI19
P41/TI07/TO07
P40/TOOL0
RESET
P124/XT2/EXCLKS
P123/XT1
P137/INTP0
P122/X2/EXCLK
P121/X1
REGC
VSS
VDD
Caution Connect the REGC pin to Vss via a capacitor (0.47 to 1 μF).
R01UH0146EJ0100 Rev.1.00 16
Sep 22, 2011
RL78/G13 CHAPTER 1 OUTLINE
P12/SO00/TxD0/TOOLTxD/(INTP5)/(TI05)/(TO05)
P11/SI00/RxD0/TOOLRxD/SDA00/(TI06)/(TO06)
P14/RxD2/SI20/SDA20/(SCLA0)/(TI03)/(TO03)
P13/TxD2/SO20/(SDAA0)/(TI04)/(TO04)
P16/TI01/TO01/INTP5/(SI00)/(RXD0)
P10/SCK00/SCL00/(TI07)/(TO07)
P15/SCK20/SCL20/(TI02)/(TO02)
P17/TI02/TO02/(SO00)/(TXD0)
P55/(PCLBUZ1)/(SCK00)
P50/INTP1/SI11/SDA11
P51/INTP2/SO11
P53/(INTP11)
P52/(INTP10)
P147/ANI18
P146
P54
48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33
P27/ANI7 49 32 P30/INTP3/RTC1HZ/SCK11/SCL11
P26/ANI6 50 31 P05/TI05/TO05
P25/ANI5 51 30 P06/TI06/TO06
P24/ANI4 52 29 P70/KR0/SCK21/SCL21
P23/ANI3 53 28 P71/KR1/SI21/SDA21
P22/ANI2 54 27 P72/KR2/SO21
P21/ANI1/AVREFM 55 26 P73/KR3/SO01
P20/ANI0/AVREFP 56 25 P74/KR4/INTP8/SI01/SDA01
P130 57 24 P75/KR5/INTP9/SCK01/SCL01
P04/SCK10/SCL10 58 23 P76/KR6/INTP10/(RXD2)
P03/ANI16/SI10/RxD1/SDA10 59 22 P77/KR7/INTP11/(TXD2)
P02/ANI17/SO10/TxD1 60 21 P31/TI03/TO03/INTP4/(PCLBUZ0)
P01/TO00 61 20 P63
P00/TI00 62 19 P62
P141/PCLBUZ1/INTP7 63 18 P61/SDAA0
P140/PCLBUZ0/INTP6 64 17 P60/SCLA0
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
P120/ANI19
P43
P42/TI04/TO04
P41/TI07/TO07
P40/TOOL0
RESET
P124/XT2/EXCLKS
P123/XT1
P137/INTP0
P122/X2/EXCLK
P121/X1
REGC
VSS
EVSS0
VDD
EVDD0
R01UH0146EJ0100 Rev.1.00 17
Sep 22, 2011
RL78/G13 CHAPTER 1 OUTLINE
8
7
6
5
4
3
2
1
A B C D E F G H H G F E D C B A
Index mark
Pin No. Name Pin No. Name Pin No. Name Pin No. Name
A1 P05/TI05/TO05 C1 P51/INTP2/SO11 E1 P13/TxD2/SO20/ G1 P146
(SDAA0)/(TI04)/(TO04)
A2 P30/INTP3/RTC1HZ C2 P71/KR1/SI21/SDA21 E2 P14/RxD2/SI20/SDA20 G2 P25/ANI5
/SCK11/SCL11 /(SCLA0)/(TI03)/(TO03)
A3 P70/KR0/SCK21 C3 P74/KR4/INTP8/SI01 E3 P15/SCK20/SCL20/ G3 P24/ANI4
/SCL21 /SDA01 (TI02)/(TO02)
A4 P75/KR5/INTP9 C4 P52/(INTP10) E4 P16/TI01/TO01/INTP5 G4 P22/ANI2
/SCK01/SCL01 /(SI00)/(RxD0)
A5 P77/KR7/INTP11/ C5 P53/(INTP11) E5 P03/ANI16/SI10/RxD1 G5 P130
(TxD2) /SDA10
A6 P61/SDAA0 C6 P63 E6 P41/TI07/TO07 G6 P02/ANI17/SO10/TxD1
A7 P60/SCLA0 C7 VSS E7 RESET G7 P00/TI00
A8 EVDD0 C8 P121/X1 E8 P137/INTP0 G8 P124/XT2/EXCLKS
B1 P50/INTP1/SI11 D1 P55/(PCLBUZ1)/ F1 P10/SCK00/SCL00/ H1 P147/ANI18
/SDA11 (SCK00) (TI07)/(TO07)
B2 P72/KR2/SO21 D2 P06/TI06/TO06 F2 P11/SI00/RxD0 H2 P27/ANI7
/TOOLRxD/SDA00/
(TI06)/(TO06)
B3 P73/KR3/SO01 D3 P17/TI02/TO02/ F3 P12/SO00/TxD0 H3 P26/ANI6
(SO00)/(TxD0) /TOOLTxD/(INTP5)/
(TI05)/(TO05)
B4 P76/KR6/INTP10/ D4 P54 F4 P21/ANI1/AVREFM H4 P23/ANI3
(RxD2)
B5 P31/TI03/TO03 D5 P42/TI04/TO04 F5 P04/SCK10/SCL10 H5 P20/ANI0/AVREFP
/INTP4/(PCLBUZ0)
B6 P62 D6 P40/TOOL0 F6 P43 H6 P141/PCLBUZ1/INTP7
B7 VDD D7 REGC F7 P01/TO00 H7 P140/PCLBUZ0/INTP6
B8 EVSS0 D8 P122/X2/EXCLK F8 P123/XT1 H8 P120/ANI19
P12/SO00/TxD0/TOOLTxD/(INTP5)/(TI05)/(TO05)
P11/SI00/RxD0/TOOLRxD/SDA00/(TI06)/(TO06)
P14/RxD2/SI20/SDA20/(SCLA0)/(TI03)/(TO03)
P13/TxD2/SO20/(SDAA0)/(TI04)/(TO04)
P16/TI01/TO01/INTP5/(SI00)/(RXD0)
P10/SCK00/SCL00/(TI07)/(TO07)
P15/SCK20/SCL20/(TI02)/(TO02)
P17/TI02/TO02/(SO00)/(TXD0)
P55/(PCLBUZ1)/(SCK00)
P50/INTP1/SI11/SDA11
P54/SCK31/SCL31
P51/INTP2/SO11
P53/SI31/SDA31
P111/(INTP11)
P110/(INTP10)
P153/ANI11
P100/ANI20
P147/ANI18
P52/SO31
P146
60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41
P152/ANI10 61 40 P30/INTP3/RTC1HZ/SCK11/SCL11
P151/ANI9 62 39 P05/TI05/TO05
P150/ANI8 63 38 P06/TI06/TO06
P27/ANI7 64 37 P70/KR0/SCK21/SCL21
P26/ANI6 65 36 P71/KR1/SI21/SDA21
P25/ANI5 66 35 P72/KR2/SO21
P24/ANI4 67 34 P73/KR3
P23/ANI3 68 33 P74/KR4/INTP8
P22/ANI2 69 32 P75/KR5/INTP9
P21/ANI1/AVREFM 70 31 P76/KR6/INTP10/(RXD2)
P20/ANI0/AVREFP 71 30 P77/KR7/INTP11/(TXD2)
P130 72 29 P67/TI13/TO13
P04/SCK10/SCL10 73 28 P66/TI12/TO12
P03/ANI16/SI10/RxD1/SDA10 74 27 P65/TI11/TO11
P02/ANI17/SO10/TxD1 75 26 P64/TI10/TO10
P01/TO00 76 25 P31/TI03/TO03/INTP4/(PCLBUZ0)
P00/TI00 77 24 P63/SDAA1
P144/SO30/TxD3 78 23 P62/SCLA1
P143/SI30/RxD3/SDA30 79 22 P61/SDAA0
P142/SCK30/SCL30 80 21 P60/SCLA0
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
P141/PCLBUZ1/INTP7
P140/PCLBUZ0/INTP6
P120/ANI19
P45/SO01
P44/SI01/SDA01
P43/SCK01/SCL01
P42/TI04/TO04
P41/TI07/TO07
P40/TOOL0
RESET
P124/XT2/EXCLKS
P123/XT1
P137/INTP0
P122/X2/EXCLK
P121/X1
REGC
VSS
EVSS0
VDD
EVDD0
R01UH0146EJ0100 Rev.1.00 19
Sep 22, 2011
RL78/G13 CHAPTER 1 OUTLINE
P12/SO00/TxD0/TOOLTxD/(INTP5)/(TI05)/(TO05)
P11/SI00/RxD0/TOOLRxD/SDA00/(TI06)/(TO06)
P14/RxD2/SI20/SDA20/(SCLA0)/(TI03)/(TO03)
P13/TxD2/SO20/(SDAA0)/(TI04)/(TO04)
P16/TI01/TO01/INTP5/(SI00)/(RXD0)
P30/INTP3/RTC1HZ/SCK11/SCL11
P10/SCK00/SCL00/(TI07)/(TO07)
P15/SCK20/SCL20/(TI02)/(TO02)
P17/TI02/TO02/(SO00)/(TXD0)
P55/(PCLBUZ1)/(SCK00)
P54/SCK31/SCL31
P53/SI31/SDA31
P50/SI11/SDA11
P111/(INTP11)
P110/(INTP10)
P146/(INTP4)
P57/(INTP3)
P56/(INTP1)
P87/(INTP9)
P100/ANI20
P147/ANI18
P52/SO31
P51/SO11
EVDD1
P101
75 74 73 72 71 70 69 68 67 66 65 64 63 62 61 60 59 58 57 56 55 54 53 52 51
P156/ANI14 76 50 P86/(INTP8)
P155/ANI13 77 49 P85/(INTP7)
P154/ANI12 78 48 P84/(INTP6)
P153/ANI11 79 47 P83
P152/ANI10 80 46 P82/(SO10)/(TXD1)
P151/ANI9 81 45 P81/(SI10)/(RXD1)/(SDA10)
P150/ANI8 82 44 P80/(SCK10)/(SCL10)
P27/ANI7 83 43 EVSS1
P26/ANI6 84 42 P05
P25/ANI5 85 41 P06
P24/ANI4 86 40 P70/KR0/SCK21/SCL21
P23/ANI3 87 39 P71/KR1/SI21/SDA21
P22/ANI2 88 38 P72/KR2/SO21
P21/ANI1/AVREFM 89 37 P73/KR3
P20/ANI0/AVREFP 90 36 P74/KR4/INTP8
P130 91 35 P75/KR5/INTP9
P102/TI06/TO06 92 34 P76/KR6/INTP10/(RXD2)
P04/SCK10/SCL10 93 33 P77/KR7/INTP11/(TXD2)
P03/ANI16/SI10/RxD1/SDA10 94 32 P67/TI13/TO13
P02/ANI17/SO10/TxD1 95 31 P66/TI12/TO12
P01/TO00 96 30 P65/TI11/TO11
P00/TI00 97 29 P64/TI10/TO10
P145/TI07/TO07 98 28 P31/TI03/TO03/INTP4/(PCLBUZ0)
P144/SO30/TxD3 99 27 P63/SDAA1
P143/SI30/RxD3/SDA30 100 26 P62/SCLA1
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
P142/SCK30/SCL30
P141/PCLBUZ1/INTP7
P140/PCLBUZ0/INTP6
P120/ANI19
P47/INTP2
P46/INTP1/TI05/TO05
P45/SO01
P44/SI01/SDA01
P43/SCK01/SCL01
P42/TI04/TO04
P41
P40/TOOL0
RESET
P124/XT2/EXCLKS
P123/XT1
P137/INTP0
P122/X2/EXCLK
P121/X1
REGC
VSS
EVSS0
VDD
EVDD0
P60/SCLA0
P61/SDAA0
Cautions 1. Make EVSS0, EVSS1 pins the same potential as VSS pin.
2. Make VDD pin the potential that is higher than EVDD0, EVDD1 pins (EVDD0 = EVDD1).
3. Connect the REGC pin to Vss via a capacitor (0.47 to 1 μF).
Remarks 1. For pin identification, see 1.4 Pin Identification.
2. When using the microcontroller for an application where the noise generated inside the microcontroller
must be reduced, it is recommended to supply separate powers to the VDD, EVDD0 and EVDD1 pins and
connect the VSS, EVSS0 and EVSS1 pins to separate ground lines.
3. Functions in parentheses in the above figure can be assigned via settings in the peripheral I/O redirection
register (PIOR).
R01UH0146EJ0100 Rev.1.00 20
Sep 22, 2011
RL78/G13 CHAPTER 1 OUTLINE
P03/ANI16/SI10/RxD1/SDA10
P143/SI30/RxD3/SDA30
P02/ANI17/SO10/TxD1
P140/PCLBUZ0/INTP6
P141/PCLBUZ1/INTP7
P142/SCK30/SCL30
P04/SCK10/SCL10
P144/SO30/TxD3
P21/ANI1/AVREFM
P20/ANI0/AVREFP
P145/TI07/TO07
P102/TI06/TO06
P152/ANI10
P153/ANI11
P154/ANI12
P155/ANI13
P156/ANI14
P100/ANI20
P147/ANI18
P150/ANI8
P151/ANI9
P01/TO00
P22/ANI2
P23/ANI3
P24/ANI4
P25/ANI5
P26/ANI6
P27/ANI7
P00/TI00
P130
80 79 78 77 76 75 74 73 72 71 70 69 68 67 66 65 64 63 62 61 60 59 58 57 56 55 54 53 52 51
P120/ANI19 81 50 P146/(INTP4)
P47/INTP2 82 49 P111/(INTP11)
P46/INTP1/TI05/TO05 83 48 P110/(INTP10)
P45/SO01 84 47 P101
P44/SI01/SDA01 85 46 P10/SCK00/SCL00/(TI07)/(TO07)
P43/SCK01/SCL01 86 45 P11/SI00/RxD0/TOOLRxD/SDA00/(TI06)/(TO06)
P42/TI04/TO04 87 44 P12/SO00/TxD0/TOOLTxD/(INTP5)/(TI05)/(TO05)
P41 88 43 P13/TxD2/SO20/(SDAA0)/(TI04)/(TO04)
P40/TOOL0 89 42 P14/RxD2/SI20/SDA20/(SCLA0)/(TI03)/(TO03)
RESET 90 41 P15/SCK20/SCL20/(TI02)/(TO02)
P124/XT2/EXCLKS 91 40 P16/TI01/TO01/INTP5/(SI00)/(RXD0)
P123/XT1 92 39 P17/TI02/TO02/(SO00)/(TXD0)
P137/INTP0 93 38 P57/(INTP3)
P122/X2/EXCLK 94 37 P56/(INTP1)
P121/X1 95 36 P55/(PCLBUZ1)/(SCK00)
REGC 96 35 P54/SCK31/SCL31
VSS 97 34 P53/SI31/SDA31
EVSS0 98 33 P52/SO31
VDD 99 32 P51/SO11
EVDD0 100 31 P50/SI11/SDA11
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
P60/SCLA0
P61/SDAA0
P62/SCLA1
P63/SDAA1
P31/TI03/TO03/INTP4/(PCLBUZ0)
P64/TI10/TO10
P65/TI11/TO11
P66/TI12/TO12
P67/TI13/TO13
P77/KR7/INTP11/(TXD2)
P76/KR6/INTP10/(RXD2)
P75/KR5/INTP9
P74/KR4/INTP8
P73/KR3
P72/KR2/SO21
P71/KR1/SI21/SDA21
P70/KR0/SCK21/SCL21
P06
P05
EVSS1
P80/(SCK10)/(SCL10)
P81/(SI10)/(RXD1)/(SDA10)
P82/(SO10)/(TXD1)
P83
P84/(INTP6)
P85/(INTP7)
P86/(INTP8)
P87/(INTP9)
P30/INTP3/RTC1HZ/SCK11/SCL11
EVDD1
Cautions 1. Make EVSS0, EVSS1 pins the same potential as VSS pin.
2. Make VDD pin the potential that is higher than EVDD0, EVDD1 pins (EVDD0 = EVDD1).
3. Connect the REGC pin to Vss via a capacitor (0.47 to 1 μF).
R01UH0146EJ0100 Rev.1.00 21
Sep 22, 2011
RL78/G13 CHAPTER 1 OUTLINE
P12/SO00/TxD0/TOOLTxD/(INTP5)/(TI05)/(TO05)
P11/SI00/RxD0/TOOLRxD/SDA00/(TI06)/(TO06)
P14/RxD2/SI20/SDA20/(SCLA0)/(TI03)/(TO03)
P13/TxD2/SO20/(SDAA0)/(TI04)/(TO04)
P16/TI01/TO01/INTP5/(SI00)/(RXD0)
P10/SCK00/SCL00/(TI07)/(TO07)
P15/SCK20/SCL20/(TI02)/(TO02)
P17/TI02/TO02/(SO00)/(TXD0)
P55/(PCLBUZ1)/(SCK00)
P30/INTP3/RTC1HZ
P95/SCK11/SCL11
P54/SCK31/SCL31
P96/SI11/SDA11
P53/SI31/SDA31
P111/(INTP11)
P110/(INTP10)
P146/(INTP4)
P57/(INTP3)
P56/(INTP1)
P87/(INTP9)
P100/ANI20
P147/ANI18
P117/ANI24
P116/ANI25
P115/ANI26
P97/SO11
P52/SO31
P101
P114
P113
P112
P94
P93
P92
P91
P90
P51
P50
102 101 100 99 98 97 96 95 94 93 92 91 90 89 88 87 86 85 84 83 82 81 80 79 78 77 76 75 74 73 72 71 70 69 68 67 66 65
P156/ANI14 103 64 P86/(INTP8)
P155/ANI13 104 63 P85/(INTP7)
P154/ANI12 105 62 P84/(INTP6)
P153/ANI11 106 61 P83
P152/ANI10 107 60 P82/(SO10)/(TXD1)
P151/ANI9 108 59 P81/(SI10)/(RXD1)/(SDA10)
P150/ANI8 109 58 P80/(SCK10)/(SCL10)
P27/ANI7 110 57 EVDD1
P26/ANI6 111 56 EVSS1
P25/ANI5 112 55 P05
P24/ANI4 113 54 P06
P23/ANI3 114 53 P70/KR0/SCK21/SCL21
P22/ANI2 115 52 P71/KR1/SI21/SDA21
P21/ANI1/AVREFM 116 51 P72/KR2/SO21
P20/ANI0/AVREFP 117 50 P73/KR3
P130 118 49 P74/KR4/INTP8
P102/TI06/TO06 119 48 P75/KR5/INTP9
P07 120 47 P76/KR6/INTP10/(RXD2)
P04/SCK10/SCL10 121 46 P77/KR7/INTP11/(TXD2)
P03/ANI16/SI10/RxD1/SDA10 122 45 P67/TI13/TO13
P02/ANI17/SO10/TxD1 123 44 P66/TI12/TO12
P01/TO00 124 43 P65/TI11/TO11
P00/TI00 125 42 P64/TI10/TO10
P145/TI07/TO07 126 41 P31/TI03/TO03/INTP4/(PCLBUZ0)
P144/SO30/TxD3 127 40 P63/SDAA1
P143/SI30/RxD3/SDA30 128 39 P62/SCLA1
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
P142/SCK30/SCL30
P141/PCLBUZ1/INTP7
P140/PCLBUZ0/INTP6
P120/ANI19
P37/ANI21
P36/ANI22
P35/ANI23
P34
P33
P32
P106/TI17/TO17
P105/TI16/TO16
P104/TI15/TO15
P103/TI14/TO14
P47/INTP2
P46/INTP1/TI05/TO05
P45/SO01
P44/SI01/SDA01
P43/SCK01/SCL01
P42/TI04/TO04
P41
P40/TOOL0
P127
P126
P125
RESET
P124/XT2/EXCLKS
P123/XT1
P137/INTP0
P122/X2/EXCLK
P121/X1
REGC
VSS
EVSS0
VDD
EVDD0
P60/SCLA0
P61/SDAA0
Cautions 1. Make EVSS0, EVSS1 pins the same potential as VSS pin.
2. Make VDD pin the potential that is higher than EVDD0, EVDD1 pins (EVDD0 = EVDD1).
3. Connect the REGC pin to Vss via a capacitor (0.47 to 1 μF).
R01UH0146EJ0100 Rev.1.00 22
Sep 22, 2011
RL78/G13 CHAPTER 1 OUTLINE
R01UH0146EJ0100 Rev.1.00 23
Sep 22, 2011
RL78/G13 CHAPTER 1 OUTLINE
TI01/TO01/P16 ch1
PORT 2 3 P20 to P22
TI02/TO02/P17 ch2
PORT 3 P30
ch3
PORT 4 P40
ch4
SCL00/P10 INTERRUPT
IIC00 INTP3/P30
SDA00/P11 BCD CONTROL
ADJUSTMENT
SCL11/P30 INTP5/P16
IIC11
SDA11/P17
R01UH0146EJ0100 Rev.1.00 24
Sep 22, 2011
RL78/G13 CHAPTER 1 OUTLINE
TI01/TO01/P16 ch1
PORT 2 3 P20 to P22
TI02/TO02/P17 ch2
PORT 3 2 P30, P31
TI03/TO03/P31 ch3
PORT 4 P40
ch4
PORT 5 P50
ch5
INTERVAL
TIMER
ch6 PORT 6 2 P60, P61
ch7
PORT 12 2 P121, P122
POWER ON RESET/
POR/LVD
VOLTAGE
SERIAL ARRAY CONTROL
DETECTOR
UNIT0 (4ch) RAM
RxD0/P11
UART0
TxD0/P12 RESET CONTROL
RxD1/P01
UART1
TxD1/P00
VDD VSS TOOLRxD/P11, ON-CHIP DEBUG TOOL0/P40
SCK00/P10 TOOLTxD/P12
SI00/P11 CSI00
SO00/P12 SYSTEM
SCK11/P30 CONTROL RESET
SI11/P50 CSI11 SERIAL SDAA0/P61 X1/P121
HIGH-SPEED
SO11/P17 INTERFACE IICA0 SCLA0/P60 ON-CHIP
X2/EXCLK/P122
OSCILLATOR
SCL00/P10
IIC00
SDA00/P11
BUZZER OUTPUT
SCL11/P30 PCLBUZ0/P31 VOLTAGE
IIC11 REGC
SDA11/P50 CLOCK OUTPUT REGULATOR
CONTROL
DIRECT MEMORY
MULTIPLIER& INTP0/P137
ACCESS CONTROL
DIVIDER,
MULITIPLY- INTERRUPT INTP1/P50
BCD ACCUMULATOR CONTROL
INTP3/P30,
ADJUSTMENT 2 INTP4/P31
INTP5/P16
R01UH0146EJ0100 Rev.1.00 25
Sep 22, 2011
RL78/G13 CHAPTER 1 OUTLINE
TI01/TO01/P16 ch1
PORT 2 3 P20 to P22
TI02/TO02/P17 ch2
PORT 3 2 P30, P31
TI03/TO03/P31 ch3
PORT 4 P40
ch4
PORT 5 P50
ch5
INTERVAL
TIMER
ch6 PORT 6 2 P60, P61
ch7
PORT 12 2 P121, P122
P130
PORT 13
WINDOW P137
WATCHDOG
TIMER PORT 14 P147
CODE FLASH MEMORY
RL78
LOW-SPEED CPU ANI0/P20 to
ON-CHIP CORE 3
DATA FLASH MEMORY ANI2/P22
OSCILLATOR
ANI16/P01, ANI17/P00,
A/D CONVERTER 3
ANI18/P147
REAL-TIME AVREFP/P20
CLOCK AVREFM/P21
POWER ON RESET/
POR/LVD
SERIAL ARRAY VOLTAGE
CONTROL
UNIT0 (4ch) DETECTOR
RAM
RxD0/P11
UART0
TxD0/P12
RESET CONTROL
RxD1/P01
UART1
TxD1/P00
VDD VSS TOOLRxD/P11, ON-CHIP DEBUG TOOL0/P40
SCK00/P10
CSI00 TOOLTxD/P12
SI00/P11
SO00/P12
SYSTEM
SCK11/P30 CONTROL RESET
SI11/P50 CSI11 SDAA0/P61
SERIAL HIGH-SPEED X1/P121
SO11/P17 INTERFACE IICA0 SCLA0/P60 ON-CHIP
X2/EXCLK/P122
SCL00/P10 OSCILLATOR
IIC00
SDA00/P11
BUZZER OUTPUT
SCL11/P30 VOLTAGE
IIC11 PCLBUZ0/P31 REGC
SDA11/P50 REGULATOR
CLOCK OUTPUT
CONTROL
DIRECT MEMORY
ACCESS CONTROL MULTIPLIER& INTP0/P137
DIVIDER,
MULITIPLY- INTERRUPT INTP1/P50
BCD ACCUMULATOR CONTROL
ADJUSTMENT INTP3/P30,
2 INTP4/P31
INTP5/P16
R01UH0146EJ0100 Rev.1.00 26
Sep 22, 2011
RL78/G13 CHAPTER 1 OUTLINE
TI01/TO01/P16 ch1
PORT 2 4 P20 to P23
TI02/TO02/P17
ch2
(TI02/TO02/P15)
PORT 3 2 P30, P31
TI03/TO03/P31
ch3
(TI03/TO03/P14)
PORT 4 P40
(TI04/TO04/P13) ch4
(TI07/TO07/P10) P120
ch7
RxD2/P14 PORT 12
2 P121, P122
REAL-TIME ANI0/P20 to
4
CLOCK ANI3/P23
CODE FLASH MEMORY
RL78 ANI16/P01, ANI17/P00,
CPU A/D CONVERTER 4
ANI18/P147, ANI19/P120
SERIAL ARRAY CORE
UNIT0 (4ch) DATA FLASH MEMORY AVREFP/P20
AVREFM/P21
RxD0/P11(RxD0/P16)
UART0
TxD0/P12(TxD0/P17)
POWER ON RESET/
POR/LVD
RxD1/P01 VOLTAGE
UART1 CONTROL
TxD1/P00 DETECTOR
RAM
SCK00/P10
SI00/P11 CSI00 RESET CONTROL
SO00/P12
SCK11/P30
SI11/P50 CSI11
VDD VSS TOOLRxD/P11, ON-CHIP DEBUG TOOL0/P40
SO11/P51 TOOLTxD/P12
SCL00/P10 SDAA0/P61(SDAA0/P13)
IIC00 SERIAL SYSTEM
SDA00/P11
INTERFACE IICA0 CONTROL RESET
SCLA0/P60(SCLA0/P14)
SCL11/P30 HIGH-SPEED X1/P121
IIC11
SDA11/P50 ON-CHIP
BUZZER OUTPUT X2/EXCLK/P122
OSCILLATOR
PCLBUZ0/P31,
2
PCLBUZ1/P15
CLOCK OUTPUT
CONTROL
SERIAL ARRAY VOLTAGE
REGC
UNIT1 (2ch) REGULATOR
MULTIPLIER&
RxD2/P14
UART2 DIVIDER,
TxD2/P13 RxD2/P14
LINSEL MULITIPLY-
ACCUMULATOR INTP0/P137
INTP1/P50,
SCK20/P15 2
DIRECT MEMORY INTERRUPT INTP2/P51
SI20/P14 CSI20 CONTROL
ACCESS CONTROL INTP3/P30,
SO20/P13 2 INTP4/P31
SCL20/P15 INTP5/P16
IIC20 BCD
SDA20/P14 ADJUSTMENT
Remark Functions in parentheses in the above figure can be assigned via settings in the peripheral I/O redirection
register (PIOR).
R01UH0146EJ0100 Rev.1.00 27
Sep 22, 2011
RL78/G13 CHAPTER 1 OUTLINE
TI01/TO01/P16 ch1
PORT 2 4 P20 to P23
TI02/TO02/P17 ch2
(TI02/TO02/P15) PORT 3 2 P30, P31
TI03/TO03/P31(TI03/TO03/P14) ch3
PORT 4 P40
(TI04/TO04/P13) ch4
(TI07/TO07/P10)
ch7 PORT 7 P70
RxD2/P14
WINDOW P120
WATCHDOG PORT 12
2 P121, P122
TIMER
PORT 13 P137
LOW-SPEED
ON-CHIP
OSCILLATOR
PORT 14 P147
CODE FLASH MEMORY
RL78
REAL-TIME CPU
ANI0/P20 to
CLOCK CORE 4
DATA FLASH MEMORY ANI3/P23
ANI16/P01, ANI17/P00,
A/D CONVERTER 4
SERIAL ARRAY ANI18/P147, ANI19/P120
UNIT0 (4ch) AVREFP/P20
AVREFM/P21
RxD0/P11(RxD0/P16)
UART0
TxD0/P12(TxD0/P17)
POWER ON RESET/
RxD1/P01 POR/LVD
UART1 RAM VOLTAGE
TxD1/P00 CONTROL
DETECTOR
SCK00/P10
SI00/P11 CSI00
RESET CONTROL
SO00/P12
VDD VSS TOOLRxD/P11,
SCK11/P30 TOOLTxD/P12
SI11/P50 CSI11
SO11/P51 ON-CHIP DEBUG TOOL0/P40
SCL00/P10 SDAA0/P61(SDAA0/P13)
IIC00 SERIAL
SDA00/P11 INTERFACE IICA0 SYSTEM
SCLA0/P60(SCLA0/P14) RESET
CONTROL
SCL11/P30 X1/P121
IIC11 HIGH-SPEED
SDA11/P50 BUZZER OUTPUT ON-CHIP
PCLBUZ0/P31, X2/EXCLK/P122
2 OSCILLATOR
PCLBUZ1/P15
CLOCK OUTPUT
CONTROL
SERIAL ARRAY VOLTAGE
UNIT1 (2ch) REGC
MULTIPLIER& REGULATOR
RxD2/P14 DIVIDER,
UART2
TxD2/P13 MULITIPLY-
LINSEL ACCUMULATOR RxD2/P14
INTP0/P137
SCK20/P15 DIRECT MEMORY INTP1/P50,
CSI20 INTERRUPT 2 INTP2/P51
SI20/P14 ACCESS CONTROL
CONTROL
SO20/P13 INTP3/P30,
2 INTP4/P31
SCL20/P15 BCD INTP5/P16
IIC20
SDA20/P14 ADJUSTMENT
Remark Functions in parentheses in the above figure can be assigned via settings in the peripheral I/O redirection
register (PIOR).
R01UH0146EJ0100 Rev.1.00 28
Sep 22, 2011
RL78/G13 CHAPTER 1 OUTLINE
TI01/TO01/P16 ch1
PORT 2 6 P20 to P25
TI02/TO02/P17
ch2
(TI02/TO02/P15)
PORT 3 2 P30, P31
TI03/TO03/P31
ch3
(TI03/TO03/P14)
PORT 4 P40
(TI04/TO04/P13) ch4
(TI07/TO07/P10)
ch7 PORT 7 3 P70 to P72
RxD2/P14
WINDOW P120
PORT 12
WATCHDOG 2 P121, P122
TIMER
LOW-SPEED
PORT 13 P137
ON-CHIP
OSCILLATOR
PORT 14 P147
CODE FLASH MEMORY
RL78
REAL-TIME
CPU
CLOCK ANI0/P20 to
CORE 6
DATA FLASH MEMORY ANI5/P25
SERIAL ARRAY
A/D CONVERTER 2 ANI18/P147, ANI19/P120
UNIT0 (4ch)
RxD0/P11(RxD0/P16) AVREFP/P20
UART0 AVREFM/P21
TxD0/P12(TxD0/P17)
RxD1/P01
UART1
TxD1/P00 POWER ON RESET/
POR/LVD
VOLTAGE
SCK00/P10 CONTROL
RAM DETECTOR
SI00/P11 CSI00
SO00/P12
SCK11/P30
CSI11 RESET CONTROL
SI11/P50
SO11/P51
SCL11/P30 SYSTEM
IIC11
SDA11/P50 SDAA0/P61(SDAA0/P13) CONTROL
SERIAL RESET
INTERFACE IICA0 HIGH-SPEED X1/P121
SCLA0/P60(SCLA0/P14) ON-CHIP X2/EXCLK/P122
SERIAL ARRAY OSCILLATOR
UNIT1 (2ch)
BUZZER OUTPUT
RxD2/P14 PCLBUZ0/P31,
UART2 2 VOLTAGE
TxD2/P13 PCLBUZ1/P15 REGC
LINSEL CLOCK OUTPUT REGULATOR
CONTROL
SCK20/P15 RxD2/P14
SI20/P14 CSI20 MULTIPLIER& INTP0/P137
DIVIDER, INTP1/P50,
SO20/P13
MULITIPLY- INTERRUPT 2 INTP2/P51
SCK21/P70 ACCUMULATOR CONTROL
SI21/P71 CSI21 INTP3/P30,
2 INTP4/P31
SO21/P72 DIRECT MEMORY
ACCESS CONTROL INTP5/P16
SCL20/P15
IIC20
SDA20/P14
SCL21/P70 BCD
IIC21
SDA21/P71 ADJUSTMENT
Remark Functions in parentheses in the above figure can be assigned via settings in the peripheral I/O redirection
register (PIOR).
R01UH0146EJ0100 Rev.1.00 29
Sep 22, 2011
RL78/G13 CHAPTER 1 OUTLINE
TI01/TO01/P16 ch1
PORT 2 7 P20 to P26
TI02/TO02/P17
ch2
(TI02/TO02/P15)
PORT 3 2 P30, P31
TI03/TO03/P31
ch3
(TI03/TO03/P14)
PORT 4 P40
(TI04/TO04/P13) ch4
(TI07/TO07/P10)
ch7 PORT 7 4 P70 to P73
RxD2/P14
WINDOW P120
PORT 12
WATCHDOG 4 P121 to P124
TIMER
LOW-SPEED
PORT 13 P137
ON-CHIP
OSCILLATOR
PORT 14 P147
CODE FLASH MEMORY
REAL-TIME RL78
RTC1HZ/P30 CPU
CLOCK ANI0/P20 to
CORE 7
DATA FLASH MEMORY ANI6/P26
SERIAL ARRAY
A/D CONVERTER 2 ANI18/P147, ANI19/P120
UNIT0 (4ch)
RxD0/P11(RxD0/P16) AVREFP/P20
UART0 AVREFM/P21
TxD0/P12(TxD0/P17)
RxD1/P01
UART1
TxD1/P00 KEY RETURN KR0/P70 to
4
KR3/P73
SCK00/P10
CSI00 RAM
SI00/P11
SO00/P12 POWER ON RESET/
POR/LVD
VOLTAGE
SCK11/P30 CONTROL
DETECTOR
SI11/P50 CSI11
SO11/P51
SCL11/P30
IIC11
SDA11/P50 ON-CHIP DEBUG TOOL0/P40
SDAA0/P61(SDAA0/P13)
SERIAL
INTERFACE IICA0
SCLA0/P60(SCLA0/P14)
SERIAL ARRAY SYSTEM RESET
UNIT1 (2ch) CONTROL X1/P121
BUZZER OUTPUT
RxD2/P14 X2/EXCLK/P122
PCLBUZ0/P31, HIGH-SPEED
UART2 2
TxD2/P13 PCLBUZ1/P15 ON-CHIP XT1/P123
LINSEL CLOCK OUTPUT OSCILLATOR
CONTROL XT2/EXCLKS/P124
SCK20/P15
CSI20 MULTIPLIER& VOLTAGE
SI20/P14 REGC
DIVIDER, REGULATOR
SO20/P13
MULITIPLY-
SCK21/P70 ACCUMULATOR RxD2/P14
SI21/P71 CSI21
INTP0/P137
SO21/P72 DIRECT MEMORY INTP1/P50,
SCL20/P15 ACCESS CONTROL INTERRUPT 2 INTP2/P51
IIC20 CONTROL
SDA20/P14 INTP3/P30,
2 INTP4/P31
SCL21/P70 BCD
IIC21
SDA21/P71 ADJUSTMENT INTP5/P16
Remark Functions in parentheses in the above figure can be assigned via settings in the peripheral I/O redirection
register (PIOR).
R01UH0146EJ0100 Rev.1.00 30
Sep 22, 2011
RL78/G13 CHAPTER 1 OUTLINE
TI01/TO01/P16 ch1
PORT 2 8 P20 to P27
TI02/TO02/P17 ch2
(TI02/TO02/P15) PORT 3 2 P30, P31
TI03/TO03/P31
ch3
(TI03/TO03/P14)
PORT 4 2 P40, P41
(TI04/TO04/P13) ch4
WINDOW P120
PORT 12
WATCHDOG 4 P121 to P124
TIMER
LOW-SPEED
PORT 13 P137
ON-CHIP
OSCILLATOR
PORT 14 2 P146, P147
CODE FLASH MEMORY
RL78
RTC1HZ/P30 REAL-TIME CPU
CLOCK CORE ANI0/P20 to
DATA FLASH MEMORY 8
ANI7/P27
SERIAL ARRAY
A/D CONVERTER 2 ANI18/P147, ANI19/P120
UNIT0 (4ch)
RxD0/P11(RxD0/P16) AVREFP/P20
UART0 AVREFM/P21
TxD0/P12(TxD0/P17)
RxD1/P01
UART1
TxD1/P00 KEY RETURN KR0/P70 to
4
KR3/P73
SCK00/P10 RAM
SI00/P11 CSI00
SO00/P12 POWER ON RESET/
POR/LVD
VOLTAGE
SCK11/P30 CONTROL
DETECTOR
SI11/P50 CSI11
SO11/P51 VDD VSS TOOLRxD/P11,
SCL00/P10 TOOLTxD/P12
IIC00 RESET CONTROL
SDA00/P11
SCL11/P30
IIC11
SDA11/P50 SDAA0/P61(SDAA0/P13) ON-CHIP DEBUG TOOL0/P40
SERIAL
INTERFACE IICA0
SCLA0/P60(SCLA0/P14)
SERIAL ARRAY SYSTEM RESET
UNIT1 (2ch) CONTROL X1/P121
BUZZER OUTPUT
RxD2/P14 X2/EXCLK/P122
PCLBUZ0/P31, HIGH-SPEED
UART2 2
TxD2/P13 PCLBUZ1/P15 ON-CHIP XT1/P123
LINSEL CLOCK OUTPUT OSCILLATOR
CONTROL XT2/EXCLKS/P124
SCK20/P15
CSI20 MULTIPLIER& VOLTAGE
SI20/P14 REGC
DIVIDER, REGULATOR
SO20/P13 MULITIPLY-
SCK21/P70 ACCUMULATOR RxD2/P14
SI21/P71 CSI21
INTP0/P137
SO21/P72 DIRECT MEMORY INTP1/P50,
SCL20/P15 ACCESS CONTROL INTERRUPT 2 INTP2/P51
IIC20 CONTROL
SDA20/P14 INTP3/P30,
2 INTP4/P31
SCL21/P70 BCD
IIC21
SDA21/P71 ADJUSTMENT INTP5/P16
Remark Functions in parentheses in the above figure can be assigned via settings in the peripheral I/O redirection
register (PIOR).
R01UH0146EJ0100 Rev.1.00 31
Sep 22, 2011
RL78/G13 CHAPTER 1 OUTLINE
TI01/TO01/P16 ch1
PORT 2 8 P20 to P27
TI02/TO02/P17 ch2
(TI02/TO02/P15) PORT 3 2 P30, P31
TI03/TO03/P31 ch3
(TI03/TO03/P14)
PORT 4 2 P40, P41
(TI04/TO04/P13) ch4
WINDOW P120
PORT 12
WATCHDOG 4 P121 to P124
TIMER
P130
LOW-SPEED
PORT 13
P137
ON-CHIP
OSCILLATOR P140,
PORT 14 3
P146, P147
RTC1HZ/P30 REAL-TIME
CLOCK CODE FLASH MEMORY
RL78 ANI0/P20 to
8
CPU ANI7/P27
CORE
SERIAL ARRAY DATA FLASH MEMORY
A/D CONVERTER 2 ANI18/P147, ANI19/P120
UNIT0 (4ch)
RxD0/P11(RxD0/P16) AVREFP/P20
UART0 AVREFM/P21
TxD0/P12(TxD0/P17)
RxD1/P01
UART1
TxD1/P00 KEY RETURN KR0/P70 to
6
KR5/P75
SCK00/P10
SI00/P11 CSI00
SO00/P12 RAM
POWER ON RESET/
SCK01/P75 POR/LVD
VOLTAGE
CSI01 CONTROL
SI01/P74 DETECTOR
SO01/P73
SCK11/P30
SI11/P50 CSI11 RESET CONTROL
SO11/P51 VDD VSS TOOLRxD/P11,
TOOLTxD/P12
SCL00/P10
IIC00 ON-CHIP DEBUG TOOL0/P40
SDA00/P11
SCL01/P75
IIC01
SDA01/P74 SYSTEM RESET
SCL11/P30 CONTROL X1/P121
IIC11 SDAA0/P61(SDAA0/P13) X2/EXCLK/P122
SDA11/P50 SERIAL HIGH-SPEED
INTERFACE IICA0 ON-CHIP XT1/P123
SCLA0/P60(SCLA0/P14)
OSCILLATOR XT2/EXCLKS/P124
SERIAL ARRAY
UNIT1 (2ch) BUZZER OUTPUT
PCLBUZ0/P140 VOLTAGE
RxD2/P14 2 (PCLBUZ0/P31), REGC
REGULATOR
UART2 CLOCK OUTPUT PCLBUZ1/P15
TxD2/P13
LINSEL CONTROL
RxD2/P14
INTP0/P137
SCK20/P15 MULTIPLIER&
CSI20 INTP1/P50,
SI20/P14 DIVIDER, 2 INTP2/P51
SO20/P13 MULITIPLY-
ACCUMULATOR INTP3/P30,
SCK21/P70 2 INTP4/P31
INTERRUPT
SI21/P71 CSI21 CONTROL
DIRECT MEMORY INTP5/P16
SO21/P72
ACCESS CONTROL
SCL20/P15 INTP6/P140
IIC20
SDA20/P14 INTP8/P74,
BCD 2
SCL21/P70 INTP9/P75
IIC21 ADJUSTMENT
SDA21/P71
Remark Functions in parentheses in the above figure can be assigned via settings in the peripheral I/O redirection
register (PIOR).
R01UH0146EJ0100 Rev.1.00 32
Sep 22, 2011
RL78/G13 CHAPTER 1 OUTLINE
TI01/TO01/P16 ch1
PORT 2 8 P20 to P27
TI02/TO02/P17
ch2
(TI02/TO02/P15)
PORT 3 2 P30, P31
TI03/TO03/P31 ch3
(TI03/TO03/P14)
PORT 4 2 P40, P41
(TI04/TO04/P13) ch4
RTC1HZ/P30 REAL-TIME
CLOCK ANI0/P20 to
8
ANI7/P27
CODE FLASH MEMORY
RL78 ANI16/P03, ANI17/P02,
CPU A/D CONVERTER 4
SERIAL ARRAY ANI18/P147, ANI19/P120
UNIT0 (4ch) CORE
DATA FLASH MEMORY AVREFP/P20
RxD0/P11(RxD0/P16) AVREFM/P21
UART0
TxD0/P12(TxD0/P17)
RxD1/P03 KR0/P70 to
UART1 KEY RETURN 8
TxD1/P02 KR7/P77
SCK00/P10
SI00/P11 CSI00
POWER ON RESET/
SO00/P12 POR/LVD
VOLTAGE
SCK01/P75 RAM CONTROL
DETECTOR
SI01/P74 CSI01
SO01/P73
SCK11/P30
RESET CONTROL
SI11/P50 CSI11
SO11/P51
SCL01/P75
IIC01 SYSTEM RESET
SDA01/P74 CONTROL X1/P121
SCL11/P30 X2/EXCLK/P122
IIC11 HIGH-SPEED
SDA11/P50 ON-CHIP XT1/P123
SDAA0/P61(SDAA0/P13) OSCILLATOR
SERIAL XT2/EXCLKS/P124
INTERFACE IICA0
SCLA0/P60(SCLA0/P14)
SERIAL ARRAY VOLTAGE
REGC
UNIT1 (2ch) REGULATOR
BUZZER OUTPUT
RxD2/P14(RxD2/P76) PCLBUZ0/P140
UART2 2 (PCLBUZ0/P31), RxD2/P14 (RxD2/P76)
TxD2/P13(TxD2/P77) CLOCK OUTPUT PCLBUZ1/P15 INTP0/P137
LINSEL
CONTROL INTP1/P50,
2 INTP2/P51
SCK20/P15
SI20/P14 CSI20 MULTIPLIER& INTP3/P30,
DIVIDER, 2 INTP4/P31
SO20/P13 INTERRUPT
MULITIPLY- CONTROL
SCK21/P70 ACCUMULATOR INTP5/P16
SI21/P71 CSI21
INTP6/P140
SO21/P72 DIRECT MEMORY
SCL20/P15 ACCESS CONTROL INTP8/P74 to
IIC20 4
INTP11/P77
SDA20/P14
SCL21/P70 BCD
IIC21
SDA21/P71 ADJUSTMENT
Remark Functions in parentheses in the above figure can be assigned via settings in the peripheral I/O redirection
register (PIOR).
R01UH0146EJ0100 Rev.1.00 33
Sep 22, 2011
RL78/G13 CHAPTER 1 OUTLINE
TI01/TO01/P16 ch1
PORT 2 8 P20 to P27
TI02/TO02/P17
ch2
(TI02/TO02/P15)
PORT 3 2 P30, P31
TI03/TO03/P31
ch3
(TI03/TO03/P14)
PORT 4 4 P40 to P43
TI04/TO04/P42
ch4
(TI04/TO04/P13)
TI05/TO05/P05 PORT 5 6 P50 to P55
ch5
(TI05/TO05/P12) INTERVAL
TI06/TO06/P06 TIMER
ch6 PORT 6 4 P60 to P63
(TI06/TO06/P11)
TI07/TO07/P41
(TI07/TO07/P10) ch7 PORT 7 8 P70 to P77
RxD2/P14
(RxD2/P76)
WINDOW P120
PORT 12
WATCHDOG 4 P121 to P124
TIMER
P130
LOW-SPEED
PORT 13
P137
ON-CHIP
OSCILLATOR P140, P141,
PORT 14 4
P146, P147
RTC1HZ/P30 REAL-TIME
CLOCK ANI0/P20 to
8
ANI7/P27
SERIAL ARRAY ANI16/P03, ANI17/P02,
A/D CONVERTER 4
UNIT0 (4ch) ANI18/P147, ANI19/P120
RxD0/P11(RxD0/P16) AVREFP/P20
UART0 CODE FLASH MEMORY AVREFM/P21
TxD0/P12(TxD0/P17) RL78
CPU
RxD1/P03 CORE
UART1 DATA FLASH MEMORY
TxD1/P02 KEY RETURN KR0/P70 to
8
KR7/P77
SCK00/P10(SCK00/P55)
SI00/P11(SI00/P16) CSI00
SO00/P12(SO00/P17) POWER ON RESET/
SCK01/P75 POR/LVD
VOLTAGE
CSI01 CONTROL
SI01/P74 DETECTOR
SO01/P73
SCK10/P04 RAM
SI10/P03 CSI10
RESET CONTROL
SO10/P02
SCK11/P30
SI11/P50 CSI11 ON-CHIP DEBUG TOOL0/P40
SO11/P51
SCL00/P10
IIC00 SYSTEM RESET
SDA00/P11 VDD, VSS, TOOLRxD/P11,
CONTROL X1/P121
EVDD0 EVSS0 TOOLTxD/P12
SCL01/P75 X2/EXCLK/P122
IIC01 HIGH-SPEED
SDA01/P74 ON-CHIP XT1/P123
SCL10/P04 SDAA0/P61(SDAA0/P13) OSCILLATOR XT2/EXCLKS/P124
IIC10 SERIAL
SDA10/P03 INTERFACE IICA0 SCLA0/P60(SCLA0/P14)
SCL11/P30 VOLTAGE
IIC11 REGC
SDA11/P50 REGULATOR
BUZZER OUTPUT PCLBUZ0/P140
(PCLBUZ0/P31), RxD2/P14 (RxD2/P76)
2
PCLBUZ1/P141
SERIAL ARRAY CLOCK OUTPUT INTP0/P137
(PCLBUZ1/P55)
UNIT1 (2ch) CONTROL INTP1/P50,
2 INTP2/P51
RxD2/P14(RxD2/P76)
UART2
TxD2/P13(TxD2/P77) MULTIPLIER& INTP3/P30,
LINSEL DIVIDER, 2 INTP4/P31
MULITIPLY- INTERRUPT
CONTROL INTP5/P16(INTP5/P12)
SCK20/P15 ACCUMULATOR
CSI20 INTP6/P140,
SI20/P14 2 INTP7/P141
SO20/P13 DIRECT MEMORY
ACCESS CONTROL INTP8/P74,
SCK21/P70 2
INTP9/P75
SI21/P71 CSI21
INTP10/P76(INTP10/P52),
SO21/P72 2
BCD INTP11/P77(INTP11/P53)
SCL20/P15 ADJUSTMENT
IIC20
SDA20/P14
SCL21/P70
IIC21
SDA21/P71
Remark Functions in parentheses in the above figure can be assigned via settings in the peripheral I/O redirection
register (PIOR).
R01UH0146EJ0100 Rev.1.00 34
Sep 22, 2011
RL78/G13 CHAPTER 1 OUTLINE
TI02/TO02/P17
ch2 ch2 TI12/TO12/P66
(TI02/TO02/P15) PORT 2 8 P20 to P27
SERIAL ARRAY
UNIT1 (4ch)
VDD, VSS, TOOLRxD/P11, RESET CONTROL
UART2 EVDD0 EVSS0 TOOLTxD/P12
RxD2/P14(RxD2/P76)
TxD2/P13(TxD2/P77) LINSEL
ON-CHIP DEBUG TOOL0/P40
RxD3/P143 SERIAL SDAA0/P61(SDAA0/P13)
UART3 INTERFACE IICA0
TxD3/P144 SCLA0/P60(SCLA0/P14)
SYSTEM RESET
SCK20/P15 SDAA1/P63 CONTROL X1/P121
SERIAL
SI20/P14 CSI20
INTERFACE IICA1 SCLA1/P62 X2/EXCLK/P122
SO20/P13 HIGH-SPEED
ON-CHIP XT1/P123
SCK21/P70
BUZZER OUTPUT PCLBUZ0/P140 OSCILLATOR XT2/EXCLKS/P124
SI21/P71 CSI21
(PCLBUZ0/P31),
SO21/P72 2
PCLBUZ1/P141
CLOCK OUTPUT VOLTAGE
SCK30/P142 (PCLBUZ1/P55) REGC
CONTROL REGULATOR
SI30/P143 CSI30
SO30/P144
MULTIPLIER& RxD2/P14(RxD2/P76)
SCK31/P54 DIVIDER, INTP0/P137
SI31/P53 CSI31 MULITIPLY- INTP1/P50,
SO31/P52 ACCUMULATOR 2 INTP2/P51
INTP3/P30,
SCL20/P15 DIRECT MEMORY WINDOW 2
IIC20 INTP4/P31
SDA20/P14 ACCESS CONTROL WATCHDOG
TIMER INTERRUPT INTP5/P16(INTP5/P12)
SCL21/P70 CONTROL
IIC21 INTP6/P140,
SDA21/P71 2
BCD LOW-SPEED INTP7/P141
SCL30/P142 ADJUSTMENT ON-CHIP INTP8/P74,
IIC30 OSCILLATOR 2
SDA30/P143 INTP9/P75
SCL31/P54 INTP10/P76(INTP10/P110),
IIC31 REAL-TIME 2
SDA31/P53 RTC1HZ/P30 INTP11/P77(INTP11/P111)
CLOCK
Remark Functions in parentheses in the above figure can be assigned via settings in the peripheral I/O redirection
register (PIOR).
R01UH0146EJ0100 Rev.1.00 35
Sep 22, 2011
RL78/G13 CHAPTER 1 OUTLINE
TI02/TO02/P17
ch2 ch2 TI12/TO12/P66
(TI02/TO02/P15) PORT 2 8 P20 to P27
TI03/TO03/P31
ch3 ch3 TI13/TO13/P67
(TI03/TO03/P14) PORT 3 2 P30, P31
TI04/TO04/P42
ch4
(TI04/TO04/P13)
PORT 4 8 P40 to P47
TI05/TO05/P46
ch5
(TI05/TO05/P12) INTERVAL
TIMER PORT 5 8 P50 to P57
TI06/TO06/P102
ch6
(TI06/TO06/P11)
TI07/TO07/P145
(TI07/TO07/P10) PORT 6 8 P60 to P67
ch7
RxD2/P14
(RxD2/P76)
PORT 7 8 P70 to P77
SERIAL ARRAY
UNIT0 (4ch) 8 ANI0/P20 to ANI7/P27
RxD0/P11(RxD0/P16) ANI8/P150 to ANI14/P156 PORT 8 8 P80 to P87
7
UART0
TxD0/P12(TxD0/P17) ANI16/P03, ANI17/P02,
5
ANI18/P147, ANI19/P120,
RxD1/P03(RxD1/P81) ANI20/P100
UART1 A/D CONVERTER
TxD1/P02(TxD1/P82)
SCK00/P10(SCK00/P55) 3 P100 to P102
CSI00 PORT 10
SI00/P11(SI00/P16)
SO00/P12(SO00/P17) AVREFP/P20
SCK01/P43 AVREFM/P21 PORT 11 2 P110, P111
SI01/P44 CSI01
SO01/P45 P120
PORT 12
SCK10/P04(SCK10/P80) 4 P121 to P124
SI10/P03(SI10/P81) CSI10
CODE FLASH MEMORY P130
SO10/P02(SO10/P82) RL78 PORT 13
CPU P137
SCK11/P30 CORE
CSI11 DATA FLASH MEMORY
SI11/P50 PORT 14 8 P140 to P147
SO11/P51
SERIAL ARRAY
UNIT1 (4ch)
VDD, VSS, TOOLRxD/P11, RESET CONTROL
UART2 EVDD0, EVSS0, TOOLTxD/P12
RxD2/P14(RxD2/P76) EVDD1 EVSS1
TxD2/P13(TxD2/P77) LINSEL
ON-CHIP DEBUG TOOL0/P40
RxD3/P143 SERIAL SDAA0/P61(SDAA0/P13)
UART3 INTERFACE IICA0 SCLA0/P60(SCLA0/P14)
TxD3/P144
SYSTEM RESET
SCK20/P15 SDAA1/P63 CONTROL X1/P121
SERIAL
SI20/P14 CSI20
INTERFACE IICA1 SCLA1/P62 X2/EXCLK/P122
SO20/P13 HIGH-SPEED
ON-CHIP XT1/P123
SCK21/P70 OSCILLATOR
CSI21 BUZZER OUTPUT PCLBUZ0/P140 XT2/EXCLKS/P124
SI21/P71
2 (PCLBUZ0/P31),
SO21/P72 PCLBUZ1/P141
CLOCK OUTPUT VOLTAGE
SCK30/P142 (PCLBUZ1/P55) REGC
CONTROL REGULATOR
SI30/P143 CSI30
SO30/P144
MULTIPLIER& RxD2/P14 (RxD2/P76)
SCK31/P54 DIVIDER, INTP0/P137
SI31/P53 CSI31 MULITIPLY- INTP1/P46(INTP1/P56),
SO31/P52 ACCUMULATOR 2 INTP2/P47
INTP3/P30(INTP3/P57),
SCL20/P15 DIRECT MEMORY WINDOW 2
IIC20 INTP4/P31(INTP4/P146)
SDA20/P14 ACCESS CONTROL WATCHDOG INTERRUPT
TIMER CONTROL INTP5/P16(INTP5/P12)
SCL21/P70
IIC21 INTP6/P140(INTP6/P84),
SDA21/P71 2
BCD LOW-SPEED INTP7/P141(INTP7/P85)
SCL30/P142 ADJUSTMENT ON-CHIP INTP8/P74(INTP8/P86),
IIC30 OSCILLATOR 2
SDA30/P143 INTP9/P75(INTP9/P87)
SCL31/P54 INTP10/P76(INTP10/P110),
IIC31 REAL-TIME 2
SDA31/P53 RTC1HZ/P30 INTP11/P77(INTP11/P111)
CLOCK
Remark Functions in parentheses in the above figure can be assigned via settings in the peripheral I/O redirection
register (PIOR).
R01UH0146EJ0100 Rev.1.00 36
Sep 22, 2011
RL78/G13 CHAPTER 1 OUTLINE
TI02/TO02/P17
ch2 ch2 TI12/TO12/P66
(TI02/TO02/P15) PORT 2 8 P20 to P27
TI03/TO03/P31
ch3 ch3 TI13/TO13/P67
(TI03/TO03/P14) PORT 3 8 P30 to P37
TI04/TO04/P42 TI14/TO14/P103
ch4 ch4
(TI04/TO04/P13)
PORT 4 8 P40 to P47
TI05/TO05/P46 ch5 TI15/TO15/P104
ch5
(TI05/TO05/P12)
PORT 5 8 P50 to P57
TI06/TO06/P102 ch6 TI16/TO16/P105
ch6
(TI06/TO06/P11)
TI07/TO07/P145
(TI07/TO07/P10) TI17/TO17/P106 PORT 6 8 P60 to P67
ch7 ch7
RxD2/P14
(RxD2/P76)
PORT 7 8 P70 to P77
SERIAL ARRAY INTERVAL
UNIT0 (4ch) TIMER
SERIAL ARRAY
UNIT1 (4ch)
VDD, VSS, TOOLRxD/P11, RESET CONTROL
UART2 EVDD0, EVSS0, TOOLTxD/P12
RxD2/P14(RxD2/P76) EVDD1 EVSS1
TxD2/P13(TxD2/P77) LINSEL
ON-CHIP DEBUG TOOL0/P40
SERIAL SDAA0/P61(SDAA0/P13)
RxD3/P143
UART3 INTERFACE IICA0 SCLA0/P60(SCLA0/P14)
TxD3/P144
SYSTEM RESET
SCK20/P15 SERIAL SDAA1/P63 CONTROL X1/P121
SI20/P14 CSI20 INTERFACE IICA1 SCLA1/P62 X2/EXCLK/P122
SO20/P13 HIGH-SPEED
ON-CHIP XT1/P123
SCK21/P70 OSCILLATOR
BUZZER OUTPUT PCLBUZ0/P140 XT2/EXCLKS/P124
SI21/P71 CSI21
2 (PCLBUZ0/P31),
SO21/P72 PCLBUZ1/P141
CLOCK OUTPUT VOLTAGE
SCK30/P142 (PCLBUZ1/P55) REGC
CONTROL REGULATOR
SI30/P143 CSI30
SO30/P144
MULTIPLIER& RxD2/P14(RxD2/P76)
SCK31/P54 DIVIDER, INTP0/P137
SI31/P53 CSI31 MULITIPLY-
INTP1/P46(INTP1/P56),
ACCUMULATOR 2
SO31/P52 INTP2/P47
INTP3/P30(INTP3/P57),
SCL20/P15 DIRECT MEMORY WINDOW 2
IIC20 INTP4/P31(INTP4/P146)
SDA20/P14 ACCESS CONTROL WATCHDOG
INTERRUPT INTP5/P16(INTP5/P12)
TIMER CONTROL
SCL21/P70
IIC21 INTP6/P140(INTP6/P84),
SDA21/P71 BCD 2
LOW-SPEED INTP7/P141(INTP7/P85)
SCL30/P142 ADJUSTMENT ON-CHIP
IIC30 INTP8/P74(INTP8/P86),
OSCILLATOR 2
SDA30/P143 INTP9/P75(INTP9/P87)
SCL31/P54 INTP10/P76(INTP10/P110),
IIC31 REAL-TIME 2
SDA31/P53 RTC1HZ/P30 INTP11/P77(INTP11/P111)
CLOCK
Remark Functions in parentheses in the above figure can be assigned via settings in the peripheral I/O redirection
register (PIOR).
R01UH0146EJ0100 Rev.1.00 37
Sep 22, 2011
RL78/G13 CHAPTER 1 OUTLINE
(1/2)
Item 20-pin 24-pin 25-pin 30-pin 32-pin 36-pin
R5F101Cx
R5F100Cx
R5F101Bx
R5F1007x
R5F100Ax
R5F101Ax
R5F1008x
R5F1017x
R5F1016x
R5F1006x
R5F1018x
R5F100Bx
Code flash memory (KB) 16 to 64 16 to 64 16 to 64 16 to 128 16 to 128 16 to 128
Data flash memory (KB) 4 − 4 − 4 − 4 to 8 − 4 to 8 − 4 to 8 −
Note1 Note1 Note1 Note1 Note1 Note1
RAM (KB) 2 to 4 2 to 4 2 to 4 2 to 12 2 to 12 2 to 12
Memory space 1 MB
Main system High-speed system X1 (crystal/ceramic) oscillation, external main system clock input (EXCLK)
clock clock 1 to 20 MHz: VDD = 2.7 to 5.5 V, 1 to 8 MHz: VDD = 1.8 to 2.7 V, 1 to 4 MHz: VDD = 1.6 to 1.8 V
High-speed on-chip High-speed operation: 1 to 32 MHz (VDD = 2.7 to 5.5 V), High-speed operation: 1 to 16 MHz (VDD =
oscillator 2.4 to 5.5 V), Low-speed operation: 1 to 8 MHz (VDD = 1.8 to 5.5 V), Low-voltage operation: 1 to 4
MHz (VDD = 1.6 to 5.5 V)
Subsystem clock −
Low-speed on-chip oscillator 15 kHz (TYP.): VDD = 1.6 to 5.5 V
General-purpose register 8 bits × 32 registers (8 bits × 8 registers × 4 banks)
Minimum instruction execution time 0.03125 μs (High-speed on-chip oscillator: fIH = 32 MHz operation)
0.05 μs (High-speed system clock: fMX = 20 MHz operation)
Instruction set • Data transfer (8/16 bits)
• Adder and subtractor/logical operation (8/16 bits)
• Multiplication (8 bits × 8 bits)
• Rotate, barrel shift, and bit manipulation (Set, reset, test, and Boolean operation), etc.
I/O port Total 16 20 21 26 28 32
CMOS I/O 13 15 15 21 22 26
CMOS input 3 3 3 3 3 3
CMOS output − − 1 − − −
N-ch open-drain I/O − 2 2 2 3 3
(6 V tolerance)
Timer 16-bit timer 8 channels
Watchdog timer 1 channel
Real-time clock (RTC) 1 channel
Interval timer (IT) 1 channel
Note 2
Timer output 3 channels 4 channels (PWM outputs: 3 )
(PWM outputs:
Note 2
2 )
RTC output −
Notes 1. In the case of the 4 KB, this is about 3 KB when the self-programming function and data flash function are
used. (For details, see CHAPTER 3)
2. The number of outputs varies, depending on the setting.
R01UH0146EJ0100 Rev.1.00 38
Sep 22, 2011
RL78/G13 CHAPTER 1 OUTLINE
(2/2)
Item 20-pin 24-pin 25-pin 30-pin 32-pin 36-pin
R5F101Cx
R5F100Cx
R5F101Bx
R5F1007x
R5F100Ax
R5F101Ax
R5F1008x
R5F1017x
R5F1016x
R5F1006x
R5F1018x
R5F100Bx
Clock output/buzzer output − 1 1 2 2 2
• 2.44 kHz, 4.88 kHz, 9.76 kHz, 1.25 MHz, 2.5 MHz, 5 MHz, 10 MHz
(Main system clock: fMAIN = 20 MHz operation)
• 256 Hz, 512 Hz, 1.024 kHz, 2.048 kHz, 4.096 kHz, 8.192 kHz, 16.384 kHz, 32.768 kHz
(Subsystem clock: fSUB = 32.768 kHz operation)
8/10-bit resolution A/D converter 6 channels 6 channels 6 channels 8 channels 8 channels 8 channels
Serial interface [20-pin, 24-pin, 25-pin products]
• CSI: 1 channel/UART: 1 channel/simplified I C: 1 channel
2
[36-pin products]
• CSI: 1 channel/UART: 1 channel/simplified I C: 1 channel
2
−
2
I C bus 1 channel 1 channel 1 channel 1 channel 1 channel
Multiplier and divider/multiply- • 16 bits × 16 bits = 32 bits (Unsigned or signed)
accumulator • 32 bits ÷ 32 bits = 32 bits (Unsigned)
• 16 bits × 16 bits + 32 bits = 32 bits (Unsigned or signed)
DMA controller 2 channels
Vectored interrupt Internal 23 24 24 27 27 27
sources External 3 5 5 6 6 6
Key interrupt −
Reset • Reset by RESET pin
• Internal reset by watchdog timer
• Internal reset by power-on-reset
• Internal reset by voltage detector
• Internal reset by illegal instruction execution
Note
Note The illegal instruction is generated when instruction code FFH is executed.
Reset by the illegal instruction execution not issued by emulation with the in-circuit emulator or on-chip debug
emulator.
R01UH0146EJ0100 Rev.1.00 39
Sep 22, 2011
RL78/G13 CHAPTER 1 OUTLINE
(1/2)
Item 40-pin 44-pin 48-pin 52-pin 64-pin
R5F100Gx
R5F101Gx
R5F100Ex
R5F101Ex
R5F100Fx
R5F101Fx
R5F100Lx
R5F101Lx
R5F100Jx
R5F101Jx
Code flash memory (KB) 16 to 192 16 to 512 16 to 512 32 to 512 32 to 512
Data flash memory (KB) 4 to 8 − 4 to 8 − 4 to 8 − 4 to 8 − 4 to 8 −
Note1 Note1 Note1 Note1 Note1
RAM (KB) 2 to 16 2 to 32 2 to 32 2 to 32 2 to 32
Memory space 1 MB
Main system High-speed system X1 (crystal/ceramic) oscillation, external main system clock input (EXCLK)
clock clock 1 to 20 MHz: VDD = 2.7 to 5.5 V, 1 to 8 MHz: VDD = 1.8 to 2.7 V, 1 to 4 MHz: VDD = 1.6 to 1.8 V
High-speed on-chip High-speed operation: 1 to 32 MHz (VDD = 2.7 to 5.5 V), High-speed operation: 1 to 16 MHz (VDD =
oscillator 2.4 to 5.5 V), Low-speed operation: 1 to 8 MHz (VDD = 1.8 to 5.5 V), Low-voltage operation: 1 to 4
MHz (VDD = 1.6 to 5.5 V)
Subsystem clock XT1 (crystal) oscillation, external subsystem clock input (EXCLKS)
32.768 kHz (TYP.): VDD = 1.6 to 5.5 V
Low-speed on-chip oscillator 15 kHz (TYP.): VDD = 1.6 to 5.5 V
General-purpose register 8 bits × 32 registers (8 bits × 8 registers × 4 banks)
Minimum instruction execution time 0.03125 μs (High-speed on-chip oscillator: fIH = 32 MHz operation)
0.05 μs (High-speed system clock: fMX = 20 MHz operation)
30.5 μs (Subsystem clock: fSUB = 32.768 kHz operation)
Instruction set • Data transfer (8/16 bits)
• Adder and subtractor/logical operation (8/16 bits)
• Multiplication (8 bits × 8 bits)
• Rotate, barrel shift, and bit manipulation (Set, reset, test, and Boolean operation), etc.
I/O port Total 36 40 44 48 58
CMOS I/O 28 31 34 38 48
CMOS input 5 5 5 5 5
CMOS output − − 1 1 1
N-ch open-drain I/O 3 4 4 4 4
(6 V tolerance)
Timer 16-bit timer 8 channels
Watchdog timer 1 channel
Real-time clock (RTC) 1 channel
Interval timer (IT) 1 channel
Note 2
Timer output 4 channels (PWM 5 channels (PWM outputs: 4 ) 8 channels (PWM
Note 2 Note 2
outputs: 3 ) outputs: 7 )
RTC output 1
• 1 Hz (subsystem clock: fSUB = 32.768 kHz or )
<R> Notes 1. In the case of the 4 KB, this is about 3 KB when the self-programming function and data flash function are
used. (For details, see CHAPTER 3)
In the case of the 20 KB, this is about 19 KB when the self-programming function and data flash function
are used. (For details, see CHAPTER 3)
In the case of the 32 KB, this is about 31 KB when the self-programming function and data flash function
are used. (For details, see CHAPTER 3)
2. The number of outputs varies, depending on the setting.
R01UH0146EJ0100 Rev.1.00 40
Sep 22, 2011
RL78/G13 CHAPTER 1 OUTLINE
(2/2)
Item 40-pin 44-pin 48-pin 52-pin 64-pin
R5F100Gx
R5F101Gx
R5F100Ex
R5F101Ex
R5F100Fx
R5F101Fx
R5F100Lx
R5F101Lx
R5F100Jx
R5F101Jx
Clock output/buzzer output 2 2 2 2 2
• 2.44 kHz, 4.88 kHz, 9.76 kHz, 1.25 MHz, 2.5 MHz, 5 MHz, 10 MHz
(Main system clock: fMAIN = 20 MHz operation)
• 256 Hz, 512 Hz, 1.024 kHz, 2.048 kHz, 4.096 kHz, 8.192 kHz, 16.384 kHz, 32.768 kHz
(Subsystem clock: fSUB = 32.768 kHz operation)
8/10-bit resolution A/D converter 9 channels 10 channels 10 channels 12 channels 12 channels
Serial interface [40-pin, 44-pin products]
• CSI: 1 channel/UART: 1 channel/simplified I C: 1 channel
2
[64-pin products]
• CSI: 2 channels/UART: 1 channel/simplified I C: 2 channels
2
2
I C bus 1 channel 1 channel 1 channel 1 channel 1 channel
Multiplier and divider/multiply- • 16 bits × 16 bits = 32 bits (Unsigned or signed)
accumulator • 32 bits ÷ 32 bits = 32 bits (Unsigned)
• 16 bits × 16 bits + 32 bits = 32 bits (Unsigned or signed)
DMA controller 2 channels
Vectored Internal 27 27 27 27 27
interrupt sources External 7 7 10 12 13
Key interrupt 4 4 6 8 8
Reset • Reset by RESET pin
• Internal reset by watchdog timer
• Internal reset by power-on-reset
• Internal reset by voltage detector
• Internal reset by illegal instruction execution
Note
Note The illegal instruction is generated when instruction code FFH is executed.
Reset by the illegal instruction execution not issued by emulation with the in-circuit emulator or on-chip debug
emulator.
R01UH0146EJ0100 Rev.1.00 41
Sep 22, 2011
RL78/G13 CHAPTER 1 OUTLINE
<R> Notes 1. In the case of the 20 KB, this is about 19 KB when the self-programming function and data flash function
are used. (For details, see CHAPTER 3)
In the case of the 32 KB, this is about 31 KB when the self-programming function and data flash function
are used. (For details, see CHAPTER 3)
2. The number of outputs varies, depending on the setting.
R01UH0146EJ0100 Rev.1.00 42
Sep 22, 2011
RL78/G13 CHAPTER 1 OUTLINE
(2/2)
Item 80-pin 100-pin 128-pin
R5F100Mx R5F101Mx R5F100Px R5F101Px R5F100Sx R5F101Sx
2
I C bus 2 channel 2 channel 2 channel
Multiplier and divider/multiply- • 16 bits × 16 bits = 32 bits (Unsigned or signed)
accumulator • 32 bits ÷ 32 bits = 32 bits (Unsigned)
• 16 bits × 16 bits + 32 bits = 32 bits (Unsigned or signed)
DMA controller 4 channels
Vectored interrupt Internal 37 37 41
sources External 13 13 13
Key interrupt 8 8 8
Reset • Reset by RESET pin
• Internal reset by watchdog timer
• Internal reset by power-on-reset
• Internal reset by voltage detector
• Internal reset by illegal instruction execution
Note
Note The illegal instruction is generated when instruction code FFH is executed.
Reset by the illegal instruction execution not issued by emulation with the in-circuit emulator or on-chip debug
emulator.
R01UH0146EJ0100 Rev.1.00 43
Sep 22, 2011
RL78/G13 CHAPTER 2 PIN FUNCTIONS
Pin I/O buffer power supplies depend on the product. The relationship between these power supplies and the pins is
shown below.
(1) 20-pin, 24-pin, 25-pin, 30-pin, 32-pin, 36-pin, 40-pin, 44-pin, 48-pin, 52-pin products
R01UH0146EJ0100 Rev.1.00 44
Sep 22, 2011
RL78/G13 CHAPTER 2 PIN FUNCTIONS
R01UH0146EJ0100 Rev.1.00 45
Sep 22, 2011
RL78/G13 CHAPTER 2 PIN FUNCTIONS
R01UH0146EJ0100 Rev.1.00 46
Sep 22, 2011
RL78/G13 CHAPTER 2 PIN FUNCTIONS
R01UH0146EJ0100 Rev.1.00 47
Sep 22, 2011
RL78/G13 CHAPTER 2 PIN FUNCTIONS
(1/2)
Function Name I/O Function After Reset Alternate Function
Remark Functions in parentheses in the above figure can be assigned via settings in the peripheral I/O redirection
register (PIOR).
R01UH0146EJ0100 Rev.1.00 48
Sep 22, 2011
RL78/G13 CHAPTER 2 PIN FUNCTIONS
(2/2)
Function Name I/O Function After Reset Alternate Function
P50 I/O Port 5. Input port INTP1/SI11/SDA11
P51 2-bit I/O port. INTP2/SO11
Output of P50 can be set to N-ch open-drain output (VDD
tolerance).
Input/output can be specified in 1-bit units.
Use of an on-chip pull-up resistor can be specified by a
software setting.
P60 I/O Port 6. Input port SCLA0
P61 2-bit I/O port. SDAA0
Output of P60 and P61 can be set to N-ch open-drain output
(6 V tolerance).
Input/output can be specified in 1-bit units.
P120 I/O Port 12. Analog input ANI19
1-bit I/O port and 2-bit input port. port
P121 Input P120 can be set to analog input. Input port X1
For only P120, input/output can be specified in 1-bit units.
P122 X2/EXCLK
For only P120, use of an on-chip pull-up resistor can be
specified by a software setting.
P137 Input Port 13. Input port INTP0
1-bit input port.
P147 I/O Port 14. Analog input ANI18
1-bit I/O port. port
P147 can be set to analog input.
Input/output can be specified.
Use of an on-chip pull-up resistor can be specified by a
software setting.
R01UH0146EJ0100 Rev.1.00 49
Sep 22, 2011
RL78/G13 CHAPTER 2 PIN FUNCTIONS
(1/2)
Function Name I/O Function After Reset Alternate Function
Remark Functions in parentheses in the above figure can be assigned via settings in the peripheral I/O redirection
register (PIOR).
R01UH0146EJ0100 Rev.1.00 50
Sep 22, 2011
RL78/G13 CHAPTER 2 PIN FUNCTIONS
(2/2)
Function Name I/O Function After Reset Alternate Function
P50 I/O Port 5. Input port INTP1/SI11/SDA11
P51 2-bit I/O port. INTP2/SO11
Output of P50 can be set to N-ch open-drain output (VDD
tolerance).
Input/output can be specified in 1-bit units.
Use of an on-chip pull-up resistor can be specified by a
software setting.
P60 I/O Port 6. Input port SCLA0
P61 3-bit I/O port. SDAA0
Output of P60 to P62 can be set to N-ch open-drain output (6
P62 −
V tolerance).
Input/output can be specified in 1-bit units.
P70 I/O Port 7. Input port −
1-bit I/O port.
Input/output can be specified.
Use of an on-chip pull-up resistor can be specified by a
software setting.
P120 I/O Port 12. Analog input ANI19
1-bit I/O port and 2-bit input port. port
P121 Input P120 can be set to analog input. Input port X1
For only P120, input/output can be specified in 1-bit units.
P122 X2/EXCLK
For only P120, use of an on-chip pull-up resistor can be
specified by a software setting.
P137 Input Port 13. Input port INTP0
1-bit input port.
P147 I/O Port 14. Analog input ANI18
1-bit I/O port. port
P147 can be set to analog input.
Input/output can be specified.
Use of an on-chip pull-up resistor can be specified by a
software setting.
R01UH0146EJ0100 Rev.1.00 51
Sep 22, 2011
RL78/G13 CHAPTER 2 PIN FUNCTIONS
(1/2)
Function Name I/O Function After Reset Alternate Function
Remark Functions in parentheses in the above figure can be assigned via settings in the peripheral I/O redirection
register (PIOR).
R01UH0146EJ0100 Rev.1.00 52
Sep 22, 2011
RL78/G13 CHAPTER 2 PIN FUNCTIONS
(2/2)
Function Name I/O Function After Reset Alternate Function
P50 I/O Port 5. Input port INTP1/SI11/SDA11
P51 2-bit I/O port. INTP2/SO11
Output of P50 can be set to N-ch open-drain output (VDD
tolerance).
Input/output can be specified in 1-bit units.
Use of an on-chip pull-up resistor can be specified by a
software setting.
P60 I/O Port 6. Input port SCLA0
P61 3-bit I/O port. SDAA0
Output of P60 to P62 can be set to N-ch open-drain output (6
P62 −
V tolerance).
Input/output can be specified in 1-bit units.
P70 I/O Port 7. Input port SCK21/SCL21
P71 3-bit I/O port. SI21/SDA21
Output of P71 can be set to N-ch open-drain output (VDD
P72 SO21
tolerance).
Input/output can be specified in 1-bit units.
Use of an on-chip pull-up resistor can be specified by a
software setting.
P120 I/O Port 12. Analog input ANI19
1-bit I/O port and 2-bit input port. port
P121 Input P120 can be set to analog input. Input port X1
For only P120, input/output can be specified in 1-bit units.
P122 X2/EXCLK
For only P120, use of an on-chip pull-up resistor can be
specified by a software setting.
P137 Input Port 13. Input port INTP0
1-bit input port.
R01UH0146EJ0100 Rev.1.00 53
Sep 22, 2011
RL78/G13 CHAPTER 2 PIN FUNCTIONS
(1/2)
Function Name I/O Function After Reset Alternate Function
Remark Functions in parentheses in the above figure can be assigned via settings in the peripheral I/O redirection
register (PIOR).
R01UH0146EJ0100 Rev.1.00 54
Sep 22, 2011
RL78/G13 CHAPTER 2 PIN FUNCTIONS
(2/2)
Function Name I/O Function After Reset Alternate Function
P50 I/O Port 5. Input port INTP1/SI11/SDA11
P51 2-bit I/O port. INTP2/SO11
Output of P50 can be set to N-ch open-drain output (VDD
tolerance).
Input/output can be specified in 1-bit units.
Use of an on-chip pull-up resistor can be specified by a
software setting.
P60 I/O Port 6. Input port SCLA0
P61 3-bit I/O port. SDAA0
Output of P60 to P62 can be set to N-ch open-drain output (6
P62 −
V tolerance).
Input/output can be specified in 1-bit units.
P70 I/O Port 7. Input port KR0/SCK21/SCL21
P71 4-bit I/O port. KR1/SI21/SDA21
Output of P71 can be set to N-ch open-drain output (VDD
P72 KR2/SO21
tolerance).
P73 Input/output can be specified in 1-bit units. KR3
Use of an on-chip pull-up resistor can be specified by a
software setting.
P120 I/O Port 12. Analog input ANI19
1-bit I/O port and 4-bit input port. port
P120 can be set to analog input.
P121 Input Input port X1
For only P120, input/output can be specified in 1-bit units.
P122 For only P120, use of an on-chip pull-up resistor can be X2/EXCLK
specified by a software setting.
P123 XT1
P124 XT2/EXCLKS
P137 Input Port 13. Input port INTP0
1-bit input port.
R01UH0146EJ0100 Rev.1.00 55
Sep 22, 2011
RL78/G13 CHAPTER 2 PIN FUNCTIONS
(1/2)
Function Name I/O Function After Reset Alternate Function
Remark Functions in parentheses in the above figure can be assigned via settings in the peripheral I/O redirection
register (PIOR).
R01UH0146EJ0100 Rev.1.00 56
Sep 22, 2011
RL78/G13 CHAPTER 2 PIN FUNCTIONS
(2/2)
Function Name I/O Function After Reset Alternate Function
P50 I/O Port 5. Input port INTP1/SI11/SDA11
P51 2-bit I/O port. INTP2/SO11
Output of P50 can be set to N-ch open-drain output (VDD
tolerance).
Input/output can be specified in 1-bit units.
Use of an on-chip pull-up resistor can be specified by a
software setting.
P60 I/O Port 6. Input port SCLA0
P61 4-bit I/O port. SDAA0
Output of P60 to P63 can be set to N-ch open-drain output (6
P62 −
V tolerance).
P63 Input/output can be specified in 1-bit units. −
R01UH0146EJ0100 Rev.1.00 57
Sep 22, 2011
RL78/G13 CHAPTER 2 PIN FUNCTIONS
(1/2)
Function Name I/O Function After Reset Alternate Function
Remark Functions in parentheses in the above figure can be assigned via settings in the peripheral I/O redirection
register (PIOR).
R01UH0146EJ0100 Rev.1.00 58
Sep 22, 2011
RL78/G13 CHAPTER 2 PIN FUNCTIONS
(2/2)
Function Name I/O Function After Reset Alternate Function
P50 I/O Port 5. Input port INTP1/SI11/SDA11
P51 2-bit I/O port. INTP2/SO11
Output of P50 can be set to N-ch open-drain output (VDD
tolerance).
Input/output can be specified in 1-bit units.
Use of an on-chip pull-up resistor can be specified by a
software setting.
P60 I/O Port 6. Input port SCLA0
P61 4-bit I/O port. SDAA0
Output of P60 to P63 can be set to N-ch open-drain output (6
P62 −
V tolerance).
P63 Input/output can be specified in 1-bit units. −
R01UH0146EJ0100 Rev.1.00 59
Sep 22, 2011
RL78/G13 CHAPTER 2 PIN FUNCTIONS
(1/2)
Function Name I/O Function After Reset Alternate Function
Remark Functions in parentheses in the above figure can be assigned via settings in the peripheral I/O redirection
register (PIOR).
R01UH0146EJ0100 Rev.1.00 60
Sep 22, 2011
RL78/G13 CHAPTER 2 PIN FUNCTIONS
(2/2)
Function Name I/O Function After Reset Alternate Function
P50 I/O Port 5. Input port INTP1/SI11/SDA11
P51 2-bit I/O port. INTP2/SO11
Output of P50 can be set to N-ch open-drain output (VDD
tolerance).
Input/output can be specified in 1-bit units.
Use of an on-chip pull-up resistor can be specified by a
software setting.
P60 I/O Port 6. Input port SCLA0
P61 4-bit I/O port. SDAA0
Output of P60 to P63 can be set to N-ch open-drain output (6
P62 −
V tolerance).
P63 Input/output can be specified in 1-bit units. −
Remark Functions in parentheses in the above figure can be assigned via settings in the peripheral I/O redirection
register (PIOR).
R01UH0146EJ0100 Rev.1.00 61
Sep 22, 2011
RL78/G13 CHAPTER 2 PIN FUNCTIONS
Remark Functions in parentheses in the above figure can be assigned via settings in the peripheral I/O redirection
register (PIOR).
R01UH0146EJ0100 Rev.1.00 62
Sep 22, 2011
RL78/G13 CHAPTER 2 PIN FUNCTIONS
(2/2)
Function Name I/O Function After Reset Alternate Function
P50 I/O Port 5. Input port INTP1/SI11/SDA11
P51 6-bit I/O port. INTP2/SO11
Output of P50 can be set to N-ch open-drain output (VDD
P52 (INTP10)
tolerance).
P53 Input/output can be specified in 1-bit units. (INTP11)
P54 Use of an on-chip pull-up resistor can be specified by a −
software setting.
P55 (PCLBUZ1)/(SCK00)
P60 I/O Port 6. Input port SCLA0
P61 4-bit I/O port. SDAA0
Output of P60 to P63 can be set to N-ch open-drain output (6
P62 −
V tolerance).
P63 Input/output can be specified in 1-bit units. −
Remark Functions in parentheses in the above figure can be assigned via settings in the peripheral I/O redirection
register (PIOR).
R01UH0146EJ0100 Rev.1.00 63
Sep 22, 2011
RL78/G13 CHAPTER 2 PIN FUNCTIONS
Remark Functions in parentheses in the above figure can be assigned via settings in the peripheral I/O redirection
register (PIOR).
R01UH0146EJ0100 Rev.1.00 64
Sep 22, 2011
RL78/G13 CHAPTER 2 PIN FUNCTIONS
(2/3)
Function Name I/O Function After Reset Alternate Function
P40 I/O Port 4. Input port TOOL0
P41 6-bit I/O port. TI07/TO07
Input of P43 and P44 can be set to TTL input buffer.
P42 TI04/TO04
Output of P43 to P45 can be set to N-ch open-drain output
P43 (VDD tolerance). SCK01/SCL01
P44 Input/output can be specified in 1-bit units. SI01/SDA01
Use of an on-chip pull-up resistor can be specified by a
P45 SO01
software setting.
P50 I/O Port 5. Input port INTP1/SI11/SDA11
Remark Functions in parentheses in the above figure can be assigned via settings in the peripheral I/O redirection
register (PIOR).
R01UH0146EJ0100 Rev.1.00 65
Sep 22, 2011
RL78/G13 CHAPTER 2 PIN FUNCTIONS
(3/3)
Function Name I/O Function After Reset Alternate Function
P130 Output Port 13. Output port −
P137 Input 1-bit output port and 1-bit input port. Input port INTP0
P140 I/O Port 14. Input port PCLBUZ0/INTP6
P141 7-bit I/O port. PCLBUZ1/INTP7
Input of P142 and P143 can be set to TTL input buffer.
P142 SCK30/SCL30
Output of P142 to P144 can be set to N-ch open-drain output
P143 (VDD tolerance). SI30/RxD3/SDA30
P144 P147 can be set to analog input. SO30/TxD3
Input/output can be specified in 1-bit units.
P146 −
Use of an on-chip pull-up resistor can be specified by a
P147 software setting. Analog input ANI18
port
P150 I/O Port 15. Analog input ANI8
P151 4-bit I/O port. port ANI9
Input/output can be specified in 1-bit units.
P152 ANI10
P153 ANI11
R01UH0146EJ0100 Rev.1.00 66
Sep 22, 2011
RL78/G13 CHAPTER 2 PIN FUNCTIONS
Remark Functions in parentheses in the above figure can be assigned via settings in the peripheral I/O redirection
register (PIOR).
R01UH0146EJ0100 Rev.1.00 67
Sep 22, 2011
RL78/G13 CHAPTER 2 PIN FUNCTIONS
(2/3)
Function Name I/O Function After Reset Alternate Function
P40 I/O Port 4. Input port TOOL0
P41 8-bit I/O port. −
Input of P43 and P44 can be set to TTL input buffer.
P42 TI04/TO04
Output of P43 to P45 can be set to N-ch open-drain output
P43 (VDD tolerance). SCK01/SCL01
P44 Input/output can be specified in 1-bit units. SI01/SDA01
Use of an on-chip pull-up resistor can be specified by a
P45 SO01
software setting.
P46 INTP1/TI05/TO05
P47 INTP2
P50 I/O Port 5. Input port SI11/SDA11
P51 8-bit I/O port. SO11
Input of P53 to P55 can be set to TTL input buffer.
P52 SO31
Output of P50, P52 to P55 can be set to N-ch open-drain
P53 output (VDD tolerance). SI31/SDA31
P54 Input/output can be specified in 1-bit units. SCK31/SCL31
Use of an on-chip pull-up resistor can be specified by a
P55 (PCLBUZ1)/(SCK00)
software setting.
P56 (INTP1)
P57 (INTP3)
P60 I/O Port 6. Input port SCLA0
P61 8-bit I/O port. SDAA0
Output of P60 to P63 can be set to N-ch open-drain output (6
P62 SCLA1
V tolerance).
P63 Input/output can be specified in 1-bit units. SDAA1
P64 For P64 to P67, use of an on-chip pull-up resistor can be TI10/TO10
specified by a software setting.
P65 TI11/TO11
P66 TI12/TO12
P67 TI13/TO13
P70 I/O Port 7. Input port KR0/SCK21/SCL21
P71 8-bit I/O port. KR1/SI21/SDA21
Output of P71 and P74 can be set to N-ch open-drain output
P72 KR2/SO21
(VDD tolerance).
P73 Input/output can be specified in 1-bit units. KR3
P74 Use of an on-chip pull-up resistor can be specified by a KR4/INTP8
software setting.
P75 KR5/INTP9
P76 KR6/INTP10/(RxD2)
P77 KR7/INTP11/(TxD2)
P80 I/O Port 8. Input port (SCK10)/(SCL10)
P81 8-bit I/O port. (SI10)/(RxD1)/(SDA10)
Input of P80 and P81 can be set to TTL input buffer.
P82 (SO10)/(TxD1)
Output of P80 to P82 can be set to N-ch open-drain output
P83 (VDD tolerance). −
P84 Input/output can be specified in 1-bit units. (INTP6)
Use of an on-chip pull-up resistor can be specified by a
P85 (INTP7)
software setting.
P86 (INTP8)
P87 (INTP9)
Remark Functions in parentheses in the above figure can be assigned via settings in the peripheral I/O redirection
register (PIOR).
R01UH0146EJ0100 Rev.1.00 68
Sep 22, 2011
RL78/G13 CHAPTER 2 PIN FUNCTIONS
(3/3)
Function Name I/O Function After Reset Alternate Function
P100 I/O Port 10. Analog input ANI20
3-bit I/O port. port
P101 P100 can be set to analog input. Input port −
P102 TI06/TO06
P110 I/O Port 11. Input port (INTP10)
P111 2-bit I/O port. (INTP11)
P120 I/O Port 12. Analog input ANI19
1-bit I/O port and 4-bit input port. port
P121 Input P120 can be set to analog input. Input port X1
For only P120, input/output can be specified in 1-bit units.
P122 X2/EXCLK
For only P120, use of an on-chip pull-up resistor can be
P123 specified by a software setting. XT1
P124 XT2/EXCLKS
P130 Output Port 13. Output port −
P137 Input 1-bit output port and 1-bit input port. Input port INTP0
P140 I/O Port 14. Input port PCLBUZ0/INTP6
P141 8-bit I/O port. PCLBUZ1/INTP7
Input of P142 and P143 can be set to TTL input buffer.
P142 SCK30/SCL30
Output of P142 to P144 can be set to N-ch open-drain output
P143 (VDD tolerance). SI30/RxD3/SDA30
P144 P147 can be set to analog input. SO30/TxD3
Input/output can be specified in 1-bit units.
P145 TI07/TO07
Use of an on-chip pull-up resistor can be specified by a
P146 software setting. (INTP4)
P147 Analog input ANI18
port
P150 I/O Port 15. Analog input ANI8
P151 7-bit I/O port. port ANI9
Input/output can be specified in 1-bit units.
P152 ANI10
P153 ANI11
P154 ANI12
P155 ANI13
P156 ANI14
Remark Functions in parentheses in the above figure can be assigned via settings in the peripheral I/O redirection
register (PIOR).
R01UH0146EJ0100 Rev.1.00 69
Sep 22, 2011
RL78/G13 CHAPTER 2 PIN FUNCTIONS
Remark Functions in parentheses in the above figure can be assigned via settings in the peripheral I/O redirection
register (PIOR).
R01UH0146EJ0100 Rev.1.00 70
Sep 22, 2011
RL78/G13 CHAPTER 2 PIN FUNCTIONS
(2/4)
Function Name I/O Function After Reset Alternate Function
P30 I/O Port 3. Input port INTP3/RTC1HZ
P31 8-bit I/O port. TI03/TO03/INTP4/
P35 to P37 can be set to analog input. (PCLBUZ0)
Input/output can be specified in 1-bit units.
P32 −
Use of an on-chip pull-up resistor can be specified by a
P33 software setting. −
P34 −
P35 Analog input ANI23
P36 port ANI22
P37 ANI21
P40 I/O Port 4. Input port TOOL0
P41 8-bit I/O port. −
Input of P43 and P44 can be set to TTL input buffer.
P42 TI04/TO04
Output of P43 to P45 can be set to N-ch open-drain output
P43 (VDD tolerance). SCK01/SCL01
P44 Input/output can be specified in 1-bit units. SI01/SDA01
Use of an on-chip pull-up resistor can be specified by a
P45 SO01
software setting.
P46 INTP1/TI05/TO05
P47 INTP2
P50 I/O Port 5. Input port −
P51 8-bit I/O port. −
Input of P53 to P55 can be set to TTL input buffer.
P52 SO31
Output of P50, P52 to P55 can be set to N-ch open-drain
P53 output (VDD tolerance). SI31/SDA31
P54 Input/output can be specified in 1-bit units. SCK31/SCL31
Use of an on-chip pull-up resistor can be specified by a
P55 (PCLBUZ1)/(SCK00)
software setting.
P56 (INTP1)
P57 (INTP3)
P60 I/O Port 6. Input port SCLA0
P61 8-bit I/O port. SDAA0
Output of P60 to P63 can be set to N-ch open-drain output (6
P62 SCLA1
V tolerance).
P63 Input/output can be specified in 1-bit units. SDAA1
P64 For P64 to P67, use of an on-chip pull-up resistor can be TI10/TO10
specified by a software setting.
P65 TI11/TO11
P66 TI12/TO12
P67 TI13/TO13
Remark Functions in parentheses in the above figure can be assigned via settings in the peripheral I/O redirection
register (PIOR).
R01UH0146EJ0100 Rev.1.00 71
Sep 22, 2011
RL78/G13 CHAPTER 2 PIN FUNCTIONS
(3/4)
Function Name I/O Function After Reset Alternate Function
P70 I/O Port 7. Input port KR0/SCK21/SCL21
P71 8-bit I/O port. KR1/SI21/SDA21
Output of P71 and P74 can be set to N-ch open-drain output
P72 KR2/SO21
(VDD tolerance).
P73 Input/output can be specified in 1-bit units. KR3
P74 Use of an on-chip pull-up resistor can be specified by a KR4/INTP8
software setting.
P75 KR5/INTP9
P76 KR6/INTP10/(RxD2)
P77 KR7/INTP11/(TxD2)
P80 I/O Port 8. (SCK10)/(SCL10)
P81 8-bit I/O port. (SI10)/(RxD1)/(SDA10)
Input of P80 and P81 can be set to TTL input buffer.
P82 (SO10)/(TxD1)
Output of P80 to P82 can be set to N-ch open-drain output
P83 (VDD tolerance). −
P84 Input/output can be specified in 1-bit units. (INTP6)
Use of an on-chip pull-up resistor can be specified by a
P85 (INTP7)
software setting.
P86 (INTP8)
P87 (INTP9)
P90 I/O Port 9. Input port −
P91 8-bit I/O port. −
Output of P96 can be set to N-ch open-drain output (VDD
P92 −
tolerance).
P93 Input/output can be specified in 1-bit units. −
P94 Use of an on-chip pull-up resistor can be specified by a −
software setting.
P95 SCK11/SCL11
P96 SI11/SDA11
P97 SO11
P100 I/O Port 10. Analog input ANI20
7-bit I/O port. port
P101 P100 can be set to analog input. Input port −
Input/output can be specified in 1-bit units.
P102 TI06/TO06
Use of an on-chip pull-up resistor can be specified by a
P103 software setting. TI14/TO14
P104 TI15/TO15
P105 TI16/TO16
P106 TI17/TO17
P110 I/O Port 11. Input port (INTP10)
P111 8-bit I/O port. (INTP11)
P115 to P117 can be set to analog input.
P112 −
Input/output can be specified in 1-bit units.
P113 Use of an on-chip pull-up resistor can be specified by a −
P114 software setting. −
P115 Analog input ANI26
P116 port ANI25
P117 ANI24
Remark Functions in parentheses in the above figure can be assigned via settings in the peripheral I/O redirection
register (PIOR).
R01UH0146EJ0100 Rev.1.00 72
Sep 22, 2011
RL78/G13 CHAPTER 2 PIN FUNCTIONS
(4/4)
Function Name I/O Function After Reset Alternate Function
P120 I/O Port 12. Analog input ANI19
4-bit I/O port and 4-bit input port. port
P121 Input P120 can be set to analog input. Input port X1
For only P120, P125 to P127, input/output can be specified in
P122 X2/EXCLK
1-bit units.
P123 For only P120, P125 to P127, use of an on-chip pull-up XT1
P124 resistor can be specified by a software setting. XT2/EXCLKS
P125 I/O −
P126 −
P127 −
P130 Output Port 13. Output port −
P137 Input 1-bit output port and 1-bit input port. Input port INTP0
P140 I/O Port 14. Input port PCLBUZ0/INTP6
P141 8-bit I/O port. PCLBUZ1/INTP7
Input of P142 and P143 can be set to TTL input buffer.
P142 SCK30/SCL30
Output of P142 to P144 can be set to N-ch open-drain output
P143 (VDD tolerance). SI30/RxD3/SDA30
P144 P147 can be set to analog input. SO30/TxD3
Input/output can be specified in 1-bit units.
P145 TI07/TO07
Use of an on-chip pull-up resistor can be specified by a
P146 software setting. (INTP4)
P147 Analog input ANI18
port
P150 I/O Port 15. Analog input ANI8
P151 7-bit I/O port. port ANI9
Input/output can be specified in 1-bit units.
P152 ANI10
P153 ANI11
P154 ANI12
P155 ANI13
P156 ANI14
Remark Functions in parentheses in the above figure can be assigned via settings in the peripheral I/O redirection
register (PIOR).
R01UH0146EJ0100 Rev.1.00 73
Sep 22, 2011
RL78/G13 CHAPTER 2 PIN FUNCTIONS
2.1.15 Pins for each product (pins other than port pins)
(1/6)
Function I/O Function 128- 100 80- 64- 52- 48- 44- 40- 36- 32- 30- 25- 24- 20-
Name pin -pin pin pin pin pin pin pin pin pin pin pin pin pin
R01UH0146EJ0100 Rev.1.00 74
Sep 22, 2011
RL78/G13 CHAPTER 2 PIN FUNCTIONS
(2/6)
Function I/O Function 128- 100 80- 64- 52- 48- 44- 40- 36- 32- 30- 25- 24- 20-
Name pin -pin pin pin pin pin pin pin pin pin pin pin pin pin
R01UH0146EJ0100 Rev.1.00 75
Sep 22, 2011
RL78/G13 CHAPTER 2 PIN FUNCTIONS
(3/6)
Function I/O Function 128- 100 80- 64- 52- 48- 44- 40- 36- 32- 30- 25- 24- 20-
Name pin -pin pin pin pin pin pin pin pin pin pin pin pin pin
R01UH0146EJ0100 Rev.1.00 76
Sep 22, 2011
RL78/G13 CHAPTER 2 PIN FUNCTIONS
(4/6)
Function I/O Function 128- 100 80- 64- 52- 48- 44- 40- 36- 32- 30- 25- 24- 20-
Name pin -pin pin pin pin pin pin pin pin pin pin pin pin pin
Remark Functions in parentheses in the above figure can be assigned via settings in the peripheral I/O redirection
register (PIOR).
R01UH0146EJ0100 Rev.1.00 77
Sep 22, 2011
RL78/G13 CHAPTER 2 PIN FUNCTIONS
(5/6)
Function I/O Function 128- 100 80- 64- 52- 48- 44- 40- 36- 32- 30- 25- 24- 20-
Name pin -pin pin pin pin pin pin pin pin pin pin pin pin pin
R01UH0146EJ0100 Rev.1.00 78
Sep 22, 2011
RL78/G13 CHAPTER 2 PIN FUNCTIONS
(6/6)
Function I/O Function 128- 100 80- 64- 52- 48- 44- 40- 36- 32- 30- 25- 24- 20-
Name pin -pin pin pin pin pin pin pin pin pin pin pin pin pin
R01UH0146EJ0100 Rev.1.00 79
Sep 22, 2011
RL78/G13 CHAPTER 2 PIN FUNCTIONS
Remark The pins mounted depend on the product. See 1.3 Pin Configuration (Top View) and 2.1 Pin Function
List.
(b) SI10
This is a serial data input pin of serial interface CSI10.
(c) SO10
This is a serial data output pin of serial interface CSI10.
(d) SCK10
This is a serial clock I/O pin of serial interface CSI10.
(e) TxD1
This is a serial data output pin of serial interface UART1.
(f) RxD1
This is a serial data input pin of serial interface UART1.
(g) SDA10
This is a serial data I/O pin of serial interface IIC10.
R01UH0146EJ0100 Rev.1.00 80
Sep 22, 2011
RL78/G13 CHAPTER 2 PIN FUNCTIONS
(h) SCL10
This is a serial clock output pin of serial interface IIC10.
(a) INTP5
This is an external interrupt request input pin for which the valid edge (rising edge, falling edge, or both rising and
falling edges) can be specified.
R01UH0146EJ0100 Rev.1.00 81
Sep 22, 2011
RL78/G13 CHAPTER 2 PIN FUNCTIONS
(i) TOOLTxD
This UART serial data output pin for an external device connection is used during flash memory programming.
(j) TOOLRxD
This UART serial data input pin for an external device connection is used during flash memory programming.
(m) PCLBUZ1
This is the clock/buzzer output pin.
(b) AVREFP
This is a pin that inputs the A/D converter reference potential (+ side).
(c) AVREFM
This is a pin that inputs the A/D converter reference potential (−side).
R01UH0146EJ0100 Rev.1.00 82
Sep 22, 2011
RL78/G13 CHAPTER 2 PIN FUNCTIONS
(b) RTC1HZ
This is a real-time clock correction clock (1 Hz) output pin.
(c) SCK11
This is a serial clock I/O pin of serial interface CSI11.
(d) SCL11
This is a serial clock output pin of serial interface IIC11.
(e) TI03
This is a pin for inputting an external count clock/capture trigger to 16-bit timer 03.
(f) TO03
This is a timer output pin from 16-bit timer 03.
(g) PCLBUZ0
This is a clock/buzzer output pin.
R01UH0146EJ0100 Rev.1.00 83
Sep 22, 2011
RL78/G13 CHAPTER 2 PIN FUNCTIONS
(c) TOOL0
This is a data I/O pin for a flash memory programmer/debugger.
Be sure to pull up this pin externally when on-chip debugging is enabled (pulling it down is prohibited).
(e) SCK01
This is a serial clock I/O pin of serial interface CSI01.
(f) SCL01
This is a serial clock output pin of serial interface IIC01.
(g) SDA01
This is a serial data I/O pin of serial interface IIC01.
(h) SI01
This is a serial data input pin of serial interface CSI01.
(i) SO01
This is a serial data output pin of serial interface CSI01.
Caution After reset release, the relationships between P40/TOOL0 and the operating mode are as follows.
For details, see 25. 5 Programming Method.
Table 2-2. Relationships Between P40/TOOL0 and Operation Mode After Reset Release
R01UH0146EJ0100 Rev.1.00 84
Sep 22, 2011
RL78/G13 CHAPTER 2 PIN FUNCTIONS
(e) SCK31
This is a serial clock I/O pin of serial interface CSI31.
(f) SCL31
This is a serial clock output pin of serial interface IIC31.
R01UH0146EJ0100 Rev.1.00 86
Sep 22, 2011
RL78/G13 CHAPTER 2 PIN FUNCTIONS
(a) SI11
This is a serial data input pin of serial interface CSI11.
(b) SO11
This is a serial data output pin of serial interface CSI11.
(c) SCK11
This is a serial clock I/O pin of serial interface CSI11.
(d) SCL11
This is a serial clock output pin of serial interface IIC11.
(e) SDA11
This is a serial data I/O pin of serial interface IIC11.
R01UH0146EJ0100 Rev.1.00 87
Sep 22, 2011
RL78/G13 CHAPTER 2 PIN FUNCTIONS
(a) ANI20
This is an analog input pin (ANI20) of A/D converter.
When using this pin as analog input pin, see Figure 11-46. Analog Input Pin Connection.
R01UH0146EJ0100 Rev.1.00 88
Sep 22, 2011
RL78/G13 CHAPTER 2 PIN FUNCTIONS
(a) ANI19
This is an analog input pin of A/D converter.
When using this pin as analog input pin, see Figure 11-46. Analog Input Pin Connection.
(b) X1, X2
These are the pins for connecting a resonator for main system clock.
(c) EXCLK
This is an external clock input pin for main system clock.
(e) EXCLKS
This is an external clock input pin for subsystem clock.
(a) INTP0
This is an external interrupt request input pin for which the valid edge (rising edge, falling edge, or both rising and
falling edges) can be specified.
R01UH0146EJ0100 Rev.1.00 89
Sep 22, 2011
RL78/G13 CHAPTER 2 PIN FUNCTIONS
<R> When the P147 pin is used as input, specify them as either digital or analog in Port mode control register 14 (PMC14).
This register can be specified in 1-bit unit.
(a) ANI18
This is an analog input pin of A/D converter.
When using this pin as analog input pin, see Figure 11-46. Analog Input Pin Connection.
(d) RxD3
This is a serial data input pin of serial interface UART3.
(e) SCK30
This is a serial clock I/O pin of serial interface CSI30.
(f) SCL30
This is a serial clock Output pin of serial interface IIC30.
(g) SDA30
This is a serial data I/O pin of serial interface IIC30.
(h) SI30
This is a serial data input pin of serial interface CSI30.
(i) SO30
This is a serial data output pin of serial interface CSI30.
(j) TI07
This is a pin for inputting an external count clock/capture trigger to 16-bit timer 07.
(k) TO07
This is a timer output pin of 16-bit timer 07.
(l) TxD3
This is a serial data output pin of serial interface UART3.
R01UH0146EJ0100 Rev.1.00 90
Sep 22, 2011
RL78/G13 CHAPTER 2 PIN FUNCTIONS
<R> Remark Use bypass capacitors (about 0.1 μ F) as noise and latch up countermeasures with relatively thick
wires at the shortest distance to VDD to VSS, EVDD0 to EVSS0 and EVDD1 to EVSS1 lines.
2.2.18 RESET
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 VDD.
When the external reset pin is used, design the circuit based on VDD.
2.2.19 REGC
<R> This is the pin for connecting regulator output stabilization capacitance for internal operation. Connect this pin to VSS
via a capacitor (0.47 to 1 μF).
Also, use a capacitor with good characteristics, since it is used to stabilize internal voltage.
REGC
VSS
Caution Keep the wiring length as short as possible for the broken-line part in the above figure.
R01UH0146EJ0100 Rev.1.00 91
Sep 22, 2011
RL78/G13 CHAPTER 2 PIN FUNCTIONS
Table 2-3 shows the types of pin I/O circuits and the recommended connections of unused pins.
Pin Name I/O Circuit Type I/O Recommended Connection of Unused Pins
P00/TI00 8-R I/O Input: Independently connect to EVDD0, EVDD1 or EVSS0, EVSS1
P01/TO00 5-AN via a resistor.
Output: Leave open.
P02/ANI17/SO10/TxD1 11-U
P03/ANI16/SI10/RxD1/ 11-V
SDA10
P04/SCK10/SCL10 5-AN
P05 8-R
P06
P07
P10/SCK00/SCL00/(TI07)/(T 5-AN
O07)
P11/SI00/RxD0/
TOOLRxD/SDA00/(TI06)/
(TO06)
P12/SO00/TxD0/ 8-R
TOOLTxD/(INTP5)/(TI05)/
(TO05)
P13/TxD2/SO20/(SDAA0)/(TI 5-AN
04)/(TO04)
P14/RxD2/SI20/SDA20/
(SCLA0)/(TI03)/(TO03)
P15/SCK20/SCL20/(TI02)/(T
O02)
P16/TI01/TO01/INTP5/
(SI00)/(RxD0)
P17/TI02/TO02/(SO00)/
(TxD0)
P20/ANI0/AVREFP 11-T Input: Independently connect to VDD or VSS via a resistor.
P21/ANI1/AVREFM Output: Leave open.
P22/ANI2 11-G
P23/ANI3
P24/ANI4
P25/ANI5
P26/ANI6
P27/ANI7
Remarks 1. With products not provided with an EVDD0, EVDD1, EVSS0, or EVSS1 pin, replace EVDD0 and EVDD1 with VDD, or
replace EVSS0 and EVSS1 with VSS.
2. Functions in parentheses in the above figure can be assigned via settings in the peripheral I/O redirection
register (PIOR).
R01UH0146EJ0100 Rev.1.00 92
Sep 22, 2011
RL78/G13 CHAPTER 2 PIN FUNCTIONS
Pin Name I/O Circuit Type I/O Recommended Connection of Unused Pins
P30/INTP3/RTC1HZ 8-R I/O Input: Independently connect to EVDD0, EVDD1 or EVSS0, EVSS1
P31/TI03/TO03/INTP4/ via a resistor.
(PCLBUZ0) Output: Leave open.
P32
P33
P34
P35/ANI23 11-U
P36/ANI22
P37/ANI21
P40/TOOL0 8-R Input: Independently connect to EVDD0, EVDD1 or leave open.
Output: Leave open.
P41 Input: Independently connect to EVDD0, EVDD1 or EVSS0, EVSS1
P42/TI04/TO04 via a resistor.
Output: Leave open.
P43/SCK01/SCL01 5-AN
P44/SI01/SDA01
P45/SO01 8-R
P46/INTP1/TI05/TO05
P47/INTP2
P50
P51
P52/SO31
P53/SI31/SDA31 5-AN
P54/SCK31/SCL31
P55/(PCLBUZ1)/(SCK00)
P56/(INTP1) 8-R
P57/(INTP3)
P60/SCLA0 13-R
P61/SDAA0
P62/SCLA1
P63/SDAA1
P64/TI10/TO10 8-R
P65/TI11/TO11
P66/TI12/TO12
P67/TI13/TO13
Remarks 1. With products not provided with an EVDD0, EVDD1, EVSS0, or EVSS1 pin, replace EVDD0 and EVDD1 with VDD, or
replace EVSS0 and EVSS1 with VSS.
2. Functions in parentheses in the above figure can be assigned via settings in the peripheral I/O redirection
register (PIOR).
3. For 64-pin products, I/O circuit type for P43, P53 and P54 pins is 8-R.
R01UH0146EJ0100 Rev.1.00 93
Sep 22, 2011
RL78/G13 CHAPTER 2 PIN FUNCTIONS
Pin Name I/O Circuit Type I/O Recommended Connection of Unused Pins
P70/KR0/SCK21/SCL21 8-R I/O Input: Independently connect to EVDD0, EVDD1 or EVSS0, EVSS1
P71/KR1/SI21/SDA21 via a resistor.
Output: Leave open.
P72/KR2/SO21
P73/KR3
P74/KR4/INTP8
P75/KR5/INTP9
P76/KR6/INTP10/(RxD2)
P77/KR7/INTP11/(TxD2)
P80/(SCK10)/(SCL10) 5-AN
P81/(SI10)/(RxD1)/
(SDA10)
P82/(SO10)/(TxD1) 8-R
P83
P84/(INTP6)
P85/(INTP7)
P86/(INTP8)
P87/(INTP9)
P90 8-R
P91
P92
P93
P94
P95/SCK11/SCL11
P96/SI11/SDA11
P97/SO11
P100/ANI20 11-U
P101 8-R
P102/TI06/TO06
P103/TI14/TO14
P104/TI15/TO15
P105/TI16/TO16
P106/TI17/TO17
P110/(INTP10)
P111/(INTP11)
P112
P113
P114
Remarks 1. With products not provided with an EVDD0, EVDD1, EVSS0, or EVSS1 pin, replace EVDD0 and EVDD1 with VDD, or
replace EVSS0 and EVSS1 with VSS.
2. Functions in parentheses in the above figure can be assigned via settings in the peripheral I/O redirection
register (PIOR).
R01UH0146EJ0100 Rev.1.00 94
Sep 22, 2011
RL78/G13 CHAPTER 2 PIN FUNCTIONS
Pin Name I/O Circuit Type I/O Recommended Connection of Unused Pins
P115/ANI26 11-U I/O Input: Independently connect to EVDD0, EVDD1 or EVSS0, EVSS1
P116/ANI25 via a resistor.
Output: Leave open.
P117/ANI24
P120/ANI19
P121/X1 37-C Input Independently connect to VDD or VSS via a resistor.
P122/X2/EXCLK
P123/XT1
P124/XT2/EXCLKS
P125 8-R I/O Input: Independently connect to EVDD0, EVDD1 or EVSS0, EVSS1
P126 via a resistor.
Output: Leave open.
P127
P130 3-C Output Leave open.
P137/INTP0 2 Input Independently connect to VDD or VSS via a resistor.
P140/PCLBUZ0/INTP6 8-R I/O Input: Independently connect to EVDD0, EVDD1 or EVSS0, EVSS1
P141/PCLBUZ1/INTP7 via a resistor.
Output: Leave open.
P142/SCK30/SCL30 5-AN
P143/SI30/RxD3/SDA30
P144/SO30/TxD3 8-R
P145/TI07/TO07
P146/(INTP4)
P147/ANI18 11-U
P150/ANI8 11-G Input: Independently connect to VDD or VSS via a resistor.
P151/ANI9 Output: Leave open.
P152/ANI10
P153/ANI11
P154/ANI12
P155/ANI13
P156/ANI14
RESET 2 Input Connect directly or via a resistor to VDD.
REGC − − Connect to VSS via capacitor (0.47 to 1 μF).
Remarks 1. With products not provided with an EVDD0, EVDD1, EVSS0, or EVSS1 pin, replace EVDD0 and EVDD1 with VDD, or
replace EVSS0 and EVSS1 with VSS.
2. Functions in parentheses in the above figure can be assigned via settings in the peripheral I/O redirection
register (PIOR).
R01UH0146EJ0100 Rev.1.00 95
Sep 22, 2011
RL78/G13 CHAPTER 2 PIN FUNCTIONS
EVDD
P-ch
IN
data OUT
N-ch
Schmitt-triggered input with hysteresis characteristics
EVSS
EVDD
EVDD
pull-up
enable P-ch
EVDD pullup
enable P-ch
data P-ch
IN/OUT EVDD
output N-ch
disable data
P-ch
EVSS
IN/OUT
CMOS
output N-ch
disable
EVSS
TTL
input
characteristic
X2, XT2
IN/OUT input
data enable
N-ch amp
output disable enable
N-ch
P-ch
EVSS
X1, XT1
input
enable
R01UH0146EJ0100 Rev.1.00 96
Sep 22, 2011
RL78/G13 CHAPTER 2 PIN FUNCTIONS
data
P-ch
VDD
IN/OU
data
P-ch output N-ch
disable
IN/OU
VSS
output N-ch
disable
P-ch
VSS Comparator
+
_
N-ch
Comparator P-ch
input enable
input enable
P-ch
AVREFP, AVREFM
N-ch
EVDD pull-up
enable P-ch
pull-up EVDD
enable P-ch
EVDD data P-ch
data P-ch IN/OUT
output N-ch
IN/OUT
disable
output N-ch
disable EVSS
EVSS CMOS
input enable
TTL
input
characteristic
Comparator P-ch
+
P-ch
_ Comparator
N-ch
+
_
Series resistor string voltage
N-ch
VSS
Series resistor string voltage
VSS
R01UH0146EJ0100 Rev.1.00 97
Sep 22, 2011
RL78/G13 CHAPTER 3 CPU ARCHITECTURE
Products in the RL78/G13 can access a 1 MB memory space. Figures 3-1 to 3-10 show the memory maps.
R01UH0146EJ0100 Rev.1.00 98
Sep 22, 2011
RL78/G13 CHAPTER 3 CPU ARCHITECTURE
FFFFFH 03FFFH
Special function register (SFR)
256 bytes
FFF00H
FFEFFH General-purpose register
FFEE0H 32 bytes
FFEDFH
RAMNote 1
FF700H 2 KB Program area
FF6FFH
Reserved
F4000H
F3FFFH
Mirror 01FFFH
8 KB
F2000H
F1FFFH 010CEH
Data flash memoryNote 4
010CDH On-chip debug security
F1000H 4 KB
ID setting areaNote 2
F0FFFH
Reserved 010C4H 10 bytes
F0800H 010C3H Option byte areaNote 2
F07FFH 010C0H 4 bytes
Special function register (2nd SFR) 010BFH Boot cluster 1
2 KB CALLT table area
Data memory 64 bytes
space F0000H 01080H
EFFFFH 0107FH
01000H
00FFFH
000CEH
000CDH On-chip debug security
ID setting areaNote 2
000C4H 10 bytes
000C3H Option byte areaNote 2 Boot cluster 0Note 3
000C0H 4 bytes
000BFH
CALLT table area
64 bytes
00080H
0007FH
Notes 1. Instructions can be executed from the RAM area excluding the general-purpose register area.
2. 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.
3. Writing boot cluster 0 can be prohibited depending on the setting of security (see 25.6 Security Setting).
4. R5F100xA only.
Caution When executing instructions from the RAM area while RAM parity error resets are enabled (RPERDIS
= 1), be sure to initialize the used RAM area + 10 bytes.
R01UH0146EJ0100 Rev.1.00 99
Sep 22, 2011
RL78/G13 CHAPTER 3 CPU ARCHITECTURE
FFFFFH 07FFFH
Special function register (SFR)
256 bytes
FFF00H
FFEFFH General-purpose register
32 bytes
FFEE0H
FFEDFH
RAMNote 1
Program area
2 KB
FF700H
FF6FFH
Reserved
F8000H
F7FFFH
Mirror 01FFFH
24 KB
F2000H
F1FFFH Data flash memoryNote 4 010CEH
4 KB 010CDH On-chip debug security
F1000H
F0FFFH ID setting areaNote 2
Reserved 010C4H 10 bytes
F0800H 010C3H
F07FFH Option byte areaNote 2
010C0H 4 bytes
Special function register (2nd SFR) 010BFH Boot cluster 1
2 KB CALLT table area
Data memory 64 bytes
space F0000H 01080H
EFFFFH 0107FH
01000H
00FFFH
Reserved
Program area
000CEH
000CDH On-chip debug security
ID setting areaNote 2
000C4H 10 bytes
000C3H Option byte areaNote 2 Boot cluster 0Note 3
000C0H 4 bytes
000BFH
CALLT table area
64 bytes
00080H
0007FH
08000H
Vector table area
07FFFH
Program 128 bytes
Code flash memory
memory 32KB
space
00000H 00000H
Notes 1. Instructions can be executed from the RAM area excluding the general-purpose register area.
2. 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.
3. Writing boot cluster 0 can be prohibited depending on the setting of security (see 25.6 Security Setting).
4. R5F100xC only.
Caution When executing instructions from the RAM area while RAM parity error resets are enabled (RPERDIS
= 1), be sure to initialize the used RAM area + 10 bytes.
FFFFFH 0BFFFH
Special function register (SFR)
256 bytes
FFF00H
FFEFFH General-purpose register
32 bytes
FFEE0H
FFEDFH
RAMNotes 1, 2
3 KB Program area
FF300H
FF2FFH
Reserved
FC000H
FBFFFH
Mirror 01FFFH
40 KB
F2000H
F1FFFH Data flash memoryNote 5 010CEH
010CDH On-chip debug security
F1000H 4 KB
F0FFFH ID setting areaNote 3
Reserved 010C4H 10 bytes
F0800H 010C3H
F07FFH Option byte areaNote 3
010C0H 4 bytes
Special function register (2nd SFR) 010BFH Boot cluster 1
2 KB CALLT table area
Data memory 64 bytes
space F0000H 01080H
EFFFFH 0107FH
01000H
00FFFH
Reserved
Program area
000CEH
000CDH On-chip debug security
ID setting areaNote 3
000C4H 10 bytes
000C3H Option byte areaNote 3 Boot cluster 0Note 4
000C0H 4 bytes
000BFH
CALLT table area
64 bytes
00080H
0007FH
0C000H
0BFFFH
Program Vector table area
Code flash memory 128 bytes
memory 48 KB
space
00000H 00000H
<R> Notes 1. Use of the area FF300H to FF309H is prohibited when using the self-programming function and data flash
function, because this area is used for self-programming library.
2. Instructions can be executed from the RAM area excluding the general-purpose register area.
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.
4. Writing boot cluster 0 can be prohibited depending on the setting of security (see 25.6 Security Setting).
5. R5F100xD only.
Caution When executing instructions from the RAM area while RAM parity error resets are enabled (RPERDIS
= 1), be sure to initialize the used RAM area + 10 bytes.
FFFFFH 0FFFFH
Special function register (SFR)
256 bytes
FFF00H
FFEFFH General-purpose register
32 bytes
FFEE0H
FFEDFH
RAMNotes 1, 2 Program area
4 KB
FEF00H
FEEFFH
Mirror
51.75 KB
01FFFH
F2000H
F1FFFH Data flash memoryNote 5 010CEH
F1000H 4 KB 010CDH On-chip debug security
F0FFFH ID setting areaNote 3
Reserved 10 bytes
F0800H 010C4H
F07FFH 010C3H Option byte areaNote 3
010C0H 4 bytes
Special function register (2nd SFR) 010BFH Boot cluster 1
2 KB CALLT table area
F0000H 64 bytes
01080H
EFFFFH
Data memory 0107FH
space
Vector table area
128 bytes
01000H
00FFFH
000CEH
000CDH On-chip debug security
ID setting areaNote 3
000C4H 10 bytes
000C3H Option byte areaNote 3 Boot cluster 0Note 4
000C0H 4 bytes
000BFH
CALLT table area
64 bytes
00080H
10000H 0007FH
0FFFFH
00000H 00000H
<R> Notes 1. Use of the area FEF00H to FF309H is prohibited when using the self-programming function and data flash
function, because this area is used for self-programming library.
2. Instructions can be executed from the RAM area excluding the general-purpose register area.
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.
4. Writing boot cluster 0 can be prohibited depending on the setting of security (see 25.6 Security Setting).
5. R5F100xE only.
Caution When executing instructions from the RAM area while RAM parity error resets are enabled (RPERDIS
= 1), be sure to initialize the used RAM area + 10 bytes.
FFFFFH 17FFFH
Special function register (SFR)
256 bytes
FFF00H
FFEFFH General-purpose register
32 bytes
FFEE0H
FFEDFH
RAMNote 1 Program area
8 KB
FDF00H
FDEFFH
Mirror
43.75 KB 01FFFH
F3000H
F2FFFH Data flash memoryNote 4 010CEH
F1000H 8 KB 010CDH On-chip debug security
F0FFFH ID setting areaNote 2
Reserved 10 bytes
F0800H 010C4H
F07FFH 010C3H Option byte areaNote 2
010C0H 4 bytes
Special function register (2nd SFR) 010BFH Boot cluster 1
2 KB CALLT table area
F0000H 64 bytes
01080H
EFFFFH
Data memory 0107FH
space
Vector table area
128 bytes
01000H
00FFFH
000CEH
000CDH On-chip debug security
ID setting areaNote 2
000C4H 10 bytes
000C3H Option byte areaNote 2 Boot cluster 0Note 3
000C0H 4 bytes
000BFH
CALLT table area
64 bytes
18000H 00080H
17FFFH 0007FH
00000H 00000H
Notes 1. Instructions can be executed from the RAM area excluding the general-purpose register area.
2. 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.
3. Writing boot cluster 0 can be prohibited depending on the setting of security (see 25.6 Security Setting).
4. R5F100xF only.
Caution When executing instructions from the RAM area while RAM parity error resets are enabled (RPERDIS
= 1), be sure to initialize the used RAM area + 10 bytes.
FFFFFH 1FFFFH
Special function register (SFR)
256 bytes
FFF00H
FFEFFH General-purpose register
32 bytes
FFEE0H
FFEDFH
RAMNote 1 Program area
12 KB
FCF00H
FCEFFH
Mirror
39.75 KB 01FFFH
F3000H
F2FFFH Data flash memoryNote 4 010CEH
F1000H 8 KB 010CDH On-chip debug security
F0FFFH ID setting areaNote 2
Reserved 10 bytes
F0800H 010C4H
F07FFH 010C3H Option byte areaNote 2
010C0H 4 bytes
Special function register (2nd SFR) 010BFH Boot cluster 1
2 KB CALLT table area
F0000H 64 bytes
01080H
EFFFFH
Data memory 0107FH
space
Vector table area
128 bytes
01000H
00FFFH
000CEH
000CDH On-chip debug security
ID setting areaNote 2
000C4H 10 bytes
000C3H Option byte areaNote 2 Boot cluster 0Note 3
000C0H 4 bytes
000BFH
CALLT table area
64 bytes
20000H 00080H
1FFFFH 0007FH
00000H 00000H
Notes 1. Instructions can be executed from the RAM area excluding the general-purpose register area.
2. 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.
3. Writing boot cluster 0 can be prohibited depending on the setting of security (see 25.6 Security Setting).
4. R5F100xG only.
Caution When executing instructions from the RAM area while RAM parity error resets are enabled (RPERDIS
= 1), be sure to initialize the used RAM area + 10 bytes.
FFFFFH 2FFFFH
Special function register (SFR)
256 bytes
FFF00H
FFEFFH General-purpose register
32 bytes
FFEE0H
FFEDFH
RAMNote 1 Program area
16 KB
FBF00H
FBEFFH
Mirror
35.75 KB 01FFFH
F3000H
F2FFFH Data flash memoryNote 4 010CEH
F1000H 8 KB 010CDH On-chip debug security
F0FFFH ID setting areaNote 2
Reserved 10 bytes
F0800H 010C4H
F07FFH 010C3H Option byte areaNote 2
010C0H 4 bytes
Special function register (2nd SFR) 010BFH Boot cluster 1
2 KB CALLT table area
F0000H 64 bytes
01080H
EFFFFH
Data memory 0107FH
space
Vector table area
128 bytes
01000H
00FFFH
000CEH
000CDH On-chip debug security
ID setting areaNote 2
000C4H 10 bytes
000C3H Option byte areaNote 2 Boot cluster 0Note 3
000C0H 4 bytes
000BFH
CALLT table area
64 bytes
30000H 00080H
2FFFFH 0007FH
00000H 00000H
Notes 1. Instructions can be executed from the RAM area excluding the general-purpose register area.
2. 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.
3. Writing boot cluster 0 can be prohibited depending on the setting of security (see 25.6 Security Setting).
4. R5F100xH only.
Caution When executing instructions from the RAM area while RAM parity error resets are enabled (RPERDIS
= 1), be sure to initialize the used RAM area + 10 bytes.
FFFFFH 3FFFFH
Special function register (SFR)
256 bytes
FFF00H
FFEFFH General-purpose register
32 bytes
FFEE0H
FFEDFH
RAMNotes 1, 2 Program area
20 KB
FAF00H
FAEFFH
Mirror
31.75 KB 01FFFH
F3000H
F2FFFH Data flash memoryNote 5 010CEH
F1000H 8 KB 010CDH On-chip debug security
F0FFFH ID setting areaNote 3
Reserved 10 bytes
F0800H 010C4H
F07FFH 010C3H Option byte areaNote 3
010C0H 4 bytes
Special function register (2nd SFR) 010BFH Boot cluster 1
2 KB CALLT table area
F0000H 64 bytes
01080H
EFFFFH
Data memory 0107FH
space
Vector table area
128 bytes
01000H
00FFFH
000CEH
000CDH On-chip debug security
ID setting areaNote 3
000C4H 10 bytes
000C3H Option byte areaNote 3 Boot cluster 0Note 4
000C0H 4 bytes
000BFH
CALLT table area
64 bytes
40000H 00080H
3FFFFH 0007FH
00000H 00000H
<R> Notes 1. Use of the area FAF00H to FB309H is prohibited when using the self-programming function and data flash
function, because this area is used for self-programming library (R5F100xJ, R5F101xJ (x = F, G, J, L, M, P
only)).
2. Instructions can be executed from the RAM area excluding the general-purpose register area.
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.
4. Writing boot cluster 0 can be prohibited depending on the setting of security (see 25.6 Security Setting).
5. R5F100xJ only.
Caution When executing instructions from the RAM area while RAM parity error resets are enabled (RPERDIS
= 1), be sure to initialize the used RAM area + 10 bytes.
FFFFFH 5FFFFH
Special function register (SFR)
256 bytes
FFF00H
FFEFFH General-purpose register
32 bytes
FFEE0H
FFEDFH
RAMNote 1 Program area
24 KB
F9F00H
F9EFFH
Mirror
27.75 KB 01FFFH
F3000H
F2FFFH Data flash memoryNote 4 010CEH
F1000H 8 KB 010CDH On-chip debug security
F0FFFH ID setting areaNote 2
Reserved 10 bytes
F0800H 010C4H
F07FFH 010C3H Option byte areaNote 2
010C0H 4 bytes
Special function register (2nd SFR) 010BFH Boot cluster 1
2 KB CALLT table area
F0000H 64 bytes
01080H
EFFFFH
Data memory 0107FH
space
Vector table area
128 bytes
01000H
00FFFH
000CEH
000CDH On-chip debug security
ID setting areaNote 2
000C4H 10 bytes
000C3H Option byte areaNote 2 Boot cluster 0Note 3
000C0H 4 bytes
000BFH
CALLT table area
64 bytes
60000H 00080H
5FFFFH 0007FH
00000H 00000H
Notes 1. Instructions can be executed from the RAM area excluding the general-purpose register area.
2. 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.
3. Writing boot cluster 0 can be prohibited depending on the setting of security (see 25.6 Security Setting).
4. R5F100xK only.
Caution When executing instructions from the RAM area while RAM parity error resets are enabled (RPERDIS
= 1), be sure to initialize the used RAM area + 10 bytes.
FFFFFH 7FFFFH
Special function register (SFR)
256 bytes
FFF00H
FFEFFH General-purpose register
32 bytes
FFEE0H
FFEDFH
F7F00H
F7EFFH
Mirror 01FFFH
F3000H 19.75 KB
F2FFFH Data flash memoryNote 5 010CEH
F1000H 8 KB 010CDH On-chip debug security
F0FFFH ID setting areaNote 3
Reserved 10 bytes
F0800H 010C4H
F07FFH 010C3H Option byte areaNote 3
010C0H 4 bytes
Special function register (2nd SFR) 010BFH Boot cluster 1
2 KB CALLT table area
F0000H 64 bytes
01080H
EFFFFH
Data memory 0107FH
space
Vector table area
128 bytes
01000H
00FFFH
000CEH
000CDH On-chip debug security
ID setting areaNote 3
000C4H 10 bytes
000C3H Option byte areaNote 3 Boot cluster 0Note 4
000C0H 4 bytes
000BFH
CALLT table area
64 bytes
80000H 00080H
7FFFFH 0007FH
00000H 00000H
<R> Notes 1. Use of the area F7F00H to F8309H is prohibited when using the self-programming function and data flash
function, because this area is used for self-programming library.
2. Instructions can be executed from the RAM area excluding the general-purpose register area.
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.
4. Writing boot cluster 0 can be prohibited depending on the setting of security (see 25.6 Security Setting).
5. R5F100xL only.
Caution When executing instructions from the RAM area while RAM parity error resets are enabled (RPERDIS
= 1), be sure to initialize the used RAM area + 10 bytes.
Remark The flash memory is divided into blocks (one block = 1 KB). For the address values and block numbers, see
Table 3-1 Correspondence Between Address Values and Block Numbers in Flash Memory.
0FFFFH
Block 3FH
0FC00H
0FBFFH
007FFH
Block 01H
00400H
003FFH
Block 00H 1 KB
00000H
(R5F100xE, R5F101xE (x = 6 to 8, A to C, E to G, J, L))
Correspondence between the address values and block numbers in the flash memory are shown below.
Table 3-1. Correspondence Between Address Values and Block Numbers in Flash Memory (1/4)
Address Value Block Address Value Block Address Value Block Address Value Block
Number Number Number Number
00000H to 003FFH 00H 08000H to 083FFH 20H 10000H to 103FFH 40H 18000H to 183FFH 60H
00400H to 007FFH 01H 08400H to 087FFH 21H 10400H to 107FFH 41H 18400H to 187FFH 61H
00800H to 00BFFH 02H 08800H to 08BFFH 22H 10800H to 10BFFH 42H 18800H to 18BFFH 62H
00C00H to 00FFFH 03H 08C00H to 08FFFH 23H 10C00H to 10FFFH 43H 18C00H to 18FFFH 63H
01000H to 013FFH 04H 09000H to 093FFH 24H 11000H to 113FFH 44H 19000H to 193FFH 64H
01400H to 017FFH 05H 09400H to 097FFH 25H 11400H to 117FFH 45H 19400H to 197FFH 65H
01800H to 01BFFH 06H 09800H to 09BFFH 26H 11800H to 11BFFH 46H 19800H to 19BFFH 66H
01C00H to 01FFFH 07H 09C00H to 09FFFH 27H 11C00H to 11FFFH 47H 19C00H to 19FFFH 67H
02000H to 023FFH 08H 0A000H to 0A3FFH 28H 12000H to 123FFH 48H 1A000H to 1A3FFH 68H
02400H to 027FFH 09H 0A400H to 0A7FFH 29H 12400H to 127FFH 49H 1A400H to 1A7FFH 69H
02800H to 02BFFH 0AH 0A800H to 0ABFFH 2AH 12800H to 12BFFH 4AH 1A800H to 1ABFFH 6AH
02C00H to 02FFFH 0BH 0AC00H to 0AFFFH 2BH 12C00H to 12FFFH 4BH 1AC00H to 1AFFFH 6BH
03000H to 033FFH 0CH 0B000H to 0B3FFH 2CH 13000H to 133FFH 4CH 1B000H to 1B3FFH 6CH
03400H to 037FFH 0DH 0B400H to 0B7FFH 2DH 13400H to 137FFH 4DH 1B400H to 1B7FFH 6DH
03800H to 03BFFH 0EH 0B800H to 0BBFFH 2EH 13800H to 13BFFH 4EH 1B800H to 1BBFFH 6EH
03C00H to 03FFFH 0FH 0BC00H to 0BFFFH 2FH 13C00H to 13FFFH 4FH 1BC00H to 1BFFFH 6FH
04000H to 043FFH 10H 0C000H to 0C3FFH 30H 14000H to 143FFH 50H 1C000H to 1C3FFH 70H
04400H to 047FFH 11H 0C400H to 0C7FFH 31H 14400H to 147FFH 51H 1C400H to 1C7FFH 71H
04800H to 04BFFH 12H 0C800H to 0CBFFH 32H 14800H to 14BFFH 52H 1C800H to 1CBFFH 72H
04C00H to 04FFFH 13H 0CC00H to 0CFFFH 33H 14C00H to 14FFFH 53H 1CC00H to 1CFFFH 73H
05000H to 053FFH 14H 0D000H to 0D3FFH 34H 15000H to 153FFH 54H 1D000H to 1D3FFH 74H
05400H to 057FFH 15H 0D400H to 0D7FFH 35H 15400H to 157FFH 55H 1D400H to 1D7FFH 75H
05800H to 05BFFH 16H 0D800H to 0DBFFH 36H 15800H to 15BFFH 56H 1D800H to 1DBFFH 76H
05C00H to 05FFFH 17H 0DC00H to 0DFFFH 37H 15C00H to 15FFFH 57H 1DC00H to 1DFFFH 77H
06000H to 063FFH 18H 0E000H to 0E3FFH 38H 16000H to 163FFH 58H 1E000H to 1E3FFH 78H
06400H to 067FFH 19H 0E400H to 0E7FFH 39H 16400H to 167FFH 59H 1E400H to 1E7FFH 79H
06800H to 06BFFH 1AH 0E800H to 0EBFFH 3AH 16800H to 16BFFH 5AH 1E800H to 1EBFFH 7AH
06C00H to 06FFFH 1BH 0EC00H to 0EFFFH 3BH 16C00H to 16FFFH 5BH 1EC00H to 1EFFFH 7BH
07000H to 073FFH 1CH 0F000H to 0F3FFH 3CH 17000H to 173FFH 5CH 1F000H to 1F3FFH 7CH
07400H to 077FFH 1DH 0F400H to 0F7FFH 3DH 17400H to 177FFH 5DH 1F400H to 1F7FFH 7DH
07800H to 07BFFH 1EH 0F800H to 0FBFFH 3EH 17800H to 17BFFH 5EH 1F800H to 1FBFFH 7EH
07C00H to 07FFFH 1FH 0FC00H to 0FFFFH 3FH 17C00H to 17FFFH 5FH 1FC00H to 1FFFFH 7FH
Table 3-1. Correspondence Between Address Values and Block Numbers in Flash Memory (2/4)
Address Value Block Address Value Block Address Value Block Address Value Block
Number Number Number Number
20000H to 203FFH 80H 28000H to 283FFH A0H 30000H to 303FFH C0H 38000H to 383FFH E0H
20400H to 207FFH 81H 28400H to 287FFH A1H 30400H to 307FFH C1H 38400H to 387FFH E1H
20800H to 20BFFH 82H 28800H to 28BFFH A2H 30800H to 30BFFH C2H 38800H to 38BFFH E2H
20C00H to 20FFFH 83H 28C00H to 28FFFH A3H 30C00H to 30FFFH C3H 38C00H to 38FFFH E3H
21000H to 213FFH 84H 29000H to 293FFH A4H 31000H to 313FFH C4H 39000H to 393FFH E4H
21400H to 217FFH 85H 29400H to 297FFH A5H 31400H to 317FFH C5H 39400H to 397FFH E5H
21800H to 21BFFH 86H 29800H to 29BFFH A6H 31800H to 31BFFH C6H 39800H to 39BFFH E6H
21C00H to 21FFFH 87H 29C00H to 29FFFH A7H 31C00H to 31FFFH C7H 39C00H to 39FFFH E7H
22000H to 223FFH 88H 2A000H to 2A3FFH A8H 32000H to 323FFH C8H 3A000H to 3A3FFH E8H
22400H to 227FFH 89H 2A400H to 2A7FFH A9H 32400H to 327FFH C9H 3A400H to 3A7FFH E9H
22800H to 22BFFH 8AH 2A800H to 2ABFFH AAH 32800H to 32BFFH CAH 3A800H to 3ABFFH EAH
22C00H to 22FFFH 8BH 2AC00H to 2AFFFH ABH 32C00H to 32FFFH CBH 3AC00H to 3AFFFH EBH
23000H to 233FFH 8CH 2B000H to 2B3FFH ACH 33000H to 333FFH CCH 3B000H to 3B3FFH ECH
23400H to 237FFH 8DH 2B400H to 2B7FFH ADH 33400H to 337FFH CDH 3B400H to 3B7FFH EDH
23800H to 23BFFH 8EH 2B800H to 2BBFFH AEH 33800H to 33BFFH CEH 3B800H to 3BBFFH EEH
23C00H to 23FFFH 8FH 2BC00H to 2BFFFH AFH 33C00H to 33FFFH CFH 3BC00H to 3BFFFH EFH
24000H to 243FFH 90H 2C000H to 2C3FFH B0H 34000H to 343FFH D0H 3C000H to 3C3FFH F0H
24400H to 247FFH 91H 2C400H to 2C7FFH B1H 34400H to 347FFH D1H 3C400H to 3C7FFH F1H
24800H to 24BFFH 92H 2C800H to 2CBFFH B2H 34800H to 34BFFH D2H 3C800H to 3CBFFH F2H
24C00H to 24FFFH 93H 2CC00H to 2CFFFH B3H 34C00H to 34FFFH D3H 3CC00H to 3CFFFH F3H
25000H to 253FFH 94H 2D000H to 2D3FFH B4H 35000H to 353FFH D4H 3D000H to 3D3FFH F4H
25400H to 257FFH 95H 2D400H to 2D7FFH B5H 35400H to 357FFH D5H 3D400H to 3D7FFH F5H
25800H to 25BFFH 96H 2D800H to 2DBFFH B6H 35800H to 35BFFH D6H 3D800H to 3DBFFH F6H
25C00H to 25FFFH 97H 2DC00H to 2DFFFH B7H 35C00H to 35FFFH D7H 3DC00H to 3DFFFH F7H
26000H to 263FFH 98H 2E000H to 2E3FFH B8H 36000H to 363FFH D8H 3E000H to 3E3FFH F8H
26400H to 267FFH 99H 2E400H to 2E7FFH B9H 36400H to 367FFH D9H 3E400H to 3E7FFH F9H
26800H to 26BFFH 9AH 2E800H to 2EBFFH BAH 36800H to 36BFFH DAH 3E800H to 3EBFFH FAH
26C00H to 26FFFH 9BH 2EC00H to 2EFFFH BBH 36C00H to 36FFFH DBH 3EC00H to 3EFFFH FBH
27000H to 273FFH 9CH 2F000H to 2F3FFH BCH 37000H to 373FFH DCH 3F000H to 3F3FFH FCH
27400H to 277FFH 9DH 2F400H to 2F7FFH BDH 37400H to 377FFH DDH 3F400H to 3F7FFH FDH
27800H to 27BFFH 9EH 2F800H to 2FBFFH BEH 37800H to 37BFFH DEH 3F800H to 3FBFFH FEH
27C00H to 27FFFH 9FH 2FC00H to 2FFFFH BFH 37C00H to 37FFFH DFH 3FC00H to 3FFFFH FFH
Table 3-1. Correspondence Between Address Values and Block Numbers in Flash Memory (3/4)
Address Value Block Address Value Block Address Value Block Address Value Block
Number Number Number Number
40000H to 403FFH 100H 48000H to 483FFH 120H 50000H to 503FFH 140H 58000H to 583FFH 160H
40400H to 407FFH 101H 48400H to 487FFH 121H 50400H to 507FFH 141H 58400H to 587FFH 161H
40800H to 40BFFH 102H 48800H to 48BFFH 122H 50800H to 50BFFH 142H 58800H to 58BFFH 162H
40C00H to 40FFFH 103H 48C00H to 48FFFH 123H 50C00H to 50FFFH 143H 58C00H to 58FFFH 163H
41000H to 413FFH 104H 49000H to 493FFH 124H 51000H to 513FFH 144H 59000H to 593FFH 164H
41400H to 417FFH 105H 49400H to 497FFH 125H 51400H to 517FFH 145H 59400H to 597FFH 165H
41800H to 41BFFH 106H 49800H to 49BFFH 126H 51800H to 51BFFH 146H 59800H to 59BFFH 166H
41C00H to 41FFFH 107H 49C00H to 49FFFH 127H 51C00H to 51FFFH 147H 59C00H to 59FFFH 167H
42000H to 423FFH 108H 4A000H to 4A3FFH 128H 52000H to 523FFH 148H 5A000H to 5A3FFH 168H
42400H to 427FFH 109H 4A400H to 4A7FFH 129H 52400H to 527FFH 149H 5A400H to 5A7FFH 169H
42800H to 42BFFH 10AH 4A800H to 4ABFFH 12AH 52800H to 52BFFH 14AH 5A800H to 5ABFFH 16AH
42C00H to 42FFFH 10BH 4AC00H to 4AFFFH 12BH 52C00H to 52FFFH 14BH 5AC00H to 5AFFFH 16BH
43000H to 433FFH 10CH 4B000H to 4B3FFH 12CH 53000H to 533FFH 14CH 5B000H to 5B3FFH 16CH
43400H to 437FFH 10DH 4B400H to 4B7FFH 12DH 53400H to 537FFH 14DH 5B400H to 5B7FFH 16DH
43800H to 43BFFH 10EH 4B800H to 4BBFFH 12EH 53800H to 53BFFH 14EH 5B800H to 5BBFFH 16EH
43C00H to 43FFFH 10FH 4BC00H to 4BFFFH 12FH 53C00H to 53FFFH 14FH 5BC00H to 5BFFFH 16FH
44000H to 443FFH 110H 4C000H to 4C3FFH 130H 54000H to 543FFH 150H 5C000H to 5C3FFH 170H
44400H to 447FFH 111H 4C400H to 4C7FFH 131H 54400H to 547FFH 151H 5C400H to 5C7FFH 171H
44800H to 44BFFH 112H 4C800H to 4CBFFH 132H 54800H to 54BFFH 152H 5C800H to 5CBFFH 172H
44C00H to 44FFFH 113H 4CC00H to 4CFFFH 133H 54C00H to 54FFFH 153H 5CC00H to 5CFFFH 173H
45000H to 453FFH 114H 4D000H to 4D3FFH 134H 55000H to 553FFH 154H 5D000H to 5D3FFH 174H
45400H to 457FFH 115H 4D400H to 4D7FFH 135H 55400H to 557FFH 155H 5D400H to 5D7FFH 175H
45800H to 45BFFH 116H 4D800H to 4DBFFH 136H 55800H to 55BFFH 156H 5D800H to 5DBFFH 176H
45C00H to 45FFFH 117H 4DC00H to 4DFFFH 137H 55C00H to 55FFFH 157H 5DC00H to 5DFFFH 177H
46000H to 463FFH 118H 4E000H to 4E3FFH 138H 56000H to 563FFH 158H 5E000H to 5E3FFH 178H
46400H to 467FFH 119H 4E400H to 4E7FFH 139H 56400H to 567FFH 159H 5E400H to 5E7FFH 179H
46800H to 46BFFH 11AH 4E800H to 4EBFFH 13AH 56800H to 56BFFH 15AH 5E800H to 5EBFFH 17AH
46C00H to 46FFFH 11BH 4EC00H to 4EFFFH 13BH 56C00H to 56FFFH 15BH 5EC00H to 5EFFFH 17BH
47000H to 473FFH 11CH 4F000H to 4F3FFH 13CH 57000H to 573FFH 15CH 5F000H to 5F3FFH 17CH
47400H to 477FFH 11DH 4F400H to 4F7FFH 13DH 57400H to 577FFH 15DH 5F400H to 5F7FFH 17DH
47800H to 47BFFH 11EH 4F800H to 4FBFFH 13EH 57800H to 57BFFH 15EH 5F800H to 5FBFFH 17EH
47C00H to 47FFFH 11FH 4FC00H to 4FFFFH 13FH 57C00H to 57FFFH 15FH 5FC00H to 5FFFFH 17FH
Table 3-1. Correspondence Between Address Values and Block Numbers in Flash Memory (4/4)
Address Value Block Address Value Block Address Value Block Address Value Block
Number Number Number Number
60000H to 603FFH 180H 68000H to 683FFH 1A0H 70000H to 703FFH 1C0H 78000H to 783FFH 1E0H
60400H to 607FFH 181H 68400H to 687FFH 1A1H 70400H to 707FFH 1C1H 78400H to 787FFH 1E1H
60800H to 60BFFH 182H 68800H to 68BFFH 1A2H 70800H to 70BFFH 1C2H 78800H to 78BFFH 1E2H
60C00H to 60FFFH 183H 68C00H to 68FFFH 1A3H 70C00H to 70FFFH 1C3H 78C00H to 78FFFH 1E3H
61000H to 613FFH 184H 69000H to 693FFH 1A4H 71000H to 713FFH 1C4H 79000H to 793FFH 1E4H
61400H to 617FFH 185H 69400H to 697FFH 1A5H 71400H to 717FFH 1C5H 79400H to 797FFH 1E5H
61800H to 61BFFH 186H 69800H to 69BFFH 1A6H 71800H to 71BFFH 1C6H 79800H to 79BFFH 1E6H
61C00H to 61FFFH 187H 69C00H to 69FFFH 1A7H 71C00H to 71FFFH 1C7H 79C00H to 79FFFH 1E7H
62000H to 623FFH 188H 6A000H to 6A3FFH 1A8H 72000H to 723FFH 1C8H 7A000H to 7A3FFH 1E8H
62400H to 627FFH 189H 6A400H to 6A7FFH 1A9H 72400H to 727FFH 1C9H 7A400H to 7A7FFH 1E9H
62800H to 62BFFH 18AH 6A800H to 6ABFFH 1AAH 72800H to 72BFFH 1CAH 7A800H to 7ABFFH 1EAH
62C00H to 62FFFH 18BH 6AC00H to 6AFFFH 1ABH 72C00H to 72FFFH 1CBH 7AC00H to 7AFFFH 1EBH
63000H to 633FFH 18CH 6B000H to 6B3FFH 1ACH 73000H to 733FFH 1CCH 7B000H to 7B3FFH 1ECH
63400H to 637FFH 18DH 6B400H to 6B7FFH 1ADH 73400H to 737FFH 1CDH 7B400H to 7B7FFH 1EDH
63800H to 63BFFH 18EH 6B800H to 6BBFFH 1AEH 73800H to 73BFFH 1CEH 7B800H to 7BBFFH 1EEH
63C00H to 63FFFH 18FH 6BC00H to 6BFFFH 1AFH 73C00H to 73FFFH 1CFH 7BC00H to 7BFFFH 1EFH
64000H to 643FFH 190H 6C000H to 6C3FFH 1B0H 74000H to 743FFH 1D0H 7C000H to 7C3FFH 1F0H
64400H to 647FFH 191H 6C400H to 6C7FFH 1B1H 74400H to 747FFH 1D1H 7C400H to 7C7FFH 1F1H
64800H to 64BFFH 192H 6C800H to 6CBFFH 1B2H 74800H to 74BFFH 1D2H 7C800H to 7CBFFH 1F2H
64C00H to 64FFFH 193H 6CC00H to 6CFFFH 1B3H 74C00H to 74FFFH 1D3H 7CC00H to 7CFFFH 1F3H
65000H to 653FFH 194H 6D000H to 6D3FFH 1B4H 75000H to 753FFH 1D4H 7D000H to 7D3FFH 1F4H
65400H to 657FFH 195H 6D400H to 6D7FFH 1B5H 75400H to 757FFH 1D5H 7D400H to 7D7FFH 1F5H
65800H to 65BFFH 196H 6D800H to 6DBFFH 1B6H 75800H to 75BFFH 1D6H 7D800H to 7DBFFH 1F6H
65C00H to 65FFFH 197H 6DC00H to 6DFFFH 1B7H 75C00H to 75FFFH 1D7H 7DC00H to 7DFFFH 1F7H
66000H to 663FFH 198H 6E000H to 6E3FFH 1B8H 76000H to 763FFH 1D8H 7E000H to 7E3FFH 1F8H
66400H to 667FFH 199H 6E400H to 6E7FFH 1B9H 76400H to 767FFH 1D9H 7E400H to 7E7FFH 1F9H
66800H to 66BFFH 19AH 6E800H to 6EBFFH 1BAH 76800H to 76BFFH 1DAH 7E800H to 7EBFFH 1FAH
66C00H to 66FFFH 19BH 6EC00H to 6EFFFH 1BBH 76C00H to 76FFFH 1DBH 7EC00H to 7EFFFH 1FBH
67000H to 673FFH 19CH 6F000H to 6F3FFH 1BCH 77000H to 773FFH 1DCH 7F000H to 7F3FFH 1FCH
67400H to 677FFH 19DH 6F400H to 6F7FFH 1BDH 77400H to 777FFH 1DDH 7F400H to 7F7FFH 1FDH
67800H to 67BFFH 19EH 6F800H to 6FBFFH 1BEH 77800H to 77BFFH 1DEH 7F800H to 7FBFFH 1FEH
67C00H to 67FFFH 19FH 6FC00H to 6FFFFH 1BFH 77C00H to 77FFFH 1DFH 7FC00H to 7FFFFH 1FFH
The internal program memory space is divided into the following areas.
128-pin
100-pin
80-pin
64-pin
52-pin
48-pin
44-pin
40-pin
36-pin
32-pin
30-pin
25-pin
24-pin
20-pin
Vector Table Address Interrupt Source
0018H INTSRE2 √ √ √ √ √ √ √ √ √ √ √ − − −
INTTM11H √ √ √ − − − − − − − − − − −
001AH INTDMA0 √ √ √ √ √ √ √ √ √ √ √ √ √ √
001CH INTDMA1 √ √ √ √ √ √ √ √ √ √ √ √ √ √
001EH INTST0/INTCSI00/INTIIC00 √ √ √ √ √ √ √ √ √ √ √ √ √ √
0020H INTSR0/INTCSI01/INTIIC01 √ √ √ √ √ √ Note 2 Note 2 Note 2 Note 2 Note 2 Note 2 Note 2 Note 2
0022H INTSRE0 √ √ √ √ √ √ √ √ √ √ √ √ √ √
INTTM01H √ √ √ √ √ √ √ √ √ √ √ √ √ √
0024H INTST1/INTCSI10/INTIIC10 √ √ √ √ Note 3 Note 3 Note 3 Note 3 Note 3 Note 3 Note 3 Note 3 Note 3 Note 3
0026H INTSR1/INTCSI11/INTIIC11 √ √ √ √ √ √ √ √ √ √ √ √ √ √
<R> 0028H INTSRE1 √ √ √ √ √ √ √ √ √ √ √ √ √ √
INTTM03H √ √ √ √ √ √ √ √ √ √ √ √ √ √
002AH INTIICA0 √ √ √ √ √ √ √ √ √ √ √ √ √ −
002CH INTTM00 √ √ √ √ √ √ √ √ √ √ √ √ √ √
002EH INTTM01 √ √ √ √ √ √ √ √ √ √ √ √ √ √
0030H INTTM02 √ √ √ √ √ √ √ √ √ √ √ √ √ √
0032H INTTM03 √ √ √ √ √ √ √ √ √ √ √ √ √ √
0034H INTAD √ √ √ √ √ √ √ √ √ √ √ √ √ √
0036H INTRTC √ √ √ √ √ √ √ √ √ √ √ √ √ √
0038H INTIT √ √ √ √ √ √ √ √ √ √ √ √ √ √
003AH INTKR √ √ √ √ √ √ √ √ − − − − − −
003CH INTST3/INTCSI30/INTIIC30 √ √ √ − − − − − − − − − − −
003EH INTSR3/INTCSI31/INTIIC31 √ √ √ − − − − − − − − − − −
0040H INTTM13 √ √ √ − − − − − − − − − − −
128-pin
100-pin
80-pin
64-pin
52-pin
48-pin
44-pin
40-pin
36-pin
32-pin
30-pin
25-pin
24-pin
20-pin
Vector Table Address Interrupt Source
0042H INTTM04 √ √ √ √ √ √ √ √ √ √ √ √ √ √
0044H INTTM05 √ √ √ √ √ √ √ √ √ √ √ √ √ √
0046H INTTM06 √ √ √ √ √ √ √ √ √ √ √ √ √ √
0048H INTTM07 √ √ √ √ √ √ √ √ √ √ √ √ √ √
004AH INTP6 √ √ √ √ √ √ − − − − − − − −
004CH INTP7 √ √ √ √ − − − − − − − − − −
004EH INTP8 √ √ √ √ √ √ − − − − − − − −
0050H INTP9 √ √ √ √ √ √ − − − − − − − −
0052H INTP10 √ √ √ √ √ − − − − − − − − −
0054H INTP11 √ √ √ √ √ − − − − − − − − −
0056H INTTM10 √ √ √ − − − − − − − − − − −
0058H INTTM11 √ √ √ − − − − − − − − − − −
005AH INTTM12 √ √ √ − − − − − − − − − − −
005CH INTSRE3 √ √ √ − − − − − − − − − − −
INTTM13H √ √ √ − − − − − − − − − − −
005EH INTMD √ √ √ √ √ √ √ √ √ √ √ √ √ √
0060H INTIICA1 √ √ √ − − − − − − − − − − −
0062H INTFL √ √ √ √ √ √ √ √ √ √ √ √ √ √
0064H INTDMA2 √ √ √ − − − − − − − − − − −
0066H INTDMA3 √ √ √ − − − − − − − − − − −
0068H INTTM14 √ − − − − − − − − − − − − −
006AH INTTM15 √ − − − − − − − − − − − − −
006CH INTTM16 √ − − − − − − − − − − − − −
006EH INTTM17 √ − − − − − − − − − − − − −
007EH BRK √ √ √ √ √ √ √ √ √ √ √ √ √ √
FFFFFH
Mirror
Reserved
10000H
0FFFFH
Code flash memory
0EF00H
0EEFFH
Code flash memory
02000H
01FFFH Code flash memory
00000H
PMC 0 0 0 0 0 0 0 MAA
MAA Selection of flash memory space for mirroring to area from F0000H to FFFFFH
Cautions 1. In products with 64 KB or less flash memory, be sure to clear bit 0 (MAA) of this register to 0
(default value).
2. Set the PMC register only once during the initial settings prior to operating the DMA controller.
Rewriting the PMC register other than during the initial settings is prohibited.
3. After setting the PMC register, wait for at least one instruction and access the mirror area.
The internal RAM can be used as a data area and a program area where instructions are written and executed. 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. However, instructions cannot be executed by using the general-purpose registers.
The internal RAM is used as stack memory.
Cautions 1. It is prohibited to use the general-purpose register (FFEE0H to FFEFFH) space for fetching
instructions or as a stack area.
<R> 2. The internal RAM in the following products cannot be used as stack memory when using the self-
programming function and data flash function.
3.1.5 Extended 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
Table 3-6 in 3.2.5 Extended Special function registers (2nd SFRs: 2nd Special Function Registers)).
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.
Caution Do not access addresses to which extended SFRs are not assigned.
<R> Figure 3-12. Correspondence Between Data Memory and Addressing (R5F100xA, R5F101xA(x = 6 to 8, A to C, E to G))
FFFFFH
FFF20H Special function register (SFR) SFR addressing
FFF1FH 256 bytes
FFF00H
FFEFFH General-purpose register Short direct
32 bytes Register addressing addressing
FFEE0H
FFEDFH
FFE20H RAM
FFE1FH 2 KB
FF700H
FF6FFH
Reserved
F4000H
F3FFFH
Mirror
8 KB
F2000H
F1FFFH Data flash memoryNote
F1000H 4 KB
F0FFFH
Reserved
F0800H
F07FFH
Special function register (2nd SFR) Direct addressing
2 KB
Register indirect addressing
F0000H
EFFFFH Based addressing
Reserved
04000H
03FFFH
Code flash memory
16 KB
00000H
Caution When executing instructions from the RAM area while RAM parity error resets are enabled (RPERDIS
= 1), be sure to initialize the used RAM area + 10 bytes.
FFFFFH
FFF20H Special function register (SFR) SFR addressing
FFF1FH 256 bytes
FFF00H
FFEFFH General-purpose register Short direct
32 bytes Register addressing addressing
FFEE0H
FFEDFH
FFE20H RAM
FFE1FH 2 KB
F8000H
F7FFFH
Reserved
FF700H
FF6FFH
Mirror
F2000H 24 KB
F1FFFH Data flash memoryNote
F1000H 4 KB
F0FFFH
Reserved
F0800H
F07FFH
Special function register (2nd SFR) Direct addressing
2 KB
Register indirect addressing
F0000H
EFFFFH Based addressing
Reserved
08000H
07FFFH
00000H
Caution When executing instructions from the RAM area while RAM parity error resets are enabled (RPERDIS
= 1), be sure to initialize the used RAM area + 10 bytes.
FFFFFH
FFF20H Special function register (SFR) SFR addressing
FFF1FH 256 bytes
FFF00H
FFEFFH General-purpose register Short direct
32 bytes Register addressing addressing
FFEE0H
FFEDFH
FFE20H RAMNote 1
FFE1FH 3 KB
FF300H
FF2FFH
Reserved
FC000H
FBFFFH Mirror
F2000H 40 KB
F1FFFH Data flash memoryNote 2
F1000H 4 KB
F0FFFH
Reserved
F0800H
F07FFH
Special function register (2nd SFR) Direct addressing
2 KB
Register indirect addressing
F0000H
EFFFFH Based addressing
Reserved
0C000H
0BFFFH
00000H
<R> Notes 1. Use of the area FF300H to FF309H is prohibited when using the self-programming function and data flash
function, because this area is used for self-programming library.
2. R5F100xD only.
Caution When executing instructions from the RAM area while RAM parity error resets are enabled (RPERDIS
= 1), be sure to initialize the used RAM area + 10 bytes.
FFFFFH
FFF20H Special function register (SFR) SFR addressing
FFF1FH 256 bytes
FFF00H
FFEFFH General-purpose register Short direct
32 bytes Register addressing addressing
FFEE0H
FFEDFH
FFE20H RAMNote 1
FFE1FH 4 KB
FEF00H
FEEFFH Mirror
51.75 KB
F2000H
F1FFFH Data flash memoryNote 2
F1000H 4 KB
F0FFFH
Reserved
F0800H
F07FFH
Special function register (2nd SFR) Direct addressing
2 KB
Register indirect addressing
F0000H
EFFFFH
Based addressing
Reserved
10000H
0FFFFH
00000H
<R> Notes 1. Use of the area FEF00H to FF309H is prohibited when using the self-programming function and data flash
function, because this area is used for self-programming library.
2. R5F100xE only.
Caution When executing instructions from the RAM area while RAM parity error resets are enabled (RPERDIS
= 1), be sure to initialize the used RAM area + 10 bytes.
FFFFFH
FFF20H Special function register (SFR) SFR addressing
FFF1FH 256 bytes
FFF00H
FFEFFH General-purpose register Short direct
32 bytes Register addressing addressing
FFEE0H
FFEDFH
FFE20H RAM
FFE1FH 8 KB
FDF00H
FDEFFH Mirror
43.75 KB
F3000H
F2FFFH Data flash memoryNote
F1000H 8 KB
F0FFFH
Reserved
F0800H
F07FFH
Special function register (2nd SFR) Direct addressing
2 KB
Register indirect addressing
F0000H
EFFFFH
Based addressing
Reserved
18000H
17FFFH
00000H
Caution When executing instructions from the RAM area while RAM parity error resets are enabled (RPERDIS
= 1), be sure to initialize the used RAM area + 10 bytes.
FFFFFH
FFF20H Special function register (SFR) SFR addressing
FFF1FH 256 bytes
FFF00H
FFEFFH General-purpose register Short direct
32 bytes Register addressing addressing
FFEE0H
FFEDFH
FFE20H RAM
FFE1FH 12 KB
FCF00H
FCEFFH Mirror
39.75 KB
F3000H
F2FFFH Data flash memoryNote
F1000H 8 KB
F0FFFH
Reserved
F0800H
F07FFH
Special function register (2nd SFR) Direct addressing
2 KB
Register indirect addressing
F0000H
EFFFFH
Based addressing
Reserved
20000H
1FFFFH
00000H
Caution When executing instructions from the RAM area while RAM parity error resets are enabled (RPERDIS
= 1), be sure to initialize the used RAM area + 10 bytes.
FFFFFH
FFF20H Special function register (SFR) SFR addressing
FFF1FH 256 bytes
FFF00H
FFEFFH General-purpose register Short direct
32 bytes Register addressing addressing
FFEE0H
FFEDFH
FFE20H RAM
FFE1FH 16 KB
FBF00H
FBEFFH Mirror
35.75 KB
F3000H
F2FFFH Data flash memoryNote
F1000H 8 KB
F0FFFH
Reserved
F0800H
F07FFH
Special function register (2nd SFR) Direct addressing
2 KB
Register indirect addressing
F0000H
EFFFFH
Based addressing
Reserved
30000H
2FFFFH
00000H
Caution When executing instructions from the RAM area while RAM parity error resets are enabled (RPERDIS
= 1), be sure to initialize the used RAM area + 10 bytes.
FFFFFH
FFF20H Special function register (SFR) SFR addressing
FFF1FH 256 bytes
FFF00H
FFEFFH General-purpose register Short direct
32 bytes Register addressing addressing
FFEE0H
FFEDFH
FFE20H RAMNote 1
FFE1FH 20 KB
FAF00H
FAEFFH Mirror
F3000H 31.75 KB
F2FFFH Data flash memoryNote 2
F1000H 8 KB
F0FFFH
Reserved
F0800H
F07FFH
Special function register (2nd SFR) Direct addressing
2 KB
Register indirect addressing
F0000H
EFFFFH
Based addressing
Reserved
40000H
3FFFFH
00000H
<R> Notes 1. Use of the area FAF00H to FB309H is prohibited when using the self-programming function and data flash
function, because this area is used for self-programming library (R5F100xJ, R5F101xJ (x = F, G, J, L, M, P)
only).
2. R5F100xJ only.
Caution When executing instructions from the RAM area while RAM parity error resets are enabled (RPERDIS
= 1), be sure to initialize the used RAM area + 10 bytes.
FFFFFH
FFF20H Special function register (SFR) SFR addressing
FFF1FH 256 bytes
FFF00H
FFEFFH General-purpose register Short direct
32 bytes Register addressing addressing
FFEE0H
FFEDFH
FFE20H RAM
FFE1FH 24 KB
F9F00H
F9EFFH Mirror
F3000H 27.75 KB
F2FFFH Data flash memoryNote
F1000H 8 KB
F0FFFH
Reserved
F0800H
F07FFH
Special function register (2nd SFR) Direct addressing
2 KB
Register indirect addressing
F0000H
EFFFFH
Based addressing
Reserved
60000H
5FFFFH
00000H
Caution When executing instructions from the RAM area while RAM parity error resets are enabled (RPERDIS
= 1), be sure to initialize the used RAM area + 10 bytes.
FFFFFH
FFF20H Special function register (SFR) SFR addressing
FFF1FH 256 bytes
FFF00H
FFEFFH General-purpose register Short direct
32 bytes Register addressing addressing
FFEE0H
FFEDFH
FFE20H RAMNote 1
FFE1FH 32 KB
F7F00H
F7EFFH Mirror
F3000H 19.75 KB
F2FFFH Data flash memoryNote 2
F1000H 8 KB
F0FFFH
Reserved
F0800H
F07FFH
Special function register (2nd SFR) Direct addressing
2 KB
Register indirect addressing
F0000H
EFFFFH
Based addressing
Reserved
80000H
7FFFFH
00000H
<R> Notes 1. Use of the area F7F00H to F8309H is prohibited when using the self-programming function and data flash
function, because this area is used for self-programming library.
2. R5F100xL only.
Caution When executing instructions from the RAM area while RAM parity error resets are enabled (RPERDIS
= 1), be sure to initialize the used RAM area + 10 bytes.
19 0
PC
7 0
Remark n = 0, 1
15 0
SP SP15 SP14 SP13 SP12 SP11 SP10 SP9 SP8 SP7 SP6 SP5 SP4 SP3 SP2 SP1 SP0
The SP is decremented ahead of write (save) to the stack memory and is incremented after read (restored) from the
stack memory.
Each stack operation saves data as shown in Figure 3-25.
Cautions 1. Since reset signal generation makes the SP contents undefined, be sure to initialize the SP
before using the stack.
2. It is prohibited to use the general-purpose register (FFEE0H to FFEFFH) space as a stack area.
<R> 3. The internal RAM in the following products cannot be used as stack memory when using the
self-programming function and data flash function.
SP←SP−2 SP←SP−2
↑ ↑
SP−2 Register pair lower SP−2 00H
↑ ↑
SP−1 Register pair higher SP−1 PSW
↑ ↑
SP → SP →
SP←SP−4 SP←SP−4
↑ ↑
SP−4 PC7 to PC0 SP−4 PC7 to PC0
↑ ↑
SP−3 PC15 to PC8 SP−3 PC15 to PC8
↑ ↑
SP−2 PC19 to PC16 SP−2 PC19 to PC16
↑ ↑
SP−1 00H SP−1 PSW
↑ ↑
SP → SP →
Cautions 1. It is prohibited to use the general-purpose register (FFEE0H to FFEFFH) space for fetching
instructions or as a stack area.
<R> 2. The internal RAM in the following products cannot be used as stack memory when using the self-
programming function and data flash function.
D
Register bank 1 DE
E
FFEF0H
B
Register bank 2 BC
C
FFEE8H
A
Register bank 3 AX
X
FFEE0H
15 0 7 0
R5
Register bank 1 RP2
R4
FFEF0H
R3
Register bank 2 RP1
R2
FFEE8H
R1
Register bank 3 RP0
R0
FFEE0H
15 0 7 0
7 6 5 4 3 2 1 0
CS 0 0 0 0 CS3 CP2 CP1 CP0
• 1-bit manipulation
Describe the symbol reserved by the assembler for the 1-bit manipulation instruction operand (sfr.bit). This
manipulation can also be specified with an address.
• 8-bit manipulation
Describe the symbol reserved 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 reserved by the assembler for the 16-bit manipulation instruction operand (sfrp). When
specifying an address, describe an even address.
Table 3-5 gives a list of the SFRs. The meanings of items in the table are as follows.
• Symbol
Symbol indicating 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
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
Indicates each register status upon reset signal generation.
Caution Do not access addresses to which extended SFRs are not assigned.
Remark For extended SFRs (2nd SFRs), see 3.2.5 Extended special function registers (2nd SFRs: 2nd Special
Function Registers).
Address Special Function Register (SFR) Name Symbol R/W Manipulable Bit Range After Reset
1-bit 8-bit 16-bit
FFF00H Port register 0 P0 R/W √ √ − 00H
FFF01H Port register 1 P1 R/W √ √ − 00H
FFF02H Port register 2 P2 R/W √ √ − 00H
FFF03H Port register 3 P3 R/W √ √ − 00H
FFF04H Port register 4 P4 R/W √ √ − 00H
FFF05H Port register 5 P5 R/W √ √ − 00H
FFF06H Port register 6 P6 R/W √ √ − 00H
FFF07H Port register 7 P7 R/W √ √ − 00H
FFF08H Port register 8 P8 R/W √ √ − 00H
FFF09H Port register 9 P9 R/W √ √ − 00H
FFF0AH Port register 10 P10 R/W √ √ − 00H
FFF0BH Port register 11 P11 R/W √ √ − 00H
FFF0CH Port register 12 P12 R/W √ √ − Undefined
FFF0DH Port register 13 P13 R/W √ √ − Undefined
FFF0EH Port register 14 P14 R/W √ √ − 00H
FFF0FH Port register 15 P15 R/W √ √ − 00H
FFF10H Serial data register 00 TXD0/ SDR00 R/W − √ √ 0000H
SIO00
FFF11H − − −
FFF12H Serial data register 01 RXD0/ SDR01 R/W − √ √ 0000H
SIO01
FFF13H − − −
FFF14H Serial data register 12 TXD3/ SDR12 R/W − √ √ 0000H
SIO30
FFF15H − − −
FFF16H Serial data register 13 RXD3/ SDR13 R/W − √ √ 0000H
SIO31
FFF17H − − −
FFF18H Timer data register 00 TDR00 R/W − − √ 0000H
FFF19H
FFF1AH Timer data register 01 TDR01L TDR01 R/W − √ √ 00H
FFF1BH TDR01H − √ 00H
FFF1EH 10-bit A/D conversion result ADCR R − − √ 0000H
register
FFF1FH 8-bit A/D conversion ADCRH R − √ − 00H
result register
FFF20H Port mode register 0 PM0 R/W √ √ − FFH
FFF21H Port mode register 1 PM1 R/W √ √ − FFH
FFF22H Port mode register 2 PM2 R/W √ √ − FFH
FFF23H Port mode register 3 PM3 R/W √ √ − FFH
FFF24H Port mode register 4 PM4 R/W √ √ − FFH
FFF25H Port mode register 5 PM5 R/W √ √ − FFH
FFF26H Port mode register 6 PM6 R/W √ √ − FFH
FFF27H Port mode register 7 PM7 R/W √ √ − FFH
FFF28H Port mode register 8 PM8 R/W √ √ − FFH
FFF29H Port mode register 9 PM9 R/W √ √ − FFH
Address Special Function Register (SFR) Name Symbol R/W Manipulable Bit Range After Reset
1-bit 8-bit 16-bit
FFF2AH Port mode register 10 PM10 R/W √ √ − FFH
FFF2BH Port mode register 11 PM11 R/W √ √ − FFH
FFF2CH Port mode register 12 PM12 R/W √ √ − FFH
FFF2EH Port mode register 14 PM14 R/W √ √ − FFH
FFF2FH Port mode register 15 PM15 R/W √ √ − FFH
FFF30H A/D converter mode register 0 ADM0 R/W √ √ − 00H
FFF31H Analog input channel ADS R/W √ √ −
00H
specification register
FFF32H A/D converter mode register 1 ADM1 R/W √ √ − 00H
FFF37H Key return mode register KRM R/W √ √ − 00H
FFF38H External interrupt rising edge EGP0 R/W √ √ − 00H
enable register 0
FFF39H External interrupt falling edge EGN0 R/W √ √ − 00H
enable register 0
FFF3AH External interrupt rising edge EGP1 R/W √ √ − 00H
enable register 1
FFF3BH External interrupt falling edge EGN1 R/W √ √ − 00H
enable register 1
FFF44H Serial data register 02 TXD1/ SDR02 R/W − √ √ 0000H
SIO10
FFF45H − − −
FFF46H Serial data register 03 RXD1/ SDR03 R/W − √ √ 0000H
SIO11
FFF47H − − −
FFF48H Serial data register 10 TXD2/ SDR10 R/W − √ √ 0000H
SIO20
FFF49H − − −
FFF4AH Serial data register 11 RXD2/ SDR11 R/W − √ √ 0000H
SIO21
FFF4BH − − −
FFF50H IICA shift register 0 IICA0 R/W − √ − 00H
FFF51H IICA status register 0 IICS0 R √ √ − 00H
FFF52H IICA flag register 0 IICF0 R/W √ √ − 00H
FFF54H IICA shift register 1 IICA1 R/W − √ − 00H
FFF55H IICA status register 1 IICS1 R √ √ − 00H
FFF56H IICA flag register 1 IICF1 R/W √ √ − 00H
FFF64H Timer data register 02 TDR02 R/W − − √ 0000H
FFF65H
FFF66H Timer data register 03 TDR03L TDR03 R/W − √ √ 00H
FFF67H TDR03H − √ 00H
FFF68H Timer data register 04 TDR04 R/W − − √ 0000H
FFF69H
Address Special Function Register (SFR) Name Symbol R/W Manipulable Bit Range After Reset
1-bit 8-bit 16-bit
FFF6AH Timer data register 05 TDR05 R/W − − √ 0000H
FFF6BH
FFF6CH Timer data register 06 TDR06 R/W − − √ 0000H
FFF6DH
FFF6EH Timer data register 07 TDR07 R/W − − √ 0000H
FFF6FH
FFF70H Timer data register 10 TDR10 R/W − − √ 0000H
FFF71H
FFF72H Timer data register 11 TDR11L TDR11 R/W − √ √ 00H
FFF73H TDR11H − √ 00H
FFF74H Timer data register 12 TDR12 R/W − − √ 0000H
FFF75H
FFF76H Timer data register 13 TDR13L TDR13 R/W − √ √ 00H
FFF77H TDR13H − √ 00H
FFF78H Timer data register 14 TDR14 R/W − − √ 0000H
FFF79H
FFF7AH Timer data register 15 TDR15 R/W − − √ 0000H
FFF7BH
FFF7CH Timer data register 16 TDR16 R/W − − √ 0000H
FFF7DH
FFF7EH Timer data register 17 TDR17 R/W − − √ 0000H
FFF7FH
FFF90H Interval timer control register ITMC R/W − − √ 0FFFH
FFF91H
FFF92H Second count register SEC R/W − √ − 00H
FFF93H Minute count register MIN R/W − √ − 00H
− √ −
Note
FFF94H Hour count register HOUR R/W 12H
FFF95H Week count register WEEK R/W − √ − 00H
FFF96H Day count register DAY R/W − √ − 01H
FFF97H Month count register MONTH R/W − √ − 01H
FFF98H Year count register YEAR R/W − √ − 00H
FFF99H Watch error correction register SUBCUD R/W − √ − 00H
FFF9AH Alarm minute register ALARMWM R/W − √ − 00H
FFF9BH Alarm hour register ALARMWH R/W − √ − 12H
FFF9CH Alarm week register ALARMWW R/W − √ − 00H
FFF9DH Real-time clock control register RTCC0 R/W √ √ − 00H
0
FFF9EH Real-time clock control register RTCC1 R/W √ √ − 00H
1
Note The 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.
Address Special Function Register (SFR) Name Symbol R/W Manipulable Bit Range After Reset
1-bit 8-bit 16-bit
FFFA0H Clock operation mode control CMC R/W − √ − 00H
register
FFFA1H Clock operation status control CSC R/W √ √ − C0H
register
FFFA2H Oscillation stabilization time OSTC R √ √ − 00H
counter status register
FFFA3H Oscillation stabilization time OSTS R/W − √ − 07H
select register
FFFA4H System clock control register CKC R/W √ √ − 00H
FFFA5H Clock output select register 0 CKS0 R/W √ √ − 00H
FFFA6H Clock output select register 1 CKS1 R/W √ √ − 00H
− √ −
Note 1
FFFA8H Reset control flag register RESF R Undefined
√ √ −
Note 2
FFFA9H Voltage detection register LVIM R/W 00H
√ √ −
Note 3
FFFAAH Voltage detection level register LVIS R/W 00H/01H/81H
− √ −
Note 4
FFFABH Watchdog timer enable register WDTE R/W 1AH/9AH
FFFACH CRC input register CRCIN R/W − √ − 00H
FFFB0H DMA SFR address register 0 DSA0 R/W − √ − 00H
FFFB1H DMA SFR address register 1 DSA1 R/W − √ − 00H
FFFB2H DMA RAM address register 0L DRA0L DRA0 R/W − √ √ 00H
FFFB3H DMA RAM address register 0H DRA0H R/W − √ 00H
FFFB4H DMA RAM address register 1L DRA1L DRA1 R/W − √ √ 00H
FFFB5H DMA RAM address register 1H DRA1H R/W − √ 00H
FFFB6H DMA byte count register 0L DBC0L DBC0 R/W − √ √ 00H
FFFB7H DMA byte count register 0H DBC0H R/W − √ 00H
FFFB8H DMA byte count register 1L DBC1L DBC1 R/W − √ √ 00H
FFFB9H DMA byte count register 1H DBC1H R/W − √ 00H
FFFBAH DMA mode control register 0 DMC0 R/W √ √ − 00H
FFFBBH DMA mode control register 1 DMC1 R/W √ √ − 00H
FFFBCH DMA operation control register 0 DRC0 R/W √ √ − 00H
FFFBDH DMA operation control register 1 DRC1 R/W √ √ − 00H
FFFD0H Interrupt request flag register 2L IF2L IF2 R/W √ √ √ 00H
FFFD1H Interrupt request flag register 2H IF2H R/W √ √ 00H
FFFD2H Interrupt request flag register 3L IF3L IF3 R/W √ √ √ 00H
FFFD4H Interrupt mask flag register 2L MK2L MK2 R/W √ √ √ FFH
FFFD5H Interrupt mask flag register 2H MK2H R/W √ √ FFH
FFFD6H Interrupt mask flag register 3L MK3L MK3 R/W √ √ √ FFH
Notes 1. The reset value of the RESF register varies depending on the reset source.
2. The reset value of the LVIM register varies depending on the reset source.
3. The reset value of the LVIS register varies depending on the reset source and the setting of the option byte.
4. The reset value of the WDTE register is determined by the setting of the option byte.
Address Special Function Register (SFR) Name Symbol R/W Manipulable Bit Range After Reset
1-bit 8-bit 16-bit
FFFD8H Priority specification flag register PR02L PR02 R/W √ √ √ FFH
02L
FFFD9H Priority specification flag register PR02H R/W √ √ FFH
02H
FFFDAH Priority specification flag register PR03L PR03 R/W √ √ √ FFH
02L
FFFDCH Priority specification flag register PR12L PR12 R/W √ √ √ FFH
12L
FFFDDH Priority specification flag register PR12H R/W √ √ FFH
12H
FFFDEH Priority specification flag register PR13L PR13 R/W √ √ √ FFH
13L
FFFE0H Interrupt request flag register 0L IF0L IF0 R/W √ √ √ 00H
FFFE1H Interrupt request flag register 0H IF0H R/W √ √ 00H
FFFE2H Interrupt request flag register 1L IF1L IF1 R/W √ √ √ 00H
FFFE3H Interrupt request flag register 1H IF1H R/W √ √ 00H
FFFE4H Interrupt mask flag register 0L MK0L MK0 R/W √ √ √ FFH
FFFE5H Interrupt mask flag register 0H MK0H R/W √ √ FFH
FFFE6H Interrupt mask flag register 1L MK1L MK1 R/W √ √ √ FFH
FFFE7H Interrupt mask flag register 1H MK1H R/W √ √ FFH
FFFE8H Priority specification flag register PR00L PR00 R/W √ √ √ FFH
00L
FFFE9H Priority specification flag register PR00H R/W √ √ FFH
00H
FFFEAH Priority specification flag register PR01L PR01 R/W √ √ √ FFH
01L
FFFEBH Priority specification flag register PR01H R/W √ √ FFH
01H
FFFECH Priority specification flag register PR10L PR10 R/W √ √ √ FFH
10L
FFFEDH Priority specification flag register PR10H R/W √ √ FFH
10H
FFFEEH Priority specification flag register PR11L PR11 R/W √ √ √ FFH
11L
FFFEFH Priority specification flag register PR11H R/W √ √ FFH
11H
FFFF0H Multiplication/division data register MDAL R/W − − √ 0000H
FFFF1H A (L)
FFFF2H Multiplication/division data register MDAH R/W − − √ 0000H
FFFF3H A (H)
FFFF4H Multiplication/division data register MDBH R/W − − √ 0000H
FFFF5H B (H)
FFFF6H Multiplication/division data register MDBL R/W − − √ 0000H
FFFF7H B (L)
FFFFEH Processor mode control register PMC R/W √ √ − 00H
nd nd
Remark For extended SFRs (2 SFRs), see Table 3-6 Extended SFR (2 SFR) List.
3.2.5 Extended 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 the symbol reserved by the assembler for the 1-bit manipulation instruction operand (!addr16.bit). This
manipulation can also be specified with an address.
• 8-bit manipulation
Describe the symbol reserved 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 reserved by the assembler for the 16-bit manipulation instruction operand (!addr16). When
specifying an address, describe an even address.
Table 3-6 gives a list of the extended SFRs. The meanings of items in the table are as follows.
• Symbol
Symbol indicating 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
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
Indicates each register status upon reset signal generation.
Caution Do not access addresses to which extended SFRs are not assigned.
Remark For SFRs in the SFR area, see 3.2.4 Special function registers (SFRs).
nd
Table 3-6. Extended SFR (2 SFR) List (1/8)
Address Special Function Register (SFR) Name Symbol R/W Manipulable Bit Range After Reset
1-bit 8-bit 16-bit
F0010H A/D converter mode register 2 ADM2 R/W √ √ − 00H
F0011H Conversion result comparison ADUL R/W − √ − FFH
upper limit setting register
F0012H Conversion result comparison ADLL R/W − √ − 00H
lower limit setting register
F0013H A/D test register ADTES R/W − √ − 00H
F0030H Pull-up resistor option register 0 PU0 R/W √ √ − 00H
F0031H Pull-up resistor option register 1 PU1 R/W √ √ − 00H
F0033H Pull-up resistor option register 3 PU3 R/W √ √ − 00H
F0034H Pull-up resistor option register 4 PU4 R/W √ √ − 01H
F0035H Pull-up resistor option register 5 PU5 R/W √ √ − 00H
F0036H Pull-up resistor option register 6 PU6 R/W √ √ − 00H
F0037H Pull-up resistor option register 7 PU7 R/W √ √ − 00H
F0038H Pull-up resistor option register 8 PU8 R/W √ √ − 00H
F0039H Pull-up resistor option register 9 PU9 R/W √ √ − 00H
F003AH Pull-up resistor option register 10 PU10 R/W √ √ − 00H
F003BH Pull-up resistor option register 11 PU11 R/W √ √ − 00H
F003CH Pull-up resistor option register 12 PU12 R/W √ √ − 00H
F003EH Pull-up resistor option register 14 PU14 R/W √ √ − 00H
F0040H Port input mode register 0 PIM0 R/W √ √ − 00H
F0041H Port input mode register 1 PIM1 R/W √ √ − 00H
F0044H Port input mode register 4 PIM4 R/W √ √ − 00H
F0045H Port input mode register 5 PIM5 R/W √ √ − 00H
F0048H Port input mode register 8 PIM8 R/W √ √ − 00H
F004EH Port input mode register 14 PIM14 R/W √ √ − 00H
F0050H Port output mode register 0 POM0 R/W √ √ − 00H
F0051H Port output mode register 1 POM1 R/W √ √ − 00H
F0054H Port output mode register 4 POM4 R/W √ √ − 00H
F0055H Port output mode register 5 POM5 R/W √ √ − 00H
F0057H Port output mode register 7 POM7 R/W √ √ − 00H
F0058H Port output mode register 8 POM8 R/W √ √ − 00H
F0059H Port output mode register 9 POM9 R/W √ √ − 00H
F005EH Port output mode register 14 POM14 R/W √ √ − 00H
F0060H Port mode control register 0 PMC0 R/W √ √ − FFH
F0063H Port mode control register 3 PMC3 R/W √ √ − FFH
F006AH Port mode control register 10 PMC10 R/W √ √ − FFH
F006BH Port mode control register 11 PMC11 R/W √ √ − FFH
F006CH Port mode control register 12 PMC12 R/W √ √ − FFH
F006EH Port mode control register 14 PMC14 R/W √ √ − FFH
Address Special Function Register (SFR) Name Symbol R/W Manipulable Bit Range After Reset
1-bit 8-bit 16-bit
F0070H Noise filter enable register 0 NFEN0 R/W √ √ − 00H
F0071H Noise filter enable register 1 NFEN1 R/W √ √ − 00H
F0072H Noise filter enable register 2 NFEN2 R/W √ √ − 00H
F0073H Input switch control register ISC R/W √ √ − 00H
F0074H Timer input select register 0 TIS0 R/W − √ − 00H
F0076H A/D port configuration register ADPC R/W − √ − 00H
F0077H Peripheral I/O redirection PIOR R/W − √ − 00H
register
F0078H Invalid memory access IAWCTL R/W − √ − 00H
detection control register
<R> F007DH Global digital input disable GDIDIS R/W √ √ − 00H
register
F0090H Data flash control register DFLCTL R/W √ √ − 00H
<R> F00A0H High-speed on-chip oscillator HIOTRM R/W − √ − Note
trimming register
F00A8H High-speed on-chip oscillator HOCODIV R/W − √ − Undefined
frequency select register
F00E0H Multiplication/division data MDCL R/W − − √ 0000H
register C (L)
F00E2H Multiplication/division data MDCH R/W − − √ 0000H
register C (H)
F00E8H Multiplication/division control MDUC R/W √ √ − 00H
register
F00F0H Peripheral enable register 0 PER0 R/W √ √ − 00H
F00F3H Operation speed mode control OSMC R/W − √ − 00H
register
F00F5H RAM parity error control register RPECTL R/W √ √ − 00H
F00FEH BCD adjust result register BCDADJ R − √ − Undefined
F0100H Serial status register 00 SSR00L SSR00 R − √ √ 0000H
F0101H − − −
F0102H Serial status register 01 SSR01L SSR01 R − √ √ 0000H
F0103H − − −
F0104H Serial status register 02 SSR02L SSR02 R − √ √ 0000H
F0105H − − −
F0106H Serial status register 03 SSR03L SSR03 R − √ √ 0000H
F0107H − − −
F0108H Serial flag clear trigger register SIR00L SIR00 R/W − √ √ 0000H
F0109H 00 − − −
F010AH Serial flag clear trigger register SIR01L SIR01 R/W − √ √ 0000H
F010BH 01 − − −
F010CH Serial flag clear trigger register SIR02L SIR02 R/W − √ √ 0000H
F010DH 02 − − −
F010EH Serial flag clear trigger register SIR03L SIR03 R/W − √ √ 0000H
F010FH 03 − − −
Address Special Function Register (SFR) Name Symbol R/W Manipulable Bit Range After Reset
1-bit 8-bit 16-bit
F0110H Serial mode register 00 SMR00 R/W − − √ 0020H
F0111H
F0112H Serial mode register 01 SMR01 R/W − − √ 0020H
F0113H
F0114H Serial mode register 02 SMR02 R/W − − √ 0020H
F0115H
F0116H Serial mode register 03 SMR03 R/W − − √ 0020H
F0117H
F0118H Serial communication operation SCR00 R/W − − √ 0087H
F0119H setting register 00
Address Special Function Register (SFR) Name Symbol R/W Manipulable Bit Range After Reset
1-bit 8-bit 16-bit
F0148H Serial flag clear trigger register SIR10L SIR10 R/W − √ √ 0000H
F0149H 10 − − −
F014AH Serial flag clear trigger register SIR11L SIR11 R/W − √ √ 0000H
F014BH 11 − − −
F014CH Serial flag clear trigger register SIR12L SIR12 R/W − √ √ 0000H
F014DH 12 − − −
F014EH Serial flag clear trigger register SIR13L SIR13 R/W − √ √ 0000H
F014FH 13 − − −
F0150H Serial mode register 10 SMR10 R/W − − √ 0020H
F0151H
F0152H Serial mode register 11 SMR11 R/W − − √ 0020H
F0153H
F0154H Serial mode register 12 SMR12 R/W − − √ 0020H
F0155H
F0156H Serial mode register 13 SMR13 R/W − − √ 0020H
F0157H
F0158H Serial communication operation SCR10 R/W − − √ 0087H
F0159H setting register 10
Address Special Function Register (SFR) Name Symbol R/W Manipulable Bit Range After Reset
1-bit 8-bit 16-bit
F0180H Timer counter register 00 TCR00 R − − √ FFFFH
F0181H
F0182H Timer counter register 01 TCR01 R − − √ FFFFH
F0183H
F0184H Timer counter register 02 TCR02 R − − √ FFFFH
F0185H
F0186H Timer counter register 03 TCR03 R − − √ FFFFH
F0187H
F0188H Timer counter register 04 TCR04 R − − √ FFFFH
F0189H
F018AH Timer counter register 05 TCR05 R − − √ FFFFH
F018BH
F018CH Timer counter register 06 TCR06 R − − √ FFFFH
F018DH
F018EH Timer counter register 07 TCR07 R − − √ FFFFH
F018FH
F0190H Timer mode register 00 TMR00 R/W − − √ 0000H
F0191H
F0192H Timer mode register 01 TMR01 R/W − − √ 0000H
F0193H
F0194H Timer mode register 02 TMR02 R/W − − √ 0000H
F0195H
F0196H Timer mode register 03 TMR03 R/W − − √ 0000H
F0197H
F0198H Timer mode register 04 TMR04 R/W − − √ 0000H
F0199H
F019AH Timer mode register 05 TMR05 R/W − − √ 0000H
F019BH
F019CH Timer mode register 06 TMR06 R/W − − √ 0000H
F019DH
F019EH Timer mode register 07 TMR07 R/W − − √ 0000H
F019FH
F01A0H Timer status register 00 TSR00L TSR00 R − √ √ 0000H
F01A1H − − −
F01A2H Timer status register 01 TSR01L TSR01 R − √ √ 0000H
F01A3H − − −
Address Special Function Register (SFR) Name Symbol R/W Manipulable Bit Range After Reset
1-bit 8-bit 16-bit
F01A4H Timer status register 02 TSR02L TSR02 R − √ √ 0000H
F01A5H − − −
F01A6H Timer status register 03 TSR03L TSR03 R − √ √ 0000H
F01A7H − − −
F01A8H Timer status register 04 TSR04L TSR04 R − √ √ 0000H
F01A9H − − −
F01AAH Timer status register 05 TSR05L TSR05 R − √ √ 0000H
F01ABH − − −
F01ACH Timer status register 06 TSR06L TSR06 R − √ √ 0000H
F01ADH − − −
F01AEH Timer status register 07 TSR07L TSR07 R − √ √ 0000H
F01AFH − − −
F01B0H Timer channel enable status TE0L TE0 R √ √ √ 0000H
F01B1H register 0 − − −
F01B2H Timer channel start register 0 TS0L TS0 R/W √ √ √ 0000H
F01B3H − − −
F01B4H Timer channel stop register 0 TT0L TT0 R/W √ √ √ 0000H
F01B5H − − −
F01B6H Timer clock select register 0 TPS0 R/W − − √ 0000H
F01B7H
F01B8H Timer output register 0 TO0L TO0 R/W − √ √ 0000H
F01B9H − − −
F01BAH Timer output enable register 0 TOE0L TOE0 R/W √ √ √ 0000H
F01BBH − − −
F01BCH Timer output level register 0 TOL0L TOL0 R/W − √ √ 0000H
F01BDH − − −
F01BEH Timer output mode register 0 TOM0L TOM0 R/W − √ √ 0000H
F01BFH − − −
F01C0H Timer counter register 10 TCR10 R − − √ FFFFH
F01C1H
F01C2H Timer counter register 11 TCR11 R − − √ FFFFH
F01C3H
F01C4H Timer counter register 12 TCR12 R − − √ FFFFH
F01C5H
F01C6H Timer counter register 13 TCR13 R − − √ FFFFH
F01C7H
Address Special Function Register (SFR) Name Symbol R/W Manipulable Bit Range After Reset
1-bit 8-bit 16-bit
F01C8H Timer counter register 14 TCR14 R − − √ FFFFH
F01C9H
F01CAH Timer counter register 15 TCR15 R − − √ FFFFH
F01CBH
F01CCH Timer counter register 16 TCR16 R − − √ FFFFH
F01CDH
F01CEH Timer counter register 17 TCR17 R − − √ FFFFH
F01CFH
<R> F01D0H Timer mode register 10 TMR10 R/W − − √ 0000H
F01D1H
<R> F01D2H Timer mode register 11 TMR11 R/W − − √ 0000H
F01D3H
<R> F01D4H Timer mode register 12 TMR12 R/W − − √ 0000H
F01D5H
<R> F01D6H Timer mode register 13 TMR13 R/W − − √ 0000H
F01D7H
<R> F01D8H Timer mode register 14 TMR14 R/W − − √ 0000H
F01D9H
<R> F01DAH Timer mode register 15 TMR15 R/W − − √ 0000H
F01DBH
<R> F01DCH Timer mode register 16 TMR16 R/W − − √ 0000H
F01DDH
<R> F01DEH Timer mode register 17 TMR17 R/W − − √ 0000H
F01DFH
F01E0H Timer status register 10 TSR10L TSR10 R − √ √ 0000H
F01E1H − − −
F01E2H Timer status register 11 TSR11L TSR11 R − √ √ 0000H
F01E3H − − −
F01E4H Timer status register 12 TSR12L TSR12 R − √ √ 0000H
F01E5H − − −
F01E6H Timer status register 13 TSR13L TSR13 R − √ √ 0000H
F01E7H − − −
F01E8H Timer status register 14 TSR14L TSR14 R − √ √ 0000H
F01E9H − − −
F01EAH Timer status register 15 TSR15L TSR15 R − √ √ 0000H
F01EBH − − −
F01ECH Timer status register 16 TSR16L TSR16 R − √ √ 0000H
F01EDH − − −
F01EEH Timer status register 17 TSR17L TSR17 R − √ √ 0000H
F01EFH − − −
F01F0H Timer channel enable status TE1L TE1 R √ √ √ 0000H
F01F1H register 1 − − −
F01F2H Timer channel start register 1 TS1L TS1 R/W √ √ √ 0000H
F01F3H − − −
Address Special Function Register (SFR) Name Symbol R/W Manipulable Bit Range After Reset
1-bit 8-bit 16-bit
F01F4H Timer channel stop register 1 TT1L TT1 R/W √ √ √ 0000H
F01F5H − − −
F01F6H Timer clock select register 1 TPS1 R/W − − √ 0000H
F01F7H
F01F8H Timer output register 1 TO1L TO1 R/W − √ √ 0000H
F01F9H − − −
F01FAH Timer output enable register 1 TOE1L TOE1 R/W √ √ √ 0000H
F01FBH − − −
F01FCH Timer output level register 1 TOL1L TOL1 R/W − √ √ 0000H
F01FDH − − −
F01FEH Timer output mode register 1 TOM1L TOM1 R/W − √ √ 0000H
F01FFH − − −
F0200H DMA SFR address register 2 DSA2 R/W − √ − 00H
F0201H DMA SFR address register 3 DSA3 R/W − √ − 00H
F0202H DMA RAM address register 2L DRA2L DRA2 R/W − √ √ 00H
F0203H DMA RAM address register 2H DRA2H R/W − √ 00H
F0204H DMA RAM address register 3L DRA3L DRA3 R/W − √ √ 00H
F0205H DMA RAM address register 3H DRA3H R/W − √ 00H
F0206H DMA byte count register 2L DBC2L DBC2 R/W − √ √ 00H
F0207H DMA byte count register 2H DBC2H R/W − √ 00H
F0208H DMA byte count register 3L DBC3L DBC3 R/W − √ √ 00H
F0209H DMA byte count register 3H DBC3H R/W − √ 00H
F020AH DMA mode control register 2 DMC2 R/W √ √ − 00H
F020BH DMA mode control register 3 DMC3 R/W √ √ − 00H
F020CH DMA operation control register 2 DRC2 R/W √ √ − 00H
F020DH DMA operation control register 3 DRC3 R/W √ √ − 00H
F0230H IICA control register 00 IICCTL00 R/W √ √ − 00H
F0231H IICA control register 01 IICCTL01 R/W √ √ − 00H
F0232H IICA low-level width setting IICWL0 R/W − √ − FFH
register 0
F0233H IICA high-level width setting IICWH0 R/W − √ − FFH
register 0
F0234H Slave address register 0 SVA0 R/W − √ − 00H
F0238H IICA control register 10 IICCTL10 R/W √ √ − 00H
F0239H IICA control register 11 IICCTL11 R/W √ √ − 00H
F023AH IICA low-level width setting IICWL1 R/W − √ − FFH
register 1
F023BH IICA high-level width setting IICWH1 R/W − √ − FFH
register 1
F023CH Slave address register 1 SVA1 R/W − √ − 00H
F02F0H Flash memory CRC control CRC0CTL R/W √ √ − 00H
register
F02F2H Flash memory CRC operation PGCRCL R/W − − √ 0000H
result register
F02FAH CRC data register CRCD R/W − − √ 0000H
Remark For SFRs in the SFR area, see Table 3-5 SFR List.
[Function]
Relative addressing stores in the program counter (PC) the result of adding a displacement value included in the
instruction word (signed complement data: −128 to +127 or −32768 to +32767) to the program counter (PC)’s value
(the start address of the next instruction), and specifies the program address to be used as the branch destination.
Relative addressing is applied only to branch instructions.
PC
OP code
[Function]
Immediate addressing stores immediate data of the instruction word in the program counter, and specifies the
program address to be used as the branch destination.
For immediate addressing, CALL !!addr20 or BR !!addr20 is used to specify 20-bit addresses and CALL !addr16 or
BR !addr16 is used to specify 16-bit addresses. 0000 is set to the higher 4 bits when specifying 16-bit addresses.
PC
OP code
Low Addr.
High Addr.
Seg Addr.
Low Addr.
0000
High Addr.
[Function]
Table indirect addressing specifies a table address in the CALLT table area (0080H to 00BFH) with the 5-bit
immediate data in the instruction word, stores the contents at that table address and the next address in the program
counter (PC) as 16-bit data, and specifies the program address. Table indirect addressing is applied only for CALLT
instructions.
In the RL78 microcontrollers, branching is enabled only to the 64 KB space from 00000H to 0FFFFH.
OP code
High Addr.
<R> 00000000 10 0
Low Addr.
Table address
Memory
0000
[Function]
Register direct addressing stores in the program counter (PC) the contents of a general-purpose register pair
(AX/BC/DE/HL) and CS register of the current register bank specified with the instruction word as 20-bit data, and
specifies the program address. Register direct addressing can be applied only to the CALL AX, BC, DE, HL, and BR
AX instructions.
OP code
CS rp
[Function]
Instructions for accessing registers (such as accumulators) that have special functions are directly specified with the
instruction word, without using any register specification field in the instruction word.
[Operand format]
Because implied addressing can be automatically employed with an instruction, no particular operand format
is necessary.
Implied addressing can be applied only to MULU X.
OP code A register
Memory
[Function]
Register addressing accesses a general-purpose register as an operand. The instruction word of 3-bit long is used
to select an 8-bit register and the instruction word of 2-bit long is used to select a 16-bit register.
[Operand format]
Identifier Description
r X, A, C, B, E, D, L, H
OP code Register
Memory
[Function]
Direct addressing uses immediate data in the instruction word as an operand address to directly specify the target
address.
[Operand format]
Identifier Description
ADDR16 Label or 16-bit immediate data (only the space from F0000H to FFFFFH is specifiable)
ES: ADDR16 Label or 16-bit immediate data (higher 4-bit addresses are specified by the ES register)
FFFFFH
OP code
Low Addr.
Target memory
High Addr.
F0000H
Memory
FFFFFH
ES
OP code
Low Addr.
Target memory
High Addr.
00000H
Memory
[Function]
Short direct addressing directly specifies the target addresses using 8-bit data in the instruction word. This type of
addressing is applied only to the space from FFE20H to FFF1FH.
[Operand format]
Identifier Description
SADDR Label, FFE20H to FFF1FH immediate data, or 0FE20H to 0FF1FH immediate data
SADDRP Label, FFE20H to FFF1FH immediate data, or 0FE20H to 0FF1FH immediate data (even address only)
(only the space from FFE20H to FFF1FH is specifiable)
OP code
FFF1FH
saddr saddr
FFE20H
Memory
Remark SADDR and SADDRP are used to describe the values of addresses FE20H to FF1FH with 16-bit immediate
data (higher 4 bits of actual address are omitted), and the values of addresses FFE20H to FFF1FH with 20-
bit immediate data.
Regardless of whether SADDR or SADDRP is used, addresses within the space from FFE20H to FFF1FH
are specified for the memory.
[Function]
SFR addressing directly specifies the target SFR addresses using 8-bit data in the instruction word. This type of
addressing is applied only to the space from FFF00H to FFFFFH.
[Operand format]
Identifier Description
FFFFFH
OP code SFR
FFF00H
SFR
Memory
[Function]
Register indirect addressing directly specifies the target addresses using the contents of the register pair specified
with the instruction word as an operand address.
[Operand format]
Identifier Description
FFFFFH
F0000H
Memory
FFFFFH
ES
00000H
Memory
[Function]
Based addressing uses the contents of a register pair specified with the instruction word as a base address, and 8-
bit immediate data or 16-bit immediate data as offset data. The sum of these values is used to specify the target
address.
[Operand format]
Identifier Description
− [HL + byte], [DE + byte], [SP + byte] (only the space from F0000H to FFFFFH is specifiable)
− ES:[HL + byte], ES:[DE + byte] (higher 4-bit addresses are specified by the ES register)
FFFFFH
SP Target memory
F0000H
OP code
byte
Memory
FFFFFH
F0000H
OP code
byte
Memory
FFFFFH
F0000H
OP code
Low Addr.
High Addr.
Memory
FFFFFH
F0000H
OP code
Low Addr.
High Addr.
Memory
FFFFFH
ES
OP code
00000H
byte
Memory
FFFFFH
ES
OP code
00000H
Low Addr.
Memory
High Addr.
FFFFFH
ES
OP code
00000H
Low Addr.
Memory
High Addr.
[Function]
Based indexed addressing uses the contents of a register pair specified with the instruction word as the base
address, and the content of the B register or C register similarly specified with the instruction word as offset address.
The sum of these values is used to specify the target address.
[Operand format]
Identifier Description
FFFFFH
OP code
F0000H
r (B/C)
Memory
FFFFFH
OP code
ES
00000H
r (B/C) Memory
[Function]
The stack area is indirectly addressed with the stack pointer (SP) contents. This addressing is automatically
employed when the PUSH, POP, subroutine call, and return instructions are executed or the register is
saved/restored upon generation of an interrupt request.
Stack addressing is applied only to the internal RAM area.
[Operand format]
Identifier Description
− PUSH AX/BC/DE/HL
POP AX/BC/DE/HL
CALL/CALLT
RET
BRK
RETB
(Interrupt request generated)
RETI
Pin I/O buffer power supplies depend on the product. The relationship between these power supplies and the pins is
shown below.
(1) 20-pin, 24-pin, 25-pin, 30-pin, 32-pin, 36-pin, 40-pin, 44-pin, 48-pin, 52-pin products
The RL78/G13 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 2 PIN FUNCTIONS.
Item Configuration
Item Configuration
Port • 80-pin products
Total: 74 (CMOS I/O: 64, CMOS input: 5, CMOS output: 1, N-ch open drain I/O: 4)
• 100-pin products
Total: 92 (CMOS I/O: 82, CMOS input: 5, CMOS output: 1, N-ch open drain I/O: 4)
• 128-pin products
Total: 120 (CMOS I/O: 110, CMOS input: 5, CMOS output: 1, N-ch open drain I/O: 4)
Pull-up resistor • 20-pin products Total: 10
• 24-pin products Total: 12
• 25-pin products Total: 12
• 30-pin products Total: 17
• 32-pin products Total: 18
• 36-pin products Total: 20
• 40-pin products Total: 21
• 44-pin products Total: 23
• 48-pin products Total: 26
• 52-pin products Total: 30
• 64-pin products Total: 40
• 80-pin products Total: 52
• 100-pin products Total: 67
• 128-pin products Total: 95
Caution Most of the following descriptions in this chapter use the 128-pin products with the 00H setting in
peripheral I/O redirection register (PIOR) as an example.
4.2.1 Port 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 P00 to P07 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 P01, 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 P00 and 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).
<R> Input to the P00 to P03 pins can be specified as analog input or digital input in 1-bit units, using port mode control
register 0 (PMC0).
This port can also be used for timer I/O, A/D converter analog input, serial interface data I/O, and clock I/O.
<R> When reset signal is generated, the following configuration will be set.
· P00 and P01 pins of the 20, 24, 25, 30, and 32-pin products ··· Analog input
· P00, P01 and P04 to P07 pins of the other products ··· Input mode
· P02 and P03 pins of the other products ··· Analog input
Pin Name PM0× PIM0× POM0× PMC0× Alternate Function Setting Remark
Name I/O
Note 1
P00 Input 1 − × 0 ×
Note 1 Note 3
Output 0 0 0 TxD1 output = 1 CMOS output
Note 1
0 1 0 N-ch O.D. output
Note 1
P01 Input 1 0 − 0 × CMOS input
Note 1
1 1 0 × TTL input
Note 1 Note 4
Output 0 × 0 TO00 output = 0
Note 2
P02 Input 1 − × 0 ×
Note 2 Note 5
Output 0 0 0 SO10/TxD1 output = 1 CMOS output
Note 2
0 1 0 N-ch O.D. output
Note 2
P03 Input 1 0 × 0 × CMOS input
Note 2
1 1 × 0 × TTL input
Note 2 Note 5
Output 0 × 0 0 SDA10 output = 1 CMOS output
Note 2
0 × 1 0 N-ch O.D. output
P04 Input 1 0 × − × CMOS input
1 1 × × TTL input
Note 5
Output 0 × 0 SCK10/SCL10 output = 1 CMOS output
0 × 1 N-ch O.D. output
P05, P06 Input 1 − − −
Note 6
Output 0 TO05 output, TO06 output = 0
P07 Input 1 − − − −
Output 0
<R> For example, figures 4-1 to 4-6 show block diagrams of port 0 for 128-pin products when PIOR = 00H.
EVDD
WRPU
PU0
PU00
P-ch
Alternate
function
RD
Selector
Internal bus
WRPORT
P0
Output latch
P00/TI00
(P00)
WRPOM
POM0
POM00
WRPM
PM0
PM00
WRPIM
PIM0
PIM01 EVDD
WRPU
PU0
PU01
P-ch
CMOS
RD
Internal bus
Selector
TTL
WRPORT
P0
Output latch
(P01) P01/TO00
WRPM
PM0
PM01
Alternate
function
EVDD
WRPU
PU0
PU02
P-ch
WRPMC
PMC0
PMC02
RD
Selector
WRPORT
Internal bus
P0
Output latch
(P02) P02/SO10/TxD1/ANI17
WRPOM
POM0
POM02
WRPM
PM0
PM02
Alternate
function
A/D converter
WRPIM
PIM0
PIM03 EVDD
WRPU
PU0
PU03
P-ch
WRPMC
PMC0
PMC03
Alternate
function
CMOS
Internal bus
RD
Selector
TTL
WRPORT
P0
Output latch
(P03) P03/SI10/RxD1/
SDA10/ANI16
WRPOM
POM0
POM03
WRPM
PM0
PM03
Alternate
function
A/D converter
WRPIM
PIM0
PIM04 EVDD
WRPU
PU0
PU04
P-ch
Alternate
function
CMOS
RD Selector
Internal bus
TTL
WRPORT
P0
Output latch
(P04) P04/SCK10/SCL10
WRPOM
POM0
POM04
WRPM
PM0
PM04
Alternate
function
PU05 to PU07
P-ch
RD
Internal bus
WRPORT Selector
P0
Output latch
P05 to P07
(P05 to P07)
WRPM
PM0
PM05 to PM07
4.2.2 Port 1
Port 1 is an I/O port with an output latch. Port 1 can be set to the input mode or output mode in 1-bit units using port
mode register 1 (PM1). When the P10 to P17 pins are used as an input port, use of an on-chip pull-up resistor can be
specified in 1-bit units by pull-up resistor option register 1 (PU1).
Input to the P10, P11, and P13 to P17 pins can be specified through a normal input buffer or a TTL input buffer in 1-bit
units using port input mode register 1 (PIM1).
Output from the P10 to P15 and P17 pins can be specified as N-ch open-drain output (VDD tolerance) in 1-bit units
using port output mode register 1 (POM1).
This port can also be used for serial interface data I/O, clock I/O, programming UART I/O, timer I/O, and external
interrupt request input.
Reset signal generation sets port 1 to input mode.
<R> For example, figures 4-7 to 4-14 show block diagrams of port 1 for 128-pin products when PIOR = 00H.
WRPIM
PIM1
PIM10 EVDD
WRPU
PU1
PU10
P-ch
Alternate
function
CMOS
RD
Selector
TTL
Internal bus
WRPORT
P1
Output latch
(P10) P10/SCK00/SCL00
WRPOM
POM1
POM10
WRPM
PM1
PM10
Alternate
function
WRPIM
PIM1
PIM11 EVDD
WRPU
PU1
PU11
P-ch
Alternate
function
CMOS
RD Selector
Internal bus
TTL
WRPORT
P1
Output latch
(P11) P11/SI00/RxD0/
SDA00/TOOLRxD
WRPOM
POM1
POM11
WRPM
PM1
PM11
Alternate
function
EVDD
WRPU
PU1
PU12
P-ch
RD
Selector
Internal bus
WRPORT
P1
Output latch
(P12) P12/SO00/
WRPOM TxD0/TOOLTxD
POM1
POM12
WRPM
PM1
PM12
Alternate
function
WRPIM
PIM1
PIM13 EVDD
WRPU
PU1
PU13
P-ch
CMOS
RD
Selector
Internal bus
TTL
WRPORT
P1
Output latch
(P13) P13/TxD2/SO20
WRPOM
POM1
POM13
WRPM
PM1
PM13
Alternate
function
WRPIM
PIM1
PIM14 EVDD
WRPU
PU1
PU14
P-ch
Alternate
function
CMOS
RD
Selector
TTL
Internal bus
WRPORT
P1
Output latch
(P14) P14/SI20/RxD2/SDA20
WRPOM
POM1
POM14
WRPM
PM1
PM14
Alternate
function
WRPIM
PIM1
PIM15 EVDD
WRPU
PU1
PU15
P-ch
Alternate
function
CMOS
RD Selector
TTL
Internal bus
WRPORT
P1
Output latch
(P15) P15/SCK20/SCL20
WRPOM
POM1
POM15
WRPM
PM1
PM15
Alternate
function
WRPIM
PIM1
PIM16 EVDD
WRPU
PU1
PU16
P-ch
Alternate
function
CMOS
RD
Internal bus
Selector
TTL
WRPORT
P1
Output latch
(P16) P16/TI01/TO01/INTP5
WRPM
PM1
PM16
Alternate
function
WRPIM
PIM1
PIM17 EVDD
WRPU
PU1
PU17
P-ch
Alternate
function
CMOS
RD
Selector
Internal bus
TTL
WRPORT
P1
Output latch
(P17) P17/TI02/TO02
WRPOM
POM1
POM17
WRPM
PM1
PM17
Alternate
function
4.2.3 Port 2
Port 2 is an I/O port with an output latch. Port 2 can be set to the input mode or output mode in 1-bit units using port
mode register 2 (PM2).
This port can also be used for A/D converter analog input and reference voltage input.
To use P20/ANI0 to P27/ANI7 as digital input pins, set them in the digital I/O mode by using the A/D port configuration
register (ADPC) and in the input mode by using the PM2 register. Use these pins starting from the upper bit.
To use P20/ANI0 to P27/ANI7 as digital output pins, set them in the digital I/O mode by using the ADPC register and in
the output mode by using the PM2 register.
To use P20/ANI0 to P27/ANI7 as analog input pins, set them in the analog input mode by using the A/D port
configuration register (ADPC) and in the input mode by using the PM2 register. Use these pins starting from the lower bit.
All P20/ANI0 to P27/ANI7 are set in the analog input mode when the reset signal is generated.
<R> For example, figure 4-15 shows a block diagram of port 2 for 128-pin products when PIOR = 00H.
WRADPC
ADPC
0:Analog input
1:Digital I/O
ADPC3 to ADPC0
RD
Selector
Internal bus
WRPORT
P2
PM20 to PM27
A/D converter
4.2.4 Port 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 to P37 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 3 (PU3).
<R> Input to the P35 to P37 pins can be specified as analog input or digital input in 1-bit units, using port mode control
register 3 (PMC3).
This port can also be used for external interrupt request input, real-time clock correction clock output, clock/buzzer
output, timer I/O, and A/D converter analog input.
<R> Reset signal generation sets P30 to P34 to input mode, and sets P35 to P37 to analog input.
P30 Input 1 − ×
Note 1
Output 0 RTC1HZ output = 0
Note 2
SCK11/SCL11 output = 0
P31 Input 1 − ×
Note 3
Output 0 TO03 output = 0
Note 4
PCLBUZ0 output = 0
Note 5
(PCLBUZ0 output = 0 )
Notes 1. To use P30/RTC1HZ/INTP3 as a general-purpose port, set bit 5 (RCLOE1) of real-time clock control
register 0 (RTCC0) to “0”, which is the same as its default status setting.
2. To use P30/INTP3/RTC1HZ/SCK11/SCL11 as a general-purpose port in 20-pin to 100-pin products, set
serial channel enable status register 0 (SE0), serial output register 0 (SO0) and serial output enable
register 0 (SOE0) to the default status.
3. To use P31/TI03/TO03/INTP4 as a general-purpose port, set bit 3 (TO03) of timer output register 0 (TO0)
and bit 3 (TOE03) of timer output enable register 0 (TOE0) to “0”, which is the same as their default status
setting.
4. To use P31/TI03/TO03/INTP4/PCLBUZ0 as a general-purpose port in 24- to 44-pin products, set bit 7
(PCLOE0) of clock output select register 0 (CKS0) to “0”, which is the same as their default status setting.
5. To use P31 as a general-purpose port, do not set PIOR3 set to 1.
6. The descriptions in parentheses indicate the case where PIORx = 1.
<R> For example, figures 4-16 to 4-19 show block diagrams of port 3 for 128-pin products when PIOR = 00H.
EVDD
WRPU
PU3
PU30
P-ch
Alternate
function
RD
Selector
Internal bus
WRPORT
P3
Output latch
(P30) P30/RTC1HZ/INTP3
WRPM
PM3
PM30
Alternate
function
EVDD
WRPU
PU3
PU31
P-ch
Alternate
function
RD
Selector
Internal bus
WRPORT
P3
Output latch
(P31) P31/TI03/TO03/INTP4
WRPM
PM3
PM31
Alternate
function
EVDD
WRPU
PU3
PU32 to PU34
P-ch
RD
Internal bus
WRPORT Selector
P3
Output latch
(P32 to P34) P32 to P34
WRPM
PM3
PM32 to PM34
EVDD
WRPU
PU3
PU35 to PU37
P-ch
WRPMC
PMC3
PMC35 to PMC37
RD
Internal bus
Selector
WRPORT
P3
Output latch
(P35 to P37) P35/ANI23 to
P37/ANI21
WRPM
PM3
PM35 to PM37
A/D converter
4.2.5 Port 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 to P47 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 4 (PU4).
Input to the P43 and P44 pins can be specified through a normal input buffer or a TTL input buffer in 1-bit units using
port input mode register 4 (PIM4).
Output from the P430 to P45 pins can be specified as N-ch open-drain output (VDD tolerance) in 1-bit units using port
output mode register 4 (POM4).
This port can also be used for data I/O for a flash memory programmer/debugger, timer I/O, serial interface data I/O,
clock I/O, and external interrupt request input.
Reset signal generation sets port 4 to input mode.
P40 Input 1 − − ×
Output 0 ×
P41 Input 1 − − ×
Note 1
Output 0 TO07 output = 0
P42 Input 1 − − ×
Note 2
Output 0 TO04 output = 0
Notes 1. P41/TI07/TO07 as a general-purpose port in 44- to 80-pin products, set bit 7 (TO07) of timer output
register 0 (TO0) and bit 7 (TOE07) of timer output enable register 7 (TOE7) to “0”, which is the same as
their default status setting.
2. To use P42/TI04/TO04 or P46/INTP1/TI05/TO05 as a general-purpose port, set bits 4 and 5 (TO04, TO05)
of timer output register 0 (TO0) and bits 4 and 5 (TOE04, TOE05) of timer output enable register 0 (TOE0)
to “0”, which is the same as their default status setting.
3. P43/SCK01/SCL01, P44/SI01/SDA01, P45/SO01 as a general-purpose port, set serial channel enable
status register 0 (SE0), serial output register 0 (SO0) and serial output enable register 0 (SOE0) to the
default status.
Caution When a tool is connected, the P40 pin cannot be used as a port pin.
<R> For example, figures 4-20 to 4-26 show block diagrams of port 4 for 128-pin products when PIOR = 00H.
EVDD
WRPU
PU4
PU40
P-ch
Alternate
function
RD
Selector
Internal bus
WRPORT
P4
Output latch
Selector
(P40)
P40/TOOL0
WRPM
PM4
PM40
Alternate
function
EVDD
WRPU
PU4
PU41
P-ch
RD
Internal bus
Selector
WRPORT
P4
Output latch
P41
(P41)
WRPM
PM4
PM41
EVDD
WRPU
PU4
PU42
P-ch
Alternate
function
RD
Selector
Internal bus
WRPORT
P4
Output latch
(P42) P42/TI04/TO04
WRPM
PM4
PM42
Alternate
function
WRPIM
PIM4
PU43, PU44
P-ch
Alternate
function
CMOS
RD
Internal bus
Selector
TTL
WRPORT
P4
Output latch
(P43. P44) P43/SCK01/SCL01,
P44/SI01/SDA01
WRPOM
POM4
POM43, POM44
WRPM
PM4
PM43, PM44
Alternate
function
EVDD
WRPU
PU4
PU45
P-ch
RD
Selector
Internal bus
WRPORT
P4
Output latch
(P45) P45/SO01
WRPOM
POM4
POM45
WRPM
PM4
PM45
Alternate
function
EVDD
WRPU
PU4
PU46
P-ch
Alternate
function
RD
Selector
Internal bus
WRPORT
P4
Output latch
(P46) P46/TI05/TO05/INTP1
WRPM
PM4
PM46
Alternate
function
EVDD
WRPU
PU4
PU47
P-ch
Alternate
function
RD
Internal bus
WRPORT Selector
P4
Output latch
P47/INTP2
(P47)
WRPM
PM4
PM47
4.2.6 Port 5
Port 5 is an I/O port with an output latch. Port 5 can be set to the input mode or output mode in 1-bit units using port
mode register 5 (PM5). When the P50 to P57 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 5 (PU5).
Input to the P53 to P55 pins can be specified through a normal input buffer or a TTL input buffer in 1-bit units using port
input mode register 5 (PIM5).
Output from the P50, and P52 to P55 pin can be specified as N-ch open-drain output (VDD tolerance) in 1-bit units using
port output mode register 5 (POM5).
This port can also be used for serial interface data I/O, clock I/O.
Reset signal generation sets port 5 to input mode.
P50 Input 1 − × ×
Note 1
Output 0 0 SDA11 output = 1 CMOS output
0 1 N-ch O.D. output
P51 Input 1 − − ×
Note 1
Output 0 SO11 output = 1
P52 Input 1 − × ×
Note 2
Output 0 0 SO31 output = 1 CMOS output
0 1 N-ch O.D. output
P53 Input 1 0 × × CMOS input
1 1 × × TTL input
Note 2
Output 0 × 0 SDA31 output = 1 CMOS output
0 × 1 N-ch O.D. output
P54 Input 1 0 × × CMOS input
1 1 × × TTL input
Note 1
Output 0 × 0 SCK31/SCL31 output = 1 CMOS output
0 × 1 N-ch O.D. output
P55 Input 1 0 × × CMOS input
1 1 × × TTL input
Note 3
Output 0 × 0 (SCK00 output = 1 ) CMOS output
Note 4
0 × 1 (PCLBUZ1 output = 0 ) N-ch O.D. output
P56, P57 Input 1 − − −
Output 0
Notes 1. To use P50 as a general-purpose port in 24- to 100-pin products or to use P51 as a general-purpose port
in 30- to 100-pin products, set serial channel enable status register 0 (SE0), serial output register 0 (SO0)
and serial output enable register 0 (SOE0) to the default status.
2. P52/SO31, P53/SI31/SDA31, P54/SCK31/SCL31 as a general-purpose port, set serial channel enable
status register 1 (SE1), serial output register 1 (SO1) and serial output enable register 1 (SOE1) to the
default status.
3. To use P55 as a general-purpose port when PIOR1 = 1, set serial channel enable status register 0 (SE0),
serial output register 0 (SO0) and serial output enable register 0 (SOE0) to the default status.
4. To use P55 as a general-purpose port when PIOR4 = 1, set clock output select registers 1 (CKS1) to the
default status.
5. The descriptions in parentheses indicate the case where PIORx = 1.
<R> For example, figures 4-27 to 4-31 show block diagrams of port 5 for 128-pin products when PIOR = 00H.
PU50
P-ch
RD
Selector
Internal bus
WRPORT
P5
Output latch
(P50) P50
WRPOM
POM5
POM50
WRPM
PM5
PM50
RD
Internal bus
WRPORT Selector
P5
Output latch
P51, P56, P57
(P51, P56, P57)
WRPM
PM5
PM51,
PM56, PM57
EVDD
WRPU
PU5
PU52
P-ch
RD
Selector
Internal bus
WRPORT
P5
Output latch
(P52) P52/SO31
WRPOM
POM5
POM52
WRPM
PM5
PM52
Alternate
function
WRPIM
PIM5
PU53, PU54
P-ch
Alternate
function
CMOS
RD
Internal bus
Selector
TTL
WRPORT
P5
Output latch
P53/SI31/SDA31,
(P53, P54)
P54/SCK31/SCL31
WRPOM
POM5
POM53, POM54
WRPM
PM5
PM53, PM54
Alternate
function
WRPIM
PIM5
PIM55 EVDD
WRPU
PU5
PU55
P-ch
CMOS
RD
Internal bus
Selector TTL
WRPORT
P5
Output latch
P55
(P55)
WRPOM
POM5
POM55
WRPM
PM5
PM55
4.2.7 Port 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). When the P64 to P67 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 6 (PU6).
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, and timer I/O.
Reset signal generation sets port 6 to input mode.
Output 0
Note 2
P62 Input 1 SCLA1 output = 0
Output 0
Note 2
P63 Input 1 SDAA1 output = 0
Output 0
Note 2
P64 Input 1 TO10 output = 0
Output 0
Note 2
P65 Input 1 TO11 output = 0
Output 0
Note 2
P66 Input 1 TO12 output = 0
Output 0
Note 2
P67 Input 1 TO13 output = 0
Output 0
Notes 1. Stop the operation of serial interface IICA when using P60/SCLA0, P61/SDAA0, P62/SCLA1, and
P63/SDAA1 as general-purpose ports.
2. To use P64/TI10/TO10 to P67/TI13/TO13 as a general-purpose port, set bits 0 to 3 (TO10 to TO13) of
timer output register 1 (TO1) and bits 0 to 3 (TOE10 to TOE13) of timer output enable register 1 (TOE1) to
“0”, which is the same as their default status setting.
<R> For example, figures 4-32 and 4-33 show block diagrams of port 6 for 128-pin products when PIOR = 00H
Alternate
function
RD
Selector
WRPORT
Internal bus
P6
Output latch P60/SCLA0,
(P60 to P63) P61/SDAA0,
P62/SCLA1,
WRPM P63/SDAA1
PM6
PM60 to PM63
Alternate
function
EVDD
WRPU
PU6
PU64 to PU67
P-ch
Alternate
function
RD
Selector
Internal bus
WRPORT
P6
P64/TI10/TO10,
Output latch P65/TI11/TO11,
(P64 to P67) P66/TI12/TO12.
P67/TI13/TO13
WRPM
PM6
PM64 to PM67
Alternate
function
4.2.8 Port 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 1-bit units by
pull-up resistor option register 7 (PU7).
Output from the P71 and P74 pins can be specified as N-ch open-drain output (VDD tolerance) in 1-bit units using port
output mode register 7 (POM7).
This port can also be used for key interrupt input, serial interface data I/O, clock I/O, and external interrupt request input.
Reset signal generation sets port 7 to input mode.
P70 Input 1 − ×
Note 1
Output 0 SCK21/SCL21 output = 1
P71 Input 1 × ×
Note 1
Output 0 0 SDA21 output = 1 CMOS output
0 1 N-ch O.D. output
P72 Input 1 − ×
Note 1
Output 0 SO21 output = 1
P73 Input 1 − ×
Note 2
Output 0 SO01 output = 1
P74 Input 1 × ×
Note 2
Output 0 0 SDA01 output = 1 CMOS output
0 1 N-ch O.D. output
P75 Input 1 − ×
Note 2
Output 0 SCK01/SCL01 output = 1
P76 Input 1 − ×
Output 0 ×
P77 Input 1 − ×
Note 3
Output 0 (TxD2 output = 1 )
<R> For example, figures 4-34 to 4-38 show block diagrams of port 7 for 128-pin products when PIOR = 00H.
EVDD
WRPU
PU7
PU70
P-ch
Alternate
function
RD
Selector
Internal bus
WRPORT
P7
Output latch
(P70) P70/KR0/SCK21/SCL21
WRPM
PM7
PM70
Alternate
function
EVDD
WRPU
PU7
PU71
P-ch
Alternate
function
RD
Selector
Internal bus
WRPORT
P7
Output latch
(P71) P71/KR1/SI21/SDA21
WRPOM
POM7
POM71
WRPM
PM7
PM71
Alternate
function
EVDD
WRPU
PU7
PU72
P-ch
Alternate
function
RD
Selector
Internal bus
WRPORT
P7
Output latch
(P72) P72/KR2/SO21
WRPM
PM7
PM72
Alternate
function
EVDD
WRPU
PU7
Alternate
function
RD
Internal bus
Selector
WRPORT
P7
Output latch P73/KR3,
(P73, P75 to P77) P75/KR5/INTP9 to
P77/KR7/INTP11
WRPM
PM7
EVDD
WRPU
PU7
PU74
P-ch
Alternate
function
RD
Internal bus
Selector
WRPORT
P7
Output latch
(P74) P74/KR4/INTP8
WRPOM
POM7
POM74
WRPM
PM7
PM74
4.2.9 Port 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 the P80 to P87 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 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 (VDD tolerance) in 1-bit units using port
output mode register 8 (POM8).
Reset signal generation sets port 8 to input mode.
Notes 1. To use P80 to P82 as a general-purpose port when PIOR5 = 1, set serial channel enable status register 1
(SE1), serial output register 1 (SO1) and serial output enable register 1 (SOE1) to the default status.
2. The descriptions in parentheses indicate the case where PIORx = 1.
<R> For example, figures 4-39 to 4-41 show block diagrams of port 8 for 128-pin products when PIOR = 00H.
WRPIM
PIM8
PU80, PU81
P-ch
CMOS
RD
Internal bus
Selector
TTL
WRPORT
P8
Output latch
P80, P81
(P80, P81)
WRPOM
POM8
POM80, POM81
WRPM
PM8
PM80, PM81
PU82
P-ch
RD
Selector
Internal bus
WRPORT
P8
Output latch
(P82) P82
WRPOM
POM8
POM82
WRPM
PM8
PM82
PU83 to PU87
P-ch
RD
Internal bus
WRPORT Selector
P8
Output latch
(P83 to P87) P83 to P87
WRPM
PM8
PM83 to PM87
4.2.10 Port 9
Port 9 is an I/O port with an output latch. Port 9 can be set to the input mode or output mode in 1-bit units using port
mode register 9 (PM9). When 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 9 (PU9).
Output from the P96 pin can be specified as N-ch open-drain output (VDD tolerance) in 1-bit units using port output
mode register 9 (POM9).
This port can also be used for serial interface data I/O, clock I/O.
Reset signal generation sets port 9 to input mode.
P90 to Input 1 − −
P94 Output 0 −
P95 Input 1 − ×
Note
Output 0 SCK11/SCL11 output = 1
P96 Input 1 × ×
Note
Output 0 0 SDA11 output = 1 CMOS output
0 1 N-ch O.D. output
P97 Input 1 − ×
Note
Output 0 SO11 output = 1
Note P95/SCK11/SCL11, P96/SI11/SDA11 or P97/SO11 as a general-purpose port, set serial channel enable status
register 0 (SE0), serial output register 0 (SO0) and serial output enable register 0 (SOE0) to the default status.
EVDD
WRPU
PU9
PU90 to PU94
P-ch
RD
Internal bus
Selector
WRPORT
P9
Output latch
P90 to P94
(P90 to P94)
WRPM
PM9
PM90 to PM94
EVDD
WRPU
PU9
PU95
P-ch
Alternate
function
RD
Selector
Internal bus
WRPORT
P9
Output latch
(P95) P95/SCK11/SCL11
WRPM
PM9
PM95
Alternate
function
EVDD
WRPU
PU9
PU96
P-ch
Alternate
function
RD
Internal bus
Selector
WRPORT
P9
Output latch
(P96) P96/SI11/SDA11
WRPOM
POM9
POM96
WRPM
PM9
PM96
Alternate
function
EVDD
WRPU
PU9
PU97
P-ch
RD
Selector
Internal bus
WRPORT
P9
Output latch
(P97) P97/SO11
WRPM
PM9
PM97
Alternate
function
4.2.11 Port 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 P106 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).
<R> Input to the P100 pin can be specified as analog input or digital input in 1-bit units, using port mode control register 10
(PMC10).
This port can also be used for timer I/O and A/D converter analog input.
<R> Reset signal generation sets P100 to analog input, P101 to P106 to input mode.
P100 Input 1 0 ×
Output 0 0 ×
P101 Input 1 − −
Output 0
P102 Input 1 − ×
Note 1
Output 0 TO06 output = 0
P103 to Input 1 − ×
P106 Output 0 TO14 to TO17 outputs = 0
Note 2
Notes 1. To use P102/TI06/TO06 as a general-purpose port, set bit 6 (TO06) of timer output register 0 (TO0) and bit
6 (TOE06) of timer output enable register 0 (TOE0) to “0”, which is the same as their default status setting.
2. To use P103/TI14/TO14 to P106/TI17/TO17 as a general-purpose port, set bits 4 to 7 (TO14 to TO17) of
timer output register 1 (TO1) and bits 4 to 7 (TOE14 to TOE17) of timer output enable register 1 (TOE1) to
“0”, which is the same as their default status setting.
For example, figures 4-46 to 4-48 show block diagrams of port 10.
EVDD
WRPU
PU10
PU100
P-ch
WRPMC
PMC10
PMC100
Internal bus
RD
Selector
WRPORT
P10
Output latch
(P100) P100/ANI20
WRPM
PM10
PM100
A/D converter
EVDD
WRPU
PU10
PU101
P-ch
RD
Internal bus
Selector
WRPORT
P10
Output latch
P101
(P101)
WRPM
PM10
PM101
EVDD
WRPU
PU10
PU102 to PU106
P-ch
Alternate
function
RD
Selector
Internal bus
WRPORT
P10
P102/TI06/TO06,
Output latch P103/TI14/TO14,
(P102 to P106) P104/TI15/TO15,
P105/TI16/TO16,
WRPM
P106/TI17/TO17
PM10
PM102 to PM106
Alternate
function
4.2.12 Port 11
Port 11 is an I/O port with an output latch. Port 11 can be set to the input mode or output mode in 1-bit units using port
mode register 11 (PM11). When the P110 to P117 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 11 (PU11).
<R> Input to the P115 to P117 pins can be specified as analog input or digital input in 1-bit units, using port mode control
register 11 (PMC11).
This port can also be used for A/D converter analog input.
<R> Reset signal generation sets P110 to P114 to input mode, and sets P115 to P117 to analog input.
P110, Input 1 − ×
P111 Output 0
P112 to Input 1 − −
P114 Output 0
P115 to Input 1 0 ×
P117 Output 0 0 ×
<R> For example, 4-49 and 4-50 show block diagrams of port 11 for 128-pin products when PIOR = 00H.
EVDD
WRPU
PU11
PU110 to PU114
P-ch
RD
Internal bus
Selector
WRPORT
P11
Output latch
P110 to P114
(P110 to P114)
WRPM
PM11
PM110 to PM114
EVDD
WRPU
PU11
PU115 to PU117
P-ch
WRPMC
PMC11
PMC115 to PMC117
RD
Internal bus
Selector
WRPORT
P11
Output latch
(P115 to P117) P115/ANI26 to
P117/ANI24
WRPM
PM11
PM115 to PM117
A/D converter
4.2.13 Port 12
P120 and P125 to 127 are 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 only ports.
<R> Input to the P120 pin can be specified as analog input or digital input in 1-bit units, using port mode control register 12
(PMC12).
This port can also be used for A/D converter analog input, connecting resonator for main system clock, connecting
resonator for subsystem clock, external clock input for main system clock, and external clock input for subsystem clock.
<R> Reset signal generation sets P120 to analog input, and sets P121 to P127 to input mode.
P120 Input 1 0 ×
Output 0 0 ×
P121 Input − − OSCSEL bit of CMC register = 0
or EXCLK bit = 1
P122 Input − − OSCSEL bit of CMC register = 0
P123 Input − − OSCSELS bit of CMC register = 0
or EXCLKS bit = 1
P124 Input − − OSCSELS bit of CMC register = 0
P125 to Input 1 − −
P127 Output 0
Caution The function setting on P121 to P124 is available only once after the reset release. The port once set
for connection to an oscillator cannot be used as an input port unless the reset is performed.
<R> For example, figures 4-51 to 4-54 show block diagrams of port 12 for 128-pin products when PIOR = 00H.
EVDD
WRPU
PU12
PU120
P-ch
WRPMC
PMC12
PMC120
RD
Internal bus
Selector
WRPORT
P12
Output latch
(P120) P120/ANI19
WRPM
PM12
PM120
A/D converter
Clock generator
CMC
OSCSEL
RD
P122/X2/EXCLK
Internal bus
CMC
EXCLK, OSCSEL
RD
P121/X1
Clock generator
CMC
OSCSELS
RD
P124/XT2/EXCLKS
Internal bus
CMC
EXCLKS, OSCSELS
RD
P123/XT1
EVDD
WRPU
PU12
PU125 to PU127
P-ch
RD
Internal bus
Selector
WRPORT
P12
Output latch
P125 to P127
(P125 to P127)
WRPM
PM12
PM125 to PM127
4.2.14 Port 13
P130 is a 1-bit output-only port with an output latch.
P137 is a 1-bit input-only port.
<R> P130 is fixed an output port, and P137 is fixed an input ports.
This port can also be used for external interrupt request input.
P130 Output −
P137 Input ×
RD
Internal bus
WRPORT P13
Remark When 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.
Reset signal
P130
Set by software
RD
Internal bus
P137/INTP0
Alternate
function
4.2.15 Port 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 P147 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 pins can be specified as N-ch open-drain output (VDD tolerance) in 1-bit units using port
output mode register 14 (POM14).
<R> Input to the P147 pin can be specified as analog input or digital input in 1-bit units, using port mode control register 14
(PMC14).
This port can also be used for clock/buzzer output, external interrupt request input, and A/D converter analog input.
<R> Reset signal generation sets P140 to P146 to input mode, and sets P147 to analog input.
Pin Name PM14× PIM14× POM14× PMC14× Alternate Function Setting Remark
Name I/O
P140, Input 1 − − − ×
P141 Output 0 PCLBUZ0 output,
Note 1
PCLBUZ1 output = 0
P146 Input 1 − − − ×
Output 0 ×
P147 Input 1 − − 0 ×
Output 0 0 ×
<R> For example, figures 4-57 to 4-63 show block diagrams of port 14 for 128-pin products when PIOR = 00H.
EVDD
WRPU
PU14
PU140, PU141
P-ch
Alternate
function
RD Selector
Internal bus
WRPORT
P14
Output latch P140/PCLBUZ0/INTP6,
(P140, P141) P141/PCLBUZ1/INTP7
WRPM
PM14
PM140, PM141
Alternate
function
WRPIM
PIM14
PIM142 EVDD
WRPU
PU14
PU142
P-ch
Alternate
function
CMOS
RD Selector
Internal bus
TTL
WRPORT
P14
Output latch
(P142) P142/SCK30/SCL30
WRPOM
POM14
POM142
WRPM
PM14
PM142
Alternate
function
WRPIM
PIM14
PIM143 EVDD
WRPU
PU14
PU143
P-ch
Alternate
function
CMOS
RD
Selector
Internal bus
TTL
WRPORT
P14
Output latch
(P143) P143/SI30/RxD3/SDA30
WRPOM
POM14
POM143
WRPM
PM14
PM143
Alternate
function
EVDD
WRPU
PU14
PU144
P-ch
RD
Selector
Internal bus
WRPORT
P14
Output latch
(P144) P144/SO30/TxD3
WRPOM
POM14
POM144
WRPM
PM14
PM144
Alternate
function
EVDD
WRPU
PU14
PU145
P-ch
Alternate
function
RD
Selector
Internal bus
WRPORT
P14
Output latch
(P145) P145/TI07/TO07
WRPM
PM14
PM145
Alternate
function
EVDD
WRPU
PU14
PU146
P-ch
RD
Internal bus
Selector
WRPORT
P14
Output latch
P146
(P146)
WRPM
PM14
PM146
EVDD
WRPU
PU14
PU147
P-ch
WRPMC
PMC14
PMC147
RD
Internal bus
Selector
WRPORT
P14
Output latch
(P147) P147/ANI18
WRPM
PM14
PM147
A/D converter
4.2.16 Port 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 P150/ANI8 to P156/ANI4 as digital input pins, set them in the digital I/O mode by using the A/D port
configuration register (ADPC) and in the input mode by using the PM15 register. Use these pins starting from the upper
bit.
To use 150/ANI8 to P156/ANI4 as digital output pins, set them in the digital I/O mode by using the ADPC register and
in the output mode by using the PM15 register.
To use 150/ANI8 to P156/ANI4 as analog input pins, set them in the analog input mode by using the A/D port
configuration register (ADPC) and in the input mode by using the PM15 register. Use these pins starting from the lower bit.
All P150/ANI8 to P156/ANI14 are set in the analog input mode when the reset signal is generated.
Figure 4-64 shows a block diagram of port 15.
WRADPC
ADPC
0:Analog input
1:Digital I/O
ADPC3 to ADPC0
RD
Selector
Internal bus
WRPORT
P15
Output latch
P150/ANI8 to P156/ANI14
(P150 to P156)
WRPM
PM15
PM150 to PM156
A/D converter
<R> Table 4-21. PMxx, Pxx, PUxx, PIMxx, POMxx, PMCxx registers and the bits mounted on each product
− √ √ √ √ √ √ √ √ √ √ √
Note1
Port 0 0 PM00 P00 PU00 POM00 PMC00
− √ √ √ √ √ √ √ √ √ √ √
Note1
1 PM01 P01 PU01 PIM01 PMC01
2 PM02 P02 PU02 − POM02 PMC02 √ √ − − − − − − − − −
√ √ − − − − − − − − −
Note2
3 PM03 P03 PU03 PIM03 POM03 PMC03
4 PM04 P04 PU04 PIM04 POM04 − √ − − − − − − − − − −
5 PM05 P05 PU05 − − − √ − − − − − − − − − −
6 PM06 P06 PU06 − − − √ − − − − − − − − − −
7 − − − − − − − − − − − − − − − − −
Port 1 0 PM10 P10 PU10 PIM10 POM10 − √ √ √ √ √ √ √ √ √ √ √
1 PM11 P11 PU11 PIM11 POM11 − √ √ √ √ √ √ √ √ √ √ √
2 PM12 P12 PU12 − POM12 − √ √ √ √ √ √ √ √ √ √ √
3 PM13 P13 PU13 PIM13 POM13 − √ √ √ √ √ √ √ √ − − −
4 PM14 P14 PU14 PIM14 POM14 − √ √ √ √ √ √ √ √ − − −
5 PM15 P15 PU15 PIM15 POM15 − √ √ √ √ √ √ √ √ − − −
6 PM16 P16 PU16 PIM16 − − √ √ √ √ √ √ √ √ √ √ √
7 PM17 P17 PU17 PIM17 POM17 − √ √ √ √ √ √ √ √ √ √ √
Port 2 0 PM20 P20 − − − − √ √ √ √ √ √ √ √ √ √ √
1 PM21 P21 − − − − √ √ √ √ √ √ √ √ √ √ √
2 PM22 P22 − − − − √ √ √ √ √ √ √ √ √ √ √
3 PM23 P23 − − − − √ √ √ √ √ √ √ √ − − −
4 PM24 P24 − − − − √ √ √ √ √ √ − − − − −
5 PM25 P25 − − − − √ √ √ √ √ √ − − − − −
6 PM26 P26 − − − − √ √ √ √ √ − − − − − −
7 PM27 P27 − − − − √ √ √ √ − − − − − − −
<R> Table 4-21. PMxx, Pxx, PUxx, PIMxx, POMxx, PMCxx registers and the bits mounted on each product
Table 4-21. PMxx, Pxx, PUxx, PIMxx, POMxx, PMCxx registers and the bits mounted on each product
PMxx Pxx PUxx PIMxx POMxx PMCxx pin pin pin pin pin pin pin pin pin pin pin
Port 8 − − − − − − − − − − − − − − − − − −
Port 9 − − − − − − − − − − − − − − − − − −
Port 10 − − − − − − − − − − − − − − − − − −
Port 11 − − − − − − − − − − − − − − − − − −
Port 12 0 PM120 P120 PU120 − − PMC120 √ √ √ √ √ √ √ √ − − −
1 − P121 − − − − √ √ √ √ √ √ √ √ √ √ √
2 − P122 − − − − √ √ √ √ √ √ √ √ √ √ √
3 − P123 − − − − √ √ √ √ √ − − − − − −
4 − P124 − − − − √ √ √ √ √ − − − − − −
5 − − − − − − − − − − − − − − − − −
6 − − − − − − − − − − − − − − − − −
7 − − − − − − − − − − − − − − − − −
Port 13 0 − P130 − − − − √ √ √ − − − − − √ − −
1 − − − − − − − − − − − − − − − − −
2 − − − − − − − − − − − − − − − − −
3 − − − − − − − − − − − − − − − − −
4 − − − − − − − − − − − − − − − − −
5 − − − − − − − − − − − − − − − − −
6 − − − − − − − − − − − − − − − − −
7 − P137 − − − − √ √ √ √ √ √ √ √ √ √ √
Port 14 0 PM140 P140 PU140 − − − √ √ √ − − − − − − − −
1 PM141 P141 PU141 − − − √ − − − − − − − − − −
2 − − − − − − − − − − − − − − − − −
3 − − − − − − − − − − − − − − − − −
4 − − − − − − − − − − − − − − − − −
5 − − − − − − − − − − − − − − − − −
6 PM146 P146 PU146 − − − √ √ √ √ − − − − − − −
7 PM147 P147 PU147 − − PMC147 √ √ √ √ √ √ √ √ √ √ √
Port 15 − − − − − − − − − − − − − − − − − −
Table 4-22. PMxx, Pxx, PUxx, PIMxx, POMxx, PMCxx registers and the bits mounted on each product
Table 4-22. PMxx, Pxx, PUxx, PIMxx, POMxx, PMCxx registers and the bits mounted on each product
<R> Table 4-22. PMxx, Pxx, PUxx, PIMxx, POMxx, PMCxx registers and the bits mounted on each product
Table 4-22. PMxx, Pxx, PUxx, PIMxx, POMxx, PMCxx registers and the bits mounted on each product
The format of each register is described below. The description here uses the 128-pin products as an example.
<R> For the registers mounted on others than 128-pin products, refer to table 4-21 and 4-22.
PM0 PM07 PM06 PM05 PM04 PM03 PM02 PM01 PM00 FFF20H FFH R/W
PM1 PM17 PM16 PM15 PM14 PM13 PM12 PM11 PM10 FFF21H FFH R/W
PM2 PM27 PM26 PM25 PM24 PM23 PM22 PM21 PM20 FFF22H FFH R/W
PM3 PM37 PM36 PM35 PM34 PM33 PM32 PM31 PM30 FFF23H FFH R/W
PM4 PM47 PM46 PM45 PM44 PM43 PM42 PM41 PM40 FFF24H FFH R/W
PM5 PM57 PM56 PM55 PM54 PM53 PM52 PM51 PM50 FFF25H FFH R/W
PM6 PM67 PM66 PM65 PM64 PM63 PM62 PM61 PM60 FFF26H FFH R/W
PM7 PM77 PM76 PM75 PM74 PM73 PM72 PM71 PM70 FFF27H FFH R/W
PM8 PM87 PM86 PM85 PM84 PM83 PM82 PM81 PM80 FFF28H FFH R/W
PM9 PM97 PM96 PM95 PM94 PM93 PM92 PM91 PM90 FFF29H FFH R/W
PM10 1 PM106 PM105 PM104 PM103 PM102 PM101 PM100 FFF2AH FFH R/W
PM11 PM117 PM116 PM115 PM114 PM113 PM112 PM111 PM110 FFF2BH FFH R/W
PM14 PM147 PM146 PM145 PM144 PM143 PM142 PM141 PM140 FFF2EH FFH R/W
PM15 1 PM156 PM155 PM154 PM153 PM152 PM151 PM150 FFF2FH FFH R/W
Caution Be sure to set bit 7 of the PM10 register, bits 1 to 4 of the PM12 register, and bit 7 of the PM15
register to “1”.
Note If P02, P03, P20 to P27, P35 to P37, P100, P115 to P117, P120, P147, and P150 to P156 are set up as
analog inputs of the A/D converter, when a port is read while in the input mode, 0 is always returned, not the
pin level.
P0 P07 P06 P05 P04 P03 P02 P01 P00 FFF00H 00H (output latch) R/W
P1 P17 P16 P15 P14 P13 P12 P11 P10 FFF01H 00H (output latch) R/W
P2 P27 P26 P25 P24 P23 P22 P21 P20 FFF02H 00H (output latch) R/W
P3 P37 P36 P35 P34 P33 P32 P31 P30 FFF03H 00H (output latch) R/W
P4 P47 P46 P45 P44 P43 P42 P41 P40 FFF04H 00H (output latch) R/W
P5 P57 P56 P55 P54 P53 P52 P51 P50 FFF05H 00H (output latch) R/W
P6 P67 P66 P65 P64 P63 P62 P61 P60 FFF06H 00H (output latch) R/W
P7 P77 P76 P75 P74 P73 P72 P71 P70 FFF07H 00H (output latch) R/W
P8 P87 P86 P85 P84 P83 P82 P81 P80 FFF08H 00H (output latch) R/W
P9 P97 P96 P95 P94 P93 P92 P91 P90 FFF09H 00H (output latch) R/W
P10 0 P106 P105 P104 P103 P102 P101 P100 FFF0AH 00H (output latch) R/W
P11 P117 P116 P115 P114 P113 P112 P111 P110 FFF0BH 00H (output latch) R/W
Note
P12 P127 P126 P125 P124 P123 P122 P121 P120 FFF0CH Undefined R/W
Note
P13 P137 0 0 0 0 0 0 P130 FFF0DH Undefined R/W
P14 P147 P146 P145 P144 P143 P142 P141 P140 FFF0EH 00H (output latch) R/W
P15 0 P156 P155 P154 P153 P152 P151 P150 FFF0FH 00H (output latch) R/W
Pmn m = 0 to 15; n = 0 to 7
Output data control (in output mode) Input data read (in input mode)
PU0 PU07 PU06 PU05 PU04 PU03 PU02 PU01 PU00 F0030H 00H R/W
PU1 PU17 PU16 PU15 PU14 PU13 PU12 PU11 PU10 F0031H 00H R/W
PU3 PU37 PU36 PU35 PU34 PU33 PU32 PU31 PU30 F0033H 00H R/W
PU4 PU47 PU46 PU45 PU44 PU43 PU42 PU41 PU40 F0034H 01H R/W
PU5 PU57 PU56 PU55 PU54 PU53 PU52 PU51 PU50 F0035H 00H R/W
PU7 PU77 PU76 PU75 PU74 PU73 PU72 PU71 PU70 F0037H 00H R/W
PU8 PU87 PU86 PU85 PU84 PU83 PU82 PU81 PU80 F0038H 00H R/W
PU9 PU97 PU96 PU95 PU94 PU93 PU92 PU91 PU90 F0039H 00H R/W
PU10 0 PU106 PU105 PU104 PU103 PU102 PU101 PU100 F003AH 00H R/W
PU11 PU117 PU116 PU115 PU114 PU113 PU112 PU111 PU110 F003BH 00H R/W
PU14 PU147 PU146 PU145 PU144 PU143 PU142 PU141 PU140 F003EH 00H R/W
(4) Port input mode registers (PIM0, PIM1, PIM4, PIM5, PIM8, PIM14)
These registers set the input buffer of P01, P03, P04, P10, P11, P13 to P17, P43, P44, P53 to P55, P80, P81, P142,
and P143 in 1-bit units.
TTL input buffer can be selected during serial communication with an external device of the different potential.
These registers can be set by a 1-bit or 8-bit memory manipulation instruction.
Reset signal generation clears these registers to 00H.
PIM1 PIM17 PIM16 PIM15 PIM14 PIM13 0 PIM11 PIM10 F0041H 00H R/W
(5) Port output mode registers (POM0, POM1, POM4, POM5, POM7 to POM9, POM14)
These registers set the output mode of P00, P02 to P04, P10 to P15, P17, P43 to P45, P50, P52 to P55, P71, P74,
P80 to P82, P96, P142 to P144 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, and for the SDA00, SDA01, SDA10, SDA11, SDA20, SDA21, SDA30, and SDA31 pins during
2
simplified I C communication with an external device of the same potential.
These registers can be set by a 1-bit or 8-bit memory manipulation instruction.
Reset signal generation clears these registers to 00H.
POM1 POM17 0 POM15 POM14 POM13 POM12 POM11 POM10 F0051H 00H R/W
(6) Port mode control registers (PMC0, PMC3, PMC10, PMC11, PMC12, PMC14)
These registers set the P00 to P03, P35 to P37, P100, P115 to P117, P120, and P147 digital I/O/analog input in 1-bit
units.
These registers can be set by a 1-bit or 8-bit memory manipulation instruction.
Reset signal generation clears these registers to FFH.
ANI13/P155
ANI12/P154
ANI11/P153
ANI10/P152
ANI9/P151
ANI8/P150
ANI7/P27
ANI6/P26
ANI5/P25
ANI4/P24
ANI3/P23
ANI2/P22
ANI1/P21
ANI0/P20
ADPC3
ADPC2
ADPC1
ADPC0
0 0 0 0 A A A A A A A A A A A A A A A
0 0 0 1 D D D D D D D D D D D D D D D
0 0 1 0 D D D D D D D D D D D D D D A
0 0 1 1 D D D D D D D D D D D D D A A
0 1 0 0 D D D D D D D D D D D D A A A
0 1 0 1 D D D D D D D D D D D A A A A
0 1 1 0 D D D D D D D D D D A A A A A
0 1 1 1 D D D D D D D D D A A A A A A
1 0 0 0 D D D D D D D D A A A A A A A
1 0 0 1 D D D D D D D A A A A A A A A
1 0 1 0 D D D D D D A A A A A A A A A
1 0 1 1 D D D D D A A A A A A A A A A
1 1 0 0 D D D D A A A A A A A A A A A
1 1 0 1 D D D A A A A A A A A A A A A
1 1 1 0 D D A A A A A A A A A A A A A
1 1 1 1 D A A A A A A A A A A A A A A
Cautions 1. Set the channel used for A/D conversion to the input mode by using port mode registers 2, 15
(PM2, PM15).
2. Do not set the pin set by the ADPC register as digital I/O by the analog input channel
specification register (ADS).
GDIDIS 0 0 0 0 0 0 0 GDIDIS0
Port operations differ depending on whether the input or output mode is set, as shown below.
<R> 4.4.4 Connecting to external device with different potential (1.8 V, 2.5 V, 3 V)
When parts of ports 0, 1, 4, 5, and 14 operate with VDD = 4.0 to 5.5 V, I/O connections with an external device that
operates on 1.8 V, 2.5 V, 3 V power supply voltage are possible.
Regarding inputs, CMOS/TTL switching is possible on a bit-by-bit basis by the port input mode registers (PIM0, PIM1,
PIM4, PIM5, PIM8, PIM14).
Moreover, regarding outputs, different potentials can be supported by switching the output buffer to the N-ch open drain
(VDD withstand voltage) by the port output mode registers (POM0, POM1, POM4, POM5, POM8, POM14).
(1) Setting procedure when using I/O pins of UART0 to UART3, CSI00, CSI01, CSI10, CSI20, CSI30, and CSI31
functions
<2> After reset release, the port mode is the input mode (Hi-Z).
<3> Set the corresponding bit of the PIM0, PIM1, PIM4, PIM5, PIM8, and PIM14 registers to 1 to switch to the
TTL input buffer.
<4> VIH/VIL operates on 1.8 V, 2.5 V, 3 V operating voltage.
<2> After reset release, the port mode changes to the input mode (Hi-Z).
<3> Set the output latch of the corresponding port to 1.
<4> Set the corresponding bit of the POM0, POM1, POM4, POM5, POM8, and POM14 registers to 1 to set
the N-ch open drain output (VDD withstand voltage) mode.
<5> Set the output mode by manipulating the PM0, PM1, PM4, PM5, PM8, and PM14 registers.
At this time, the output data is high level, so the pin is in the Hi-Z state.
<6> Can be communication by setting the serial array unit.
(2) Setting procedure when using I/O pins of IIC00, IIC01, IIC10, IIC20, IIC30, and IIC31 functions
<R> <1> Externally pull up the pin to be used (on-chip pull-up resistor cannot be used).
<2> After reset release, the port mode is the input mode (Hi-Z).
<3> Set the output latch of the corresponding port to 1.
<4> Set the corresponding bit of the POM0, POM1, POM4, POM5, and POM14 registers to 1 to set the N-ch
open drain output (VDD withstand voltage) mode.
<5> Set the corresponding bit of the PM0, PM1, PM4, PM5, and PM14 registers to the output mode (data I/O
is possible in the output mode).
At this time, the output data is high level, so the pin is in the Hi-Z state.
2
<6> Enable the operation of the serial array unit and set the mode to the simplified I C mode.
4.5 Settings of Port Mode Register, and Output Latch When Using Alternate Function
To use the alternate function of a port pin, set the port mode register, and output latch as shown in Table 4-23.
<R> Table 4-23. Settings of Port Mode Register, and Output Latch When Using Alternate Function (1/5)
<R> Table 4-23. Settings of Port Mode Register, and Output Latch When Using Alternate Function (2/5)
<R> Table 4-23. Settings of Port Mode Register, and Output Latch When Using Alternate Function (3/5)
<R> Table 4-23. Settings of Port Mode Register, and Output Latch When Using Alternate Function (4/5)
<R> Table 4-23. Settings of Port Mode Register, and Output Latch When Using Alternate Function (5/5)
Notes 1. The functions of the ANI16/P03, ANI17/P02, ANI18/P147, ANI19/P120, ANI20/P100, ANI21/P37 to
ANI23/P35, and ANI24/P117 to ANI26/P115 pins can be selected by using the port mode control registers 0,
3, 10, 11, 12, 14 (PMC0, PMC3, PMC10, PMC11, PMC12, PMC14), analog input channel specification
register (ADS), and port mode registers 0, 3, 10, 11, 12, 14 (PM0, PM3, PM10, PM11, PM12, PM14).
PMC0, PMC3, PMC10, PM0, PM3, PM10, ADS Register ANI16/P03, ANI17/P02,
PMC11, PMC12, PMC14 PM11, PM12, ANI18/P147, ANI19/P120,
Registers PM14 Registers ANI20/P100, ANI21/P37 to
ANI23/P35, ANI24/P117 to
ANI26/P115 Pins
Digital I/O selection Input mode × Digital input
Output mode × Digital output
Analog input selection Input mode Selects ANI. Analog input (to be converted)
Does not select ANI. Analog input (not to be converted)
Output mode Selects ANI. Setting prohibited
Does not select ANI.
2. The functions of the ANI0/P20 to ANI7/P27, ANI8/P150 to ANI14/P156 pins can be selected by using the
A/D port configuration register (ADPC), analog input channel specification register (ADS), and port mode
registers 2, 15 (PM2, PM15).
<R> 3. In the products other than 128-pin products, multiple alternate output functions are assigned to the pins. In
such cases, the output from the alternate functions that are not used in any settings except the one
indicated in table 4-23 must be set to the same value as the one in the initial status. For more detail about
the targets and the method of processing, refer to the section 4.6.2.
<Example> When P10 is an output port, P11 to P17 are input ports (all pin statuses are high level), and the port
latch value of port 1 is 00H, if the output of output port P10 is changed from low level to high level via a
1-bit manipulation instruction, the output latch value of port 1 is FFH.
Explanation: The targets of writing to and reading from the Pn register of a port whose PMnm bit is 1 are the output
latch and pin status, respectively.
A 1-bit manipulation instruction is executed in the following order in the RL78/G13.
In step <1>, the output latch value (0) of P10, which is an output port, is read, while the pin statuses of
P11 to P17, which are input ports, are read. If the pin statuses of P11 to P17 are high level at this time,
the read value is FEH.
The value is changed to FFH by the manipulation in <2>.
FFH is written to the output latch by the manipulation in <3>.
1-bit manipulation
P10 instruction P10
(set1 P1.0)
Low-level output High-level output
is executed for P10
bit.
P11 to P17 P11 to P17
Pin status: High level Pin status: High level
0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1
<R> 4.6.2 Cautions on the pin settings on the products other than 128-pin
In the products other than 128-pin products, multiple alternate output functions may be assigned to P15 to P17, P30
and P31 pins.
In such cases, the output from the alternate functions that are not used in any settings except the one indicated in
Table 4-23 must be set to the same value as the one in the initial status.
The following indicates the specific targets and the method of processing;
The presence or absence of connecting resonator pin for main system clock, connecting resonator pin for subsystem
clock, external clock input pin for main system clock, and external clock input pin for subsystem clock, depends on the
product.
Output pin 20, 24, 25, 30, 32, 36-pin 40, 44, 48, 52, 64, 80, 100, 128-pin
X1, X2 pins √ √
EXCLK pin √ √
XT1, XT2 pins − √
EXCLKS pin − √
Note The 20, 24, 25, 30, 32, and 36-pin products don’t have the subsystem clock.
The clock generator generates the clock to be supplied to the CPU and peripheral hardware.
The following three kinds of system clocks and clock oscillators are selectable.
An external main system clock (fEX = 1 to 20 MHz) can also be supplied from the EXCLK/X2/P122 pin. An external
main system clock input can be disabled by executing the STOP instruction or setting of the MSTOP bit.
As the main system clock, a high-speed system clock (X1 clock or external main system clock) or high-speed on-
chip oscillator clock can be selected by setting of the MCM0 bit (bit 4 of the system clock control register (CKC)).
An external subsystem clock (fEXS = 32.768 KHz) can also be supplied from the EXCLKS/XT2/P124 pin. An
<R> external subsystem clock input can be disabled by the setting of the XTSTOP bit.
• Watchdog timer
• Real-time clock
• Interval timer
This clock operates when bit 4 (WDTON) of the option byte (000C0H), bit 4 (WUTMMCK0) of the operation
speed mode control register (OSMC), or both are set to 1.
However, when WDTON = 1, WUTMMCK0 = 0, and bit 0 (WDSTBYON) of the option byte (000C0H) is 0,
oscillation of the low-speed on-chip oscillator stops if the HALT or STOP instruction is executed.
Caution The low-speed on-chip oscillator clock (fIL) can only be selected as the real-time clock
operation clock when the fixed-cycle interrupt function is used.
Item Configuration
Control registers Clock operation mode control register (CMC)
System clock control register (CKC)
Clock operation status control register (CSC)
Oscillation stabilization time counter status register (OSTC)
Oscillation stabilization time select register (OSTS)
Peripheral enable register 0 (PER0)
Operation speed mode control register (OSMC)
High-speed on-chip oscillator frequency select register (HOCODIV)
High-speed on-chip oscillator trimming register (HIOTRM)
Oscillators X1 oscillator
XT1 oscillator
High-speed on-chip oscillator
Low-speed on-chip oscillator
RL78/G13
Figure 5-1. Block Diagram of Clock Generator
Internal bus
AMPH EXCLK OSCSEL MSTOP OSTS2 OSTS1 OSTS0 CLS CSS MCS MCM0
Standby controller
3
STOP mode
X1 oscillation
STOP mode stabilization time counter
HALT mode
signal
X1/P121 clock
clockoscillator
oscillator
Crystal/ceramic Oscillation stabilization
fX time counter status
oscillation fMX
X2/EXCLK register (OSTC)
/P122 External input
fEX
clock
Clock output/
Option byte (000C2H) buzzer output
FRQSEL0 to FRQSEL3
Controller
WDSTBYON Serial array unit 1
Oscillation (1 MHz (TYP.)) Serial interface IICA0
Low-speed
on-chip oscillator HALT/STOP mode signal A/D converter
fIL Serial interface IICA1
Oscillation (15 kHz (TYP.)) Watchdog timer
CLS 6
Internal bus
The following nine registers are used to control the clock generator.
Note
AMPHS1 AMPHS0 XT1 oscillator oscillation mode selection
<R> 0 0 Low power consumption oscillation (default) Oscillation margin: Medium
0 1 Normal oscillation Oscillation margin: high
1 0 Ultra-low power consumption oscillation Oscillation margin: Low
1 1 Setting prohibited
<R> Note As the XT oscillator becomes oscillation mode with lower power consumption, then its oscillation
margin becomes smaller.
Cautions 1. The CMC register can be written only once after reset release, by an 8-bit memory
manipulation instruction.
2. After reset release, set the CMC register before X1 or XT1 oscillation is started as set
by the clock operation status control register (CSC).
3. Be sure to set the AMPH bit to 1 if the X1 clock oscillation frequency exceeds 10 MHz.
4. When the CMC register is used at the default value (00H), be sure to set 00H to this
register after reset release in order to prevent malfunctioning during a program loop.
5. The XT1 oscillator is a circuit with low amplification in order to achieve low-power
consumption. Note the following points when designing the circuit.
• Pins and circuit boards include parasitic capacitance. Therefore, perform
oscillation evaluation using a circuit board to be actually used and confirm that
there are no problems.
• When using the ultra-low power consumption oscillation (AMPHS1, AMPHS0 = 1,
0) as the mode of the XT1 oscillator, use the recommended resonators described
in CHAPTER 29 ELECTRICAL SPECIFICATIONS.
• Make the wiring between the XT1 and XT2 pins and the resonators as short as
possible, and minimize the parasitic capacitance and wiring resistance. Note
this particularly when the ultra-low power consumption oscillation (AMPHS1,
AMPHS0 = 1, 0) is selected.
• Configure the circuit of the circuit board, using material with little wiring
resistance.
• Place a ground pattern that has the same potential as VSS as much as possible
near the XT1 oscillator.
• Be sure that the signal lines between the XT1 and XT2 pins, and the resonators
do not cross with the other signal lines. Do not route the wiring near a signal
line through which a high fluctuating current flows.
• The impedance between the XT1 and XT2 pins may drop and oscillation may be
disturbed due to moisture absorption of the circuit board in a high-humidity
environment or dew condensation on the board. When using the circuit board in
such an environment, take measures to damp-proof the circuit board, such as by
coating.
• When coating the circuit board, use material that does not cause capacitance or
leakage between the XT1 and XT2 pins.
Note 1
Address: FFFA4H After reset: 00H R/W
Symbol <7> <6> <5> <4> 3 2 1 0
Note 2
MCM0 Main system clock (fMAIN) operation control
0 Selects the high-speed on-chip oscillator clock (fIH) as the main system clock (fMAIN)
1 Selects the high-speed system clock (fMX) as the main system clock (fMAIN)
Cautions 1. After reset release, set the clock operation mode control register (CMC) before
setting the CSC register.
2. Set the oscillation stabilization time select register (OSTS) before setting the MSTOP
bit to 0 after releasing reset. Note that if the OSTS register is being used with its
default settings, the OSTS register is not required to be set here.
3. To start X1 oscillation as set by the MSTOP bit, check the oscillation stabilization
time of the X1 clock by using the oscillation stabilization time counter status register
(OSTC).
4. When starting XT1 oscillation by setting the XSTOP bit, wait for oscillation of the
subsystem clock to stabilize by setting a wait time using software.
5. Do not stop the clock selected for the CPU peripheral hardware clock (fCLK) with the
OSC register.
6. The setting of the flags of the register to stop clock oscillation (invalidate the
external clock input) and the condition before clock oscillation is to be stopped are
as Table 5-2.
XT1 clock CPU and peripheral hardware clocks operate with a clock XTSTOP = 1
External subsystem other than the subsystem clock.
clock (CLS = 0)
High-speed on-chip CPU and peripheral hardware clocks operate with a clock HIOSTOP = 1
oscillator clock other than the high-speed on-chip oscillator clock.
(CLS = 0 and MCS = 1, or CLS = 1)
• If the X1 clock starts oscillation while the high-speed on-chip oscillator clock or subsystem clock is being used as
the CPU clock.
• If the STOP mode is entered and then released while the high-speed on-chip oscillator clock is being used as the
CPU clock with the X1 clock oscillating.
The OSTC register can be read by a 1-bit or 8-bit memory manipulation instruction.
When reset signal is generated, the STOP instruction and MSTOP (bit 7 of clock operation status control register
(CSC)) = 1 clear the OSTC register to 00H.
Remark The oscillation stabilization time counter starts counting in the following cases.
• When oscillation of the X1 clock starts (EXCLK, OSCSEL = 0, 1 → MSTOP = 0)
• When the STOP mode is released
Figure 5-5. Format of Oscillation Stabilization Time Counter Status Register (OSTC)
Symbol 7 6 5 4 3 2 1 0
OSTC MOST MOST MOST MOST MOST MOST MOST MOST
8 9 10 11 13 15 17 18
MOST MOST MOST MOST MOST MOST MOST MOST Oscillation stabilization time status
8 9 10 11 13 15 17 18 fX = 10 MHz fX = 20 MHz
25.6 μs max. 12.8 μs max.
8
0 0 0 0 0 0 0 0 2 /fX max.
25.6 μs min. 12.8 μs min.
8
1 0 0 0 0 0 0 0 2 /fX min.
51.2 μs min. 25.6 μs min.
9
1 1 0 0 0 0 0 0 2 /fX min.
102.4 μs min. 51.2 μs min.
10
1 1 1 0 0 0 0 0 2 /fX min.
204.8 μs min. 102.4 μs min.
11
1 1 1 1 0 0 0 0 2 /fX min.
819.2 μs min. 409.6 μs min.
13
1 1 1 1 1 0 0 0 2 /fX min.
15
1 1 1 1 1 1 0 0 2 /fX min. 3.27 ms min. 1.64 ms min.
17
1 1 1 1 1 1 1 0 2 /fX min. 13.11 ms min. 6.55 ms min.
18
1 1 1 1 1 1 1 1 2 /fX min. 26.21 ms min. 13.11 ms min.
Cautions 1. After the above time has elapsed, the bits are set to 1 in order from the MOST8 bit
and remain 1.
2. The oscillation stabilization time counter counts up to the oscillation stabilization
time set by the oscillation stabilization time select register (OSTS).
In the following cases, set the oscillation stabilization time of the OSTS register to
the value greater than the count value which is to be checked by the OSTC register.
• If the X1 clock starts oscillation while the high-speed on-chip oscillator clock or
subsystem clock is being used as the CPU clock.
• If the STOP mode is entered and then released while the high-speed on-chip
oscillator clock is being used as the CPU clock with the X1 clock oscillating.
(Note, therefore, that only the status up to the oscillation stabilization time set by
the OSTS register is set to the OSTC register after the STOP mode is released.)
3. The X1 clock oscillation stabilization wait time does not include the time until clock
oscillation starts (“a” below).
X1 pin voltage
waveform
Cautions 1. To set the STOP mode when the X1 clock is used as the CPU clock, set the OSTS
register before executing the STOP instruction.
2. Change the setting of the OSTS register before setting the MSTOP bit of the clock
operation status control register (CSC) to 0.
3. Do not change the value of the OSTS register during the X1 clock oscillation
stabilization time.
4. The oscillation stabilization time counter counts up to the oscillation stabilization
time set by the OSTS register.
In the following cases, set the oscillation stabilization time of the OSTS register to
the value greater than the count value which is to be checked by the OSTC register
after the oscillation starts.
• If the X1 clock starts oscillation while the high-speed on-chip oscillator clock or
subsystem clock is being used as the CPU clock.
• If the STOP mode is entered and then released while the high-speed on-chip
oscillator clock is being used as the CPU clock with the X1 clock oscillating. (Note,
therefore, that only the status up to the oscillation stabilization time set by the
OSTS register is set to the OSTC register after the STOP mode is released.)
5. The X1 clock oscillation stabilization wait time does not include the time until clock
oscillation starts (“a” below).
X1 pin voltage
waveform
The PER0 register can be set by a 1-bit or 8-bit memory manipulation instruction.
Reset signal generation clears these registers to 00H.
<R> RTCEN Control of real-time clock (RTC) and interval timer input clock supply
RTCLPC Setting in STOP mode or HALT mode while subsystem clock is selected as CPU clock
0 Enables supply of subsystem clock to peripheral functions
(See Table 18-1 for peripheral functions whose operations are enabled.)
1 Stops supply of subsystem clock to peripheral functions other than real-time clock and
interval timer.
WUTMMCK0 Selection of operation clock for real-time clock and interval timer.
Caution The STOP mode current or HALT mode current when the subsystem clock is used can
be reduced by setting the RTCLPC bit to 1. However, no clock can be supplied to the
peripheral functions other than the real-time clock and interval timer during HALT mode
while subsystem clock is selected as CPU clock.
Figure 5-9. Format of High-speed On-chip Oscillator Frequency Select Register (HOCODIV)
0 0 0 24 MHz 32 MHz
0 0 1 12 MHz 16 MHz
0 1 0 6 MHz 8 MHz
0 1 1 3 MHz 4 MHz
1 0 0 Setting prohibited 2 MHz
1 0 1 Setting prohibited 1 MHz
Other than aboves Setting prohibited
Cautions 1. Set the HOCODIV register within the operable voltage range both before and after
changing the frequency.
2. Use the device within the voltage of the flash operation mode set by the option
byte (000C2H/010C2H) even after the frequency has been changed by using the
HOCODIV register.
Option Byte
Operating Operating Voltage
(000C2H/010C2H) Value Flash Operation Mode
Frequency Range Range
CMODE1 CMODE2
<R> 3. When setting of high-speed on-chip oscillator clock as system clock, the device
operates at the old frequency for the duration of 3 clocks after the frequency value
has been changed by using the HOCODIV register.
4. To change the frequency of the high-speed on-chip oscillator when X1 oscillation,
external oscillation input or subclock is set for the system clock, stop the high-
speed on-chip oscillator by setting bit 0 (HIOSTOP) of the CSC register to 1 and
then change the frequency.
<R> Caution The frequency will vary if the temperature and VDD pin voltage change after accuracy
adjustment. When the temperature and VDD voltage change, accuracy adjustment must be
executed regularly or before the frequency accuracy is required.
0 0 0 0 0 0 Minimum speed
0 0 0 0 0 1
0 0 0 0 1 0
0 0 0 0 1 1
0 0 0 1 0 0
•
•
•
1 1 1 1 1 0
1 1 1 1 1 1 Maximum speed
5.4.1 X1 oscillator
The X1 oscillator oscillates with a crystal resonator or ceramic resonator (1 to 20 MHz) connected to the X1 and X2
pins.
An external clock can also be input. In this case, input the clock signal to the EXCLK pin.
To use the X1 oscillator, set bits 7 and 6 (EXCLK, OSCSEL) of the clock operation mode control register (CMC) as
follows.
• Crystal or ceramic oscillation: EXCLK, OSCSEL = 0, 1
• External clock input: EXCLK, OSCSEL = 1, 1
When the X1 oscillator is not used, set the input port mode (EXCLK, OSCSEL = 0, 0).
When the pins are not used as input port pins, either, see Table 2-3 Connection of Unused Pins.
Figure 5-11 shows an example of the external circuit of the X1 oscillator.
VSS
X1
X2 EXCLK
External clock
Crystal resonator
or
ceramic resonator
VSS
XT1
32.768
kHz
XT2 External clock EXCLKS
Caution 1. When using the X1 oscillator and XT1 oscillator, wire as follows in the area enclosed by the
broken lines in the Figures 5-10 and 5-11 to avoid an adverse effect from wiring capacitance.
• Keep the wiring length as short as possible.
• Do not cross the wiring with the other signal lines. Do not route the wiring near a signal line
through which a high fluctuating current flows.
• Always make the ground point of the oscillator capacitor the same potential as VSS. Do not
ground the capacitor to a ground pattern through which a high current flows.
• Do not fetch signals from the oscillator.
The XT1 oscillator is a circuit with low amplification in order to achieve low-power consumption.
Note the following points when designing the circuit.
• Pins and circuit boards include parasitic capacitance. Therefore, perform oscillation evaluation
using a circuit board to be actually used and confirm that there are no problems.
• When using the ultra-low power consumption oscillation (AMPHS1, AMPHS0 = 1, 0) as the mode
of the XT1 oscillator, use the recommended resonators described in CHAPTER 29 ELECTRICAL
SPECIFICATIONS.
• Make the wiring between the XT1 and XT2 pins and the resonators as short as possible, and
minimize the parasitic capacitance and wiring resistance. Note this particularly when the ultra-
low power consumption oscillation (AMPHS1, AMPHS0 = 1, 0) is selected.
• Configure the circuit of the circuit board, using material with little wiring resistance.
• Place a ground pattern that has the same potential as VSS as much as possible near the XT1
oscillator.
• Be sure that the signal lines between the XT1 and XT2 pins, and the resonators do not cross
with the other signal lines. Do not route the wiring near a signal line through which a high
fluctuating current flows.
• The impedance between the XT1 and XT2 pins may drop and oscillation may be disturbed due
to moisture absorption of the circuit board in a high-humidity environment or dew
condensation on the board. When using the circuit board in such an environment, take
measures to damp-proof the circuit board, such as by coating.
• When coating the circuit board, use material that does not cause capacitance or leakage
between the XT1 and XT2 pins.
PORT
VSS X1 X2 VSS X1 X2
NG
NG
NG
(c) The X1 and X2 signal line wires cross. (d) A power supply/GND pattern exists
under the X1 and X2 wires.
VSS X1 X2
VSS X1 X2
Note
Note Do not place a power supply/GND pattern under the wiring section (section indicated by a broken line in the
figure) of the X1 and X2 pins and the resonators in a multi-layer board or double-sided board.
Do not configure a layout that will cause capacitance elements and affect the oscillation characteristics.
Remark When using the subsystem clock, replace X1 and X2 with XT1 and XT2, respectively. Also, insert resistors
in series on the XT2 side.
(e) Wiring near high alternating current (f) Current flowing through ground line of oscillator
(potential at points A, B, and C fluctuates)
VDD
Pmn
VSS X1 X2
A B C
High current
VSS X1 X2
Caution When X2 and XT1 are wired in parallel, the crosstalk noise of X2 may increase with XT1, resulting in
malfunctioning.
Remark When using the subsystem clock, replace X1 and X2 with XT1 and XT2, respectively. Also, insert resistors
in series on the XT2 side.
The clock generator generates the following clocks and controls the operation modes of the CPU, such as standby
mode (see Figure 5-1).
The CPU starts operation when the high-speed on-chip oscillator starts outputting after a reset release in the RL78/G13.
When the power supply voltage is turned on, the clock generator operation is shown in Figure 5-14.
Figure 5-14. Clock Generator Operation When Power Supply Voltage Is Turned On
0V
<1>
Internal reset signal
Switched by software
Reset processing Note3
<3> <5> <5>
high-speed on-chip High-speed Subsystem
CPU clock
oscillator clock system clock clock
<2>
High-speed on-chip
oscillator clock (fIH)
Note 1
High-speed
system clock (fMX) <4>
(when X1 oscillation
selected)
X1 clock
oscillation stabilization timeNote 2
Subsystem clock (fSUB) Starting X1 oscillation <4>
(when XT1 oscillation is specified by software.
selected)
<1> When the power is turned on, an internal reset signal is generated by the power-on-reset (POR) circuit.
<2> When the power supply voltage exceeds 1.51 V (TYP.), the reset is released and the high-speed on-chip
oscillator automatically starts oscillation.
<3> The CPU starts operation on the high-speed on-chip oscillator clock after a reset processing such as waiting for
the voltage of the power supply or regulator to stabilize has been performed after reset release.
<4> Set the start of oscillation of the X1 or XT1 clock via software (see 5.6.2 Example of setting X1 oscillation
clock and 5.6.3 Example of setting XT1 oscillation clock).
<5> When switching the CPU clock to the X1 or XT1 clock, wait for the clock oscillation to stabilize, and then set
switching via software (see 5.6.2 Example of setting X1 oscillation clock and 5.6.3 Example of setting XT1
oscillation clock).
Notes 1. The internal reset processing time includes the oscillation accuracy stabilization time of the high-speed on-
chip oscillator clock.
2. When releasing a reset, confirm the oscillation stabilization time for the X1 clock using the oscillation
stabilization time counter status register (OSTC).
<R> 3. Reset processing time: 387 to 720 μ s (When LVD is used)
155 to 407 μ s (When LVD off)
Caution It is not necessary to wait for the oscillation stabilization time when an external clock input from the
EXCLK pin is used.
[Register settings] Set the register in the order of <1> to <5> below.
<R> <1> Set (1) the OSCSEL bit of the CMC register, except for the cases where the frequency is equal or more than
10MHz, in such cases set (1) the AMPH bit, to operate the X1 oscillator.
7 6 5 4 3 2 1 0
EXCLK OSCSEL EXCLKS OSCSELS AMPHS1 AMPHS0 AMPH
CMC
0 1 0 0 0 0 0 1
AMPH bit: Set this bit to 0 if the X1 oscillation clock is 10 MHz or less.
<2> Using the OSTS register, select the oscillation stabilization time of the X1 oscillator at releasing of the STOP mode.
Example: Setting values when a wait of at least 102.4 μs is set based on a 10 MHz resonator.
7 6 5 4 3 2 1 0
OSTS2 OSTS1 OSTS0
OSTS
0 0 0 0 0 0 1 0
<3> Clear (0) the MSTOP bit of the CSC register to start oscillating the X1 oscillator.
7 6 5 4 3 2 1 0
MSTOP XTSTOP HIOSTOP
CSC
0 1 0 0 0 0 0 0
<4> Use the OSTC register to wait for oscillation of the X1 oscillator to stabilize.
Example: Wait until the bits reach the following values when a wait of at least 102.4 μs is set based on a 10 MHz
resonator.
7 6 5 4 3 2 1 0
MOST8 MOST9 MOST10 MOST11 MOST13 MOST15 MOST17 MOST18
OSTC
1 1 1 0 0 0 0 0
<5> Use the MCM0 bit of the CKC register to specify the X1 oscillation clock as the CPU/peripheral hardware clock.
7 6 5 4 3 2 1 0
CLS CSS MCS MCM0
CKC
0 0 0 1 0 0 0 0
[Register settings] Set the register in the order of <1> to <5> below.
<1> To run only the real-time clock and interval timer on the subsystem clock (ultra-low current consumption) when in
the STOP mode or sub-HALT mode, set the RTCLPC bit to 1.
7 6 5 4 3 2 1 0
RTCLPC WUTMMCK0
OSMC
0/1 0 0 0 0 0 0 0
<2> Set (1) the OSCSELS bit of the CMC register to operate the XT1 oscillator.
7 6 5 4 3 2 1 0
EXCLK OSCSEL EXCLKS OSCSELS AMPHS1 AMPHS0 AMPH
CMC
0 0 0 1 0 0/1 0/1 0
AMPHS0 and AMPHS1 bits: These bits are used to specify the oscillation mode of the XT1 oscillator.
<3> Clear (0) the XTSTOP bit of the CSC register to start oscillating the XT1 oscillator.
7 6 5 4 3 2 1 0
MSTOP XTSTOP HIOSTOP
CSC
1 0 0 0 0 0 0 0
<4> Use the timer function or another function to wait for oscillation of the subsystem clock to stabilize by using
software.
<5> Use the CSS bit of the CKC register to specify the XT1 oscillation clock as the CPU/peripheral hardware clock.
7 6 5 4 3 2 1 0
CLS CSS MCS MCM0
CKC
0 1 0 0 0 0 0 0
High-speed on-chip oscillator: Operating (B) (H) High-speed on-chip oscillator: Stops
X1 oscillation/EXCLK input: Selectable by CPU
CPU: Operating X1 oscillation/EXCLK input: Stops
XT1 oscillation/EXCLKS input: Selectable by CPU CPU: High-speed
with high-speed XT1 oscillation/EXCLKS input:
on-chip oscillator on-chip oscillator Oscillatable
High-speed on-chip oscillator: → STOP
Selectable by CPU
(D)
CPU: Operating
X1 oscillation/EXCLK input:
with XT1 oscillation or (J) High-speed on-chip oscillator: Operating
Selectable by CPU X1 oscillation/EXCLK input: Stops
XT1 oscillation/EXCLKS input:
EXCLKS input (E) CPU: High-speed
on-chip oscillator XT1 oscillation/EXCLKS input: Oscillatable
Operating CPU: High-speed → SNOOZE
on-chip oscillator
(C) → HALT
(G) CPU: Operating High-speed on-chip oscillator: Operating
CPU: XT1 with X1 oscillation or X1 oscillation/EXCLK input: Oscillatable
oscillation/EXCLKS EXCLK input XT1 oscillation/EXCLKS input: Oscillatable
input → HALT
(I)
CPU: X1
High-speed on-chip oscillator: High-speed on-chip oscillation/EXCLK
Oscillatable oscillator: Selectable by CPU input → STOP High-speed on-chip oscillator: Stops
X1 oscillation/EXCLK input: (F)
X1 oscillation/EXCLK input: X1 oscillation/EXCLK input: Stops
Oscillatable Operating CPU: X1 XT1 oscillation/EXCLKS input:
XT1 oscillation/EXCLKS input: XT1 oscillation/EXCLKS input: oscillation/EXCLK Oscillatable
Operating Selectable by CPU input → HALT
High-speed on-chip
oscillator: Oscillatable
X1 oscillation/EXCLK input:
Operating
XT1 oscillation/EXCLKS input:
Oscillatable
Table 5-3 shows transition of the CPU clock and examples of setting the SFR registers.
Table 5-3. CPU Clock Transition and SFR Register Setting Examples (1/5)
(1) CPU operating with high-speed on-chip oscillator clock (B) after reset release (A)
(A) → (B) SFR registers do not have to be set (default status after reset release).
(2) CPU operating with high-speed system clock (C) after reset release (A)
(The CPU operates with the high-speed on-chip oscillator clock immediately after a reset release (B).)
Note The clock operation mode control register (CMC) can be written only once by an 8-bit memory manipulation
instruction after reset release.
Caution Set the clock after the supply voltage has reached the operable voltage of the clock to be set (see
CHAPTER 29 ELECTRICAL SPECIFICATIONS.
(3) CPU operating with subsystem clock (D) after reset release (A)
(The CPU operates with the high-speed on-chip oscillator clock immediately after a reset release (B).)
Note The clock operation mode control register (CMC) can be written only once by an 8-bit memory manipulation
instruction after reset release.
Table 5-3. CPU Clock Transition and SFR Register Setting Examples (2/5)
(4) CPU clock changing from high-speed on-chip oscillator clock (B) to high-speed system clock (C)
Notes 1. The clock operation mode control register (CMC) can be changed only once after reset release. This
setting is not necessary if it has already been set.
2. Set the oscillation stabilization time as follows.
• Desired the oscillation stabilization time counter status register (OSTC) oscillation stabilization time ≤
Oscillation stabilization time set by the oscillation stabilization time select register (OSTS)
Caution Set the clock after the supply voltage has reached the operable voltage of the clock to be set (see
CHAPTER 29 ELECTRICAL SPECIFICATIONS.
(5) CPU clock changing from high-speed on-chip oscillator clock (B) to subsystem clock (D)
Note The clock operation mode control register (CMC) can be written only once by an 8-bit memory manipulation
instruction after reset release.
Table 5-3. CPU Clock Transition and SFR Register Setting Examples (3/5)
(6) CPU clock changing from high-speed system clock (C) to high-speed on-chip oscillator clock (B)
Setting Flag of SFR Register CSC Register Oscillation accuracy CKC Register
Status Transition HIOSTOP stabilization time MCM0
(C) → (B) 0 30 μ s 0
(7) CPU clock changing from high-speed system clock (C) to subsystem clock (D)
Setting Flag of SFR Register CSC Register Waiting for Oscillation CKC Register
XTSTOP Stabilization CSS
Status Transition
(8) CPU clock changing from subsystem clock (D) to high-speed on-chip oscillator clock (B)
(D) → (B) 0 0 0
Remark (A) to (J) in Table 5-3 correspond to (A) to (J) in Figure 5-15.
Table 5-3. CPU Clock Transition and SFR Register Setting Examples (4/5)
(9) CPU clock changing from subsystem clock (D) to high-speed system clock (C)
Setting Flag of SFR Register OSTS CSC Register OSTC Register CKC Register
Register MSTOP CSS MCM0
Status Transition
Caution Set the clock after the supply voltage has reached the operable voltage of the clock to be set (see
CHAPTER 29 ELECTRICAL SPECIFICATIONS.
(10) • HALT mode (E) set while CPU is operating with high-speed on-chip oscillator clock (B)
• HALT mode (F) set while CPU is operating with high-speed system clock (C)
• HALT mode (G) set while CPU is operating with subsystem clock (D)
Remark (A) to (J) in Table 5-3 correspond to (A) to (J) in Figure 5-15.
Table 5-3. CPU Clock Transition and SFR Register Setting Examples (5/5)
(11) • STOP mode (H) set while CPU is operating with high-speed on-chip oscillator clock (B)
• STOP mode (I) set while CPU is operating with high-speed system clock (C)
(Setting sequence)
(12) CPU changing from STOP mode (H) to SNOOZE mode (J)
For details about the setting for switching from the STOP mode to the SNOOZE mode, see 11.8 SNOOZE Mode
Function, 12.5.7 SNOOZE mode function and 12.6.3 SNOOZE mode function.
Remark (A) to (J) in Table 5-3 correspond to (A) to (J) in Figure 5-15.
5.6.5 Condition before changing CPU clock and processing after changing CPU clock
Condition before changing the CPU clock and processing after changing the CPU clock are shown below.
X1 clock High-speed on- Oscillation of high-speed on-chip oscillator X1 oscillation can be stopped (MSTOP = 1).
chip oscillator • HIOSTOP = 0
clock
External main Transition not possible −
system clock (To change the clock, set it again after
executing reset once.)
XT1 clock Stabilization of XT1 oscillation X1 oscillation can be stopped (MSTOP = 1).
• OSCSELS = 1, EXCLKS = 0, XTSTOP = 0
• After elapse of oscillation stabilization time
External Enabling input of external clock from the X1 oscillation can be stopped (MSTOP = 1).
subsystem clock EXCLKS pin
• OSCSELS = 1, EXCLKS = 1, XTSTOP = 0
External main High-speed on- Oscillation of high-speed on-chip oscillator External main system clock input can be
system clock chip oscillator • HIOSTOP = 0 disabled (MSTOP = 1).
clock
X1 clock Transition not possible −
(To change the clock, set it again after
executing reset once.)
XT1 clock Stabilization of XT1 oscillation External main system clock input can be
• OSCSELS = 1, EXCLKS = 0, XTSTOP = 0 disabled (MSTOP = 1).
• After elapse of oscillation stabilization time
External Enabling input of external clock from the External main system clock input can be
subsystem clock EXCLKS pin disabled (MSTOP = 1).
• OSCSELS = 1, EXCLKS = 1, XTSTOP = 0
XT1 clock High-speed on- Oscillation of high-speed on-chip oscillator XT1 oscillation can be stopped (XTSTOP =
chip oscillator and selection of high-speed on-chip 1)
clock oscillator clock as main system clock
• HIOSTOP = 0, MCS = 0
X1 clock Stabilization of X1 oscillation and selection
of high-speed system clock as main system
clock
• OSCSEL = 1, EXCLK = 0, MSTOP = 0
• After elapse of oscillation stabilization time
• MCS = 1
External main Enabling input of external clock from the
system clock EXCLK pin and selection of high-speed
system clock as main system clock
• OSCSEL = 1, EXCLK = 1, MSTOP = 0
• MCS = 1
External Transition not possible −
subsystem clock (To change the clock, set it again after
executing reset once.)
External High-speed on- Oscillation of high-speed on-chip oscillator External subsystem clock input can be
subsystem clock chip oscillator and selection of high-speed on-chip disabled (XTSTOP = 1).
clock oscillator clock as main system clock
• HIOSTOP = 0, MCS = 0
X1 clock Stabilization of X1 oscillation and selection
of high-speed system clock as main system
clock
• OSCSEL = 1, EXCLK = 0, MSTOP = 0
• After elapse of oscillation stabilization time
• MCS = 1
External main Enabling input of external clock from the
system clock EXCLK pin and selection of high-speed
system clock as main system clock
• OSCSEL = 1, EXCLK = 1, MSTOP = 0
• MCS = 1
XT1 clock Transition not possible −
(To change the clock, set it again after
executing reset once.)
5.6.6 Time required for switchover of CPU clock and main system clock
By setting bits 4 and 6 (MCM0, CSS) of the system clock control register (CKC), the CPU clock can be switched
(between the main system clock and the subsystem clock), and main system clock can be switched (between the high-
speed on-chip oscillator clock and the high-speed system clock).
The actual switchover operation is not performed immediately after rewriting to the CKC register; operation continues
on the pre-switchover clock for several clocks (see Table 5-5 to Table 5-7).
Whether the CPU is operating on the main system clock or the subsystem clock can be ascertained using bit 7 (CLS) of
the CKC register. Whether the main system clock is operating on the high-speed system clock or high-speed on-chip
oscillator clock can be ascertained using bit 5 (MCS) of the CKC register.
When the CPU clock is switched, the peripheral hardware clock is also switched.
Table 5-5. Maximum Time Required for Main System Clock Switchover
<R> 0 f MX ≥f IH 2 clock
(f MAIN = f IH ) f MX <f IH 2fIH/fMX clock
1 f MX ≥f IH 2fMX/fIH clock
(f MAIN = f MX ) f MX <f IH 2 clock
0 1 + 2fMAIN/fSUB clock
(f CLK = f MAIN )
<R> 1 3 clock
(f CLK = f SUB)
Remarks 1. The number of clocks listed in Table 5-6 and Table 5-7 is the number of CPU clocks before switchover.
2. Calculate the number of clocks in Table 5-6 and Table 5-7 by removing the decimal portion.
Example When switching the main system clock from the high-speed on-chip oscillator clock (when 8
MHz selected) to the high-speed system clock (@ oscillation with fIH = 8 MHz, fMX = 10 MHz)
1 + fIH/fMX = 1 + 8/10 = 1 + 0.8 = 1.8 → 2 clocks
Table 5-7. Conditions Before the Clock Oscillation Is Stopped and Flag Settings
The number of units or channels of the timer array unit differs, depending on the product.
Units Channels 20, 24, 25, 30, 32, 36, 80, 100-pin 128-pin
40, 44, 48, 52, 64-pin
Unit 0 Channel 0 √ √ √
Channel 1 √ √ √
Channel 2 √ √ √
Channel 3 √ √ √
Channel 4 √ √ √
Channel 5 √ √ √
Channel 6 √ √ √
Channel 7 √ √ √
Unit 1 Channel 0 − √ √
Channel 1 − √ √
Channel 2 − √ √
Channel 3 − √ √
Channel 4 − − √
Channel 5 − − √
Channel 6 − − √
Channel 7 − − √
Cautions 1. The presence or absence of timer I/O pins depends on the product. See Table 6-2 Timer I/O Pins
provided in Each Product for details.
2. Most of the following descriptions in this chapter use the 128-pin products as an example.
channel 1
channel 2
channel 6
channel 7
It is possible to use the 16-bit timer of channels 1 and 3 of the units 0 and 1 as two 8-bit timers (higher and lower). The
functions that can use channels 1 and 3 as 8-bit timers are as follows:
• Interval timer
• External event counter (lower 8-bit timer only)
• Delay counter (lower 8-bit timer only)
Channel 7 of unit 0 can be used to realize LIN-bus communication operating in combination with UART2 of the serial
array unit (30, 32, 36, 40, 44, 48, 52, 64, 80, 100, and 128-pin products only).
Compare operation
Operation clock Interrupt signal (INTTMmn)
Channel n (master)
Compare operation
Timer output
Channel p (slave) (TOmp) Duty
Period
Compare operation
Timer output
Channel p (slave) (TOmp) Duty
Period
Compare operation
Timer output
Channel q (slave) (TOmq) Duty
Period
Caution The following rules apply when using multiple channels simultaneously.
• Only an even-numbered channel (channel 0, 2, 4, …) can be specified as the master channel.
• Only channels with lower channel numbers than the master channel can be specified as slave
channels (multiple slave channels can be set).
For details about the rules of simultaneous channel operation function, see 6.4.1 Basic rules of
simultaneous channel operation function.
Caution There are several rules for using 8-bit timer operation function.
For details, see 6.4.2 Basic rules of 8-bit timer operation function (channels 1 and 3 only).
Remark For details about setting up the operations used to implement the LIN-bus, see 6.3 (13) Input switch control
register (ISC) and 6.7.5 Operation as input signal high-/low-level width measurement.
Item Configuration
Timer/counter Timer count register mn (TCRmn)
Register Timer data register mn (TDRmn)
Note 1
Timer input TI00 to TI07, TI10 to TI17 , RxD2 pin (for LIN-bus)
Note 1
Timer output TO00 to TO07, TO10 to TO17 pins , output controller
Control registers <Registers of unit setting block>
• Peripheral enable register 0 (PER0)
• Timer clock select register m (TPSm)
• Timer channel enable status register m (TEm)
• Timer channel start register m (TSm)
• Timer channel stop register m (TTm)
• Timer input select register 0 (TIS0)
• Timer output enable register m (TOEm)
• Timer output register m (TOm)
• Timer output level register m (TOLm)
• Timer output mode register m (TOMm)
<Registers of each channel>
• Timer mode register mn (TMRmn)
• Timer status register mn (TSRmn)
• Input switch control register (ISC)
• Noise filter enable registers 1, 2 (NFEN1, NFEN2)
• Port mode register (PMxx)
Note 2
Notes 1. The presence or absence of timer I/O pins of channel 0 to 7 depends on the product. See Table 6-2 Timer
I/O Pins provided in Each Product for details.
2. The port mode registers (PMxx) and port registers (Pxx) to be set differ depending on the product. for
details, see 6. 3 (15) Port mode registers 0, 1, 3, 4, 6, 10, 14 (PM0, PM1, PM3, PM4, PM6, PM10, PM14).
The presence or absence of timer I/O pins in each timer array unit channel depends on the product.
<R>
Table 6-2. Timer I/O Pins provided in Each Product
(P13)
P46/TI05/TO05 P05/TI05/TO05
Channel 5 (P12) (P12) (P12) (P12) − −
(P12) (P12)
P102/TI06/TO06 P06/TI06/TO06
Channel 6 (P11) (P11) (P11) (P11) − −
(P11) (P11)
P145/TI07/TO07 P41/TI07/TO07
Channel 7 (P10) (P10) − −
(P10) (P10)
Channel 0 P64/TI10/TO10 × × × × × × ×
Channel 1 P65/TI11/TO11 × × × × × × ×
Channel 2 P66/TI12/TO12 × × × × × × ×
Channel 3 P67/TI13/TO13 × × × × × × ×
P103/TI14
Channel 4 × × × × × × × × ×
Unit 1
/TO14
P104/TI15
Channel 5 × × × × × × × × ×
/TO15
P105/TI16
Channel 6 × × × × × × × × ×
/TO16
P106/TI17
Channel 7 × × × × × × × ×
/TO17
Note For 30- to 128-pin products, channel 2 and 3 can be set P15 and P14 with setting the bit 0 of the peripheral I/O
redirection register (PIOR) to “1”.
Remarks 1. When timer input and timer output are shared by the same pin, either only timer input or only timer output
can be used.
2. −: There is no timer I/O pin, but the channel is available. (However, the channel can only be used as an
interval timer.)
×: The channel is not available.
3. “(P1x)” indicates an alternate port when the bit 0 of the peripheral I/O redirection register (PIOR) is set to “1”.
Figures 6-1 and 6-2 show the block diagrams of the timer array unit.
Figure 6-1. Entire Configuration of Timer Array Unit 0 (Example: 64-pin products)
PRS031PRS030 PRS021 PRS020 PRS013 PRS012PRS011 PRS010 PRS003 PRS002 PRS001 PRS000
2 2 4 4
fCLK Prescaler
fCLK/21, fCLK/22,
fCLK/28, fCLK/210, fCLK/24,fCLK/26, fCLK/20 - fCLK/215
fCLK/212,fCLK/214,
Peripheral enable
register 0 Selector Selector
TAU0EN
(PER0)
Selector Selector
TO01
INTTM01
TI01 Channel 1 Slave/master controller INTTM01H
TO02
Timer input select TI02 INTTM02
register 0 (TIS0)
Channel 2
TO04
fSUB
TO05
Selector
fIL INTTM05
Channel 5
TI05
TO06
TO07
TI07
RxD2 Channel 7 (LIN-bus supported) INTTM07
(Serial input pin)
Slave/master
controller
CK00
clock selection
Count clock
Timer controller
Operating
selection
fMCK fTCLK Output
CK01 controller TO0n
MAS
CKS0n CCS0n STS0n2 STS0n1 STS0n0 CIS0n1 CIS0n0 MD0n3 MD0n2 MD0n1 MD0n0
TER0n
Remark n = 0, 2, 4, 6
Address: F0180H, F0181H (TCR00) to F018EH, F018FH (TCR07), After reset: FFFFH R
F01C0H, F01C1H (TCR10) to F01CEH, F01CFH (TCR17)
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
TCRmn
The count value can be read by reading timer count register mn (TCRmn).
The count value is set to FFFFH in the following cases.
• When the reset signal is generated
• When the TAUmEN bit of peripheral enable register 0 (PER0) is cleared
• When counting of the slave channel has been completed in the PWM output mode
<R> • When counting of the slave channel has been completed in the delay count mode
• When counting of the master/slave channel has been completed in the one-shot pulse output mode
• When counting of the slave channel has been completed in the multiple PWM output mode
The count value is cleared to 0000H in the following cases.
• When the start trigger is input in the capture mode
• When capturing has been completed in the capture mode
Caution The count value is not captured to timer data register mn (TDRmn) even when the TCRmn
register is read.
The TCRmn register read value differs as follows according to operation mode changes and the operating status.
Table 6-3. Timer Count Register mn (TCRmn) Read Value in Various Operation Modes
Note
Operation Mode Count Mode Timer count register mn (TCRmn) Read Value
Value if the Value if the Value if the Value when waiting
operation mode operation mode was Operation was for a start trigger
was changed after changed after count restarted after count after one count
releasing reset operation paused operation paused
(TTmn = 1) (TTmn = 1)
Interval timer Count down FFFFH Undefined Stop value −
mode
Capture mode Count up 0000H Undefined Stop value −
Event counter Count down FFFFH Undefined Stop value −
mode
One-count mode Count down FFFFH Undefined Stop value FFFFH
Capture & one- Count up 0000H Undefined Stop value Capture value of
count mode TDRmn register + 1
Note This indicates the value read from the TCRmn register when channel n has stopped operating as a timer (TEmn = 0)
and has been enabled to operate as a counter (TSmn = 1). The read value is held in the TCRmn register until the
count operation starts.
Address: FFF18H, FFF19H (TDR00), FFF64H, FFF65H (TDR02), After reset: 0000H R/W
FFF68H, FFF69H (TDR04) to FFF6EH, FFF6FH (TDR07),
FFF70H, FFF71H (TDR10), FFF74H, FFF75H (TDR12),
FFF78H, FFF79H (TDR14) to FFF7EH, FFF7FH (TDR17)
FFF19H (TDR00) FFF18H (TDR00)
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
TDRmn
Address: FFF1AH, FFF1BH (TDR01), FFF65H, FFF66H (TDR03), After reset: 0000H R/W
FFF72H, FFF73H (TDR11), FFF76H, FFF77H (TDR13),
FFF1BH (TDR01H) FFF1AH (TDR01L)
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
TDRmn
Caution The TDRmn register does not perform a capture operation even if a capture trigger is input,
when it is set to the compare function.
Note The port mode registers (PMxx) and port registers (Pxx) to be set differ depending on the product. For details,
see 6. 3 (15) Port mode registers 0, 1, 3, 4, 6, 10, 14 (PM0, PM1, PM3, PM4, PM6, PM10, PM14).
Cautions 1. When setting the timer array unit, be sure to set the TAUmEN bit to 1 first. If TAUmEN = 0,
writing to a control register of timer array unit is ignored, and all read values are default
values (except for the timer input select register 0 (TIS0), input switch control register
(ISC), noise filter enable register 1, 2 (NFEN1, NFEN2), port mode registers 0, 1, 3, 4, 6, 10,
14 (PM0, PM1, PM3, PM4, PM6, PM10, PM14), and port registers 0, 1, 3, 4, 6, 10, 14 (P0, P1,
P3, P4, P6, P10, P14)).
2. Be sure to clear the following bits to 0.
20-pin products: bits 1, 3, 4, 6
24, 25-pin products: bits 1, 3, 6
30, 32, 36, 40, 44, 48, 52, 64-pin products: bits 1, 6
Address: F01B6H, F01B7H (TPS0), F01F6H, F01F7H (TPS1) After reset: 0000H R/W
Symbol 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
TPSm 0 0 PRS PRS 0 0 PRS PRS PRS PRS PRS PRS PRS PRS PRS PRS
m31 m30 m21 m20 m13 m12 m11 m10 m03 m02 m01 m00
Note
PRS PRS PRS PRS Selection of operation clock (CKmk) (k = 0, 1)
mk3 mk2 mk1 mk0 fCLK = 2 MHz fCLK = 5 MHz fCLK = 10 MHz fCLK = 20 MHz fCLK = 32 MHz
Note When changing the clock selected for fCLK (by changing the system clock control register (CKC)
value), stop timer array unit (TTm = 00FFH).
The timer array unit must also be stopped if the operating clock (fMCK) specified by using the
CKSmn0 and CKSmn1 bits or the valid edge of the signal input from the TImn pin is selected as the
count clock (fTCLK).
Address: F01B6H, F01B7H (TPS0), F01F6H, F01F7H (TPS1) After reset: 0000H R/W
Symbol 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
TPSm 0 0 PRS PRS 0 0 PRS PRS PRS PRS PRS PRS PRS PRS PRS PRS
m31 m30 m21 m20 m13 m12 m11 m10 m03 m02 m01 m00
Note
PRS PRS Selection of operation clock (CKm2)
m21 m20 fCLK = 2 MHz fCLK = 5 MHz fCLK = 10 MHz fCLK = 20 MHz fCLK = 32 MHz
Note
PRS PRS Selection of operation clock (CKm3)
m31 m30 fCLK = 2 MHz fCLK = 5 MHz fCLK = 10 MHz fCLK = 20 MHz fCLK = 32 MHz
8
0 0 fCLK/2 7.81 kHz 19.5 kHz 39.1 kHz 78.1 kHz 125 kHz
10
0 1 fCLK/2 1.95 kHz 4.88 kHz 9.76 kHz 19.5 kHz 31.25 kHz
12
1 0 fCLK/2 488 Hz 1.22 kHz 2.44 kHz 4.88 kHz 7.81 kHz
14
1 1 fCLK/2 122 HZ 305 Hz 610 Hz 1.22 kHz 1.95 kHZ
Note When changing the clock selected for fCLK (by changing the system clock control register (CKC)
value), stop timer array unit (TTm = 00FFH).
The timer array unit must also be stopped if the operating clock (fMCK) specified by using the
CKSmn0, and CKSmn1 bits or the valid edge of the signal input from the TImn pin is selected as the
count clock (fTCLK).
By using channels 1 and 3 in the 8-bit timer mode and specifying CKm2 or CKm3 as the operation clock, the
interval times shown in Table 6-4 can be achieved by using the interval timer function.
Table 6-4. Interval Times Available for Operation Clock CKSm2 or CKSm3
<R> Caution The bits mounted depend on the channels in the bit 11 of TMRmn register.
TMRm2, TMRm4, TMRm6: MASTERmn bit (n = 2, 4, 6)
TMRm1, TMRm3: SPLITmn bit (n = 1, 3)
TMRm0, TMRm5, TMRm7: Fixed to 0
Address: F0190H, F0191H (TMR00) to F019EH, F019FH (TMR07) After reset: 0000H R/W
F01D0H, F01D1H (TMR10) to F01DEH, F01DFH (TMR17)
Symbol 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
TMRmn CKS CKS 0 CCS MAST STS STS STS CIS CIS 0 0 MD MD MD MD
(n = 2, 4, 6 ) mn1 mn0 mn ERmn mn2 mn1 mn0 mn1 mn0 mn3 mn2 mn1 mn0
Symbol 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
TMRmn CKS CKS 0 CCS SPLIT STS STS STS CIS CIS 0 0 MD MD MD MD
(n = 1, 3) mn1 mn0 mn mn mn2 mn1 mn0 mn1 mn0 mn3 mn2 mn1 mn0
Symbol 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Count clock (fTCLK) is used for the timer/counter, output controller, and interrupt controller.
Address: F0190H, F0191H (TMR00) to F019EH, F019FH (TMR07) After reset: 0000H R/W
F01D0H, F01D1H (TMR10) to F01DEH, F01DFH (TMR17)
Symbol 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
TMRmn CKS CKS 0 CCS MAST STS STS STS CIS CIS 0 0 MD MD MD MD
(n = 2, 4, 6 ) mn1 mn0 mn ERmn mn2 mn1 mn0 mn1 mn0 mn3 mn2 mn1 mn0
Symbol 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
TMRmn CKS CKS 0 CCS SPLIT STS STS STS CIS CIS 0 0 MD MD MD MD
(n = 1, 3) mn1 mn0 mn mn mn2 mn1 mn0 mn1 mn0 mn3 mn2 mn1 mn0
Symbol 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
0 Operates in independent channel operation function or as slave channel in simultaneous channel operation
function.
1 Operates as master channel in simultaneous channel operation function.
<R> Only the channel 2, 4, 6 can be set as a master channel (MASTERmn = 1).
Be sure to use channel 0, 5, 7 are fixed to 0 (Regardless of the bit setting, channel 0 operates as master, because it
is the highest channel).
Clear the MASTERmn bit to 0 for a channel that is used with the independent channel operation function.
0 0 0 Only software trigger start is valid (other trigger sources are unselected).
0 0 1 Valid edge of the TImn pin input is used as both the start trigger and capture trigger.
0 1 0 Both the edges of the TImn pin input are used as a start trigger and a capture trigger.
1 0 0 Interrupt signal of the master channel is used (when the channel is used as a slave channel
with the simultaneous channel operation function).
Other than above Setting prohibited
Address: F0190H, F0191H (TMR00) to F019EH, F019FH (TMR07) After reset: 0000H R/W
F01D0H, F01D1H (TMR10) to F01DEH, F01DFH (TMR17)
Symbol 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
TMRmn CKS CKS 0 CCS MAST STS STS STS CIS CIS 0 0 MD MD MD MD
(n = 2, 4, 6 ) mn1 mn0 mn ERmn mn2 mn1 mn0 mn1 mn0 mn3 mn2 mn1 mn0
Symbol 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
TMRmn CKS CKS 0 CCS SPLIT STS STS STS CIS CIS 0 0 MD MD MD MD
(n = 1, 3) mn1 mn0 mn mn mn2 mn1 mn0 mn1 mn0 mn3 mn2 mn1 mn0
Symbol 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
0 0 Falling edge
0 1 Rising edge
1 0 Both edges (when low-level width is measured)
Start trigger: Falling edge, Capture trigger: Rising edge
1 1 Both edges (when high-level width is measured)
Start trigger: Rising edge, Capture trigger: Falling edge
If both the edges are specified when the value of the STSmn2 to STSmn0 bits is other than 010B, set the CISmn1
to CISmn0 bits to 10B.
0 0 0 1/0 Interval timer mode Interval timer / Square wave Counting down
output / Divider function / PWM
output (master)
0 1 0 1/0 Capture mode Input pulse interval Counting up
measurement
0 1 1 0 Event counter mode External event counter Counting down
1 0 0 1/0 One-count mode Delay counter / One-shot pulse Counting down
output / PWM output (slave)
1 1 0 0 Capture & one-count mode Measurement of high-/low-level Counting up
width of input signal
Other than above Setting prohibited
The operation of the MDmn0 bit varies depending on each operation mode (see table below).
Address: F0190H, F0191H (TMR00) to F019EH, F019FH (TMR07) After reset: 0000H R/W
F01D0H, F01D1H (TMR10) to F01DEH, F01DFH (TMR17)
Symbol 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
TMRmn CKS CKS 0 CCS MAST STS STS STS CIS CIS 0 0 MD MD MD MD
(n = 2, 4, 6 ) mn1 mn0 mn ERmn mn2 mn1 mn0 mn1 mn0 mn3 mn2 mn1 mn0
Symbol 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
TMRmn CKS CKS 0 CCS SPLIT STS STS STS CIS CIS 0 0 MD MD MD MD
(n = 1, 3) mn1 mn0 mn mn mn2 mn1 mn0 mn1 mn0 mn3 mn2 mn1 mn0
Symbol 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Notes 1. In one-count mode, interrupt output (INTTMmn) when starting a count operation and TOmn output are
not controlled.
<R> 2. If the start trigger (TSmn = 1) is issued during operation, the counter is initialaized, an interrupt is
generated, and recounting is started.
Address: F01A0H, F01A1H (TSR00) to F01AEH, F01AFH (TSR07), After reset: 0000H R
F01E0H, F01E1H (TSR10) to F01EEH, F01EFH (TSR17)
Symbol 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
TSRmn 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 OVF
When OVF = 1, this flag is cleared (OVF = 0) when the next value is captured without overflow.
Table 6-5. OVF Bit Operation and Set/Clear Conditions in Each Operation Mode
Remark The OVF bit does not change immediately after the counter has overflowed, but changes upon the
subsequent capture.
Address: F01B0H, F01B1H (TE0), F01F0H, F01F1H (TE1) After reset: 0000H R
Symbol 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
TEm 0 0 0 0 TEHm 0 TEHm 0 TEm TEm TEm TEm TEm TEm TEm TEm
3 1 7 6 5 4 3 2 1 0
TEH Indication of whether operation of the higher 8-bit timer is enabled or stopped when channel 3 is in the 8-bit
03 timer mode
0 Operation is stopped.
1 Operation is enabled.
TEH Indication of whether operation of the higher 8-bit timer is enabled or stopped when channel 1 is in the 8-bit
01 timer mode
0 Operation is stopped.
1 Operation is enabled.
0 Operation is stopped.
1 Operation is enabled.
This bit displays whether operation of the lower 8-bit timer for TEm1 and TEm3 is enabled or stopped when channel
1 or 3 is in the 8-bit timer mode.
Address: F01B2H, F01B3H (TS0), F01F2H, F01F3H (TS1) After reset: 0000H R/W
Symbol 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
TSm 0 0 0 0 TSHm 0 TSHm 0 TSm TSm TSm TSm TSm TSm TSm TSm
3 1 7 6 5 4 3 2 1 0
TSH Trigger to enable operation (start operation) of the higher 8-bit timer when channel 3 is in the 8-bit timer mode
m3
0 No trigger operation
1 The TEHm3 bit is set to 1 and the count operation becomes enabled.
The TCRm3 register count operation start in the interval timer mode in the count operation enabled state
(see Table 6-6 in 6.5.2 Start timing of counter).
TSH Trigger to enable operation (start operation) of the higher 8-bit timer when channel 1 is in the 8-bit timer mode
m1
0 No trigger operation
1 The TEHm1 bit is set to 1 and the count operation becomes enabled.
The TCRm1 register count operation start in the interval timer mode in the count operation enabled state
(see Table 6-6 in 6.5.2 Start timing of counter).
0 No trigger operation
1 The TEmn bit is set to 1 and the count operation becomes enabled.
The TCRmn register count operation start in the count operation enabled state varies depending on each
operation mode (see Table 6-6 in 6.5.2 Start timing of counter).
This bit is the trigger to enable operation (start operation) of the lower 8-bit timer for TSm1 and TSm3 when
channel 1 or 3 is in the 8-bit timer mode.
TTm 0 0 0 0 TTHm 0 TTHm 0 TTm TTm TTm TTm TTm TTm TTm TTm
3 1 7 6 5 4 3 2 1 0
TTH Trigger to stop operation of the higher 8-bit timer when channel 3 is in the 8-bit timer mode
m3
0 No trigger operation
1 Operation is stopped (stop trigger is generated).
TTH Trigger to stop operation of the higher 8-bit timer when channel 1 is in the 8-bit timer mode
m1
0 No trigger operation
1 Operation is stopped (stop trigger is generated).
0 No trigger operation
1 Operation is stopped (stop trigger is generated).
This bit is the trigger to stop operation of the lower 8-bit timer for TTm1 and TTm3 when channel 1 or 3 is in
the 8-bit timer mode.
Caution Be sure to clear bits 15 to 12, 10, 8 of the TTm register to “0”.
Address: F01BAH, F01BBH (TOE0), F01FAH, F01FBH (TOE1) After reset: 0000H R/W
Symbol 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
0 The TOmn operation stopped by count operation (timer channel output bit).
Writing to the TOmn bit is enabled.
The TOmn pin functions as data output, and it outputs the level set to the TOmn bit.
The output level of the TOmn pin can be manipulated by software.
1 The TOmn operation enabled by count operation (timer channel output bit).
Writing to the TOmn bit is disabled (writing is ignored).
The TOmn pin functions as timer output, and the TOEmn bit is set or reset depending on the timer
operation.
The TOmn pin outputs the square-wave or PWM depending on the timer operation.
Address: F01B8H, F01B9H (TO0), F01F8H, F01F9H (TO1) After reset: 0000H R/W
Symbol 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Address: F01BCH, F01BDH (TOL0), F01FCH, F01FDH (TOL1) After reset: 0000H R/W
Symbol 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Remarks 1. If the value of this register is rewritten during timer operation, the timer output logic is inverted when
the timer output signal changes next, instead of immediately after the register value is rewritten.
2. m: Unit number (m = 0, 1), n: Channel number (n = 0 to 7)
Address: F01BEH, F01BFH (TOM0), F01FEH, F01FFH (TOM1) After reset: 0000H R/W
Symbol 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
0 Master channel output mode (to produce toggle output by timer interrupt request signal (INTTMmn))
1 Slave channel output mode (output is set by the timer interrupt request signal (INTTMmn) of the master
channel, and reset by the timer interrupt request signal (INTTM0p) of the slave channel)
0 Uses the input signal of the INTP0 pin as an external interrupt (normal operation).
1 Uses the input signal of the RXD2 pin as an external interrupt (wakeup signal detection).
Remark When the LIN-bus communication function is used, select the input signal of the RxD2 pin by setting
ISC1 to 1.
Note For details, see 6.5.1 (2) When valid edge of input signal input from the TImn pin is selected (CCSmn
= 1) and 6.5.2 Start timing of counter.
Figure 6-19. Format of Noise Filter Enable Registers 1, 2 (NFEN1, NFEN2) (1/2)
Note
TNFEN07 Enable/disable using noise filter of TI07/TO07/P145 pin or RxD2/P14 pin input signal
0 Noise filter OFF
1 Noise filter ON
Note The applicable pin can be switched by setting the ISC1 bit of the ISC register.
ISC1 = 0: Whether or not to use the noise filter of the TI07 pin can be selected.
ISC1 = 1: Whether or not to use the noise filter of the RxD2 pin can be selected.
Remark The presence or absence of timer I/O pins of channel 0 to 7 depends on the product. See Table 6-2
Timer I/O Pins provided in Each Product for details.
Figure 6-19. Format of Noise Filter Enable Registers 1, 2 (NFEN1, NFEN2) (2/2)
Remark The presence or absence of timer I/O pins of channel 0 to 7 depends on the product. See Table 6-2
Timer I/O Pins provided in Each Product for details.
(15) Port mode registers 0, 1, 3, 4, 6, 10, 14 (PM0, PM1, PM3, PM4, PM6, PM10, PM14)
These registers set input/output of ports 0, 1, 3, 4, 6, 10, 14 in 1-bit units.
The presence or absence of timer I/O pins depends on the product. When using the timer array unit, set the
following port mode registers according to the product used.
20, 24, 25, 30, 32, 36, and 40-pin products: PM0, PM1, PM3
44, 48, 52, and 64-pin products: PM0, PM1, PM3, PM4
80-pin products: PM0, PM1, PM3, PM4, PM6
100 and 128-pin products: PM0, PM1, PM3, PM4, PM6, PM10, PM14
When using the ports (such as P01/TO00 and P17/TO02/TI02) to be shared with the timer output pin for timer
output, set the port mode register (PMxx) bit and port register (Pxx) bit corresponding to each port to 0.
When using the ports (such as P00/TI00 and P17/TO02/TI02) to be shared with the timer input pin for timer input,
set the port mode register (PMxx) bit corresponding to each port to 1. At this time, the port register (Pxx) bit may
be 0 or 1.
The PM0, PM1, PM3, PM4, PM6, PM10, PM14 registers can be set by a 1-bit or 8-bit memory manipulation
instruction.
Reset signal generation sets these registers to FFH.
<R> Remark In the 20- to 30-pin products, TI00 (P00) and TO00 (P01) pins alternate analog input pins. When using
the timer I/O function, the corresponding bit of the PMC0 register for switching digital I/O or analog input
is sure to set to “0”.
Figure 6-20. Format of Port Mode Registers 0, 1, 3, 4, 6, 10, 14 (PM0, PM1, PM3, PM4, PM6, PM10, PM14)
(128-pin products)
Remark The figure shown above presents the format of port mode registers 0, 1, 3, 4, 6, 10, and 14 of the 128-pin
products. The format of the port mode register of other products, see 4.3 (1) Port mode registers (PMxx).
(1) Only an even channel (channel 0, 2, 4, etc.) can be set as a master channel.
(2) Any channel, except channel 0, can be set as a slave channel.
(3) The slave channel must be lower than the master channel.
Example: If channel 2 is set as a master channel, channel 3 or those that follow (channels 3, 4, 5, etc.) can be set
as a slave channel.
(4) Two or more slave channels can be set for one master channel.
(5) When two or more master channels are to be used, slave channels with a master channel between them may not
be set.
Example: If channels 0 and 4 are set as master channels, channels 1 to 3 can be set as the slave channels of
master channel 0. Channels 5 to 7 cannot be set as the slave channels of master channel 0.
(6) The operating clock for a slave channel in combination with a master channel must be the same as that of the
master channel. The CKSmn0, CKSmn1 bits (bit 15, 14 of timer mode register mn (TMRmn)) of the slave channel
that operates in combination with the master channel must be the same value as that of the master channel.
(7) A master channel can transmit INTTMmn (interrupt), start software trigger, and count clock to the lower channels.
(8) A slave channel can use INTTMmn (interrupt), a start software trigger, or the count clock of the master channel as
a source clock, but cannot transmit its own INTTMmn (interrupt), start software trigger, or count clock to channels
with lower channel numbers.
(9) A master channel cannot use INTTMmn (interrupt), a start software trigger, or the count clock from the other higher
master channel as a source clock.
(10) To simultaneously start channels that operate in combination, the channel start trigger bit (TSmn) of the channels
in combination must be set at the same time.
<R> (11) During the counting operation, a TSmn bit of a master channel or TSmn bits of all channels which are operating
simultaneously can be set. It cannot be applied to TSmn bits of slave channels alone.
(12) To stop the channels in combination simultaneously, the channel stop trigger bit (TTmn) of the channels in
combination must be set at the same time.
<R> (13) CKm2/CKm3 cannot be selected while channels are operating simultaneously, because the operating clocks of
master channels and slave channels have to be synchronized.
<R> (14) Timer mode register m0 (TMRm0) has no master bit (it is fixed as “0”). However, as channel 0 is the highest
channel, it can be used as a master channel during simultaneous operation.
The rules of the simultaneous channel operation function are applied in a channel group (a master channel and slave
channels forming one simultaneous channel operation function).
If two or more channel groups that do not operate in combination are specified, the basic rules of the simultaneous
channel operation function in 6.4.1 Basic rules of simultaneous channel operation function do not apply to the
channel groups.
Example
TAU0
6.4.2 Basic rules of 8-bit timer operation function (channels 1 and 3 only)
The 8-bit timer operation function makes it possible to use a 16-bit timer channel in a configuration consisting of two 8-
bit timer channels.
This function can only be used for channels 1 and 3, and there are several rules for using it.
The basic rules for this function are as follows:
(1) The 8-bit timer operation function applies only to channels 1 and 3.
(2) When using 8-bit timers, set the SPLIT bit of timer mode register mn (TMRmn) to 1.
(3) The higher 8 bits can be operated as the interval timer function.
(4) At the start of operation, the higher 8 bits output INTTMm1H/INTTMm3H (an interrupt) (which is the same
operation performed when MDmn0 is set to 1).
(5) The operation clock of the higher 8 bits is selected according to the CKSmn1 and CKSmn0 bits of the lower-bit
TMRmn register.
(6) For the higher 8 bits, the TSHm1/TSHm3 bit is manipulated to start channel operation and the TTHm1/TTHm3 bit
is manipulated to stop channel operation. The channel status can be checked using the TEHm1/TEHm3 bit.
(7) The lower 8 bits operate according to the TMRmn register settings. The following three functions support
operation of the lower 8 bits:
• Interval timer function
• External event counter function
• Delay count function
(8) For the lower 8 bits, the TSm1/TSm3 bit is manipulated to start channel operation and the TTm1/TTm3 bit is
manipulated to stop channel operation. The channel status can be checked using the TEm1/TEm3 bit.
(9) During 16-bit operation, manipulating the TSHm1, TSHm3, TTHm1, and TTHm3 bits is invalid. The TSm1, TSm3,
TTm1, and TTm3 bits are manipulated to operate channels 1 and 3. The TEHm3 and TEHm1 bits are not changed.
(10) For the 8-bit timer function, the simultaneous operation functions (one-shot pulse, PWM, and multiple PWM)
cannot be used.
Because the timer array unit is designed to operate in synchronization with fCLK, the timings of the count clock (fTCLK) are
shown below.
(1) When operation clock (fMCK) specified by the CKSmn0 and CKSmn1 bits is selected (CCSmn = 0)
The count clock (fTCLK) is between fCLK to fCLK /215 by setting of timer clock select register m (TPSm). When a
divided fCLK is selected, however, the count clock is not a signal which is simply divided fCLK by 2m, but a signal
which becomes high level for one period of fCLK from its rising edge (m = 1 to 15).
Counting of timer count register mn (TCRmn) delayed by one period of fCLK from rising edge of the count clock,
because of synchronization with fCLK. But, this is described as “counting at rising edge of the count clock”, as a
matter of convenience.
Figure 6-21. Timing of fCLK and count clock (fTCLK) (When CCSmn = 0)
fCLK
fCLK/2
fCLK/4
fTCLK
( = fMCK fCLK/8
= CKmn)
fCLK/16
(2) When valid edge of input signal via the TImn pin is selected (CCSmn = 1)
The count clock (fTCLK) becomes the signal that detects valid edge of input signal via the TImn pin and synchronizes
next rising fMCK. The count clock (fTCLK) is delayed for 1 to 2 period of fMCK from the input signal via the TImn pin
(when a noise filter is used, the delay becomes 3 to 4 clock).
Counting of timer count register mn (TCRmn) delayed by one period of fCLK from rising edge of the count clock,
because of synchronization with fCLK. But, this is described as “counting at valid edge of input signal via the TImn
pin”, as a matter of convenience.
Figure 6-22. Timing of fCLK and count clock (fTCLK) (When CCSmn = 1, noise filter unused)
fMCK
TSmn(Write)
<1>
TEmn
TImn input
<2>
Sampling wave
Edge detection <3> Edge detection
Rising edge
detection signal (fTCLK)
<1> Setting TSmn bit to 1 enables the timer to be started and to become wait state for valid edge of input
signal via the TImn pin.
<2> The rise of input signal via the TImn pin is sampled by fMCK.
<3> The edge is detected by the rising of the sampled signal and the detection signal (count clock) is output.
Table 6-6. Operations from Count Operation Enabled State to Timer count Register mn (TCRmn) Count Start
• Interval timer mode No operation is carried out from start trigger detection (TSmn=1) until count clock
generation.
The first count clock loads the value of the TDRmn register to the TCRmn
register and the subsequent count clock performs count down operation (see
6.5.2 (a) Start timing in interval timer mode).
• Event counter mode Writing 1 to the TSmn bit loads the value of the TDRmn register to the TCRmn
register.
The subsequent count clock performs count down operation.
The external trigger detection selected by the STSmn2 to STSmn0 bits in the
TMRmn register does not start count operation (see 6.5.2 (b) Start timing in
event counter mode).
• Capture mode No operation is carried out from start trigger detection until count clock
generation.
The first count clock loads 0000H to the TCRmn register and the subsequent
count clock performs count up operation (see 6.5.2 (c) Start timing in capture
mode).
• One-count mode The waiting-for-start-trigger state is entered by writing 1 to the TSmn bit while the
timer is stopped (TEmn = 0).
No operation is carried out from start trigger detection until count clock
generation.
The first count clock loads the value of the TDRmn register to the TCRmn
register and the subsequent count clock performs count down operation (see
6.5.2 (d) Start timing in one-count mode).
• Capture & one-count mode The waiting-for-start-trigger state is entered by writing 1 to the TSmn bit while the
timer is stopped (TEmn = 0).
No operation is carried out from start trigger detection until count clock
generation.
The first count clock loads 0000H to the TCRmn register and the subsequent
count clock performs count up operation (see 6.5.2 (e) Start timing in capture &
one-count mode).
<1> Operation is enabled (TEmn = 1) by writing 1 to the TSmn bit. Timer count register mn (TCRmn) holds the
initial value until count clock generation.
<2> A start trigger is generated at the first count clock after operation is enabled.
<3> When the MDmn0 bit is set to 1, INTTMmn is generated by the start trigger.
<4> By the first count clock after the operation enable, the value of timer data register mn (TDRmn) is loaded
to the TCRmn register and counting starts in the interval timer mode.
<5> When the TCRmn register counts down and its count value is 0000H, INTTMmn is generated and the
value of timer data register mn (TDRmn) is loaded to the TCRmn register and counting keeps on.
fMCK
(fTCLK)
TSmn(Write)
<1>
TEmn
<2>
Start trigger
detection signal
<5>
INTTMmn
Remark fMCK, the start trigger detection signal, and INTTMmn become active between one clock in
synchronization with fCLK.
Caution In the first cycle operation of count clock after writing the TSmn bit, an error at a maximum of one
clock is generated since count start delays until count clock has been generated. When the
information on count start timing is necessary, an interrupt can be generated at count start by
setting MDmn0 = 1.
<1> Timer count register mn (TCRmn) holds its initial value while operation is stopped (TEmn = 0).
<2> Operation is enabled (TEmn = 1) by writing 1 to the TSmn bit.
<3> As soon as 1 has been written to the TSmn bit and 1 has been set to the TEmn bit, the value of timer data
register mn (TDRmn) is loaded to the TCRmn register to start counting.
<4> After that, the TCRmn register value is counted down according to the count clock of the valid edge of the
TImn input .
fMCK
TSmn(Write)
<1>
TEmn
<2>
TImn input
<1> <3>
TDRmn m
Remark The timing is shown in Figure 6-24 indicates while the noise filter is not used. By making the noise filter
on-state, the edge detection becomes 2 fMCK cycles (it sums up to 3 to 4 cycles) later than the normal
cycle of TImn input.
fMCK
(fTCLK)
TSmn(Write)
<1>
TEmn
<3>
TI0n input
TDRmn 0001 m
INTTMmn
When MDmn0=1
setting
Remark The timing is shown in Figure 6-25 indicates while the noise filter is not used. By making the noise filter
on-state, the edge detection becomes 2 fMCK cycles (it sums up to 3 to 4 cycles) later than the normal
cycle of TImn input.
Since the start of the count and the timing of TIm input are asynchronous, the first capture value (<4> in
Figure 6-24) has absolutely no connection with the pulse interval. Therefore, ignore the first capture
value.
Caution In the first cycle operation of count clock after writing the TSmn bit, an error at a maximum of one
clock is generated since count start delays until count clock has been generated. When the
information on count start timing is necessary, an interrupt can be generated at count start by
setting MDmn0 = 1.
fMCK
(fTCLK)
TSmn(Write)
<1>
TEmn
Edge detection
Rising edge
<4>
Start trigger
detection signal
<2> <5>
INTTMmn
Remark The timing is shown in Figure 6-26 indicates while the noise filter is not used. By making the noise filter
on-state, the edge detection becomes 2 fMCK cycles (it sums up to 3 to 4 cycles) later than the normal
cycle of TImn input. The error per one period occurs be the asynchronous between the period of the
TImn input and that of the count clock (fMCK).
(e) Start timing in capture & one-count mode (when high-level width is measured)
<1> Operation is enabled (TEmn = 1) by writing 1 to the TSmn bit of timer channel start register m (TSm).
<2> Timer count register mn (TCRmn) holds the initial value until start trigger generation.
<3> Rising edge of the TImn input is detected.
<R> <4> On start trigger detection, the value of 0000H is loaded to the TCRmn register and count starts.
<5> On detection of the falling edge of the TImn input, the value of the TCRmn register is captured to timer
data register mn (TDRmn) and INTTMmn is generated.
fMCK
(fTCLK)
TSmn(Write)
<1>
TEmn
Start trigger
detection signal
<2>
TDRmn 0000 m
<R> INTTMmn
Remark The timing is shown in Figure 6-27 indicates while the noise filter is not used. By making the noise filter
on-state, the edge detection becomes 2 fMCK cycles (it sums up to 3 to 4 cycles) later than the normal
cycle of TImn input.
<5>
TOmn register
Interrupt signal of the master channel
(INTTMmn)
Controller
Set
TOLmn
TOMmn Internal bus
<1> When TOMmn = 0 (master channel output mode), the set value of timer output level register m (TOLm) is
ignored and only INTTM0p (slave channel timer interrupt) is transmitted to timer output register m (TOm).
<2> When TOMmn = 1 (slave channel output mode), both INTTMmn (master channel timer interrupt) and
INTTM0p (slave channel timer interrupt) are transmitted to the TOm register.
At this time, the TOLm register becomes valid and the signals are controlled as follows:
When INTTMmn and INTTM0p are simultaneously generated, (0% output of PWM), INTTM0p (reset signal)
takes priority, and INTTMmn (set signal) is masked.
<3> While timer output is enabled (TOEmn = 1), INTTMmn (master channel timer interrupt) and INTTM0p (slave
channel timer interrupt) are transmitted to the TOm register. Writing to the TOm register (TOmn write signal)
becomes invalid.
When TOEmn = 1, the TOmn pin output never changes with signals other than interrupt signals.
To initialize the TOmn pin output level, it is necessary to set timer operation is stopeed (TOEmn = 0) and to
write a value to the TOm register.
<4> While timer output is disabeled (TOEmn = 0), writing to the TOmn bit to the target channel (TOmn write signal)
becomes valid. When timer output is disabeled (TOEmn = 0), neither INTTMmn (master channel timer
interrupt) nor INTTM0p (slave channel timer interrupt) is transmitted to the TOm register.
<5> The TOm register can always be read, and the TOmn pin output level can be checked.
Figure 6-29. Status Transition from Timer Output Setting to Operation Start
Hi-Z
Timer alternate-function pin
TOmn
TOEmn
Write operation enabled period to TOmn Write operation disabled period to TOmn
<1> Set TOMmn <2> Set TOmn <3> Set TOEmn <4> Set the port to <5> Timer operation start
Set TOLmn output mode
• TOMmn bit (0: Master channel output mode, 1: Slave channel output mode)
• TOLmn bit (0: Positive logic output, 1: Negative logic output)
<2> The timer output signal is set to the initial status by setting timer output register m (TOm).
<3> The timer output operation is enabled by writing 1 to the TOEmn bit (writing to the TOm register is disabled).
<4> The port I/O setting is set to output (see 6.3 (15) Port mode registers 0, 1, 3, 4, 6, 10, 14 (PM0, PM1, PM3,
PM4, PM6, PM10, PM14)).
<5> The timer operation is enabled (TSmn = 1).
(1) Changing values set in the registers TOm, TOEm, TOLm, and TOMm during timer operation
Since the timer operations (operations of timer count register mn (TCRmn) and timer data register mn (TDRmn)) are
independent of the TOmn output circuit and changing the values set in timer output register m (TOm), timer output
enable register m (TOEm), timer output level register m (TOLm), and timer output mode register m (TOMm) does not
affect the timer operation, the values can be changed during timer operation. To output an expected waveform from the
TOmn pin by timer operation, however, set the TOm, TOEm, TOLm, and TOMm registers to the values stated in the
register setting example of each operation shown by 6.7 and 6.8.
When the values set to the TOEm, TOLm, and TOMm registers (but not the TOm register) are changed close to the
occurrence of the timer interrupt (INTTMmn) of each channel, the waveform output to the TOmn pin might differ,
depending on whether the values are changed immediately before or immediately after the timer interrupt (INTTMmn)
occurs.
(2) Default level of TOmn pin and output level after timer operation start
The change in the output level of the TOmn pin when timer output register m (TOm) is written while timer output is
disabled (TOEmn = 0), the initial level is changed, and then timer output is enabled (TOEmn = 1) before port
output is enabled, is shown below.
(a) When operation starts with master channel output mode (TOMmn = 0) setting
The setting of timer output level register m (TOLm) is invalid when master channel output mode (TOMmn = 0).
When the timer operation starts after setting the default level, the toggle signal is generated and the output
level of the TOmn pin is reversed.
<R> Figure 6-30. TOmn Pin Output Status at Toggle Output (TOMmn = 0)
TOEmn
TOmn = 0, TOLmn = 1
Hi-Z
(Same output waveform as TOLmn = 0)
(b) When operation starts with slave channel output mode (TOMmn = 1) setting (PWM output))
When slave channel output mode (TOMmn = 1), the active level is determined by timer output level register m
(TOLm) setting.
TOEmn
Remarks 1. Set: The output signal of the TOmn pin changes from inactive level to active level.
Reset: The output signal of the TOmn pin changes from active level to inactive level.
2. m: Unit number (m = 0, 1), n: Channel number (n = 0 to 7)
(a) When timer output level register m (TOLm) setting has been changed during timer operation
When the TOLm register setting has been changed during timer operation, the setting becomes valid at the
generation timing of the TOmn pin change condition. Rewriting the TOLm register does not change the output
level of the TOmn pin.
The operation when TOMmn is set to 1 and the value of the TOLm register is changed while the timer is
operating (TEmn = 1) is shown below.
Figure 6-32. Operation when TOLm Register Has Been Changed during Timer Operation
TOLmn
TOmn pin
Remarks 1. Set: The output signal of the TOmn pin changes from inactive level to active level.
Reset: The output signal of the TOmn pin changes from active level to inactive level.
2. m: Unit number (m = 0, 1), n: Channel number (n = 0 to 7)
fTCLK
INTTMmn
TOmn pin/
TOmn Toggle Toggle
Internal set
signal
1 clock delay
INTTMmp
Slave
channel
Internal reset
signal
TOmp pin/
TOmp
Set Reset Set
fTCLK
INTTMmn
Toggle Toggle
Internal set
signal
1 clock delay
INTTMmp
Slave
channel Internal reset Set
signal
Before writing
Data to be written
0 0 0 0 0 0 0 0 1 1 0 0 0 0 1 1
After writing
O O × O × × × ×
TO0 0 0 0 0 0 0 0 0 TO07 TO06 TO05 TO04 TO03 TO02 TO01 TO00
1 1 1 0 0 0 1 0
Writing is done only to the TOmn bit with TOEmn = 0, and writing to the TOmn bit with TOEmn = 1 is ignored.
TOmn (channel output) to which TOEmn = 1 is set is not affected by the write operation. Even if the write operation is
done to the TOmn bit, it is ignored and the output change by timer operation is normally done.
TO04
TO01
TO00
Caution While timer output is enabled (TOEmn = 1), even if the output by timer interrupt of each timer
(INTTMmn) contends with writing to the TOmn bit, output is normally done to the TOmn pin.
Figure 6-36. Operation examples of timer interrupt at count operation start and TOmn output
TCRmn
TEmn
INTTMmn
TOmn
TCRmn
TEmn
INTTMmn
TOmn
When MDmn0 is set to 1, a timer interrupt (INTTMmn) is output at count operation start, and TOmn performs a toggle
operation.
When MDmn0 is set to 0, a timer interrupt (INTTMmn) is not output at count operation start, and TOmn does not
change either. After counting one cycle, INTTMmn is output and TOmn performs a toggle operation.
Generation period of INTTMmn (timer interrupt) = Period of count clock × (Set value of TDRmn + 1)
• Period of square wave output from TOmn = Period of count clock × (Set value of TDRmn + 1) × 2
• Frequency of square wave output from TOmn = Frequency of count clock/{(Set value of TDRmn + 1) × 2}
Timer count register mn (TCRmn) operates as a down counter in the interval timer mode.
The TCRmn register loads the value of timer data register mn (TDRmn) at the first count clock after the channel
start trigger bit (TSmn, TSHm1, TSHm3) of timer channel start register m (TSm) is set to 1. If the MDmn0 bit of
timer mode register mn (TMRmn) is 0 at this time, INTTMmn is not output and TOmn is not toggled. If the MDmn0
bit of the TMRmn register is 1, INTTMmn is output and TOmn is toggled.
After that, the TCRmn register count down in synchronization with the count clock.
When TCRmn = 0000H, INTTMmn is output and TOmn is toggled at the next count clock. At the same time, the
TCRmn register loads the value of the TDRmn register again. After that, the same operation is repeated.
The TDRmn register can be rewritten at any time. The new value of the TDRmn register becomes valid from the
next period.
Clock selection
CKm1
Operation clockNote Timer counter
CKm0 Output TOmn pin
register mn (TCRmn) controller
Trigger selection
Timer data Interrupt
TSmn Interrupt signal
register mn(TDRmn) controller
(INTTMmn)
<R> Note When channels 1 and 3, the clock can be selected from CKm0, CKm1, CKm2 and CKm3.
Figure 6-38. Example of Basic Timing of Operation as Interval Timer/Square Wave Output (MDmn0 = 1)
TSmn
TEmn
TCRmn
0000H
TDRmn a b
TOmn
INTTMmn
Figure 6-39. Example of Set Contents of Registers During Operation as Interval Timer/Square Wave Output (1/2)
Figure 6-39. Example of Set Contents of Registers During Operation as Interval Timer/Square Wave Output (2/2)
Figure 6-40. Operation Procedure of Interval Timer/Square Wave Output Function (1/2)
Figure 6-40. Operation Procedure of Interval Timer/Square Wave Output Function (2/2)
Timer count register mn (TCRmn) operates as a down counter in the event counter mode.
The TCRmn register loads the value of timer data register mn (TDRmn) by setting any channel start trigger bit (TSmn,
TSHm1, TSHm3) of timer channel start register m (TSm) to 1.
The TCRmn register counts down each time the valid input edge of the TImn pin has been detected. When TCRmn =
0000H, the TCRmn register loads the value of the TDRmn register again, and outputs INTTMmn.
After that, the above operation is repeated.
An irregular waveform that depends on external events is output from the TOmn pin. Stop the output by setting the
TOEmn bit of timer output enable register m (TOEm) to 0.
The TDRmn register can be rewritten at any time. The new value of the TDRmn register becomes valid during the next
count period.
Edge
TImn pin Timer counter
detection
register mn (TCRmn)
Trigger selection
TSmn
TEmn
TImn
3 3
2 2 2 2
TCRmn 1 1 1 1
0000H 0 0 0
INTTMmn
Figure 6-43. Example of Set Contents of Registers in External Event Counter Mode (1/2)
Figure 6-43. Example of Set Contents of Registers in External Event Counter Mode (2/2)
Figure 6-44. Operation Procedure When External Event Counter Function Is Used
Timer count register 00 (TCR00) operates as a down counter in the interval timer mode.
After the channel start trigger bit (TS00) of timer channel start register 0 (TS0) is set to 1, the TCR00 register loads the
value of timer data register 00 (TDR00) when the TI00 valid edge is detected.
If the MD000 bit of timer mode register 00 (TMR00) is 0 at this time, INTTM00 is not output and TO00 is not toggled. If
the MD000 bit of timer mode register 00 (TMR00) is 1, INTTM00 is output and TO00 is toggled.
After that, the TCR00 register counts down at the valid edge of the TI00 pin. When TCR00 = 0000H, it toggles TO00.
At the same time, the TCR00 register loads the value of the TDR00 register again, and continues counting.
If detection of both the edges of the TI00 pin is selected, the duty factor error of the input clock affects the divided clock
period of the TO00 output.
The period of the TO00 output clock includes a sampling error of one period of the operation clock.
Clock period of TO00 output = Ideal TO00 output clock period ± Operation clock period (error)
The TDR00 register can be rewritten at any time. The new value of the TDR00 register becomes valid during the next
count period.
Edge
TI00 pin Timer counter Output
detection TO00 pin
register 00 (TCR00) controller
Trigger selection
Timer data
TS00 register 00 (TDR00)
TS00
TE00
TI00
2 2 2
1 1 1 1 1 1 1
TCR00
0000H 0 0 0 0 0 0 0
TO00
INTTM00
Divided Divided
by 6 by 4
Figure 6-47. Example of Set Contents of Registers During Operation as Frequency Divider
Slave/master selection
0: Independent channel operation function.
During Set value of the TDR00 register can be changed. Counter (TCR00) counts down. When count value reaches
operation The TCR00 register can always be read. 0000H, the value of the TDR00 register is loaded to the
The TSR00 register is not used. TCR00 register again, and the count operation is continued.
Set values of the TO0 and TOE0 registers can be By detecting TCR00 = 0000H, INTTM00 is generated and
changed. TO00 performs toggle operation.
Set values of the TMR00 register, TOM00, and TOL00 After that, the above operation is repeated.
bits cannot be changed.
Operation The TT00 bit is set to 1. TE00 = 0, and count operation stops.
stop The TT00 bit automatically returns to 0 because it is a The TCR00 register holds count value and stops.
trigger bit. The TO00 output is not initialized but holds current status.
The TOE00 bit is cleared to 0 and value is set to the TO00 bit. The TO00 pin outputs the TO00 set level.
TAU To hold the TO00 pin output level
stop Clears the TO00 bit to 0 after the value to be held is
set to the port register. The TO00 pin output level is held by port function.
When holding the TO00 pin output level is not
necessary
Setting not required.
The TAU0EN bit of the PER0 register is cleared to 0. Power-off status
All circuits are initialized and SFR of each channel is also
initialized.
(The TO00 bit is cleared to 0 and the TO00 pin is set to
port mode).
TImn input pulse interval = Period of count clock × ((10000H × TSRmn: OVF) + (Capture value of TDRmn + 1))
Caution The TImn pin input is sampled using the operating clock selected with the CKSmn bit of timer
mode register mn (TMRmn), so an error of up to one operating clock cycle occurs.
CKm1
Operation clock Note Timer counter
CKm0 register mn (TCRmn)
Trigger selection
Edge
TImn pin
detection Timer data Interrupt
register mn (TDRmn) Interrupt signal
controller
TSmn (INTTMmn)
<R> Note When channels 1 and 3, the clock can be selected from CKm0, CKm1, CKm2 and CKm3.
Figure 6-50. Example of Basic Timing of Operation as Input Pulse Interval Measurement (MDmn0 = 0)
TSmn
TEmn
TImn
FFFFH
b c d
TCRmn a
0000H
TDRmn 0000H a b c d
INTTMmn
OVF
Figure 6-51. Example of Set Contents of Registers to Measure Input Pulse Interval
Figure 6-52. Operation Procedure When Input Pulse Interval Measurement Function Is Used
During Set values of only the CISmn1 and CISmn0 bits of the Counter (TCRmn) counts up from 0000H. When the TImn
operation TMRmn register can be changed. pin input valid edge is detected, the count value is
The TDRmn register can always be read. transferred (captured) to timer data register mn (TDRmn).
The TCRmn register can always be read. At the same time, the TCRmn register is cleared to
The TSRmn register can always be read. 0000H, and the INTTMmn signal is generated.
Set values of the TOMmn, TOLmn, TOmn, and TOEmn If an overflow occurs at this time, the OVF bit of timer
bits cannot be changed. status register mn (TSRmn) is set; if an overflow does not
occur, the OVF bit is cleared.
After that, the above operation is repeated.
Operation The TTmn bit is set to 1. TEmn = 0, and count operation stops.
stop The TTmn bit automatically returns to 0 because it is a The TCRmn register holds count value and stops.
trigger bit. The OVF bit of the TSRmn register is also held.
TAU The TAUmEN bit of the PER0 register is cleared to 0. Power-off status
stop All circuits are initialized and SFR of each channel is
also initialized.
Caution When using a channel to implement the LIN-bus, set bit 1 (ISC1) of the input switch control
register (ISC) to 1. In the following descriptions, read TImn as RxD2.
By starting counting at one edge of the TImn pin input and capturing the number of counts at another edge, the signal
width (high-level width/low-level width) of TImn can be measured. The signal width of TImn can be calculated by the
following expression.
Signal width of TImn input = Period of count clock × ((10000H × TSRmn: OVF) + (Capture value of TDRmn + 1))
Caution The TImn pin input is sampled using the operating clock selected with the CKSmn bit of timer
mode register mn (TMRmn), so an error equivalent to one operation clock occurs.
Timer count register mn (TCRmn) operates as an up counter in the capture & one-count mode.
When the channel start trigger bit (TSmn) of timer channel start register m (TSm) is set to 1, the TEmn bit is set to 1
and the TImn pin start edge detection wait status is set.
When the TImn pin input start edge (rising edge of the TImn pin input when the high-level width is to be measured) is
detected, the counter counts up from 0000H in synchronization with the count clock. When the valid capture edge (falling
edge of the TImn pin input when the high-level width is to be measured) is detected later, the count value is transferred to
timer data register mn (TDRmn) and, at the same time, INTTMmn is output. If the counter overflows at this time, the OVF
bit of timer status register mn (TSRmn) is set to 1. If the counter does not overflow, the OVF bit is cleared. The TCRmn
register stops at the value “value transferred to the TDRmn register + 1”, and the TImn pin start edge detection wait status
is set. After that, the above operation is repeated.
As soon as the count value has been captured to the TDRmn register, the OVF bit of the TSRmn register is updated
depending on whether the counter overflows during the measurement period. Therefore, the overflow status of the
captured value can be checked.
If the counter reaches a full count for two or more periods, it is judged to be an overflow occurrence, and the OVF bit of
the TSRmn register is set to 1. However, a normal interval value cannot be measured for the OVF bit, if two or more
overflows occur.
Whether the high-level width or low-level width of the TImn pin is to be measured can be selected by using the CISmn1
and CISmn0 bits of the TMRmn register.
Because this function is used to measure the signal width of the TImn pin input, the TSmn bit cannot be set to 1 while
the TEmn bit is 1.
Figure 6-53. Block Diagram of Operation as Input Signal High-/Low-Level Width Measurement
Clock selection
CKm1
Operation clock Note
CKm0 Timer counter
register mn (TCRmn)
Trigger selection
Edge Timer data Interrupt
TImn pin register mn (TDRmn) Interrupt signal
detection controller
(INTTMmn)
<R> Note For channels 1 and 3, the clock can be selected from CKm0, CKm1, CKm2 and CKm3.
Figure 6-54. Example of Basic Timing of Operation as Input Signal High-/Low-Level Width Measurement
TSmn
TEmn
TImn
FFFFH
a
TCRmn b
c
0000H
TDRmn 0000H a b c
INTTMmn
OVF
Figure 6-55. Example of Set Contents of Registers to Measure Input Signal High-/Low-Level Width
Figure 6-56. Operation Procedure When Input Signal High-/Low-Level Width Measurement Function Is Used
Generation period of INTTMmn (timer interrupt) = Period of count clock × (Set value of TDRmn + 1)
Timer count register mn (TCRmn) operates as a down counter in the one-count mode.
When the channel start trigger bit (TSmn, TSHm1, TSHm3) of timer channel start register m (TSm) is set to 1, the
TEmn, TEHm1, TEHm3 bits are set to 1 and the TImn pin input valid edge detection wait status is set.
Timer count register mn (TCRmn) starts operating upon TImn pin input valid edge detection and loads the value of
timer data register mn (TDRmn). The TCRmn register counts down from the value of the TDRmn register it has loaded, in
synchronization with the count clock. When TCRmn = 0000H, it outputs INTTMmn and stops counting until the next TImn
pin input valid edge is detected.
The TDRmn register can be rewritten at any time. The new value of the TDRmn register becomes valid from the next
period.
CKm1
Operation clockNote Timer counter
CKm0 register mn (TCRmn)
Trigger selection
TSmn
Timer data Interrupt signal
Interrupt
register mn (TDRmn) (INTTMmn)
Edge controller
TImn pin
detection
<R> Note For using channels 1 and 3, the clock can be selected from CKm0, CKm1, CKm2 and CKm3.
TSmn
TEmn
TImn
FFFFH
TCRmn
0000H
TDRmn a b
INTTMmn
a+1 b+1
register mn (TCRmn).
During Set value of the TDRmn register can be changed. The counter (TCRmn) counts down. When TCRmn
operation The TCRmn register can always be read. counts down to 0000H, INTTMmn is output, and counting
The TSRmn register is not used. stops (which leaves TCRmn at 0000H) until the next TImn
pin input.
Operation The TTmn bit is set to 1. TEmn = 0, and count operation stops.
stop The TTmn bit automatically returns to 0 because it is a The TCRmn register holds count value and stops.
trigger bit.
TAU The TAUmEN bit of the PER0 register is cleared to 0. Power-off status
stop All circuits are initialized and SFR of each channel is
also initialized.
The master channel operates in the one-count mode and counts the delays. Timer count register mn (TCRmn) of the
master channel starts operating upon start trigger detection and loads the value of timer data register mn (TDRmn).
The TCRmn register counts down from the value of the TDRmn register it has loaded, in synchronization with the count
clock. When TCRmn = 0000H, it outputs INTTMmn and stops counting until the next start trigger is detected.
The slave channel operates in the one-count mode and counts the pulse width. The TCRmp register of the slave
channel starts operation using INTTMmn of the master channel as a start trigger, and loads the value of the TDRmp
register. The TCRmp register counts down from the value of The TDRmp register it has loaded, in synchronization with
the count value. When count value = 0000H, it outputs INTTMmp and stops counting until the next start trigger (INTTMmn
of the master channel) is detected. The output level of TOmp becomes active one count clock after generation of
INTTMmn from the master channel, and inactive when TCRmp = 0000H.
Instead of using the TImn pin input, a one-shot pulse can also be output using the software operation (TSmn = 1) as a
start trigger.
Caution The timing of loading of timer data register mn (TDRmn) of the master channel is different from that of
the TDRmp register of the slave channel. If the TDRmn and TDRmp registers are rewritten during
operation, therefore, an illegal waveform is output. Rewrite the TDRmn register after INTTMmn is
generated and the TDRmp register after INTTMmp is generated.
Master channel
(one-count mode)
Clock selection
CKm1
Operation clock Timer counter
CKm0 register mn (TCRmn)
Trigger selection
TSmn
Timer data Interrupt
register mn (TDRmn) Interrupt signal
Edge controller
TImn pin (INTTMmn)
detection
Slave channel
(one-count mode)
Clock selection
CKm1
Operation clock Timer counter Output
CKm0 register mp (TCRmp) TOmp pin
controller
Trigger selection
Figure 6-62. Example of Basic Timing of Operation as One-Shot Pulse Output Function
TSmn
TEmn
TImn
Master
FFFFH
channel
TCRmn
0000H
TDRmn a
TOmn
INTTMmn
TSmp
TEmp
FFFFH
TCRmp
Slave 0000H
channel
TDRmp b
TOmp
INTTMmp
a+2 b a+2 b
Figure 6-63. Example of Set Contents of Registers When One-Shot Pulse Output Function Is Used (Master Channel)
Slave/master selection
1: Master channel.
Figure 6-64. Example of Set Contents of Registers When One-Shot Pulse Output Function Is Used (Slave Channel)
Remark The duty factor exceeds 100% if the set value of TDRmp (slave) > (set value of TDRmn (master) + 1), it
summarizes to 100% output.
The master channel operates in the interval timer mode. If the channel start trigger bit (TSmn) of timer channel start
register m (TSm) is set to 1, an interrupt (INTTMmn) is output, the value set to timer data register mn (TDRmn) is loaded
to timer count register mn (TCRmn), and the counter counts down in synchronization with the count clock. When the
counter reaches 0000H, INTTMmn is output, the value of the TDRmn register is loaded again to the TCRmn register, and
the counter counts down. This operation is repeated until the channel stop trigger bit (TTmn) of timer channel stop
register m (TTm) is set to 1.
If two channels are used to output a PWM waveform, the period until the master channel counts down to 0000H is the
PWM output (TOmp) cycle.
The slave channel operates in one-count mode. By using INTTMmn from the master channel as a start trigger, the
TCRmp register loads the value of the TDRmp register and the counter counts down to 0000H. When the counter
reaches 0000H, it outputs INTTMmp and waits until the next start trigger (INTTMmn from the master channel) is generated.
If two channels are used to output a PWM waveform, the period until the slave channel counts down to 0000H is the
PWM output (TOmp) duty.
PWM output (TOmp) goes to the active level one clock after the master channel generates INTTMmn and goes to the
inactive level when the TCRmp register of the slave channel becomes 0000H.
Caution To rewrite both timer data register mn (TDRmn) of the master channel and the TDRmp register of the
slave channel, a write access is necessary two times. The timing at which the values of the TDRmn
and TDRmp registers are loaded to the TCRmn and TCRmp registers is upon occurrence of INTTMmn
of the master channel. Thus, when rewriting is performed split before and after occurrence of
INTTMmn of the master channel, the TOmp pin cannot output the expected waveform. To rewrite both
the TDRmn register of the master and the TDRmp register of the slave, therefore, be sure to rewrite
both the registers immediately after INTTMmn is generated from the master channel.
Master channel
(interval timer mode)
Clock selection
CKm1
Operation clock Timer counter
CKm0 register mn (TCRmn)
Trigger selection
Timer data Interrupt
TSmn register mn (TDRmn) Interrupt signal
controller
(INTTMmn)
Slave channel
(one-count mode)
Clock selection
CKm1
Operation clock Timer counter Output
CKm0 register mp (TCRmp) TOmp pin
controller
Trigger selection
TSmn
TEmn
FFFFH
Master
TCRmn
channel 0000H
TDRmn a b
TOmn
INTTMmn
TSmp
TEmp
FFFFH
TCRmp
Slave 0000H
channel
TDRmp c d
TOmp
INTTMmp
a+1 a+1 b+1
c c d
Figure 6-68. Example of Set Contents of Registers When PWM Function (Master Channel) Is Used
Slave/master selection
1: Master channel.
Figure 6-69. Example of Set Contents of Registers When PWM Function (Slave Channel) Is Used
During Set values of the TMRmn and TMRmp registers, The counter of the master channel loads the TDRmn
operation TOMmn, TOMmp, TOLmn, and TOLmp bits cannot be register value to timer count register mn (TCRmn), and
changed. counts down. When the count value reaches TCRmn =
Operation is resumed.
Set values of the TDRmn and TDRmp registers can be 0000H, INTTMmn output is generated. At the same time,
changed after INTTMmn of the master channel is the value of the TDRmn register is loaded to the TCRmn
generated. register, and the counter starts counting down again.
The TCRmn and TCRmp registers can always be read. At the slave channel, the value of the TDRmp register is
The TSRmn and TSRmp registers are not used. loaded to the TCRmp register, triggered by INTTMmn of
the master channel, and the counter starts counting down.
The output level of TOmp becomes active one count clock
after generation of the INTTMmn output from the master
channel. It becomes inactive when TCRmp = 0000H, and
the counting operation is stopped.
After that, the above operation is repeated.
Operation The TTmn (master) and TTmp (slave) bits are set to 1 at
stop the same time. TEmn, TEmp = 0, and count operation stops.
The TTmn and TTmp bits automatically return to 0 The TCRmn and TCRmp registers hold count value and
because they are trigger bits. stop.
The TOmp output is not initialized but holds current
status.
The TOEmp bit of slave channel is cleared to 0 and value
is set to the TOmp bit. The TOmp pin outputs the TOmp set level.
TAU To hold the TOmp pin output level
stop Clears the TOmp bit to 0 after the value to The TOmp pin output level is held by port function.
be held is set to the port register.
When holding the TOmp pin output level is not
necessary
Setting not required.
The TAUmEN bit of the PER0 register is cleared to 0. Power-off status
All circuits are initialized and SFR of each channel is
also initialized.
(The TOmp bit is cleared to 0 and the TOmp pin is set
to port mode.)
Remark Although the duty factor exceeds 100% if the set value of TDRmp (slave 1) > {set value of TDRmn
(master) + 1} or if the {set value of TDRmq (slave 2)} > {set value of TDRmn (master) + 1}, it is
summarized into 100% output.
Timer count register mn (TCRmn) of the master channel operates in the interval timer mode and counts the periods.
The TCRmp register of the slave channel 1 operates in one-count mode, counts the duty factor, and outputs a PWM
waveform from the TOmp pin. The TCRmp register loads the value of timer data register mp (TDRmp), using INTTMmn of
the master channel as a start trigger, and starts counting down. When TCRmp = 0000H, TCRmp outputs INTTMmp and
stops counting until the next start trigger (INTTMmn of the master channel) has been input. The output level of TOmp
becomes active one count clock after generation of INTTMmn from the master channel, and inactive when TCRmp =
0000H.
In the same way as the TCRmp register of the slave channel 1, the TCRmq register of the slave channel 2 operates in
one-count mode, counts the duty factor, and outputs a PWM waveform from the TOmq pin. The TCRmq register loads the
value of the TDRmq register, using INTTMmn of the master channel as a start trigger, and starts counting down. When
TCRmq = 0000H, the TCRmq register outputs INTTMmq and stops counting until the next start trigger (INTTMmn of the
master channel) has been input. The output level of TOmq becomes active one count clock after generation of INTTMmn
from the master channel, and inactive when TCRmq = 0000H.
When channel 0 is used as the master channel as above, up to seven types of PWM signals can be output at the same
time.
Caution To rewrite both timer data register mn (TDRmn) of the master channel and the TDRmp register of the
slave channel 1, write access is necessary at least twice. Since the values of the TDRmn and TDRmp
registers are loaded to the TCRmn and TCRmp registers after INTTMmn is generated from the master
channel, if rewriting is performed separately before and after generation of INTTMmn from the master
channel, the TOmp pin cannot output the expected waveform. To rewrite both the TDRmn register of
the master and the TDRmp register of the slave, be sure to rewrite both the registers immediately
after INTTMmn is generated from the master channel (This applies also to the TDRmq register of the
slave channel 2).
Figure 6-71. Block Diagram of Operation as Multiple PWM Output Function (output two types of PWMs)
Master channel
(interval timer mode)
Clock selection
CKm1
Operation clock Timer counter
CKm0 register mn (TCRmn)
Trigger selection
Timer data Interrupt
TSmn register mn (TDRmn) Interrupt signal
controller
(INTTMmn)
Slave channel 1
(one-count mode)
Clock selection
CKm1
Operation clock Timer counter Output
CKm0 register mp (TCRmp) TOmp pin
controller
Trigger selection
Slave channel 2
(one-count mode)
Clock selection
CKm1
Operation clock Timer counter Output
CKm0 register mq (TCRmq) TOmq pin
controller
Trigger selection
Figure 6-72. Example of Basic Timing of Operation as Multiple PWM Output Function
(Output two types of PWMs) (1/2)
TSmn
TEmn
FFFFH
Master
TCRmn
channel 0000H
TDRmn a b
TOmn
INTTMmn
TSmp
TEmp
FFFFH
TCRmp
Slave 0000H
channel 1
TDRmp c d
TOmp
INTTMmp
a+1 a+1 b+1
c c d d
TSmq
TEmq
FFFFH
TCRmq
Slave 0000H
channel 2
TDRmq e f
TOmq
INTTMmq
a+1 a+1 b+1
e e f f
Figure 6-72. Example of Basic Timing of Operation as Multiple PWM Output Function
(Output two types of PWMs) (2/2)
Slave/master selection
1: Master channel.
Figure 6-75. Operation Procedure When Multiple PWM Output Function Is Used (1/2)
Figure 6-75. Operation Procedure When Multiple PWM Output Function Is Used (2/2)
Set values of the TDRmn, TDRmp, and TDRmq registers 0000H, INTTMmn output is generated. At the same time,
can be changed after INTTMmn of the master channel is the value of the TDRmn register is loaded to the TCRmn
generated. register, and the counter starts counting down again.
The TCRmn, TCRmp, and TCRmq registers can always At the slave channel 1, the values of the TDRmp register
be read. are transferred to the TCRmp register, triggered by
The TSRmn, TSRmp, and TSR0q registers are not used. INTTMmn of the master channel, and the counter starts
counting down. The output levels of TOmp become active
one count clock after generation of the INTTMmn output
from the master channel. It becomes inactive when
TCRmp = 0000H, and the counting operation is stopped.
At the slave channel 2, the values of the TDRmq register
are transferred to TCRmq regster, triggered by INTTMmn
of the master channel, and the counter starts counting
down. The output levels of TOmq become active one count
clock after generation of the INTTMmn output from the
master channel. It becomes inactive when TCRmq =
0000H, and the counting operation is stopped.
After that, the above operation is repeated.
Operation The TTmn bit (master), TTmp, and TTmq (slave) bits are
stop set to 1 at the same time. TEmn, TEmp, TEmq = 0, and count operation stops.
The TTmn, TTmp, and TTmq bits automatically return
The TCRmn, TCRmp, and TCRmq registers hold count
to 0 because they are trigger bits. value and stop.
The TOmp and TOmq output are not initialized but hold
current status.
The TOEmp and TOEmq bits of slave channels are
cleared to 0 and value is set to the TOmp and TOmq bits. The TOmp and TOmq pins output the TOmp and TOmq
set levels.
TAU To hold the TOmp and TOmq pin output levels
stop Clears the TOmp and TOmq bits to 0 after
the value to be held is set to the port register. The TOmp and TOmq pin output levels are held by port
When holding the TOmp and TOmq pin output levels are function.
not necessary
Setting not required
The TAUmEN bit of the PER0 register is cleared to 0. Power-off status
All circuits are initialized and SFR of each channel is
also initialized.
(The TOmp and TOmq bits are cleared to 0 and the
TOmp and TOmq pins are set to port mode.)
Remark m: Unit number (m = 0, 1), n: Channel number (n = 0, 2, 4)
p: Slave channel number 1, q: Slave channel number 2
n < p < q ≤ 7 (Where p and q are a consecutive integer greater than n)
Depends on products, a pin is assigned atimer output and other alternate functions. In this case, outputs of the other
alternate functions must be set in initial status.
(1) Using TO01 output assigned to the P16 for 20-pin products
So that the alternated SO11 output becomes 1, not only set the port mode register (the PM16 bit) and the port
register (the P16 bit) to 0, but also use the serial channel enable status register 0 (SE0), serial output register 0
(SO0), and serial output enable register 0 (SOE0) with the same setting as the initial status.
(2) Using TO02 output assigned to the P17 for 24- and 25-pin products
So that the alternated SO11 output becomes 1, not only set the port mode register (the PM17 bit) and the port
register (the P17 bit) to 0, but also use the serial channel enable status register 0 (SE0), serial output register 0
(SO0), and serial output enable register 0 (SOE0) with the same setting as the initial status.
(3) Using TO02 output assigned to the P17 for 20-pin products
So that the alternated SDA11 output becomes 1, not only set the port mode register (the PM17 bit) and the port
register (the P17 bit) to 0, but also use the serial channel enable status register 0 (SE0), serial output register 0
(SO0), and serial output enable register 0 (SOE0) with the same setting as the initial status.
(4) Using TO03 output assigned to the P31 for 24- to 44-pin products
So that the alternated PCLBUZ0 output becomes 0, not only set the port mode register (the PM31 bit) and the port
register (the P31 bit) to 0, but also use the bit 7 of the clock output select register 0 (CKS0) with the same setting
as the initial status.
• Having counters of year, month, week, day, hour, minute, and second, and can count up to 99 years.
• Constant-period interrupt function (period: 0.5 seconds, 1 second, 1 minute, 1 hour, 1 day, 1 month)
• Alarm interrupt function (alarm: week, hour, minute)
• Pin output function of 1 Hz (40, 44, 48, 52, 64, 80, 100, and 128-pin products only)
<R> Caution The count of year, month, week, day, hour, minutes and second can only be performed when a
subsystem clock (fSUB = 32.768 kHz) is selected as the operation clock of the real-time clock.
When the low-speed oscillation clock (fIL) is selected, only the constant-period interrupt
function is available. The 20- to 36-pin products have the constant-period interrupt function
only, because these products have no subsystem clock.
However, the constant-period interrupt interval when fIL is selected will be calculated with the
constant-period (the value selected with RTCC0 register) × fSUB/fIL.
Item Configuration
RTC1HZ
Alarm week Alarm hour Alarm minute
register register register
(ALARMWW) (ALARMWH) (ALARMWM)
(7-bit) (6-bit) (7-bit)
INTRTC
CT0 to CT2
RIFG
Selector
AMPM
Selector
fSUB
fIL
Count enable/
disable circuit Watch error
correction
register
(SUBCUD)
Buffer Buffer Buffer Buffer Buffer Buffer Buffer (8-bit) WUTMMCK0
RTCE
Internal bus
<R> Caution The count of year, month, week, day, hour, minutes and second can only be performed when a
subsystem clock (fSUB = 32.768 kHz) is selected as the operation clock of the real-time clock.
When the low-speed oscillation clock (fIL) is selected, only the constant-period interrupt
function is available. The 20- to 36-pin products have the constant-period interrupt function
only, because these products have no subsystem clock.
However, the constant-period interrupt interval when fIL is selected will be calculated with the
constant-period (the value selected with RTCC0 register) × fSUB/fIL.
<R> RTCEN Control of real-time clock (RTC) and interval timer input clock supply
Cautions 1. When using the real-time clock, first set the RTCEN bit to 1, while oscillation of the
input clock (fRTC) is stable. If RTCEN = 0, writing to a control register of the real-time
clock or interval timer is ignored, and, even if the register is read, only the default
value is read.
2. The subsystem clock supply to peripheral functions other than the real-time clock
and interval timer can be stopped in STOP mode or HALT mode when the subsystem
clock is used, by setting the RTCLPC bit of the operation speed mode control
register (OSMC) to 1. In this case, set the RTCEN bit of the PER0 register to 1 and
the other bits (bits 0 to 6) to 0.
3. Be sure to clear the following bits to 0.
20-pin products: bits 1, 3, 4, 6
24, 25-pin products: bits 1, 3, 6
30, 32, 36, 40, 44, 48, 52, 64-pin products: bits 1, 6
WUTMMCK0 Selection of operation clock (fRTC) for real-time clock and interval timer.
<R> Caution The count of year, month, week, day, hour, minutes and second can only be performed when a
subsystem clock (fSUB = 32.768 kHz) is selected as the operation clock of the real-time clock.
When the low-speed oscillation clock (fIL) is selected, only the constant-period interrupt
function is available. The 20- to 36-pin products have the constant-period interrupt function
only, because these products have no subsystem clock.
However, the constant-period interrupt interval when fIL is selected will be calculated with the
constant-period (the value selected with RTCC0 register) × fSUB/fIL.
• Rewrite the AMPM bit value after setting the RWAIT bit (bit 0 of real-time clock control register 1 (RTCC1)) to 1. If
the AMPM bit value is changed, the values of the hour count register (HOUR) change according to the specified
time system.
• Table 7-2 shows the displayed time digits that are displayed.
When changing the values of the CT2 to CT0 bits while the counter operates (RTCE = 1), rewrite the values of the
CT2 to CT0 bits after disabling interrupt servicing INTRTC by using the interrupt mask flag register. Furthermore,
after rewriting the values of the CT2 to CT0 bits, enable interrupt servicing after clearing the RIFG and RTCIF flags.
Caution Do not change the value of the RTCLOE1 bit when RTCE = 1.
When setting a value to the WALE bit while the counter operates (RTCE = 1) and WALIE = 1, rewrite the WALE bit
after disabling interrupt servicing INTRTC by using the interrupt mask flag register. Furthermore, clear the WAFG
and RTCIF flags after rewriting the WALE bit. When setting each alarm register (WALIE flag of real-time clock
control register 1 (RTCC1), the alarm minute register (ALARMWM), the alarm hour register (ALARMWH), and the
alarm week register (ALARMWW)), set match operation to be invalid (“0”) for the WALE bit.
0 Alarm mismatch
1 Detection of matching of alarm
This is a status flag that indicates detection of matching with the alarm. It is valid only when WALE = 1 and is set to
“1” one clock (32.768 kHz) after matching of the alarm is detected. This flag is cleared when “0” is written to it.
Writing “1” to it is invalid.
This flag indicates the status of generation of the constant-period interrupt. When the constant-period interrupt is
generated, it is set to “1”.
This flag is cleared when “0” is written to it. Writing “1” to it is invalid.
0 Counter is operating.
1 Mode to read or write counter value
This status flag indicates whether the setting of the RWAIT bit is valid.
Before reading or writing the counter value, confirm that the value of this flag is 1.
Caution If writing is performed to the RTCC1 register with a 1-bit manipulation instruction, the RIFG flag
and WAFG flag may be cleared. Therefore, to perform writing to the RTCC1 register, be sure to
use an 8-bit manipulation instruction. To prevent the RIFG flag and WAFG flag from being
cleared during writing, disable writing by setting 1 to the corresponding bit. If the RIFG flag and
WAFG flag are not used and the value may be changed, the RTCC1 register may be written by
using a 1-bit manipulation instruction.
Remark Fixed-cycle interrupts and alarm match interrupts use the same interrupt source (INTRTC). When using
these two types of interrupts at the same time, which interrupt occurred can be judged by checking the
fixed-cycle interrupt status flag (RIFG) and the alarm detection status flag (WAFG) upon INTRTC
occurrence.
<R> Caution When it reads or writes from/to the register while the counter is in operation (RTCE = 1), follow
the procedures described in the section 7.4.3 Reading/writing real-time clock.
<R> Caution When it reads or writes from/to the register while the counter is in operation (RTCE = 1), follow
the procedures described in the section 7.4.3 Reading/writing real-time clock.
Cautions 1. Bit 5 (HOUR20) of the HOUR register indicates AM(0)/PM(1) if AMPM = 0 (if the 12-hour system
is selected).
<R> 2. When it reads or writes from/to the register while the counter is in operation (RTCE = 1),
follow the procedures described in the section 7.4.3 Reading/writing real-time clock.
Table 7-2 shows the relationship between the setting value of the AMPM bit, the hour count register (HOUR) value, and
time.
The HOUR register value is set to 12-hour display when the AMPM bit is “0” and to 24-hour display when the AMPM bit
is “1”.
In 12-hour display, the fifth bit of the HOUR register displays 0 for AM and 1 for PM.
<R> When data is written to this register, it is written to a buffer and then to the counter up to 2 clocks (fRTC) later. Even
if the hour count register overflows while this register is being written, this register ignores the overflow and is set to
the value written. Set a decimal value of 01 to 31 to this register in BCD code. If a value outside the range is set,
the register value returns to the normal value after 1 period.
The DAY register can be set by an 8-bit memory manipulation instruction.
Reset signal generation clears this register to 01H.
<R> Caution When it reads or writes from/to the register while the counter is in operation (RTCE = 1), follow
the procedures described in the section 7.4.3 Reading/writing real-time clock.
Cautions 1. The value corresponding to the month count register (MONTH) or the day count register (DAY)
is not stored in the week count register (WEEK) automatically. After reset release, set the
week count register as follow.
Day WEEK
Sunday 00H
Monday 01H
Tuesday 02H
Wednesday 03H
Thursday 04H
Friday 05H
Saturday 06H
<R> 2. When it reads or writes from/to the register while the counter is in operation (RTCE = 1),
follow the procedures described in the section 7.4.3 Reading/writing real-time clock.
<R> Caution When it reads or writes from/to the register while the counter is in operation (RTCE = 1), follow
the procedures described in the section 7.4.3 Reading/writing real-time clock.
<R> Caution When it reads or writes from/to the register while the counter is in operation (RTCE = 1), follow
the procedures described in the section 7.4.3 Reading/writing real-time clock.
SUBCUD DEV F6 F5 F4 F3 F2 F1 F0
The range of value that can be corrected by using the watch error correction register (SUBCUD) is shown below.
Correctable range –189.2 ppm to 189.2 ppm –63.1 ppm to 63.1 ppm
Remark If a correctable range is − 63.1 ppm or lower and 63.1 ppm or higher, set 0 to DEV.
Caution Set a decimal value of 00 to 59 to this register in BCD code. If a value outside the range is set,
the alarm is not detected.
Caution Set a decimal value of 00 to 23, 01 to 12, or 21 to 32 to this register in BCD code. If a value
outside the range is set, the alarm is not detected.
Caution Bit 5 (WH20) of the ALARMWH register indicates AM(0)/PM(1) if AMPM = 0 (if the 12-hour system
is selected).
Start
Setting SEC
Setting AMPM, CT2 to CT0 Selects 12-/24-hour system and interrupt (INTRTC).
Yes
No
INTRTC = 1?
End
Notes 1. First set the RTCEN bit to 1, while oscillation of the input clock (fRTC) is stable.
2. Set up the SUBCUD register only if the watch error must be corrected. For details about how to
calculate the correction value, see 7.4.6 Example of watch error correction of real-time clock.
3. Confirm the procedure described in 7.4.2 Shifting to STOP mode after starting operation when
shifting to STOP mode without waiting for INTRTC = 1 after RTCE = 1.
• Shifting to STOP mode when at least two input clocks (fRTC) have elapsed after setting the RTCE bit to 1 (see Figure
7-18, Example 1).
• Checking by polling the RWST bit to become 1, after setting the RTCE bit to 1 and then setting the RWAIT bit to 1.
Afterward, setting the RWAIT bit to 0 and shifting to STOP mode after checking again by polling that the RWST bit
has become 0 (see Figure 7-18, Example 2).
Figure 7-18. Procedure for Shifting to STOP Mode After Setting RTCE bit to 1
Example 1 Example 2
Yes
RWST = 0 ?
No
Yes
Start
No
RWST = 1? Checks wait status of counter.
Yes
No
RWST = 0?Note
Yes
End
Caution Complete the series of process of setting the RWAIT bit to 1 to clearing the RWAIT bit to 0 within 1
second.
Remark The second count register (SEC), minute count register (MIN), hour count register (HOUR), week count
register (WEEK), day count register (DAY), month count register (MONTH), and year count register (YEAR)
may be read in any sequence.
All the registers do not have to read and only some registers may be read.
Start
No
RWST = 1? Checks wait status of counter.
Yes
No
RWST = 0?Note
Yes
End
Start
No
INTRTC = 1?
Yes
No
WAFG = 1?
Remarks 1. The alarm week register (ALARMWW), alarm hour register (ALARMWH), and alarm week register
(ALARMWW) may be written in any sequence.
2. Fixed-cycle interrupts and alarm match interrupts use the same interrupt source (INTRTC). When using
these two types of interrupts at the same time, which interrupt occurred can be judged by checking the
fixed-cycle interrupt status flag (RIFG) and the alarm detection status flag (WAFG) upon INTRTC
occurrence.
Start
Caution First set the RTCEN bit to 1, while oscillation of the input clock (fSUB) is stable.
(When DEV = 0)
Correction valueNote = Number of correction counts in 1 minute ÷ 3 = (Oscillation frequency ÷ Target frequency − 1)
¯ 32768 ¯ 60 ÷ 3
(When DEV = 1)
Correction valueNote = Number of correction counts in 1 minute = (Oscillation frequency ÷ Target frequency − 1) ¯
32768 ¯ 60
Note The correction value is the watch error correction value calculated by using bits 6 to 0 of the watch error
correction register (SUBCUD).
(When F6 = 0) Correction value = {(F5, F4, F3, F2, F1, F0) − 1} ¯ 2
(When F6 = 1) Correction value = − {(/F5, /F4, /F3, /F2, /F1, /F0) + 1} ¯ 2
When (F6, F5, F4, F3, F2, F1, F0) is (*, 0, 0, 0, 0, 0, *), watch error correction is not performed. “*” is 0 or 1.
/F5 to /F0 are bit-inverted values (000011 when 111100).
Remarks 1. The correction value is 2, 4, 6, 8, … 120, 122, 124 or −2, −4, −6, −8, … −120, −122, −124.
2. The oscillation frequency is the input clock (fRTC).
It can be calculated from the output frequency of the RTC1HZ pin ¯ 32768 when the watch error
correction register is set to its initial value (00H).
3. The target frequency is the frequency resulting after correction performed by using the watch error
correction register.
Correction example
Example of correcting from 32767.4 Hz to 32768 Hz (32767.4 Hz + 18.3 ppm)
Note See 7.4.5 1 Hz output of real-time clock for the setting procedure of outputting about 1 Hz from the RTC1HZ
pin.
Consequently, when correcting from 32767.4 Hz to 32768 Hz (32767.4 Hz + 18.3 ppm), setting the correction
register such that DEV is 1 and the correction value is −36 (bits 6 to 0 of the SUBCUD register: 1101110) results in
32768 Hz (0 ppm).
Figure 7-23 shows the operation when (DEV, F6, F5, F4, F3, F2, F1, F0) is (1, 1, 1, 0, 1, 1, 1, 0).
RL78/G13
Figure 7-23. Operation when (DEV, F6, F5, F4, F3, F2, F1, F0) = (1, 1, 1, 0, 1, 1, 1, 0)
7FFFH + 56H (86) 7FFFH + 56H (86) 7FFFH + 56H (86) 7FFFH+56H (86)
Count start
Sub-count register
0000H 8054H 8055H 0000H 0001H 7FFFH 0000H 0001H 7FFFH 0000H 8054H 8055H 0000H 0001H 7FFFH 0000H 8054H 8055H 0000H 0001H 7FFFH 0000H 8054H 8055H
count value
SEC 00 01 19 20 39 40 59 00
<R> An interrupt (INTIT) is generated at any previously specified time interval. It can be utilized for wakeup from STOP
mode and triggering an A/D converter’s SNOOZE mode.
Item Configuration
Counter 12-bit counter
Control registers Peripheral enable register 0 (PER0)
Operation speed mode control register (OSMC)
Interval timer control register (ITMC)
Clear
Selector
WUTMM
RINTE ITMCMP11-ITMCMP0
CK0
Operation speed mode Interval timer control
control register (OSMC) register (ITMC)
Internal bus
RTCEN Control of real-time clock (RTC) and interval timer input clock supply
0 Stops input clock supply.
• SFR used by the real-time clock (RTC) and interval timer cannot be written.
• The real-time clock (RTC) and interval timer are in the reset status.
1 Enables input clock supply.
• SFR used by the real-time clock (RTC) and interval timer can be read and written.
Cautions 1. When using the interval timer, first set the RTCEN bit to 1, while oscillation of the
input clock (fRTC) is stable. If RTCEN = 0, writing to a control register of the real-time
clock or interval timer is ignored, and, even if the register is read, only the default
value is read.
2. Clock supply to peripheral functions other than the real-time clock and interval timer
can be stopped in STOP mode or HALT mode when the subsystem clock is used, by
setting the RTCLPC bit of the operation speed mode control register (OSMC) to 1. In
this case, set the RTCEN bit of the PER0 register to 1 and the other bits (bits 0 to 6)
to 0.
3. Be sure to clear the following bits to 0.
20-pin products: bits 1, 3, 4, 6
24, 25-pin products: bits 1, 3, 6
30, 32, 36, 40, 44, 48, 52, 64-pin products: bits 1, 6
WUTMMCK0 Selection of operation clock for real-time clock and interval timer.
001H These bits generate an interrupt at the fixed cycle (count clock cycles x (ITCMP
• setting + 1)).
•
•
FFFH
000H Setting prohibit
Example interrupt cycles when 001H or FFFH is specified for ITCMP11 to ITCMP0
• ITCMP11 to ITCMP0 = 001H, count clock: when fSUB = 32.768 kHz
1/32.768 [kHz] × (1 + 1) = 0.06103515625 [ms] ≅ 61.03 [μs]
• ITCMP11 to ITCMP0 = FFFH, count clock: when fSUB = 32.768 kHz
1/32.768 [kHz] × (4095 + 1) = 125 [ms]
Cautions 1. Before changing the RINTE bit from 1 to 0, use the interrupt mask flag register to disable the
<R> INTIT interrupt servicing. When the operation starts (from 0 to 1) again, clear the ITIF flag,
and then enable the interrupt servicing.
2. The value read from the RINTE bit is applied one count clock cycle after setting the RINTE bit.
3. Only change the setting of the ITCMP11 to ITCMP0 bits when RINTE = 0.
However, it is possible to change the settings of the ITCMP11 to ITCMP0 bits at the same time
as when changing RINTE from 0 to 1 or 1 to 0.
The count value specified for the ITCMP11 to ITCMP0 bits is used as an interval to operate an interval timer that
repeatedly generates interrupt requests (INTIT).
When the RINTE bit is set to 1, the 12-bit counter starts counting.
When the 12-bit counter value matches the value specified for the ITCMP11 to ITCMP0 bits, the 12-bit counter value is
cleared to 0, counting continues, and an interrupt request signal (INTIT) is generated at the same time.
Figure 8-5. Interval Timer Operation Timing (ITCMP11 to ITCMP0 = 0FFH, count clock: fSUB = 32.768 kHz)
Count clock
RINTE
After RINTE is changed from 0 to 1, counting starts
at the next rise of the count clock signal.
0FFH
12-bit counter
000H
ITCMP11- 0FFH
ITCMP0
INTIT
The number of output pins of the clock output and buzzer output controllers differs, depending on the product.
Output pin 20-pin 24, 25-pin 30, 32, 36, 40, 44, 48, 52,
64, 80, 100, 128-pin
PCLBUZ0 − √ √
PCLBUZ1 − − √
Caution Most of the following descriptions in this chapter use the 64-pin as an example.
The clock output controller is intended for carrier output during remote controlled transmission and clock output for
supply to peripheral ICs.
Buzzer output is a function to output a square wave of buzzer frequency.
One pin can be used to output a clock or buzzer sound.
Two output pins, PCLBUZ0 and PCLBUZ1, are available.
The PCLBUZn pin outputs a clock selected by clock output select register n (CKSn).
Figure 9-1 shows the block diagram of clock output/buzzer output controller.
Caution In the low-consumption RTC mode (when the RTCLPC bit of the operation speed mode control
register (OSMC) = 1), it is not possible to output the subsystem clock (fSUB) from the PCLBUZn pin.
Remark n = 0, 1
Internal bus
fMAIN Prescaler
PCLOE1
5 3 fMAIN/211 to fMAIN/213
Selector
Clock/buzzer
fMAIN to fMAIN/24 controller PCLBUZ1Note/INTP7/P141
fSUB to fSUB/27
Output latch
PM141
fMAIN/211 to fMAIN/213 (P141)
fMAIN to fMAIN/24
Selector
Clock/buzzer
fSUB to fSUB/27 controller PCLBUZ0Note/INTP6/P140
8 8
PCLOE0 Output latch
fSUB Prescaler PM140
(P140)
Internal bus
<R> Note For output frequencies available from PCLBUZ0 and PCLBUZ1, refer 29.5 AC Characteristics.
<R> Remark The clock output/buzzer output pins in above diagram shows the information of 64- to 128-pins products
with PIOR3 = 0 and PIOR4 = 0.
In other cases, the name of pins, output latches (Pxx) and PMxx should be read differently (xx = 15, 31, 55,
140 or 141).
Item Configuration
The following two registers are used to control the clock output/buzzer output controller.
• Clock output select registers n (CKSn)
• Port mode register 1, 3, 5, 14 (PM1, PM3, PM5, PM14)
<R> Note Use the output clock within a range of 16 MHz. Furthermore, when using the output clock at 2.7 V ≤ VDD < 4.0
V, can be use it within 8 MHz only. See 29.5 AC Characteristics for details.
Cautions 1. Change the output clock after disabling clock output (PCLOEn = 0).
2. To shift to STOP mode when the main system clock is selected (CSELn = 0), set PCLOEn = 0
before executing the STOP instruction. When the subsystem clock is selected (CSELn = 1),
PCLOEn = 1 can be set because the clock can be output in STOP mode.
3. In the low-consumption RTC mode (when the RTCLPC bit of the operation speed mode control
register (OSMC) = 1), it is not possible to output the subsystem clock (fSUB) from the PCLBUZn
pin.
Remarks 1. n = 0, 1
2. fMAIN: Main system clock frequency
fSUB: Subsystem clock frequency
PMmn Pmn pin I/O mode selection (mn = 140, 141, 146, 147)
Remark For details of the port mode register other than 64-pin products, see 4. 3 Registers Controlling Port
Function.
<1> Select the output frequency with bits 0 to 3 (CCSn0 to CCSn2, CSELn) of the clock output select register (CKSn)
of the PCLBUZn pin (output in disabled status).
<2> Set bit 7 (PCLOEn) of the CKSn register to 1 to enable clock/buzzer output.
Remarks 1. The controller used for outputting the clock starts or stops outputting the clock one clock after enabling or
disabling clock output (PCLOEn bit) is switched. At this time, pulses with a narrow width are not output.
Figure 9-4 shows enabling or stopping output using the PCLOEn bit and the timing of outputting the clock.
2. n = 0, 1
PCLOEn
1 clock elapsed
Clock output
When a reset occurs due to the watchdog timer, bit 4 (WDTRF) of the reset control flag register (RESF) is set to 1. For
details of the RESF register, see CHAPTER 19 RESET FUNCTION.
When 75% of the overflow time is reached, an interval interrupt can be generated.
Item Configuration
How the counter operation is controlled, overflow time, window open period, and interval interrupt are set by the option
byte.
WDCS2 to WDCS0 of
option byte (000C0H)
Internal bus
The watchdog timer is controlled by the watchdog timer enable register (WDTE).
Note The WDTE register reset value differs depending on the WDTON bit setting value of the option byte
(000C0H). To operate watchdog timer, set the WDTON bit to 1.
Cautions 1. If a value other than “ACH” is written to the WDTE register, an internal reset signal is
generated.
2. If a 1-bit memory manipulation instruction is executed for the WDTE register, an internal reset
signal is generated.
3. The value read from the WDTE register is 9AH/1AH (this differs from the written value (ACH)).
• Enable counting operation of the watchdog timer by setting bit 4 (WDTON) of the option byte (000C0H) to 1 (the
counter starts operating after a reset release) (for details, see CHAPTER 24).
• Set an overflow time by using bits 3 to 1 (WDCS2 to WDCS0) of the option byte (000C0H) (for details, see 10.4.2
and CHAPTER 24).
• Set a window open period by using bits 6 and 5 (WINDOW1 and WINDOW0) of the option byte (000C0H) (for
details, see 10.4.3 and CHAPTER 24).
Cautions 1. When data is written to the watchdog timer enable register (WDTE) for the first time after reset
release, the watchdog timer is cleared in any timing regardless of the window open time, as long
as the register is written before the overflow time, and the watchdog timer starts counting again.
2. If the watchdog timer is cleared by writing “ACH” to the WDTE register, the actual overflow time
may be different from the overflow time set by the option byte by up to 2/fIL seconds.
3. The watchdog timer can be cleared immediately before the count value overflows.
<R> Cautions 4. The operation of the watchdog timer in the HALT and STOP and SNOOZE modes differs as
follows depending on the set value of bit 0 (WDSTBYON) of the option byte (000C0H).
WDSTBYON = 0 WDSTBYON = 1
In HALT mode Watchdog timer operation stops. Watchdog timer operation continues.
In STOP mode
In SNOOZE mode
If WDSTBYON = 0, the watchdog timer resumes counting after the HALT or STOP mode is
released. At this time, the counter is cleared to 0 and counting starts.
When operating with the X1 oscillation clock after releasing the STOP mode, the CPU starts
operating after the oscillation stabilization time has elapsed.
Therefore, if the period between the STOP mode release and the watchdog timer overflow is short,
an overflow occurs during the oscillation stabilization time, causing a reset.
Consequently, set the overflow time in consideration of the oscillation stabilization time when
operating with the X1 oscillation clock and when the watchdog timer is to be cleared after the
STOP mode release by an interval interrupt.
• If “ACH” is written to the watchdog timer enable register (WDTE) during the window open period, the watchdog timer
is cleared and starts counting again.
• Even if “ACH” is written to the WDTE register during the window close period, an abnormality is detected and an
internal reset signal is generated.
Counting Overflow
starts time
Caution When data is written to the WDTE register for the first time after reset release, the watchdog timer is
cleared in any timing regardless of the window open time, as long as the register is written before the
overflow time, and the watchdog timer starts counting again.
0 0 Setting prohibited
0 1 50%
1 0 75%
1 1 100%
<R> Caution When bit 0 (WDSTBYON) of the option byte (000C0H) = 0, the window open period is 100%
regardless of the values of the WINDOW1 and WINDOW0 bits.
9
Remark If the overflow time is set to 2 /fIL, the window close time and open time are as follows.
Caution When operating with the X1 oscillation clock after releasing the STOP mode, the CPU starts
operating after the oscillation stabilization time has elapsed.
Therefore, if the period between the STOP mode release and the watchdog timer overflow is short, an
overflow occurs during the oscillation stabilization time, causing a reset.
Consequently, set the overflow time in consideration of the oscillation stabilization time when
operating with the X1 oscillation clock and when the watchdog timer is to be cleared after the STOP
mode release by an interval interrupt.
Remark The watchdog timer continues counting even after INTWDTI is generated (until ACH is written to the
watchdog timer enable register (WDTE)). If ACH is not written to the WDTE register before the overflow time,
an internal reset signal is generated.
The number of analog input channels of the A/D converter differs, depending on the product.
20, 24, 25-pin 30, 32-pin 36-pin 40-pin 44, 48-pin 52, 64-pin 80-pin 100-pin 128-pin
Analog 6 ch 8 ch 8 ch 9 ch 10 ch 12 ch 17 ch 20 ch 26 ch
input (ANI0 to ANI2, (ANI0 to ANI3, (ANI0 to ANI5, (ANI0 to ANI6, (ANI0 to ANI7, (ANI0 to ANI7, (ANI0 to ANI11, (ANI0 to ANI14, (ANI0 to ANI14,
channels ANI16 to ANI18) ANI16 to ANI19) ANI18, ANI19) ANI18, ANI19) ANI18, ANI19) ANI16 to ANI19) ANI16 to ANI20) ANI16 to ANI20) ANI16 to ANI26)
Note
<R> The A/D converter is a 10-bit resolution converter that converts analog input signals into digital values, and is
configured to control analog inputs, including up to 26 channels of A/D converter analog inputs (ANI0 to ANI14 and ANI16
to ANI26).
The A/D converter has the following function.
Note 8-bit resolution can also be selected by using the ADTYP bit of A/D converter mode register 2 (ADM2).
Various A/D conversion modes can be specified by using the mode combinations below.
Internal bus
ADPC3 ADPC2 ADPC1 ADPC0 ADTES1 ADTES0 Conversion result Conversion result
comparison upper limit comparison lower limit ADREFP1 and ADREFP0 bits
setting register (ADUL) setting register (ADLL)
Selector
Internal reference voltage (1.45 V)
2
4 VDD
AVREFP/ANI0/P20
ANI0/AVREFP/P20 ADCS bit
Analog/digital switcher
ANI1/AVREFM/P21
ANI2/P22
Selector
ANI3/P23 Sample & hold circuit
ANI4/P24 A/D voltage comparator
ANI5/P25
Comparison
ANI6/P26
voltage
ANI7/P27 ADREFM bit
Selector
generator
VSS
Successive
Selector
ANI16/P03/SI10/RxD1/SDA10 AVREFM/ANI1/P21
approximation register
ANI17/P02/SO10/TxD1 (SAR)
ANI18/P147 VSS
Selector
ANI19/P120
Timer trigger signal (INTRTC)
Temperature sensor Timer trigger signal (INTIT)
Controller Timer trigger signal (INTTM01)
Internal reference voltage (1.45 V)
A/D conversion
result upper INTAD
limit/lower limit
6 comparator
ADREFP1 ADREFP0 ADREFPM ADRCK AWC ADTYP
Internal bus
Remark Analog input pin for figure 11-1 when a 64-pin product is used.
The voltage tap of the comparison voltage generator and the analog input voltage are compared and bit 8 of the SAR
register is manipulated according to the result of the comparison.
Remark AVREF: The + side reference voltage of the A/D converter. This can be selected from AVREFP, the internal
<R> reference voltage (1.45 V), and VDD.
(8) Controller
This circuit controls the conversion time of an input analog signal that is to be converted into a digital signal, as well
as starting and stopping of the conversion operation. When A/D conversion has been completed, this controller
generates INTAD.
Cautions 1. When setting the A/D converter, be sure to set the ADCEN bit to 1 first. If ADCEN = 0, writing
to a control register of the A/D converter is ignored, and, even if the register is read, only the
default value is read (except for port mode registers 0, 2, 12, and 14 (PM0, PM2, PM12, PM14),
port mode control registers 0, 12, and 14 (PMC0, PMC12, PMC14), and A/D port configuration
register (ADPC)).
2. Be sure to clear the following bits to 0.
20-pin products: bits 1, 3, 4, 6
24, 25-pin products: bits 1, 3, 6
30, 32, 36, 40, 44, 48, 52, 64-pin products: bits 1, 6
Notes 1. For details of the FR2 to FR0, LV1, LV0 bits, and A/D conversion, see Table 11-3 A/D Conversion Time
Selection.
2. While in the software trigger mode or hardware trigger wait mode, the ADCS bit can be used as a status
flag for the conversion operation status. However, while in the hardware trigger no-wait mode, this bit
cannot be used as a status flag.
3. While in the software trigger mode or hardware trigger no-wait mode, the operation of the A/D voltage
comparator is controlled by the ADCS and ADCE bits, and it takes 1 μs from the start of operation for the
operation to stabilize. Therefore, when the ADCS bit is set to 1 after 1 μs or more has elapsed from the
time ADCE bit is set to 1, the conversion result at that time has priority over the first conversion result.
Otherwise, ignore data of the first conversion.
ADCE
1 is written 0 is written
to ADCS. to ADCS.
Note While in the software trigger mode or hardware trigger no-wait mode, the time from the rising of the ADCE bit to
the falling of the ADCS bit must be 1 μs or longer to stabilize the internal circuit.
Cautions 1. If using the hardware trigger wait mode, setting the ADCS bit to 1 is prohibited (but the bit is
automatically switched to 1 when the hardware trigger signal is detected). However, it is possible
to clear the ADCS bit to 0 to specify the A/D conversion standby status.
2. While in the one-shot conversion mode of the hardware trigger no-wait mode, the ADCS flag is
not automatically cleared to 0 when A/D conversion ends. Instead, 1 is retained.
3 Only rewrite the value of the ADCE bit when ADCS = 0 (while in the conversion
stopped/conversion standby status).
A/D Converter Mode Register 0 (ADM0) Mode Conversion Time Selection Conversion
FR2 FR1 FR0 LV1 LV0 fCLK = fCLK = fCLK = fCLK = fCLK = 16 fCLK = 32 Clock (fAD)
1 MHz 2 MHz 4 MHz 8 MHz MHz MHz
Cautions 1. When rewriting the FR2 to FR0, LV1, and LV0 bits to other than the same data, stop A/D conversion
once (ADCS = 0) beforehand.
2. The above conversion time does not include clock frequency errors. Select conversion time, taking
clock frequency errors into consideration.
A/D Converter Mode Register 0 (ADM0) Mode Conversion Time Selection Conversion
fCLK = 1 fCLK = 2 fCLK = 4 fCLK = 8 fCLK = 16 fCLK = 32 Clock (fAD)
FR2 FR1 FR0 LV1 LV0
MHz MHz MHz MHz MHz MHz
0 0 0 0 0 Normal 1 Setting Setting Setting Setting Setting 38 μs fCLK/64
prohibited prohibited prohibited prohibited prohibited
0 0 1 38 μs 19 μs fCLK/32
0 1 0 38 μs 19 μs 9.5 μs fCLK/16
0 1 1 38 μs 19 μs 9.5 μs 4.75 μs fCLK/8
1 0 0 28.5 μs 14.25 μs 7.125 μs 3.5625 μs fCLK/6
1 0 1 23.75 μs 11.875 μs 5.938 μs Setting fCLK/5
1 1 0 38 μs 19 μs 9.5 μs 4.75 μs prohibited fCLK/4
1 1 1 38 μs 19 μs 9.5 μs 4.75 μs Setting fCLK/2
prohibited
0 0 0 0 1 Normal 2 Setting Setting Setting Setting Setting prohibited 34 μs fCLK/64
0 0 1 prohibited prohibited prohibited prohibited 34 μs 17 μs fCLK/32
0 1 0 34 μs 17 μs 8.5 μs fCLK/16
0 1 1 34 μs 17 μs 8.5 μs 4.25 μs fCLK/8
1 0 0 25.5 μs 12.75 μs 6.375 μs 3.1875 μs fCLK/6
Note
Cautions 1. When rewriting the FR2 to FR0, LV1, and LV0 bits to other than the same data, stop A/D conversion
once (ADCS = 0) beforehand.
2. The above conversion time does not include clock frequency errors. Select conversion time, taking
clock frequency errors into consideration.
A/D Converter Mode Register 0 (ADM0) Mode Conversion Time Selection Conversion
FR2 FR1 FR0 LV1 LV0 fCLK = 1 fCLK = 2 fCLK = 4 fCLK = 8 fCLK = 16 fCLK = 32 Clock (fAD)
Note
MHz MHz MHz MHz MHz MHz
0 0 1 38 μs 19 μs fCLK/32
0 1 0 38 μs 19 μs Setting fCLK/16
0 1 1 38 μs 19 μs Setting prohibited fCLK/8
prohibited
1 0 0 28.5 μs Setting fCLK/6
prohibited
1 0 1 23.75 μs fCLK/5
1 1 0 38 μs 19 μs fCLK/4
1 1 1 38 μs 19 μs Setting fCLK/2
prohibited
0 0 0 1 1 Low- Setting Setting Setting Setting Setting 34 μs fCLK/64
voltage 2 prohibited prohibited prohibited prohibited prohibited
0 0 1 34 μs 17 μs fCLK/32
0 1 0 34 μs 17 μs Setting fCLK/16
0 1 1 34 μs 17 μs Setting prohibited fCLK/8
prohibited
1 0 0 25.5 μs Setting fCLK/6
prohibited
1 0 1 21.25 μs fCLK/5
1 1 0 34 μs 17 μs fCLK/4
1 1 1 34 μs 17 μs Setting fCLK/2
prohibited
A/D Converter Mode Register 0 (ADM0) Mode Conversion Time Selection Conversion
FR2 FR1 FR0 LV1 LV0 fCLK = 1 fCLK = 2 fCLK = 4 fCLK = 8 fCLK = 16 fCLK = 32 Clock (fAD)
Note 1 Note 2
MHz MHz MHz MHz MHz MHz
0 0 0 0 0 Normal 1 Setting Setting Setting Setting Setting Setting fCLK/64
0 0 1 prohibited prohibited prohibited prohibited prohibited prohibited fCLK/32
0 1 0 fCLK/16
0 1 1 fCLK/8
1 0 0 fCLK/6
1 0 1 fCLK/5
1 1 0 fCLK/4
1 1 1 fCLK/2
0 0 0 0 1 Normal 2 Setting Setting Setting Setting Setting Setting fCLK/64
0 0 1 prohibited prohibited prohibited prohibited prohibited prohibited fCLK/32
0 1 0 fCLK/16
0 1 1 fCLK/8
1 0 0 fCLK/6
1 0 1 fCLK/5
1 1 0 fCLK/4
1 1 1 fCLK/2
0 0 0 1 0 Low- Setting Setting Setting Setting 76 μs Setting fCLK/64
voltage 1 prohibited prohibited prohibited prohibited prohibited
0 0 1 76 μs Setting fCLK/32
0 1 0 76 μs Setting prohibited fCLK/16
0 1 1 76 μs Setting prohibited fCLK/8
1 0 0 57 μs prohibited fCLK/6
1 0 1 95 μs Setting fCLK/5
1 1 0 76 μs prohibited fCLK/4
1 1 1 Setting fCLK/2
prohibited
0 0 0 1 1 Low- Setting Setting Setting Setting 68 μs Setting fCLK/64
voltage 2 prohibited prohibited prohibited prohibited prohibited
0 0 1 68 μs Setting fCLK/32
0 1 0 68 μs Setting prohibited fCLK/16
0 1 1 68 μs Setting prohibited fCLK/8
1 0 0 Setting prohibited fCLK/6
1 0 1 85 μs prohibited fCLK/5
1 1 0 68 μs fCLK/4
1 1 1 Setting fCLK/2
prohibited
Notes 1. Setting is prohibited when VDD < 1.8 V.
2. Setting is prohibited when VDD < 2.4 V.
Cautions 1. When rewriting the FR2 to FR0, LV1, and LV0 bits to other than the same data, stop A/D conversion
once (ADCS = 0) beforehand.
2. The above conversion time does not include clock frequency errors. Select conversion time, taking
clock frequency errors into consideration.
(5) 3.6 V ≤ VDD ≤ 5.5 V when there is stabilization wait time (hardware trigger wait mode)
A/D Converter Mode Register 0 (ADM0) Mode Conversion Time Selection Conversion
FR2 FR1 FR0 LV1 LV0 fCLK = 1 fCLK = 2 fCLK = 4 fCLK = 8 fCLK = 16 fCLK = 32 Clock (fAD)
MHz MHz MHz MHz MHz MHz
Cautions 1. When rewriting the FR2 to FR0, LV1, and LV0 bits to other than the same data, stop A/D conversion
once (ADCS = 0) beforehand.
2. The above conversion time does not include clock frequency errors. Select conversion time, taking
clock frequency errors into consideration.
3. While in the hardware trigger wait mode, the conversion time includes the time spent waiting for
stabilization after the hardware trigger is detected.
A/D Converter Mode Register 0 (ADM0) Mode Conversion Time Selection Conversion
FR2 FR1 FR0 LV1 LV0 fCLK = 1 fCLK = 2 fCLK = 4 fCLK = 8 fCLK = 16 fCLK = 32 Clock (fAD)
MHz MHz MHz MHz MHz MHz
Cautions 1. When rewriting the FR2 to FR0, LV1, and LV0 bits to other than the same data, stop A/D conversion
once (ADCS = 0) beforehand.
2. The above conversion time does not include clock frequency errors. Select conversion time, taking
clock frequency errors into consideration.
3. While in the hardware trigger wait mode, the conversion time includes the time spent waiting for
stabilization after the hardware trigger is detected.
A/D Converter Mode Register 0 (ADM0) Mode Conversion Time Selection Conversion
FR2 FR1 FR0 LV1 LV0 fCLK = 1 fCLK = 2 fCLK = 4 fCLK = 8 fCLK = 16 fCLK = 32 Clock (fAD)
MHz MHz MHz MHz MHz MHz
0 0 0 0 0 Normal 1 Setting Setting Setting Setting Setting Setting fCLK/64
0 0 1 prohibited prohibited prohibited prohibited prohibited prohibited fCLK/32
0 1 0 fCLK/16
0 1 1 fCLK/8
1 0 0 fCLK/6
1 0 1 fCLK/5
1 1 0 fCLK/4
1 1 1 fCLK/2
0 0 0 0 1 Normal 2 Setting Setting Setting Setting Setting Setting fCLK/64
0 0 1 prohibited prohibited prohibited prohibited prohibited prohibited fCLK/32
0 1 0 fCLK/16
0 1 1 fCLK/8
1 0 0 fCLK/6
1 0 1 fCLK/5
1 1 0 fCLK/4
1 1 1 fCLK/2
0 0 0 1 0 Low- Setting Setting Setting Setting Setting 54 μs fCLK/64
voltage 1 prohibited prohibited prohibited prohibited prohibited
0 0 1 54 μs 27 μs fCLK/32
0 1 0 54 μs 27 μs Setting fCLK/16
0 1 1 54 μs 27 μs Setting prohibited fCLK/8
1 0 0 40.5 μs Setting prohibited fCLK/6
1 0 1 33.75 μs prohibited fCLK/5
1 1 0 54 μs 27 μs fCLK/4
1 1 1 54 μs 27 μs Setting fCLK/2
prohibited
0 0 0 1 1 Low- Setting Setting Setting Setting Setting 50 μs fCLK/64
voltage 2 prohibited prohibited prohibited prohibited prohibited
0 0 1 50 μs 25 μs fCLK/32
0 1 0 50 μs 25 μs Setting fCLK/16
0 1 1 50 μs 25 μs Setting prohibited fCLK/8
1 0 0 37.5 μs Setting prohibited fCLK/6
1 0 1 31.25 μs prohibited fCLK/5
1 1 0 50 μs 25 μs fCLK/4
1 1 1 50 μs 25 μs Setting fCLK/2
prohibited
Cautions 1. When rewriting the FR2 to FR0, LV1, and LV0 bits to other than the same data, stop A/D conversion
once (ADCS = 0) beforehand.
2. The above conversion time does not include clock frequency errors. Select conversion time, taking
clock frequency errors into consideration.
3. While in the hardware trigger wait mode, the conversion time includes the time spent waiting for
stabilization after the hardware trigger is detected.
A/D Converter Mode Register 0 (ADM0) Mode Conversion Time Selection Conversion
FR2 FR1 FR0 LV1 LV0 fCLK = 1 fCLK = 2 fCLK = 4 fCLK = 8 fCLK = 16 fCLK = 32 Clock (fAD)
MHz MHz MHz MHz MHz MHz
0 0 0 0 0 Normal 1 Setting Setting Setting Setting Setting Setting fCLK/64
0 0 1 prohibited prohibited prohibited prohibited prohibited prohibited fCLK/32
0 1 0 fCLK/16
0 1 1 fCLK/8
1 0 0 fCLK/6
1 0 1 fCLK/5
1 1 0 fCLK/4
1 1 1 fCLK/2
0 0 0 0 1 Normal 2 Setting Setting Setting Setting Setting Setting fCLK/64
0 0 1 prohibited prohibited prohibited prohibited prohibited prohibited fCLK/32
0 1 0 fCLK/16
0 1 1 fCLK/8
1 0 0 fCLK/6
1 0 1 fCLK/5
1 1 0 fCLK/4
1 1 1 fCLK/2
0 0 0 1 0 Low- Setting Setting Setting Setting 108 μs Setting fCLK/64
voltage 1 prohibited prohibited prohibited prohibited prohibited
0 0 1 108 μs Setting fCLK/32
0 1 0 108 μs Setting prohibited fCLK/16
0 1 1 108 μs Setting prohibited fCLK/8
1 0 0 81 μs prohibited fCLK/6
1 0 1 135 μs Setting fCLK/5
1 1 0 108 μs prohibited fCLK/4
1 1 1 Setting fCLK/2
prohibited
0 0 0 1 1 Low- Setting Setting Setting Setting 100 μs Setting fCLK/64
voltage 2 prohibited prohibited prohibited prohibited prohibited
0 0 1 100 μs Setting fCLK/32
0 1 0 100 μs Setting prohibited fCLK/16
0 1 1 100 μs Setting prohibited fCLK/8
1 0 0 Setting prohibited fCLK/6
1 0 1 125 μs prohibited fCLK/5
1 1 0 100 μs fCLK/4
1 1 1 Setting fCLK/2
prohibited
Cautions 1. When rewriting the FR2 to FR0, LV1, and LV0 bits to other than the same data, stop A/D conversion
once (ADCS = 0) beforehand.
2. The above conversion time does not include clock frequency errors. Select conversion time, taking
clock frequency errors into consideration.
3. While in the hardware trigger wait mode, the conversion time includes the time spent waiting for
stabilization after the hardware trigger is detected.
Figure 11-5. A/D Converter Sampling and A/D Conversion Timing (Example for Software Trigger Mode)
ADCS
Sampling
timing
INTAD
Cautions 1. Only rewrite the value of the ADM1 register while conversion operation is stopped (which is
indicated by the ADCS bit of A/D converter mode register 0 (ADM0) being 0).
2. For the trigger interval in the hardware trigger wait mode, specify at least “A/D Conversion
Time, When there is stabilization wait time” described in Table 11-3.
ADREFP1 ADREFP0 Selection of the + side reference voltage source of the A/D converter
0 0 Supplied from VDD
0 1 Supplied from P20/AVREFP/ANI0
1 0 Supplied from the internal reference voltage (1.45 V)
1 1 Setting prohibited
<R> ・ When ADREFP1 or ADREFP0 bit is rewritten, this must be configured in accordance with the following procedures.
(1) Set ADCE = 0
(2) Change the values of ADREFP1 and ADREFP0
(3) Stabilization wait time (A)
(4) Set ADCE = 1
(5) Stabilization wait time (B)
When ADREFP1 and ADREFP0 are set to 1 and 0, the setting is changed to A = 1 μ s, B = 5 μ s.
When ADREFP1 and ADREFP0 are set to 0 and 0 or 0 and 1, A needs no wait and B = 1 μ s.
・ When ADREFP1 and ADREFP0 are set to 1 and 0, respectively, A/D conversion cannot be performed on the
temperature sensor output.
Be sure to perform A/D conversion while ADISS = 0.
ADREFM Selection of the − side reference voltage source of the A/D converter
<R> ADRCK Checking the upper limit and lower limit conversion result values
0 The interrupt signal (INTAD) is output when the ADLL register ≤ the ADCR register ≤ the ADUL register
(<1>).
1 The interrupt signal (INTAD) is output when the ADCR register < the ADLL register (<2>) or the ADUL
register < the ADCR register (<3>).
Figure 11-8 shows the generation range of the interrupt signal (INTAD) for <1> to <3>.
Caution Only rewrite the value of the ADM2 register while conversion operation is stopped (which is
indicated by the ADCS bit of A/D converter mode register 0 (ADM0) being 0).
0 10-bit resolution
1 8-bit resolution
Caution Only rewrite the value of the ADM2 register while conversion operation is stopped (which is
indicated by the ADCS bit of A/D converter mode register 0 (ADM0) being 0).
<1>
(ADLL ≤ ADCR ≤ ADUL) INTAD is generated
when ADRCK = 0.
FFF1FH FFF1EH
Symbol
ADCR 0 0 0 0 0 0
Cautions 1. When writing to the A/D converter mode register 0 (ADM0), analog input channel specification
register (ADS), and A/D port configuration register (ADPC), the contents of the ADCR register
may become undefined. Read the conversion result following conversion completion before
writing to the ADM0, ADS, and ADPC registers. Using timing other than the above may cause an
incorrect conversion result to be read.
2. When 8-bit resolution A/D conversion is selected (when the ADTYP bit of A/D converter mode
register 2 (ADM2) is 1) and the ADCR register is read, 0 is read from the lower two bits (ADCR1
and ADCR0).
3. When the ADCR register is accessed in 16-bit units, the higher 10 bits of the conversion result
are read in order starting at bit 15.
Symbol 7 6 5 4 3 2 1 0
ADCRH
Caution When writing to the A/D converter mode register 0 (ADM0), analog input channel specification
register (ADS), and A/D port configuration register (ADPC), the contents of the ADCRH register may
become undefined. Read the conversion result following conversion completion before writing to
the ADM0, ADS, and ADPC registers. Using timing other than the above may cause an incorrect
conversion result to be read.
<R> Figure 11-11. Format of Analog Input Channel Specification Register (ADS) (1/2)
<R> Figure 11-11. Format of Analog Input Channel Specification Register (ADS) (2/2)
Caution When 10-bit resolution A/D conversion is selected, the higher eight bits of the 10-bit A/D conversion
result register (ADCR) are compared with the ADUL register.
Figure 11-12. Format of Conversion Result Comparison Upper Limit Setting Register (ADUL)
Figure 11-13. Format of Conversion Result Comparison Lower Limit Setting Register (ADLL)
Caution When 10-bit resolution A/D conversion is selected, the higher eight bits of the 10-bit A/D conversion
result register (ADCR) are compared with the ADLL register.
ANI13/P155
ANI12/P154
ANI11/P153
ANI10/P152
ANI9/P151
ANI8/P150
ANI7/P27
ANI6/P26
ANI5/P25
ANI4/P24
ANI3/P23
ANI2/P22
ANI1/P21
ANI0/P20
ADPC3
ADPC2
ADPC1
ADPC0
0 0 0 0 A A A A A A A A A A A A A A A
0 0 0 1 D D D D D D D D D D D D D D D
0 0 1 0 D D D D D D D D D D D D D D A
0 0 1 1 D D D D D D D D D D D D D A A
0 1 0 0 D D D D D D D D D D D D A A A
0 1 0 1 D D D D D D D D D D D A A A A
0 1 1 0 D D D D D D D D D D A A A A A
0 1 1 1 D D D D D D D D D A A A A A A
1 0 0 0 D D D D D D D D A A A A A A A
1 0 0 1 D D D D D D D A A A A A A A A
1 0 1 0 D D D D D D A A A A A A A A A
1 0 1 1 D D D D D A A A A A A A A A A
1 1 0 0 D D D D A A A A A A A A A A A
1 1 0 1 D D D A A A A A A A A A A A A
1 1 1 0 D D A A A A A A A A A A A A A
1 1 1 1 D A A A A A A A A A A A A A A
Cautions 1. Set the channel used for A/D conversion to the input mode by using port mode registers 2, 15
(PM2, PM15).
2. Do not set the pin set by the ADPC register as digital I/O by the analog input channel
specification register (ADS).
<R> (12) Port mode control registers 0, 3, 10, 11, 12, 14 (PMC0, PMC3, PMC10, PMC11, PMC12, PMC14)
This register switches the ANI16 to ANI26 pins to digital I/O of port or analog input of A/D converter.
These registers can be set by a 1-bit or 8-bit memory manipulation instruction.
Reset signal generation clears these registers to FFH.
<R> (13) Port mode register 0, 2, 3, 10, 11, 12, 14, 15 (PM0, PM2, PM3, PM10, PM11, PM12, PM14, PM15)
When using the ANI0 to ANI14 or ANI16 to ANI26 pin for an analog input port, set the PMmn bit to 1. The output
latches of Pnm at this time may be 0 or 1.
If the PMmn bits are set to 0, they cannot be used as analog input port pins.
The PMmn registers can be set by a 1-bit or 8-bit memory manipulation instruction.
Reset signal generation sets these registers to FFH.
Caution If a pin is set as an analog input port, not the pin level but “0” is always read.
Figure 11-17. Formats of Port Mode Registers 0, 2, 12, and 14 (PM0, PM2, PM12, PM14) (64-pin products)
PM12 1 1 1 1 1 1 1 PM120
PMmn Pmn pin I/O mode selection (mn = 00 to 07, 20 to 27, 120, 140, 141)
Remark For details of the port mode register other than 64-pin products, see 4. 3 Registers Controlling Port
Function.
<R> The ANI0/P20 to ANI7/P27 and ANI8/P150 to ANI14/P156 pins are as shown below depending on the settings of the
A/D port configuration register (ADPC), analog input channel specification register (ADS), PM2 and PM15 registers.
The ANI16 to ANI26 pins are as shown below depending on the settings of port mode control registers 0, 3, 10, 11, 12,
and 14 (PMC0, PMC3, PMC10, PMC11, PMC12, PMC14), analog input channel specification register (ADS), PM0,
PM3, PM10, PM11, PM12, and PM14 registers.
PMC0, PMC3, PMC10, PM0, PM3, PM10, ADS ANI16 to ANI26 Pins
PMC11, PMC12, and PM11, PM12, and
PMC14 PM14
<1> The voltage input to the selected analog input channel is sampled by the sample & hold circuit.
<2> When sampling has been done for a certain time, the sample & hold circuit is placed in the hold state and the
sampled voltage is held until the A/D conversion operation has ended.
<3> Bit 9 of the successive approximation register (SAR) is set. The series resistor string voltage tap is set to (1/2)
AVREF by the tap selector.
<4> The voltage difference between the series resistor string voltage tap and sampled voltage is compared by the
voltage comparator. If the analog input is greater than (1/2) AVREF, the MSB bit of the SAR register remains set
to 1. If the analog input is smaller than (1/2) AVREF, the MSB bit is reset to 0.
<5> Next, bit 8 of the SAR register is automatically set to 1, and the operation proceeds to the next comparison. The
series resistor string voltage tap is selected according to the preset value of bit 9, as described below.
• Bit 9 = 1: (3/4) AVREF
• Bit 9 = 0: (1/4) AVREF
The voltage tap and sampled voltage are compared and bit 8 of the SAR register is manipulated as follows.
• Sampled voltage ≥ Voltage tap: Bit 8 = 1
• Sampled voltage < Voltage tap: Bit 8 = 0
<6> Comparison is continued in this way up to bit 0 of the SAR register.
<7> Upon completion of the comparison of 10 bits, an effective digital result value remains in the SAR register, and
the result value is transferred to the A/D conversion result register (ADCR, ADCRH) and then latched.
At the same time, the A/D conversion end interrupt request (INTAD) can also be generated.
<8> Repeat steps <1> to <7>, until the ADCS bit is cleared to 0Note.
To stop the A/D converter, clear the ADCS bit to 0.
Note While in the sequential conversion mode, the ADCS flag is not automatically cleared to 0. This flag is not
automatically cleared to 0 while in the one-shot conversion mode of the hardware trigger no-wait mode, either.
Instead, 1 is retained.
Remarks 1. Two types of the A/D conversion result registers are available.
• ADCR register (16 bits): Store 10-bit A/D conversion value
• ADCRH register (8 bits): Store 8-bit A/D conversion value
2. AVREF: The + side reference voltage of the A/D converter. This can be selected from AVREFP, the internal
reference voltage (1.45 V), and VDD.
Conversion time
Sampling time
A/D converter
SAR clear Sampling A/D conversion
operation
Conversion
SAR Undefined result
ADCR Conversion
result
INTAD
A/D conversion operations are performed continuously until bit 7 (ADCS) of the A/D converter mode register (ADM) is
reset (0) by software.
If a write operation is performed to the analog input channel specification register (ADS) during an A/D conversion
operation, the conversion operation is initialized, and if the ADCS bit is set (1), conversion starts again from the beginning.
Reset signal generation clears the A/D conversion result register (ADCR, ADCRH) to 0000H or 00H.
The relationship between the analog input voltage input to the analog input pins (ANI0 to ANI14, ANI16 to ANI26) and
the theoretical A/D conversion result (stored in the 10-bit A/D conversion result register (ADCR)) is shown by the following
expression.
VAIN
SAR = INT ( × 1024 + 0.5)
AVREF
ADCR = SAR × 64
or
Figure 11-19 shows the relationship between the analog input voltage and the A/D conversion result.
Figure 11-19. Relationship Between Analog Input Voltage and A/D Conversion Result
SAR ADCR
1023 FFC0H
1022 FF80H
1021 FF40H
3 00C0H
2 0080H
1 0040H
0 0000H
1 1 3 2 5 3 2043 1022 2045 1023 2047 1
2048 1024 2048 1024 2048 1024 2048 1024 2048 1024 2048
Input voltage/AVREF
Remark AVREF: The + side reference voltage of the A/D converter. This can be selected from AVREFP, the internal
reference voltage (1.45 V), and VDD.
The operation of each A/D converter mode is described below. In addition, the procedure for specifying each mode is
described in 11.7 A/D Converter Setup Flowchart.
<R> <1> In the stop status, the ADCE bit of A/D converter mode register 0 (ADM0) is set to 1, and the system enters the
A/D conversion standby status.
<2> After the software counts up to the stabilization wait time (1 μs), the ADCS bit of the ADM0 register is set to 1 to
perform the A/D conversion of the analog input specified by the analog input channel specification register (ADS).
<3> When A/D conversion ends, the conversion result is stored in the A/D conversion result register (ADCR, ADCRH),
and the A/D conversion end interrupt request signal (INTAD) is generated. After A/D conversion ends, the next
A/D conversion immediately starts.
<4> When ADCS is overwritten with 1 during conversion operation, the current A/D conversion is interrupted, and
conversion restarts. The partially converted data is discarded.
<5> When the value of the ADS register is rewritten or overwritten during conversion operation, the current A/D
conversion is interrupted, and A/D conversion is performed on the analog input respecified by the ADS register.
The partially converted data is discarded.
<6> Even if a hardware trigger is input during conversion operation, A/D conversion does not start.
<7> When ADCS is cleared to 0 during conversion operation, the current A/D conversion is interrupted, and the
system enters the A/D conversion standby status.
<R> <8> When ADCE is cleared to 0 while in the A/D conversion standby status, the A/D converter enters the stop status.
When ADCE = 0, specifying 1 for ADCS is ignored and A/D conversion does not start.
Figure 11-20. Example of Software Trigger Mode (Select Mode, Sequential Conversion Mode) Operation Timing
INTAD
<R> <1> In the stop status, the ADCE bit of A/D converter mode register 0 (ADM0) is set to 1, and the system enters the
A/D conversion standby status.
<2> After the software counts up to the stabilization wait time (1 μs), the ADCS bit of the ADM0 register is set to 1 to
perform the A/D conversion of the analog input specified by the analog input channel specification register (ADS).
<3> When A/D conversion ends, the conversion result is stored in the A/D conversion result register (ADCR, ADCRH),
and the A/D conversion end interrupt request signal (INTAD) is generated.
<4> After A/D conversion ends, the ADCS bit is automatically cleared to 0, and the system enters the A/D conversion
standby status.
<5> When ADCS is overwritten with 1 during conversion operation, the current A/D conversion is interrupted, and
conversion restarts. The partially converted data is discarded.
<6> When the value of the ADS register is rewritten or overwritten during conversion operation, the current A/D
conversion is interrupted, and A/D conversion is performed on the analog input respecified by the ADS register.
The partially converted data is discarded.
<7> When ADCS is cleared to 0 during conversion operation, the current A/D conversion is interrupted, and the
system enters the A/D conversion standby status.
<R> <8> When ADCE is cleared to 0 while in the A/D conversion standby status, the A/D converter enters the stop status.
When ADCE = 0, specifying 1 for ADCS is ignored and A/D conversion does not start. In addition, A/D
conversion does not start even if a hardware trigger is input while in the A/D conversion standby status.
Figure 11-21. Example of Software Trigger Mode (Select Mode, One-Shot Conversion Mode) Operation Timing
INTAD
<R> <1> In the stop status, the ADCE bit of A/D converter mode register 0 (ADM0) is set to 1, and the system enters the
A/D conversion standby status.
<2> After the software counts up to the stabilization wait time (1 μs), the ADCS bit of the ADM0 register is set to 1 to
perform A/D conversion on the four analog input channels specified by scan 0 to scan 3, which are specified by
the analog input channel specification register (ADS). A/D conversion is performed on the analog input channels
in order, starting with that specified by scan 0.
<3> A/D conversion is sequentially performed on the four analog input channels, the conversion results are stored in
the A/D conversion result register (ADCR, ADCRH) each time conversion ends, and the A/D conversion end
interrupt request signal (INTAD) is generated. After A/D conversion of the four channels ends, the A/D
conversion of the channel following the specified channel automatically starts (until all four channels are finished).
<4> When ADCS is overwritten with 1 during conversion operation, the current A/D conversion is interrupted, and
conversion restarts at the first channel. The partially converted data is discarded.
<5> When the value of the ADS register is rewritten or overwritten during conversion operation, the current A/D
conversion is interrupted, and A/D conversion is performed on the first channel respecified by the ADS register.
The partially converted data is discarded.
<6> Even if a hardware trigger is input during conversion operation, A/D conversion does not start.
<7> When ADCS is cleared to 0 during conversion operation, the current A/D conversion is interrupted, and the
system enters the A/D conversion standby status.
<R> <8> When ADCE is cleared to 0 while in the A/D conversion standby status, the A/D converter enters the stop status.
When ADCE = 0, specifying 1 for ADCS is ignored and A/D conversion does not start.
Figure 11-22. Example of Software Trigger Mode (Scan Mode, Sequential Conversion Mode) Operation Timing
INTAD
<R> <1> In the stop status, the ADCE bit of A/D converter mode register 0 (ADM0) is set to 1, and the system enters the
A/D conversion standby status.
<2> After the software counts up to the stabilization wait time (1 μs), the ADCS bit of the ADM0 register is set to 1 to
perform A/D conversion on the four analog input channels specified by scan 0 to scan 3, which are specified by
the analog input channel specification register (ADS). A/D conversion is performed on the analog input channels
in order, starting with that specified by scan 0.
<3> A/D conversion is sequentially performed on the four analog input channels, the conversion results are stored in
the A/D conversion result register (ADCR, ADCRH) each time conversion ends, and the A/D conversion end
interrupt request signal (INTAD) is generated.
<4> After A/D conversion of the four channels ends, the ADCS bit is automatically cleared to 0, and the system enters
the A/D conversion standby status.
<5> When ADCS is overwritten with 1 during conversion operation, the current A/D conversion is interrupted, and
conversion restarts at the first channel. The partially converted data is discarded.
<6> When the value of the ADS register is rewritten or overwritten during conversion operation, the current A/D
conversion is interrupted, and A/D conversion is performed on the first channel respecified by the ADS register.
The partially converted data is discarded.
<7> When ADCS is cleared to 0 during conversion operation, the current A/D conversion is interrupted, and the
system enters the A/D conversion standby status.
<R> <8> When ADCE is cleared to 0 while in the A/D conversion standby status, the A/D converter enters the stop status.
When ADCE = 0, specifying 1 for ADCS is ignored and A/D conversion does not start. In addition, A/D
conversion does not start even if a hardware trigger is input while in the A/D conversion standby status.
Figure 11-23. Example of Software Trigger Mode (Scan Mode, One-Shot Conversion Mode) Operation Timing
ADCR, Data 1 Data 2 Data 3 Data 4 Data 1 (ANI0) Data 2 Data 3 Data 4 Data 1 Data 5 Data 6 Data 7
ADCRH (ANI0) (ANI1) (ANI2) (ANI3) (ANI1) (ANI2) (ANI3) (ANI0) (ANI4) (ANI5) (ANI6)
INTAD
The interrupt is generated four times. The interrupt is generated four times.
11.6.5 Hardware trigger no-wait mode (select mode, sequential conversion mode)
<R> <1> In the stop status, the ADCE bit of A/D converter mode register 0 (ADM0) is set to 1, and the system enters the
A/D conversion standby status.
<2> After the software counts up to the stabilization wait time (1 μs), the ADCS bit of the ADM0 register is set to 1 to
place the system in the hardware trigger standby status (and conversion does not start at this stage). Note that,
while in this status, A/D conversion does not start even if ADCS is set to 1.
<3> If a hardware trigger is input while ADCS = 1, A/D conversion is performed on the analog input specified by the
analog input channel specification register (ADS).
<4> When A/D conversion ends, the conversion result is stored in the A/D conversion result register (ADCR, ADCRH),
and the A/D conversion end interrupt request signal (INTAD) is generated. After A/D conversion ends, the next
A/D conversion immediately starts.
<5> If a hardware trigger is input during conversion operation, the current A/D conversion is interrupted, and
conversion restarts. The partially converted data is discarded.
<6> When the value of the ADS register is rewritten or overwritten during conversion operation, the current A/D
conversion is interrupted, and A/D conversion is performed on the analog input respecified by the ADS register.
The partially converted data is discarded.
<7> When ADCS is overwritten with 1 during conversion operation, the current A/D conversion is interrupted, and
conversion restarts. The partially converted data is discarded.
<8> When ADCS is cleared to 0 during conversion operation, the current A/D conversion is interrupted, and the
<R> system enters the A/D conversion standby status. However, the A/D converter does not stop in this status.
<R> <9> When ADCE is cleared to 0 while in the A/D conversion standby status, the A/D converter enters the stop status.
When ADCS = 0, inputting a hardware trigger is ignored and A/D conversion does not start.
Figure 11-24. Example of Hardware Trigger No-Wait Mode (Select Mode, Sequential Conversion Mode) Operation
Timing
INTAD
11.6.6 Hardware trigger no-wait mode (select mode, one-shot conversion mode)
<R> <1> In the stop status, the ADCE bit of A/D converter mode register 0 (ADM0) is set to 1, and the system enters the
A/D conversion standby status.
<2> After the software counts up to the stabilization wait time (1 μs), the ADCS bit of the ADM0 register is set to 1 to
place the system in the hardware trigger standby status (and conversion does not start at this stage). Note that,
while in this status, A/D conversion does not start even if ADCS is set to 1.
<3> If a hardware trigger is input while ADCS = 1, A/D conversion is performed on the analog input specified by the
analog input channel specification register (ADS).
<4> When A/D conversion ends, the conversion result is stored in the A/D conversion result register (ADCR, ADCRH),
and the A/D conversion end interrupt request signal (INTAD) is generated.
<5> After A/D conversion ends, the ADCS bit remains set to 1, and the system enters the A/D conversion standby
status.
<6> If a hardware trigger is input during conversion operation, the current A/D conversion is interrupted, and
conversion restarts. The partially converted data is discarded.
<7> When the value of the ADS register is rewritten or overwritten during conversion operation, the current A/D
conversion is interrupted, and A/D conversion is performed on the analog input respecified by the ADS register.
The partially converted data is discarded.
<8> When ADCS is overwritten with 1 during conversion operation, the current A/D conversion is interrupted, and
conversion restarts. The partially converted data is discarded.
<9> When ADCS is cleared to 0 during conversion operation, the current A/D conversion is interrupted, and the
<R> system enters the A/D conversion standby status. However, the A/D converter does not stop in this status.
<R> <10> When ADCE is cleared to 0 while in the A/D conversion standby status, the A/D converter enters the stop status.
When ADCS = 0, inputting a hardware trigger is ignored and A/D conversion does not start.
Figure 11-25. Example of Hardware Trigger No-Wait Mode (Select Mode, One-Shot Conversion Mode) Operation
Timing
INTAD
11.6.7 Hardware trigger no-wait mode (scan mode, sequential conversion mode)
<R> <1> In the stop status, the ADCE bit of A/D converter mode register 0 (ADM0) is set to 1, and the system enters the
A/D conversion standby status.
<2> After the software counts up to the stabilization wait time (1 μs), the ADCS bit of the ADM0 register is set to 1 to
place the system in the hardware trigger standby status (and conversion does not start at this stage). Note that,
while in this status, A/D conversion does not start even if ADCS is set to 1.
<3> If a hardware trigger is input while ADCS = 1, A/D conversion is performed on the four analog input channels
specified by scan 0 to scan 3, which are specified by the analog input channel specification register (ADS). A/D
conversion is performed on the analog input channels in order, starting with that specified by scan 0.
<4> A/D conversion is sequentially performed on the four analog input channels, the conversion results are stored in
the A/D conversion result register (ADCR, ADCRH) each time conversion ends, and the A/D conversion end
interrupt request signal (INTAD) is generated. After A/D conversion of the four channels ends, the A/D
conversion of the channel following the specified channel automatically starts.
<5> If a hardware trigger is input during conversion operation, the current A/D conversion is interrupted, and
conversion restarts at the first channel. The partially converted data is discarded.
<6> When the value of the ADS register is rewritten or overwritten during conversion operation, the current A/D
conversion is interrupted, and A/D conversion is performed on the first channel respecified by the ADS register.
The partially converted data is discarded.
<7> When ADCS is overwritten with 1 during conversion operation, the current A/D conversion is interrupted, and
conversion restarts. The partially converted data is discarded.
<8> When ADCS is cleared to 0 during conversion operation, the current A/D conversion is interrupted, and the
<R> system enters the A/D conversion standby status. However, the A/D converter does not stop in this status.
<R> <9> When ADCE is cleared to 0 while in the A/D conversion standby status, the A/D converter enters the stop status.
When ADCE = 0, specifying 1 for ADCS is ignored and A/D conversion does not start.
Figure 11-26. Example of Hardware Trigger No-Wait Mode (Scan Mode, Sequential Conversion Mode) Operation
Timing
ADCR, Data 1 Data 2 Data 3 Data 4 Data 2 Data 3 Data 4 Data 1 Data 5 Data 6 Data 7 Data 8 Data 5 Data 6 Data 5 Data 6 Data 7 Data 8
(ANI0) (ANI1) (ANI2) (ANI3) Data 1 (ANI0) (ANI1) (ANI2) (ANI3) (ANI0) (ANI4) (ANI5) (ANI6) (ANI7) (ANI4) (ANI5) (ANI4) (ANI5) (ANI6) (ANI7)
ADCRH
INTAD
The interrupt is generated four times. The interrupt is generated four times. The interrupt is generated four times. The interrupt is generated four times.
11.6.8 Hardware trigger no-wait mode (scan mode, one-shot conversion mode)
<R> <1> In the stop status, the ADCE bit of A/D converter mode register 0 (ADM0) is set to 1, and the system enters the
A/D conversion standby status.
<2> After the software counts up to the stabilization wait time (1 μs), the ADCS bit of the ADM0 register is set to 1 to
place the system in the hardware trigger standby status (and conversion does not start at this stage). Note that,
while in this status, A/D conversion does not start even if ADCS is set to 1.
<3> If a hardware trigger is input while ADCS = 1, A/D conversion is performed on the four analog input channels
specified by scan 0 to scan 3, which are specified by the analog input channel specification register (ADS). A/D
conversion is performed on the analog input channels in order, starting with that specified by scan 0.
<4> A/D conversion is sequentially performed on the four analog input channels, the conversion results are stored in
the A/D conversion result register (ADCR, ADCRH) each time conversion ends, and the A/D conversion end
interrupt request signal (INTAD) is generated.
<5> After A/D conversion of the four channels ends, the ADCS bit remains set to 1, and the system enters the A/D
conversion standby status.
<6> If a hardware trigger is input during conversion operation, the current A/D conversion is interrupted, and
conversion restarts at the first channel. The partially converted data is discarded.
<7> When the value of the ADS register is rewritten or overwritten during conversion operation, the current A/D
conversion is interrupted, and A/D conversion is performed on the first channel respecified by the ADS register.
The partially converted data is discarded.
<8> When ADCS is overwritten with 1 during conversion operation, the current A/D conversion is interrupted, and
conversion restarts at the first channel. The partially converted data is discarded.
<9> When ADCS is cleared to 0 during conversion operation, the current A/D conversion is interrupted, and the
<R> system enters the A/D conversion standby status. However, the A/D converter does not stop in this status.
<R> <10> When ADCE is cleared to 0 while in the A/D conversion standby status, the A/D converter enters the stop status.
When ADCS = 0, inputting a hardware trigger is ignored and A/D conversion does not start.
Figure 11-27. Example of Hardware Trigger No-Wait Mode (Scan Mode, One-Shot Conversion Mode) Operation
Timing
ADCR, Data 1 Data 2 Data 3 Data 4 Data 2 Data 3 Data 4 Data 1 Data 5 Data 6 Data 7 Data 8 Data 6
Data 1 (ANI0) Data 5 (ANI4)
ADCRH (ANI0) (ANI1) (ANI2) (ANI3) (ANI1) (ANI2) (ANI3) (ANI0) (ANI4) (ANI5) (ANI6) (ANI7) (ANI5)
INTAD
The interrupt is generated four times. The interrupt is generated four times. The interrupt is generated four times.
11.6.9 Hardware trigger wait mode (select mode, sequential conversion mode)
<R> <1> In the stop status, the ADCE bit of A/D converter mode register 0 (ADM0) is set to 1, and the system enters the
hardware trigger standby status.
<2> If a hardware trigger is input while in the hardware trigger standby status, A/D conversion is performed on the
analog input specified by the analog input channel specification register (ADS). The ADCS bit of the ADM0
register is automatically set to 1 according to the hardware trigger input.
<3> When A/D conversion ends, the conversion result is stored in the A/D conversion result register (ADCR, ADCRH),
and the A/D conversion end interrupt request signal (INTAD) is generated. After A/D conversion ends, the next
A/D conversion immediately starts. (At this time, no hardware trigger is necessary.)
<4> If a hardware trigger is input during conversion operation, the current A/D conversion is interrupted, and
conversion restarts. The partially converted data is discarded.
<5> When the value of the ADS register is rewritten or overwritten during conversion operation, the current A/D
conversion is interrupted, and A/D conversion is performed on the analog input respecified by the ADS register.
The partially converted data is discarded.
<6> When ADCS is overwritten with 1 during conversion operation, the current A/D conversion is interrupted, and
conversion restarts. The partially converted data is discarded.
<7> When ADCS is cleared to 0 during conversion operation, the current A/D conversion is interrupted, the system
<R> enters the hardware trigger standby status, and the A/D converter enters the stop status. When ADCE = 0,
inputting a hardware trigger is ignored and A/D conversion does not start.
Figure 11-28. Example of Hardware Trigger Wait Mode (Select Mode, Sequential Conversion Mode) Operation
Timing
ADCE
<4> A hardware trigger is Trigger The trigger
<2> A hardware trigger generated during A/D
is generated. conversion operation. standby is not
Hardware status acknowledged.
trigger
INTAD
11.6.10 Hardware trigger wait mode (select mode, one-shot conversion mode)
<R> <1> In the stop status, the ADCE bit of A/D converter mode register 0 (ADM0) is set to 1, and the system enters the
hardware trigger standby status.
<2> If a hardware trigger is input while in the hardware trigger standby status, A/D conversion is performed on the
analog input specified by the analog input channel specification register (ADS). The ADCS bit of the ADM0
register is automatically set to 1 according to the hardware trigger input.
<3> When A/D conversion ends, the conversion result is stored in the A/D conversion result register (ADCR, ADCRH),
and the A/D conversion end interrupt request signal (INTAD) is generated.
<4> After A/D conversion ends, the ADCS bit is automatically cleared to 0, and the A/D converter enters the stop
status.
<5> If a hardware trigger is input during conversion operation, the current A/D conversion is interrupted, and
conversion restarts. The partially converted data is discarded.
<6> When the value of the ADS register is rewritten or overwritten during conversion operation, the current A/D
conversion is interrupted, and A/D conversion is performed on the analog input respecified by the ADS register.
The partially converted data is discarded.
<7> When ADCS is overwritten with 1 during conversion operation, the current A/D conversion is interrupted, and
conversion restarts. The partially converted data is initialized.
<8> When ADCS is cleared to 0 during conversion operation, the current A/D conversion is interrupted, the system
<R> enters the hardware trigger standby status, and the A/D converter enters the stop status. When ADCE = 0,
inputting a hardware trigger is ignored and A/D conversion does not start.
Figure 11-29. Example of Hardware Trigger Wait Mode (Select Mode, One-Shot Conversion Mode) Operation
Timing
ADCE
<2> A hardware trigger <2> <5> A hardware trigger is <2> Trigger
generated during A/D <2> <2>
standby
Hardware is generated. conversion operation. status
trigger
Trigger ADCS is automatically
The trigger is not standby <7> ADCS is overwritten<4>
acknowledged. status cleared to 0 after
<4> <4> <4>
with 1 during A/D <8> ADCS is cleared
conversion operation. to 0 during A/D
conversion ends. conversion
ADCS <6> ADS is rewritten
during A/D conversion operation.
operation (from ANI0
to ANI1).
Data 1 Data 2
ADS (ANI0) (ANI1)
<3> A/D conversion Conversion is Conversion is Conversion is Conversion is
ends. interrupted <3> interrupted interrupted interrupted.
and restarts. and restarts.<3> and restarts. <3>
A/D
Data 1 Stop Data 1 Data 1 Stop Data 1 Data 2 Stop Data 2 Data 2 Stop Data 2
<R> conversion
status
Stop status
(ANI0) status (ANI0) (ANI0) status (ANI0) (ANI1) status (ANI1) (ANI1) status (ANI1)
Stop status
INTAD
11.6.11 Hardware trigger wait mode (scan mode, sequential conversion mode)
<R> <1> In the stop status, the ADCE bit of A/D converter mode register 0 (ADM0) is set to 1, and the system enters the
A/D conversion standby status.
<2> If a hardware trigger is input while in the hardware trigger standby status, A/D conversion is performed on the
four analog input channels specified by scan 0 to scan 3, which are specified by the analog input channel
specification register (ADS). The ADCS bit of the ADM0 register is automatically set to 1 according to the
hardware trigger input. A/D conversion is performed on the analog input channels in order, starting with that
specified by scan 0.
<3> A/D conversion is sequentially performed on the four analog input channels, the conversion results are stored in
the A/D conversion result register (ADCR, ADCRH) each time conversion ends, and the A/D conversion end
interrupt request signal (INTAD) is generated. After A/D conversion of the four channels ends, the A/D
conversion of the channel following the specified channel automatically starts.
<4> If a hardware trigger is input during conversion operation, the current A/D conversion is interrupted, and
conversion restarts at the first channel. The partially converted data is discarded.
<5> When the value of the ADS register is rewritten or overwritten during conversion operation, the current A/D
conversion is interrupted, and A/D conversion is performed on the first channel respecified by the ADS register.
The partially converted data is discarded.
<6> When ADCS is overwritten with 1 during conversion operation, the current A/D conversion is interrupted, and
conversion restarts. The partially converted data is discarded.
<7> When ADCS is cleared to 0 during conversion operation, the current A/D conversion is interrupted, the system
<R> enters the hardware trigger standby status, and the A/D converter enters the stop status. When ADCE = 0,
inputting a hardware trigger is ignored and A/D conversion does not start.
Figure 11-30. Example of Hardware Trigger Wait Mode (Scan Mode, Sequential Conversion Mode) Operation
Timing
ADCE
<4> A hardware trigger is
<2> A hardware trigger generated during A/D Trigger The trigger
is generated. standby is not
Hardware conversion operation.
trigger status acknowledged.
The trigger is not Trigger ADCS is overwritten <6> ADCS is cleared <7>
acknowledged. standby status with 1 during A/D to 0 during A/D
conversion operation. conversion operation.
ADCS
ADCR, Data 1 Data 2 Data 3 Data 4 Data 2 Data 3 Data 4 Data 1 Data 5 Data 6 Data 7 Data 8 Data 5 Data 6 Data 5 Data 6 Data 7 Data 8
Data 1 (ANI0)
ADCRH (ANI0) (ANI1) (ANI2) (ANI3) (ANI1) (ANI2) (ANI3) (ANI0) (ANI4) (ANI5) (ANI6) (ANI7) (ANI4) (ANI5) (ANI4) (ANI5) (ANI6) (ANI7)
INTAD
The interrupt is generated four times. The interrupt is generated four times. The interrupt is generated four times. The interrupt is generated four times.
11.6.12 Hardware trigger wait mode (scan mode, one-shot conversion mode)
<R> <1> In the stop status, the ADCE bit of A/D converter mode register 0 (ADM0) is set to 1, and the system enters the
A/D conversion standby status.
<2> If a hardware trigger is input while in the hardware trigger standby status, A/D conversion is performed on the
four analog input channels specified by scan 0 to scan 3, which are specified by the analog input channel
specification register (ADS). The ADCS bit of the ADM0 register is automatically set to 1 according to the
hardware trigger input. A/D conversion is performed on the analog input channels in order, starting with that
specified by scan 0.
<3> A/D conversion is sequentially performed on the four analog input channels, the conversion results are stored in
the A/D conversion result register (ADCR, ADCRH) each time conversion ends, and the A/D conversion end
interrupt request signal (INTAD) is generated.
<4> After A/D conversion ends, the ADCS bit is automatically cleared to 0, and the A/D converter enters the stop
status.
<5> If a hardware trigger is input during conversion operation, the current A/D conversion is interrupted, and
conversion restarts at the first channel. The partially converted data is discarded.
<6> When the value of the ADS register is rewritten or overwritten during conversion operation, the current A/D
conversion is interrupted, and A/D conversion is performed on the first channel respecified by the ADS register.
The partially converted data is discarded.
<7> When ADCS is overwritten with 1 during conversion operation, the current A/D conversion is interrupted, and
conversion restarts. The partially converted data is discarded.
<8> When ADCS is cleared to 0 during conversion operation, the current A/D conversion is interrupted, the system
<R> enters the hardware trigger standby status, and the A/D converter enters the stop status. When ADCE = 0,
inputting a hardware trigger is ignored and A/D conversion does not start.
Figure 11-31. Example of Hardware Trigger Wait Mode (Scan Mode, One-Shot Conversion Mode) Operation
Timing
INTAD
The interrupt is generated four times. The interrupt is generated four times. The interrupt is generated four times.
The A/D converter setup flowchart in each operation mode is described below.
Start of setup
PER0 register setting The ADCEN bit of the PER0 register is set (1), and supplying the clock starts.
• ADM0 register
FR2 to FR0, LV1, and LV0 bits: These are used to specify the A/D conversion time.
ADMD bit: Select mode/scan mode
• ADM1 register
ADTMD1 and ADTMD0 bits: These are used to specify the software trigger mode.
ADSCM bit: Sequential conversion mode/one-shot conversion mode
• ADM0 register setting
• ADM2 register
• ADM1 register setting
ADREFP1, ADREFP0, and ADREFM bits: These are used to select the reference
• ADM2 register setting
voltage source.
• ADUL/ADLL register setting
ADRCK bit: This is used to select the range for the A/D conversion result
• ADS register setting
comparison value generated by the interrupt signal from AREA1,
(The order of the settings is
AREA3, and AREA2.
irrelevant.)
ADTYP bit: 8-bit/10-bit resolution
• ADUL/ADLL register
These are used to specify the upper limit and lower limit A/D conversion result
comparison values.
• ADS register
ADS4 to ADS0 bits: These are used to select the analog input channels.
ADCE bit setting The ADCE bit of the ADM0 register is set (1), and the system enters the A/D
conversion standby status.
Stabilization wait time count (1 μs) The software counts up to the stabilization wait time (1 μs).
ADCS bit setting After counting up to the stabilization wait time ends, the ADCS bit of the ADM0
register is set (1), and A/D conversion starts.
End of A/D conversion The A/D conversion end interrupt (INTAD) is generated.
Note
Note Depending on the settings of the ADRCK bit and ADUL/ADLL register, there is a possibility of no interrupt signal
being generated. In this case, the results are not stored in the ADCR, ADCRH registers.
Start of setup
PER0 register setting The ADCEN bit of the PER0 register is set (1), and supplying the clock starts.
• ADM0 register
FR2 to FR0, LV1, and LV0 bits: These are used to specify the A/D conversion time.
ADMD bit: Select mode/scan mode
• ADM1 register
ADTMD1 and ADTMD0 bits: These are used to specify the hardware trigger no-wait
mode.
ADSCM bit: Sequential conversion mode/one-shot conversion mode
• ADM0 register setting
• ADM1 register setting • ADM2 register
• ADM2 register setting ADREFP1, ADREFP0, and ADREFM bits: These are used to select the reference
• ADUL/ADLL register setting voltage source.
• ADS register setting ADRCK bit: This is used to select the range for the A/D conversion result comparison
(The order of the settings is value generated by the interrupt signal from AREA1, AREA3, and
irrelevant.) AREA2.
ADTYP bit: 8-bit/10-bit resolution
• ADUL/ADLL register
These are used to specify the upper limit and lower limit A/D conversion result
comparison values.
• ADS register
ADS4 to ADS0 bits: These are used to select the analog input channels.
ADCE bit setting The ADCE bit of the ADM0 register is set (1), and the system enters the A/D conversion
standby status.
Stabilization wait time count (1 μs) The software counts up to the stabilization wait time (1 μs).
After counting up to the stabilization wait time ends, the ADCS bit of the ADM0 register
ADCS bit setting
is set (1), and the system enters the hardware trigger standby status.
Note Depending on the settings of the ADRCK bit and ADUL/ADLL register, there is a possibility of no interrupt signal
being generated. In this case, the results are not stored in the ADCR, ADCRH registers.
Start of setup
PER0 register setting The ADCEN bit of the PER0 register is set (1), and supplying the clock starts.
• ADM0 register
FR2 to FR0, LV1, and LV0 bits: These are used to specify the A/D conversion time.
ADMD bit: Select mode/scan mode
• ADM1 register
ADTMD1 and ADTMD0 bits: These are used to specify the hardware trigger wait mode.
ADSCM bit: Sequential conversion mode/one-shot conversion mode
ADTRS1 and ADTRS0 bits: These are used to select the hardware trigger signal.
• ADM0 register setting
• ADM1 register setting • ADM2 register
• ADM2 register setting ADREFP1, ADREFP0, and ADREFM bits: These are used to select the reference
• ADUL/ADLL register setting voltage source.
• ADS register setting ADRCK bit: This is used to select the range for the A/D conversion result comparison
(The order of the settings is value generated by the interrupt signal from AREA1, AREA3, and AREA2.
irrelevant.) AWC bit: This is used to set up the SNOOZE mode function.
ADTYP bit: 8-bit/10-bit resolution
• ADUL/ADLL register
These are used to specify the upper limit and lower limit A/D conversion result
comparison values.
• ADS register
ADS4 to ADS0 bits: These are used to select the analog input channels.
The ADCE bit of the ADM0 register is set (1), and the system enters the A/D conversion
ADCE bit setting
standby status.
Stabilization wait time count The system automatically counts up to the stabilization wait time.
Start of A/D conversion After counting up to the stabilization wait time ends, A/D conversion starts
End of A/D conversion The A/D conversion end interrupt (INTAD) is generated.
Note
Note Depending on the settings of the ADRCK bit and ADUL/ADLL register, there is a possibility of no interrupt signal
being generated. In this case, the results are not stored in the ADCR, ADCRH registers.
<R> 11.7.4 Setup when using temperature sensor (example for software trigger mode and one-shot conversion mode)
Start of setup
The ADCEN bit of the PER0 register is set (1), and supplying the clock
PER0 register setting
starts.
• ADM0 register
FR2 to FR0, LV1, and LV0 bits: These are used to specify the A/D
conversion time.
ADMD bit: This is used to specify the select mode.
• ADM1 register
ADTMD1 and ADTMD0 bits: These are used to specify the software
trigger mode.
ADSCM bit: Sequential conversion mode/one-shot conversion mode
• ADS register
ADISS and ADS4 to ADS0 bits: These are used to select temperature
sensor 0 output or internal reference
voltage output.
ADCE bit setting The ADCE bit of the ADM0 register is set (1), and the system enters the
A/D conversion standby status.
Stabilization wait time count (1 μs) The software counts up to the stabilization wait time (1 μs).
After counting up to the stabilization wait time ends, the ADCS bit of the
ADCS bit setting
ADM0 register is set (1), and the system enters the software trigger
standby status.
End of A/D conversion The A/D conversion end interrupt (INTAD) will be generated.
After ADISS is set (1), the initial conversion result cannot be used.
Stabilization wait time (5 μ s) This is the wait time from the time when ADISS is set (1) to the time
second conversion starts.
f
Note
End of A/D conversion The A/D conversion end interrupt (INTAD) is generated.
Note Depending on the settings of the ADRCK bit and ADUL/ADLL register, there is a possibility of no interrupt signal
being generated. In this case, the results are not stored in the ADCR, ADCRH registers.
Start of setup
PER0 register setting The ADCEN bit of the PER0 register is set (1), and supplying the clock starts.
• ADM0 register
FR2 to FR0, LV1, and LV0 bits: 11100B (set to fCLK/2, normal mode)
ADMD bit: This is used to specify the select mode.
• ADM1 register
ADTMD1 and ADTMD0 bits: These are used to specify the software trigger mode.
ADSCM bit: This is used to specify the one-shot conversion mode.
• ADM0 register setting • ADM2 register
• ADM1 register setting ADREFP1, ADREFP0, and ADREFM bits: These are used to select VDD and VSS for
• ADM2 register setting the reference voltage source.
• ADUL/ADLL register setting ADRCK bit: This is used to set the range for the A/D conversion result comparison
• ADS register setting value generated by the interrupt signal to AREA2.
• ADTES register setting ADTYP bit: This is used to specify 10-bit resolution.
(The order of the settings is • ADUL/ADLL register
irrelevant.) These set ADUL to FFH and ADLL to 00H (initial values).
• ADS register
ADS4 to ADS0 bits: These are used to set to ANI0.
• ADTES register
ADTES1, ADTES0 bits: AVREFM/AVREFP
The ADCE bit of the ADM0 register is set (1), and the system enters the A/D
ADCE bit setting
conversion standby status.
Stabilization wait time count (1 μs) The software counts up to the stabilization wait time (1 μs).
After counting up to the stabilization wait time ends, the ADCS bit of the ADM0 register
ADCS bit setting
is set (1), and A/D conversion starts.
End of A/D conversion The A/D conversion end interrupt (INTAD) is generated.
Note
Note Depending on the settings of the ADRCK bit and ADUL/ADLL register, there is a possibility of no interrupt signal
being generated. In this case, the results are not stored in the ADCR, ADCRH registers.
In the SNOOZE mode, A/D conversion is triggered by inputting a hardware trigger in the STOP mode. Normally, A/D
conversion is stopped while in the STOP mode, but, by using the SNOOZE mode, A/D conversion can be performed
without operating the CPU by inputting a hardware trigger. This is effective for reducing the operation current.
In the SNOOZE mode, only the following two conversion modes can be used:
• Hardware trigger wait mode (select mode, one-shot conversion mode)
• Hardware trigger wait mode (scan mode, one-shot conversion mode)
Note that the SNOOZE mode can only be specified when the high-speed on-chip oscillator clock is selected for fCLK.
When using the SNOOZE mode function, the initial setting of each register is specified before switching to the STOP
mode. (For details about these settings, see 11.7.3 Setting up hardware trigger wait modeNote 2.) At this time, bit 2
(AWC) of A/D converter mode register 2 (ADM2) is set to 1. After the initial settings are specified, bit 0 (ADCE) of A/D
converter mode register 0 (ADM0) is set to 1.
If a hardware trigger is input after switching to the STOP mode, the high-speed on-chip oscillator clock is supplied to
the A/D converter. After supplying this clock, the system automatically counts up to the stabilization wait time, and then
A/D conversion starts.
The SNOOZE mode operation after A/D conversion ends differs depending on whether an interrupt signal is
generatedNote 1.
Notes 1. Depending on the setting of the A/D conversion result comparison function (ADRCK bit, ADUL/ADLL
register), there is a possibility of no interrupt signal being generated.
2. Be sure to set the ADM1 register to E2H or E3H.
Figure 11-38. Operation Example When Interrupt Is Generated After A/D Conversion Ends (While in Scan Mode)
INTRTC
ADCS
Conversion
Channel 1 Channel 2 Channel 3 Channel 4
channels
Interrupt signal
(INTAD)
An interrupt is generated
when conversion on one
of the channels ends.
Figure 11-39. Operation Example When No Interrupt Is Generated After A/D Conversion Ends (While in Scan
Mode)
INTRTC
Conversion
Channel 1 Channel 2 Channel 3 Channel 4
channels
Interrupt signal
(INTAD)
(1) Resolution
This is the minimum analog input voltage that can be identified. That is, the percentage of the analog input voltage
per bit of digital output is called 1LSB (Least Significant Bit). The percentage of 1LSB with respect to the full scale is
expressed by %FSR (Full Scale Range).
1......1 1......1
Ideal line
Digital output
Digital output
Overall
error 1/2LSB Quantization error
1/2LSB
0......0 0......0
0 AVREF 0 AVREF
Analog input Analog input
111
Digital output (Lower 3 bits)
Full-scale error
Ideal line
110
010
000 000
0 1 2 3 AVREF 0 AVREF−3 AVREF−2 AVREF−1 AVREF
Analog input (LSB) Analog input (LSB)
Figure 11-44. Integral Linearity Error Figure 11-45. Differential Linearity Error
1......1
1......1
Ideal 1LSB width
Ideal line
Digital output
Digital output
Differential
Integral linearity linearity error
error
0......0 0......0
0 AVREF 0 AVREF
Analog input Analog input
Sampling
time
Conversion time
<1> Conflict between the A/D conversion result register (ADCR, ADCRH) write and the ADCR or ADCRH register
read by instruction upon the end of conversion
The ADCR or ADCRH register read has priority. After the read operation, the new conversion result is written to
the ADCR or ADCRH registers.
<2> Conflict between the ADCR or ADCRH register write and the A/D converter mode register 0 (ADM0) write, the
analog input channel specification register (ADS), or A/D port configuration register (ADPC) write upon the end
of conversion
The ADM0, ADS, or ADPC registers write has priority. The ADCR or ADCRH register write is not performed,
nor is the conversion end interrupt signal (INTAD) generated.
Reference
voltage AVREFP or VDD
input
C = 100 to 1,000 pF
<1> The analog input pins (ANI0 to ANI14, ANI16 to ANI26) are also used as input port pins (P20 to P27, P00 to
P03, P35 to P37, P100, P115 to P117, P147, P120, P150 to P156).
When A/D conversion is performed with any of the ANI0 to ANI14 and ANI16 to ANI26 pins selected, do not
access P20 to P27, P00 to P03, P35 to P37, P100, P115 to P117, P147, P120, P150 to P156 while conversion
is in progress; otherwise the conversion resolution may be degraded.
<2> If a digital pulse is applied to the pins adjacent to the pins currently used for A/D conversion, the expected value
of the A/D conversion may not be obtained due to coupling noise. Therefore, do not apply a pulse to the pins
adjacent to the pin undergoing A/D conversion.
ADIF
R1
ANIn
C1 C2
<R> Table 11-6. Resistance and Capacitance Values of Equivalent Circuit (Reference Values)
Remark The resistance and capacitance values shown in Table 11-6 are not guaranteed values.
Serial array unit 0 has four serial channels, and serial array unit 1 has two. Each channel can achieve 3-wire serial
(CSI), UART, and simplified I2C communication.
Function assignment of each channel supported by the RL78/G13 is as shown below.
1 0 − − −
1 − −
• 64-pin products
2
Unit Channel Used as CSI Used as UART Used as Simplified I C
When “UART0” is used for channels 0 and 1 of the unit 0, CSI00 and CSI01 cannot be used, but CSI10, UART1, or
IIC10 can be used.
<R> Caution Most of the following descriptions in this chapter use the units and channels of the 128-pin products
as an example.
Each serial interface supported by the RL78/G13 has the following features.
12.1.1 3-wire serial I/O (CSI00, CSI01, CSI10, CSI11, CSI20, CSI21, CSI30, CSI31)
Data is transmitted or received in synchronization with the serial clock (SCK) output from the master channel.
3-wire serial communication is clocked communication performed by using three communication lines: one for the serial
clock (SCK), one for transmitting serial data (SO), one for receiving serial data (SI).
For details about the settings, see 12.5 Operation of 3-Wire Serial I/O (CSI00, CSI01, CSI10, CSI11, CSI20, CSI21,
CSI30, CSI31) Communication.
[Data transmission/reception]
• Data length of 7 or 8 bits
• Phase control of transmit/receive data
• MSB/LSB first selectable
• Level setting of transmit/receive data
[Clock control]
• Master/slave selection
• Phase control of I/O clock
• Setting of transfer period by prescaler and internal counter of each channel
• Maximum transfer rate
During master communication (CSI00): Max. fCLK/2 Note
Note
During master communication (other than CSI00): Max. fCLK/4
During slave communication: Max. fMCK/6 Note
[Interrupt function]
• Transfer end interrupt/buffer empty interrupt
[Error detection flag]
• Overrun error
In addition, CSIs of following channels supports the SNOOZE mode. When SCK input is detected while in the STOP
mode, the SNOOZE mode makes data reception that does not require the CPU possible. Only following CSIs can be
specified for asynchronous reception.
<R> • 20 to 64-pin products: CSI00
• 80, 100, 128-pin products: CSI00 and CSI20
Note Use the clocks within a range satisfying the SCK cycle time (tKCY) characteristics (see CHAPTER 29
ELECTRICAL SPECIFICATIONS.
[Data transmission/reception]
• Data length of 7, 8, or 9 bits
• Select the MSB/LSB first
• Level setting of transmit/receive data and select of reverse
• Parity bit appending and parity check functions
• Stop bit appending
[Interrupt function]
• Transfer end interrupt/buffer empty interrupt
• Error interrupt in case of framing error, parity error, or overrun error
[Error detection flag]
• Framing error, parity error, or overrun error
In addition, UARTs of following channels supports the SNOOZE mode. When RxD input is detected while in the STOP
mode, the SNOOZE mode makes data reception that does not require the CPU possible. Only following UARTs can be
specified for asynchronous reception.
<R> • 20 to 64-pin products: UART0 only
• 80, 100, 128-pin products: UART0 and UART2 only
The LIN-bus is accepted in UART2 (0 and 1 channels of unit 1) (30, 32, 36, 40, 44, 48, 52, 64, 80, 100, and 128-pin
products only).
[LIN-bus functions]
• Wakeup signal detection
Using the external interrupt (INTP0) and
• Sync break field (SBF) detection
timer array unit
• Sync field measurement, baud rate calculation
2
12.1.3 Simplified I C (IIC00, IIC01, IIC10, IIC11, IIC20, IIC21, IIC30, IIC31)
This is a clocked communication function to communicate with two or more devices by using two lines: serial clock
(SCL) and serial data (SDA). This simplified I2C is designed for single communication with a device such as EEPROM,
flash memory, or A/D converter, and therefore, it functions only as a master.
Make sure by using software, as well as operating the control registers, that the AC specifications of the start and stop
conditions are observed.
For details about the settings, see 12.8 Operation of Simplified I2C (IIC00, IIC01, IIC10, IIC11, IIC20, IIC21, IIC30,
IIC31)
[Data transmission/reception]
• Master transmission, master reception (only master function with a single master)
• ACK output functionNote and ACK detection function
• Data length of 8 bits (When an address is transmitted, the address is specified by the higher 7 bits, and the least
significant bit is used for R/W control.)
• Manual generation of start condition and stop condition
[Interrupt function]
• Transfer end interrupt
[Error detection flag]
<R> • Parity error (ACK error), or overrun error
Note When receiving the last data, ACK will not be output if 0 is written to the SOEmn bit (serial output enable register
m (SOEm)) and serial communication data output is stopped. See the processing flow in 12.8.3 (2) for details.
Remark To use an I2C bus of full function, see CHAPTER 13 SERIAL INTERFACE IICA.
Item Configuration
Note 1
Shift register 8 bits or 9 bits
Notes 1, 2
Buffer register Lower 8 bits or 9 bits of serial data register mn (SDRmn)
Serial clock I/O SCK00, SCK01, SCK10, SCK11, SCK20, SCK21, SCK30, SCK31 pins (for 3-wire serial I/O),
2
SCL00, SCL01, SCL10, SCL11, SCL20, SCL21, SCL30, SCL31 pins (for simplified I C)
Serial data input SI00, SI01, SI10, SI11, SI20, SI21, SI30, SI31 pins (for 3-wire serial I/O), RXD0, RxD1, RxD3
pins (for UART), RXD2 pin (for UART supporting LIN-bus)
Serial data output SO00, SO01, SO10, SO11, SO20, SO21, SO30, SO31 pins (for 3-wire serial I/O), TXD0, TxD1,
TxD3 pins (for UART), TXD2 pin (for UART supporting LIN-bus), output controller
2
Serial data I/O SDA00, SDA01, SDA10, SDA11, SDA20, SDA21, SDA30, SDA31 pins (for simplified I C)
<R> Notes 1. The number of bits used as the shift register and buffer register differs depending on the unit and channel.
• 20 to 64-pin products and mn = 00, 01: lower 9 bits
• 80, 100, 128-pin products and mn = 00, 01, 10, 11: lower 9 bits
• Other than above: lower 8 bits
2. The lower 8 bits of serial data register mn (SDRmn) can be read or written as the following SFR, depending
on the communication mode.
• CSIp communication … SIOp (CSIp data register)
• UARTq reception … RXDq (UARTq receive data register)
• UARTq transmission … TXDq (UARTq transmit data register)
• IICr communication … SIOr (IICr data register)
Remark m: Unit number (m = 0, 1), n: Channel number (n = 0 to 3), p: CSI number (p = 00, 01, 10, 11, 20, 21, 30, 31),
q: UART number (q = 0 to 3), r: IIC number (r = 00, 01, 10, 11, 20, 21, 30, 31)
Figure 12-1 shows the block diagram of the serial array unit 0.
0 0 0 0 CKO03 CKO02 CKO01 CKO00 0 0 0 0 SO03 SO02 SO01 SO00 SNFEN SNFEN
10 00
Peripheral enable Serial channel
register 0 (PER0) Serial clock select register 0 (SPS0) Serial standby
SE03 SE02 SE01 SE00 enable status
register 0 (SE0) control register 0
PRS PRS PRS PRS PRS PRS PRS PRS (SSC0)
SAU0EN
013 012 011 010 003 002 001 000 Serial channel
SS03 SS02 SS01 SS00 start register 0 SSEC0 SWC0
(SS0)
4 4 Serial channel
ST03 ST02 ST01 ST00 stop register 0
(ST0)
Serial output
SOE03 SOE02 SOE01 SOE00 enable register 0
fCLK Prescaler (SOE0)
Selector Selector
TXE RXE DAP CKP EOC PTC PTC DIR SLC SLC DLS DLS TSF BFF PEF OVF
00 00 00 00 00 001 000 00 001 000 001 000 00 00 00 00
When UART0
Serial communication operation setting register 00 (SCR00) Serial status register 00 (SSR00)
CK01 CK00
Serial data output pin
(when CSI01: SO01)
Channel 1 (when IIC01: SDA01)
Serial clock I/O pin Communication controller
(when CSI01: SCK01) Serial transfer end interrupt
(when IIC01: SCL01) Mode selection (when CSI01: INTCSI01)
CSI01 or IIC01 (when IIC01: INTIIC01)
or UART0 (when UART0: INTSR0)
Selector Edge/level
Serial data input pin Synchro- (for reception) Error controller
nous detection Serial transfer error interrupt
(when CSI01: SI01) circuit (INTSRE0)
(when IIC01: SDA01)
CK01 CK00
Serial data output pin
(when CSI10: SO10)
Serial clock I/O pin Channel 2 (when IIC10: SDA10)
(when CSI10: SCK10) Communication controller (when UART1: TXD1)
(when IIC10: SCL10)
Synchro- Noise Mode selection
Serial data input pin nous elimination Edge/level Serial transfer end interrupt
(when CSI10: SI10) circuit enabled/
detection CSI10 or IIC10 (when CSI10: INTCSI10)
disabled
(when IIC10: SDA10) or UART1 (when IIC10: INTIIC10)
(when UART1: RXD1) (for transmission) (when UART1: INTST1)
SNFEN10
Figure 12-2 shows the block diagram of the serial array unit 1.
Selector Selector
fTCLK
(when UART2: TxD2)
Shift register
Output
Serial clock I/O pin Synchro-
Edge fSCK controller
nous
(when CSI20: SCK20) circuit detection
(when IIC20: SCL20)
circuit
(when IIC20: SDA20) disabled
TXE RXE DAP CKP EOC PTC PTC DIR SLC SLC DLS DLS TSF BFF PEF OVF
10 10 10 10 10 101 100 10 101 100 101 100 10 10 10 10
When UART2 Serial communication operation setting register 10 (SCR10) Serial status register 10 (SSR10)
CK11 CK10
Serial data output pin
(when CSI30: SO30)
Serial clock I/O pin Channel 2 (when IIC30: SDA30)
(when CSI10: SCK30) Communication controller (when UART3: TXD3)
(when IIC10: SCL30)
Synchro- Noise Mode selection
Serial data input pin nous elimination Edge/level Serial transfer end interrupt
(when CSI10: SI30) circuit enabled/
detection CSI30 or IIC30 (when CSI30: INTCSI30)
disabled
(when IIC10: SDA30) or UART3 (when IIC30: INTIIC30)
(when UART1: RXD3) (for transmission) (when UART3: INTST3)
SNFEN30
8 7 6 5 4 3 2 1 0
Shift register
<R> Notes 1. Only following UARTs can be specified for the 9-bit data length.
• 20 to 64-pin products: UART0
• 80, 100, 128-pin products: UART0, UART2
2. Writing in 8-bit units is prohibited when the operation is stopped (SEmn = 0).
Remarks 1. After data is received, “0” is stored in bits 0 to 8 in bit portions that exceed the data length.
2. m: Unit number (m = 0, 1), n: Channel number (n = 0 to 3), p: CSI number (p = 00, 01, 10, 11, 20, 21,
30, 31), q: UART number (q = 0 to 3), r: IIC number (r = 00, 01, 10, 11, 20, 21, 30, 31)
Figure 12-3. Format of Serial Data Register mn (SDRmn) (mn = 00, 01, 10, 11)
Address: FFF10H, FFF11H (SDR00), FFF12H, FFF13H (SDR01) After reset: 0000H R/W
Note Note
FFF48H, FFF49H (SDR10) , FFF4AH, FFF4BH (SDR11)
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
SDRmn
8 7 6 5 4 3 2 1 0
Shift register
Remark For the function of the higher 7 bits of the SDRmn register, see 12.3 Registers Controlling Serial
Array Unit.
Figure 12-4. Format of Serial Data Register mn (SDRmn) (mn = 02, 03, 10, 11, 12, 13)
Address: FFF44H, FFF45H (SDR02), FFF46H, FFF47H (SDR03), After reset: 0000H R/W
Note Note
FFF48H, FFF49H (SDR10) , FFF4AH, FFF4BH (SDR11)
FFF14H, FFF15H (SDR12), FFF16H, FFF17H (SDR13)
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
SDRmn 0
8 7 6 5 4 3 2 1 0
Shift register
Remark For the function of the higher 7 bits of the SDRmn register, see 12.3 Registers Controlling Serial
Array Unit.
Cautions 1. When setting serial array unit m, be sure to set the SAUmEN bit to 1 first. If SAUmEN = 0,
writing to a control register of serial array unit m is ignored, and, even if the register is read,
only the default value is read (except for the input switch control register (ISC), noise filter
<R> enable register 0 (NFEN0), port input mode registers 0, 1, 4, 5, 8, 14 (PIM0, PIM1, PIM4, PIM5,
PIM8, PIM14), port output mode registers 0, 1, 4, 5, 7 to 9, 14 (POM0, POM1, POM4, POM5,
POM7 to POM9, POM14), port mode registers 0, 1, 3 to 5, 7 to 9, 14 (PM0, PM1, PM3 to PM5,
PM7 to PM9, PM14), and port registers 0, 1, 3 to 5, 7 to 9, 14 (P0, P1, P3 to P5, P7 to P9, P14)).
2. Be sure to clear the following bits to 0.
20-pin products: bits 1, 3, 4, 6
24, 25-pin products: bits 1, 3, 6
30, 32, 36, 40, 44, 48, 52, 64-pin products: bits 1, 6
Address: F0126H, F0127H (SPS0), F0166H, F0167H (SPS1) After reset: 0000H R/W
Symbol 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Note 1
PRS PRS PRS PRS Section of operation clock (CKmk)
mk3 mk2 mk1 mk0 fCLK = 2 MHz fCLK = 5 MHz fCLK = 10 MHz fCLK = 20 MHz fCLK = 32 MHz
Note When changing the clock selected for fCLK (by changing the system clock control register (CKC) value), do
so after having stopped (serial channel stop register m (STm) = 000FH) the operation of the serial array
unit (SAU).
Address: F0110H, F0111H (SMR00) to F0116H, F0117H (SMR03), After reset: 0020H R/W
F0150H, F0151H (SMR10) to F0156H, F0157H (SMR13)
Symbol 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Operation clock (fMCK) is used by the edge detector. In addition, depending on the setting of the CCSmn bit and the
higher 7 bits of the SDRmn register, a transfer clock (fTCLK) is generated.
Transfer clock fTCLK is used for the shift register, communication controller, output controller, interrupt controller, and
error controller. When CCSmn = 0, the division ratio of operation clock (fMCK) is set by the higher 7 bits of the
SDRmn register.
Caution Be sure to clear bits 13 to 9, 7, 4, and 3 (or bits 13 to 6, 4, and 3 for the SMR00, SMR02, SMR10, or
SMR12 register) to “0”. Be sure to set bit 5 to “1”.
Remark m: Unit number (m = 0, 1), n: Channel number (n = 0 to 3), p: CSI number (p = 00, 01, 10, 11, 20, 21, 30,
31), q: UART number (q = 0 to 3), r: IIC number (r = 00, 01, 10, 11, 20, 21, 30, 31)
Address: F0110H, F0111H (SMR00) to F0116H, F0117H (SMR03), After reset: 0020H R/W
F0150H, F0151H (SMR10) to F0156H, F0157H (SMR13)
Symbol 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
0 0 CSI mode
0 1 UART mode
2
1 0 Simplified I C mode
1 1 Setting prohibited
Caution Be sure to clear bits 13 to 9, 7, 4, and 3 (or bits 13 to 6, 4, and 3 for the SMR00, SMR02, SMR10, or
SMR12 register) to “0”. Be sure to set bit 5 to “1”.
Remark m: Unit number (m = 0, 1), n: Channel number (n = 0 to 3), p: CSI number (p = 00, 01, 10, 11, 20, 21, 30,
31), q: UART number (q = 0 to 3), r: IIC number (r = 00, 01, 10, 11, 20, 21, 30, 31)
Figure 12-8. Format of Serial Communication Operation Setting Register mn (SCRmn) (1/2)
Address: F0118H, F0119H (SCR00) to F011EH, F011FH (SCR03), After reset: 0087H R/W
F0158H, F0159H (SCR10) to F015EH, F015FH (SCR13)
Symbol 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
SCRmn TXE RXE DAP CKP 0 EOC PTC PTC DIR 0 SLCm SLC 0 1 DLSm DLS
Note 1 Note 2
mn mn mn mn mn mn1 mn0 mn n1 mn0 n1 mn0
0 0 Disable communication.
0 1 Reception only
1 0 Transmission only
1 1 Transmission/reception
DAP CKP Selection of data and clock phase in CSI mode Type
mn mn
0 0 SCKp 1
SOp D7 D6 D5 D4 D3 D2 D1 D0
SIp input timing
0 1 SCKp 2
SOp D7 D6 D5 D4 D3 D2 D1 D0
SIp input timing
1 0 SCKp 3
SOp D7 D6 D5 D4 D3 D2 D1 D0
SIp input timing
1 1 SCKp 4
SOp D7 D6 D5 D4 D3 D2 D1 D0
SIp input timing
2
Be sure to set DAPmn, CKPmn = 0, 0 in the UART mode and simplified I C mode.
<R> Caution Be sure to clear bits 3, 6, and 11 to “0”. (Also clear bit 5 of the SCR01, SCR03, SCR11, or SCR13
register to 0, as well as bit 1 of the SCR02, SCR03, SCR12, SCR13 registers, and SCR10, or
SCR11 registers for 20 to 64-pin products.). Be sure to set bit 2 to “1”.
Remark m: Unit number (m = 0, 1), n: Channel number (n = 0 to 3), p: CSI number (p = 00, 01, 10, 11, 20, 21, 30,
31)
Figure 12-8. Format of Serial Communication Operation Setting Register mn (SCRmn) (2/2)
Address: F0118H, F0119H (SCR00) to F011EH, F011FH (SCR03), After reset: 0087H R/W
F0158H, F0159H (SCR10) to F015EH, F015FH (SCR13)
Symbol 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
SCRmn TXE RXE DAP CKP 0 EOC PTC PTC DIR 0 SLCm SLC 0 1 DLSm DLS
Note 1 Note 2
mn mn mn mn mn mn1 mn0 mn n1 mn0 n1 mn0
0 0 No stop bit
0 1 Stop bit length = 1 bit
1 0 Stop bit length = 2 bits (mn = 00, 02, 10, 12 only)
1 1 Setting prohibited
When the transfer end interrupt is selected, the interrupt is generated when all stop bits have been completely
transferred.
2
Set 1 bit (SLCmn1, SLCmn0 = 0, 1) during UART reception and in the simplified I C mode.
Set no stop bit (SLCmn1, SLCmn0 = 0, 0) in the CSI mode.
0 1 9-bit data length (stored in bits 0 to 8 of the SDRmn register) (settable in UART mode only)
1 0 7-bit data length (stored in bits 0 to 6 of the SDRmn register)
1 1 8-bit data length (stored in bits 0 to 7 of the SDRmn register)
Other than above Setting prohibited
2
Be sure to set DLSmn1, DLSmn0 = 1, 1 in the simplified I C mode.
<R> Caution Be sure to clear bits 3, 6, and 11 to “0”. (Also clear bit 5 of the SCR01, SCR03, SCR11, or SCR13
register to 0, as well as bit 1 of the SCR02, SCR03, SCR12, SCR13 registers, and SCR10, or
SCR11 registers for 20 to 64-pin products.). Be sure to set bit 2 to “1”.
Remark m: Unit number (m = 0, 1), n: Channel number (n = 0 to 3), p: CSI number (p = 00, 01, 10, 11, 20, 21, 30, 31)
R01UH0146EJ0100 Rev.1.00 552
Sep 22, 2011
RL78/G13 CHAPTER 12 SERIAL ARRAY UNIT
Address: FFF10H, FFF11H (SDR00), FFF12H, FFF13H (SDR01) After reset: 0000H R/W
Note 1 Note 1
FFF48H, FFF49H (SDR10) , FFF4AH, FFF4BH (SDR11)
Symbol 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
SDRmn 0
Address: FFF44H, FFF45H (SDR02), FFF46H, FFF47H (SDR03), After reset: 0000H R/W
Note 2 Note 2
FFF48H, FFF49H (SDR10) , FFF4AH, FFF4BH (SDR11)
FFF14H, FFF15H (SDR12), FFF16H, FFF17H (SDR13)
Symbol 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
SDRmn 0
0 0 0 0 0 0 0 fMCK/2
0 0 0 0 0 0 1 fMCK/4
0 0 0 0 0 1 0 fMCK/6
0 0 0 0 0 1 1 fMCK/8
• • • • • • • •
• • • • • • • •
• • • • • • • •
1 1 1 1 1 1 0 fMCK/254
1 1 1 1 1 1 1 fMCK/256
Cautions 1. Be sure to clear bit 8 of the SDR02, SDR03, SDR12, SDR13, and SDR10, and SDR11 of 20 to 64-
pin products to “0”.
2. Setting SDRmn[15:9] = (0000000B, 0000001B) is prohibited when UART is used.
3. Setting SDRmn[15:9] = 0000000B is prohibited when simplified I2C is used. Set SDRmn[15:9]
to 0000001B or greater.
4. Do not write eight bits to the lower eight bits if operation is stopped (SEmn = 0). (If these bits
are written to, the higher seven bits are cleared to 0.)
Remarks 1. For the function of the lower 8/9 bits of the SDRmn register, see 12.2 Configuration of Serial Array Unit.
2. m: Unit number (m = 0, 1), n: Channel number (n = 0 to 3)
Address: F0108H, F0109H (SIR00) to F010EH, F010FH (SIR03), After reset: 0000H R/W
F0148H, F0149H (SIR10) to F014EH, F014FH (SIR13)
Symbol 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
0 Not cleared
1 Clears the FEFmn bit of the SSRmn register to 0.
0 Not cleared
1 Clears the PEFmn bit of the SSRmn register to 0.
0 Not cleared
1 Clears the OVFmn bit of the SSRmn register to 0.
Caution Be sure to clear bits 15 to 3 (or bits 15 to 2 for the SIR00, SIR02, SIR10, or SIR12 register) to “0”.
Address: F0100H, F0101H (SSR00) to F0106H, F0107H (SSR03), After reset: 0000H R
F0140H, F0141H (SSR10) to F0146H, F0147H (SSR13)
Symbol 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
<Clear conditions>
• The STmn bit of the STm register is set to 1 (communication is stopped) or the SSmn bit of the SSm register is
set to 1 (communication is suspended).
• Communication ends.
<Set condition>
• Communication starts.
<Clear conditions>
• Transferring transmit data from the SDRmn register to the shift register ends during transmission.
• Reading receive data from the SDRmn register ends during reception.
• The STmn bit of the STm register is set to 1 (communication is stopped) or the SSmn bit of the SSm register is set
to 1 (communication is enabled).
<Set conditions>
• Transmit data is written to the SDRmn register while the TXEmn bit of the SCRmn register is set to 1
(transmission or transmission and reception mode in each communication mode).
• Receive data is stored in the SDRmn register while the RXEmn bit of the SCRmn register is set to 1 (reception or
transmission and reception mode in each communication mode).
• A reception error occurs.
Caution If data is written to the SDRmn register when BFFmn = 1, the transmit/receive data stored in the
register is discarded and an overrun error (OVEmn = 1) is detected.
Address: F0100H, F0101H (SSR00) to F0106H, F0107H (SSR03), After reset: 0000H R
F0140H, F0141H (SSR10) to F0146H, F0147H (SSR13)
Symbol 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
0 No error occurs.
1 An error occurs (during UART reception).
<Clear condition>
• 1 is written to the FECTmn bit of the SIRmn register.
<Set condition>
• A stop bit is not detected when UART reception ends.
0 No error occurs.
2
1 An error occurs (during UART reception) or ACK is not detected (during I C transmission).
<Clear condition>
• 1 is written to the PECTmn bit of the SIRmn register.
<Set condition>
• The parity of the transmit data and the parity bit do not match when UART reception ends (parity error).
• No ACK signal is returned from the slave channel at the ACK reception timing during I C transmission (ACK is
2
not detected).
0 No error occurs.
1 An error occurs
<Clear condition>
• 1 is written to the OVCTmn bit of the SIRmn register.
<Set condition>
• Even though receive data is stored in the SDRmn register, that data is not read and transmit data or the next
receive data is written while the RXEmn bit of the SCRmn register is set to 1 (reception or transmission and
reception mode in each communication mode).
• Transmit data is not ready for slave transmission or transmission and reception in CSI mode.
0 No trigger operation
Note
1 Sets the SEmn bit to 1 and enters the communication wait status .
Cautions 1. Be sure to clear bits 15 to 4 of the SS0 register and bits 15 to 4 of the SS1 register to “0”.
<R> 2. For the UART reception, set the RXEmn bit of SCRmn register to 1, and then be sure to set
SSmn to 1 after 4 or more fCLK clocks have elapsed.
0 No trigger operation
Note
1 Clears the SEmn bit to 0 and stops the communication operation .
Note Communication stops while holding the value of the control register and shift register, and the status of the
serial clock I/O pin, serial data output pin, and each error flag (FEFmn: framing error flag, PEFmn: parity
error flag, OVFmn: overrun error flag).
Caution Be sure to clear bits 15 to 4 of the ST0 register and bits 15 to 4 of the ST1 register to “0”.
0 Operation stops
1 Operation is enabled.
Caution Be sure to clear bits 15 to 4 of the SOE0 register, and bits 15 to 4 of the SOE1 register to “0”.
SOL Selects inversion of the level of the transmit data of channel n in UART mode
mn
Caution Be sure to clear bits 15 to 3, and 1 of the SOL0 register and bits 15 to 3, and 1 of the SOL1
register to “0”.
<R> Note The SSC1 register is provided in the 80, 100, 128-pin products only.
SSCm 0 0 0 0 0 0 0 0 0 0 0 0 0 0 SS SWC
ECm m
SW Selection of whether to enable or stop the startup of CSI00/CSI20 or UART0/UART2 reception while in the
Cm STOP mode
0 30, 32, 36, 40, 44, 48, 52, 64, 80, 100, and 128-pin products:
Uses the input signal of the TI07 pin as a timer input (normal operation).
20, 24, and 25-pin products:
Do not use a timer input signal for channel 7.
1 Input signal of the RXD2 pin is used as timer input (detects the wakeup signal and measures the low
width of the sync break field and the pulse width of the sync field).
Setting is prohibited in the 20, 24, and 25-pin products.
0 Uses the input signal of the INTP0 pin as an external interrupt (normal operation).
1 Uses the input signal of the RXD2 pin as an external interrupt (wakeup signal detection).
Note For details, see 6.5.1 (2) When valid edge of input signal input from the TI0n pin is selected (CCS0n
= 1) and 6.5.2 Start timing of counter.
(17) Port input mode registers 0, 1, 4, 5, 8, 14 (PIM0, PIM1, PIM4, PIM5, PIM8, PIM14)
These registers set the input buffer of ports 0, 1, 4, 5, 8, and 14 in 1-bit units.
The PIM0, PIM1, PIM4, PIM5, PIM8, and PIM14 registers can be set by a 1-bit or 8-bit memory manipulation
instruction.
Reset signal generation clears the PIM0, PIM1, PIM4, PIM5, PIM8 and PIM14 registers to 00H.
Figure 12-21. Format of Port Input Mode Registers 0, 1, 4, 5, 8 and 14 (PIM0, PIM1, PIM4, PIM5, PIM8, PIM14)
(18) Port output mode registers 0, 1, 4, 5, 7 to 9, 14 (POM0, POM1, POM4, POM5, POM7 to POM9, POM14)
These registers set the output mode of ports 0, 1, 4, 5, 7 to 9, and 14 in 1-bit units.
The POM0, POM1, POM4, POM5, POM7 to POM9, and POM14 registers can be set by a 1-bit or 8-bit memory
manipulation instruction.
Reset signal generation clears the POM0, POM1, POM4, POM5, POM7 to POM9, and POM14 registers to 00H.
Figure 12-22. Format of Port Output Mode Registers 0, 1, 4, 5, 7 to 9, and 14 (POM0, POM1, POM4, POM5,
POM7 to POM9, POM14) (128-pin products)
POM9 0 POM 96 0 0 0 0 0 0
(19) Port mode registers 0, 1, 3 to 5, 7 to 9, and 14 (PM0, PM1, PM3 to PM5, PM7 to PM9, and PM14)
These registers set input/output of ports 0, 1, 3 to 5, 7 to 9, and 14 in 1-bit units.
When using the ports (such as P02/ANI17/SO10/TXD1, P04/SCK10/SCL10) to be shared with the serial data
output pin or serial clock output pin for serial data output or serial clock output, set the port mode register (PMxx)
bit corresponding to each port to 0. And set the port register (Pxx) bit corresponding to each port to 1
When using the ports (such as P04/SCK10/SCL10, P50/INTP1/SI11/SDA11) to be shared with the serial data
input pin or serial clock input pin for serial data input or serial clock input, set the port mode register (PMxx) bit
corresponding to each port to 1. At this time, the port register (Pxx) bit may be 0 or 1.
The PM0, PM1, PM3 to PM5, PM7 to PM9, and PM14 registers can be set by a 1-bit or 8-bit memory manipulation
instruction.
Reset signal generation sets the PM0, PM1, PM3 to PM5, PM7 to PM9, and PM14 registers to FFH.
Figure 12-23. Format of Port Mode Registers 0, 1, 3 to 5, 7 to 9, and 14 (PM0, PM1, PM3 to PM5, PM7 to PM9,
and 14)
Each serial interface of serial array unit has the operation stop mode.
In this mode, serial communication cannot be executed, thus reducing the power consumption.
In addition, the pin for serial interface can be used as port function pins in this mode.
Figure 12-24. Peripheral Enable Register 0 (PER0) Setting When Stopping the Operation by Units
(a) Peripheral enable register 0 (PER0) … Set only the bit of SAUm to be stopped to 0.
7 6 5 4 3 2 1 0
× × × × 0/1 0/1 × ×
Control of SAUm input clock
0: Stops supply of input clock
1: Supplies input clock
Cautions 1. If SAUmEN = 0, writing to a control register of serial array unit m is ignored, and, even if the
register is read, only the default value is read
Note that this does not apply to the following registers.
• Input switch control register (ISC)
• Noise filter enable register 0 (NFEN0)
• Serial standby control register 0 (SSC0)
• Port input mode registers 0, 1, 4, 5, 8, 14 (PIM0, PIM1, PIM4, PIM5, PIM8, PIM14)
• Port output mode registers 0, 1, 4, 5, 7 to 9, 14 (POM0, POM1, POM4, POM5, POM7 to POM9,
POM14)
• Port mode registers 0, 1, 3 to 5, 7 to 9, 14 (PM0, PM1, PM3 to PM5, PM7 to PM9, PM14)
• Port registers 0, 1, 3 to 5, 7 to 9, 14 (P0, P1, P3 to P5, P7 to P9, P14)
2. Be sure to clear the following bits to 0.
20-pin products: bits 1, 3, 4, 6
24, 25-pin products: bits 1, 3, 6
30, 32, 36, 40, 44, 48, 52, 64-pin products: bits 1, 6
Remark ×: Bits not used with serial array units (depending on the settings of other peripheral functions)
0/1: Set to 0 or 1 depending on the usage of the user
Figure 12-25. Each Register Setting When Stopping the Operation by Channels
(a) Serial channel stop register m (STm) … This register is a trigger register that is used to enable
stopping communication/count by each channel.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
* Because the STmn bit is a trigger bit, it is cleared immediately when SEmn = 0.
(b) Serial Channel Enable Status Register m (SEm) … This register indicates whether data
transmission/reception operation of each channel is enabled or stopped.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
SEm SEm3
Note
SEm2
Note
SEm1 SEm0
0 0 0 0 0 0 0 0 0 0 0 0 0/1 0/1 0/1 0/1
0: Operation stops
* The SEm register is a read-only status register, whose operation is stopped by using the STm register.
With a channel whose operation is stopped, the value of the CKOmn bit of the SOm register can be set by
software.
(c) Serial output enable register m (SOEm) … This register is a register that is used to enable or stop
output of the serial communication operation of each channel.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
SOEm3 SOEm2
SOEm Note Note SOEm1 SOEm0
0 0 0 0 0 0 0 0 0 0 0 0 0/1 0/1 0/1 0/1
0: Stops output by serial communication operation
* For channel n, whose serial output is stopped, the SOmn bit value of the SOm register can be set by software.
(d) Serial output register m (SOm) …This register is a buffer register for serial output of each channel.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
CKOm3 CKOm2 SOm3 SOm2
SOm Note Note CKOm1 CKOm0 Note Note SOm1 SOm0
0 0 0 0 0/1 0/1 0/1 0/1 0 0 0 0 0/1 0/1 0/1 0/1
1: Serial clock output value is “1” 1: Serial data output value is “1”
* When using pins corresponding to each channel as port function pins, set the corresponding CKOmn, SOmn bits to “1”.
12.5 Operation of 3-Wire Serial I/O (CSI00, CSI01, CSI10, CSI11, CSI20, CSI21, CSI30, CSI31)
Communication
This is a clocked communication function that uses three lines: serial clock (SCK) and serial data (SI and SO) lines.
[Data transmission/reception]
• Data length of 7 or 8 bits
• Phase control of transmit/receive data
• MSB/LSB first selectable
• Level setting of transmit/receive data
[Clock control]
• Master/slave selection
• Phase control of I/O clock
• Setting of transfer period by prescaler and internal counter of each channel
• Maximum transfer rate
During master communication (CSI00): Max. fCLK/2 Note
During master communication (other than CSI00): Max. fCLK/4 Note
During slave communication: Max. fMCK/6 Note
[Interrupt function]
• Transfer end interrupt/buffer empty interrupt
[Error detection flag]
• Overrun error
In addition, CSIs of following channels supports the SNOOZE mode. When SCK input is detected while in the STOP
mode, the SNOOZE mode makes data reception that does not require the CPU possible. Only following CSIs can be
specified for asynchronous reception.
<R> • 24 to 64-pin products: CSI00 only
• 80, 100, 128-pin products: CSI00 and CSI20 only
Note Use the clocks within a range satisfying the SCK cycle time (tKCY) characteristics (see CHAPTER 29
ELECTRICAL SPECIFICATIONS).
The channels supporting 3-wire serial I/O (CSI00, CSI01, CSI10, CSI11, CSI20, CSI21, CSI30, CSI31) are channels 0
to 3 of SAU0 and channels 0 to 3 of SAU1.
1 − −
2 − UART1 −
3 CSI11 IIC11
1 0 − − −
1 − −
1 − −
2 − UART1 −
3 CSI11 IIC11
1 − −
1 − −
2 − UART1 −
3 CSI11 IIC11
2 − UART1 −
3 CSI11 IIC11
• 64-pin products
2
Unit Channel Used as CSI Used as UART Used as Simplified I C
3-wire serial I/O (CSI00, CSI01, CSI10, CSI11, CSI20, CSI21, CSI30, CSI31) performs the following seven types of
communication operations.
• Master transmission (See 12.5.1.)
• Master reception (See 12.5.2.)
• Master transmission/reception (See 12.5.3.)
• Slave transmission (See 12.5.4.)
• Slave reception (See 12.5.5.)
• Slave transmission/reception (See 12.5.6.)
• SNOOZE mode function (See 12.5.7.)
3-Wire Serial I/O CSI00 CSI01 CSI10 CSI11 CSI20 CSI21 CSI30 CSI31
Target channel Channel Channel Channel Channel Channel Channel Channel Channel
0 of 1 of 2 of 3 of 0 of 1 of 2 of 3 of
SAU0 SAU0 SAU0 SAU0 SAU1 SAU1 SAU1 SAU1
Pins used SCK00, SCK01, SCK10, SCK11, SCK20, SCK21, SCK30, SCK31,
SO00 SO01 SO10 SO11 SO20 SO21 SO30 SO31
Transfer end interrupt (in single-transfer mode) or buffer empty interrupt (in continuous transfer mode)
can be selected.
Transfer rate Max. fCLK/2 [Hz] (CSI00), fCLK/4 [Hz] (other than CSI00)
Note Use this operation within a range that satisfies the conditions above and the AC characteristics in the electrical
specifications (see CHAPTER 29 ELECTRICAL SPECIFICATIONS).
Figure 12-26. Example of Contents of Registers for Master Transmission of 3-Wire Serial I/O
(CSI00, CSI01, CSI10, CSI11, CSI20, CSI21, CSI30, CSI31) (1/2)
SCRmn TXEmn RXEmn DAPmn CKPmn EOCmn PTCmn1 PTCmn0 DIRmn SLCmn1 SLCmn0 DLSmn1 DLSmn0
1 0 0/1 0/1 0 0 0 0 0/1 0 0 0 0 1 1 0/1
SIOp
(d) Serial output register m (SOm) … Sets only the bits of the target channel.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Remarks 1. m: Unit number (m = 0, 1), n: Channel number (n = 0 to 3), p: CSI number (p = 00, 01, 10, 11, 20, 21,
30, 31), mn = 00 to 03, 10 to 13
2. : Setting is fixed in the CSI master transmission mode, : Setting disabled (set to the initial value)
0/1: Set to 0 or 1 depending on the usage of the user
Figure 12-26. Example of Contents of Registers for Master Transmission of 3-Wire Serial I/O
(CSI00, CSI01, CSI10, CSI11, CSI20, CSI21) (2/2)
(e) Serial output enable register m (SOEm) … Sets only the bits of the target channel to 1.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
(f) Serial channel start register m (SSm) … Sets only the bits of the target channel to 1.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Remarks 1. m: Unit number (m = 0, 1), n: Channel number (n = 0 to 3), p: CSI number (p = 00, 01, 10, 11, 20, 21,
30, 31), mn = 00 to 03, 10 to 13
2. : Setting disabled (set to the initial value)
×: Bit that cannot be used in this mode (set to the initial value when not used in any mode)
0/1: Set to 0 or 1 depending on the usage of the user
Setting the PER0 register Release the serial array unit from the
reset status and start clock supply.
Yes
Setting the STm register Write 1 to the STmn bit of the target
channel.
SSmn
STmn
SEmn
Data transmission (8-bit length) Data transmission (8-bit length) Data transmission (8-bit length)
TSFmn
Remark m: Unit number (m = 0, 1), n: Channel number (n = 0 to 3), p: CSI number (p = 00, 01, 10, 11, 20, 21, 30,
31), mn = 00 to 03, 10 to 13
Set data for transmission and the number of data. Clear communication end flag
Setting transmit data (Storage area, Transmission data pointer, Number of communication data and
Communication end flag are optionally set on the internal RAM by the software)
Clear interrupt request flag (XXIF), reset interrupt mask (XXMK) and set
Enables interrupt
interrupt enable (EI).
Writing transmit data to Read transmit data from storage area and write it
SIOp (=SDRmn[7:0]) to SIOp. Update transmit data pointer. Writing to SIOp makes SOp and
SCKp signals out
(communication starts)
No
Transmitting next data?
Yes
Read transmit data, if any, from storage area and
Writing transmit data to Sets communication
write it to SIOp. Update transmit data pointer.
SIOp (=SDRmn[7:0]) completion flag
If not, set transmit end flag
RETI
Yes
Main routine
End of communication
Figure 12-32. Timing Chart of Master Transmission (in Continuous Transmission Mode)
(Type 1: DAPmn = 0, CKPmn = 0)
SSmn
STmn
SEmn
Data transmission (8-bit length) Data transmission (8-bit length) Data transmission (8-bit length)
MDmn0
TSFmn
BFFmn
<1> <2> <3> <2> <3> <2> <3> <4> <5> <6>
(Note)
Note If transmit data is written to the SDRmn register while the BFFmn bit of serial status register mn (SSRmn) is
1 (valid data is stored in serial data register mn (SDRmn)), the transmit data is overwritten.
Caution The MDmn0 bit of serial mode register mn (SMRmn) can be rewritten even during operation.
However, rewrite it before transfer of the last bit is started, so that it will be rewritten before the
transfer end interrupt of the last transmit data.
Remark m: Unit number (m = 0, 1), n: Channel number (n = 0 to 3), p: CSI number (p = 00, 01, 10, 11, 20, 21, 30,
31), mn = 00 to 03, 10 to 13
<R> Figure 12-33. Flowchart of Master Transmission (in Continuous Transmission Mode)
Starting setting
Set data for transmission and the number of data. Clear communication end flag
Setting transmit data (Storage area, Transmission data pointer, Number of communication data and
Main routine
Communication end flag are optionally set on the internal RAM by the software)
Clear interrupt request flag (XXIF), reset interrupt mask (XXMK) and set
Enables interrupt
interrupt enable (EI).
Writing transmit data to Read transmit data from storage area and write it
<2>
to SIOp. Update transmit data pointer.
SIOp (=SDRmn[7:0]) Writing to SIOp makes SOp
and SCKp signals out
(communication starts)
RETI
Yes
Communication
continued?
No
End of communication
Remark <1> to <6> in the figure correspond to <1> to <6> in Figure 12-32 Timing Chart of Master
Transmission (in Continuous Transmission Mode).
3-Wire Serial I/O CSI00 CSI01 CSI10 CSI11 CSI20 CSI21 CSI30 CSI31
Target channel Channel Channel Channel Channel Channel Channel Channel Channel
0 of 1 of 2 of 3 of 0 of 1 of 2 of 3 of
SAU0 SAU0 SAU0 SAU0 SAU1 SAU1 SAU1 SAU1
Pins used SCK00, SCK01, SCK10, SCK11, SCK20, SCK21, SCK30, SCK31,
SI00 SI01 SI10 SI11 SI20 SI21 SI30 SI31
Transfer end interrupt (in single-transfer mode) or buffer empty interrupt (in continuous transfer mode)
can be selected.
Transfer rate Max. fCLK/2 [Hz] (CSI00), fCLK/4 [Hz] (other than CSI00)
Note Use this operation within a range that satisfies the conditions above and the AC characteristics in the electrical
specifications (see CHAPTER 29 ELECTRICAL SPECIFICATIONS).
Figure 12-34. Example of Contents of Registers for Master Reception of 3-Wire Serial I/O
(CSI00, CSI01, CSI10, CSI11, CSI20, CSI21, CSI30, CSI31) (1/2)
SCRmn TXEmn RXEmn DAPmn CKPmn EOCmn PTCmn1 PTCmn0 DIRmn SLCmn1 SLCmn0 DLSmn1 DLSmn0
0 1 0/1 0/1 0 0 0 0 0/1 0 0 0 0 1 1 0/1
SDRmn
Baud rate setting Receive data
(Operation clock (fMCK) division setting) 0 (Write FFH as dummy data.)
SIOp
(d) Serial output register m (SOm) … Sets only the bits of the target channel.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Remarks 1. m: Unit number (m = 0, 1), n: Channel number (n = 0 to 3), p: CSI number (p = 00, 01, 10, 11, 20, 21,
30, 31), mn = 00 to 03, 10 to 13
2. : Setting is fixed in the CSI master reception mode, : Setting disabled (set to the initial value)
×: Bit that cannot be used in this mode (set to the initial value when not used in any mode)
0/1: Set to 0 or 1 depending on the usage of the user
Figure 12-34. Example of Contents of Registers for Master Reception of 3-Wire Serial I/O
(CSI00, CSI01, CSI10, CSI11, CSI20, CSI21, CSI30, CSI31) (2/2)
(e) Serial output enable register m (SOEm) …The register that not used in this mode.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
(f) Serial channel start register m (SSm) … Sets only the bits of the target channel to 1.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Remarks 1. m: Unit number (m = 0, 1), n: Channel number (n = 0 to 3), p: CSI number (p = 00, 01, 10, 11, 20, 21,
30, 31)
2. : Setting disabled (set to the initial value)
×: Bit that cannot be used in this mode (set to the initial value when not used in any mode)
0/1: Set to 0 or 1 depending on the usage of the user
Remark Even after communication is stopped, the pin level is retained. To resume the operation, re-set serial
output register m (SOm) (see Figure 12-37 Procedure for Resuming Master Reception).
SSmn
STmn
SEmn
Receive data 1 Receive data 2 Receive data 3
SDRmn Dummy data for reception Dummy data Dummy data
Write Write Write
Read Read Read
SCKp pin
SIp pin Receive data 1 Receive data 2 Receive data 3
Shift
Reception & shift operation Reception & shift operation Reception & shift operation
register mn
INTCSIp
Data reception (8-bit length) Data reception (8-bit length) Data reception (8-bit length)
TSFmn
Remark m: Unit number (m = 0, 1), n: Channel number (n = 0 to 3), p: CSI number (p = 00, 01, 10, 11, 20, 21, 30,
31), mn = 00 to 03, 10 to 13
Enables interrupt Clear interrupt request flag (XXIF), reset interrupt mask (XXMK) and set
interrupt enable (EI)
RETI
No
Check the number of communication data
All reception completed?
Yes
Main routine
End of communication
Figure 12-40. Timing Chart of Master Reception (in Continuous Reception Mode) (Type 1: DAPmn = 0, CKPmn = 0)
SSmn
STmn
SEmn
Receive data 3
SDRmn Dummy data Dummy data Receive data 1 Dummy data Receive data 2
Write Write Write
Read Read Read
SCKp pin
SIp pin Receive data 1 Receive data 2 Receive data 3
Shift
Reception & shift operation Reception & shift operation Reception & shift operation
register mn
INTCSIp
Data reception (8-bit length) Data reception (8-bit length) Data reception (8-bit length)
MDmn0
TSFmn
BFFmn
<1> <2> <3> <2> <3> <4> <2> <3> <4> <5> <6> <7> <8>
Remarks 1. <1> to <8> in the figure correspond to <1> to <8> in Figure 12-41 Flowchart of Master Reception
(in Continuous Reception Mode).
2. m: Unit number (m = 0, 1), n: Channel number (n = 0 to 3), p: CSI number (p = 00, 01, 10, 11, 20, 21,
30, 31), mn = 00 to 03, 10 to 13
<R> Figure 12-41. Flowchart of Master Reception (in Continuous Reception Mode)
Enables interrupt Clear interrupt request flag (XXIF), reset interrupt mask (XXMK) and set
interrupt enable (EI)
No
BFFmn = 1?
Interrupt processing routine
Yes
Read receive data, if any, then write them to storage
<4> Reading receive data to SIOp area, and update receive data pointer (also subtract -1
from number of transmit data)
<7> (=SDRmn[7:0])
=0
Number of communication ≥2
data?
<2>
<5> =1
Writing dummy data to
Clear MDmn0 bit to 0 SIOp (=SDRmn[7:0])
RETI
No
Number of communication When number of communication data
data = 0? becomes 0, receive completes
Yes
Yes
Communication continued?
No
<8> Write STmn bit to 1
End of communication
Remark <1> to <8> in the figure correspond to <1> to <8> in Figure 12-40 Timing Chart of Master Reception
(in Continuous Reception Mode).
R01UH0146EJ0100 Rev.1.00 595
Sep 22, 2011
RL78/G13 CHAPTER 12 SERIAL ARRAY UNIT
3-Wire Serial I/O CSI00 CSI01 CSI10 CSI11 CSI20 CSI21 CSI30 CSI31
Target channel Channel Channel Channel Channel Channel Channel Channel Channel
0 of 1 of 2 of 3 of 0 of 1 of 2 of 3 of
SAU0 SAU0 SAU0 SAU0 SAU1 SAU1 SAU1 SAU1
Pins used SCK00, SCK01, SCK10, SCK11, SCK20, SCK21, SCK30, SCK31,
SI00, SI01, SI10, SI11, SI20, SI21, SI30, SI31,
SO00 SO01 SO10 SO11 SO20 SO21 SO30 SO31
Transfer end interrupt (in single-transfer mode) or buffer empty interrupt (in continuous transfer mode)
can be selected.
Transfer rate Max. fCLK/2 [Hz] (CSI00), fCLK/4 [Hz] (other than CSI00)
Note Use this operation within a range that satisfies the conditions above and the AC characteristics in the electrical
specifications (see CHAPTER 29 ELECTRICAL SPECIFICATIONS).
Figure 12-42. Example of Contents of Registers for Master Transmission/Reception of 3-Wire Serial I/O
(CSI00, CSI01, CSI10, CSI11, CSI20, CSI21, CSI30, CSI31) (1/2)
SCRmn TXEmn RXEmn DAPmn CKPmn EOCmn PTCmn1 PTCmn0 DIRmn SLCmn1 SLCmn0 DLSmn1 DLSmn0
1 1 0/1 0/1 0 0 0 0 0/1 0 0 0 0 1 1 0/1
SIOp
(d) Serial output register m (SOm) … Sets only the bits of the target channel.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Remarks 1. m: Unit number (m = 0, 1), n: Channel number (n = 0 to 3), p: CSI number (p = 00, 01, 10, 11, 20, 21,
30, 31), mn = 00 to 03, 10 to 13
2. : Setting is fixed in the CSI master transmission/reception mode
: Setting disabled (set to the initial value)
×: Bit that cannot be used in this mode (set to the initial value when not used in any mode)
0/1: Set to 0 or 1 depending on the usage of the user
Figure 12-42. Example of Contents of Registers for Master Transmission/Reception of 3-Wire Serial I/O
(CSI00, CSI01, CSI10, CSI11, CSI20, CSI21, CSI30, CSI31) (2/2)
(e) Serial output enable register m (SOEm) … Sets only the bits of the target channel to 1.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
(f) Serial channel start register m (SSm) … Sets only the bits of the target channel to 1.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Remarks 1. m: Unit number (m = 0, 1), n: Channel number (n = 0 to 3), p: CSI number (p = 00, 01, 10, 11, 20, 21,
30, 31), mn = 00 to 03, 10 to 13
2. : Setting disabled (set to the initial value)
×: Bit that cannot be used in this mode (set to the initial value when not used in any mode)
0/1: Set to 0 or 1 depending on the usage of the user
Remark Even after communication is stopped, the pin level is retained. To resume the operation, re-set serial
output register m (SOm) (see Figure 12-45 Procedure for Resuming Master Transmission).
SSmn
STmn
SEmn
Receive data 1 Receive data 2 Receive data 3
SDRmn Transmit data 1 Transmit data 2 Transmit data 2
Write Write Write
Read Read Read
SCKp pin
SIp pin Receive data 1 Receive data 2 Receive data 3
Shift
Reception & shift operation Reception & shift operation Reception & shift operation
register mn
SOp pin Transmit data 1 Transmit data 2 Transmit data 3
INTCSIp
Data transmission/reception (8-bit length) Data transmission/reception (8-bit length) Data transmission/reception (8-bit length)
TSFmn
Remark m: Unit number (m = 0, 1), n: Channel number (n = 0 to 3), p: CSI number (p = 00, 01, 10, 11, 20, 21, 30,
31), mn = 00 to 03, 10 to 13
<R> Figure 12-47. Flowchart of Master Transmission/Reception (in Single- Transmission/Reception Mode)
Clear interrupt request flag (XXIF), reset interrupt mask (XXMK) and set
Enables interrupt
interrupt enable (EI)
Writing transmit data to Read transmit data from storage area and write it
SIOp (=SDRmn[7:0]) to SIOp. Update transmit data pointer. Writing to SIOp makes SOp
and SCKp signals out
(communication starts)
Wait for transmission/reception
completes
When transfer end interrupt is generated, it
moves to interrupt processing routine.
Interrupt processing routine
RETI
No Transmission/reception
If there are the next data, it continues
completed?
Yes
Main routine
End of communication
Figure 12-48. Timing Chart of Master Transmission/Reception (in Continuous Transmission/Reception Mode)
(Type 1: DAPmn = 0, CKPmn = 0)
SSmn
STmn
SEmn
Receive data 3
SDRmn Transmit data 1 Transmit data 2 Receive data 1 Transmit data 3 Receive data 2
Write Write Write
Read Read Read
SCKp pin
SIp pin Receive data 1 Receive data 2 Receive data 3
Shift
Reception & shift operation Reception & shift operation Reception & shift operation
register mn
SOp pin Transmit data 1 Transmit data 2 Transmit data 3
INTCSIp
Data transmission/reception (8-bit length) Data transmission/reception (8-bit length) Data transmission/reception (8-bit length)
MDmn0
TSFmn
BFFmn
<1> <2> <3> <2> <3> <4> <2> <3> <4> <5> <6> <7> <8>
(Note 1) (Note 2) (Note 2)
Notes 1. If transmit data is written to the SDRmn register while the BFFmn bit of serial status register mn
(SSRmn) is 1 (valid data is stored in serial data register mn (SDRmn)), the transmit data is overwritten.
2. The transmit data can be read by reading the SDRmn register during this period. At this time, the
transfer operation is not affected.
Caution The MDmn0 bit of serial mode register mn (SMRmn) can be rewritten even during operation.
However, rewrite it before transfer of the last bit is started, so that it has been rewritten before the
transfer end interrupt of the last transmit data.
Remarks 1. <1> to <8> in the figure correspond to <1> to <8> in Figure 12-49 Flowchart of Master
Transmission/Reception (in Continuous Transmission/Reception Mode).
2. m: Unit number (m = 0, 1), n: Channel number (n = 0 to 3), p: CSI number (p = 00, 01, 10, 11, 20, 21,
30, 31), mn = 00 to 03, 10 to 13
<R> Figure 12-49. Flowchart of Master Transmission/Reception (in Continuous Transmission/Reception Mode)
Starting setting
Enables interrupt Clear interrupt request flag (XXIF), reset interrupt mask (XXMK) and set interrupt
enable (EI)
<2> Writing dummy data to Read transmit data from storage area and write it
SIOp (=SDRmn[7:0]) to SIOp. Update transmit data pointer.
Writing to SIOp makes SOp
and SCKp signals out
(communication starts)
Wait for transmission/reception
completes
When transmission/reception interrupt is generated, it
<3> <6> moves to interrupt processing routine
Interrupt processing routine
No
BFFmn = 1?
Yes Except for initial interrupt, read data received then write them
to storage area, and update receive data pointer
Reading reception data to
<4>
SIOp (=SDRmn[7:0])
<7>
≥2 to communication end
<5>
Writing transmit data to
SIOp (=SDRmn[7:0]) Clear MDmn0 bit to 0
RETI
No
Number of communication
data = 0?
Yes
Yes
Continuing Communication?
No
End of communication
Remark <1> to <8> in the figure correspond to <1> to <8> in Figure 12-48 Timing Chart of Master
Transmission/Reception (in Continuous Transmission/Reception Mode).
3-Wire Serial I/O CSI00 CSI01 CSI10 CSI11 CSI20 CSI21 CSI30 CSI31
Target channel Channel Channel Channel Channel Channel Channel Channel Channel
0 of 1 of 2 of 3 of 0 of 1 of 2 of 3 of
SAU0 SAU0 SAU0 SAU0 SAU1 SAU1 SAU1 SAU1
Pins used SCK00, SCK01, SCK10, SCK11, SCK20, SCK21, SCK30, SCK31,
SO00 SO01 SO10 SO11 SO20 SO21 SO30 SO31
Transfer end interrupt (in single-transfer mode) or buffer empty interrupt (in continuous transfer mode)
can be selected.
Notes 1. Because the external serial clock input to the SCK00, SCK01, SCK10, SCK11, SCK20, SCK21, SCK30, and
SCK31 pins is sampled internally and used, the fastest transfer rate is fMCK/6 [Hz].
2. Use this operation within a range that satisfies the conditions above and the AC characteristics in the
electrical specifications (see CHAPTER 29 ELECTRICAL SPECIFICATIONS).
Figure 12-50. Example of Contents of Registers for Slave Transmission of 3-Wire Serial I/O
(CSI00, CSI01, CSI10, CSI11, CSI20, CSI21, CSI30, CSI31) (1/2)
SCRmn TXEmn RXEmn DAPmn CKPmn EOCmn PTCmn1 PTCmn0 DIRmn SLCmn1 SLCmn0 DLSmn1 DLSmn0
1 0 0/1 0/1 0 0 0 0 0/1 0 0 0 0 1 1 0/1
SDRmn 0000000
Transmit data setting
Baud rate setting
0
SIOp
(d) Serial output register m (SOm) … Sets only the bits of the target channel.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Remarks 1. m: Unit number (m = 0, 1), n: Channel number (n = 0 to 3), p: CSI number (p = 00, 01, 10, 11, 20, 21,
30, 31), mn = 00 to 03, 10 to 13
2. : Setting is fixed in the CSI slave transmission mode, : Setting disabled (set to the initial value)
×: Bit that cannot be used in this mode (set to the initial value when not used in any mode)
0/1: Set to 0 or 1 depending on the usage of the user
Figure 12-50. Example of Contents of Registers for Slave Transmission of 3-Wire Serial I/O
(CSI00, CSI01, CSI10, CSI11, CSI20, CSI21, CSI30, CSI31) (2/2)
(e) Serial output enable register m (SOEm) … Sets only the bits of the target channel to 1.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
(f) Serial channel start register m (SSm) … Sets only the bits of the target channel to 1.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Remarks 1. m: Unit number (m = 0, 1), n: Channel number (n = 0 to 3), p: CSI number (p = 00, 01, 10, 11, 20, 21,
30, 31), mn = 00 to 03, 10 to 13
2. : Setting disabled (set to the initial value)
×: Bit that cannot be used in this mode (set to the initial value when not used in any mode)
0/1: Set to 0 or 1 depending on the usage of the user
Remark Even after communication is stopped, the pin level is retained. To resume the operation, re-set the SOm
register (see Figure 12-53 Procedure for Resuming Slave Transmission).
(Essential) Starting target for communication Starts the target for communication.
SSmn
STmn
SEmn
Data transmission (8-bit length) Data transmission (8-bit length) Data transmission (8-bit length)
TSFmn
Remark m: Unit number (m = 0, 1), n: Channel number (n = 0 to 3), p: CSI number (p = 00, 01, 10, 11, 20, 21, 30,
31), mn = 00 to 03, 10 to 13
Set storage area and the number of data for transmit data
Setting transmit data (Storage area, Transmission data pointer, Number of communication data and
Communication end flag are optionally set on the internal RAM by the software)
Enables interrupt Clear interrupt request flag (XXIF), reset interrupt mask (XXMK) and set
interrupt enable (EI).
Writing transmit data to Read transmit data from storage area and write it to SIOp. Update
SIOp (=SDRmn[7:0]) transmit data pointer.
Yes
Yes
Transmitting next data? Determine if it completes by counting number of communication data
No
Yes
Continuing transmit?
No
Write STmn bit to 1
End of communication
Figure 12-56. Timing Chart of Slave Transmission (in Continuous Transmission Mode)
(Type 1: DAPmn = 0, CKPmn = 0)
SSmn
STmn
SEmn
SCKp pin
SOp pin Transmit data 1 Transmit data 2 Transmit data 3
Shift
Shift operation Shift operation Shift operation
register mn
INTCSIp
Data transmission (8-bit length) Data transmission (8-bit length) Data transmission (8-bit length)
MDmn0
TSFmn
BFFmn
<1> <2> <3> <2> <3> <2> <3> <4> <5> <6>
(Note)
Note If transmit data is written to the SDRmn register while the BFFmn bit of serial status register mn (SSRmn) is
1 (valid data is stored in serial data register mn (SDRmn)), the transmit data is overwritten.
Caution The MDmn0 bit of serial mode register mn (SMRmn) can be rewritten even during operation.
However, rewrite it before transfer of the last bit is started.
Remark m: Unit number (m = 0, 1), n: Channel number (n = 0 to 3), p: CSI number (p = 00, 01, 10, 11, 20, 21, 30,
31), mn = 00 to 03, 10 to 13
<R> Figure 12-57. Flowchart of Slave Transmission (in Continuous Transmission Mode)
Starting setting
Setting transmit data Set storage area and the number of data for transmit data
(Storage area, Transmission data pointer, Number of communication data and
Communication end flag are optionally set on the internal RAM by the software)
Clear interrupt request flag (XXIF), reset interrupt mask (XXMK) and set
Enables interrupt
interrupt enable (EI)
Read transmit data from buffer and write it to SIOp. Update transmit
<2> Writing transmit data to
SIOp (=SDRmn[7:0]) data pointer
If transmit data is left, read them from storage area then write into
No SIOp, and update transmit data pointer.
Number of transmit
data > 1? If not, change the interrupt to transmission complete
Yes
Reading transmit data
Subtract -1 from number of It is determined as follows depending on the number of communication data.
transmit data +1: Transmit data completion
0: During the last data received
No
Number of communication
data = -1?
Yes
Main routine
Yes
Communication continued?
No
<6> Write STmn bit to 1
End of communication
Remark <1> to <6> in the figure correspond to <1> to <6> in Figure 12-56 Timing Chart of Slave
Transmission (in Continuous Transmission Mode).
3-Wire Serial I/O CSI00 CSI01 CSI10 CSI11 CSI20 CSI21 CSI30 CSI31
Target channel Channel Channel Channel Channel Channel Channel Channel Channel
0 of 1 of 2 of 3 of 0 of 1 of 2 of 3 of
SAU0 SAU0 SAU0 SAU0 SAU1 SAU1 SAU1 SAU1
Pins used SCK00, SCK01, SCK10, SCK11, SCK20, SCK21, SCK30, SCK31,
SI00 SI01 SI10 SI11 SI20 SI21 SI30 SI31
Transfer end interrupt only (Setting the buffer empty interrupt is prohibited.)
Notes 1. Because the external serial clock input to the SCK00, SCK01, SCK10, SCK11, SCK20, SCK21, SCK30, and
SCK31 pins is sampled internally and used, the fastest transfer rate is fMCK/6 [Hz].
2. Use this operation within a range that satisfies the conditions above and the AC characteristics in the
electrical specifications (see CHAPTER 29 ELECTRICAL SPECIFICATIONS).
Figure 12-58. Example of Contents of Registers for Slave Reception of 3-Wire Serial I/O
(CSI00, CSI01, CSI10, CSI11, CSI20, CSI21, CSI30, CSI31)
SCRmn TXEmn RXEmn DAPmn CKPmn EOCmn PTCmn1 PTCmn0 DIRmn SLCmn1 SLCmn0 DLSmn1 DLSmn0
0 1 0/1 0/1 0 0 0 0 0/1 0 0 0 0 1 1 0/1
SDRmn 0000000
Baud rate setting Receive data
0
SIOp
(d) Serial output register m (SOm) …The Register that not used in this mode.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Remarks 1. m: Unit number (m = 0, 1), n: Channel number (n = 0 to 3), p: CSI number (p = 00, 01, 10, 11, 20, 21,
30, 31), mn = 00 to 03, 10 to 13
2. : Setting is fixed in the CSI slave transmission mode, : Setting disabled (set to the initial value)
×: Bit that cannot be used in this mode (set to the initial value when not used in any mode)
0/1: Set to 0 or 1 depending on the usage of the user
Figure 12-58. Example of Contents of Registers for Slave Reception of 3-Wire Serial I/O
(CSI00, CSI01, CSI10, CSI11, CSI20, CSI21) (2/2)
(e) Serial output enable register m (SOEm) …The Register that not used in this mode.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
(f) Serial channel start register m (SSm) … Sets only the bits of the target channel to 1.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Remarks 1. m: Unit number (m = 0, 1), n: Channel number (n = 0 to 3), p: CSI number (p = 00, 01, 10, 11, 20, 21,
30, 31), mn = 00 to 03, 10 to 13
2. : Setting disabled (set to the initial value)
×: Bit that cannot be used in this mode (set to the initial value when not used in any mode)
0/1: Set to 0 or 1 depending on the usage of the user
SSmn
STmn
SEmn
Receive data 3
SDRmn Receive data 1 Receive data 2
Data reception (8-bit length) Data reception (8-bit length) Data reception (8-bit length)
TSFmn
Remark m: Unit number (m = 0, 1), n: Channel number (n = 0 to 3), p: CSI number (p = 00, 01, 10, 11, 20, 21, 30,
31), mn = 00 to 03, 10 to 13
Enables interrupt Clear interrupt request flag (XXIF), reset interrupt mask (XXMK) and set
interrupt enable (EI).
RETI
No
Check completion of number of receive data
Reception completed?
Main routine
Yes
End of communication
3-Wire Serial I/O CSI00 CSI01 CSI10 CSI11 CSI20 CSI21 CSI30 CSI31
Target channel Channel Channel Channel Channel Channel Channel Channel Channel
0 of 1 of 2 of 3 of 0 of 1 of 2 of 3 of
SAU0 SAU0 SAU0 SAU0 SAU1 SAU1 SAU1 SAU1
Pins used SCK00, SCK01, SCK10, SCK11, SCK20, SCK21, SCK30, SCK31,
SI00, SI01, SI10, SI11, SI20, SI21, SI30, SI31,
SO00 SO01 SO10 SO11 SO20 SO21 SO30 SO31
Transfer end interrupt (in single-transfer mode) or buffer empty interrupt (in continuous transfer mode)
can be selected.
Notes 1. Because the external serial clock input to the SCK00, SCK01, SCK10, SCK11, SCK20, SCK21, SCK30, and
SCK31 pins is sampled internally and used, the fastest transfer rate is fMCK/6 [Hz].
2. Use this operation within a range that satisfies the conditions above and the AC characteristics in the
electrical specifications (see CHAPTER 29 ELECTRICAL SPECIFICATIONS).
Figure 12-64. Example of Contents of Registers for Slave Transmission/Reception of 3-Wire Serial I/O
(CSI00, CSI01, CSI10, CSI11, CSI20, CSI21, CSI30, CSI31) (1/2)
SCRmn TXEmn RXEmn DAPmn CKPmn EOCmn PTCmn1 PTCmn0 DIRmn SLCmn1 SLCmn0 DLSmn1 DLSmn0
1 1 0/1 0/1 0 0 0 0 0/1 0 0 0 0 1 1 0/1
SDRmn 0000000
Baud rate setting Transmit data setting/receive data register
0
SIOp
(d) Serial output register m (SOm) … Sets only the bits of the target channel.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Caution Be sure to set transmit data to the SlOp register before the clock from the master is started.
Remarks 1. m: Unit number (m = 0, 1), n: Channel number (n = 0 to 3), p: CSI number (p = 00, 01, 10, 11, 20, 21,
30, 31), mn = 00 to 03, 10 to 13
2. : Setting is fixed in the CSI slave transmission/reception mode,
: Setting disabled (set to the initial value)
×: Bit that cannot be used in this mode (set to the initial value when not used in any mode)
0/1: Set to 0 or 1 depending on the usage of the user
Figure 12-64. Example of Contents of Registers for Slave Transmission/Reception of 3-Wire Serial I/O
(CSI00, CSI01, CSI10, CSI11, CSI20, CSI21, CSI30, CSI31) (2/2)
(e) Serial output enable register m (SOEm) … Sets only the bits of the target channel to 1.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
(f) Serial channel start register m (SSm) … Sets only the bits of the target channel to 1.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Remarks 1. m: Unit number (m = 0, 1), n: Channel number (n = 0 to 3), p: CSI number (p = 00, 01, 10, 11, 20, 21,
30, 31), mn = 00 to 03, 10 to 13
2. : Setting disabled (set to the initial value)
×: Bit that cannot be used in this mode (set to the initial value when not used in any mode)
0/1: Set to 0 or 1 depending on the usage of the user
Caution Be sure to set transmit data to the SlOp register before the clock from the master is started.
Stopping communication
Remark Even after communication is stopped, the pin level is retained. To resume the operation, re-set serial
output register m (SOm) (see Figure 12-67 Procedure for Resuming Slave Transmission/Reception).
(Essential) Starting target for communication Starts the target for communication.
Caution Be sure to set transmit data to the SlOp register before the clock from the master is started.
SSmn
STmn
SEmn
Receive data 1 Receive data 2 Receive data 3
SDRmn Transmit data 1 Transmit data 2 Transmit data 3
Write Write Write
Read Read Read
SCKp pin
SIp pin Receive data 1 Receive data 2 Receive data 3
Shift
Reception & shift operation Reception & shift operation Reception & shift operation
register mn
SOp pin Transmit data 1 Transmit data 2 Transmit data 3
INTCSIp
Data transmission/reception (8-bit length) Data transmission/reception (8-bit length) Data transmission/reception (8-bit length)
TSFmn
Remark m: Unit number (m = 0, 1), n: Channel number (n = 0 to 3), p: CSI number (p = 00, 01, 10, 11, 20, 21, 30,
31), mn = 00 to 03, 10 to 13
<R> Figure 12-69. Flowchart of Slave Transmission/Reception (in Single- Transmission/Reception Mode)
Enables interrupt Clear interrupt request flag (XXIF), reset interrupt mask (XXMK) and set
interrupt enable (EI).
Writing transmit data to Read transmit data from storage area and write it to SIOp.
SIOp (=SDRmn[7:0]) Update transmit data pointer.
Reading receive data to Read receive data and write it to storage area. Update
SIOp (=SDRmn[7:0]) receive data pointer.
RETI
No Transmission/reception
completed?
Yes
Update the number of communication data and confirm
Yes Transmission/reception if next transmission/reception data is available
next data?
No
End of communication
Caution Be sure to set transmit data to the SlOp register before the clock from the master is started.
Figure 12-70. Timing Chart of Slave Transmission/Reception (in Continuous Transmission/Reception Mode) (Type
1: DAPmn = 0, CKPmn = 0)
SSmn
STmn
SEmn
Receive data 3
SDRmn Transmit data 1 Transmit data 2 Receive data 1 Transmit data 3 Receive data 2
Write Write Write
Read Read Read
SCKp pin
SIp pin Receive data 1 Receive data 2 Receive data 3
Shift
Reception & shift operation Reception & shift operation Reception & shift operation
register mn
SOp pin Transmit data 1 Transmit data 2 Transmit data 3
INTCSIp
Data transmission/reception (8-bit length) Data transmission/reception (8-bit length) Data transmission/reception (8-bit length)
MDmn0
TSFmn
BFFmn
<1> <2> <3> <2> <3> <4> <2> <3> <4> <5> <6> <7><8>
(Note 1) (Note 2) (Note 2)
Notes 1. If transmit data is written to the SDRmn register while the BFFmn bit of serial status register mn
(SSRmn) is 1 (valid data is stored in serial data register mn (SDRmn)), the transmit data is overwritten.
2. The transmit data can be read by reading the SDRmn register during this period. At this time, the
transfer operation is not affected.
Caution The MDmn0 bit of serial mode register mn (SMRmn) can be rewritten even during operation.
However, rewrite it before transfer of the last bit is started, so that it has been rewritten before the
transfer end interrupt of the last transmit data.
Remarks 1. <1> to <8> in the figure correspond to <1> to <8> in Figure 12-71 Flowchart of Slave
Transmission/Reception (in Continuous Transmission/Reception Mode).
2. m: Unit number (m = 0, 1), n: Channel number (n = 0 to 3), p: CSI number (p = 00, 01, 10, 11, 20, 21,
30, 31), mn = 00 to 03, 10 to 13
<R> Figure 12-71. Flowchart of Slave Transmission/Reception (in Continuous Transmission/Reception Mode)
Starting setting
Enables interrupt Clear interrupt request flag (XXIF), reset interrupt mask (XXMK) and set
interrupt enable (EI)
No
BFFmn = 1?
Interrupt processing routine
Yes
Other than the first interrupt, read reception data then writes
Read receive data to SIOp
<4> to storage area, update receive data pointer
(=SDRmn[7:0])
<7>
RETI
No Number of communication
data = 0?
Yes
Yes
Communication
continued?
No
End of communication
Caution Be sure to set transmit data to the SlOp register before the clock from the master is started.
Remark <1> to <8> in the figure correspond to <1> to <8> in Figure 12-70 Timing Chart of Slave
Transmission/Reception (in Continuous Transmission/Reception Mode).
When using the SNOOZE mode function, set the SWCm bit of serial standby control register m (SSCm) to 1 before
switching to the STOP mode.
Cautions 1. The SNOOZE mode can only be specified when the high-speed on-chip oscillator clock is selected
for fCLK.
2. The maximum transfer rate when using CSIp in the SNOOZE mode is 1 Mbps.
Figure 12-72. Timing Chart of SNOOZE Mode Operation (once startup) (Type 1: DAPmn = 0, CKPmn = 0)
CPU operation status Normal peration STOP mode SNOOZE mode Normal peration
<4>
SSm0
STm0
SEm0
SWCm
SSECm L
Clock request signal
(internal signal)
Receive data 2
SDRm0 Receive data 1
<8>
Read Note1
SCKp pin
SIp pin Receive data 1 Receive data 2
Shift register Reception & shift operation Reception & shift operation
m0
INTCSIp Note 2
Data reception (8-bit length) Data reception (8-bit length)
TSFm0
Notes 1. Only read received data while SWCm = 1 and before the next edge of the SCKp pin input is
detected.
2. The transfer end interrupt (INTCSIp) is cleared either when SWCm is cleared to 0 or when the
next edge of the SCKp pin input is detected.
Caution Before switching to the SNOOZE mode or after reception operation in the SNOOZE mode
finishes, be sure to set the STm0 bit to 1 and clear the SEm0 bit (to stop the operation).
Remarks 1. <1> to <11> in the figure correspond to <1> to <11> in Figure 12-73. Flowchart of SNOOZE Mode
Operation (once startup).
<R> 2. 24 to 64-pin products: m = 0; p = 00
80, 100, 128-pin products: m = 0, 1; p = 00, 20
Starting setting
No
TSFmn = 0 for all channels?
Yes
Normal operation
<1> Write STm0 bit to 1 Become the operation STOP status (SEm0 = 0)
<3> Write SSm0 bit to 1 Become the communication wait status (SEm0 = 1)
<4> Entered the STOP mode fCLK supplied to the SAU is stopped.
STOP mode
<9> Write STm0 bit to 1 Become the operation STOP status (SEm0 = 0)
<11> Write SSm0 bit to 1 It becomes communication ready state (SEm0 = 1) under
normal operation
Remarks 1. <1> to <11> in the figure correspond to <1> to <11> in Figure 12-72. Timing Chart of SNOOZE
Mode Operation (once startup).
<R> 2. 24 to 64-pin products: m = 0; p = 00
80, 100, 128-pin products: m = 0, 1; p = 00, 20
Figure 12-74. Timing Chart of SNOOZE Mode Operation (continuous startup) (Type 1: DAPmn = 0, CKPmn = 0)
CPU operation status Normal peration STOP mode SNOOZE mode Normal peration STOP mode SNOOZE mode
<4> <4>
SSm0
STm0
SEm0
SWCm
SSECm L
Clock request signal
(internal signal)
Receive data 2
SDRm0 Receive data 1
<8>
Read Note1
SCKp pin
SIp pin Receive data 1 Receive data 2
Shift register
Reception & shift operation Reception & shift operation
m0
INTCSIp Note 2
Data reception (8-bit length) Data reception (8-bit length)
TSFm0
<1> <2> <3> <5> <6> <7> <9>, <2> <3> <5> <6>
<10>
Notes 1. Only read received data while SWCm = 1 and before the next edge of the SCKp pin input is
detected.
2. The transfer end interrupt (INTCSIp) is cleared either when SWCm is cleared to 0 or when the
next edge of the SCKp pin input is detected.
Caution Before switching to the SNOOZE mode or after reception operation in the SNOOZE mode
finishes, be sure to set the STm0 bit to 1 and clear the SEm0 bit (to stop the operation).
Remarks 1. <1> to <10> in the figure correspond to <1> to <10> in Figure 12-75. Flowchart of SNOOZE Mode
Operation (continuous startup).
<R> 2. 24 to 64-pin products: m = 0; p = 00
80, 100, 128-pin products: m = 0, 1; p = 00, 20
Starting setting
No
TSFmn = 0 for all channels?
Normal operation
Yes
<1> Write STm0 bit to 1 Become the operation STOP status (SEm0 = 0)
Enables interrupt Clear interrupt request flag (XXIF), reset interrupt mask (XXMK)
and set interrupt enable (EI).
<4> Entered the STOP mode fCLK supplied to the SAU is stopped.
STOP mode
<8> Reading receive data to The mode switches from SNOOZE to normal operation.
SIOp (=SDRmn[7:0])
Normal operation
Remarks 1. <1> to <10> in the figure correspond to <1> to <10> in Figure 12-74. Timing Chart of SNOOZE
Mode Operation (continuous startup).
<R> 2. 24 to 64-pin products: m = 0; p = 00
80, 100, 128-pin products: m = 0, 1; p = 00, 20
(1) Master
(Transfer clock frequency) = {Operation clock (fMCK) frequency of target channel} ÷ (SDRmn[15:9] + 1) ÷ 2 [Hz]
(2) Slave
Note
(Transfer clock frequency) = {Frequency of serial clock (SCK) supplied by master} [Hz]
Remark The value of SDRmn[15:9] is the value of bits 15 to 9 of serial data register mn (SDRmn) (0000000B to
1111111B) and therefore is 0 to 127.
The operation clock (fMCK) is determined by serial clock select register m (SPSm) and bit 15 (CKSmn) of serial mode
register mn (SMRmn).
0 X X X X 0 0 0 0 fCLK 32 MHz
X X X X 0 0 0 1 fCLK/2 16 MHz
2
X X X X 0 0 1 0 fCLK/2 8 MHz
3
X X X X 0 0 1 1 fCLK/2 4 MHz
4
X X X X 0 1 0 0 fCLK/2 2 MHz
5
X X X X 0 1 0 1 fCLK/2 1 MHz
6
X X X X 0 1 1 0 fCLK/2 500 kHz
7
X X X X 0 1 1 1 fCLK/2 250 kHz
8
X X X X 1 0 0 0 fCLK/2 125 kHz
9
X X X X 1 0 0 1 fCLK/2 62.5 kHz
10
X X X X 1 0 1 0 fCLK/2 31.25 kHz
11
X X X X 1 0 1 1 fCLK/2 15.63 kHz
1 0 0 0 0 X X X X fCLK 32 MHz
0 0 0 1 X X X X fCLK/2 16 MHz
2
0 0 1 0 X X X X fCLK/2 8 MHz
3
0 0 1 1 X X X X fCLK/2 4 MHz
4
0 1 0 0 X X X X fCLK/2 2 MHz
5
0 1 0 1 X X X X fCLK/2 1 MHz
6
0 1 1 0 X X X X fCLK/2 500 kHz
7
0 1 1 1 X X X X fCLK/2 250 kHz
8
1 0 0 0 X X X X fCLK/2 125 kHz
9
1 0 0 1 X X X X fCLK/2 62.5 kHz
10
1 0 1 0 X X X X fCLK/2 31.25 kHz
11
1 0 1 1 X X X X fCLK/2 15.63 kHz
Other than above Setting prohibited
Note When changing the clock selected for fCLK (by changing the system clock control register (CKC) value), do
so after having stopped (serial channel stop register m (STm) = 000FH) the operation of the serial array
unit (SAU).
12.5.9 Procedure for processing errors that occurred during 3-wire serial I/O (CSI00, CSI01, CSI10, CSI11, CSI20,
CSI21, CSI30, CSI31) communication
The procedure for processing errors that occurred during 3-wire serial I/O (CSI00, CSI01, CSI10, CSI11, CSI20, CSI21,
CSI30, CSI31) communication is described in Figure 12-76.
Reads serial data register mn (SDRmn). The BFFmn bit of the SSRmn register is This is to prevent an overrun error if the
set to 0 and channel n is enabled to next reception is completed during error
receive data. processing.
Reads serial status register mn Error type is identified and the read
(SSRmn). value is used to clear error flag.
Writes 1 to serial flag clear trigger Error flag is cleared. Error can be cleared only during
register mn (SIRmn). reading, by writing the value read from
the SSRmn register to the SIRmn
register without modification.
This is a start-stop synchronization function using two lines: serial data transmission (TXD) and serial data reception
(RXD) lines. By using these two communication lines, each data frame, which consist of a start bit, data, parity bit, and
stop bit, is transferred asynchronously (using the internal baud rate) between the microcontroller and the other
communication party. Full-duplex UART communication can be performed by using a channel dedicated to transmission
(even-numbered channel) and a channel dedicated to reception (odd-numbered channel). The LIN-bus can be
implemented by using timer array unit 0 with an external interrupt (INTP0).
[Data transmission/reception]
• Data length of 7, 8, or 9 bits
Note
In addition, UART0 reception (channel 1 of unit 0) supports the SNOOZE mode. When RxD0 pin input is detected while
in the STOP mode, the SNOOZE mode makes data reception that does not require the CPU possible. Only following
UARTs can be specified for the reception baud rate adjustment function.
<R> • 24 to 64-pin products: UART0
• 80, 100, 128-pin products: UART0 and UART2
The LIN-bus is accepted in UART2 (channels 0 and 1 of unit 1) (30, 32, 36, 40, 44, 48, 52, 64, 80, 100, and 128-pin
products only).
[LIN-bus functions]
• Wakeup signal detection Using the external interrupt (INTP0) and
• Sync break field (SBF) detection timer array unit 0
• Sync field measurement, baud rate calculation
Note Only following UARTs can be specified for the 9-bit data length.
<R> • 24 to 64-pin products: UART0
• 80, 100, 128-pin products: UART0 and UART2
1 0 − − −
1 − −
• 64-pin products
2
Unit Channel Used as CSI Used as UART Used as Simplified I C
1 CSI01 IIC01
2 CSI10 UART1 IIC10
3 CSI11 IIC11
3 CSI31 IIC31
Caution When using serial array unit as UARTs, the channels of both the transmitting side (even-number
channel) and the receiving side (odd-number channel) can be used only as UARTs.
Target channel Channel 0 of SAU0 Channel 2 of SAU0 Channel 0 of SAU1 Channel 2 of SAU1
Transfer end interrupt (in single-transfer mode) or buffer empty interrupt (in continuous transfer mode)
can be selected.
Max. fMCK/6 [bps] (SDRmn [15:9] = 3 or more), Min. fCLK/(2 × 2 × 128) [bps]
15 Note 2
Transfer rate
Notes 1. Only following UARTs can be specified for the 9-bit data length.
<R> • 24 to 64-pin products: UART0
• 80, 100, 128-pin products: UART0 and UART2
2. Use this operation within a range that satisfies the conditions above and the AC characteristics in the
electrical specifications (see CHAPTER 29 ELECTRICAL SPECIFICATIONS).
SCRmn TXEmn RXEmn DAPmn CKPmn EOCmn PTCmn1 PTCmn0 DIRmn SLCmn1 SLCmn0 DLSmn1 DLSmn0
1 0 0 0 0 0 0/1 0/1 0/1 0 0/1 0/1 0 1 0/1 0/1
SDRmn
Baud rate setting Transmit data setting
0 Note
TXDq
(d) Serial output level register m (SOLm) … Sets only the bits of the target channel.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Note When UART0 performs 9-bit communication (by setting the DLS001 and DLS000 bits of the SCR00 register
to 1), bits 0 to 8 of the SDR00 register are used as the transmission data specification area. Only following
UARTs can be specified for the 9-bit data length.
<R> • 24 to 64-pin products: UART0
• 80, 100, 128-pin products: UART0 and UART2
Remarks 1. m: Unit number (m = 0, 1), n: Channel number (n = 0, 2), q: UART number (q = 0 to 3),
mn = 00, 02, 10, 12
2. : Setting is fixed in the UART transmission mode, : Setting disabled (set to the initial value)
×: Bit that cannot be used in this mode (set to the initial value when not used in any mode)
0/1: Set to 0 or 1 depending on the usage of the user
(e) Serial output register m (SOm) … Sets only the bits of the target channel.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
(f) Serial output enable register m (SOEm) … Sets only the bits of the target channel to 1.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
(g) Serial channel start register m (SSm) … Sets only the bits of the target channel to 1.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Note Before transmission is started, be sure to set to 1 when the SOLmn bit of the target channel is set to 0, and
set to 0 when the SOLmn bit of the target channel is set to 1. The value varies depending on the
communication data during communication operation.
Setting the SOm register Set the initial output level of the serial
data (SOmn).
Remark Even after communication is stopped, the pin level is retained. To resume the operation, re-set serial
output register m (SOm) (see Figure 12-80 Procedure for Resuming UART Transmission).
(Essential) Changing setting of the SOEm register Clear the SOEmn bit to 0 and stop
SSmn
STmn
SEmn
Data transmission (7-bit length) Data transmission (7-bit length) Data transmission (7-bit length)
TSFmn
SMRmn, SCRmn: Setting communication Specify the initial settings while the
SDRmn[15:9]: Setting transfer rate SEmn bit of serial channel enable
status register m (SEm) is 0 (operation
SOLmn: Setting output data level
is stopped).
SOm, SOEm: Setting output
Port manipulation
Yes
No
Transmission completed?
Yes
End of communication
Figure 12-83. Timing Chart of UART Transmission (in Continuous Transmission Mode)
SSmn
STmn
SEmn
Data transmission (7-bit length) Data transmission (7-bit length) Data transmission (7-bit length)
MDmn0
TSFmn
BFFmn
<1> <2> <3> <2> <3> <2> <3> <4> <5> <6>
(Note)
Note If transmit data is written to the SDRmn register while the BFFmn bit of serial status register mn (SSRmn) is
1 (valid data is stored in serial data register mn (SDRmn)), the transmit data is overwritten.
Caution The MDmn0 bit of serial mode register mn (SSRmn) can be rewritten even during operation.
However, rewrite it before transfer of the last bit is started, so that it will be rewritten before the
transfer end interrupt of the last transmit data.
SMRmn, SCRmn: Setting communication Specify the initial settings while the
SDRmn[15:9]: Setting transfer rate SEmn bit of serial channel enable status
<1> Select the buffer empty interrupt. register m (SEm) is 0 (operation is
SOLmn: Setting output data level
stopped).
SOm, SOEm: Setting output
Port manipulation
Yes <3>
Yes
Transmitting next data?
No
TSFmn = 1?
No
Yes
Yes <5>
Yes
Writing 1 to the MDmn0 bit Communication continued?
No
End of communication
Remark <1> to <6> in the figure correspond to <1> to <6> in Figure 12-83 Timing Chart of UART
Transmission (in Continuous Transmission Mode).
Target channel Channel 1 of SAU0 Channel 3 of SAU0 Channel 1 of SAU1 Channel 3 of SAU1
Transfer end interrupt only (Setting the buffer empty interrupt is prohibited.)
Max. fMCK/6 [bps] (SDRmn [15:9] = 3 or more), Min. fCLK/(2 × 2 × 128) [bps]
15 Note 2
Transfer rate
Notes 1. Only following UARTs can be specified for the 8-bit data length.
<R> • 24 to 64-pin products: UART0 only
• 80, 100, 128-pin products: UART0 and UART2 only
2. Use this operation within a range that satisfies the conditions above and the AC characteristics in the
electrical specifications (see CHAPTER 29 ELECTRICAL SPECIFICATIONS).
Operation clock (fMCK) of channel n 0: Forward (normal) reception Operation mode of channel n
0: Prescaler output clock CKm0 1: Reverse reception 0: Transfer end interrupt
set by the SPSm register
1: Prescaler output clock CKm1
set by the SPSm register
SCRmn TXEmn RXEmn DAPmn CKPmn EOCmn PTCmn1 PTCmn0 DIRmn DLSmn1 DLSmn0
0 1 0 0 0 1 0/1 0/1 0/1 0 0 0 0 1 0/1 0/1
RXDq
Note When UART performs 9-bit communication, bits 0 to 8 of the SDRm1 register are used as the transmission
data specification area. Only following UARTs can be specified for the 8-bit data length.
<R> • 24 to 64-pin products: UART0
• 80, 100, 128-pin products: UART0 and UART2
Caution For the UART reception, be sure to set the SMRmr register of channel r to UART transmission mode
that is to be paired with channel n.
Remarks 1. m: Unit number (m = 0, 1), n: Channel number (n = 1, 3), mn = 01, 03, 11, 13
r: Channel number (r = n − 1), q: UART number (q = 0 to 3)
2. : Setting is fixed in the UART reception mode, : Setting disabled (set to the initial value)
×: Bit that cannot be used in this mode (set to the initial value when not used in any mode)
0/1: Set to 0 or 1 depending on the usage of the user
(e) Serial output register m (SOm) … The register that not used in this mode.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
(f) Serial output enable register m (SOEm) …The register that not used in this mode.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
(g) Serial channel start register m (SSm) … Sets only the bits of the target channel is 1.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Caution For the UART reception, be sure to set the SMRmr register of channel r to UART Transmission
mode that is to be paired with channel n.
Remarks 1. m: Unit number (m = 0, 1), n: Channel number (n = 1, 3), mn = 01, 03, 11, 13
r: Channel number (r = n − 1), q: UART number (q = 0 to 3)
2. : Setting is fixed in the UART reception mode, : Setting disabled (set to the initial value)
×: Bit that cannot be used in this mode (set to the initial value when not used in any mode)
0/1: Set to 0 or 1 depending on the usage of the user
Writing to the SSm register Set the SSmn bit of the target channel to 1 and
set the SEmn bit to 1 (to enable operation).
Caution Set the RXEmn bit of SCRmn register to 1, and then be sure to set SSmn to 1 after 4 or more fCLK
clocks have elapsed.
Changing setting of the SMRmn Re-set the registers to change serial mode
(Selective)
registers mn, mr (SMRmn, SMRmr)
and SMRmr registers
setting.
(Selective)
Re-set the register to change serial
Changing setting of the SCRmn register
communication operation setting register
mn (SCRmn) setting.
SSmn
STmn
SEmn
Receive data 3
SDRmn Receive data 1 Receive data 2
Data reception (7-bit length) Data reception (7-bit length) Data reception (7-bit length)
TSFmn
Remark m: Unit number (m = 0, 1), n: Channel number (n = 1, 3), mn = 01, 03, 11, 13
r: Channel number (r = n − 1), q: UART number (q = 0 to 3)
Port manipulation
Starting reception
Yes
Reading the RXDq register
Note
(SDRmn[7:0]) Error processing
Reception completed?
No
Yes
Note In case of 9-bit of data, be sure to read SDRmn [8:0] and not the RxDq register.
Caution Set the RXEmn bit of SCRmn to 1, and then be sure to set SSmn = 1 after 4 or more fCLK clocks
have elapsed.
When using the SNOOZE mode function, set the SWCm bit of serial standby control register m (SSCm) to 1 before
switching to the STOP mode.
Cautions 1. The SNOOZE mode can only be specified when the high-speed on-chip oscillator clock is selected
for fCLK.
2. The maximum transfer rate when using UARTq in the SNOOZE mode is 9600 bps (target).
Figure 12-91. Timing Chart of SNOOZE Mode Operation (Normal operation mode)
CPU operation status Normal peration STOP mode SNOOZE mode Normal peration
<4>
SSm1
STm1
SEm1
SWCm
SSECm L
Clock request signal
(internal signal)
Receive data 2
SDRm1 Receive data 1
<9>
Read Note1
RxDq pin ST Receive data 1 P SP ST Receive data 2 P SP
Shift
Shift operation Shift operation
register m1
INTSRq
Data reception (7-bit length) Data reception (7-bit length)
INTSREq L <7>
TSFm1
Note Only read received data while SWCm = 1 and before the next edge of the RxDq pin input is detected.
Caution Before switching to the SNOOZE mode or after reception operation in the SNOOZE mode
finishes, be sure to set the STm1 bit to 1 and clear the SEm1 bit (to stop the operation).
Remarks 1. <1> to <11> in the figure correspond to <1> to <11> in Figure 12-93. Flowchart of SNOOZE Mode
Operation (Normal Operation/Abnormal Operation <1>).
<R> 2. 24 to 64-pin products: m = 0; q = 0
80, 100, 128-pin products: m = 0, 1; q = 0, 2
Figure 12-92. Timing Chart of SNOOZE Mode Operation (Abnormal Operation <1>)
CPU operation status Normal peration STOP mode SNOOZE mode Normal peration
<4>
SSm1
STm1
SEm1
SWCm
SSECm L
Clock request signal
(internal signal)
Receive data 2
SDRm1 Receive data 1
INTSRq
Data reception (7-bit length) <7> Data reception (7-bit length)
INTSREq L
TSFm1
Caution Before switching to the SNOOZE mode or after reception operation in the SNOOZE mode
finishes, be sure to set the STm1 bit to 1 and clear the SEm1 bit (to stop the operation).
Remarks 1. <1> to <11> in the figure correspond to <1> to <11> in Figure 12-93. Flowchart of SNOOZE Mode
Operation (Normal Operation/Abnormal Operation <1>).
<R> 2. 24 to 64-pin products: m = 0; q = 0
80, 100, 128-pin products: m = 0, 1; q = 0, 2
Figure 12-93. Flowchart of SNOOZE Mode Operation (Normal Operation/Abnormal Operation <1>)
Setting start
No
Does TSFmn = 0 on all
channels?
Yes
<4> Entered the STOP mode fCLK supplied to the SAU is stopped.
The clock request signal is set to the high level, and fCLK
No
(the high-speed on-chip oscillator clock) is requested for
<5> Was an RxDq edge
detected? the clock generator. After the oscillation-accuracy
Yes stabilization time passes, supplying a clock to SAU starts.
<6> Entered the SNOOZE mode The clock is supplied and UART reception is started.
No
Transfer end interrupt (INTSRq)
<8> generated?
Yes
Remarks 1. <1> to <11> in the figure correspond to <1> to <11> in Figure 12-91. Timing Chart of SNOOZE
Mode Operation (Normal operation mode) and Figure 12-92. Timing Chart of SNOOZE Mode
Operation (Abnormal Operation <1>).
<R> 2. 24 to 64-pin products: m = 0; q = 0
80, 100, 128-pin products: m = 0, 1; q = 0, 2
Figure 12-94. Timing Chart of SNOOZE Mode Operation (Abnormal Operation <2>)
CPU operation status Normal operation STOP mode SNOOZE mode STOP mode SNOOZE mode Normal
operation
<4>
SSm1
STm1
SEm1
SWCm
SSECm
Clock request signal
(internal signal)
Receive data 2
SDRm1 Receive data 1
<9>
Read Note1
RxDq pin ST Receive data 1 P SP ST Receive data 2 P SP
Shift
register m1 Shift operation Shift operation
INTSRq
Data reception (7-bit length) Data reception (7-bit length)
INTSREq L Note 2
TSFm1
Notes 1. Only read received data while SWCm = 1 and before the next edge of the RxDq pin input is detected.
2. After UARTq successfully finishes reception in the SNOOZE mode, it is possible to continue to perform
normal reception operations without changing the settings, but, because SSECm = 1, the PEFm1 and
FEFm1 bits are not set even if a framing error or parity error occurs. In addition, no error interrupt
(INTSREq) is generated.
Cautions 1. Before switching to the SNOOZE mode or after reception operation in the SNOOZE mode
finishes, be sure to set the STm1 bit to 1 and clear the SEm1 bit (to stop the operation).
2. When using the SNOOZE mode while SSECm is set to 1, no overrun errors occur. Therefore,
when using the SNOOZE mode, read bits 7 to 0 (RxDq) of the SDRm1 register before switching
to the STOP mode.
Remarks 1. <1> to <9> in the figure correspond to <1> to <9> in Figure 12-95. Flowchart of SNOOZE Mode
Operation (Abnormal Operation <2>).
<R> 2. 24 to 64-pin products: m = 0; q = 0
80, 100, 128-pin products: m = 0, 1; q = 0, 2
Setting start
No
Does TSFmn = 0 on all
channels?
Yes
<4>
Entered the STOP mode fCLK supplied to the SAU is stopped.
The clock request signal is set to the high level, and fCLK
No
(the high-speed on-chip oscillator clock) is requested for
<5> Was an RxDq edge
detected? the clock generator. After the oscillation-accuracy
Yes stabilization time passes, supplying a clock to SAU starts.
<6> Entered the SNOOZE mode The clock is supplied and UART reception is started.
No
No
Transfer end interrupt (INTSRq)
<8> generated?
Yes
Normal processing
Normal operation of UARTq
Caution When using the SNOOZE mode while SSECm is set to 1, no overrun errors occur. Therefore,
when using the SNOOZE mode, read bits 7 to 0 (RxDq) of the SDRm1 register before switching to
the STOP mode.
Remarks 1. <1> to <9> in the figure correspond to <1> to <9> in Figure 12-94. Timing Chart of SNOOZE Mode
Operation (Abnormal Operation <2>).
<R> 2. 24 to 64-pin products: m = 0; q = 0
80, 100, 128-pin products: m = 0, 1; q = 0, 2
(Baud rate) = {Operation clock (fMCK) frequency of target channel} ÷ (SDRmn[15:9] + 1) ÷ 2 [bps]
Caution Setting serial data register mn (SDRmn) SDRmn[15:9] = (0000000B, 0000001B) is prohibited.
Remarks 1. When UART is used, the value of SDRmn[15:9] is the value of bits 15 to 9 of the SDRmn register
(0000010B to 1111111B) and therefore is 2 to 127.
2. m: Unit number (m = 0, 1), n: Channel number (n = 0 to 3), mn = 00 to 03, 10 to 13
The operation clock (fMCK) is determined by serial clock select register m (SPSm) and bit 15 (CKSmn) of serial
mode register mn (SMRmn).
0 X X X X 0 0 0 0 fCLK 32 MHz
X X X X 0 0 0 1 fCLK/2 16 MHz
2
X X X X 0 0 1 0 fCLK/2 8 MHz
3
X X X X 0 0 1 1 fCLK/2 4 MHz
4
X X X X 0 1 0 0 fCLK/2 2 MHz
5
X X X X 0 1 0 1 fCLK/2 1 MHz
6
X X X X 0 1 1 0 fCLK/2 500 kHz
7
X X X X 0 1 1 1 fCLK/2 250 kHz
8
X X X X 1 0 0 0 fCLK/2 125 kHz
9
X X X X 1 0 0 1 fCLK/2 62.5 kHz
10
X X X X 1 0 1 0 fCLK/2 31.25 kHz
11
X X X X 1 0 1 1 fCLK/2 15.63 kHz
1 0 0 0 0 X X X X fCLK 32 MHz
0 0 0 1 X X X X fCLK/2 16 MHz
2
0 0 1 0 X X X X fCLK/2 8 MHz
3
0 0 1 1 X X X X fCLK/2 4 MHz
4
0 1 0 0 X X X X fCLK/2 2 MHz
5
0 1 0 1 X X X X fCLK/2 1 MHz
6
0 1 1 0 X X X X fCLK/2 500 kHz
7
0 1 1 1 X X X X fCLK/2 250 kHz
8
1 0 0 0 X X X X fCLK/2 125 kHz
9
1 0 0 1 X X X X fCLK/2 62.5 kHz
10
1 0 1 0 X X X X fCLK/2 31.25 kHz
11
1 0 1 1 X X X X fCLK/2 15.63 kHz
Other than above Setting prohibited
Note When changing the clock selected for fCLK (by changing the system clock control register (CKC) value), do so
after having stopped (serial channel stop register m (STm) = 000FH) the operation of the serial array unit
(SAU).
(Baud rate error) = (Calculated baud rate value) ÷ (Target baud rate) × 100 − 100 [%]
±0.0 %
3
31250 bps fCLK/2 63 31250.0 bps
2
38400 bps fCLK/2 103 38461.5 bps +0.16 %
Remark m: Unit number (m = 0, 1), n: Channel number (n = 0, 2), mn = 00, 02, 10, 12
2 × k × Nfr
(Maximum receivable baud rate) = × Brate
2 × k × Nfr − k + 2
2 × k × (Nfr − 1)
(Minimum receivable baud rate) = × Brate
2 × k × Nfr − k − 2
Brate: Calculated baud rate value at the reception side (See 12.6.4 (1) Baud rate calculation expression.)
k: SDRmn[15:9] + 1
Nfr: 1 data frame length [bits]
= (Start bit) + (Data length) + (Parity bit) + (Stop bit)
Remark m: Unit number (m = 0, 1), n: Channel number (n = 1, 3), mn = 01, 03, 11, 13
Figure 12-96. Permissible Baud Rate Range for Reception (1 Data Frame Length = 11 Bits)
Latch
timing
FL
1 data frame (11 × FL)
As shown in Figure 12-96, the timing of latching receive data is determined by the division ratio set by bits 15 to 9
of serial data register mn (SDRmn) after the start bit is detected. If the last data (stop bit) is received before this
latch timing, the data can be correctly received.
12.6.5 Procedure for processing errors that occurred during UART (UART0 to UART3) communication
The procedure for processing errors that occurred during UART (UART0 to UART3) communication is described in
Figures 12-97 and 12-98.
Reads serial data register mn The BFFmn bit of the SSRmn register This is to prevent an overrun error if the
(SDRmn). is set to 0 and channel n is enabled to next reception is completed during error
receive data. processing.
Reads serial status register mn Error type is identified and the read
(SSRmn). value is used to clear error flag.
Writes 1 to serial flag clear trigger Error flag is cleared. Error can be cleared only during
register mn (SIRmn). reading, by writing the value read from
the SSRmn register to the SIRmn
register without modification.
Reads serial data register mn The BFFmn bit of the SSRmn register This is to prevent an overrun error if the
(SDRmn). is set to 0 and channel n is enabled to next reception is completed during error
receive data. processing.
Reads serial status register mn Error type is identified and the read
(SSRmn). value is used to clear error flag.
Writes serial flag clear trigger register mn Error flag is cleared. Error can be cleared only during
(SIRmn). reading, by writing the value read from
the SSRmn register to the SIRmn
register without modification.
Sets the STmn bit of serial channel stop The SEmn bit of serial channel enable
register m (STm) to 1. status register m (SEm) is set to 0 and
channel n stops operating.
Sets the SSmn bit of serial channel start The SEmn bit of serial channel enable
register m (SSm) to 1. status register m (SEm) is set to 1 and
channel n is enabled to operate.
Support of LIN communication Not supported Not supported Supported Not supported
Interrupt − − INTST2 −
Transfer end interrupt (in single-transfer mode) or buffer empty interrupt (in continuous transfer
mode) can be selected.
Max. fMCK/6 [bps] (SDR10 [15:9] = 3 or more), Min. fCLK/(2 × 2 × 128) [bps]
15 Note
Transfer rate
Note Use this operation within a range that satisfies the conditions above and the AC characteristics in the electrical
specifications (see CHAPTER 29 ELECTRICAL SPECIFICATIONS).
LIN stands for Local Interconnect Network and is a low-speed (1 to 20 kbps) serial communication protocol designed to
reduce the cost of an automobile network.
Communication of LIN is single-master communication and up to 15 slaves can be connected to one master.
The slaves are used to control switches, actuators, and sensors, which are connected to the master via LIN.
Usually, the master is connected to a network such as CAN (Controller Area Network).
A LIN bus is a single-wire bus to which nodes are connected via transceiver conforming to ISO9141.
According to the protocol of LIN, the master transmits a frame by attaching baud rate information to it. A slave receives
this frame and corrects a baud rate error from the master. If the baud rate error of a slave is within ±15%, communication
can be established.
Wakeup signal Sync break Sync field Identification Data field Data field Checksum
frame field field field
LIN Bus
TXD2
(output)
INTST2Note 3
Notes 1. The baud rate is set so as to satisfy the standard of the wakeup signal and data of 00H is transmitted.
2. A sync break field is defined to have a width of 13 bits and output a low level. Where the baud rate for main
transfer is N [bps], therefore, the baud rate of the sync break field is calculated as follows.
(Baud rate of sync break field) = 9/13 × N
By transmitting data of 00H at this baud rate, a sync break field is generated.
3. INTST2 is output upon completion of transmission. INTST2 is also output when SBF transmission is
executed.
Transmitting wakeup
signal frame
Transmitting
sync break field
Identification field
Data field
Transmitting data
Checksum field
Support of LIN communication Not supported Not supported Supported Not supported
Interrupt − − INTSR2 −
Transfer end interrupt only (Setting the buffer empty interrupt is prohibited.)
Max. fMCK/6 [bps] (SDR11 [15:9] = 3 or more), Min. fCLK/(2 × 2 × 128) [bps]
15 Note
Transfer rate
Note Use this operation within a range that satisfies the conditions above and the AC characteristics in the electrical
specifications (see CHAPTER 29 ELECTRICAL SPECIFICATIONS).
Wakeup signal Sync break Sync field Identification Data filed Data filed Checksum
frame field field field
LIN Bus
<2> <5>
RXD2 (input)
Disable Enable
<3>
Reception interrupt
(INTSR2)
<1>
Edge detection
(INTP0)
<4>
Capture
Disable Enable
timer
<1> The wakeup signal is detected by detecting an interrupt edge (INTP0) on a pin. When the wakeup signal is
detected, enable reception of UART2 (RXE11 = 1) and wait for SBF reception.
<2> When the start bit of SBF is detected, reception is started and serial data is sequentially stored in the RXD2
register (= bits 7 to 0 of serial data register 11 (SDR11)) at the set baud rate. When the stop bit is detected, the
reception end interrupt request (INTSR2) is generated. When data of low levels of 11 bits or more is detected as
SBF, it is judged that SBF reception has been correctly completed. If data of low levels of less than 11 bits is
detected as SBF, it is judged that an SBF reception error has occurred, and the system returns to the SBF
reception wait status.
<3> When SBF reception has been correctly completed, start channel 7 of the timer array unit and measure the bit
interval (pulse width) of the sync field (see 6.7.5 Operation as input signal high-/low-level width
measurement).
<4> Calculate a baud rate error from the bit interval of sync field (SF). Stop UART2 once and adjust (re-set) the baud
rate.
<5> The checksum field should be distinguished by software. In addition, processing to initialize UART2 after the
checksum field is received and to wait for reception of SBF should also be performed by software.
Figure 12-102 and figure 12-103 show the configuration of a port that manipulates reception of LIN.
The wakeup signal transmitted from the master of LIN is received by detecting an edge of an external interrupt (INTP0).
The length of the sync field transmitted from the master can be measured by using the external event capture operation of
the timer array unit 0 to calculate a baud-rate error.
By controlling switch of port input (ISC0/ISC1), the input source of port input (RxD2) for reception can be input to the
external interrupt pin (INTP0) and timer array unit
Figure 12-102 Port Configuration for Manipulating Reception of LIN (30, 32, 36, 40-pin)
Selector
P14/RxD2/SI20/SDA20
RXD2 input
Port mode
(PM14)
Output latch
(P14)
Selector
P137/INTP0
INTP0 input
Port input
switch control
(ISC0)
<ISC0>
0: Selects INTP0 (P137)
1: Selects RxD2 (P14)
Port input
switch control
(ISC1)
<ISC1>
0: Do not use a timer input signal for channel 7.
1: Selects RxD2 (P14)
Remark ISC0, ISC1: Bits 0 and 1 of the input switch control register (ISC) (See Figure 12-19.)
Figure 12-103 Port Configuration for Manipulating Reception of LIN (44, 48, 52, 64-pin)
Selector
P14/RxD2/SI20/SDA20
RXD2 input
Port mode
(PM14)
Output latch
(P14)
Selector
P137/INTP0
INTP0 input
Port input
switch control
(ISC0)
<ISC0>
0: Selects INTP0 (P137)
1: Selects RxD2 (P14)
Selector
Selector
P41/TI07/TO07
Port mode
(PM41) Port input
switch control
(ISC1)
Output latch
<ISC1>
(P41)
0: Selects TI07 (P41)
1: Selects RxD2 (P14)
Remark ISC0, ISC1: Bits 0 and 1 of the input switch control register (ISC) (See Figure 12-19.)
The peripheral functions used for the LIN communication operation are as follows.
SBF detected?
INTP0,
TAU
Stopping operation
Sync field
Detecting low-level width
2
12.8 Operation of Simplified I C (IIC00, IIC01, IIC10, IIC11, IIC20, IIC21, IIC30, IIC31) Communication
This is a clocked communication function to communicate with two or more devices by using two lines: serial clock
(SCL) and serial data (SDA). This communication function is designed to execute single communication with devices such
as EEPROM, flash memory, and A/D converter, and therefore, can be used only by the master.
Make sure by using software, as well as operating the control registers, that the AC specifications of the start and stop
conditions are observed.
[Data transmission/reception]
• Master transmission, master reception (only master function with a single master)
• ACK output functionNote and ACK detection function
• Data length of 8 bits
(When an address is transmitted, the address is specified by the higher 7 bits, and the least significant bit is
used for R/W control.)
• Manual generation of start condition and stop condition
[Interrupt function]
• Transfer end interrupt
[Error detection flag]
• Overrun error
• Parity error (ACK error)
Note When receiving the last data, ACK will not be output if 0 is written to the SOEmn (SOEm register) bit and serial
communication data output is stopped. See the processing flow in 12.8.3 (2) for details.
2
The channel supporting simplified I C (IIC00, IIC01, IIC10, IIC11, IIC20, IIC21, IIC30, IIC31) is channels 0 to 3 of SAU0
and channel 0 and 1 of SAU1.
1 − −
2 − UART1 −
3 CSI11 IIC11
1 0 − − −
1 − −
1 − −
2 − UART1 −
3 CSI11 IIC11
1 − −
1 − −
2 − UART1 −
3 CSI11 IIC11
2 − UART1 −
3 CSI11 IIC11
• 64-pin products
2
Unit Channel Used as CSI Used as UART Used as Simplified I C
2
Simplified I C (IIC00, IIC01, IIC10, IIC11, IIC20, IIC21, IIC30, IIC31) performs the following four types of communication
operations.
• Address field transmission (See 12.8.1.)
• Data transmission (See 12.8.2.)
• Data reception (See 12.8.3.)
• Stop condition generation (See 12.8.4.)
2
Simplified I C IIC00 IIC01 IIC10 IIC11 IIC20 IIC21 IIC30 IIC31
Target channel Channel 0 Channel 1 Channel 2 Channel 3 Channel 0 Channel 1 Channel 2 Channel 3
of SAU0 of SAU0 of SAU0 of SAU0 of SAU1 of SAU1 of SAU1 of SAU1
Pins used SCL00, SCL01, SCL10, SCL11, SCL20, SCL21, SCL30, SCL31,
Note Note Note Note Note Note Note Note
SDA00 SDA01 SDA10 SDA11 SDA20 SDA21 SDA30 SDA31
Transfer end interrupt only (Setting the buffer empty interrupt is prohibited.)
Transfer data length 8 bits (transmitted with specifying the higher 7 bits as address and the least significant bit as R/W control)
Transfer rate Max. fMCK/2 [Hz] (SDRmn[15:9] = 1 or more) fMCK: Operation clock frequency of target channel
2
However, the following condition must be satisfied in each mode of I C.
• Max. 1 MHz (first mode plus)
• Max. 400 kHz (first mode)
• Max. 100 kHz (standard mode)
2
Note To perform communication via simplified I C, set the N-ch open-drain output (VDD tolerance) mode (POM03,
<R> POM11, POM14, POM50, POM53, POM71, POM74, POM143 = 1) for the port output mode registers (POM0,
POM1, POM4, POM5, POM7 to POM9, POM14) (see 4.3 Registers Controlling Port Function for details). When
IIC00, IIC10, IIC20, IIC30, IIC31 communicating with an external device with a different potential, set the N-ch
open-drain output (VDD tolerance) mode (POM04, POM10, POM15, POM54, POM142 = 1) also for the clock
input/output pins (SCL00, SCL10, SCL20, SCL30, SCL31) (see 4.4.4 Connecting to external device with
different potential (2.5 V, 3 V) for details).
SCRmn TXEmn RXEmn DAPmn CKPmn EOCmn PTCmn1 PTCmn0 DIRmn SLCmn1 SLCmn0 DLSmn1 DLSmn0
1 0 0 0 0 0 0 0 0 0 0 1 0 1 1 1
Setting of parity bit Setting of stop bit
00B: No parity 01B: Appending 1 bit (ACK)
SDRmn
Baud rate setting Transmit data setting (address + R/W)
0
SIOr
(d) Serial output register m (SOm)
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Remarks 1. m: Unit number (m = 0, 1), n: Channel number (n = 0 to 3), r: IIC number (r = 00, 01, 10, 11, 20, 21,
30, 31), mn = 00 to 03, 10 to 13
2. : Setting is fixed in the IIC mode, : Setting disabled (set to the initial value)
×: Bit that cannot be used in this mode (set to the initial value when not used in any mode)
0/1: Set to 0 or 1 depending on the usage of the user
2
Figure 12-105. Example of Contents of Registers for Address Field Transmission of Simplified I C (IIC00, IIC01,
IIC10, IIC11, IIC20, IIC21, IIC30, IIC31) (2/2)
(f) Serial channel start register m (SSm) … Sets only the bits of the target channel is 1.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Remarks 1. m: Unit number (m = 0, 1), n: Channel number (n = 0 to 3), r: IIC number (r = 00, 01, 10, 11, 20, 21,
30, 31), mn = 00 to 03, 10 to 13
2. : Setting disabled (set to the initial value)
×: Bit that cannot be used in this mode (set to the initial value when not used in any mode)
0/1: Set to 0 or 1 depending on the usage of the user
Changing setting of the SOEm Set the SOEmn bit to 1 and enable data
register output of the target channel.
SSmn
SEmn
SOEmn
SCLr output
CKOmn
bit manipulation
SDAr output D7 D6 D5 D4 D3 D2 D1 D0
SOmn bit manipulation
R/W
Address
SDAr input D7 D6 D5 D4 D3 D2 D1 D0 ACK
Shift
Shift operation
register mn
INTIICr
TSFmn
Remark m: Unit number (m = 0, 1), n: Channel number (n = 0 to 3), r: IIC number (r = 00, 01, 10, 11, 20, 21,
30, 31), mn = 00 to 03, 10 to 13
Yes
No
ACK reception error
Address field
transmission completed
2
Simplified I C IIC00 IIC01 IIC10 IIC11 IIC20 IIC21 IIC30 IIC31
Target channel Channel 0 Channel 1 Channel 2 Channel 3 Channel 0 Channel 1 Channel 2 Channel 3
of SAU0 of SAU0 of SAU0 of SAU0 of SAU1 of SAU1 of SAU1 of SAU1
Pins used SCL00, SCL01, SCL10, SCL11, SCL20, SCL21, SCL30, SCL31,
Note Note Note Note Note Note Note Note
SDA00 SDA01 SDA10 SDA11 SDA20 SDA21 SDA30 SDA31
Transfer end interrupt only (Setting the buffer empty interrupt is prohibited.)
Transfer rate Max. fMCK/2 [Hz] (SDRmn[15:9] = 1 or more) fMCK: Operation clock frequency of target channel
2
However, the following condition must be satisfied in each mode of I C.
• Max. 1 MHz (first mode plus)
• Max. 400 kHz (first mode)
• Max. 100 kHz (standard mode)
Note To perform communication via simplified I2C, set the N-ch open-drain output (VDD tolerance) mode (POM03,
<R> POM11, POM14, POM50, POM53, POM71, POM74, POM143 = 1) for the port output mode registers (POM0,
POM1, POM4, POM5, POM7 to POM9, POM14) (see 4.3 Registers Controlling Port Function for details). When
IIC00, IIC10, IIC20, IIC30, IIC31 communicating with an external device with a different potential, set the N-ch
open-drain output (VDD tolerance) mode (POM04, POM10, POM15, POM54, POM142 = 1) also for the clock
input/output pins (SCL00, SCL10, SCL20, SCL30, SCL31) (see 4.4.4 Connecting to external device with
different potential (2.5 V, 3 V) for details).
Figure 12-109. Example of Contents of Registers for Data Transmission of Simplified I2C (IIC00, IIC01, IIC10, IIC11,
IIC20, IIC21, IIC30, IIC31) (1/2)
(a) Serial mode register mn (SMRmn) … Do not manipulate this register during data
transmission/reception.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
(b) Serial communication operation setting register mn (SCRmn) … Do not manipulate the bits of this
register, except the TXEmn and
RXEmn bits, during data
transmission/reception.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
SCRmn TXEmn RXEmn DAPmn CKPmn EOCmn PTCmn1 PTCmn0 DIRmn SLCmn1 SLCmn0 DLSmn1 DLSmn0
1 0 0 0 0 0 0 0 0 0 0 1 0 1 1 1
SDRmn
Baud rate setting Transmit data setting
0
SIOr
(d) Serial output register m (SOm) … Do not manipulate this register during data
transmission/reception.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
(e) Serial output enable register m (SOEm) … Do not manipulate this register during data
transmission/reception.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Note The value varies depending on the communication data during communication operation.
Remarks 1. m: Unit number (m = 0, 1), n: Channel number (n = 0 to 3), r: IIC number (r = 00, 01, 10, 11, 20, 21,
30, 31), mn = 00 to 03, 10 to 13
2. : Setting is fixed in the IIC mode, : Setting disabled (set to the initial value)
×: Bit that cannot be used in this mode (set to the initial value when not used in any mode)
0/1: Set to 0 or 1 depending on the usage of the user
2
Figure 12-109. Example of Contents of Registers for Data Transmission of Simplified I C (IIC00, IIC01, IIC10, IIC11,
IIC20, IIC21, IIC30, IIC31) (2/2)
(f) Serial channel start register m (SSm) … Do not manipulate this register during data
transmission/reception.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Remarks 1. m: Unit number (m = 0, 1), n: Channel number (n = 0 to 3), r: IIC number (r = 00, 01, 10, 11, 20, 21,
30, 31), mn = 00 to 03, 10 to 13
2. : Setting disabled (set to the initial value)
×: Bit that cannot be used in this mode (set to the initial value when not used in any mode)
0/1: Set to 0 or 1 depending on the usage of the user
SSmn “L”
SEmn
“H”
SOEmn “H”
SCLr output
SDAr output D7 D6 D5 D4 D3 D2 D1 D0
Shift
Shift operation
register mn
INTIICr
TSFmn
Address field
transmission completed
Yes
No
ACK reception error
No
Data transfer completed?
Yes
Data transmission
completed
2
Simplified I C IIC00 IIC01 IIC10 IIC11 IIC20 IIC21 IIC30 IIC31
Target channel Channel 0 Channel 1 Channel 2 Channel 3 Channel 0 Channel 1 Channel 2 Channel 3
of SAU0 of SAU0 of SAU0 of SAU0 of SAU1 of SAU1 of SAU1 of SAU1
Pins used SCL00, SCL01, SCL10, SCL11, SCL20, SCL21, SCL30, SCL31,
Note Note Note Note Note Note Note Note
SDA00 SDA01 SDA10 SDA11 SDA20 SDA21 SDA30 SDA31
Transfer end interrupt only (Setting the buffer empty interrupt is prohibited.)
Transfer rate Max. fMCK/2 [Hz] (SDRmn[15:9] = 1 or more) fMCK: Operation clock frequency of target channel
2
However, the following condition must be satisfied in each mode of I C.
• Max. 1 MHz (first mode plus)
• Max. 400 kHz (first mode)
• Max. 100 kHz (standard mode)
Note To perform communication via simplified I2C, set the N-ch open-drain output (VDD tolerance) mode (POM03,
<R> POM11, POM14, POM50, POM53, POM71, POM74, POM143 = 1) for the port output mode registers (POM0,
POM1, POM4, POM5, POM7 to POM9, POM14) (see 4.3 Registers Controlling Port Function for details). When
IIC00, IIC10, IIC20, IIC30, IIC31 communicating with an external device with a different potential, set the N-ch
open-drain output (VDD tolerance) mode (POM04, POM10, POM15, POM54, POM142 = 1) also for the clock
input/output pins (SCL00, SCL10, SCL20, SCL30, SCL31) (see 4.4.4 Connecting to external device with
different potential (2.5 V, 3 V) for details).
Figure 12-112. Example of Contents of Registers for Data Reception of Simplified I2C (IIC00, IIC01, IIC10, IIC11,
IIC20, IIC21, IIC30, IIC31) (1/2)
(a) Serial mode register mn (SMRmn) … Do not manipulate this register during data
transmission/reception.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
(b) Serial communication operation setting register mn (SCRmn) … Do not manipulate the bits of this
register, except the TXEmn and
RXEmn bits, during data
transmission/reception.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
SCRmn TXEmn RXEmn DAPmn CKPmn EOCmn PTCmn1 PTCmn0 DIRmn SLCmn1 SLCmn0 DLSmn1 DLSmn0
0 1 0 0 0 0 0 0 0 0 0 1 0 1 1 1
SDRmn
Baud rate setting Dummy transmit data setting (FFH)
0
SIOr
(d) Serial output register m (SOm) … Do not manipulate this register during data
transmission/reception.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
(e) Serial output enable register m (SOEm) … Do not manipulate this register during data
transmission/reception.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Note The value varies depending on the communication data during communication operation.
Remarks 1. m: Unit number (m = 0, 1), n: Channel number (n = 0 to 3), r: IIC number (r = 00, 01, 10, 11, 20, 21,
30, 31), mn = 00 to 03, 10 to 13
2. : Setting is fixed in the IIC mode, : Setting disabled (set to the initial value)
×: Bit that cannot be used in this mode (set to the initial value when not used in any mode)
0/1: Set to 0 or 1 depending on the usage of the user
2
Figure 12-112. Example of Contents of Registers for Data Reception of Simplified I C (IIC00, IIC01, IIC10, IIC11,
IIC20, IIC21, IIC30, IIC31) (2/2)
(f) Serial channel start register m (SSm) … Do not manipulate this register during data
transmission/reception.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Remarks 1. m: Unit number (m = 0, 1), n: Channel number (n = 0 to 3), r: IIC number (r = 00, 01, 10, 11, 20, 21,
30, 31), mn = 00 to 03, 10 to 13
2. : Setting is fixed in the CSI master transmission mode, : Setting disabled (set to the initial value)
×: Bit that cannot be used in this mode (set to the initial value when not used in any mode)
0/1: Set to 0 or 1 depending on the usage of the user
SSmn
STmn
SEmn
SOEmn “H”
TXEmn,
TXEmn = 1 / RXEmn = 0 TXEmn = 0 / RXEmn = 1
RXEmn
SDRmn Dummy data (FFH) Receive data
SCLr output
SDAr input D7 D6 D5 D4 D3 D2 D1 D0
Shift
Shift operation
register mn
INTIICr
TSFmn
STmn
SEmn
SCLr output
SDAr input D2 D1 D0 D7 D6 D5 D4 D3 D2 D1 D0
Shift
Shift operation Shift operation
register mn
INTIICr
TSFmn
Step condition
Remark m: Unit number (m = 0, 1), n: Channel number (n = 0 to 3), r: IIC number (r = 00, 01, 10, 11, 20, 21, 30, 31),
mn = 00 to 03, 10 to 13
Yes
Last byte received?
No
Data transfer completed?
Yes
Caution ACK is not output when the last data is received (NACK). Communication is then completed by
setting “1” to the STmn bit of serial channel stop register m (STm) to stop operation and
generating a stop condition.
STmn
SEmn
SOEmn Note
SCLr output
SDAr output
Stop condition
Note During a receive operation, the SOEmn bit of serial output enable register m (SOEm) is cleared to 0 before
receiving the last data.
Completion of data
transmission/data reception
Remarks 1. The value of SDRmn[15:9] is the value of bits 15 to 9 of the SDRmn register (0000001B to
1111111B) and therefore is 1 to 127.
2. m: Unit number (m = 0, 1), n: Channel number (n = 0 to 3), mn = 00 to 03, 10 to 13
The operation clock (fMCK) is determined by serial clock select register m (SPSm) and bit 15 (CKSmn) of serial mode
register mn (SMRmn).
2
Table 12-4. Selection of Operation Clock For Simplified I C
Note
SMRmn SPSm Register Operation Clock (fMCK)
Register
CKSmn PRS PRS PRS PRS PRS PRS PRS PRS fCLK = 32 MHz
m13 m12 m11 m10 m03 m02 m01 m00
0 X X X X 0 0 0 0 fCLK 32 MHz
X X X X 0 0 0 1 fCLK/2 16 MHz
2
X X X X 0 0 1 0 fCLK/2 8 MHz
3
X X X X 0 0 1 1 fCLK/2 4 MHz
4
X X X X 0 1 0 0 fCLK/2 2 MHz
5
X X X X 0 1 0 1 fCLK/2 1 MHz
6
X X X X 0 1 1 0 fCLK/2 500 kHz
7
X X X X 0 1 1 1 fCLK/2 250 kHz
8
X X X X 1 0 0 0 fCLK/2 125 kHz
9
X X X X 1 0 0 1 fCLK/2 62.5 kHz
10
X X X X 1 0 1 0 fCLK/2 31.25 kHz
11
X X X X 1 0 1 1 fCLK/2 15.63 kHz
1 0 0 0 0 X X X X fCLK 32 MHz
0 0 0 1 X X X X fCLK/2 16 MHz
2
0 0 1 0 X X X X fCLK/2 8 MHz
3
0 0 1 1 X X X X fCLK/2 4 MHz
4
0 1 0 0 X X X X fCLK/2 2 MHz
5
0 1 0 1 X X X X fCLK/2 1 MHz
6
0 1 1 0 X X X X fCLK/2 500 kHz
7
0 1 1 1 X X X X fCLK/2 250 kHz
8
1 0 0 0 X X X X fCLK/2 125 kHz
9
1 0 0 1 X X X X fCLK/2 62.5 kHz
10
1 0 1 0 X X X X fCLK/2 31.25 kHz
11
1 0 1 1 X X X X fCLK/2 15.63 kHz
Other than above Setting prohibited
Note When changing the clock selected for fCLK (by changing the system clock control register (CKC) value), do so
after having stopped (serial channel stop register m (STm) = 000FH) the operation of the serial array unit
(SAU).
2
Here is an example of setting an I C transfer rate where fMCK = fCLK = 32 MHz.
2
I C Transfer Mode fCLK = 32 MHz
(Desired Transfer Rate) Operation Clock (fMCK) SDRmn[15:9] Calculated Error from Desired Transfer
Transfer Rate Rate
100 kHz fCLK/2 79 100 kHz 0.0%
400 kHz fCLK 39 400 kHz 0.0%
1 MHz fCLK/2 7 1 MHz 0.0%
2
12.8.6 Procedure for processing errors that occurred during simplified I C (IIC00, IIC01, IIC10, IIC11, IIC20, IIC21,
IIC30, IIC31) communication
The procedure for processing errors that occurred during simplified I2C (IIC00, IIC01, IIC10, IIC11, IIC20, IIC21, IIC30,
IIC31) communication is described in Figure 12-117 and 12-118.
Reads serial data register mn The BFFmn bit of the SSRmn register This is to prevent an overrun error if the
(SDRmn). is set to 0 and channel n is enabled to next reception is completed during error
receive data. processing.
Reads serial status register mn Error type is identified and the read
(SSRmn). value is used to clear error flag.
Writes 1 to serial flag clear trigger Error flag is cleared. Error can be cleared only during
register mn (SIRmn). reading, by writing the value read from
the SSRmn register to the SIRmn
register without modification.
Figure 12-118. Processing Procedure in Case of Parity Error (ACK error) in Simplified I2C Mode
Software Manipulation Hardware Status Remark
Reads serial data register mn The BFFmn bit of the SSRmn register is This is to prevent an overrun error if the
Reads serial status register mn (SSRmn). Error type is identified and the read
value is used to clear error flag.
Writes serial flag clear trigger register mn Error flag is cleared. Error can be cleared only during
(SIRmn). reading, by writing the value read from
the SSRmn register to the SIRmn
register without modification.
Sets the STmn bit of serial channel stop The SEmn bit of serial channel enable Slave is not ready for reception
register m (STm) to 1. status register m (SEm) is set to 0 and because ACK is not returned.
channel n stops operation. Therefore, a stop condition is created,
the bus is released, and
communication is started again from
the start condition. Or, a restart
condition is generated and
Creates stop condition. transmission can be redone from
Creates start condition. address transmission.
Sets the SSmn bit of serial channel start The SEmn bit of serial channel enable
register m (SSm) to 1. status register m (SEm) is set to 1 and
channel n is enabled to operate.
Remark m: Unit number (m = 0, 1), n: Channel number (n = 0 to 3), r: IIC number (r = 00, 01, 10, 11, 20, 21, 30, 31)
mn = 00 to 03, 10 to 13
The number of channels of the serial Interface IICA differs, depending on the product.
20-pin 24, 25, 30, 32, 36, 40, 80, 100, 128-pin
44, 48, 52, 56, 64-pin
channels − 1 ch 2 ch
Caution Most of the following descriptions in this chapter use the 64-pin products as an example.
Internal bus
Filter
Slave address Clear Start
SDAA0/ register 0 (SVA0) condition
Set generator
P61 Match
Noise signal
eliminator
Stop
IICA shift SO latch condition
D Q generator
register 0 (IICA0)
DFC0 IICWL0
Data hold
TRC0 time correction
N-ch open- circuit
drain output
Output control ACK
Output generator Wakeup
PM61 controller
latch
(P61)
ACK detector
Start condition
detector
Filter
Stop condition
SCLA0/ detector
P60
Interrupt request
Noise Serial clock signal generator INTIICA0
eliminator counter
IICS0.MSTS0, EXC0, COI0
DFC0 Serial clock
Serial clock wait controller IICA shift register 0 (IICA0)
controller Bus status
N-ch open- detector
fCLK IICCTL00.STT0, SPT0
Selector
drain output
IICA low-level width IICA high-level width WUP0 CLD0 DAD0 SMC0 DFC0 PRS0 STCF0 IICBSY0 STCEN0 IICRSV0
setting register 0 (IICWL0) setting register 0 (IICWH0)
IICA control register 01 IICA flag register 0
(IICCTL01) (IICF0)
Internal bus
+ VDD + VDD
Address 2
SCLA0
SDAA0
Slave IC
Address 3
SCLA0
SDAA0
Slave IC
Address N
SCLA0
Item Configuration
Registers IICA shift register 0 (IICA0)
Slave address register 0 (SVA0)
Control registers Peripheral enable register 0 (PER0)
IICA control register 00 (IICCTL00)
IICA status register 0 (IICS0)
IICA flag register 0 (IICF0)
IICA control register 01 (IICCTL01)
IICA low-level width setting register 0 (IICWL0)
IICA high-level width setting register 0 (IICWH0)
Port mode register 6 (PM6)
Port register 6 (P6)
Symbol 7 6 5 4 3 2 1 0
IICA0
Cautions 1. Do not write data to the IICA0 register during data transfer.
2. Write or read the IICA0 register only during the wait period. Accessing the IICA0 register in a
communication state other than during the wait period is prohibited. When the device serves
as the master, however, the IICA0 register can be written only once after the communication
trigger bit (STT0) is set to 1.
3. When communication is reserved, write data to the IICA0 register after the interrupt triggered
by a stop condition is detected.
Symbol 7 6 5 4 3 2 1 0
SVA0 A6 A5 A4 A3 A2 A1 A0 0Note
(3) SO latch
The SO latch is used to retain the SDAA0 pin’s output level.
(9) ACK generator, stop condition detector, start condition detector, and ACK detector
These circuits generate and detect each status.
Cautions 1. When setting serial interface IICAm, be sure to set the IICAmEN bit to 1 first. If IICAmEN = 0,
writing to a control register of serial interface IICAm is ignored, and, even if the register is
read, only the default value is read (except for port mode register 6 (PM6) and port register 6
(P6)).
2. Be sure to clear the following bits to 0.
20-pin products: bits 1, 3, 4, 6
24, 25-pin products: bits 1, 3, 6
30, 32, 36, 40, 44, 48, 52, 64-pin products: bits 1, 6
Remark m = 0, 1
2
IICE0 I C operation enable
Note 1
0 Stop operation. Reset the IICA status register 0 (IICS0) . Stop internal operation.
1 Enable operation.
Be sure to set this bit (1) while the SCLA0 and SDAA0 lines are at high level.
Notes 2, 3
LREL0 Exit from communications
0 Normal operation
1 This exits from the current communications and sets standby mode. This setting is automatically cleared
to 0 after being executed.
Its uses include cases in which a locally irrelevant extension code has been received.
The SCLA0 and SDAA0 lines are set to high impedance.
The following flags of IICA control register 00 (IICCTL00) and the IICA status register 0 (IICS0) are
cleared to 0.
• STT0 • SPT0 • MSTS0 • EXC0 • COI0 • TRC0 • ACKD0 • STD0
The standby mode following exit from communications remains in effect until the following communications entry
conditions are met.
• After a stop condition is detected, restart is in master mode.
• An address match or extension code reception occurs after the start condition.
Notes 2, 3
WREL0 Wait cancellation
When the WREL0 bit is set (wait canceled) during the wait period at the ninth clock pulse in the transmission status
(TRC0 = 1), the SDAA0 line goes into the high impedance state (TRC0 = 0).
Notes 1. The IICA status register 0 (IICS0), the STCF and IICBSY bits of the IICA flag register 0 (IICF0), and
the CLD0 and DAD0 bits of IICA control register 01 (IICCTL01) are reset.
2. The signal of this bit is invalid while IICE0 is 0.
3. When the LREL0 and WREL0 bits are read, 0 is always read.
2
Caution If the operation of I C is enabled (IICE0 = 1) when the SCLA0 line is high level, the SDAA0 line
is low level, and the digital filter is turned on (DFC0 bit of IICCTL01 register = 1), a start
condition will be inadvertently detected immediately. In this case, set (1) the LREL0 bit by
2
using a 1-bit memory manipulation instruction immediately after enabling operation of I C
(IICE0 = 1).
Note 1
SPIE0 Enable/disable generation of interrupt request when stop condition is detected
0 Disable
1 Enable
If the WUP0 bit of IICA control register 01 (IICCTL01) is 1, no stop condition interrupt will be generated even if SPIE0
= 1.
Note 1
WTIM0 Control of wait and interrupt request generation
Notes 1, 2
ACKE0 Acknowledgment control
0 Disable acknowledgment.
1 Enable acknowledgment. During the ninth clock period, the SDAA0 line is set to low level.
Notes 1. The signal of this bit is invalid while IICE0 is 0. Set this bit during that period.
2. The set value is invalid during address transfer and if the code is not an extension code.
When the device serves as a slave and the addresses match, an acknowledgment is generated
regardless of the set value.
Note
STT0 Start condition trigger
Caution When bit 3 (TRC0) of the IICA status register 0 (IICS0) is set to 1 (transmission status), bit 5
(WREL0) of IICA control register 00 (IICCTL00) is set to 1 during the ninth clock and wait is
canceled, after which the TRC0 bit is cleared (reception status) and the SDAA0 line is set to
high impedance. Release the wait performed while the TRC0 bit is 1 (transmission status)
by writing to the IICA shift register 0.
Caution Reading the IICS0 register while the address match wakeup function is enabled (WUP0 = 1) in
STOP mode is prohibited. When the WUP0 bit is changed from 1 to 0 (wakeup operation is
stopped), regardless of the INTIICA0 interrupt request, the change in status is not reflected until
the next start condition or stop condition is detected. To use the wakeup function, therefore,
enable (SPIE0 = 1) the interrupt generated by detecting a stop condition and read the IICS0
register after the interrupt has been detected.
0 This status means either that there was no arbitration or that the arbitration result was a “win”.
1 This status indicates the arbitration result was a “loss”. The MSTS0 bit is cleared.
Condition for clearing (ALD0 = 0) Condition for setting (ALD0 = 1)
• Automatically cleared after the IICS0 register is • When the arbitration result is a “loss”.
Note
read
• When the IICE0 bit changes from 1 to 0 (operation
stop)
• Reset
Note This register is also cleared when a 1-bit memory manipulation instruction is executed for bits other
than the IICS0 register. Therefore, when using the ALD0 bit, read the data of this bit before the data
of the other bits.
1 Addresses match.
0 Receive status (other than transmit status). The SDAA0 line is set for high impedance.
1 Transmit status. The value in the SO0 latch is enabled for output to the SDAA0 line (valid starting at
the falling edge of the first byte’s ninth clock).
<Slave>
• When the ALD0 bit changes from 0 to 1 (arbitration
loss) • When 1 (slave transmission) is input to the LSB
• Reset (transfer direction specification bit) of the first byte
• When not used for communication (MSTS0, EXC0, COI0 from the master (during address transfer)
= 0)
<Master>
• When “1” is output to the first byte’s LSB (transfer
direction specification bit)
<Slave>
• When a start condition is detected
• When “0” is input to the first byte’s LSB (transfer
direction specification bit)
Note When bit 3 (TRC0) of the IICA status register 0 (IICS0) is set to 1 (transmission status), bit 5
(WREL0) of IICA control register 00 (IICCTL00) is set to 1 during the ninth clock and wait is
canceled, after which the TRC0 bit is cleared (reception status) and the SDAA0 line is set to high
impedance. Release the wait performed while the TRC0 bit is 1 (transmission status) by writing to
the IICA shift register 0.
Remark LREL0: Bit 6 of IICA control register 00 (IICCTL00)
IICE0: Bit 7 of IICA control register 00 (IICCTL00)
• When a stop condition is detected • After the SDAA0 line is set to low level at the rising
• At the rising edge of the next byte’s first clock edge of SCLA0 line’s ninth clock
• Cleared by LREL0 = 1 (exit from communications)
• When the IICE0 bit changes from 1 to 0 (operation
stop)
• Reset
1 Start condition was detected. This indicates that the address transfer period is in effect.
1 Stop condition was detected. The master device’s communication is terminated and the bus is
released.
• At the rising edge of the address transfer byte’s first • When a stop condition is detected
clock following setting of this bit and detection of a
start condition
<R> • When the WUP0 bit changes from 1 to 0
• When the IICE0 bit changes from 1 to 0 (operation
stop)
• Reset
Cautions 1. Write to the STCEN bit only when the operation is stopped (IICE0 = 0).
2. As the bus release status (IICBSY = 0) is recognized regardless of the actual bus status
when STCEN = 1, when generating the first start condition (STT0 = 1), it is necessary to
verify that no third party communications are in progress in order to prevent such
communications from being destroyed.
3. Write to IICRSV only when the operation is stopped (IICE0 = 0).
Note 1
Address: F0231H After reset: 00H R/W
To shift to STOP mode when WUP0 = 1, execute the STOP instruction at least three clocks after setting (1) the
WUP0 bit (see Figure 13-22 Flow When Setting WUP0 = 1).
Clear (0) the WUP0 bit after the address has matched or an extension code has been received. The
subsequent communication can be entered by the clearing (0) WUP0 bit. (The wait must be released and
transmit data must be written after the WUP0 bit has been cleared (0).)
The interrupt timing when the address has matched or when an extension code has been received, while WUP0
= 1, is identical to the interrupt timing when WUP0 = 0. (A delay of the difference of sampling by the clock will
occur.) Furthermore, when WUP0 = 1, a stop condition interrupt is not generated even if the SPIE0 bit is set to
1.
When WUP0 = 0 is set by a source other than an interrupt from serial interface IICA, operation as the master
device cannot be performed until the subsequent start condition or stop condition is detected. Do not output a
start condition by setting (1) the STT0 bit, without waiting for the detection of the subsequent start condition or
stop condition.
• Cleared by instruction (after address match or • Set by instruction (when the MSTS0, EXC0, and
extension code reception) COI0 bits are “0”, and the STD0 bit also “0”
Note 2
(communication not entered))
<1> <2>
SCLA0
SDAA0 A6 A5 A4 A3 A2 A1 A0 R/W
• When the SCLA0 pin is at low level • When the SCLA0 pin is at high level
• When IICE0 = 0 (operation stop)
• Reset
• When the SDAA0 pin is at low level • When the SDAA0 pin is at high level
• When IICE0 = 0 (operation stop)
• Reset
1 Operates in fast mode (fastest transfer rate: 400 kbps) or fast mode plus (fastest transfer rate: 1
Mbps).
Caution The fastest operation frequency of the operation clock of the serial interface IICA is 20
MHz (Max.). If the fCLK exceeds 20 MHz, set the clock to fCLK/2 by setting the PRS0 bit to 1.
Symbol 7 6 5 4 3 2 1 0
IICWL0
Symbol 7 6 5 4 3 2 1 0
IICWH0
Remark For how to set the transfer clock by using the IICWL0 and IICWH0 registers, see 13.4.2 Setting
transfer clock by using IICWL0 and IICWH0 registers.
(1) SCLA0 .... This pin is used for serial clock input and output.
This pin is an N-ch open-drain output for both master and slave devices. Input is Schmitt input.
(2) SDAA0 .... This pin is used for serial data input and output.
This pin is an N-ch open-drain output for both master and slave devices. Input is Schmitt input.
Since outputs from the serial clock line and the serial data bus line are N-ch open-drain outputs, an external pull-up
resistor is required.
Slave device
VDD
Master device
SCLA0 SCLA0
SDAA0 SDAA0
VSS VSS
fCLK
Transfer clock = IICWL0 + IICWH0 + fCLK (tR + tF)
At this time, the optimal setting values of the IICWL0 and IICWH0 registers are as follows.
(The fractional parts of all setting values are rounded up.)
0.52
IICWL0 = × fCLK
Transfer clock
0.48
IICWH0 = ( − tR − tF) × fCLK
Transfer clock
0.47
IICWL0 = × fCLK
Transfer clock
0.53
IICWH0 = ( − tR − tF) × fCLK
Transfer clock
0.50
IICWL0 = × fCLK
Transfer clock
0.50
IICWH0 = ( − tR − tF) × fCLK
Transfer clock
Caution Note the minimum fCLK operation frequency when setting the transfer clock. The minimum fCLK
operation frequency for serial interface IICA is determined according to the mode.
Fast mode: fCLK = 3.5 MHz (MIN.)
Fast mode plus: fCLK = 10 MHz (MIN.)
Normal mode: fCLK = 1 MHz (MIN.)
In addition, the fastest operation frequency of the operation clock of the serial interface IICA is 20
MHz (Max.). If the fCLK exceeds 20 MHz, set the clock to fCLK/2 by setting the PRS0 bit of IICCTL01
register to 1.
Remarks 1. Calculate the rise time (tR) and fall time (tF) of the SDAA0 and SCLA0 signals separately, because
they differ depending on the pull-up resistance and wire load.
2. IICWL0: IICA low-level width setting register 0
IICWH0: IICA high-level width setting register 0
tF: SDAA0 and SCLA0 signal falling times
tR: SDAA0 and SCLA0 signal rising times
fCLK: CPU/peripheral hardware clock frequency
The following section describes the I2C bus’s serial data communication format and the signals used by the I2C bus.
Figure 13-14 shows the transfer timing for the “start condition”, “address”, “data”, and “stop condition” output via the I2C
bus’s serial data bus.
SDAA0
The master device generates the start condition, slave address, and stop condition.
The acknowledge (ACK) can be generated by either the master or slave device (normally, it is output by the device that
receives 8-bit data).
The serial clock (SCLA0) is continuously output by the master device. However, in the slave device, the SCLA0 pin low
level period can be extended and a wait can be inserted.
H
SCLA0
SDAA0
A start condition is output when bit 1 (STT0) of IICA control register 00 (IICCTL00) is set (1) after a stop condition has
been detected (SPD0: Bit 0 of the IICA status register 0 (IICS0) = 1). When a start condition is detected, bit 1 (STD0) of
the IICS0 register is set (1).
13.5.2 Addresses
The address is defined by the 7 bits of data that follow the start condition.
An address is a 7-bit data segment that is output in order to select one of the slave devices that are connected to the
master device via the bus lines. Therefore, each slave device connected via the bus lines must have a unique address.
The slave devices include hardware that detects the start condition and checks whether or not the 7-bit address data
matches the data values stored in the slave address register 0 (SVA0). If the address data matches the SVA0 register
values, the slave device is selected and communicates with the master device until the master device generates a start
condition or stop condition.
SCLA0 1 2 3 4 5 6 7 8 9
SDAA0 A6 A5 A4 A3 A2 A1 A0 R/W
Address
Note
INTIICA0
Note INTIICA0 is not issued if data other than a local address or extension code is received during slave device
operation.
Addresses are output when a total of 8 bits consisting of the slave address and the transfer direction described in
13.5.3 Transfer direction specification are written to the IICA shift register 0 (IICA0). The received addresses are
written to the IICA0 register.
The slave address is assigned to the higher 7 bits of the IICA0 register.
SCLA0 1 2 3 4 5 6 7 8 9
SDAA0 A6 A5 A4 A3 A2 A1 A0 R/W
Note INTIICA0 is not issued if data other than a local address or extension code is received during slave device
operation.
To generate ACK, the reception side makes the SDAA0 line low at the ninth clock (indicating normal reception).
Automatic generation of ACK is enabled by setting bit 2 (ACKE0) of IICA control register 00 (IICCTL00) to 1. Bit 3
(TRC0) of the IICS0 register is set by the data of the eighth bit that follows 7-bit address information. Usually, set the
ACKE0 bit to 1 for reception (TRC0 = 0).
If a slave can receive no more data during reception (TRC0 = 0) or does not require the next data item, then the slave
must inform the master, by clearing the ACKE0 bit to 0, that it will not receive any more data.
When the master does not require the next data item during reception (TRC0 = 0), it must clear the ACKE0 bit to 0 so
that ACK is not generated. In this way, the master informs a slave at the transmission side that it does not require any
more data (transmission will be stopped).
SCLA0 1 2 3 4 5 6 7 8 9
When the local address is received, ACK is automatically generated, regardless of the value of the ACKE0 bit. When
an address other than that of the local address is received, ACK is not generated (NACK).
When an extension code is received, ACK is generated if the ACKE0 bit is set to 1 in advance.
How ACK is generated when data is received differs as follows depending on the setting of the wait timing.
• When 8-clock wait state is selected (bit 3 (WTIM0) of IICCTL00 register = 0):
By setting the ACKE0 bit to 1 before releasing the wait state, ACK is generated at the falling edge of the eighth clock
of the SCLA0 pin.
• When 9-clock wait state is selected (bit 3 (WTIM0) of IICCTL00 register = 1):
ACK is generated by setting the ACKE0 bit to 1 in advance.
H
SCLA0
SDAA0
A stop condition is generated when bit 0 (SPT0) of IICA control register 00 (IICCTL00) is set to 1. When the stop
condition is detected, bit 0 (SPD0) of the IICA status register 0 (IICS0) is set to 1 and INTIICA0 is generated when bit 4
(SPIE0) of the IICCTL00 register is set to 1.
13.5.6 Wait
The wait is used to notify the communication partner that a device (master or slave) is preparing to transmit or receive
data (i.e., is in a wait state).
Setting the SCLA0 pin to low level notifies the communication partner of the wait state. When wait state has been
canceled for both the master and slave devices, the next data transfer can begin.
(1) When master device has a nine-clock wait and slave device has an eight-clock wait
(master transmits, slave receives, and ACKE0 = 1)
Master
Master returns to high
impedance but slave Wait after output
is in wait state (low level). of ninth clock
IICA0 IICA0 data write (cancel wait)
SCLA0 6 7 8 9 1 2 3
Slave
Wait after output
of eighth clock
FFH is written to IICA0 or WREL0 is set to 1
IICA0
SCLA0
H
ACKE0
Transfer lines
Wait from slave Wait from master
SCLA0 6 7 8 9 1 2 3
SDAA0 D2 D1 D0 ACK D7 D6 D5
(2) When master and slave devices both have a nine-clock wait
(master transmits, slave receives, and ACKE0 = 1)
SCLA0 6 7 8 9 1 2 3
Slave
FFH is written to IICA0 or WREL0 is set to 1
IICA0
SCLA0
ACKE0 H
Wait from
master and
Transfer lines slave Wait from slave
SCLA0 6 7 8 9 1 2 3
SDAA0 D2 D1 D0 ACK D7 D6 D5
A wait may be automatically generated depending on the setting of bit 3 (WTIM0) of IICA control register 00 (IICCTL00).
Normally, the receiving side cancels the wait state when bit 5 (WREL0) of the IICCTL00 register is set to 1 or when
FFH is written to the IICA shift register 0 (IICA0), and the transmitting side cancels the wait state when data is written to
the IICA0 register.
The master device can also cancel the wait state via either of the following methods.
• By setting bit 1 (STT0) of the IICCTL00 register to 1
• By setting bit 0 (SPT0) of the IICCTL00 register to 1
When the above wait canceling processing is executed, the I2C cancels the wait state and communication is resumed.
To cancel a wait state and transmit data (including addresses), write the data to the IICA0 register.
To receive data after canceling a wait state, or to complete data transmission, set bit 5 (WREL0) of the IICCTL00
register to 1.
To generate a restart condition after canceling a wait state, set bit 1 (STT0) of the IICCTL00 register to 1.
To generate a stop condition after canceling a wait state, set bit 0 (SPT0) of the IICCTL00 register to 1.
Execute the canceling processing only once for one wait state.
If, for example, data is written to the IICA0 register after canceling a wait state by setting the WREL0 bit to 1, an
incorrect value may be output to SDAA0 line because the timing for changing the SDAA0 line conflicts with the timing for
writing the IICA0 register.
In addition to the above, communication is stopped if the IICE0 bit is cleared to 0 when communication has been
aborted, so that the wait state can be canceled.
If the I2C bus has deadlocked due to noise, processing is saved from communication by setting bit 6 (LREL0) of the
IICCTL00 register, so that the wait state can be canceled.
Caution If a processing to cancel a wait state is executed when WUP0 = 1, the wait state will not be canceled.
Notes 1. The slave device’s INTIICA0 signal and wait period occurs at the falling edge of the ninth clock only when
there is a match with the address set to the slave address register 0 (SVA0).
At this point, ACK is generated regardless of the value set to the IICCTL00 register’s bit 2 (ACKE0). For a
slave device that has received an extension code, INTIICA0 occurs at the falling edge of the eighth clock.
However, if the address does not match after restart, INTIICA0 is generated at the falling edge of the 9th
clock, but wait does not occur.
2. If the received address does not match the contents of the slave address register 0 (SVA0) and extension
code is not received, neither INTIICA0 nor a wait occurs.
Remark The numbers in the table indicate the number of the serial clock’s clock signals. Interrupt requests and wait
control are both synchronized with the falling edge of these clock signals.
• Slave device operation: Interrupt and wait timing are determined depending on the conditions described in
Notes 1 and 2 above, regardless of the WTIM0 bit.
• Master device operation: Interrupt and wait timing occur at the falling edge of the ninth clock regardless of the
WTIM0 bit.
• Master/slave device operation: Interrupt and wait timing are determined according to the WTIM0 bit.
• Master/slave device operation: Interrupt and wait timing are determined according to the WTIM0 bit.
When an 8-clock wait has been selected (WTIM0 = 0), the presence/absence of ACK generation must be
determined prior to wait cancellation.
(1) When the higher 4 bits of the receive address are either “0000” or “1111”, the extension code reception flag (EXC0)
is set to 1 for extension code reception and an interrupt request (INTIICA0) is issued at the falling edge of the
eighth clock. The local address stored in the slave address register 0 (SVA0) is not affected.
(2) The settings below are specified if 11110xx0 is transferred from the master by using a 10-bit address transfer when
the SVA0 register is set to 11110xx0. Note that INTIICA0 occurs at the falling edge of the eighth clock.
(3) Since the processing after the interrupt request occurs differs according to the data that follows the extension code,
such processing is performed by software.
If the extension code is received while a slave device is operating, then the slave device is participating in
communication even if its address does not match.
For example, after the extension code is received, if you do not wish to operate the target device as a slave device,
set bit 6 (LREL0) of IICA control register 00 (IICCTL00) to 1 to set the standby mode for the next communication
operation.
1111 0xx 1 10-bit slave address specification (after address match, when
read command is issued)
Remark See the I2C bus specifications issued by NXP Semiconductors for details of extension codes other than those
described above.
13.5.12 Arbitration
When several master devices simultaneously generate a start condition (when the STT0 bit is set to 1 before the STD0
bit is set to 1), communication among the master devices is performed as the number of clocks are adjusted until the data
differs. This kind of operation is called arbitration.
When one of the master devices loses in arbitration, an arbitration loss flag (ALD0) in the IICA status register 0 (IICS0)
is set (1) via the timing by which the arbitration loss occurred, and the SCLA0 and SDAA0 lines are both set to high
impedance, which releases the bus.
The arbitration loss is detected based on the timing of the next interrupt request (the eighth or ninth clock, when a stop
condition is detected, etc.) and the ALD0 = 1 setting that has been made by software.
For details of interrupt request timing, see 13.5.8 Interrupt request (INTIICA0) generation timing and wait control.
Master 1
Hi-Z
SCLA0
Hi-Z
SDAA0
SCLA0
SDAA0
Transfer lines
SCLA0
SDAA0
Table 13-4. Status During Arbitration and Interrupt Request Generation Timing
Notes 1. When the WTIM0 bit (bit 3 of IICA control register 00 (IICCTL00)) = 1, an interrupt request occurs at the
falling edge of the ninth clock. When WTIM0 = 0 and the extension code’s slave address is received, an
interrupt request occurs at the falling edge of the eighth clock.
2. When there is a chance that arbitration will occur, set SPIE0 = 1 for master device operation.
START
No
MSTS0 = STD0 = EXC0 = COI0 =0?
Yes
WUP0 = 1
Figure 13-23. Flow When Setting WUP0 = 0 upon Address Match (Including Extension Code Reception)
Yes
WUP0 = 0
Reading IICS0
Use the following flows to perform the processing to release the STOP mode other than by an interrupt request
(INTIICA0) generated from serial interface IICA.
Figure 13-24. When Operating as Master Device after Releasing STOP Mode other than by INTIICA0
START
SPIE0 = 1
WUP0 = 1
STOP instruction
STOP mode state
Releasing STOP mode Releases STOP mode by an interrupt other than INTIICA0.
WUP0 = 0
No
INTIICA0 = 1?
Reading IICS0
(1) When communication reservation function is enabled (bit 0 (IICRSV) of IICA flag register 0 (IICF0) = 0)
To start master device communications when not currently using a bus, a communication reservation can be made
to enable transmission of a start condition when the bus is released. There are two modes under which the bus is
not used.
If bit 1 (STT0) of the IICCTL00 register is set to 1 while the bus is not used (after a stop condition is detected), a
start condition is automatically generated and wait state is set.
If an address is written to the IICA shift register 0 (IICA0) after bit 4 (SPIE0) of the IICCTL00 register was set to 1,
and it was detected by generation of an interrupt request signal (INTIICA0) that the bus was released (detection of
the stop condition), then the device automatically starts communication as the master. Data written to the IICA0
register before the stop condition is detected is invalid.
When the STT0 bit has been set to 1, the operation mode (as start condition or as communication reservation) is
determined according to the bus status.
Check whether the communication reservation operates or not by using the MSTS0 bit (bit 7 of the IICA status
register 0 (IICS0)) after the STT0 bit is set to 1 and the wait time elapses.
Use software to secure the wait time calculated by the following expression.
Write to
Program processing STT0 = 1
IICA0
SCLA0 1 2 3 4 5 6 7 8 9 1 2 3 4 5 6
SDAA0
Communication reservations are accepted via the timing shown in Figure 13-26. After bit 1 (STD0) of the IICA
status register 0 (IICS0) is set to 1, a communication reservation can be made by setting bit 1 (STT0) of IICA
control register 00 (IICCTL00) to 1 before a stop condition is detected.
SCLA0
SDAA0
STD0
SPD0
Standby mode (Communication can be reserved by setting STT0 to 1 during this period.)
DI
(Communication reservation)Note 2
MSTS0 = 0? Confirmation of communication reservation
Yes
No
(Generate start condition)
Cancel communication
Clear user flag
reservation
EI
(2) When communication reservation function is disabled (bit 0 (IICRSV) of IICA flag register 0 (IICF0) = 1)
When bit 1 (STT0) of IICA control register 00 (IICCTL00) is set to 1 when the bus is not used in a communication
during bus communication, this request is rejected and a start condition is not generated. The following two
statuses are included in the status where bus is not used.
To confirm whether the start condition was generated or request was rejected, check STCF (bit 7 of the IICF0
register). It takes up to 5 clocks until the STCF bit is set to 1 after setting STT0 = 1. Therefore, secure the time by
software.
13.5.15 Cautions
<1> Clear bit 4 (SPIE0) of the IICCTL00 register to 0 to disable generation of an interrupt request signal
(INTIICA0) when the stop condition is detected.
<2> Set bit 7 (IICE0) of the IICCTL00 register to 1 to enable the operation of I2C.
<3> Wait for detection of the start condition.
<4> Set bit 6 (LREL0) of the IICCTL00 register to 1 before ACK is returned (4 to 80 clocks after setting the IICE0
bit to 1), to forcibly disable detection.
(4) Setting the STT0 and SPT0 bits (bits 1 and 0 of the IICCTL00 register) again after they are set and before they are
cleared to 0 is prohibited.
(5) When transmission is reserved, set the SPIE0 bit (bit 4 of the IICTL0 register) to 1 so that an interrupt request is
generated when the stop condition is detected. Transfer is started when communication data is written to the IICA
shift register 0 (IICA0) after the interrupt request is generated. Unless the interrupt is generated when the stop
condition is detected, the device stops in the wait state because the interrupt request is not generated when
communication is started. However, it is not necessary to set the SPIE0 bit to 1 when the MSTS0 bit (bit 7 of the
IICA status register 0 (IICS0)) is detected by software.
START
IICF0 ← 0XH
Sets a start condition.
Setting STCEN0, IICRSV0 = 0
Initial setting
IICCTL00 ← 0XX111XXB
ACKE0 = WTIM0 = SPIE0 = 1
IICCTL00 ← 1XX111XXB
IICE0 = 1
2
Set the port from input mode to output mode and enable the output of the I C bus
Setting port (see 13.3 (8) Port mode register 6 (PM6)).
Yes
STCEN0 = 1?
No
Prepares for starting communication
SPT0 = 1 (generates a stop condition).
INTIICA0 No
interrupt occurs?
Waits for detection of the stop condition.
Yes
Starts communication
Writing IICA0 (specifies an address and transfer
direction).
INTIICA0 No
interrupt occurs? Waits for detection of acknowledge.
Yes
No
ACKD0 = 1?
Yes
No
TRC0 = 1?
ACKE0 = 1
Yes
Communication processing
WTIM0 = 0
INTIICA0 No
interrupt occurs? INTIICA0 No
Waits for data transmission.
interrupt occurs?
Waits for data
Yes reception.
Yes
Yes
No
End of transfer?
No
End of transfer?
Yes
Yes
ACKE0 = 0
WTIM0 = WREL0 = 1
No
Restart?
INTIICA0 No
Yes SPT0 = 1 interrupt occurs? Waits for detection
of acknowledge.
Yes
END
2
Note Release (SCLA0 and SDAA0 pins = high level) the I C bus in conformance with the specifications of the product
that is communicating. If EEPROM is outputting a low level to the SDAA0 pin, for example, set the SCLA0 pin in
the output port mode, and output a clock pulse from the output port until the SDAA0 pin is constantly at high
level.
Remark Conform to the specifications of the product that is communicating, with respect to the transmission and
reception formats.
R01UH0146EJ0100 Rev.1.00 742
Sep 22, 2011
RL78/G13 CHAPTER 13 SERIAL INTERFACE IICA
START
Setting port Setting of the port used alternatively as the pin to be used.
First, set the port to input mode and the output latch to 0 (see 13.3 (8) Port mode register 6 (PM6)).
IICF0 ← 0XH
Sets a start condition.
Setting STCEN0 and IICRSV0
IICCTL00 ← 0XX111XXB
ACKE0 = WTIM0 = SPIE0 = 1
IICCTL00 ← 1XX111XXB
IICE0 = 1
2
Set the port from input mode to output mode and enable the output of the I C bus
Setting port
Initial setting
Bus status is No
being checked. STCEN0 = 1?
Prepares for starting
No INTIICA0 Yes SPT0 = 1 communication
interrupt occurs? (generates a stop condition).
Yes
INTIICA0 No
interrupt occurs?
No Waits for detection
SPD0 = 1?
of the stop condition.
Yes
Yes Slave operation
No
SPD0 = 1?
Yes
Slave operation
• Waiting to be specified as a slave by other master
1
• Waiting for a communication start request (depends on user program)
Master operation No
Waits for a communication
Yes SPIE0 = 0
(Communication start request)
INTIICA0 No
SPIE0 = 1 interrupt occurs?
Waits for a communication request.
Yes
Yes
A B
Enables reserving Disables reserving
communication. communication.
Note Confirm that the bus is released (CLD0 bit = 1, DAD0 bit = 1) for a specific period (for example, for a period of
one frame). If the SDAA0 pin is constantly at low level, decide whether to release the I2C bus (SCLA0 and
SDAA0 pins = high level) in conformance with the specifications of the product that is communicating.
No
MSTS0 = 1?
Yes INTIICA0 No
interrupt occurs? Waits for bus release
(communication being reserved).
Yes
No
EXC0 = 1 or COI0 =1?
Wait state after stop condition
was detected and start condition
was generated by the communication Yes
reservation function.
C Slave operation
No
IICBSY0 = 0?
Yes
D
WaitNote
No
STCF0 = 0?
Yes INTIICA0 No
interrupt occurs? Waits for bus release
Yes
C
Slave operation D
Starts communication
Writing IICA0
(specifies an address and transfer direction).
INTIICA0 No
interrupt occurs? Waits for detection of ACK.
Yes
No
MSTS0 = 1?
Yes
2
No
ACKD0 = 1?
Yes
No
TRC0 = 1?
ACKE0 = 1
Yes WTIM0 = 0
WTIM0 = 1
Communication processing
Yes No
MSTS0 = 1?
No
MSTS0 = 1?
Yes
2
Yes Reading IICA0
2
No
ACKD0 = 1?
Transfer end? No
Yes
Yes
No WTIM0 = WREL0 = 1
Transfer end?
ACKE0 = 00
Yes
INTIICA0 No
interrupt occurs? Waits for detection of ACK.
No
Restart?
Yes
SPT0 = 1
Yes
No
MSTS0 = 1?
STT0 = 1 END
Yes 2
C
Communication processing
No
EXC0 = 1 or COI0 = 1?
Yes 1
Remarks 1. Conform to the specifications of the product that is communicating, with respect to the transmission and
reception formats.
2. To use the device as a master in a multi-master system, read the MSTS0 bit each time interrupt INTIICA0
has occurred to check the arbitration result.
3. To use the device as a slave in a multi-master system, check the status by using the IICA status register
0 (IICS0) and IICA flag register 0 (IICF0) each time interrupt INTIICA0 has occurred, and determine the
processing to be performed next.
INTIICA0 Flag
Interrupt servicing
Setting
IICA0 Main processing
Data
Setting
Therefore, data communication processing is performed by preparing the following three flags and passing them to
the main processing instead of INTIICA0.
START
IICF0 ← 0XH
Sets a start condition.
Setting IICRSV0
IICCTL00 ← 0XX011XXB
ACKE0 = WTIM0 = 1, SPI0 = 0
IICCTL00 ← 1XX011XXB
IICE0 = 1
Setting port Set the port from input mode to output mode and enable the output of the I2C bus
(see 13.3 (8) Port mode register 6 (PM6)).
No
Communication
mode flag = 1?
Yes
No
Communication
direction flag = 1?
Yes
Starts
WREL0 = 1 reception.
Starts
Writing IICA0
transmission.
No
Communication
mode flag = 1?
No
Communication
Communication processing
Yes Communication No
No direction flag = 1?
Communication
direction flag = 1? Yes
Yes No
Ready flag = 1?
No
Ready flag = 1?
Yes
Yes
Reading IICA0
Clearing ready flag
No
Clearing communication
mode flag
WREL0 = 1
Remark Conform to the specifications of the product that is in communication, regarding the transmission and
reception formats.
An example of the processing procedure of the slave with the INTIICA0 interrupt is explained below (processing is
performed assuming that no extension code is used). The INTIICA0 interrupt checks the status, and the following
operations are performed.
Remark <1> to <3> above correspond to <1> to <3> in Figure 13-31 Slave Operation Flowchart (2).
INTIICA0 generated
Yes <1>
SPD0 = 1?
No
Yes <2>
STD0 = 1?
No No
COI0 = 1?
<3>
Yes
Set ready flag
SPT0 = 1
↓
ST AD6 to AD0 R/W ACK D7 to D0 ACK D7 to D0 ACK SP
1 2 3 4 5
1: IICS0 = 1000×110B
2: IICS0 = 1000×000B
3: IICS0 = 1000×000B (Sets the WTIM0 bit to 1)Note
4: IICS0 = 1000××00B (Sets the SPT0 bit to 1)Note
5: IICS0 = 00000001B
Note To generate a stop condition, set the WTIM0 bit to 1 and change the timing for generating the INTIICA0
interrupt request signal.
SPT0 = 1
↓
ST AD6 to AD0 R/W ACK D7 to D0 ACK D7 to D0 ACK SP
1 2 3 4
1: IICS0 = 1000×110B
2: IICS0 = 1000×100B
3: IICS0 = 1000××00B (Sets the SPT0 bit to 1)
4: IICS0 = 00000001B
STT0 = 1 SPT0 = 1
↓ ↓
ST AD6 to AD0 R/W ACK D7 to D0 ACK ST AD6 to AD0 R/W ACK D7 to D0 ACK SP
1 2 3 4 5 6 7
1: IICS0 = 1000×110B
2: IICS0 = 1000×000B (Sets the WTIM0 bit to 1)Note 1
3: IICS0 = 1000××00B (Clears the WTIM0 bit to 0Note 2, sets the STT0 bit to 1)
4: IICS0 = 1000×110B
5: IICS0 = 1000×000B (Sets the WTIM0 bit to 1)Note 3
6: IICS0 = 1000××00B (Sets the SPT0 bit to 1)
7: IICS0 = 00000001B
Notes 1. To generate a start condition, set the WTIM0 bit to 1 and change the timing for generating the
INTIICA0 interrupt request signal.
2. Clear the WTIM0 bit to 0 to restore the original setting.
3. To generate a stop condition, set the WTIM0 bit to 1 and change the timing for generating the
INTIICA0 interrupt request signal.
STT0 = 1 SPT0 = 1
↓ ↓
ST AD6 to AD0 R/W ACK D7 to D0 ACK ST AD6 to AD0 R/W ACK D7 to D0 ACK SP
1 2 3 4 5
1: IICS0 = 1000×110B
2: IICS0 = 1000××00B (Sets the STT0 bit to 1)
3: IICS0 = 1000×110B
4: IICS0 = 1000××00B (Sets the SPT0 bit to 1)
5: IICS0 = 00000001B
SPT0 = 1
↓
ST AD6 to AD0 R/W ACK D7 to D0 ACK D7 to D0 ACK SP
1 2 3 4 5
1: IICS0 = 1010×110B
2: IICS0 = 1010×000B
3: IICS0 = 1010×000B (Sets the WTIM0 bit to 1)Note
4: IICS0 = 1010××00B (Sets the SPT0 bit to 1)
5: IICS0 = 00000001B
Note To generate a stop condition, set the WTIM0 bit to 1 and change the timing for generating the INTIICA0
interrupt request signal.
SPT0 = 1
↓
ST AD6 to AD0 R/W ACK D7 to D0 ACK D7 to D0 ACK SP
1 2 3 4
1: IICS0 = 1010×110B
2: IICS0 = 1010×100B
3: IICS0 = 1010××00B (Sets the SPT0 bit to 1)
4: IICS0 = 00001001B
1: IICS0 = 0001×110B
2: IICS0 = 0001×000B
3: IICS0 = 0001×000B
4: IICS0 = 00000001B
1: IICS0 = 0001×110B
2: IICS0 = 0001×100B
3: IICS0 = 0001××00B
4: IICS0 = 00000001B
×: Don’t care
ST AD6 to AD0 R/W ACK D7 to D0 ACK ST AD6 to AD0 R/W ACK D7 to D0 ACK SP
1 2 3 4 5
1: IICS0 = 0001×110B
2: IICS0 = 0001×000B
3: IICS0 = 0001×110B
4: IICS0 = 0001×000B
5: IICS0 = 00000001B
ST AD6 to AD0 R/W ACK D7 to D0 ACK ST AD6 to AD0 R/W ACK D7 to D0 ACK SP
1 2 3 4 5
1: IICS0 = 0001×110B
2: IICS0 = 0001××00B
3: IICS0 = 0001×110B
4: IICS0 = 0001××00B
5: IICS0 = 00000001B
(i) When WTIM0 = 0 (after restart, does not match address (= extension code))
ST AD6 to AD0 R/W ACK D7 to D0 ACK ST AD6 to AD0 R/W ACK D7 to D0 ACK SP
1 2 3 4 5
1: IICS0 = 0001×110B
2: IICS0 = 0001×000B
3: IICS0 = 0010×010B
4: IICS0 = 0010×000B
5: IICS0 = 00000001B
(ii) When WTIM0 = 1 (after restart, does not match address (= extension code))
ST AD6 to AD0 R/W ACK D7 to D0 ACK ST AD6 to AD0 R/W ACK D7 to D0 ACK SP
1 2 3 4 5 6
1: IICS0 = 0001×110B
2: IICS0 = 0001××00B
3: IICS0 = 0010×010B
4: IICS0 = 0010×110B
5: IICS0 = 0010××00B
6: IICS0 = 00000001B
(i) When WTIM0 = 0 (after restart, does not match address (= not extension code))
ST AD6 to AD0 R/W ACK D7 to D0 ACK ST AD6 to AD0 R/W ACK D7 to D0 ACK SP
1 2 3 4
1: IICS0 = 0001×110B
2: IICS0 = 0001×000B
3: IICS0 = 00000110B
4: IICS0 = 00000001B
(ii) When WTIM0 = 1 (after restart, does not match address (= not extension code))
ST AD6 to AD0 R/W ACK D7 to D0 ACK ST AD6 to AD0 R/W ACK D7 to D0 ACK SP
1 2 3 4
1: IICS0 = 0001×110B
2: IICS0 = 0001××00B
3: IICS0 = 00000110B
4: IICS0 = 00000001B
1: IICS0 = 0010×010B
2: IICS0 = 0010×000B
3: IICS0 = 0010×000B
4: IICS0 = 00000001B
1: IICS0 = 0010×010B
2: IICS0 = 0010×110B
3: IICS0 = 0010×100B
4: IICS0 = 0010××00B
5: IICS0 = 00000001B
ST AD6 to AD0 R/W ACK D7 to D0 ACK ST AD6 to AD0 R/W ACK D7 to D0 ACK SP
1 2 3 4 5
1: IICS0 = 0010×010B
2: IICS0 = 0010×000B
3: IICS0 = 0001×110B
4: IICS0 = 0001×000B
5: IICS0 = 00000001B
ST AD6 to AD0 R/W ACK D7 to D0 ACK ST AD6 to AD0 R/W ACK D7 to D0 ACK SP
1 2 3 4 5 6
1: IICS0 = 0010×010B
2: IICS0 = 0010×110B
3: IICS0 = 0010××00B
4: IICS0 = 0001×110B
5: IICS0 = 0001××00B
6: IICS0 = 00000001B
ST AD6 to AD0 R/W ACK D7 to D0 ACK ST AD6 to AD0 R/W ACK D7 to D0 ACK SP
1 2 3 4 5
1: IICS0 = 0010×010B
2: IICS0 = 0010×000B
3: IICS0 = 0010×010B
4: IICS0 = 0010×000B
5: IICS0 = 00000001B
ST AD6 to AD0 R/W ACK D7 to D0 ACK ST AD6 to AD0 R/W ACK D7 to D0 ACK SP
1 2 3 4 5 6 7
1: IICS0 = 0010×010B
2: IICS0 = 0010×110B
3: IICS0 = 0010××00B
4: IICS0 = 0010×010B
5: IICS0 = 0010×110B
6: IICS0 = 0010××00B
7: IICS0 = 00000001B
(i) When WTIM0 = 0 (after restart, does not match address (= not extension code))
ST AD6 to AD0 R/W ACK D7 to D0 ACK ST AD6 to AD0 R/W ACK D7 to D0 ACK SP
1 2 3 4
1: IICS0 = 00100010B
2: IICS0 = 00100000B
3: IICS0 = 00000110B
4: IICS0 = 00000001B
(ii) When WTIM0 = 1 (after restart, does not match address (= not extension code))
ST AD6 to AD0 R/W ACK D7 to D0 ACK ST AD6 to AD0 R/W ACK D7 to D0 ACK SP
1 2 3 4 5
1: IICS0 = 00100010B
2: IICS0 = 00100110B
3: IICS0 = 00100×00B
4: IICS0 = 00000110B
5: IICS0 = 00000001B
1: IICS0 = 00000001B
(a) When arbitration loss occurs during transmission of slave address data
1: IICS0 = 0101×110B
2: IICS0 = 0001×000B
3: IICS0 = 0001×000B
4: IICS0 = 00000001B
1: IICS0 = 0101×110B
2: IICS0 = 0001×100B
3: IICS0 = 0001××00B
4: IICS0 = 00000001B
1: IICS0 = 0110×010B
2: IICS0 = 0010×000B
3: IICS0 = 0010×000B
4: IICS0 = 00000001B
1: IICS0 = 0110×010B
2: IICS0 = 0010×110B
3: IICS0 = 0010×100B
4: IICS0 = 0010××00B
5: IICS0 = 00000001B
(6) Operation when arbitration loss occurs (no communication after arbitration loss)
When the device is used as a master in a multi-master system, read the MSTS0 bit each time interrupt request
signal INTIICA0 has occurred to check the arbitration result.
(a) When arbitration loss occurs during transmission of slave address data (when WTIM0 = 1)
1: IICS0 = 01000110B
2: IICS0 = 00000001B
1: IICS0 = 0110×010B
Sets LREL0 = 1 by software
2: IICS0 = 00000001B
1: IICS0 = 10001110B
2: IICS0 = 01000000B
3: IICS0 = 00000001B
1: IICS0 = 10001110B
2: IICS0 = 01000100B
3: IICS0 = 00000001B
(d) When loss occurs due to restart condition during data transfer
1 2 3
1: IICS0 = 1000×110B
2: IICS0 = 01000110B
3: IICS0 = 00000001B
1: IICS0 = 1000×110B
2: IICS0 = 01100010B
Sets LREL0 = 1 by software
3: IICS0 = 00000001B
(e) When loss occurs due to stop condition during data transfer
1: IICS0 = 10000110B
2: IICS0 = 01000001B
(f) When arbitration loss occurs due to low-level data when attempting to generate a restart condition
STT0 = 1
↓
1: IICS0 = 1000×110B
2: IICS0 = 1000×000B (Sets the WTIM0 bit to 1)
3: IICS0 = 1000×100B (Clears the WTIM0 bit to 0)
4: IICS0 = 01000000B
5: IICS0 = 00000001B
STT0 = 1
↓
1 2 3 4
1: IICS0 = 1000×110B
2: IICS0 = 1000×100B (Sets the STT0 bit to 1)
3: IICS0 = 01000100B
4: IICS0 = 00000001B
(g) When arbitration loss occurs due to a stop condition when attempting to generate a restart condition
STT0 = 1
↓
1: IICS0 = 1000×110B
2: IICS0 = 1000×000B (Sets the WTIM0 bit to 1)
3: IICS0 = 1000××00B (Sets the STT0 bit to 1)
4: IICS0 = 01000001B
STT0 = 1
↓
1 2 3
1: IICS0 = 1000×110B
2: IICS0 = 1000××00B (Sets the STT0 bit to 1)
3: IICS0 = 01000001B
(h) When arbitration loss occurs due to low-level data when attempting to generate a stop condition
SPT0 = 1
↓
1: IICS0 = 1000×110B
2: IICS0 = 1000×000B (Sets the WTIM0 bit to 1)
3: IICS0 = 1000×100B (Clears the WTIM0 bit to 0)
4: IICS0 = 01000100B
5: IICS0 = 00000001B
SPT0 = 1
↓
1: IICS0 = 1000×110B
2: IICS0 = 1000×100B (Sets the SPT0 bit to 1)
3: IICS0 = 01000100B
4: IICS0 = 00000001B
When using the I2C bus mode, the master device outputs an address via the serial bus to select one of several slave
devices as its communication partner.
After outputting the slave address, the master device transmits the TRC0 bit (bit 3 of the IICA status register 0 (IICS0)),
which specifies the data transfer direction, and then starts serial communication with the slave device.
Figures 13-32 and 13-33 show timing charts of the data communication.
The IICA shift register 0 (IICA0)’s shift operation is synchronized with the falling edge of the serial clock (SCLA0). The
transmit data is transferred to the SO latch and is output (MSB first) via the SDAA0 pin.
Data input via the SDAA0 pin is captured into IICA0 at the rising edge of SCLA0.
Master side
Note 1
IICA0
<2> <5>
ACKD0
(ACK detection)
WTIM0
(8 or 9 clock wait) H
ACKE0
(ACK control) H
MSTS0
(communication status)
STT0
<1>
(ST trigger)
SPT0
(SP trigger) L
WREL0
(wait cancellation) L
INTIICA0
(interrupt)
TRC0
(transmit/receive)
IICA0
ACKD0
(ACK detection)
STD0
(ST detection)
SPD0
(SP detection)
WTIM0
(8 or 9 clock wait) H
ACKE0
(ACK control) H
MSTS0
(communication status) L
WREL0 Note 3
<6>
(wait cancellation)
INTIICA0
(interrupt)
TRC0
(transmit/receive) L
Notes 1. Write data to IICA0, not setting the WREL0 bit, in order to cancel a wait state during transmission by a master
device.
2. Make sure that the time between the fall of the SDAA0 pin signal and the fall of the SCLA0 pin signal is
at least 4.0 μs when specifying standard mode and at least 0.6 μs when specifying fast mode.
3. For releasing wait state during reception of a slave device, write “FFH” to IICA0 or set the WREL0 bit.
The meanings of <1> to <6> in (1) Start condition ~ address ~ data in Figure 13-32 are explained below.
<1> The start condition trigger is set by the master device (STT0 = 1) and a start condition (i.e. SCLA0 = 1
changes SDAA0 from 1 to 0) is generated once the bus data line goes low (SDAA0). When the start
condition is subsequently detected, the master device enters the master device communication status
(MSTS0 = 1). The master device is ready to communicate once the bus clock line goes low (SCLA0 = 0)
after the hold time has elapsed.
<2> The master device writes the address + W (transmission) to the IICA shift register 0 (IICA0) and transmits
the slave address.
<3> In the slave device if the address received matches the address (SVA0 value) of a slave deviceNote, that
slave device sends an ACK by hardware to the master device. The ACK is detected by the master device
(ACKD0 = 1) at the rising edge of the 9th clock.
<4> The master device issues an interrupt (INTIICA0: end of address transmission) at the falling edge of the 9th
clock. The slave device whose address matched the transmitted slave address sets a wait status (SCLA0 =
0) and issues an interrupt (INTIICA0: address match)Note.
<5> The master device writes the data to transmit to the IICA0 register and releases the wait status that it set by
the master device.
<6> If the slave device releases the wait status (WREL0 = 1), the master device starts transferring data to the
slave device.
Note If the transmitted address does not match the address of the slave device, the slave device does not return
an ACK to the master device (NACK: SDAA0 = 1). The slave device also does not issue the INTIICA0
interrupt (address match) and does not set a wait status. The master device, however, issues the INTIICA0
interrupt (end of address transmission) regardless of whether it receives an ACK or NACK.
Remark <1> to <15> in Figure 13-32 represent the entire procedure for communicating data using the I2C bus.
Figure 13-32 (1) Start condition ~ address ~ data shows the processing from <1> to <6>, Figure 13-32
(2) Address ~ data ~ data shows the processing from <3> to <10>, and Figure 13-32 (3) Data ~ data ~
stop condition shows the processing from <7> to <15>.
Master side
Note 1 Note 1
IICA0
<5> <9>
ACKD0
(ACK detection)
WTIM0 H
(8 or 9 clock wait)
ACKE0
(ACK control) H
MSTS0
(communication status) H
STT0
(ST trigger) L
SPT0
(SP trigger) L
WREL0
L
(wait cancellation)
INTIICA0
(interrupt)
TRC0
(transmit/receive) H
Bus line
SCLA0 (bus)
(clock line)
<4> <8>
SDAA0 (bus)
W ACK D 17 D16 D 15 D14 D 13 D12 D 11 D 10 ACK D 27
(data line)
<3> <7>
Slave side
IICA0
ACKD0
(ACK detection)
STD0
(ST detection)
SPD0
(SP detection) L
WTIM0 H
(8 or 9 clock wait)
ACKE0
(ACK control) H
MSTS0
(communication status) L
WREL0 <10>
<6> Note 2 Note 2
(wait cancellation)
INTIICA0
(interrupt)
TRC0
(transmit/receive) L
Notes 1. Write data to IICA0, not setting the WREL0 bit, in order to cancel a wait state during transmission by a
master device.
2. For releasing wait state during reception of a slave device, write “FFH” to IICA0 or set the WREL0 bit.
The meanings of <3> to <10> in (2) Address ~ data ~ data in Figure 13-32 are explained below.
<3> In the slave device if the address received matches the address (SVA0 value) of a slave deviceNote, that
slave device sends an ACK by hardware to the master device. The ACK is detected by the master device
(ACKD0 = 1) at the rising edge of the 9th clock.
<4> The master device issues an interrupt (INTIICA0: end of address transmission) at the falling edge of the 9th
clock. The slave device whose address matched the transmitted slave address sets a wait status (SCLA0 =
0) and issues an interrupt (INTIICA0: address match)Note.
<5> The master device writes the data to transmit to the IICA shift register 0 (IICA0) and releases the wait
status that it set by the master device.
<6> If the slave device releases the wait status (WREL0 = 1), the master device starts transferring data to the
slave device.
<7> After data transfer is completed, because of ACKE0 = 1, the slave device sends an ACK by hardware to the
master device. The ACK is detected by the master device (ACKD0 = 1) at the rising edge of the 9th clock.
<8> The master device and slave device set a wait status (SCLA0 = 0) at the falling edge of the 9th clock, and
both the master device and slave device issue an interrupt (INTIICA0: end of transfer).
<9> The master device writes the data to transmit to the IICA0 register and releases the wait status that it set by
the master device.
<10> The slave device reads the received data and releases the wait status (WREL0 = 1). The master device
then starts transferring data to the slave device.
Note If the transmitted address does not match the address of the slave device, the slave device does not return
an ACK to the master device (NACK: SDAA0 = 1). The slave device also does not issue the INTIICA0
interrupt (address match) and does not set a wait status. The master device, however, issues the INTIICA0
interrupt (end of address transmission) regardless of whether it receives an ACK or NACK.
Remark <1> to <15> in Figure 13-32 represent the entire procedure for communicating data using the I2C bus.
Figure 13-32 (1) Start condition ~ address ~ data shows the processing from <1> to <6>, Figure 13-32
(2) Address ~ data ~ data shows the processing from <3> to <10>, and Figure 13-32 (3) Data ~ data ~
stop condition shows the processing from <7> to <15>.
Master side
Note 1
IICA0
<9>
ACKD0
(ACK detection)
WTIM0
H
(8 or 9 clock wait)
ACKE0
(ACK control) H
MSTS0
(communication status)
STT0
(ST trigger) L
SPT0
(SP trigger)
WREL0 <14>
(wait cancellation) L
INTIICA0
(interrupt)
TRC0
(transmit/receive)
SCLA0 (bus)
(clock line)
<8> <12>
SDAA0 (bus)
D150 ACK D167 D166 D165 D164 D163 D162 D161 D160 ACK
(data line)
<7> <11> Note 2
Slave side <15>
IICA0
ACKD0
(ACK detection)
STD0
(ST detection) L
SPD0
(SP detection)
WTIM0 H
(8 or 9 clock wait)
ACKE0
(ACK control) H
MSTS0
(communication status) L
WREL0
<10> Note 3 <13> Note 3
(wait cancellation)
INTIICA0
(interrupt)
TRC0
(transmit/receive) L
Notes 1. Write data to IICA0, not setting the WREL0 bit, in order to cancel a wait state during transmission by a master
device.
2. Make sure that the time between the rise of the SCLA0 pin signal and the generation of the stop
condition after a stop condition has been issued is at least 4.0 μs when specifying standard mode and
at least 0.6 μs when specifying fast mode.
3. For releasing wait state during reception of a slave device, write “FFH” to IICA0 or set the WREL0 bit.
The meanings of <7> to <15> in (3) Data ~ data ~ stop condition in Figure 13-32 are explained below.
<7> After data transfer is completed, because of ACKE0 = 1, the slave device sends an ACK by hardware to the
master device. The ACK is detected by the master device (ACKD0 = 1) at the rising edge of the 9th clock.
<8> The master device and slave device set a wait status (SCLA0 = 0) at the falling edge of the 9th clock, and
both the master device and slave device issue an interrupt (INTIICA0: end of transfer).
<9> The master device writes the data to transmit to the IICA shift register 0 (IICA0) and releases the wait
status that it set by the master device.
<10> The slave device reads the received data and releases the wait status (WREL0 = 1). The master device
then starts transferring data to the slave device.
<11> When data transfer is complete, the slave device (ACKE0 =1) sends an ACK by hardware to the master
device. The ACK is detected by the master device (ACKD0 = 1) at the rising edge of the 9th clock.
<12> The master device and slave device set a wait status (SCLA0 = 0) at the falling edge of the 9th clock, and
both the master device and slave device issue an interrupt (INTIICA0: end of transfer).
<13> The slave device reads the received data and releases the wait status (WREL0 = 1).
<14> By the master device setting a stop condition trigger (SPT0 = 1), the bus data line is cleared (SDAA0 = 0)
and the bus clock line is set (SCLA0 = 1). After the stop condition setup time has elapsed, by setting the
bus data line (SDAA0 = 1), the stop condition is then generated (i.e. SCLA0 =1 changes SDAA0 from 0 to
1).
<15> When a stop condition is generated, the slave device detects the stop condition and issues an interrupt
(INTIICA0: stop condition).
Remark <1> to <15> in Figure 13-32 represent the entire procedure for communicating data using the I2C bus.
Figure 13-32 (1) Start condition ~ address ~ data shows the processing from <1> to <6>, Figure 13-32
(2) Address ~ data ~ data shows the processing from <3> to <10>, and Figure 13-32 (3) Data ~ data ~
stop condition shows the processing from <7> to <15>.
Master side
IICA0
<iii>
ACKD0
(ACK detection)
WTIM0
H
(8 or 9 clock wait)
ACKE0
(ACK control) H
MSTS0
(communication status) H
STT0
(ST trigger) <ii>
SPT0
(SP trigger) L
WREL0
(wait cancellation) L
INTIICA0
(interrupt)
TRC0
(transmit/receive) H
IICA0
ACKD0
(ACK detection)
STD0
(ST detection)
SPD0
(SP detection) L
WTIM0
H
(8 or 9 clock wait)
ACKE0
(ACK control) H
MSTS0
(communication status) L
WREL0 Note 2
<i>
(wait cancellation)
INTIICA0
(interrupt)
TRC0
(transmit/receive) L
Notes 1. Make sure that the time between the rise of the SCLA0 pin signal and the generation of the start
condition after a restart condition has been issued is at least 4.7 μs when specifying standard mode and
at least 0.6 μs when specifying fast mode.
2. For releasing wait state during reception of a slave device, write “FFH” to IICA0 or set the WREL0 bit.
The following describes the operations in Figure 13-32 (4) Data ~ restart condition ~ address. After the operations
in steps <7> and <8>, the operations in steps <i> to <iii> are performed. These steps return the processing to step
<iii>, the data transmission step.
<7> After data transfer is completed, because of ACKE0 = 1, the slave device sends an ACK by hardware to the
master device. The ACK is detected by the master device (ACKD0 = 1) at the rising edge of the 9th clock.
<8> The master device and slave device set a wait status (SCLA0 = 0) at the falling edge of the 9th clock, and
both the master device and slave device issue an interrupt (INTIICA0: end of transfer).
<i> The slave device reads the received data and releases the wait status (WREL0 = 1).
<ii> The start condition trigger is set again by the master device (STT0 = 1) and a start condition (i.e. SCLA0 =1
changes SDAA0 from 1 to 0) is generated once the bus clock line goes high (SCLA0 = 1) and the bus data
line goes low (SDAA0 = 0) after the restart condition setup time has elapsed. When the start condition is
subsequently detected, the master device is ready to communicate once the bus clock line goes low
(SCLA0 = 0) after the hold time has elapsed.
<iii> The master device writing the address + R/W (transmission) to the IICA shift register (IICA0) enables the
slave address to be transmitted.
Master side
IICA0
<2>
ACKD0
(ACK detection)
WTIM0 <5>
(8 or 9 clock wait)
ACKE0
(ACK control) H
MSTS0
(communication status)
STT0 <1>
(ST trigger)
SPT0
(SP trigger) L
SCLA0 (bus)
(clock line)
Note 2 <4>
SDAA0 (bus)
AD6 AD5 AD4 AD3 AD2 AD1 AD0 R ACK D17
(data line)
Slave address <3>
Slave side
Note 3
IICA0
<6>
ACKD0
(ACK detection)
STD0
(ST detection)
SPD0
(SP detection)
WTIM0 H
(8 or 9 clock wait)
ACKE0
(ACK control) H
MSTS0
(communication status) L
WREL0
(wait cancellation) L
INTIICA0
(interrupt)
TRC0
(transmit/receive)
Notes 1. For releasing wait state during reception of a master device, write “FFH” to IICA0 or set the WREL0 bit.
2. Make sure that the time between the fall of the SDAA0 pin signal and the fall of the SCLA0 pin signal is
at least 4.0 μs when specifying standard mode and at least 0.6 μs when specifying fast mode.
3. Write data to IICA0, not setting the WREL0 bit, in order to cancel a wait state during transmission by a
slave device.
The meanings of <1> to <7> in (1) Start condition ~ address ~ data in Figure 13-33 are explained below.
<1> The start condition trigger is set by the master device (STT0 = 1) and a start condition (i.e. SCLA0 =1
changes SDAA0 from 1 to 0) is generated once the bus data line goes low (SDAA0). When the start
condition is subsequently detected, the master device enters the master device communication status
(MSTS0 = 1). The master device is ready to communicate once the bus clock line goes low (SCLA0 = 0)
after the hold time has elapsed.
<R> <2> The master device writes the address + R (reception) to the IICA shift register 0 (IICA0) and transmits the
slave address.
<3> In the slave device if the address received matches the address (SVA0 value) of a slave device Note, that
slave device sends an ACK by hardware to the master device. The ACK is detected by the master device
(ACKD0 = 1) at the rising edge of the 9th clock.
<4> The master device issues an interrupt (INTIICA0: end of address transmission) at the falling edge of the 9th
clock. The slave device whose address matched the transmitted slave address sets a wait status (SCLA0 =
0) and issues an interrupt (INTIICA0: address match) Note.
<5> The timing at which the master device sets the wait status changes to the 8th clock (WTIM0 = 0).
<6> The slave device writes the data to transmit to the IICA0 register and releases the wait status that it set by
the slave device.
<7> The master device releases the wait status (WREL0 = 1) and starts transferring data from the slave device
to the master device.
Note If the transmitted address does not match the address of the slave device, the slave device does not return
an ACK to the master device (NACK: SDAA0 = 1). The slave device also does not issue the INTIICA0
interrupt (address match) and does not set a wait status. The master device, however, issues the INTIICA0
interrupt (end of address transmission) regardless of whether it receives an ACK or NACK.
Remark <1> to <19> in Figure 13-33 represent the entire procedure for communicating data using the I2C bus.
Figure 13-33 (1) Start condition ~ address ~ data shows the processing from <1> to <7>, Figure 13-33
(2) Address ~ data ~ data shows the processing from <3> to <12>, and Figure 13-33 (3) Data ~ data ~
stop condition shows the processing from <8> to <19>.
Master side
IICA0
ACKD0
(ACK detection)
WTIM0
(8 or 9 clock wait) <5>
ACKE0
(ACK control) H
MSTS0
(communication status) H
STT0
(ST trigger) L
SPT0
(SP trigger) L
Bus line
SCLA0 (bus)
(clock line)
<4> <8> <11>
SDAA0 (bus)
R ACK D17 D16 D15 D14 D13 D12 D11 D10 ACK D27
(data line)
<3> <10>
Slave side
IICA0
<6> Note 2 <12> Note 2
ACKD0
(ACK detection)
STD0
(ST detection)
SPD0
(SP detection) L
WTIM0
H
(8 or 9 clock wait)
ACKE0
(ACK control) H
MSTS0
(communication status) L
WREL0
(wait cancellation) L
INTIICA0
(interrupt)
TRC0
(transmit/receive) H
Notes 1. For releasing wait state during reception of a master device, write “FFH” to IICA0 or set the WREL0 bit.
2. Write data to IICA0, not setting the WREL0 bit, in order to cancel a wait state during transmission by a
slave device.
The meanings of <3> to <12> in (2) Address ~ data ~ data in Figure 13-33 are explained below.
<3> In the slave device if the address received matches the address (SVA0 value) of a slave deviceNote, that
slave device sends an ACK by hardware to the master device. The ACK is detected by the master device
(ACKD0 = 1) at the rising edge of the 9th clock.
<4> The master device issues an interrupt (INTIICA0: end of address transmission) at the falling edge of the 9th
clock. The slave device whose address matched the transmitted slave address sets a wait status (SCLA0 =
0) and issues an interrupt (INTIICA0: address match)Note.
<5> The master device changes the timing of the wait status to the 8th clock (WTIM0 = 0).
<6> The slave device writes the data to transmit to the IICA shift register 0 (IICA0) and releases the wait status
that it set by the slave device.
<7> The master device releases the wait status (WREL0 = 1) and starts transferring data from the slave device
to the master device.
<8> The master device sets a wait status (SCLA0 = 0) at the falling edge of the 8th clock, and issues an
interrupt (INTIICA0: end of transfer). Because of ACKE0 = 1 in the master device, the master device then
sends an ACK by hardware to the slave device.
<9> The master device reads the received data and releases the wait status (WREL0 = 1).
<10> The ACK is detected by the slave device (ACKD0 = 1) at the rising edge of the 9th clock.
<11> The slave device set a wait status (SCLA0 = 0) at the falling edge of the 9th clock, and the slave device
issue an interrupt (INTIICA0: end of transfer).
<12> By the slave device writing the data to transmit to the IICA0 register, the wait status set by the slave device
is released. The slave device then starts transferring data to the master device.
Note If the transmitted address does not match the address of the slave device, the slave device does not return
an ACK to the master device (NACK: SDAA0 = 1). The slave device also does not issue the INTIICA0
interrupt (address match) and does not set a wait status. The master device, however, issues the INTIICA0
interrupt (end of address transmission) regardless of whether it receives an ACK or NACK.
Remark <1> to <19> in Figure 13-33 represent the entire procedure for communicating data using the I2C bus.
Figure 13-33 (1) Start condition ~ address ~ data shows the processing from <1> to <7>, Figure 13-33
(2) Address ~ data ~ data shows the processing from <3> to <12>, and Figure 13-33 (3) Data ~ data ~
stop condition shows the processing from <8> to <19>.
Master side
IICA0
ACKD0
(ACK detection)
WTIM0
(8 or 9 clock wait)
<14>
ACKE0
(ACK control)
MSTS0
(communication status)
STT0
(ST trigger) L
SPT0
(SP trigger)
WREL0 Note 1 Note 1 <17>
(wait cancellation)
INTIICA0 <9> <15>
(interrupt)
TRC0
(transmit/receive) L
SCLA0 (bus)
(clock line)
<8> <11> <13> <16>
SDAA0 (bus) Note 2
(data line) D150 ACK D167 D166 D165 D164 D163 D162 D161 D160 NACK
<10>
Slave side
<19>
IICA0
<12> Note 3
ACKD0
(ACK detection)
STD0
(ST detection) L
SPD0
(SP detection)
WTIM0
H
(8 or 9 clock wait)
ACKE0
(ACK control) H
MSTS0
(communication L
status) <18>
WREL0 Notes 1, 4
(wait cancellation)
INTIICA0
(interrupt)
TRC0
(transmit/receive) Note 4
Notes 1. To cancel a wait state, write “FFH” to IICA0 or set the WREL0 bit.
2. Make sure that the time between the rise of the SCLA0 pin signal and the generation of the stop
condition after a stop condition has been issued is at least 4.0 μs when specifying standard mode and at
least 0.6 μs when specifying fast mode.
3. Write data to IICA0, not setting the WREL0 bit, in order to cancel a wait state during transmission by a
slave device.
4. If a wait state during transmission by a slave device is canceled by setting the WREL0 bit, the TRC0 bit
will be cleared.
The meanings of <8> to <19> in (3) Data ~ data ~ stop condition in Figure 13-33 are explained below.
<8> The master device sets a wait status (SCLA0 = 0) at the falling edge of the 8th clock, and issues an
interrupt (INTIICA0: end of transfer). Because of ACKE0 = 0 in the master device, the master device then
sends an ACK by hardware to the slave device.
<9> The master device reads the received data and releases the wait status (WREL0 = 1).
<10> The ACK is detected by the slave device (ACKD0 = 1) at the rising edge of the 9th clock.
<11> The slave device set a wait status (SCLA0 = 0) at the falling edge of the 9th clock, and the slave device
issue an interrupt (INTIICA0: end of transfer).
<12> By the slave device writing the data to transmit to the IICA register, the wait status set by the slave device is
released. The slave device then starts transferring data to the master device.
<13> The master device issues an interrupt (INTIICA0: end of transfer) at the falling edge of the 8th clock, and
sets a wait status (SCLA0 = 0). Because ACK control (ACKE0 = 1) is performed, the bus data line is at the
low level (SDAA0 = 0) at this stage.
<14> The master device sets NACK as the response (ACKE0 = 0) and changes the timing at which it sets the
wait status to the 9th clock (WTIM0 = 1).
<15> If the master device releases the wait status (WREL0 = 1), the slave device detects the NACK (ACK = 0) at
the rising edge of the 9th clock.
<16> The master device and slave device set a wait status (SCLA0 = 0) at the falling edge of the 9th clock, and
both the master device and slave device issue an interrupt (INTIICA0: end of transfer).
<17> When the master device issues a stop condition (SPT0 = 1), the bus data line is cleared (SDAA0 = 0) and
the master device releases the wait status. The master device then waits until the bus clock line is set
(SCLA0 = 1).
<18> The slave device acknowledges the NACK, halts transmission, and releases the wait status (WREL0 = 1) to
end communication. Once the slave device releases the wait status, the bus clock line is set (SCLA0 = 1).
<19> Once the master device recognizes that the bus clock line is set (SCLA0 = 1) and after the stop condition
setup time has elapsed, the master device sets the bus data line (SDAA0 = 1) and issues a stop condition
(i.e. SCLA0 =1 changes SDAA0 from 0 to 1). The slave device detects the generated stop condition and
slave device issue an interrupt (INTIICA0: stop condition).
Remark <1> to <19> in Figure 13-33 represent the entire procedure for communicating data using the I2C bus.
Figure 13-33 (1) Start condition ~ address ~ data shows the processing from <1> to <7>, Figure 13-33
(2) Address ~ data ~ data shows the processing from <3> to <12>, and Figure 13-33 (3) Data ~ data ~
stop condition shows the processing from <8> to <19>.
Item Configuration
Internal bus
Multiplication/division data register B Multiplication/division data register C Multiplication/division data register A DIVMODE MACMODE MDSM DIVST
MDBH MDBL MDCH MDCL MDAH MDAL
Start
INTMD
Multiplicand
Divisor Multiplier Dividend
Clear
Multiplication/division block
Controller
Address: FFFF0H, FFFF1H, FFFF2H, FFFF3H After reset: 0000H, 0000H R/W
Symbol FFFF3H FFFF2H
MDAH MDAH MDAH MDAH MDAH MDAH MDAH MDAH MDAH MDAH MDAH MDAH MDAH MDAH MDAH MDAH MDAH
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
MDAL MDAL MDAL MDAL MDAL MDAL MDAL MDAL MDAL MDAL MDAL MDAL MDAL MDAL MDAL MDAL MDAL
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Cautions 1. Do not rewrite the MDAH and MDAL registers values during division operation processing
(when the multiplication/division control register (MDUC) value is 81H or C1H). The operation
will be executed in this case, but the operation result will be an undefined value.
2. The MDAH and MDAL registers values read during division operation processing (when the
MDUC register value is 81H or C1H) will not be guaranteed.
3. The data is in the two's complement format in either the multiplication mode (signed) or
multiply-accumulator mode (signed).
The following table shows the functions of the MDAH and MDAL registers during operation execution.
Table 14-2. Functions of MDAH and MDAL Registers During Operation Execution
Address: FFFF4H, FFFF5H, FFFF6H, FFFF7H After reset: 0000H, 0000H R/W
Symbol FFFF7H FFFF6H
MDBH MDBH MDBH MDBH MDBH MDBH MDBH MDBH MDBH MDBH MDBH MDBH MDBH MDBH MDBH MDBH MDBH
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
MDBL MDBL MDBL MDBL MDBL MDBL MDBL MDBL MDBL MDBL MDBL MDBL MDBL MDBHL MDBL MDBL MDBL
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Cautions 1. Do not rewrite the MDBH and MDBL registers values during division operation processing
(when the multiplication/division control register (MDUC) value is 81H or C1H) or multiply-
accumulation operation processing (when the MDUC register value is 41H or 49H). The
operation result will be an undefined value.
2. Do not set the MDBH and MDBL registers to 0000H in the division mode. If they are set, the
operation result will be an undefined value.
3. The data is in the two's complement format in either the multiplication mode (signed) or
multiply-accumulator mode (signed).
The following table shows the functions of the MDBH and MDBL registers during operation execution.
Table 14-3. Functions of MDBH and MDBL Registers During Operation Execution
Address: F00E0H, F00E1H, F00E2H, F00E3H After reset: 0000H, 0000H R/W
Symbol F00E3H F00E2H
MDCH MDCH MDCH MDCH MDCH MDCH MDCH MDCH MDCH MDCH MDCH MDCH MDCH MDCH MDCH MDCH MDCH
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
MDCL MDCL MDCL MDCL MDCL MDCL MDCL MDCL MDCL MDCL MDCL MDCL MDCL MDCL MDCL MDCL MDCL
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Cautions 1. The MDCH and MDCL registers values read during division operation processing (when the
multiplication/division control register (MDUC) value is 81H or C1H) will not be guaranteed.
2. During multiply-accumulator processing (when the MDUC register value is 41H or 49H), do not
use software to rewrite the values of the MDCH and MDCL registers. If this is done, the
operation result will be undefined.
3. The data is in the two's complement format in the multiply-accumulator mode (signed).
Table 14-4. Functions of MDCH and MDCL Registers During Operation Execution
The register configuration differs between when multiplication is executed and when division is executed, as follows.
The multiplier and divider/multiply-accumulator is controlled by using the multiplication/division control register (MDUC).
0 No overflow
1 With over flow
<Set condition>
• For the multiply-accumulator mode (unsigned)
The bit is set when the accumulated value goes outside the range from 00000000h to FFFFFFFFh.
• For the multiply-accumulator mode (signed)
The bit is set when the result of adding a positive product to a positive accumulated value exceeds
7FFFFFFFh and is negative, or when the result of adding a negative product to a negative accumulated
value exceeds 80000000h and is positive.
Note
DIVST Division operation start/stop
Note The DIVST bit can only be set (1) in the division mode. In the division mode, division operation is started by
setting (1) the DIVST bit. The DIVST bit is automatically cleared (0) when the operation ends. In the
multiplication mode, operation is automatically started by setting the multiplier and multiplicand to
multiplication/division data register A (MDAH, MDAL), respectively.
Cautions 1. Do not rewrite the DIVMODE, MDSM bits during operation processing (while the DIVST bit is
1). If it is rewritten, the operation result will be an undefined value.
2. The DIVST bit cannot be cleared (0) by using software during division operation processing
(while the DIVST bit is 1).
• Initial setting
<1> Set the multiplication/division control register (MDUC) to 00H.
<2> Set the multiplicand to multiplication/division data register A (L) (MDAL).
<3> Set the multiplier to multiplication/division data register A (H) (MDAH).
(There is no preference in the order of executing steps <2> and <3>. Multiplication operation is automatically
started when the multiplier and multiplicand are set to the MDAH and MDAL registers, respectively.)
• During operation processing
<4> Wait for at least one clock. The operation will end when one clock has been issued.
• Operation end
<5> Read the product (lower 16 bits) from multiplication/division data register B (L) (MDBL).
<6> Read the product (higher 16 bits) from multiplication/division data register B (H) (MDBH).
(There is no preference in the order of executing steps <5> and <6>.)
• Next operation
<7> To execute multiplication (unsigned) operation next, start from the “Initial setting” for multiplication (unsigned)
operation.
<8> The next time multiplication (signed), multiply-accumulation (signed or unsigned), or division is performed, start
with the initial settings of each step.
Operation clock
MDUC 00H
<1>
MDSM L
• Initial setting
<1> Set the multiplication/division control register (MDUC) to 08H.
<2> Set the multiplicand to multiplication/division data register A (L) (MDAL).
<3> Set the multiplier to multiplication/division data register A (H) (MDAH).
(There is no preference in the order of executing steps <2> and <3>. Multiplication operation is automatically
started when the multiplier and multiplicand are set to the MDAH and MDAL registers, respectively.)
• During operation processing
<4> Wait for at least one clock. The operation will end when one clock has been issued.
• Operation end
<5> Read the product (lower 16 bits) from multiplication/division data register B (L) (MDBL).
<6> Read the product (higher 16 bits) from multiplication/division data register B (H) (MDBH).
(There is no preference in the order of executing steps <5> and <6>.)
• Next operation
<7> To execute multiplication (signed) operation next, start from the “Initial setting” for multiplication (signed)
operation.
<8> The next time multiplication (unsigned), multiply-accumulation (signed or unsigned), or division is performed,
start with the initial settings of each step.
Caution The data is in the two's complement format in multiplication mode (signed).
Figure 14-7. Timing Diagram of Multiplication (Signed) Operation (−2 × 32767 = −65534)
Operation clock
<1>
MDUC 00H 08H
MDSM
FFFF_
MDBL, MDBH Initial value = 0 FFFF_0002H 8001H 0001H
<4>
<2> <3> <5>, <6> <7>
• Initial setting
<1> Set the multiplication/division control register (MDUC) to 40H.
<2> Set the initial accumulated value of higher 16 bits to multiplication/division data register C (L) (MDCL).
<3> Set the initial accumulated value of lower 16 bits to multiplication/division data register C (H) (MDCH).
<4> Set the multiplicand to multiplication/division data register A (L) (MDAL).
<5> Set the multiplier to multiplication/division data register A (H) (MDAH).
<R> (There is no preference in the order of executing steps <2>, <3>, and <4>. Multiplication operation is
automatically started when the multiplier is set to the MDAH register, respectively.)
• During operation processing
<6> The multiplication operation finishes in one clock cycle.
(The multiplication result is stored in multiplication/division data register B (L) (MDBL) and multiplication/division
data register B (H) (MDBH).)
<7> After <6>, the multiply-accumulation operation finishes in one additional clock cycle. (There is a wait of at least
two clock cycles after specifying the initial settings is finished (<5>).)
• Operation end
<8> Read the accumulated value (lower 16 bits) from the MDCL register.
<9> Read the accumulated value (higher 16 bits) from the MDCH register.
(There is no preference in the order of executing steps <8> and <9>.)
<R> (<10> If the result of the multiply-accumulation operation causes an overflow, the MACOF bit is set to 1, INTMD
signal is occurred.)
• Next operation
<11> To execute multiply-accumulation (unsigned) operation next, start from the “Initial setting” for multiply-
accumulation (unsigned) operation.
<12> The next time multiplication (signed or unsigned), multiply-accumulation (signed), or division is performed, start
with the initial settings of each step.
Operation clock
<1>
MDUC 00H 40H 44H
MDSM L
INTMD
MACOF
MACSF L
<2> <3> <4> <5> <6> <7> <2> <3> <4> <5> <6> <7>
• Initial setting
<1> Set the multiplication/division control register (MDUC) to 48H.
<2> Set the initial accumulated value of higher 16 bits to multiplication/division data register C (H) (MDCH).
(<3> If the accumulated value in the MDCH register is negative, the MACSF bit is set to 1.)
<4> Set the initial accumulated value of lower 16 bits to multiplication/division data register C (L) (MDCL).
<5> Set the multiplicand to multiplication/division data register A (L) (MDAL).
<6> Set the multiplier to multiplication/division data register A (H) (MDAH).
<R> (There is no preference in the order of executing steps <2>, <4>, and <5>. Multiplication operation is
automatically started when the multiplier is set to the MDAH register, respectively.)
• During operation processing
<7> The multiplication operation finishes in one clock cycle.
(The multiplication result is stored in multiplication/division data register B (L) (MDBL) and multiplication/division
data register B (H) (MDBH).)
<8> After <7>, the multiply-accumulation operation finishes in one additional clock cycle. (There is a wait of at least
two clock cycles after specifying the initial settings is finished (<6>).)
• Operation end
<9> If the accumulated value stored in the MDCL and MDCH registers is positive, the MACSF bit is cleared to 0.
<10> Read the accumulated value (lower 16 bits) from the MDCL register.
<11> Read the accumulated value (higher 16 bits) from the MDCH register.
(There is no preference in the order of executing steps <10> and <11>.)
(<12> If the result of the multiply-accumulation operation causes an overflow, the MACOF bit is set to 1, INTMD
signal is occurred.)
• Next operation
<13> To execute multiply-accumulation (signed) operation next, start from the “Initial setting” for multiply-accumulation
(signed) operation.
<14> The next time multiplication (signed or unsigned), multiply-accumulation (unsigned), or division is performed,
start with the initial settings of each step.
Caution The data is in the two's complement format in multiply-accumulation (signed) operation.
Operation clock
MDSM L
INTMD
MACOF
<2> <4> <5> <6> <7> <8> <2> <4> <5> <6> <7> <8>
• Initial setting
<1> Set the multiplication/division control register (MDUC) to 80H.
<2> Set the dividend (higher 16 bits) to multiplication/division data register A (H) (MDAH).
<3> Set the dividend (lower 16 bits) to multiplication/division data register A (L) (MDAL).
<4> Set the divisor (higher 16 bits) to multiplication/division data register B (H) (MDBH).
<5> Set the divisor (lower 16 bits) to multiplication/division data register B (L) (MDBL).
<6> Set bit 0 (DIVST) of the MDUC register to 1.
(There is no preference in the order of executing steps <2> to <5>.)
• During operation processing
<7> The operation will end when one of the following processing is completed.
• A wait of at least 16 clocks (The operation will end when 16 clocks have been issued.)
• A check whether the DIVST bit has been cleared
• Generation of a division completion interrupt (INTMD)
(The read values of the MDBL, MDBH, MDCL, and MDCH registers during operation processing are not
guaranteed.)
• Operation end
<8> The DIVST bit is cleared (0) and an interrupt request signal (INTMD) is generated (end of operation).
<9> Read the quotient (lower 16 bits) from the MDAL register.
<10> Read the quotient (higher 16 bits) from the MDAH register.
<11> Read the remainder (lower 16 bits) from multiplication/division data register C (L) (MDCL).
<12> Read the remainder (higher 16 bits) from multiplication/division data register C (H) (MDCH).
(There is no preference in the order of executing steps <9> to <12>.)
• Next operation
<13> To execute division operation next, start from the “Initial setting” for Division operation.
<14> The next time multiplication (signed or unsigned) or multiply-accumulation (signed or unsigned) is performed,
start with the initial settings of each step.
RL78/G13
Figure 14-10. Timing Diagram of Division Operation (Example: 35 ÷ 6 = 5, Remainder 5)
Operation clock
Counter Undefined 0 1 2 3 4 5 6 7 8 9 A B C D E F 0
<8>
INTMD
<1> <2> <3> <4> <5> <6> <7> <9>, <10> <11>, <12>
799
RL78/G13 CHAPTER 15 DMA CONTROLLER
{ Number of DMA channels: 2 channels (20, 24, 25, 30, 32, 36, 40, 44, 48, 52, or 64-pin products)
4 channels (80, 100, or 128-pin products)
{ Transfer unit: 8 or 16 bits
{ Maximum transfer unit: 1024 times
{ Transfer type: 2-cycle transfer (One transfer is processed in 2 clocks and the CPU stops during that
processing.)
{ Transfer mode: Single-transfer mode
{ Transfer request: Selectable from the following peripheral hardware interrupts
• A/D converter
• Serial interface
(CSI00, CSI01, CSI10, CSI11, CSI20, CSI21, CSI30, CSI31, UART0 to UART3)
• Timer (channel 0, 1, 2, 3, 10, 11, 12, or 13)
{ Transfer target: Between SFR and internal RAM
Item Configuration
Address: FFFB0H (DSA0), FFFB1H (DSA1), F0200H (DSA2), F0201H (DSA3) After reset: 00H R/W
7 6 5 4 3 2 1 0
DSAn
Address: FFFB2H, FFFB3H (DRA0), FFFB4H, FFFB5H (DRA1) , After reset: 0000H R/W
F0202H, F0203H (DRA2), F0204H, F0205H (DRA3)
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
DRAn
(n = 0 to 3)
<R> Table 15-2 Internal RAM Area other than the General-purpose Registers
Part Number Internal RAM Area other than the General-purpose Registers
Address: FFFB6H, FFFB7H (DBC0), FFFB8H, FFFB9H (DBC1) After reset: 0000H R/W
F0206H, F0207H (DBC2), F0208H, F0209H (DBC3)
DBC0H: FFFB7H DBC0L: FFFB6H
DBC1H: FFFB9H DBC1L: FFFB8H
DBC2H: F0207H DBC2L: F0206H
DBC3H: F0209H DBC3L: F0208H
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
DBCn 0 0 0 0 0 0
(n = 0 to 3)
000H 1024 Completion of transfer or waiting for 1024 times of DMA transfer
001H 1 Waiting for remaining one time of DMA transfer
002H 2 Waiting for remaining two times of DMA transfer
003H 3 Waiting for remaining three times of DMA transfer
• • •
• • •
• • •
Address: FFFBAH (DMC0), FFFBBH (DMC1), F020AH (DMC2), F020BH (DMC3) After reset: 00H R/W
Symbol <7> <6> <5> <4> 3 2 1 0
Note 1
STGn DMA transfer start software trigger
0 No trigger operation
1 DMA transfer is started when DMA operation is enabled (DENn = 1).
DMA transfer is performed once by writing 1 to the STGn bit when DMA operation is enabled (DENn = 1).
When this bit is read, 0 is always read.
0 8 bits
1 16 bits
Note 2
DWAITn Pending of DMA transfer
0 Executes DMA transfer upon DMA start request (not held pending).
1 Holds DMA start request pending if any.
DMA transfer that has been held pending can be started by clearing the value of the DWAITn bit to 0.
It takes 2 clocks to actually hold DMA transfer pending when the value of the DWAITn bit is set to 1.
Notes 1. The software trigger (STGn) can be used regardless of the IFCn0 to IFCn3 bits values.
2. When DMA transfer is held pending while using two or more DMA channels, be sure to hold the DMA
transfer pending for all channels (by setting the DWAIT0, DWAIT1, DWAIT2, and DWAIT3 bits to 1).
(When n = 0 or 1)
Note
IFCn IFCn IFCn IFCn Selection of DMA start source
3 2 1 0 Trigger signal Trigger contents
Note The software trigger (STGn) can be used regardless of the IFCn0 to IFCn3 bits values.
(When n = 2 or 3)
Note
IFCn IFCn IFCn IFCn Selection of DMA start source
3 2 1 0 Trigger signal Trigger contents
Note The software trigger (STGn) can be used regardless of the IFCn0 to IFCn3 bits values.
Address: FFFBCH (DRC0), FFFBDH (DRC1), F020CH (DRC2), F020DH (DRC3) After reset: 00H R/W
Symbol <7> 6 5 4 3 2 1 <0>
DMAC waits for a DMA trigger when DSTn = 1 after DMA operation is enabled (DENn = 1).
DMAC waits for a DMA trigger when DSTn = 1 after DMA operation is enabled (DENn = 1).
When a software trigger (STGn) or the start source trigger set by the IFCn3 to IFCn0 bits is input, DMA transfer is
started.
When DMA transfer is completed after that, this bit is automatically cleared to 0.
Write 0 to this bit to forcibly terminate DMA transfer under execution.
Caution The DSTn flag is automatically cleared to 0 when a DMA transfer is completed.
Writing the DENn flag is enabled only when DSTn = 0. When a DMA transfer is terminated
without waiting for generation of the interrupt (INTDMAn) of DMAn, therefore, set the DSTn bit
to 0 and then the DENn bit to 0 (for details, refer to 15.5.5 Forced termination by software).
<1> The DMA controller is enabled to operate when DENn = 1. Before writing the other registers, be sure to set the
DENn bit to 1. Use 80H to write with an 8-bit manipulation instruction.
<2> Set an SFR address, a RAM address, the number of times of transfer, and a transfer mode of DMA transfer to
DMA SFR address register n (DSAn), DMA RAM address register n (DRAn), DMA byte count register n (DBCn),
and DMA mode control register n (DMCn).
<3> The DMA controller waits for a DMA trigger when DSTn = 1. Use 81H to write with an 8-bit manipulation
instruction.
<4> When a software trigger (STGn) or a start source trigger specified by the IFCn3 to IFCn0 bits is input, a DMA
transfer is started.
<5> Transfer is completed when the number of times of transfer set by the DBCn register reaches 0, and transfer is
automatically terminated by occurrence of an interrupt (INTDMAn).
<6> Stop the operation of the DMA controller by clearing the DENn bit to 0 when the DMA controller is not used.
DENn = 1
DSTn = 1
No
DMA trigger = 1?
Yes
No
DBCn = 0000H ?
Yes
DSTn = 0
INTDMAn = 1
0 0 Transfer from SFR of 1-byte data (fixed address) to RAM (address is incremented by +1)
0 1 Transfer from SFR of 2-byte data (fixed address) to RAM (address is incremented by +2)
1 0 Transfer from RAM of 1-byte data (address is incremented by +1) to SFR (fixed address)
1 1 Transfer from RAM of 2-byte data (address is incremented by +2) to SFR (fixed address)
By using these transfer modes, up to 1024 bytes of data can be consecutively transferred by using the serial interface,
data resulting from A/D conversion can be consecutively transferred, and port data can be scanned at fixed time intervals
by using a timer.
Start
DEN0 = 1
DSA0 = 44H
DRA0 = FB00H
DBC0 = 0100H
DMC0 = 48H
DST0 = 1
DMA is started.
STG0 = 1
INTCSI10 occurs.
User program
processing
DMA0 transfer
CSI
transmission
Occurrence of
INTDMA0
DST0 = 0Note
DEN0 = 0
RETI
Hardware operation
End
Note The DST0 flag is automatically cleared to 0 when a DMA transfer is completed.
Writing the DEN0 flag is enabled only when DST0 = 0. To terminate a DMA transfer without waiting for
occurrence of the interrupt of DMA0 (INTDMA0), set the DST0 bit to 0 and then the DEN0 bit to 0 (for details,
refer to 15.5.5 Forced termination by software).
The fist trigger for consecutive transmission is not started by the interrupt of CSI. In this example, it start by a software
trigger.
CSI transmission of the second time and onward is automatically executed.
A DMA interrupt (INTDMA0) occurs when the last transmit data has been written to the data register.
Start
DEN1 = 1
DSA1 = 1EH
DRA1 = FCE0H
DBC1 = 0100H
DMC1 = 21H
DST1 = 1
INTAD occurs.
User program
processing
DMA1 transfer
INTDMA1 occurs.
DST1 = 0Note
DEN1 = 0
RETI
Hardware operation
End
Note The DST1 flag is automatically cleared to 0 when a DMA transfer is completed.
Writing the DEN1 flag is enabled only when DST1 = 0. To terminate a DMA transfer without waiting for
occurrence of the interrupt of DMA1 (INTDMA1), set the DST1 bit to 0 and then the DEN1 bit to 0 (for details,
refer to 15.5.5 Forced termination by software).
Figure 15-9. Example of Setting for UART Consecutive Reception + ACK Transmission
Start
INTSR0 interrupt routine
DEN0 = 1
DSA0 = 12H
DRA0 = FE00H STG0 = 1
DBC0 = 0040H
DMC0 = 00H
DMA0 transfer
P10 = 0
DST0 = 1
INTSR0 occurs.
RETI
User program
processing
INTDMA0
occurs.
DST0 = 0
DEN0 = 0Note
RETI
Hardware operation
End
Note The DST0 flag is automatically cleared to 0 when a DMA transfer is completed.
Writing the DEN0 flag is enabled only when DST0 = 0. To terminate a DMA transfer without waiting for
occurrence of the interrupt of DMA0 (INTDMA0), set the DST0 bit to 0 and then the DEN0 bit to 0 (for details,
refer to 15.5.5 Forced termination by software).
Remark This is an example where a software trigger is used as a DMA start source.
If ACK is not transmitted and if only data is consecutively received from UART, the UART reception end
interrupt (INTSR0) can be used to start DMA for data reception.
Figure 15-10. Example of Setting for Holding DMA Transfer Pending by DWAITn Bit
Main program
DWAITn = 1
Wait for 2 clocks
P10 = 1
Wait for 9 clocks
P10 = 0
DWAITn = 0
Caution When DMA transfer is held pending while using two or more DMA channels, be sure to held the
DMA transfer pending for all channels (by setting DWAIT0, DWAIT1, DWAIT2, and DWAIT3 to 1). If
the DMA transfer of one channel is executed while that of the other channel is held pending, DMA
transfer might not be held pending for the latter channel.
• Set the DSTn bit to 0 (use DRCn = 80H to write with an 8-bit manipulation instruction) by software and then set the
DENn bit to 0 (use DRCn = 00H to write with an 8-bit manipulation instruction) two or more clocks after.
Example 1 Example 2
DSTn = 0 DSTn = 0
2 clock wait
No
DSTn = 0 ?
DENn = 0
Yes
DENn = 0
Example 3
• Procedure for forcibly terminating the DMA • Procedure for forcibly terminating the DMA
transfer for one channel if both channels are used transfer for both channels if both channels are used
DWAIT0 = 1 DWAIT0 = 1
DWAIT1 = 1 DWAIT1 = 1
DSTn = 0 DST0 = 0
DST1 = 0
DWAIT0 = 0
DWAIT1 = 0 DWAIT0 = 0
DWAIT1 = 0
DENn = 0
DEN0 = 0
DEN1 = 0
Caution In example 3, the system is not required to wait two clock cycles after the DWAITn bit is set to 1. In
addition, the system does not have to wait two clock cycles after clearing the DSTn bit to 0,
because more than two clock cycles elapse from when the DSTn bit is cleared to 0 to when the
DENn bit is cleared to 0.
Note The maximum time necessary to execute an instruction from internal RAM is 16 clock cycles.
Cautions 1. The above response time does not include the two clock cycles required for a DMA
transfer.
2. When executing a DMA pending instruction (see 15.6 (4)), the maximum response
time is extended by the execution time of that instruction to be held pending.
3. Do not specify successive transfer triggers for a channel within a period equal to the
maximum response time plus one clock cycle, because they might be ignored.
• CALL !addr16
• CALL $!addr20
• CALL !!addr20
• CALL rp
• CALLT [addr5]
• BRK
• Bit manipulation instructions for registers IF0L, IF0H, IF1L, IF1H, IF2L, IF2H, IF3L, MK0L, MK0H, MK1L, MK1H,
MK2L, MK2H, MK3L, PR00L, PR00H, PR01L, PR01H, PR02L, PR02H, PR03L, PR10L, PR10H, PR11L,
PR11H, PR12L, PR12H, PR13L, and PSW each.
<R> • Instruction for accessing the data flash memory
(5) Operation if address in general-purpose register area or other than those of internal RAM area is specified
The address indicated by DMA RAM address register n (DRAn) is incremented during DMA transfer. If the
address is incremented to an address in the general-purpose register area or exceeds the area of the internal
RAM, the following operation is performed.
In either case, malfunctioning may occur or damage may be done to the system. Therefore, make sure that the
address is within the internal RAM area other than the general-purpose register area.
FFF00H
FFEFFH
General-purpose registers
FFEE0H
FFEDFH
<R> (6) Operation if instructions for accessing the data flash area
• Because DMA transfer is suspended to access to the data flash area, be sure to add the DMA pending
instruction.
If the data flash area is accessed after an next instruction execution from start of DMA transfer, a 3-clock wait
will be inserted to the next instruction.
Instruction 1
DMA transfer
Instruction 2 The wait of three clock cycles occurs.
MOV A, ! DataFlash area
20-pin 24, 25- 30, 32, 40, 44- 48-pin 52-pin 64-pin 80, 100- 128-pin
pin 36-pin pin pin
Maskable External 3 5 6 7 10 12 13 13 13
interrupts Internal 23 24 27 27 27 27 27 37 41
Interrupt sources include maskable interrupts and software interrupts. In addition, they also have up to seven reset
sources (see Table 16-1). The vector codes that store the program start address when branching due to the generation of
a reset or various interrupt requests are two bytes each, so interrupts jump to a 64 K address of 00000H to 0FFFFH.
Type
Basic Configuration
128-pin
100-pin
80-pin
64-pin
52-pin
48-pin
44-pin
40-pin
36-pin
32-pin
30-pin
25-pin
24-pin
20-pin
Interrupt Interrupt Source Internal/ Vector
Type External Table
Note 2
Name Trigger Address
Note 1
√ √ √ √ √ √ √ √ √ √ √ √ √ √
Note 3
Maskable 0 INTWDTI Watchdog timer interval Internal 0004H (A)
<R> (75% of overflow time+1/2fIL)
√ √ √ √ √ √ √ √ √ √ √ √ √ √
Note 4
1 INTLVI Voltage detection 0006H
2 INTP0 Pin input edge detection External 0008H (B) √ √ √ √ √ √ √ √ √ √ √ √ √ √
3 INTP1 000AH √ √ √ √ √ √ √ √ √ √ √ √ √ −
4 INTP2 000CH √ √ √ √ √ √ √ √ √ √ √ − − −
5 INTP3 000EH √ √ √ √ √ √ √ √ √ √ √ √ √ √
6 INTP4 0010H √ √ √ √ √ √ √ √ √ √ √ √ √ −
7 INTP5 0012H √ √ √ √ √ √ √ √ √ √ √ √ √ √
8 INTST2/ UART2 transmission transfer Internal 0014H (A) √ √ √ √ √ √ √ √ √ √ √ − − −
INTCSI20/ end or buffer empty
INTIIC20 interrupt/CSI20 transfer end or
buffer empty interrupt/IIC20
transfer end
9 INTSR2/ UART2 reception transfer 0016H √ √ √ √ √ √ √ √ √ − − −
Note 5
Note 5
INTCSI21/ end/CSI21 transfer end or
INTIIC21 buffer empty interrupt/IIC21
transfer end
10 INTSRE2 UART2 reception communication 0018H √ √ √ √ √ √ √ √ √ √ √ − − −
error occurrence
INTTM11H End of timer channel 11 count √ √ √ − − − − − − − − − − −
or capture (at 8-bit timer
operation)
11 INTDMA0 End of DMA0 transfer 001AH √ √ √ √ √ √ √ √ √ √ √ √ √ √
12 INTDMA1 End of DMA1 transfer 001CH √ √ √ √ √ √ √ √ √ √ √ √ √ √
13 INTST0/ UART0 transmission transfer 001EH √ √ √ √ √ √ √ √ √ √ √ √ √ √
INTCSI00/ end or buffer empty
INTIIC00 interrupt/CSI00 transfer end or
buffer empty interrupt/IIC00
transfer end
14 INTSR0/ UART0 reception transfer 0020H √ √ √ √ √ √
Note 6
Note 6
Note 6
Note 6
Note 6
Note 6
Note 6
Note 6
Notes 1. The default priority determines the sequence of interrupts if two or more maskable interrupts occur
simultaneously. Zero indicates the highest priority and 53 indicates the lowest priority.
2. Basic configuration types (A) to (D) correspond to (A) to (D) in Figure 16-1.
3. When bit 7 (WDTINT) of the option byte (000C0H) is set to 1.
4. When bit 7 (LVIMD) of the voltage detection level register (LVIS) is cleared to 0.
5. INTSR2 only.
6. INTSR0 only.
Type
Basic Configuration
128-pin
100-pin
80-pin
64-pin
52-pin
48-pin
44-pin
40-pin
36-pin
32-pin
30-pin
25-pin
24-pin
20-pin
Interrupt Interrupt Source Internal/ Vector
Type External Table
Note 2
Name Trigger Address
Note 1
Note 3
Note 3
Note 3
Note 3
Note 3
Note 3
Note 3
Note 3
Note 3
Note 3
INTCSI10/ end or buffer empty
INTIIC10 interrupt/CSI10 transfer end or
buffer empty interrupt/IIC10
transfer end
17 INTSR1/ UART1 reception transfer 0026H √ √ √ √ √ √ √ √ √ √ √ √ √ √
INTCSI11/ end/CSI11 transfer end or
INTIIC11 buffer empty interrupt/IIC11
transfer end
18 INTSRE1 UART1 reception 0028H √ √ √ √ √ √ √ √ √ √ √ √ √ √
communication error occurrence
INTTM03H End of timer channel 3 count or √ √ √ √ √ √ √ √ √ √ √ √ √ √
capture (at 8-bit timer
operation)
19 INTIICA0 End of IICA0 communication 002AH √ √ √ √ √ √ √ √ √ √ √ √ √ −
20 INTTM00 End of timer channel 0 count or 002CH √ √ √ √ √ √ √ √ √ √ √ √ √ √
capture
21 INTTM01 End of timer channel 1 count 002EH √ √ √ √ √ √ √ √ √ √ √ √ √ √
or capture
22 INTTM02 End of timer channel 2 count 0030H √ √ √ √ √ √ √ √ √ √ √ √ √ √
or capture
23 INTTM03 End of timer channel 3 count 0032H √ √ √ √ √ √ √ √ √ √ √ √ √ √
or capture
24 INTAD End of A/D conversion 0034H √ √ √ √ √ √ √ √ √ √ √ √ √ √
25 INTRTC Fixed-cycle signal of real-time 0036H √ √ √ √ √ √ √ √ √ √ √ √ √ √
clock/alarm match detection
26 INTIT Interval signal detection 0038H √ √ √ √ √ √ √ √ √ √ √ √ √ √
27 INTKR Key return signal detection External 003AH (C) √ √ √ √ √ √ √ √ − − − − − −
28 INTST3/ UART3 transmission transfer Internal 003CH (A) √ √ √ − − − − − − − − − − −
INTCSI30/ end or buffer empty
INTIIC30 interrupt/CSI30 transfer end or
buffer empty interrupt/IIC30
transfer end
29 INTSR3/ UART3 reception transfer 003EH √ √ √ − − − − − − − − − − −
INTCSI31/ end/CSI31 transfer end or
INTIIC31 buffer empty interrupt/IIC31
transfer end
30 INTTM13 End of timer channel 13 count 0040H √ √ √ − − − − − − − − − − −
or capture
31 INTTM04 End of timer channel 4 count 0042H √ √ √ √ √ √ √ √ √ √ √ √ √ √
or capture
Notes 1. The default priority determines the sequence of interrupts if two or more maskable interrupts occur
simultaneously. Zero indicates the highest priority and 53 indicates the lowest priority.
2. Basic configuration types (A) to (D) correspond to (A) to (D) in Figure 16-1.
3. INTST1 only.
Type
Basic Configuration
128-pin
100-pin
80-pin
64-pin
52-pin
48-pin
44-pin
40-pin
36-pin
32-pin
30-pin
25-pin
24-pin
20-pin
Interrupt Interrupt Source Internal/ Vector
Type External Table
Note 2
Name Trigger Address
Note 1
Notes 1. The default priority determines the sequence of interrupts if two or more maskable interrupts occur
simultaneously. Zero indicates the highest priority and 53 indicates the lowest priority.
2. Basic configuration types (A) to (D) correspond to (A) to (D) in Figure 16-1.
<R> 3. Be used only at the self programming library.
Type
Basic Configuration
128-pin
100-pin
80-pin
64-pin
52-pin
48-pin
44-pin
40-pin
36-pin
32-pin
30-pin
25-pin
24-pin
20-pin
Interrupt Interrupt Source Internal/ Vector
Type External Table
Note 2
Address
Note 1
Notes 1. The default priority determines the sequence of interrupts if two or more maskable interrupts occur
simultaneously. Zero indicates the highest priority and 53 indicates the lowest priority.
2. Basic configuration types (A) to (D) correspond to (A) to (D) in Figure 16-1.
<R> 3. When bit 7 (LVIMD) of the voltage detection level register (LVIS) is set to 1.
4. When the instruction code in FFH is executed.
Reset by the illegal instruction execution not issued by emulation with the in-circuit emulator or on-chip
debug emulator.
Internal bus
Standby release
signal
Internal bus
Standby release
signal
Remark 20-pin: n = 0, 3, 5
24, 25-pin: n = 0, 1, 3 to 5
30, 32, 36, 40, 44-pin: n = 0 to 5
48-pin: n = 0 to 6, 8, 9
52-pin: n = 0 to 6, 8 to 11
64, 80, 100, 128-pin: n = 0 to 11
Internal bus
KRMn
Standby release
signal
Internal bus
The following 6 types of registers are used to control the interrupt functions.
• Interrupt request flag registers (IF0L, IF0H, IF1L, IF1H, IF2L, IF2H, IF3L)
• Interrupt mask flag registers (MK0L, MK0H, MK1L, MK1H, MK2L, MK2H, MK3L)
• Priority specification flag registers (PR00L, PR00H, PR01L, PR01H, PR02L, PR02H, PR03L, PR10L, PR10H,
PR11L, PR11H, PR12L, PR12H, PR13L)
• External interrupt rising edge enable registers (EGP0, EGP1)
• External interrupt falling edge enable registers (EGN0, EGN1)
• Program status word (PSW)
Table 16-2 shows a list of interrupt request flags, interrupt mask flags, and priority specification flags corresponding to
interrupt request sources.
128-pin
100-pin
80-pin
64-pin
52-pin
48-pin
40, 44-pin
36-pin
30, 32-pin
24, 25-pin
20-pin
Interrupt Interrupt Request Flag Interrupt Mask Flag Priority Specification Flag
Source
Register Register Register
128-pin
100-pin
80-pin
64-pin
52-pin
48-pin
40, 44-pin
36-pin
30, 32-pin
24, 25-pin
20-pin
Interrupt Interrupt Request Flag Interrupt Mask Flag Priority Specification Flag
Source
Register Register Register
√ √ √ √ √ √ √ √ √ − −
Note 1 Note 1 Note 1 Note 1
INTST2 STIF2 IF0H STMK2 MK0H STPR02, STPR12 PR00H,
INTCSI20
Note 1
CSIIF20
Note 1
CSIMK20
Note 1
CSIPR020, CSIPR120
Note 1 PR10H √ √ √ √ √ √ √ √ √ − −
√ √ √ √ √ √ √ √ √ − −
Note 1 Note 1 Note 1 Note 1
INTIIC20 IICIF20 IICMK20 IICPR020, IICPR120
√ √ √ √ √ √ √ √ √ − −
Note 2 Note 2 Note 2 Note 2
INTSR2 SRIF2 SRMK2 SRPR02, SRPR12
√ √ √ √ √ √ √ √ − − −
Note 2 Note 2 Note 2 Note 2
INTCSI21 CSIIF21 CSIMK21 CSIPR021, CSIPR121
√ √ √ √ √ √ √ √ − − −
Note 2 Note 2 Note 2 Note 2
INTIIC21 IICIF21 IICMK21 IICPR021, IICPR121
√ √ √ √ √ √ √ √ √ − −
Note 3 Note 3 Note 3 Note 3
INTSRE2 SREIF2 SREMK2 SREPR02, SREPR12
√ √ √ − − − − − − − −
Note 3 Note 3 Note 3
INTTM11H TMIF11H TMMK11H TMPR011H, TMPR111H
Note 3
Notes 1. Do not use UART2, CSI20, and IIC20 at the same time because they share flags for the interrupt request
sources. If one of the interrupt sources INTST2, INTCSI20, and INTIIC20 is generated, bit 0 of the IF0H
register is set to 1. Bit 0 of the MK0H, PR00H, and PR10H registers supports these three interrupt sources.
2. Do not use UART2, CSI21, and IIC21 at the same time because they share flags for the interrupt request
sources. If one of the interrupt sources INTSR2, INTCSI21, and INTIIC21 is generated, bit 1 of the IF0H
register is set to 1. Bit 1 of the MK0H, PR00H, and PR10H registers supports these three interrupt sources.
3. Do not use UART2 and channel 1 of TAU1 (at 8-bit timer operation) at the same time because they share
flags for the interrupt request sources. If one of the interrupt sources INTSRE2 and INTTM11H is generated,
bit 2 of the IF0H register is set to 1. Bit 2 of the MK0H, PR00H, and PR10H registers supports these two
interrupt sources.
4. Do not use UART0, CSI00, and IIC00 at the same time because they share flags for the interrupt request
sources. If one of the interrupt sources INTST0, INTCSI00, and INTIIC00 is generated, bit 5 of the IF0H
register is set to 1. Bit 5 of the MK0H, PR00H, and PR10H registers supports these three interrupt sources.
5. Do not use UART0, CSI01, and IIC01 at the same time because they share flags for the interrupt request
sources. If one of the interrupt sources INTSR0, INTCSI01, and INTIIC01 is generated, bit 6 of the IF0H
register is set to 1. Bit 6 of the MK0H, PR00H, and PR10H registers supports these three interrupt sources.
6. Do not use UART0 and channel 1 of TAU0 (at 8-bit timer operation) at the same time because they share
flags for the interrupt request sources. If one of the interrupt sources INTSRE0 and INTTM01H is generated,
bit 7 of the IF0H register is set to 1. Bit 7 of the MK0H, PR00H, and PR10H registers supports these two
interrupt sources.
128-pin
100-pin
80-pin
64-pin
52-pin
48-pin
40, 44-pin
36-pin
30, 32-pin
24, 25-pin
20-pin
Interrupt Interrupt Request Flag Interrupt Mask Flag Priority Specification Flag
Source
Register Register Register
√ √ √ √ √ √ √ √ √ √ √
Note 1 Note 1 Note 1 Note 1
INTST1 STIF1 IF1L STMK1 MK1L STPR01, STPR11 PR01L,
INTCSI10
Note 1
CSIIF10
Note 1
CSIMK10
Note 1
CSIPR010, CSIPR110
Note 1 PR11L √ √ √ √ − − − − − − −
√ √ √ √ − − − − − − −
Note 1 Note 1 Note 1 Note 1
INTIIC10 IICIF10 IICMK10 IICPR010, IICPR110
√ √ √ √ √ √ √ √ √ √ √
Note 2 Note 2 Note 2 Note 2
INTSR1 SRIF1 SRMK1 SRPR01, SRPR11
√ √ √ √ √ √ √ √ √ √ √
Note 2 Note 2 Note 2 Note 2
INTCSI11 CSIIF11 CSIMK11 CSIPR011, CSIPR111
√ √ √ √ √ √ √ √ √ √ √
Note 2 Note 2 Note 2 Note 2
INTIIC11 IICIF11 IICMK11 IICPR011, IICPR111
√ √ √ √ √ √ √ √ √ √ √
Note 3 Note 3 Note 3 Note 3
INTSRE1 SREIF1 SREMK1 SREPR01, SREPR11
√ √ √ √ √ √ √ √ √ √ √
Note 3 Note 3 Note 3
INTTM03H TMIF03H TMMK03H TMPR003H, TMPR103H
Note 3
Notes 1. Do not use UART1, CSI10, and IIC10 at the same time because they share flags for the interrupt request
sources. If one of the interrupt sources INTST1, INTCSI10, and INTIIC10 is generated, bit 0 of the IF1L
register is set to 1. Bit 0 of the MK1L, PR01L, and PR11L registers supports these three interrupt sources.
2. Do not use UART1, CSI11, and IIC11 at the same time because they share flags for the interrupt request
sources. If one of the interrupt sources INTSR1, INTCSI11, and INTIIC11 is generated, bit 1 of the IF1L
register is set to 1. Bit 1 of the MK1L, PR01L, and PR11L registers supports these three interrupt sources.
3. Do not use UART1 and channel 3 of TAU0 (at 8-bit timer operation) at the same time because they share
flags for the interrupt request sources. If one of the interrupt sources INTSRE1 and INTTM03H is generated,
bit 2 of the IF1L register is set to 1. Bit 2 of the MK1L, PR01L, and PR11L registers supports these two
interrupt sources.
4. Do not use UART3, CSI30, and IIC30 at the same time because they share flags for the interrupt request
sources. If one of the interrupt sources INTST3, INTCSI30, and INTIIC30 is generated, bit 4 of the IF1H
register is set to 1. Bit 4 of the MK1H, PR01H, and PR11H registers supports these three interrupt sources.
5. Do not use UART3, CSI31, and IIC31 at the same time because they share flags for the interrupt request
sources. If one of the interrupt sources INTSR3, INTCSI31, and INTIIC31 is generated, bit 5 of the IF1H
register is set to 1. Bit 5 of the MK1H, PR01H, and PR11H registers supports these three interrupt sources.
128-pin
100-pin
80-pin
64-pin
52-pin
48-pin
40, 44-pin
36-pin
30, 32-pin
24, 25-pin
20-pin
Interrupt Interrupt Request Flag Interrupt Mask Flag Priority Specification Flag
Source
Register Register Register
√ √ √ − − − − − − − −
Note Note Note
INTTM13H TMIF13H TMMK13H TMPR013H, TMPR113H
Note
Note Do not use UART3 and channel 3 of TAU1 (at 8-bit timer operation) at the same time because they share flags
for the interrupt request sources. If one of the interrupt sources INTSRE3 and INTTM13H is generated, bit 4 of
the IF2H register is set to 1. Bit 4 of the MK2H, PR02H, and PR12H registers supports these two interrupt
sources.
(1) Interrupt request flag registers (IF0L, IF0H, IF1L, IF1H, IF2L, IF2H, IF3L)
The interrupt request flags are set to 1 when the corresponding interrupt request is generated or an instruction is
executed. They are cleared to 0 when an instruction is executed upon acknowledgment of an interrupt request or
upon reset signal generation.
When an interrupt is acknowledged, the interrupt request flag is automatically cleared and then the interrupt routine is
entered.
The IF0L, IF0H, IF1L, IF1H, IF2L, IF2H, and IF3L registers can be set by a 1-bit or 8-bit memory manipulation
instruction. When the IF0L and IF0H registers, the IF1L and IF1H registers, and the IF2L and IF2H registers are
combined to form 16-bit registers IF0, IF1, and IF2, they can be set by a 16-bit memory manipulation instruction.
Reset signal generation clears these registers to 00H.
Remark If an instruction that writes data to this register is executed, the number of instruction execution clocks
increases by 2 clocks.
Figure 16-2. Format of Interrupt Request Flag Registers (IF0L, IF0H, IF1L, IF1H, IF2L, IF2H, IF3L) (128-pin) (1/2)
Figure 16-2. Format of Interrupt Request Flag Registers (IF0L, IF0H, IF1L, IF1H, IF2L, IF2H, IF3L) (128-pin) (2/2)
Cautions 1. The above is the bit layout for the 128-pin. The available bits differ depending on the product.
For details about the bits available for each product, see Table 16-2. Be sure to clear bits that
are not available to 0.
2. When operating a timer, serial interface, or A/D converter after standby release, operate it once
after clearing the interrupt request flag. An interrupt request flag may be set by noise.
3. When manipulating a flag of the interrupt request flag register, use a 1-bit memory manipulation
instruction (CLR1). When describing in C language, use a bit manipulation instruction such as
“IF0L.0 = 0;” or “_asm(“clr1 IF0L, 0”);” because the compiled assembler must be a 1-bit memory
manipulation instruction (CLR1).
If a program is described in C language using an 8-bit memory manipulation instruction such as
“IF0L &= 0xfe;” and compiled, it becomes the assembler of three instructions.
mov a, IF0L
and a, #0FEH
mov IF0L, a
In this case, even if the request flag of the another bit of the same interrupt request flag register
(IF0L) is set to 1 at the timing between “mov a, IF0L” and “mov IF0L, a”, the flag is cleared to 0
at “mov IF0L, a”. Therefore, care must be exercised when using an 8-bit memory manipulation
instruction in C language.
(2) Interrupt mask flag registers (MK0L, MK0H, MK1L, MK1H, MK2L, MK2H, MK3L)
The interrupt mask flags are used to enable/disable the corresponding maskable interrupt servicing.
The MK0L, MK0H, MK1L, MK1H, MK2L, MK2H, and MK3L registers can be set by a 1-bit or 8-bit memory
manipulation instruction. When the MK0L and MK0H registers, the MK1L and MK1H registers, and the MK2L and
MK2H registers are combined to form 16-bit registers MK0, MK1, and MK2, they can be set by a 16-bit memory
manipulation instruction.
Reset signal generation sets these registers to FFH.
Remark If an instruction that writes data to this register is executed, the number of instruction execution clocks
increases by 2 clocks.
Figure 16-3. Format of Interrupt Mask Flag Registers (MK0L, MK0H, MK1L, MK1H, MK2L, MK2H, MK3L)(128-pin)
Caution The above is the bit layout for the 128-pin. The available bits differ depending on the product. For
details about the bits available for each product, see Table 16-2. Be sure to set bits that are not
available to 1.
(3) Priority specification flag registers (PR00L, PR00H, PR01L, PR01H, PR02L, PR02H, PR03L, PR10L, PR10H,
PR11L, PR11H, PR12L, PR12H, PR13L)
The priority specification flag registers are used to set the corresponding maskable interrupt priority level.
A priority level is set by using the PR0xy and PR1xy registers in combination (xy = 0L, 0H, 1L, 1H, 2L, or 2H).
The PR00L, PR00H, PR01L, PR01H, PR02L, PR02H, PR03L, PR10L, PR10H, PR11L, PR11H, PR12L, PR12H, and
the PR13L registers can be set by a 1-bit or 8-bit memory manipulation instruction. If the PR00L and PR00H registers,
the PR01L and PR01H registers, the PR02L and PR02H registers, the PR10L and PR10H registers, the PR11L and
PR11H registers, and the PR12L and PR12H registers are combined to form 16-bit registers PR00, PR01, PR02,
PR10, PR11, and PR12, they can be set by a 16-bit memory manipulation instruction.
Reset signal generation sets these registers to FFH.
Remark If an instruction that writes data to this register is executed, the number of instruction execution clocks
increases by 2 clocks.
Figure 16-4. Format of Priority Specification Flag Registers (PR00L, PR00H, PR01L, PR01H, PR02L, PR02H,
PR03L, PR10L, PR10H, PR11L, PR11H, PR12L, PR12H, PR13L) (128-pin) (1/3)
Figure 16-4. Format of Priority Specification Flag Registers (PR00L, PR00H, PR01L, PR01H, PR02L, PR02H,
PR03L, PR10L, PR10H, PR11L, PR11H, PR12L, PR12H, PR13L) (128-pin) (2/3)
Figure 16-4. Format of Priority Specification Flag Registers (PR00L, PR00H, PR01L, PR01H, PR02L, PR02H,
PR03L, PR10L, PR10H, PR11L, PR11H, PR12L, PR12H, PR13L) (128-pin) (3/3)
Caution The above is the bit layout for the 128-pin. The available bits differ depending on the product. For
details about the bits available for each product, see Table 16-2. Be sure to set bits that are not
available to 1.
(4) External interrupt rising edge enable registers (EGP0, EGP1), external interrupt falling edge enable registers
(EGN0, EGN1)
These registers specify the valid edge for INTP0 to INTP11.
The EGP0, EGP1, EGN0, and EGN1 registers can be set by a 1-bit or 8-bit memory manipulation instruction.
Reset signal generation clears these registers to 00H.
Figure 16-5. Format of External Interrupt Rising Edge Enable Registers (EGP0, EGP1) and External Interrupt
Falling Edge Enable Registers (EGN0, EGN1) (128-pin)
Table 16-3 shows the ports corresponding to the EGPn and EGNn bits.
Detection Enable Bit Edge Detection Interrupt 64, 80, 52-pin 48-pin 30, 32, 24, 25- 20-pin
Port Request Signal 100, 36, 40, pin
128-pin 44-pin
Caution Select the port mode by clearing the EGPn and EGNn bits to 0 because an edge may be
detected when the external interrupt function is switched to the port function.
Remark n = 0 to 11
Note If an interrupt request is generated just before the RET instruction, the wait time becomes longer.
If two or more maskable interrupt requests are generated simultaneously, the request with a higher priority level
specified in the priority specification flag is acknowledged first. If two or more interrupts requests have the same priority
level, the request with the highest default priority is acknowledged first.
An interrupt request that is held pending is acknowledged when it becomes acknowledgeable.
Figure 16-7 shows the interrupt request acknowledgment algorithm.
If a maskable interrupt request is acknowledged, the contents are saved into the stacks in the order of PSW, then PC,
the IE flag is reset (0), and the contents of the priority specification flag corresponding to the acknowledged interrupt are
transferred to the ISP1 and ISP0 flags. The vector table data determined for each interrupt request is the loaded into the
PC and branched.
Restoring from an interrupt is possible by using the RETI instruction.
Start
No
××IF = 1?
No
××MK = 0?
Yes
Interrupt request held pending
Higher priority No
than other interrupt requests
simultaneously
generated?
No
IE = 1?
Yes
Interrupt request held pending
Note For the default priority, refer to Table 16-1 Interrupt Source List.
6 clocks
××IF
9 clocks
6 clocks 6 clocks
PSW and PC saved, Interrupt servicing
CPU processing Instruction RET instruction jump to interrupt
program
servicing
××IF
14 clocks
<R> Caution Can not use the RETI instruction for restoring from the software interrupt.
Table 16-5. Relationship Between Interrupt Requests Enabled for Multiple Interrupt Servicing
During Interrupt Servicing
EI IE = 0 IE = 0 IE = 0
EI EI
RETI
IE = 1
IE = 1 RETI IE = 1 RETI
During servicing of interrupt INTxx, two interrupt requests, INTyy and INTzz, are acknowledged, and multiple interrupt
servicing takes place. Before each interrupt request is acknowledged, the EI instruction must always be issued to enable
interrupt request acknowledgment.
Example 2. Multiple interrupt servicing does not occur due to priority control
EI IE = 0
EI
INTxx INTyy
(PR = 10) (PR = 11)
RETI
IE = 1
1 instruction execution IE = 0
RETI
IE = 1
Interrupt request INTyy issued during servicing of interrupt INTxx is not acknowledged because its priority is lower than
that of INTxx, and multiple interrupt servicing does not take place. The INTyy interrupt request is held pending, and is
acknowledged following execution of one main processing instruction.
Example 3. Multiple interrupt servicing does not occur because interrupts are not enabled
IE = 0
EI
INTyy
INTxx (PR = 00)
(PR = 11) RETI
IE = 1
IE = 0
1 instruction execution
RETI
IE = 1
Interrupts are not enabled during servicing of interrupt INTxx (EI instruction is not issued), therefore, interrupt request
INTyy is not acknowledged and multiple interrupt servicing does not take place. The INTyy interrupt request is held
pending, and is acknowledged following execution of one main processing instruction.
Caution The BRK instruction is not one of the above-listed interrupt request hold instructions. However, the
software interrupt activated by executing the BRK instruction causes the IE flag to be cleared.
Therefore, even if a maskable interrupt request is generated during execution of the BRK instruction,
the interrupt request is not acknowledged.
Figure 16-11 shows the timing at which interrupt requests are held pending.
××IF
The number of key interrupt input channels differs, depending on the product.
20, 24, 25, 30, 32, 36- 40, 44-pin 48-pin 52, 64, 80, 100, 128-
pin pin
A key interrupt (INTKR) can be generated by setting the key return mode register (KRM) and inputting a falling edge to
the key interrupt input pins (KR0 to KR7).
Flag Description
Item Configuration
KR7
KR6
KR5
KR4
INTKR
KR3
KR2
KR1
KR0
Symbol 7 6 5 4 3 2 0
KRM KRM7 KRM6 KRM5 KRM4 KRM3 KRM2 KRM1 KRM0
Cautions 1. If any of the KRM0 to KRM7 bits used is set to 1, set bits 0 to 7 (PU70 to PU77) of the
corresponding pull-up resistor register 7 (PU7) to 1.
2. An interrupt will be generated if the target bit of the KRM register is set while a low level is being
input to the key interrupt input pin. To ignore this interrupt, set the KRM register after disabling
interrupt servicing by using the interrupt mask flag. Afterward, clear the interrupt request flag
and enable interrupt servicing after waiting for the key interrupt input low-level width (250 ns or
more).
3. The pins not used in the key interrupt mode can be used as normal ports.
Remarks 1. n = 0 to 7
2. KR0 to KR3: 40-, 44-pin products
KR0 to KR5: 48-pin products
KR0 to KR7: 52-, 64-, 80-, 100-, 128-pin products
In either of these two modes, all the contents of registers, flags and data memory just before the standby mode is set
are held. The I/O port output latches and output buffer statuses are also held.
Cautions 1. The STOP mode can be used only when the CPU is operating on the main system clock. The
STOP mode cannot be set while the CPU operates with the subsystem clock. The HALT mode
can be used when the CPU is operating on either the main system clock or the subsystem clock.
<R> 2. When shifting to the STOP mode, be sure to stop the peripheral hardware operation operating
with main system clock before executing STOP instruction.
<R> 3. When using CSIp, UARTq, or the A/D converter in the SNOOZE mode, set up serial standby
control register m (SSCm) and A/D converter mode register 2 (ADM2) before switching to the
STOP mode. For details, see 12.3 Registers Controlling Serial Array Unit and 11.3 Registers
Used in A/D Converter.
<R> 4. The following sequence is recommended for power consumption reduction of the A/D converter
when the standby function is used: First clear bit 7 (ADCS) and bit 0 (ADCE) of A/D converter
mode register 0 (ADM0) to 0 to stop the A/D conversion operation, and then execute the STOP
instruction.
5. It can be selected by the option byte whether the low-speed on-chip oscillator continues
oscillating or stops in the HALT or STOP mode. For details, see CHAPTER 24 OPTION BYTE.
Remark For the registers that start, stop, or select the clock, see CHAPTER 5 CLOCK GENERATOR.
• If the X1 clock starts oscillation while the high-speed on-chip oscillator clock or subsystem clock is being used as
the CPU clock.
• If the STOP mode is entered and then released while the high-speed on-chip oscillator clock is being used as
the CPU clock with the X1 clock oscillating.
The OSTC register can be read by a 1-bit or 8-bit memory manipulation instruction.
When reset is released (reset by RESET input, POR, LVD, WDT, and executing an illegal instruction), the STOP
instruction and MSTOP bit (bit 7 of clock operation status control register (CSC)) = 1 clear this register to 00H.
Figure 18-1. Format of Oscillation Stabilization Time Counter Status Register (OSTC)
MOST MOST MOST MOST MOST MOST MOST MOST Oscillation stabilization time status
8 9 10 11 13 15 17 18 fX = 10 MHz fX = 20 MHz
2 /fX max. 25.6 μs max. 12.8 μs max.
8
0 0 0 0 0 0 0 0
2 /fX min. 25.6 μs min. 12.8 μs min.
8
1 0 0 0 0 0 0 0
2 /fX min. 51.2 μs min. 25.6 μs min.
9
1 1 0 0 0 0 0 0
2 /fX min. 102.4 μs min. 51.2 μs min.
10
1 1 1 0 0 0 0 0
2 /fX min. 204.8 μs min. 102.4 μs min.
11
1 1 1 1 0 0 0 0
2 /fX min. 819.2 μs min. 409.6 μs min.
13
1 1 1 1 1 0 0 0
15
1 1 1 1 1 1 0 0 2 /fX min. 3.27 ms min. 1.64 ms min.
17
1 1 1 1 1 1 1 0 2 /fX min. 13.11 ms min. 6.55 ms min.
18
1 1 1 1 1 1 1 1 2 /fX min. 26.21 ms min. 13.11 ms min.
Cautions 1. After the above time has elapsed, the bits are set to 1 in order from the MOST8
bit and remain 1.
2. The oscillation stabilization time counter counts up to the oscillation
stabilization time set by the oscillation stabilization time select register (OSTS).
If the STOP mode is entered and then released while the high-speed on-chip
oscillator clock is being used as the CPU clock, set the oscillation stabilization
time as follows.
• Desired OSTC register oscillation stabilization time ≤ Oscillation
stabilization time set by OSTS register
Note, therefore, that only the status up to the oscillation stabilization time set
by the OSTS register is set to the OSTC register after STOP mode is released.
3. The X1 clock oscillation stabilization wait time does not include the time until
clock oscillation starts (“a” below).
X1 pin voltage
waveform
X1 pin voltage
waveform
HALT Mode Setting When HALT Instruction Is Executed While CPU Is Operating on Main System Clock
When CPU Is Operating on When CPU Is Operating on When CPU Is Operating on
High-speed On-chip Oscillator X1 Clock (fX) External Main System Clock
Item Clock (fIH) (fEX)
System clock Clock supply to the CPU is stopped
Main system clock fIH Operation continues (cannot Operation disabled
be stopped)
fX Operation disabled Operation continues (cannot Cannot operate
be stopped)
fEX Cannot operate Operation continues (cannot
be stopped)
Subsystem clock fXT Status before HALT mode was set is retained
fEXS
fIL Set by bits 0 (WDSTBYON) and 4 (WDTON) of option byte (000C0H), and WUTMMCK0 bit of
operation speed mode control register (OSMC)
• WUTMMCK0 = 1: Oscillates
• WUTMMCK0 = 0 and WDTON = 0: Stops
• WUTMMCK0 = 0, WDTON = 1, and WDSTBYON = 1: Oscillates
• WUTMMCK0 = 0, WDTON = 1, and WDSTBYON = 0: Stops
CPU Operation stopped
Code flash memory Operation stopped
Data flash memory
RAM
Port (latch) Status before HALT mode was set is retained
Timer array unit Operable
Real-time clock (RTC)
Interval timer
Watchdog timer See CHAPTER 10 WATCHDOG TIMER
Clock output/buzzer output Operable
A/D converter
Serial array unit (SAU)
Serial interface (IICA)
Multiplier and divider/multiply-
accumulator
DMA controller
Power-on-reset function
Voltage detection function
External interrupt
Key interrupt function
CRC High-speed CRC
operation General-purpose
function CRC
Illegal-memory access
detection function
Remark Operation stopped: Operation is automatically stopped before switching to the HALT mode.
Operation disabled: Operation is stopped before switching to the HALT mode.
fIH: High-speed on-chip oscillator clock
fIL: Low-speed on-chip oscillator clock
fX: X1 clock
fEX: External main system clock
fXT: XT1 clock
fEXS: External subsystem clock
HALT Mode Setting When HALT Instruction Is Executed While CPU Is Operating on Subsystem Clock
Item When CPU Is Operating on XT1 Clock (fXT) When CPU Is Operating on External
Subsystem Clock (fEXS)
System clock Clock supply to the CPU is stopped
Main system clock fIH Operation disabled
fX
fEX
Subsystem clock fXT Operation continues (cannot be stopped) Cannot operate
fEXS Cannot operate Operation continues (cannot be stopped)
fIL Set by bits 0 (WDSTBYON) and 4 (WDTON) of option byte (000C0H), and WUTMMCK0 bit of
operation speed mode control register (OSMC)
• WUTMMCK0 = 1: Oscillates
• WUTMMCK0 = 0 and WDTON = 0: Stops
• WUTMMCK0 = 0, WDTON = 1, and WDSTBYON = 1: Oscillates
• WUTMMCK0 = 0, WDTON = 1, and WDSTBYON = 0: Stops
CPU Operation stopped
Code flash memory
Data flash memory
RAM
Port (latch) Status before HALT mode was set is retained
Timer array unit Operable (Operation is disabled while in the low consumption RTC mode (when the RTCLPC
bit of the OSMC register is 1))
Real-time clock (RTC) Operable
Interval timer
Watchdog timer See CHAPTER 10 WATCHDOG TIMER
Clock output/buzzer output Operable (Operation is disabled while in the low consumption RTC mode (when the RTCLPC
bit of the OSMC register is 1))
A/D converter Operation disabled
Serial array unit (SAU) Operable (Operation is disabled while in the low consumption RTC mode (when the RTCLPC
bit of the OSMC register is 1))
Serial interface (IICA) Operation disabled
Multiplier and divider/multiply- Operable (Operation is disabled while in the low consumption RTC mode (when the RTCLPC
accumulator bit of the OSMC register is 1))
DMA controller
Power-on-reset function Operable
Voltage detection function
External interrupt
Key interrupt function
CRC High-speed CRC Operation disabled
operation General-purpose Operable
function CRC
Illegal-memory access detection Operation stopped
function
Remark Operation stopped: Operation is automatically stopped before switching to the HALT mode.
Operation disabled: Operation is stopped before switching to the HALT mode.
fIH: High-speed on-chip oscillator clock
fIL: Low-speed on-chip oscillator clock
fX: X1 clock
fEX: External main system clock
fXT: XT1 clock
fEXS: External subsystem clock
Interrupt
HALT request
instruction
Standby
release signal
Remark The broken lines indicate the case when the interrupt request which has released the standby mode is
acknowledged.
HALT
instruction
HALT
instruction
Reset signal
HALT
instruction
<R> Note Reset processing time: 387 to 720 μ s (When LVD is used)
155 to 407 μ s (When LVD off)
Cautions 1. Because the interrupt request signal is used to clear the standby mode, if there is an interrupt
source with the interrupt request flag set and the interrupt mask flag reset, the standby mode is
immediately cleared if set. Thus, the STOP mode is reset to the HALT mode immediately after
execution of the STOP instruction and the system returns to the operating mode as soon as the
wait time set using the oscillation stabilization time select register (OSTS) has elapsed.
2. When using CSIp, UARTq, or the A/D converter in the SNOOZE mode, set up serial standby
control register m (SSCm) and A/D converter mode register 2 (ADM2) before switching to the
STOP mode. For details, see 12.3 Registers Controlling Serial Array Unit and 11.3 Registers
Used in A/D Converter.
STOP Mode Setting When STOP Instruction Is Executed While CPU Is Operating on Main System Clock
When CPU Is Operating on When CPU Is Operating on When CPU Is Operating on
High-speed on-chip oscillator X1 Clock (fX) External Main System Clock
Item clock (fIH) (fEX)
System clock Clock supply to the CPU is stopped
Main system clock fIH Stopped
fX
fEX
Subsystem clock fXT Status before STOP mode was set is retained
fEXS
fIL Set by bits 0 (WDSTBYON) and 4 (WDTON) of option byte (000C0H), and WUTMMCK0 bit of
operation speed mode control register (OSMC)
• WUTMMCK0 = 1: Oscillates
• WUTMMCK0 = 0 and WDTON = 0: Stops
• WUTMMCK0 = 0, WDTON = 1, and WDSTBYON = 1: Oscillates
• WUTMMCK0 = 0, WDTON = 1, and WDSTBYON = 0: Stops
CPU Operation stopped
Code flash memory
Data flash memory Operation stopped (The STOP instruction is not executed during data flash programming)
RAM Operation stopped
Port (latch) Status before STOP mode was set is retained
Timer array unit Operation disabled
Real-time clock (RTC) Operable
Interval timer
Watchdog timer See CHAPTER 10 WATCHDOG TIMER
Clock output/buzzer output Operable only when subsystem clock is selected as the count clock
A/D converter Wakeup operation is enabled (switching to the SNOOZE mode)
Serial array unit (SAU) Wakeup operation is enabled only for CSIp and UARTq (switching to the SNOOZE mode)
Operation is disabled for anything other than CSIp and UARTq
Serial interface (IICA) Wakeup by address match operable
Multiplier and divider/multiply- Operation disabled
accumulator
DMA controller
Power-on-reset function Operable
Voltage detection function
External interrupt
Key interrupt function
CRC High-speed CRC Operation stopped
operation General-purpose
function CRC
Illegal-memory access
detection function
Remarks 1. Operation stopped: Operation is automatically stopped before switching to the STOP mode.
Operation disabled: Operation is stopped before switching to the STOP mode.
fIH: High-speed on-chip oscillator clock fIL: Low-speed on-chip oscillator clock
fX: X1 clock fEX: External main system clock
fXT: XT1 clock fEXS: External subsystem clock
<R> 2. 20 to 64-pin products: p = 00; q = 0
80, 100, 128-pin products: p = 00, 20; q = 0, 2
Cautions 1. To use the peripheral hardware that stops operation in the STOP mode, and the peripheral hardware
for which the clock that stops oscillating in the STOP mode after the STOP mode is released, restart
the peripheral hardware.
<R> 2. To stop the low-speed on-chip oscillator clock in the STOP mode, must previously be set an option
byte to stop the watchdog timer operation in the HALT/STOP mode (bit 0 (WDSTBYON) of 000C0H =
0).
3. To shorten oscillation stabilization time after the STOP mode is released when the CPU operates
with the high-speed system clock (X1 oscillation), temporarily switch the CPU clock to the high-
speed on-chip oscillator clock before the execution of the STOP instruction. Before changing the
CPU clock from the high-speed on-chip oscillator clock to the high-speed system clock (X1
oscillation) after the STOP mode is released, check the oscillation stabilization time with the
oscillation stabilization time counter status register (OSTC).
(1) When high-speed system clock (X1 oscillation) is used as CPU clock
Interrupt
request
STOP
instruction
Remark The broken lines indicate the case when the interrupt request that has released the standby mode is
acknowledged.
(2) When high-speed system clock (external clock input) is used as CPU clock
Interrupt
request
STOP
instruction
High-speed
Oscillates Oscillation stopped Oscillates
system clock
(external clock input)
Interrupt
STOP request
instruction
Remark The broken lines indicate the case when the interrupt request that has released the standby mode is
acknowledged.
STOP
instruction
Reset signal
Reset processing Note
STOP
instruction
Reset signal
Reset processing Note
<R> Note Reset processing time: 387 to 720 μ s (When LVD is used)
155 to 407 μ s (When LVD off)
STOP Mode Setting When Inputting CSIp/UARTq Data Reception Signal or A/D Converter Timer Trigger Signal
Item While in STOP Mode
Remarks 1. Operation stopped: Operation is automatically stopped before switching to the SNOOZE mode.
Operation disabled: Operation is stopped before switching to the SNOOZE mode.
fIH: High-speed on-chip oscillator clock fIL: Low-speed on-chip oscillator clock
fX: X1 clock fEX: External main system clock
fXT: XT1 clock fEXS: External subsystem clock
<R> 2. 20 to 64-pin products: p = 00; q = 0
80, 100, 128-pin products: p = 00, 20; q = 0, 2
External and internal resets start program execution from the address at 0000H and 0001H when the reset signal is
generated.
A reset is effected when a low level is input to the RESET pin, the watchdog timer overflows, or by POR and LVD
circuit voltage detection, execution of illegal instructionNote, RAM parity error or illegal-memory access, and each item of
hardware is set to the status shown in Tables 19-1.
<R> When a low level is input to the RESET pin, the device is reset. It is released from the reset status when a high level is
input to the RESET pin and program execution is started with the high-speed on-chip oscillator clock after reset
processing. A reset by the watchdog timer is automatically released, and program execution starts using the high-speed
on-chip oscillator clock (see Figures 19-2 to 19-4) after reset processing. Reset by POR and LVD circuit supply voltage
detection is automatically released when VDD ≥ VPOR or VDD ≥ VLVI after the reset, and program execution starts using the
high-speed on-chip oscillator clock (see CHAPTER 20 POWER-ON-RESET CIRCUIT and CHAPTER 21 VOLTAGE
DETECTOR) after reset processing.
Note The illegal instruction is generated when instruction code FFH is executed.
Reset by the illegal instruction execution not issued by emulation with the in-circuit emulator or on-chip debug
emulator.
Cautions 1. For an external reset, input a low level for 10 μs or more to the RESET pin.
(To perform an external reset upon power application, a low level of at least 10 μs must be
continued during the period in which the supply voltage is within the operating range (VDD ≥ 1.6
V).)
2. During reset input, the X1 clock, XT1 clock, high-speed on-chip oscillator clock, and low-speed
on-chip oscillator clock stop oscillating. External main system clock input and external
subsystem clock input become invalid.
3. When reset is effected, port pin P130 is set to low-level output and other port pins become high-
impedance, because each SFR and 2nd SFR are initialized.
RL78/G13
Figure 19-1. Block Diagram of Reset Function
Internal bus
Caution An LVD circuit internal reset does not reset the LVD circuit.
High-speed on-chip
oscillator clock
Starting X1 oscillation is specified by software.
High-speed system clock
(when X1 oscillation is selected)
Reset period Normal operation
CPU status Normal operation
(high-speed on-chip oscillator clock)
Delay
<R> Figure 19-3. Timing of Reset Due to Execution of Illegal Instruction or Watchdog Timer Overflow
High-speed on-chip
oscillator clock
Starting X1 oscillation is specified by software.
High-speed system clock
(when X1 oscillation is selected)
Reset period Reset processing
CPU status Normal operation
Normal operation (oscillation stop)
41 to 69 μs (high-speed on-chip oscillator clock)
Execution of Illegal
Instruction/
Watchdog timer
overflow
Port pin
Note
(P130)
Note When P130 is set to high-level output before reset is effected, the output signal of P130 can be dummy-output
as a reset signal to an external device, because P130 outputs a low level when reset is effected. To release a
reset signal to an external device, set P130 to high-level output by software.
High-speed on-chip
oscillator clock
Starting X1 oscillation is specified by software.
High-speed system clock
(when X1 oscillation is selected)
Reset period
Normal Stop status Normal operation
CPU status
operation (oscillation stop) (high-speed on-chip oscillator clock)
Delay
Note When P130 is set to high-level output before reset is effected, the output signal of P130 can be dummy-output
as a reset signal to an external device, because P130 outputs a low level when reset is effected. To release a
reset signal to an external device, set P130 to high-level output by software.
Remark For the reset timing of the power-on-reset circuit and voltage detector, see CHAPTER 20 POWER-ON-
RESET CIRCUIT and CHAPTER 21 VOLTAGE DETECTOR.
Notes 1. During reset signal generation or oscillation stabilization time wait, only the PC contents among the hardware
statuses become undefined. All other hardware statuses remain unchanged after reset.
<R> 2. The reset value differs for each chip.
Remark The special function register (SFR) mounted depend on the product. See 3.1.4 Special function registers
(SFRs) and 3.1.5 Extended special function registers (2nd SFRs: 2nd Special Function Registers).
Notes 1. During reset signal generation or oscillation stabilization time wait, only the PC contents among the hardware
statuses become undefined. All other hardware statuses remain unchanged after reset.
2. The reset value of WDTE is determined by the option byte setting.
Remark The special function register (SFR) mounted depend on the product. See 3.1.4 Special function registers
(SFRs) and 3.1.5 Extended special function registers (2nd SFRs: 2nd Special Function Registers).
Note During reset signal generation or oscillation stabilization time wait, only the PC contents among the hardware
statuses become undefined. All other hardware statuses remain unchanged after reset.
Remark The special function register (SFR) mounted depend on the product. See 3.1.4 Special function registers
(SFRs) and 3.1.5 Extended special function registers (2nd SFRs: 2nd Special Function Registers).
Notes 1. During reset signal generation or oscillation stabilization time wait, only the PC contents among the hardware
statuses become undefined. All other hardware statuses remain unchanged after reset.
2. These values vary depending on the reset source.
Reset Source RESET Input Reset by Reset by Reset by Reset by Reset by Reset by
Register POR Execution of WDT RAM parity illegal- LVD
Illegal error memory
Instruction access
RESF TRAP bit Cleared (0) Cleared (0) Set (1) Held Held Held Held
WDTRF bit Held Set (1) Held Held Held
3. The generation of reset signal other than an LVD reset sets as follows.
• When option byte LVIMDS1, LVIMDS0 = 1, 0: 00H
• When option byte LVIMDS1, LVIMDS0 = 1, 1: 81H
• When option byte LVIMDS1, LVIMDS0 = 0, 1: 01H
Remark The special function register (SFR) mounted depend on the product. See 3.1.4 Special function registers
(SFRs) and 3.1.5 Extended special function registers (2nd SFRs: 2nd Special Function Registers).
Many internal reset generation sources exist in the RL78/G13. The reset control flag register (RESF) is used to store
which source has generated the reset request.
The RESF register can be read by an 8-bit memory manipulation instruction.
RESET input, reset by power-on-reset (POR) circuit, and reading the RESF register clear TRAP, WDTRF, RPERF,
IAWRF, and LVIRF flags.
Note 1
Address: FFFA8H After reset: 00H R
Symbol 7 6 5 4 3 2 1 0
Note 2
TRAP Internal reset request by execution of illegal instruction
Notes 1. The value after reset varies depending on the reset source.
2. The illegal instruction is generated when instruction code FFH is executed.
Reset by the illegal instruction execution not issued by emulation with the in-circuit emulator or on-chip
debug emulator.
Cautions 1. Do not read data by a 1-bit memory manipulation instruction.
2. An instruction code fetched from RAM is not subject to parity error detection while it is being
executed. However, the data read by the instruction is subject to parity error detection.
3. Because the RL78’s CPU executes lookahead due to the pipeline operation, the CPU might read
an uninitialized RAM area that is allocated beyond the RAM used, which causes a RAM parity
error. Therefore, when enabling RAM parity error resets (RPERDIS = 1), be sure to initialize the
used RAM area + 10 bytes.
The status of the RESF register when a reset request is generated is shown in Table 19-3.
Reset Source RESET Input Reset by Reset by Reset by Reset by Reset by Reset by
Flag POR Execution of WDT RAM parity illegal- LVD
Illegal error memory
Instruction access
TRAP bit Cleared (0) Cleared (0) Set (1) Held Held Held Held
WDTRF bit Held Set (1) Held Held Held
• Compares supply voltage (VDD) and detection voltage (VPDR = 1.50 V ±0.03 V), generates internal reset signal when
VDD < VPDR.
Caution If an internal reset signal is generated in the POR circuit, TRAP, WDTRF, RPERF, IAWRF, and
LVIRF flags of the reset control flag register (RESF) is cleared.
Remark This product incorporates multiple hardware functions that generate an internal reset signal. A flag that
indicates the reset source is located in the reset control flag register (RESF) for when an internal reset
signal is generated by the watchdog timer (WDT), voltage-detector (LVD), illegal instruction execution,
RAM parity error, or illegal-memory access. The RESF register is not cleared to 00H and the flag is set to
1 when an internal reset signal is generated by the watchdog timer (WDT), voltage-detector (LVD), illegal
instruction execution, RAM parity error, or illegal-memory access.
For details of the RESF register, see CHAPTER 19 RESET FUNCTION.
VDD
VDD
+
Internal reset signal
Reference
voltage
source
• An internal reset signal is generated on power application. When the supply voltage (VDD) exceeds the detection
voltage (VPDR = 1.51 V ±0.03 V), the reset status is released.
• The supply voltage (VDD) and detection voltage (VPDR = 1.50 V ±0.03 V) are compared. When VDD < VPDR, the
internal reset signal is generated.
The timing of generation of the internal reset signal by the power-on-reset circuit and voltage detector is shown below.
<R> (1) When LVD is OFF (option byte 000C1H/010C1H: VPOC2 = 1B)
Supply voltage
(VDD)
1.6 VNote 1
VPOR = 1.51 V (TYP.)
VPDR = 1.50 V (TYP.)
0V
Wait for oscillation Wait for oscillation
accuracy stabilizationNote 2 accuracy stabilizationNote 2
High-speed on-chip
oscillator clock (fIH)
Starting oscillation is Starting oscillation is
specified by software specified by software
High-speed
system clock (fMX)
(when X1 oscillation
is selected) Reset
Reset processing Note 4 Normal operation period Reset processing Normal operation
(high-speed on-chip (oscillation (high-speed on-chip
Operation oscillator clock)Note 3 stop) oscillator clock)Note 3 Operation stops
CPU
stops
Notes 1. The operation guaranteed range is 1.6 V ≤ VDD ≤ 5.5 V. To make the state at lower than 1.6 V reset state
when the supply voltage falls, use the reset function of the voltage detector, or input the low level to the
RESET pin.
2. The internal reset processing time includes the oscillation accuracy stabilization time of the high-speed on-
chip oscillator clock.
3. The high-speed on-chip oscillator clock and a high-speed system clock or subsystem clock can be selected
as the CPU clock. To use the X1 clock, use the oscillation stabilization time counter status register (OSTC)
to confirm the lapse of the oscillation stabilization time. To use the XT1 clock, use the timer function for
confirmation of the lapse of the stabilization time.
<R> 4. Reset processing time: 155 to 407 μ s
(2) When LVD is interrupt & reset mode (option byte 000C1/010C1H: LVIMDS1, LVIMDS0 = 1, 0)
Supply voltage
(VDD)
Note 4
VLVIH
VLVIL
1.6 VNote 1
VPOR = 1.51 V (TYP.)
VPDR = 1.50 V (TYP.)
0V
Wait for oscillation Wait for oscillation
accuracy stabilizationNote 3 accuracy stabilizationNote 3
High-speed on-chip
oscillator clock (fIH)
INTLVI
Notes 1. The operation guaranteed range is 1.6 V ≤ VDD ≤ 5.5 V. To make the state at lower than 1.6 V reset state
when the supply voltage falls, use the reset function of the voltage detector, or input the low level to the
RESET pin.
2. The high-speed on-chip oscillator clock and a high-speed system clock or subsystem clock can be selected
as the CPU clock. To use the X1 clock, use the oscillation stabilization time counter status register (OSTC)
to confirm the lapse of the oscillation stabilization time. To use the XT1 clock, use the timer function for
confirmation of the lapse of the stabilization time.
3. The internal reset processing time includes the oscillation accuracy stabilization time of the high-speed on-
chip oscillator clock.
4. After the first interrupt request signal (INTLVI) is generated, the LVIL and LVIMD bits of the voltage
detection level register (LVIS) are automatically set to 1. If the operating voltage returns to 1.6 V or higher
<R> without falling below the voltage detection level (VLVIL), after INTLVI is generated, perform the required
backup processing, and then use software to specify the following settings in order:
<1> Clear the LVILV bit of the LVIS register to 0.
<2> Clear the LVIMD bit of the LVIS register to 0.
<R> 5. Reset processing time: 387 to 720 μ s
In a system where the supply voltage (VDD) fluctuates for a certain period in the vicinity of the POR detection voltage
(VPOR, VPDR), the system may be repeatedly reset and released from the reset status. In this case, the time from release
of reset to the start of the operation of the microcontroller can be arbitrarily set by taking the following action.
<Action>
After releasing the reset signal, wait for the supply voltage fluctuation period of each system by means of a software
counter that uses a timer, and then initialize the ports.
Reset
Power-on-reset
Clearing WDT
Note 1
No 50 ms has passed?
(TMIFmn = 1?)
Yes
Notes 1. If reset is generated again during this period, initialization processing <2> is not started.
2. A flowchart is shown on the next page.
Remark m = 0, 1
n = 0 to 7
Yes
TRAP of RESF
register = 1?
No
Reset processing by
illegal instruction execution Note
Yes
WDTRF of RESF
register = 1?
No
Reset processing by
watchdog timer
Yes
RPERF of RESF
register = 1?
No
Reset processing by
RAM parity error
Yes
IAWRF of RESF
register = 1?
No
Reset processing by
illegal-memory access
Yes
LVIRF of RESF
register = 1?
No
Reset processing by
voltage detector
Power-on-reset/external
reset generated
Note The illegal instruction is generated when instruction code FFH is executed.
Reset by the illegal instruction execution not issued by emulation with the in-circuit emulator or on-chip
debug emulator.
• The LVD circuit compares the supply voltage (VDD) with the detection voltage (VLVIH, VLVIL), and generates an
internal reset or internal interrupt signal.
• The detection level for the power supply detection voltage (VLVIH, VLVIL) can be selected by using the option byte as
one of 14 levels (For details, see CHAPTER 24 OPTION BYTE).
• Operable in STOP mode.
• The following three operation modes can be selected by using the option byte.
Two detection voltages (VLVIH, VLVIL) can be specified in the interrupt & reset mode, and one (VLVI) can be specified in
the reset mode and interrupt mode.
The reset and interrupt signals are generated as follows according to the option byte (LVIMDS0, LVIMDS1) selection.
While the voltage detector is operating, whether the supply voltage or the input voltage from an external input pin is
more than or less than the detection level can be checked by reading the voltage detection flag (LVIF: bit 0 of the voltage
detection register (LVIM)).
Bit 0 (LVIRF) of the reset control flag register (RESF) is set to 1 if reset occurs. For details of the RESF register, see
CHAPTER 19 RESET FUNCTION.
VDD VDD
N-ch
Internal reset signal
Voltage detection
level selector
Controller
+
VLVIH
Selector
−
VLVIL
INTLVI
Reference
Option byte (000C1H) voltage
source LVIOMSK LVIMD LVILV LVIF
LVIS1, LVIS0
Option byte (000C1H) Voltage detection Voltage detection
VPOC2 to VPOC0 register (LVIM) level register (LVIS)
Internal bus
Note 1 Note 2
Address: FFFA9H After reset: 00H R/W
Symbol <7> 6 5 4 3 2 <1> <0>
LVISEN Specification of whether to enable or disable rewriting the voltage detection level
register (LVIS)
0 Disabling rewriting
Note 3
1 Enabling rewriting
0 Mask is invalid
Note 4
1 Mask is valid
0 Supply voltage (VDD) ≥ detection voltage (VLVI), or when LVD operation is disabled
1 Supply voltage (VDD) < detection voltage (VLVI)
Note 1
Address: FFFAAH After reset: 00H/01H/81H R/W
Symbol <7> 6 5 4 3 2 1 <0>
Note 2
LVIMD Operation mode of voltage detection
0 Interrupt mode
1 Reset mode
Note 2
LVILV LVD detection level
Notes 1. The reset value changes depending on the reset source and the setting of the option byte.
This register is not cleared (00H) by LVD reset.
The generation of reset signal other than an LVD reset sets as follows.
• When option byte LVIMDS1, LVIMDS0 = 1, 0: 00H
• When option byte LVIMDS1, LVIMDS0 = 1, 1: 81H
• When option byte LVIMDS1, LVIMDS0 = 0, 1: 01H
<R> 2. Writing “0” can only be allowed when LVIMDS1 and LVIMDS0 are set to 1 and 0 (interrupt and reset
mode) by the option byte. In other cases, writing is not allowed and the value is switched automatically
when reset or interrupt is generated.
Cautions 1. Only rewrite the value of the LVIS register after setting the LVISEN bit (bit 7 of the LVIM register) to 1.
2. Specify the LVD operation mode and detection voltage (VLVIH, VLVIL) by using the option byte (000C1H).
Table 21-1 shows the option byte (000C1H) settings. For details about the option byte, see CHAPTER
24 OPTION BYTE.
Table 21-1. LVD Operation Mode and Detection Voltage Settings for User Option Byte (000C1H/010C1H)
1.67 V 1.63 V 0 1 0 0 0 1 1
1.77 V 1.73 V 0 0 0 1 0
1.88 V 1.84 V 0 0 1 1 1
1.98 V 1.94 V 0 0 1 1 0
2.09 V 2.04 V 0 0 1 0 1
2.50 V 2.45 V 0 1 0 1 1
2.61 V 2.55 V 0 1 0 1 0
2.71 V 2.65 V 0 1 0 0 1
2.81 V 2.75 V 0 1 1 1 1
2.92 V 2.86 V 0 1 1 1 0
3.02 V 2.96 V 0 1 1 0 1
3.13 V 3.06 V 0 0 1 0 0
3.75 V 3.67 V 0 1 0 0 0
4.06 V 3.98 V 0 1 1 0 0
Other than above Setting prohibited
− − 0/1 1 1 × × × ×
Other than above Setting prohibited
<R> • Set bit 7 (LVISEN) of the voltage detection register (LVIM) to 0 (disable rewriting of voltage detection level
register (LVIS))
• When the option byte LVIMDS1 and LVIMDS0 are set to 1, the initial value of the LVIS register is set to 81H.
Bit 7 (LVIMD) is 1 (reset mode).
Bit 0 (LVILV) is 1 (low-voltage detection level: VLVI).
Figure 21-4 shows the timing of the internal reset signal generated by the voltage detector.
<R> Figure 21-4. Timing of Voltage Detector Internal Reset Signal Generation
(Option Byte LVIMDS1, LVIMDS0 = 1, 1)
VLVI
VPOR = 1.51 V (TYP.)
VPDR = 1.50 V (TYP.)
Time
LVIMK flag
(set by software) HNote 1
LVISEN flag
LVIOMSK flag L
Note 2
LVIRF flag
<R> • Set bit 7 (LVISEN) of the voltage detection register (LVIM) to 0 (disable rewriting of voltage detection level
register (LVIS))
• When the option byte LVIMDS1 is clear to 0 and LVIMDS0 is set to 1, the initial value of the LVIS register is
set to 00H.
Bit 7 (LVIMD) is 0 (interrupt mode).
Bit 0 (LVILV) is 1 (low-voltage detection level: VLVI).
Figure 21-5 shows the timing of the internal interrupt signal generated by the voltage detector.
<R> Figure 21-5. Timing of Voltage Detector Internal Interrupt Signal Generation
(Option Byte LVIMDS1, LVIMDS0 = 0, 1)
VLVI
VPOR = 1.51 V (TYP.)
VPDR = 1.50 V (TYP.)
Time
LVIMK flag
(set by software) HNote 1
Cleared by
software
LVISEN flag
Cleared
LVIF flag
LVIOMSK flag L
LVIMD flag
H
LVILV flag
INTLVI
LVIIF flag
Note 2
LVIRF flag
<R> • Set bit 7 (LVISEN) of the voltage detection register (LVIM) to 0 (disable rewriting of voltage detection level
register (LVIS))
• When the option byte LVIMDS1 is set to 1 and LVIMDS0 is clear to 0, the initial value of the LVIS register is
set to 00H.
Bit 7 (LVIMD) is 0 (interrupt mode).
Bit 0 (LVILV) is 0 (high-voltage detection level: VLVIH).
Caution The LVIRF flag may become 1 from the beginning due to the power-on waveform.
For details of the RESF register, see CHAPTER 19 RESET FUNCTION.
Figure 21-6 shows the timing of the internal reset signal and interrupt signal generated by the voltage detector.
<R> Figure 21-6. Timing of Voltage Detector Reset Signal and Interrupt Signal Generation
(Option Byte LVIMDS1, LVIMDS0 = 1, 0)
VLVIH
VLVIL
Time
LVIMK flag
Note 1
(set by software)
Cleared by
software
LVIF flag
LVISEN flag
(set by software) Cleared
LVIOMSK flag
LVIMD flag
LVILV flag
Note 2
LVIRF flag
Cleared
INTLVI
LVIIF flag
Yes
TRAP of RESF
register = 1?
No
Reset processing by
illegal instruction execution Note
Yes
WDTRF of RESF
register = 1?
No
Reset processing by
watchdog timer
Yes
RPERF of RESF
register = 1?
No
Reset processing by
RAM parity error
Yes
IAWRF of RESF
register = 1?
No
Reset processing by
illegal-memory access
LVIRF of RESF No
register = 1?
Yes
Power-on-reset/external
reset generated
Reset processing by
voltage detector
(2) Delay from the time LVD reset source is generated until the time LVD reset has been generated or released
There is some delay from the time supply voltage (VDD) < LVD detection voltage (VLVI) until the time LVD reset has
been generated.
In the same way, there is also some delay from the time LVD detection voltage (VLVI) ≤ supply voltage (VDD) until the
time LVD reset has been released (see Figure 21-8).
Figure 21-8. Delay from the time LVD reset source is generated until the time LVD reset has been generated or released
VLVI
Time
LVIF flag
<1> <1>
The following safety functions are provided in the RL78/G13 to comply with the IEC60730 and IEC61508 safety
standards.
These functions enable the microcontroller to self-diagnose abnormalities and stop operating if an abnormality is
detected.
(1) Flash memory CRC operation function (high-speed CRC, general-purpose CRC)
This detects data errors in the flash memory by performing CRC operations.
Two CRC functions are provided in the RL78/G13 that can be used according to the application or purpose of use.
• High-speed CRC: The CPU can be stopped and a high-speed check executed on its entire code flash
memory area during the initialization routine.
• General CRC: This can be used for checking various data in addition to the code flash memory area while
the CPU is running.
Remark See the application note (currently under preparation) for the features required to comply with the IEC60730
and IEC61508 standards.
The safety functions use the following registers for each function.
• RAM parity error control register (RPECTL) RAM parity error detection function
• Invalid memory access detection control register (IAWCTL) RAM guard function
SFR guard function
Invalid memory access detection function
• Timer input select register 0 (TIS0) Frequency detection function
• A/D test register (ADTES) A/D test function
Remark The operation result is different between the high-speed CRC and the general CRC, because the general
CRC operates in LSB first order.
<Control register>
(1) Flash memory CRC control register (CRC0CTL)
This register is used to control the operation of the high-speed CRC ALU, as well as to specify the operation range.
The CRC0CTL register can be set by a 1-bit or 8-bit memory manipulation instruction.
Reset signal generation clears this register to 00H.
Figure 22-1. Format of Flash Memory CRC Control Register (CRC0CTL) (1/2)
Figure 22-1. Format of Flash Memory CRC Control Register (CRC0CTL) (2/2)
FEA5 FEA4 FEA3 FEA2 FEA1 FEA0 High-speed CRC operation range
Remark Input the expected CRC operation result value to be used for comparison in the lowest 4 bytes of the flash
memory. Note that the operation range will thereby be reduced by 4 bytes.
Figure 22-2. Format of Flash Memory CRC Operation Result Register (PGCRCL)
Caution The PGCRCL register can only be written if CRC0EN (bit 7 of the CRC0CTL register) = 1.
Figure 22-3 shows the flowchart of flash memory CRC operation function (high-speed CRC).
<Operation flow>
Figure 22-3. Flowchart of Flash Memory CRC Operation Function (High-speed CRC)
Start
; Store the expected CRC operation result
; value in the lowest 4 bytes.
Set FEA5 to FEA0 bits
; CRC operation range setting
Correctly complete
The expected CRC value can be calculated by using tools such as the CubeSuite development environment. (See the
CubeSuite user’s manual for details.)
Bit reverse
Bit reverse data 0001 1110 0110 1010 0010 1100 0100 1000
Bit reverse
<Control register>
(1) CRC input register (CRCIN)
CRCIN register is an 8-bit register that is used to set the CRC operation data of general-purpose CRC.
The possible setting range is 00H to FFH.
The CRCIN register can be set by an 8-bit memory manipulation instruction.
Reset signal generation clears this register to 00H.
CRCIN
Bits 7 to 0 Function
CRCD
Cautions 1. Read the value written to CRCD register before writing to CRCIN register.
2. If conflict between writing and storing operation result to CRCD register occurs, the writing is
ignored.
<Operation flow>
START
Address+1
Last address?
Yes
No
<Control register>
• RAM parity error control register (RPECTL)
This register is used to control parity error generation check bit and reset generation due to parity errors.
The RPECTL register can be set by a 1-bit or 8-bit memory manipulation instruction.
Reset signal generation clears this register to 00H.
Caution An instruction code fetched from RAM is not subject to parity error detection while it is being
executed. However, the RL78’s CPU executes lookahead due to the pipeline operation, the CPU
might read an uninitialized RAM area that is allocated beyond the RAM used, which causes a RAM
parity error. Therefore, when enabling RAM parity error resets (RPERDIS = 1), be sure to initialize
the used RAM area + 10 bytes. When using the self-programming function while RAM parity error
resets are enabled, be sure to initialize the RAM area to overwrite + 10 bytes before overwriting.
The data read by the instruction is subject to parity error detection.
Remarks 1. The RAM parity check is always on, and the result can be confirmed by checking the PREF flag.
2. The parity error reset is enabled by default (RPERDIS = 0).
Even if the parity error reset is disabled (RPERDIS = 1), the RPEF flag will be set (1) if a parity error
occurs.
3. The RPEF flag is set (1) by RAM parity errors and cleared (0) by writing 0 to it or by any reset source.
When RPEF = 1, the value is retained even if RAM for which no parity error has occurred is read.
<Control register>
• Invalid memory access detection control register (IAWCTL)
This register is used to control the detection of invalid memory access and RAM/SFR guard function.
GRAM1 and GRAM0 bits are used in RAM guard function.
The IAWCTL register can be set by an 8-bit memory manipulation instruction.
Reset signal generation clears this register to 00H.
Figure 22-8. Format of Invalid Memory Access Detection Control Register (IAWCTL)
Note
GRAM1 GRAM0 RAM guard space
Note The RAM start address differs depending on the size of the RAM provided with the product.
<Control register>
• Invalid memory access detection control register (IAWCTL)
This register is used to control the detection of invalid memory access and RAM/SFR guard function.
GPORT, GINT and GCSC bits are used in SFR guard function.
The IAWCTL register can be set by an 8-bit memory manipulation instruction.
Reset signal generation clears this register to 00H.
Figure 22-9. Format of Invalid Memory Access Detection Control Register (IAWCTL)
Notes 2
GCSC Control registers of clock control function, voltage detector and RAM parity error detection function guard
0 Disabled. Control registers of clock control function, voltage detector and RAM parity error detection
function can be read or written to.
1 Enabled. Writing to control registers of clock control function, voltage detector and RAM parity error
detection function is disabled. Reading is enabled.
[Guarded SFR] CMC, CSC, OSTS, CKC, PERx, OSMC, LVIM, LVIS, RPECTL
Possibility access
Fetching
instructions
Read Write (execute)
FFFFFH
Special function register (SFR)
NG
256 byte
FFF00H
FFEFFH General-purpose register
32 byte OK
FFEE0H
FFEDFH
OK
RAMNote
yyyyyH
Mirror OK
NG NG
Data flash memory Note 2
F1000H
F0FFFH
Reserved OK
F0800H
F07FFH
OK
Special function register (2nd SFR) NG
2 Kbyte
F0000H
EFFFFH
OK
EF000H
EEFFFH
NG NG NG
Reserved
xxxxxH
00000H
Note Code flash memory and RAM address of each product are as follows.
Products Code flash memory RAM
(00000H to xxxxxH) (yyyyyH to FFEFFH)
R5F100xA, R5F101xA (x = 6 to 8, A to C, E to G) 16384 × 8 bit (00000H to 03FFFH) 2048 × 8 bit (FF700H to FFEFFH)
R5F100xC, R5F101xC (x = 6 to 8, A to C, E to G, J, L) 32768 × 8 bit (00000H to 07FFFH) 2048 × 8 bit (FF700H to FFEFFH)
R5F100xD, R5F101xD (x = 6 to 8, A to C, E to G, J, L) 49152 × 8 bit (00000H to 0BFFFH) 3072 × 8 bit (FF300H to FFEFFH)
R5F100xE, R5F101xE (x = 6 to 8, A to C, E to G, J, L) 65536 × 8 bit (00000H to 0FFFFH) 4096 × 8 bit (FEF00H to FFEFFH)
R5F100xF, R5F101xF (x = A to C, E to G, J, L, M, P) 98304 × 8 bit (00000H to 17FFFH) 8192 × 8 bit (FDF00H to FFEFFH)
R5F100xG, R5F101xG (x = A to C, E to G, J, L, M, P) 131072 × 8 bit (00000H to 1FFFFH) 12288 × 8 bit (FCF00H to FFEFFH)
R5F100xH, R5F101xH (x = E to G, J, L, M, P, S) 196608 × 8 bit (00000H to 2FFFFH) 16384 × 8 bit (FBF00H to FFEFFH)
R5F100xJ, R5F101xJ (x = F, G, J, L, M, P, S) 262144 × 8 bit (00000H to 3FFFFH) 20480 × 8 bit (FAF00H to FFEFFH)
R5F100xK, R5F101xK (x = F, G, J, L, M, P, S) 393216 × 8 bit (00000H to 5FFFFH) 24576 × 8 bit (F9F00H to FFEFFH)
R5F100xL, R5F101xL (x = F, G, J, L, M, P, S) 524288 × 8 bit (00000H to 7FFFFH) 32768 × 8 bit (F7F00H to FFEFFH)
<Control register>
• Invalid memory access detection control register (IAWCTL)
This register is used to control the detection of invalid memory access and RAM/SFR guard function.
IAWEN bit is used in invalid memory access detection function.
The IAWCTL register can be set by an 8-bit memory manipulation instruction.
Reset signal generation clears this register to 00H.
Figure 22-11. Format of Invalid Memory Access Detection Control Register (IAWCTL)
Note
IAWEN Control of invalid memory access detection
0 Disable the detection of invalid memory access.
1 Enable the detection of invalid memory access.
Remark By specifying WDTON = 1 for the option byte, the invalid memory access function is always enabled
regardless of the setting for the IAWEN bit. (For details, see CHAPTER 24 OPTION BYTE.)
Note Only writing 1 to the IAWEN bit is enabled, not writing 0 to it after setting it to 1.
High-speed on-chip
ossiratopr (fIH)
Selector
X1 X1 oscillator
X2 (fMX) fCLK
Selector
TI05 (TAU0)
<Operational overview>
Whether the clock frequency is correct or not can be judged by measuring the pulse width under the following
conditions:
• The internal high-speed oscillation clock (fIH) or the external X1 oscillation clock (fMX) is selected as the
CPU/peripheral hardware clock (fCLK).
• The internal low-speed oscillation clock (fIL: 15 kHz) is selected as the timer input for channel 5 of timer array unit 0
(TAU0).
If pulse width measurement results in an abnormal value, it can be concluded that the clock frequency is abnormal.
For how to execute pulse width measurement, see 6.7.4 Operation as input pulse interval measurement.
<Control register>
• Timer input select register 0 (TIS0)
This register is used to select the timer input of channel 5.
By selecting the internal low-speed oscillation clock for the timer input, its pulse width can be measured to determine
whether the proportional relationship between the internal low-speed oscillation clock and the timer operation clock is
correct.
The TIS0 register can be set by an 8-bit memory manipulation instruction.
Reset signal generation clears this register to 00H.
VDD
ANI0/AVREFP
+ side reference
voltage source
ANI1/AVREFM
(AVREF+)
ANIx
ANIx
A/D convertor
- side reference
Temperature
sensor 00 voltage source
(AVREF-)
Internal reference
voltage (1.45 V)
VSS
<Control register>
(1) A/D test register (ADTES)
This register is used to select the A/D converter’s positive reference voltage AVREFP, the A/D converter’s negative
reference voltage AVREFM, or the analog input channel (ANIxx) as the target of A/D conversion.
When using the A/D test function, specify the following settings:
• Select AVREFM as the target of A/D conversion when converting the internal 0 V.
• Select AVREFP as the target of A/D conversion when converting AVREF.
• Select ANIxx as the target of A/D conversion when converting the internal reference voltage (1.45 V), and specify
the internal reference voltage output as the input source in the ADS register.
0 0 ANIxx (This is specified using the analog input channel specification register (ADS).)
1 0 AVREFM
1 1 AVREFP
Figure 22-16. Format of Analog Input Channel Specification Register (ADS) (1/2)
CHAPTER 23 REGULATOR
The RL78/G13 contains a circuit for operating the device with a constant voltage. At this time, in order to stabilize the
regulator output voltage, connect the REGC pin to VSS via a capacitor (0.47 to 1 μF). Also, use a capacitor with good
characteristics, since it is used to stabilize internal voltage.
<R> The regulator output voltage, see table 23-1.
Note When it shifts to the subsystem clock operation or STOP mode during the on-chip debugging, the regulator output
voltage is kept at 2.1 V (not decline to 1.8 V).
Addresses 000C0H to 000C3H of the flash memory of the RL78/G13 form an option byte area.
Option bytes consist of user option byte (000C0H to 000C2H) and on-chip debug option byte (000C3H).
Upon power application or resetting and starting, an option byte is automatically referenced and a specified function is
set. When using the product, be sure to set the following functions by using the option bytes.
To use the boot swap operation during self programming, 000C0H to 000C3H are replaced by 010C0H to 010C3H.
Therefore, set the same values as 000C0H to 000C3H to 010C0H to 010C3H.
(1) 000C0H/010C0H
{ Operation of watchdog timer
• Operation is stopped or enabled in the HALT or STOP mode.
{ Setting of interval time of watchdog timer
{ Operation of watchdog timer
• Operation is stopped or enabled.
{ Setting of window open period of watchdog timer
{ Setting of interval interrupt of watchdog timer
• Used or not used
Caution Set the same value as 000C0H to 010C0H when the boot swap operation is used because
000C0H is replaced by 010C0H.
(2) 000C1H/010C1H
{ Setting of LVD operation mode
• Interrupt & reset mode.
• Reset mode.
<R> • Interrupt mode.
<R> { Setting of LVD detection level (VLVIH, VLVIL, VLVI)
Caution Set the same value as 000C1H to 010C1H when the boot swap operation is used because
000C1H is replaced by 010C1H.
(3) 000C2H/010C2H
{ Setting of flash operation mode
• LV (low voltage main) mode
• LS (low speed main) mode
• HS (high speed main) mode
{ Setting of the frequency of the high-speed on-chip oscillator
• Select from 1 MHz, 4 MHz, 8 MHz, 12 MHz, 16 MHz, 24 MHz, and 32 MHz.
Caution Set the same value as 000C2H to 010C2H when the boot swap operation is used because
000C2H is replaced by 010C2H.
Caution Set the same value as 000C3H to 010C3H when the boot swap operation is used because
000C3H is replaced by 010C3H.
Note 2
WINDOW1 WINDOW0 Watchdog timer window open period
0 0 Setting prohibited
0 1 50%
1 0 75%
1 1 100%
Notes 1. Set the same value as 000C0H to 010C0H when the boot swap operation is used because 000C0H is
replaced by 010C0H.
2. The window open period is 100% when WDSTBYON = 0, regardless the value of the WINDOW1 and
WINDOW0 bits.
<R> Caution The watchdog timer continues its operation during EEPROM emulation. During processing, the
interrupt acknowledge time is delayed. Set the overflow time and window size taking this delay into
consideration.
1.67 V 1.63 V 1 1 0 0 0 1 1
1.77 V 1.73 V 0 0 0 1 0
1.88 V 1.84 V 0 0 1 1 1
1.98 V 1.94 V 0 0 1 1 0
2.09 V 2.04 V 0 0 1 0 1
2.50 V 2.45 V 0 1 0 1 1
2.61 V 2.55 V 0 1 0 1 0
2.71 V 2.65 V 0 1 0 0 1
2.81 V 2.75 V 0 1 1 1 1
2.92 V 2.86 V 0 1 1 1 0
3.02 V 2.96 V 0 1 1 0 1
3.13 V 3.06 V 0 0 1 0 0
3.75 V 3.67 V 0 1 0 0 0
4.06 V 3.98 V 0 1 1 0 0
Other than above Setting prohibited
Note Set the same value as 000C1H to 010C1H when the boot swap operation is used because 000C1H is replaced
by 010C1H.
1.67 V 1.63 V 0 1 0 0 0 1 1
1.77 V 1.73 V 0 0 0 1 0
1.88 V 1.84 V 0 0 1 1 1
1.98 V 1.94 V 0 0 1 1 0
2.09 V 2.04 V 0 0 1 0 1
2.50 V 2.45 V 0 1 0 1 1
2.61 V 2.55 V 0 1 0 1 0
2.71 V 2.65 V 0 1 0 0 1
2.81 V 2.75 V 0 1 1 1 1
2.92 V 2.86 V 0 1 1 1 0
3.02 V 2.96 V 0 1 1 0 1
3.13 V 3.06 V 0 0 1 0 0
3.75 V 3.67 V 0 1 0 0 0
4.06 V 3.98 V 0 1 1 0 0
Other than above Setting prohibited
− − 0/1 1 1 × × × ×
Other than above Setting prohibited
Note Set the same value as 000C1H to 010C1H when the boot swap operation is used because 000C1H is replaced
by 010C1H.
Note Set the same value as 000C2H to 010C2H when the boot swap operation is used because 000C2H is replaced
by 010C2H.
Note Set the same value as 000C3H to 010C3H when the boot swap operation is used because 000C3H is replaced
by 010C3H.
Caution Bits 7 and 0 (OCDENSET and OCDERSD) can only be specified a value.
Be sure to set 000010B to bits 6 to 1.
Remark The value on bits 3 to 1 will be written over when the on-chip debug function is in use and thus it will become
unstable after the setting.
However, be sure to set the default values (0, 1, and 0) to bits 3 to 1 at setting.
The user option byte and on-chip debug option byte can be set using the assembler linker option, in addition to
describing to the source. When doing so, the contents set by using the linker option take precedence, even if descriptions
exist in the source, as mentioned below.
A software description example of the option byte setting is shown below.
When the boot swap function is used during self programming, 000C0H to 000C3H is switched to 010C0H to 010C3H.
Describe to 010C0H to 010C3H, therefore, the same values as 000C0H to 000C3H as follows.
Caution To specify the option byte by using assembly language, use OPT_BYTE as the relocation attribute
name of the CSEG pseudo instruction. To specify the option byte to 010C0H to 010C3H in order to
use the boot swap function, use the relocation attribute AT to specify an absolute address.
The RL78/G13 incorporates the flash memory to which a program can be written, erased, and overwritten while
mounted on the board. The flash memory includes the “code flash memory”, in which programs can be executed, and the
“data flash memory”, an area for storing data.
FFFFFH
Special function register (SFR)
256 bytes
FFF00H
FFEFFH General-purpose register
32 bytes
FFEE0H
FFEDFH
RAM
2 to 32 KB
Mirror
Reserved
00000H
The following three methods for programming the flash memory are available:
• Writing to flash memory by using flash memory programmer (see 25.1)
• Writing to flash memory by using external device (that Incorporates UART) (see 25.2)
• Self-programming (see 25.7)
The following dedicated flash memory programmer can be used to write data to the internal flash memory of the
RL78/G13.
• PG-FP5, FL-PR5
• E1 on-chip debugging emulator
Data can be written to the flash memory on-board or off-board, by using a dedicated flash memory programmer.
Remark FL-PR5 and FA series are products of Naito Densei Machida Mfg. Co., Ltd.
<R> Table 25-1. Wiring Between RL78/G13 and Dedicated Flash Memory Programmer
Note Connect REGC pin to ground via a capacitor (default: 0.47 μF).
Remark Pins that are not indicated in the above table can be left open when using the flash memory programmer
for flash programming.
The environment required for writing a program to the flash memory of the RL78/G13 is illustrated below.
E1 VDD
PG-FP5, FL-PR5
RS-232C EVDDNote
VSS, EVSS
USB RESET
Dedicated flash TOOL0 (dedicated single-line UART) RL78/G13
memory programmer
Host machine
A host machine that controls the dedicated flash memory programmer is necessary.
To interface between the dedicated flash memory programmer and the RL78/G13, the TOOL0 pin is used for
manipulation such as writing and erasing via a dedicated single-line UART. To write the flash memory off-board, a
dedicated program adapter (FA series) is necessary.
Communication between the dedicated flash memory programmer and the RL78/G13 is established by serial
communication using the TOOL0 pin via a dedicated single-line UART of the RL78/G13.
VDD VDD
PG-FP5, FL-PR5 E1 EVDD VDD/EVDD
GND VSS/EVSS/REGCNote 3
RESETNote 1,
RESET
/RESETNote 2
Dedicated flash
memory programmer TOOL0Note 1
TOOL0 RL78/G13
SI/RxDNote 2
The dedicated flash memory programmer generates the following signals for the RL78/G13. See the manual of PG-FP5,
FL-PR5, or E1 on-chip debugging emulator for details.
Note Connect REGC pin to ground via a capacitor (default: 0.47 μF).
25.2 Writing to Flash Memory by Using External Device (that Incorporates UART)
On-board data writing to the internal flash memory is possible by using the RL78/G13 and an external device (a
microcontroller or ASIC) connected to a UART.
The environment required for writing a program to the flash memory of the RL78/G13 is illustrated below.
VDD, EVDD
VSS, EVSS
RESET
External device UART (TOOLTxD, TOOLRxD) RL78/G13
(such as microcontroller
TOOL0
and ASIC)
Processing to write data to or delete data from the RL78/G13 by using an external device is performed on-board. Off-
board writing is not possible.
Communication between the external device and the RL78/G13 is established by serial communication using the
<R> TOOLTxD and TOOLRxD pins via the dedicated UART of the RL78/G13.
VDD VDD/EVDD
GND VSS/EVSS/REGCNote
/RESET RESET
External device RxD TOOLTxD RL78/G13
(such as microcontroller
TxD TOOLRxD
and ASIC)
PORT TOOL0
Note Connect REGC pin to ground via a capacitor (default: 0.47 μF).
The external device generates the following signals for the RL78/G13.
Note Connect REGC pin to ground via a capacitor (default: 0.47 μF).
To write the flash memory on-board by using the flash memory programmer, connectors that connect the dedicated
flash memory programmer must be provided on the target system. First provide a function that selects the normal
operation mode or flash memory programming mode on the board.
When the flash memory programming mode is set, all the pins not used for programming the flash memory are in the
same status as immediately after reset. Therefore, if the external device does not recognize the state immediately after
reset, the pins must be handled as described below.
When used as an input pin: Input of low-level is prohibited for 1 ms period after pin reset release. Furthermore, when
this pin is used via pull-down resistors, use the 500 kΩ or more resistors.
When used as an output pin: When this pin is used via pull-down resistors, use the 500 kΩ or more resistors.
Remark The SAU and IICA pins are not used for communication between the RL78/G13 and dedicated flash memory
programmer, because single-line UART (TOOL0 pin) is used.
RL78/G13
Output pin
Remark In the flash memory programming mode, the high-speed on-chip oscillator clock (fIH) is used.
FFFFFH
Special function register (SFR)
256 bytes
FFF00H
FFEFFH General-purpose register
32 bytes
FFEE0H
FFEDFH
RAM
2 to 32 KB
Mirror
Reserved
00000H
• The data flash memory can be written to by using the flash memory programmer or an external device
<R> • Programming is performed in 8-bit units
• Blocks can be deleted in 1 KB units
• The only access by CPU instructions is byte reading (reading: four clock cycles)
• Because the data flash memory is an area exclusively used for data, it cannot be used to execute instructions (code
fetching)
• Instructions can be executed from the code flash memory while rewriting the data flash memory (That is, back ground
operation (BGO) is supported)
• Accessing the data flash memory is not possible while rewriting the code flash memory (during self programming)
• Because the data flash memory is stopped after a reset ends, the data flash control register (DFLCTL) must be set
up in order to use the data flash memory
• Manipulating the DFLCTL register is not possible while rewriting the data flash memory
<R> • When data flash is accessed, the CPU waits for three clock cycles
DFLCTL 0 0 0 0 0 0 0 DFLEN
Caution Manipulating the DFLCTL register is not possible while rewriting the data flash memory.
The data flash memory is initially stopped after a reset ends and cannot be accessed (read or programmed). To
access the memory, perform the following procedure:
<1> Write 1 to bit 0 (DFLEN) of the data flash control register (DFLCTL).
<2> Wait for the setup to finish.
The time setup takes differs for each main clock mode.
<Setup time for each main clock mode>
<R> • HS (High-speed main): 5 μs
• LS (Low-speed main): 720 ns
• LV (Low-voltage main): 10 μs
<3> After the wait, the data flash memory can be accessed.
Cautions 1. Accessing the data flash memory is not possible during the setup time.
2. Before executing a STOP instruction during the setup time, temporarily clear DFLEN to 0.
Start
No
End?
Yes
End
RESET
tHD+
soft processing
time
TOOL0
tSU tSUINIT
Remark tSUINIT: The segment shows that it is necessary to finish specifying the initial communication settings within 100
ms from when the external and internal resets end.
tSU: How long from when the TOOL0 pin is placed at the low level until a pin reset ends
tHD: How long to keep the TOOL0 pin at the low level from when the external and internal resets end
Table 25-4. Relationship Between TOOL0 Pin and Operation Mode After Reset Release
There are two flash memory programming modes for which the voltage range in which to write, erase, or verify data
differs.
Table 25-5. Programming Modes and Voltages at Which Data Can Be Written, Erased, or Verified
Note This can only be specified if the CMODE1 and CMODE0 bits of the option byte 000C2H are 1.
Specify the mode that corresponds to the voltage range in which to write data. When programming by using the
dedicated flash memory programmer, the mode is automatically selected by the voltage setting on GUI.
Remarks 1. Using both the wide voltage mode and full speed mode imposes no restrictions on writing,
deletion, or verification.
2. For details about communication commands, see 25.5.4 Communication commands.
Notes 1. Selection items for Standard settings on GUI of the flash memory programmer.
2. Because factors other than the baud rate error, such as the signal waveform slew, also affect UART
communication, thoroughly evaluate the slew as well as the baud rate error.
Dedicated flash
memory programmer
PG-FP5, FL-PR5 E1
Command
Response
RL78/G13
External device
(such as microcontroller
and ASIC)
The flash memory control commands of the RL78/G13 are listed in the table below. All these commands are issued
from the programmer or external device, and the RL78/G13 perform processing corresponding to the respective
commands.
Verify Verify Compares the contents of a specified area of the flash memory with
data transmitted from the programmer.
Erase Block Erase Erases a specified area in the flash memory.
Blank check Block Blank Check Checks if a specified block in the flash memory has been correctly
erased.
Write Programming Writes data to a specified area in the flash memory.
Getting information Silicon Signature Gets the RL78/G13 information (such as the part number, flash memory
configuration, and programming firmware version).
Checksum Gets the checksum data for a specified area.
Security Security Set Sets security information.
Security Get Gets security information.
Security Release Release setting of prohibition of writing.
Others Reset Used to detect synchronization status of communication.
Baud Rate Set Sets baud rate when UART communication mode is selected.
The RL78/G13 returns a response for the command issued by the dedicated flash memory programmer or external
device. The response names sent from the RL78/G13 are listed below.
The RL78/G13 supports a security function that prohibits rewriting the user program written to the internal flash memory,
so that the program cannot be changed by an unauthorized person.
The operations shown below can be performed using the Security Set command. The security setting is valid when the
programming mode is set next.
• Disabling write
Execution of the write command for entire blocks in the flash memory is prohibited during on-board/off-board
programming. However, blocks can be written by means of self programming.
The block erase, write commands and rewriting boot cluster 0 are enabled by the default setting when the flash
memory is shipped. Security can be set by on-board/off-board programming and self programming. Each security setting
can be used in combination.
Table 25-11 shows the relationship between the erase and write commands when the RL78/G13 security function is
enabled.
Remark To prohibit writing and erasing during self-programming, use the flash sealed window function (see 25.7.2 for
detail).
Note Confirm that no data has been written to the write area. Because data cannot be erased after block erase is
prohibited, do not write data if the data has not been erased.
Remark To prohibit writing and erasing during self-programming, use the flash sealed window function (see 25.7.2 for
detail).
Prohibition of block erase Set via GUI of dedicated flash memory Cannot be disabled after set.
Prohibition of writing programmer, etc. Execute security release command
Prohibition of rewriting boot cluster 0 Cannot be disabled after set.
Caution The security release command can be applied only when the security is not set as the block erase
prohibition and the boot cluster 0 rewrite prohibition with code flash memory area and data flash
memory area being blanks.
The RL78/G13 supports a self-programming function that can be used to rewrite the flash memory via a user program.
Because this function allows a user application to rewrite the flash memory by using the RL78/G13 self-programming
library, it can be used to upgrade the program in the field.
Cautions 1. The self-programming function cannot be used when the CPU operates with the subsystem clock.
2. To prohibit an interrupt during self-programming, in the same way as in the normal operation
mode, execute the self-programming library in the state where the IE flag is cleared (0) by the DI
instruction. To enable an interrupt, clear (0) the interrupt mask flag to accept in the state where
the IE flag is set (1) by the EI instruction, and then execute the self-programming library.
3. When enabling RAM parity error resets (RPERDIS = 1), be sure to initialize the RAM area to use +
10 bytes before overwriting.
Remarks 1. For details of the self-programming function and the RL78/G13 self-programming library, refer to RL78
Microcontroller Self Programming Library Type01 User’s Manual (R01AN0350E).
2. For details of the time required to execute self programming, see the notes on use that accompany the
flash self programming library tool.
Similar to when writing data by using the flash memory programmer, there are two flash memory programming modes
for which the voltage range in which to write, erase, or verify data differs.
Table 25-13. Programming Modes and Voltages at Which Data Can Be Written, Erased, or Verified
Mode Voltages at which data can be written, erased, or verified Writing Clock Frequency
Wide voltage mode 1.8 V to 5.5 V 8 MHz (MAX.)
Note
Full speed mode 2.4 V to 5.5 V 16 MHz (MAX.)
2.7 V to 5.5 V 32 MHz (MAX.)
Note This can only be specified if the CMODE1 and CMODE0 bits of the option byte 000C2H are 1.
Specify the mode that corresponds to the voltage range in which to write data. If the argument fsl_flash_voltage_u08 is
other than 00H when the FSL_Init function of the self programming library provided by Renesas Electronics is executed,
wide-voltage mode is specified. If the argument is 00H, full-speed mode is specified.
Remarks 1. Using both the wide voltage mode and full speed mode imposes no restrictions on writing,
deletion, or verification.
2. For details of the self-programming function and the RL78/G13 self-programming library, refer to
RL78 Microcontroller Self Programming Library Type01 User’s Manual (R01AN0350E).
The following figure illustrates a flow of rewriting the flash memory by using a self programming library.
Erase
Write
• Inhibit access to flash memory
• Inhibit shifting STOP mode
• Inhibit clock stop
Verify
End
Note A boot cluster is a 4 KB area and boot clusters 0 and 1 are swapped by the boot swap function.
XXXXXH
Self-programming User program Execution of boot User program Self-programming User program
User program
to boot cluster 1 swap by firmware to boot cluster 0
02000H
New boot program Boot program New user program
User program (boot cluster 1) (boot cluster 0) (boot cluster 0)
01000H
Boot program Boot program New boot program New boot program
(boot cluster 0) (boot cluster 0) (boot cluster 1) (boot cluster 1)
00000H Boot
Boot Boot Boot
Block number
Erasing block 4 Erasing block 5 Erasing block 6 Erasing block 7
7 Program 7 Program 7 Program 7 Program 7
Boot 6 Program 6 Program 6 Program 6 6
cluster 1 5 Program 5 Program 5 5 5
4 Program 01000H 4 4 4 4
3 Boot program 3 Boot program 3 Boot program 3 Boot program 3 Boot program
Boot
2 Boot program 2 Boot program 2 Boot program 2 Boot program 2 Boot program
cluster 0 1 Boot program 1 Boot program 1 Boot program 1 Boot program 1 Boot program
0 Boot program 00000H 0 Boot program 0 Boot program 0 Boot program 0 Boot program
Booted by boot cluster 0
01C00H
01BFFH Block 06H
(end block)
√: On-board/off-board programming
Window range Block 05H
Flash memory √: Self programming
area Block 04H
01000H (start block)
00FFFH
Block 03H
Block 00H
00000H
Cautions 1. If the rewrite-prohibited area of the boot cluster 0 overlaps with the flash shield window range,
prohibition to rewrite the boot cluster 0 takes priority.
2. The flash shield window can only be used for the code flash memory (and is not supported for
the data flash memory).
Table 25-14. Relationship between Flash Shield Window Function Setting/Change Methods and Commands
Self-programming Specify the starting and Block erasing is enabled Writing is enabled only
ending blocks by the only within the window within the range of
<R> flash self programming range. window range.
library.
On-board/Off-board Specify the starting and Block erasing is enabled Writing is enabled also
programming ending blocks on GUI of also outside the window outside the window
dedicated flash memory range. range.
programmer, etc.
Remark See 25.6 Security Settings to prohibit writing/erasing during on-board/off-board programming.
The RL78/G13 uses the VDD, RESET, TOOL0, and VSS pins to communicate with the host machine via an E1 on-chip
debugging emulator. Serial communication is performed by using a single-line UART that uses the TOOL0 pin.
Caution The RL78/G13 has an on-chip debug function, which is provided for development and evaluation. Do
not use the on-chip debug function in products designated for mass production, because the
guaranteed number of rewritable times of the flash memory may be exceeded when this function is
used, and product reliability therefore cannot be guaranteed. Renesas Electronics is not liable for
problems occurring when the on-chip debug function is used.
GND
GND GND
GND VDD/EVDD
1 kΩ
TOOL0 TOOL0
RESET RESET
VDD
RESET Note 2
10 kΩ 1 kΩ Reset circuit
TRESET Reset signal
Note 1
Notes 1. Connecting the dotted line is not necessary during flash programming.
2. If the reset circuit on the target system does not have a buffer and generates a reset signal only with
resistors and capacitors, this pull-up resistor is not necessary.
Caution This circuit diagram is assumed that the reset signal outputs from an N-ch O.D. buffer (output
resistor: 100 Ω or less)
The RL78/G13 has an on-chip debug operation control bit in the flash memory at 000C3H (see CHAPTER 24 OPTION
BYTE) and an on-chip debug security ID setting area at 000C4H to 000CDH, to prevent third parties from reading memory
content.
When the boot swap function is used, also set a value that is the same as that of 010C3H and 010C4H to 010CDH in
advance, because 000C3H, 000C4H to 000CDH and 010C3H, and 010C4H to 010CDH are switched.
010C4H to 010CDH
To perform communication between the RL78/G13 and E1 on-chip debugging emulator, as well as each debug function,
the securing of memory space must be done beforehand.
If Renesas Electronics assembler or compiler is used, the items can be set by using linker options.
<R> Figure 26-2. Memory Spaces Where Debug Monitor Programs Are Allocated
Note 1
(512 bytes or
256 bytes Note 2) Stack area for debugging Internal RAM
(4 bytes) Note 4 area
Mirror area
Code flash
area
000D8H
Security ID area
On-chip debug option byte area
000C4H (10 bytes)
(1 byte)
000C3H
2. When real-time RAM monitor (RRM) function and dynamic memory modification (DMM) function are not
used, it is 256 bytes.
3. In debugging, reset vector is rewritten to address allocated to a monitor program.
4. Since this area is allocated immediately before the stack area, the address of this area varies depending on
the stack increase and decrease. That is, 4 extra bytes are consumed for the stack area used.
When using self-programming, 12 extra bytes are consumed for the stack area used.
The result of addition/subtraction of the BCD (binary-coded decimal) code and BCD code can be obtained as BCD
code with this circuit.
The decimal correction operation result is obtained by performing addition/subtraction having the A register as the
operand and then adding/ subtracting the BCD correction result register (BCDADJ).
BCDADJ
(1) Addition: Calculating the result of adding a BCD code value and another BCD code value by using a
BCD code value
<1> The BCD code value to which addition is performed is stored in the A register.
<2> By adding the value of the A register and the second operand (value of one more BCD code to be added) as
are in binary, the binary operation result is stored in the A register and the correction value is stored in the
BCD correction result register (BCDADJ).
<3> Decimal correction is performed by adding in binary the value of the A register (addition result in binary) and
the BCDADJ register (correction value), and the correction result is stored in the A register and CY flag.
Caution The value read from the BCDADJ register varies depending on the value of the A register
when it is read and those of the CY and AC flags. Therefore, execute the instruction <3>
after the instruction <2> instead of executing any other instructions. To perform BCD
correction in the interrupt enabled state, saving and restoring the A register is required
within the interrupt function. PSW (CY flag and AC flag) is restored by the RETI instruction.
Examples 1: 99 + 89 = 188
Examples 2: 85 + 15 = 100
Examples 3: 80 + 80 = 160
(2) Subtraction: Calculating the result of subtracting a BCD code value from another BCD code value by
using a BCD code value
<1> The BCD code value from which subtraction is performed is stored in the A register.
<2> By subtracting the value of the second operand (value of BCD code to be subtracted) from the A register as is
in binary, the calculation result in binary is stored in the A register, and the correction value is stored in the
BCD correction result register (BCDADJ).
<3> Decimal correction is performed by subtracting the value of the BCDADJ register (correction value) from the A
register (subtraction result in binary) in binary, and the correction result is stored in the A register and CY flag.
Caution The value read from the BCDADJ register varies depending on the value of the A register
when it is read and those of the CY and AC flags. Therefore, execute the instruction <3>
after the instruction <2> instead of executing any other instructions. To perform BCD
correction in the interrupt enabled state, saving and restoring the A register is required
within the interrupt function. PSW (CY flag and AC flag) is restored by the RETI instruction.
Example: 91 − 52 = 39
This chapter lists the instructions in the RL78 microcontroller instruction set. For details of each operation and
<R> operation code, refer to the separate document RL78 Microcontrollers User’s Manual: software.
In the case of immediate data, describe an appropriate numeric value or a label. When using a label, be sure to
describe the #, !, !!, $, $!, [ ], and ES: symbols.
For operand register identifiers, r and rp, either function names (X, A, C, etc.) or absolute names (names in
parentheses in the table below, R0, R1, R2, etc.) can be used for description.
Remark The special function registers can be described to operand sfr as symbols. See Table 3-5 SFR List for the
symbols of the special function registers. The extended special function registers can be described to
operand !addr16 as symbols. See Table 3-6 Extended SFR (2nd SFR) List for the symbols of the extended
special function registers.
Symbol Function
A A register; 8-bit accumulator
X X register
B B register
C C register
D D register
E E register
H H register
L L register
ES ES register
CS CS register
AX AX register pair; 16-bit accumulator
BC BC register pair
DE DE register pair
HL HL register pair
PC Program counter
SP Stack pointer
PSW Program status word
CY Carry flag
AC Auxiliary carry flag
Z Zero flag
RBS Register bank select flag
IE Interrupt request enable flag
() Memory contents indicated by address or register contents in parentheses
X H, X L 16-bit registers: XH = higher 8 bits, XL = lower 8 bits
XS, XH, XL 20-bit registers: XS = (bits 19 to 16), XH = (bits 15 to 8), XL = (bits 7 to 0)
∧ Logical product (AND)
∨ Logical sum (OR)
∨ Exclusive logical sum (exclusive OR)
−
Inverted data
addr5 16-bit immediate data (even addresses only in 0080H to 00BFH)
addr16 16-bit immediate data
addr20 20-bit immediate data
jdisp8 Signed 8-bit data (displacement value)
jdisp16 Signed 16-bit data (displacement value)
Instruction Opcode
1 2 3 4 5
Caution Set the ES register value with MOV ES, A, etc., before executing the PREFIX instruction.
A, CS 2 1 − A ← CS
CS, A 2 1 − CS ← A
A, ES 2 1 − A ← ES
ES, A 2 1 − ES ← A
A, !addr16 3 1 4 A ← (addr16)
A, ES:!addr16 4 2 5 A ← (ES, addr16)
!addr16, A 3 1 − (addr16) ← A
ES:!addr16, A 4 2 − (ES, addr16) ← A
A, saddr 2 1 − A ← (saddr)
saddr, A 2 1 − (saddr) ← A
Notes 1. Number of CPU clocks (fCLK) when the internal RAM area, SFR area, or extended SFR area is accessed, or
when no data is accessed.
2. Number of CPU clocks (fCLK) when the program memory area is accessed.
3. Except r = A
Remark Number of clock is when program exists in the internal ROM (flash memory) area. If fetching the instruction
from the internal RAM area, the number becomes double number plus 3 clocks at a maximum.
A, [DE] 1 1 4 A ← (DE)
[DE], A 1 1 − (DE) ← A
A, [HL] 1 1 4 A ← (HL)
[HL], A 1 1 − (HL) ← A
A, word[B] 3 1 4 A ← (B + word)
word[B], A 3 1 − (B + word) ← A
A, word[C] 3 1 4 A ← (C + word)
word[C], A 3 1 − (C + word) ← A
Notes 1. Number of CPU clocks (fCLK) when the internal RAM area, SFR area, or extended SFR area is accessed, or
when no data is accessed.
2. Number of CPU clocks (fCLK) when the program memory area is accessed.
Remark Number of clock is when program exists in the internal ROM (flash memory) area. If fetching the instruction
from the internal RAM area, the number becomes double number plus 3 clocks at a maximum.
A, [HL+C] 2 1 4 A ← (HL + C)
[HL+C], A 2 1 − (HL + C) ← A
X, !addr16 3 1 4 X ← (addr16)
X, saddr 2 1 − X ← (saddr)
B, !addr16 3 1 4 B ← (addr16)
B, saddr 2 1 − B ← (saddr)
C, !addr16 3 1 4 C ← (addr16)
C, saddr 2 1 − C ← (saddr)
− A ←→ r
Note 3
XCH A, r 1 (r = X) 1
2 (other
than r =
X)
A, !addr16 4 2 − A ←→ (addr16)
A, saddr 3 2 − A ←→ (saddr)
A, sfr 3 2 − A ←→ sfr
A, [DE] 2 2 − A ←→ (DE)
A, [HL] 2 2 − A ←→ (HL)
Notes 1. Number of CPU clocks (fCLK) when the internal RAM area, SFR area, or extended SFR area is accessed, or
when no data is accessed.
2. Number of CPU clocks (fCLK) when the program memory area is accessed.
3. Except r = A
Remark Number of clock is when program exists in the internal ROM (flash memory) area. If fetching the instruction
from the internal RAM area, the number becomes double number plus 3 clocks at a maximum.
R01UH0146EJ0100 Rev.1.00 964
Sep 22, 2011
RL78/G13 CHAPTER 28 INSTRUCTION SET
A, [HL+C] 2 2 − A ←→ (HL+C)
ONEB A 1 1 − A ← 01H
X 1 1 − X ← 01H
B 1 1 − B ← 01H
C 1 1 − C ← 01H
CLRB A 1 1 − A ← 00H
X 1 1 − X ← 00H
B 1 1 − B ← 00H
C 1 1 − C ← 00H
− AX ← rp
Note 3
AX, rp 1 1
− rp ← AX
Note 3
rp, AX 1 1
!addr16, AX 3 1 − (addr16) ← AX
saddrp, AX 2 1 − (saddrp) ← AX
sfrp, AX 2 1 − sfrp ← AX
Notes 1. Number of CPU clocks (fCLK) when the internal RAM area, SFR area, or extended SFR area is accessed, or
when no data is accessed.
2. Number of CPU clocks (fCLK) when the program memory area is accessed.
3. Except rp = AX
Remark Number of clock is when program exists in the internal ROM (flash memory) area. If fetching the instruction
from the internal RAM area, the number becomes double number plus 3 clocks at a maximum.
[HL], AX 1 1 − (HL) ← AX
[DE+byte], AX 2 1 − (DE+byte) ← AX
word[C], AX 3 1 − (C + word) ← AX
Notes 1. Number of CPU clocks (fCLK) when the internal RAM area, SFR area, or extended SFR area is accessed, or
when no data is accessed.
2. Number of CPU clocks (fCLK) when the program memory area is accessed.
Remark Number of clock is when program exists in the internal ROM (flash memory) area. If fetching the instruction
from the internal RAM area, the number becomes double number plus 3 clocks at a maximum.
− AX ←→ rp
Note 3
XCHW AX, rp 1 1
ONEW AX 1 1 − AX ← 0001H
BC 1 1 − BC ← 0001H
CLRW AX 1 1 − AX ← 0000H
BC 1 1 − BC ← 0000H
− A, CY ← A + r
Note 4
A, r 2 1 × × ×
r, A 2 1 − r, CY ← r + A × × ×
A, !addr16 3 1 4 A, CY ← A + (addr16) × × ×
A, saddr 2 1 − A, CY ← A + (saddr) × × ×
A, [HL] 1 1 4 A, CY ← A+ (HL) × × ×
A, [HL+byte] 2 1 4 A, CY ← A + (HL+byte) × × ×
A, [HL+B] 2 1 4 A, CY ← A + (HL+B) × × ×
A, [HL+C] 2 1 4 A, CY ← A + (HL+C) × × ×
Notes 1. Number of CPU clocks (fCLK) when the internal RAM area, SFR area, or extended SFR area is accessed, or
when no data is accessed.
2. Number of CPU clocks (fCLK) when the program memory area is accessed.
3. Except rp = AX
4. Except r = A
Remark Number of clock is when program exists in the internal ROM (flash memory) area. If fetching the instruction
from the internal RAM area, the number becomes double number plus 3 clocks at a maximum.
− A, CY ← A + r + CY
Note 3
A, rv 2 1 × × ×
r, A 2 1 − r, CY ← r + A + CY × × ×
A, !addr16 3 1 4 A, CY ← A + (addr16)+CY × × ×
A, saddr 2 1 − A, CY ← A + (saddr)+CY × × ×
A, [HL] 1 1 4 A, CY ← A+ (HL) + CY × × ×
A, [HL+byte] 2 1 4 A, CY ← A+ (HL+byte) + CY × × ×
A, [HL+C] 2 1 4 A, CY ← A+ (HL+C)+CY × × ×
− A, CY ← A − r
Note 3
A, r 2 1 × × ×
r, A 2 1 − r, CY ← r − A × × ×
A, !addr16 3 1 4 A, CY ← A − (addr16) × × ×
A, saddr 2 1 − A, CY ← A – (saddr) × × ×
A, [HL] 1 1 4 A, CY ← A – (HL) × × ×
A, [HL+byte] 2 1 4 A, CY ← A – (HL+byte) × × ×
A, [HL+B] 2 1 4 A, CY ← A – (HL+B) × × ×
A, [HL+C] 2 1 4 A, CY ← A – (HL+C) × × ×
Notes 1. Number of CPU clocks (fCLK) when the internal RAM area, SFR area, or extended SFR area is accessed, or
when no data is accessed.
2. Number of CPU clocks (fCLK) when the program memory area is accessed.
3. Except r = A
Remark Number of clock is when program exists in the internal ROM (flash memory) area. If fetching the instruction
from the internal RAM area, the number becomes double number plus 3 clocks at a maximum.
− A, CY ← A – r – CY
Note 3
A, r 2 1 × × ×
r, A 2 1 − r, CY ← r – A – CY × × ×
A, !addr16 3 1 4 A, CY ← A – (addr16) – CY × × ×
A, saddr 2 1 − A, CY ← A – (saddr) – CY × × ×
A, [HL] 1 1 4 A, CY ← A – (HL) – CY × × ×
A, [HL+byte] 2 1 4 A, CY ← A – (HL+byte) – CY × × ×
A, [HL+B] 2 1 4 A, CY ← A – (HL+B) – CY × × ×
A, [HL+C] 2 1 4 A, CY ← A – (HL+C) – CY × × ×
A, ES:[HL+C] 3 2 5 A, CY ← A – ((ES:HL)+C) – CY × × ×
− A←A∧r
Note 3
A, r 2 1 ×
r, A 2 1 − R←r∧A ×
A, !addr16 3 1 4 A ← A ∧ (addr16) ×
A, ES:!addr16 4 2 5 A ← A ∧ (ES:addr16) ×
A, saddr 2 1 − A ← A ∧ (saddr) ×
A, [HL] 1 1 4 A ← A ∧ (HL) ×
A, ES:[HL] 2 2 5 A ← A ∧ (ES:HL) ×
A, [HL+byte] 2 1 4 A ← A ∧ (HL+byte) ×
A, ES:[HL+byte] 3 2 5 A ← A ∧ ((ES:HL)+byte) ×
A, [HL+B] 2 1 4 A ← A ∧ (HL+B) ×
A, ES:[HL+B] 3 2 5 A ← A ∧ ((ES:HL)+B) ×
A, [HL+C] 2 1 4 A ← A ∧ (HL+C) ×
A, ES:[HL+C] 3 2 5 A ← A ∧ ((ES:HL)+C) ×
Notes 1. Number of CPU clocks (fCLK) when the internal RAM area, SFR area, or extended SFR area is accessed, or
when no data is accessed.
2. Number of CPU clocks (fCLK) when the program memory area is accessed.
3. Except r = A
Remark Number of clock is when program exists in the internal ROM (flash memory) area. If fetching the instruction
from the internal RAM area, the number becomes double number plus 3 clocks at a maximum.
− A ← A∨r
Note 3
A, r 2 1 ×
r, A 2 1 − r ← r∨A ×
A, !addr16 3 1 4 A ← A∨(addr16) ×
A, ES:!addr16 4 2 5 A ← A∨(ES:addr16) ×
A, saddr 2 1 − A ← A∨(saddr) ×
A, [HL] 1 1 4 A ← A∨(H) ×
A, ES:[HL] 2 2 5 A ← A∨(ES:HL) ×
A, [HL+byte] 2 1 4 A ← A∨(HL+byte) ×
A, ES:[HL+byte] 3 2 5 A ← A∨((ES:HL)+byte) ×
A, [HL+B] 2 1 4 A ← A∨(HL+B) ×
A, ES:[HL+B] 3 2 5 A ← A∨((ES:HL)+B) ×
A, [HL+C] 2 1 4 A ← A∨(HL+C) ×
A, ES:[HL+C] 3 2 5 A ← A∨((ES:HL)+C) ×
− A ← A∨r
Note 3
A, r 2 1 ×
r, A 2 1 − r ← r∨A ×
A, !addr16 3 1 4 A ← A∨(addr16) ×
A, ES:!addr16 4 2 5 A ← A∨(ES:addr16) ×
A, saddr 2 1 − A ← A∨(saddr) ×
A, [HL] 1 1 4 A ← A∨(HL) ×
A, ES:[HL] 2 2 5 A ← A∨(ES:HL) ×
A, [HL+byte] 2 1 4 A ← A∨(HL+byte) ×
A, ES:[HL+byte] 3 2 5 A ← A∨((ES:HL)+byte) ×
A, [HL+B] 2 1 4 A ← A∨(HL+B) ×
A, ES:[HL+B] 3 2 5 A ← A∨((ES:HL)+B) ×
A, [HL+C] 2 1 4 A ← A∨(HL+C) ×
A, ES:[HL+C] 3 2 5 A ← A∨((ES:HL)+C) ×
Notes 1. Number of CPU clocks (fCLK) when the internal RAM area, SFR area, or extended SFR area is accessed, or
when no data is accessed.
2. Number of CPU clocks (fCLK) when the program memory area is accessed.
3. Except r = A
Remark Number of clock is when program exists in the internal ROM (flash memory) area. If fetching the instruction
from the internal RAM area, the number becomes double number plus 3 clocks at a maximum.
−
Note3
A, r 2 1 A–r × × ×
r, A 2 1 − r–A × × ×
A, !addr16 3 1 4 A – (addr16) × × ×
A, ES:!addr16 4 2 5 A – (ES:addr16) × × ×
A, saddr 2 1 − A – (saddr) × × ×
A, [HL] 1 1 4 A – (HL) × × ×
A, ES:[HL] 2 2 5 A – (ES:HL) × × ×
A, [HL+byte] 2 1 4 A – (HL+byte) × × ×
A, ES:[HL+byte] 3 2 5 A – ((ES:HL)+byte) × × ×
A, [HL+B] 2 1 4 A – (HL+B) × × ×
A, ES:[HL+B] 3 2 5 A – ((ES:HL)+B) × × ×
A, [HL+C] 2 1 4 A – (HL+C) × × ×
A, ES:[HL+C] 3 2 5 A – ((ES:HL)+C) × × ×
CMP0 A 1 1 − A – 00H × × ×
X 1 1 − X – 00H × × ×
B 1 1 − B – 00H × × ×
C 1 1 − C – 00H × × ×
X, ES:[HL+byte] 4 2 5 X – ((ES:HL)+byte) × × ×
Notes 1. Number of CPU clocks (fCLK) when the internal RAM area, SFR area, or extended SFR area is accessed, or
when no data is accessed.
2. Number of CPU clocks (fCLK) when the program memory area is accessed.
3. Except r = A
Remark Number of clock is when program exists in the internal ROM (flash memory) area. If fetching the instruction
from the internal RAM area, the number becomes double number plus 3 clocks at a maximum.
AX, BC 1 1 − AX, CY ← AX – BC × × ×
AX, DE 1 1 − AX, CY ← AX – DE × × ×
AX, HL 1 1 − AX, CY ← AX – HL × × ×
AX, BC 1 1 − AX – BC × × ×
AX, DE 1 1 − AX – DE × × ×
AX, HL 1 1 − AX – HL × × ×
Notes 1. Number of CPU clocks (fCLK) when the internal RAM area, SFR area, or extended SFR area is accessed, or
when no data is accessed.
2. Number of CPU clocks (fCLK) when the program memory area is accessed.
Remark Number of clock is when program exists in the internal ROM (flash memory) area. If fetching the instruction
from the internal RAM area, the number becomes double number plus 3 clocks at a maximum.
DEC r 1 1 − r←r–1 × ×
INCW rp 1 1 − rp ← rp+1
DECW rp 1 1 − rp ← rp – 1
SARW AX, cnt 2 1 − (CY ← AX0, AXm-1 ← AXm, AX15← AX15) ×cnt ×
Notes 1. Number of CPU clocks (fCLK) when the internal RAM area, SFR area, or extended SFR area is accessed, or
when no data is accessed.
2. Number of CPU clocks (fCLK) when the program memory area is accessed.
Remarks 1. Number of clock is when program exists in the internal ROM (flash memory) area. If fetching the instruction
from the internal RAM area, the number becomes double number plus 3 clocks at a maximum.
2. cnt indicates the bit shift count.
PSW.bit, CY 3 4 − PSW.bit ← CY × ×
saddr.bit, CY 3 2 − (saddr).bit ← CY
sfr.bit, CY 3 2 − sfr.bit ← CY
CY,[HL].bit 2 1 4 CY ← (HL).bit ×
[HL].bit, CY 2 2 − (HL).bit ← CY
CY,[HL].bit 2 1 4 CY ← CY ∧ (HL).bit ×
Notes 1. Number of CPU clocks (fCLK) when the internal RAM area, SFR area, or extended SFR area is accessed, or
when no data is accessed.
2. Number of CPU clocks (fCLK) when the program memory area is accessed.
Remark Number of clock is when program exists in the internal ROM (flash memory) area. If fetching the instruction
from the internal RAM area, the number becomes double number plus 3 clocks at a maximum.
PSW.bit 3 4 − PSW.bit ← 1 × × ×
!addr16.bit 4 2 − (addr16).bit ← 1
saddr.bit 3 2 − (saddr).bit ← 1
sfr.bit 3 2 − sfr.bit ← 1
[HL].bit 2 2 − (HL).bit ← 1
PSW.bit 3 4 − PSW.bit ← 0 × × ×
!addr16.bit 4 2 − (addr16).bit ← 0
saddr.bit 3 2 − (saddr.bit) ← 0
sfr.bit 3 2 − sfr.bit ← 0
[HL].bit 2 2 − (HL).bit ← 0
SET1 CY 2 1 − CY ← 1 1
CLR1 CY 2 1 − CY ← 0 0
NOT1 CY 2 1 − CY ← CY ×
Notes 1. Number of CPU clocks (fCLK) when the internal RAM area, SFR area, or extended SFR area is accessed, or
when no data is accessed
2. Number of CPU clocks (fCLK) when the program memory area is accessed.
Remark Number of clock is when program exists in the internal ROM (flash memory) area. If fetching the instruction
from the internal RAM area, the number becomes double number plus 3 clocks at a maximum.
Notes 1. Number of CPU clocks (fCLK) when the internal RAM area, SFR area, or extended SFR area is accessed, or
when no data is accessed.
2. Number of CPU clocks (fCLK) when the program memory area is accessed.
Remark Number of clock is when program exists in the internal ROM (flash memory) area. If fetching the instruction
from the internal RAM area, the number becomes double number plus 3 clocks at a maximum.
SP, AX 2 1 − SP ← AX
AX, SP 2 1 − AX ← SP
HL, SP 3 1 − HL ← SP
BC, SP 3 1 − BC ← SP
DE, SP 3 1 − DE ← SP
Unconditio BR AX 2 3 − PC ← CS, AX
nal branch
$addr20 2 3 − PC ← PC + 2 + jdisp8
$!addr20 3 3 − PC ← PC + 3 + jdisp16
!!addr20 4 3 − PC ← addr20
− PC ← PC + 2 + jdisp8 if CY = 1
Note3
Conditional BC $addr20 2 2/4
branch
− PC ← PC + 2 + jdisp8 if CY = 0
Note3
BNC $addr20 2 2/4
− PC ← PC + 2 + jdisp8 if Z = 1
Note3
BZ $addr20 2 2/4
− PC ← PC + 2 + jdisp8 if Z = 0
Note3
BNZ $addr20 2 2/4
− PC ← PC + 3 + jdisp8 if (Z∨CY)=0
Note3
BH $addr20 3 2/4
− PC ← PC + 3 + jdisp8 if (Z∨CY)=1
Note3
BNH $addr20 3 2/4
− PC ← PC + 4 + jdisp8 if (saddr).bit = 1
Note3
BT saddr.bit, $addr20 4 3/5
− PC ← PC + 4 + jdisp8 if sfr.bit = 1
Note3
sfr.bit, $addr20 4 3/5
− PC ← PC + 3 + jdisp8 if A.bit = 1
Note3
A.bit, $addr20 3 3/5
− PC ← PC + 4 + jdisp8 if PSW.bit = 1
Note3
PSW.bit, $addr20 4 3/5
PC ← PC + 3 + jdisp8 if (HL).bit = 1
Note3
[HL].bit, $addr20 3 3/5 6/7
Notes 1. Number of CPU clocks (fCLK) when the internal RAM area, SFR area, or extended SFR area is accessed, or
when no data is accessed.
2. Number of CPU clocks (fCLK) when the program memory area is accessed.
3. This indicates the number of clocks “when condition is not met/when condition is met”.
Remark Number of clock is when program exists in the internal ROM (flash memory) area. If fetching the instruction
from the internal RAM area, the number becomes double number plus 3 clocks at a maximum.
− PC ← PC + 4 + jdisp8 if (saddr).bit = 0
Note3
Condition BF saddr.bit, $addr20 4 3/5
al branch
− PC ← PC + 4 + jdisp8 if sfr.bit = 0
Note3
sfr.bit, $addr20 4 3/5
− PC ← PC + 3 + jdisp8 if A.bit = 0
Note3
A.bit, $addr20 3 3/5
− PC ← PC + 4 + jdisp8 if PSW.bit = 0
Note3
PSW.bit, $addr20 4 3/5
PC ← PC + 3 + jdisp8 if (HL).bit = 0
Note3
[HL].bit, $addr20 3 3/5 6/7
− PC ← PC + 4 + jdisp8 if (saddr).bit = 1
Note3
BTCLR saddr.bit, $addr20 4 3/5
then reset (saddr).bit
− PC ← PC + 4 + jdisp8 if sfr.bit = 1
Note3
sfr.bit, $addr20 4 3/5
then reset sfr.bit
− PC ← PC + 3 + jdisp8 if A.bit = 1
Note3
A.bit, $addr20 3 3/5
then reset A.bit
− PC ← PC + 4 + jdisp8 if PSW.bit = 1
Note3
PSW.bit, $addr20 4 3/5 × × ×
then reset PSW.bit
− PC ← PC + 3 + jdisp8 if (HL).bit = 1
Note3
[HL].bit, $addr20 3 3/5
then reset (HL).bit
− RBS[1:0] ← n
Note4
CPU SEL RBn 2 1
control
NOP − 1 1 − No Operation
EI − 3 4 − IE ← 1 (Enable Interrupt)
DI − 3 4 − IE ← 0 (Disable Interrupt)
Notes 1. Number of CPU clocks (fCLK) when the internal RAM area, SFR area, or extended SFR area is accessed, or
when no data is accessed.
2. Number of CPU clocks (fCLK) when the program memory area is accessed.
3. This indicates the number of clocks “when condition is not met/when condition is met”.
Remark Number of clock is when program exists in the internal ROM (flash memory) area. If fetching the instruction
from the internal RAM area, the number becomes double number plus 3 clocks at a maximum.
Cautions 1. The RL78/G13 have an on-chip debug function, which is provided for development and evaluation.
Do not use the on-chip debug function in products designated for mass production, because the
guaranteed number of rewritable times of the flash memory may be exceeded when this function
is used, and product reliability therefore cannot be guaranteed. Renesas Electronics is not liable
for problems occurring when the on-chip debug function is used.
2. The pins mounted are as follows according to product.
Caution The pins mounted depend on the product. Refer to 2.1.1 20-pin products to 2.1.14 128-pin products,
and 2.1.15 Pins for each product (pins other than port pins).
Input voltage VI1 P00 to P07, P10 to P17, P30 to P37, P40 to P47, −0.3 to EVDD0 +0.3 V
P50 to P57, P64 to P67, P70 to P77, P80 to P87, and −0.3 to VDD +0.3
Note 2
Notes 1. Connect the REGC pin to Vss via a capacitor (0.47 to 1 μ F). This value regulates the absolute
maximum rating of the REGC pin. Do not use this pin with voltage applied to it.
2. Must be 6.5 V or lower.
Caution Product quality may suffer if the absolute maximum rating is exceeded even momentarily for any
parameter. That is, the absolute maximum ratings are rated values at which the product is on the verge
of suffering physical damage, and therefore the product must be used under conditions that ensure that
the absolute maximum ratings are not exceeded.
Remark Unless specified otherwise, the characteristics of alternate-function pins are the same as those of the port pins.
Caution The pins mounted depend on the product. Refer to 2.1.1 20-pin products to 2.1.14 128-pin products,
and 2.1.15 Pins for each product (pins other than port pins).
Caution Product quality may suffer if the absolute maximum rating is exceeded even momentarily for any
parameter. That is, the absolute maximum ratings are rated values at which the product is on the verge
of suffering physical damage, and therefore the product must be used under conditions that ensure that
the absolute maximum ratings are not exceeded.
Remark Unless specified otherwise, the characteristics of alternate-function pins are the same as those of the port pins.
Caution The pins mounted depend on the product. Refer to 2.1.1 20-pin products to 2.1.14 128-pin products,
and 2.1.15 Pins for each product (pins other than port pins).
(TA = −40 to +85°C, 1.6 V ≤ EVDD0 = EVDD1 ≤ VDD ≤ 5.5 V, VSS = EVSS0 = EVSS1 = 0 V)
Resonator Recommended Parameter Conditions MIN. TYP. MAX. Unit
Circuit
Ceramic resonator X1 clock oscillation 2.7 V ≤ VDD ≤ 5.5 V 1.0 20.0 MHz
VSS X1 X2 Note
frequency (fX) 1.8 V ≤ VDD < 2.7 V 1.0 8.0 MHz
Rd
1.6 V ≤ VDD < 1.8 V 1.0 4.0 MHz
C1 C2
Crystal resonator X1 clock oscillation 2.7 V ≤ VDD ≤ 5.5 V 1.0 20.0 MHz
VSS X1 X2 Note
frequency (fX) 1.8 V ≤ VDD < 2.7 V 1.0 8.0 MHz
Rd
1.6 V ≤ VDD < 1.8 V 1.0 4.0 MHz
C1 C2
Note Indicates only oscillator characteristics. Refer to AC Characteristics for instruction execution time.
Cautions 1. When using the X1 oscillator, wire as follows in the area enclosed by the broken lines in the above
figures to avoid an adverse effect from wiring capacitance.
2. Since the CPU is started by the high-speed on-chip oscillator clock after a reset release, check the
X1 clock oscillation stabilization time using the oscillation stabilization time counter status register
(OSTC) by the user. Determine the oscillation stabilization time of the OSTC register and the
oscillation stabilization time select register (OSTS) after sufficiently evaluating the oscillation
stabilization time with the resonator to be used.
Caution The pins mounted depend on the product. Refer to 2.1.1 20-pin products to 2.1.14 128-pin products,
and 2.1.15 Pins for each product (pins other than port pins).
(TA = −20 to +85°C, 1.6 V ≤ EVDD0 = EVDD1 ≤ VDD ≤ 5.5 V, VSS = EVSS0 = EVSS1 = 0 V)
Oscillators Parameters Conditions MIN. TYP. MAX. Unit
High-speed on-chip fIH 1.8 V ≤ VDD ≤ 5.5 V 32 MHz selected 31.68 32.00 32.32 MHz
Note
oscillator clock frequency 24 MHz selected 23.76 24.00 24.24 MHz
16 MHz selected 15.84 16.00 16.16 MHz
12 MHz selected 11.88 12.00 12.12 MHz
8 MHz selected 7.92 8.00 8.08 MHz
4 MHz selected 3.96 4.00 4.04 MHz
1 MHz selected 0.99 1.00 1.01 MHz
1.6 V ≤ VDD < 1.8 V 32 MHz selected 30.40 32.00 33.60 MHz
24 MHz selected 22.80 24.00 25.20 MHz
16 MHz selected 15.20 16.00 16.80 MHz
12 MHz selected 11.40 12.00 12.60 MHz
8 MHz selected 7.60 8.00 8.40 MHz
4 MHz selected 3.80 4.00 4.20 MHz
1 MHz selected 0.95 1.00 1.05 MHz
(TA = −40 to +85°C, 1.6 V ≤ EVDD0 = EVDD1 ≤ VDD ≤ 5.5 V, VSS = EVSS0 = EVSS1 = 0 V)
Oscillators Parameters Conditions MIN. TYP. MAX. Unit
High-speed on-chip fIH 1.8 V ≤ VDD ≤ 5.5 V 32 MHz selected 31.52 32.00 32.48 MHz
Note
oscillator clock frequency 24 MHz selected 23.64 24.00 24.36 MHz
16 MHz selected 15.76 16.00 16.24 MHz
12 MHz selected 11.82 12.00 12.18 MHz
8 MHz selected 7.88 8.00 8.12 MHz
4 MHz selected 3.94 4.00 4.06 MHz
1 MHz selected 0.985 1.00 1.015 MHz
1.6 V ≤ VDD < 1.8 V 32 MHz selected 30.24 32.00 33.76 MHz
24 MHz selected 22.68 24.00 25.32 MHz
16 MHz selected 15.12 16.00 16.88 MHz
12 MHz selected 11.34 12.00 12.66 MHz
8 MHz selected 7.56 8.00 8.44 MHz
4 MHz selected 3.78 4.00 4.22 MHz
1 MHz selected 0.945 1.00 1.055 MHz
Low-speed on-chip oscillator fIL 12.75 15 17.25 kHz
clock frequency
Note This only indicates the oscillator characteristics. Refer to AC Characteristics for instruction execution time.
When WQFN (24-, 32-, 40-, 48-pin), FLGA (25-, 36-pin), FBGA (64-pin), TQFP (64-pin), LQFP (14 × 20) (100-,
128-pin) products, these specifications show target values, which may change after device evaluation.
Caution The pins mounted depend on the product. Refer to 2.1.1 20-pin products to 2.1.14 128-pin products,
and 2.1.15 Pins for each product (pins other than port pins).
(TA = −40 to +85°C, 1.6 V ≤ EVDD0 = EVDD1 ≤ VDD ≤ 5.5 V, VSS = EVSS0 = EVSS1 = 0 V)
Resonator Recommended Items Conditions MIN. TYP. MAX. Unit
Circuit
C4 C3
Note Indicates only oscillator characteristics. Refer to AC Characteristics for instruction execution time.
Cautions 1. When using the XT1 oscillator, wire as follows in the area enclosed by the broken lines in the above
figures to avoid an adverse effect from wiring capacitance.
2. The XT1 oscillator is designed as a low-amplitude circuit for reducing power consumption, and is
more prone to malfunction due to noise than the X1 oscillator. Particular care is therefore required
with the wiring method when the XT1 clock is used.
Caution The pins mounted depend on the product. Refer to 2.1.1 20-pin products to 2.1.14 128-pin products,
and 2.1.15 Pins for each product (pins other than port pins).
Murata CSBFB1M00J58-R1 SMD 1.0 HS, LV, LS 100 100 0 1.7 5.5
Manufacturing
CSBLA1M00J58-B0 Lead 100 100 0
Co., Ltd.
CSTCC2M00G56-R0 SMD 2.0 Internal (47) Internal (47) 0 1.6 5.5
CSTCR4M00G55-R0 SMD 4.0 Internal (39) Internal (39) 0
CSTCR4M19G55-R0 SMD 4.194 HS, LS Internal (39) Internal (39) 0 1.8 5.5
Note Set the flash operation mode by using CMODE1 and CMODE0 bits of the option byte (000C2H/010C2H).
Caution The oscillator constants shown above are reference values based on evaluation in a specific
environment by the resonator manufacturer. If it is necessary to optimize the oscillator characteristics
in the actual application, apply to the resonator manufacturer for evaluation on the implementation
circuit. The oscillation voltage and oscillation frequency only indicate the oscillator characteristic. Use
the RL78/G13 so that the internal operation conditions are within the specifications of the DC and AC
characteristics.
Caution The pins mounted depend on the product. Refer to 2.1.1 20-pin products to 2.1.14 128-pin products,
and 2.1.15 Pins for each product (pins other than port pins).
Murata CSTCE12M0G52-R0 SMD 12.0 HS Internal (10) Internal (10) 0 2.4 5.5
Manufacturing
CSTCE16M0V53-R0 SMD 16.0 Internal (15) Internal (15) 0
Co., Ltd.
CSTLS16M0X51-B0 Lead Internal (5) Internal (5) 0
Note Set the flash operation mode by using CMODE1 and CMODE0 bits of the option byte (000C2H/010C2H).
Notes 1. Set the flash operation mode by using CMODE1 and CMODE0 bits of the option byte (000C2H/010C2H).
2. When using this resonator, contact Nihon Dempa Kogyo Co., Ltd (http://www.ndk.com/en).
Notes 1. Set the flash operation mode by using CMODE1 and CMODE0 bits of the option byte (000C2H/010C2H).
2. When using these resonators, contact Nihon Dempa Kogyo Co., Ltd (http://www.ndk.com/en).
Caution The oscillator constants shown above are reference values based on evaluation in a specific
environment by the resonator manufacturer. If it is necessary to optimize the oscillator characteristics
in the actual application, apply to the resonator manufacturer for evaluation on the implementation
circuit. The oscillation voltage and oscillation frequency only indicate the oscillator characteristic. Use
the RL78/G13 so that the internal operation conditions are within the specifications of the DC and AC
characteristics.
Caution The pins mounted depend on the product. Refer to 2.1.1 20-pin products to 2.1.14 128-pin products,
and 2.1.15 Pins for each product (pins other than port pins).
Ultra-low power
consumption oscillation
Notes 1. Set the XT1 oscillation mode by using AMPHS0, AMPHS1 bits of the Clock Operation Mode Control Register
(CMC).
2. When using these resonators, contact Seiko Instruments Inc., Ltd (http://www.sii-crystal.com).
3. When using this resonator, contact Nihon Dempa Kogyo Co., Ltd (http://www.ndk.com/en).
Caution The oscillator constants shown above are reference values based on evaluation in a specific
environment by the resonator manufacturer. If it is necessary to optimize the oscillator characteristics
in the actual application, apply to the resonator manufacturer for evaluation on the implementation
circuit. The oscillation voltage and oscillation frequency only indicate the oscillator characteristic. Use
the RL78/G13 so that the internal operation conditions are within the specifications of the DC and AC
characteristics.
Caution The pins mounted depend on the product. Refer to 2.1.1 20-pin products to 2.1.14 128-pin products,
and 2.1.15 Pins for each product (pins other than port pins).
29.4 DC Characteristics
(TA = −40 to +85°C, 1.6 V ≤ EVDD0 = EVDD1 ≤ VDD ≤ 5.5 V, VSS = EVSS0 = EVSS1 = 0 V)
Items Symbol Conditions MIN. TYP. MAX. Unit
Output current, IOH1 Per pin for P00 to P07, P10 to P17, 1.6 V ≤ EVDD0 ≤ 5.5 V −10.0 mA
Note 1 Note 2
high P30 to P37, P40 to P47, P50 to P57,
P64 to P67, P70 to P77, P80 to P87,
P90 to P97, P100 to P106,
P110 to P117, P120, P125 to P127,
P130, P140 to P147
Total of P00 to P04, P07, P32 to P37, 4.0 V ≤ EVDD0 ≤ 5.5 V −55.0 mA
P40 to P47, P102 to P106, P120, 2.7 V ≤ EVDD0 < 4.0 V −10.0 mA
P125 to p127, P130, P140 to P145
Note 3 1.8 V ≤ EVDD0 < 2.7 V −5.0 mA
(When duty = 70% )
1.6 V ≤ EVDD0 < 1.8 V −2.5 mA
Total of P05, P06, P10 to P17, P30, P31, 4.0 V ≤ EVDD0 ≤ 5.5 V −80.0 mA
P50 to P57, P64 to P67, P70 to P77, 2.7 V ≤ EVDD0 < 4.0 V −19.0 mA
P80 to P87, P90 to P97, P100, P101,
P110 to P117, P146, P147 1.8 V ≤ EVDD0 < 2.7 V −10.0 mA
(When duty = 70%
Note 3
) 1.6 V ≤ EVDD0 < 1.8 V −5.0 mA
Total of all pins 1.6 V ≤ EVDD0 ≤ 5.5 V −135.0 mA
Note 3
(When duty = 70% )
1.6 V ≤ VDD ≤ 5.5 V −0.1
Note 2
IOH2 Per pin for P20 to P27, P150 to P156 mA
Total of all pins 1.6 V ≤ VDD ≤ 5.5 V −1.5 mA
Note 3
(When duty = 70% )
Notes 1. Value of current at which the device operation is guaranteed even if the current flows from the EVDD0,
EVDD1, VDD pins to an output pin.
2. However, do not exceed the total current value.
3. Specification under conditions where the duty factor is 70%.
The output current value that has changed the duty ratio can be calculated with the following expression
(when changing the duty factor from 70% to n%).
• Total output current of pins = (IOH × 0.7)/(n × 0.01)
<Example> Where n = 50% and IOH = −10.0 mA
Total output current of pins = (−10.0 × 0.7)/(50 × 0.01) = −14.0 mA
However, the current that is allowed to flow into one pin does not vary depending on the duty factor. A
current higher than the absolute maximum rating must not flow into one pin.
Caution P00, P02 to P04, P10 to P15, P17, P43 to P45, P50, P52 to P55, P71, P74, P80 to P82, P96, and P142 to
P144 do not output high level in N-ch open-drain mode.
Remark Unless specified otherwise, the characteristics of alternate-function pins are the same as those of the port
pins.
Caution The pins mounted depend on the product. Refer to 2.1.1 20-pin products to 2.1.14 128-pin products,
and 2.1.15 Pins for each product (pins other than port pins).
(TA = −40 to +85°C, 1.6 V ≤ EVDD0 = EVDD1 ≤ VDD ≤ 5.5 V, VSS = EVSS0 = EVSS1 = 0 V)
Items Symbol Conditions MIN. TYP. MAX. Unit
Note 2
Output current, IOL1 Per pin for P00 to P07, P10 to P17, 20.0 mA
Note 1
low P30 to P37, P40 to P47, P50 to P57,
P64 to P67, P70 to P77, P80 to P87,
P90 to P97, P100 to P106,
P110 to P117, P120, P125 to P127,
P130, P140 to P147
Note 2
Per pin for P60 to P63 15.0 mA
Total of P00 to P04, P07, P32 to P37, 4.0 V ≤ EVDD0 ≤ 5.5 V 70.0 mA
P40 to P47, P102 to P106, P120, 2.7 V ≤ EVDD0 < 4.0 V 15.0 mA
P125 to p127, P130, P140 to P145
Note 3 1.8 V ≤ EVDD0 < 2.7 V 9.0 mA
(When duty = 70% )
1.6 V ≤ EVDD0 < 1.8 V 4.5 mA
Total of P05, P06, P10 to P17, P30, 4.0 V ≤ EVDD0 ≤ 5.5 V 80.0 mA
P31, P50 to P57, P64 to P67, 2.7 V ≤ EVDD0 < 4.0 V 35.0 mA
P70 to P77, P80 to P87, P90 to P97,
P100, P101, P110 to P117, P146, 1.8 V ≤ EVDD0 < 2.7 V 20.0 mA
P147 1.6 V ≤ EVDD0 < 1.8 V 10.0 mA
Note 3
(When duty = 70% )
Total of all pins 150.0 mA
Note 3
(When duty = 70% )
Note 2
IOL2 Per pin for P20 to P27, P150 to P156 0.4 mA
Total of all pins 1.6 V ≤ VDD ≤ 5.5 V 5.0 mA
Note 3
(When duty = 70% )
Notes 1. Value of current at which the device operation is guaranteed even if the current flows from an output pin to
the EVSS0, EVSS1 and VSS pin.
2. However, do not exceed the total current value.
3. Specification under conditions where the duty factor is 70%.
The output current value that has changed the duty ratio can be calculated with the following expression
(when changing the duty factor from 70% to n%).
• Total output current of pins = (IOL × 0.7)/(n × 0.01)
<Example> Where n = 50% and IOL = 10.0 mA
Total output current of pins = (10.0 × 0.7)/(50 × 0.01) = 14.0 mA
However, the current that is allowed to flow into one pin does not vary depending on the duty factor. A
current higher than the absolute maximum rating must not flow into one pin.
Remark Unless specified otherwise, the characteristics of alternate-function pins are the same as those of the port
pins.
Caution The pins mounted depend on the product. Refer to 2.1.1 20-pin products to 2.1.14 128-pin products,
and 2.1.15 Pins for each product (pins other than port pins).
(TA = −40 to +85°C, 1.6 V ≤ EVDD0 = EVDD1 ≤ VDD ≤ 5.5 V, VSS = EVSS0 = EVSS1 = 0 V)
Items Symbol Conditions MIN. TYP. MAX. Unit
Input voltage, VIH1 P00 to P07, P10 to P17, P30 to P37, Normal input buffer 0.8EVDD0 EVDD0 V
high P40 to P47, P50 to P57, P64 to P67,
P70 to P77, P80 to P87, P90 to P97,
P100 to P106, P110 to P117, P120,
P125 to P127, P140 to P147
VIH2 P01, P03, P04, P10, P11, TTL input buffer 2.2 EVDD0 V
P13 to P17, P43, P44, P53 to P55, 4.0 V ≤ EVDD0 ≤ 5.5 V
P80, P81, P142, P143 TTL input buffer 2.0 EVDD0 V
3.3 V ≤ EVDD0 < 4.0 V
TTL input buffer 1.5 EVDD0 V
1.6 V ≤ EVDD0 < 3.3 V
VIH3 P20 to P27, P150 to P156 0.7VDD VDD V
VIH4 P60 to P63 0.7EVDD0 6.0 V
VIH5 P121 to P124, P137, EXCLK, EXCLKS, RESET 0.8VDD VDD V
Input voltage, VIL1 P00 to P07, P10 to P17, P30 to P37, Normal input buffer 0 0.2EVDD0 V
low P40 to P47, P50 to P57, P64 to P67,
P70 to P77, P80 to P87, P90 to P97,
P100 to P106, P110 to P117, P120,
P125 to P127, P140 to P147
VIL2 P01, P03, P04, P10, P11, TTL input buffer 0 0.8 V
P13 to P17, P43, P44, P53 to P55, 4.0 V ≤ EVDD0 ≤ 5.5 V
P80, P81, P142, P143 TTL input buffer 0 0.5 V
3.3 V ≤ EVDD0 < 4.0 V
TTL input buffer 0 0.32 V
1.6 V ≤ EVDD0 < 3.3 V
VIL3 P20 to P27, P150 to P156 0 0.3VDD V
VIL4 P60 to P63 0 0.3EVDD0 V
VIL5 P121 to P124, P137, EXCLK, EXCLKS, RESET 0 0.2VDD V
Caution The maximum value of VIH of pins P00, P02 to P04, P10 to P15, P17, P43 to P45, P50, P52 to P55, P71,
P74, P80 to P82, P96, and P142 to P144 is EVDD0, even in the N-ch open-drain mode.
Remark Unless specified otherwise, the characteristics of alternate-function pins are the same as those of the port
pins.
Caution The pins mounted depend on the product. Refer to 2.1.1 20-pin products to 2.1.14 128-pin products,
and 2.1.15 Pins for each product (pins other than port pins).
(TA = −40 to +85°C, 1.6 V ≤ EVDD0 = EVDD1 ≤ VDD ≤ 5.5 V, VSS = EVSS0 = EVSS1 = 0 V)
Items Symbol Conditions MIN. TYP. MAX. Unit
Output voltage, VOH1 P00 to P07, P10 to P17, P30 to P37, 4.0 V ≤ EVDD0 ≤ 5.5 V, EVDD0 − V
high P40 to P47, P50 to P57, P64 to P67, IOH1 = −10.0 mA 1.5
P70 to P77, P80 to P87, P90 to P97, 4.0 V ≤ EVDD0 ≤ 5.5 V, EVDD0 − V
P100 to P106, P110 to P117, P120, IOH1 = −3.0 mA 0.7
P125 to P127, P130, P140 to P147
2.7 V ≤ EVDD0 ≤ 5.5 V, EVDD0 − V
IOH1 = −2.0 mA 0.6
1.8 V ≤ EVDD0 ≤ 5.5 V, EVDD0 − V
IOH1 = −1.5 mA 0.5
1.6 V ≤ EVDD0 < 1.8 V, EVDD0 − V
IOH1 = −1.0 mA 0.5
VOH2 P20 to P27, P150 to P156 1.6 V ≤ VDD ≤ 5.5 V, VDD − 0.5 V
IOH2 = −100 μ A
Output voltage, VOL1 P00 to P07, P10 to P17, P30 to P37, 4.0 V ≤ EVDD0 ≤ 5.5 V, 1.3 V
low P40 to P47, P50 to P57, P64 to P67, IOL1 = 20 mA
P70 to P77, P80 to P87, P90 to P97, 4.0 V ≤ EVDD0 ≤ 5.5 V, 0.7 V
P100 to P106, P110 to P117, P120, IOL1 = 8.5 mA
P125 to P127, P130, P140 to P147
4.0 V ≤ EVDD0 ≤ 5.5 V, 0.6 V
IOL1 = 3.0 mA
2.7 V ≤ EVDD0 ≤ 5.5 V, 0.4 V
IOL1 = 1.5 mA
1.8 V ≤ EVDD0 ≤ 5.5 V, 0.4 V
IOL1 = 0.6 mA
1.6 V ≤ EVDD0 < 5.5 V, 0.4 V
IOL1 = 0.3 mA
VOL2 P20 to P27, P150 to P156 1.6 V ≤ VDD ≤ 5.5 V, 0.4 V
IOL2 = 400 μ A
VOL3 P60 to P63 4.0 V ≤ EVDD0 ≤ 5.5 V, 2.0 V
IOL3 = 15.0 mA
4.0 V ≤ EVDD0 ≤ 5.5 V, 0.4 V
IOL3 = 5.0 mA
2.7 V ≤ EVDD0 ≤ 5.5 V, 0.4 V
IOL3 = 3.0 mA
1.8 V ≤ EVDD0 ≤ 5.5 V, 0.4 V
IOL3 = 2.0 mA
1.6 V ≤ EVDD0 < 5.5 V, 0.4 V
IOL3 = 1.0 mA
Caution P00, P02 to P04, P10 to P15, P17, P43 to P45, P50, P52 to P55, P71, P74, P80 to P82, P96, and P142 to
P144 do not output high level in N-ch open-drain mode.
Remark Unless specified otherwise, the characteristics of alternate-function pins are the same as those of the port
pins.
Caution The pins mounted depend on the product. Refer to 2.1.1 20-pin products to 2.1.14 128-pin products,
and 2.1.15 Pins for each product (pins other than port pins).
(TA = −40 to +85°C, 1.6 V ≤ EVDD0 = EVDD1 ≤ VDD ≤ 5.5 V, VSS = EVSS0 = EVSS1 = 0 V)
Items Symbol Conditions MIN. TYP. MAX. Unit
Input leakage ILIH1 P00 to P07, P10 to P17, VI = EVDD0 1 μA
current, high P30 to P37, P40 to P47,
P50 to P57, P60 to P67,
P70 to P77, P80 to P87,
P90 to P97, P100 to P106,
P110 to P117, P120,
P125 to P127, P140 to P147
On-chip pll-up RU P00 to P07, P10 to P17, VI = EVSS0, In input port 10 20 100 kΩ
resistance P30 to P37, P40 to P47,
P50 to P57, P64 to P67,
P70 to P77, P80 to P87,
P90 to P97, P100 to P106,
P110 to P117, P120,
P125 to P127, P140 to P147
Remark Unless specified otherwise, the characteristics of alternate-function pins are the same as those of the port
pins.
Caution The pins mounted depend on the product. Refer to 2.1.1 20-pin products to 2.1.14 128-pin products,
and 2.1.15 Pins for each product (pins other than port pins).
Caution The pins mounted depend on the product. Refer to 2.1.1 20-pin products to 2.1.14 128-pin products,
and 2.1.15 Pins for each product (pins other than port pins).
Notes 1. Total current flowing into VDD and EVDD0, including the input leakage current flowing when the level of the input
pin is fixed to VDD, EVDD0 or VSS, EVSS0. The values below the MAX. column include the peripheral operation
current (except for background operation (BGO)). However, not including the current flowing into the A/D
converter, LVD circuit, I/O port, and on-chip pull-up/pull-down resistors.
2. When high-speed on-chip oscillator and subsystem clock are stopped.
3. When high-speed system clock and subsystem clock are stopped.
4. When high-speed on-chip oscillator and high-speed system clock are stopped. When real-time counter and
watchdog timer is stopped. When AMPHS1 = 1 (Ultra-low power consumption oscillation).
5. Relationship between operation voltage width, operation frequency of CPU and operation mode is as below.
High speed operation: VDD = 2.4 V to 5.5 V@1 MHz to 32 MHz
Low speed operation: VDD = 1.8 V to 5.5 V@1 MHz to 8 MHz
Low voltage operation: VDD = 1.6 V to 5.5 V@1 MHz to 4 MHz
Remarks 1. fMX: High-speed system clock frequency (X1 clock oscillation frequency or external main system clock
frequency)
2. fIH: High-speed on-chip oscillator clock frequency
3. fSUB: Subsystem clock frequency (XT1 clock oscillation frequency)
<R> 4. Except subsystem clock operation, temperature condition of the TYP. value is TA = 25°C
Caution The pins mounted depend on the product. Refer to 2.1.1 20-pin products to 2.1.14 128-pin products,
and 2.1.15 Pins for each product (pins other than port pins).
Caution The pins mounted depend on the product. Refer to 2.1.1 20-pin products to 2.1.14 128-pin products,
and 2.1.15 Pins for each product (pins other than port pins).
Notes 1. Total current flowing into VDD and EVDD0, including the input leakage current flowing when the level of the input
pin is fixed to VDD, EVDD0 or VSS, EVSS0. The values below the MAX. column include the peripheral operation
current. However, not including the current flowing into the A/D converter, LVD circuit, I/O port, and on-chip
pull-up/pull-down resistors.
2. During HALT instruction execution by flash memory.
3. When high-speed on-chip oscillator and subsystem clock are stopped.
4. When high-speed system clock and subsystem clock are stopped.
5. When operating real-time clock (RTC) and setting ultra-low current consumption (AMPHS1 = 1). When high-
speed on-chip oscillator and high-speed system clock are stopped. When watchdog timer is stopped. The
<R> values below the MAX. column include the leakage current.
6. When high-speed on-chip oscillator, high-speed system clock, and subsystem clock are stopped. When
watchdog timer is stopped. The values below the MAX. column include the leakage current.
7. Relationship between operation voltage width, operation frequency of CPU and operation mode is as below.
High speed operation: VDD = 2.4 V to 5.5 V@1 MHz to 32 MHz
Low speed operation: VDD = 1.8 V to 5.5 V@1 MHz to 8 MHz
Low voltage operation: VDD = 1.6 V to 5.5 V@1 MHz to 4 MHz
Remarks 1. fMX: High-speed system clock frequency (X1 clock oscillation frequency or external main system clock
frequency)
2. fIH: High-speed on-chip oscillator clock frequency
3. fSUB: Subsystem clock frequency (XT1 clock oscillation frequency)
<R> 4. Except subsystem clock operation and STOP mode, temperature condition of the TYP. value is TA = 25°C
Caution The pins mounted depend on the product. Refer to 2.1.1 20-pin products to 2.1.14 128-pin products,
and 2.1.15 Pins for each product (pins other than port pins).
(TA = −40 to +85°C, 1.6 V ≤ EVDD0 = EVDD1 ≤ VDD ≤ 5.5 V, VSS = EVSS0 = EVSS1 = 0 V) (1/2)
Parameter Symbol Conditions MIN. TYP. MAX. Unit
Note 1 Note 3
Supply IDD1 Operating High-speed fIH = 32 MHz Basic VDD = 5.0 V 2.3 mA
Note 5
current mode operation operation VDD = 3.0 V 2.3 mA
Normal VDD = 5.0 V 5.2 8.5 mA
operation VDD = 3.0 V 5.2 8.5 mA
Note 3
fIH = 24 MHz Normal VDD = 5.0 V 4.1 6.6 mA
operation VDD = 3.0 V 4.1 6.6 mA
Note 3
fIH = 16 MHz Normal VDD = 5.0 V 3.0 4.7 mA
operation VDD = 3.0 V 3.0 4.7 mA
Note 3
Low-speed fIH = 8 MHz Normal VDD = 3.0 V 1.3 2.1 mA
Note 5
operation operation VDD = 2.0 V 1.3 2.1 mA
Note 3
Low-voltage fIH = 4 MHz Normal VDD = 3.0 V 1.3 1.8 mA
Note 5
operation operation VDD = 2.0 V 1.3 1.8 mA
Note 2
High-speed fMX = 20 MHz , Normal Square wave input 3.4 5.5 mA
Note 5
operation VDD = 5.0 V operation Resonator connection 3.6 5.7 mA
Note 2
fMX = 20 MHz , Normal Square wave input 3.4 5.5 mA
VDD = 3.0 V operation Resonator connection 3.6 5.7 mA
Note 2
fMX = 10 MHz , Normal Square wave input 2.1 3.2 mA
VDD = 5.0 V operation Resonator connection 2.1 3.2 mA
Note 2
fMX = 10 MHz , Normal Square wave input 2.1 3.2 mA
VDD = 3.0 V operation Resonator connection 2.1 3.2 mA
Note 2
Low-speed fMX = 8 MHz , Normal Square wave input 1.2 2.0 mA
Note 5
operation VDD = 3.0 V operation Resonator connection 1.2 2.0 mA
Note 2
fMX = 8 MHz , Normal Square wave input 1.2 2.0 mA
VDD = 2.0 V operation Resonator connection 1.2 2.0 mA
Subsystem fSUB = 32.768 kHz Normal Square wave input 4.8 μA
Note 4
clock operation Resonator connection 4.9 μA
operation TA = −40°C
fSUB = 32.768 kHz Normal Square wave input 4.9 5.9 μA
Note 4
operation Resonator connection 5.0 6.0 μA
TA = +25°C
fSUB = 32.768 kHz Normal Square wave input 4.9 7.6 μA
Note 4
operation Resonator connection 5.0 7.7 μA
TA = +50°C
fSUB = 32.768 kHz Normal Square wave input 5.2 9.3 μA
Note 4
operation Resonator connection 5.3 9.4 μA
TA = +70°C
fSUB = 32.768 kHz Normal Square wave input 6.1 13.3 μA
Note 4
operation Resonator connection 6.2 13.4 μA
TA = +85°C
Caution The pins mounted depend on the product. Refer to 2.1.1 20-pin products to 2.1.14 128-pin products,
and 2.1.15 Pins for each product (pins other than port pins).
Notes 1. Total current flowing into VDD, EVDD0 and EVDD1, including the input leakage current flowing when the level of
the input pin is fixed to VDD, EVDD0 or VSS, EVSS0. The values below the MAX. column include the peripheral
operation current (except for background operation (BGO)). However, not including the current flowing into the
A/D converter, LVD circuit, I/O port, and on-chip pull-up/pull-down resistors.
2. When high-speed on-chip oscillator and subsystem clock are stopped.
3. When high-speed system clock and subsystem clock are stopped.
4. When high-speed on-chip oscillator and high-speed system clock are stopped. When real-time counter and
watchdog timer is stopped. When AMPHS1 = 1 (Ultra-low power consumption oscillation).
5. Relationship between operation voltage width, operation frequency of CPU and operation mode is as below.
High speed operation: VDD = 2.4 V to 5.5 V@1 MHz to 32 MHz
Low speed operation: VDD = 1.8 V to 5.5 V@1 MHz to 8 MHz
Low voltage operation: VDD = 1.6 V to 5.5 V@1 MHz to 4 MHz
Remarks 1. fMX: High-speed system clock frequency (X1 clock oscillation frequency or external main system clock
frequency)
2. fIH: High-speed on-chip oscillator clock frequency
3. fSUB: Subsystem clock frequency (XT1 clock oscillation frequency)
<R> 4. Except subsystem clock operation, temperature condition of the TYP. value is TA = 25°C
Caution The pins mounted depend on the product. Refer to 2.1.1 20-pin products to 2.1.14 128-pin products,
and 2.1.15 Pins for each product (pins other than port pins).
Caution The pins mounted depend on the product. Refer to 2.1.1 20-pin products to 2.1.14 128-pin products,
and 2.1.15 Pins for each product (pins other than port pins).
Notes 1. Total current flowing into VDD, EVDD0 and EVDD1, including the input leakage current flowing when the level of
the input pin is fixed to VDD, EVDD0 or VSS, EVSS0. The values below the MAX. column include the peripheral
operation current. However, not including the current flowing into the A/D converter, LVD circuit, I/O port, and
on-chip pull-up/pull-down resistors.
2. During HALT instruction execution by flash memory.
3. When high-speed on-chip oscillator and subsystem clock are stopped.
4. When high-speed system clock and subsystem clock are stopped.
5. When operating real-time clock (RTC) and setting ultra-low current consumption (AMPHS1 = 1). When high-
speed on-chip oscillator and high-speed system clock are stopped. When watchdog timer is stopped. The
values below the MAX. column include the leakage current.
6. When high-speed on-chip oscillator, high-speed system clock, and subsystem clock are stopped. When
watchdog timer is stopped. The values below the MAX. column include the leakage current.
7. Relationship between operation voltage width, operation frequency of CPU and operation mode is as below.
High speed operation: VDD = 2.4 V to 5.5 V@1 MHz to 32 MHz
Low speed operation: VDD = 1.8 V to 5.5 V@1 MHz to 8 MHz
Low voltage operation: VDD = 1.6 V to 5.5 V@1 MHz to 4 MHz
Remarks 1. fMX: High-speed system clock frequency (X1 clock oscillation frequency or external main system clock
frequency)
2. fIH: High-speed on-chip oscillator clock frequency
3. fSUB: Subsystem clock frequency (XT1 clock oscillation frequency)
<R> 4. Except subsystem clock operation and STOP mode, temperature condition of the TYP. value is TA = 25°C
Caution The pins mounted depend on the product. Refer to 2.1.1 20-pin products to 2.1.14 128-pin products,
and 2.1.15 Pins for each product (pins other than port pins).
(3) 128-pin products, and flash ROM: 384 to 512 KB of 44- to 100-pin products Preliminary
(TA = −40 to +85°C, 1.6 V ≤ EVDD0 = EVDD1 ≤ VDD ≤ 5.5 V, VSS = EVSS0 = EVSS1 = 0 V) (1/2)
Parameter Symbol Conditions MIN. TYP. MAX. Unit
Note 1 Note 3
Supply IDD1 Operating High-speed fIH = 32 MHz Basic VDD = 5.0 V 2.6 mA
Note 5
current mode operation operation
VDD = 3.0 V 2.6 mA
Normal VDD = 5.0 V 5.5 8.5 mA
operation VDD = 3.0 V 5.5 8.5 mA
Note 3
fIH = 24 MHz Normal VDD = 5.0 V 4.4 6.8 mA
operation VDD = 3.0 V 4.4 6.8 mA
Note 3
fIH = 16 MHz Normal VDD = 5.0 V 3.3 5.1 mA
operation VDD = 3.0 V 3.3 5.1 mA
Note 3
Low-speed fIH = 8 MHz Normal VDD = 3.0 V 1.5 2.3 mA
Note 5
operation operation VDD = 2.0 V 1.5 2.3 mA
Note 3
Low-voltage fIH = 4 MHz Normal VDD = 3.0 V 1.5 2.0 mA
Note 5
operation operation VDD = 2.0 V 1.5 2.0 mA
Note 2
High-speed fMX = 20 MHz , Normal Square wave input 3.7 5.6 mA
Note 5
operation VDD = 5.0 V operation Resonator connection 3.8 5.7 mA
Note 2
fMX = 20 MHz , Normal Square wave input 3.7 5.6 mA
VDD = 3.0 V operation Resonator connection 3.8 5.7 mA
Note 2
fMX = 10 MHz , Normal Square wave input 2.2 3.0 mA
VDD = 5.0 V operation Resonator connection 2.3 3.1 mA
Note 2
fMX = 10 MHz , Normal Square wave input 2.2 3.0 mA
VDD = 3.0 V operation Resonator connection 2.3 3.1 mA
Note 2
Low-speed fMX = 8 MHz , Normal Square wave input 1.4 2.2 mA
Note 5
operation VDD = 3.0 V operation Resonator connection 1.4 2.2 mA
Note 2
fMX = 8 MHz , Normal Square wave input 1.4 2.2 mA
VDD = 2.0 V operation Resonator connection 1.4 2.2 mA
<R>
Subsystem fSUB = 32.768 kHz Normal Square wave input μA
Note 4
clock operation Resonator connection μA
operation TA = −40°C
fSUB = 32.768 kHz Normal Square wave input 5.1 μA
Note 4
operation Resonator connection 5.1 μA
TA = +25°C
fSUB = 32.768 kHz Normal Square wave input μA
Note 4
operation Resonator connection μA
TA = +50°C
fSUB = 32.768 kHz Normal Square wave input μA
Note 4
operation Resonator connection μA
TA = +70°C
fSUB = 32.768 kHz Normal Square wave input μA
Note 4
operation Resonator connection μA
TA = +85°C
<R>
Caution 128-pin products, and flash ROM: 384 to 512 KB of 44- to 100-pin products, these specifications show
target values, which may change after device evaluation.
Caution The pins mounted depend on the product. Refer to 2.1.1 20-pin products to 2.1.14 128-pin products,
and 2.1.15 Pins for each product (pins other than port pins).
Notes 1. Total current flowing into VDD, EVDD0 and EVDD1, including the input leakage current flowing when the level of
the input pin is fixed to VDD, EVDD0 or VSS, EVSS0. The values below the MAX. column include the peripheral
operation current (except for background operation (BGO)). However, not including the current flowing into the
A/D converter, LVD circuit, I/O port, and on-chip pull-up/pull-down resistors.
2. When high-speed on-chip oscillator and subsystem clock are stopped.
3. When high-speed system clock and subsystem clock are stopped.
4. When high-speed on-chip oscillator and high-speed system clock are stopped. When real-time counter and
watchdog timer is stopped. When AMPHS1 = 1 (Ultra-low power consumption oscillation).
5. Relationship between operation voltage width, operation frequency of CPU and operation mode is as below.
High speed operation: VDD = 2.4 V to 5.5 V@1 MHz to 32 MHz
Low speed operation: VDD = 1.8 V to 5.5 V@1 MHz to 8 MHz
Low voltage operation: VDD = 1.6 V to 5.5 V@1 MHz to 4 MHz
Remarks 1. fMX: High-speed system clock frequency (X1 clock oscillation frequency or external main system clock
frequency)
2. fIH: High-speed on-chip oscillator clock frequency
3. fSUB: Subsystem clock frequency (XT1 clock oscillation frequency)
<R> 4. Except subsystem clock operation, temperature condition of the TYP. value is TA = 25°C
Caution The pins mounted depend on the product. Refer to 2.1.1 20-pin products to 2.1.14 128-pin products,
and 2.1.15 Pins for each product (pins other than port pins).
(3) 128-pin products, and flash ROM: 384 to 512 KB of 44- to 100-pin products Preliminary
(TA = −40 to +85°C, 1.6 V ≤ EVDD0 = EVDD1 ≤ VDD ≤ 5.5 V, VSS = EVSS0 = EVSS1 = 0 V) (2/2)
Parameter Symbol Conditions MIN. TYP. MAX. Unit
Note 4
Supply IDD2 HALT High-speed fIH = 32 MHz VDD = 5.0 V 0.62 2.00 mA
Note 2 Note 7
current mode operation
Note 1
VDD = 3.0 V 0.62 2.00 mA
Note 4
fIH = 24 MHz VDD = 5.0 V 0.50 1.60 mA
VDD = 3.0 V 0.50 1.60 mA
Note 4
fIH = 16 MHz VDD = 5.0 V 0.44 1.25 mA
VDD = 3.0 V 0.44 1.25 mA
Low-speed fIH = 8 MHz
Note 4
VDD = 3.0 V 300 610 μA
Note 7
operation VDD = 2.0 V 300 610 μA
Low-voltage fIH = 4 MHz
Note 4
VDD = 3.0 V 470 710 μA
Note 7
operation VDD = 2.0 V 470 710 μA
Note 3
High-speed fMX = 20 MHz , Square wave input 0.35 1.30 mA
Note 7
operation VDD = 5.0 V Resonator connection 0.45 1.40 mA
Note 3
fMX = 20 MHz , Square wave input 0.35 1.30 mA
VDD = 3.0 V Resonator connection 0.45 1.40 mA
Note 3
fMX = 10 MHz , Square wave input 0.22 0.72 mA
VDD = 5.0 V Resonator connection 0.30 0.80 mA
Note 3
fMX = 10 MHz , Square wave input 0.22 0.72 mA
VDD = 3.0 V Resonator connection 0.30 0.80 mA
Low-speed fMX = 8 MHz
Note 3
, Square wave input 120 480 μA
Note 7
operation VDD = 3.0 V Resonator connection 160 520 μA
fMX = 8 MHz
Note 3
, Square wave input 120 480 μA
VDD = 2.0 V Resonator connection 160 520 μA
<R> Subsystem fSUB = 32.768 kHz
Note 5
Square wave input μA
clock TA = −40°C Resonator connection 0.49 μA
operation
fSUB = 32.768 kHz
Note 5
Square wave input 0.54 μA
TA = +25°C Resonator connection μA
fSUB = 32.768 kHz
Note 5
Square wave input μA
TA = +50°C Resonator connection μA
fSUB = 32.768 kHz
Note 5
Square wave input μA
TA = +70°C Resonator connection μA
fSUB = 32.768 kHz
Note 5
Square wave input μA
TA = +85°C Resonator connection μA
<R> IDD3
Note 6
STOP TA = −40°C μA
mode TA = +25°C 0.25 μA
TA = +50°C μA
TA = +70°C μA
TA = +85°C μA
Caution 128-pin products, and flash ROM: 384 to 512 KB of 44- to 100-pin products, these specifications show
target values, which may change after device evaluation.
Caution The pins mounted depend on the product. Refer to 2.1.1 20-pin products to 2.1.14 128-pin products,
and 2.1.15 Pins for each product (pins other than port pins).
Notes 1. Total current flowing into VDD, EVDD0 and EVDD1, including the input leakage current flowing when the level of
the input pin is fixed to VDD, EVDD0 or VSS, EVSS0. The values below the MAX. column include the peripheral
operation current. However, not including the current flowing into the A/D converter, LVD circuit, I/O port, and
on-chip pull-up/pull-down resistors.
2. During HALT instruction execution by flash memory.
3. When high-speed on-chip oscillator and subsystem clock are stopped.
4. When high-speed system clock and subsystem clock are stopped.
5. When operating real-time clock (RTC) and setting ultra-low current consumption (AMPHS1 = 1). When high-
speed on-chip oscillator and high-speed system clock are stopped. When watchdog timer is stopped. The
values below the MAX. column include the leakage current.
6. When high-speed on-chip oscillator, high-speed system clock, and subsystem clock are stopped. When
watchdog timer is stopped. The values below the MAX. column include the leakage current.
7. Relationship between operation voltage width, operation frequency of CPU and operation mode is as below.
High speed operation: VDD = 2.4 V to 5.5 V@1 MHz to 32 MHz
Low speed operation: VDD = 1.8 V to 5.5 V@1 MHz to 8 MHz
Low voltage operation: VDD = 1.6 V to 5.5 V@1 MHz to 4 MHz
Remarks 1. fMX: High-speed system clock frequency (X1 clock oscillation frequency or external main system clock
frequency)
2. fIH: High-speed on-chip oscillator clock frequency
3. fSUB: Subsystem clock frequency (XT1 clock oscillation frequency)
<R> 4. Except subsystem clock operation and STOP mode, temperature condition of the TYP. value is TA = 25°C
Caution The pins mounted depend on the product. Refer to 2.1.1 20-pin products to 2.1.14 128-pin products,
and 2.1.15 Pins for each product (pins other than port pins).
Notes 1. Current flowing only to the real-time clock (excluding the operating current of the XT1 oscillator). The TYP.
value of the current value of the RL78/G13 is the sum of the TYP. values of either IDD1 or IDD2, and IRTC, when
the real-time clock operates in operation mode or HALT mode. The IDD1 and IDD2 MAX. values also include the
<R> real-time clock operating current. However, IDD2 subsystem clock operation includes the operational current of
the real-time clock.
2. When high speed on-chip oscillator and high-speed system clock are stopped.
3. Current flowing only to the watchdog timer (including the operating current of the low-speed on-chip oscillator).
The current value of the RL78/G13 is the sum of IDD1, IDD2 or IDD3 and IWDT when fCLK = fSUB when the watchdog
timer operates in STOP mode.
4. Current flowing only to the A/D converter. The current value of the RL78/G13 is the sum of IDD1 or IDD2 and IADC
when the A/D converter operates in an operation mode or the HALT mode.
5. Current flowing only to the LVD circuit. The current value of the RL78/G13 is the sum of IDD1, IDD2 or IDD3 and
ILVI when the LVD circuit operates in the Operating, HALT or STOP mode.
6. Current flowing only to the BGO. The current value of the RL78/G13 is the sum of IDD1 or IDD2 and IBGO when
the BGO operates in an operation mode.
Caution The pins mounted depend on the product. Refer to 2.1.1 20-pin products to 2.1.14 128-pin products,
and 2.1.15 Pins for each product (pins other than port pins).
29.5 AC Characteristics
(TA = −40 to +85°C, 1.6 V ≤ EVDD0 = EVDD1 ≤ VDD ≤ 5.5 V, VSS = EVSS0 = EVSS1 = 0 V)
Items Symbol Conditions MIN. TYP. MAX. Unit
Instruction cycle (minimum TCY Main High-speed 2.7 V ≤ VDD ≤ 5.5 V 0.03125 1 μs
instruction execution time) system main mode
2.4 V ≤ VDD < 2.7 V 0.0625 1 μs
clock (fMAIN)
operation Low voltage 1.6 V ≤ VDD ≤ 5.5 V 0.25 1 μs
main mode
Low-speed 1.8 V ≤ VDD ≤ 5.5 V 0.125 1 μs
main mode
Subsystem clock (fSUB) 1.8 V ≤ VDD ≤ 5.5 V 28.5 30.5 31.3 μs
operation
In the self High-speed 2.7 V ≤ VDD ≤ 5.5 V 0.03125 1 μs
programming main mode 2.4 V ≤ VDD < 2.7 V 0.0625 1 μs
mode
Low voltage 1.8 V ≤ VDD ≤ 5.5 V 0.25 1 μs
main mode
Low-speed 1.8 V ≤ VDD ≤ 5.5 V 0.125 1 μs
main mode
External main system clock fEX 2.7 V ≤ VDD ≤ 5.5 V 1.0 20.0 MHz
frequency 1.8 V ≤ VDD < 2.7 V 1.0 8.0 MHz
1.6 V ≤ VDD < 1.8 V 1.0 4.0 MHz
fEXS 32 35 kHz
External main system clock input tEXH, tEXL 2.7 V ≤ VDD ≤ 5.5 V 24 ns
high-level width, low-level width 1.8 V ≤ VDD < 2.7 V 60 ns
1.6 V ≤ VDD < 1.8 V 120 ns
tEXHS, tEXLS 13.7 μs
<R> TI00 to TI07, TI10 to TI17 input tTIH, 1/fMCK+10
Note
ns
high-level width, low-level width tTIL
<R> TO00 to TO07, TO10 to TO17 fTO High-speed main 4.0 V ≤ EVDD0 ≤ 5.5 V 16 MHz
output frequency mode 2.7 V ≤ EVDD0 < 4.0 V 8 MHz
1.8 V ≤ EVDD0 < 2.7 V 4 MHz
1.6 V ≤ EVDD0 < 1.8 V 2 MHz
Low voltage main 1.6 V ≤ EVDD0 ≤ 5.5 V 2 MHz
mode
Low-speed main 1.8 V ≤ EVDD0 ≤ 5.5 V 4 MHz
mode 1.6 V ≤ EVDD0 < 1.8 V 2 MHz
<R> PCLBUZ0, PCLBUZ1 output fPCL High-speed main 4.0 V ≤ EVDD0 ≤ 5.5 V 16 MHz
frequency mode 2.7 V ≤ EVDD0 < 4.0 V 8 MHz
1.8 V ≤ EVDD0 < 2.7 V 4 MHz
1.6 V ≤ EVDD0 < 1.8 V 2 MHz
Low voltage main 1.8 V ≤ EVDD0 ≤ 5.5 V 4 MHz
mode 1.6 V ≤ EVDD0 < 1.8 V 2 MHz
Low-speed main 1.8 V ≤ EVDD0 ≤ 5.5 V 4 MHz
mode 1.6 V ≤ EVDD0 < 1.8 V 2 MHz
<R> Interrupt input high-level width, tINTH, INTP0 1.6 V ≤ VDD ≤ 5.5 V 1 μs
low-level width tINTL INTP1 to INTP11 1.6 V ≤ EVDD0 ≤ 5.5 V 1 μs
Key interrupt input low-level width tKR KR0 to KR7 1.8 V ≤ EVDD0 ≤ 5.5 V 250 ns
<R> 1.6 V ≤ EVDD0 < 1.8 V 1 μs
RESET low-level width tRSL 10 μs
(Note and Remark are listed on the next page.)
Caution The pins mounted depend on the product. Refer to 2.1.1 20-pin products to 2.1.14 128-pin products,
and 2.1.15 Pins for each product (pins other than port pins).
Note The following conditions are required for low voltage interface when EVDD0<VDD
1.8 V ≤ EVDD0 < 2.7 V : MIN. 125 ns
1.6 V ≤ EVDD0 < 1.8 V : MIN. 250 ns
Caution The pins mounted depend on the product. Refer to 2.1.1 20-pin products to 2.1.14 128-pin products,
and 2.1.15 Pins for each product (pins other than port pins).
(1) During communication at same potential (UART mode) (dedicated baud rate generator output)
(TA = −40 to +85°C, 1.6 V ≤ EVDD0 = EVDD1 ≤ VDD ≤ 5.5 V, VSS = EVSS0 = EVSS1 = 0 V)
Parameter Symbol Conditions MIN. TYP. MAX. Unit
Note 1 Note 2
<R> Transfer rate fMCK/6 bps
Theoretical value of the 5.3 Mbps
maximum transfer rate
fCLK = 32 MHz, fMCK = fCLK
TxDq Rx
RxDq Tx
1/Transfer rate
High-/Low-bit width
Baud rate error tolerance
TxDq
RxDq
Notes 1. Transfer rate in the SNOOZE mode is max. 9600 bps, min. 4800 bps.
<R> 2. The following conditions are required for low voltage interface when EVDD0<VDD.
2.4 V ≤ EVDD0 < 2.7 V : MAX. 2.6 Mbps
1.8 V ≤ EVDD0 < 2.4 V : MAX. 1.3 Mbps
1.6 V ≤ EVDD0 < 1.8 V : MAX. 0.6 Mbps
Caution Select the normal input buffer for the RxDq pin and the normal output mode for the TxDq pin by using
port input mode register g (PIMg) and port output mode register g (POMg).
Caution The pins mounted depend on the product. Refer to 2.1.1 20-pin products to 2.1.14 128-pin products,
and 2.1.15 Pins for each product (pins other than port pins).
(2) During communication at same potential (CSI mode) (master mode (fMCK/2), SCKp... internal clock output)
(TA = −40 to +85°C, 2.7 V ≤ EVDD0 = EVDD1 ≤ VDD ≤ 5.5 V, VSS = EVSS0 = EVSS1 = 0 V)
Parameter Symbol Conditions MIN. TYP. MAX. Unit
Caution Select the normal input buffer for the SIp pin and the normal output mode for the SOp pin and SCKp pin
by using port input mode register g (PIMg) and port output mode register g (POMg).
Remarks 1. This specification is valid only when CSI00’s peripheral I/O redirect function is not used.
2. p: CSI number (p = 00), m: Unit number (m = 0), n: Channel number (n = 0),
g: PIM and POM numbers (g = 1)
3. fMCK: Serial array unit operation clock frequency
(Operation clock to be set by the CKSmn bit of serial mode register mn (SMRmn). m: Unit number,
n: Channel number (mn = 00))
Caution The pins mounted depend on the product. Refer to 2.1.1 20-pin products to 2.1.14 128-pin products,
and 2.1.15 Pins for each product (pins other than port pins).
(3) During communication at same potential (CSI mode) (master mode (fMCK/4), SCKp... internal clock output)
(TA = −40 to +85°C, 1.6 V ≤ EVDD0 = EVDD1 ≤ VDD ≤ 5.5 V, VSS = EVSS0 = EVSS1 = 0 V)
Parameter Symbol Conditions MIN. TYP. MAX. Unit
Caution Select the normal input buffer for the SIp pin and the normal output mode for the SOp pin and SCKp pin
by using port input mode register g (PIMg) and port output mode register g (POMg).
Remarks 1. This specification is valid only when CSI00’s peripheral I/O redirect function is not used.
2. p: CSI number (p = 00, 01, 10, 11, 20, 21, 30, 31), m: Unit number (m = 0, 1), n: Channel number (n = 0 to 3),
g: PIM and POM numbers (g = 0, 1, 4, 5, 8, 14)
3. fMCK: Serial array unit operation clock frequency
(Operation clock to be set by the CKSmn bit of serial mode register mn (SMRmn). m: Unit number,
n: Channel number (mn = 00 to 03, 10 to 13))
Caution The pins mounted depend on the product. Refer to 2.1.1 20-pin products to 2.1.14 128-pin products,
and 2.1.15 Pins for each product (pins other than port pins).
(4) During communication at same potential (CSI mode) (slave mode, SCKp... external clock input)
(TA = −40 to +85°C, 1.6 V ≤ EVDD0 = EVDD1 ≤ VDD ≤ 5.5 V, VSS = EVSS0 = EVSS1 = 0 V)
Parameter Symbol Conditions MIN. TYP. MAX. Unit
Notes 1. When DAPmn = 0 and CKPmn = 0, or DAPmn = 1 and CKPmn = 1. The SIp setup time becomes “to SCKp↓”
when DAPmn = 0 and CKPmn = 1, or DAPmn = 1 and CKPmn = 0.
2. When DAPmn = 0 and CKPmn = 0, or DAPmn = 1 and CKPmn = 1. The SIp hold time becomes “from SCKp↓”
when DAPmn = 0 and CKPmn = 1, or DAPmn = 1 and CKPmn = 0.
3. When DAPmn = 0 and CKPmn = 0, or DAPmn = 1 and CKPmn = 1. The delay time to SOp output becomes
“from SCKp↑” when DAPmn = 0 and CKPmn = 1, or DAPmn = 1 and CKPmn = 0.
4. C is the load capacitance of the SOp output lines.
<R> 5. Transfer rate in the SNOOZE mode : MAX. 1 Mbps
Caution Select the TTL input buffer for the SIp pin and SCKp pin and the normal output mode for the SOp pin by
using port input mode register g (PIMg) and port output mode register g (POMg).
Remarks 1. p: CSI number (p = 00, 01, 10, 11, 20, 21, 30, 31), m: Unit number (m = 0, 1),
n: Channel number (n = 0 to 3), g: PIM number (g = 0, 1, 4, 5, 8, 14)
2. fMCK: Serial array unit operation clock frequency
(Operation clock to be set by the CKSmn bit of serial mode register mn (SMRmn). m: Unit number, n:
Channel number (mn = 00 to 03, 10 to 13))
Caution The pins mounted depend on the product. Refer to 2.1.1 20-pin products to 2.1.14 128-pin products,
and 2.1.15 Pins for each product (pins other than port pins).
SCKp SCK
SOp SI
tKCY1, 2
tKL1, 2 tKH1, 2
SCKp
tSIK1, 2 tKSI1, 2
tKSO1, 2
tKCY1, 2
tKH1, 2 tKL1, 2
SCKp
tSIK1, 2 tKSI1, 2
tKSO1, 2
Remarks 1. p: CSI number (p = 00, 01, 10, 11, 20, 21, 30, 31)
2. m: Unit number, n: Channel number (mn = 00 to 03, 10 to 13)
Caution The pins mounted depend on the product. Refer to 2.1.1 20-pin products to 2.1.14 128-pin products,
and 2.1.15 Pins for each product (pins other than port pins).
2
(5) During communication at same potential (simplified I C mode)
(TA = −40 to +85°C, 1.6 V ≤ EVDD0 = EVDD1 ≤ VDD ≤ 5.5 V, VSS = EVSS0 = EVSS1 = 0 V)
Parameter Symbol Conditions MIN. MAX. Unit
SCLr clock frequency fSCL 2.7 V ≤ EVDD0 ≤ 5.5 V, 1000 kHz
Cb = 50 pF, Rb = 2.7 kΩ
1.8 V ≤ EVDD0 ≤ 5.5 V, 400 kHz
Cb = 100 pF, Rb = 3 kΩ
1.8 V ≤ EVDD0 < 2.7 V, 300 kHz
Cb = 100 pF, Rb = 5 kΩ
1.6 V ≤ EVDD0 < 1.8 V, 250 kHz
Cb = 100 pF, Rb = 5 kΩ
Hold time when SCLr = “L” tLOW 2.7 V ≤ EVDD0 ≤ 5.5 V, 475 ns
Cb = 50 pF, Rb = 2.7 kΩ
1.8 V ≤ EVDD0 ≤ 5.5 V, 1150 ns
Cb = 100 pF, Rb = 3 kΩ
<R> 1.8 V ≤ EVDD0 < 2.7 V, 1550 ns
Cb = 100 pF, Rb = 5 kΩ
<R> 1.6 V ≤ EVDD0 < 1.8 V, 1850 ns
Cb = 100 pF, Rb = 5 kΩ
Hold time when SCLr = “H” tHIGH 2.7 V ≤ EVDD0 ≤ 5.5 V, 475 ns
Cb = 50 pF, Rb = 2.7 kΩ
1.8 V ≤ EVDD0 ≤ 5.5 V, 1150 ns
Cb = 100 pF, Rb = 3 kΩ
<R> 1.8 V ≤ EVDD0 < 2.7 V, 1550 ns
Cb = 100 pF, Rb = 5 kΩ
<R> 1.6 V ≤ EVDD0 < 1.8 V, 1850 ns
Cb = 100 pF, Rb = 5 kΩ
Data setup time (reception) tSU:DAT 2.7 V ≤ EVDD0 ≤ 5.5 V, 1/fMCK + 85 ns
Note
Cb = 50 pF, Rb = 2.7 kΩ
<R> 1.8 V ≤ EVDD ≤ 5.5 V, 1/fMCK + 145 ns
Note
Cb = 100 pF, Rb = 3 kΩ
1.8 V ≤ EVDD0 < 2.7 V, 1/fMCK + 230 ns
Note
Cb = 100 pF, Rb = 5 kΩ
1.6 V ≤ EVDD0 < 1.8 V, 1/fMCK + 290 ns
Note
Cb = 100 pF, Rb = 5 kΩ
Data hold time (transmission) tHD:DAT 2.7 V ≤ EVDD0 ≤ 5.5 V, 0 305 ns
Cb = 50 pF, Rb = 2.7 kΩ
1.8 V ≤ EVDD0 ≤ 5.5 V, 0 355 ns
Cb = 100 pF, Rb = 3 kΩ
1.8 V ≤ EVDD0 < 2.7 V, 0 405 ns
Cb = 100 pF, Rb = 5 kΩ
1.6 V ≤ EVDD0 < 1.8 V, 0 405 ns
Cb = 100 pF, Rb = 5 kΩ
<R> Note Set the fMCK value to keep the hold time of SCLr = "L" and SCLr = "H".
Caution The pins mounted depend on the product. Refer to 2.1.1 20-pin products to 2.1.14 128-pin products,
and 2.1.15 Pins for each product (pins other than port pins).
2
Simplified I C mode mode connection diagram (during communication at same potential)
VDD
Rb
SDAr SDA
SCLr SCL
2
Simplified I C mode serial transfer timing (during communication at same potential)
1/fSCL
tLOW tHIGH
SCLr
SDAr
tHD:DAT tSU:DAT
Caution Select the TTL input buffer and the N-ch open drain output (VDD tolerance) mode for the SDAr pin and
the normal output mode for the SCLr pin by using port input mode register g (PIMg) and port output
mode register h (POMh).
Remarks 1. Rb[Ω]:Communication line (SDAr) pull-up resistance, Cb[F]: Communication line (SDAr, SCLr) load
capacitance
2. r: IIC number (r = 00, 01, 10, 11, 20, 21, 30, 31), g: PIM number (g = 0, 1, 4, 5, 8, 14),
h: POM number (g = 0, 1, 4, 5, 7 to 9, 14)
3. fMCK: Serial array unit operation clock frequency
(Operation clock to be set by the CKSmn bit of serial mode register mn (SMRmn). m: Unit number (m = 0, 1),
n: Channel number (n = 0 to 3), mn = 00 to 03, 10 to 13)
Caution The pins mounted depend on the product. Refer to 2.1.1 20-pin products to 2.1.14 128-pin products,
and 2.1.15 Pins for each product (pins other than port pins).
(6) Communication at different potential (2.5 V, 3 V) (UART mode) (dedicated baud rate generator output) (1/2)
(TA = −40 to +85°C, 1.8 V ≤ EVDD0 = EVDD1 ≤ VDD ≤ 5.5 V, VSS = EVSS0 = EVSS1 = 0 V)
Parameter Symbol Conditions MIN. TYP. MAX. Unit
<R> Notes 1. Transfer rate in the SNOOZE mode : MAX. 9600 bps, MIN. 4800 bps
<R> 2. Use it with EVDD0≥Vb.
<R> 3. The following conditions are required for low voltage interface when EVDD0<VDD.
2.4 V ≤ EVDD0 < 2.7 V : MAX. 2.6 Mbps
1.8 V ≤ EVDD0 < 2.4 V : MAX. 1.3 Mbps
1.6 V ≤ EVDD0 < 1.8 V : MAX. 0.6 Mbps
Caution Select the TTL input buffer for the RxDq pin and the N-ch open drain output (VDD tolerance) mode for
the TxDq pin by using port input mode register g (PIMg) and port output mode register g (POMg).
Caution The pins mounted depend on the product. Refer to 2.1.1 20-pin products to 2.1.14 128-pin products,
and 2.1.15 Pins for each product (pins other than port pins).
(6) Communication at different potential (2.5 V, 3 V) (UART mode) (dedicated baud rate generator output) (2/2)
(TA = −40 to +85°C, 1.8 V ≤ EVDD0 = EVDD1 ≤ VDD ≤ 5.5 V, VSS = EVSS0 = EVSS1 = 0 V)
Parameter Symbol Conditions MIN. TYP. MAX. Unit
Notes 1. The smaller maximum transfer rate derived by using fMCK/6 or the following expression is the valid maximum
transfer rate.
Expression for calculating the transfer rate when 4.0 V ≤ EVDD0 ≤ 5.5 V and 2.7 V ≤ Vb ≤ 4.0 V
1
Maximum transfer rate = [bps]
2.2
{−Cb × Rb × ln (1 − )} × 3
Vb
1 2.2
− {−Cb × Rb × ln (1 − )}
Transfer rate × 2 Vb
Baud rate error (theoretical value) = × 100 [%]
1
( ) × Number of transferred bits
Transfer rate
* This value is the theoretical value of the relative difference between the transmission and reception sides.
<R> 2. Transfer rate in the SNOOZE mode : MAX. 9600 bps, MIN. 4800 bps
3. This value as an example is calculated when the conditions described in the “Conditions” column are met.
Refer to Note 1 above to calculate the maximum transfer rate under conditions of the customer.
4. The smaller maximum transfer rate derived by using fMCK/6 or the following expression is the valid maximum
transfer rate.
Expression for calculating the transfer rate when 2.7 V ≤ EVDD0 < 4.0 V and 2.3 V ≤ Vb ≤ 2.7 V
1
Maximum transfer rate = [bps]
2.0
{−Cb × Rb × ln (1 − )} × 3
Vb
1 2.0
− {−Cb × Rb × ln (1 − )}
Transfer rate × 2 Vb
Baud rate error (theoretical value) = × 100 [%]
1
( ) × Number of transferred bits
Transfer rate
* This value is the theoretical value of the relative difference between the transmission and reception sides.
5. This value as an example is calculated when the conditions described in the “Conditions” column are met.
Refer to Note 4 above to calculate the maximum transfer rate under conditions of the customer.
Caution The pins mounted depend on the product. Refer to 2.1.1 20-pin products to 2.1.14 128-pin products,
and 2.1.15 Pins for each product (pins other than port pins).
1
Maximum transfer rate = [bps]
1.5
{−Cb × Rb × ln (1 − )} × 3
Vb
1 1.5
− {−Cb × Rb × ln (1 − )}
Transfer rate × 2 Vb
Baud rate error (theoretical value) = × 100 [%]
1
( ) × Number of transferred bits
Transfer rate
* This value is the theoretical value of the relative difference between the transmission and reception sides.
8. This value as an example is calculated when the conditions described in the “Conditions” column are met.
Refer to Note 7 above to calculate the maximum transfer rate under conditions of the customer.
Caution Select the TTL input buffer for the RxDq pin and the N-ch open drain output (VDD tolerance) mode for the
TxDq pin by using port input mode register g (PIMg) and port output mode register g (POMg).
Vb
Rb
TxDq Rx
RxDq Tx
Caution The pins mounted depend on the product. Refer to 2.1.1 20-pin products to 2.1.14 128-pin products,
and 2.1.15 Pins for each product (pins other than port pins).
1/Transfer rate
Low-bit width
High-bit width
Baud rate error tolerance
TxDq
1/Transfer rate
High-/Low-bit width
Baud rate error tolerance
RxDq
Caution Select the TTL input buffer for the RxDq pin and the N-ch open drain output (VDD tolerance) mode for the
TxDq pin by using port input mode register g (PIMg) and port output mode register g (POMg).
Remarks 1. UART2 cannot communicate at different potentia when bit 1 (PIOR1) of peripheral I/O redirection register
(PIOR) is 1.
2. Rb[Ω]:Communication line (TxDq) pull-up resistance, Vb[V]: Communication line voltage
3. q: UART number (q = 0 to 3), g: PIM and POM number (g = 0, 1, 8, 14)
Caution The pins mounted depend on the product. Refer to 2.1.1 20-pin products to 2.1.14 128-pin products,
and 2.1.15 Pins for each product (pins other than port pins).
(7) Communication at different potential (2.5 V, 3 V) (fMCK/2) (CSI mode) (master mode, SCKp... internal clock output)
(TA = −40 to +85°C, 2.7 V ≤ EVDD0 = EVDD1 ≤ VDD ≤ 5.5 V, VSS = EVSS0 = EVSS1 = 0 V)
Parameter Symbol Conditions MIN. TYP. MAX. Unit
SCKp low-level width tKL1 4.0 V ≤ EVDD0 ≤ 5.5 V, 2.7 V ≤ Vb ≤ 4.0 V, tKCY1/2 − 7 ns
Cb = 20 pF, Rb = 1.4 kΩ
Caution The pins mounted depend on the product. Refer to 2.1.1 20-pin products to 2.1.14 128-pin products,
and 2.1.15 Pins for each product (pins other than port pins).
<Master> Vb Vb
Rb Rb
SCKp SCK
SOp SI
Caution Select the TTL input buffer for the SIp pin and the N-ch open drain output (VDD tolerance) mode for the
SOp pin and SCKp pin by using port input mode register g (PIMg) and port output mode register g
(POMg).
Remarks 1. Rb[Ω]:Communication line (SCKp, SOp) pull-up resistance, Cb[F]: Communication line (SCKp, SOp) load
capacitance, Vb[V]: Communication line voltage
2. p: CSI number (p = 00), m: Unit number (m = 0), n: Channel number (n = 0),
g: PIM and POM number (g = 1)
<R> 3. VIH and VIL below are observation points for the AC characteristics of the serial array unit when
communicating at different potentials in CSI mode.
4.0 V ≤ EVDD0 ≤ 5.5 V, 2.7 V ≤ Vb ≤ 4.0 V: VIH = 2.2 V, VIL = 0.8 V
2.7 V ≤ EVDD0 < 4.0 V, 2.3 V ≤ Vb ≤ 2.7 V: VIH = 2.0 V, VIL = 0.5 V
4. fMCK: Serial array unit operation clock frequency
(Operation clock to be set by the CKSmn bit of serial mode register mn (SMRmn). m: Unit number,
n: Channel number (mn = 00)
<R> 5. This specification is valid only when CSI00’s peripheral I/O redirect function is not used.
Caution The pins mounted depend on the product. Refer to 2.1.1 20-pin products to 2.1.14 128-pin products,
and 2.1.15 Pins for each product (pins other than port pins).
(8) Communication at different potential (2.5 V, 3 V) (fMCK/4) (CSI mode) (master mode, SCKp... internal clock output) (1/2)
(TA = −40 to +85°C, 1.8 V ≤ EVDD0 = EVDD1 ≤ VDD ≤ 5.5 V, VSS = EVSS0 = EVSS1 = 0 V)
Parameter Symbol Conditions MIN. TYP. MAX. Unit
SCKp low-level width tKL1 4.0 V ≤ EVDD0 ≤ 5.5 V, 2.7 V ≤ Vb ≤ 4.0 V, tKCY1/2 − 12 ns
Cb = 30 pF, Rb = 1.4 kΩ
Cautions 1. Select the TTL input buffer for the SIp pin and the N-ch open drain output (VDD tolerance) mode for
the SOp pin and SCKp pin by using port input mode register g (PIMg) and port output mode register
g (POMg).
2. Use it with EVDD0 ≥ Vb.
Remarks 1. Rb[Ω]:Communication line (SCKp, SOp) pull-up resistance, Cb[F]: Communication line (SCKp, SOp) load
capacitance, Vb[V]: Communication line voltage
2. p: CSI number (p = 00, 01, 10, 20, 30, 31), m: Unit number , n: Channel number (mn = 00, 01, 02, 10,
12, 13), g: PIM and POM number (g = 0, 1, 4, 5, 8, 14)
3. VIH and VIL below are observation points for the AC characteristics of the serial array unit when
communicating at different potentials in CSI mode.
4.0 V ≤ EVDD0 ≤ 5.5 V, 2.7 V ≤ Vb ≤ 4.0 V: VIH = 2.2 V, VIL = 0.8 V
2.7 V ≤ EVDD0 < 4.0 V, 2.3 V ≤ Vb ≤ 2.7 V: VIH = 2.0 V, VIL = 0.5 V
<R> 1.8 V ≤ EVDD0 < 3.3 V, 1.6 V ≤ Vb ≤ 2.0 V: VIH = 1.5 V, VIL = 0.32 V
4. CSI01 of 48-, 52-, 64-pin products, and CSI11 and CSI21 cannot communicate at different potential. Use
other CSI for communication at different potential.
Caution The pins mounted depend on the product. Refer to 2.1.1 20-pin products to 2.1.14 128-pin products,
and 2.1.15 Pins for each product (pins other than port pins).
(8) Communication at different potential (2.5 V, 3 V) (fMCK/4) (CSI mode) (master mode, SCKp... internal clock output) (2/2)
(TA = −40 to +85°C, 1.8 V ≤ EVDD0 = EVDD1 ≤ VDD ≤ 5.5 V, VSS = EVSS0 = EVSS1 = 0 V)
Parameter Symbol Conditions MIN. TYP. MAX. Unit
SIp setup time tSIK1 4.0 V ≤ EVDD0 ≤ 5.5 V, 2.7 V ≤ Vb ≤ 4.0 V, 81 ns
Note 1
(to SCKp↑) Cb = 30 pF, Rb = 1.4 kΩ
2.7 V ≤ EVDD0 < 4.0 V, 2.3 V ≤ Vb ≤ 2.7 V, 177 ns
Cb = 30 pF, Rb = 2.7 kΩ
<R> 1.8 V ≤ EVDD0 < 3.3 V, 1.6 V ≤ Vb ≤ 2.0 V, 479 ns
Cb = 30 pF, Rb = 5.5 kΩ
SIp hold time tKSI1 4.0 V ≤ EVDD0 ≤ 5.5 V, 2.7 V ≤ Vb ≤ 4.0 V, 19 ns
Note 1
(from SCKp↑) Cb = 30 pF, Rb = 1.4 kΩ
2.7 V ≤ EVDD0 < 4.0 V, 2.3 V ≤ Vb ≤ 2.7 V, 19 ns
Cb = 30 pF, Rb = 2.7 kΩ
<R> 1.8 V ≤ EVDD0 < 3.3 V, 1.6 V ≤ Vb ≤ 2.0 V, 19 ns
Cb = 30 pF, Rb = 5.5 kΩ
Delay time from SCKp↓ to tKSO1 4.0 V ≤ EVDD0 ≤ 5.5 V, 2.7 V ≤ Vb ≤ 4.0 V, 100 ns
Note 1
SOp output Cb = 30 pF, Rb = 1.4 kΩ
2.7 V ≤ EVDD0 < 4.0 V, 2.3 V ≤ Vb ≤ 2.7 V, 195 ns
Cb = 30 pF, Rb = 2.7 kΩ
<R> 1.8 V ≤ EVDD0 < 3.3 V, 1.6 V ≤ Vb ≤ 2.0 V, 483 ns
Cb = 30 pF, Rb = 5.5 kΩ
<R> SIp setup time tSIK1 4.0 V ≤ EVDD ≤ 5.5 V, 2.7 V ≤ Vb ≤ 4.0 V, 44 ns
Note 2
(to SCKp↓) Cb = 30 pF, Rb = 1.4 kΩ
<R> 2.7 V ≤ EVDD0 < 4.0 V, 2.3 V ≤ Vb ≤ 2.7 V, 44 ns
Cb = 30 pF, Rb = 2.7 kΩ
<R> 1.8 V ≤ EVDD0 < 3.3 V, 1.6 V ≤ Vb ≤ 2.0 V, 110 ns
Cb = 30 pF, Rb = 5.5 kΩ
SIp hold time tKSI1 4.0 V ≤ EVDD0 ≤ 5.5 V, 2.7 V ≤ Vb ≤ 4.0 V, 19 ns
Note 2
(from SCKp↓) Cb = 30 pF, Rb = 1.4 kΩ
2.7 V ≤ EVDD0 < 4.0 V, 2.3 V ≤ Vb ≤ 2.7 V, 19 ns
Cb = 30 pF, Rb = 2.7 kΩ
<R> 1.8 V ≤ EVDD0 < 3.3 V, 1.6 V ≤ Vb ≤ 2.0 V, 19 ns
Cb = 30 pF, Rb = 5.5 kΩ
Delay time from SCKp↑ to tKSO1 4.0 V ≤ EVDD0 ≤ 5.5 V, 2.7 V ≤ Vb ≤ 4.0 V, 25 ns
Note 2
SOp output Cb = 30 pF, Rb = 1.4 kΩ
2.7 V ≤ EVDD0 < 4.0 V, 2.3 V ≤ Vb ≤ 2.7 V, 25 ns
Cb = 30 pF, Rb = 2.7 kΩ
<R> 1.8 V ≤ EVDD0 < 3.3 V, 1.6 V ≤ Vb ≤ 2.0 V, 25 ns
Cb = 30 pF, Rb = 5.5 kΩ
Caution The pins mounted depend on the product. Refer to 2.1.1 20-pin products to 2.1.14 128-pin products,
and 2.1.15 Pins for each product (pins other than port pins).
<Master> Vb Vb
Rb Rb
SCKp SCK
SOp SI
Cautions 1. Select the TTL input buffer for the SIp pin and the N-ch open drain output (VDD tolerance) mode for
the SOp pin and SCKp pin by using port input mode register g (PIMg) and port output mode register
g (POMg).
<R> 2. Use it with EVDD0 ≥ Vb.
Remarks 1. Rb[Ω]:Communication line (SCKp, SOp) pull-up resistance, Cb[F]: Communication line (SCKp, SOp) load
capacitance, Vb[V]: Communication line voltage
2. p: CSI number (p = 00, 01, 10, 20, 30, 31), m: Unit number , n: Channel number (mn = 00, 01, 02, 10, 12,
13), g: PIM and POM number (g = 0, 1, 4, 5, 8, 14)
3. VIH and VIL below are observation points for the AC characteristics of the serial array unit when
communicating at different potentials in CSI mode.
4.0 V ≤ EVDD0 ≤ 5.5 V, 2.7 V ≤ Vb ≤ 4.0 V: VIH = 2.2 V, VIL = 0.8 V
2.7 V ≤ EVDD0 < 4.0 V, 2.3 V ≤ Vb ≤ 2.7 V: VIH = 2.0 V, VIL = 0.5 V
<R> 1.8 V ≤ EVDD0 < 3.3 V, 1.6 V ≤ Vb ≤ 2.0 V: VIH = 1.5 V, VIL = 0.32 V
4. CSI01 of 48-, 52-, 64-pin products, and CSI11 and CSI21 cannot communicate at different potential. Use
other CSI for communication at different potential.
Caution The pins mounted depend on the product. Refer to 2.1.1 20-pin products to 2.1.14 128-pin products,
and 2.1.15 Pins for each product (pins other than port pins).
CSI mode serial transfer timing (master mode) (during communication at different potential)
(When DAPmn = 0 and CKPmn = 0, or DAPmn = 1 and CKPmn = 1.)
tKCY1
tKL1 tKH1
SCKp
tSIK1 tKSI1
tKSO1
CSI mode serial transfer timing (master mode) (during communication at different potential)
(When DAPmn = 0 and CKPmn = 1, or DAPmn = 1 and CKPmn = 0.)
tKCY1
tKH1 tKL1
SCKp
tSIK1 tKSI1
tKSO1
Caution Select the TTL input buffer for the SIp pin and the N-ch open drain output (VDD tolerance) mode for the
SOp pin and SCKp pin by using port input mode register g (PIMg) and port output mode register g
(POMg).
Remarks 1. p: CSI number (p = 00, 01, 10, 20, 30, 31), m: Unit number (m = 00, 01, 02, 10, 12, 13), n: Channel number
(n = 0, 2), g: PIM and POM number (g = 0, 1, 4, 5, 8, 14)
2. CSI01 of 48-, 52-, 64-pin products, and CSI11 and CSI21 cannot communicate at different potential. Use
other CSI for communication at different potential.
Caution The pins mounted depend on the product. Refer to 2.1.1 20-pin products to 2.1.14 128-pin products,
and 2.1.15 Pins for each product (pins other than port pins).
(9) Communication at different potential (2.5 V, 3 V) (CSI mode) (slave mode, SCKp... external clock input)
(TA = −40 to +85°C, 1.8 V ≤ EVDD0 = EVDD1 ≤ VDD ≤ 5.5 V, VSS = EVSS0 = EVSS1 = 0 V)
Parameter Symbol Conditions MIN. TYP. MAX. Unit
<R> SCKp cycle time Note 1
tKCY2 4.0 V ≤ EVDD0 ≤ 5.5 V, 24 MHz < fMCK 14/fMCK ns
2.7 V ≤ Vb ≤ 4.0 V 20 MHz < fMCK ≤ 24 MHz 12/fMCK ns
8 MHz < fMCK ≤ 20 MHz 10/fMCK ns
4 MHz < fMCK ≤ 8 MHz 8/fMCK ns
fMCK ≤ 4 MHz 6/fMCK ns
2.7 V ≤ EVDD0 < 4.0 V, 24 MHz < fMCK 20/fMCK ns
2.3 V ≤ Vb ≤ 2.7 V 20 MHz < fMCK ≤ 24 MHz 16/fMCK ns
16 MHz < fMCK ≤ 20 MHz 14/fMCK ns
8 MHz < fMCK ≤ 16 MHz 12/fMCK ns
4 MHz < fMCK ≤ 8 MHz 8/fMCK ns
fMCK ≤ 4 MHz 6/fMCK ns
1.8 V ≤ EVDD0 < 3.3 V, 24 MHz < fMCK 48/fMCK ns
1.6 V ≤ Vb ≤ 2.0 V 20 MHz < fMCK ≤ 24 MHz
Note 2
36/fMCK ns
16 MHz < fMCK ≤ 20 MHz 32/fMCK ns
8 MHz < fMCK ≤ 16 MHz 26/fMCK ns
4 MHz < fMCK ≤ 8 MHz 16/fMCK ns
fMCK ≤ 4 MHz 10/fMCK ns
SCKp high-/low-level tKH2, 4.0 V ≤ EVDD0 ≤ 5.5 V, 2.7 V ≤ Vb ≤ 4.0 V tKCY2/2 − ns
width tKL2 12
2.7 V ≤ EVDD0 < 4.0 V, 2.3 V ≤ Vb ≤ 2.7 V tKCY2/2 − ns
18
Caution The pins mounted depend on the product. Refer to 2.1.1 20-pin products to 2.1.14 128-pin products,
and 2.1.15 Pins for each product (pins other than port pins).
<Slave> Vb
Rb
SCKp SCK
SOp SI
Caution Select the TTL input buffer for the SIp pin and SCKp pin and the N-ch open drain output (VDD tolerance)
mode for the SOp pin by using port input mode register g (PIMg) and port output mode register g
(POMg).
Remarks 1. Rb[Ω]:Communication line (SOp) pull-up resistance, Cb[F]: Communication line (SOp) load capacitance,
Vb[V]: Communication line voltage
2. p: CSI number (p = 00, 01, 10, 20, 30, 31), m: Unit number (m = 0, 1), n: Channel number (n = 00, 01, 02, 10,
12, 13), g: PIM and POM number (g = 0, 1, 4, 5, 8, 14)
3. fMCK: Serial array unit operation clock frequency
(Operation clock to be set by the CKSmn bit of serial mode register mn (SMRmn).
m: Unit number, n: Channel number (mn = 00, 01, 02, 10, 12, 13))
4. VIH and VIL below are observation points for the AC characteristics of the serial array unit when
communicating at different potentials in CSI mode.
4.0 V ≤ EVDD0 ≤ 5.5 V, 2.7 V ≤ Vb ≤ 4.0 V: VIH = 2.2 V, VIL = 0.8 V
2.7 V ≤ EVDD0 < 4.0 V, 2.3 V ≤ Vb ≤ 2.7 V: VIH = 2.0 V, VIL = 0.5 V
<R> 1.8 V ≤ EVDD0 < 3.3 V, 1.6 V ≤ Vb ≤ 2.0 V: VIH = 1.5 V, VIL = 0.32 V
5. CSI01 of 48-, 52-, 64-pin products, and CSI11 and CSI21 cannot communicate at different potential. Use
other CSI for communication at different potential.
Caution The pins mounted depend on the product. Refer to 2.1.1 20-pin products to 2.1.14 128-pin products,
and 2.1.15 Pins for each product (pins other than port pins).
CSI mode serial transfer timing (slave mode) (during communication at different potential)
(When DAPmn = 0 and CKPmn = 0, or DAPmn = 1 and CKPmn = 1.)
tKCY2
tKL2 tKH2
SCKp
tSIK2 tKSI2
tKSO2
CSI mode serial transfer timing (slave mode) (during communication at different potential)
(When DAPmn = 0 and CKPmn = 1, or DAPmn = 1 and CKPmn = 0.)
tKCY2
tKH2 tKL2
SCKp
tSIK2 tKSI2
tKSO2
Caution Select the TTL input buffer for the SIp pin and SCKp pin and the N-ch open drain output (VDD tolerance)
mode for the SOp pin by using port input mode register g (PIMg) and port output mode register g
(POMg).
Remarks 1. p: CSI number (p = 00, 01, 10, 20, 30, 31), m: Unit number, n: Channel number (mn = 00, 01, 02, 10, 12. 13),
g: PIM and POM number (g = 0, 1, 4, 5, 8, 14)
2. CSI01 of 48-, 52-, 64-pin products, and CSI11 and CSI21 cannot communicate at different potential. Use
other CSI for communication at different potential.
Caution The pins mounted depend on the product. Refer to 2.1.1 20-pin products to 2.1.14 128-pin products,
and 2.1.15 Pins for each product (pins other than port pins).
2
(10) Communication at different potential (2.5 V, 3 V) (simplified I C mode) (1/2)
(TA = −40 to +85°C, 1.8 V ≤ EVDD0 = EVDD1 ≤ VDD ≤ 5.5 V, VSS = EVSS0 = EVSS1 = 0 V)
Parameter Symbol Conditions MIN. MAX. Unit
SCLr clock frequency fSCL 4.0 V ≤ EVDD0 ≤ 5.5 V, 1000 kHz
2.7 V ≤ Vb ≤ 4.0 V,
Cb = 50 pF, Rb = 2.7 kΩ
2.7 V ≤ EVDD0 < 4.0 V, 1000 kHz
2.3 V ≤ Vb < 2.7 V,
Cb = 50 pF, Rb = 2.7 kΩ
4.0 V ≤ EVDD0 ≤ 5.5 V, 400 kHz
2.7 V ≤ Vb ≤ 4.0 V,
Cb = 100 pF, Rb = 2.8 kΩ
2.7 V ≤ EVDD0 < 4.0 V, 400 kHz
2.3 V ≤ Vb < 2.7 V,
Cb = 100 pF, Rb = 2.7 kΩ
1.8 V ≤ EVDD0 < 3.3 V, 300 kHz
<R> 1.6 V ≤ Vb ≤ 2.0 V
Note 1
,
Cb = 100 pF, Rb = 5.5 kΩ
Hold time when SCLr = “L” tLOW 4.0 V ≤ EVDD0 ≤ 5.5 V, 475 ns
2.7 V ≤ Vb ≤ 4.0 V,
Cb = 50 pF, Rb = 2.7 kΩ
2.7 V ≤ EVDD0 < 4.0 V, 475 ns
2.3 V ≤ Vb < 2.7 V,
Cb = 50 pF, Rb = 2.7 kΩ
4.0 V ≤ EVDD0 ≤ 5.5 V, 1150 ns
2.7 V ≤ Vb ≤ 4.0 V,
Cb = 100 pF, Rb = 2.8 kΩ
2.7 V ≤ EVDD0 < 4.0 V, 1150 ns
2.3 V ≤ Vb < 2.7 V,
Cb = 100 pF, Rb = 2.7 kΩ
1.8 V ≤ EVDD0 < 3.3 V, 1550 ns
<R> 1.6 V ≤ Vb ≤ 2.0 V
Note 1
,
Cb = 100 pF, Rb = 5.5 kΩ
Hold time when SCLr = “H” tHIGH 4.0 V ≤ EVDD0 ≤ 5.5 V, 245 ns
2.7 V ≤ Vb ≤ 4.0 V,
Cb = 50 pF, Rb = 2.7 kΩ
2.7 V ≤ EVDD0 < 4.0 V, 200 ns
2.3 V ≤ Vb < 2.7 V,
Cb = 50 pF, Rb = 2.7 kΩ
4.0 V ≤ EVDD0 ≤ 5.5 V, 675 ns
2.7 V ≤ Vb ≤ 4.0 V,
Cb = 100 pF, Rb = 2.8 kΩ
2.7 V ≤ EVDD0 < 4.0 V, 600 ns
2.3 V ≤ Vb < 2.7 V,
Cb = 100 pF, Rb = 2.7 kΩ
1.8 V ≤ EVDD0 < 3.3 V, 610 ns
1.6 V ≤ Vb ≤ 2.0 V
Note 1
<R> ,
Cb = 100 pF, Rb = 5.5 kΩ
Caution The pins mounted depend on the product. Refer to 2.1.1 20-pin products to 2.1.14 128-pin products,
and 2.1.15 Pins for each product (pins other than port pins).
2
(10) Communication at different potential (2.5 V, 3 V) (simplified I C mode) (2/2)
(TA = −40 to +85°C, 1.8 V ≤ EVDD0 = EVDD1 ≤ VDD ≤ 5.5 V, VSS = EVSS0 = EVSS1 = 0 V)
Parameter Symbol Conditions MIN. MAX. Unit
Data setup time (reception) tSU:DAT 4.0 V ≤ EVDD0 ≤ 5.5 V, 1/fMCK + 135 ns
2.7 V ≤ Vb ≤ 4.0 V,
Note 2
Cb = 50 pF, Rb = 2.7 kΩ
2.7 V ≤ EVDD0 < 4.0 V, 1/fMCK + 135 ns
2.3 V ≤ Vb < 2.7 V,
Note 2
Cb = 50 pF, Rb = 2.7 kΩ
4.0 V ≤ EVDD0 ≤ 5.5 V, 1/fMCK + 190 ns
2.7 V ≤ Vb ≤ 4.0 V,
Note 2
Caution Select the TTL input buffer and the N-ch open drain output (VDD tolerance) mode for the SDAr pin and
the N-ch open drain output (VDD tolerance) mode for the SCLr pin by using port input mode register g
(PIMg) and port output mode register g (POMg).
Caution The pins mounted depend on the product. Refer to 2.1.1 20-pin products to 2.1.14 128-pin products,
and 2.1.15 Pins for each product (pins other than port pins).
2
Simplified I C mode connection diagram (during communication at different potential)
Vb Vb
Rb Rb
SDAr SDA
SCLr SCL
2
Simplified I C mode serial transfer timing (during communication at different potential)
1/fSCL
tLOW tHIGH
SCLr
SDAr
tHD:DAT tSU:DAT
Caution Select the TTL input buffer and the N-ch open drain output (VDD tolerance) mode for the SDAr pin and
the N-ch open drain output (VDD tolerance) mode for the SCLr pin by using port input mode register g
(PIMg) and port output mode register g (POMg).
Remarks 1. Rb[Ω]:Communication line (SDAr, SCLr) pull-up resistance, Cb[F]: Communication line (SDAr, SCLr) load
capacitance, Vb[V]: Communication line voltage
2. r: IIC number (r = 00, 01, 10, 20, 30, 31), g: PIM, POM number (g = 0, 1, 4, 5, 8, 14)
3. fMCK: Serial array unit operation clock frequency
(Operation clock to be set by the CKSmn bit of serial mode register mn (SMRmn). m: Unit number, n:
Channel number (mn = 00, 01, 02, 10, 12, 13)
4. VIH and VIL below are observation points for the AC characteristics of the serial array unit when
2
communicating at different potentials in simplified I C mode mode.
4.0 V ≤ EVDD0 ≤ 5.5 V, 2.7 V ≤ Vb ≤ 4.0 V: VIH = 2.2 V, VIL = 0.8 V
2.7 V ≤ EVDD0 < 4.0 V, 2.3 V ≤ Vb ≤ 2.7 V: VIH = 2.0 V, VIL = 0.5 V
<R> 1.8 V ≤ EVDD0 < 3.3 V, 1.6 V ≤ Vb ≤ 2.0 V: VIH = 1.5 V, VIL = 0.32 V
Caution The pins mounted depend on the product. Refer to 2.1.1 20-pin products to 2.1.14 128-pin products,
and 2.1.15 Pins for each product (pins other than port pins).
(TA = −40 to +85°C, 1.6 V ≤ EVDD0 = EVDD1 ≤ VDD ≤ 5.5 V, VSS = EVSS0 = EVSS1 = 0 V)
Parameter Symbol Conditions Standard Fast Mode Fast Mode Unit
Mode Plus
MIN. MAX. MIN. MAX. MIN. MAX.
SCLA0 clock frequency fSCL Fast mode plus: 2.7 V ≤ EVDD0 ≤ 5.5 V 0 1000 kHz
fCLK ≥ 10 MHz
Fast mode: 1.8 V ≤ EVDD0 ≤ 5.5 V 0 400 kHz
fCLK ≥ 3.5 MHz
Normal mode: 1.6 V ≤ EVDD0 ≤ 5.5 V 0 100 kHz
fCLK ≥ 1 MHz
Setup time of restart condition tSU:STA 4.7 0.6 0.26 μs
Hold time
Note 1
tHD:STA 4.0 0.6 0.26 μs
Hold time when SCLA0 = “L” tLOW 4.7 1.3 0.5 μs
Hold time when SCLA0 = “H” tHIGH 4.0 0.6 0.26 μs
Data setup time (reception) tSU:DAT 250 100 50 ns
Data hold time (transmission)
Note 2
tHD:DAT 0 3.45 0 0.9 0 μs
Setup time of stop condition tSU:STO 4.0 0.6 0.26 μs
Bus-free time tBUF 4.7 1.3 0.5 μs
Notes 1. The first clock pulse is generated after this period when the start/restart condition is detected.
2. The maximum value (MAX.) of tHD:DAT is during normal transfer and a wait state is inserted in the ACK
(acknowledge) timing.
Remark The maximum value of Cb (communication line capacitance) and the value of Rb (communication line pull-up
resistor) at that time in each mode are as follows.
tLOW
SCL0
SDA0
tLOW
Caution The pins mounted depend on the product. Refer to 2.1.1 20-pin products to 2.1.14 128-pin products,
and 2.1.15 Pins for each product (pins other than port pins).
(TA = −40 to +85°C, 1.8 V ≤ EVDD0 = EVDD1 ≤ VDD ≤ 5.5 V, VSS = EVSS0 = EVSS1 = 0 V)
Parameter Symbol Conditions MIN. TYP. MAX. Unit
(1) When AVREF (+) = AVREFP/ANI0 (ADREFP1 = 0, ADREFP0 = 1), AVREF (−) = AVREFM/ANI1 (ADREFM = 1), target ANI
pin : ANI2 to ANI14 (supply ANI pin to VDD)
(TA = −40 to +85°C, 1.6 V ≤ EVDD0 = EVDD1 ≤ VDD ≤ 5.5 V, VSS = EVSS0 = EVSS1 = 0 V, Reference voltage (+) = AVREFP,
Reference voltage (−) = AVREFM = 0 V)
Caution The pins mounted depend on the product. Refer to 2.1.1 20-pin products to 2.1.14 128-pin products,
and 2.1.15 Pins for each product (pins other than port pins).
(2) When AVREF (+) = AVREFP/ANI0 (ADREFP1 = 0, ADREFP0 = 1), AVREF (−) = AVREFM/ANI1 (ADREFM = 1), target ANI
pin : ANI16 to ANI26 (supply ANI pin to EVDD0)
(TA = −40 to +85°C, 1.6 V ≤ EVDD0 = EVDD1 ≤ VDD ≤ 5.5 V, VSS = EVSS0 = EVSS1 = 0 V, Reference voltage (+) = AVREFP,
Reference voltage (−) = AVREFM)
Caution The pins mounted depend on the product. Refer to 2.1.1 20-pin products to 2.1.14 128-pin products,
and 2.1.15 Pins for each product (pins other than port pins).
(3) When AVREF (+) = VDD (ADREFP1 = 0, ADREFP0 = 0), AVREF (−) = VSS (ADREFM = 0), target ANI pin : ANI0 to
ANI14, ANI16 to ANI26
(TA = −40 to +85°C, 1.6 V ≤ EVDD0 = EVDD1 ≤ VDD ≤ 5.5 V, VSS = EVSS0 = EVSS1 = 0 V, Reference voltage (+) = VDD,
Reference voltage (−) = VSS)
Caution The pins mounted depend on the product. Refer to 2.1.1 20-pin products to 2.1.14 128-pin products,
and 2.1.15 Pins for each product (pins other than port pins).
(4) When AVREF (+) = Internal reference voltage (ADREFP1 = 1, ADREFP0 = 0), AVREF (−) = AVREFM/ANI1 (ADREFM =
1), target ANI pin : ANI0 to ANI14, ANI16 to ANI26
(TA = −40 to +85°C, 1.6 V ≤ EVDD0 = EVDD1 ≤ VDD ≤ 5.5 V, VSS = EVSS0 = EVSS1 = 0 V, Reference voltage (+) = VBGR,
Reference voltage (−) = AVREFM = 0 V)
Caution The pins mounted depend on the product. Refer to 2.1.1 20-pin products to 2.1.14 128-pin products,
and 2.1.15 Pins for each product (pins other than port pins).
(TA = −40 to +85°C, 2.4 V ≤ EVDD0 = EVDD1 ≤ VDD ≤ 5.5 V, VSS = EVSS0 = EVSS1 = 0 V)
<R> Temperature sensor output voltage VTMPS25 Setting ADS register = 80H, TA = +25°C 1.05 V
<R> Reference output voltage VCONST Setting ADS register = 81H 1.38 1.45 1.5 V
<R> Temperature coefficient FVTMPS Temperature sensor that depends on the −3.6 mV/C
temperature
Operation stabilization wait time tAMP 5 μs
Caution The pins mounted depend on the product. Refer to 2.1.1 20-pin products to 2.1.14 128-pin products,
and 2.1.15 Pins for each product (pins other than port pins).
Detection Supply voltage level VLVD0 Power supply rise time 3.98 4.06 4.14 V
voltage V
Power supply fall time 3.90 3.98 4.06
VLVD1 Power supply rise time 3.68 3.75 3.82 V
Caution The pins mounted depend on the product. Refer to 2.1.1 20-pin products to 2.1.14 128-pin products,
and 2.1.15 Pins for each product (pins other than port pins).
Interrupt and reset VLVD13 VPOC0, VPOC1, VPOC2 = 0, 0, 0, falling reset voltage: 1.6 V 1.60 1.63 1.66 V
mode VLVD12 LVIS0, LVIS1 = 1, 0 Rising release reset voltage 1.74 1.77 1.81 V
(+0.1 V) Falling interrupt voltage 1.70 1.73 1.77 V
VLVD11 LVIS0, LVIS1 = 0, 1 Rising release reset voltage 1.84 1.88 1.91 V
(+0.2 V) Falling interrupt voltage 1.80 1.84 1.87 V
VLVD4 LVIS0, LVIS1 = 0, 0 Rising release reset voltage 2.86 2.92 2.97 V
(+1.2 V) Falling interrupt voltage 2.80 2.86 2.91 V
VLVD11 VPOC0, VPOC1, VPOC2 = 0, 0, 1, falling reset voltage: 1.8 V 1.80 1.84 1.87 V
VLVD10 LVIS0, LVIS1 = 1, 0 Rising release reset voltage 1.94 1.98 2.02 V
(+0.1 V) Falling interrupt voltage 1.90 1.94 1.98 V
VLVD9 LVIS0, LVIS1 = 0, 1 Rising release reset voltage 2.05 2.09 2.13 V
(+0.2 V) Falling interrupt voltage 2.00 2.04 2.08 V
VLVD2 LVIS0, LVIS1 = 0, 0 Rising release reset voltage 3.07 3.13 3.19 V
(+1.2 V) Falling interrupt voltage 3.00 3.06 3.12 V
VLVD8 VPOC0, VPOC1, VPOC2 = 0, 1, 0, falling reset voltage: 2.4 V 2.40 2.45 2.50 V
VLVD7 LVIS0, LVIS1 = 1, 0 Rising release reset voltage 2.56 2.61 2.66 V
(+0.1 V) Falling interrupt voltage 2.50 2.55 2.60 V
VLVD6 LVIS0, LVIS1 = 0, 1 Rising release reset voltage 2.66 2.71 2.76 V
(+0.2 V) Falling interrupt voltage 2.60 2.65 2.70 V
VLVD1 LVIS0, LVIS1 = 0, 0 Rising release reset voltage 3.68 3.75 3.82 V
(+1.2 V) Falling interrupt voltage 3.60 3.67 3.74 V
VLVD5 VPOC0, VPOC1, VPOC2 = 0, 1, 1, falling reset voltage: 2.7 V 2.70 2.75 2.81 V
VLVD4 LVIS0, LVIS1 = 1, 0 Rising release reset voltage 2.86 2.92 2.97 V
(+0.1 V) Falling interrupt voltage 2.80 2.86 2.91 V
VLVD3 LVIS0, LVIS1 = 0, 1 Rising release reset voltage 2.96 3.02 3.08 V
(+0.2 V) Falling interrupt voltage 2.90 2.96 3.02 V
VLVD0 LVIS0, LVIS1 = 0, 0 Rising release reset voltage 3.98 4.06 4.14 V
(+1.2 V) Falling interrupt voltage 3.90 3.98 4.06 V
Caution The pins mounted depend on the product. Refer to 2.1.1 20-pin products to 2.1.14 128-pin products,
and 2.1.15 Pins for each product (pins other than port pins).
Note Make sure to raise the power supply in a shorter time than this.
1.6 V
0V
Time
POR internal
signal
tPUP1
Caution The pins mounted depend on the product. Refer to 2.1.1 20-pin products to 2.1.14 128-pin products,
and 2.1.15 Pins for each product (pins other than port pins).
29.8 Data Memory STOP Mode Low Supply Voltage Data Retention Characteristics
Note The value depends on the POR detection voltage. When the voltage drops, the data is retained before a POR
reset is effected, but data is not retained when a POR reset is effected.
VDD
VDDDR
(TA = −40 to +85°C, 1.8 V ≤ EVDD0 = EVDD1 ≤ VDD ≤ 5.5 V, VSS = EVSS0 = EVSS1 = 0 V)
Parameter Symbol Conditions MIN. TYP. MAX. Unit
Notes 1. 128-pin products, and flash ROM: 384 to 512 KB of 44- to 100-pin products, these specifications show target
values, which may change after device evaluation.
2. When using flash memory programmer and Renesas Electronics self programming library
Remark When updating data multiple times, use the flash memory as one for updating data.
Caution The pins mounted depend on the product. Refer to 2.1.1 20-pin products to 2.1.14 128-pin products,
and 2.1.15 Pins for each product (pins other than port pins).
RESET
tHD+
software
processing
time
TOOL0
tSU tSUINIT
Remark tSUINIT: The segment shows that it is necessary to finish specifying the initial communication settings within 100
ms from when the external and internal resets end.
<R> tSU: How long from when the TOOL0 pin is placed at the low level until a pin reset ends
tHD: How long to keep the TOOL0 pin at the low level from when the external and internal resets end
20 11
P
L
E U
1 10
A
H
I J
N S
C K
D M M B
D 0.24 +0.08
−0.07
E 0.1±0.05
F 1.3±0.1
G 1.2
H 8.1±0.2
I 6.1±0.2
J 1.0±0.2
K 0.17±0.03
L 0.5
M 0.13
N 0.10
P 3° +5°
−3°
T 0.25
U 0.6±0.15
S20MC-65-5A4-2
DETAIL OF A PART
E
A
S
y S
D2
A
EXPOSED DIE PAD (UNIT:mm)
1 6
ITEM DIMENSIONS
D 4.00 ± 0.05
24 7
E 4.00 ± 0.05
A 0.75 ± 0.05
B
b 0.20±0.05
E2 e 0.50
Lp 0.40 ± 0.10
x 0.05
19 y 0.05
12
P24K8-50-CAB
18 13
Lp e D2 E2
ITEM
MIN NOM MAX MIN NOM MAX
b x M S AB EXPOSED
DIE PAD A 2.45 2.50 2.55 2.45 2.50 2.55
VARIATIONS
ZD A
D w S A ZE e
B 4
E 3 2.27
2
C
1
E D C B A
INDEX MARK w S B D
2.27
INDEX MARK
y1 S A
y S
30 16
F
G
P
L
1 15
A E U
I J
C N S B
D M M K
D 0.24 +0.08
−0.07
E 0.1±0.05
F 1.3±0.1
G 1.2
H 8.1±0.2
I 6.1±0.2
J 1.0±0.2
K 0.17±0.03
L 0.5
M 0.13
N 0.10
P 3° +5°
−3°
T 0.25
U 0.6±0.15
S30MC-65-5A4-2
DETAIL OF A PART
E
A
S
y S
D2
24 17
Lp e ITEM
D2 E2
MIN NOM MAX MIN NOM MAX
b x M S AB EXPOSED
DIE PAD A 3.45 3.50 3.55 3.45 3.50 3.55
VARIATIONS
ZD A
D w S A ZE e
6
5
B
4
E 2.90
3
2
C 1
F E D C B A
INDEX MARK w S B D E
2.90
y1 S A
y S
DETAIL OF A PART
E
A
S
y S
D2
30 21
Lp e D2 E2
ITEM
MIN NOM MAX MIN NOM MAX
b x M S AB EXPOSED
DIE PAD A 4.45 4.50 4.55 4.45 4.50 4.55
VARIATIONS
HD
D
detail of lead end
33 23 A3
34 22 c
θ L
E HE Lp
L1
44 12 (UNIT:mm)
1 11 ITEM DIMENSIONS
D 10.00±0.20
ZE E 10.00±0.20
HD 12.00±0.20
ZD e
HE 12.00±0.20
b x M S A 1.60 MAX.
A A1 0.10±0.05
A2 A2 1.40±0.05
A3 0.25
b 0.37 +0.08
−0.07
S
c 0.145 +0.055
−0.045
L 0.50
y S A1 Lp 0.60±0.15
L1 1.00±0.20
θ 3° +5°
−3°
e 0.80
NOTE
x 0.20
Each lead centerline is located within 0.20 mm of
y 0.10
its true position at maximum material condition.
ZD 1.00
ZE 1.00
P44GB-80-UES-1
HD
36 25 A3
37 24
c
θ L
E HE Lp
L1
48 13
1 12
(UNIT:mm)
ZE ITEM DIMENSIONS
D 7.00±0.20
E 7.00±0.20
ZD e
HD 9.00±0.20
b x M S HE 9.00±0.20
A A 1.60 MAX.
A2 A1 0.10±0.05
A2 1.40±0.05
A3 0.25
b 0.22±0.05
S c 0.145 +0.055
−0.045
L 0.50
Lp 0.60±0.15
y S A1 L1 1.00±0.20
θ 3° +5°
−3°
e 0.50
NOTE x 0.08
Each lead centerline is located within 0.08 mm of y 0.08
its true position at maximum material condition. ZD 0.75
ZE 0.75
P48GA-50-8EU
DETAIL OF A PART
E
A
S
y S
D2
Lp e ITEM
D2 E2
MIN NOM MAX MIN NOM MAX
b x M S AB EXPOSED
DIE PAD A 5.45 5.50 5.55 5.45 5.50 5.55
VARIATIONS
2
D
39 27
detail of lead end
40 26
c
1
E HE
θ L
14
52
1 13
e (UNIT:mm)
3
b x M ITEM DIMENSIONS
A D 10.00±0.10
A2 E 10.00±0.10
HD 12.00±0.20
HE 12.00±0.20
A 1.70 MAX.
A1 0.10±0.05
A2 1.40
y A1 b 0.32±0.05
c 0.145 ±0.055
NOTE
L 0.50±0.15
1.Dimensions “ 1” and “ 2” do not include mold flash. θ 0° to 8°
2.Dimension “ 3” does not include trim offset. e 0.65
x 0.13
y 0.10
P52GB-65-GBS
HD
θ L
E HE Lp
L1
(UNIT:mm)
ITEM DIMENSIONS
64 17
D 12.00±0.20
1 16 E 12.00±0.20
HD 14.00±0.20
ZE HE 14.00±0.20
ZD e A 1.60 MAX.
A1 0.10±0.05
b x M S A2 1.40±0.05
A
A3 0.25
A2 b 0.32 +0.08
−0.07
c 0.145 +0.055
−0.045
S L 0.50
Lp 0.60±0.15
L1 1.00±0.20
y S A1
θ 3° +5°
−3°
e 0.65
x 0.13
NOTE y 0.10
Each lead centerline is located within 0.13 mm of ZD 1.125
its true position at maximum material condition.
ZE 1.125
P64GK-65-UET-1
HD
48 33
A3
49 32
c
θ L
E HE Lp
L1
(UNIT:mm)
64 17
ITEM DIMENSIONS
1 16 D 10.00±0.20
E 10.00±0.20
ZE HD 12.00±0.20
HE 12.00±0.20
ZD e A 1.60 MAX.
A1 0.10±0.05
b x M S A2 1.40±0.05
A
A3 0.25
A2 b 0.22±0.05
c 0.145 +0.055
−0.045
L 0.50
S
Lp 0.60±0.15
L1 1.00±0.20
y θ 3° +5°
−3°
S A1
e 0.50
x 0.08
y 0.08
NOTE ZD 1.25
Each lead centerline is located within 0.08 mm of ZE 1.25
its true position at maximum material condition. P64GB-50-UEU-1
D w S A ZE ZD A
8
7
B 6
5
E
4
3
2
1
H G F E D C B A
INDEX MARK w S B INDEX MARK
y1 S A2
(UNIT:mm)
ITEM DIMENSIONS
D 4.00±0.10
S
E 4.00±0.10
w 0.15
A 0.89±0.10
y S e A1 A1 0.20± 0.05
A2 0.69
b x M S A B e 0.40
b 0.25 ± 0.05
x 0.05
y 0.08
y1 0.20
ZD 0.60
ZE 0.60
P64F1-40-AA2-1
HD
D
detail of lead end
60 41 A3
61 40
c
θ L
E HE Lp
L1
80 21 (UNIT:mm)
1 20 ITEM DIMENSIONS
D 14.00±0.20
ZE E 14.00±0.20
HD 17.20±0.20
ZD e HE 17.20±0.20
A 1.70 MAX.
b x M S
A1 0.125±0.075
A
A2 1.40±0.05
A2 A3 0.25
b 0.32±0.06
S
c 0.17 +0.03
−0.06
L 0.80
y Lp 0.886±0.15
S A1
L1 1.60±0.20
θ 3° +5°
−3°
e 0.65
NOTE x 0.13
Each lead centerline is located within 0.13 mm of y 0.10
its true position at maximum material condition.
ZD 0.825
ZE 0.825
P80GC-65-UBT
HD
D
detail of lead end
60 41
A3
61 40
c
θ L
E HE Lp
L1
(UNIT:mm)
80 21
ITEM DIMENSIONS
1 20 D 12.00±0.20
E 12.00±0.20
ZE HD 14.00±0.20
HE 14.00±0.20
ZD e
A 1.60 MAX.
b x M S A1 0.10±0.05
A2 1.40±0.05
A A3 0.25
b 0.22±0.05
A2
c 0.145 +0.055
−0.045
L 0.50
S
Lp 0.60±0.15
L1 1.00±0.20
y θ 3° +5°
−3°
S A1
e 0.50
x 0.08
y 0.08
NOTE ZD 1.25
Each lead centerline is located within 0.08 mm of ZE 1.25
its true position at maximum material condition. P80GK-50-8EU-1
D
A detail of lead end
L1
75 51
76 50 A3
c
B L
E HE Lp
(UNIT:mm)
ITEM DIMENSIONS
D 14.00±0.20
26 E 14.00±0.20
100
1 25 HD 16.00±0.20
HE 16.00±0.20
A 1.60 MAX.
ZE e A1 0.10±0.05
A2 1.40± 0.05
ZD b x M S AB A3 0.25
A
b 0.22 ±0.05
A2
c 0.145 + 0.055
0.045
L 0.50
S
Lp 0.60±0.15
L1 1.00±0.20
y S A1 3° + 5°
3°
e 0.50
x 0.08
y 0.08
ZD 1.00
ZE 1.00
P100GC-50-GBR
D
A detail of lead end
80 51 A3
81 50
B
E HE
L
Lp
L1
100 31
1 30
ZE (UNIT:mm)
ZD e ITEM DIMENSIONS
D 20.00 0.20
b x M S AB
E 14.00 0.20
HD 22.00 0.20
A HE 16.00 0.20
A 1.60 MAX.
A2
A1 0.10 0.05
S A2 1.40 0.05
A3 0.25
b + 0.08
0.32 0.07
y S A1
c 0.145 + 0.055
0.045
L 0.50
Lp 0.60 0.15
L1 1.00 0.20
3 +5
3
e 0.65
x 0.13
y 0.10
ZD 0.575
ZE 0.825
P100GF-65-GBN
2011 Renesas Electronics Corporation. All rights reserved.
HD
B
θ
E HE L
Lp
L1
128 39
1 38
(UNIT:mm)
ZE
ITEM DIMENSIONS
ZD e D 20.00±0.20
b x M S AB E 14.00±0.20
HD 22.00±0.20
A HE 16.00±0.20
A 1.60 MAX.
A2 A1 0.10±0.05
A2 1.40±0.05
S
A3 0.25
b 0.22 ±0.05
y S A1 c 0.145 +0.055
−0.045
L 0.50
Lp 0.60±0.15
L1 1.00±0.20
θ 3° +5°
−3°
e 0.50
x 0.08
y 0.08
ZD 0.75
ZE 0.75
P128GF-50-GBP
(2/7)
Page Description Classification
CHAPTER 4 PORT FUNCTIONS
Though out Addition of Table 4-x. Settings of Registers When Using Port x (c)
Though out Change of Block Diagram in 4.2 Port Configuration to be corresponded to 128-pin products (c)
Though out Change of description for Digital I/O/analog input in 4.2 Port Configuration (c)
Though out Change of description for reset signal generation in 4.2 Port Configuration (c)
p. 180 Change of Figure 4-10. Block Diagram of P13 (c)
p. 186 Change of Figure 4-15. Block Diagram of P20 to P27 (c)
p. 197 Change of Figure 4-23. Block Diagram of P43, P44 (a)
p. 199 Change of Figure 4-25. Block Diagram of P46 (a)
p. 200 Change of Figure 4-26. Block Diagram of P47 (a)
p. 236 Change of Figure 4-52. Block Diagram of P121 and P122 (c)
p. 237 Change of Figure 4-53. Block Diagram of P123 and P124 (c)
p. 239 Change of description in 4.2.14 Port 13 (c)
p. 250 Change of Figure 4-64. Block Diagram of P150 to P156 (c)
p. 251, 252 Change of Table 4-21. PMxx, Pxx, PUxx, PIMxx, POMxx, PMCxx registers and the bits (c)
mounted on each product (20-pin products to 64-pin products)
p. 256 Change of Table 4-22. PMxx, Pxx, PUxx, PIMxx, POMxx, PMCxx registers and the bits (c)
mounted on each product (80-pin products to 128-pin products) (3/4)
p. 265 Change of Figure 4-70. Format of Port Mode Control Register (c)
p. 268 Change of cautions 1 and 2 in Figure 4-72. Format of Peripheral I/O Redirection Register (PIOR) (c)
p. 269 Change of description in 4.3 (9) Global digital input disable register (GDIDIS) (c)
p. 271, 272 Change of description in 4.4.4 Connecting to external device with different potential (1.8 V, (c)
2.5 V, 3 V)
p. 273 to 277 Change of Table 4-23. Settings of Port Mode Register, and Output Latch When Using (b), (c)
Alternate Function
p. 278 Addition of note 3 to Table 4-23. Settings of Port Mode Register, and Output Latch When (c)
Using Alternate Function
p. 279 Addition of 4.6 Cautions When Using Port Function (c)
p. 280, 281 Addition of 4.6.2 Cautions on the pin settings on the products other than 128-pin (c)
CHAPTER 5 CLOCK GENERATOR
p. 283 Change of description in 5.1 (2) Subsystem clock (c)
p. 285 Change of Figure 5-1. Block Diagram of Clock Generator (c)
p. 287 Change and addition of note to Figure 5-2. Format of Clock Operation Mode Control Register (c)
(CMC)
p. 289 Change of description and deletion of note 2 in 5.3 (2) System clock control register (CKC) (c)
p. 295 Change of Figure 5-6. Format of Oscillation Stabilization Time Select Register (OSTS) (c)
p. 296 Deletion of note 4 in Figure 5-7. Format of Peripheral Enable Register 0 (PER0) (c)
p. 299 Change of description and deletion of caution in 5.3 (7) Operation speed mode control register (c)
(OSMC)
p. 300 Change of cautions 2, 3 in Figure 5-9. Format of High-speed On-chip Oscillator Frequency (c)
Select Register (HOCODIV)
p. 301 Change of 5.3 (9) High-speed on-chip oscillator trimming register (HIOTRM) (c)
p. 308 Addition of note 3 to Figure 5-14. Clock Generator Operation When Power Supply Voltage Is (c)
Turned On
p. 309 Change of 5.6.1 Example of setting high-speed on-chip oscillator (c)
p. 310 Change of description in 5.6.2 Example of setting X1 oscillation clock (c)
p. 315 Change of (6) and (8) in Table 5-3. CPU Clock Transition and SFR Register Setting Examples (c)
p. 320 Change of Table 5-6 and Table 5-7 (c)
(3/7)
Page Description Classification
CHAPTER 6 TIMER ARRAY UNIT
p. 329 Change of Table 6-2. Timer I/O Pins provided in Each Product (c)
p. 332 Change of 6.2 (1) Timer count register mn (TCRmn) (c)
p. 336 Change of caution in 6.3 (2) Timer clock select register m (TPSm) (c)
p. 338 Addition of note to Table 6-4. Interval Times Available for Operation Clock CKSm2 or CKSm3 (c)
p. 339 Change of caution in 6.3 (3) Timer mode register mn (TMRmn) (c)
p. 340 to 343 Change of Figure 6-8. Format of Timer Mode Register mn (TMRmn) (c)
p. 345 Change of description in 6.3 (5) Timer channel enable status register m (TEm) (c)
p. 346 Change of description in 6.3 (6) Timer channel start register m (TSm) (c)
p. 353 Change of Figure 6-18. Format of Input Switch Control Register (ISC) (c)
p. 357 Addition of remark to 6.3 (15) Port mode registers 0, 1, 3, 4, 6, 10, 14 (PM0, PM1, PM3, PM4, (c)
PM6, PM10, PM14)
p. 359 Change of description in 6.4.1 Basic rules of simultaneous channel operation function (c)
p. 369 Change of description in 6.5.2 (e) Start timing in capture & one-count mode (when high-level (c)
width is measured)
Change of Figure 6-27. Start Timing (In Capture & One-count Mode)
p. 373 Change of Figure 6-30. TOmn Pin Output Status at Toggle Output (TOMmn = 0) (c)
p. 381, 382, Change of note in Figure 6-37, Figure 6-39, Figure 6-43, Figure 6-51, Figure 6-55, Figure 6-57, (c)
388, 397, Figure 6-59, Figure 6-64, Figure 6-69, Figure 6-74
401, 403,
405, 412,
419, 427
p. 382, 388, Change of operation clock (fMCK) selection in Figure 6-39, Figure 6-43, Figure 6-51, Figure 6-55, (c)
397, 401, Figure 6-59
405
p. 395, 400 Addition of note to Figure 6-49, Figure 6-53 (c)
p. 403 Change of description in 6.7.6 Operation as delay counter (c)
p. 430 Addition of 6.9 Cautions When Using Timer Array Unit (c)
CHAPTER 7 REAL-TIME CLOCK
p. 431 Change of caution in 7.1 Functions of Real-time Clock (c)
p. 432 Change of figure and caution in Figure 7-1. Block Diagram of Real-time Clock (c)
p. 434 Deletion of caution 4 of 7.3 (1) Peripheral enable register 0 (PER0) (c)
p. 435 Change of caution in 7.3 (2) Operation speed mode control register (OSMC) (c)
p. 438 Change of Figure 7-5. Format of Real-time Clock Control Register 1 (RTCC1) (2/2) (c)
p. 439, 440, Change of description and caution in 7.3 (5) Second count register (SEC) to 7.3 (11) Year (c)
442 to 444 count register (YEAR)
p. 450 Change of description in 7.4.3 Reading/writing real-time clock (c)
p. 451 Addition of caution 2 to Figure 7-20. Procedure for Writing Real-time Clock (c)
p. 453 Change of Figure 7-22. 1 Hz Output Setting Procedure (c)
CHAPTER 8 INTERVAL TIMER
p. 457 Change of description in 8.1 Functions of Interval Timer (c)
p. 460 Change of caution 1 in Figure 8-4. Format of Interval Timer Control Register (ITMC) (c)
Remark “Classification” in the above table classifies revisions as follows.
(a): Error correction, (b): Addition/change of specifications, (c): Addition/change of description or note,
(d): Addition/change of package, part number, or management division, (e): Addition/change of related
documents
(4/7)
Page Description Classification
CHAPTER 9 CLOCK OUTPUT/BUZZER OUTPUT CONTROLLER
p. 463 Change of note and addition of remark to Figure 9-1. Block Diagram of Clock Output/Buzzer (a), (c)
Output Controller
p. 465 Change of Figure 9-2. Format of Clock Output Select Register n (CKSn) (c)
p. 466 Change of 9.3 (2) Port mode register 1, 3, 5, 14 (PM1, PM3, PM5, PM14) (c)
CHAPTER 10 WATCHDOG TIMER
p. 472 Change of caution 4 and deletion of caution 5 in 10.4.1 Controlling operation of watchdog timer (c)
Deletion of caution of Table 10-3. Setting of Overflow Time of Watchdog Timer
p. 473, 474 Deletion of caution 1 and change of remark in Table 10-4. Setting Window Open Period of (c)
Watchdog Timer
CHAPTER 11 A/D CONVERTER
p. 475 Change of description in 11.1 Function of A/D Converter (c)
p. 476 Change of Figure 11-1. Block Diagram of A/D Converter (c)
p. 477, 478 Change of description in 11.2 Configuration of A/D Converter (b), (c)
p. 479 Change of 11.3 Registers Used in A/D Converter (c)
p. 482 Addition of note to Table 11-1. Settings of ADCS and ADCE Bits (c)
Change of Table 11-2. Setting and Clearing Conditions for ADCS Bit
p. 486, 487, Change of Table 11-3. A/D Conversion Time Selection (c)
490, 491
p. 493 Change of Figure 11-7. Format of A/D Converter Mode Register 2 (ADM2) (a), (c)
p. 494 Change of Figure 11-8. ADRCK Bit Interrupt Signal Generation Range (a)
p. 496, 497 Change of Figure 11-11. Format of Analog Input Channel Specification Register (ADS) (c)
p. 499 Change of Figure 11-14. Format of A/D Test Register (ADTES) (c)
p. 500 Change of description in 11.3 (11) A/D port configuration register (ADPC) (c)
p. 501 Change of 11.3 (12) Port mode control registers 0, 3, 10, 11, 12, 14 (PMC0, PMC3, PMC10, (c)
PMC11, PMC12, PMC14)
p. 502, 503 Change of 11.3 (13) Port mode register 0, 2, 3, 10, 11, 12, 14, 15 (PM0, PM2, PM3, PM10, (c)
PM11, PM12, PM14, PM15)
p. 507 to 518 Change from “power down status” to “stop status” in 11.6 A/D Converter Operation Modes (c)
p. 523 Change of 11.7.4 Setup when using temperature sensor (example for software trigger mode (c)
and one-shot conversion mode)
p. 526 Addition of description to 11.8 (1) If an interrupt is generated after A/D conversion ends (c)
p. 530 Change of 11.10 (2) Input range of ANI0 to ANI14 and ANI16 to ANI26 pins (b)
p. 533 Change of Table 11-6. Resistance and Capacitance Values of Equivalent Circuit (Reference (b)
Values)
Remark “Classification” in the above table classifies revisions as follows.
(a): Error correction, (b): Addition/change of specifications, (c): Addition/change of description or note,
(d): Addition/change of package, part number, or management division, (e): Addition/change of related
documents
(5/7)
Page Description Classification
CHAPTER 12 SERIAL ARRAY UNIT
Though out Addition of description of CSI30, CSI31, UART3, IIC30, IIC31 (corresponding to 128-pin products) (c)
Though out Change of description to be corresponded to 128-pin products (c)
p. 536, 537, Change of description to CSI-UART channel corresponding SNOOZE mode (c)
574, 631 to
634, 638, 658
to 662
p. 543, 638, Change of description to UART channel corresponding 9-bit data communication (c)
641, 642, 651
p. 535 Change of caution in CHAPTER 12 SERIAL ARRAY UNIT (c)
2
p. 538 Change of description in 12.1.3 Simplified I C (IIC00, IIC01, IIC10, IIC11, IIC20, IIC21, IIC30, (c)
IIC31)
p. 540 Change of note 1 in Table 12-1. Configuration of Serial Array Unit) (c)
p. 542 Change of Figure 12-2. Block Diagram of Serial Array Unit 1 (c)
p. 544 Addition of note to Figure 12-3 and 12-4 (c)
p. 546 Change of caution 1 in Figure 12-5. Format of Peripheral Enable Register 0 (PER0) (c)
p. 548 Change of Figure 12-6. Format of Serial Clock Select Register m (SPSm) (c)
p. 551, 552 Change of note 2 and caution in Figure 12-8. Format of Serial Communication Operation (c)
Setting Register mn (SCRmn)
p. 553 Change of description in 12.3 (5) Higher 7 bits of the serial data register mn (SDRmn) (c)
p. 558 Addition of caution 2 to Figure 12-12. Format of Serial Channel Start Register m (SSm) (c)
p. 563 Change of description in 12.3 (13) Serial output level register m (SOLm) (c)
p. 564 Change of note and addition of caution to 12.3 (14) Serial standby control register m (SSCm) (c)
p. 565 Change of Figure 12-19. Format of Input Switch Control Register (ISC) (c)
p. 584, 586, Change of flowchart for each operation mode (c)
593, 595, 602,
604, 611, 613,
620, 628, 630,
632, 634
p. 654 Change of Figure 12-86. Initial Setting Procedure for UART Reception (c)
p. 655 Change of Figure 12-88. Procedure for Resuming UART Reception (c)
p.680, 686, Change of note in 12.8.1 Address field transmission to 12.8.3 Data reception (c)
690
CHAPTER 13 SERIAL INTERFACE IICA
p. 709, 710 Change of Figure 13-6. Format of IICA Control Register 00 (IICCTL00) (c)
p. 713 Change of Figure 13-7. Format of IICA Status Register 0 (IICS0) (c)
p. 720 Change of 13.4.2 Setting transfer clock by using IICWL0 and IICWH0 registers (c)
p. 779 Change of description in Figure 13-33. Example of Slave to Master Communication (8-Clock (c)
Wait Is Selected for Master, 9-Clock Wait Is Selected for Slave) (1/3)
CHAPTER 14 MULTIPLIER AND DIVIDER/MULTIPLY-ACCUMULATOR
p. 792 Change of Figure 14-6. Timing Diagram of Multiplication (Unsigned) Operation (2 × 3 = 6) (c)
p. 794 Change of description in 14.4.3 Multiply-accumulation (unsigned) operation (c)
p. 795 Change of Figure 14-8. Timing Diagram of Multiply-Accumulation (Unsigned) Operation (2 × (c)
3 + 3 = 9 → 32767 × 2 + 4294901762 = 0 (over flow generated))
p. 796 Change of description in 14.4.4 Multiply-accumulation (signed) operation (c)
p. 797 Change of Figure 14-9. Timing Diagram of Multiply-Accumulation (signed) Operation (c)
(2 × 3 + (− 4) = 2 → 32767 × (− 1) + (− 2147483647) = − 2147450882 (overflow occurs.))
Remark “Classification” in the above table classifies revisions as follows.
(a): Error correction, (b): Addition/change of specifications, (c): Addition/change of description or note,
(d): Addition/change of package, part number, or management division, (e): Addition/change of related
documents
(6/7)
Page Description Classification
CHAPTER 15 DMA CONTROLLER
p. 802 Change of Table 15-2 Internal RAM Area other than the General-purpose Registers (c)
p. 821 Change of (4) and addition of (6) to 15.6 Cautions on Using DMA Controller (c)
CHAPTER 16 INTERRUPT FUNCTION
p. 823, 825, Change of Table 16-1. Interrupt Source List (c)
826
p. 830 Change of Table 16-2. Flags Corresponding to Interrupt Request Sources (c)
p. 845 Change of caution in 16.4.2 Software interrupt request acknowledgment (c)
CHAPTER 18 STANDBY FUNCTION
p. 853 Change of cautions 2, 4 and remark, and addition of caution 3 to 18.1.1 Standby function (c)
p. 860, 861 Addition of note to Figure 18-3 and Figure 18-4. (c)
p. 862 Change of remark in 18.2.2 (1) STOP mode setting and operating statuses (c)
p. 863, 864 Change of remark 2, caution 2 in Table 18-2. Operating Statuses in STOP Mode (c)
p. 864 to 866 Addition of note to Figure 18-5 and Figure 18-6. (c)
p. 867 Change of remark in 18.2.3 (1) SNOOZE mode setting and operating statuses (c)
p. 868 Change of remark 2 in Table 18-3. Operating Statuses in SNOOZE Mode (c)
CHAPTER 19 RESET FUNCTION
p. 869 Change of description and deletion caution 3 in CHAPTER 19 RESET FUNCTION (c)
p. 871, 872 Change of Figure 19-2. to Figure 19-4. (c)
p. 874 Change of Table 19-2. Hardware Statuses After Reset Acknowledgment (1/4) and change of note 2 (c)
p. 878 Change of values of LVIM, LVIS of note 2 in Table 19-2. Hardware Statuses After Reset (c)
Acknowledgment (4/4)
CHAPTER 20 POWER-ON-RESET CIRCUIT
p. 883 Change of figure and addition of note 4 to Figure 20-2. Timing of Generation of Internal Reset (b), (c)
Signal by Power-on-reset Circuit and Voltage Detector (1/2)
p. 884 Change of note 4 and addition of note 5 to Figure 20-2. Timing of Generation of Internal Reset (b)
Signal by Power-on-reset Circuit and Voltage Detector (2/2)
p. 885 Change of Figure 20-3. Example of Software Processing After Reset Release (c)
CHAPTER 21 VOLTAGE DETECTOR
p. 887 Change of description in 21.1 Functions of Voltage Detector (c)
p. 889 Change of note 2 and addition of notes 3, 4 to Figure 21-2. Format of Voltage Detection (c)
Register (LVIM)
p. 890 Change of Figure 21-3. Format of Voltage Detection Level Select Register (LVIS) (c)
p. 891, 892 Change of Table 21-1. LVD Operation Mode and Detection Voltage Settings for User Option (c)
Byte (000C1H/010C1H)
p. 893 Change of description in 21.4.1 When used as reset mode (c)
p. 894 Change of Figure 21-4. Timing of Voltage Detector Internal Reset Signal Generation (Option (c)
Byte LVIMDS1, LVIMDS0 = 1, 1)
p. 895 Change of description in 21.4.2 When used as interrupt mode (c)
p. 896 Change of Figure 21-5. Timing of Voltage Detector Internal Interrupt Signal Generation (c)
(Option Byte LVIMDS1, LVIMDS0 = 0, 1)
p. 897 Change of description in 21.4.3 When used as interrupt and reset mode (c)
p. 898 Change of Figure 21-6. Timing of Voltage Detector Reset Signal and Interrupt Signal (c)
Generation (Option Byte LVIMDS1, LVIMDS0 = 1, 0)
p. 901 Change of Figure 21-8. Delay from the time LVD reset source is generated until the time LVD (c)
reset has been generated or released
Remark “Classification” in the above table classifies revisions as follows.
(a): Error correction, (b): Addition/change of specifications, (c): Addition/change of description or note,
(d): Addition/change of package, part number, or management division, (e): Addition/change of related
documents
R01UH0146EJ0100 Rev.1.00 1067
Sep 22, 2011
RL78/G13 APPENDIX A REVISION HISTORY
(7/7)
Page Description Classification
CHAPTER 22 SAFETY FUNCTIONS
Though out Change of all (c)
CHAPTER 23 REGULATOR
p. 920 Change of 23.1 Regulator Overview and Table 23-1. Regulator Output Voltage Conditions (c)
CHAPTER 24 OPTION BYTE
p. 921 Change of description in 24.1.1 User option byte (000C0H to 000C2H/010C0H to 010C2H) (c)
p. 923 Change of caution in Figure 24-1. Format of User Option Byte (000C0H/010C0H) (c)
p. 924, 925 Change of Figure 24-2. Format of User Option Byte (000C1H/010C1H) (1/2) (c)
p. 926 Change of Figure 24-3. Format of Option Byte (000C2H/010C2H) (c)
CHAPTER 25 FLASH MEMORY
p. 931 Change of Table 25-1. Wiring Between RL78/G13 and Dedicated Flash Memory Programmer (c)
p. 932 Change of 25.1.2 Communication Mode (c)
p. 934 Change of description in 25.2.2 Communication Mode (c)
p. 937, 938 Change of description in 25.4.1 Data flash overview (c)
p. 939 Change of description in 25.4.3 Procedure for accessing data flash memory (c)
p. 941 Change of description in 25.5.2 Flash memory programming mode (c)
p. 944 Addition of 25.5.5 Description of signature data (c)
p. 946 Change of Table 25-12. Setting Security in Each Programming Mode (c)
p. 951 Change of Table 25-14. Relationship between Flash Shield Window Function Setting/Change (c)
Methods and Commands
CHAPTER 26 ON-CHIP DEBUG FUNCTION
p. 954 Change of Figure 26-2. Memory Spaces Where Debug Monitor Programs Are Allocated (c)
CHAPTER 28 INSTRUCTION SET
p. 958 Change of description and deletion of remark in CHAPTER 28 INSTRUCTION SET (c)
p. 962 to 978 Change of 28.2 Operation List (c)
CHAPTER 29 ELECTRICAL SPECIFICATIONS
Though out Addition of caution for pins of each products (c)
p. 980, 981 Change of 29.2 Absolute Maximum Ratings (b), (c)
p. 983 Change of 29.3.2 On-chip oscillator characteristics (b), (c)
p. 985 to 987 Addition of 29.3.4 Recommended Oscillator Constants (b), (c)
p. 988 to 992 Change of 29.4.1 Pin characteristics (b), (c)
p. 993 to Change of 29.4.2 Supply current characteristics (b), (c)
1005
p. 1006 Change of 29.5.1 Basic operation (b), (c)
p. 1008 to Change of 29.6.1 Serial array unit (b), (c)
1030
p. 1032 to Change of 29.7.1 A/D converter characteristics (b), (c)
1035
p. 1036 Change of 29.7.2 Temperature sensor characteristics and 29.7.3 POR circuit characteristics (b), (c)
p. 1039 Change of Supply Voltage Rise Time (b), (c)
p. 1040 Change of 29.8 Data Memory STOP Mode Low Supply Voltage Data Retention (b), (c)
Characteristics and 29.9 Flash Memory Programming Characteristics
p. 1041 Change of 29.10 Timing Specs for Switching Modes (b), (c)
CHAPTER 30 PACKAGE DRAWINGS
Though out Addition of CHAPTER 30 PACKAGE DRAWINGS (b), (c)
Remark “Classification” in the above table classifies revisions as follows.
(a): Error correction, (b): Addition/change of specifications, (c): Addition/change of description or note,
(d): Addition/change of package, part number, or management division, (e): Addition/change of related
documents
R01UH0146EJ0100 Rev.1.00 1068
Sep 22, 2011
RL78/G13 APPENDIX A REVISION HISTORY
Here is the revision history of the preceding editions. Chapter indicates the chapter of each edition.
(1/2)
Edition Description Chapter
Ver.0.07 Change of 1.1 Features CHAPTER 1 PIN
Change of 1.6 Outline of Functions FUNCTIONS
(2/2)
Edition Description Chapter
Ver.0.07 Change of note 2 in Figure 6-8. Format of Timer Mode Register mn (TMRmn) CHAPTER 6 TIMER
(4/4)
ARRAY UNIT
Change of 6. 3 (6) Timer channel start register m (TSm)
Change of Figure 6-42. Operation Procedure of Interval Timer/Square Wave
Output Function (2/2)
Change of Figure 6-46. Operation Procedure When External Event Counter
Function Is Used
Change of Figure 6-50. Operation Procedure When Frequency Divider Function
Is Used
Change of Figure 6-62. Operation Procedure When Delay Counter Function Is
Used
Change of Figure 6-67. Operation Procedure of One-Shot Pulse Output
Function (2/2)
Change of Figure 6-72. Operation Procedure When PWM Function Is Used (2/2)
Change of Figure 6-77. Operation Procedure When Multiple PWM Output
Function Is Used (2/2)
Addition of cautions to Figure 19-5. Format of Reset Control Flag Register CHAPTER 19 RESET
(RESF) FUNCTION
Addition of caution to Figure 22-6. Format of RAM Parity Error Control Register CHAPTER 22
(RPECTL) SAFETY FUNCTIONS
Change of Table 25-1. Wiring Between RL78/G13 and Dedicated Flash Memory CHAPTER 25 FLASH
Programmer MEMORY
Change of Figure 25-2. Communication with Dedicated Flash Memory
Programmer
Change of Table 25-2. Pin Connection
Change of description of 25.4.1 Data flash overview
Change of description of 25.5.2 Flash memory programming mode
Change of Table 25-7. Flash Memory Control Commands
R01UH0146EJ0100