RL78 L1B Usermanual
RL78 L1B Usermanual
RL78 L1B Usermanual
RL78/I1B
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).
(2012.4)
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/I1B 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/I1B manual is separated into two parts: this manual and the software edition
(common to the RL78 Family).
How to Read This Manual It is assumed that the readers of this manual have general knowledge of electrical
engineering, logic circuits, and microcontrollers.
To gain a general understanding of functions:
Read this manual in the order of the CONTENTS.
The mark “<R>” shows major revised points. The revised points can be easily
searched by copying an “<R>” in the PDF file and specifying it in the “Find what:” field.
How to interpret the register format:
For a bit number enclosed in angle brackets, the bit name is defined as a reserved
word in the assembler, and is defined as an sfr variable using the #pragma sfr
directive in the compiler.
To know details of the RL78/I1B Microcontroller instructions:
Refer to the separate document RL78 Family Software User’s Manual
(R01US0015E).
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.
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.
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
Index-1
3.3.1 Relative addressing .......................................................................................................................... 69
3.3.2 Immediate addressing ...................................................................................................................... 69
3.3.3 Table indirect addressing ................................................................................................................. 70
3.3.4 Register direct addressing ................................................................................................................ 70
3.4 Addressing for Processing Data Addresses ............................................................................. 71
3.4.1 Implied addressing ........................................................................................................................... 71
3.4.2 Register addressing ......................................................................................................................... 71
3.4.3 Direct addressing ............................................................................................................................. 72
3.4.4 Short direct addressing .................................................................................................................... 73
3.4.5 SFR addressing ................................................................................................................................ 74
3.4.6 Register indirect addressing ............................................................................................................. 75
3.4.7 Based addressing ............................................................................................................................. 76
3.4.8 Based indexed addressing ............................................................................................................... 80
3.4.9 Stack addressing .............................................................................................................................. 81
Index-2
4.4.1 Writing to I/O port ........................................................................................................................... 105
4.4.2 Reading from I/O port ..................................................................................................................... 105
4.4.3 Operations on I/O port .................................................................................................................... 105
4.4.4 Connecting to external device with different potential (1.8 V, 2.5 V, 3 V) ....................................... 106
4.4.5 Handling different potential (1.8 V, 2.5 V, 3 V) by using I/O buffers ............................................... 106
4.5 Register Settings When Using Alternate Function ................................................................. 108
4.5.1 Basic concept when using alternate function.................................................................................. 108
4.5.2 Register settings for alternate function whose output function is not used ..................................... 109
4.5.3 Register setting examples for used port and alternate functions .................................................... 110
4.5.4 Operation of Ports That Alternately Function as SEGxx Pins ......................................................... 118
4.5.5 Operation of Ports That Alternately Function as VL3, CAPL, CAPH Pins ...................................... 119
4.6 Cautions When Using Port Function ........................................................................................ 121
4.6.1 Cautions on 1-Bit Manipulation Instruction for Port Register n (Pn) ............................................... 121
4.6.2 Notes on specifying the pin settings ............................................................................................... 122
Index-3
5.6.7 Conditions before stopping clock oscillation ................................................................................... 164
5.7 Resonator and Oscillator Constants ........................................................................................ 165
6.1 High-speed On-chip Oscillator Clock Frequency Correction Function ................................ 169
6.2 Register ....................................................................................................................................... 170
6.2.1 High-speed on-chip oscillator clock frequency correction control register (HOCOFC) ................... 170
6.3 Operation ..................................................................................................................................... 171
6.3.1 Operation overview ........................................................................................................................ 171
6.3.2 Operation procedure ...................................................................................................................... 174
6.4 Usage Notes ................................................................................................................................ 175
6.4.1 SFR access .................................................................................................................................... 175
6.4.2 Operation during standby state ...................................................................................................... 175
6.4.3 Changing high-speed on-chip oscillator frequency select register (HOCODIV).............................. 175
Index-4
7.4 Basic Rules of Timer Array Unit ............................................................................................... 211
7.4.1 Basic rules of simultaneous channel operation function ................................................................. 211
7.4.2 Basic rules of 8-bit timer operation function (channels 1 and 3 only) ............................................. 213
7.5 Operation of Counter ................................................................................................................. 214
7.5.1 Count clock (fTCLK) ....................................................................................................................... 214
7.5.2 Start timing of counter .................................................................................................................... 216
7.5.3 Operation of counter ....................................................................................................................... 217
7.6 Channel Output (TOmn Pin) Control ........................................................................................ 222
7.6.1 TOmn pin output circuit configuration ............................................................................................. 222
7.6.2 TOmn Pin Output Setting ............................................................................................................... 223
7.6.3 Cautions on Channel Output Operation ......................................................................................... 224
7.6.4 Collective manipulation of TOmn bit ............................................................................................... 229
7.6.5 Timer Interrupt and TOmn Pin Output at Operation Start ............................................................... 230
7.7 Timer Input (TImn) Control ........................................................................................................ 231
7.7.1 TImn input circuit configuration....................................................................................................... 231
7.7.2 Noise filter ...................................................................................................................................... 231
7.7.3 Cautions on channel input operation .............................................................................................. 232
7.8 Independent Channel Operation Function of Timer Array Unit ............................................. 233
7.8.1 Operation as interval timer/square wave output ............................................................................. 233
7.8.2 Operation as external event counter .............................................................................................. 239
7.8.3 Operation as input pulse interval measurement ............................................................................. 244
7.8.4 Operation as input signal high-/low-level width measurement ........................................................ 248
7.8.5 Operation as delay counter ............................................................................................................ 252
7.9 Simultaneous Channel Operation Function of Timer Array Unit .......................................... 257
7.9.1 Operation as one-shot pulse output function .................................................................................. 257
7.9.2 Operation as PWM function............................................................................................................ 264
7.9.3 Operation as multiple PWM output function ................................................................................... 271
7.10 Cautions When Using Timer Array Unit ................................................................................. 279
7.10.1 Cautions When Using Timer output .............................................................................................. 279
Index-5
8.3.8 Minute count register (MIN) ............................................................................................................ 293
8.3.9 Hour count register (HOUR) ........................................................................................................... 294
8.3.10 Date count register (DAY) ............................................................................................................ 296
8.3.11 Day-of-week count register (WEEK) ............................................................................................. 297
8.3.12 Month count register (MONTH) .................................................................................................... 298
8.3.13 Year count register (YEAR) .......................................................................................................... 298
8.3.14 Clock error correction register (SUBCUD) .................................................................................... 299
8.3.15 Alarm minute register (ALARMWM) ............................................................................................. 302
8.3.16 Alarm hour register (ALARMWH) ................................................................................................. 302
8.3.17 Alarm day-of-week register (ALARMWW) .................................................................................... 303
8.4 Real-time Clock 2 Operation ..................................................................................................... 304
8.4.1 Starting operation of real-time clock 2 ............................................................................................ 304
8.4.2 Shifting to HALT/STOP mode after starting operation .................................................................... 305
8.4.3 Reading real-time clock 2 counter .................................................................................................. 306
8.4.4 Writing to real-time clock 2 counter ................................................................................................ 307
8.4.5 Setting alarm of real-time clock 2 ................................................................................................... 308
8.4.6 1 Hz output of real-time clock 2 ...................................................................................................... 309
8.4.7 Clock error correction register setting procedure............................................................................ 310
8.4.8 Example of watch error correction of real-time clock 2 ................................................................... 311
8.4.9 High-accuracy 1 Hz output ............................................................................................................. 314
Index-6
10.4 12-bit Interval Timer Operation ............................................................................................... 327
10.4.1 12-bit interval timer operation timing ............................................................................................ 327
10.4.2 Start of count operation and re-enter to HALT/STOP mode after returned from
HALT/STOP mode ....................................................................................................................... 328
Index-7
13.4 Operation of Watchdog Timer ................................................................................................. 352
13.4.1 Controlling operation of watchdog timer ....................................................................................... 352
13.4.2 Setting overflow time of watchdog timer ....................................................................................... 353
13.4.3 Setting window open period of watchdog timer ............................................................................ 354
13.4.4 Setting watchdog timer interval interrupt ...................................................................................... 355
Index-8
14.7.4 Setup when temperature sensor output voltage/internal reference voltage is selected
(example for software trigger mode and one-shot conversion mode) .......................................... 397
14.7.5 Setting up test mode .................................................................................................................... 398
14.8 SNOOZE Mode Function .......................................................................................................... 399
14.9 How to Read A/D Converter Characteristics Table ............................................................... 403
14.10 Cautions for A/D Converter ................................................................................................... 405
Index-9
16.4 Notes on Using 24-Bit ∆Σ A/D Converter ............................................................................... 436
16.4.1 External pins................................................................................................................................. 436
16.4.2 SFR access .................................................................................................................................. 436
16.4.3 Setting operating clock ................................................................................................................. 436
16.4.4 Phase adjustment for single-phase two-wire ................................................................................ 437
Index-10
18.3.11 Serial output enable register m (SOEm) ..................................................................................... 475
18.3.12 Serial output register m (SOm) ................................................................................................... 476
18.3.13 Serial output level register m (SOLm) ........................................................................................ 477
18.3.14 Serial standby control register 0 (SSC0) .................................................................................... 479
18.3.15 Input switch control register (ISC) .............................................................................................. 480
18.3.16 Noise filter enable register 0 (NFEN0) ........................................................................................ 481
18.3.17 Registers controlling port functions of serial input/output pins .................................................... 482
18.4 Operation Stop Mode ............................................................................................................... 483
18.4.1 Stopping the operation by units .................................................................................................... 484
18.4.2 Stopping the operation by channels ............................................................................................. 485
18.5 Operation of 3-Wire Serial I/O (CSI00) Communication........................................................ 486
18.5.1 Master transmission ..................................................................................................................... 488
18.5.2 Master reception ........................................................................................................................... 498
18.5.3 Master transmission/reception...................................................................................................... 507
18.5.4 Slave transmission ....................................................................................................................... 517
18.5.5 Slave reception ............................................................................................................................. 527
18.5.6 Slave transmission/reception........................................................................................................ 534
18.5.7 SNOOZE mode function ............................................................................................................... 544
18.5.8 Calculating transfer clock frequency ............................................................................................. 548
18.5.9 Procedure for processing errors that occurred during 3-wire serial I/O (CSI00)
communication ............................................................................................................................. 550
18.6 Operation of UART (UART0 to UART2) Communication ...................................................... 551
18.6.1 UART transmission ...................................................................................................................... 553
18.6.2 UART reception ............................................................................................................................ 563
18.6.3 SNOOZE mode function ............................................................................................................... 570
18.6.4 Calculating baud rate ................................................................................................................... 578
18.6.5 Procedure for processing errors that occurred during UART (UART0 to UART2)
communication ............................................................................................................................. 582
18.7 LIN Communication Operation ............................................................................................... 583
18.7.1 LIN transmission ........................................................................................................................... 583
18.7.2 LIN reception ................................................................................................................................ 586
18.8 Operation of Simplified I2C (IIC00, IIC10) Communication ................................................... 591
18.8.1 Address field transmission............................................................................................................ 593
18.8.2 Data transmission ......................................................................................................................... 599
18.8.3 Data reception .............................................................................................................................. 603
18.8.4 Stop condition generation ............................................................................................................. 608
18.8.5 Calculating transfer rate ............................................................................................................... 609
18.8.6 Procedure for processing errors that occurred during simplified I2C (IIC00, IIC10)
communication ............................................................................................................................. 611
Index-11
19.1 Functions of Serial Interface IICA ........................................................................................... 612
19.2 Configuration of Serial Interface IICA .................................................................................... 615
19.3 Registers Controlling Serial Interface IICA ............................................................................ 618
19.3.1 Peripheral enable register 0 (PER0) ............................................................................................. 618
19.3.2 IICA control register n0 (IICCTLn0) .............................................................................................. 619
19.3.3 IICA status register n (IICSn)........................................................................................................ 624
19.3.4 IICA flag register n (IICFn)............................................................................................................ 626
19.3.5 IICA control register n1 (IICCTLn1) .............................................................................................. 628
19.3.6 IICA low-level width setting register n (IICWLn) ........................................................................... 630
19.3.7 IICA high-level width setting register n (IICWHn) ......................................................................... 630
19.3.8 Port mode register 6 (PM6) .......................................................................................................... 631
2
19.4 I C Bus Mode Functions .......................................................................................................... 632
19.4.1 Pin configuration ........................................................................................................................... 632
19.4.2 Setting transfer clock by using IICWLn and IICWHn registers...................................................... 633
2
19.5 I C Bus Definitions and Control Methods .............................................................................. 635
19.5.1 Start conditions ............................................................................................................................. 635
19.5.2 Addresses .................................................................................................................................... 636
19.5.3 Transfer direction specification ..................................................................................................... 636
19.5.4 Acknowledge (ACK) ..................................................................................................................... 637
19.5.5 Stop condition............................................................................................................................... 638
19.5.6 Wait .............................................................................................................................................. 639
19.5.7 Canceling wait .............................................................................................................................. 641
19.5.8 Interrupt request (INTIICAn) generation timing and wait control................................................... 642
19.5.9 Address match detection method ................................................................................................. 643
19.5.10 Error detection ............................................................................................................................ 643
19.5.11 Extension code ........................................................................................................................... 643
19.5.12 Arbitration ................................................................................................................................... 644
19.5.13 Wakeup function ......................................................................................................................... 646
19.5.14 Communication reservation ........................................................................................................ 649
19.5.15 Cautions ..................................................................................................................................... 653
19.5.16 Communication operations ......................................................................................................... 654
19.5.17 Timing of I2C interrupt request (INTIICAn) occurrence ............................................................... 661
19.6 Timing Charts ........................................................................................................................... 682
Index-12
20.3.2 Transmission ................................................................................................................................ 701
20.3.3 Reception ..................................................................................................................................... 702
20.3.4 Selecting High-Level Pulse Width ................................................................................................ 702
20.4 Usage Notes on IrDA ................................................................................................................ 703
Index-13
22.3.1 Allocation of DTC control data area and DTC vector table area ................................................... 770
22.3.2 Control data allocation .................................................................................................................. 771
22.3.3 Vector table .................................................................................................................................. 773
22.3.4 Peripheral enable register 1 (PER1) ............................................................................................. 775
22.3.5 DTC control register j (DTCCRj) (j = 0 to 23) ................................................................................ 776
22.3.6 DTC block size register j (DTBLSj) (j = 0 to 23) ............................................................................ 777
22.3.7 DTC transfer count register j (DTCCTj) (j = 0 to 23) ..................................................................... 777
22.3.8 DTC transfer count reload register j (DTRLDj) (j = 0 to 23) .......................................................... 778
22.3.9 DTC source address register j (DTSARj) (j = 0 to 23) .................................................................. 778
22.3.10 DTC destination address register j (DTDARj) (j = 0 to 23).......................................................... 778
22.3.11 DTC activation enable register i (DTCENi) (i = 0 to 3) ................................................................ 779
22.3.12 DTC base address register (DTCBAR)....................................................................................... 781
22.4 DTC Operation .......................................................................................................................... 782
22.4.1 Activation sources ........................................................................................................................ 782
22.4.2 Normal mode ................................................................................................................................ 783
22.4.3 Repeat mode ................................................................................................................................ 786
22.4.4 Chain transfers ............................................................................................................................. 789
22.5 Notes on DTC ............................................................................................................................ 791
22.5.1 Setting DTC control data and vector table .................................................................................... 791
22.5.2 Allocation of DTC control data area and DTC vector table area ................................................... 791
22.5.3 DTC pending instruction ............................................................................................................... 791
22.5.4 Number of DTC execution clock cycles ........................................................................................ 792
22.5.5 DTC response time ...................................................................................................................... 793
22.5.6 DTC activation sources ................................................................................................................ 793
22.5.7 Operation in standby mode status ................................................................................................ 794
Index-14
23.4.4 Interrupt servicing during division instruction ................................................................................ 817
23.4.5 Interrupt request hold ................................................................................................................... 819
Index-15
28.2.2 Battery backup power switching control register 1 (BUPCTL1) .................................................... 875
28.2.3 Global digital input disable register (GDIDIS) ............................................................................... 875
28.3 Operation ................................................................................................................................... 876
28.3.1 Battery backup function ................................................................................................................ 876
28.4 Usage Notes .............................................................................................................................. 878
Index-16
CHAPTER 31 REGULATOR ................................................................................................................. 905
Index-17
CHAPTER 35 BCD CORRECTION CIRCUIT ..................................................................................... 937
Index-18
37.10 Flash Memory Programming Characteristics .................................................................... 1021
37.11 Dedicated Flash Memory Programmer Communication (UART) ..................................... 1021
37.12 Timing Specs for Switching Flash Memory Programming Modes .................................. 1022
Index-19
RL78/I1B R01UH0407EJ0210
Rev.2.10
RENESAS MCU
Apr 25, 2016
CHAPTER 1 OUTLINE
1.1 Features
R01UH0407EJ0210 Rev.2.10 1
Apr 25, 2016
RL78/I1B CHAPTER 1 OUTLINE
Serial interface
CSI: 1channel
UART/UART (LIN-bus supported): 3 channels
I2C/Simplified I2C communication: 3 channels
IrDA: 1 channel
Timer
16-bit timer: 8 channels
12-bit interval timer: 1 channel
8-bit interval timer: 4 channels
Real-time clock 2: 1 channel (calendar for 99 years, alarm function, and clock correction function)
Watchdog timer: 1 channel (operable with the dedicated low-speed on-chip oscillator)
Oscillation stop detection circuit: 1 channel
LCD controller/driver
Internal voltage boosting method, capacitor split method, and external resistance division method are switchable
Segment signal output: 34 (30)Note 1 to 42 (38)Note 1
Common signal output: 4 (8)Note 1
A/D converter
8/10-bit resolution A/D converter (VDD = 1.9 to 5.5 V): 4 or 6 channels
24-Bit ∆Σ A/D converter: 3 or 4 channels
Internal reference voltage (1.45 V) and temperature sensorNote 2
Comparator
2 channels
Operation mode: Comparator high-speed mode, comparator low-speed mode, or window mode
External reference voltage and internal reference voltage are selectable
I/O port
I/O port: 53 or 69 (N-ch open drain I/O [withstand voltage of 6 V]: 3,
N-ch open drain I/O [VDD withstand voltage]: 13)
Can be set to N-ch open drain, TTL input buffer, and on-chip pull-up resistor
Different potential interface: Can connect to a 1.8/2.5/3 V device
On-chip clock output/buzzer output controller
Others
On-chip BCD (binary-coded decimal) correction circuit
On-chip battery backup function
Notes 1. The values in parentheses are the number of signal outputs when 8 com is used.
2. Can be selected only in HS (high-speed main) mode
Remark The functions mounted depend on the product. See 1.6 Outline of Functions.
R01UH0407EJ0210 Rev.2.10 2
Apr 25, 2016
RL78/I1B CHAPTER 1 OUTLINE
Note
128 KB 8 KB R5F10MMG R5F10MPG
64 KB 6 KB R5F10MME R5F10MPE
Note This is about 7 KB when the self-programming function is used. (For details, see CHAPTER 3)
R01UH0407EJ0210 Rev.2.10 3
Apr 25, 2016
RL78/I1B CHAPTER 1 OUTLINE
Packaging specification
#30 : Tray (LFQFP)
#50 : Embossed Tape (LFQFP)
Package type:
FB : LFQFP, 0.50 mm pitch
ROM capacity:
E : 64 KB
G : 128 KB
Pin count:
M : 80-pin
P : 100-pin
RL78/I1B group
Memory type:
F : Flash memory
Renesas MCU
Note For the fields of application, see Figure 1-1 Part Number, Memory Size, and Package of RL78/I1B.
Caution The ordering part numbers represent the numbers at the time of publication. For the latest ordering part
numbers, refer to the target product page of the Renesas Electronics website.
R01UH0407EJ0210 Rev.2.10 4
Apr 25, 2016
RL78/I1B CHAPTER 1 OUTLINE
P07/SO00/TxD0/TI02/TO02/INTP2/TOOLTxD/SEG37
P16/SEG10/(SI00)/(RxD0)/(SDA00)
P81/SEG13/(RxD1)/(SDA10)
P15/SEG9/(SCK00)/(SCL00)
P17/SEG11/(SO00)/(TxD0)
P80/SEG12/(SCL10)
P82/SEG14/(TxD1)
COM4/SEG0
COM5/SEG1
COM6/SEG2
COM7/SEG3
P10/SEG4
P11/SEG5
P12/SEG6
P13/SEG7
P14/SEG8
COM0
COM1
COM2
COM3
60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41
P06/SI00/RxD0/TI03/TO03/SDA00/TOOLRxD/SEG36 61 40 P83/SEG15
P05/SCK00/SCL00/TI04/TO04/INTP3/SEG35 62 39 P70/SEG16/(INTP0)
P04/TxD1/TI05/TO05/INTP4/(VCOUT1)/SEG34 63 38 P71/SEG17/(INTP1)
P03/RxD1/TI06/TO06/SDA10/(VCOUT0)/SEG33 64 37 P72/SEG18/(INTP2)
P02/SCL10/TI07/TO07/INTP5/SEG32 65 36 P73/SEG19/(INTP3)
ANIP2 66 35 P74/SEG20/(INTP4)
ANIN2 67 34 P75/SEG21/(INTP5)
AVRT 68 33 P76/SEG22/(INTP6)
AVCM 69 32 P77/SEG23/(INTP7)
AVDD 70 31 P30/SEG24/(TI07)/(TO07)
AVSS 71 RL78/I1B(Top View) 30 P31/SEG25/(TI06)/(TO06)
AREGC 72 29 P32/SEG26/(PCLBUZ1)
ANIP1 73 28 P33/SEG27/(PCLBUZ0)
ANIN1 74 27 P125/VL3/INTP1/(TI05)/(TO05)
ANIP0 75 26 VL4
ANIN0 76 25 VL2
P23/ANI3/IVCMP1/IVREF0 77 24 VL1
P22/ANI2/IVCMP0/IVREF1 78 23 P126/CAPL/(TI04)/(TO04)
P21/AVREFM/ANI1 79 22 P127/CAPH/(TI03)/(TO03)
P20/AVREFP /ANI0 80 21 P62/(TI02)/(TO02)/(RTC1HZ)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
P01/TxD2/IrTxD/VCOUT1
P00/RxD2/IrRxD/VCOUT0
P130/RTC1HZ
RESET
VBAT
P44/INTP6
P43/TI00/TO00/PCLBUZ0
P42/INTP7
P41/TI01/TO01/PCLBUZ1
P40/TOOL0
P123/XT1
P137/INTP0
P60/SCLA0/(TI00)/(TO00)
P61/SDAA0/(TI01)/(TO01)
P121/X1
P124/XT2/EXCLKS
P122/X2/EXCLK
REGC
VSS
VDD
Caution Connect the REGC pin to VSS via a capacitor (0.47 to 1 μF).
R01UH0407EJ0210 Rev.2.10 5
Apr 25, 2016
RL78/I1B CHAPTER 1 OUTLINE
P16/SEG10/(SI00)/(RxD0)/(SDA00)
P15/SEG9/(SCK00)/(SCL00)
P81/SEG13/(RxD1)/(SDA10)
P17/SEG11/(SO00)/(TxD0)
P80/SEG12/(SCL10)
P82/SEG14/(TxD1)
COM4/SEG0
COM5/SEG1
COM6/SEG2
COM7/SEG3
P56/SEG38
P57/SEG39
P84/SEG40
P85/SEG41
P10/SEG4
P11/SEG5
P12/SEG6
P13/SEG7
P14/SEG8
COM0
COM1
COM2
COM3
EVDD1
EVSS1
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
P55/SEG37 76 50 P83/SEG15
P54/SEG36 77 49 P70/SEG16/(INTP0)
P53/SEG35 78 48 P71/SEG17/(INTP1)
P52/SEG34 79 47 P72/SEG18/(INTP2)
P51/SEG33 80 46 P73/SEG19/(INTP3)
P50/SEG32 81 45 P74/SEG20/(INTP4)
ANIP3 82 44 P75/SEG21/(INTP5)
ANIN3 83 43 P76/SEG22/(INTP6)
ANIP2 84 42 P77/SEG23/(INTP7)
ANIN2 85 41 P30/SEG24/(TI07)/(TO07)
AVRT 86 40 P31/SEG25/(TI06)/(TO06)
AVCM 87 39 P32/SEG26/(PCLBUZ1)
AVDD 88 RL78/I1B(Top View) 38 P33/SEG27/(PCLBUZ0)
AVSS 89 37 P34/SEG28
AREGC 90 36 P35/SEG29
ANIP1 91 35 P36/SEG30
ANIN1 92 34 P37/SEG31
ANIP0 93 33 P125/VL3/INTP1/(TI05)/(TO05)
ANIN0 94 32 VL4
P25/ANI5 95 31 VL2
P24/ANI4 96 30 VL1
P23/ANI3/IVCMP1/IVREF0 97 29 P126/CAPL/(TI04)/(TO04)
P22/ANI2/IVCMP0/IVREF1 98 28 P127/CAPH/(TI03)/(TO03)
P21/AVREFM /ANI1 99 27 P62/(TI02)/(TO02)/(RTC1HZ)
P20/AVREFP /ANI0 100 26 P61/SDAA0/(TI01)/(TO01)
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
P07/SO00/TxD0/TI02/TO02/INTP2/TOOLTxD
P04/TxD1/TI05/TO05/INTP4/(VCOUT1)
P06/SI00/RxD0/TI03/TO03/SDA00/TOOLRxD
P60/SCLA0/(TI00)/(TO00)
P03/RxD1/TI06/TO06/SDA10/(VCOUT0)
P05/SCK00/SCL00/TI04/TO04/INTP3
P02/SCL10/TI07/TO07/INTP5
P43/TI00/TO00/PCLBUZ0
P41/TI01/TO01/PCLBUZ1
P01/TxD2/IrTxD/VCOUT1
P40/TOOL0
P130/RTC1HZ
P00/RxD2/IrRxD/VCOUT0
P123/XT1
P137/INTP0
P44/INTP6
P42/INTP7
P121/X1
P124/XT2/EXCLKS
P122/X2/EXCLK
REGC
VSS/EVSS0
VDD/EVDD0
RESET
VBAT
R01UH0407EJ0210 Rev.2.10 7
Apr 25, 2016
RL78/I1B CHAPTER 1 OUTLINE
TIMER ARRAY
UNIT (8ch) PORT 0 8 P00 to P07
TI00/TO00/P43
ch0
(TI00/TO00/P60)
PORT 1 8 P10 to P17
TI01/TO01/P41
(TI01/TO01/P61) ch1
PORT 2 4 P20 to P23
TI02/TO02/P07
ch2
(TI02/TO02/P62)
2 ANI2/P22, ANI3/P23 PORT 3 4 P30 to P33
TI03/TO03/P06 10-BIT A/D
ch3 CONVERTER (4ch)
(TI03/TO03/P127) ANI0/AVREFP/P20
ANI1/AVREFM/P21
TI04/TO04/P05 PORT 4 5 P40 to P44
ch4
(TI04/TO04/P126)
TI05/TO05/P04 COMPARATOR PORT 6 3 P60 to P62
ch5
(TI05/TO05/P125) (2ch)
TI06/TO06/P03 VCOUT0/P00
(TI06/TO06/P31) ch6 COMPARATOR0 IVCMP0/P22 PORT 7 8 P70 to P77
TI07/TO07/P02 IVREF0/P23
(TI07/TO07/P30) ch7 VCOUT1/P01
RxD0/P06 COMPARATOR1 IVCMP1/P23 PORT 8 4 P80 to P83
(RxD0/P16) IVREF1/P22
4 P121 to P124
PORT 12
8- BIT INTERVAL 3 P125 to P127
SEG0 to SEG27,
TIMER 0 ch00 LCD 34
SEG32 to SEG37
CONTROLLER/ P130
ch01 PORT 13
DRIVER 8 COM0 to COM7 P137
8- BIT INTERVAL VL1 to VL4
RAM SPACE
TIMER 1 ch10 FOR LCD DATA CAPH
ch11 CAPL
POWER ON RESET/
POR/LVD
SERIAL ARRAY VOLTAGE
CONTROL
UNIT0 (2ch) DETECTOR
RxD0/P06(RxD0/P16) UART0
TxD0/P07(TxD0/P17) LINSEL
RL78 RESET CONTROL
RxD1/P03(RxD1/P81) CPU
UART1 CORE CODE FLASH MEMORY
TxD1/P04(TxD1/P82)
MUL & DIV ON-CHIP DEBUG TOOL0/P40
SCK00/P05(SCK00/P15)
SI00/P06(SI00/P16) CSI00
SO00/P07(SO00/P17) SYSTEM RESET
SCL00/P05(SCL00/P15) CONTROL X1/P121
IIC00
SDA00/P06(SDA00/P16) X2/EXCLK/P122
HIGH-SPEED
SCL10/P02(SCL10/P80) ON-CHIP XT1/P123
IIC10 OSCILLATOR
SDA10/P03(SDA10/P81) XT2/EXCLKS/P124
RAM
VOLTAGE
REGC
SERIAL ARRAY REGULATOR
UNIT1 (1ch)
RxD2/IrRxD/P00 UART2
TxD2/IrTxD/P01 IrDA VDD VSS VBAT TOOLRxD/P06,
TOOLTxD/P07 RxD0/P06 (RxD0/P16)
INTP0/P137(INTP0/P70)
Remark Functions in parentheses in the above figure can be assigned via settings in the peripheral I/O redirection
register (PIOR). See Figure 4-8 Format of Peripheral I/O Redirection Register (PIOR).
R01UH0407EJ0210 Rev.2.10 8
Apr 25, 2016
RL78/I1B CHAPTER 1 OUTLINE
TIMER ARRAY
UNIT (8ch) PORT 0 8 P00 to P07
TI00/TO00/P43
ch0
(TI00/TO00/P60)
PORT 1 8 P10 to P17
TI01/TO01/P41
(TI01/TO01/P61) ch1
PORT 2 6 P20 to P25
TI02/TO02/P07
ch2
(TI02/TO02/P62)
4 ANI2/P22 to ANI5/P25 PORT 3 8 P30 to P37
TI03/TO03/P06 10-BIT A/D
ch3 CONVERTER (6ch)
(TI03/TO03/P127) ANI0/AVREFP/P20
ANI1/AVREFM/P21
TI04/TO04/P05 PORT 4 5 P40 to P44
ch4
(TI04/TO04/P126)
TI05/TO05/P04 COMPARATOR PORT 5 8 P50 to P57
ch5
(TI05/TO05/P125) (2ch)
TI06/TO06/P03 VCOUT0/P00
(TI06/TO06/P31) ch6 COMPARATOR0 IVCMP0/P22 PORT 6 3 P60 to P62
TI07/TO07/P02 IVREF0/P23
(TI07/TO07/P30) ch7 VCOUT1/P01
RxD0/P06 COMPARATOR1 IVCMP1/P23 PORT 7 8 P70 to P77
(RxD0/P16) IVREF1/P22
POWER ON RESET/
POR/LVD
SERIAL ARRAY VOLTAGE
CONTROL
UNIT0 (2ch) DETECTOR
RxD0/P06(RxD0/P16) UART0
TxD0/P07(TxD0/P17) LINSEL
RL78 RESET CONTROL
RxD1/P03(RxD1/P81) CPU
UART1 CORE CODE FLASH MEMORY
TxD1/P04(TxD1/P82)
MUL & DIV ON-CHIP DEBUG TOOL0/P40
SCK00/P05(SCK00/P15)
SI00/P06(SI00/P16) CSI00
SO00/P07(SO00/P17) SYSTEM RESET
SCL00/P05(SCL00/P15) CONTROL X1/P121
IIC00
SDA00/P06(SDA00/P16) X2/EXCLK/P122
HIGH-SPEED
SCL10/P02(SCL10/P80) ON-CHIP XT1/P123
IIC10 OSCILLATOR
SDA10/P03(SDA10/P81) XT2/EXCLKS/P124
RAM
VOLTAGE
REGC
SERIAL ARRAY REGULATOR
UNIT1 (1ch)
RxD2/IrRxD/P00 UART2
TxD2/IrTxD/P01 IrDA VDD/EVDD0, VSS/EVSS0, VBAT TOOLRxD/P06,
EVDD1 EVSS1 TOOLTxD/P07 RxD0/P06 (RxD0/P16)
INTP0/P137(INTP0/P70)
Remark Functions in parentheses in the above figure can be assigned via settings in the peripheral I/O redirection
register (PIOR). See Figure 4-8 Format of Peripheral I/O Redirection Register (PIOR).
R01UH0407EJ0210 Rev.2.10 9
Apr 25, 2016
RL78/I1B CHAPTER 1 OUTLINE
<R> Main system High-speed system X1 (crystal/ceramic) oscillation, external main system clock input (EXCLK)
clock clock HS (High-speed main) mode: 1 to 20 MHz (VDD = 2.7 to 5.5 V),
HS (High-speed main) mode: 1 to 16 MHz (VDD = 2.4 to 5.5 V),
LS (Low-speed main) mode: 1 to 8 MHz (VDD = 1.9 to 5.5 V)
High-speed on-chip HS (High-speed main) mode: 24/12/6/3 MHz (VDD = 2.7 to 5.5 V),
oscillator clock HS (High-speed main) mode: 12/6/3 MHz (VDD = 2.4 to 5.5 V),
LS (Low-speed main) mode: 6/3 MHz (VDD = 1.9 to 5.5 V)
Subsystem clock XT1 (crystal) oscillation, external subsystem clock input (EXCLKS)
32.768 kHz (TYP.): VDD = 1.9 to 5.5 V
High-speed on-chip oscillator clock Correct the frequency of the high-speed on-chip oscillator clock by the subsystem clock.
frequency correction function
Low-speed on-chip oscillator 15 kHz (TYP.): VDD = 1.9 to 5.5 V
General-purpose register 8 bits 8 registers 4 banks
Minimum instruction execution time 0.04167 μs (High-speed on-chip oscillator: fIH = 24 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 (16 bits 16 bits), division (32 bits ÷ 32 bits)
Multiplication and accumulation (16 bits 16 bits + 32 bits)
Rotate, barrel shift, and bit manipulation (set, reset, test, and boolean operation), etc.
I/O port Total 53 69
CMOS I/O 44 60
CMOS input 5 5
CMOS output 1 1
N-ch O.D I/O (6 V 3 3
tolerance)
Timer 16-bit timer TAU 8 channels
Watchdog timer 1 channel
12-bit interval timer 1 channel
8-bit interval timer 4 channels
Real-time clock 2 1 channel
Oscillation stop 1 channel
detection circuit
Timer output Timer outputs: 8 channels
Note 2
PWM outputs: 7
RTC output 1 channel
1 Hz (subsystem clock: fSUB = 32.768 kHz)
Notes 1. In the case of the 8 KB, this is about 7 KB when the self-programming function is used.
2. The number of outputs varies, depending on the setting of channels in use and the number of the master
(see 7.9.3 Operation as multiple PWM output function).
R01UH0407EJ0210 Rev.2.10 10
Apr 25, 2016
RL78/I1B CHAPTER 1 OUTLINE
(2/2)
Item 80-pin 100-pin
R5F10MMEDFB R5F10MMGDFB R5F10MPEDFB R5F10MPGDFB
Notes 1. The values in parentheses are the number of signal outputs when 8 com is used.
2. This reset occurs when instruction code FFH is executed.
This reset does not occur during emulation using an in-circuit emulator or an on-chip debugging emulator.
R01UH0407EJ0210 Rev.2.10 11
Apr 25, 2016
RL78/I1B 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.
Notes 1. When using the battery backup function, the power supply of the internal I/O buffer of this pin is powered
from the VDD pin even when switch to power from VBAT pin. If the power of the VDD pin is lost, make sure
the input voltage does not exceed the absolute maximum rating.
2. The power supply pin for the I/O buffers can be switched between VDD and VBAT by using the battery
backup function.
3. The input/output signal voltage of the pin that is defined as “VDD or VBAT” must match the supply voltage of
the I/O buffer.
Caution The EVDD1 pin must be at the same potential as VDD/EVDD0 pin.
R01UH0407EJ0210 Rev.2.10 12
Apr 25, 2016
RL78/I1B CHAPTER 2 PIN FUNCTIONS
Set in each port I/O, buffer, pull-up resistor is also valid for alternate functions.
Notes 1. “Digital input invalid” refers to the state in which all the digital outputs, digital inputs, and LCD outputs are
disabled.
2. Digital or LCD for each pin can be selected with the port mode register x (PMx) and the LCD port function
register x (PFSEGx) (can be set in 1-bit unit).
3. Setting digital or analog to each pin can be done in A/D port configuration register (ADPC).
Remark Functions in parentheses in the above figure can be assigned via settings in the peripheral I/O redirection
register (PIOR). See Figure 4-8 Format of Peripheral I/O Redirection Register (PIOR).
R01UH0407EJ0210 Rev.2.10 13
Apr 25, 2016
RL78/I1B CHAPTER 2 PIN FUNCTIONS
(2/2)
<R> Function Name Pin Type I/O After Reset Alternate Function Function
Release
P40 7-1-3 I/O Input port TOOL0 Port 4.
P41 TI01/TO01/PCLBUZ1 5-bit I/O port.
Input/output can be specified in 1-bit units.
P42 INTP7 Use of an on-chip pull-up resistor can be specified by
P43 TI00/TO00/PCLBUZ0 a software setting at input port.
P44 INTP6
P60 12-1-3 I/O Input port SCLA0/(TI00)/(TO00) Port 6.
3-bit I/O port.
P61 SDAA0/(TI01)/(TO01)
Input/output can be specified in 1-bit units.
P62 (TI02)/(TO02)/(RTC1HZ) Can be set to N-ch open-drain output (6 V tolerance).
P75 SEG21/(INTP5)
P76 SEG22/(INTP6)
P77 SEG23/(INTP7)
P127 CAPH/(TI03)/(TO03)
P130 1-1-4 Output Output port RTC1HZ Port 13.
1-bit output port and 1-bit input only port.
P137 2-1-2 Input Input port INTP0
Notes 1. “Digital input invalid” refers to the state in which all the digital outputs, digital inputs, and LCD outputs are
disabled.
2. Digital or LCD for each pin can be selected with the port mode register x (PMx) and the LCD port function
register x (PFSEGx) (can be set in 1-bit unit).
Remark Functions in parentheses in the above figure can be assigned via settings in the peripheral I/O redirection
register (PIOR). See Figure 4-8 Format of Peripheral I/O Redirection Register (PIOR).
R01UH0407EJ0210 Rev.2.10 14
Apr 25, 2016
RL78/I1B CHAPTER 2 PIN FUNCTIONS
P35 SEG29
P36 SEG30
P37 SEG31
Notes 1. “Digital input invalid” refers to the state in which all the digital outputs, digital inputs, and LCD outputs are
disabled.
2. Digital or LCD for each pin can be selected with the port mode register x (PMx) and the LCD port function
register x (PFSEGx) (can be set in 1-bit unit).
3. Setting digital or analog to each pin can be done in A/D port configuration register (ADPC).
Remark Functions in parentheses in the above figure can be assigned via settings in the peripheral I/O redirection
register (PIOR). See Figure 4-8 Format of Peripheral I/O Redirection Register (PIOR).
R01UH0407EJ0210 Rev.2.10 15
Apr 25, 2016
RL78/I1B CHAPTER 2 PIN FUNCTIONS
(2/3)
<R> Function Name Pin Type I/O After Reset Alternate Function Function
Release
P40 7-1-3 I/O Input port TOOL0 Port 4.
P41 TI01/TO01/PCLBUZ1 5-bit I/O port.
Input/output can be specified in 1-bit units.
P42 INTP7 Use of an on-chip pull-up resistor can be specified by
P43 TI00/TO00/PCLBUZ0 a software setting at input port.
P44 INTP6
P50 7-5-4 I/O Digital input SEG32 Port 5.
Note 1
invalid 8-bit I/O port.
P51 SEG33
Input/output can be specified in 1-bit units.
P52 SEG34 Use of an on-chip pull-up resistor can be specified by
P53 SEG35 a software setting at input port.
Note 2
Can be set to LCD output .
P54 SEG36
P55 SEG37
P56 SEG38
P57 SEG39
P75 SEG21/(INTP5)
P76 SEG22/(INTP6)
P77 SEG23/(INTP7)
Notes 1. “Digital input invalid” refers to the state in which all the digital outputs, digital inputs, and LCD outputs are
disabled.
2. Digital or LCD for each pin can be selected with the port mode register x (PMx) and the LCD port function
register x (PFSEGx) (can be set in 1-bit unit).
Remark Functions in parentheses in the above figure can be assigned via settings in the peripheral I/O redirection
register (PIOR). See Figure 4-8 Format of Peripheral I/O Redirection Register (PIOR).
R01UH0407EJ0210 Rev.2.10 16
Apr 25, 2016
RL78/I1B CHAPTER 2 PIN FUNCTIONS
(3/3)
<R> Function Name Pin Type I/O After Reset Alternate Function Function
Release
P127 CAPH/(TI03)/(TO03)
P130 1-1-4 Output Output port RTC1HZ Port 13.
1-bit output port and 1-bit input only port.
P137 2-1-2 Input Input port INTP0
Notes 1. “Digital input invalid” refers to the state in which all the digital outputs, digital inputs, and LCD outputs are
disabled.
2. Digital or LCD for each pin can be selected with the port mode register x (PMx) and the LCD port function
register x (PFSEGx) (can be set in 1-bit unit).
Remark Functions in parentheses in the above figure can be assigned via settings in the peripheral I/O redirection
register (PIOR). See Figure 4-8 Format of Peripheral I/O Redirection Register (PIOR).
R01UH0407EJ0210 Rev.2.10 17
Apr 25, 2016
RL78/I1B CHAPTER 2 PIN FUNCTIONS
(1/2)
Function Name 100-pin 80-pin Function Name 100-pin 80-pin Function Name 100-pin 80-pin
ANI0 TxD2 XT2
ANI1 SCK00 EXCLKS
ANI2 SI00 VDD
ANI3 SO00 EVDD0
ANI4 SCL00 EVDD1
ANI5 SCL10 VBAT
ANIN0 SDA00 AVREFP
ANIN1 SDA10 AVREFM
ANIN2 SDAA0 VSS
ANIN3 SCLA0 EVSS0
ANIP0 IrRxD EVSS1
ANIP1 IrTxD AVRT
ANIP2 TI00 AVCM
ANIP3 TI01 AREGC
INTP0 TI02 AVDD
INTP1 TI03 AVSS
INTP2 TI04 TOOLRxD
INTP3 TI05 TOOLTxD
INTP4 TI06 TOOL0
INTP5 TI07 COM0
INTP6 TO00 COM1
INTP7 TO01 COM2
IVCMP0 TO02 COM3
IVCMP1 TO03 COM4
IVREF0 TO04 COM5
IVREF1 TO05 COM6
VCOUT0 TO06 COM7
VCOUT1 TO07 SEG0
PCLBUZ0 VL1 SEG1
PCLBUZ1 VL2 SEG2
RTC1HZ VL3 SEG3
REGC VL4 SEG4
RESET CAPH SEG5
RxD0 CAPL SEG6
RxD1 X1 SEG7
RxD2 X2 SEG8
TxD0 EXCLK SEG9
TxD1 XT1 SEG10
R01UH0407EJ0210 Rev.2.10 18
Apr 25, 2016
RL78/I1B CHAPTER 2 PIN FUNCTIONS
(2/2)
Function Name 100-pin 80-pin Function Name 100-pin 80-pin Function Name 100-pin 80-pin
SEG11 SEG22 SEG33
SEG12 SEG23 SEG34
SEG13 SEG24 SEG35
SEG14 SEG25 SEG36
SEG15 SEG26 SEG37
SEG16 SEG27 SEG38
SEG17 SEG28 SEG39
SEG18 SEG29 SEG40
SEG19 SEG30 SEG41
SEG20 SEG31
SEG21 SEG32
R01UH0407EJ0210 Rev.2.10 19
Apr 25, 2016
RL78/I1B CHAPTER 2 PIN FUNCTIONS
R01UH0407EJ0210 Rev.2.10 20
Apr 25, 2016
RL78/I1B CHAPTER 2 PIN FUNCTIONS
(2/2)
Function Name I/O Function
X1, X2 If an external 24-bit ∆Σ type A/D converter is used for external clock input, a 12 MHz
oscillator must be connected.
EXCLK Input External clock input for main system clock
XT1, XT2 Resonator connection for subsystem clock
EXCLKS Input External clock input for subsystem clock
VDD <80-pin >
Positive power supply for all pins
<100-pin>
Positive power supply for P20 to P25, P121 to P124, P137 and other than ports
EVDD1 Positive power supply for ports (other than P20 to P25, P121 to P124, P137)
VBAT Power supply for battery backup
AVREFP Input A/D converter reference potential (+ side) input
AVREFM Input A/D converter reference potential ( side) input
VSS <80-pin >
Ground potential for all pins
<100-pin >
Ground potential for P20 to P25, P121 to P124, P137 and other than ports
EVSS1 Ground potential for ports (other than P20 to P25, P121 to P124, P137)
AVRT Reference potential for ∆Σ ADC
AVCM Control for ∆Σ ADC
AREGC Regulator capacitance for ∆Σ ADC
AVDD Power supply for ∆Σ ADC
AVSS Ground for ∆Σ ADC
TOOLRxD Input UART reception pin for the external device connection used during flash memory
programming
TOOLTxD Output UART transmission pin for the external device connection used during flash memory
programming
TOOL0 I/O Data I/O for flash memory programmer/debugger
COM0 to COM7 Output LCD controller/driver common signal outputs
SEG0 to SEG41 Output LCD controller/driver segment signal outputs
Caution After reset release, the relationships between P40/TOOL0 and the operating mode are as follows.
Table 2-2. Relationships Between P40/TOOL0 and Operation Mode After Reset Release
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, EVDD1 to EVSS1 lines.
R01UH0407EJ0210 Rev.2.10 21
Apr 25, 2016
RL78/I1B CHAPTER 2 PIN FUNCTIONS
Remark The pins mounted depend on the product. See 1.3 Pin Configuration (Top View) and 2.1 Port Function
List.
P00 to P07 I/O Input: Independently connect to EVDD0, EVDD1 or EVSS0, EVSS1 via a resistor.
Output: Leave open.
P10 to P17 <When setting to port I/O>
Input: Independently connect to EVDD0, EVDD1 or EVSS0, EVSS1 via a resistor.
Output: Leave open.
<When setting to segment output>
Leave open.
P20 to P25 Input: Independently connect to VDD or VSS via a resistor. In addition,
individually connect to VSS via a resistor when using a battery backup
function.
Output: Leave open.
P30 to P37 <When setting to port I/O>
Input: Independently connect to EVDD0, EVDD1 or EVSS0, EVSS1 via a resistor.
Output: Leave open.
<When setting to segment output>
Leave open.
P40/TOOL0 Input: Independently connect to EVDD via a resistor or leave open.
Output: Leave open.
P41 to P44 Input: Independently connect to EVDD0, EVDD1 or EVSS0, EVSS1 via a resistor.
Output: Leave open.
P50 to P57 <When setting to port I/O>
Input: Independently connect to EVDD0, EVDD1 or EVSS0, EVSS1 via a resistor.
Output: Leave open.
<When setting to segment output>
Leave open.
P60 to P62 Input: Independently connect to EVDD0, EVDD1 or EVSS0, EVSS1 via a resistor.
Output: Set the port’s output latch to 0 and leave the pin open, or set the port’s
output latch to 1 and independently connect the pin to EVDD0, EVDD1 or
EVSS0, EVSS1 via a resistor.
Remark For the products that do not have an EVDD0, EVDD1, EVSS0, or EVSS1 pin, replace EVDD0 and EVDD1 with VDD,
and replace EVSS0 and EVSS1 with VSS.
R01UH0407EJ0210 Rev.2.10 22
Apr 25, 2016
RL78/I1B CHAPTER 2 PIN FUNCTIONS
Remark For the products that do not have an EVDD0, EVDD1, EVSS0, or EVSS1 pin, replace EVDD0 and EVDD1 with VDD,
and replace EVSS0 and EVSS1 with VSS.
R01UH0407EJ0210 Rev.2.10 23
Apr 25, 2016
RL78/I1B CHAPTER 2 PIN FUNCTIONS
Figures 2-1 to 2-16 show the block diagrams of the pins described in 2.1.1 80-pin products and 2.1.2 100-pin
products. For the 80-pin products, replace EVDD1 and EVSS1 with VDD and VSS, respectively.
RDPORT
Internal bus
VDD
WDPORT
P-ch
Output latch
(Pmn) Pmn
N-ch
Alternate
function VSS
RESET RESET
<R> Figure 2-3. Pin Block Diagram for Pin Type 2-1-2
Alternate
function
RD
Internal bus
Pmn
R01UH0407EJ0210 Rev.2.10 24
Apr 25, 2016
RL78/I1B CHAPTER 2 PIN FUNCTIONS
Clock generator
CMC
OSCSEL/
OSCSELS
RD Alternate
function
Internal bus
P122/X2/EXCLK/Alternate function
P124/XT2/EXCLKS/Alternate function
CMC
EXCLK, OSCSEL/
EXCLKS, OSCSELS
N-ch P-ch
RD Alternate
function
P121/X1/Alternate function
P123/XT1/Alternate function
R01UH0407EJ0210 Rev.2.10 25
Apr 25, 2016
RL78/I1B CHAPTER 2 PIN FUNCTIONS
WRADPC
0: Analog input
1: Digital I/O
ADPC
RDPORT
0 1
Internal bus
0
WRPORT
VDD
Output latch
(Pmn) P-ch
WRRM Pmn
PM register N-ch
(PMmn)
VSS
WRPMS
PMS register
P-ch
A/D converter
N-ch
R01UH0407EJ0210 Rev.2.10 26
Apr 25, 2016
RL78/I1B CHAPTER 2 PIN FUNCTIONS
WRADPC
0: Analog input
1: Digital I/O
ADPC
RDPORT
0 1
Internal bus
0
WRPORT
VDD
Output latch
(Pmn) P-ch
WRRM Pmn
PM register N-ch
(PMmn)
VSS
WRPMS
PMS register
P-ch
A/D converter
N-ch
Comparator
R01UH0407EJ0210 Rev.2.10 27
Apr 25, 2016
RL78/I1B CHAPTER 2 PIN FUNCTIONS
Alternate
function
EVDD1
WDPU
PU register
(PUmn) P-ch
RDPORT Schmitt2
1
Internal bus
0 1
WDPORT 0
EVDD1
Output latch
(Pmn)
WDPMS P-ch
Pmn
PMS register
N-ch
WDPM
PM register EVSS1
(PMmn)
Alternate
function
(SAU)
Alternate
function
(other than SAU)
R01UH0407EJ0210 Rev.2.10 28
Apr 25, 2016
RL78/I1B CHAPTER 2 PIN FUNCTIONS
Alternate
function
WRPU EVDD1
PU register
(PUmn) P-ch
RDPORT Schmitt2
0
Internal bus
WRPORT 0
EVDD1
Output latch
(Pmn)
WRPMS P-ch
Pmn
PMS register
N-ch
WRPM
PM register
EVSS1
(PMmn)
WRPOM
POM register
(POMmn)
Alternate
function
(SAU)
Alternate
function
(other than SAU)
R01UH0407EJ0210 Rev.2.10 29
Apr 25, 2016
RL78/I1B CHAPTER 2 PIN FUNCTIONS
Alternate
function
EVDD1
WRPU
PU register
(PUmn) P-ch
RDPORT Schmitt2
0 1
Internal bus
WRPORT 0
EVDD1
Output latch
(Pmn)
WRPMS P-ch
Pmn
PMS register
N-ch
WRPM
PM register EVSS1
(PMmn)
WRPFSEG
PFSEG register
(PFSEGmn)
Alternate
function
(SAU)
Alternate
function
(other than SAU)
R01UH0407EJ0210 Rev.2.10 30
Apr 25, 2016
RL78/I1B CHAPTER 2 PIN FUNCTIONS
Alternate
function
WRPU EVDD1
PU register
(PUmn)
P-ch
WRISCLCD
ISCLCD register
(LSCCAP)
RDPORT Schmitt2
0 1
Internal bus
WRPORT 0
EVDD1
Output latch
(Pmn)
WRPMS P-ch
Pmn
PMS register
N-ch
WRPM
PM register
EVSS1
(PMmn)
WRLCDM0
LCDM0 register
(MDSET1, 0)
Alternate
function
(SAU)
Alternate
function
(other than SAU)
LCD controller/ P-ch
driver
N-ch
R01UH0407EJ0210 Rev.2.10 31
Apr 25, 2016
RL78/I1B CHAPTER 2 PIN FUNCTIONS
Alternate
function
WRPU EVDD1
PU register
(PUmn)
P-ch
WRISCLCD
ISCLCD register
(LSCVL3)
RDPORT Schmitt2
0 1
Internal bus
WRPORT 0
EVDD1
Output latch
(Pmn)
WRPMS P-ch
Pmn
PMS register
N-ch
WRPM
PM register EVSS1
(PMmn)
WRLCDM0
LCDM0 register
(LBAS1, 0)
Alternate
function
(SAU)
Alternate
function
(other than SAU)
R01UH0407EJ0210 Rev.2.10 32
Apr 25, 2016
RL78/I1B CHAPTER 2 PIN FUNCTIONS
Alternate
function
WRPU EVDD1
PU register
(PUmn)
P-ch
RDPORT Schmitt2
0 1
Internal bus
WRPORT 0
EVDD1
Output latch
(Pmn)
WRPMS P-ch
Pmn
PMS register
WRPM N-ch
PM register
EVSS1
(PMmn)
WRPOM
POM register
(POMmn)
WRPFSEG
PFSEG register
(PFSEGmn)
Alternate
function
(SAU)
Alternate
function
(other than SAU)
R01UH0407EJ0210 Rev.2.10 33
Apr 25, 2016
RL78/I1B CHAPTER 2 PIN FUNCTIONS
Alternate
function
EVDD1
WRPU
PU register
(PUmn) P-ch
WRPM
PIM register
(PIMmn)
RDPORT Schmitt2
1
Internal bus
0 1
WRPORT 0 TTL
EVDD1
Output latch
(Pmn)
WRPMS P-ch
Pmn
PMS register
N-ch
WRPM
PM register EVSS1
(PMmn)
Alternate
function
(SAU)
Alternate
function
(other than SAU)
R01UH0407EJ0210 Rev.2.10 34
Apr 25, 2016
RL78/I1B CHAPTER 2 PIN FUNCTIONS
Alternate
function
WRPU EVDD1
PU register
(PUmn) P-ch
WRPM
PIM register
(PIMmn)
RDPORT Schmitt2
0 1
Internal bus
WRPORT 0 TTL
EVDD1
Output latch
(Pmn)
WRPMS P-ch
Pmn
PMS register
N-ch
WRPM
PM register
EVSS1
(PMmn)
WRPOM
POM register
(POMmn)
Alternate
function
(SAU)
Alternate
function
(other than SAU)
R01UH0407EJ0210 Rev.2.10 35
Apr 25, 2016
RL78/I1B CHAPTER 2 PIN FUNCTIONS
Alternate
function
WRPU EVDD1
PU register
(PUmn) P-ch
WRPM
PIM register
(PIMmn)
RDPORT Schmitt2
0 1
Internal bus
WRPORT 0 TTL
EVDD1
Output latch
(Pmn)
WRPMS P-ch
Pmn
PMS register
N-ch
WRPM
PM register EVSS1
(PMmn)
WRPOM
POM register
(POMmn)
WRPFSEG
PFSEG register
(PFSEGmn)
Alternate
function
(SAU)
R01UH0407EJ0210 Rev.2.10 36
Apr 25, 2016
RL78/I1B CHAPTER 2 PIN FUNCTIONS
Alternate
function
WRPER0
PER0
(IICA0EN)
RDPORT
1 Schmitt1
0 1
Internal bus
WRPORT 0
Output latch
(Pmn)
WRPMS
PMS register
WRPM Pmn
PM register N-ch
(PMmn)
EVSS1
Alternate
function
(SAU)
Alternate
function
(other than SAU)
R01UH0407EJ0210 Rev.2.10 37
Apr 25, 2016
RL78/I1B CHAPTER 3 CPU ARCHITECTURE
Products in the RL78/I1B can access a 1 MB address space. Figures 3-1 and 3-2 show the memory maps.
R01UH0407EJ0210 Rev.2.10 38
Apr 25, 2016
RL78/I1B CHAPTER 3 CPU ARCHITECTURE
Mirror 01FFFH
53.75 KB
010CEH
F1000H 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
Notes 1. Do not allocate RAM addresses which are used as a stack area, a data buffer, a branch destination of
vector interrupt processing, and a DTC transfer destination/transfer source to the area FFE20H to FFEDFH
when performing self-programming.
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 33.6 Security Settings).
5. When using the trace function of on-chip debugging, area FE300H to FE6FFH is disabled.
Caution When executing instructions from the RAM area while RAM parity error resets are enabled (RPERDIS
= 0), be sure to initialize RAM areas where data access is to proceed and the RAM area + 10 bytes
when instructions are fetched from RAM areas, respectively. Reset signal generation sets RAM
parity error resets to enabled (RPERDIS = 0). For details, see 30.3.3 RAM parity error detection
function.
R01UH0407EJ0210 Rev.2.10 39
Apr 25, 2016
RL78/I1B CHAPTER 3 CPU ARCHITECTURE
Mirror 01FFFH
51.75 KB
010CEH
F1000H 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
20000H 00080H
1FFFFH 0007FH
00000H 00000H
<R> Notes 1. Do not allocate the stack area, data buffers for use by the flash library, arguments of library functions,
branch destinations in the processing of vectored interrupts, or destinations or sources for DTC transfer to
the area from FFE20H to FFEDFH when performing self-programming. The RAM area used by the flash
library starts at FDF00H. For the RAM areas used by the flash library, see Self RAM list of Flash Self-
Programming Library for RL78 Family (R20UT2944).
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 33.6 Security Settings).
5. When using the trace function of on-chip debugging, area FE300H to FE6FFH is disabled.
Caution When executing instructions from the RAM area while RAM parity error resets are enabled (RPERDIS
= 0), be sure to initialize RAM areas where data access is to proceed and the RAM area + 10 bytes
when instructions are fetched from RAM areas, respectively. Reset signal generation sets RAM
parity error resets to enabled (RPERDIS = 0). For details, see 30.3.3 RAM parity error detection
function.
R01UH0407EJ0210 Rev.2.10 40
Apr 25, 2016
RL78/I1B CHAPTER 3 CPU ARCHITECTURE
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.
1 FFFFH
Block 7FH
1 FC00H
1 FBFFH
007FFH
Block 01H
00400H
003FFH
Block 00H 1 KB
00000H
(R5F10MMG, R5F10MPG)
R01UH0407EJ0210 Rev.2.10 41
Apr 25, 2016
RL78/I1B CHAPTER 3 CPU ARCHITECTURE
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
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
R01UH0407EJ0210 Rev.2.10 42
Apr 25, 2016
RL78/I1B CHAPTER 3 CPU ARCHITECTURE
The internal program memory space is divided into the following areas.
R01UH0407EJ0210 Rev.2.10 43
Apr 25, 2016
RL78/I1B CHAPTER 3 CPU ARCHITECTURE
R01UH0407EJ0210 Rev.2.10 44
Apr 25, 2016
RL78/I1B CHAPTER 3 CPU ARCHITECTURE
R01UH0407EJ0210 Rev.2.10 45
Apr 25, 2016
RL78/I1B CHAPTER 3 CPU ARCHITECTURE
FFFFFH
F1000H
F0FFFH
Reserved
F0800H
F07FFH
Special-function register (2nd SFR)
2 KB
F0000H
EFFFFH
Mirror
Reserved
20000H
1FFFFH
Code flash memory
0DF00H
0DEFFH
Code flash memory
01000H
00FFFH Code flash memory
00000H
R01UH0407EJ0210 Rev.2.10 46
Apr 25, 2016
RL78/I1B CHAPTER 3 CPU ARCHITECTURE
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 flash memory, be sure to clear bit 0 (MAA) of this register to 0 (default
value).
2. After setting the PMC register, wait for at least one instruction and access the mirror area.
R01UH0407EJ0210 Rev.2.10 47
Apr 25, 2016
RL78/I1B CHAPTER 3 CPU ARCHITECTURE
The internal RAM can be used as a data area and a program area where instructions are executed. (Instructions
cannot be executed in the area to which general-purpose registers are allocated.) Four general-purpose register banks
consisting of eight 8-bit registers per bank are assigned to the 32-byte area of FFEE0H to FFEFFH of the internal RAM
area. The internal RAM is used as stack memory.
Cautions 1. The space (FFEE0H to FFEFFH) that the general-purpose registers are allocated cannot be used
for fetching instructions or as a stack area.
2. Do not allocate RAM addresses which are used as a stack area, a data buffer, a branch
destination of vector interrupt processing, and a DTC transfer destination/transfer source to the
area FFE20H to FFEDFH when performing self-programming.
3. Use of the RAM areas of the following products is prohibited when performing self-programming,
because these areas are used for each library.
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.
R01UH0407EJ0210 Rev.2.10 48
Apr 25, 2016
RL78/I1B CHAPTER 3 CPU ARCHITECTURE
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 6/8 KB
Mirror
F1000H
F0FFFH
Reserved
F0800H
F07FFH
Special function register (2nd SFR) Direct addressing
2 KB
Register indirect addressing
F0000H
EFFFFH
Based addressing
Reserved
00000H
R01UH0407EJ0210 Rev.2.10 49
Apr 25, 2016
RL78/I1B CHAPTER 3 CPU ARCHITECTURE
19 0
PC
7 0
R01UH0407EJ0210 Rev.2.10 50
Apr 25, 2016
RL78/I1B CHAPTER 3 CPU ARCHITECTURE
Remark n = 0, 1
15 0
SP SP15 SP14 SP13 SP12 SP11 SP10 SP9 SP8 SP7 SP6 SP5 SP4 SP3 SP2 SP1 0
In stack addressing through a stack pointer, the SP is decremented ahead of write (save) to the stack memory and is
incremented after read (restored) from the stack memory.
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 for fetching
instructions or a stack area.
3. Do not allocate RAM addresses which are used as a stack area, a data buffer, a branch
destination of vector interrupt processing, and a DTC transfer destination/transfer source to the
area FFE20H to FFEDFH when performing self-programming.
4. Use of the RAM areas of the following products is prohibited when performing self-programming,
because these areas are used for each library.
R01UH0407EJ0210 Rev.2.10 51
Apr 25, 2016
RL78/I1B CHAPTER 3 CPU ARCHITECTURE
Caution It is prohibited to use the general-purpose register (FFEE0H to FFEFFH) space for fetching
instructions or as a stack area.
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
R01UH0407EJ0210 Rev.2.10 52
Apr 25, 2016
RL78/I1B CHAPTER 3 CPU ARCHITECTURE
7 6 5 4 3 2 1 0
CS 0 0 0 0 CS3 CS2 CS1 CS0
The data area that can be accessed by using 16-bit addresses is the 64 KB from F0000H to FFFFFH. By using the ES
register, this area can be extended to the 1 MB from 00000H to FFFFFH.
ES:!saddr16
FFFFFH
Special function register
(SFR) 256 bytes
!saddr16
R01UH0407EJ0210 Rev.2.10 53
Apr 25, 2016
RL78/I1B CHAPTER 3 CPU ARCHITECTURE
1-bit manipulation
Describe as follows for the 1-bit manipulation instruction operand (sfr.bit).
When the bit name is defined: <Bit name>
When the bit name is not defined: <Register name>.<Bit number> or <Address>.<Bit number>
8-bit manipulation
Describe the symbol defined by the assembler for the 8-bit manipulation instruction operand (sfr). This manipulation
can also be specified with an address.
16-bit manipulation
Describe the symbol defined by the assembler for the 16-bit manipulation instruction operand (sfrp). When
specifying an address, describe an even address.
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).
R01UH0407EJ0210 Rev.2.10 54
Apr 25, 2016
RL78/I1B CHAPTER 3 CPU ARCHITECTURE
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
FFF0CH Port register 12 P12 R/W Undefined
FFF0DH Port register 13 P13 R/W Undefined
FFF10H Serial data register 00 TXD0/ SDR00 R/W 0000H
SIO00
FFF11H
FFF12H Serial data register 01 RXD0 SDR01 R/W 0000H
FFF13H
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 register ADCR R 0000H
FFF1FH 8-bit A/D conversion result register ADCRH R 00H
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
FFF2CH Port mode register 12 PM12 R/W FFH
FFF30H A/D converter mode register 0 ADM0 R/W 00H
FFF31H Analog input channel specification register ADS R/W 00H
FFF32H A/D converter mode register 1 ADM1 R/W 00H
R01UH0407EJ0210 Rev.2.10 55
Apr 25, 2016
RL78/I1B CHAPTER 3 CPU ARCHITECTURE
Address Special Function Register (SFR) Name Symbol R/W Manipulable Bit Range After Reset
1-bit 8-bit 16-bit
FFF38H External interrupt rising edge enable register 0 EGP0 R/W 00H
FFF39H External interrupt falling edge enable register 0 EGN0 R/W 00H
FFF40H LCD mode register 0 LCDM0 R/W 00H
FFF41H LCD mode register 1 LCDM1 R/W 00H
FFF42H LCD clock control register LCDC0 R/W 00H
FFF43H LCD boost level control register VLCD R/W 04H
FFF44H Serial data register 02 TXD1/ SDR02 R/W 0000H
SIO10
FFF45H
FFF46H Serial data register 03 RXD1 SDR03 R/W 0000H
FFF47H
FFF48H Serial data register 10 TXD2 SDR10 R/W 0000H
FFF49H
FFF4AH Serial data register 11 RXD2 SDR11 R/W 0000H
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
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
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
R01UH0407EJ0210 Rev.2.10 56
Apr 25, 2016
RL78/I1B CHAPTER 3 CPU ARCHITECTURE
Address Special Function Register (SFR) Name Symbol R/W Manipulable Bit Range After Reset
1-bit 8-bit 16-bit
FFF90H 12-bit interval timer control register ITMC R/W 0FFFH
FFF91H
FFF92H Second count register SEC R/W Undefined
FFF93H Minute count register MIN R/W Undefined
FFF94H Hour count register HOUR R/W Undefined
FFF95H Week count register WEEK R/W Undefined
FFF96H Day count register DAY R/W Undefined
FFF97H Month count register MONTH R/W Undefined
FFF98H Year count register YEAR R/W Undefined
FFF9AH Alarm minute register ALARMWM R/W Undefined
FFF9BH Alarm hour register ALARMWH R/W Undefined
FFF9CH Alarm week register ALARMWW R/W Undefined
Note 1
FFF9DH Real-time clock control register 0 RTCC0 R/W 00H
Note 1
FFF9EH Real-time clock control register 1 RTCC1 R/W 00H
Note 1
FFFA0H Clock operation mode control register CMC R/W 00H
Note 1
FFFA1H Clock operation status control register CSC R/W C0H
FFFA2H Oscillation stabilization time counter status register OSTC R 00H
FFFA3H Oscillation stabilization time select register OSTS R/W 07H
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 2
FFFA8H Reset control flag register RESF R Undefined
Note 2
FFFA9H Voltage detection register LVIM R/W 00H
Note 2
FFFAAH Voltage detection level register LVIS R/W 00H/01H/81H
Note 3
FFFABH Watchdog timer enable register WDTE R/W 1AH/9AH
FFFACH CRC input register CRCIN R/W 00H
Reset Source RESET Input Reset by POR Reset by Reset by Reset by RAM Reset by Reset by LVD
Execution of WDT Parity Error Illegal-Memory
Illegal Access
Register Instruction
3. The reset value of the WDTE register is determined by the setting of the option byte.
4. When option byte LVIMDS1, LVIMDS0 = 0, 1: LVD reset is not generated.
R01UH0407EJ0210 Rev.2.10 57
Apr 25, 2016
RL78/I1B CHAPTER 3 CPU ARCHITECTURE
Address Special Function Register (SFR) Name Symbol R/W Manipulable Bit Range After Reset
1-bit 8-bit 16-bit
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
FFFD8H Priority specification flag register 02L PR02L PR02 R/W FFH
FFFD9H Priority specification flag register 02H PR02H R/W FFH
FFFDAH Priority specification flag register 03L PR03L PR03 R/W FFH
FFFDCH Priority specification flag register 12L PR12L PR12 R/W FFH
FFFDDH Priority specification flag register 12H PR12H R/W FFH
FFFDEH Priority specification flag register 13L PR13L PR13 R/W FFH
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 00L PR00L PR00 R/W FFH
FFFE9H Priority specification flag register 00H PR00H R/W FFH
R01UH0407EJ0210 Rev.2.10 58
Apr 25, 2016
RL78/I1B CHAPTER 3 CPU ARCHITECTURE
Address Special Function Register (SFR) Name Symbol R/W Manipulable Bit Range After Reset
1-bit 8-bit 16-bit
FFFEAH Priority specification flag register 01L PR01L PR01 R/W FFH
FFFEBH Priority specification flag register 01H PR01H R/W FFH
FFFECH Priority specification flag register 10L PR10L PR10 R/W FFH
FFFEDH Priority specification flag register 10H PR10H R/W FFH
FFFEEH Priority specification flag register 11L PR11L PR11 R/W FFH
FFFEFH Priority specification flag register 11H PR11H R/W FFH
FFFF0H Multiply and accumulation register MACRL R/W 0000H
FFFF1H (L)
FFFF2H Multiply and accumulation register MACRH R/W 0000H
FFFF3H (H)
FFFFEH Processor mode control register PMC R/W 00H
Remark For extended SFRs (2nd SFRs), see Table 3-6 Extended SFR (2nd SFR) List.
R01UH0407EJ0210 Rev.2.10 59
Apr 25, 2016
RL78/I1B CHAPTER 3 CPU ARCHITECTURE
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 as follows for the 1-bit manipulation instruction operand (!addr16.bit).
When the bit name is defined: Bit name
When the bit name is not defined: Register name.Bit number or Address.Bit number
8-bit manipulation
Describe the symbol defined by the assembler for the 8-bit manipulation instruction operand (!addr16). This
manipulation can also be specified with an address.
16-bit manipulation
Describe the symbol defined by the assembler for the 16-bit manipulation instruction operand (!addr16). When
specifying an address, describe an even address.
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).
R01UH0407EJ0210 Rev.2.10 60
Apr 25, 2016
RL78/I1B CHAPTER 3 CPU ARCHITECTURE
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 upper limit setting ADUL R/W FFH
register
F0012H Conversion result comparison lower limit setting ADLL R/W 00H
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
F0037H Pull-up resistor option register 7 PU7 R/W 00H
F0038H Pull-up resistor option register 8 PU8 R/W 00H
F003CH Pull-up resistor option register 12 PU12 R/W 00H
F0040H Port input mode register 0 PIM0 R/W 00H
F0041H Port input mode register 1 PIM1 R/W 00H
F0048H Port input mode register 8 PIM8 R/W 00H
F0050H Port output mode register 0 POM0 R/W 00H
F0051H Port output mode register 1 POM1 R/W 00H
F0058H Port output mode register 8 POM8 R/W 00H
F0070H Noise filter enable register 0 NFEN0 R/W 00H
F0071H Noise filter enable register 1 NFEN1 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 register PIOR R/W 00H
F0078H Invalid memory access detection control register IAWCTL R/W 00H
F007AH Peripheral enable register 1 PER1 R/W 00H
F007BH Port mode select resister PMS R/W 00H
F007DH Global digital input disable register GDIDIS R/W 00H
F0098H Peripheral clock control register PCKC R/W 00H
Note 1
F00A8H High-speed on-chip oscillator frequency select HOCODIV R/W Undefined
register
F00F0H Peripheral enable register 0 PER0 R/W 00H
F00F3H Subsystem clock supply mode control register OSMC R/W 00H
F00F5H RAM parity error control register RPECTL R/W 00H
Note 2
F00F9H Power-on-reset status register PORSR R/W 00H
F00FEH BCD adjust result register BCDADJ R Undefined
Notes 1. The reset value of the HOCODIV register is determined by the setting of the option byte (000C2H).
2. This register is reset only by a power-on reset.
R01UH0407EJ0210 Rev.2.10 61
Apr 25, 2016
RL78/I1B CHAPTER 3 CPU ARCHITECTURE
Address Special Function Register (SFR) Name Symbol R/W Manipulable Bit Range After Reset
1-bit 8-bit 16-bit
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 00 SIR00L SIR00 R/W 0000H
F0109H
F010AH Serial flag clear trigger register 01 SIR01L SIR01 R/W 0000H
F010BH
F010CH Serial flag clear trigger register 02 SIR02L SIR02 R/W 0000H
F010DH
F010EH Serial flag clear trigger register 03 SIR03L SIR03 R/W 0000H
F010FH
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 setting register SCR00 R/W 0087H
F0119H 00
R01UH0407EJ0210 Rev.2.10 62
Apr 25, 2016
RL78/I1B CHAPTER 3 CPU ARCHITECTURE
Address Special Function Register (SFR) Name Symbol R/W Manipulable Bit Range After Reset
1-bit 8-bit 16-bit
F0128H Serial output register 0 SO0 R/W 0F0FH
F0129H
F012AH Serial output enable register 0 SOE0L SOE0 R/W 0000H
F012BH
F0134H Serial output level register 0 SOL0L SOL0 R/W 0000H
F0135H
F0138H Serial standby control register 0 SSC0L SSC0 R/W 0000H
F0139H
F0140H Serial status register 10 SSR10L SSR10 R 0000H
F0141H
F0142H Serial status register 11 SSR11L SSR11 R 0000H
F0143H
F0148H Serial flag clear trigger register 10 SIR10L SIR10 R/W 0000H
F0149H
F014AH Serial flag clear trigger register 11 SIR11L SIR11 R/W 0000H
F014BH
F0150H Serial mode register 10 SMR10 R/W 0020H
F0151H
F0152H Serial mode register 11 SMR11 R/W 0020H
F0153H
F0158H Serial communication operation setting SCR10 R/W 0087H
F0159H register 10
R01UH0407EJ0210 Rev.2.10 63
Apr 25, 2016
RL78/I1B CHAPTER 3 CPU ARCHITECTURE
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
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
R01UH0407EJ0210 Rev.2.10 64
Apr 25, 2016
RL78/I1B CHAPTER 3 CPU ARCHITECTURE
Address Special Function Register (SFR) Name Symbol R/W Manipulable Bit Range After Reset
1-bit 8-bit 16-bit
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 register 0 TE0L TE0 R 0000H
F01B1H
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
F0230H IICA control register 00 IICCTL00 R/W 00H
F0231H IICA control register 01 IICCTL01 R/W 00H
F0232H IICA low-level width setting register 0 IICWL0 R/W FFH
F0233H IICA high-level width setting register 0 IICWH0 R/W FFH
F0234H Slave address register 0 SVA0 R/W 00H
F02D0H Oscillation stop detection register OSDC R/W 0FFFH
F02D8H High-speed on-chip oscillator clock frequency HOCOFC R/W 00H
correction control register
F02E0H DTC base address register DTCBAR R/W 00H
F02E8H DTC enable register 0 DTCEN0 R/W 00H
F02E9H DTC enable register 1 DTCEN1 R/W 00H
F02EAH DTC enable register 2 DTCEN2 R/W 00H
F02EBH DTC enable register 3 DTCEN3 R/W 00H
F02F0H Flash memory CRC control register CRC0CTL R/W 00H
F02F2H Flash memory CRC operation result register PGCRCL R/W 0000H
F02FAH CRC data register CRCD R/W 0000H
F0300H LCD port function register 0 PFSEG0 R/W F0H
F0301H LCD port function register 1 PFSEG1 R/W FFH
F0302H LCD port function register 2 PFSEG2 R/W FFH
F0303H LCD port function register 3 PFSEG3 R/W FFH
F0304H LCD port function register 4 PFSEG4 R/W FFH
F0305H LCD port function register 5 PFSEG5 R/W FFH
R01UH0407EJ0210 Rev.2.10 65
Apr 25, 2016
RL78/I1B CHAPTER 3 CPU ARCHITECTURE
Address Special Function Register (SFR) Name Symbol R/W Manipulable Bit Range After Reset
1-bit 8-bit 16-bit
F0308H LCD Input switch control register ISCLCD R/W 00H
Note
F0310H Watch error correction register SUBCUD R/W 0020H
F0312H Frequency measurement count register L FMCRL R 0000H
F0314H Frequency measurement count register H FMCRH R 0000H
F0316H Frequency measurement control register FMCTL R/W 00H
F0330H Backup power switch control register 0 BUPCTL0 R/W 00H
F0340H Comparator mode setting register COMPMDR R/W 00H
F0341H Comparator filter control register COMPFIR R/W 00H
F0342H Comparator output control register COMPOCR R/W 00H
F0350H 8-bit interval timer compare register 00 TRTC TRTC R/W FFH
MP00 MP0
F0351H 8-bit interval timer compare register 01 TRTC R/W FFH
MP01
F0352H 8-bit interval timer control register 0 TRTCR0 R/W 00H
F0353H 8-bit interval timer frequency division register 0 TRTMD0 R/W 00H
F0358H 8-bit interval timer compare register 10 TRTC TRTC R/W FFH
MP10 MP1
F0359H 8-bit interval timer compare register 11 TRTC R/W FFH
MP11
F035AH 8-bit interval timer control register 1 TRTCR1 R/W 00H
F035BH 8-bit interval timer frequency division register 1 TRTMD1 R/W 00H
F03A0H IrDA control register IRCR R/W 00H
F03B0H Temperature sensor control register TMPCTL R/W 00H
R01UH0407EJ0210 Rev.2.10 66
Apr 25, 2016
RL78/I1B CHAPTER 3 CPU ARCHITECTURE
Address Special Function Register (SFR) Name Symbol R/W Manipulable Bit Range After Reset
1-bit 8-bit 16-bit
F03C0H ∆Σ A/D converter mode register DSADMR R/W 0000H
F03C2H ∆Σ A/D converter gain control register 0 DSADGCR0 R/W 00H
F03C3H ∆Σ A/D converter gain control register 1 DSADGCR1 R/W 00H
F03C5H ∆Σ A/D converter HPF control register DSADHPFCR R/W 00H
F03C6H ∆Σ A/D converter phase control register 0 DSADPHCR0 R/W 0000H
F03C8H ∆Σ A/D converter phase control register 1 DSADPHCR1 R/W 0000H
F03D0H ∆Σ A/D converter conversion result register 0L DSAD DSAD R 00H
CR0L CR0
F03D1H ∆Σ A/D converter conversion result register 0M DSAD R 00H
CR0M
F03D2H ∆Σ A/D converter conversion result register 0H DSADCR0H R 00H
F03D4H ∆Σ A/D converter conversion result register 1L DSAD DSAD R 00H
CR1L CR1
F03D5H ∆Σ A/D converter conversion result register 1M DSAD R 00H
CR1M
F03D6H ∆Σ A/D converter conversion result register 1H DSADCR1H R 00H
F03D8H ∆Σ A/D converter conversion result register 2L DSAD DSAD R 00H
CR2L CR2
F03D9H ∆Σ A/D converter conversion result register 2M DSAD R 00H
CR2M
F03DAH ∆Σ A/D converter conversion result register 2H DSADCR2H R 00H
F03DCH ∆Σ A/D converter conversion result register 3L DSAD DSAD R 00H
CR3L CR3
F03DDH ∆Σ A/D converter conversion result register 3M DSAD R 00H
CR3M
F03DEH ∆Σ A/D converter conversion result register 3H DSADCR3H R 00H
F0400H LCD display data memory 0 SEG0 R/W 00H
F0401H LCD display data memory 1 SEG1 R/W 00H
F0402H LCD display data memory 2 SEG2 R/W 00H
F0403H LCD display data memory 3 SEG3 R/W 00H
F0404H LCD display data memory 4 SEG4 R/W 00H
F0405H LCD display data memory 5 SEG5 R/W 00H
F0406H LCD display data memory 6 SEG6 R/W 00H
F0407H LCD display data memory 7 SEG7 R/W 00H
F0408H LCD display data memory 8 SEG8 R/W 00H
F0409H LCD display data memory 9 SEG9 R/W 00H
F040AH LCD display data memory 10 SEG10 R/W 00H
R01UH0407EJ0210 Rev.2.10 67
Apr 25, 2016
RL78/I1B CHAPTER 3 CPU ARCHITECTURE
Address Special Function Register (SFR) Name Symbol R/W Manipulable Bit Range After Reset
1-bit 8-bit 16-bit
F040BH LCD display data memory 11 SEG11 R/W 00H
F040CH LCD display data memory 12 SEG12 R/W 00H
F040DH LCD display data memory 13 SEG13 R/W 00H
F040EH LCD display data memory 14 SEG14 R/W 00H
F040FH LCD display data memory 15 SEG15 R/W 00H
F0410H LCD display data memory 16 SEG16 R/W 00H
F0411H LCD display data memory 17 SEG17 R/W 00H
F0412H LCD display data memory 18 SEG18 R/W 00H
F0413H LCD display data memory 19 SEG19 R/W 00H
F0414H LCD display data memory 20 SEG20 R/W 00H
F0415H LCD display data memory 21 SEG21 R/W 00H
F0416H LCD display data memory 22 SEG22 R/W 00H
F0417H LCD display data memory 23 SEG23 R/W 00H
F0418H LCD display data memory 24 SEG24 R/W 00H
F0419H LCD display data memory 25 SEG25 R/W 00H
F041AH LCD display data memory 26 SEG26 R/W 00H
F041BH LCD display data memory 27 SEG27 R/W 00H
F041CH LCD display data memory 28 SEG28 R/W 00H
F041DH LCD display data memory 29 SEG29 R/W 00H
F041EH LCD display data memory 30 SEG30 R/W 00H
F041FH LCD display data memory 31 SEG31 R/W 00H
F0420H LCD display data memory 32 SEG32 R/W 00H
F0421H LCD display data memory 33 SEG33 R/W 00H
F0422H LCD display data memory 34 SEG34 R/W 00H
F0423H LCD display data memory 35 SEG35 R/W 00H
F0424H LCD display data memory 36 SEG36 R/W 00H
F0425H LCD display data memory 37 SEG37 R/W 00H
F0426H LCD display data memory 38 SEG38 R/W 00H
F0427H LCD display data memory 39 SEG39 R/W 00H
F0428H LCD display data memory 40 SEG40 R/W 00H
F0429H LCD display data memory 41 SEG41 R/W 00H
F0540H 8-bit interval timer count register 00 TRT00 TRT0 R 00H
F0541H 8-bit interval timer count register 01 TRT01 R 00H
F0548H 8-bit interval timer count register 10 TRT10 TRT1 R 00H
F0549H 8-bit interval timer count register 11 TRT11 R 00H
Remark For SFRs in the SFR area, see Table 3-5 SFR List.
R01UH0407EJ0210 Rev.2.10 68
Apr 25, 2016
RL78/I1B CHAPTER 3 CPU ARCHITECTURE
[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 Instruction code
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 Instruction code
OP code
Low Addr.
High Addr.
Seg Addr.
Low Addr.
0000
High Addr.
R01UH0407EJ0210 Rev.2.10 69
Apr 25, 2016
RL78/I1B CHAPTER 3 CPU ARCHITECTURE
[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.
Instruction code
OP code
High Addr.
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.
Instruction code
OP code
CS rp
R01UH0407EJ0210 Rev.2.10 70
Apr 25, 2016
RL78/I1B CHAPTER 3 CPU ARCHITECTURE
[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]
Implied addressing can be applied only to MULU X.
Instruction code
OP code A register
Memory
(register area)
[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
Instruction code
OP code Register
Memory
(register bank area)
R01UH0407EJ0210 Rev.2.10 71
Apr 25, 2016
RL78/I1B CHAPTER 3 CPU ARCHITECTURE
[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)
MOV !addr16, A
FFFFFH
<1>
Instruction code
Low Addr.
<1>
High Addr. F0000H
Memory
ES: !addr16
FFFFFH
<1> <2>
Instruction code
Area from
OP-code Target memory X0000H to
Specifies the XFFFFH
Low Addr. address in memory
<2>
High Addr. X0000H
Specifies a
64 KB area
ES
00000H
The ES register <1> specifies a 64 KB area within the
overall 1 MB space as the four higher-order bits, X, of Memory
the address range.
A 16-bit address <2> in the area from X0000H to XFFFFH
and the ES register <1> specify the target location;
this is used for access to fixed data other than
that in mirrored areas.
R01UH0407EJ0210 Rev.2.10 72
Apr 25, 2016
RL78/I1B CHAPTER 3 CPU ARCHITECTURE
[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
(only the space from FFE20H to FFF1FH is specifiable)
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)
Instruction code
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.
R01UH0407EJ0210 Rev.2.10 73
Apr 25, 2016
RL78/I1B CHAPTER 3 CPU ARCHITECTURE
[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
Instruction code
FFFFFH
OP code SFR
FFF00H
SFR
Memory
R01UH0407EJ0210 Rev.2.10 74
Apr 25, 2016
RL78/I1B CHAPTER 3 CPU ARCHITECTURE
[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
[DE], [HL]
<1> <1>
Target memory
Instruction code <1>
Specifies the
<1>
address in memory
OP-code rp(HL/DE)
F0000H
R01UH0407EJ0210 Rev.2.10 75
Apr 25, 2016
RL78/I1B CHAPTER 3 CPU ARCHITECTURE
[Function]
Based addressing uses the contents of a register pair specified with the instruction word or 16-bit immediate data 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
Instruction code
R01UH0407EJ0210 Rev.2.10 76
Apr 25, 2016
RL78/I1B CHAPTER 3 CPU ARCHITECTURE
OP-code Target
Target memory
<2> Offset array
<2> byte of data
<1> Address of
an array Other data in
rp(HL/DE) the array
F0000H
Array of
Instruction code Target memory
word-sized
<2> <2> Offset
OP-code r(B/C) data
Address of a word
Low Addr. <1> within an array
High Addr. F0000H
word [BC]
FFFFFH
<1> <2>
R01UH0407EJ0210 Rev.2.10 77
Apr 25, 2016
RL78/I1B CHAPTER 3 CPU ARCHITECTURE
<1> Specifies a
<1>
64 KB area
ES
R01UH0407EJ0210 Rev.2.10 78
Apr 25, 2016
RL78/I1B CHAPTER 3 CPU ARCHITECTURE
R01UH0407EJ0210 Rev.2.10 79
Apr 25, 2016
RL78/I1B CHAPTER 3 CPU ARCHITECTURE
[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
Target
Instruction code Target memory array
<2> Offset of data
OP-code r(B/C)
Address of
<1> an array Other data in
rp(HL) the array
F0000H
R01UH0407EJ0210 Rev.2.10 80
Apr 25, 2016
RL78/I1B CHAPTER 3 CPU ARCHITECTURE
[Function]
The stack area is indirectly addressed with the stack pointer (SP) values. 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.
Only the internal RAM area can be set as the stack area.
[Operand format]
Identifier Description
CALL/CALLT
RET
BRK
RETB
(Interrupt request generated)
RETI
Each stack operation saves or restores data as shown in Figures 3-33 to 3-38.
PUSH rp
<1> <2>
<1> SP
Instruction code SP - 1 Higher byte of rp
<3> SP - 2 Lower byte of rp Stack area
OP-code <2> SP
rp F0000H
Stack addressing is specified <1>.
The higher and lower bytes of the pair of registers indicated
by rp <2> are stored in addresses SP - 1 and SP - 2, respectively.
The value of SP <3> is decreased by two (if rp is the program
status word (PSW), the value of the PSW is stored in SP - 1 and
Memory
0 is stored in SP - 2).
R01UH0407EJ0210 Rev.2.10 81
Apr 25, 2016
RL78/I1B CHAPTER 3 CPU ARCHITECTURE
POP rp
<1> <2>
<1> SP+ 2
SP (SP+1) Stack
Instruction code SP+ 1
SP (SP) area
OP-code <2> SP
F0000H
rp
CALL
<1>
<1> SP SP - 1 Stack
Instruction code 00H
SP - 2 area
PC19 - PC16
OP-code SP - 3 PC15 - PC8
<3> SP - 4 PC7 - PC0
SP
<2>
F0000H
PC
R01UH0407EJ0210 Rev.2.10 82
Apr 25, 2016
RL78/I1B CHAPTER 3 CPU ARCHITECTURE
RET
<1> SP+4
<1> SP (SP+3)
Instruction code SP+3
SP+2 (SP+2) Stack
OP-code area
SP+1 (SP+1)
<3> SP (SP)
SP
<2> F0000H
PC
<2>
PSW
SP Stack
Instruction code SP - 1 PSW
<1> SP - 2 PC19 - PC16 area
OP-code SP - 3 PC15 - PC8
or SP <3> SP - 4 PC7 - PC0
Interrupt
<2>
F0000H
PC
R01UH0407EJ0210 Rev.2.10 83
Apr 25, 2016
RL78/I1B CHAPTER 3 CPU ARCHITECTURE
RETI, RETB
<1> PSW
SP+4
<1> SP
Instruction code SP+3 (SP+3)
SP+2 (SP+2) Stack
OP-code SP+1 (SP+1) area
<3> SP (SP)
SP
<2> F0000H
PC
R01UH0407EJ0210 Rev.2.10 84
Apr 25, 2016
RL78/I1B CHAPTER 4 PORT FUNCTIONS
The RL78/I1B 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
R01UH0407EJ0210 Rev.2.10 85
Apr 25, 2016
RL78/I1B CHAPTER 4 PORT FUNCTIONS
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 P00, P03, P05 and P06 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 P01 to P07 pins can be specified as N-ch open-drain output (VDD tolerance) in 1-bit units using port
output mode register 0 (POM0).
This port can also be used for programming UART transmission/reception, IrDA transmission, serial interface data I/O,
and clock I/O, timer I/O, external interrupt request input, and comparator output. For the 80-pin products, this port can be
used for segment output of LCD controller/driver.
Reset signal generation sets port 0 to input mode. For the 80-pin products, the P00 and P01 pins are set to input mode,
and P02 to P07 pins are set to the digital input invalid modeNote.
Note “Digital input invalid” refers to the state in which all the digital outputs, digital inputs, and LCD outputs are
disabled.
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 P15 and P16 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 P15 to 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, and segment output of LCD controller/driver.
Reset signal generation sets port 1 to the digital input invalid modeNote.
Note “Digital input invalid” refers to the state in which all the digital outputs, digital inputs, and LCD outputs are
disabled.
R01UH0407EJ0210 Rev.2.10 86
Apr 25, 2016
RL78/I1B CHAPTER 4 PORT FUNCTIONS
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, (+side and –side) reference voltage input, comparator
reference voltage input, and comparator analog voltage input.
To use P20/ANI0 to P25/ANI15 as digital I/O pins, set them in the digital I/O mode by using the A/D port configuration
register (ADPC). Use these pins starting from the upper bit.
To use P20/ANI0 to P25/ANI15 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.
Reset signal generation sets port 2 to the analog input mode.
R01UH0407EJ0210 Rev.2.10 87
Apr 25, 2016
RL78/I1B CHAPTER 4 PORT FUNCTIONS
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).
This port can also be used for clock/buzzer output, timer I/O, and segment output of LCD controller/driver.
Reset signal generation sets port 3 to the digital input invalid modeNote.
Note “Digital input invalid” refers to the state in which all the digital outputs, digital inputs, and LCD outputs are
disabled.
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 P44 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).
This port can also be used for external interrupt request input , clock/buzzer output, timer I/O, and data I/O for a flash
memory programmer/debugger.
Reset signal generation sets port 4 to input mode.
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).
This port can also be used for segment output of LCD controller/driver.
Reset signal generation sets port 5 to the digital input invalid modeNote.
Note “Digital input invalid” refers to the state in which all the digital outputs, digital inputs, and LCD outputs are
disabled.
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).
The output of the P60, P61, and P62 pins is N-ch open-drain output (6 V tolerance).
This port can also be used for serial interface data I/O, clock I/O, timer I/O, and real-time clock correction clock output.
Reset signal generation sets port 6 to input mode.
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 the P70 to P77 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 7 (PU7).
This port can also be used for segment output of LCD controller/driver and external interrupt request input.
Reset signal generation sets port 7 to the digital input invalid modeNote.
Note “Digital input invalid” refers to the state in which all the digital outputs, digital inputs, and LCD outputs are
disabled.
R01UH0407EJ0210 Rev.2.10 88
Apr 25, 2016
RL78/I1B CHAPTER 4 PORT FUNCTIONS
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 P85 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 P81 pin 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 pins can be specified as N-ch open-drain output (VDD tolerance) in 1-bit units using port
output mode register 8 (POM8).
This port can also be used for serial interface data I/O, clock I/O, and segment output of LCD controller/driver.
Note
Reset signal generation sets port 8 to the digital input invalid mode .
Note “Digital input invalid” refers to the state in which all the digital outputs, digital inputs, and LCD outputs are
disabled.
4.2.10 Port 12
P125 to P127 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 the P125 to P127 pins are 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.
This port can also be used for connecting resonator for main system clock, connecting resonator for subsystem clock,
external clock input for main system clock, external clock input for subsystem clock, connecting a capacitor for LCD
controller/driver, power supply voltage pin for driving the LCD, external interrupt request input, and timer I/O.
Reset signal generation sets P121 to P124 to input mode. P125 to P127 are set in the digital invalid modeNote.
Note “Digital input invalid” refers to the state in which all the digital outputs, digital inputs, and LCD outputs are
disabled.
4.2.11 Port 13
P130 is a 1-bit output-only port with an output latch. P137 is a 1-bit input-only port. P130 is fixed an output mode, and
P137 is fixed an input mode.
This port can also be used for real-time clock correction clock output and external interrupt request input.
Remark When a reset takes effect, P130 outputs a low-level signal. If P130 is set to output a high-level signal before
a reset takes effect, the output signal of P130 can be dummy-output as the CPU reset signal.
Reset signal
P130
Set by software
R01UH0407EJ0210 Rev.2.10 89
Apr 25, 2016
RL78/I1B CHAPTER 4 PORT FUNCTIONS
Caution Which registers and bits are included depends on the product. For registers and bits mounted on
each product, see Table 4-3. Be sure to set bits that are not mounted to their initial values.
R01UH0407EJ0210 Rev.2.10 90
Apr 25, 2016
RL78/I1B CHAPTER 4 PORT FUNCTIONS
Table 4-3. PMxx, Pxx, PUxx, PIMxx, POMxx Registers and the Bits Mounted on Each Product (1/3)
R01UH0407EJ0210 Rev.2.10 91
Apr 25, 2016
RL78/I1B CHAPTER 4 PORT FUNCTIONS
Table 4-3. PMxx, Pxx, PUxx, PIMxx, POMxx Registers and the Bits Mounted on Each Product (2/3)
R01UH0407EJ0210 Rev.2.10 92
Apr 25, 2016
RL78/I1B CHAPTER 4 PORT FUNCTIONS
Table 4-3. PMxx, Pxx, PUxx, PIMxx, POMxx Registers and the Bits Mounted on Each Product (3/3)
R01UH0407EJ0210 Rev.2.10 93
Apr 25, 2016
RL78/I1B CHAPTER 4 PORT FUNCTIONS
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 1 1 PM25 PM24 PM23 PM22 PM21 PM20 FFF22H FFH R/W
PM3 PM37 PM36 PM35 PM34 PM33 PM32 PM31 PM30 FFF23H FFH R/W
PM5 PM57 PM56 PM55 PM54 PM53 PM52 PM51 PM50 FFF25H FFH R/W
PM7 PM77 PM76 PM75 PM74 PM73 PM72 PM71 PM70 FFF27H FFH R/W
PM8 1 1 PM85 PM84 PM83 PM82 PM81 PM80 FFF28H FFH R/W
Caution Be sure to set bits that are not mounted to their initial values.
R01UH0407EJ0210 Rev.2.10 94
Apr 25, 2016
RL78/I1B CHAPTER 4 PORT FUNCTIONS
Note If P20 to P25 are set up as analog inputs of the A/D converter or comparator, 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 0 0 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 0 0 0 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
P7 P77 P76 P75 P74 P73 P72 P71 P70 FFF07H 00H (output latch) R/W
P8 0 0 P85 P84 P83 P82 P81 P80 FFF08H 00H (output latch) R/W
Note
P12 P127 P126 P125 P124 P123 P122 P121 0 FFF0CH Undefined R/W
Note
P13 P137 0 0 0 0 0 0 P130 FFF0DH Undefined R/W
Pmn Output data control (in output mode) Input data read (in input mode)
Caution Be sure to set bits that are not mounted to their initial values.
Remark m = 0 to 8, 12, 13 ; n = 0 to 7
R01UH0407EJ0210 Rev.2.10 95
Apr 25, 2016
RL78/I1B CHAPTER 4 PORT FUNCTIONS
Caution When a port with the PIMn register is input from different potential device to TTL buffer, pull up to the
power supply of the different potential device via an external pull-up resistor by setting PUmn = 0.
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
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 0 0 PU85 PU84 PU83 PU82 PU81 PU80 F0038H 00H R/W
Caution Be sure to set bits that are not mounted to their initial values.
R01UH0407EJ0210 Rev.2.10 96
Apr 25, 2016
RL78/I1B CHAPTER 4 PORT FUNCTIONS
Caution Be sure to set bits that are not mounted to their initial values.
R01UH0407EJ0210 Rev.2.10 97
Apr 25, 2016
RL78/I1B CHAPTER 4 PORT FUNCTIONS
Caution An on-chip pull-up resistor is not connected to a bit for which N-ch open drain output (VDD
toleranceNote 1/EVDD1 toleranceNote 2) mode (POMmn = 1) is set.
POM0 POM07 POM06 POM05 POM04 POM03 POM02 POM01 0 F0050H 00H R/W
Caution Be sure to set bits that are not mounted to their initial values.
R01UH0407EJ0210 Rev.2.10 98
Apr 25, 2016
RL78/I1B CHAPTER 4 PORT FUNCTIONS
0 0 0 A A A A A A
0 0 1 D D D D D D
0 1 0 D D D D D A
0 1 1 D D D D A A
1 0 0 D D D A A A
1 0 1 D D A A A A
1 1 0 D A A A A A
Other than above Setting prohibited
Cautions 1. Set the port to analog input by ADPC register to the input mode by using port mode register 2
(PM2).
2. Do not set the pin set by the ADPC register as digital I/O by the analog input channel
specification register (ADS).
3. When using AVREFP and AVREFM, set ANI0 and ANI1 to analog input and set the port mode
register to the input mode.
R01UH0407EJ0210 Rev.2.10 99
Apr 25, 2016
RL78/I1B CHAPTER 4 PORT FUNCTIONS
GDIDIS 0 0 0 0 0 0 0 GDIDIS0
Turn off the EVDD power supply with the following procedure.
1. Prohibit input to input buffers (set GDIDIS0 = 1).
2. Turn off the EVDD power supply.
Turn on again the EVDD power supply with the following procedure.
1. Turn on the EVDD power supply.
2. Permit input to input buffers (set GDIDIS0 = 0).
Cautions 1. Do not input an input voltage equal to or greater than EVDD to an input port that uses EVDD as the
power supply.
2. When input to input buffers is prohibited (GDIDIS0 = 1), the value read from the port register (Pxx)
of a port that uses EVDD as the power supply is 1. When 1 is set in the port output mode register
(POMxx) (N-ch open drain output (EVDD tolerance) mode), the value read from the port register
(Pxx) is 0.
Remark Even when input to input buffers is prohibited (GDIDIS0 = 1), peripheral functions which do not use port
functions having EVDD as the power supply can be used.
Note Uses a battery backup function and the P137 pin is enabled when supplying power from VBAT.
When the INTP0 function is assigned to P70, note that the interrupt function is disabled when supplying power
from VBAT.
Remark The correspondence between the segment output pins (SEGxx) and the PFSEG register (PFSEGxx bits)
and the existence of SEGxx pins in each product are shown in Table 4-4 Segment Output Pins in Each
Product and Correspondence with PFSEG Register (PFSEG Bits).
<R> Figure 4-9. Format of LCD port function registers 0 to 5 (PFSEG0 to PFSEG5)
PFSEGxx Port (other than segment output)/segment outputs specification of Pmn pins
(xx = 04 to (mn = 10 to 17, 30 to 37, 50 to 57, 70 to 77, 80 to 85)
41)
Caution Be sure to set bits that are not mounted to their initial values.
Remark To use the Pmn pins as segment output pins (PFSEGxx = 1), be sure to set the PUmn bit of the PUm
register, POMmn bit of the POMm register, and PIMmn bit of the PIMm register to “0”.
Table 4-4. Segment Output Pins in Each Product and Correspondence with PFSEG Register (PFSEG Bits)
Bit Name of PFSEG Register Corresponding SEGxx Pins Alternate Port 80-pin 100-pin
PFSEG04 SEG4 P10
PFSEG05 SEG5 P11
PFSEG06 SEG6 P12
PFSEG07 SEG7 P13
PFSEG08 SEG8 P14
PFSEG09 SEG9 P15
PFSEG10 SEG10 P16
PFSEG11 SEG11 P17
PFSEG12 SEG12 P80
PFSEG13 SEG13 P81
PFSEG14 SEG14 P82
PFSEG15 SEG15 P83
PFSEG16 SEG16 P70
PFSEG17 SEG17 P71
PFSEG18 SEG18 P72
PFSEG19 SEG19 P73
PFSEG20 SEG20 P74
PFSEG21 SEG21 P75
PFSEG22 SEG22 P76
PFSEG23 SEG23 P77
PFSEG24 SEG24 P30
PFSEG25 SEG25 P31
PFSEG26 SEG26 P32
PFSEG27 SEG27 P33
PFSEG28 SEG28 P34
PFSEG29 SEG29 P35
PFSEG30 SEG30 P36
PFSEG31 SEG31 P37
PFSEG32 SEG32 80-pin products: P02
100-pin products: P50
PFSEG33 SEG33 80-pin products: P03
100-pin products: P51
PFSEG34 SEG34 80-pin products: P04
100-pin products: P52
PFSEG35 SEG35 80-pin products: P05
100-pin products: P53
PFSEG36 SEG36 80-pin products: P06
100-pin products: P54
PFSEG37 SEG37 80-pin products: P07
100-pin products: P55
PFSEG38 SEG38 P56
PFSEG39 SEG39 P57
PFSEG40 SEG40 P84
PFSEG41 SEG41 P85
ISCCAP Control of schmitt trigger buffer of CAPL/ P126 and CAPH/P127 pins
Caution If ISCVL3 bit = 0 and ISCCAP bit = 0, set the corresponding port control registers as follows:
PU127 bit of PU12 register = 0, P127 bit of P12 register = 0
PU126 bit of PU12 register = 0, P126 bit of P12 register = 0
PU125 bit of PU12 register = 0, P125 bit of P12 register = 0
Port operations differ depending on whether the input or output mode is set, as shown below.
(1) Setting procedure when using input pins of UART0 to UART2, and CSI00 functions for the TTL input buffer
Remark Functions in parentheses can be assigned via settings in the peripheral I/O redirection register (PIOR).
<1> Using an external resistor, pull up externally the pin to be used to the power supply of the target device (on-
chip pull-up resistor cannot be used).
<2> Set the corresponding bit of the PIM0, PIM1, and PIM8 registers to 1 to switch to the TTL input buffer. For
VIH and VIL, refer to the DC characteristics when the TTL input buffer is selected.
<3> Enable the operation of the serial array unit and set the mode to the UART/CSI mode.
(2) Setting procedure when using output pins of UART0 to UART2, and CSI00 functions in N-ch open-drain
output mode
Remark Functions in parentheses can be assigned via settings in the peripheral I/O redirection register (PIOR).
<1> Using an external resistor, pull up externally the pin to be used to the power supply of the target device (on-
chip pull-up resistor cannot be used).
<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, and POM8 registers to 1 to set the N-ch open drain output
(VDD toleranceNote 1/EVDD toleranceNote 2) mode.
<5> Enable the operation of the serial array unit and set the mode to the UART/CSI mode.
<6> Set the output mode by manipulating the PM0, PM1, and PM8 registers.
At this time, the output data is high level, so the pin is in the Hi-Z state.
(3) Setting procedure when using I/O pins of IIC00 and IIC10 functions with a different potential (1.8 V, 2.5 V, 3 V)
Remark Functions in parentheses can be assigned via settings in the peripheral I/O redirection register (PIOR).
<1> Using an external resistor, pull up externally the pin to be used to the power supply of the target device (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, and POM8 registers to 1 to set the N-ch open drain output
(VDD toleranceNote 1/EVDD toleranceNote 2) mode.
<5> Set the corresponding bit of the PIM0, PIM1, and PIM8 registers to 1 to switch the TTL input buffer. For VIH
and VIL, refer to the DC characteristics when the TTL input buffer is selected.
<6> Enable the operation of the serial array unit and set the mode to the simplified I2C mode.
<7> Set the corresponding bit of the PM0, PM1, and PM8 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.
WRPORT
EVDD0/EVDD1/VDD
Output latch
(Pmn)
P-ch
WRPM Pmn/
Alternate function
PM register N-ch
Internal bus
(PMmn)
WRPOM
VSS
POM register Note 1
(POMmn)
To input circuit
Alternate Note 2
function (SAU)
Notes 1. When there is no POM register, this signal should be considered to be low level (0).
2. When there is no alternate function, this signal should be considered to be high level (1).
3. When there is no alternate function, this signal should be considered to be low level (0).
Port Function Output Function for SAU Output Function for other than SAU
Output function for port Output is high (1) Output is low (0)
Note Since more than one output function other than SAU may be assigned to a single pin, the output of an unused
alternate function must be set to low level (0). For details on the setting method, see 4.5.2 Register settings
for alternate function whose output function is not used.
4.5.2 Register settings for alternate function whose output function is not used
When the output of an alternate function of the pin is not used, the following settings should be made. Note that when
the peripheral I/O redirection function is the target, the output can be switched to another pin by setting the peripheral I/O
redirection register (PIOR). This allows usage of the port function or other alternate function assigned to the target pin.
(1) SOp = 1, TxDq = 1 (settings when the serial output (SOp/TxDq) of SAU is not used)
When the serial output (SOp/TxDq) is not used, such as, a case in which only the serial input of SAU is used, set the
bit in serial output enable register m (SOEm) which corresponds to the unused output to 0 (output disabled) and set
the SOmn bit in serial output register m (SOm) to 1 (high). These are the same settings as the initial state.
(2) SCKp = 1, SDAr = 1, SCLr = 1 (settings when channel n in SAU is not used)
When SAU is not used, set bit n (SEmn) in serial channel enable status register m (SEm) to 0 (operation stopped
state), set the bit in serial output enable register m (SOEm) which corresponds to the unused output to 0 (output
disabled), and set the SOmn and CKOmn bits in serial output register m (SOm) to 1 (high). These are the same
settings as the initial state.
(3) TOmn = 0 (settings when the output of channel n in TAU is not used)
When the TOmn output of TAU is not used, set the bit in timer output enable register 0 (TOE0) which corresponds to
the unused output to 0 (output disabled) and set the bit in timer output register 0 (TO0) to 0 (low). These are the
same settings as the initial state.
4.5.3 Register setting examples for used port and alternate functions
Register setting examples for used port and alternate functions are shown in Table 4-6. The registers used to control
the port functions should be set as shown in Table 4-6. See the following remark for legends used in Table 4-6.
Table 4-6. Setting Examples of Registers and Output Latches When Using Alternate Function (1/9)
Pin Used Function PIOR× POM×× PM×× P×× PFSEG×× Alternate Function Output 80-pin 100-pin
Name Function I/O (ISCVL3, SAU Output Other than SAU
Name ISCCAP)Note Function
P00 P00 Input 1 0
Output 0 0/1 0
RxD2 Input 1 0
IrRxD Input 1 0
VCOUT0 Analog output PIOR3 = 0 0 0 0
P01 P01 Input 1 0
Output 0 0 0/1 0
N-ch open drain TxD2/IrTxD = 1
1 0 0/1 0
output
TxD2 Output 0/1 0 1 0
IrTxD Output 0/1 0 1 0
VCOUT1 Analog output PIOR3 = 0 0 0 0 0 TxD2/IrTxD = 1
P02 P02 Input 1 0
Output 0 0 0/1 0
N-ch open drain SCL10 = 1 TO07 = 0
1 0 0/1 0
output
SCL10 Output PIOR2 = 0 0/1 0 1 0 TO07 = 0
TI07 Input PIOR0 = 0 1 0
TO07 Output PIOR0 = 0 0 0 0 0 SCL10=1
INTP5 Input PIOR4 = 0 1 0
SEG32 Output 0 0 0 1
P03 P03 Input 1 0
Output 0 0 0/1 0
N-ch open drain SDA10 = 1 TO06 = 0
1 0 0/1 0
output
RxD1 Input PIOR2 = 0 1 0
TI06 Input PIOR0 = 0 1 0
TO06 Output PIOR0 = 0 0 0 0 0 SDA10 = 1
SDA10 I/O PIOR2 = 0 1 0 1 0 TO06 = 0
(VCOUT0) Analog output PIOR3 = 1 0 0 0 0
SEG33 Output 0 0 0 1
P04 P04 Input 1 0
Output 0 0 0/1 0
N-ch open drain TxD1 = 1 TO05 = 0
1 0 0/1 0
output
TxD1 Output PIOR2 = 0 0/1 0 1 0 TO05 = 0
TI05 Input PIOR0 = 0 1 0
TO05 Output PIOR0 = 0 0 0 0 0 TxD1 = 1
INTP4 Input PIOR4 = 0 1 0
(VCOUT1) Analog output PIOR3 = 1 0 0 0 0
SEG34 Output 0 0 0 1
P05 P05 Input 1 0
Output 0 0 0/1 0
SCK00/SCL00
N-ch open drain TO04 = 0
1 0 0/1 0 =1
output
SCK00 Input 1 0
PIOR1 = 0
Output 0/1 0 1 0 TO04 = 0
SCL00 Output PIOR1 = 0 0/1 0 1 0 TO04 = 0
TI04 Input PIOR0 = 0 1 0
TO04 Output SCK00/SCL00
PIOR0 = 0 0 0 0 0
=1
INTP3 Input PIOR4 = 0 1 0
SEG35 Output 0 0 0 1
Note ISCVL3 and ISCCAP are registers that correspond to P125, and P126 and P127, respectively.
Table 4-6. Setting Examples of Registers and Output Latches When Using Alternate Function (2/9)
Pin Used Function PIOR× POM×× PM×× P×× PFSEG×× Alternate Function Output 80-pin 100-pin
Name Function I/O (ISCVL3, SAU Output Other than
Name ISCCAP)Note Function SAU
P06 P06 Input 1 0
Output 0 0 0/1 0
N-ch open SDA00 = 1 TO03 = 0
1 0 0/1 0
drain output
SI00 Input PIOR1 = 0 1 0
RxD0 Input PIOR1 = 0 1 0
TI03 Input PIOR0 = 0 1 0
TO03 Output PIOR0 = 0 0 0 0 0 SDA00 = 1
SDA00 I/O PIOR1 = 0 1 0 1 0 TO03 = 0
TOOLRxD Input 1 0
SEG36 Output 0 0 0 1
P07 P07 Input 1 0
Output 0 0 0/1 0
N-ch open SO00/TxD0 = 1 TO02 = 0
1 0 0/1 0
drain output
SO00 Output PIOR1 = 0 0/1 0 1 0 TO02 = 0
TxD0 Output PIOR1 = 0 0/1 0 1 0 TO02 = 0
TI02 Input PIOR0 = 0 1 0
TO02 Output PIOR0 = 0 0 0 0 0 SO00/TxD0 = 1
INTP2 Input PIOR4 = 0 1 0
TOOLTxD Output 0/1 0 1 0
SEG37 Output 0 0 0 1
P10 P10 Input 1 0
Output 0 0/1 0
SEG4 Output 0 0 1
P11 P11 Input 1 0
Output 0 0/1 0
SEG5 Output 0 0 1
P12 P12 Input 1 0
Output 0 0/1 0
SEG6 Output 0 0 1
P13 P13 Input 1 0
Output 0 0/1 0
SEG7 Output 0 0 1
P14 P14 Input 1 0
Output 0 0/1 0
SEG8 Output 0 0 1
P15 P15 Input 1 0
Output 0 0 0/1 0
(SCK00/SCL00)
N-ch open
1 0 0/1 0 =1
drain output
SEG9 Output 0 0 0 1
(SCK00) Input PIOR1 = 1 1 0
Output PIOR1 = 1 0/1 0 1 0
(SCL00) Output PIOR1 = 1 0/1 0 1 0
P16 P16 Input 1 0
Output 0 0 0/1 0
N-ch open (SDA00) = 1
1 0 0/1 0
drain output
SEG10 Output 0 0 0 1
(SI00) Input PIOR1 = 1 1 0
(RxD0) Input PIOR1 = 1 1 0
(SDA00) I/O PIOR1 = 1 1 0 0 0
Table 4-6. Setting Examples of Registers and Output Latches When Using Alternate Function (3/9)
Pin Used Function PIOR× POM×× PM×× P×× PFSEG×× Alternate Function Output 80-pin 100-pin
Name Function I/O (ISCVL3, SAU Output Other than
Name ISCCAP)Note Function SAU
P17 P17 Input 1 0
Output 0 0 0/1 0
(SO00/TxD0) =
N-ch open
1 0 0/1 0 1
drain output
SEG11 Output 0 0 0 1
(SO00) Output PIOR1 = 1 0/1 0 1 0
(TxD0) Output PIOR1 = 1 0/1 0 1 0
Note ISCVL3 and ISCCAP are registers that correspond to P125, and P126 and P127, respectively.
Table 4-6. Setting Examples of Registers and Output Latches When Using Alternate Function (4/9)
Pin Used Function ADPC ADM2 PM×× P×× 80-pin 100-pin
Name Function I/O
Name
P20 P20 Input 01H 1
Output 01H 0 0/1
ANI0 Analog input 00x0xx0xB
00H/02H to 06H 1
10x0xx0xB
AVREFP Reference
00H/02H to 06H 01x0xx0xB 1
voltage input
P21 P21 Input 01H/02H 1
Output 01H/02H 0 0/1
ANI1 Analog input 00H/03H to 06H xx00xx0xB 1
AVREFM Reference
00H/03H to 06H xx10xx0xB 1
voltage input
P22 P22 Input 01H to 03H 1
Output 01H to 03H 0 0/1
ANI2 Analog input 00H/04H to 06H 1
IVCMP0 Analog input 00H/04H to 06H 1
IVREF1 Analog input 00H/04H to 06H 1
P23 P23 Input 01H to 04H 1
Output 01H to 04H 0 0/1
ANI3 Analog input 00H/05H/06H 1
IVCMP1 Analog input 00H/05H/06H 1
IVREF0 Analog input 00H/05H/06H 1
P24 P24 Input 01H to 05H 1
Output 01H to 05H 0 0/1
ANI4 Analog input 00H/06H 1
P25 P25 Input 01H to 06H 1
Output 01H to 06H 0 0/1
ANI5 Analog input 00H 1
Table 4-6. Setting Examples of Registers and Output Latches When Using Alternate Function (5/9)
Pin Used Function PIOR× POM×× PM×× P×× PFSEG×× Alternate Function Output 80-pin 100-pin
Name Function I/O (ISCVL3, SAU Output Other than
Name ISCCAP)Note Function SAU
P30 P30 Input 1 0
Output 0 0/1 0 (TI07) = 0
SEG24 Output 0 0 1
(TI07) Input PIOR0 = 1 1 0
(TO07) Output PIOR0 = 1 0 0 0
P31 P31 Input 1 0
Output 0 0/1 0 (TI06) = 0
SEG25 Output 0 0 1
(TI06) Input PIOR0 = 1 1 0
(TO06) Output PIOR0 = 1 0 0 0
P32 P32 Input 1 0
Output 0 0/1 0 (PCLBUZ1) = 0
SEG26 Output 0 0 1
(PCLBUZ1) Output PIOR3 = 1 0 0 0
P33 P33 Input 1 0
Output 0 0/1 0 (PCLBUZ0) = 0
SEG27 Output 0 0 1
(PCLBUZ0) Output PIOR3 = 1 0 0 0
P34 P34 Input 1 0
Output 0 0/1 0
SEG28 Output 0 0 1
P35 P35 Input 1 0
Output 0 0/1 0
SEG29 Output 0 0 1
P36 P36 Input 1 0
Output 0 0/1 0
SEG30 Output 0 0 1
P37 P37 Input 1 0
Output 0 0/1 0
SEG31 Output 0 0 1
P40 P40 Input 1
Output 0 0/1
TOOL0 I/O
P41 P41 Input 1
Output TO01 = 0
0 0/1
PCLBUZ1 = 0
TI01 Input PIOR0 = 0 1
TO01 Output PIOR0 = 0 0 0 PCLBUZ1 = 0
PCLBUZ1 Output PIOR3 = 0 0 0 TO01 = 0
P42 P42 Input 1
Output 0 0/1
INTP7 Input PIOR4=0 1
P43 P43 Input 1
TO00 = 0
Output 0 0/1
PCLBUZ0 = 0
TI00 Input PIOR0 = 0 1
TO00 Output PIOR0 = 0 0 0 PCLBUZ0 = 0
PCLBUZ0 Output PIOR3 = 0 0 0 TO00 = 0
P44 P44 Input 1
Output 0 0/1
INTP6 Input PIOR4 = 0 1
Note ISCVL3 and ISCCAP are registers that correspond to P125, and P126 and P127, respectively.
Table 4-6. Setting Examples of Registers and Output Latches When Using Alternate Function (6/9)
Pin Used Function PIOR× POM×× PM×× P×× PFSEG×× Alternate Function Output 80-pin 100-pin
Name Function I/O (ISCVL3, SAU Output Other than SAU
Name ISCCAP)Note Function
P50 P50 Input 1 0
Output 0 0/1 0
SEG32 Output 0 0 1
P51 P51 Input 1 0
Output 0 0/1 0
SEG33 Output 0 0 1
P52 P52 Input 1 0
Output 0 0/1 0
SEG34 Output 0 0 1
P53 P53 Input 1 0
Output 0 0/1 0
SEG35 Output 0 0 1
P54 P54 Input 1 0
Output 0 0/1 0
SEG36 Output 0 0 1
P55 P55 Input 1 0
Output 0 0/1 0
SEG37 Output 0 0 1
P56 P56 Input 1 0
Output 0 0/1 0
SEG38 Output 0 0 1
P57 P57 Input 1 0
Output 0 0/1 0
SEG39 Output 0 0 1
P60 P60 Input 1
N-ch open drain
SCLA0 = 0
output 0 0/1
(TO00) = 0
(6 V tolerance)
SCLA0 I/O 0 0 (TO00) = 0
(TI00) Input PIOR0 = 1 1
(TO00) Output PIOR0 = 1 0 0 SCLA0 = 0
P61 P61 Input 1
N-ch open drain
SDAA0 = 0
output 0 0/1
(TO01) = 0
(6 V tolerance)
SDAA0 I/O 0 0 (TO01) = 0
(TI01) Input PIOR0 = 1 1
(TO01) Output PIOR0 = 1 0 0 SDAA0 = 0
P62 P62 Input 1
N-ch open drain
(TO02) = 0
output 0 0/1
(RTC1HZ) = 0
(6 V tolerance)
(TI02) Input PIOR0 = 1 1
(TO02) Output PIOR0 = 1 0 0 (RTC1HZ) = 0
(RTC1HZ) Output PIOR3 = 1 0 0 (TO02) = 0
P70 P70 Input 1 0
Output 0 0/1 0
SEG16 Output 0 0 1
(INTP0) Input PIOR4 = 1 1 0
P71 P71 Input 1 0
Output 0 0/1 0
SEG17 Output 0 0 1
(INTP1) Input PIOR4 = 1 1 0
Note ISCVL3 and ISCCAP are registers that correspond to P125, and P126 and P127, respectively.
Table 4-6. Setting Examples of Registers and Output Latches When Using Alternate Function (7/9)
Pin Used Function PIOR× POM×× PM×× P×× PFSEG×× Alternate Function Output 80-pin 100-pin
Name Function I/O (ISCVL3, SAU Output Other than
Name ISCCAP)Note Function SAU
P72 P72 Input 1 0
Output 0 0/1 0
SEG18 Output 0 0 1
(INTP2) Input PIOR4 = 1 1 0
P73 P73 Input 1 0
Output 0 0/1 0
SEG19 Output 0 0 1
(INTP3) Input PIOR4 = 1 1 0
P74 P74 Input 1 0
Output 0 0/1 0
SEG20 Output 0 0 1
(INTP4) Input PIOR4 = 1 1 0
P75 P75 Input 1 0
Output 0 0/1 0
SEG21 Output 0 0 1
(INTP5) Input PIOR4 = 1 1 0
P76 P76 Input 1 0
Output 0 0/1 0
SEG22 Output 0 0 1
(INTP6) Input PIOR4 = 1 1 0
P77 P77 Input 1 0
Output 0 0/1 0
SEG23 Output 0 0 1
(INTP7) Input PIOR4 = 1 1 0
P80 P80 Input 1 0
Output 0 0 0/1 0
N-ch open drain (SCL10) = 1
1 0 0/1 0
output
SEG12 Output 0 0 1
(SCL10) Output PIOR2 = 1 0/1 0 1 0
P81 P81 Input 1 0
Output 0 0 0/1 0
N-ch open drain (SDA10) = 1
1 0 0/1 0
output
SEG13 Output 0 0 1
(RxD1) Input PIOR2 = 1 1 0
(SDA10) I/O PIOR2 = 1 1 0 1 0
P82 P82 Input 1 0
Output 0 0 0/1 0
N-ch open drain (TxD1) = 1
1 0 0/1 0
output
SEG14 Output 0 0 1
(TxD1) Output PIOR2 = 1 0/1 0 1 0
P83 P83 Input 1 0
Output 0 0/1 0
SEG15 Output 0 0 1
P84 P84 Input 1 0
Output 0 0/1 0
SEG40 Output 0 0 1
P85 P85 Input 1 0
Output 0 0/1 0
SEG41 Output 0 0 1
Note ISCVL3 and ISCCAP are registers that correspond to P125, and P126 and P127, respectively.
Table 4-6. Setting Examples of Registers and Output Latches When Using Alternate Function (8/9)
Table 4-6. Setting Examples of Registers and Output Latches When Using Alternate Function (9/9)
Pin Used Function PIOR× POM×× PM×× P×× PFSEG×× Alternate Function Output 80-pin 100-pin
Name Function I/O (ISCVL3, SAU Output Other than
Name ISCCAP)Note Function SAU
P125 P125 Input 1 1
Output 0 0/1 1 (TO05) = 0
VL3 1 0
INTP1 Input PIOR4 = 0 1 1
(TI05) Input PIOR0 = 1 1 1
(TO05) Output PIOR0 = 1 0 0 1
P126 P126 Input 1 1
Output 0 0/1 1 (TO04) = 0
CAPL 1 0
(TI04) Input PIOR0 = 1 1 1
(TO04) Output PIOR0 = 1 0 0 1
P127 P127 Input 1 1
Output 0 0/1 1 (TO03) = 0
CAPH 1 0
(TI03) Input PIOR0 = 1 1 1
(TO03) Output PIOR0 = 1 0 0 1
P130 P130 Output 0 0/1 RTC1HZ = 0
RTC1HZ Output PIOR3 = 0 0 0
P137 P137 Input
INTP0 Input PIOR4 = 0
Note ISCVL3 and ISCCAP are registers that correspond to P125, and P126 and P127, respectively.
Reset status
Reset release
PFSEGxx = 0
Caution Be sure to set the segment output mode before segment output starts (while SCOC of LCD mode
register 1 (LCDM1) is 0).
4.5.5 Operation of Ports That Alternately Function as VL3, CAPL, CAPH Pins
The functions of the VL3/P125, CAPL/P126, CAPH/P127 pins can be selected by using the LCD input switch control
register (ISCLCD), LCD mode register 0 (LCDM0), and port mode register 12 (PM12).
(1) VL3/P125
Bias Setting ISCVL3 Bit of PM125 Bit of Pin Function Initial Status
(LBAS1 and LBAS0 Bits of ISCLCD Register PM12 Register
LCDM0 Register )
Reset status
Reset release
ISCVL3 = 1
Caution Be sure to set the VL3 function mode before segment output starts (while SCOC of LCD mode
register 1 (LCDM1) is 0).
LCD Drive Voltage Generator ISCCAP Bit of PM126, PM127 Bits Pin Function Initial Status
(MDSET1 and MDSET0 Bits ISCLCD Register of PM12 Register
of LCDM0 Register )
The following shows the CAPL/P126 and CAPH/P127 pins function status transitions.
Figure 4-14. CAPL/P126 and CAPH/P127 Pins Function Status Transition Diagram
Reset status
Reset release
MDSET1, 0 = 01 or 10
Digital input
invalid mode
MDSET1, 0 = 00
ISCCAP = 1
Caution Be sure to set the CAPL/CAPH function mode before segment output starts (while SCOC of LCD
mode register 1 (LCDM1) is 0).
<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/I1B.
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
The clock generator generates the clock to be supplied to the CPU and peripheral hardware.
The following three system clocks and clock oscillators are selectable.
<1> X1 oscillator
This circuit oscillates the X1 oscillator clock (fX = 1 to 20 MHz) by connecting a resonator to the X1 and X2
pins.
Oscillation can be stopped by executing the STOP instruction or setting the MSTOP bit (bit 7 of the clock
operation status control register (CSC)).
<2> High-speed on-chip oscillator
The oscillation frequency (fIH) can be selected from 24, 12, 6, or 3 MHz (typ.) by using the option byte
(000C2H). After reset release, the CPU always starts operating on this high-speed on-chip oscillator clock.
Oscillation can be stopped by executing the STOP instruction or setting the HIOSTOP bit (bit 0 of the CSC
register).
The frequency specified by using the option byte can be changed by using the high-speed on-chip oscillator
frequency select register (HOCODIV). For details about the frequency, see Figure 5-10 Format of High-
speed On-chip Oscillator Frequency Select Register (HOCODIV).
The frequencies that can be specified for the high-speed on-chip oscillator by using the option byte and the
high-speed on-chip oscillator frequency select register (HOCODIV) are shown below.
An external main system clock (fEX = 1 to 20 MHz) can also be supplied from the EXCLK/X2/P122 pin. The
external main system clock input can be disabled by executing the STOP instruction or setting 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 the MCM0 bit (bit 4 of the system clock control register (CKC)).
<R> However, note that the usable frequency range of the main system clock differs depending on the setting of the
power supply voltage (VDD). The operating voltage of the flash memory must be set by using the CMODE0 and
CMODE1 bits of the option byte (000C2H) (see CHAPTER 32 OPTION BYTE).
An external subsystem clock (fEXS = 32.768 kHz) can also be supplied from the EXCLKS/XT2/P124 pin. An
external subsystem clock input can be disabled by the setting of the XTSTOP bit.
Watchdog timer
Real-time clock 2 (except high-accuracy 1 Hz output function)
12-bit interval timer
Oscillation stop detection circuit
LCD controller/driver
This clock operates when either bit 4 (WDTON) of the option byte (000C0H) or bit 4 (WUTMMCK0) of the
subsystem clock supply 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.
Cautions 1. The low-speed on-chip oscillator clock (fIL) can only be selected as real-time clock 2 count
clock when the fixed-cycle interrupt function is used.
2. Because the low-speed on-chip oscillator clock must always operate to use the oscillator
stop detector, be sure to set bit 4 (WUTMMCK0) of the OSMC register to 1, or bit 4 (WDTON)
and bit 0 (WDSTBYON) of the option byte (000C0H) to 1.
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 registers 0 and 1 (PER0, PER1)
Subsystem clock supply mode control register (OSMC)
High-speed on-chip oscillator frequency select register (HOCODIV)
Peripheral clock control register (PCKC)
Oscillators X1 oscillator
XT1 oscillator
High-speed on-chip oscillator
Low-speed on-chip oscillator
Internal bus
RL78/I1B
AMPH EXCLK OSCSEL MSTOP OSTS2 OSTS1 OSTS0 CLS CSS MCS MCM0
Standby controller
3
STOP mode
X1 oscillation
stabilization time counter
STOP mode HALT mode
signal
R01UH0407EJ0210 Rev.2.10
MOST MOST MOST MOST MOST MOST MOST MOST Normal
operation mode
High-speed system 8 9 10 11 13 15 17 18
X1/P121 clock oscillator
Crystal/ceramic Oscillation stabilization
fX time counter status
oscillation fMX
X2/EXCLK register (OSTC)
/P122 External input
fEX
clock
24-bit ΔΣ-type
Controller A/D converter
High-speed on-chip oscillator fHOCO/2 fMAIN
DSADCK DSADCEN Subsystem clock
Controller frequency fCLK
(24 MHz (TYP.)) (12 MHz (TYP.)) Real-time clock 2 Main system clock CPU clock CPU
Controller measurement circuit source selector and peripheral
(for high-accuracy 1 Hz output) hardware
fIH WUTMMCK0 clock source
(6 MHz (TYP.)) (3 MHz (TYP.)) selection
WUTMMCK0 Timer array unit
Option byte (000C0H)
WDTON Serial array unit 0
WDSTBYON Serial array unit 1
Low-speed Serial interface IICA0
on-chip oscillator 10-bit A/D converter
HALT/STOP mode signal
fIL IrDA
(15 kHz (TYP.)) Watchdog timer
Controller
CLS
RTCW IRDA ADC IICA0 SAU1 SAU0 TAU0 TMKA FMC CMP OSDC DTC DSADC
AMPHS1 AMPHS0 EXCLKS OSCSELS HOCODIV2 HOCODIV1 HOCODIV0 XTSTOP HIOSTOP RTCLPC WUTMMCK0 DSADCK
EN EN EN EN EN EN EN EN EN EN EN EN EN
Clock operation mode High-speed on-chip Clock operation Subsystem clock supply Peripheral clock Peripheral enable Peripheral enable
control register oscillator frequency select status control mode control register control register register 0 (PER0) register 1 (PER1)
(CMC) register (HOCODIV) register (CSC) (OSMC) (PCKC)
Internal bus
126
RL78/I1B CHAPTER 5 CLOCK GENERATOR
Note Selecting fSUB as the output clock of the clock output/buzzer output controller is prohibited when the
WUTMMCK0 bit is set to 1.
Caution The EXCLKS, OSCSELS, AMPHS1, and AMPHS0 bits are reset only by a power-on reset; they retain
the previous values when a reset caused by another factor occurs.
Note
Address: FFFA0H After reset: 00H R/W
Symbol 7 6 5 4 3 2 1 0
Note Note Note Note
CMC EXCLK OSCSEL EXCLKS OSCSELS 0 AMPHS1 AMPHS0 AMPH
Note The EXCLKS, OSCSELS, AMPHS1, and AMPHS0 bits are reset only by a power-on reset; they
retain the values when a reset caused by another factor occurs.
Cautions 1. The CMC register can be written only once after a reset ends, by an 8-bit memory
manipulation instruction. When using the CMC register with its initial value (00H), be
sure to set the register to 00H after a reset ends in order to prevent malfunction due
to a program loop. A malfunction caused by mistakenly writing a value other than
00H is unrecoverable.
2. After a reset ends, set up the CMC register before setting the clock operation status
control register (CSC) to start X1 or XT1 oscillation .
3. Be sure to set the AMPH bit to 1 if the X1 clock oscillation frequency exceeds 10 MHz.
4. Specify the settings for the AMPH, AMPHS1, and AMPHS0 bits while fIH is selected as
fCLK after a reset ends (before fCLK is switched to fMX).
5. Count the fXT oscillation stabilization time by using software.
Cautions 6. Although the maximum system clock frequency is 24 MHz, the maximum frequency
of the X1 oscillator is 20 MHz.
7. If a reset other than a power-on reset occurs after the CMC register is written and
then the reset ends, be sure to set the CMC register to the value specified before the
reset occurred, to prevent a malfunction if a program loop occurs.
8. 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.
Before using the ultra-low power consumption oscillation (AMPHS1, AMPHS0 = 1,
0) as the mode of the XT1 oscillator, evaluate the resonators described in 5.7
Resonator and Oscillator Constants.
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)
Caution The XTSTOP bit is reset only by a power-on reset; it retains the value when a reset caused by
another factor occurs.
Note The XTSTOP bit is reset only by a power-on reset; it retains the value when a reset caused by
another factor occurs.
Cautions 1. After reset release, set the clock operation mode control register (CMC) before
setting the CSC register.
2. Set up the oscillation stabilization time select register (OSTS) before setting the
MSTOP bit to 0 after releasing reset. Note that if the OSTS register is used with its
default settings, setting the OSTS register is not required here.
3. When starting X1 oscillation by setting 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.
Cautions 5. Do not stop the clock selected for the CPU/peripheral hardware clock (fCLK) by using
the OSC register.
<R> 6. The setting of the flags of the register to stop clock oscillation (disabling the external
clock input) and the condition before clock oscillation is stopped are shown in Table
5-2. When stopping the clock, confirm the condition before stopping clock.
XT1 oscillator clock The CPU/peripheral hardware clock is a clock other than the XTSTOP = 1
External subsystem clock subsystem clock.
(CLS = 0)
High-speed on-chip The CPU/peripheral hardware clock is a clock other than the HIOSTOP = 1
oscillator clock high-speed on-chip oscillator clock.
(CLS = 0 and MCS = 1, or CLS = 1)
If the X1 clock starts oscillating while the high-speed on-chip oscillator clock or subsystem clock is used as the
CPU clock
If the STOP mode is entered and then exited while the high-speed on-chip oscillator clock is used as the CPU clock
and the X1 clock is oscillating
The OSTC register can be read by a 1-bit or 8-bit memory manipulation instruction.
Occurrence of a reset signal, executing the STOP instruction, or setting MSTOP (bit 7 of clock operation status control
register (CSC)) to 1 clears 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 exited
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
8
0 0 0 0 0 0 0 0 2 /fX max. 25.6 μs max. 12.8 μs max.
8
1 0 0 0 0 0 0 0 2 /fX min. 25.6 μs min. 12.8 μs min.
9
1 1 0 0 0 0 0 0 2 /fX min. 51.2 μs min. 25.6 μs min.
10
1 1 1 0 0 0 0 0 2 /fX min. 102 μs min. 51.2 μs min.
11
1 1 1 1 0 0 0 0 2 /fX min. 204 μs min. 102 μs min.
13
1 1 1 1 1 0 0 0 2 /fX min. 819 μs min. 409 μs min.
15
1 1 1 1 1 1 0 0 2 /fX min. 3.27 ms min. 1.63 ms min.
17
1 1 1 1 1 1 1 0 2 /fX min. 13.1 ms min. 6.55 ms min.
18
1 1 1 1 1 1 1 1 2 /fX min. 26.2 ms min. 13.1 ms min.
Cautions 1. After the above time has elapsed, the bits are set to 1 starting 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 a
value greater than the count value to be monitored by using the OSTC register after
the oscillation starts.
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. Change the setting of the OSTS register before setting the MSTOP bit of the clock
operation status control register (CSC) to 0.
2. 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 a
value greater than the count value to be monitored by using the OSTC register after
the oscillation starts.
3. The X1 clock oscillation stabilization wait time does not include the time until clock
oscillation starts (“a” below).
X1 pin voltage
waveform
The PER0 and PER1 registers can be set by a 1-bit or 8-bit memory manipulation instruction.
Reset signal generation clears these registers to 00H.
Figure 5-9. Format of Subsystem Clock Supply Mode Control Register (OSMC)
RTCLPC Setting in STOP mode or in HALT mode while subsystem clock is selected as CPU clock
Cautions 1. Setting the RTCLPC bit to 1 can reduce current consumption in STOP mode and in HALT
mode with the CPU operating on the subsystem clock. However, setting the RTCLPC bit
to 1 means that there is no clock supply to peripheral circuits other than real-time clock
2, 12-bit interval timer, clock output/buzzer output controller, and LCD controller/driver
in HALT mode with the CPU operating on the subsystem clock. Before setting the
system to HALT mode with the CPU operating on the subsystem clock, therefore, be
sure to set bit 7 (RTCWEN) of peripheral enable register 0 (PER0) and bit 7 (TMKAEN) of
peripheral enable register 1 (PER1) to 1, and bits 0, 2, and 3 of PER0, and bit 5 of PER1
to 0.
2. If the subsystem clock is oscillating, only the subsystem clock can be selected
(WUTMMCK0 = 0).
3. When WUTMMCK0 is set to 1, the low-speed on-chip oscillator clock oscillates.
Cautions 4. When WUTMMCK0 is set to 1, only the constant-period interrupt function of real-time
clock 2 can be used. The year, month, day of the week, day, hour, minute, and second
counters and the 1 Hz output function of real-time clock 2 cannot be used.
The interval of the constant-period interrupt is calculated by constant period (value
selected by using the RTCC0 register) fSUB/fIL.
5. The subsystem clock and low-speed on-chip oscillator clock can only be switched by
using the WUTMMCK0 bit if real-time clock 2, 12-bit interval timer, and LCD
controller/driver are all stopped.
These are stopped as follows:
Real-time clock 2: Set the RTCE bit to 0.
12-bit interval timer: Set the RINTE bit to 0.
LCD controller/driver: Set the SCOC and VLCON bits to 0.
6. Do not select fSUB as the clock output from the output/buzzer output controller or the
operation clock of the 8-bit interval timer when the WUTMMCK0 bit is 1.
Figure 5-10. Format of High-speed On-chip Oscillator Frequency Select Register (HOCODIV)
Address: F00A8H After reset: the value set by FRQSEL2 to FRQSEL0 of the option byte (000C2H) R/W
Symbol 7 6 5 4 3 2 1 0
0 0 0 fIH = 24 MHz
0 0 1 fIH = 12 MHz
0 1 0 fIH = 6 MHz
0 1 1 fIH = 3 MHz
Other than above Setting prohibited
Cautions 1. Set the HOCODIV register within the operable voltage range of the flash operation mode
set in the option byte (000C2H) both before and after changing the frequency.
2. Set the HOCODIV register while the high-speed on-chip oscillator clock (fIH) is selected as
the CPU/peripheral hardware clock (fCLK).
3. After the frequency has been changed using the HOCODIV register and the following
transition time has been elapsed, the frequency is switched.
• Operation for up to three clocks at the pre-change frequency
• CPU/peripheral hardware clock wait at the post-change frequency for up to three clocks
PCKC 0 0 0 0 0 0 0 DSADCK
Note Only crystal oscillator 12 MHz is allowed as high-speed system clock frequency (fMX).
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, specify the input port mode (EXCLK, OSCSEL = 0, 0).
When the X1 and X2 pins are not used as input port pins, either, see Table 2-3 Connection of Unused Pins.
Figure 5-12 shows an example of the external circuit connected to the X1 oscillator.
VSS
X1
X2 EXCLK
External clock
Crystal resonator
or
ceramic resonator
VSS
XT1
32.768
kHz
XT2 External clock EXCLKS
Caution When using the X1 oscillator and XT1 oscillator, wire as follows in the area enclosed by the
broken lines in the Figures 5-12 and 5-13 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.
• Before using the ultra-low power consumption oscillation (AMPHS1, AMPHS0 = 1, 0) as the
mode of the XT1 oscillator, evaluate the resonators described in 5.7 Resonator and Oscillator
Constants.
• 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.
Caution Because the low-speed on-chip oscillator clock must always operate to use the oscillator stop
detector, be sure to set bit 4 (WUTMMCK0) of the OSMC register to 1, or bit 4 (WDTON) and bit 0
(WDSTBYON) of the option byte (000C0H) to 1.
The clock generator generates the following clocks and controls the operation modes of the CPU, such as standby
mode (see Figure 5-1).
In the RL78/I1B, the CPU starts operating when the high-speed on-chip oscillator starts generating the clock after reset
release.
The clock generator operation after the power supply voltage is turned on is shown in Figure 5-15.
Figure 5-15. Clock Generator Operation When Power Supply Voltage Is Turned On
Lower limit of
the operating
voltage range
VPOR
<1>
RESET pin
Switched by software
Reset
processing timeNote 3 <3> <5> <5>
CPU clock High-sped on-chip oscillator clock High-speed system clock Subsystem clock
<2>
High-speed on-chip
oscillator clock (fIH)
Note 1
High-speed <4>
system clock (fMX)
(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. Note that
the reset state is maintained after a reset by the voltage detection circuit or an external reset until the voltage
reaches the range of operating voltage described in 37.4 AC Characteristics (the above figure is an example
when the external reset is in use).
<2> When the reset is released, the high-speed on-chip oscillator automatically starts oscillation.
<3> The CPU starts operation on the high-speed on-chip oscillator clock after waiting for the voltage to stabilize and a
reset processing have 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 reset processing time includes the oscillation accuracy stabilization time of the high-speed on-chip
oscillator clock.
2. When releasing a reset, confirm the X1 clock oscillation stabilization time by using the oscillation
stabilization time counter status register (OSTC).
3. For the reset processing time, see CHAPTER 26 POWER-ON-RESET CIRCUIT.
Caution Waiting for the oscillation to stabilize is not necessary when an external clock input from the EXCLK
pin is used.
0 0 0 fIH = 24 MHz
0 0 1 fIH = 12 MHz
0 1 0 fIH = 6 MHz
0 1 1 fIH = 3 MHz
[Register settings] Set the register according to steps <1> to <5> below.
<1> Set the OSCSEL bit of the CMC register to 1. If fX is 10 MHz or less, set the AMPH bit to 1 instead, to start 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 0/1
<2> Using the OSTS register, select the oscillation stabilization time of the X1 oscillator after the STOP mode is exited.
Example: Specify as below to wait for oscillation to stabilize for at least 102.4 μs when using 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 the MSTOP bit of the CSC register to 0 to start oscillation of 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 are set to the following values to wait for at least 102.4 μs for oscillation to stabilize
when using 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
Cautions 1 The EXCLKS, OSCSELS, AMPHS1, AMPHS0 and XTSTOP bits are reset only by a power-on reset;
they retain the previous values when a reset caused by another factor occurs.
<R> Cautions 2. Set the HOCODIV register within the operable voltage range of the flash operation mode set in
the option byte (000C2H) both before and after changing the frequency.
[Register settings] Set the register according to steps <1> to <5> below.
<1> Set the RTCLPC bit to 1 to run only real-time clock 2, 12-bit interval timer, LCD controller/driver, 8-bit interval timer,
and oscillation stop detector on the subsystem clock (for ultra-low current consumption) in the STOP mode or
HALT mode during CPU operation on the subsystem clock.
7 6 5 4 3 2 1 0
RTCLPC WUTMMCK0
OSMC
0/1 0 0 0 0 0 0 0
<2> Set the OSCSELS bit of the CMC register to 1 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: Use these bits to specify the oscillation mode of the XT1 oscillator.
<3> Clear the XTSTOP bit of the CSC register to 0 to start oscillation of 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 features such as the timer 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
Caution The EXCLKS, OSCSELS, AMPHS1, AMPHS0 and XTSTOP bits are reset only by a power-on reset;
they retain the previous values when a reset caused by another factor occurs.
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 special function registers (SFRs).
Table 5-3. CPU Clock Transition and SFR Setting Examples (1/5)
(1) CPU operating on high-speed on-chip oscillator clock (B) after reset release (A)
(A) (B) SFR setting not required (SFRs are in the default status after reset release).
(2) CPU operating on high-speed system clock (C) after reset release (A)
(The CPU operates on the high-speed on-chip oscillator clock immediately after reset release (B).)
Notes 1. The clock operation mode control register (CMC) can be written only once by an 8-bit memory
manipulation instruction after reset release.
2. Set the oscillation stabilization time as follows.
Desired oscillation stabilization time indicated by the oscillation stabilization time counter status register
(OSTC) Oscillation stabilization time set by the oscillation stabilization time select register (OSTS)
Caution Specify the clock after the supply voltage has reached the operable voltage of the clock to be
specified (see CHAPTER 37 ELECTRICAL SPECIFICATIONS).
(3) CPU operating on subsystem clock (D) after reset release (A)
(The CPU operates on the high-speed on-chip oscillator clock immediately after 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 Setting Examples (2/5)
(4) Changing CPU clock 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 oscillation stabilization time indicated by the oscillation stabilization time counter status register
(OSTC) Oscillation stabilization time set by the oscillation stabilization time select register (OSTS)
Caution Specify the clock after the supply voltage has reached the operable voltage of the clock to be
specified (see CHAPTER 37 ELECTRICAL SPECIFICATIONS).
(5) Changing CPU clock 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. This setting is not necessary if it has already been set.
Table 5-3. CPU Clock Transition and SFR Setting Examples (3/5)
(6) Changing CPU clock from high-speed system clock (C) to high-speed on-chip oscillator clock (B)
(C) (B) 0 18 μs to 65 μs 0
Remark The oscillation accuracy stabilization time changes according to the temperature conditions and the STOP
mode period.
(7) Changing CPU clock from high-speed system clock (C) to subsystem clock (D)
SFR Flag to Set CSC Register Waiting for Oscillation CKC Register
Status Transition XTSTOP Stabilization CSS
(8) Changing CPU clock from subsystem clock (D) to high-speed on-chip oscillator clock (B)
Setting Flag of SFR Register CSC Register Oscillation accuracy CKC Register
Status Transition HIOSTOP stabilization time CSS
(D) (B) 0 18 μs to 65 μs 0
Remarks 1. (A) to (J) in Table 5-3 correspond to (A) to (J) in Figure 5-16.
2. The oscillation accuracy stabilization time changes according to the temperature conditions and the
STOP mode period.
Table 5-3. CPU Clock Transition and SFR Setting Examples (4/5)
(9) Changing CPU clock from subsystem clock (D) to high-speed system clock (C)
Setting Flag of SFR Register OSTS CSC Register OSTC Register CKC Register
Status Transition Register MSTOP CSS
Caution Specify the clock after the supply voltage has reached the operable voltage of the clock to be
specified (see CHAPTER 37 ELECTRICAL SPECIFICATIONS).
(10) HALT mode (E) entered while CPU is operating on high-speed on-chip oscillator clock (B)
HALT mode (F) entered while CPU is operating on high-speed system clock (C)
HALT mode (G) entered while CPU is operating on subsystem clock (D)
Remark (A) to (J) in Table 5-3 correspond to (A) to (J) in Figure 5-16.
Table 5-3. CPU Clock Transition and SFR Setting Examples (5/5)
(11) STOP mode (H) entered while CPU is operating on high-speed on-chip oscillator clock (B)
STOP mode (I) entered while CPU is operating on high-speed system clock (C)
(Setting sequence)
(12) Changing CPU operating mode from STOP mode (H) to SNOOZE mode (J)
For details about the setting for switching from the STOP mode to the SNOOZE mode, see 14.8 SNOOZE Mode
Function, 18.5.7 SNOOZE mode function, and 18.6.3 SNOOZE mode function.
Remark (A) to (J) in Table 5-3 correspond to (A) to (J) in Figure 5-16.
5.6.5 Conditions before changing the CPU clock and processing after changing CPU clock
The conditions before changing the CPU clock and processing after changing the CPU clock are shown below.
X1 clock High-speed on- Enabling oscillation of high-speed on-chip After confirming that the CPU clock has
chip oscillator oscillator changed from the X1 clock to the high-
clock HIOSTOP = 0 speed on-chip oscillator clock, the X1
The oscillation accuracy stabilization time oscillation can be stopped (MSTOP = 1).
has elapsed
External main Transition impossible
system clock
XT1 clock XT1 oscillation is stable After confirming that the CPU clock has
OSCSELS = 1, EXCLKS = 0, XTSTOP = 0 changed from the X1 clock to the XT1 clock,
The oscillation stabilization time has the X1 oscillation can be stopped (MSTOP
elapsed = 1).
External Inputting the external clock from the After confirming that the CPU clock has
subsystem clock EXCLKS pin is enabled changed from the X1 clock to the external
OSCSELS = 1, EXCLKS = 1, XTSTOP = 0 subsystem clock, the X1 oscillation can be
stopped (MSTOP = 1).
External main High-speed on- Enabling oscillation of high-speed on-chip After confirming that the CPU clock has
system clock chip oscillator oscillator changed from the external main system
clock HIOSTOP = 0 clock to the high-speed on-chip oscillator
The oscillation accuracy stabilization time clock, inputting the external main system
has elapsed clock can be disabled (MSTOP = 1).
X1 clock Transition impossible
XT1 clock XT1 oscillation is stable After confirming that the CPU clock has
OSCSELS = 1, EXCLKS = 0, XTSTOP = 0 changed from the external main system
The oscillation stabilization time has clock to the XT1 clock, inputting the external
elapsed main system clock can be disabled (MSTOP
= 1).
External Inputting the external clock from the After confirming that the CPU clock has
subsystem clock EXCLKS pin is enabled changed from the external main system
OSCSELS = 1, EXCLKS = 1, XTSTOP = 0 clock to the external subsystem clock,
inputting the external main system clock can
be disabled (MSTOP = 1).
External High-speed on- The high-speed on-chip oscillator is After confirming that the CPU clock has
subsystem clock chip oscillator oscillating and the high-speed on-chip
changed from the external subsystem clock
clock oscillator clock is selected as the main
to the high-speed on-chip oscillator clock, X1
system clock
HIOSTOP = 0, MCS = 0 clock, or external main system clock,
X1 clock X1 oscillation is stable and the high-speed inputting the external subsystem clock can
system clock is selected as the main system be disabled (XTSTOP = 1).
clock
OSCSEL = 1, EXCLK = 0, MSTOP = 0
The oscillation stabilization time has
elapsed
MCS = 1
External main Inputting the external clock from the EXCLK
system clock pin is enabled and the high-speed system
clock is selected as the main system clock
OSCSEL = 1, EXCLK = 1, MSTOP = 0
MCS = 1
XT1 clock Transition impossible
5.6.6 Time required for switching CPU clock and 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 clock is not switched immediately after rewriting the CKC register; operation continues on the clock before the
change for several clock cycles (see Table 5-5 to Table 5-7).
Whether the CPU is operating on the main system clock or the subsystem clock can be checked by 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 checked by using bit 5 (MCS) of the CKC register.
When the CPU clock is switched, the peripheral hardware clock is also switched.
Table 5-6. Maximum Number of Clock Cycles Required for Switching Between fIH and fMX
Table 5-7. Maximum Number of Clocks Required for Switching Between fMAIN and fSUB
1 3 clock cycles
(f CLK = f SUB)
Remarks 1. The number of clock cycles in Table 5-6 and Table 5-7 is the number of CPU clock cycles before
switchover.
2. Calculate the number of clock cycles in Table 5-6 and Table 5-7, rounding out the decimal values.
Example When switching the main system clock from the high-speed system clock to the high-speed on-
chip oscillator clock (when fIH = 6 MHz, fMX = 10 MHz)
2 fMX/fIH cycles = 2 (10/6) = 3.3 4 clock cycles
Table 5-8. Conditions Before Stopping the Clock Oscillation and Flag Settings
The resonators for which the operation is verified and their oscillator constants are shown below.
Cautions 1. The constants for these oscillator circuits are reference values based on specific environments
set up for evaluation by the manufacturers. For actual applications, request evaluation by the
manufacturer of the oscillator circuit mounted on a board. Furthermore, if you are switching
from a different product to this microcontroller, and whenever you change the board, again
request evaluation by the manufacturer of the oscillator circuit mounted on the new board.
2. The oscillation voltage and oscillation frequency only indicate the oscillator characteristic. Use
the RL78 microcontroller so that the internal operation conditions are within the specifications of
the DC and AC characteristics.
(1) X1 oscillation:
As of March, 2014 (1/2)
Manufacturer Resonator Part Number SMD/ Frequency Flash Recommended Circuit Oscillation Voltage
Note 2
Lead (MHz) operation Constants (reference) Range (V)
Note 1
mode C1 (pF) C2 (pF) Rd (kΩ) MIN. MAX.
Notes 1. Set the flash operation mode by using CMODE1 and CMODE0 bits of the option byte (000C2H).
2. Values in parentheses in the C1 and C2 columns indicate an internal capacitance.
3. When using this resonator, for details about the matching, contact Murata Manufacturing Co., Ltd.
(http://www.murata.com).
Remark Relationship between operation voltage width, operation frequency of CPU and operation mode is as below.
HS (high-speed main) mode: 2.7 V VDD 5.5 V@1 MHz to 24 MHz
2.4 V VDD 5.5 V@1 MHz to 16 MHz
LS (low-speed main) mode: 1.9 V VDD 5.5 V@1 MHz to 8 MHz
Notes 1. Set the flash operation mode by using CMODE1 and CMODE0 bits of the option byte (000C2H).
2. This resonator supports operation at up to 85C.
3. When using this resonator, for details about the matching, contact Nihon Dempa Kogyo Co., Ltd
(http://www.ndk.com/en).
4. When using this resonator, for details about the matching, contact Kyocera Crystal Device Co., Ltd.
(http://www.kyocera-crystal.jp/eng/index.html, http://global.kyocera.com).
5. When using this resonator, for details about the matching, contact RIVER ELETEC CORPORATION
(http://www.river-ele.co.jp/english/index.html).
Remark Relationship between operation voltage width, operation frequency of CPU and operation mode is as below.
HS (high-speed main) mode: 2.7 V VDD 5.5 V@1 MHz to 24 MHz
2.4 V VDD 5.5 V@1 MHz to 16 MHz
LS (low-speed main) mode: 1.9 V VDD 5.5 V@1 MHz to 8 MHz
Using the subsystem clock fSUB (32.768 kHz) as a reference, the frequency of high-speed on-chip oscillator is
measured, and the accuracy of the high-speed on-chip oscillator clock (fIH) frequency is corrected in real time.
Table 6-1 lists the operation specifications of high-speed on-chip oscillator clock frequency correction function and
Figure 6-1 shows the block diagram of high-speed on-chip oscillator clock frequency correction function.
Table 6-1. Operation Specifications of High-speed On-chip Oscillator Clock Frequency Correction Function
Item Description
9
Reference clock • fSUB/2 (subsystem clock: 32.768 kHz)
Clock to be corrected • fIH (high-speed on-chip oscillator clock)
Operating modes • Continuous operating mode
The high-speed on-chip oscillator clock frequency is corrected continuously.
• Intermittent operating mode
The high-speed on-chip oscillator clock frequency is corrected intermittently
using a timer interrupt, etc.
• Correction time: Correction cycle (31.2 ms) (number of corrections 0.5)
Note
Clock accuracy correction function
Interrupt • Output when high-speed on-chip oscillator clock frequency correction is
completed (while interrupt output is enabled).
Figure 6-1. Block Diagram of High-speed On-chip Oscillator Clock Frequency Correction Function
CPU bus
Cautions 1. A subsystem clock is necessary to use the high-speed on-chip oscillator clock frequency
correction function. Connect a sub clock oscillator to XT1 and XT2.
2. Use this function as necessary to select a high-speed on-chip oscillator as the operating clock
when using a 24 bit ∆Σ type A/D converter.
6.2 Register
Table 6-2 lists the register used for the high-speed on-chip oscillator clock frequency correction function.
Table 6-2. Register for High-speed On-chip Oscillator Clock Frequency Correction Function
Item Configuration
Control registers High-speed on-chip oscillator clock frequency correction control register (HOCOFC)
6.2.1 High-speed on-chip oscillator clock frequency correction control register (HOCOFC)
This register is used to control the high-speed on-chip oscillator clock frequency correction function.
The HOCOFC register can be set by an 8-bit memory manipulation instruction.
Reset signal generation clears this register to 00H.
Figure 6-2. Format of High-Speed On-Chip Oscillator Clock Frequency Correction Control Register (HOCOFC)
Note 1
FCMD High-speed on-chip oscillator clock frequency correction function operating mode
FCIE Control of high-speed on-chip oscillator clock frequency correction end interrupt
0 No interrupt is generated when high-speed on-chip oscillator clock frequency correction is completed
1 An interrupt is generated when high-speed on-chip oscillator clock frequency correction is completed
Note 2
FCST High-speed on-chip oscillator clock frequency correction circuit operation control/status
0 High-speed on-chip oscillator clock frequency correction circuit stops operating/frequency correction
is completed
1 High-speed on-chip oscillator clock frequency correction circuit starts operating/frequency correction
is operating
In continuous operating mode, operation is stopped by writing 0 to this bit by software.
In intermittent operating mode, the FCST bit is cleared by hardware after correction is completed.
Notes 1. Do not rewrite the FCMD bit when the FCST bit is 1.
2. When writing 1 to the FCST bit, confirm that the FCST bit is 0 before writing 1 to FCST. However,
when writing 1 to the FCST bit immediately after intermittent operation is completed (an interrupt is
generated when high-speed on-chip oscillator clock frequency correction is completed), wait for at
least one fIH cycle to elapse after the high-speed on-chip oscillator clock frequency correction end
interrupt is generated because clearing by hardware has priority.
After writing 0 (high-speed on-chip oscillator clock frequency correction circuit stops operating) to
the FCST bit, do not write 1 (high-speed on-chip oscillator clock frequency correction circuit starts
operating) to the FCST bit for two fIH cycles.
6.3 Operation
Table 6-3. High-Speed On-Chip Oscillator Input Frequency and Correction Cycle
Note
fIH (MHz) HOCODIV2 to HOCODIV0 (HOCODIV Register) Correction Cycle (ms)
24 000 31.2
12 001 (frequency measurement phase
6 010 +
Note Be sure to change the high-speed on-chip oscillator frequency select register (HOCODIV) only when the high-
speed on-chip oscillator clock frequency correction function is not used.
The frequency measurement phase period for the correction cycle is counted using the high-speed on-chip oscillator
clock, and the high-speed on-chip oscillator frequency is corrected depending on the count result and whether it is greater
or smaller than the expected value.
Figure 6-3. Operation Timing (Details) of High-speed On-chip Oscillator Clock Frequency Correction
Remark Basic operation is the same in both continuous and intermittent operating modes. Only the difference
between these modes is clearing the FCST bit is controlled by either software or hardware. In addition, the
correction value is not cleared until a reset is applied to the system.
When the FCIE bit in the HOCOFC register is set to 1, a high-speed on-chip oscillator clock frequency correction end
interrupt is output every time high-speed on-chip oscillator clock frequency correction is completed. In continuous
operating mode, the frequency measurement phase and the frequency correction phase are repeated until the high-
speed on-chip oscillator clock frequency correction function is stopped.
Figure 6-4 shows the continuous operating mode timing.
Operation timing
Continuous Operating Mode
Reference
clock
(fSUB/29)
FCMD
(operating Continuous Operating Mode 0
mode bit)
FCST
(operation
enable bit) FCST clearing: Cleared by software.
19-bit
count register Mid-count value
+1 +1 No difference retained
Correction
value 0000000B 0000001B 0000010B 0000010B
[6:0]
High-speed on-chip
oscillator clock
frequency correction Interrupt output:
end interrupt output A pulse of one f IH cycle is output on completion of correction when the FCIE bit is 1.
While the FCIE bit in the HOCOFC register is set to 1, a high-speed on-chip oscillator clock frequency correction end
interrupt is output when high-speed on-chip oscillator clock frequency correction is completed. In intermittent
operating mode, the frequency measurement phase and the frequency correction phase are repeated, and high-
speed on-chip oscillator clock frequency correction operation is stopped after high-speed on-chip oscillator clock
frequency correction is completed.
Figure 6-5 shows the intermittent operating mode timing.
• Operation timing
Reference
clock
(fSUB/29)
FCMD
(operating
mode bit)
Intermittent Operating Mode 1
FCST
(operation
enable bit) FCST clearing:
Cleared by hardware when there is no change in the correction value .
19-bit
count register Count value retained
Correction +1 +1 No difference
value
[6:0] 0000000B 0000001B “0000010B” 0000010B45
High-speed on-chip
oscillator clock frequency Interrupt output:
correction end interrupt
output A pulse of one fIH cycle is output on completion of correction when the FCIE bit is 1.
Yes Yes
High-speed on-chip oscillator clock
HOCOFC = 01H frequency correction end interrupt High-speed on-chip oscillator clock
disabled frequency correction completed
Yes
High-speed on-chip oscillator clock
frequency correction completed
Note The high speed on-chip oscillator clock frequency correction is repeated until the high speed on-chip oscillator
clock frequency correction function is stopped.
channel 1
channel 2
channel 6
channel 7
It is possible to use the 16-bit timer of channels 1 and 3 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 (upper or lower 8-bit timer)/square wave output (lower 8-bit timer only)
External event counter (lower 8-bit timer only)
Delay counter (lower 8-bit timer only)
Channel 7 can be used to realize LIN-bus communication operating in combination with UART0 of the serial array unit.
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 For details about the rules of simultaneous channel operation function, see 7.4.1 Basic rules of
simultaneous channel operation function.
Caution There are several rules for using 8-bit timer operation function.
For details, see 7.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 7.3.13 Input switch control
register (ISC) and 7.8.4 Operation as input signal high-/low-level width measurement.
Item Configuration
Timer/counter Timer count register mn (TCRmn)
Register Timer data register mn (TDRmn)
Timer input TI00 to TI07, RxD0 pin (for LIN-bus)
Timer output TO00 to TO07 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 register 1 (NFEN1)
Port mode registers (PM0, PM3, PM4, PM6, PM12)
Port registers (P0, P3, P4, P6, P12)
Figure 7-1 shows the block diagrams of the timer array unit.
PRS031PRS030 PRS021 PRS020 PRS013 PRS012PRS011 PRS010 PRS003 PRS002 PRS001 PRS000
2 2 4 4
fCLK Prescaler
fCLK/2 , fCLK/22,
1
CK03
CK02
CK01
CK00
TO00
INTTM00
TI00
(Timer interrupt)
Channel 0
TO01
INTTM01
TI01 Channel 1 INTTM01H
TO02
TI02 INTTM02
Channel 2
TO03
Timer input select
INTTM03
register 0 (TIS0)
TI03
Channel 3 INTTM03H
TIS02 TIS01 TIS00
TO04
fSUB TO05
Selector
fIL INTTM05
Channel 5
TI05
TO06
Input switch
control register TI06 Channel 6 INTTM06
(ISC)
ISC1
TO07
TI07
Channel 7 (LIN-bus supported) INTTM07
Selector
RxD0
(Serial input pin)
clock selection
Count clock
CK00 Timer controller Output
Operating
selection
fMCK fTCLK TO00
controller
CK01
Output latch
Mode (Pxx) PMxx
selection
Interrupt
INTTM00
controller
(Timer interrupt)
selection
Trigger
Edge
TI00 detection
Timer counter register 00 (TCR00)
Timer status
register 00 (TSR00)
OVF
Timer data register 00 (TDR00)
Overflow 00
CKS00 CCS00 0 STS002 STS001 STS000 CIS001 CIS000 MD003 MD002 MD001 MD000
CK00
clock selection
Count clock
selection
detection
Trigger
CKS0n CCS0n MAS STS0n2 STS0n1 STS0n0 CIS0n1 CIS0n0 MD0n3 MD0n2 MD0n1 MD0n0
TER0n
Channel n Timer mode register 0n (TMR0n)
Remark n = 2, 4, 6
CK00
clock selection
Count clock
Output
Operating
selection
CK01 fMCK fTCLK Timer controller TO0n
controller
CK02
CK03 Output latch
Mode (Pxx) PMxx
selection
Interrupt
INTTM0n
controller
(Timer interrupt)
selection
Trigger
TI0n Edge
detection Timer counter register 0n (TCR0n)
Timer status
register 0n (TSR0n)
OVF
Timer data register 0n (TDR0n)
Overflow 0n
8-bit timer
controller Interrupt
INTTM0nH
Mode controller
(Timer interrupt)
selection
SPLIT
CKS0n CCS0n STS0n2 STS0n1 STS0n0 CIS0n1 CIS0n0 MD0n3 MD0n2 MD0n1 MD0n0
0n
Channel n Timer mode register 0n (TMR0n)
Remark n = 1, 3
CK00
Count clock
Output
Operating
selection
Edge
detection Timer counter register 05 (TCR05)
fIL Timer status
Selector
CKS05 CCS05 STS052 STS051 STS050 CIS051 CIS050 MD053 MD052 MD051 MD050
clock selection
Count clock
CK00 Output
Operating
selection
fMCK fTCLK Timer controller TO07
controller
CK01
Output latch
Mode (Pxx) PMxx
selection
Interrupt
controller INTTM07
(Timer interrupt)
selection
Trigger
Selector
TI07
Edge
detection Timer counter register 07 (TCR07)
RxD0
Timer status
register 07 (TSR07)
CKS07 CCS07 STS072 STS071 STS070 CIS071 CIS070 MD073 MD072 MD071 MD070
Address: F0180H, F0181H (TCR00) to F018EH, F018FH (TCR07) After reset: FFFFH R
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
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 7-2. 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 Operation Value if the operation Value when waiting
operation mode was restarted after mode was changed for a start trigger
was changed after count operation after count operation after one count
releasing reset paused (TTmn = 1) paused (TTmn = 1)
Interval timer Count down FFFFH Value if stop Undefined
mode
Capture mode Count up 0000H Value if stop Undefined
Event counter Count down FFFFH Value if stop Undefined
mode
One-count mode Count down FFFFH Value if stop Undefined FFFFH
Capture & one- Count up 0000H Value if stop Undefined 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)
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), FFF66H, FFF67H (TDR03) After reset: 0000H R/W
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.
Cautions 1. When setting the timer array unit, be sure to set the following registers first while the
TAUmEN bit is set to 1. If TAUmEN = 0, the values of the registers which control the
timer array unit are cleared to their initial values and writing to them is ignored (except
for the timer input select register 0 (TIS0), input switch control register (ISC), noise filter
enable register 1 (NFEN1), port mode registers 0, 3, 4, 6, 12 (PM0, PM3, PM4, PM6, PM12),
and port registers 0, 3, 4, 6, 12 (P0, P3, P4, P6, P12)).
Timer clock select register m (TPSm)
Timer mode register mn (TMRmn)
Timer status register mn (TSRmn)
Timer channel enable status register m (TEm)
Timer channel start register m (TSm)
Timer channel stop register m (TTm)
Timer output enable register m (TOEm)
Timer output register m (TOm)
Timer output level register m (TOLm)
Timer output mode register m (TOMm)
2. Be sure to clear bit 1 to “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) ( = 0, 1)
mk3 mk2 mk1 mk0 fCLK = 4 MHz fCLK = 8 MHz fCLK = 12 MHz fCLK = 20 MHz fCLK = 24 MHz
Note When changing the clock selected for fCLK (by changing the system clock control register (CKC) value),
stop timer array unit (TTm = 00FFH).
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 = 4 MHz fCLK = 8 MHz fCLK = 12 MHz fCLK = 20 MHz fCLK = 24 MHz
Note
PRS PRS Selection of operation clock (CKm3)
m31 m30 fCLK = 4 MHz fCLK = 8 MHz fCLK = 12 MHz fCLK = 20 MHz fCLK = 24 MHz
8
0 0 fCLK/2 15.6 kHz 31.3 kHz 46.9 kHz 78.1 kHz 93.8 kHz
10
0 1 fCLK/2 3.91 kHz 7.81 kHz 11.7 kHz 19.5 kHz 23.4 kHz
12
1 0 fCLK/2 976 Hz 1.95 kHz 2.93 kHz 4.88 kHz 5.86 kHz
14
1 1 fCLK/2 244 Hz 488 Hz 732 Hz 1.22 kHz 1.46 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 7-3 can be achieved by using the interval timer function.
Table 7-3. Interval Times Available for Operation Clock CKSm2 or CKSm3
Note
Clock Interval time (fCLK = 20 MHz)
16 μs 160 μs 1.6 ms 16 ms
CKm2 fCLK/2
2
fCLK/2
4
fCLK/2
6
fCLK/2
8
CKm3 fCLK/2
10
fCLK/2
12
fCLK/2
14
fCLK/2
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
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
Note
TMRmn CKS CKS 0 CCS 0 STS STS STS CIS CIS 0 0 MD MD MD MD
(n = 0, 5, 7) mn1 mn0 mn mn2 mn1 mn0 mn1 mn0 mn3 mn2 mn1 mn0
Count clock (fTCLK) is used for the counter, output controller, and interrupt controller.
Address: F0190H, F0191H (TMR00) to F019EH, F019FH (TMR07) After reset: 0000H R/W
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
Note
TMRmn CKS CKS 0 CCS 0 STS STS STS CIS CIS 0 0 MD MD MD MD
(n = 0, 5, 7) mn1 mn0 mn mn2 mn1 mn0 mn1 mn0 mn3 mn2 mn1 mn0
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.
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
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
Note
TMRmn CKS CKS 0 CCS 0 STS STS STS CIS CIS 0 0 MD MD MD MD
(n = 0, 5, 7) mn1 mn0 mn mn2 mn1 mn0 mn1 mn0 mn3 mn2 mn1 mn0
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.
Address: F0190H, F0191H (TMR00) to F019EH, F019FH (TMR07) After reset: 0000H R/W
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
Note 1
TMRmn CKS CKS 0 CCS 0 STS STS STS CIS CIS 0 0 MD MD MD MD
(n = 0, 5, 7) mn1 mn0 mn mn2 mn1 mn0 mn1 mn0 mn3 mn2 mn1 mn0
The operation of each mode varies depending on MDmn0 bit (see the table below).
Address: F01A0H, F01A1H (TSR00) to F01AEH, F01AFH (TSR07) After reset: 0000H R
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 7-4. 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.
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.
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 7-5 in 7.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 7-5 in 7.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 7-5 in 7.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 TEHm3 bit is cleared to 0 and the count operation is stopped.
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 TEHm1 bit is cleared to 0 and the count operation is stopped.
0 No trigger operation
1 TEmn bit clear to 0, to be count operation stop enable status.
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”.
Caution High-level width, low-level width of timer input is selected, will require more than 1/fMCK +10 ns.
<R> Therefore, when selecting fSUB to fCLK (CSS bit of CKC register = 1), can not TIS02 bit set to 1.
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), n: Channel number (n = 0 to 7)
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 TI07 pin as a timer input (normal operation).
1 Input signal of the RXD0 pin is used as timer input (detects the wakeup signal and measures the low
width of the break field and the pulse width of the sync field).
0 Uses the input signal of the INTP0 pin as an external interrupt (normal operation).
1 Uses the input signal of the RXD0 pin as an external interrupt (wakeup signal detection).
Remark When the LIN-bus communication function is used, select the input signal of the RxD0 pin by setting
ISC1 to 1.
Note For details, see 7.5.1 (2) When valid edge of input signal via the TImn pin is selected (CCSmn = 1), 7.5.2
Start timing of counter, and 7.7 Timer Input (TImn) Control.
Note
TNFEN07 Enable/disable using noise filter of TI07 pin or RxD0 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 RxD0 pin can be selected.
7.3.15 Registers controlling port functions of pins to be used for timer I/O
Using port pins for the timer array unit functions requires setting of the registers that control the port functions
multiplexed on the target pins (port mode register (PMxx) and port register (Pxx)). For details, see 4.3.1 Port mode
registers (PMxx) and 4.3.2 Port registers (Pxx).
The port mode register (PMxx) and port register (Pxx) to be set depend on the product. For details, see 4.5 Register
Settings When Using Alternate Function.
When using the ports (such as P43/TI00/TO00) 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 P43/TI00) 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.
Remarks 1. In case of 80-pin product, in order to use a port that is shared with segment output for timer I/O function,
be sure to set the corresponding bits of LCD port function register 4 (PFSEG4) bits PFSEG32 to
PFSEG37 to “0”.
2. When using the P125/(TI05)/(TO05)/VL3 pin for timer I/O, be sure to clear the ISCVL3 bit of the LCD Input
switch control register (ISCLCD) to “0”.
3. When using the P126/(TI04)/(TO04)/CAPL and P127/(TI03)/(TO03)/CAPH pins for timer I/O, be sure to
clear the ISCCAP bit of the LCD Input switch control register (ISCLCD) to “1”.
(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.
(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.
(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.
(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 7.4.1 Basic rules of simultaneous channel operation function do not apply to the
channel groups.
Example
TAU0
7.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)
15
The count clock (fTCLK) is between fCLK to fCLK /2 by setting of timer clock select register m (TPSm). When a
divided fCLK is selected, however, the clock selected in TPSmn register, but a signal which becomes high level for
one period of fCLK from its rising edge. When a fCLK is selected, fixed to high level
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 7-24. 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 7-25. 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 7-5. 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
7.5.3 (1) Operation of interval timer mode).
Event counter mode Writing 1 to the TSmn bit loads the value of the TDRmn register to the TCRmn
register.
If detect edge of TImn input. The subsequent count clock performs count down
operation (see 7.5.3 (2) Operation of event counter mode).
Capture mode No operation is carried out from start trigger detection (TSmn = 1) until count
clock generation.
The first count clock loads 0000H to the TCRmn register and the subsequent
count clock performs count up operation (see 7.5.3 (3) Operation of capture
mode (input pulse interval measurement)).
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
7.5.3 (4) Operation of 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 7.5.3 (5) Operation of capture &
one-count mode (high-level width measurement)).
<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
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.
Remark fMCK, the start trigger detection signal, and INTTMmn become active between one clock in
synchronization with fCLK.
<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 above figure 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).
Figure 7-28. Operation Timing (In Capture Mode: Input Pulse Interval Measurement)
fMCK
(fTCLK)
TSmn (write)
<1>
TEmn
Note
<3>
TImn input
TDRmn 0001
Note
m
INTTMmn
When MDmn0 = 1
Note If a clock has been input to TImn (the trigger exists) when capturing starts, counting starts when a trigger is
detected, even if no edge is detected. Therefore, the first captured value (<4>) does not determine a pulse
interval (in the above figure, 0001 just indicates two clock cycles but does not determine the pulse interval)
and so the user can ignore it.
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.
Remark The timing is shown in above figure 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 cycle occurs because the TImn input is not synchronous with the
count clock (fMCK).
fMCK
(fTCLK)
TSmn (write)
<1>
TEmn
Edge detection
Rising edge
<4>
Start trigger
detection signal
<2> <5>
INTTMmn
Remark The timing is shown in above figure 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).
<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.
<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.
Figure 7-30. Operation Timing (In Capture & One-count Mode: High-level Width Measurement)
fMCK
(fTCLK)
TSmn (write)
<1>
TEmn
Start trigger
detection signal
<2>
TDRmn 0000 m
INTTMmn
Remark The timing is shown in above figure 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).
<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.
Caution Since outputs are N-ch open-drain outputs, an external pull-up resistor is required to use P60,
P61, and P62 as channel output.
Figure 7-32. 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 7.3.15 Registers controlling port functions of pins to be used
for timer I/O).
<5> The timer operation is enabled (TSmn = 1).
(1) Changing values set in the registers TOm, TOEm, and TOLm 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), and timer output level register m (TOLm) 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 7.8 and 7.9.
When the values set to the TOEm, 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.
TOEmn
Default
Hi-Z status TOmn bit = 0
(Default status : Low)
TOmn bit = 0
(Active high)
TOmn bit = 1
(Default status : High)
TOmn
(output) TOmn bit = 0
(Default status : Low)
TOmn bit = 1
(Active low)
TOmn bit = 1
(Default status : High)
Port output is enabled
Bold : Active level
Toggle Toggle Toggle Toggle Toggle
(b) When operation starts with slave channel output mode (TOMmp = 1) setting (PWM output))
When slave channel output mode (TOMmp = 1), the active level is determined by timer output level register m
(TOLm) setting.
TOEmp
Active Active Active
Hi -Z Default
TOmp bit = 0
status
(Default status : Low)
TOmp bit = 0
(Active high)
TOmp bit = 1
(Default status : High)
TOmp
(output)
TOmp bit = 0
(Default status : Low)
TOmp bit = 1
(Active low)
TOmp bit = 1
(Default status : High)
Reset Reset
Set Set Set
Remarks 1. Set: The output signal of the TOmp pin changes from inactive level to active level.
Reset: The output signal of the TOmp pin changes from active level to inactive level.
2. m: Unit number (m = 0), p: Channel number (p = 1 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 7-35. Operation When TOLm Register Has Been Changed Contents During Timer Operation
TOLm
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), 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
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
<R>
Figure 7-39. 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.
CCSmn
Interrupt signal from master channel
fMCK
Count clock
selection
fTCLK
Timer
controller
TImn pin Noise Edge
filter detection
selection
Trigger
TNFENmn CISmn1, STSmn2 to
CISmn0 STSmn0
Figure 7-41. Sampling Waveforms through TImn Input Pin with Noise Filter Enabled and Disabled
TImn pin
Caution The TImn pin input waveform is shown to explain the noise filter ON/OFF operation. For actual
operation, refer to the high-level width/low-level width in 37.4 AC Characteristics.
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)
Note When channels 1 and 3, the clock can be selected from CKm0, CKm1, CKm2 and CKm3.
Figure 7-43. Example of Basic Timing of Operation as Interval Timer/Square Wave Output (MDmn0 = 1)
TSmn
TEmn
TCRmn
0000H
TDRmn a b
TOmn
INTTMmn
Figure 7-44. Example of Set Contents of Registers During Operation as Interval Timer/Square Wave Output (1/2)
Figure 7-44. Example of Set Contents of Registers During Operation as Interval Timer/Square Wave Output (2/2)
Figure 7-45. Operation Procedure of Interval Timer/Square Wave Output Function (1/2)
register is 1.
During Set value of the TDRmn register can be changed. Counter (TCRmn) counts down. When count value reaches
operation The TCRmn register can always be read. 0000H, the value of the TDRmn register is loaded to the
The TSRmn register is not used. TCRmn register again and the count operation is continued.
Set values of the TOm and TOEm registers can be By detecting TCRmn = 0000H, INTTMmn is generated and
changed. TOmn performs toggle operation.
Set values of the TMRmn register, TOMmn, and TOLmn After that, the above operation is repeated.
bits cannot be changed.
Operation The TTmn (TTHm1, TTHm3) bit is set to 1. TEmn (TEHm1, TEHm3), and count operation stops.
stop The TTmn (TTHm1, TTHm3) bit automatically returns The TCRmn register holds count value and stops.
to 0 because it is a trigger bit. The TOmn output is not initialized but holds current status.
The TOEmn bit is cleared to 0 and value is set to the TOmn bit. The TOmn pin outputs the TOmn bit set level.
Figure 7-45. 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.
TNFENxx
Clock selection
Noise Edge
TImn pin Timer counter
filter 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 7-48. Example of Set Contents of Registers in External Event Counter Mode (1/2)
Figure 7-48. Example of Set Contents of Registers in External Event Counter Mode (2/2)
Figure 7-49. Operation Procedure When External Event Counter Function Is Used
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)
TNFENxx
Trigger selection
Noise Edge
TImn pin
filter detection Timer data Interrupt
register mn (TDRmn) Interrupt signal
controller
TSmn (INTTMmn)
Note When channels 1 and 3, the clock can be selected from CKm0, CKm1, CKm2 and CKm3.
Figure 7-51. 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 7-52. Example of Set Contents of Registers to Measure Input Pulse Interval
Figure 7-53. Operation Procedure When Input Pulse Interval Measurement Function Is Used
operation TMRmn register can be changed. pin input valid edge is detected or the TSmn bit is set to 1,
The TDRmn register can always be read. the count value is transferred (captured) to timer data
The TCRmn register can always be read. register mn (TDRmn). At the same time, the TCRmn
The TSRmn register can always be read. register is cleared to 0000H, and the INTTMmn signal is
Set values of the TOMmn, TOLmn, TOmn, and TOEmn generated.
bits cannot be changed. If an overflow occurs at this time, the OVF bit of timer
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 RxD0.
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 7-54. Block Diagram of Operation as Input Signal High-/Low-Level Width Measurement
Clock selection
CKm1
Operation clock Note Timer counter
CKm0 register mn (TCRmn)
TNFENxx
Trigger selection
Noise Edge Timer data Interrupt
TImn pin register mn (TDRmn) Interrupt signal
filter detection controller
(INTTMmn)
Note For channels 1 and 3, the clock can be selected from CKm0, CKm1, CKm2 and CKm3.
Figure 7-55. 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 7-56. Example of Set Contents of Registers to Measure Input Signal High-/Low-Level Width
Figure 7-57. 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
TNFENxx
Timer data Interrupt signal
Interrupt
register mn (TDRmn) (INTTMmn)
Noise Edge controller
TImn pin detection
filter
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
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.
<R> 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
counting, therefore, an illegal waveform may be output in conflict with the timing of loading. 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
TNFENxx
TSmn
Timer data Interrupt
register mn (TDRmn) Interrupt signal
Noise Edge controller
TImn pin (INTTMmn)
filter detection
Slave channel
(one-count mode) Clock selection
CKm1
Operation clock Timer counter Output
CKm0 register mp (TCRmp) TOmp pin
controller
Trigger selection
Figure 7-63. 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 7-64. Example of Set Contents of Registers When One-Shot Pulse Output Function Is Used (Master Channel)
Figure 7-65. 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 7-69. Example of Set Contents of Registers When PWM Function (Master Channel) Is Used
Figure 7-70. 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 7-72. 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 7-73. Example of Basic Timing of Operation as Multiple PWM Output Function
(Output Two Types of PWMs)
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 7-76. Operation Procedure When Multiple PWM Output Function Is Used (1/2)
Figure 7-76. 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 register, 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), n: Channel number (n = 0, 2, 4)
p: Slave channel number, q: Slave channel number
n < p < q 7 (Where p and q are a consecutive integer greater than n)
(b) Using TO00 and TO01 outputs assigned to the P43 and P41
So that the alternated PCLBUZ1 and PCLBUZ0 outputs become 0, not only set the port mode register (the
PM43 and PM41 bits) and the port register (the P43 and P41 bits) to 0, but also use the bit 7 of the clock
output select register n (CKSn) with the same setting as the initial status.
(d) Using TO05 and TO06 outputs assigned to the P04 and P03 (When PIOR3 = 1)
So that the alternated VCOUT0 and VCOUT1 outputs become 0, not only set the port mode register (the PM04
and PM03 bits) and the port register (the P04 and P03 bits) to 0, but also use the bit 1 of the comparator
output control register (COMPOCR) with the same setting as the initial status.
Counters of year, month, day of the week, date, hour, minute, and second, that can count up to 99 years (with leap
year correction function)
Constant-period interrupt function (period: 0.5 seconds, 1 second, 1 minute, 1 hour, 1 day, 1 month)
Alarm interrupt function (alarm: day of the week, hour, and minute)
Pin output function of 1 Hz (normal 1 Hz output, high accuracy 1 Hz output)
The real-time clock interrupt signal (INTRTC) can be utilized for wakeup from STOP mode and triggering an A/D
converter’s SNOOZE mode.
Cautions 1. The year, month, week, day, hour, minute and second can only be counted when a subsystem
clock (fSUB = 32.768 kHz) is selected as the operation clock of real-time clock 2.
When the low-speed oscillation clock (fIL = 15 kHz) is selected, only the constant-period interrupt
function is available.
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.
2. When using the high accuracy 1 Hz pin output, set the high-speed on-chip oscillator clock (fIH) to
24 MHz.
Item Configuration
Counter Counter (16-bit)
Control registers Peripheral enable register 0 (PER0)
Peripheral enable register 1 (PER1)
Subsystem clock supply mode control register (OSMC)
Power-on-reset status register (PORSR)
Real-time clock control register 0 (RTCC0)
Real-time clock control register 1 (RTCC1)
Second count register (SEC)
Minute count register (MIN)
Hour count register (HOUR)
Day count register (DAY)
Week count register (WEEK)
Month count register (MONTH)
Year count register (YEAR)
Watch error correction register (SUBCUD)
Alarm minute register (ALARMWM)
Alarm hour register (ALARMWH)
Alarm week register (ALARMWW)
RTC1HZ
Selector
High accuracy 1 Hz
Alarm week Alarm hour Alarm minute output circuit Note 1 RCLOSEL
register register register
(ALARMWW) (ALARMWH) Normal 1 Hz output mode/
(ALARMWM)
(7-bit) (6-bit) fIH ( = 24 MHz) high accuracy 1 Hz output mode switching
(7-bit)
INTRTC
CT0-CT2
RIFG
Selector
RITE
AMPM
RWST RWAIT INTRTIT Note 2
Selector
(8-bit) (5-bit) (3-bit) (6-bit) (6-bit) (7-bit) fSUB
fIL
Count Watch error
enable/ correction
disable register
(SUBCUD) WUTMMCK0
circuit
(16-bit)
Buffer Buffer Buffer Buffer Buffer Buffer Buffer
RTCE
Correction Circuit
Internal bus
Notes 1. A high-speed on-chip oscillator (HOCO: 24 MHz) can be used for high precision 1 Hz output. HOCO must be
set to ON in order to run in high precision 1 Hz output mode. To run in normal 1 Hz mode, there is no need to
set HOCO to ON.
2. An interrupt that indicates the timing to get the correction value from the clock error correction register
(SUBCUD).
The fetch timing is 1 second (fSUB base) interval.
Note 1 Note 2
Reset Source System-related Register Calendar-related Register
Reset generation does not reset the SEC, MIN, HOUR, DAY, WEEK, MONTH, YEAR, ALARMWM, ALARMWH, or
ALARMWW register. Initialize all the registers after power on.
The PORSR register is used to check the occurrence of a power-on reset.
Cautions 1. The clock error correction register (SUBCUD) can be read or written by setting
RTCWEN of peripheral enable register 0 (PER0) to 1 or setting FMCEN of peripheral
enable register 1 (PER1) to 1.
2. When using real-time clock 2, first set the RTCWEN bit to 1 and then set the following
registers, while oscillation of the count clock (fRTC) is stable. If RTCWEN = 0, writing
to the control registers of real-time clock 2 is ignored, and read values are the values
set when RTCWEN = 1 (except for the subsystem clock supply mode control register
(OSMC) and power-on reset status register (PORSR)).
Real-time clock control register 0 (RTCC0)
Real-time clock control register 1 (RTCC1)
Second count register (SEC)
Minute count register (MIN)
Hour count register (HOUR)
Day count register (DAY)
Week count register (WEEK)
Month count register (MONTH)
Year count register (YEAR)
Watch error correction register (SUBCUD)
Alarm minute register (ALARMWM)
Alarm hour register (ALARMWH)
Alarm week register (ALARMWW)
3. Be sure to set bit 1 to “0”.
FMCEN Control of internal clock supply to subsystem clock frequency measurement circuit
Cautions 1. The clock error correction register (SUBCUD) can be read or written by setting
RTCWEN of peripheral enable register 0 (PER0) to 1 or setting FMCEN of peripheral
enable register 1 (PER1) to 1.
2. Be sure to set bits 1 and 2 to “0”.
Figure 8-4. Format of Subsystem Clock Supply Mode Control Register (OSMC)
RTCLPC In STOP mode and in HALT mode while the CPU operates using the subsystem clock
Cautions 1. Setting the RTCLPC bit to 1 can reduce current consumption in STOP mode and in
HALT mode with the CPU operating on the subsystem clock. However, setting the
RTCLPC bit to 1 means that there is no clock supply to peripheral circuits other than
real-time clock 2, 12-bit interval timer, clock output/buzzer output controller, and LCD
controller/driver in HALT mode with the CPU operating on the subsystem clock.
Before setting the system to HALT mode with the CPU operating on the subsystem
clock, therefore, be sure to set bit 7 (RTCWEN) of peripheral enable register 0 (PER0)
and bit 7 (TMKAEN) of peripheral enable register 1 (PER1) to 1, and bits 0, 2, and 3 of
PER0, and bit 5 of PER1 to 0.
2. If the subsystem clock is oscillating, be sure to select the subsystem clock
(WUTMMCK0 bit = 0).
3. When WUTMMCK0 is set to 1, the low-speed on-chip oscillator clock oscillates.
Cautions 4. When WUTMMCK0 is set to 1, only the constant-period interrupt function of real-time
clock 2 can be used. The year, month, day of the week, day, hour, minute, and second
counters and the 1 Hz output function of real-time clock 2 cannot be used.
The interval of the constant-period interrupt is calculated by constant period (value
selected by using the RTCC0 register) fSUB/fIL.
5. The subsystem clock and low-speed on-chip oscillator clock can only be switched by
using the WUTMMCK0 bit if real-time clock 2, 12-bit interval timer, and LCD
controller/driver are all stopped.
6. 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 real-
time clock 2. When the low-speed oscillation clock (fIL = 15 kHz) is selected, only the
constant-period interrupt function is available.
However, the constant-period interrupt interval when fIL is selected will be calculated
with the constant-period (the value selected with RTCC0 register) × 1/fIL.
Cautions 1. The PORSR register is reset only by a power-on reset; it retains the value when a reset caused by
another factor occurs.
2. If the PORF bit is set to 1, it guarantees that no power-on reset has occurred, but it does not
guarantee that the RAM value is retained.
PORSR 0 0 0 0 0 0 0 PORF
Note 1
RTCE Real-time clock 2 operation control
Note 2
RCLOE1 RTC1HZ pin output control
Notes 1. When shifting to STOP mode immediately after setting RTCE to 1, use the procedure shown in
Figure 8-20 Procedure for Shifting to HALT/STOP Mode After Setting RTCE = 1.
2. When the RCLOE1 bit is set while the clock counter operates (RTCE = 1), a glitch may be
output to the 1 Hz output pin (RTC1HZ).
Cautions 1. The high accuracy 1 Hz output is available only when 24 MHz is selected for the high-
speed on-chip oscillator (fIH) and the high-speed on-chip oscillator is running
(HIOSTOP = 0). There is no need to select fIH for CPU clock. Also, Using clock error
correction when high accuracy 1 Hz output is used.
2. Be sure to set bit 4 to “0”.
Table 8-2. Relation Between RTCE, RCLOSEL, and RCLOE1 Settings and Status
Caution If writing is performed to RTCC1 with a 1-bit manipulation instruction, the RIFG and
WAFG flags may be cleared. Therefore, to perform writing to RTCC1, be sure to use an 8-
bit manipulation instruction.
To prevent the RIFG and WAFG flags from being cleared during writing, set 1 (writing
disabled) to the corresponding bit. If the RIFG and WAFG flags are not used and the
value may be changed, RTCC1 may be written by using a 1-bit manipulation instruction.
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.
Caution If writing is performed to RTCC1 with a 1-bit manipulation instruction, the RIFG and
WAFG flags may be cleared. Therefore, to perform writing to RTCC1, be sure to use an 8-
bit manipulation instruction.
To prevent the RIFG and WAFG flags from being cleared during writing, set 1 (writing
disabled) to the corresponding bit. If the RIFG and WAFG flags are not used and the
value may be changed, RTCC1 may be written by using a 1-bit manipulation instruction.
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.
Even if the RWAIT bit is set to 0, the RWST bit is not set to 0 while writing to the counter. After writing
is completed, the RWST bit is set to 0.
<R> Notes 1. When the RWAIT bit is set to 1 within one cycle of fRTC clock after setting the RTCE bit to 1, the
RWST bit being set to 1 may take up to two cycles of the operating clock (fRTC).
<R> 2. When the RWAIT bit is set to 1 within one cycle of fRTC clock after release from the standby
mode (HALT mode, STOP mode, or SNOOZE mode), the RWST bit being set to 1 may take up
to two cycles of the operating clock (fRTC).
Caution If writing is performed to RTCC1 with a 1-bit manipulation instruction, the RIFG and
WAFG flags may be cleared. Therefore, to perform writing to RTCC1, be sure to use an 8-
bit manipulation instruction.
To prevent the RIFG and WAFG flags from being cleared during writing, set 1 (writing
disabled) to the corresponding bit. If the RIFG and WAFG flags are not used and the
value may be changed, RTCC1 may be written by using a 1-bit manipulation instruction.
Remarks 1. Constant-period 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 constant-period interrupt status flag (RIFG) and
the alarm detection status flag (WAFG) upon INTRTC occurrence.
2. The internal counter (16 bits) is cleared when the second count register (SEC) is written.
Caution When reading or writing to SEC while the clock counter operates (RTCE = 1), be sure to use the flows
shown in 8.4.3 Reading real-time clock 2 counter and 8.4.4 Writing to real-time clock 2 counter.
Remark The internal counter (16 bits) is cleared when the second count register (SEC) is written.
Caution When reading or writing to MIN while the clock counter operates (RTCE = 1), be sure to use the flows
shown in 8.4.3 Reading real-time clock 2 counter and 8.4.4 Writing to real-time clock 2 counter.
Cautions 1. Bit 5 (HOUR20) of the HOUR register indicates AM(0)/PM(1) if AMPM = 0 (if the 12-hour system is
selected).
2. When reading or writing to HOUR while the clock counter operates (RTCE = 1), be sure to use the
flows shown in 8.4.3 Reading real-time clock 2 counter and 8.4.4 Writing to real-time clock 2
counter.
Table 8-3 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.
When data is written to this register, it is written to a buffer and then to the counter up to 2 clocks of 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.
The DAY register can be set by an 8-bit memory manipulation instruction.
Reset signal generation not clears this register to default value.
Caution When reading or writing to DAY while the clock counter operates (RTCE = 1), be sure to use the flows
shown in 8.4.3 Reading real-time clock 2 counter and 8.4.4 Writing to real-time clock 2 counter.
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
2. When reading or writing to WEEK while the clock counter operates (RTCE = 1), be sure to use the
flows shown in 8.4.3 Reading real-time clock 2 counter and 8.4.4 Writing to real-time clock 2
counter.
Caution When reading or writing to MONTH while the clock counter operates (RTCE = 1), be sure to use the
flows shown in 8.4.3 Reading real-time clock 2 counter and 8.4.4 Writing to real-time clock 2 counter.
Caution When reading or writing to YEAR while the clock counter operates (RTCE = 1), be sure to use the
flows shown in 8.4.3 Reading real-time clock 2 counter and 8.4.4 Writing to real-time clock 2 counter.
SUBCUD F15 0 0 0 0 0 0 F8 F7 F6 F5 F4 F3 F2 F1 F0
The range of value that can be corrected by using the clock error correction register (SUBCUD) is shown in Table 8-4.
Item Value
F15 F8 F7 F6 F5 F4 F3 F2 F1 F0
1 1 0 0 0 0 0 0 0 0 274.6 ppm
1 0 0 0 0 0 0 0 1 273.7 ppm
1 0 0 0 0 0 0 1 0 272.7 ppm
• • • • • • • • • •
• • • • • • • • • •
• • • • • • • • • •
1 1 1 1 1 1 1 0 1 33.3 ppm
1 1 1 1 1 1 1 1 0 32.4 ppm
1 1 1 1 1 1 1 1 1 31.4 ppm
0 0 0 0 0 0 0 0 0 30.5 ppm
0 0 0 0 0 0 0 0 1 29.6 ppm
0 0 0 0 0 0 0 1 0 28.6 ppm
• • • • • • • • • •
• • • • • • • • • •
• • • • • • • • • •
0 0 0 0 1 1 1 1 1 0.95 ppm
0 0 0 1 0 0 0 0 0 0 ppm
0 0 0 1 0 0 0 0 1 0.95 ppm
• • • • • • • • • •
• • • • • • • • • •
• • • • • • • • • •
0 1 1 1 1 1 1 0 1 210.7 ppm
0 1 1 1 1 1 1 1 0 211.7 ppm
0 1 1 1 1 1 1 1 1 212.6 ppm
0 × × × × × × × × × Clock error correction stopped
The F8 to F0 value of the SUBCUD register is calculated from the target correction value by using the following
expression.
15
Target correction value [ppm] × 2
SUBCUD[8:0] = 6 2's complement + 0001.00000B
10 (9 bit fixed-point
format)
Caution The target correction value is the oscillation frequency deviation (unit: [ppm]) of the crystal
resonator. For calculating the correction value, see 8.4.8 Example of watch error correction of
real-time clock 2.
15 6
SUBCUD[8:0] = (18.3 × 2 / 10 ) 2's complement (9 bit fixed-point format) + 0001.00000B
= (0.59375) 2's complement (9 bit fixed-point format) + 0001.00000B
= 0000.10011B + 0001.00000B
= 0001.10011B
15 6
SUBCUD[8:0] = (18.3 × 2 / 10 ) 2's complement (9 bit fixed-point format) + 0001.00000B
= (0.59965) 2's complement (9 bit fixed-point format) + 0001.00000B
= 1111.01101B + 0001.00000B
= 0000.01101B
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.
Cautions 1. Set a decimal value of 00 to 23 or 01 to 12 and 21 to 32 to this register in BCD code. If a value
outside the range is set, the alarm is not detected.
2. Bit 5 (WH20) of the ALARMWH register indicates AM(0)/PM(1) if AMPM = 0 (if the 12-hour system
is selected).
Start
Setting AMPM, CT2 to CT0 Selects 12-/24-hour system and interrupt (INTRTC).
Setting SUBCUD Sets clock error correction register (when correcting clock errors).Note 3
No
INTRTC = 1?
Yes
End
Notes 1. Set RTCWEN to 0, except when accessing the RTC register, in order to prevent error when writing to the
clock counter.
2. First set the RTCWEN bit to 1, while oscillation of the count clock (fRTC) is stable.
3. Set up the SUBCUD register only if the watch error must be corrected. For details about how to calculate
the correction value, see 8.4.8 Example of watch error correction of real-time clock 2.
4. Confirm the procedure described in 8.4.2 Shifting to HALT/STOP mode after starting operation when
shifting to HALT/STOP mode without waiting for INTRTC = 1 after RTCE = 1.
(1) Shifting to HALT/STOP mode when at least two input clocks of the count clock (fRTC) have elapsed after setting the
RTCE bit to 1 (see Example 1 of Figure 8-20).
(2) 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 HALT/STOP mode after checking again by polling that the
RWST bit has become 0 (see Example 2 of Figure 8-20).
Figure 8-20. Procedure for Shifting to HALT/STOP Mode After Setting RTCE = 1
Example 1 Example 2
RWST = 0?
No
Yes
Notes 1. When the counter is stopped (RTCE = 0), RWST is not set to 1.
2. Be sure to confirm that RWST = 0 before setting STOP mode.
Caution Complete the series of operations of setting the RWAIT bit to 1 to clearing the RWAIT bit to 0 within 1
second.
Remark SEC, MIN, HOUR, WEEK, DAY, MONTH, and YEAR may be read in any sequence. All the registers do not
have to be set and only some registers may be read.
Notes 1. When the counter is stopped (RTCE = 0), RWST is not set to 1.
2. Be sure to confirm that RWST = 0 before setting STOP mode.
Cautions 1. Complete the series of operations of setting the RWAIT bit to 1 to clearing the RWAIT bit to 0
within 1 second.
2. When changing the values of the SEC, MIN, HOUR, WEEK, DAY, MONTH, and YEAR register while
the counter operates (RTCE = 1), rewrite the values of the MIN register after disabling interrupt
servicing INTRTC by using the interrupt mask flag register. Furthermore, clear the WAFG, RIFG
and RTCIF flags after rewriting the MIN register.
Remark SEC, MIN, HOUR, WEEK, DAY, MONTH, and YEAR may be read in any sequence. All the registers do not
have to be set and only some registers may be written.
Start
WALE = 0
WALIE = 1
Setting ALARMWM
Setting ALARMWH
Setting ALARMWW
No INTRTC = 1?
Yes
No
WAFG = 1?
Start
Caution When using a high-precision 1 Hz pin output, select 24 MHz for high-speed on-chip oscillator clock
(fIH) and operate the high-speed on-chip oscillator (HIOSTOP=0). There is no need to select it for
CPU clock.
(1) Set the clock error correction register after setting RTCWEN to 1 first. Then set RTCWEN to 0.
(2) Set the clock error correction register after setting FMCEN to 1 first. Then set FMCEN to 0.
Note See 8.4.6 1 Hz output of real-time clock 2 for the procedure of outputting about 1 Hz from the RTC1HZ pin.
Remarks 1. The oscillation frequency is the input clock (fRTC). It can be calculated from the output frequency of the
RTC1HZ pin 32768 when stops the watch error correction.
2. The target correction value is the oscillation frequency deviation (unit: [ppm]) of the crystal resonator.
3. The target frequency is the frequency resulting after watch error correction performed.
Note See 9.4.1 Setting crystal oscillation frequency measurement circuit using reference clock for the
operating procedure of subsystem clock frequency measurement.
Oscillation frequency = fMX frequency [Hz] × operating trigger division ratio (FMCRH, FMCRL) value
5 15
= 10 × 10 × 2 9999060D
= 32771.0804816 Hz
Assume the target frequency to be 32768 Hz. Then the target correction value is calculated as follows.
Remarks 1. The operating trigger division ratio is the division ratio of fSUB set by FMDIV2 to FMDIV0 of the frequency
8
measurement control register. The operating trigger division ratio is 2 when FMDIV2 to FMDIV0 = 000B,
15
and 2 when FMDIV2 to FMDIV0 = 111B.
2. The target correction value is the oscillation frequency deviation (unit: [ppm]) of the crystal resonator.
3. The target frequency is the frequency resulting after watch error correction performed.
15
Target correction value [ppm] × 2
SUBCUD[8:0] = 6 + 0001.00000B
10 2's complement (9 bit fixed-point format)
15 6
SUBCUD[8:0] = (18.3 × 2 / 10 ) 2's complement (9 bit fixed-point format) + 0001.00000B
= (0.59965) 2's complement (9 bit fixed-point format) + 0001.00000B
= 1111.01101B + 0001.00000B
= 0000.01101B
15 6
SUBCUD[8:0] = (94.0 × 2 / 10 ) 2's complement (9 bit fixed-point format) + 0001.00000B
= (+3.08019) 2's complement (9 bit fixed-point format) + 0001.00000B
= 0011.00011B + 0001.00000B
= 0100.00011B
Note Actual high-accuracy 1-Hz output includes quantization error in fIH accuracy and counting correction time.
When using a high-precision 1 Hz output, select 24 MHz for high-speed on-chip oscillator clock (fIH) and operate
the high-speed on-chip oscillator (HIOSTOP=0). There is no need to select it for CPU clock.
The subsystem clock frequency measurement circuit is used to measure the frequency of the subsystem clock (fSUB),
by inputting the reference clock externally.
RTC clock error correction is possible without using a temperature sensor by measuring the subsystem clock (fSUB)
frequency with the following method.
Input external main system clock (fEX) as reference clock from an externally mounted temperature
compensated crystal oscillator (TCXO)
Use X1 oscillation clock (fX) as reference clock by connecting an AT cut oscillator with good temperature
characteristics to X1 and X2
Caution The subsystem clock frequency measurement circuit can be used only when the subsystem clock
(fSUB = 32.768 kHz) is selected as the operating clock (WUTMMCK0 in the OSMC register = 0).
The subsystem clock frequency measurement circuit includes the following hardware.
Item Configuration
Figure 9-1 shows the subsystem clock frequency measurement circuit diagram.
The subsystem clock frequency measurement circuit is controlled by the following registers.
Cautions 1. The clock error correction register (SUBCUD) can be read or written by setting
RTCWEN of peripheral enable register 0 (PER0) to 1 or setting FMCEN of peripheral
enable register 1 (PER1) to 1.
2. Be sure to set bits 1 and 2 to “0”.
Figure 9-3. Format of Subsystem Clock Supply Mode Control Register (OSMC)
RTCLPC In STOP mode and in HALT mode while the CPU operates using the subsystem clock
0 Enables subsystem clock supply to peripheral functions.
For peripheral functions for which operation is enabled, see CHAPTER 24 STANDBY
FUNCTION.
1 Stops subsystem clock supply to peripheral functions other than real-time clock 2, 12-bit
interval timer, clock output/buzzer output controller, LCD controller/driver, 8-bit interval
timer, and oscillation stop detector.
Cautions 1. Setting the RTCLPC bit to 1 can reduce current consumption in STOP mode and in
HALT mode with the CPU operating on the subsystem clock. However, setting the
RTCLPC bit to 1 means that there is no clock supply to peripheral circuits other than
real-time clock 2, 12-bit interval timer, clock output/buzzer output controller, and LCD
controller/driver in HALT mode with the CPU operating on the subsystem clock.
Before setting the system to HALT mode with the CPU operating on the subsystem
clock, therefore, be sure to set bit 7 (RTCWEN) of peripheral enable register 0 (PER0)
and bit 7 (TMKAEN) of peripheral enable register 1 (PER1) to 1, and bits 0, 2, and 3 of
PER0, and bit 5 of PER1 to 0.
2. If the subsystem clock is oscillating, only the subsystem clock can be selected
(WUTMMCK0 = 0).
3. When WUTMMCK0 is set to 1, the low-speed on-chip oscillator clock oscillates.
4. When WUTMMCK0 is set to 1, only the constant-period interrupt function of real-time
clock 2 can be used. The year, month, day of the week, day, hour, minute, and second
counters and the 1 Hz output function of real-time clock 2 cannot be used.
The interval of the constant-period interrupt is calculated by constant period (value
selected by using the RTCC0 register) fSUB/fIL.
FMCRL
FMCRH
Symbol 31 16 15 0
Caution Do not read the value of the FMDIV2 to FMDIV0 bits when FMS = 1.
Remark The frequency measurement resolution can be calculated by the formula below.
6
• Frequency measurement resolution = 10 /(frequency measurement period × reference clock
frequency (fMX) [Hz]) [ppm]
Example 1) When FMDIV2 to FMDIV0 = 000B and fMX = 20 MHz, measurement resolution = 6.4 ppm
Example 2) When FMDIV2 to FMDIV0 = 111B and fMX = 1 MHz, measurement resolution = 1 ppm
Figure 9-8. Procedure for Setting Subsystem Clock Frequency Measurement Circuit Using Reference Clock
Start
No INTFM = 1?
Yes
Reading counters Reads frequency measurement count register (L/H).
Frequency calculation
Caution After the frequency measurement count register (L/H) is read, be sure to set FMCEN to 0.
For example, when the frequency is measured under the following conditions
• Count clock frequency: fMX = 10 MHz
15
• Frequency measurement period setting register: FMDIV2 to FMDIV0 = 111B (operation trigger division ratio: 2 )
and the measurement result is as follows,
• Frequency measurement count register: FMCR = 10000160D
the fSUB oscillation frequency is obtained as below.
6 15
(10 × 10 ) × 2
fSUB oscillation frequency = 32767.47572 [Hz]
10000160
Write Write
Bit 6 (FMCEN) of peripheral
enable register 1
Write
Frequency
measurement circuit
operation enable bit
(FMS)
fSUB
Reference clock
(fMX: 1 to 20 MHz)
Frequency
00000000
measurement count 0 1 2 3 4 5 6 7 00989720H
H
register (FMCR)
Interrupt
(INTFM)
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 1 (PER1)
Subsystem clock supply mode control register (OSMC)
12-bit interval timer control register (ITMC)
Clear
Count
Count
Selector
WUTMM
RINTE ITCMP11-ITCMP0
CK0
Subsystem clock supply
mode control register (OSMC) Interval timer control
register (ITMC)
Internal bus
Cautions 1. When using an 12-bit interval timer, be sure to set TMKAEN = 1 beforehand with the
count clock oscillation stabilized. If TMKAEN = 0, writing to a control register of the
12-bit interval timer is ignored, and, even if the register is read, only the default value
is read. (except the subsystem clock supply mode control register (OSMC))
2. Clock supply to peripheral functions other than real-time clock 2, 12-bit interval timer,
clock output/buzzer output controller, LCD controller/driver, 8-bit interval timer, and
oscillation stop detector can be stopped in STOP mode or HALT mode when the
subsystem clock is used, by setting the RTCLPC bit of the subsystem clock supply
mode control register (OSMC) to 1.
3. Be sure to set bits 2 and 1 to “0”.
Figure 10-3. Format of Subsystem Clock Supply Mode Control Register (OSMC)
Cautions 1. Be sure to select the subsystem clock (WUTMMCK0 bit = 0) if the subsystem clock is
oscillating.
2. When WUTMMCK0 is set to 1, the low-speed on-chip oscillator clock oscillates.
3. The subsystem clock and low-speed on-chip oscillator clock can only be switched by
using the WUTMMCK0 bit if real-time clock 2, 12-bit interval timer, and LCD
controller/driver are all stopped.
001H These bits generate an interrupt at the fixed cycle (count clock cycles (ITMCMP
• setting + 1)).
•
•
FFFH
000H Setting prohibit
Example interrupt cycles when 001H or FFFH is specified for ITMCMP11 to ITMCMP0
• ITMCMP11 to ITMCMP0 = 001H, count clock: when fSUB = 32.768 kHz
1/32.768 [kHz] (1 + 1) = 0.06103515625 [ms] 61.03 [μs]
• ITMCMP11 to ITMCMP0 = 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
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. When setting the RINTE bit after returned from standby mode and entering standby mode
again, confirm that the written value of the RINTE bit is reflected, or wait that more than one
clock of the count clock has elapsed after returned from standby mode. Then enter standby
mode.
4. Only change the setting of the ITMCMP11 to ITMCMP0 bits when RINTE = 0.
However, it is possible to change the settings of the ITMCMP11 to ITMCMP0 bits at the same
time as when changing RINTE from 0 to 1 or 1 to 0.
Figure 10-5. 12-bit Interval Timer Operation Timing (ITMCMP11 to ITMCMP0 = 0FFH, Count Clock: fSUB = 32.768 kHz)
Count clock
RINTE
Counting starts at the rising edge of the next count
clock after the RINTE is changed from 0 to 1.
0FFH
12-bit counter
000H
ITMCMP11 to 0FFH
ITMCMP0
INTIT
10.4.2 Start of count operation and re-enter to HALT/STOP mode after returned from HALT/STOP mode
When setting the RINTE bit to 1 after returned from HALT or STOP mode and entering HALT or STOP mode again,
write 1 to the RINTE bit, and confirm the written value of the RINTE bit is reflected or wait for at least one cycle of the
count clock. Then, enter HALT or STOP mode.
After setting RINTE to 1, confirm by polling that the RINTE bit has become 1, and then enter HALT or STOP mode
(see Example 1 in Figure 10-6).
After setting RINTE to 1, wait for at least one cycle of the count clock and then enter HALT or STOP mode (see
Example 2 in Figure 10-6).
Figure 10-6. Procedure of Entering to HALT or STOP Mode After Setting RINTE to 1
Example 1 Example 2
The 8-bit interval timer has two 8-bit timers (channel 0 and channel 1) with each operating independently. In addition,
the two 8-bit timers can be connected to operate as a 16-bit timer.
The 8-bit interval timer contains two units, 8-bit interval timer_0 and 8-bit interval timer_1, which have the same function.
This chapter describes these units as the 8-bit interval timer unless there are differences between them.
11.1 Overview
The 8-bit interval timer is an 8-bit timer that operates using the fSUB clock, which is asynchronous with the CPU.
Table 11-1 lists the 8-bit interval timer specifications and Figure 11-1 shows the 8-bit interval timer block diagram.
Item Description
Count source (operating clock) fSUB, fSUB/2, fSUB/4, fSUB/8, fSUB/16, fSUB/32, fSUB/64, fSUB/128
Operating mode 8-bit counter mode
Channel 0 and channel 1 operate independently as an 8-bit counter
16-bit counter mode
Channel 0 and channel 1 are connected to operate as a 16-bit counter
Interrupt Output when the counter value matches the compare value
Channel 0
Data bus
Channel 0
Compare register (8-bit) interrupt signal
(INTITn0)
TSTARTn0 Clear
Channel 1
Data bus
TSTARTn1
1 Count source Channel 1
fSUB, Compare register (8-bit) interrupt signal
fSUB/m 0 (INTITn1)
Clear
TCSMDn
Counter register (8-bit)
TCKn0 [2:0]
Division register (8-bit)
TCKn1 [2:0]
The 8-bit interval timer does not have any I/O pins.
11.3 Registers
Item Configuration
Note 1
Control registers 8-bit interval timer counter register 00 (TRT00)
Note 1
8-bit interval timer counter register 01 (TRT01)
Note 2
8-bit interval timer counter register 0 (TRT0)
Note 1
8-bit interval timer compare register 00 (TRTCMP00)
Note 1
8-bit interval timer compare register 01 (TRTCMP01)
Note 2
8-bit interval timer compare register 0 (TRTCMP0)
8-bit interval timer control register 0 (TRTCR0)
8-bit interval timer division register 0 (TRTMD0)
Note 1
8-bit interval timer counter register 10 (TRT10)
Note 1
8-bit interval timer counter register 11 (TRT11)
Note 2
8-bit interval timer counter register 1 (TRT1)
Note 1
8-bit interval timer compare register 10 (TRTCMP10)
Note 1
8-bit interval timer compare register 11 (TRTCMP11)
Note 2
8-bit interval timer compare register 1 (TRTCMP1)
8-bit interval timer control register 1 (TRTCR1)
8-bit interval timer division register 1 (TRTMD1)
Notes 1. Can be accessed only when the TCSMDn bit in the TRTCRn register is 0.
2. Can be accessed only when the TCSMDn bit in the TRTCRn register is 1.
Remark n = 0, 1
Notes 1, 2
Address: F0540H (TRT00), F0541H (TRT01), F0548H (TRT10), F0549H (TRT11) After reset: 00H R
Symbol 7 6 5 4 3 2 1 0
TRTni
Notes 1. The TRTni register is set to 00H two count clock cycles after the compare register TRTCMPni is write-
accessed. See 11.4.4 Timing of updating compare register values.
2. Can be accessed only when the mode select bit (TCSMDn) in 8-bit interval timer control register n (TRTCRn)
is 0.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
TRTn
Notes 1. The TRTn register is set to 0000H two count clock cycles after the compare register TRTCMPn is write-
accessed. See 11.4.4 Timing of updating compare register values.
2. Can be accessed only when the mode select bit (TCSMDn) in 8-bit interval timer control register n (TRTCRn)
is 1.
TRTCMPni
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
TRTCMPn
Note 3
Address: F0352H (TRTCR0), F035AH (TRTCR1) After reset: 00H R/W
Symbol 7 6 5 4 3 <2> 1 <0>
Note 1
TCLKENn 8-bit interval timer clock enable
0 Clock is stopped
1 Clock is supplied
Notes 1, 2
TSTARTn1 8-bit interval timer 1 count start
0 Counting stops
1 Counting starts
In 8-bit interval timer mode, writing 1 to the TSTARTn1 bit triggers the start of counting by TRTn1, and writing 0 stops counting by
TRTn1.
In 16-bit interval timer mode, this bit is invalid because it is not used. See 11.4 Operation for details.
Notes 1, 2
TSTARTn0 8-bit interval timer 0 count start
0 Counting stops
1 Counting starts
In 8-bit interval timer mode, writing 1 to the TSTARTn0 bit triggers the start of counting by TRTn0, and writing 0 stops counting by
TRTn0.
In 16-bit interval timer mode, writing 1 to the TSTARTn0 bit triggers the start of counting by TRTn, and writing 0 stops counting by
TRTn.
See 11.4 Operation for details.
Notes 1. Be sure to set the TCLKENn bit to 1 before setting the 8-bit interval timer. To stop the clock, set TSTARTn0
and TSTARTn1 to 0 and then set the TCLKENn bit to 0 after one or more fSUB cycles have elapsed. See
11.5.3 8-bit interval timer setting procedure for details.
2. See 11.5.1 Changing the operating mode and clock settings for notes on using bits TSTARTn0,
TSTARTn1, and TCSMDn.
3. Bits 6, 5, 3, and 1 are read-only. When writing, write 0. When reading, 0 is read.
Note 4
Address: F0353H (TRTMD0), F035BH (TRTMD1) After reset: 00H R/W
Symbol 7 6 5 4 3 2 1 0
Notes 1, 2, 3
TCKn1 Selection of division ratio for 8-bit interval timer 1
Bit 6 Bit 5 Bit 4
0 0 0 fSUB
0 0 1 fSUB/2
0 1 0 fSUB/4
0 1 1 fSUB/8
1 0 0 fSUB/16
1 0 1 fSUB/32
1 1 0 fSUB/64
1 1 1 fSUB/128
In 8-bit interval timer mode, TRTn1 counts based on the count clock specified by TCKn1.
In 16-bit interval timer mode, set these bits to 000B because they are not used. See 11.4 Operation for details.
Notes 1, 2, 3
TCKn0 Selection of division ratio for 8-bit interval timer 0
Bit 2 Bit 1 Bit 0
0 0 0 fSUB
0 0 1 fSUB/2
0 1 0 fSUB/4
0 1 1 fSUB/8
1 0 0 fSUB/16
1 0 1 fSUB/32
1 1 0 fSUB/64
1 1 1 fSUB/128
In 8-bit interval timer mode, TRTn0 counts based on the count clock specified by TCKn0.
In 16-bit interval timer mode, TRTn counts based on the count clock specified by TCKn0.
See 11.4 Operation for details.
Notes 1. Do not switch the count source during counting. When switching the count source, set these bits while the
TSTARTni bit in the TRTCRn register is 0 (counting is stopped).
2. Set TCKni (i = 0, 1) of the unused channel to 000B.
3. Be sure to set the TCKni (i = 0, 1) bit before setting the TRTCMPni register.
4. Bits 7 and 3 are read-only. When writing, write 0. When reading, 0 is read.
11.4 Operation
Remark n = 0, 1
Remark n = 0, 1
However, the initial 00H count interval when starting count varies as follows according to the timing 1 is written in the
TSTARTni (I = 0, 1) bit of the TRTCR register.
When the count value matches the compare value, the count value is cleared at the next count source cycle. When the
compare value in the TRTCMPni register is rewritten, the count value is also cleared two count source cycles after writing.
Table 11-5 lists the interrupt sources in 8-bit and 16-bit counter modes.
Interrupt Name Interrupt Source in 8-bit Counter Mode Interrupt Source in 16-bit Counter Mode
INTITn0 Rising edge of the count source cycle after compare Rising edge of the count source cycle after compare
match on channel 0 match
INTITn1 Rising edge of the count source cycle after compare Not generated
match on channel 1
Remark n = 0, 1
The TCSMDn bit in the TRTCRn register is set to 0 (8-bit counter operation).
Remark n = 0 or 1, i = 0 or 1
Figure 11-10. Example of Stopping Counting Clearing the Counter Restarting Counting
(When fSUB Is Selected)
The TCSMDn bit in the TRTCRn register is set to 0 (8-bit counter operation).
Remark n = 0 or 1, i = 0 or 1
m
(2) When fSUB/2 is selected as count source
After 1 is written to the TSTARTni (n = 0 or 1, i = 0 or 1) bit in the TRTCRn register, counting starts at the next
m
subsystem clock (fSUB) cycle, and then the counter is incremented from 00H to 01H at the next count source (fSUB/2 )
cycle. Similarly, after writing 0 in the TSTARTni, the count is stopped after counting with the subsystem clock (fSUB).
However, the initial 00H count interval at the start of count becomes shorter than 1 cycle of the count source as
follows due to the TSTARTni bit write timing and the timing of the next count source.
Figure 11-11 shows the count start/stop timing and Figure 11-12 shows the timing for stop count set compare
register (clear count) start count. Figure 11-11 and Figure 11-12 show the update timing in 8-bit counter mode, but
the operation is performed at the same timing even in 16-bit counter mode.
The TCSMDn bit in the TRTCRn register is set to 0 (8-bit counter operation).
Remark n = 0 or 1, i = 0 or 1
Figure 11-12. Example of Stopping Counting Clearing the Counter Starting Counting
m
(When fSUB/2 Is Selected)
The TCSMDn bit in the TRTCRn register is set to 0 (8-bit counter operation).
Remark n = 0 or 1, i = 0 or 1
Count source
Remark n = 0 or 1, i = 0 or 1
The clock output controller is intended for 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.
The PCLBUZn pin outputs a clock selected by clock output select register n (CKSn).
Figure 12-1 shows the block diagram of clock output/buzzer output controller.
Caution It is not possible to output the subsystem clock (fSUB) from the PCLBUZn pin while the RTCLPC bit of
the subsystem clock supply mode control register (OSMC), is set to 1 and moreover while HALT mode
is set with the subsystem clock (fSUB) selected as CPU clock.
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 1/TI01/
TO01/P41
fSUB to fSUB/27
Output latch
PM41
fMAIN/211 to fMAIN/213 (P41)
fMAIN to fMAIN/24
Selector
Clock/buzzer
fSUB to fSUB/27 controller PCLBUZ0Note 1/TI00/
TO00/P43
8 8
Note 2
PCLOE0 Output latch
fSUB Prescaler PM43
(P43)
Internal bus
Notes 1. For output frequencies available from PCLBUZ0 and PCLBUZ1, see 37.4 AC Characteristics.
2. Selecting fSUB as the output clock of the clock output/buzzer output controller is prohibited when the
WUTMMCK0 bit of the OSMC register is set to 1.
Remark The clock output/buzzer output pins in above diagram shows the information with PIOR3 = 0.
Item Configuration
Control registers Clock output select registers n (CKSn)
Port mode register 3, 4 (PM3, PM4)
Port register 3, 4 (P3, P4)
Notes 1. Use the output clock within a range of 16 MHz. See 37.4 AC Characteristics for details.
2. Selecting fSUB as the output clock of the clock output/buzzer output controller is prohibited when the
WUTMMCK0 bit of the OSMC register is set to 1.
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. It is not possible to output the subsystem clock (fSUB) from the PCLBUZn pin while the RTCLPC
bit of the subsystem clock supply mode control register (OSMC), is set to 1 and moreover while
HALT mode is set with the subsystem clock (fSUB) selected as CPU clock.
Remarks 1. n = 0, 1
2. fMAIN: Main system clock frequency
fSUB: Subsystem clock frequency
12.3.2 Registers controlling port functions of pins to be used for clock or buzzer output
Using a port pin for clock or buzzer output requires setting of the registers that control the port functions multiplexed on
the target pin (port mode register (PMxx), port register (Pxx)). For details, see 4.3.1 Port mode registers (PMxx) and
4.3.2 Port registers (Pxx).
Specifically, using a port pin with a multiplexed clock or buzzer output function (e.g. P43/TI00/TO00/PCLBUZ0,
P41/TI01/TO01/PCLBUZ1) for clock or buzzer output, requires setting the corresponding bits in the port mode register
(PMxx) and port register (Pxx) to 0.
<1> Set 0 in the bit of the port mode register (PMxx) and port register (Px) which correspond to the port which has a
pin used as the PCLBUZ0 pin.
<2> 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).
<3> 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 12-3 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
<R> When the main system clock is selected for the PCLBUZn output (CSEL = 0), if STOP mode is entered within 1.5 clock
cycles output from the PCLBUZn pin after the output is disabled (PCLOEn = 0), the PCLBUZn output width becomes
shorter.
The counting operation of the watchdog timer is set by the option byte (000C0H).
The watchdog timer operates on the low-speed on-chip oscillator clock (fIL).
The watchdog timer is used to detect an inadvertent program loop. If a program loop is detected, an internal reset
signal is generated.
Program loop is detected in the following cases.
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 25 RESET FUNCTION.
When 75% + 1/2/fIL of the overflow time is reached, an interval interrupt can be generated.
Item Configuration
Counter Internal counter (17 bits)
Control register Watchdog timer enable register (WDTE)
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 32).
Set an overflow time by using bits 3 to 1 (WDCS2 to WDCS0) of the option byte (000C0H) (for details, see 13.4.2
and CHAPTER 32).
Set a window open period by using bits 6 and 5 (WINDOW1 and WINDOW0) of the option byte (000C0H) (for
details, see 13.4.3 and CHAPTER 32).
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. After “ACH” is written to the WDTE register, an error of up to 2 clocks (fIL) may occur before the
watchdog timer is cleared.
3. The watchdog timer can be cleared immediately before the count value overflows.
Cautions 4. The operation of the watchdog timer in the HALT, 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%
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.
Remark If the overflow time is set to 29/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.
80-pin 100-pin
Analog input channels 4 ch 6 ch
(ANI0 to ANI3) (ANI0 to ANI5)
The A/D converter is used to convert analog input signals into digital values, and is configured to control analog inputs,
including up to 6 channels of A/D converter analog inputs (ANI0 to ANI5). 10-bit or 8-bit resolution can be selected by the
ADTYP bit of the A/D converter mode register 2 (ADM2).
The A/D converter has the following function.
Various A/D conversion modes can be specified by using the mode combinations below.
Internal bus
RL78/I1B
R01UH0407EJ0210 Rev.2.10
AVREFP/ANI0/P20
Selector
ADCS bit
ANI0/AVREFP/P20
ANI1/AVREFM/P21
Digital Sample & hold circuit
P22/ANI2/IVCMP0/IVREF1 port
control A/D voltage comparator
P23/ANI3/IVCMP1/IVREF0
P24/ANI4 Comparison
P25/ANI5 voltage
generator ADREFM bit
VSS
Selector
Successive
approximation register AVREFM/ANI1/P21
(SAR)
Selector
VSS
Timer trigger signal (INTRTC)
Temperature sensor Timer trigger signal (INTIT)
Controller Timer trigger signal (INTTM01)
Internal reference voltage (1.45 V)Note
A/D conversion
result upper INTAD
limit/lower limit
6 ADTYP
comparator
ADREFP1 ADREFP0 ADREFPM ADRCK AWC
Internal bus
Remark Analog input pin for figure 14-1 when a 100-pin product is used.
Note When using an internal reference voltage, it must be used in HS mode.
The minimum operating voltage in HS mode is 2.4 V.
Use an external reference voltage if you need to operate at 2.4 V or less.
CHAPTER 14 A/D CONVERTER
358
RL78/I1B CHAPTER 14 A/D CONVERTER
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
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 through the A/D conversion result upper limit/lower limit comparator.
Cautions 1. When setting the A/D converter, be sure to set the following registers first while the ADCEN
bit is set to 1. If ADCEN = 0, the values of the A/D converter control registers are cleared to
their initial values and writing to them is ignored (except for port mode register 2 (PM2) and
A/D port configuration register (ADPC)).
A/D converter mode register 0 (ADM0)
A/D converter mode register 1 (ADM1)
A/D converter mode register 2 (ADM2)
10-bit A/D conversion result register (ADCR)
8-bit A/D conversion result register (ADCRH)
Analog input channel specification register (ADS)
Conversion result comparison upper limit setting register (ADUL)
Conversion result comparison lower limit setting register (ADLL)
A/D test register (ADTES).
2. Be sure to clear bit 1 to 0.
Notes 1. For details of the FR2 to FR0, LV1, LV0 bits, and A/D conversion, see Table 14-3 A/D Conversion Time
Selection.
2. 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.
Cautions 1. Change the ADMD, FR2 to FR0, LV1, LV0, and ADCE bits while conversion is stopped (ADCS =
0, ADCE = 0).
2. Do not set ADCS = 1 and ADCE = 0.
3. Do not change the ADCE and ADCS bits from 0 to 1 at the same time by using an 8-bit
manipulation instruction. Be sure to set these bits in the order described in 14.7 A/D
Converter Setup Flowchart.
<R> Figure 14-4. Timing Chart When A/D Voltage Comparator Is Used
ADCE
Notes 1. 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.
2. In starting conversion, the longer will take up to following time
ADM0 Conversion Clock Conversion Start Time (Number of fCLK Clock)
FR2 FR1 FR0 (fAD) Software Trigger Mode/ Hardware Trigger Wait Mode
Hardware Trigger No-wait Mode
0 0 0 fCLK/64 63 1
0 0 1 fCLK/32 31
0 1 0 fCLK/16 15
0 1 1 fCLK/8 7
1 0 0 fCLK/6 5
1 0 1 fCLK/5 4
1 1 0 fCLK/4 3
1 1 1 fCLK/2 1
However, for the second and subsequent conversion in sequential conversion mode, the conversion start
time and stabilization wait time for A/D power supply do not occur after a hardware trigger is detected.
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.
Cautions 3. Only rewrite the value of the ADCE bit when ADCS = 0 (while in the conversion
stopped/conversion standby status).
4. To complete A/D conversion, specify at least the following time as the hardware trigger interval:
Hardware trigger no wait mode: 2 fCLK clock + conversion start time + A/D conversion time
Hardware trigger wait mode: 2 fCLK clock + conversion start time + A/D power supply
stabilization wait time + A/D conversion time
A/D Converter Mode Register 0 Mode Conversion Number of Conversion Conversion Time Selection at 10-Bit Resolution
(ADM0) Clock (fAD) Conversion Time 2.7 V VDD 5.5 V
Note
FR2 FR1 FR0 LV1 LV0 Clock fCLK = fCLK = fCLK = fCLK = fCLK =
1 MHz 4 MHz 8 MHz 16 MHz 24 MHz
0 0 0 0 0 Normal 1 fCLK/64 19 fAD 1216/fCLK Setting Setting Setting Setting prohibited
0 0 1 fCLK/32 (number of 608/fCLK prohibited prohibited prohibited 38 μs 25.3333 μs
0 1 0 fCLK/16 sampling 304/fCLK 38 μs 19 μs 12.6667 μs
0 1 1 fCLK/8 clock: 152/fCLK 38 μs 19 μs 9.5 μs 6.3333 μs
1 0 0 fCLK/6 7 fAD) 114/fCLK 28.5 μs 14.25 μs 7.125 μs 4.75 μs
1 0 1 fCLK/5 95/fCLK 23.75 μs 11.875 μs 5.938 μs 3.9583 μs
1 1 0 fCLK/4 76/fCLK 19 μs 9.5 μs 4.75 μs 3.1667 μs
1 1 1 fCLK/2 38/fCLK 38 μs 9.5 μs 4.75 μs 2.375 μs Setting
prohibited
0 0 0 0 1 Normal 2 fCLK/64 17 fAD 1088/fCLK Setting Setting Setting Setting prohibited
0 0 1 fCLK/32 (number of 544/fCLK prohibited prohibited prohibited 34 μs 22.6667 μs
0 1 0 fCLK/16 sampling 272/fCLK 34 μs 17 μs 11.3333 μs
0 1 1 fCLK/8 clock: 136/fCLK 34 μs 17 μs 8.5 μs 5.6667 μs
1 0 0 fCLK/6 5 fAD) 102/fCLK 25.5 μs 12.75 μs 6.375 μs 4.25 μs
1 0 1 fCLK/5 85/fCLK 21.25 μs 10.625 μs 5.3125 μs 3.5417 μs
1 1 0 fCLK/4 68/fCLK 17 μs 8.5 μs 4.25 μs 2.8333 μs
1 1 1 fCLK/2 34/fCLK 34 μs 8.5 μs 4.25 μs 2.125 μs Setting
prohibited
Note These are the numbers of clock cycles when conversion is with 10-bit resolution. When eight-bit resolution is
selected, the values are shorter by two cycles of the conversion clock (fAD).
Cautions 1. The A/D conversion time must also be within the relevant range of conversion time (tCONV) described
in 37.6.1 A/D converter characteristics.
2. Rewriting the FR2 to FR0, LV1, and LV0 bits to other than the same data while conversion is
stopped (ADCS = 0, ADCE = 0).
3. The above conversion time does not include conversion start time. Conversion start time add in the
first conversion. Select conversion time, taking clock frequency errors into consideration.
A/D Converter Mode Register 0 Mode Conversion Number of Conversion Conversion Time Selection at 10-Bit Resolution
(ADM0) Clock (fAD) Conversion Time 1.9 V VDD 5.5 V Note 2 Note 3
Note 1
FR2 FR1 FR0 LV1 LV0 Clock fCLK = fCLK = fCLK = fCLK = fCLK =
1 MHz 4 MHz 8 MHz 16 MHz 24 MHz
0 0 0 1 0 Low- fCLK/64 19 fAD 1216/fCLK Setting Setting Setting Setting prohibited
voltage 1
0 0 1 fCLK/32 (number of 608/fCLK prohibited prohibited prohibited 38 μs 25.3333 μs
0 1 0 fCLK/16 sampling 304/fCLK 38 μs 19 μs 12.6667 μs
0 1 1 fCLK/8 clock: 152/fCLK 38 μs 19 μs 9.5 μs 6.3333 μs
1 0 0 fCLK/6 7 fAD) 114/fCLK 28.5 μs 14.25 μs 7.125 μs 4.75 μs
1 0 1 fCLK/5 95/fCLK 23.75 μs 11.875 μs 5.938 μs 3.9587 μs
1 1 0 fCLK/4 76/fCLK 19 μs 9.5 μs 4.75 μs 3.1667 μs
1 1 1 fCLK/2 38/fCLK 38 μs 9.5 μs 4.75 μs 2.375 μs Setting
prohibited
0 0 0 1 1 Low- fCLK/64 17 fAD 1088/fCLK Setting Setting Setting Setting prohibited
voltage 2
0 0 1 fCLK/32 (number of 544/fCLK prohibited prohibited prohibited 34 μs 22.6667 μs
0 1 0 fCLK/16 sampling 272/fCLK 34 μs 17 μs 11.3333 μs
0 1 1 fCLK/8 clock: 5 136/fCLK 34 μs 17 μs 8.5 μs 5.6667 μs
1 0 0 fCLK/6 fAD) 102/fCLK 25.5 μs 12.75 μs 6.375 μs 4.25 μs
1 0 1 fCLK/5 85/fCLK 21.25 μs 10.625 μs 5.3125 μs 3.5417 μs
1 1 0 fCLK/4 68/fCLK 17 μs 8.5 μs 4.25 μs 2.8333 μs
1 1 1 fCLK/2 34/fCLK 34 μs 8.5 μs 4.25 μs 2.125 μs Setting
prohibited
Notes 1. These are the numbers of clock cycles when conversion is with 10-bit resolution. When eight-bit resolution is
selected, the values are shorter by two cycles of the conversion clock (fAD).
2. 2.4 V VDD 5.5 V
3. 2.7 V VDD 5.5 V
Cautions 1. The A/D conversion time must also be within the relevant range of conversion time (tCONV) described
in 37.6.1 A/D converter characteristics.
2. Rewriting the FR2 to FR0, LV1, and LV0 bits to other than the same data while conversion is
stopped (ADCS = 0, ADCE = 0).
3. The above conversion time does not include conversion start time. Conversion start time add in the
first conversion. Select conversion time, taking clock frequency errors into consideration.
A/D Converter Mode Mode Conversion Number of Number of A/D Power A/D Power Supply Stabilization Wait Cock +
Register 0 (ADM0) Clock (fAD) A/D Power Conversion Supply Conversion Time at 10-Bit Resolution
Note 2
Supply Clock Stabilization 2.7 V VDD 5.5 V
FR2 FR1 FR0 LV1 LV0 Stabilization Wait Cock + fCLK = fCLK = fCLK = fCLK = fCLK =
Wait Cock Conversion 1 MHz 4 MHz 8 MHz 16 MHz 24 MHz
Time
0 0 0 0 0 Normal fCLK/64 8 fAD 19 fAD 1728/fCLK Setting Setting Setting Setting prohibited
0 0 1 1 fCLK/32 (number of 864/fCLK prohibited prohibited prohibited 54 μs 36 μs
0 1 0 fCLK/16 sampling 432/fCLK 54 μs 27 μs 18 μs
clock:
0 1 1 fCLK/8 216/fCLK 54 μs 27 μs 13.5 μs 9 μs
7 fAD)
1 0 0 fCLK/6 162/fCLK 40.5 μs 20.25 μs 10.125 μs 6.75 μs
1 0 1 fCLK/5 135/fCLK 33.75 μs 16.875 μs 8.4375 μs 5.625 μs
1 1 0 fCLK/4 108/fCLK 27 μs 13.5 μs 6.75 μs 4.5 μs
1 1 1 fCLK/2 54/fCLK 54 μs 13.5 μs 6.75 μs 3.375 μs Setting
prohibited
0 0 0 0 1 Normal fCLK/64 8 fAD 17 fAD 1600/fCLK Setting Setting Setting Setting prohibited
0 0 1 2 fCLK/32 (number of 800/fCLK prohibited prohibited prohibited 50 μs 33.3333 μs
0 1 0 fCLK/16 sampling 400/fCLK 50 μs 25 μs 16.6667 μs
0 1 1 fCLK/8 clock: 200/fCLK 50 μs 25 μs 12.5 μs 8.3333 μs
1 0 0 fCLK/6 5 fAD) 150/fCLK 37.5 μs 18.75 μs 9.375 μs 6.25 μs
1 0 1 fCLK/5 125/fCLK 31.25 μs 15.625 μs 7.8125 μs 5.2083 μs
1 1 0 fCLK/4 100/fCLK 25 μs 12.5 μs 6.25 μs 4.1667 μs
1 1 1 fCLK/2 50/fCLK 50 μs 12.5 μs 6.25 μs 3.125 μs Setting
prohibited
Notes 1. For the second and subsequent conversion in sequential conversion mode, the conversion start time and
stabilization wait time for A/D power supply do not occur after a hardware trigger is detected (see Table 14-3
(1/4)).
2. These are the numbers of clock cycles when conversion is with 10-bit resolution. When eight-bit resolution is
selected, the values are shorter by two cycles of the conversion clock (fAD).
Cautions 1. The A/D conversion time must also be within the relevant range of conversion time (tCONV) described
in 37.6.1 A/D converter characteristics. Note that the conversion time (tCONV) does not include the
A/D power supply stabilization wait time.
2. Rewriting the FR2 to FR0, LV1, and LV0 bits to other than the same data while conversion is
stopped (ADCS = 0, ADCE = 0).
3. The above conversion time does not include conversion start time. Conversion start time add in the
first conversion. Select conversion time, taking clock frequency errors into consideration.
4. When hardware trigger wait mode, specify the conversion time, including the A/D power supply
stabilization wait time from the hardware trigger detection.
A/D Converter Mode Register 0 Mode Conversion Number of Number of A/D power A/D Power Supply Stabilization Wait Cock +
(ADM0) Clock (fAD) A/D power Conversion Supply Conversion Time at 10-Bit Resolution
Note 2
supply Clock Stabilization 1.9 V VDD 5.5 V Note 3 Note 4
FR2 FR1 FR0 LV1 LV0 Stabilization Wait Cock + fCLK = fCLK = fCLK = fCLK = fCLK =
Wait Cock Conversion 1 MHz 4 MHz 8 MHz 16 MHz 24 MHz
Time
0 0 0 1 0 Low- fCLK/64 2 fAD 19 fAD 1344/fCLK Setting Setting Setting Setting prohibited
0 0 1 voltage fCLK/32 (number of 672/fCLK prohibited prohibited prohibited 42 μs 28 μs
0 1 0 1 fCLK/16 sampling 336/fCLK 42 μs 21 μs 14 μs
0 1 1 fCLK/8 clock: 168/fCLK 42 μs 21 μs 10.5 μs 7 μs
1 0 0 fCLK/6 7 fAD) 126/fCLK 31.25 μs 15.75 μs 7.875 μs 5.25 μs
1 0 1 fCLK/5 105/fCLK 26.25 μs 13.125 μs 6.5625 μs 4.375 μs
1 1 0 fCLK/4 84/fCLK 21 μs 10.5 μs 5.25 μs 3.5 μs
1 1 1 fCLK/2 42/fCLK 42 μs 10.5 μs 5.25 μs 2.625 μs Setting
prohibited
0 0 0 1 1 Low- fCLK/64 2 fAD 17 fAD 1216/fCLK Setting Setting Setting Setting prohibited
0 0 1 voltage fCLK/32 (number of 608/fCLK prohibited prohibited prohibited 38 μs 25.3333 μs
0 1 0 2 fCLK/16 sampling 304/fCLK 38 μs 19 μs 12.6667 μs
0 1 1 fCLK/8 clock: 152/fCLK 38 μs 19 μs 9.5 μs 6.3333 μs
1 0 0 fCLK/6 5 fAD) 114/fCLK 28.5 μs 14.25 μs 7.125 μs 4.75 μs
1 0 1 fCLK/5 95/fCLK 23.75 μs 11.875 μs 5.938 μs 3.9583 μs
1 1 0 fCLK/4 76/fCLK 19 μs 9.5 μs 4.75 μs 3.1667 μs
1 1 1 fCLK/2 38/fCLK 38 μs 9.5 μs 4.75 μs 2.375 μs Setting
prohibited
Notes 1. For the second and subsequent conversion in sequential conversion mode, the conversion start time and
stabilization wait time for A/D power supply do not occur after a hardware trigger is detected (see Table 14-3 (2/4)).
2. These are the numbers of clock cycles when conversion is with 10-bit resolution. When eight-bit resolution is
selected, the values are shorter by two cycles of the conversion clock (fAD).
3. 2.4 V VDD 5.5 V
4. 2.7 V VDD 5.5 V
Cautions 1. The A/D conversion time must also be within the relevant range of conversion time (tCONV) described
in 37.6.1 A/D converter characteristics. Note that the conversion time (tCONV) does not include the
A/D power supply stabilization wait time.
2. Rewriting the FR2 to FR0, LV1, and LV0 bits to other than the same data while conversion is
stopped (ADCS = 0, ADCE = 0).
3. The above conversion time does not include conversion start time. Conversion start time add in the
first conversion. Select conversion time, taking clock frequency errors into consideration.
4. When hardware trigger wait mode, specify the conversion time, including the A/D power supply
stabilization wait time from the hardware trigger detection.
Figure 14-5. A/D Converter Sampling and A/D Conversion Timing (Example for Software Trigger Mode)
ADCS
Sampling
timing
INTAD
Cautions 1. Rewrite the value of the ADM1 register while conversion is stopped (ADCS = 0, ADCE = 0).
2. To complete A/D conversion, specify at least the following time as the hardware trigger interval:
Hardware trigger no wait mode: 2 fCLK clock + conversion start time + A/D conversion time
Hardware trigger wait mode: 2 fCLK clock + conversion start time + A/D power supply
stabilization wait time + A/D conversion time
3. In modes other than SNOOZE mode, input of the next INTRTC or INTIT will not be recognized as
a valid hardware trigger for up to four fCLK cycles after the first INTRTC or INTIT is input.
ADREFP1 ADREFP0 Selection of the + side reference voltage of the A/D converter
Note 2
0 0 Supplied from VDD
0 1 Supplied from P20/AVREFP/ANI0
Note 1
1 0 Supplied from the internal reference voltage (1.45 V)
1 1 Setting prohibited
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) Reference voltage stabilization wait time (A)
(4) Set ADCE = 1
(5) Reference voltage stabilization wait time (B)
When ADREFP1 and ADREFP0 are set to 1 and 0, the setting is changed to A = 5 μs, B = 1 μs.
When ADREFP1 and ADREFP0 are set to 0 and 0 or 0 and 1, A needs no wait and B = 1 μs.
After (5) stabilization time, start the A/D conversion.
When ADREFP1 and ADREFP0 are set to 1 and 0, respectively, A/D conversion cannot be performed on the
temperature sensor output voltage and internal reference voltage (1.45 V).
Be sure to perform A/D conversion while ADISS = 0.
ADREFM Selection of the side reference voltage source of the A/D converter
Cautions 1. Only rewrite the value of the ADM2 register while conversion is stopped (ADCS = 0, ADCE = 0).
2. Do not set the ADREFP1 bit to 1 when shifting to STOP mode, or to HALT mode while the CPU is
operating on the subsystem clock. When the internal reference voltage is selected (ADREFP1,
ADREFP0 = 1, 0), the A/D converter reference voltage current (IADREF) indicated in 37.3.2 Supply
current characteristics will be added.
3. When using AVREFP and AVREFM, specify ANI0 and ANI1 as the analog input channels and specify
input mode by using the port mode register.
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
(AREA 1).
1 The interrupt signal (INTAD) is output when the ADCR register < the ADLL register (AREA 2) or the
ADUL register < the ADCR register (AREA 3).
Figure 14-8 shows the generation range of the interrupt signal (INTAD) for AREA 1 to AREA 3.
Note Refer to “Transition time from STOP mode to SNOOZE mode” in 24.3.3 SNOOZE mode
Caution Only rewrite the value of the ADM2 register while conversion is stopped (ADCS = 0, ADCE = 0).
AREA 1
(ADLL ≤ ADCR ≤ ADUL) INTAD is generated
when ADRCK = 0.
Remark If INTAD does not occur, the A/D conversion result is not stored in the ADCR or ADCRH register.
Note If the A/D conversion result is outside the range specified by using the A/D conversion comparison function (the
value specified by the ADRCK bit of the ADM2 register and ADUL/ADLL registers; see Figure 14-8), the result is
not stored.
FFF1FH FFF1EH
Symbol
ADCR 0 0 0 0 0 0
Cautions 1. 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 (bits 7 and
6 of the ADCR register).
2. 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 of the ADCR register.
Note If the A/D conversion result is outside the range specified by using the A/D conversion comparison function (the
value specified by the ADRCK bit of the ADM2 register and ADUL/ADLL registers; see Figure 14-8), the result is
not stored.
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.
Cautions 7. If ADISS is set to 1, the internal reference voltage (1.45 V) cannot be used for the + side
reference voltage. After the ADISS bit is set to 1, the initial conversion result cannot be used.
For the setting flow, see 14.7.4 Setup when temperature sensor output voltage/internal
reference voltage is selected.
8. Do not set the ADISS bit to 1 when shifting to STOP mode, or to HALT mode while the CPU is
operating on the subsystem clock. Also, if the ADREFP1 bit is set to 1, the A/D converter
reference voltage current (IADREF) indicated in 37.3.2 Supply current characteristics will be
added to the current consumption when shifting to HALT mode while the CPU is operating on
the main system clock.
9. Ignore the conversion result if the corresponding ANI pin does not exist in the product used.
Figure 14-12. Format of Conversion Result Comparison Upper Limit Setting Register (ADUL)
Figure 14-13. Format of Conversion Result Comparison Lower Limit Setting Register (ADLL)
Cautions 1. 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 values in the ADUL and ADLL
registers.
2. Only write new values to the ADUL and ADLL registers while conversion is stopped (ADCS = 0,
ADCE = 0).
3. The setting of the ADUL registers must be greater than that of the ADLL register.
Note The temperature sensor output voltage and internal reference voltage (1.45 V) can be selected only in
the HS (high-speed main) mode.
Caution For details of the A/D test function, see CHAPTER 30 SAFETY FUNCTIONS.
When using the ANI0 to ANI5 pins for analog input of the A/D converter, set the port mode register (PMxx) bit
corresponding to each port to 1 and select analog input through the A/D port configuration register (ADPC).
<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 latchedNote 1.
Note 1
At the same time, the A/D conversion end interrupt request (INTAD) can also be generated .
Note 2
<8> Repeat steps <1> to <7>, until the ADCS bit is cleared to 0 .
To stop the A/D converter, clear the ADCS bit to 0.
Notes 1. If the A/D conversion result is outside the A/D conversion result range specified by the ADRCK bit and the
ADUL and ADLL registers (see Figure 14-8), the A/D conversion result interrupt request signal is not
generated and no A/D conversion results are stored in the ADCR and ADCRH registers.
2. 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.
Write ADCS το 1
ADCS
Conversion time
Conversion Sampling time
start time
Conversion
SAR Undefined result
ADCR Conversion
result
INTAD
In one-shot conversion mode, the ADCS bit is automatically cleared to 0 after completion of A/D conversion.
In sequential conversion mode, A/D conversion operations proceed continuously until the software clears bit 7 (ADCS)
of the A/D converter mode register 0 (ADM0) to 0.
When the value of the analog input channel specification register (ADS) is rewritten or overwritten during conversion,
the current A/D conversion is interrupted, and A/D conversion is performed on the analog input newly specified in the ADS
register. The partially converted data is discarded.
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 ANI5) 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 14-16 shows the relationship between the analog input voltage and the A/D conversion result.
Figure 14-16. 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 14.7 A/D Converter Setup Flowchart.
<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.
<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 14-17. Example of Software Trigger Mode (Select Mode, Sequential Conversion Mode) Operation Timing
INTAD
<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.
<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 14-18. Example of Software Trigger Mode (Select Mode, One-shot Conversion Mode) Operation Timing
INTAD
<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.
<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 14-19. Example of Software Trigger Mode (Scan Mode, Sequential Conversion Mode) Operation Timing
INTAD
The interrupt is generated four times. The interrupt is generated four times. The interrupt is generated four times.
<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.
<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 14-20. Example of Software Trigger Mode (Scan Mode, One-shot Conversion Mode) Operation Timing
ADCR, Data 0 Data 1 Data 2 Data 3 Data 0 (ANI0) Data 1 Data 2 Data 3 Data 0 Data 4 Data 5 Data 6
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.
14.6.5 Hardware trigger no-wait mode (select mode, sequential conversion mode)
<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
system enters the A/D conversion standby status. However, the A/D converter does not stop in this status.
<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 14-21. Example of Hardware Trigger No-wait Mode (Select Mode, Sequential Conversion Mode) Operation
Timing
INTAD
14.6.6 Hardware trigger no-wait mode (select mode, one-shot conversion mode)
<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
system enters the A/D conversion standby status. However, the A/D converter does not stop in this status.
<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 14-22. Example of Hardware Trigger No-wait Mode (Select Mode, One-shot Conversion Mode) Operation
Timing
INTAD
14.6.7 Hardware trigger no-wait mode (scan mode, sequential conversion mode)
<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
system enters the A/D conversion standby status. However, the A/D converter does not stop in this status.
<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 14-23. Example of Hardware Trigger No-wait Mode (Scan Mode, Sequential Conversion Mode) Operation
Timing
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.
14.6.8 Hardware trigger no-wait mode (scan mode, one-shot conversion mode)
<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
system enters the A/D conversion standby status. However, the A/D converter does not stop in this status.
<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 14-24. Example of Hardware Trigger No-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.
14.6.9 Hardware trigger wait mode (select mode, sequential conversion mode)
<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
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 14-25. Example of Hardware Trigger Wait Mode (Select Mode, Sequential Conversion Mode) Operation
Timing
ADCE
<4> A hardware trigger is
<2> A hardware trigger generated during A/D
Hardware is generated. conversion operation.
trigger
ADCS is overwritten <6> ADCS is cleared <7>
The trigger Trigger to 0 during A/D Trigger The trigger
is not with 1 during A/D
standby conversion operation. conversion operation. standby is not
acknowledged. status status acknowledged.
ADCS <5> ADS is rewritten during
A/D conversion operation
(from ANI0 to ANI1).
Data 0 Data 1
ADS (ANI0) (ANI1)
<3> A/D conversion ends Conversion is Conversion is
and the next Conversion is interrupted and Conversion is
conversion<3> interrupted restarts. interrupted.
and restarts.<3> interrupted <3> <3>
starts. and restarts.
A/D
Conversion Conversion Data 0 Data 0 Data 0 Data 0 Data 0 Data 1 Data 1 Data 1 Data 1 Conversion Conversion
conversion stopped standby (ANI0) (ANI0) (ANI0) (ANI0) (ANI0) (ANI1) (ANI1) (ANI1) (ANI1) standby stopped
status
Conversion start
ADCR, Data 0 Data 0 Data 0 Data 1 Data 1
ADCRH (ANI0) (ANI0) (ANI0) (ANI1) (ANI1)
INTAD
14.6.10 Hardware trigger wait mode (select mode, one-shot conversion mode)
<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
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 14-26. 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> <8> ADCS is cleared
generated during A/D <2> <2>
is generated. to 0 during A/D
Hardware conversion operation. conversion
trigger operation.
Trigger ADCS is automatically
The trigger is not standby Trigger
<4>standby Trigger
<4> standby Trigger
<4>standby <7> ADCS is overwritten <4>Trigger Trigger The trigger is not
standby standby acknowledged.
acknowledged. status cleared to 0 after with 1 during A/D
status status status status status
conversion ends. conversion operation.
INTAD
14.6.11 Hardware trigger wait mode (scan mode, sequential conversion mode)
<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
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 14-27. 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
is generated.
Hardware conversion operation.
trigger
The trigger is not Trigger ADCS is overwritten <6> ADCS is cleared <7>Trigger standby The trigger is not
acknowledged. standby status with 1 during A/D to 0 during A/D status acknowledged.
conversion operation. conversion operation.
ADCS
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.
14.6.12 Hardware trigger wait mode (scan mode, one-shot conversion mode)
<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
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 14-28. 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
ADM2 register
ADM0 register setting ADREFP1, ADREFP0, and ADREFM bits: These are used to select the reference
ADM1 register setting voltage.
ADM2 register setting ADRCK bit: This is used to select the range for the A/D conversion result comparison
ADUL/ADLL register setting value generated by the interrupt signal from AREA1, AREA3, and
AREA2.
ADS register setting
ADTYP bit: 8-bit/10-bit resolution
(The order of the settings is
ADUL/ADLL register
irrelevant.)
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.
Counting up to the reference
The counting up to the reference voltage stabilization wait time A indicated by A below
voltage stabilization
may be required if the values of the ADREFP1 and ADREFP0 bits are changed.
wait time A If change the ADREFP1 and ADREFP0 = 1, 0: A = 5 μs
If change the ADREFP1 and ADREFP0 = 0, 0 or 0, 1: No wait
ADCE bit setting The ADCE bit of the ADM0 register is set (1), and the system enters the A/D conversion
standby status.
Counting up to the reference
voltage stabilization The counting up to the reference voltage stabilization wait time B (1 μs) is counted by
wait time B the software.
After counting up to the counting up to the reference voltage stabilization wait time B
ADCS bit setting
ends, the ADCS bit of the ADM0 register is set (1), and A/D conversion starts.
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: 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
ADM2 register
ADM0 register setting ADREFP1, ADREFP0, and ADREFM bits: These are used to select the reference
ADM1 register setting voltage.
ADM2 register setting ADRCK bit: This is used to select the range for the A/D conversion result comparison
ADUL/ADLL register setting value generated by the interrupt signal from AREA1, AREA3, and AREA2.
ADS register setting ADTYP bit: 8-bit/10-bit resolution
The counting up to the reference voltage stabilization wait time A indicated by A below
Counting up to the reference
may be required if the values of the ADREFP1 and ADREFP0 bits are changed.
voltage stabilization wait time A If change the ADREFP1 and ADREFP0 = 1, 0: A = 5 μs
If change the ADREFP1 and ADREFP0 = 0, 0 or 0, 1: No wait
ADCE bit setting The ADCE bit of the ADM0 register is set (1), and the system enters the A/D conversion
standby status.
Counting up to the reference The counting up to the reference voltage stabilization wait time B (1 μs) is counted by the
voltage stabilization wait time B software.
After counting up to the counting up to the reference voltage stabilization wait time B
ADCS bit setting
ends, the ADCS bit of the ADM0 register is set (1), and the system enters the hardware
trigger standby status.
Hardware trigger standby status
Start of A/D conversion by
generating a hardware trigger
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
ADREFP1, ADREFP0, and ADREFM bits: These are used to select the reference
ADM2 register setting
voltage.
ADUL/ADLL register setting ADRCK bit: This is used to select the range for the A/D conversion result comparison
ADS register setting value generated by the interrupt signal from AREA1, AREA3, and AREA2.
(The order of the settings is AWC bit: This is used to set up the SNOOZE mode function.
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.
Counting up to the reference The counting up to the reference voltage stabilization wait time A indicated by A below
may be required if the values of the ADREFP1 and ADREFP0 bits are changed.
voltage stabilization wait time A
If change the ADREFP1 and ADREFP0 = 1, 0: A = 5 μs
If change the ADREFP1 and ADREFP0 = 0, 0 or 0, 1: No wait
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 for A/D The system automatically counts up to the stabilization wait time for A/D power supply.
power supply
Start of A/D conversion After counting up to the reference voltage 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.
14.7.4 Setup when temperature sensor output voltage/internal reference voltage is selected (example for software
trigger mode and one-shot conversion mode)
<R> Figure 14-32. Setup When Temperature Sensor Output Voltage/Internal Reference Voltage Is Selected
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: One-shot conversion mode
ADUL/ADLL register
These are used to specify the upper limit and lower limit A/D conversion
result comparison values.
ADS register
ADISS and ADS4 to ADS0 bits: These are used to select temperature
sensor output voltage or internal
reference voltage.
The counting up to the reference voltage stabilization wait time A may be
Counting up to the reference required if the values of the ADREFP1 and ADREFP0 bits are changed.
voltage stabilization wait time A If change the ADREFP1 and ADREFP0 = 0, 0 or 0, 1: No wait
If change the ADREFP1 and ADREFP0 = 1, 0: Setting prohibited
The ADCE bit of the ADM0 register is set (1), and the system enters the
ADCE bit setting
A/D conversion standby status.
Counting up to the reference The counting up to the reference voltage stabilization wait time B (1 μs) is
First A/D conversion time
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.
Second A/D conversion time
ADCS bit setting The ADCS bit of the ADM0 register is set (1), and A/D conversion starts.
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 and 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.
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 for the reference
ADM2 register setting voltage.
ADUL/ADLL register setting ADRCK bit: This is used to set the range for the A/D conversion result comparison
value generated by the interrupt signal to AREA2.
ADS register setting
ADTYP bit: This is used to specify 10-bit resolution.
ADTES register setting
(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
Counting up to the reference The counting up to the reference voltage stabilization wait time A may be required if the
values of the ADREFP1 and ADREFP0 bits are changed.
voltage stabilization wait time A
If change the ADREFP1 and ADREFP0 = 1, 0: A = 5 μs
If change the ADREFP1 and ADREFP0 = 0, 0 or 0, 1: No wait
ADCE bit setting The ADCE bit of the ADM0 register is set (1), and the system enters the A/D conversion
standby status.
Counting up to the reference The counting up to the reference voltage stabilization wait time B (1 μs) is counted by the
voltage stabilization wait time B software.
ADCS bit setting After counting up to the counting up to the reference voltage stabilization wait time B
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.
Caution For the procedure for testing the A/D converter, see 30.3.8 A/D test function.
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. This is effective for reducing the operation current.
If the A/D conversion result range is specified using the ADUL and ADLL registers, A/D conversion results can be
judged at a certain interval of time in SNOOZE mode. Using this function enables power supply voltage monitoring and
input key judgment based on A/D inputs.
In the SNOOZE mode, only the following 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)
Caution 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 14.7.3 Setting up hardware trigger wait modeNote 2). Just before move to
STOP mode, 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 A/D power supply 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 14-35. 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 14-36. 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)
Start of setup
PER0 register setting The ADCEN bit of the PER0 register is set (1), and supplying the clock starts.
PMx register setting The ports are set to the input mode.
• ADM0 register
FR2 to FR0, LV1, and LV0 bits: These are used to specify theA/D conversion time.
ADMD bit: Select mode/scan mode
• ADM0 register setting • ADM1 register
Normal ADTMD1 and ADTMD0 bits: These are used to specify the hardware trigger wait mode.
operation • ADM1 register setting ADSCM bit: One-shot conversion mode
ADTRS1 and ADTRS0 bits: These are used to select the hardware trigger signal.
• ADM2 register setting
• ADM2 register
• ADUL/ADLL register ADREFP1, ADREFP0, and ADREFM bits: These are used to select the reference voltage.
setting ADRCK bit: This is used to select the range for theA/D conversion result comparison value
generated by the interrupt signal fromAREA1, AREA3, and AREA2.
• ADS register setting ADTYP bit: 8-bit/10-bit resolution
• ADUL/ADLL register
(The order of the settings
These are used to specify the upper limit and lower limitA/D conversion result comparison values.
is irrelevant.)
• ADS register
ADS4 to ADS0 bits: These are used to select the analog input channels.
Counting up to The counting up to the reference voltage stabilization wait time A may be required if the values
the reference of the ADREFP1 and ADREFP0 bits are changed.
voltage stabilization If change theADREFP1 and ADREFP0 = 1, 0: A = 5 μs
wait time A If change theADREFP1 and ADREFP0 = 0, 0 or 0, 1: No wait
Immediately before entering the STOP mode, enable the SNOOZE mode by setting theAWC bit of
AWC = 1 the ADM2 register to 1.
The ADCE bit of the ADM0 register is set (1), and the system enters theA/D conversion
ADCE bit setting standby status.
STOP
mode
Hardware trigger After hardware trigger is generated, the system automatically counts up to the stabilization
generation wait time for A/D power supply andA/D conversion is started in the SNOOZE mode.
End of A/D conversion The A/D conversion end interrupt (INTAD) is generated.Note 1
SNOOZE
mode
The clock request signal
(an internal signal) is No INTAD
automatically set to the low generation
level in the SNOOZE mode.
Yes
Storage of conversion The conversion results are stored in theADCR and ADCRH registers.
results in the ADCR and
ADCRH registers
Normal
operation AWC = 0 Release the SNOOZE mode by clearing theAWC bit of the ADM2 register to 0.Note 2
Normal operation
Notes 1. If the A/D conversion end interrupt request signal (INTAD) is not generated by setting ADRCK bit and
ADUL/ADLL register, the result is not stored in the ADCR and ADCRH registers.
The system enters the STOP mode again. If a hardware trigger is input later, A/D conversion operation is
again performed in the SNOOZE mode.
2. If the AWC bit is left set to 1, A/D conversion will not start normally in spite of the subsequent SNOOZE or
normal operation mode. Be sure to clear the AWC bit to 0.
(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).
10
1LSB = 1/2 = 1/1024
= 0.098%FSR
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
110
010
Figure 14-42. Integral Linearity Error Figure 14-43. 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
Caution Internal reference voltage (1.45 V) can be used only in HS (high-speed main) mode.
<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
ANI0 to ANI5
C = 10 pF to 0.1 μ F
<1> The analog input pins (ANI0 to ANI5) are also used as input port pins (P20 to P25).
When A/D conversion is performed with any of the ANI0 to ANI5 pins selected, do not change to output value
P20 to P25 while conversion is in progress; otherwise the conversion resolution may be degraded.
<2> If a pin adjacent to a pin that is being A/D converted is used as a digital I/O port pin, the A/D conversion result
might differ from the expected value due to a coupling noise. Be sure to avoid the input or output of digital
signals and signals with similarly sharp transitions during A/D conversion.
ADIF
R1
ANIn
C1 C2
Table 14-4. Resistance and Capacitance Values of Equivalent Circuit (Reference Values)
Remark The resistance and capacitance values shown in Table 14-4 are not guaranteed values.
The RL78/I1B has an on-chip temperature sensor. Temperature can be measured by measuring the output voltage
from the temperature sensor using the 10-bit A/D converter. The mode of the temperature sensor can be switched to one
of the following three modes by setting the temperature control register.
10-bit
Temperature sensor A/D converter
Internal bus
1.25
0.1
0
TJ = 40 TJ = 10 TJ = 25 TJ = 55 TJ = 90 Temp. (°C)
15.2 Registers
Table 15-1 shows the register used for the temperature sensor.
Item Configuration
Notes 1. After setting the TMPEN bit to 1, a 50 μs operation stabilization wait time is necessary.
2. After changing bits TMPSEL1-TMPSEL0, a 15 μs mode switch stabilization wait time is necessary.
The procedures for setting the temperature sensor are shown below.
Note Operation stabilization wait time is required until the A/D converter starts conversion.
Note Mode switch stabilization wait time is required until the A/D converter starts conversion.
The 24-bit ∆Σ A/D converter has a 24-bit resolution when converting an analog input signal to digital values.
Caution When using the high-speed system clock (fMX) by setting DSADCK in the PCKC register to 1, supply
12 MHz.
Table 16-1 lists the configuration of 24-bit ∆Σ A/D converter. Figures 16-1 and 16-2 show the block diagram of 24-bit
∆Σ A/D converter, respectively.
Item Configuration
Phase adjustment
(PHC0)
Phase adjustment
(PHC1)
Internal bus
Selector
×1 to ×16 filter
ANIP0 + Channel 0 (current channel) (DF)
Digital High-pass
ANIN1 - A/D converter
×1 to ×16 filter filter
ANIP1 + Channel 1 (voltage channel) (DF) (HPF)
adjustment
(PHC1)
Phase
Digital DSADCR0
ANIN2 - A/D converter DSADCR1 Interrupt
×1 to ×16 filter
ANIP2 + Channel 2 (current channel) (DF) DSADCR2 INTDSAD
Internal bus
AREGC
0.47 F AVCM
0.47 F AVRT
DSADCK
0.47 F
High-speed
system clock
Controller
Notes 1. One channel inputs two signals. The ANINn pin is the negative input, while the ANIPn pin is the positive
input.
2. Channels 0 and 2 are current channels and channels 1 and 3 are voltage channels.
3. Connect capacitors of 10 μF + 0.1 μF as stabilization capacitance between the AVDD and AVSS pins.
4. Consider the sensor delay when selecting the pin for a single phase two-wire meter.
16.1.2 Pre-amplifier
This unit amplifies an analog input signal to be input to the ANINn and ANIPn pins.
The gain can be set to 1, 2, 4, 8, 16, or 32
Note
using the register settings.
16.2 Registers
Table 16-3 lists the registers used for the 24-bit ∆Σ A/D converter.
Item Configuration
Control registers ∆Σ A/D converter mode register (DSADMR)
∆Σ A/D converter gain control register 0 (DSADGCR0)
∆Σ A/D converter gain control register 1 (DSADGCR1)
∆Σ A/D converter HPF control register (DSADHPFCR)
∆Σ A/D converter phase control register 0 (DSADPHCR0)
∆Σ A/D converter phase control register 1 (DSADPHCR1)
Registers ∆Σ A/D converter conversion result register 0L (DSADCR0L)
∆Σ A/D converter conversion result register 0M (DSADCR0M)
∆Σ A/D converter conversion result register 0H (DSADCR0H)
∆Σ A/D converter conversion result register 1L (DSADCR1L)
∆Σ A/D converter conversion result register 1M (DSADCR1M)
∆Σ A/D converter conversion result register 1H (DSADCR1H)
∆Σ A/D converter conversion result register 2L (DSADCR2L)
∆Σ A/D converter conversion result register 2M (DSADCR2M)
∆Σ A/D converter conversion result register 2H (DSADCR2H)
∆Σ A/D converter conversion result register 3L (DSADCR3L)
∆Σ A/D converter conversion result register 3M (DSADCR3M)
∆Σ A/D converter conversion result register 3H (DSADCR3H)
∆Σ A/D converter conversion result register 0 (DSADCR0)
∆Σ A/D converter conversion result register 1 (DSADCR1)
∆Σ A/D converter conversion result register 2 (DSADCR2)
∆Σ A/D converter conversion result register 3 (DSADCR3)
Control registers Peripheral enable register 1 (PER1)
Peripheral clock control register (PCKC)
DSADMR DSAD DSAD 0 0 DSAD DSAD DSAD DSAD 0 0 0 0 DSAD DSAD DSAD DSAD
FR TYP PON3 PON2 PON1 PON0 CE3 CE2 CE1 CE0
0 3906.25 Hz
1 1953.125 Hz
This bit is used to select the sampling frequency.
DSADTYP Resolution selection when reading ∆Σ A/D converter conversion result register
0 24-bit resolution
1 16-bit resolution
When DSADTYP = 0:
The lower 16 bits in the ∆Σ A/D converter conversion result register can be read by reading the ∆Σ A/D converter conversion
result register (DSADCRn). Read DSADCRnH as the higher 8 bits.
When DSADTYP = 1:
The higher 16 bits in the ∆Σ A/D converter conversion result register can be read by reading the ∆Σ A/D converter conversion
result register (DSADCRn).
0 Power down
1 Power on
DSADCEn ∆Σ A/D converter operation enable (analog and digital blocks) of channel n
Note
Note For 80-pin products, when adjusting the phase of the current channel (I1: channel 2) using a ∆Σ A/D converter
phase control register 1 (DSADPHCR1), be sure to set the DSADCE3 bit of the ∆Σ A/D converter mode register
(DSADMR) to 1. Otherwise, be sure to set the DSADCE3 bit to 0.
Cautions 1. When a clock faster than 12 MHz is selected as the CPU clock (fCLK), do not write to the DSADMR
register successively. When writing to this register successively, allow at least one cycle of fCLK
between writes. Three cycles is required until the ∆Σ A/D converter is powered down after the
DSADPONn bit is set to 0. When setting the DSADPONn bit to 1 again, be sure to allow at least three
cycles of fCLK before powering on the ∆Σ A/D converter.
2. Be sure to clear bits 13, 12, and 7 to 4 to “0”.
Remark n = 0 to 3
0000B Power-down
0001B I0
0010B V0
0011B V0 I0 Single-phase two-wire I: 1 channel, V: 1 channel
0100B I1
0101B I1 I0
0110B I1 V0
0111B I1 V0 I0 Single-phase two-wire I: 2 channels, V: 1 channel
1000B V1
1001B V1 I0
1010B V1 V0
1011B V1 V0 I0
1100B V1 I1 Single-phase two-wire I: 1 channel, V: 1 channel
1101B V1 I1 I0 Single-phase two-wire I: 2 channels, V: 1 channel
1110B V1 I1 V0
1111B V1 I1 V0 I0 Single-phase three-wire I: 2 channels, V: 2 channels
Caution When adjusting the phase using the ∆Σ A/D converter phase control register 0 (DSADPHCR0), be sure
to set the DSADCE0 and DSADCE1 bits of the ∆Σ A/D converter mode register (DSADMR) to “1”.
Especially when using with single-phase two-wire (I0: channel 0, I1: channel 2, V1: channel 3) and
adjusting the phase of the current channel (I0: channel 0), set DSADPHCCTL0 = 1, DSADPON0 = 1,
DSADCE0 = 1, DSADPON1 = 0, and DSADCE1 = 1.
Also, when adjusting the phase using the ∆Σ A/D converter phase control register 1 (DSADPHCR1), be
sure to set the DSADCE2 and DSADCE3 bits of the ∆Σ A/D converter mode register (DSADMR) to “1”.
Especially when using with single-phase two-wire (I0: channel 0, V0: channel 1, I1: channel 2) and
adjusting the phase of the current channel (I1: channel 2), set DSADPHCCTL1 = 1, DSADPON2 = 1,
DSADCE2 = 1, DSADPON3 = 0, and DSADCE3 = 1.
0 0 0 PGA gain: 1
0 0 1 PGA gain: 2
0 1 0 PGA gain: 4
0 1 1 PGA gain: 8
1 0 0 PGA gain: 16
Other than above Setting prohibited
These bits are used to control the PGA gain. The gain can be set in the range of 1 to 16.
0 0 0 PGA gain: 1
0 0 1 PGA gain: 2
0 1 0 PGA gain: 4
0 1 1 PGA gain: 8
1 0 0 PGA gain: 16
PGA gain: 32
Note
1 0 1
Other than above Setting prohibited
These bits are used to control the PGA gain. The gain can be set in the range of 1 to 32.
Note The gain is doubled by the digital filter (for current channels (ch0, ch2) only).
0 0 0 PGA gain: 1
0 0 1 PGA gain: 2
0 1 0 PGA gain: 4
0 1 1 PGA gain: 8
1 0 0 PGA gain: 16
Other than above Setting prohibited
These bits are used to control the PGA gain. The gain can be set in the range of 1 to 16.
0 0 0 PGA gain: 1
0 0 1 PGA gain: 2
0 1 0 PGA gain: 4
0 1 1 PGA gain: 8
1 0 0 PGA gain: 16
PGA gain: 32
Note
1 0 1
Other than above Setting prohibited
These bits are used to control the PGA gain. The gain can be set in the range of 1 to 32.
Note The gain is doubled by the digital filter (for current channels (ch0, ch2) only).
0 0 0.607 Hz
0 1 1.214 Hz
1 0 2.429 Hz
1 1 4.857 Hz
Remark The high-pass filter convergence time can be changed by changing the high-pass filter cut-off frequency. The
convergence time decreases as the cut-off frequency increases.
The DSADEN bit of the peripheral enable register (PRE1) must be reset in order to clear the high-pass filter.
DSADPHCR0 DSAD DSAD DSAD DSAD DSAD DSAD DSAD DSAD DSAD DSAD DSAD DSAD
PHCC 0 0 0 0 PHC0 PHC0 PHC0 PHC0 PHC0 PHC0 PHC0 PHC0 PHC0 PHC0 PHC0
TL0 10 9 8 7 6 5 4 3 2 1 0
DSADPHCR1 DSAD DSAD DSAD DSAD DSAD DSAD DSAD DSAD DSAD DSAD DSAD DSAD
PHCC 0 0 0 0 PHC1 PHC1 PHC1 PHC1 PHC1 PHC1 PHC1 PHC1 PHC1 PHC1 PHC1
TL1 10 9 8 7 6 5 4 3 2 1 0
Symbol 7 6 5 4 3 2 1 0
Symbol 7 6 5 4 3 2 1 0
DSADCRnL DSADCRnL [7:0]
∆Σ A/D conversion result n [23:16] ∆Σ A/D conversion result n [15:8] ∆Σ A/D conversion result n [7:0]
∆Σ A/D conversion result n [23:16] ∆Σ A/D conversion result n [23:16] ∆Σ A/D conversion result n [15:8]
Caution Be sure to read the ∆Σ A/D converter conversion result register within its maximum pending
time after the ∆Σ A/D conversion end interrupt is generated.
Note Access to the DSADCRn register changes depending on the setting of the DSADTYP bit in the DSADMR
register.
DSADTYP = 0: The lower 16 bits can be read. Read DSADCRnH as the higher 8 bits.
DSADTYP = 1: The higher 16 bits can be read.
Caution Be sure to read the ∆Σ A/D converter conversion result register within its maximum pending time
after the ∆Σ A/D conversion end interrupt is generated.
Cautions 1. When setting the 24-bit ∆Σ A/D converter, be sure to set the DSADCEN bit to 1 first.
If DSADCEN = 0, writing to a control register of the ∆Σ A/D converter is ignored, and all read values
are default values.
2. Be sure to clear bits 2 and 1 to “0”.
3. When a high-speed on-chip oscillator is selected as the input clock, be sure to run the high-speed
on-chip oscillator clock frequency correction function to input clock with high frequency precision.
PCKC 0 0 0 0 0 0 0 DSADCK
Notes 1. When selecting the high-speed on-chip oscillator clock, be sure to run the high-speed on-chip oscillator clock
frequency correction function.
2. Only a 12 MHz crystal oscillator can be used as the high-speed system clock frequency (fMX).
16.3 Operation
The 24-bit ∆Σ A/D converter has the digital signal input pins for four ∆Σ A/D converter conversion results. By passing
2-bit values obtained from these ∆Σ A/D converter conversion results through the digital filter, the value is converted into
24-bit digital values.
The mode setting of the ∆Σ A/D converter of the analog block depends on the values of the DSADMR, DSADGCR0,
and DSADGCR1 register. Table 16-5 lists the mode settings.
Remark n = 0 to 3
Select A/D converter input clock • High-speed system clock (fMX) selected (DSADCK = 1)
(DSADCK in PCKC register) Execute a NOP instruction twice after switching to the selected clock.
Enable A/D converter input clock • Set bit 0 (DSADCEN) in peripheral enable register 1 (PER1) to 1,
DSADCEN in PER1 register = 1 and start the input clock to the A/D converter.
Execute processing
using A/D conversion result
Notes 1. When selecting the high-speed on-chip oscillator clock, be sure to run the high-speed on-chip oscillator
clock frequency correction function before running the ∆Σ A/D converter.
2. Set the sampling frequency while the ∆Σ A/D converter is powered down.
3. The setup time (the number of times INTDSAD is to be generated) when DSADPONn is set to 0 and then 1
will be officially determined after evaluation.
4. If the ∆Σ A/D converter is temporarily stopped for initialization (DSADCEn = 0 with DSADPONn = 1) and
then restarted, it is necessary to wait for a certain setup time. In this case, since stabilization time is
necessary for the converter, wait for one INTDSAD to be generated as the setup time.
To initialize the ∆Σ A/D converter, make sure that DSADCEn remains 0 for at least 1.4 μs.
5. Perform only when selecting the high-speed on-chip oscillator clock.
Remark n = 0 to 3; m = 0, 1
16.3.2 Procedure for switching from normal operation mode to neutral missing mode
Figure 16-14 shows the procedure for switching from normal operation (with anti-tamper) (a total of three: current
channel 0, voltage channel 1, and current channel 2 operate) to neutral missing mode (only current channel 0 operates), in
single-phase two-wire mode.
In neutral missing mode, there are cases when only current channel 0 operates and only current channel 2 operates.
Use the same procedure when switching the mode.
Figure 16-14. Procedure for Switching from Normal Operation Mode to Neutral Missing Mode
Figure 16-15. Timing of Generation of INTDSAD Signal and Storing in DSADCRn Register
Remark n = 0 to 3
Remark n = 0 to 3
(1) Read the DSADCRn register by ∆Σ A/D conversion end interrupt (INTDSAD) servicing. If the DSADCRn register is
read before a ∆Σ A/D conversion end interrupt is generated, an illegal value may be read because of a conflict
between storing the conversion value in the DSADCRn register and reading the register. The period of the
INTDSAD processing during which the DSADCRn register is read is 192 μs (when DSADFR is set to 0) or 384 μs
(when DSADFR is set to 1), so complete reading of the register within this time.
(2) After powering on the ∆Σ A/D converter (DSADPONn in the DSADMR register = 1), internal setup time is
necessary. Consequently, the data of the first 80 conversions is invalid.
(3) Setup time is also necessary when the ∆Σ A/D converter has been temporarily stopped for initialization (by clearing
the DSADCEn bit in the DSADMR register to 0 with DSADPONn = 1) and then restarted. In this case, since
stabilization time is necessary for the converter, wait for one INTDSAD to be generated as the setup time. To
initialize the ∆Σ A/D converter, make sure that DSADCEn remains 0 for at least 1.4 μs.
(4) The time required for the correct data to be output after the conversion operation has been enabled (by setting the
DSADCEn bit to 1) differs depending on the analog input status at that time. This is because the stabilization time
of the high-pass filter changes depending on the analog input status.
(5) Set the conversion rate while the DSADPONn bit in the DSADMR register is 0. Be sure to set the gain and the
DSADPHCR0 and DSADPHCR1 registers while the ∆Σ A/D converter is stopped (DSADCEn = 0).
(6) Since the DSADCRn register is initialized when the DSADCEn bit is 0, read the DSADCRn register when the
DSADCEn bit is 1.
(7) Clear the DSADPONn bit in the DSADMR register to 0 before shifting to software STOP mode. If software STOP
mode is entered with the DSADPONn bit set to 1, a current will flow.
Remark n = 0 to 3
Cautions 1. Count the INTDSAD signal 80 times after the ∆Σ A/D converter is started and then load the
converted data when the next INTDSAD signal is generated. The setup time is subject to change.
Consult Renesas Electronics before using the setup time.
2. Thoroughly evaluate the stabilization time in the environment in which the ∆Σ A/D converter is
used.
To stop the 24-bit ∆Σ A/D converter while it is operating, set the DSADPON3 to DSADPON0 bits in the DSADMR
register to 0000B, and then set the DSADCEN bit in the PER1 register to 0.
CHAPTER 17 COMPARATOR
The comparator compares a reference input voltage to an analog input voltage. It consists of two independent
comparators: comparator 0 and comparator 1.
Comparator high-speed mode, comparator low-speed mode, or comparator window mode can be selected.
The external reference voltage input or internal reference voltage can be selected as the reference voltage.
The canceling width of the noise canceling digital filter can be selected.
An interrupt signal can be generated by detecting an active edge of the comparator output.
C0MON C0VRF C0WDE C0ENB Comparator mode setting C0EDG C0EPO C0FCK1 C0FCK0 Comparator filter control register
register (COMPMDR) (COMPFIR)
2
Comparator 0
Selector
fCLK
Sampling
fCLK/8
clock
fCLK/32
Digital filter
(match 3
times) Both-edge
Selector
detection
Selector
Selector
One-edge
IVCMP0 + detection
-
Selector
IVREF0
Selector
INTCMP0
(Comparator detection 0 interrupt)
Selector
I/O control
+
VCOUT0
-
IVCMP1
Comparator 1 INTCMP1
IVREF1 (Comparator detection 1 interrupt)
I/O control
VCOUT1
VTW+
Note
Note When either or both of the C0WDE and C1WDE bits are set to 1, this switch is turned on and the divider
resistors for generating the comparison voltage are enabled.
Remark n = 0, 1
Cautions 1. When setting the comparator, be sure to set the CMPEN bit to 1 first. If CMPEN = 0, writing to a
control register of the comparator is ignored, and all read values are default values (except for
A/D port configuration register (ADPC), port mode registers 0, 2 (PM0, PM2), port registers 0, 2
(P0, P2)).
Comparator mode setting register (COMPMDR)
Comparator filter control register (COMPFIR)
Comparator output control register (COMPOCR)
2. Be sure to clear the bits 2 and 1 to “0”.
Notes 3, 7
C1MON Comparator 1 monitor flag
0 In standard mode:
IVCMP1 < comparator 1 reference voltage or comparator 1 stopped
In window mode:
IVCMP1 < low-voltage reference or IVCMP1 > high-voltage reference
1 In standard mode:
IVCMP1 > comparator 1 reference voltage
In window mode:
Low-voltage reference < IVCMP1 < high-voltage reference
Notes 1, 4, 5, 6
C1VRF Comparator 1 reference voltage selection
Note 2
C1WDE Comparator 1 window mode selection
Notes 3, 7
C0MON Comparator 0 monitor flag
0 In standard mode:
IVCMP0 < comparator 0 reference voltage or comparator 0 stopped
In window mode:
IVCMP0 < low-voltage reference or IVCMP0 > high-voltage reference
1 In standard mode:
IVCMP0 > comparator 0 reference voltage
In window mode:
Low-voltage reference < IVCMP0 < high-voltage reference
Notes 1, 4, 5, 6
C0VRF Comparator 0 reference voltage selection
Note 2
C0WDE Comparator 0 window mode selection
Notes 1. Valid only when standard mode is selected. In window mode, the reference voltage in the comparator is
selected regardless of the setting of this bit.
2. Window mode cannot be set when low-speed mode is selected (the SPDMD bit in the COMPOCR register is
0).
3. The initial value is 0 immediately after a reset is released. However, the value is undefined when C0ENB is
set to 0 and C1ENB is set to 0 after operation of the comparator is enabled once.
4. The internal reference voltage (1.45 V) can be selected in HS (high-speed main) mode.
5. Do not select the internal reference voltage in STOP mode.
6. Do not select the internal reference voltage when the subsystem clock (fXT) is selected as the CPU clock and
both the high-speed system clock (fMX) and high-speed on-chip oscillator clock (fIH) are stopped.
7. Writing to this bit is ignored.
Note 1
C1EDG Comparator 1 edge detection selection
0 Interrupt request by comparator 1 one-edge detection
1 Interrupt request by comparator 1 both-edge detection
Note 1
C1EPO Comparator 1 edge polarity switching
0 Interrupt request at comparator 1 rising edge
1 Interrupt request at comparator 1 falling edge
Note 1
C1FCK1 C1FCK0 Comparator 1 filter selection
0 0 No comparator 1 filter
0 1 Comparator 1 filter enabled, sampling at fCLK
1 0 Comparator 1 filter enabled, sampling at fCLK/8
1 1 Comparator 1 filter enabled, sampling at fCLK/32
Note 2
C0EDG Comparator 0 edge detection selection
0 Interrupt request by comparator 0 one-edge detection
1 Interrupt request by comparator 0 both-edge detection
Note 2
C0EPO Comparator 0 edge polarity switching
0 Interrupt request at comparator 0 rising edge
1 Interrupt request at comparator 0 falling edge
Note 2
C0FCK1 C0FCK0 Comparator 0 filter selection
0 0 No comparator 0 filter
0 1 Comparator 0 filter enabled, sampling at fCLK
1 0 Comparator 0 filter enabled, sampling at fCLK/8
1 1 Comparator 0 filter enabled, sampling at fCLK/32
Notes 1. If bits C1FCK1, C1FCK0, C1EPO, and C1EDG are changed, a comparator 1 interrupt request may be
generated. Also, be sure to clear (0) bit 7 (CMPIF1) in interrupt request flag register 2L (IF2L). If bits
C1FCK1 and C1FCK0 are changed from 00B (no comparator 1 filter) to a value other than 00B (comparator
1 filter enabled), allow four sampling times to elapse until the filter output is updated, and then use the
comparator 1 interrupt request.
2. If bits C0FCK1, C0FCK0, C0EPO, and C0EDG are changed, a comparator 0 interrupt request may be
generated. Also, be sure to clear (0) bit 6 (CMPIF0) in request flag register 2L (IF2L). If bits C0FCK1 and
C0FCK0 are changed from 00B (no comparator 0 filter) to a value other than 00B (comparator 0 filter
enabled), allow four sampling times to elapse until the filter output is updated, and then use the comparator 0
interrupt request.
Note 1
SPDMD Comparator speed selection
Note 2
C1IE Comparator 1 interrupt request enable
Note 3
C0IE Comparator 0 interrupt request enable
Notes 1. When rewriting the SPDMD bit, be sure to set the CiENB bit (i = 0 or 1) in the COMPMDR register to 0 in
advance.
2. If C1IE is changed from 0 (interrupt request disabled) to 1 (interrupt request enabled), bit 7 (CMPIF1) in
interrupt request flag register 2L (IF2L) may be set to 1 (interrupt requested), so be sure to clear (0) bit 7
(CMPIF1) in interrupt request flag register 2L (IF2L) before using an interrupt.
3. If C0IE is changed from 0 (interrupt request disabled) to 1 (interrupt request enabled), bit 6 (CMPIF0) in
interrupt request flag register 2L (IF2L) may be set to 1 (interrupt requested), so be sure to clear (0) bit 6
(CMPIF0) in interrupt request flag register 2L (IF2L) before using an interrupt.
17.4 Operation
Comparator 0 and comparator 1 operate independently. Their setting methods and operations are the same. Table
17-2 lists the Procedure for Setting Comparator Associated Registers.
Remark i = 0, 1, n = 2, 3
Figures 17-6 and 17-7 show comparator i (i = 0 or 1) operation examples. In standard mode, the CiMON bit in the
COMPMDR register is set to 1 when the analog input voltage is higher than the reference input voltage, and the CiMON
bit is set to 0 when the analog input voltage is lower than the reference input voltage.
In window mode, the CiMON bit in the COMPMDR register is set to 1 when the analog input voltage meets the
following condition, and the CiMON bit is set to 0 when the analog input voltage does not meet the following condition:
“Low-voltage reference voltage < analog input voltage < high-voltage reference voltage”
When using the comparator i interrupt, set CiIE in the COMPOCR register to 1 (interrupt request output enabled). If the
comparison result changes at this time, a comparator i interrupt request is generated. For details on interrupt requests,
see 17.4.2 Comparator i (i = 0 or 1) Interrupts.
Caution The above diagram applies when CiFCK1 to CiFCK0 in the COMPFIR register = 00B (no filter) and
CiEDG = 1 (both edges). When CiEDG = 0 and CiEPO = 0 (rising edge), CMPIFi changes as shown by
(A) only. When CiEDG = 0 and CiEPO = 1 (falling edge), CMPIFi changes as shown by (B) only.
Caution The above diagram applies when CiFCK1 to CiFCK0 in the COMPFIR register = 00B (no filter) and
CiEDG = 1 (both edges). When CiEDG = 0 and CiEPO = 0 (rising edge), CMPIFi changes as shown by
(A) only. When CiEDG = 0 and CiEPO = 1 (falling edge), CMPIFi changes as shown by (B) only.
Caution The above operation example applies when bits CiFCK1 and CiFCK0 in the COMPFIR register is 01B,
10B, or 11B (digital filter enabled).
<1> Set the mode for the comparator (Steps 1 to 4 as listed in Table 17-2 Procedure for Setting Comparator
Associated Registers).
<2> Set the VCOUTi output for the comparator (set the COMPOCR register to select the polarity and enable the
output).
<3> Set the corresponding port register bit for the VCOUTi output pin to 0.
<4> Set the corresponding port direction register for the VCOUTi output pin to output (start outputting from the pin).
<1> Set the CiENB bit in the COMPMDR register to 0 (stop the comparator).
<2> Set the CMPIFi bit in registers IF2L to 0 (clear any unnecessary interrupt before stopping the comparator).
<3> Set the CMPEN bit in the PER1 register to 0.
When the clock is stopped by setting PER1, all the internal registers in the comparator are initialized. To use the
comparator again, follow the procedure in Table 17-2 to set the registers.
Caution When DTC activation is enabled under either of the following conditions, a DTC transfer is started
and an interrupt is generated after completion of the transfer. Therefore, enable DTC activation after
confirming the comparator monitor flag (CnMON) as necessary. (n = 0, 1)
- The comparator is set to an interrupt request on one-edge detection (CnEDG = 0), an interrupt
request at the rising edge for the comparator, and IVCMP > IVREF (or internal reference voltage:
1.45 V)
- The comparator is set to an interrupt request on one-edge detection (CnEDG = 0), an interrupt
request at the falling edge for the comparator, and IVCMP < IVREF (or internal reference voltage:
1.45 V)
Serial array unit has up to four serial channels. Each channel can achieve 3-wire serial (CSI), UART, and simplified I2C
communication.
Function assignment of each channel supported by the RL78/I1B is as shown below.
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 IIC00 cannot be used, but UART1 or IIC10 can be
used.
Each serial interface supported by the RL78/I1B has the following features.
[Data transmission/reception]
Data length of 7 or 8 bits
Phase control of transmit/receive data
MSB/LSB first selectable
[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 rateNote
During master communication: Max. fMCK/2
During slave communication: Max. fMCK/6
[Interrupt function]
Transfer end interrupt/buffer empty interrupt
[Error detection flag]
Overrun error
In addition, CSI00 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.
Note Use the clocks within a range satisfying the SCK cycle time (tKCY) characteristics. For details, see CHAPTER
37 ELECTRICAL SPECIFICATIONS.
[Data transmission/reception]
Data length of 7, 8, or 9 bitsNote
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, UART0 reception 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.
Note Only UART0 can be specified for the 9-bit data length.
[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]
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 18.8.3 (2) for details.
Remarks 1. To use an I2C bus of full function, see CHAPTER 19 SERIAL INTERFACE IICA.
18.1.4 IrDA
By combining UART2 of the serial array unit and the IrDA module, IrDA communication waveforms can be transmitted
or received based on IrDA (Infrared Data Association) standard 1.0. For details, see CHAPTER 20 IrDA.
[Data transmission/reception]
Transfer rate: 115.2 kbps/57.6 kbps/38.4 kbps/19.2 kbps/9600 bps/2400 bps
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)
2
Serial clock I/O SCK00 pin (for 3-wire serial I/O), SCL00, SCL10 pins (for simplified I C)
Serial data input SI00 pin (for 3-wire serial I/O), RxD1 to RxD2 pins (for UART), RXD0 pin (for UART supporting
LIN-bus)
Serial data output SO00 pin (for 3-wire serial I/O), TxD1 to TxD2 pins (for UART), TXD0 pin (for UART supporting
LIN-bus)
2
Serial data I/O SDA00, SDA10 pins (for simplified I C)
Control registers <Registers of unit setting block>
Peripheral enable register 0 (PER0)
Serial clock select register m (SPSm)
Serial channel enable status register m (SEm)
Serial channel start register m (SSm)
Serial channel stop register m (STm)
Serial output enable register m (SOEm)
Serial output register m (SOm)
Serial output level register m (SOLm)
Serial standby control register 0 (SSC0)
Input switch control register (ISC)
Noise filter enable register 0 (NFEN0)
<Registers of each channel>
Serial data register mn (SDRmn)
Serial mode register mn (SMRmn)
Serial communication operation setting register mn (SCRmn)
Serial status register mn (SSRmn)
Serial flag clear trigger register mn (SIRmn)
Port input mode registers 0, 1, 8 (PIM0, PIM1, PIM8)
Port output mode registers 0, 1, 8 (POM0, POM1, POM8)
Port mode registers 0, 1, 8 (PM0, PM1, PM8)
Port registers 0, 1, 8 (P0, P1, P8)
Notes 1. The number of bits used as the shift register and buffer register differs depending on the unit and channel.
mn = 00, 01: 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),
q: UART number (q = 0 to 2), r: IIC number (r = 00, 10), mn = 00 to 03, 10, 11
Figure 18-1 shows the block diagram of the serial array unit 0.
Selector Selector
SNFEN00 CKS00 CCS00 STS00 SIS00 MD002 MD001 MD000 Error controller
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
Channel 1
(LIN-bus supported) Communication controller
Serial transfer end interrupt
Mode selection (when UART0: INTSR0)
UART0
Edge/level (for reception)
detection Error controller Serial transfer error interrupt
(INTSRE0)
CK01 CK00
SNFEN10
CK01 CK00
When UART1
Channel 3
Communication controller
Serial transfer end interrupt
Mode selection (when UART1: INTSR1)
UART1
Edge/level (for reception)
Error controller Serial transfer error interrupt
detection
(INTSRE1)
Figure 18-2 shows the block diagram of the serial array unit 1.
0 0 0 0 0 0 0 0 1 SO10 SNFEN
1 1 1 1 1 1
20
Peripheral enable
Serial clock select register 1 (SPS1) Serial channel
register 0 (PER0) enable status
SE11 SE10
PRS PRS PRS PRS PRS PRS PRS register 1 (SE1)
SAU1EN PRS
113 112 111 110 103 102 101 100 Serial channel
SS11 SS10 start register 1
(SS1)
4 4 Serial channel
ST11 ST10 stop register 1
(ST1)
Serial output
0 SOE10 enable register 1
fCLK Prescaler
(SOE1)
fCLK/20 to fCLK/215 fCLK/20 to Serial output
0 SOL10 level register 1
fCLK/215
(SOL1)
Selector Selector
IrDA
Selector
fTCLK
Shift register
Output
controller
Synchro- Edge/level
nous elimination
(when UART2: RxD2) enabled/ detection
Communication
status
circuit
disabled
(when IrDA: IrRxD)
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
8 7 6 5 4 3 2 1 0
Shift register
Notes 1. Only UART0 can be specified for the 9-bit data length.
2. Rewriting SDRmn[7:0] by 8-bit memory manipulation instruction is prohibited when the operation is stopped
(SEmn = 0) (all of SDRmn[15:9] are cleared (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),
q: UART number (q = 0 to 2), r: IIC number (r = 00, 10), mn = 00 to 03, 10, 11
Figure 18-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
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 18.3 Registers Controlling Serial
Array Unit.
Figure 18-4. Format of Serial Data Register mn (SDRmn) (mn = 02, 03)
Address: FFF44H, FFF45H (SDR02), FFF46H, FFF47H (SDR03) After reset: 0000H R/W
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 18.3 Registers Controlling Serial
Array Unit.
Cautions 1. When setting serial array unit m, be sure to first set the following registers with the SAUmEN
bit set to 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 (except for the input switch control
register (ISC), noise filter enable register 0 (NFEN0), port input mode registers 0, 1, 8 (PIM0,
PIM1, PIM8), port output mode registers 0, 1, 8 (POM0, POM1, POM8), port mode registers 0, 1,
8 (PM0, PM1, PM8), and port registers 0, 1, 8 (P0, P1, P8)).
Serial clock select register m (SPSm)
Serial mode register mn (SMRmn)
Serial communication operation setting register mn (SCRmn)
Serial data register mn (SDRmn)
Serial flag clear trigger register mn (SIRmn)
Serial status register mn (SSRmn)
Serial channel start register m (SSm)
Serial channel stop register m (STm)
Serial channel enable status register m (SEm)
Serial output enable register m (SOEm)
Serial output level register m (SOLm)
Serial output register m (SOm)
Serial standby control register m (SSCm)
2. Be sure to clear bit 1 to “0”.
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
PRS PRS PRS PRS Section of operation clock (CKmk)
mk3 mk2 mk1 mk0 fCLK = 4 MHz fCLK = 8 MHz fCLK = 12 MHz fCLK = 20 MHz fCLK = 24 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), F0152H, F0153H (SMR11)
Symbol 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
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, or SMR10
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),
q: UART number (q = 0 to 2), r: IIC number (r = 00, 10), mn = 00 to 03, 10, 11
Address: F0110H, F0111H (SMR00) to F0116H, F0117H (SMR03), After reset: 0020H R/W
F0150H, F0151H (SMR10), F0152H, F0153H (SMR11)
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, or SMR10
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),
q: UART number (q = 0 to 2), r: IIC number (r = 00, 10), mn = 00 to 03, 10, 11
Figure 18-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), F015AH, F015BH (SCR11)
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.
Caution Be sure to clear bits 3, 6, and 11 to “0” (Also clear bit 5 of the SCR01, SCR03, or SCR11 register
to 0). 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), mn = 00 to 03, 10,
11
Figure 18-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), F015AH, F015BH (SCR11)
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 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.
Set 1 bit (SLCmn1, SLCmn0 = 0, 1) or 2 bits (SLCmn1, SLCmn0 = 1, 0) during UART transmission.
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.
Caution Be sure to clear bits 3, 6, and 11 to “0” (Also clear bit 5 of the SCR01, SCR03, or SCR11 register
to 0). 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), mn = 00 to 03, 10, 11
Address: FFF10H, FFF11H (SDR00), FFF12H, FFF13H (SDR01) After reset: 0000H R/W
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
FFF48H, FFF49H (SDR10), FFF4AH, FFF4BH (SDR11)
FFF45H (SDR02) FFF44H (SDR02)
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, SDR10 and SDR11 registers 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. Rewriting SDRmn[7:0] by 8-bit memory manipulation instruction is prohibited when the
operation is stopped (SEmn = 0) (all of SDRmn[15:9] are cleared (0)).
Remarks 1. For the function of the lower 8/9 bits of the SDRmn register, see 18.2 Configuration of Serial Array Unit.
2. m: Unit number (m = 0, 1), n: Channel number (n = 0 to 3), mn = 00 to 03, 10, 11
Address: F0108H, F0109H (SIR00) to F010EH, F010FH (SIR03), After reset: 0000H R/W
F0148H, F0149H (SIR10), F014AH, F014BH (SIR11)
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, or SIR10 register) to “0”.
Address: F0100H, F0101H (SSR00) to F0106H, F0107H (SSR03), After reset: 0000H R
F0140H, F0141H (SSR10), F0142H, F0143H (SSR11)
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 When the CSI is performing reception operations in the SNOOZE mode (SWCm = 1), the BFFmn
flag will not change.
Address: F0100H, F0101H (SSR00) to F0106H, F0107H (SSR03), After reset: 0000H R
F0140H, F0141H (SSR10), F0142H, F0143H (SSR11)
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 Parity 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.
Cautions 1. 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.
2. When the CSI is performing reception operations in the SNOOZE mode (SWCm = 1), the
OVFmn flag will not change.
0 No trigger operation
Note
1 Sets the SEmn bit to 1 and enters the communication wait status .
Note If set the SSmn = 1 to during a communication operation, will wait status to stop the communication.
At this time, holding status value of control register and shift register, SCKmn and SOmn pins, and FEFmn,
PEFmn, OVFmn flags.
Cautions 1. Be sure to clear bits 15 to 4 of the SS0 register, bits 15 to 2 of the SS1 register to “0”.
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 fMCK clocks have elapsed.
0 No trigger operation
Note
1 Clears the SEmn bit to 0 and stops the communication operation .
Note Holding status value of the control register and shift register, the SCKmn and SOmn pins, and FEFmn,
PEFmn, OVFmn flags.
Caution Be sure to clear bits 15 to 4 of the ST0 register, bits 15 to 2 of the ST1 register to “0”.
0 Operation stops
1 Operation is enabled.
Caution Be sure to clear bits 15 to 3 and 1 of the SOE0 register, bits 15 to 3 and 1 of the SOE1 register to
“0”.
SO1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 SO
10
Caution Be sure to clear bits 15 to 12 and 7 to 4 of the SO0 register to “0”. And be sure to set bits 11, 9, 3,
and 1 to “1”.
Be sure to clear bits 15 to 12 and 7 to 4 of the SO1 register to “0”. And be sure to set bits 11 to 8,
3, and 1 to “1”.
SOL1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 SOL
10
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, bits 15 to 1 of the SOL1 register to “0”.
Figure 18-18 shows examples in which the level of transmit data is reversed during UART transmission.
SOLmn = 0 output
TXDq
Transmit data
SOLmn = 1 output
TXDq
Transmit data (inverted)
SSC0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 SS SWC
EC0 0
SS Selection of whether to enable or disable the generation of communication error interrupts in the SNOOZE
EC0 mode
EOCmn Bit SSECm Bit Reception Ended Successfully Reception Ended in an Error
0 Uses the input signal of the TI07 pin as a timer input (normal operation).
1 Input signal of the RXD0 pin is used as timer input (detects the wakeup signal and measures the low
width of the break field and the pulse width of the sync field).
0 Uses the input signal of the INTP0 pin as an external interrupt (normal operation).
1 Uses the input signal of the RXD0 pin as an external interrupt (wakeup signal detection).
When using a port pin with a multiplexed serial data or serial clock output function (e.g.
P07/SO00/TxD0/TI02/TO02/INTP2/TOOLTxD, P15/SEG9/(SCK00)/(SCL00)) for serial data or serial clock output, requires
setting the corresponding bits in the port mode register (PMxx) to 0, and the corresponding bit in the port register (Pxx) to
1.
When using the port pin in N-ch open-drain output (VDD tolerance) mode, set the corresponding bit in the port output
mode register (POMxx) to 1. When connecting an external device operating on a different potential (1.8 V, 2.5 V or 3 V),
see 4.4.4 Connecting to external device with different potential (1.8 V, 2.5 V, 3 V).
When using a port pin with a multiplexed serial data or serial clock input function (e.g.
P05/SCK00/SCL00/TI04/TO04/INTP3, P06/SI00/RxD0/TI03/TO03/SDA00/TOOLRxD) for serial data or serial clock input,
requires setting the corresponding bit in the port mode register (PMxx) to 1. In this case, the corresponding bit in the port
register (Pxx) can be set to 0 or 1.
When the TTL input buffer is selected, set the corresponding bit in the port input mode register (PIMxx) to 1. When
connecting an external device operating on a different potential (1.8 V, 2.5 V or 3 V), see 4.4.4 Connecting to external
device with different potential (1.8 V, 2.5 V, 3 V).
The PM0, PM1 and PM8 registers can be set by a 1-bit or 8-bit memory manipulation instruction.
Reset signal generation sets the PM0, PM1 and PM8 registers to FFH.
See Tables 4-3 to see which PMxx registers are provided for each product.
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 18-23. 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)
Port input mode registers 0, 1, 8 (PIM0, PIM1, PIM8)
Port output mode registers 0, 1, 8 (POM0, POM1, POM8)
Port mode registers 0, 1, 8 (PM0, PM1, PM8)
Port registers 0, 1, 8 (P0, P1, P8)
2. Be sure to clear bit 1 to 0.
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 18-24. 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
STm3 STm2
STm Note Note STm1 STm0
0 0 0 0 0 0 0 0 0 0 0 0 0/1 0/1 0/1 0/1
* 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
SEm3 SEm2
SEm Note 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
SOEm2
SOEm Note SOEm0
0 0 0 0 0 0 0 0 0 0 0 0 0 0/1 0 0/1
(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
CKOm0 SOm2
SOm Note Note SOm0
0 0 0 0 1 1 1 0/1 0 0 0 0 1 0/1 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”.
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
[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 rateNote
During master communication: Max. fMCK/2
During slave communication: Max. fMCK/6
[Interrupt function]
Transfer end interrupt/buffer empty interrupt
[Error detection flag]
Overrun error
In addition, CSI00 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. CSI00 supports the asynchronous reception.
Note Use the clocks within a range satisfying the SCK cycle time (tKCY) characteristics. For details, see CHAPTER 37
ELECTRICAL SPECIFICATIONS.
The channels supporting 3-wire serial I/O (CSI00) are channels 0 of SAU0.
2
Unit Channel Used as CSI Used as UART Used as Simplified I C
1
2 UART1 IIC10
3
1 0 UART2
1
3-wire serial I/O (CSI00) performs the following seven types of communication operations.
Master transmission (See 18.5.1.)
Master reception (See 18.5.2.)
Master transmission/reception (See 18.5.3.)
Slave transmission (See 18.5.4.)
Slave reception (See 18.5.5.)
Slave transmission/reception (See 18.5.6.)
SNOOZE mode function (See 18.5.7.)
Interrupt INTCSI00
Transfer end interrupt (in single-transfer mode) or buffer empty interrupt (in continuous transfer mode)
can be selected.
Note Use this operation within a range that satisfies the conditions above and the peripheral functions characteristics in
the electrical specifications (see CHAPTER 37 ELECTRICAL SPECIFICATIONS).
Figure 18-25. Example of Contents of Registers for Master Transmission of 3-Wire Serial I/O (CSI00) (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
Note Only provided for the SCR00 register. This bit is fixed to 1 for the other registers.
Remarks 1. m: Unit number (m = 0), n: Channel number (n = 0, 2), p: CSI number (p = 00, 10), mn = 00
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 18-25. Example of Contents of Registers for Master Transmission of 3-Wire Serial I/O (CSI00) (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), n: Channel number (n = 0, 2), p: CSI number (p = 00), mn = 00
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.
(Essential) Writing the STm register Write “1” to the STmn bit of the target channel.
(SEmn = 0: to operation stop status)
(Essential) Changing setting of the SOEm register Set the SOEmn bit to “0” and stop the output
of the target channel.
(Selective) Setting the PER0 register Reset the serial array unit by stopping the
clock supply to it.
Setting is completed
Completing resumption
Sets transmit data to the SIOp register (bits
setting
7 to 0 of the SDRmn register) and start
communication.
Remark If PER0 is rewritten while stopping the master transmission and the clock supply is stopped, wait
until the transmission target (slave) stops or transmission finishes, and then perform initialization
instead of restarting the transmission.
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
Remark m: Unit number (m = 0), n: Channel number (n = 0), p: CSI number (p = 00), mn = 00
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 18-31. Timing Chart of Master Transmission (in Continuous Transmission Mode)
(Type 1: DAPmn = 0, CKPmn = 0)
SSmn <1>
STmn <6>
SEmn
SCKp pin
BFFmn
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), n: Channel number (n = 0), p: CSI number (p = 00), mn = 00
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
Yes
Communication
continued?
No
End of communication
Remark <1> to <6> in the figure correspond to <1> to <6> in Figure 18-31 Timing Chart of Master
Transmission (in Continuous Transmission Mode).
Interrupt INTCSI00
Transfer end interrupt (in single-transfer mode) or buffer empty interrupt (in continuous transfer mode)
can be selected.
Note Use this operation within a range that satisfies the conditions above and the peripheral functions characteristics in
the electrical specifications (see CHAPTER 37 ELECTRICAL SPECIFICATIONS).
Figure 18-33. Example of Contents of Registers for Master Reception of 3-Wire Serial I/O (CSI00) (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
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), n: Channel number (n = 0, 2), p: CSI number (p = 00), mn = 00
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 18-33. Example of Contents of Registers for Master Reception of 3-Wire Serial I/O (CSI00) (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), n: Channel number (n = 0), p: CSI number (p = 00), mn = 00
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
(Essential) Writing the STm register Write “1” to the STmn bit of the target channel.
(SEmn = 0: to operation stop status)
(Essential) Changing setting of the SOEm register Set the SOEmn bit to “0” and stop the output
of the target channel.
(Selective) Setting the PER0 register Reset the serial array unit by stopping the
clock supply to it.
Setting is completed
Completing resumption
Sets dummy data to the SIOp register (bits
setting
7 to 0 of the SDRmn register) and start
communication.
Remark If PER0 is rewritten while stopping the master transmission and the clock supply is stopped, wait
until the transmission target (slave) stops or transmission finishes, and then perform initialization
instead of restarting the transmission.
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
Remark m: Unit number (m = 0), n: Channel number (n = 0), p: CSI number (p = 00), mn = 00
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?
Main routine
Yes
Disable interrupt (MASK)
End of communication
Figure 18-39. Timing Chart of Master Reception (in Continuous Reception Mode) (Type 1: DAPmn = 0, CKPmn = 0)
SSmn <1>
STmn <8>
SEmn
Receive data 3
SDRmn Dummy data Dummy data Receive data 1 Dummy data Receive data 2
<2> Write <2> Write <2> 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
BFFmn
Remarks 1. <1> to <8> in the figure correspond to <1> to <8> in Figure 18-40 Flowchart of Master Reception
(in Continuous Reception Mode).
2. m: Unit number (m = 0), n: Channel number (n = 0), p: CSI number (p = 00), mn = 00
Clear interrupt request flag (XXIF), reset interrupt mask (XXMK) and set
Enables interrupt
interrupt enable (EI)
No
BFFmn = 1?
Interrupt processing routine
Yes
<4> Reading receive data from Read receive data, if any, then write them to storage
SIOp (=SDRmn[7:0]) area, and update receive data pointer (also subtract -1
<7> from number of transmit data)
=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
Main routine
Yes
Communication continued?
No
End of communication
Remark <1> to <8> in the figure correspond to <1> to <8> in Figure 18-39 Timing Chart of Master Reception
(in Continuous Reception Mode).
R01UH0407EJ0210 Rev.2.10 506
Apr 25, 2016
RL78/I1B CHAPTER 18 SERIAL ARRAY UNIT
Interrupt INTCSI00
Transfer end interrupt (in single-transfer mode) or buffer empty interrupt (in continuous transfer mode)
can be selected.
Note Use this operation within a range that satisfies the conditions above and the peripheral functions characteristics in
the electrical specifications (see CHAPTER 37 ELECTRICAL SPECIFICATIONS).
Figure 18-41. Example of Contents of Registers for Master Transmission/Reception of 3-Wire Serial I/O
(CSI00) (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), n: Channel number (n = 0), p: CSI number (p = 00), mn = 00
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 18-41. Example of Contents of Registers for Master Transmission/Reception of 3-Wire Serial I/O
(CSI00) (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), n: Channel number (n = 0), p: CSI number (p = 00), mn = 00
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
(Essential) Writing the STm register Write “1” to the STmn bit of the target channel.
(SEmn = 0: to operation stop status)
(Essential) Changing setting of the SOEm register Set the SOEmn bit to “0” and stop the output
of the target channel.
(Selective) Setting the PER0 register Reset the serial array unit by stopping the
clock supply to it.
Yes
Disable data output and clock output of
(Selective) the target channel by setting a port
Port manipulation
register and a port mode register.
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
Remark m: Unit number (m = 0), n: Channel number (n = 0), p: CSI number (p = 00), mn = 00
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 18-47. Timing Chart of Master Transmission/Reception (in Continuous Transmission/Reception Mode)
(Type 1: DAPmn = 0, CKPmn = 0)
SSmn <1>
STmn <8>
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
BFFmn
<2><3> <2> Note 2 <3> <4> <2> <3> <4> <6> <7>
Note 2
Note 1
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 18-48 Flowchart of Master
Transmission/Reception (in Continuous Transmission/Reception Mode).
2. m: Unit number (m = 0), n: Channel number (n = 0), p: CSI number (p = 00), mn = 00
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 from
<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 18-47 Timing Chart of Master
Transmission/Reception (in Continuous Transmission/Reception Mode).
Interrupt INTCSI00
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 pin 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 peripheral functions
characteristics in the electrical specifications (see CHAPTER 37 ELECTRICAL SPECIFICATIONS).
Figure 18-49. Example of Contents of Registers for Slave Transmission of 3-Wire Serial I/O
(CSI00) (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
Note Only provided for the SCR00 register. This bit is fixed to 1 for the other registers.
Remarks 1. m: Unit number (m = 0), n: Channel number (n = 0), p: CSI number (p = 00), mn = 00
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 18-49. Example of Contents of Registers for Slave Transmission of 3-Wire Serial I/O
(CSI00) (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), n: Channel number (n = 0), p: CSI number (p = 00), mn = 00
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
(Essential) Writing the STm register Write “1” to the STmn bit of the target channel.
(SEmn = 0: to operation stop status)
(Essential) Changing setting of the SOEm register Set the SOEmn bit to “0” and stop the output
of the target channel.
(Selective) Setting the PER0 register Reset the serial array unit by stopping the
clock supply to it.
(Selective) Changing setting of the SDRmn register baud rate setting (setting the transfer clock
by dividing the operation clock (fMCK)).
Remark If PER0 is rewritten while stopping the master transmission and the clock supply is stopped, wait
until the transmission target (master) stops or transmission finishes, and then perform
initialization instead of restarting the transmission.
SSmn
STmn
SEmn
Remark m: Unit number (m = 0), n: Channel number (n = 0), p: CSI number (p = 00), mn = 00
Set storage area and the number of data for transmit data
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)
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
Transmitting next data? Determine if it completes by counting number of communication data
No
Yes
Continuing transmit?
Main routine
No
End of communication
Figure 18-55. Timing Chart of Slave Transmission (in Continuous Transmission Mode)
(Type 1: DAPmn = 0, CKPmn = 0)
SSmn <1>
STmn <6>
SEmn
BFFmn
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), n: Channel number (n = 0), p: CSI number (p = 00), mn = 00
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
No If transmit data is left, read them from storage area then write into
Number of transmit
data > 1? SIOp, and update transmit data pointer.
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
End of communication
Remark <1> to <6> in the figure correspond to <1> to <6> in Figure 18-55 Timing Chart of Slave
Transmission (in Continuous Transmission Mode).
Interrupt INTCSI00
Transfer end interrupt only (Setting the buffer empty interrupt is prohibited.)
Notes 1. Because the external serial clock input to the SCK00 pin 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 peripheral functions
characteristics in the electrical specifications (see CHAPTER 37 ELECTRICAL SPECIFICATIONS).
Figure 18-57. Example of Contents of Registers for Slave Reception of 3-Wire Serial I/O (CSI00) (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 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), n: Channel number (n = 0), p: CSI number (p = 00), mn = 00
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 18-57. Example of Contents of Registers for Slave Reception of 3-Wire Serial I/O (CSI00) (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), n: Channel number (n = 0), p: CSI number (p = 00), mn = 00
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
(Essential) Writing the STm register Write “1” to the STmn bit of the target channel.
(SEmn = 0: to operation stop status)
(Essential) Changing setting of the SOEm register Set the SOEmn bit to 0 and stop the output of
the target channel.
(Selective) Setting the PER0 register Reset the serial array unit by stopping the
clock supply to it.
Remark If PER0 is rewritten while stopping the master transmission and the clock supply is stopped, wait
until the transmission target (master) stops or transmission finishes, and then perform initialization
instead of restarting the transmission.
SSmn
STmn
SEmn
Receive data 3
SDRmn Receive data 1 Receive data 2
Remark m: Unit number (m = 0), n: Channel number (n = 0), p: CSI number (p = 00), mn = 00
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
Interrupt INTCSI00
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 pin 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 peripheral functions
characteristics in the electrical specifications (see CHAPTER 37 ELECTRICAL SPECIFICATIONS).
Figure 18-63. Example of Contents of Registers for Slave Transmission/Reception of 3-Wire Serial I/O
(CSI00) (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), n: Channel number (n = 0), p: CSI number (p = 00), mn = 00
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 18-63. Example of Contents of Registers for Slave Transmission/Reception of 3-Wire Serial I/O
(CSI00) (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), n: Channel number (n = 0), p: CSI number (p = 00), mn = 00
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.
(Essential) Writing the STm register Write “1” to the STmn bit of the target channel.
(SEmn = 0: to operation stop status)
(Essential) Changing setting of the SOEm register Set the SOEmn bit to 0 and stop the output of
the target channel.
(Selective) Setting the PER0 register Reset the serial array unit by stopping the
clock supply to it.
Cautions 1. Be sure to set transmit data to the SlOp register before the clock from the master is started.
2. If PER0 is rewritten while stopping the master transmission and the clock supply is stopped,
wait until the transmission target (master) stops or transmission finishes, and then perform
initialization instead of restarting the transmission.
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
Remark m: Unit number (m = 0), n: Channel number (n = 0), p: CSI number (p = 00), mn = 00
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
Main routine
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 18-69. Timing Chart of Slave Transmission/Reception (in Continuous Transmission/Reception Mode)
(Type 1: DAPmn = 0, CKPmn = 0)
SSmn <1>
STmn <8>
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
BFFmn
<2> <3> <2> <3> <4> <2> <3> <4> <6> <7>
Note 2 Note 2
Note 1
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 18-70 Flowchart of Slave
Transmission/Reception (in Continuous Transmission/Reception Mode).
2. m: Unit number (m = 0), n: Channel number (n = 0), p: CSI number (p = 00), mn = 00
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
Read receive data to SIOp Other than the first interrupt, read reception data then writes
<4> to storage area, update receive data pointer
(=SDRmn[7:0])
<7>
<5>
Writing transmit data to Clear MDmn0 bit to 0
SIOp (=SDRmn[7:0])
RETI
No Number of communication
data = 0?
Yes
Main routine
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 18-69 Timing Chart of Slave
Transmission/Reception (in Continuous Transmission/Reception Mode).
When using the CSI in SNOOZE mode, make the following setting before switching to the STOP mode (see Figure 18-
72 Flowchart of SNOOZE Mode Operation (Once Startup) and Figure 18-74 Flowchart of SNOOZE Mode
Operation (Continuous Startup)).
When using the SNOOZE mode function, set the SWCm bit of serial standby control register m (SSCm) to 1 just
<R> before switching to the STOP mode. After the initial setting has been completed, set the SSm0 bit of serial channel
start register m (SSm) to 1.
The CPU shifts to the SNOOZE mode on detecting the valid edge of the SCKp signal following a transition to the
STOP mode. A CSIp starts reception on detecting input of the serial clock on the SCKp pin.
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.
<R> Figure 18-71. Timing Chart of SNOOZE Mode Operation (Once Startup) (Type 1: DAPm0 = 0, CKPm0 = 0)
CPU operation status Normal operation STOP mode SNOOZE mode Normal operation
<4>
SSm0 <3> <11>
STm0 <1> <9>
SEm0
SWCm
<10>
SSECm L
<R> Note Only read received data while SWCm = 1 and before the next valid edge of the SCKp pin input is detected.
Cautions 1. Before switching to the SNOOZE mode or after reception operation in the SNOOZE mode
finishes, set the STm0 bit to 1 (clear the SEm0 bit, and stop the operation).
And after completion the receive operation, also clearing SWCm bit to 0 (SNOOZE mode
release).
2. When SWCm = 1, the BFFm1 and OVFm1 flags will not change.
Remarks 1. <1> to <11> in the figure correspond to <1> to <11> in Figure 18-72 Flowchart of SNOOZE Mode
Operation (Once Startup).
2. m = 0; p = 00
R01UH0407EJ0210 Rev.2.10 544
Apr 25, 2016
RL78/I1B CHAPTER 18 SERIAL ARRAY UNIT
No
TSFmn = 0 for all channels?
Yes
Normal operation
<3> Write 1 to SSm0 bit Become the communication wait status (SEm0 = 1)
Enables interrupt Clear interrupt request flag (XXIF), reset interrupt mask (XXMK)
processing and enable interrupt processing.
<4> Entered the STOP mode CPU/peripheral hardware clock fCLK supplied
to the SAU is stopped.
STOP mode
<5>
The valid edge of the SCKp pin detected
(Entered the SNOOZE mode)
SNOOZE mode
<9> Write 1 to STm0 bit Become the operation STOP status (SEm0 = 0)
<11> Write 1 to SSm0 bit 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 18-71 Timing Chart of SNOOZE
Mode Operation (Once Startup).
2. m = 0; p = 00
<R> Figure 18-73. Timing Chart of SNOOZE Mode Operation (Continuous Startup) (Type 1: DAPm0 = 0, CKPm0 = 0)
CPU operation status Normal operation STOP mode SNOOZE mode Normal operation STOP mode SNOOZE mode
<4> <4>
SSm0 <3> <3>
STm0 <1> <9>
SEm0
SWCm <10>
SSECm L
SCKp pin
SIp pin Receive data 1 Receive data 2
Shift
register m0 Reception & shift operation Reception & shift operation
INTCSIp
<R> Note Only read received data while SWCm = 1 and before the next valid edge of the SCKp pin input is detected.
Cautions 1. Before switching to the SNOOZE mode or after reception operation in the SNOOZE mode
finishes, set the STm0 bit to 1 (clear the SEm0 bit, and stop the operation).
And after completion the receive operation, also clearing SWCm bit to 0 (SNOOZE release).
2. When SWCm = 1, the BFFm1 and OVFm1 flags will not change.
Remarks 1. <1> to <10> in the figure correspond to <1> to <10> in Figure 18-74 Flowchart of SNOOZE Mode
Operation (Continuous Startup).
2. m = 0; p = 00
No
TSFmn = 0 for all channels?
Normal operation
Yes
Enables interrupt Clear interrupt request flag (XXIF), reset interrupt mask (XXMK)
processing and enable interrupt processing.
<8> Reading receive data from 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 18-73 Timing Chart of SNOOZE
Mode Operation (Continuous Startup).
2. m = 0; p = 00
(1) Master
(Transfer clock frequency) = {Operation clock (fMCK) frequency of target channel} ÷ (SDRmn[15:9] + 1) 2 [Hz]
(2) Slave
(Transfer clock frequency) = {Frequency of serial clock (SCK) supplied by master}Note [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 24 MHz
X X X X 0 0 0 1 fCLK/2 12 MHz
2
X X X X 0 0 1 0 fCLK/2 6 MHz
3
X X X X 0 0 1 1 fCLK/2 3 MHz
4
X X X X 0 1 0 0 fCLK/2 1.5 MHz
5
X X X X 0 1 0 1 fCLK/2 750 kHz
6
X X X X 0 1 1 0 fCLK/2 375 kHz
7
X X X X 0 1 1 1 fCLK/2 187.5 kHz
8
X X X X 1 0 0 0 fCLK/2 93.8 kHz
9
X X X X 1 0 0 1 fCLK/2 46.9 kHz
10
X X X X 1 0 1 0 fCLK/2 23.4 kHz
11
X X X X 1 0 1 1 fCLK/2 11.7 kHz
12
X X X X 1 1 0 0 fCLK/2 5.86 kHz
13
X X X X 1 1 0 1 fCLK/2 2.93 kHz
14
X X X X 1 1 1 0 fCLK/2 1.46 kHz
15
X X X X 1 1 1 1 fCLK/2 732 Hz
1 0 0 0 0 X X X X fCLK 24 MHz
0 0 0 1 X X X X fCLK/2 12 MHz
2
0 0 1 0 X X X X fCLK/2 6 MHz
3
0 0 1 1 X X X X fCLK/2 3 MHz
4
0 1 0 0 X X X X fCLK/2 1.5 MHz
5
0 1 0 1 X X X X fCLK/2 750 kHz
6
0 1 1 0 X X X X fCLK/2 375 kHz
7
0 1 1 1 X X X X fCLK/2 187.5 kHz
8
1 0 0 0 X X X X fCLK/2 93.8 kHz
9
1 0 0 1 X X X X fCLK/2 46.9 kHz
10
1 0 1 0 X X X X fCLK/2 23.4 kHz
11
1 0 1 1 X X X X fCLK/2 11.7 kHz
12
1 1 0 0 X X X X fCLK/2 5.86 kHz
13
1 1 0 1 X X X X fCLK/2 2.93 kHz
14
1 1 1 0 X X X X fCLK/2 1.46 kHz
15
1 1 1 1 X X X X fCLK/2 732 Hz
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).
18.5.9 Procedure for processing errors that occurred during 3-wire serial I/O (CSI00) communication
The procedure for processing errors that occurred during 3-wire serial I/O (CSI00) communication is described in
Figure 18-75.
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 asynchronous communication 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 UART0, timer array unit 0 (channel 7), and an external interrupt
(INTP0).
[Data transmission/reception]
Note
Data length of 7, 8, or 9 bits
Select the MSB/LSB first
Level setting of transmit/receive data (selecting whether to reverse the level)
Parity bit appending and parity check functions
Stop bit appending, stop bit check function
[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, UART0 reception supports the SNOOZE mode. When RxD pin input is detected while in the STOP mode,
the SNOOZE mode makes data reception that does not require the CPU possible. Only UART0 can be specified for the
reception baud rate adjustment function.
[LIN-bus functions]
Wakeup signal detection Using the external interrupt (INTP0) and
Break field (BF) detection timer array unit 0 (channel 7)
Sync field measurement, baud rate calculation
Note Only UART0 can be specified for the 9-bit data length.
2
Unit Channel Used as CSI Used as UART Used as Simplified I C
3
1 0 UART2 (supporting IrDA)
1
Select any function for each channel. Only the selected function is possible. If UART0 is selected for channels 0 and 1
of unit 0, for example, these channels cannot be used for CSI00. At this time, however, channel 2, 3, or other channels of
the same unit can be used for a function other than UART0, such as UART1 and IIC10.
Caution When using a serial array unit for UART, both the transmitter side (even-numbered channel) and the
receiver side (odd-numbered channel) can only be used for UART.
Transfer end interrupt (in single-transfer mode) or buffer empty interrupt (in continuous transfer mode)
can be selected.
Notes 1. Only UART0 can be specified for the 9-bit data length.
2. Use this operation within a range that satisfies the conditions above and the peripheral functions
characteristics in the electrical specifications (see CHAPTER 37 ELECTRICAL SPECIFICATIONS).
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
Notes 1. Only provided for the SCR00, SCR01, SCR10 and SCR11 registers. This bit is fixed to 1 for the other
registers.
2. When UART0 performs 9-bit communication, bits 0 to 8 of the SDRm0 register are used as the
transmission data specification area. Only UART0 can be specified for the 9-bit data length.
Remarks 1. m: Unit number (m = 0, 1), n: Channel number (n = 0, 2), q: UART number (q = 0 to 2),
mn = 00, 02, 10
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
CKOm0 SOm2 SOm0
SOm Note 2
0 0 0 0 1 1 1 0 0 0 0 1 0/1 1 0/1
Notes 1, 2 Note 1
0: Serial data output value is “0”
1: Serial data output value is “1”
(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
Notes 1. 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.
2. Serial array unit 0 only.
Setting the SOm register Set the initial output level of the serial
data (SOmn).
(Essential) Writing the STm register Write “1” to the STmn bit of the target channel.
(SEmn = 0: to operation stop status)
(Essential) Changing setting of the SOEm register Set the SOEmn bit to 0 and stop the output of
the target channel.
(Selective) Setting the PER0 register Reset the serial array unit by stopping the
clock supply to it.
Setting is completed.
Set transmit data to the SDRmn[7:0] bits
Completing resumption setting
(TXDq register) (8 bits) or the SDRmn[8:0] bits
(9 bits) and start communication.
Remark If PER0 is rewritten while stopping the master transmission and the clock supply is stopped, wait until the
transmission target stops or transmission finishes, and then perform initialization instead of restarting the
transmission.
SSmn
STmn
SEmn
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
SDRmn[7:0] bits (TXDq to TXDq. Update transmit data pointer.
register) (8 bits) or the Communication starts by writing
SDRmn[8:0] bits (9 bits)
to SDRmn[7:0]
Sets communication
Writing transmit data to completion flag
SDRmn[7:0] bits (TXDq
register) (8 bits) or the
SDRmn[8:0] bits (9 bits)
RETI
Main routine
Yes
End of communication
Figure 18-82. Timing Chart of UART Transmission (in Continuous Transmission Mode)
SSmn <1>
STmn <6>
SEmn
TSFmn
BFFmn
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.
Starting UART
communication
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).
Sets communication
Subtract -1 from number of
Clear MDmn0 bit to 0 completion interrupt flag
transmit data
RETI
Yes
Write MDmn0 bit to 1
Main routine
Yes
Communication
continued?
No
End of communication
Remark <1> to <6> in the figure correspond to <1> to <6> in Figure 18-82 Timing Chart of UART
Transmission (in Continuous Transmission Mode).
Transfer end interrupt only (Setting the buffer empty interrupt is prohibited.)
Notes 1. Only UART0 can be specified for the 9-bit data length.
2. Use this operation within a range that satisfies the conditions above and the peripheral functions
characteristics in the electrical specifications (see CHAPTER 37 ELECTRICAL SPECIFICATIONS).
RXDq
Notes 1. Only provided for the SCR00, SCR01, SCR10 and SCR11 registers. This bit is fixed to 1 for the other
registers.
2. When UART performs 9-bit communication, bits 0 to 8 of the SDRm1 register are used as the
transmission data specification area. Only UART0 can be specified for the 9-bit data length.
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.
(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
CKOm0 SOm2 SOm0
SOm Note Note
0 0 0 0 1 1 1 0 0 0 0 1 1
(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.
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). Become wait for start bit detection.
Completing initial setting
Caution Set the RXEmn bit of SCRmn register to 1, and then be sure to set SSmn to 1 after 4 or more fMCK
clocks have elapsed.
(Essential) Writing the STm register Write “1” to the STmn bit of the target channel.
(SEmn = 0: to operation stop status)
(Selective) Setting the PER0 register Reset the serial array unit by stopping the
clock supply to it.
Changing setting of the SMRmn Re-set the registers to change serial mode
(Selective) registers mn, mr (SMRmn, SMRmr)
and SMRmr registers
setting.
Caution After is set RXEmn bit to 1 of SCRmn register, set the SSmn = 1 from an interval of at least
four clocks of fMCK.
Remark If PER0 is rewritten while stopping the master transmission and the clock supply is stopped, wait
until the transmission target (slave) stops or transmission finishes, and then perform initialization
instead of restarting the transmission.
SSmn
STmn
SEmn
Receive data 3
SDRmn Receive data 1 Receive data 2
Reading receive data from Read receive data then writes to storage area.
the SDRmn[7:0] bits
Update receive data pointer and number of
(RXDq register) (8 bits) or
communication data.
the SDRmn[8:0] bits (9 bits)
No
Indicating normal reception?
Yes
RETI
Error processing
No
Reception completed? Check the number of communication data,
Yes determine the completion of reception
End of UART
When using UARTq in the SNOOZE mode, make the following settings before entering the STOP mode. (See Figure
18-92 and Figure 18-94 Flowchart of SNOOZE Mode Operation.)
• In the SNOOZE mode, the baud rate setting for UART reception needs to be changed to a value different from that in
normal operation. Set the SPSm register and bits 15 to 9 of the SDRmn register with reference to Table 18-3.
• Set the EOCmn and SSECmn bits. This is for enabling or stopping generation of an error interrupt (INTSRE0) when
a communication error occurs.
• When using the SNOOZE mode function, set the SWCm bit of serial standby control register m (SSCm) to 1 just
before switching to the STOP mode. After the initial setting has completed, set the SSm1 bit of serial channel start
register m (SSm) to 1.
<R> • A UARTq starts reception in SNOOZE mode on detecting input of the start bit on the RxDq pin following a transition
of the CPU 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 4800 bps.
3. When SWCm = 1, UARTq can be used only when the reception operation is started in the STOP
mode. When used simultaneously with another SNOOZE mode function or interrupt, if the
reception operation is started in a state other than the STOP mode, such as those given below,
data may not be received correctly and a framing error or parity error may be generated.
When after the SWCm bit has been set to 1, the reception operation is started before the
STOP mode is entered
When the reception operation is started while another function is in the SNOOZE mode
When after returning from the STOP mode to normal operation due to an interrupt or other
cause, the reception operation is started before the SWCm bit is returned to 0
4. If a parity error, framing error, or overrun error occurs while the SSECm bit is set to 1, the PEFmn,
FEFmn, or OVFmn flag is not set and an error interrupt (INTSREq) is not generated. Therefore,
when the setting of SSECm = 1 is made, clear the PEFmn, FEFmn, or OVFmn flag before setting
the SWC0 bit to 1 and read the value in bits 7 to 0 (RxDq register) of the SDRm1 register.
<R> 5. The CPU shifts from the STOP mode to the SNOOZE mode on detecting the valid edge of the RxDq
signal. Note, however, that transfer through the UART channel may not start and the CPU may
remain in the SNOOZE mode if an input pulse on the RxDq pin is too short to be detected as a
start bit. In such cases, data may not be received correctly, and this may lead to a framing error or
parity error in the next UART transfer.
Table 18-3. Baud Rate Setting for UART Reception in SNOOZE Mode
Note When the accuracy of the clock frequency of the high-speed on-chip oscillator is 1.5%, the permissible range
becomes smaller as shown below.
In the case of fIH 1.5%, perform (Maximum permissible value 0.5%) and (Minimum permissible value +
0.5%) to the values in the above table.
Remark The maximum permissible value and minimum permissible value are permissible values for the baud rate in
UART reception. The baud rate on the transmitting side should be set to fall inside this range.
<R> Figure 18-90. Timing Chart of SNOOZE Mode Operation (EOCm1 = 0, SSECm = 0/1)
CPU operation status Normal operation STOP mode SNOOZE mode Normal operation
<4>
SS01 <3> <12>
ST01 <1> <10>
SE01
SWC0
<11>
EOC01 L
SSEC0 L
Clock request signal
(internal signal)
Receive data 2
SDR01 Receive data 1
<9> Read Note
RxD0 pin ST Receive data 1 P SP ST Receive data 2 P SP
Shift
register 01 Shift operation Shift operation
INTSRq
Data reception <7> Data reception
INTSREq L
TSF01
Caution Before switching to the SNOOZE mode or after reception operation in the SNOOZE mode
finishes, set the STm1 bit to 1 (clear the SEm1 bit, and stop the operation).
And after completion the receive operation, also clearing SWCm bit to 0 (SNOOZE mode release).
Remarks 1. <1> to <12> in the figure correspond to <1> to <12> in Figure 18-92 Flowchart of SNOOZE Mode
Operation (EOCm1 = 0, SSECm = 0/1 or EOCm1 = 1, SSECm = 0).
2. m = 0; q = 0
(2) SNOOZE mode operation (EOCm1 = 1, SSECm = 0: Error interrupt (INTSREq) generation is enabled)
Because EOCm1 = 1 and SSECm = 0, an error interrupt (INTSREq) is generated when a communication error
occurs.
<R> Figure 18-91. Timing Chart of SNOOZE Mode Operation (EOCm1 = 1, SSECm = 0)
CPU operation status Normal operation STOP mode SNOOZE mode Normal operation
<4>
SS01 <3> <12>
ST01 <1> <10>
SE01
SWC0
<11>
EOC01
SSEC0 L
INTSRq
TSF01
Caution Before switching to the SNOOZE mode or after reception operation in the SNOOZE mode
finishes, set the STm1 bit to 1 (clear the SEm1 bit, and stop the operation).
And after completion the receive operation, also clearing SWCm bit to 0 (SNOOZE mode release).
Remarks 1. <1> to <12> in the figure correspond to <1> to <12> in Figure 18-92 Flowchart of SNOOZE Mode
Operation (EOCm1 = 0, SSECm = 0/1 or EOCm1 = 1, SSECm = 0).
2. m = 0; q = 0
<R> Figure 18-92. Flowchart of SNOOZE Mode Operation (EOCm1 = 0, SSECm = 0/1 or EOCm1 = 1, SSECm = 0)
Setting start
Ye s
<1> Writing 1 to the STmn bit The operation of all channels is also stopped to switch to the
→ SEmn = 0 STOP mode.
Normal operation
<7>
Transfer end interrupt (INTSRq) or
<8>
error interrupt (INTSREq) generated
INTSREq INTSRq
Writing 1 to the STm1 bit <10> Writing 1 to the STm1 bit To operation stop status (SEm1 = 0)
Clear the SWCm bit to 0 <11> Clear the SWCm bit to 0 Reset SNOOZE mode setting.
Error processing
Change to the UART Change to the UART Set the SPSm register and bits 15 to 9 in the
reception baud rate in reception baud rate in SDRm1 register.
normal operation normal operation
Writing 1 to the SSmn bit <12> Writing 1 to the SSmn bit To communication wait status (SEmn = 1)
Remarks 1. <1> to <12> in the figure correspond to <1> to <12> in Figure 18-90 Timing Chart of SNOOZE
Mode Operation (EOCm1 = 0, SSECm = 0/1) and Figure 18-91 Timing Chart of SNOOZE Mode
Operation (EOCm1 = 1, SSECm = 0).
2. m = 0; q = 0
(3) SNOOZE mode operation (EOCm1 = 1, SSECm = 1: Error interrupt (INTSREq) generation is stopped)
Because EOCm1 = 1 and SSECm = 1, an error interrupt (INTSREq) is not generated when a communication error
occurs.
<R> Figure 18-93. Timing Chart of SNOOZE Mode Operation (EOCm1 = 1, SSECm = 1)
Normal operation
CPU operation status Normal operation STOP mode SNOOZE mode STOP mode SNOOZE mode
<4>
SS01 <3>
ST01 <1> <10>
SE01
SWC0 <11>
EOC01
<11>
SSEC0
TSF01
Cautions 1. Before switching to the SNOOZE mode or after reception operation in the SNOOZE mode
finishes, set the STm1 bit to 1 (clear the SEm1 bit and stop the operation).
After the receive operation completes, also clear the SWCm bit to 0 (SNOOZE mode release).
2. If a parity error, framing error, or overrun error occurs while the SSECm bit is set to 1, the
PEFm1, FEFm1, or OVFm1 flag is not set and an error interrupt (INTSREq) is not generated.
Therefore, when the setting of SSECm = 1 is made, clear the PEFm1, FEFm1, or OVFm1 flag
before setting the SWCm bit to 1 and read the value in SDRm1[7:0] (RxDq register) (8 bits) or
SDRm1[8:0] (9 bits).
Remarks 1. <1> to <11> in the figure correspond to <1> to <11> in Figure 18-94 Flowchart of SNOOZE Mode
Operation (EOCm1 = 1, SSECm = 1).
2. m = 0; q = 0
Setting start
Yes
SIRm1 = 0007H Clear the all error flags
<1> Writing 1 to the STmn bit The operation of all channels is also stopped to switch to
Normal operation
<2> Setting SSCm register SNOOZE mode setting (make the setting to enable generation
(SWCm = 1, SSECm = 1) of error interrupt INTSREq in SNOOZE mode).
Setting interrupt Clear interrupt request flag (XXIF), reset interrupt mask (XXMK)
and set interrupt disable (DI).
<7>
Reception error detected
STOP mode
<7>
<8> Transfer end interrupt (INTSRq) generated
INTSRq
Change to the UART Set the SPSm register and bits 15 to 9 in the SDRm1
reception baud rate in
register.
normal operation
Normal operation
Caution If a parity error, framing error, or overrun error occurs while the SSECm bit is set to 1, the PEFm1,
FEFm1, or OVFm1 flag is not set and an error interrupt (INTSREq) is not generated. Therefore,
when the setting of SSECm = 1 is made, clear the PEFm1, FEFm1, or OVFm1 flag before setting
the SWCm bit to 1 and read the value in SDRm1[7:0] (RxDq register) (8 bits) or SDRm1[8:0] (9
bits).
Remarks 1. <1> to <11> in the figure correspond to <1> to <11> in Figure 18-93 Timing Chart of SNOOZE
Mode Operation (EOCm1 = 1, SSECm = 1).
2. m = 0; q = 0
(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 2), mn = 00 to 03, 10, 11
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 24 MHz
X X X X 0 0 0 1 fCLK/2 12 MHz
2
X X X X 0 0 1 0 fCLK/2 6 MHz
3
X X X X 0 0 1 1 fCLK/2 3 MHz
4
X X X X 0 1 0 0 fCLK/2 1.5 MHz
5
X X X X 0 1 0 1 fCLK/2 750 kHz
6
X X X X 0 1 1 0 fCLK/2 375 kHz
7
X X X X 0 1 1 1 fCLK/2 187.5 kHz
8
X X X X 1 0 0 0 fCLK/2 93.8 kHz
9
X X X X 1 0 0 1 fCLK/2 46.9 kHz
10
X X X X 1 0 1 0 fCLK/2 23.4 kHz
11
X X X X 1 0 1 1 fCLK/2 11.7 kHz
12
X X X X 1 1 0 0 fCLK/2 5.86 kHz
13
X X X X 1 1 0 1 fCLK/2 2.93 kHz
14
X X X X 1 1 1 0 fCLK/2 1.46 kHz
15
X X X X 1 1 1 1 fCLK/2 732 Hz
1 0 0 0 0 X X X X fCLK 24 MHz
0 0 0 1 X X X X fCLK/2 12 MHz
2
0 0 1 0 X X X X fCLK/2 6 MHz
3
0 0 1 1 X X X X fCLK/2 3 MHz
4
0 1 0 0 X X X X fCLK/2 1.5 MHz
5
0 1 0 1 X X X X fCLK/2 750 kHz
6
0 1 1 0 X X X X fCLK/2 375 kHz
7
0 1 1 1 X X X X fCLK/2 187.5 kHz
8
1 0 0 0 X X X X fCLK/2 93.8 kHz
9
1 0 0 1 X X X X fCLK/2 46.9 kHz
10
1 0 1 0 X X X X fCLK/2 23.4 kHz
11
1 0 1 1 X X X X fCLK/2 11.7 kHz
12
1 1 0 0 X X X X fCLK/2 5.86 kHz
13
1 1 0 1 X X X X fCLK/2 2.93 kHz
14
1 1 1 0 X X X X fCLK/2 1.46 kHz
15
1 1 1 1 X X X X fCLK/2 732 Hz
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 47 31250.0 bps
2
38400 bps fCLK/2 77 38461.5 bps +0.16 %
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 18.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)
Figure 18-95. Permissible Baud Rate Range for Reception (1 Data Frame Length = 11 Bits)
Latch
timing
FL
1 data frame (11 ´ FL)
As shown in Figure 18-95, 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.
18.6.5 Procedure for processing errors that occurred during UART (UART0 to UART2) communication
The procedure for processing errors that occurred during UART (UART0 to UART2) communication is described in
Figures 18-96 and 18-97.
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.
Interrupt INTST0
Transfer end interrupt (in single-transfer mode) or buffer empty interrupt (in continuous transfer
mode) can be selected.
Note Use this operation within a range that satisfies the conditions above and the peripheral functions characteristics in
the electrical specifications (see CHAPTER 37 ELECTRICAL SPECIFICATIONS). In addition, LIN
communication is usually 2.4/9.6/19.2 kbps is often used.
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 Break field Sync field Identification Data field Data field Checksum
frame field field
LIN Bus
TXD0
(output)
INTST0 Note 3
Notes 1. Set the baud rate in accordance with the wakeup signal regulations and transmit data of 80H.
2. A 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 break field is calculated as follows.
(Baud rate of break field) = 9/13 N
By transmitting data of 00H at this baud rate, a break field is generated.
3. INTST0 is output upon completion of transmission. INTST0 is also output at BF transmission.
BF transmission
00 TxD0
BF generation
No TxD0 13-bit length
Waiting for
TSF00 = 0?
completion of BF
Yes transmission
Transmit data
UART0 stop
(1 ST00 bit)
UART0 restart
(1 SS00 bit)
No
BFF00 = 0? Waiting for buffer empty
Yes
Remark Default setting of the UART is complete, and the flow from the transmission enable status.
Interrupt INTSR0
Transfer end interrupt only (Setting the buffer empty interrupt is prohibited.)
Note Use this operation within a range that satisfies the conditions above and the peripheral functions characteristics in
the electrical specifications (see CHAPTER 37 ELECTRICAL SPECIFICATIONS).
Wakeup signal Break field Sync field Identification Data filed Data filed Checksum
frame field field
LIN Bus
<2> <5>
RXD0
INTSR0
<1>
Edge detection
(INTP0)
<3> <4>
TM07 STOP Pulse width measurement Pulse interval measurement
INTTM07
<1> The wakeup signal is detected by detecting an interrupt edge (INTP0) on a pin. When the wakeup signal is
detected, change TM07 to pulse width measurement upon detection of the wakeup signal to measure the low-
level width of the BF signal. Then wait for BF signal reception.
<2> TM07 starts measuring the low-level width upon detection of the falling edge of the BF signal, and then captures
the data upon detection of the rising edge of the BF signal. The captured data is used to judge whether it is the
BF signal.
<3> When the BF signal has been received normally, change TM07 to pulse interval measurement and measure the
interval between the falling edges of the RxD0 signal in the Sync field four times.
<4> When BF 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 7.8.3 Operation as input pulse interval measurement).
<5> Calculate a baud rate error from the bit interval of sync field (SF). Stop UART0 once and adjust (re-set) the baud
rate.
<6> The checksum field should be distinguished by software. In addition, processing to initialize UART0 after the
checksum field is received and to wait for reception of BF should also be performed by software.
RxD0 pin
No Measure the intervals
Generate INTTM07? between five falling Channel 7 Pulse interval
edges of SF, and of TAU0 measurement
Yes INTTM07
accumulate the four
Capture value cumulative captured values.
No Cumulative four
Completed 4 times? times
Yes
Changing TM07 to low-level Change TM07 to low-level width measurement
width measurement to detect a Sync break field.
No
Completing all data
transmission?
Yes
Stop UART0 reception
(1 ST01)
Figure 18-102 shows 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 (RxD0) for reception can be input to the
external interrupt pin (INTP0) and timer array unit
[80-pin]
P06/SI00/RxD0/TI03/TO03/
SDA00/TOOLRxD/SEG36 Selector
Selector
[100-pin]
P06/SI00/RxD0/TI03/TO03/
SDA00/TOOLRxD RXD0 input
P16/SEG10/(SI00)/(RxD0)/(SDA00)
Output latch
(P06 or P16)
Selector
Selector
P137/INTP0
INTP0 input
P70/SEG16/(INTP0)
Port input
PIOR4 switch control
(ISC0)
<ISC0>
[80-pin] 0: Selects INTP0 (P137 or P70)
P02/SCL10/TI07/TO07/ 1: Selects RxD0 (P06 or P16)
INTP5 Selector Selector
[100-pin] Selector
P02/SCL10/TI07/TO07/
INTP5/SEG32
Channel 7 input of
P30/SEG24/(TI07)/(TO07) timer array unit
Remarks 1. ISC0, ISC1: Bits 0 and 1 of the input switch control register (ISC) (See Figure 18-21.)
PIOR0, PIOR1, PIOR4: Bits 0 to 4 of the peripheral I/O redirection register (PIOR) (See Figure 4-8.).
2. Functions in parentheses in the above figure can be assigned via settings in the peripheral I/O redirection
register (PIOR). See Figure 4-8 Format of Peripheral I/O Redirection Register (PIOR).
The peripheral functions used for the LIN communication operation are as follows.
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.
Operate the control registers by software for setting the start and stop conditions while observing the specifications of
the I2C bus line
[Data transmission/reception]
Master transmission, master reception (only master function with a single master)
ACK output function
Note
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.)
Gneration of start condition and stop condition for software
[Interrupt function]
Transfer end interrupt
[Error detection flag]
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 18.8.3 (2) for details.
The channel supporting simplified I2C (IIC00, IIC10) is channels 0 and 2 of SAU0.
2
Unit Channel Used as CSI Used as UART Used as Simplified I C
1
2 UART1 IIC10
3
1 0 UART2 (supporting IrDA)
1
Simplified I2C (IIC00, IIC10) performs the following four types of communication operations.
Address field transmission (See 18.8.1.)
Data transmission (See 18.8.2.)
Data reception (See 18.8.3.)
Stop condition generation (See 18.8.4.)
2
Simplified I C IIC00 IIC10
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)
Note 2
Transfer rate Max. fMCK/4 [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 (fast mode plus)
Max. 400 kHz (fast mode)
Max. 100 kHz (standard mode)
2
Notes 1. To perform communication via simplified I C, set the N-ch open-drain output (VDD tolerance) mode for the
port output mode register (POM0) (see 4.3.5 Port output mode registers (POMxx) for details). When
IIC00, IIC10 communicating with an external device with a different potential, set the N-ch open-drain output
(VDD tolerance) mode also for the clock input/output pins (SCL00, SCL10) (see 4.4.4 Connecting to
external device with different potential (1.8 V, 2.5 V, 3 V) for details).
2. Use this operation within a range that satisfies the conditions above and the peripheral functions
characteristics in the electrical specifications (see CHAPTER 37 ELECTRICAL SPECIFICATIONS)).
SCRmn TXEmn RXEmn DAPmn CKPmn EOCmn PTCmn1 PTCmn0 DIRmn SLCmn1 SLCmn0 DLSmn1 DLSmn0
Note
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
Note Only provided for the SCR00 register. This bit is fixed to 1 for the other registers.
Remarks 1. m: Unit number (m = 0), n: Channel number (n = 0, 2), r: IIC number (r = 00, 10), mn = 00, 02
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
Figure 18-103. Example of Contents of Registers for Address Field Transmission of Simplified I2C (IIC00, IIC10)
(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), n: Channel number (n = 0, 2), r: IIC number (r = 00, 10), mn = 00, 02
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
2
Figure 18-104. Initial Setting Procedure for Simplified I C
Starting communication
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), n: Channel number (n = 0, 2), r: IIC number (r = 00, 10), mn = 00, 02
Communication error
processing
Address field
transmission completed
2
Simplified I C IIC00 IIC10
Transfer end interrupt only (Setting the buffer empty interrupt is prohibited.)
Notes 1. To perform communication via simplified I2C, set the N-ch open-drain output (VDD tolerance) mode for the
port output mode registers (POM0) (see 4.3.5 Port output mode registers (POMxx) for details). When
IIC00, IIC10 communicating with an external device with a different potential, set the N-ch open-drain output
(VDD tolerance) mode also for the clock input/output pins (SCL00, SCL10) (see 4.4.4 Connecting to
external device with different potential (1.8 V, 2.5 V, 3 V) for details).
2. Use this operation within a range that satisfies the conditions above and the peripheral functions
characteristics in the electrical specifications (see CHAPTER 37 ELECTRICAL SPECIFICATIONS).
Figure 18-107. Example of Contents of Registers for Data Transmission of Simplified I2C (IIC00, IIC10) (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 1Note 1 1
(c) Serial data register mn (SDRmn) (lower 8 bits: SIOr) … During data transmission/reception, valid only
lower 8-bits (SIOr)
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
SDRmn
Note 2
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
Notes 1. Only provided for the SCR00 register. This bit is fixed to 1 for the other registers.
2. Because the setting is completed by address field transmission, setting is not required.
3. The value varies depending on the communication data during communication operation.
Remarks 1. m: Unit number (m = 0), n: Channel number (n = 0, 2), r: IIC number (r = 00, 10), mn = 00, 02
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
Figure 18-107. Example of Contents of Registers for Data Transmission of Simplified I2C (IIC00, IIC10) (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), n: Channel number (n = 0, 2), r: IIC number (r = 00, 10), mn = 00, 02
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
2
Figure 18-109. Flowchart of Simplified I C Data Transmission
Address field
transmission completed
Yes
Data transmission
completed
2
Simplified I C IIC00 IIC10
Transfer end interrupt only (Setting the buffer empty interrupt is prohibited.)
Notes 1. To perform communication via simplified I2C, set the N-ch open-drain output (VDD tolerance) mode for the
port output mode registers (POM0) (see 4.3.5 Port output mode registers (POMxx) for details). When
IIC00, IIC10 communicating with an external device with a different potential, set the N-ch open-drain output
(VDD tolerance) mode also for the clock input/output pins (SCL00, SCL10) (see 4.4.4 Connecting to
external device with different potential (1.8 V, 2.5 V, 3 V) for details).
2. Use this operation within a range that satisfies the conditions above and the peripheral functions
characteristics in the electrical specifications (see CHAPTER 37 ELECTRICAL SPECIFICATIONS).
2
Figure 18-110. Example of Contents of Registers for Data Reception of Simplified I C (IIC00, IIC10) (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
Note 1
SDRmn Note 2
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
Notes 1. Only provided for the SCR00 register. This bit is fixed to 1 for the other registers.
2. The baud rate setting is not required because the baud rate has already been set when the address
field was transmitted.
3. The value varies depending on the communication data during communication operation.
Remarks 1. m: Unit number (m = 0), n: Channel number (n = 0, 2), r: IIC number (r = 00, 10), mn = 00, 02
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
Figure 18-110. Example of Contents of Registers for Data Reception of Simplified I2C (IIC00, IIC10) (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), n: Channel number (n = 0, 2), r: IIC number (r = 00, 10), mn = 00, 02
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), n: Channel number (n = 0, 2), r: IIC number (r = 00, 10), mn = 00, 02
Operation restart
Writing 1 to the SSmn bit
No
Last byte received?
Yes
Disable output so that not the ACK
response to the last received data.
Writing 0 to the SOEmn bit
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
Writing 1 to the STmn bit to clear Operation stop status (operable CKOmn
(the SEmn bit is cleared to 0)
manipulation)
Writing 1 to the CKOmn bit Timing to satisfy the low width standard of SCL
2
for the I C bus.
Caution SDRmn[15:9] must not be set to 00000000B. Be sure to set a value of 00000001B or greater
for SDRmn[15:9]. The duty ratio of the SCL signal output by the simplified I2C is 50%. The I2C
bus specifications define that the low-level width of the SCL signal is longer than the high-
level width. If 400 kbps (fast mode) or 1 Mbps (fast mode plus) is specified, therefore, the low-
level width of the SCL output signal becomes shorter than the value specified in the I2C bus
specifications. Make sure that the SDRmn[15:9] value satisfies the I2C bus specifications.
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), n: Channel number (n = 0, 2), mn = 00, 02
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 24 MHz
X X X X 0 0 0 1 fCLK/2 12 MHz
2
X X X X 0 0 1 0 fCLK/2 6 MHz
3
X X X X 0 0 1 1 fCLK/2 3 MHz
4
X X X X 0 1 0 0 fCLK/2 1.5 MHz
5
X X X X 0 1 0 1 fCLK/2 750 kHz
6
X X X X 0 1 1 0 fCLK/2 375 kHz
7
X X X X 0 1 1 1 fCLK/2 187.5 kHz
8
X X X X 1 0 0 0 fCLK/2 93.8 kHz
9
X X X X 1 0 0 1 fCLK/2 46.9 kHz
10
X X X X 1 0 1 0 fCLK/2 23.4 kHz
11
X X X X 1 0 1 1 fCLK/2 11.7 kHz
1 0 0 0 0 X X X X fCLK 24 MHz
0 0 0 1 X X X X fCLK/2 12 MHz
2
0 0 1 0 X X X X fCLK/2 6 MHz
3
0 0 1 1 X X X X fCLK/2 3 MHz
4
0 1 0 0 X X X X fCLK/2 1.5 MHz
5
0 1 0 1 X X X X fCLK/2 750 kHz
6
0 1 1 0 X X X X fCLK/2 375 kHz
7
0 1 1 1 X X X X fCLK/2 187.5 kHz
8
1 0 0 0 X X X X fCLK/2 93.8 kHz
9
1 0 0 1 X X X X fCLK/2 46.9 kHz
10
1 0 1 0 X X X X fCLK/2 23.4 kHz
11
1 0 1 1 X X X X fCLK/2 11.7 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 = 24 MHz.
2
I C Transfer Mode fCLK = 24 MHz
(Desired Transfer Rate) Operation Clock (fMCK) SDRmn[15:9] Calculated Error from Desired Transfer
Transfer Rate Rate
100 kHz fCLK/2 59 100 kHz 0.0%
Note
400 kHz fCLK 29 380 kHz 5.0%
Note
1 MHz fCLK 5 0.84 MHz 16.0%
Note The error cannot be set to about 0% because the duty ratio of the SCL signal is 50%.
18.8.6 Procedure for processing errors that occurred during simplified I2C (IIC00, IIC10) communication
2
The procedure for processing errors that occurred during simplified I C (IIC00, IIC10) communication is described in
Figures 18-115 and 18-116.
Reads serial data register mn The BFFmn bit of the SSRmn register is This is to prevent an overrun error if the
(SDRmn). set to 0 and channel n is enabled to next reception is completed during
receive data. error processing.
Reads serial status register mn (SSRmn). The error type is identified and the read
value is used to clear the error flag.
Writes 1 to serial flag clear trigger The error flag is cleared. The error only during reading can be
register mn (SIRmn). cleared, by writing the value read
from the SSRmn register to the
SIRmn register without modification.
Figure 18-116. Processing Procedure in Case of ACK Error in Simplified I2C Mode
Reads serial status register mn (SSRmn). The error type is identified and the read
value is used to clear the error flag.
Writes 1 to serial flag clear trigger The error flag is cleared. The error only during reading can be
register mn (SIRmn). cleared, by writing the value read from
the SSRmn register to the SIRmn
register without modification.
Sets the STmn bit of serial channel The SEmn bit of serial channel enable The slave is not ready for reception
stop 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 a stop condition. transmission can be redone from
Creates a start condition. address transmission.
Sets the SSmn bit of serial channel The SEmn bit of serial channel enable
start 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), n: Channel number (n = 0, 2), r: IIC number (r = 00, 10), mn = 00, 02
Remark n=0
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
Output fMCK
PM60 Counter IICS0.MSTS0, EXC0, COI0
latch fCLK/2
(P60)
Match signal
IICCTL01.PRS0
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
2
Figure 19-2. Serial Bus Configuration Example Using I C Bus
+ VDD + VDD
Address 2
SCLAn
SDAAn
Slave IC
Address 3
SCLAn
SDAAn
Slave IC
Address N
SCLAn
Remark n=0
Item Configuration
Registers IICA shift register n (IICAn)
Slave address register n (SVAn)
Control registers Peripheral enable register 0 (PER0)
IICA control register n0 (IICCTLn0)
IICA status register n (IICSn)
IICA flag register n (IICFn)
IICA control register n1 (IICCTLn1)
IICA low-level width setting register n (IICWLn)
IICA high-level width setting register n (IICWHn)
Port mode register 6 (PM6)
Port register 6 (P6)
Remark n=0
Symbol 7 6 5 4 3 2 1 0
IICAn
Cautions 1. Do not write data to the IICAn register during data transfer.
2. Write or read the IICAn register only during the wait period. Accessing the IICAn register in a
communication state other than during the wait period is prohibited. When the device serves
as the master, however, the IICAn register can be written only once after the communication
trigger bit (STTn) is set to 1.
3. When communication is reserved, write data to the IICAn register after the interrupt triggered
by a stop condition is detected.
Remark n=0
Symbol 7 6 5 4 3 2 1 0
SVAn A6 A5 A4 A3 A2 A1 A0 0Note
(3) SO latch
The SO latch is used to retain the SDAAn pin’s output level.
(9) ACK generator, stop condition detector, start condition detector, and ACK detector
These circuits generate and detect each status.
Remark n=0
Remark n=0
Cautions 1. When setting serial interface IICAn, be sure to set the following registers first while the IICAnEN
bit is set to 1. If IICAnEN = 0, the control registers of serial interface IICA are set to their initial
values, and writing to them is ignored (except for port mode register 6 (PM6) and port register 6
(P6)).
• IICA control register n0 (IICCTLn0)
• IICA flag register n (IICFn)
• IICA status register n (IICSn)
• IICA control register n1 (IICCTLn1)
• IICA low-level width setting register n (IICWLn)
• IICA high-level width setting register n (IICWHn)
2. Be sure to clear bit 1 to “0”.
Remark n=0
Remark n=0
2
IICEn I C operation enable
Note 1
0 Stop operation. Reset the IICA status register n (IICSn) . Stop internal operation.
1 Enable operation.
Be sure to set this bit (1) while the SCLAn and SDAAn lines are at high level.
Notes 2, 3
LRELn 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 SCLAn and SDAAn lines are set to high impedance.
The following flags of IICA control register n0 (IICCTLn0) and the IICA status register n (IICSn) are
cleared to 0.
• STTn • SPTn • MSTSn • EXCn • COIn • TRCn • ACKDn • STDn
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
WRELn Wait cancellation
When the WRELn bit is set (wait canceled) during the wait period at the ninth clock pulse in the transmission status
(TRCn = 1), the SDAAn line goes into the high impedance state (TRCn = 0).
Notes 1. The IICA status register n (IICSn), the STCFn and IICBSYn bits of the IICA flag register n (IICFn),
and the CLDn and DADn bits of IICA control register n1 (IICCTLn1) are reset.
2. The signal of this bit is invalid while IICEn is 0.
3. When the LRELn and WRELn bits are read, 0 is always read.
2
Caution If the operation of I C is enabled (IICEn = 1) when the SCLAn line is high level, the SDAAn
line is low level, and the digital filter is turned on (DFCn bit of IICCTLn1 register = 1), a start
condition will be inadvertently detected immediately. In this case, set (1) the LRELn bit by
2
using a 1-bit memory manipulation instruction immediately after enabling operation of I C
(IICEn = 1).
Remark n=0
R01UH0407EJ0210 Rev.2.10 620
Apr 25, 2016
RL78/I1B CHAPTER 19 SERIAL INTERFACE IICA
Note 1
SPIEn Enable/disable generation of interrupt request when stop condition is detected
0 Disable
1 Enable
If the WUPn bit of IICA control register n1 (IICCTLn1) is 1, no stop condition interrupt will be generated even if SPIEn
= 1.
Note 1
WTIMn Control of wait and interrupt request generation
Notes 1, 2
ACKEn Acknowledgment control
0 Disable acknowledgment.
1 Enable acknowledgment. During the ninth clock period, the SDAAn line is set to low level.
Notes 1. The signal of this bit is invalid while IICEn 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.
Remark n=0
Notes 1, 2
STTn Start condition trigger
Note
SPTn Stop condition trigger
Caution When bit 3 (TRCn) of the IICA status register n (IICSn) is set to 1 (transmission status), bit 5
(WRELn) of IICA control register n0 (IICCTLn0) is set to 1 during the ninth clock and wait is
canceled, after which the TRCn bit is cleared (reception status) and the SDAAn line is set to
high impedance. Release the wait performed while the TRCn bit is 1 (transmission status)
by writing to the IICA shift register n.
Remark n=0
Caution Reading the IICSn register while the address match wakeup function is enabled (WUPn = 1) in STOP
mode is prohibited. When the WUPn bit is changed from 1 to 0 (wakeup operation is stopped),
regardless of the INTIICAn 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 (SPIEn = 1)
the interrupt generated by detecting a stop condition and read the IICSn 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 MSTSn bit is cleared.
Condition for clearing (ALDn = 0) Condition for setting (ALDn = 1)
Automatically cleared after the IICSn register is When the arbitration result is a “loss”.
Note
read
When the IICEn 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 IICSn register. Therefore, when using the ALDn 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 SDAAn line is set for high impedance.
1 Transmit status. The value in the SOn latch is enabled for output to the SDAAn line (valid starting at
the falling edge of the first byte’s ninth clock).
Note When bit 3 (TRCn) of the IICA status register n (IICSn) is set to 1 (transmission status), bit 5
(WRELn) of IICA control register n0 (IICCTLn0) is set to 1 during the ninth clock and wait is
canceled, after which the TRCn bit is cleared (reception status) and the SDAAn line is set to high
impedance. Release the wait performed while the TRCn bit is 1 (transmission status) by writing to
the IICA shift register n.
Remarks 1. LRELn: Bit 6 of IICA control register n0 (IICCTLn0)
IICEn: Bit 7 of IICA control register n0 (IICCTLn0)
2. n=0
When a stop condition is detected After the SDAAn line is set to low level at the rising
At the rising edge of the next byte’s first clock edge of SCLAn line’s ninth clock
Cleared by LRELn = 1 (exit from communications)
When the IICEn 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
When the WUPn bit changes from 1 to 0
When the IICEn bit changes from 1 to 0 (operation
stop)
Reset
Cautions 1. Write to the STCENn bit only when the operation is stopped (IICEn = 0).
2. As the bus release status (IICBSYn = 0) is recognized regardless of the actual bus
status when STCENn = 1, when generating the first start condition (STTn = 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 IICRSVn only when the operation is stopped (IICEn = 0).
Note 1
Address: F0231H After reset: 00H R/W
To shift to STOP mode when WUPn = 1, execute the STOP instruction at least three clocks of fMCK after setting
(1) the WUPn bit (see Figure 19-22 Flow When Setting WUPn = 1).
Clear (0) the WUPn bit after the address has matched or an extension code has been received. The
subsequent communication can be entered by the clearing (0) WUPn bit. (The wait must be released and
transmit data must be written after the WUPn bit has been cleared (0).)
The interrupt timing when the address has matched or when an extension code has been received, while WUPn
= 1, is identical to the interrupt timing when WUPn = 0. (A delay of the difference of sampling by the clock will
occur.) Furthermore, when WUPn = 1, a stop condition interrupt is not generated even if the SPIEn bit is set to
1.
Cleared by instruction (after address match or Set by instruction (when the MSTSn, EXCn, and
extension code reception) COIn bits are “0”, and the STDn bit also “0”
Note 2
(communication not entered))
<1> <2>
SCLAn
SDAAn A6 A5 A4 A3 A2 A1 A0 R/W
Remark n=0
When the SCLAn pin is at low level When the SCLAn pin is at high level
When IICEn = 0 (operation stop)
Reset
When the SDAAn pin is at low level When the SDAAn pin is at high level
When IICEn = 0 (operation stop)
Reset
1 Operates in fast mode (fastest transfer rate: 400 kbps) or fast mode plus (fastest transfer rate: 1
Mbps).
Digital filter can be used only in fast mode and fast mode plus.
The digital filter is used for noise elimination. The transfer clock does not vary, regardless of the DFCn bit being
set (1) or cleared (0).
Cautions 1. The maximum operating frequency of the IICA operating clock (fMCK) is 20 MHz
(Max.). Set the IICA control register n1 (IICCTLn1) bit 0 (PRSn) to “1” only when fCLK
exceeds 20 MHz.
2. 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.)
3. The fast mode plus is only available in the products for “A: Consumer applications
(TA = 40C to +85C)” and “D: Industrial applications (TA = 40C to +85C)”.
Symbol 7 6 5 4 3 2 1 0
IICWLn
Symbol 7 6 5 4 3 2 1 0
IICWHn
Remarks 1. For setting procedures of the transfer clock on master side and of the IICWLn and IICWHn
registers on slave side, see 19.4.2 (1) and 19.4.2 (2), respectively.
2. n=0
(1) SCLAn .... 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) SDAAn .... 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
SCLAn SCLAn
SDAAn SDAAn
VSS VSS
Remark n = 0
fMCK
Transfer clock = IICWL0 + IICWH0 + fMCK (tR + tF)
At this time, the optimal setting values of the IICWLn and IICWHn registers are as follows.
(The fractional parts of all setting values are rounded up.)
0.52
IICWLn = Transfer clock fMCK
0.48
IICWHn = ( Transfer clock tR tF) fMCK
0.47
IICWLn = Transfer clock fMCK
0.53
IICWHn = ( Transfer clock tR tF) fMCK
0.50
IICWLn = Transfer clock fMCK
0.50
IICWHn = ( Transfer clock tR tF) fMCK
Cautions 1. The fastest operation frequency of the IICA operation clock (fMCK) is 20 MHz (Max.).
Set bit 0 (PRSn) of the IICA control register n1 (IICCTLn1) to “1” only when the fCLK exceeds 20
MHz.
2. 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.)
Remarks 1. Calculate the rise time (tR) and fall time (tF) of the SDAAn and SCLAn signals separately, because
they differ depending on the pull-up resistance and wire load.
2. IICWLn: IICA low-level width setting register n
IICWHn: IICA high-level width setting register n
tF: SDAAn and SCLAn signal falling times
tR: SDAAn and SCLAn signal rising times
fMCK: IICA operation clock frequency
3. n=0
The following section describes the I2C bus’s serial data communication format and the signals used by the I2C bus.
Figure 19-14 shows the transfer timing for the “start condition”, “address”, “data”, and “stop condition” output via the I2C
bus’s serial data bus.
2
Figure 19-14. I C Bus Serial Data Transfer Timing
SDAAn
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 (SCLAn) is continuously output by the master device. However, in the slave device, the SCLAn pin low
level period can be extended and a wait can be inserted.
H
SCLAn
SDAAn
A start condition is output when bit 1 (STTn) of IICA control register n0 (IICCTLn0) is set (1) after a stop condition has
been detected (SPDn: Bit 0 of the IICA status register n (IICSn) = 1). When a start condition is detected, bit 1 (STDn) of
the IICSn register is set (1).
Remark n = 0
19.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 n (SVAn). If the address data matches the SVAn register
values, the slave device is selected and communicates with the master device until the master device generates a start
condition or stop condition.
SCLAn 1 2 3 4 5 6 7 8 9
SDAAn A6 A5 A4 A3 A2 A1 A0 R/W
Address
Note
INTIICAn
Note INTIICAn 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
19.5.3 Transfer direction specification are written to the IICA shift register n (IICAn). The received addresses are
written to the IICAn register.
The slave address is assigned to the higher 7 bits of the IICAn register.
SCLAn 1 2 3 4 5 6 7 8 9
SDAAn A6 A5 A4 A3 A2 A1 A0 R/W
Note INTIICAn is not issued if data other than a local address or extension code is received during slave device
operation.
Remark n = 0
To generate ACK, the reception side makes the SDAAn line low at the ninth clock (indicating normal reception).
Automatic generation of ACK is enabled by setting bit 2 (ACKEn) of IICA control register n0 (IICCTLn0) to 1. Bit 3
(TRCn) of the IICSn register is set by the data of the eighth bit that follows 7-bit address information. Usually, set the
ACKEn bit to 1 for reception (TRCn = 0).
If a slave can receive no more data during reception (TRCn = 0) or does not require the next data item, then the slave
must inform the master, by clearing the ACKEn bit to 0, that it will not receive any more data.
When the master does not require the next data item during reception (TRCn = 0), it must clear the ACKEn 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).
SCLAn 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 ACKEn 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 ACKEn 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 (WTIMn) of IICCTLn0 register = 0):
By setting the ACKEn bit to 1 before releasing the wait state, ACK is generated at the falling edge of the eighth clock
of the SCLAn pin.
When 9-clock wait state is selected (bit 3 (WTIMn) of IICCTLn0 register = 1):
ACK is generated by setting the ACKEn bit to 1 in advance.
Remark n = 0
H
SCLAn
SDAAn
A stop condition is generated when bit 0 (SPTn) of IICA control register n0 (IICCTLn0) is set to 1. When the stop
condition is detected, bit 0 (SPDn) of the IICA status register n (IICSn) is set to 1 and INTIICAn is generated when bit 4
(SPIEn) of the IICCTLn0 register is set to 1.
Remark n = 0
19.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 SCLAn 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 ACKEn = 1)
Master
Master returns to high
impedance but slave Wait after output
is in wait state (low level). of ninth clock
IICAn IICA0 data write (cancel wait)
SCLAn 6 7 8 9 1 2 3
Slave
Wait after output
of eighth clock
FFH is written to IICAn or WRELn is set to 1
IICAn
SCLAn
H
ACKEn
Transfer lines
Wait from slave Wait from master
SCLAn 6 7 8 9 1 2 3
SDAAn D2 D1 D0 ACK D7 D6 D5
Remark n = 0
(2) When master and slave devices both have a nine-clock wait
(master transmits, slave receives, and ACKEn = 1)
SCLAn 6 7 8 9 1 2 3
Slave
FFH is written to IICAn or WRELn is set to 1
IICAn
SCLAn
ACKEn H
Wait from
master and
Transfer lines slave Wait from slave
SCLAn 6 7 8 9 1 2 3
SDAAn D2 D1 D0 ACK D7 D6 D5
A wait may be automatically generated depending on the setting of bit 3 (WTIMn) of IICA control register n0 (IICCTLn0).
Normally, the receiving side cancels the wait state when bit 5 (WRELn) of the IICCTLn0 register is set to 1 or when
FFH is written to the IICA shift register n (IICAn), and the transmitting side cancels the wait state when data is written to
the IICAn register.
The master device can also cancel the wait state via either of the following methods.
• By setting bit 1 (STTn) of the IICCTLn0 register to 1
• By setting bit 0 (SPTn) of the IICCTLn0 register to 1
Remark n = 0
2
When the above wait canceling processing is executed, the I C cancels the wait state and communication is resumed.
To cancel a wait state and transmit data (including addresses), write the data to the IICAn register.
To receive data after canceling a wait state, or to complete data transmission, set bit 5 (WRELn) of the IICCTLn0
register to 1.
To generate a restart condition after canceling a wait state, set bit 1 (STTn) of the IICCTLn0 register to 1.
To generate a stop condition after canceling a wait state, set bit n (SPTn) of the IICCTLn0 register to 1.
Execute the canceling processing only once for one wait state.
If, for example, data is written to the IICAn register after canceling a wait state by setting the WRELn bit to 1, an
incorrect value may be output to SDAAn line because the timing for changing the SDAAn line conflicts with the timing for
writing the IICAn register.
In addition to the above, communication is stopped if the IICEn 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 (LRELn) of the
IICCTLn0 register, so that the wait state can be canceled.
Caution If a processing to cancel a wait state is executed when WUPn = 1, the wait state will not be canceled.
Remark n = 0
Notes 1. The slave device’s INTIICAn 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 n (SVAn).
At this point, ACK is generated regardless of the value set to the IICCTLn0 register’s bit 2 (ACKEn). For a
slave device that has received an extension code, INTIICAn occurs at the falling edge of the eighth clock.
However, if the address does not match after restart, INTIICAn 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 n (SVAn) and extension
code is not received, neither INTIICAn 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 WTIMn bit.
• Master device operation: Interrupt and wait timing occur at the falling edge of the ninth clock regardless of the
WTIMn bit.
• Master/slave device operation: Interrupt and wait timing are determined according to the WTIMn bit.
• Master/slave device operation: Interrupt and wait timing are determined according to the WTIMn bit.
When an 8-clock wait has been selected (WTIMn = 0), the presence/absence of ACK generation must be
determined prior to wait cancellation.
Remark n = 0
Remark n = 0
(1) When the higher 4 bits of the receive address are either “0000” or “1111”, the extension code reception flag (EXCn)
is set to 1 for extension code reception and an interrupt request (INTIICAn) is issued at the falling edge of the
eighth clock. The local address stored in the slave address register n (SVAn) 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 SVAn register is set to 11110xx0. Note that INTIICAn 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 (LRELn) of IICA control register n0 (IICCTLn0) 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)
Remarks 1. See the I2C bus specifications issued by NXP Semiconductors for details of extension codes other than
those described above.
2. n = 0
19.5.12 Arbitration
When several master devices simultaneously generate a start condition (when the STTn bit is set to 1 before the STDn
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 (ALDn) in the IICA status register n (IICSn)
is set (1) via the timing by which the arbitration loss occurred, and the SCLAn and SDAAn 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 ALDn = 1 setting that has been made by software.
For details of interrupt request timing, see 19.5.8 Interrupt request (INTIICAn) generation timing and wait control.
Master 1
Hi-Z
SCLAn
Hi-Z
SDAAn
SCLAn
SDAAn
Transfer lines
SCLAn
SDAAn
Remark n = 0
Table 19-4. Status During Arbitration and Interrupt Request Generation Timing
Notes 1. When the WTIMn bit (bit 3 of IICA control register n0 (IICCTLn0)) = 1, an interrupt request occurs at the
falling edge of the ninth clock. When WTIMn = 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 SPIEn = 1 for master device operation.
START
No
MSTSn = STDn = EXCn = COIn =0?
Yes
WUPn = 1
Remark n = 0
Figure 19-23. Flow When Setting WUPn = 0 upon Address Match (Including Extension Code Reception)
Yes
WUPn = 0
Reading IICSn
Use the following flows to perform the processing to release the STOP mode other than by an interrupt request
(INTIICAn) generated from serial interface IICA.
• When operating next IIC communication as master: Flow shown in Figure 19-24
• When operating next IIC communication as slave:
When restored by INTIICAn interrupt: Same as the flow in Figure 19-23
When restored by other than INTIICAn interrupt: Until the INTIICAn interrupt occurs, continue operating with WUPn
left set to 1
Remark n = 0
Figure 19-24. When Operating as Master Device After Releasing STOP Mode Other than by INTIICAn
START
SPIEn = 1
WUPn = 1
STOP instruction
STOP mode state
Releasing STOP mode Releases STOP mode by an interrupt other than INTIICAn.
WUPn = 0
No
INTIICAn = 1?
Reading IICSn
Remark n = 0
(1) When communication reservation function is enabled (bit n (IICRSVn) of IICA flag register n (IICFn) = 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 (STTn) of the IICCTLn0 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 n (IICAn) after bit 4 (SPIEn) of the IICCTLn0 register was set to 1,
and it was detected by generation of an interrupt request signal (INTIICAn) that the bus was released (detection of
the stop condition), then the device automatically starts communication as the master. Data written to the IICAn
register before the stop condition is detected is invalid.
When the STTn 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 MSTSn bit (bit 7 of the IICA status
register n (IICSn)) after the STTn bit is set to 1 and the wait time elapses.
Use software to secure the wait time calculated by the following expression.
<R> Wait time from setting STTn = 1 to checking the MSTSn flag:
(IICWLn setting value + IICWHn setting value + 4)/fMCK + tF 2
Write to
Program processing STTn = 1
IICAn
SCLAn 1 2 3 4 5 6 7 8 9 1 2 3 4 5 6
SDAAn
Communication reservations are accepted via the timing shown in Figure 19-26. After bit 1 (STDn) of the IICA
status register n (IICSn) is set to 1, a communication reservation can be made by setting bit 1 (STTn) of IICA
control register n0 (IICCTLn0) to 1 before a stop condition is detected.
SCLAn
SDAAn
STDn
SPDn
Standby mode (Communication can be reserved by setting STTn to 1 during this period.)
Remark n = 0
DI
(Communication reservation)Note 2
MSTSn = 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 (IICRSVn) of IICA flag register n (IICFn) = 1)
When bit 1 (STTn) of IICA control register n0 (IICCTLn0) 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 STCFn (bit 7 of the IICFn
register). It takes up to 5 clocks of fMCK until the STCFn bit is set to 1 after setting STTn = 1. Therefore, secure the
time by software.
Remark n = 0
19.5.15 Cautions
<1> Clear bit 4 (SPIEn) of the IICCTLn0 register to 0 to disable generation of an interrupt request signal
(INTIICAn) when the stop condition is detected.
<2> Set bit 7 (IICEn) of the IICCTLn0 register to 1 to enable the operation of I2C.
<3> Wait for detection of the start condition.
<4> Set bit 6 (LRELn) of the IICCTLn0 register to 1 before ACK is returned (4 to 72 clocks of fMCK after setting the
IICEn bit to 1), to forcibly disable detection.
(4) Setting the STTn and SPTn bits (bits 1 and 0 of the IICCTLn0 register) again after they are set and before they are
cleared to 0 is prohibited.
(5) When transmission is reserved, set the SPIEn bit (bit 4 of the IICCTLn0 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 n (IICAn) 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 SPIEn bit to 1 when the MSTSn bit (bit 7 of the
IICA status register n (IICSn)) is detected by software.
Remark n = 0
Remark n = 0
START
Setting the PER0 register Release the serial interface IICAn from the reset status and start clock supply.
IICFn ← 0XH
Sets a start condition.
Setting STCENn, IICRSVn = 0
Setting IICCTLn1
Initial setting
IICCTLn0 ← 0XX111XXB
ACKEn = WTIMn = SPIEn = 1
IICCTLn0 ← 1XX111XXB
IICEn = 1
2
Set the port from input mode to output mode and enable the output of the I C bus
Setting port
(see 19.3.8 Port mode register 6 (PM6)).
Yes
STCENn = 1?
No
Prepares for starting communication
SPTn = 1 (generates a stop condition).
INTIICAn No
interrupt occurs?
Waits for detection of the stop condition.
Yes
Starts communication
Writing IICAn (specifies an address and transfer
direction).
INTIICAn No
interrupt occurs? Waits for detection of acknowledge.
Yes
No
ACKDn = 1?
ACKEn = 1
Yes WTIMn = 0
No
TRCn = 1? WRELn = 1 Starts reception.
Yes
Communication processing
INTIICAn No
Writing IICAn Starts transmission. interrupt occurs?
Waits for data
reception.
Yes
INTIICAn No Reading IICAn
interrupt occurs? Waits for data transmission.
Yes
No
End of transfer?
ACKDn = 1? No
Yes
Yes ACKEn = 0
No
End of transfer?
WTIMn = 1
Yes
WRELn = 1
No
Restart?
INTIICAn No
Yes SPTn = 1 interrupt occurs? Waits for detection
of acknowledge.
Yes
END
Note Release (SCLAn and SDAAn pins = high level) the I2C bus in conformance with the specifications of the product
that is communicating. If EEPROM is outputting a low level to the SDAAn pin, for example, set the SCLAn pin in
the output port mode, and output a clock pulse from the output port until the SDAAn pin is constantly at high level.
Remarks 1. Conform to the specifications of the product that is communicating, with respect to the transmission and
reception formats.
2. n = 0
START
Setting the PER0 register Release the serial interface IICAn from the reset status and start clock supply.
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 19.3.8 Port mode register 6 (PM6)).
IICFn ← 0XH
Sets a start condition.
Setting STCENn and IICRSVn
Setting IICCTLn1
IICCTLn0 ← 0XX111XXB
ACKEn = WTIMn = SPIEn = 1
IICCTLn0 ← 1XX111XXB
Initial setting
IICEn = 1
2
Set the port from input mode to output mode and enable the output of the I C bus
Setting port
(see 19.3.8 Port mode register 6 (PM6)).
Bus status is No
being checked. STCENn = 1?
Prepares for starting
No INTIICAn Yes SPTn = 1 communication
interrupt occurs? (generates a stop condition).
Yes
INTIICAn No
interrupt occurs?
No Waits for detection
SPDn = 1?
of the stop condition.
Yes
Yes Slave operation
No
SPDn = 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 SPIEn = 0
(Communication start request)
INTIICAn No
SPIEn = 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 (CLDn bit = 1, DADn bit = 1) for a specific period (for example, for a period of
one frame). If the SDAAn pin is constantly at low level, decide whether to release the I2C bus (SCLAn and
SDAAn pins = high level) in conformance with the specifications of the product that is communicating.
Remark n = 0
R01UH0407EJ0210 Rev.2.10 656
Apr 25, 2016
RL78/I1B CHAPTER 19 SERIAL INTERFACE IICA
No
MSTSn = 1?
Yes INTIICAn No
interrupt occurs? Waits for bus release
(communication being reserved).
Yes
No
EXCn = 1 or COIn = 1?
Wait state after stop condition
was detected and start condition
was generated by the communication Yes
reservation function.
C Slave operation
No
IICBSYn = 0?
Yes
D
No
STCFn = 0?
Yes INTIICAn No
interrupt occurs? Waits for bus release
Yes
C
EXCn = 1 or COIn = 1? No
Detects a stop condition.
Yes
Slave operation D
Starts communication
Writing IICAn
(specifies an address and transfer direction).
INTIICAn No
interrupt occurs? Waits for detection of ACK.
Yes
No
MSTSn = 1?
Yes
2
No
ACKDn = 1?
ACKEn = 1
WTIMn = 0
Yes
No
TRCn = 1? WRELn = 1 Starts reception.
Yes
WTIMn = 1 INTIICAn No
Communication processing
Yes
Writing IICAn Starts transmission.
No
MSTSn = 1?
INTIICAn No Yes
interrupt occurs? 2
Waits for data transmission.
Reading IICAn
Yes
No
MSTSn = 1? No
Transfer end?
Yes
2 Yes
No ACKEn = 0
ACKDn = 1?
Yes WTIMn = 1
No
Transfer end? WRELn = 1
Yes
INTIICAn No
interrupt occurs? Waits for detection of ACK.
No
Restart?
Yes
SPTn = 1
Yes
No
MSTSn = 1?
STTn = 1 END
Yes 2
C
Communication processing
No
EXCn = 1 or COIn = 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 MSTSn bit each time interrupt
INTIICAn 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
n (IICSn) and IICA flag register n (IICFn) each time interrupt INTIICAn has occurred, and determine the
processing to be performed next.
4. n=0
INTIICAn Flag
Interrupt servicing
Setting
IICA 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 INTIICAn.
Remark n = 0
START
Setting the PER0 register Release the serial interface IICAn from the reset status and start clock supply.
IICFn ← 0XH
Sets a start condition.
Setting IICRSVn
Setting IICCTLn1
IICCTLn0 ← 0XX011XXB
ACKEn = WTIMn = 1, SPIn = 0
IICCTLn0 ← 1XX011XXB
IICEn = 1
Setting port Set the port from input mode to output mode and enable the output of the I2C bus
(see 19.3.8 Port mode register 6 (PM6)).
No
Communication
mode flag = 1?
Yes
No
Communication
direction flag = 1?
Yes
Starts SPIEn = 1
Writing IICAn
transmission.
No Starts
Communication WRELn = 1
Communication processing
Yes
No No
Communication Communication
direction flag = 1? mode flag = 1?
Yes Yes
No No
Ready flag = 1? Communication
direction flag = 0?
Yes Yes
No
Clearing ready flag Ready flag = 1?
Yes
Yes
ACKDn = 1? Reading IICAn
No
Clearing communication
mode flag Clearing ready flag
WRELn = 1
Remarks 1. Conform to the specifications of the product that is in communication, regarding the transmission and
reception formats.
2.. n = 0
An example of the processing procedure of the slave with the INTIICAn interrupt is explained below (processing is
performed assuming that no extension code is used). The INTIICAn interrupt checks the status, and the following
operations are performed.
Remark <1> to <3> above correspond to <1> to <3> in Figure 19-31 Slave Operation Flowchart (2).
INTIICAn generated
Yes <1>
SPDn = 1?
No
Yes <2>
STDn = 1?
No No
COIn = 1?
<3>
Yes
Set ready flag
Remark n = 0
SPTn = 1
↓
ST AD6 to AD0 R/W ACK D7 to D0 ACK D7 to D0 ACK SP
1 2 3 4 5
1: IICSn = 1000×110B
2: IICSn = 1000×000B
3: IICSn = 1000×000B (Sets the WTIMn bit to 1)Note
4: IICSn = 1000××00B (Sets the SPTn bit to 1)Note
5: IICSn = 00000001B
Note To generate a stop condition, set the WTIMn bit to 1 and change the timing for generating the INTIICAn
interrupt request signal.
SPTn = 1
↓
ST AD6 to AD0 R/W ACK D7 to D0 ACK D7 to D0 ACK SP
1 2 3 4
1: IICSn = 1000×110B
2: IICSn = 1000×100B
3: IICSn = 1000××00B (Sets the SPTn bit to 1)
4: IICSn = 00000001B
Remark n = 0
STTn = 1 SPTn = 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: IICSn = 1000×110B
2: IICSn = 1000×000B (Sets the WTIMn bit to 1)Note 1
3: IICSn = 1000××00B (Clears the WTIMn bit to 0Note 2, sets the STTn bit to 1)
4: IICSn = 1000×110B
5: IICSn = 1000×000B (Sets the WTIMn bit to 1)Note 3
6: IICSn = 1000××00B (Sets the SPTn bit to 1)
7: IICSn = 00000001B
Notes 1. To generate a start condition, set the WTIMn bit to 1 and change the timing for generating the
INTIICAn interrupt request signal.
2. Clear the WTIMn bit to 0 to restore the original setting.
3. To generate a stop condition, set the WTIMn bit to 1 and change the timing for generating the
INTIICAn interrupt request signal.
STTn = 1 SPTn = 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: IICSn = 1000×110B
2: IICSn = 1000××00B (Sets the STTn bit to 1)
3: IICSn = 1000×110B
4: IICSn = 1000××00B (Sets the SPTn bit to 1)
5: IICSn = 00000001B
Remark n = 0
SPTn = 1
↓
ST AD6 to AD0 R/W ACK D7 to D0 ACK D7 to D0 ACK SP
1 2 3 4 5
1: IICSn = 1010×110B
2: IICSn = 1010×000B
3: IICSn = 1010×000B (Sets the WTIMn bit to 1)Note
4: IICSn = 1010××00B (Sets the SPTn bit to 1)
5: IICSn = 00000001B
Note To generate a stop condition, set the WTIMn bit to 1 and change the timing for generating the INTIICAn
interrupt request signal.
SPTn = 1
↓
ST AD6 to AD0 R/W ACK D7 to D0 ACK D7 to D0 ACK SP
1 2 3 4
1: IICSn = 1010×110B
2: IICSn = 1010×100B
3: IICSn = 1010××00B (Sets the SPTn bit to 1)
4: IICSn = 00001001B
Remark n = 0
1: IICSn = 0001×110B
2: IICSn = 0001×000B
3: IICSn = 0001×000B
4: IICSn = 00000001B
1: IICSn = 0001×110B
2: IICSn = 0001×100B
3: IICSn = 0001××00B
4: IICSn = 00000001B
Remark n = 0
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: IICSn = 0001×110B
2: IICSn = 0001×000B
3: IICSn = 0001×110B
4: IICSn = 0001×000B
5: IICSn = 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: IICSn = 0001×110B
2: IICSn = 0001××00B
3: IICSn = 0001×110B
4: IICSn = 0001××00B
5: IICSn = 00000001B
Remark n = 0
(i) When WTIMn = 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: IICSn = 0001×110B
2: IICSn = 0001×000B
3: IICSn = 0010×010B
4: IICSn = 0010×000B
5: IICSn = 00000001B
(ii) When WTIMn = 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: IICSn = 0001×110B
2: IICSn = 0001××00B
3: IICSn = 0010×010B
4: IICSn = 0010×110B
5: IICSn = 0010××00B
6: IICSn = 00000001B
Remark n = 0
(i) When WTIMn = 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: IICSn = 0001×110B
2: IICSn = 0001×000B
3: IICSn = 00000×10B
4: IICSn = 00000001B
(ii) When WTIMn = 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: IICSn = 0001×110B
2: IICSn = 0001××00B
3: IICSn = 00000×10B
4: IICSn = 00000001B
Remark n = 0
1: IICSn = 0010×010B
2: IICSn = 0010×000B
3: IICSn = 0010×000B
4: IICSn = 00000001B
1: IICSn = 0010×010B
2: IICSn = 0010×110B
3: IICSn = 0010×100B
4: IICSn = 0010××00B
5: IICSn = 00000001B
Remark n = 0
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: IICSn = 0010×010B
2: IICSn = 0010×000B
3: IICSn = 0001×110B
4: IICSn = 0001×000B
5: IICSn = 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: IICSn = 0010×010B
2: IICSn = 0010×110B
3: IICSn = 0010××00B
4: IICSn = 0001×110B
5: IICSn = 0001××00B
6: IICSn = 00000001B
Remark n = 0
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: IICSn = 0010×010B
2: IICSn = 0010×000B
3: IICSn = 0010×010B
4: IICSn = 0010×000B
5: IICSn = 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: IICSn = 0010×010B
2: IICSn = 0010×110B
3: IICSn = 0010××00B
4: IICSn = 0010×010B
5: IICSn = 0010×110B
6: IICSn = 0010××00B
7: IICSn = 00000001B
Remark n = 0
(i) When WTIMn = 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: IICSn = 0010×010B
2: IICSn = 0010×000B
3: IICSn = 00000×10B
4: IICSn = 00000001B
(ii) When WTIMn = 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: IICSn = 0010×010B
2: IICSn = 0010×110B
3: IICSn = 0010××00B
4: IICSn = 00000×10B
5: IICSn = 00000001B
Remark n = 0
1: IICSn = 00000001B
(a) When arbitration loss occurs during transmission of slave address data
1: IICSn = 0101×110B
2: IICSn = 0001×000B
3: IICSn = 0001×000B
4: IICSn = 00000001B
Remark n = 0
1: IICSn = 0101×110B
2: IICSn = 0001×100B
3: IICSn = 0001××00B
4: IICSn = 00000001B
1: IICSn = 0110×010B
2: IICSn = 0010×000B
3: IICSn = 0010×000B
4: IICSn = 00000001B
Remark n = 0
1: IICSn = 0110×010B
2: IICSn = 0010×110B
3: IICSn = 0010×100B
4: IICSn = 0010××00B
5: IICSn = 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 MSTSn bit each time interrupt request
signal INTIICAn has occurred to check the arbitration result.
(a) When arbitration loss occurs during transmission of slave address data (when WTIMn = 1)
1: IICSn = 01000110B
2: IICSn = 00000001B
Remark n = 0
1: IICSn = 0110×010B
Sets LRELn = 1 by software
2: IICSn = 00000001B
1: IICSn = 10001110B
2: IICSn = 01000000B
3: IICSn = 00000001B
Remark n = 0
1: IICSn = 10001110B
2: IICSn = 01000100B
3: IICSn = 00000001B
(d) When loss occurs due to restart condition during data transfer
1 2 3
1: IICSn = 1000×110B
2: IICSn = 01000110B
3: IICSn = 00000001B
Remark n = 0
1: IICSn = 1000×110B
2: IICSn = 01100010B
Sets LRELn = 1 by software
3: IICSn = 00000001B
(e) When loss occurs due to stop condition during data transfer
1: IICSn = 10000110B
2: IICSn = 01000001B
Remark n = 0
(f) When arbitration loss occurs due to low-level data when attempting to generate a restart condition
STTn = 1
↓
1: IICSn = 1000×110B
2: IICSn = 1000×000B (Sets the WTIMn bit to 1)
3: IICSn = 1000×100B (Clears the WTIMn bit to 0)
4: IICSn = 01000000B
5: IICSn = 00000001B
STTn = 1
↓
1 2 3 4
1: IICSn = 1000×110B
2: IICSn = 1000×100B (Sets the STTn bit to 1)
3: IICSn = 01000100B
4: IICSn = 00000001B
Remark n = 0
(g) When arbitration loss occurs due to a stop condition when attempting to generate a restart condition
STTn = 1
↓
1: IICSn = 1000×110B
2: IICSn = 1000×000B (Sets the WTIMn bit to 1)
3: IICSn = 1000××00B (Sets the STTn bit to 1)
4: IICSn = 01000001B
STTn = 1
↓
1 2 3
1: IICSn = 1000×110B
2: IICSn = 1000××00B (Sets the STTn bit to 1)
3: IICSn = 01000001B
Remark n = 0
(h) When arbitration loss occurs due to low-level data when attempting to generate a stop condition
SPTn = 1
↓
1: IICSn = 1000×110B
2: IICSn = 1000×000B (Sets the WTIMn bit to 1)
3: IICSn = 1000×100B (Clears the WTIMn bit to 0)
4: IICSn = 01000100B
5: IICSn = 00000001B
SPTn = 1
↓
1: IICSn = 1000×110B
2: IICSn = 1000×100B (Sets the SPTn bit to 1)
3: IICSn = 01000100B
4: IICSn = 00000001B
Remark n = 0
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 TRCn bit (bit 3 of the IICA status register n (IICSn)),
which specifies the data transfer direction, and then starts serial communication with the slave device.
Figures 19-32 and 19-33 show timing charts of the data communication.
The IICA shift register n (IICAn)’s shift operation is synchronized with the falling edge of the serial clock (SCLAn). The
transmit data is transferred to the SO latch and is output (MSB first) via the SDAAn pin.
Data input via the SDAAn pin is captured into IICAn at the rising edge of SCLAn.
Remark n = 0
Master side
Note 1
IICAn
<2> <5>
ACKDn
(ACK detection)
WTIMn
(8 or 9 clock wait) H
ACKEn
(ACK control) H
MSTSn
(communication status)
STTn
<1>
(ST trigger)
SPTn
(SP trigger) L
WRELn
(wait cancellation) L
INTIICAn
(interrupt)
TRCn
(transmit/receive)
IICAn
ACKDn
(ACK detection)
STDn
(ST detection)
SPDn
(SP detection)
WTIMn
(8 or 9 clock wait) H
ACKEn
(ACK control) H
MSTSn
(communication status) L
WRELn Note 3
<6>
(wait cancellation)
INTIICAn
(interrupt)
TRCn
(transmit/receive) L
Notes 1. Write data to IICAn, not setting the WRELn 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 SDAAn pin signal and the fall of the SCLAn 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 IICAn or set the WRELn bit.
Remark n = 0
The meanings of <1> to <6> in (1) Start condition ~ address ~ data in Figure 19-32 are explained below.
<1> The start condition trigger is set by the master device (STTn = 1) and a start condition (i.e. SCLAn = 1
changes SDAAn from 1 to 0) is generated once the bus data line goes low (SDAAn). When the start
condition is subsequently detected, the master device enters the master device communication status
(MSTSn = 1). The master device is ready to communicate once the bus clock line goes low (SCLAn = 0)
after the hold time has elapsed.
<2> The master device writes the address + W (transmission) to the IICA shift register n (IICAn) and transmits
the slave address.
<3> In the slave device if the address received matches the address (SVAn 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
(ACKDn = 1) at the rising edge of the 9th clock.
<4> The master device issues an interrupt (INTIICAn: 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 (SCLAn =
0) and issues an interrupt (INTIICAn: address match)Note.
<5> The master device writes the data to transmit to the IICAn register and releases the wait status that it set by
the master device.
<6> If the slave device releases the wait status (WRELn = 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: SDAAn = 1). The slave device also does not issue the INTIICAn
interrupt (address match) and does not set a wait status. The master device, however, issues the INTIICAn
interrupt (end of address transmission) regardless of whether it receives an ACK or NACK.
Remarks 1. <1> to <15> in Figure 19-32 represent the entire procedure for communicating data using the I2C
bus.
Figure 19-32 (1) Start condition ~ address ~ data shows the processing from <1> to <6>, Figure 19-
32 (2) Address ~ data ~ data shows the processing from <3> to <10>, and Figure 19-32 (3) Data ~
data ~ stop condition shows the processing from <7> to <15>.
2. n=0
Master side
Note 1 Note 1
IICAn
<5> <9>
ACKDn
(ACK detection)
WTIMn H
(8 or 9 clock wait)
ACKEn
(ACK control) H
MSTSn
(communication status) H
STTn
(ST trigger) L
SPTn
(SP trigger) L
WRELn
L
(wait cancellation)
INTIICAn
(interrupt)
TRCn
(transmit/receive) H
Bus line
SCLAn (bus)
(clock line)
<4> <8>
SDAAn (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
IICAn
ACKDn
(ACK detection)
STDn
(ST detection)
SPDn
(SP detection) L
WTIMn H
(8 or 9 clock wait)
ACKEn
(ACK control) H
MSTSn
(communication status) L
WRELn <10>
<6> Note 2 Note 2
(wait cancellation)
INTIICAn
(interrupt)
TRCn
(transmit/receive) L
Notes 1. Write data to IICAn, not setting the WRELn 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 IICAn or set the WRELn bit.
Remark n = 0
R01UH0407EJ0210 Rev.2.10 685
Apr 25, 2016
RL78/I1B CHAPTER 19 SERIAL INTERFACE IICA
The meanings of <3> to <10> in (2) Address ~ data ~ data in Figure 19-32 are explained below.
Note
<3> In the slave device if the address received matches the address (SVAn value) of a slave device , that
slave device sends an ACK by hardware to the master device. The ACK is detected by the master device
(ACKDn = 1) at the rising edge of the 9th clock.
<4> The master device issues an interrupt (INTIICAn: 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 (SCLAn =
0) and issues an interrupt (INTIICAn: address match)Note.
<5> The master device writes the data to transmit to the IICA shift register n (IICAn) and releases the wait
status that it set by the master device.
<6> If the slave device releases the wait status (WRELn = 1), the master device starts transferring data to the
slave device.
<7> After data transfer is completed, because of ACKEn = 1, the slave device sends an ACK by hardware to the
master device. The ACK is detected by the master device (ACKDn = 1) at the rising edge of the 9th clock.
<8> The master device and slave device set a wait status (SCLAn = 0) at the falling edge of the 9th clock, and
both the master device and slave device issue an interrupt (INTIICAn: end of transfer).
<9> The master device writes the data to transmit to the IICAn 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 (WRELn = 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: SDAAn = 1). The slave device also does not issue the INTIICAn
interrupt (address match) and does not set a wait status. The master device, however, issues the INTIICAn
interrupt (end of address transmission) regardless of whether it receives an ACK or NACK.
Remarks 1. <1> to <15> in Figure 19-32 represent the entire procedure for communicating data using the I2C
bus.
Figure 19-32 (1) Start condition ~ address ~ data shows the processing from <1> to <6>, Figure 19-
32 (2) Address ~ data ~ data shows the processing from <3> to <10>, and Figure 19-32 (3) Data ~
data ~ stop condition shows the processing from <7> to <15>.
2. n=0
Master side
Note 1
IICAn
<9>
ACKDn
(ACK detection)
WTIMn
H
(8 or 9 clock wait)
ACKEn
(ACK control) H
MSTSn
(communication status)
STTn
(ST trigger) L
SPTn
(SP trigger)
WRELn <14>
(wait cancellation) L
INTIICAn
(interrupt)
TRCn
(transmit/receive)
SCLAn (bus)
(clock line)
<8> <12>
SDAAn (bus)
D150 ACK D167 D166 D165 D164 D163 D162 D161 D160 ACK
(data line)
<7> <11> Note 2
Slave side <15>
IICAn
ACKDn
(ACK detection)
STDn
(ST detection) L
SPDn
(SP detection)
WTIMn H
(8 or 9 clock wait)
ACKEn
(ACK control) H
MSTSn
(communication status) L
WRELn
<10> Note 3 <13> Note 3
(wait cancellation)
INTIICAn
(interrupt)
TRCn
(transmit/receive) L
Notes 1. Write data to IICAn, not setting the WRELn 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 SCLAn 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 IICAn or set the WRELn bit.
Remark n = 0
The meanings of <7> to <15> in (3) Data ~ data ~ stop condition in Figure 19-32 are explained below.
<7> After data transfer is completed, because of ACKEn = 1, the slave device sends an ACK by hardware to the
master device. The ACK is detected by the master device (ACKDn = 1) at the rising edge of the 9th clock.
<8> The master device and slave device set a wait status (SCLAn = 0) at the falling edge of the 9th clock, and
both the master device and slave device issue an interrupt (INTIICAn: end of transfer).
<9> The master device writes the data to transmit to the IICA shift register n (IICAn) 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 (WRELn = 1). The master device
then starts transferring data to the slave device.
<11> When data transfer is complete, the slave device (ACKEn =1) sends an ACK by hardware to the master
device. The ACK is detected by the master device (ACKDn = 1) at the rising edge of the 9th clock.
<12> The master device and slave device set a wait status (SCLAn = 0) at the falling edge of the 9th clock, and
both the master device and slave device issue an interrupt (INTIICAn: end of transfer).
<13> The slave device reads the received data and releases the wait status (WRELn = 1).
<14> By the master device setting a stop condition trigger (SPTn = 1), the bus data line is cleared (SDAAn = 0)
and the bus clock line is set (SCLAn = 1). After the stop condition setup time has elapsed, by setting the
bus data line (SDAAn = 1), the stop condition is then generated (i.e. SCLAn =1 changes SDAAn from 0 to
1).
<15> When a stop condition is generated, the slave device detects the stop condition and issues an interrupt
(INTIICAn: stop condition).
Remarks 1. <1> to <15> in Figure 19-32 represent the entire procedure for communicating data using the I2C
bus.
Figure 19-32 (1) Start condition ~ address ~ data shows the processing from <1> to <6>, Figure 19-
32 (2) Address ~ data ~ data shows the processing from <3> to <10>, and Figure 19-32 (3) Data ~
data ~ stop condition shows the processing from <7> to <15>.
2. n=0
Master side
IICAn
<iii>
ACKDn
(ACK detection)
WTIMn
H
(8 or 9 clock wait)
ACKEn
(ACK control) H
MSTSn
(communication status) H
STTn
(ST trigger) <ii>
SPTn
(SP trigger) L
WRELn
(wait cancellation) L
INTIICAn
(interrupt)
TRCn
(transmit/receive) H
IICAn
ACKDn
(ACK detection)
STDn
(ST detection)
SPDn
(SP detection) L
WTIMn
H
(8 or 9 clock wait)
ACKEn
(ACK control) H
MSTSn
(communication status) L
WRELn Note 2
<i>
(wait cancellation)
INTIICAn
(interrupt)
TRCn
(transmit/receive) L
Notes 1. Make sure that the time between the rise of the SCLAn 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 IICAn or set the WRELn bit.
Remark n = 0
The following describes the operations in Figure 19-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 ACKEn = 1, the slave device sends an ACK by hardware to the
master device. The ACK is detected by the master device (ACKDn = 1) at the rising edge of the 9th clock.
<8> The master device and slave device set a wait status (SCLAn = 0) at the falling edge of the 9th clock, and
both the master device and slave device issue an interrupt (INTIICAn: end of transfer).
<i> The slave device reads the received data and releases the wait status (WRELn = 1).
<ii> The start condition trigger is set again by the master device (STTn = 1) and a start condition (i.e. SCLAn =1
changes SDAAn from 1 to 0) is generated once the bus clock line goes high (SCLAn = 1) and the bus data
line goes low (SDAAn = 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
(SCLAn = 0) after the hold time has elapsed.
<iii> The master device writing the address + R/W (transmission) to the IICA shift register (IICAn) enables the
slave address to be transmitted.
Remark n = 0
Master side
IICAn
<2>
ACKDn
(ACK detection)
WTIMn <5>
(8 or 9 clock wait)
ACKEn
(ACK control) H
MSTSn
(communication status)
STTn <1>
(ST trigger)
SPTn
(SP trigger) L
SCLAn (bus)
(clock line)
Note 2 <4>
SDAAn (bus)
AD6 AD5 AD4 AD3 AD2 AD1 AD0 R ACK D17
(data line)
Slave address <3>
Slave side
Note 3
IICAn
<6>
ACKDn
(ACK detection)
STDn
(ST detection)
SPDn
(SP detection)
WTIMn H
(8 or 9 clock wait)
ACKEn
(ACK control) H
MSTSn
(communication status) L
WRELn
(wait cancellation) L
INTIICAn
(interrupt)
TRCn
(transmit/receive)
Notes 1. For releasing wait state during reception of a master device, write “FFH” to IICAn or set the WRELn bit.
2. Make sure that the time between the fall of the SDAAn pin signal and the fall of the SCLAn 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 IICAn, not setting the WRELn bit, in order to cancel a wait state during transmission by a
slave device.
Remark n = 0
The meanings of <1> to <7> in (1) Start condition ~ address ~ data in Figure 19-33 are explained below.
<1> The start condition trigger is set by the master device (STTn = 1) and a start condition (i.e. SCLAn =1
changes SDAAn from 1 to 0) is generated once the bus data line goes low (SDAAn). When the start
condition is subsequently detected, the master device enters the master device communication status
(MSTSn = 1). The master device is ready to communicate once the bus clock line goes low (SCLAn = 0)
after the hold time has elapsed.
<2> The master device writes the address + R (reception) to the IICA shift register n (IICAn) and transmits the
slave address.
<3> In the slave device if the address received matches the address (SVAn 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
(ACKDn = 1) at the rising edge of the 9th clock.
<4> The master device issues an interrupt (INTIICAn: 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 (SCLAn =
0) and issues an interrupt (INTIICAn: address match)Note.
<5> The timing at which the master device sets the wait status changes to the 8th clock (WTIMn = 0).
<6> The slave device writes the data to transmit to the IICAn register and releases the wait status that it set by
the slave device.
<7> The master device releases the wait status (WRELn = 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: SDAAn = 1). The slave device also does not issue the INTIICAn
interrupt (address match) and does not set a wait status. The master device, however, issues the INTIICAn
interrupt (end of address transmission) regardless of whether it receives an ACK or NACK.
Remarks 1. <1> to <19> in Figure 19-33 represent the entire procedure for communicating data using the I2C
bus.
Figure 19-33 (1) Start condition ~ address ~ data shows the processing from <1> to <7>, Figure 19-
33 (2) Address ~ data ~ data shows the processing from <3> to <12>, and Figure 19-33 (3) Data ~
data ~ stop condition shows the processing from <8> to <19>.
2. n=0
Master side
IICAn
ACKDn
(ACK detection)
WTIMn
(8 or 9 clock wait) <5>
ACKEn
(ACK control) H
MSTSn
(communication status) H
STTn
(ST trigger) L
SPTn
(SP trigger) L
Bus line
SCLAn (bus)
(clock line)
<4> <8> <11>
SDAAn (bus)
R ACK D17 D16 D15 D14 D13 D12 D11 D10 ACK D27
(data line)
<3> <10>
Slave side
IICAn
<6> Note 2 <12> Note 2
ACKDn
(ACK detection)
STDn
(ST detection)
SPDn
(SP detection) L
WTIMn
H
(8 or 9 clock wait)
ACKEn
(ACK control) H
MSTSn
(communication status) L
WRELn
(wait cancellation) L
INTIICAn
(interrupt)
TRCn
(transmit/receive) H
Notes 1. For releasing wait state during reception of a master device, write “FFH” to IICAn or set the WRELn bit.
2. Write data to IICAn, not setting the WRELn bit, in order to cancel a wait state during transmission by a
slave device.
Remark n = 0
The meanings of <3> to <12> in (2) Address ~ data ~ data in Figure 19-33 are explained below.
Note
<3> In the slave device if the address received matches the address (SVAn value) of a slave device , that
slave device sends an ACK by hardware to the master device. The ACK is detected by the master device
(ACKDn = 1) at the rising edge of the 9th clock.
<4> The master device issues an interrupt (INTIICAn: 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 (SCLAn =
0) and issues an interrupt (INTIICAn: address match)Note.
<5> The master device changes the timing of the wait status to the 8th clock (WTIMn = 0).
<6> The slave device writes the data to transmit to the IICA shift register n (IICAn) and releases the wait status
that it set by the slave device.
<7> The master device releases the wait status (WRELn = 1) and starts transferring data from the slave device
to the master device.
<8> The master device sets a wait status (SCLAn = 0) at the falling edge of the 8th clock, and issues an
interrupt (INTIICAn: end of transfer). Because of ACKEn = 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 (WRELn = 1).
<10> The ACK is detected by the slave device (ACKDn = 1) at the rising edge of the 9th clock.
<11> The slave device set a wait status (SCLAn = 0) at the falling edge of the 9th clock, and the slave device
issue an interrupt (INTIICAn: end of transfer).
<12> By the slave device writing the data to transmit to the IICAn 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: SDAAn = 1). The slave device also does not issue the INTIICAn
interrupt (address match) and does not set a wait status. The master device, however, issues the INTIICAn
interrupt (end of address transmission) regardless of whether it receives an ACK or NACK.
Remarks 1. <1> to <19> in Figure 19-33 represent the entire procedure for communicating data using the I2C
bus.
Figure 19-33 (1) Start condition ~ address ~ data shows the processing from <1> to <7>, Figure 19-
33 (2) Address ~ data ~ data shows the processing from <3> to <12>, and Figure 19-33 (3) Data ~
data ~ stop condition shows the processing from <8> to <19>.
2. n=0
Master side
IICAn
ACKDn
(ACK detection)
WTIMn
(8 or 9 clock wait)
<14>
ACKEn
(ACK control)
MSTSn
(communication status)
STTn
(ST trigger) L
SPTn
(SP trigger)
WRELn Note 1 Note 1 <17>
(wait cancellation)
INTIICAn <9> <15>
(interrupt)
TRCn
(transmit/receive) L
SCLAn (bus)
(clock line)
<8> <11> <13> <16>
SDAAn (bus) Note 2
(data line) D150 ACK D167 D166 D165 D164 D163 D162 D161 D160 NACK
<10>
Slave side
<19>
IICAn
<12> Note 3
ACKDn
(ACK detection)
STDn
(ST detection) L
SPDn
(SP detection)
WTIMn
H
(8 or 9 clock wait)
ACKEn
(ACK control) H
MSTSn
(communication L
status) <18>
WRELn Notes 1, 4
(wait cancellation)
INTIICAn
(interrupt)
TRCn
(transmit/receive) Note 4
Notes 1. To cancel a wait state, write “FFH” to IICAn or set the WRELn bit.
2. Make sure that the time between the rise of the SCLAn 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 IICAn, not setting the WRELn 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 WRELn bit, the TRCn bit
will be cleared.
Remark n = 0
R01UH0407EJ0210 Rev.2.10 695
Apr 25, 2016
RL78/I1B CHAPTER 19 SERIAL INTERFACE IICA
The meanings of <8> to <19> in (3) Data ~ data ~ stop condition in Figure 19-33 are explained below.
<8> The master device sets a wait status (SCLAn = 0) at the falling edge of the 8th clock, and issues an
interrupt (INTIICAn: end of transfer). Because of ACKEn = 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 (WRELn = 1).
<10> The ACK is detected by the slave device (ACKDn = 1) at the rising edge of the 9th clock.
<11> The slave device set a wait status (SCLAn = 0) at the falling edge of the 9th clock, and the slave device
issue an interrupt (INTIICAn: 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 (INTIICAn: end of transfer) at the falling edge of the 8th clock, and
sets a wait status (SCLAn = 0). Because ACK control (ACKEn = 1) is performed, the bus data line is at the
low level (SDAAn = 0) at this stage.
<14> The master device sets NACK as the response (ACKEn = 0) and changes the timing at which it sets the
wait status to the 9th clock (WTIMn = 1).
<15> If the master device releases the wait status (WRELn = 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 (SCLAn = 0) at the falling edge of the 9th clock, and
both the master device and slave device issue an interrupt (INTIICAn: end of transfer).
<17> When the master device issues a stop condition (SPTn = 1), the bus data line is cleared (SDAAn = 0) and
the master device releases the wait status. The master device then waits until the bus clock line is set
(SCLAn = 1).
<18> The slave device acknowledges the NACK, halts transmission, and releases the wait status (WRELn = 1)
to end communication. Once the slave device releases the wait status, the bus clock line is set (SCLAn =
1).
<19> Once the master device recognizes that the bus clock line is set (SCLAn = 1) and after the stop condition
setup time has elapsed, the master device sets the bus data line (SDAAn = 1) and issues a stop condition
(i.e. SCLAn =1 changes SDAAn from 0 to 1). The slave device detects the generated stop condition and
slave device issue an interrupt (INTIICAn: stop condition).
Remarks 1. <1> to <19> in Figure 19-33 represent the entire procedure for communicating data using the I2C
bus.
Figure 19-33 (1) Start condition ~ address ~ data shows the processing from <1> to <7>, Figure 19-
33 (2) Address ~ data ~ data shows the processing from <3> to <12>, and Figure 19-33 (3) Data ~
data ~ stop condition shows the processing from <8> to <19>.
2. n=0
CHAPTER 20 IrDA
The IrDA sends and receives IrDA data communication waveforms in cooperation with the Serial Array Unit (SAU)
based on the IrDA (Infrared Data Association) standard 1.0.
Enabling the IrDA function by using the IRE bit in the IRCR register allows encoding and decoding the TxD2 and RxD2
signals of the SAU to the waveforms conforming to the IrDA standard 1.0 (IrTxD and IrRxD pins). Connecting these
waveforms to an infrared transmitter/receiver implements infrared data communication conforming to the IrDA standard
1.0 system.
With the IrDA standard 1.0 system, data transfer can be started at 9600 bps and the transfer rate can be changed
whenever necessary. Since the IrDA cannot change the transfer rate automatically, the transfer rate should be changed
through software.
When the high-speed on-chip oscillator (fIH =24/12/6/3 MHz) is selected, the following baud rates can be selected:
Figures 20-1 is a block diagram showing cooperation between IrDA and SAU.
Figure 20-1. Block Diagram Showing Cooperation Between IrDA and SAU
20.2 Registers
Item Configuration
Control registers Peripheral enable register 0 (PER0)
IrDA control register (IRCR)
Cautions 1. When setting the IrDA, be sure to set the IRDAEN bit to 1 first.
If IRDAEN = 0, writing to a control register of the IrDA is ignored, and all read values
are default values.
2. Be sure to set bit 1 to “0”.
20.3 Operation
<1> Configure the port register and port mode register to set the status of the IrTxD pin after stopping IrDA
communication.
Remark The output status may change because the IrTxD pin changes to normal serial interface UART data
output when IrDA is reset in step 3.
<2> Set STm register (SAU related register) bits STm0 and STm1 to 1 (stop SAU channels 0 and 1).
<3> Set PER0 register bit IRDAEN to 0 and reset IrDA.
Do not set STm register bits STm0 and STm1 to 1 or IrDA bit IRE to 0 with any procedure other than the above.
<1> Set SAU STm register bit STm1 to 1 (stop SAU CH1 operation)
<2> Set SAU SSm register bit SSm1 to 1 (start SAU CH1 operation)
Also refer to the chapter on SAU for information on SAU framing error processing.
20.3.2 Transmission
In transmission, the signals output from the SAU (UART frames) are converted to the IR frame data through the IrDA
(see Figure 20-4). When IRTXINV bit is 0 and serial data is 0, high-level pulses with the width of 3/16 the bit rate (1-bit
width period) are output (initial setting). The high-level pulse width can be changed by using the IRCKS2 to IRCKS0 bits.
The standard prescribes that the minimum high-level pulse width should be 1.41 μs and the maximum high-level pulse
width be (3/16 + 2.5%) bit rate or (3/16 bit rate) + 1.08 μs.
When the CPU/peripheral hardware clock (fCLK) is 20 MHz, the high-level pulse width can be 1.41 μs to 1.6 μs.
When serial data is 1, no pulses are output.
UART frame
Data
Start bit Stop bit
0 1 0 1 0 0 1 1 0 1
Transmission Reception
IR frame
Data
Start bit Stop bit
0 1 0 1 0 0 1 1 0 1
20.3.3 Reception
In reception, the IR frame data is converted to the UART frame data through the IrDA and is input to the SAU.
Low-level data is output when the IRRXINV bit is 0 and a high-level pulse is detected, and high-level data is output
when no pulse is detected for 1-bit period. Note that a pulse shorter than 1.41 μs, which is the minimum pulse width, is
identified as a low signal.
Note 1 Note 1 Note 1
1 IRCKS2 to IRCKS0 001 001 001
Note 1 Note 1 Note 1
High-level pulse width [μs] 2.00 2.00 2.00
Note 1
2 IRCKS2 to IRCKS0 010 010 010 010 010
Note 1
High-level pulse width [μs] 2.00 2.00 2.00 2.00 2.00
Note 1
3 IRCKS2 to IRCKS0 011 011 011 011 011
Note 1
High-level pulse width [μs] 2.67 2.67 2.67 2.67 2.67
Note 2
4 IRCKS2 to IRCKS0 011 011 011 011 011 000
High-level pulse width [μs] 2.00 2.00 2.00 2.00 2.00 1.50
Note 2
6 IRCKS2 to IRCKS0 100 100 100 100 100 000
High-level pulse width [μs] 2.67 2.67 2.67 2.67 2.67 1.50
Note 2
8 IRCKS2 to IRCKS0 100 100 100 100 100 000
High-level pulse width [μs] 2.00 2.00 2.00 2.00 2.00 1.50
Note 2
12 IRCKS2 to IRCKS0 101 101 101 101 101 000
High-level pulse width [μs] 2.67 2.67 2.67 2.67 2.67 1.50
Note 2
16 IRCKS2 to IRCKS0 101 101 101 101 101 000
High-level pulse width [μs] 2.00 2.00 2.00 2.00 2.00 1.50
Note 2
24 IRCKS2 to IRCKS0 110 110 110 110 110 000
High-level pulse width [μs] 2.67 2.67 2.67 2.67 2.67 1.50
(1) The IrDA function cannot be used to transition to SNOOZE via IrRxD reception.
(2) The input of IrDA operating clock can be disabled/enabled with the peripheral enable register. Initially, register
access is disabled because clock input is disabled. Enable IrDA operating clock input with the peripheral enable
register before setting the register.
(3) During HALT mode, the IrDA function continues to run.
(4) The use of SAU initialization function (SS bit= 1) is prohibited during IrDA communication.
(5) The IRCR register bits IRRXINV, IRTXINV, and IRCKS[2:0] can be set only when IRE bit is 0.
The number of LCD display function pins of the RL78/I1B differs depending on the product. The following table shows
the number of pins of each product.
Item RL78/I1B
Multiplexed I/O port bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0
37 36 35 34 33 32
P1 SEG SEG SEG SEG SEG SEG SEG SEG SEG SEG SEG SEG SEG SEG SEG SEG
11 10 9 8 7 6 5 4 11 10 9 8 7 6 5 4
P3 SEG SEG SEG SEG SEG SEG SEG SEG SEG SEG SEG SEG
27 26 25 24 31 30 29 28 27 26 25 24
39 38 37 36 35 34 33 32
P7 SEG SEG SEG SEG SEG SEG SEG SEG SEG SEG SEG SEG SEG SEG SEG SEG
23 22 21 20 19 18 17 16 23 22 21 20 19 18 17 16
P8 SEG SEG SEG SEG SEG SEG SEG SEG SEG SEG
14 13 12
15 14 13 12 41 40 15
Alternate relationship
between COM signal
output pins and I/O
pots
Note ( ) indicates the number of signal output pins when 8 com is used.
The functions of the LCD controller/driver in the RL78/I1B microcontrollers are as follows.
Table 21-2 lists the maximum number of pixels that can be displayed in each display mode.
Drive Waveform for LCD Driver Voltage Bias Mode Number of Maximum Number of Pixels
LCD Driver Generator Time Slices
1/3 3
Drive Waveform for LCD Driver Voltage Bias Mode Number of Maximum Number of Pixels
LCD Driver Generator Time Slices
1/3 3
Item Configuration
R01UH0407EJ0210 Rev.2.10
WUTMMCK0 LCDC5 LCDC4 LCDC3 LCDC2 LCDC1 LCDC0 LCTY2 LCTY1 LCTY0 LBAS1 LBAS0 LWAVE VLCD4 VLCD3 VLCD2 VLCD1 VLCD0 00H ........... 03H 04H ........... 29H
76543210 76543210 76543210 76543210
6 5
6
fSUB
fLCD
LCD LCDCL
Selector
fIL clock
fMAIN selector
........... ...........
Timing
controller
Clock generator 76543210 76543210 76543210 ........... 76543210
for Clock generator VLCON
INTRTC Selector Selector Selector Selector
capacitor split for voltage boost
LCDON LCDON LCDON LCDON
........... ...........
Capacitor split Voltage boost
circuit circuit .........
Segment voltage ........... .........
...........
.........
........... .........
...........
controller
. . . . . . . .
. . . . . . . . . .
CAPH CAPL VL1 VL2 VL3 VL4 COM0 . . . . COM3 COM4/ . . . . COM7/ SEG4 SEG41
SEG0 SEG3
2 2
708
RL78/I1B CHAPTER 21 LCD CONTROLLER/DRIVER
The following ten registers are used to control the LCD controller/driver.
1 1 Setting prohibited
0 Waveform A
1 Waveform B
0 0 0 Static
0 0 1 2-time slice
0 1 0 3-time slice
0 1 1 4-time slice
1 0 0 6-time slice
1 0 1 8-time slice
1 1 Setting prohibited
Cautions 1. Do not rewrite the LCDM0 value while the SCOC bit of the LCDM1 register = 1.
2. When “Static” is selected (LDTY2 to LDTY0 bits = 000B), be sure to set the LBAS1 and LBAS0
bits to the default value (00B). Otherwise, the operation will not be guaranteed.
3. Only the combinations of display waveform, number of time slices, and bias method shown in
Table 21-4 are supported.
Combinations of settings not shown in Table 21-4 are prohibited.
Table 21-4. Combinations of Display Waveform, Time Slices, Bias Method, and Frame Frequency
Display Number Bias LWAVE LDTY2 LDTY1 LDTY0 LBAS1 LBAS0 External Internal Capacitor
Waveform of Time Mode Resistance Voltage Split
Slices Division Boosting
Ο Ο
Waveform A 8 1/4 0 1 0 1 1 0
(24 to 128 Hz) (24 to 64 Hz)
Ο
Waveform A 6 1/4 0 1 0 0 1 0
(32 to 86 Hz)
Ο Ο Ο
Waveform A 4 1/3 0 0 1 1 0 1
(24 to 128 Hz) (24 to 128 Hz) (24 to 128 Hz)
Ο Ο Ο
Waveform A 3 1/3 0 0 1 0 0 1
(32 to 128 Hz) (32 to 128 Hz) (32 to 128 Hz)
Ο
Waveform A 3 1/2 0 0 1 0 0 0
(32 to 128 Hz)
Ο
Waveform A 2 1/2 0 0 0 1 0 0
(24 to 128 Hz)
Ο
Waveform A Static 0 0 0 0 0 0
(24 to 128 Hz)
Ο Ο
Waveform B 8 1/4 1 1 0 1 1 0
(24 to 128 Hz) (24 to 64 Hz)
Ο Ο Ο
Waveform B 4 1/3 1 0 1 1 0 1
(24 to 128 Hz) (24 to 128 Hz) (24 to 128 Hz)
Remark Ο: Supported
: Not supported
0 1
1 1 Display on
Note 1
VLCON Voltage boost circuit or capacitor split circuit operation enable/disable
Note 2
BLON LCDSEL Display data area control
0 0 Displaying an A-pattern area data (lower four bits of LCD display data register)
0 1 Displaying a B-pattern area data (higher four bits of LCD display data register)
1 0 Alternately displaying A-pattern and B-pattern area data (blinking display corresponding
to the constant-period interrupt (INTRTC) timing of real-time clock 2 (RTC2))
1 1
Note
LCDVLM Control of default value of voltage boosting pin
Note A function to set the initial state of the VLx pin and efficiently boost voltage when using a voltage boosting
circuit. Set LCDVLM bit = 0 when VDD at the start of voltage boosting is 2.7 V or more. Set LCDVLM bit = 1
when VDD is 4.2 V or less.
However, when 2.7 V VDD 4.2 V, operation is possible with LCDVLM = 0 or LCDVLM = 1.
Cautions 1. When the voltage boost circuit is used, set SCOC = 0 and VLCON = 0, and MDSET1, MDSET0
= 00 in order to reduce power consumption when the LCD is not used. When MDSET1,
MDSET0 = 01, power is consumed by the internal reference voltage generator.
2. When the external resistance division method has been set (MDSET1 and MDSET0 of LCDM0
= 00B) or capacitor split method has been set (MDSET1 and MDSET0 = 10B), set the LCDVLM
bit to 0.
3. Do not rewrite the VLCON and LCDVLM bits while SCOC = 1.
4. Set the BLON and LCDSEL bits to 0 when 8 has been selected as the number of time slices
for the display mode.
5. To use the internal voltage boosting method, specify the reference voltage by using the
VLCD register (select the internal boosting method (by setting the MDSET1 and MDSET0 bits
of the LCDM0 register to 01B) if the default reference voltage is used), wait for the reference
voltage setup time (5 ms (min.)), and then set the VLCON bit to 1.
Figure 21-4. Format of Subsystem clock supply mode Control Register (OSMC)
RTCLPC Setting in STOP mode or HALT mode while subsystem clock is selected as CPU clock
WUTMMCK0 Selection of operation Selection of clock output from Operation of subsystem clock
clock for real-time clock 2, PCLBUZn pin of clock output/buzzer frequency measurement circuit.
12-bit interval timer, and output controller and selection of
LCD controller/driver. operation clock for 8-bit interval timer.
Cautions 1. Be sure to select the subsystem clock (WUTMMCK0 bit = 0) if the subsystem clock is
oscillating.
2. When WUTMMCK0 is set to “1”, the low-speed on-chip oscillator clock oscillates.
3. The subsystem clock and low-speed on-chip oscillator clock can only be switched by
using the WUTMMCK0 bit if real-time clock 2, 12-bit interval timer, and LCD
controller/driver are all stopped.
<R>
Cautions 1. The VLCD setting is valid only when the voltage boost circuit is operating.
2. Be sure to set bits 5 to 7 to “0”.
3. Be sure to change the VLCD value after having stopped the operation of the voltage boost
circuit (VLCON = 0).
4. To use the internal voltage boosting method, specify the reference voltage by using the
VLCD register (select the internal boosting method (by setting the MDSET1 and MDSET0
bits of the LCDM0 register to 01B) if the default reference voltage is used), wait for the
reference voltage setup time (5 ms (min.)), and then set VLCON to 1.
5. To use the external resistance division method or capacitor split method, use the VLCD
register with its initial value (04H).
0 Input invalid
1 Input valid
0 Input invalid
1 Input valid
(1) Operation of ports that alternately function as VL3, CAPL, and CAPH pins
The functions of the VL3/P125, CAPL/P126, and CAPH/P127 pins can be selected by using the LCD input switch
control register (ISCLCD), LCD mode register 0 (LCDM0), and port mode register 12 (PM12).
VL3/P125
Bias Setting ISCVL3 Bit of PM125 Bit of Pin Function Initial Status
(LBAS1 and LBAS0 Bits of ISCLCD Register PM12 Register
LCDM0 Register )
Reset status
Reset release
ISCVL3 = 1
Caution Be sure to set the VL3 function mode before segment output starts (while SCOC bit of LCD
mode register 1 (LCDM1) is 0).
LCD Drive Voltage Generator ISCCAP Bit of PM126 and Pin Function Initial Status
(MDSET1 and MDSET0 Bits of ISCLCD Register PM127 Bits of
LCDM0 Register) PM12 Register
The following shows the CAPL/P126 and CAPH/P127 pin function status transitions.
Reset status
Reset release
MDSET1, MDSET0 = 01 or 10
Digital input
invailid mode
MDSET1, MDSET0 = 00
ISCCAP = 1
Caution Be sure to set the CAPL/CAPH function mode before segment output starts (while SCOC bit
of LCD mode register 1 (LCDM1) is 0).
Remark The correspondence between the segment output pins (SEGxx) and the PFSEG register (PFSEGxx bits)
and the existence of SEGxx pins in each product are shown in Table 21-7 Segment Output Pins in Each
Product and Correspondence with PFSEG Register (PFSEG Bits).
PFSEGxx Port (other than segment output)/segment outputs specification of Pmn pins
(xx = 04 to (mn = 02 to 07, 10 to 17, 30 to 37, 50 to 57, 70 to 77, 80 to 85)
41)
Caution To use the Pmn pins as segment output pins (PFSEGxx = 1), be sure to set the PUmn bit of the
PUm register, POMmn bit of the POMm register, and PIMmn bit of the PIMm register to “0”.
Table 21-7. Segment Output Pins in Each Product and Correspondence with PFSEG Register (PFSEG Bits)
Bit name of PFSEG register Corresponding SEGxx pins Alternate port 100-pin 80-pin
PFSEG04 SEG4 P10
PFSEG05 SEG5 P11
PFSEG06 SEG6 P12
PFSEG07 SEG7 P13
PFSEG08 SEG8 P14
PFSEG09 SEG9 P15
PFSEG10 SEG10 P16
PFSEG11 SEG11 P17
PFSEG12 SEG12 P80
PFSEG13 SEG13 P81
PFSEG14 SEG14 P82
PFSEG15 SEG15 P83
PFSEG16 SEG16 P70
PFSEG17 SEG17 P71
PFSEG18 SEG18 P72
PFSEG19 SEG19 P73
PFSEG20 SEG20 P74
PFSEG21 SEG21 P75
PFSEG22 SEG22 P76
PFSEG23 SEG23 P77
PFSEG24 SEG24 P30
PFSEG25 SEG25 P31
PFSEG26 SEG26 P32
PFSEG27 SEG27 P33
PFSEG28 SEG28 P34
PFSEG29 SEG29 P35
PFSEG30 SEG30 P36
PFSEG31 SEG31 P37
PFSEG32 SEG32 P50
P02
PFSEG33 SEG33 P51
P03
PFSEG34 SEG34 P52
P04
PFSEG35 SEG35 P53
P05
PFSEG36 SEG36 P54
P06
PFSEG37 SEG37 P55
P07
PFSEG38 SEG38 P56
PFSEG39 SEG39 P57
PFSEG40 SEG40 P84
PFSEG41 SEG41 P85
P02 to P07, P10 to P17, P30 to P37, P50 to P57, P70 to P77, P80 to P85
(ports that do not serve as analog input pins (ANIxx))
Reset status
Reset release
PFSEGxx = 0
Caution Be sure to set the segment output mode before segment output starts (while SCOC bit of LCD
mode register 1 (LCDM1) is 0).
21.3.8 Port mode registers 0, 1, 3, 5, 7, 8 (PM0, PM1, PM3, PM5, PM7, PM8)
These registers specify input/output of ports 0, 1, 5, 7, and 8 in 1-bit units.
When using the ports (such as P10/SEG4) to be shared with the segment output pin for segment output, set the port
mode register (PMxx) bit and port register (Pxx) bit corresponding to each port to 0.
These registers are set by using a 1-bit or 8-bit memory manipulation instruction.
Reset signal generation sets these registers to FFH.
Figure 21-12. Format of Port Mode Registers 0, 1, 3, 5, 7, 8 (PM0, PM1, PM3, PM5, PM7, PM8)
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
PM3 1 1 PM35 PM34 PM33 PM32 PM31 PM30 FFF23H FFH R/W
PM5 PM57 PM56 PM55 PM54 PM53 PM52 PM51 PM50 FFF25H FFH R/W
PM7 PM77 PM76 PM75 PM74 PM73 PM72 PM71 PM70 FFF27H FFH R/W
Remark The figure shown above presents the format of port mode registers 0, 1, 3, 5, 7, and 8. The format of
the port mode register of other products, see Table 4-3 PMxx, Pxx, PUxx, PIMxx, POMxx registers
and the bits mounted on each product.
The LCD display data registers are mapped as shown in Table 21-9. The contents displayed on the LCD can be
changed by changing the contents of the LCD display data registers.
Table 21-9. Relationship Between LCD Display Data Register Contents and Segment/Common Outputs (1/4)
(a) Other than 6-time slice and 8-time slice (static, 2-time slice, 3-time slice, and 4-time slice) (1/2)
Register Address bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 100-pin 80-pin
Name
COM7 COM6 COM5 COM4 COM3 COM2 COM1 COM0
Table 21-9. Relationship Between LCD Display Data Register Contents and Segment/Common Outputs (2/4)
(a) Other than 6-time slice and 8-time slice (static, 2-time slice, 3-time slice, and 4-time slice) (2/2)
Register Address bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 100-pin 80-pin
Name
COM7 COM6 COM5 COM4 COM3 COM2 COM1 COM0
Table 21-9. Relationship Between LCD Display Data Register Contents and Segment/Common Outputs (3/4)
Table 21-9. Relationship Between LCD Display Data Register Contents and Segment/Common Outputs (4/4)
Note The COM4 to COM7 pins and SEG0 to SEG3 pins are used alternatively.
To use the LCD display data register when the number of time slices is static, two, three, or four, the lower four bits and
higher four bits of each address of the LCD display data register become an A-pattern area and a B-pattern area,
respectively.
The correspondences between A-pattern area data and COM signals are as follows: bit 0 COM0, bit 1 COM1, bit
2 COM2, and bit 3 COM3.
The correspondences between B-pattern area data and COM signals are as follows: bit 4 COM0, bit 5 COM1, bit
6 COM2, and bit 7 COM3.
A-pattern area data will be displayed on the LCD panel when BLON = LCDSEL = 0 has been selected, and B-pattern
area data will be displayed on the LCD panel when BLON = 0 and LCDSEL = 1 have been selected.
With RL78/I1B, to use the LCD display data registers when the number of time slices is static, two, three, or four, the
LCD display data register can be selected from the following three types, according to the BLON and LCDSEL bit settings.
• Displaying an A-pattern area data (lower four bits of LCD display data register)
• Displaying a B-pattern area data (higher four bits of LCD display data register)
• Alternately displaying A-pattern and B-pattern area data (blinking display corresponding to the constant-period
interrupt timing of real-time clock 2 (RTC2))
Caution When the number of time slices is six or eight, LCD display data registers (A-pattern, B-pattern, or
blinking display) cannot be selected.
Figure 21-13. Example of Setting LCD Display Registers When Pattern Is Changed
Register Address Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0
Name COM COM COM COM COM COM COM COM
3 2 1 0 3 2 1 0
… … …
SEG5 F0405H
SEG4 F0404H Set these bits to 1 for blinking display
SEG3 F0403H
SEG2 F0402H
SEG1 F0401H
SEG0 F0400H
21.5.2 Blinking display (Alternately displaying A-pattern and B-pattern area data)
When BLON = 1 has been set, A-pattern and B-pattern area data will be alternately displayed, according to the
constant-period interrupt (INTRTC) timing of real-time clock 2 (RTC2). See CHAPTER 8 REAL-TIME CLOCK 2 about
the setting of the RTC constant-period interrupt (INTRTC, 0.5 s setting only) timing.
For blinking display of the LCD, set inverted values to the B-pattern area bits corresponding to the A-pattern area bits.
(Example: Set 1 to bit 0 of 00H, and set 0 to bit 4 of F0400H for blinking display.) When not setting blinking display of the
LCD, set the same values. (Example: Set 1 to bit 2 of F0402H, and set 1 to bit 6 of F0402H for lighting display.)
See 21.4 LCD Display Data Registers about the display area.
Next, the timing operation of display switching is shown.
BLON = 1,
BLON, LCDSEL bits LCDSEL = 0 or 1 BLON = 0, LCDSEL = 0
Cautions 1. To operate the LCD controller/driver, be sure to follow procedures (1) to (3). Unless these
procedures are observed, the operation will not be guaranteed.
2. The steps shown in the flowcharts in (1) to (3) are performed by the CPU.
START
Set the LCDVLM bit of the LCDM1 register according to the VDD voltage. For details, see Figure 21-3 Format of
LCD Mode Register 1 (LCDM1).
Select the display waveform (select waveform A or B), number of time slices,
and bias method by using the LWAVE, LDTY2 to LDTY0, LBAS1,
and LBAS0 bits of the LCDM0 register.
No
No. of time slices 4 or lower ?
Yes
Select the reference voltage for voltage boosting by using the VLCD register.
No
Setup time of reference voltage has elapsed?
Yes
No
Voltage boosting wait time has elapsed?
Yes
Cautions 1. Wait until the setup time has elapsed even if not changing the setting of the VLCD register.
2. For the specifications of the reference voltage setup time and voltage boosting wait time, see
CHAPTER 37 ELECTRICAL SPECIFICATIONS.
START
Select the display waveform (select waveform A or B), number of time slices,
and bias method by using the LWAVE, LDTY2 to LDTY0, LBAS1,
and LBAS0 bits of the LCDM0 register.
No
No. of time slices 4 or lower ?
Yes
No
Voltage boosting wait time has elapsed?
Yes
Caution For the specifications of the voltage boosting wait time, see CHAPTER 37 ELECTRICAL
SPECIFICATIONS.
To stop the operation of the LCD while it is displaying waveforms, follow the steps shown in the flowchart below.
The LCD stops operating when the LCDON bit of LCDM1 register and SCOC bit of the LCDM1 register are set to “0”.
Yes
END
Caution Stopping the voltage boost/capacitor split circuits is prohibited while the display is on (SCOC and
LCDON bits of LCDM1 register = 11B). Otherwise, the operation will not be guaranteed. Be sure
to turn off display (SCOC and LCDON bits of LCDM1 register = 00B) before stopping the voltage
boost/capacitor split circuits (VLCON bit of LCDM1 register = 0).
21.8 Supplying LCD Drive Voltages VL1, VL2, VL3, and VL4
The external resistance division method, internal voltage boosting method, and capacitor split method can be selected
as LCD drive power generating method.
Figure 21-20. Examples of LCD Drive Power Connections (External Resistance Division Method) (1/2)
VDD VDD
VL4 VL4
VL4 VL4
R
VL3 VL3/P125Note 2 VL3/
VL3
P125Note
VL2 VL2Note 1 V2
VL2
R
VL1 VL1Note 1
VL1 VL1
VSS
VSS
VSS
VSS
VL4 = VDD
VL4 = VDD
Figure 21-20. Examples of LCD Drive Power Connections (External Resistance Division Method) (2/2)
VDD VDD
VL4 VL4
VL4 VL4
R VL3/ R
VL3/ VL3 P125
P125
P125Note
R
VL2 VL2
VL2 VL2
R R
VL1 VL1
VL1 VL1
R R
VSS VSS
VSS VSS
Caution The reference resistance “R” value for external resistance division is 10 kΩ to 1 MΩ. Also, to
stabilize the potential of the VL1 to VL4 pins, connect a capacitor between each of pins VL1 to VL4
and the GND pin as needed. The reference capacitance is about 0.47 μF but it depends on the
LCD panel used, the number of segment pins, the number of common pins, the frame frequency,
and the operating environment. Thoroughly evaluate these values in accordance with your
system and adjust and determine the capacitance.
VL3 3 VL1
Figure 21-21. Examples of LCD Drive Power Connections (Internal Voltage Boosting Method)
VDD VDD
4 VL1 VL4
3 VL1 VL4
3 VL1 VL3/P125
VL3/P125Note
VL1
CAPH C2 C3 C4 C5
C2 C3 C4
CAPH C1
CAPL
C1
CAPL
VL4 VDD
VL3
Figure 21-22. Examples of LCD Drive Power Connections (Capacitor Split Method)
VDD
VL3/P125 Note 2
CAPH
C1
C2 C3
CAPL
Notes 1. When switching to internal voltage boosting method, connect capacitor C4 as shown in Figure 21-21. Examples
of LCD Drive Power Connections (Internal Voltage Boosting Method)
2. VL3 can be used as port (P125).
COM Signal COM0 COM1 COM2 COM3 COM4 COM5 COM6 COM7
Number of
Time Slices
Static display mode Note Note Note Note
Eight-time-slice mode
Check, with the information given above, what combination of front-surface electrodes (corresponding to the
segment signals) and rear-surface electrodes (corresponding to the common signals) forms display patterns in the
LCD display data register, and write the bit data that corresponds to the desired display pattern on a one-to-one
basis.
Remark The mounted segment output pins vary depending on the product.
• 80-pin products: SEG0 to SEG27, SEG32 to SEG37
• 100-pin products: SEG0 to SEG41
Figure 21-23 shows the common signal waveforms, and Figure 21-24 shows the voltages and phases of the common
and segment signals.
VL4
COMn
VLCD
(Static display)
VSS
TF = T
VL4
COMn
VL2 VLCD
(Two-time-slice mode)
VSS
TF = 2 T
VL4
COMn
VL2 VLCD
(Three-time-slice mode)
VSS
TF = 3 T
VL4
COMn VL3
VLCD
VL2
(Three-time-slice mode)
VSS
TF = 3 T
VL4
COMn VL3
VLCD
VL2
(Four-time-slice mode)
VSS
TF = 4 T
< Example of calculation of LCD frame frequency (When four-time-slice mode is used) >
7
LCD clock: 32768/2 = 256 Hz (When setting to LCDC0 = 06H)
LCD frame frequency: 64 Hz
VL4
VL3
COMn VL2 VLCD
VL1
(Eight-time-slice mode)
VSS
TF = 8 T
< Example of calculation of LCD frame frequency (When eight-time-slice mode is used) >
7
LCD clock: 32768/2 = 256 Hz (When setting to LCDC0 = 06H)
LCD frame frequency: 32 Hz
Figure 21-24. Voltages and Phases of Common and Segment Signals (1/3)
Select Deselect
VL4
VSS
VL4
VSS
T T
Select Deselect
VL4
VSS
VL4
VSS
T T
Figure 21-24. Voltages and Phases of Common and Segment Signals (2/3)
Select Deselect
VL4
VL2
Common signal VLCD
VL1
VSS
VL4
VL2
Segment signal VLCD
VL1
VSS
T T
Select Deselect
VL4
VL2
Common signal VLCD
VL1
VSS
VL4
VL2
Segment signal VLCD
VL1
VSS
Figure 21-24. Voltages and Phases of Common and Segment Signals (3/3)
Select Deselect
VL4
VL3
Common signal VL2 VLCD
VL1
VSS
VL4
VL3
Segment signal VL2 VLCD
VL1
VSS
T T
Select Deselect
VL4
VL3
Common signal VL2 VLCD
VL1
VSS
VL4
VL3
Segment signal VL2 VLCD
VL1
VSS
Common
According to Table 21-14, it is determined that the bit-0 pattern of the display data register locations (F0408H to
F040FH) must be 10110111.
Figure 21-27 shows the LCD drive waveforms of SEG11 and SEG12, and COM0. When the select voltage is applied to
SEG11 at the timing of COM0, an alternate rectangle waveform, +VLCD/VLCD, is generated to turn on the corresponding
LCD segment.
COM1 to COM3 are supplied with the same waveform as for COM0. So, COM0 to COM3 may be connected together
to increase the driving capacity.
SEG8n+3
SEG8n+4 SEG8n+2
SEG8n+5 COM0
SEG8n+6 SEG8n+1
SEG8n
SEG8n+7
COM 3
Timing Strobe
COM 2 Can be connected
COM 1 together
COM 0
Bit 3
Bit 2
Bit 1
Bit 0
SEG 0
0 0 0 0 0 1 1 0 1 1 1 0 1 1 0 1 1 0 1 0 1 1 1 0
F0400H
× × × × × × × × × × × × × × × × × × × × × × × ×
× × × × × × × × × × × × × × × × × × × × × × × ×
× × × × × × × × × × × × × × × × × × × × × × × ×
SEG 1
1
SEG 2
2
SEG 3
3
SEG 4
4
SEG 5
5
SEG 6
6
SEG 7
7
SEG 8
8
Data memory address
SEG 9
9
SEG 10
A
LCD panel
SEG 11
B
SEG 12
C
SEG 13
D
SEG 14
E
SEG 15
F
SEG 16
F0410H
SEG 17
1
SEG 18
2
SEG 19
3
SEG 20
4
SEG 21
5
SEG 22
6
SEG 23
7
Figure 21-27. Static LCD Drive Waveform Examples for SEG11, SEG12, and COM0
1 frame 1 frame
VL4
COM0
VSS
VL4
COM1
VSS
VL4
COM2
VSS
VL4
COM3
VSS
VL4
SEG11
VSS
VL4
SEG12
VSS
COM0-SEG11
Lights Lights Lights Lights Lights Lights Lights Lights
+VL4
COM0-SEG11 0
VL4
COM0-SEG12
Extinguishes Extinguishes Extinguishes Extinguishes Extinguishes Extinguishes Extinguishes Extinguishes
+VL4
COM0-SEG12 0
VL4
Common
According to Table 21-15, it is determined that the display data register location (F040FH) that corresponds to SEG15
must contain xx10.
Figure 21-30 shows examples of LCD drive waveforms between the SEG15 signal and each common signal. When the
select voltage is applied to SEG15 at the timing of COM1, an alternate rectangle waveform, +VLCD/VLCD, is generated to
turn on the corresponding LCD segment.
SEG4n+3 SEG4n
COM1
Timing strobe
COM 3
Open
COM 2
Open
COM 1
COM 0
Bit 3
Bit 2
Bit 1
Bit 0
SEG 0
F0400H
× × × × × × × × × × × × × × × × × × × × × × × ×
× × × × × × × × × × × × × × × × × × × × × × × ×
0 0 0 0 1 1 1 0 1 1 1 0 0 0 1 0 1 1 1 1 1 1 1 0
0 0 1 1 1 0 1 0 0 0 1 1 0 1 1 1 0 1 0 1 1 1 0 1
SEG 1
1
SEG 2
2
SEG 3
3
SEG 4
4
SEG 5
5
SEG 6
6
SEG 7
7
Data memory address
SEG 8
8
SEG 9
9
SEG 10
LCD panel
A
SEG 11
B
SEG 12
C
SEG 13
D
SEG 14
E
SEG 15
F
SEG 16
F0410H
SEG 17
1
SEG 18
2
SEG 19
3
SEG 20
4
SEG 21
5
SEG 22
6
SEG 23
7
: Can always be used to store any data because the two-time-slice mode is being used.
Figure 21-30. Two-Time-Slice LCD Drive Waveform Examples Between SEG15 and Each Common Signals
(1/2 Bias Method)
1 frame 1 frame
VL4
COM0 VL2 = VL1
VSS
VL4
COM1 VL2 = VL1
VSS
VL4
SEG15 VL2 = VL1
VSS
COM0-SEG15
Extinguishes Extinguishes Extinguishes Extinguishes Extinguishes Extinguishes Extinguishes Extinguishes
+VL4
+VL2 = +VL1
COM0-SEG15 0
VL2 = VL1
VL4
COM1-SEG15
Extinguishes Lights Extinguishes Lights Extinguishes Lights Extinguishes Lights
+VL4
+VL2 = +VL1
COM1-SEG15 0
VL2 = VL1
VL4
Common
According to Table 21-16, it is determined that the display data register location (F0406H) that corresponds to SEG6
must contain x110.
Figures 21-33 and 21-34 show examples of LCD drive waveforms between the SEG6 signal and each common signal
in the 1/2 and 1/3 bias methods, respectively. When the select voltage is applied to SEG6 at the timing of COM1 or COM2,
an alternate rectangle waveform, +VLCD/VLCD, is generated to turn on the corresponding LCD segment.
SEG3n+1 COM0
SEG3n+2 SEG3n
COM1
COM2
COM 3
Timing strobe
Open
COM 2
COM 1
COM 0
Bit 1
Bit 3
Bit 0
Bit 2
SEG 0
F0400H
x’ 0 0 x’ 1 0 x’ 1 0 x’ 0 0 x’ 1 0 x’ 1 1 x’ 0 0 x’ 1 0
0 0 1 1 1 0 0 1 1 0 1 1 0 1 1 1 1 1 0 0 1 1 1 1
0 0 1 0 1 1 0 1 1 1 0 1 1 1 0 1 1 0 1 1 1 1 1 1
× × × × × × × × × × × × × × × × × × × × × × × ×
SEG 1
1
SEG 2
2
SEG 3
3
SEG 4
4
SEG 5
5
SEG 6
6
SEG 7
7
SEG 8
8
SEG 9
Data memory address
9
SEG 10
A
LCD panel
SEG 11
B
SEG 12
C
SEG 13
D
SEG 14
E
SEG 15
F
SEG 16
F0410H
SEG 17
1
SEG 18
2
SEG 19
3
SEG 20
4
SEG 21
5
SEG 22
6
SEG 23
7
’: Can be used to store any data because there is no corresponding segment in the LCD panel.
: Can always be used to store any data because the three-time-slice mode is being used.
Figure 21-33. Three-Time-Slice LCD Drive Waveform Examples Between SEG6 and Each Common Signals
(1/2 Bias Method)
1 frame 1 frame
VL4
COM0 VL2 = VL1
VSS
VL4
COM1 VL2 = VL1
VSS
VL4
COM2 VL2 = VL1
VSS
VL4
SEG6 VL2 = VL1
VSS
COM0-SEG6
Extinguishes Extinguishes Extinguishes Extinguishes Extinguishes Extinguishes Extinguishes Extinguishes
+VL4
+VL2 = +VL1
COM0-SEG6 0
VL2 = VL1
VL4
COM1-SEG6
Extinguishes Lights Extinguishes Extinguishes Lights Extinguishes Extinguishes Lights
+VL4
+VL2 = +VL1
COM1-SEG6 0
VL2 = VL1
VL4
COM2-SEG6
Extinguishes Extinguishes Lights Extinguishes Extinguishes Lights Extinguishes Extinguishes
+VL4
+VL2 = +VL1
COM2-SEG6 0
VL2 = VL1
VL4
Figure 21-34. Three-Time-Slice LCD Drive Waveform Examples Between SEG6 and Each Common Signals
(1/3 Bias Method)
1 frame 1 frame
VL4
VL2
COM0
VL1
VSS
VL4
VL2
COM1
VL1
VSS
VL4
VL2
COM2
VL1
VSS
VL4
VL2
SEG6
VL1
VSS
COM0-SEG6
Extinguishes Extinguishes Extinguishes Extinguishes Extinguishes Extinguishes Extinguishes Extinguishes
+VL4
+VL2
+VL1
COM0-SEG6 0
VL1
VL2
VL4
COM1-SEG6
Extinguishes Lights Extinguishes Extinguishes Lights Extinguishes Extinguishes Lights
+VL4
+VL2
+VL1
COM1-SEG6 0
VL1
VL2
VL4
COM2-SEG6
Extinguishes Extinguishes Lights Extinguishes Extinguishes Lights Extinguishes Extinguishes
+VL4
+VL2
+VL1
COM2-SEG6 0
VL1
VL2
VL4
Common
According to Table 21-17, it is determined that the display data register location (F040CH) that corresponds to SEG12
must contain 1101.
Figure 21-37 shows examples of LCD drive waveforms between the SEG12 signal and each common signal. When the
select voltage is applied to SEG12 at the timing of COM0, an alternate rectangle waveform, +VLCD/VLCD, is generated to
turn on the corresponding LCD segment.
SEG2n
COM0 COM1
COM2
COM3
SEG2n+1
COM 3
Timing strobe
COM 2
COM 1
COM 0
Bit 3
Bit 2
Bit 1
Bit 0
SEG 0
F0400H
0 0 1 0 1 0 0 0 1 0 1 1 0 0 1 0 0 0 1 0 0 0 1 0
0 1 1 0 0 1 0 1 0 1 1 1 0 1 1 1 0 1 1 1 0 1 1 0
0 1 1 1 1 1 1 1 1 0 1 0 0 1 1 1 1 1 0 1 0 1 1 1
0 0 0 1 0 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 1
SEG 1
1
SEG 2
2
SEG 3
3
SEG 4
4
SEG 5
5
SEG 6
6
SEG 7
7
SEG 8
8
SEG 9
Data memory address
9
SEG 10
LCD panel
A
SEG 11
B
SEG 12
C
SEG 13
D
SEG 14
E
SEG 15
F
SEG 16
F0410H
SEG 17
1
SEG 18
2
SEG 19
3
SEG 20
4
SEG 21
5
SEG 22
6
SEG 23
7
Figure 21-37. Four-Time-Slice LCD Drive Waveform Examples Between SEG12 and Each Common Signals
(1/3 Bias Method) (1/2)
(a) Waveform A
1 frame 1 frame
VL4
VL2
COM0
VL1
VSS
VL4
VL2
COM1
VL1
VSS
VL4
VL2
COM2
VL1
VSS
VL4
VL2
COM3
VL1
VSS
VL4
VL2
SEG12
VL1
VSS
COM0-SEG12
Lights Extinguishes Extinguishes Extinguishes Lights Extinguishes Extinguishes Extinguishes
+VL4
+VL2
+VL1
COM0-SEG12 0
VL1
VL2
VL4
COM1-SEG12
Extinguishes Extinguishes Extinguishes Extinguishes Extinguishes Extinguishes Extinguishes Extinguishes
+VL4
+VL2
+VL1
COM1-SEG12 0
VL1
VL2
VL4
Figure 21-37. Four-Time-Slice LCD Drive Waveform Examples Between SEG12 and Each Common Signals
(1/3 Bias Method) (2/2)
(b) Waveform B
1 frame 1 frame
VL4
VL2
COM0
VL1
VSS
VL4
VL2
COM1
VL1
VSS
VL4
VL2
COM2
VL1
VSS
VL4
VL2
COM3
VL1
VSS
VL4
VL2
SEG12
VL1
VSS
COM0-SEG12
Lights Extinguishes Lights Extinguishes Lights Extinguishes Lights Extinguishes
+VL4
+VL2
+VL1
COM0-SEG12 0
-VL1
-VL2
-VL4
COM1-SEG12
Extinguishes Extinguishes Extinguishes Extinguishes Extinguishes Extinguishes Extinguishes Extinguishes
+VL4
+VL2
+VL1
COM1-SEG12 0
-VL1
-VL2
-VL4
Common
According to Table 21-18, it is determined that the display data register location (F0402H) that corresponds to SEG2
must contain 010001.
Figure 21-40 shows examples of LCD drive waveforms between the SEG2 signal and each common signal. When the
select voltage is applied to SEG2 at the timing of COM0, a waveform is generated to turn on the corresponding LCD
segment.
S S S S S
E E E E E
G G G G G
5n+6 5n+5 5n+4 5n+3 5n+2
COM0
COM1
COM2
COM3
COM4
COM5
COM 7
Open
COM 6
Open
COM 5
Timing strobe COM 4
COM 3
COM 2
COM 1
COM 0
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
SEG 2
F0402H
0 1 1 1 0 1 1 1 1 1 0 1 1 1 0
0 0 1 0 0 0 0 1 0 0 1 0 0 0 1
0 0 1 0 0 0 0 0 1 0 0 0 0 1 0
0 0 1 0 0 0 0 0 0 1 0 0 1 0 0
0 1 1 0 0 1 0 0 0 1 0 0 0 1 0
0 0 1 0 0 0 1 1 1 0 1 1 1 1 1
× × × × × × × × × × × × × × ×
× × × × × × × × × × × × × × ×
SEG 3
3
SEG 4
4
SEG 5
5
Data memory address
SEG 6
6
SEG 7
LCD panel
7
SEG 8
8
SEG 9
9
SEG 10
A
SEG 11
B
SEG 12
C
SEG 13
D
SEG 14
E
SEG 15
F
SEG 16
F0410H
: Can always be used to store any data because the six-time-slice mode is being used.
Figure 21-40. Six-Time-Slice LCD Drive Waveform Examples Between SEG4 and Each Common Signals
(1/4 Bias Method)
(a) Waveform A
1 frame
VL4
VL3
COM0 VL2
VL1
VSS
VL4
VL3
COM1 VL2
VL1
VSS
VL4
VL3
COM2 VL2
VL1
VSS
..
.
VL4
VL3
COM5 VL2
VL1
VSS
VL4
VL3
SEG2 VL2
VL1
VSS
COM0-SEG2
Lights Extinguishes
+VL4
+VL3
+VL2
+VL1
COM0-SEG2 0
-VL1
-VL2
-VL3
-VL4
COM1-SEG2
Extinguishes
+VL4
+VL3
+VL2
+VL1
COM1-SEG2 0
-VL1
-VL2
-VL3
-VL4
Common
According to Table 21-19, it is determined that the display data register location (F0404H) that corresponds to SEG4
must contain 00110001.
Figure 21-43 shows examples of LCD drive waveforms between the SEG4 signal and each common signal. When the
select voltage is applied to SEG4 at the timing of COM0, a waveform is generated to turn on the corresponding LCD
segment.
S S S S S
E E E E E
G G G G G
5n+8 5n+7 5n+6 5n+5 5n+4
COM0
COM1
COM2
COM3
COM4
COM5
COM6
COM7
Timing strobe
1
2
F
9
8
7
6
5
E
B
A
D
C
R01UH0407EJ0210 Rev.2.10
F0410H
F0404H
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Bit 7
0 1 1 1 0 1 1 1 1 1 0 1 1 1 0 Bit 6
0 0 1 0 0 0 1 0 0 0 1 0 0 0 1 Bit 5
0 0 1 0 0 0 0 1 0 0 0 0 0 0 1 Bit 4
0 0 1 0 0 0 0 0 1 0 0 0 0 1 0 Bit 3
0 0 1 0 0 0 0 0 0 1 0 0 1 0 0 Bit 2
0 1 1 0 0 1 0 0 0 1 0 0 0 1 0 Bit 1
0 0 1 0 0 0 1 1 1 0 1 1 1 1 1 Bit 0
SEG 9
SEG 8
SEG 7
SEG 6
SEG 5
SEG 4
SEG 18
SEG 17
SEG 16
SEG 15
SEG 14
SEG 13
SEG 12
SEG 11
SEG 10
COM 0
COM 1
COM 2
COM 3
COM 4
COM 5
COM 6
COM 7
Figure 21-42. Example of Connecting Eight-Time-Slice LCD Panel
LCD panel
CHAPTER 21 LCD CONTROLLER/DRIVER
763
RL78/I1B CHAPTER 21 LCD CONTROLLER/DRIVER
Figure 21-43. Eight-Time-Slice LCD Drive Waveform Examples Between SEG4 and Each Common Signals
(1/4 Bias Method) (1/2)
(a) Waveform A
1 frame
VL4
VL3
COM0 VL2
VL1
VSS
VL4
VL3
COM1 VL2
VL1
VSS
VL4
VL3
COM2 VL2
VL1
VSS
..
.
VL4
VL3
COM7 VL2
VL1
VSS
VL4
VL3
SEG4 VL2
VL1
VSS
COM0-SEG4
Lights Extinguishes
+VL4
+VL3
+VL2
+VL1
COM0-SEG4 0
-VL1
-VL2
-VL3
-VL4
COM1-SEG4
Extinguishes
+VL4
+VL3
+VL2
+VL1
COM1-SEG4 0
-VL1
-VL2
-VL3
-VL4
Figure 21-43. Eight-Time-Slice LCD Drive Waveform Examples Between SEG4 and Each Common Signals
(1/4 Bias Method) (2/2)
(b) Waveform B
1 frame
VL4
VL3
COM0 VL2
VL1
VSS
VL4
VL3
COM1 VL2
VL1
VSS
VL4
VL3
COM2 VL2
VL1
VSS
..
.
VL4
VL3
COM7 VL2
VL1
VSS
VL4
VL3
SEG4 VL2
VL1
VSS
COM0-SEG4
Lights Extinguishes Lights Extinguishes
+VL4
+VL3
+VL2
+VL1
COM0-SEG4 0
-VL1
-VL2
-VL3
-VL4
COM1-SEG4
Extinguishes
+VL4
+VL3
+VL2
+VL1
COM1-SEG4 0
-VL1
-VL2
-VL3
-VL4
<R> The term “8 higher-order bits of the address” in this chapter indicates bits 15 to 8 of 20-bit address as shown below.
20-bit address
4 lower-order bits
Unless otherwise specified, the 4 highest-order address bits all become 1 (values are of the form FxxxxH).
The data transfer controller (DTC) is a function that transfers data between memories without using the CPU. The DTC
is activated by a peripheral function interrupt to perform data transfers. The DTC and CPU use the same bus, and the
DTC takes priority over the CPU in using the bus.
Item Specification
<R> Activation sources 30 sources
Allocatable control data 24 sets
Address space Address space 64 Kbytes (F0000H to FFFFFH), excluding general-purpose registers
which can be Sources Special function register (SFR), RAM area (excluding general-purpose registers), mirror area
Note
,
transferred extended special function register (2nd SFR)
Destinations Special function register (SFR), RAM area (excluding general-purpose registers), extended
special function register (2nd SFR)
Maximum number Normal mode 256 times
of transfers Repeat mode 255 times
Maximum size of Normal mode 256 bytes
block to be (8-bit transfer)
transferred Normal mode 512 bytes
(16-bit transfer)
Repeat mode 255 bytes
Unit of transfers 8 bits/16 bits
Transfer mode Normal mode Transfers end on completion of the transfer causing the DTCCTj register value to change from 1
to 0.
Repeat mode On completion of the transfer causing the DTCCTj register value to change from 1 to 0, the
repeat area address is initialized and the DTRLDj register value is reloaded to the DTCCTj
register to continue transfers.
Address control Normal mode Fixed or incremented
Repeat mode Addresses of the area not selected as the repeat area are fixed or incremented.
Priority of activation sources See Table 22-5 DTC Activation Sources and Vector Addresses.
Interrupt request Normal mode When the data transfer causing the DTCCTj register value to change from 1 to 0 is performed,
the activation source interrupt request is generated for the CPU, and interrupt handling is
performed on completion of the data transfer.
Repeat mode When the data transfer causing the DTCCTj register value to change from 1 to 0 is performed
while the RPTINT bit in the DTCCRj register is 1 (interrupt generation enabled), the activation
source interrupt request is generated for the CPU, and interrupt handling is performed on
completion of the transfer.
Transfer start When bits DTCENi0 to DTCENi7 in the DTCENi registers are 1 (activation enabled), data
transfer is started each time the corresponding DTC activation sources are generated.
Transfer stop Normal mode When bits DTCENi0 to DTCENi7 are set to 0 (activation disabled).
When the data transfer causing the DTCCTj register value to change from 1 to 0 is completed.
Repeat mode When bits DTCENi0 to DTCENi7 are set to 0 (activation disabled).
When the data transfer causing the DTCCTj register value to change from 1 to 0 is completed
while the RPTINT bit is 1 (interrupt generation enabled).
Note In the HALT and SNOOZE modes, these areas cannot be set as the sources for DTC transfer since the flash
memory is stopped.
Remark i = 0 to 3, j = 0 to 23
DTCENi DTCBAR
Internal bus
RAM
Remark j = 0 to 23
22.3.1 Allocation of DTC control data area and DTC vector table area
The DTCBAR register is used to set the 256-byte area where DTC control data and the vector table within the RAM
area.
Figure 22-2 shows a memory map example when DTCBAR register is set to FBH.
In the 192-byte DTC control data area, the space not used by the DTC can be used as RAM.
Figure 22-2. Memory Map Example When DTCBAR Register Is Set to FBH (R5F10MMGDFB, R5F10MPGDFB)
The areas where the DTC control data and vector table can be allocated differ depending on the product.
Cautions 1. It is prohibited to use the general-purpose register (FFEE0H to FFEFFH) space as the DTC
control data area or DTC vector table area.
2. Make sure the stack area, the DTC control data area, and the DTC vector table area do not
overlap.
3. The internal RAM area in the following products cannot be used as the DTC control data area or
DTC vector table area when using the self-programming.
R5F10MMGDFB, R5F10MPGDFB: FDF00H to FE309H
R5F10MMEDFB, R5F10MPEDFB: FE700H to FEB09H
4. The internal RAM area of the following products cannot be used as the DTC control data area or
DTC vector table area when using the trace function of on-chip debugging.
R5F10MME, R5F10MPE, R5F10MMG, R5F10MPG: FE300H to FE6FFH
Notes 1. Change the data in registers DTCCRj, DTBLSj, DTCCTj, DTRLDj, DTSARj, and DTDARj when the
corresponding bit among bits DTCENi0 to DTCENi7 (i = 0 to 3) in the DTCENi register is set to 0 (DTC
activation disabled).
2. Do not access DTCCRj, DTBLSj, DTCCTj, DTRLDj, DTSARj, or DTDARj using a DTC transfer.
j Address j Address
11 Fxx98H 23 FxxF8H
10 Fxx90H 22 FxxF0H
9 Fxx88H 21 FxxE8H
8 Fxx80H 20 FxxE0H
7 Fxx78H 19 FxxD8H
6 Fxx70H 18 FxxD0H
5 Fxx68H 17 FxxC8H
4 Fxx60H 16 FxxC0H
3 Fxx58H 15 FxxB8H
2 Fxx50H 14 FxxB0H
1 Fxx48H 13 FxxA8H
0 Fxx40H 12 FxxA0H
Note Change the start address of the DTC control data area to be set in the vector table when the corresponding bit
among bits DTCENi0 to DTCENi7 (i = 0 to 3) in the DTCENi register is set to 0 (activation disabled).
Control data 23
FFBF8H
Control data 15
FFB88H
DTC control data area
FFB40H to FFBF8H
(when DTCBAR is set to FBH)
Control data 2
FFB50H
Example: When the DTC
activating trigger is Control data 1
generated as a result of FFB48H
the A/D conversion
Control data 0
The DTC reads the control FFB40H
data at FFB88H in the
control data area of the
vector table (88H) and
transfers the data from the
68H Comparator
ADC. FFB27H detection 1
The PER1 register can be set by a 1-bit or 8-bit memory manipulation instruction.
Reset signal generation clears this register to 00H.
Address: See 22.3.2 Control data allocation. After reset: Undefined R/W
Symbol 7 6 5 4 3 2 1 0
0 Normal mode
1 Repeat mode
Address: See 22.3.2 Control data allocation. After reset: Undefined R/W
Symbol 7 6 5 4 3 2 1 0
Address: See 22.3.2 Control data allocation. After reset: Undefined R/W
Symbol 7 6 5 4 3 2 1 0
01H Once
02H 2 times
03H 3 times
... ...
Address: See 22.3.2 Control data allocation. After reset: Undefined R/W
Symbol 7 6 5 4 3 2 1 0
Address: See 22.3.2 Control data allocation. After reset: Undefined R/W
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
DTSARj DTSA DTSA DTSA DTS DTS DTSA DTS DTS DTS DTS DTS DTS DTS DTS DTS DTS
Rj15 Rj14 Rj13 ARj12 ARj11 Rj10 ARj9 ARj8 ARj7 ARj6 ARj5 ARj4 ARj3 ARj2 ARj1 ARj0
Cautions 1. Do not set the general-purpose register (FFEE0H to FFEFFH) space to the transfer source
address.
2. Do not access the DTSARj register using a DTC transfer.
Address: See 22.3.2 Control data allocation. After reset: Undefined R/W
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
DTDARj DTDA DTD DTD DTDA DTDA DTD DTD DTD DTD DTD DTD DTD DTD DTD DTD DTD
Rj15 ARj14 ARj13 Rj12 Rj11 ARj10 ARj9 ARj8 ARj7 ARj6 ARj5 ARj4 ARj3 ARj2 ARj1 ARj0
Cautions 1. Do not set the general-purpose register (FFEE0H to FFEFFH) space to the transfer source
address.
2. Do not access the DTDARj register using a DTC transfer.
Notes 1. Modify bits DTCENi0 to DTCENi7 if an activation source corresponding to the bit has not been generated.
2. Do not access the DTCENi register using a DTC transfer.
Address: F02E8H (DTCEN0), F02E9H (DTCEN1), F02EAH (DTCEN2), After reset: 00H R/W
F02EBH (DTCEN3)
Symbol <7> <6> <5> <4> <3> <2> <1> <0>
0 Activation disabled
1 Activation enabled
The DTCENi7 bit is set to 0 (activation disabled) by a condition for generating a transfer end interrupt.
0 Activation disabled
1 Activation enabled
The DTCENi6 bit is set to 0 (activation disabled) by a condition for generating a transfer end interrupt.
0 Activation disabled
1 Activation enabled
The DTCENi5 bit is set to 0 (activation disabled) by a condition for generating a transfer end interrupt.
0 Activation disabled
1 Activation enabled
The DTCENi4 bit is set to 0 (activation disabled) by a condition for generating a transfer end interrupt.
0 Activation disabled
1 Activation enabled
The DTCENi3 bit is set to 0 (activation disabled) by a condition for generating a transfer end interrupt.
0 Activation disabled
1 Activation enabled
The DTCENi2 bit is set to 0 (activation disabled) by a condition for generating a transfer end interrupt.
0 Activation disabled
1 Activation enabled
The DTCENi1 bit is set to 0 (activation disabled) by a condition for generating a transfer end interrupt.
0 Activation disabled
1 Activation enabled
The DTCENi0 bit is set to 0 (activation disabled) by a condition for generating a transfer end interrupt.
Table 22-6. Correspondences Between Interrupt Sources and Bits DTCENi0 to DTCENi7
Register DTCENi7 Bit DTCENi6 Bit DTCENi5 Bit DTCENi4 Bit DTCENi3 Bit DTCENi2 Bit DTCENi1 Bit DTCENi0 Bit
Remark i = 0 to 3
Cautions 1. Change the DTCBAR register value with all DTC activation sources set to activation disabled.
2. Do not rewrite the DTCBAR register more than once.
3. Do not access the DTCBAR register using a DTC transfer.
4. For the allocation of the DTC control data area and the DTC vector table area, see the Notes on
22.3.1 Allocation of DTC control data area and DTC vector table area.
When the DTC is activated, control data is read from the DTC control data area to perform data transfers and control
data after data transfer is written back to the DTC control data area. Twenty-four sets of control data can be stored in the
DTC control data area, which allows 24 types of data transfers to be performed.
There are two transfer modes (normal mode and repeat mode) and two transfer sizes (8-bit transfer and 16-bit transfer).
When the CHNE bit in the DTCCRj (j = 0 to 23) register is set to 1 (chain transfers enabled), multiple control data is read
and data transfers are continuously performed by one activation source (chain transfers).
A transfer source address is specified by the 16-bit register DTSARj, and a transfer destination address is specified by
the 16-bit register DTDARj.
The values in registers DTSARj and DTDARj are separately incremented or fixed according to the control data after the
data transfer.
Branch (1)
DTC activation source 0 is written to the bit among bits DTCENi0 to DTCENi7 and an interrupt request is generated when transfer is
generation either of the following:
- A transfer that causes the DTCCTj (j = 0 to 23) register value to change from 1 to 0 in normal mode
- A transfer that causes the DTCCTj register value to change from 1 to 0 while the RPTINT bit is 1 in repeat mode
No No Yes
Yes CHNE = 1?
CHNE = 1?
No No
Note 0 is not written to the bit among bits DTCENi0 to DTCENi7 for data transfers activated by the setting to enable chain
transfers (the CHNE bit is 1). Also, no interrupt request is generated.
DTC block size register j DTBLSj Size of the data block to be transferred by one activation
DTC transfer count register j DTCCTj Number of data transfers
Note
DTC transfer count reload register j DTRLDj Not used
DTC source address register j DTSARj Data transfer source address
DTC destination address register j DTDARj Data transfer destination address
Note Initialize this register to 00H when parity error resets are enabled (RPERDIS = 0) using the RAM parity error
detection function.
Remark j = 0 to 23
(1) Example 1 of using normal mode: Consecutively capturing A/D conversion results
The DTC is activated by an A/D conversion end interrupt and the value of the A/D conversion result register is
transferred to RAM.
The vector address is FFB0AH and control data is allocated at FFBA0H to FFBA7H
Transfers 2-byte data of the A/D conversion result register (FFF1EH, FFF1FH) to 80 bytes of FFD80H to
<R> FFDCFH of RAM 40 times
<R> Figure 22-16. Example 1 of Using Normal Mode: Consecutively Capturing A/D Conversion Results
DTCBAR = FBH
No
A/D conversion
end interrupt?
Yes
Yes
DTCCT12 = 01H?
Data transfer
Interrupt handling
The value of the DTRLD12 register is not used because of normal mode, but initialize the register to 00H when parity
error resets are enabled (RPERDIS = 0) using the RAM parity error detection function.
Remark j = 0 to 23
Cautions 1. When repeat mode is used, the lower 8 bits of the initial value for the repeat area address must be
00H.
2. When repeat mode is used, the data size of the repeat area must be set to 255 bytes or less.
(1) Example of using repeat mode: Outputting a stepping motor control pulse using ports
The DTC is activated by an interval timer interrupt and the pattern of the motor control pulse stored in the code
flash memory is transferred to general-purpose ports.
The vector address is FFC0CH and control data is allocated at FFCD0H to FFCD7H
Transfers 8-byte data of 02000H to 02007H of the code flash memory from the mirror space (F2000H to
F2007H) to port register 1 (FFF01H)
A repeat mode interrupt is disabled
Figure 22-19. Example 1 of Using Repeat Mode: Outputting a Stepping Motor Control Pulse Using Ports
DTCBAR = FCH
Timer setting
P12
P11
Yes
P10
Yes
DTCCT23 = 01H
Example of 1-2 phase excitation
Data transfer No
FFFFFH
DTC activation source generation
DTDAR2 register
Read control data 1
DTSAR2 register
Control data 2
DTRLD2 register DTCCT2 register (the CHNE bit is 0)
Transfer data
DTBLS2 register DTCCR2 register
DTDAR1 register
Write back control data 1
DTSAR1 register Control data 1
(the CHNE bit is 1)
DTRLD1 register DTCCT1 register
Read control data 2
DTBLS1 register DTCCR1 register
F0000H
Notes 1. Set the CHNE bit in the DTCCR23 register to 0 (chain transfers disabled).
2. During chain transfers, bits DTCENi0 to DTCENi7 (i = 0 to 3) in the DTCENi register are not set to 0 (DTC
activation disabled) for the second and subsequent transfers. Also, no interrupt request is generated.
(1) Example of using chain transfers: Consecutively capturing A/D conversion results and UART transmission
The DTC is activated by an A/D conversion end interrupt and A/D conversion results are transferred to RAM, and
then transmitted using the UART.
The vector address is FFB0AH
Control data of capturing A/D conversion results is allocated at FFBA0H to FFBA7H
Control data of UART transmission is allocated at FFBA8H at FFBAFH
An A/D conversion end interrupt is assigned to TRIGER23
Transfers 2-byte data of the A/D conversion result register (FFF1FH, FFF1EH) to FFD80H to FFDCFH of RAM,
and transfers the upper 1 byte (FFF1FH) of the A/D conversion result register to the UART transmit buffer
(FFF10H)
Figure 22-21. Example of Using Chain Transfers: Consecutively Capturing A/D Conversion Results and UART
Transmission
DTCBAR = FBH
FD80H
Setting control data
of UART transmission
Vector address (FFB0CH) = C8H
DTCCR12 (FFBC8H) = 00H
DTBLS12 (FFBC9H) = 01H
DTCCT12 (FFBCAH) = 00H
DTRLD12 (FFBCBH) = 00H
DTSAR12 (FFBCCH) = FF1FH A/D conversion No
DTDAR12 (FFBCEH) = FF10H end interrupt?
Yes
DTCEN15 = 1
Yes
DTCCT10 = 01H?
Do not access the DTC SFRs, the DTC control data area, the DTC vector table area, or the general-register (FFEE0H
to FFEFFH) space using a DTC transfer.
Modify the DTC base address register (DTCBAR) while all DTC activation sources are set to activation disabled.
Do not rewrite the DTC base address register (DTCBAR) twice or more.
Modify the data of the DTCCRj, DTBLSj, DTCCTj, DTRLDj, DTSARj, or DTDARj register when the corresponding bit
among bits DTCENi0 to DTCENi7 in the DTCENi (i = 0 to 3) register is 0 (DTC activation disabled).
Modify the start address of the DTC control data area to be set in the vector table when the corresponding bit among
bits DTCENi0 to DTCENi7 in the DTCENi (i = 0 to 3) register is 0 (DTC activation disabled).
Do not allocate RAM addresses which are used as a DTC transfer destination/transfer source to the area FFE20H to
FFEDFH when performing self-programming.
22.5.2 Allocation of DTC control data area and DTC vector table area
The areas where the DTC control data and vector table can be allocated differ.
It is prohibited to use the general-purpose register (FFEE0H to FFEFFH) space as the DTC control data area or DTC
vector table area.
Make sure the stack area, the DTC control data area, and the DTC vector table area do not overlap.
The internal RAM area in the following products cannot be used as the DTC control data area or DTC vector table
area when using the self-programming.
R5F10MMGDFB, R5F10MPGDFB : FDF00H-FE309H
R5F10MMEDFB, R5F10MPEDFB : FE700H-FEB09H
The internal RAM area in the following products cannot be used as the DTC control data area or DTC vector table
area when using the on-chip trace function.
R5F10MME, R5F10MPE, R5F10MMG, R5F10MPG: FE300H to FE6FFH
Initialize the DTRLD register to 00H even in normal mode when parity error resets are enabled (RPERDIS = 0) using
the RAM parity error detection function.
Call/return instruction
Unconditional branch instruction
Conditional branch instruction
Read access instruction for code flash memory
Bit manipulation instructions for IFxx, MKxx, PRxx, and PSW, and an 8-bit manipulation instruction that has the ES
register as operand
<R> Instruction of Multiply, Divide, Multiply & Accumulate (excluding MULU)
Cautions 1. When a DTC transfer request is acknowledged, all interrupt requests are held pending until DTC
transfer is completed.
2. While the DTC is held pending by the DTC pending instruction, all interrupt requests are held
pending.
Table 22-9. Operations Following DTC Activation and Required Number of Cycles
Control Data
Vector Read Data Read Data Write
Read Write-back
1 4 Note 1 Note 2 Note 2
Notes 1. For the number of clock cycles required for control data write-back, see Table 22-10 Number of Clock
Cycles Required for Control Data Write-Back Operation.
2. For the number of clock cycles required for data read/write, see Table 22-11 Number of Clock Cycles
Required for Data Read/Write Operation.
Table 22-10. Number of Clock Cycles Required for Control Data Write-Back Operation
DTCCR Register Setting Address Setting Control Register to be Written Back Number
DTCCTj DTRLDj DTSARj DTDARj of Clock
DAMOD SAMOD RPTSEL MODE Source Destination
Register Register Register Register Cycles
Remark j = 0 to 23; X: 0 or 1
Table 22-11. Number of Clock Cycles Required for Data Read/Write Operation
Note that the response from the DTC may be further delayed under the following cases. The number of delayed clock
cycles differs depending on the conditions.
After inputting a DTC activation source, do not input the same activation source again until DTC transfer is completed.
While a DTC activation source is generated, do not manipulate the DTC activation enable bit corresponding to the
source.
If DTC activation sources conflict, their priority levels are determined in order to select the source for activation when
the CPU acknowledges the DTC transfer. For details on the priority levels of activation sources, see 22.3.3 Vector
table.
When DTC activation is enabled under either of the following conditions, a DTC transfer is started and an interrupt is
generated after completion of the transfer. Therefore, enable DTC activation after confirming the comparator monitor
flag (CnMON) as necessary. (n = 0, 1)
- The comparator is set to an interrupt request on one-edge detection (CnEDG = 0), an interrupt request at the rising
edge for the comparator, and IVCMP > IVREF (or internal reference voltage: 1.45 V)
- The comparator is set to an interrupt request on one-edge detection (CnEDG = 0), an interrupt request at the falling
edge for the comparator, and IVCMP < IVREF (or internal reference voltage: 1.45 V)
Notes 1. The SNOOZE mode can only be specified when the high-speed on-chip oscillator clock is selected as fCLK.
2. In the STOP mode, detecting a DTC activation source enables transition to SNOOZE mode and DTC
transfer. After completion of transfer, the system returns to the STOP mode. However, since the code flash
memory is stopped during the HALT or SNOOZE mode, the flash memory cannot be set as the transfer
source.
3. When a transfer end interrupt is set as a DTC activation source from the CSIp SNOOZE mode function,
release the SNOOZE mode using the transfer end interrupt to start CPU processing after completion of DTC
transfer, or use a chained transfer to set CSIp reception again (writing 1 to the STm0 bit, writing 0 to the
SWCm bit, setting of the SSCm register, and writing 1 to the SSm0 bit).
4. When a transfer end interrupt is set as a DTC activation source from the UARTq SNOOZE mode function,
release the SNOOZE mode using the transfer end interrupt to start CPU processing after completion of DTC
transfer, or use a chained transfer to set UARTq reception again (writing 1 to the STm1 bit, writing 0 to the
SWCm bit, setting of the SSCm register, and writing 1 to the SSm1 bit).
5. When an A/D conversion end interrupt is set as a DTC activation source from the A/D converter SNOOZE
mode function, release the SNOOZE mode using the A/D conversion end interrupt to start CPU processing
after completion of DTC transfer, or use a chained transfer to set the A/D converter SNOOZE mode function
again after clear the AWC bit.
Caution The SNOOZE function for the DTC and the SNOOZE function for UART cannot be used at the same
time.
Remark p = 00; q = 0; m = 0
The interrupt function switches the program execution to other processing. When the branch processing is finished, the
program returns to the interrupted processing.
Interrupt sources include maskable interrupts and software interrupts. In addition, they also have up to seven reset
sources (see Table 23-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.
Default Priority
Type
Basic Configuration
Interrupt Interrupt Source Internal/ Vector
Type External Table
Note 2
Note 1
Name Trigger Address
Note 3
Maskable 0 INTWDTI Watchdog timer interval Internal 0004H (A)
(75% of overflow time+1/2fIL)
Note 4
1 INTLVI Voltage detection 0006H
Note 5
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 end or buffer Internal 0014H (A)
empty interrupt
9 INTSR2 UART2 reception transfer end 0016H
10 INTSRE2 UART2 reception communication error 0018H
occurrence
11 INTST0/ UART0 transmission transfer end or buffer 001EH
INTCSI00/ empty interrupt/CSI00 transfer end or buffer
INTIIC00 empty interrupt/IIC00 transfer end
12 INTTM00 End of timer channel 00 count or capture 0020H
13 INTSR0 UART0 reception transfer end 0022H
14 INTSRE0 UART0 reception communication error 0024H
occurrence
INTTM01H End of timer channel 01 count or capture (at
higher 8-bit timer operation)
15 INTST1/ UART1 transmission transfer end or buffer 0026H
INTIIC10 empty interrupt/IIC10 transfer end
16 INTSR1 UART1 reception transfer end 0028H
17 INTSRE1 UART1 reception communication error 002AH
occurrence
INTTM03H End of timer channel 03 count or capture (at
higher 8-bit timer operation)
18 INTIICA0 End of IICA0 communication 002CH
19 INTRTIT RTC correction timing 002EH
20 INTFM End of frequency measurement 0030H
21 INTTM01 End of timer channel 01 count or capture (at 16- 0032H
bit/lower 8-bit timer operation)
Notes 1. The default priority determines the sequence of interrupts if two or more maskable interrupts occur
simultaneously. Zero indicates the highest priority and 42 indicates the lowest priority.
2. Basic configuration types (A) to (C) correspond to (A) to (C) in Figure 23-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. The input buffer power supply of the INTP0 pin is connected to internal VDD. Interrupts can be accepted
even when a battery backup function is used and power is supplied from the VBAT pin.
Default Priority
Type
Basic Configuration
Interrupt Interrupt Source Internal/ Vector
Type External Table
Note 2
Note 1
Name Trigger Address
Maskable 22 INTTM02 End of timer channel 02 count or capture Internal 0034H (A)
23 INTTM03 End of timer channel 03 count or capture (at 16- 0036H
bit/lower 8-bit timer operation)
24 INTAD End of A/D conversion 0038H
25 INTRTC Fixed-cycle signal of real-time clock 2/alarm 003AH
match detection
26 INTIT Interval signal of 12-bit interval timer detection 003CH
27 INTDSAD End of ∆Σ A/D conversion 0044H
28 INTTM04 End of timer channel 04 count or capture 0046H
29 INTTM05 End of timer channel 05 count or capture 0048H
30 INTP6 Pin input edge detection External 004AH (B)
31 INTP7 004CH
32 INTCMP0 Comparator detection 0 0050H
33 INTCMP1 Comparator detection 1 0052H
34 INTTM06 End of timer channel 06 count or capture Internal 0054H (A)
35 INTTM07 End of timer channel 07 count or capture 0056H
36 INTIT00 8-bit interval timer channel 00/channel 0 (when 0058H
cascade) compare match detection
37 INTIT01 8-bit interval timer channel 01 compare match 005AH
detection
38 INTCR End of high-speed on-chip oscillator clock 005CH
frequency correction
39 INTOSDC Oscillation stop detection 0060H
40 INTIT10 8-bit interval timer channel 10/channel 1 (when 0068H
cascade) compare match detection
41 INTIT11 8-bit interval timer channel 11 compare match 006AH
detection
42 INTVBAT Power switching detection interrupt 006CH
Notes 1. The default priority determines the sequence of interrupts if two or more maskable interrupts occur
simultaneously. Zero indicates the highest priority and 42 indicates the lowest priority.
2. Basic configuration types (A) to (C) correspond to (A) to (C) in Figure 23-1.
Default Priority
Type
Basic Configuration
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 42 indicates the lowest priority.
2. Basic configuration types (A) to (C) correspond to (A) to (C) in Figure 23-1.
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
Internal bus
Remark n = 0 to 7
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 register (EGP0)
External interrupt falling edge enable register (EGN0)
Program status word (PSW)
Table 23-2 shows a list of interrupt request flags, interrupt mask flags, and priority specification flags corresponding to
interrupt request sources.
Interrupt Interrupt Request Flag Interrupt Mask Flag Priority Specification Flag
Source
Register Register Register
Note 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.
Interrupt Interrupt Request Flag Interrupt Mask Flag Priority Specification Flag
Source
Register Register Register
Notes 1. Do not use a UART0 reception error interrupt and an interrupt of channel 1 of TAU0 (at higher 8-bit timer
operation) at the same time because they share flags for the interrupt request sources. If the UART0
reception error interrupt is not used (EOC01 = 0), UART0 and channel 1 of TAU0 (at higher 8-bit timer
operation) can be used at the same time. If one of the interrupt sources INTSRE0 and INTTM01H is
generated, bit 0 of the IF1L register is set to 1. Bit 0 of the MK1L, PR01L, and PR11L registers supports
these two interrupt sources.
2. If one of the interrupt sources INTST1 and INTIIC10 is generated, bit 1 of the IF1L register is set to 1. Bit 1
of the MK1L, PR01L, and PR11L registers supports these two interrupt sources.
3. Do not use a UART1 reception error interrupt and an interrupt of channel 3 of TAU0 (at higher 8-bit timer
operation) at the same time because they share flags for the interrupt request sources. If the UART1
reception error interrupt is not used (EOC03 = 0), UART1 and channel 3 of TAU0 (at higher 8-bit timer
operation) can be used at the same time. If one of the interrupt sources INTSRE1 and INTTM03H is
generated, bit 3 of the IF1L register is set to 1. Bit 3 of the MK1L, PR01L, and PR11L registers supports
these two interrupt sources.
Interrupt Interrupt Request Flag Interrupt Mask Flag Priority Specification Flag
Source
Register Register Register
23.3.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 23-2. Format of Interrupt Request Flag Registers (IF0L, IF0H, IF1L, IF1H, IF2L, IF2H, IF3L) (1/2)
Figure 23-2. Format of Interrupt Request Flag Registers (IF0L, IF0H, IF1L, IF1H, IF2L, IF2H, IF3L) (2/2)
Cautions 1. For details about the bits, see Table 23-2. Be sure to clear bits that are not available to 0.
2. 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.
23.3.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.
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 23-3. Format of Interrupt Mask Flag Registers (MK0L, MK0H, MK1L, MK1H, MK2L, MK2H, MK3L)
Caution For details about the bits, see Table 23-2. Be sure to set bits that are not available to the initial value.
23.3.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 23-4. Format of Priority Specification Flag Registers (PR00L, PR00H, PR01L, PR01H, PR02L, PR02H,
PR03L, PR10L, PR10H, PR11L, PR11H, PR12L, PR12H, PR13L) (1/2)
Figure 23-4. Format of Priority Specification Flag Registers (PR00L, PR00H, PR01L, PR01H, PR02L, PR02H,
PR03L, PR10L, PR10H, PR11L, PR11H, PR12L, PR12H, PR13L) (2/2)
Caution For details about the bits, see Table 23-2. Be sure to set bits that are not available to the initial value.
23.3.4 External interrupt rising edge enable register (EGP0), external interrupt falling edge enable register (EGN0)
These registers specify the valid edge for INTP0 to INTP7.
The EGP0 and EGN0 registers can be set by a 1-bit or 8-bit memory manipulation instruction.
Reset signal generation clears these registers to 00H.
Figure 23-5. Format of External Interrupt Rising Edge Enable Register (EGP0) and External Interrupt Falling Edge
Enable Register (EGN0)
Table 23-3 shows the ports corresponding to the EGPn and EGNn bits.
Caution When the input port pins used for the external interrupt functions are switched to the output mode,
the INTPn interrupt might be generated upon detection of a valid edge.
When switching the input port pins to the output mode, set the port mode register (PMxx) to 0 after
disabling the edge detection (by setting EGPn and EGNn to 0).
Remarks 1. For edge detection port, see 2.1 Port Function List.
2. n = 0 to 7
Note Maximum time does not apply when an instruction from the internal RAM area is executed.
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 23-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?
Higher default
priorityNote than other interrupt No
requests with the same priority
simultaneously
generated?
Interrupt request held pending
Yes
No
IE = 1?
Yes
Interrupt request held pending
Note For the default priority, see Table 23-1 Interrupt Source List.
6 clocks
PSW and PC saved, Interrupt servicing
CPU processing Instruction Instruction jump to interrupt
servicing program
xxIF
9 clocks
8 clocks 6 clocks
xxIF
16 clocks
Caution Can not use the RETI instruction for restoring from the software interrupt.
Table 23-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.
The AX, BC, DE, and HL registers are used for DIVHU/DIVWU. Use these registers by stacking them for
interrupt servicing.
<R>
MOVW AX, #8081H Interrupt1 Interrupt2
PUSH HL PUSH HL
DIVWU
MOVW !addr16, AX
MOVW !addr16, AX
MOVW AX, DE
POP HL POP HL
MOVW !addr16, AX
POP DE POP DE
MOVW AX, HL
POP BC POP BC
MOVW !addr16, AX
POP AX POP AX
RETI RETI
Caution Disable interrupts when executing the DIVHU or DIVWU instruction in an interrupt servicing
routine.
Alternatively, unless they are executed in the RAM area, note that execution of a DIVHU or DIVWU
instruction is possible even with interrupts enabled as long as a NOP instruction is added
immediately after the DIVHU or DIVWU instruction in the assembly language source code. The
following compilers automatically add a NOP instruction immediately after any DIVHU or DIVWU
instruction output during the build process.
- V. 1.71 and later versions of the CA78K0R (Renesas Electronics compiler), for both C and assembly
language source code
- Service pack 1.40.6 and later versions of the EWRL78 (IAR compiler), for C language source code
- GNURL78 (KPIT compiler), for C language source code
Figure 23-11 shows the timing at which interrupt requests are held pending.
××IF
The standby function reduces the operating current of the system, and the following three modes are available.
In all these 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. Do not
set to the STOP mode 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.
2. When shifting to the STOP mode, be sure to stop the peripheral hardware operation operating
with main system clock before executing STOP instruction (except SNOOZE mode setting unit).
3. When using CSI00, UART0, or the A/D converter in the SNOOZE mode, set up serial standby
control register 0 (SSC0) and A/D converter mode register 2 (ADM2) before switching to the
STOP mode. For details, see 18.3 Registers Controlling Serial Array Unit and 14.3 Registers
Controlling A/D Converter.
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 32 OPTION BYTE.
The registers which control the standby function are described below.
Remark For details of registers described above, see CHAPTER 5 CLOCK GENERATOR. For registers which
control the SNOOZE mode, CHAPTER 14 A/D CONVERTER and CHAPTER 18 SERIAL ARRAY UNIT.
Caution Because the interrupt request signal is used to clear the HALT mode, if the interrupt mask flag is 0
(the interrupt processing is enabled) and the interrupt request flag is 1 (the interrupt request signal is
generated), the HALT mode is not entered even if the HALT instruction is executed in such a
situation.
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 fEX: External main system clock
fIL: Low-speed on-chip oscillator clock fXT: XT1 clock
fX: X1 clock fEXS: External subsystem clock
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 fEX: External main system clock
fIL: Low-speed on-chip oscillator clock fXT: XT1 clock
fX: X1 clock fEXS: External subsystem clock
Interrupt
HALT request
instruction
Standby
release signal Note 1
Notes 1. For details of the standby release signal, see Figure 23-1
2. Wait time for HALT mode release
When vectored interrupt servicing is carried out
Main system clock: 15 to 16 clock
Subsystem clock (RTCLPC = 0): 10 to 11 clock
Subsystem clock (RTCLPC = 1): 11 to 12 clock
When vectored interrupt servicing is not carried out
Main system clock: 9 to 10 clock
Subsystem clock (RTCLPC = 0): 4 to 5 clock
Subsystem clock (RTCLPC = 1): 5 to 6 clock
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
Note For the reset processing time, see CHAPTER 25 RESET FUNCTION.
For the reset processing time of the power-on-reset circuit (POR) and voltage detector (LVD), see
CHAPTER 26 POWER-ON-RESET CIRCUIT.
Caution Because the interrupt request signal is used to clear the STOP mode, if the interrupt mask flag is 0
(the interrupt processing is enabled) and the interrupt request flag is 1 (the interrupt request signal
is generated), the STOP mode is immediately cleared if set when the STOP instruction is executed
in such a situation. Accordingly, once the STOP instruction is executed, the system returns to its
normal operating mode after the elapse of release time from the STOP mode.
Remark 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
Interrupt
STOP request
instruction
Notes 1. For details of the standby release signal, see Figure 23-1.
2. STOP mode release time
Supply of the clock is stopped: 18 μs to 65 μs
Wait
When vectored interrupt servicing is carried out: 7 clocks
When vectored interrupt servicing is not carried out: 1 clock
Remarks 1. The clock supply stop time varies depending on the temperature conditions and STOP mode
period.
2. The broken lines indicate the case when the interrupt request that has released the standby mode
is acknowledged.
(2) When high-speed system clock (X1 oscillation) is used as CPU clock
Interrupt
request
STOP
instruction
Notes 1. For details of the standby release signal, see Figure 23-1.
2. STOP mode release time
Supply of the clock is stopped: 18 μs to “whichever is longer 65 μs and the oscillation stabilization
time (set by OSTS)”
Wait
When vectored interrupt servicing is carried out: 10 to 11 clocks
When vectored interrupt servicing is not carried out: 4 to 5 clocks
(3) When high-speed system clock (external clock input) is used as CPU clock
Interrupt
request
STOP
instruction
Notes 1. For details of the standby release signal, see Figure 23-1.
2. STOP mode release time
Supply of the clock is stopped: 18 μs to 65 μs
Wait
When vectored interrupt servicing is carried out: 7 clocks
When vectored interrupt servicing is not carried out: 1 clock
Caution To reduce the oscillation stabilization time after release from the STOP mode while CPU
operates based on the high-speed system clock (X1 oscillation), switch the clock to the high-
speed on-chip oscillator clock temporarily before executing the STOP instruction.
Remarks 1. The clock supply stop time varies depending on the temperature conditions and STOP mode
period.
2. 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
Note For the reset processing time, see CHAPTER 25 RESET FUNCTION.
For the reset processing time of the power-on-reset circuit (POR) and voltage detector (LVD), see
CHAPTER 26 POWER-ON-RESET CIRCUIT.
Remark Transition time from STOP mode to SNOOZE mode varies depending on the temperature conditions and
the STOP mode period.
Remark 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
(2) Timing diagram when the interrupt request signal is generated in the SNOOZE mode
Figure 24-5. When the Interrupt Request Signal is Generated in the SNOOZE Mode
STOP Trigger
instruction detection H
Interrupt request
Standby release L
signal Note 1
Normal operation Note 4
(high-speed SNOOZE mode
on-chip (A/D conversion, Normal operation Note 5
oscillator clock) STOP mode Note 2 UART/CSI) Note 3 (high-speed on-chip oscillator clock)
Status of CPU
Oscillation
High-speed Oscillates Oscillates
stopped
on-chip oscillator
clock
Wait for oscillation accuracy stabilization
Notes 1. For details of the standby release signal, see Figure 23-1.
2. Transition time from STOP mode to SNOOZE mode
3. Transition time from SNOOZE mode to normal operation
4. Enable the SNOOZE mode (AWC = 1 or SWC = 1) immediately before switching to the STOP mode.
5. Be sure to release the SNOOZE mode (AWC = 0 or SWC = 0) immediately after return to the normal
operation.
(3) Timing diagram when the interrupt request signal is not generated in the SNOOZE mode
Figure 24-6. When the Interrupt Request Signal is not Generated in the SNOOZE Mode
STOP Trigger
instruction detection
Standby release L
signal Note 1
Normal operation Note 3
(high-speed SNOOZE mode
on-chip (A/D conversion, STOP mode
oscillator clock) STOP mode Note 2 UART/CSI) (Waiting for a trigger to switch to the SNOOZE mode)
Status of CPU
Oscillation
High-speed Oscillates stopped Oscillates Oscillation stopped
on-chip oscillator
clock
Wait for oscillation accuracy stabilization
Notes 1. For details of the standby release signal, see Figure 23-1.
2. Transition time from STOP mode to SNOOZE mode
3. Enable the SNOOZE mode (AWC = 1 or SWC = 1) immediately before switching to the STOP mode.
Remark For details of the SNOOZE mode function, see CHAPTER 14 A/D CONVERTER and CHAPTER 18
SERIAL ARRAY UNIT.
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 Table 25-1.
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, input a low level to the RESET pin, turn
power on, continue to input a low level to the pin for 10 μs or more within the operating voltage
range shown in 37.4 AC Characteristics, and then input a high level to the pin.
2. During reset input, the X1 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. The port pins become the following state because each SFR and 2nd SFR are initialized after
reset.
P40: High-impedance during the external reset period or reset period by the POR. High level
during other types of reset or after receiving a reset signal (connected to the internal pull-up
resistor).
P130: High-impedance during the reset period. Low level after receiving a reset signal.
Ports other than P40 and P130: High-impedance during the reset period or after receiving a
reset signal.
Internal bus
RL78/I1B
R01UH0407EJ0210 Rev.2.10
Clear Clear Clear Clear Clear Clear
Caution An LVD circuit internal reset does not reset the LVD circuit.
839
RL78/I1B CHAPTER 25 RESET FUNCTION
This LSI is reset by input of the low level on the RESET pin and released from the reset state by input of the high level
on the RESET pin. After reset processing, execution of the program with the high-speed on-chip oscillator clock as the
operating clock starts.
The input buffer of the RESET pin is connected to internal VDD. When using the battery backup function, input signal
based on the voltage of the selected power supply source (VDD pin or VBAT pin).
Release from the reset state is automatic in the case of a reset due to a watchdog timer overflow, execution of an
illegal instruction, detection of a RAM parity error, or detection of illegal memory access. After reset processing, program
execution starts with the high-speed on-chip oscillator clock as the operating clock.
Figure 25-3. Timing of Reset Due to Watchdog Timer Overflow, Execution of Illegal Instruction,
Detection of RAM Parity Error, or Detection of Illegal Memory
Notes 1. 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.
2. Reset times (times for release from the external reset state)
After the first release of the POR: 0.672 ms (typ.), 0.832 ms (max.) when the LVD is in use.
0.399 ms (typ.), 0.519 ms (max.) when the LVD is off.
After the second release of the POR: 0.531 ms (typ.), 0.675 ms (max.) when the LVD is in use.
0.259 ms (typ.), 0.362 ms (max.) when the LVD is off.
After power is supplied, a voltage stabilization waiting time of about 0.99 ms (typ.) and up to 2.30 ms (max.)
is required before reset processing starts after release of the external reset.
3. The state of P40 is as follows.
High-impedance during the external reset period or reset period by the POR.
High level during other types of reset or after receiving a reset signal (connected to the internal pull-up
resistor).
<R>
Reset by POR and LVD circuit supply voltage detection is automatically released when internal VDD ≥ VPOR or internal
VDD ≥ VLVD after the reset. After reset processing, execution of the program with the high-speed on-chip oscillator clock as
the operating clock starts.
For details, see CHAPTER 26 POWER-ON-RESET CIRCUIT or CHAPTER 27 VOLTAGE DETECTOR.
Table 25-1 shows the states of operation during reset periods. Table 25-2 shows the states of the hardware after
receiving a reset signal.
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 For the state of the special function register (SFR) after receiving a reset signal, see 3.2.4 Special function
register (SFR) area and 3.2.5 Extended special function register (2nd SFR: 2nd Special Function
Register) area.
Note 1
Address: FFFA8H After reset: Undefined R
Symbol 7 6 5 4 3 2 1 0
Note 2
TRAP Internal reset request by execution of illegal instruction
0 No internal reset request has been generated, or the RESF register has been cleared.
1 An internal reset request has been generated.
0 No internal reset request has been generated, or the RESF register has been cleared.
1 An internal reset request has been generated.
0 No internal reset request has been generated, or the RESF register has been cleared.
1 An internal reset request has been generated.
0 No internal reset request has been generated, or the RESF register has been cleared.
1 An internal reset request has been generated.
0 No internal reset request has been generated, or the RESF register has been cleared.
1 An internal reset request has been generated.
Notes 1. The value after reset varies depending on the reset source. See Table 25-3.
2. This reset occurs when instruction code FFH is executed.
This reset does not occur during emulation using an in-circuit emulator or an on-chip debugging emulator.
The status of the RESF register when a reset request is generated is shown in Table 25-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
The RESF register is automatically cleared when it is read by an 8-bit memory manipulation instruction.
Figure 25-5 shows the procedure for checking a reset source.
Read the RESF register (clear the RESF register) and store
Read RESF register
the value of the RESF register in any RAM.
Yes
TRAP of RESF
register = 1?
No
Internal reset request by the
execution of the illegal instruction
generated
Yes
WDTRF of RESF
register = 1?
No
Internal reset request by the
watchdog timer generated
Yes
RPERF of RESF
register = 1?
No
Internal reset request by the
RAM parity error generated
Yes
IAWRF of RESF
register = 1?
No
Internal reset request by the
illegal memory access generated
Yes
LVIRF of RESF
register = 1?
No
Internal reset request
by the voltage detector generated
Power-on-reset/external
reset generated
Cautions 1. The PORSR register is reset only by a power-on reset; it retains the value when a reset caused by
another factor occurs.
2. If the PORF bit is set to 1, it guarantees that no power-on reset has occurred, but it does not
guarantee that the RAM value is retained.
PORSR 0 0 0 0 0 0 0 PORF
Note Internal power supply voltage (internal VDD) when using the battery backup function.
Caution If an internal reset signal is generated in the power-on-reset circuit, the reset control flag register
(RESF) and power-on-reset status register (PORSR) are cleared to 00H.
Remarks 1. The RL78 microcontroller 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 25 RESET FUNCTION.
2. Whether an internal reset has been generated by the power-on reset circuit can be checked by using
the power-on-reset status register (PORSR). For details of the PORSR register, see CHAPTER 25
RESET FUNCTION.
3. VPOR: POR power supply rise detection voltage
VPDR: POR power supply fall detection voltage
For details, see 37.6.5 POR circuit characteristics.
VDD Note
VDD Note
+
Internal reset signal
Reference
voltage
source
Note Internal power supply voltage (internal VDD) when using the battery backup function.
The timing of generation of the internal reset signal by the power-on-reset circuit and voltage detector is shown below.
(1) When the externally input reset signal on the RESET pin is used
0V
RESET pin
At least 10 μs
Wait for oscillation
Note 1
Wait for oscillation accuracy stabilization
Note 1
accuracy stabilization
High-speed on-chip
oscillator clock (fIH)
Starting oscillation Starting oscillation
is specified is specified by software
High-speedsystem by software
clock (fMX)
(when X1 oscillation Reset
Reset processing time Normal operation
is selected) period
when external reset Normal operation (high-speed (oscillation
(high-speed on-chip
is released. Note 3 on-chip oscillator clock) Note 2 stop) oscillator clock) Note 2
CPU Operation stops Operation stops
Voltage stabilization wait Reset processing time when
0.99 ms (TYP.), 2.30 ms (MAX.) external reset is released. Note 3
Notes 1. The internal reset processing time includes the oscillation accuracy stabilization time of the high-speed on-
chip oscillator clock.
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.
<R> 3. The time until normal operation starts includes the following reset processing time when the external reset
is released (release from the first external reset following release from the POR state) after the RESET
signal is driven high (1) as well as the voltage stabilization wait time after VPOR (1.51 V, typ.) is reached.
Reset processing time when the external reset is released is shown below.
Release from the first external reset following release from the POR state:
0.672 ms (typ.), 0.832 ms (max.) (when the LVD is in use)
0.399 ms (typ.), 0.519 ms (max.) (when the LVD is off)
<R> 4. Reset times in cases of release from an external reset other than the above are listed below.
Release from the reset state for external resets other than the above case:
0.531 ms (typ.), 0.675 ms (max.) (when the LVD is in use)
0.259 ms (typ.), 0.362 ms (max.) (when the LVD is off)
5. After power is supplied, the reset state must be retained until the operating voltage becomes in the range
defined in 37.4 AC Characteristics. This is done by controlling the externally input reset signal. After
power supply is turned off, this LSI should be placed in the STOP mode, or in the reset state by utilizing the
voltage detection circuit or externally input reset signal, before the voltage falls below the operating range.
When restarting the operation, make sure that the operation voltage has returned within the range of
operation.
Caution For power-on reset, be sure to use the externally input reset signal on the RESET pin when the LVD is
off. For details, see CHAPTER 27 VOLTAGE DETECTOR.
(2) LVD interrupt & reset mode (option byte 000C1H: LVIMDS1, LVIMDS0 = 1, 0)
0V
Wait for oscillation Wait for oscillation
Note 1 Note 1
accuracy stabilization accuracy stabilization
High-speed on-chip
oscillator clock (fIH)
Starting oscillation is specified by software Starting oscillation is specified by software
High-speedsystem
clock
(fMX)(when X1 oscillation
is selected) Normal operation (high-speed
Normal operation (high-speed Reset period on-chip oscillator clock) Note 2
on-chip oscillator clock) Note 2 (oscillation stop)
CPU Operation stops Operation stops
LVD reset processing time Note 4 LVD reset processing time Note 4
Voltage stabilization wait + POR reset processing time Voltage stabilization wait + POR reset processing time
1.64 ms (TYP.), 3.10 ms (MAX.) 1.64 ms (TYP.), 3.10 ms (MAX.)
INTLVI
Notes 1. The internal reset processing time includes the oscillation accuracy stabilization time of the high-speed on-
chip oscillator clock.
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.
<R> 3. After the interrupt request signal (INTLVI) is generated, the LVILV and LVIMD bits of the voltage detection
level register (LVIS) are automatically set to 1. After INTLVI is generated, appropriate settings should be
made according to Figure 27-8 Setting Procedure for Operating Voltage Check/Reset and Figure 27-9
Initial Setting of Interrupt and Reset Mode, taking into consideration that the supply voltage might return
to the high voltage detection level (VLVDH) or higher without falling below the low voltage detection level
(VLVDL).
4. The time until normal operation starts includes the following LVD reset processing time after the LVD
detection level (VLVDH) is reached as well as the voltage stabilization wait + POR reset processing time after
the VPOR (1.51 V, typ.) is reached.
LVD reset processing time: 0 ms to 0.0701 ms (max.)
0V
Wait for oscillation Note 1 Wait for oscillation Note 1
accuracy stabilization accuracy stabilization
High-speed on-chip
oscillator clock (fIH) Starting oscillation Starting oscillation
is specified by software is specified by software
High-speed
system clock (fMX)
(when X1 oscillation
Normal operation Reset period Normal operation Reset period
is selected) (high-speed on-chip (oscillation (high-speed on-chip (oscillation
oscillator clock) Note 2 stop) oscillator clock) Note 2 stop)
CPU Operation stops
LVD reset processing
time Note 3
Voltage stabilization wait + POR reset
processing time 1.64 ms (TYP.), LVD reset processing
3.10 ms (MAX.) time Note 4
Notes 1. The internal reset processing time includes the oscillation accuracy stabilization time of the high-speed on-
chip oscillator clock.
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 time until normal operation starts includes the following LVD reset processing time after the LVD
detection level (VLVD) is reached as well as the voltage stabilization wait + POR reset processing time after
the VPOR (1.51 V, typ.) is reached.
LVD reset processing time: 0 ms to 0.0701 ms (max.)
4. When the power supply voltage is below the lower limit for operation and the power supply voltage is then
restored after an internal reset is generated only by the voltage detector (LVD), the following LVD reset
processing time is required after the LVD detection level (VLVD) is reached.
LVD reset processing time: 0.0511 ms (typ.), 0.0701 ms (max.)
The operation mode and detection voltages (VLVDH, VLVDL, VLVD) for the voltage detector is set by using the option byte
(000C1H).
The voltage detector (LVD) has the following functions.
The LVD circuit compares the internal power supply voltage (internal VDD) that supplied from the VDD or VBAT pin
with the detection voltage (VLVDH, VLVDL, VLVD), and generates an internal reset or internal interrupt signal.
The detection level for the internal power supply detection voltage (VLVDH, VLVDL, VLVD) can be selected by using the
option byte as one of 11 levels (for details, see CHAPTER 32 OPTION BYTE).
Operable in STOP mode.
<R> After power is supplied, the reset state must be retained until the operating voltage becomes in the range defined in
37.4 AC Characteristics. This is done by utilizing the voltage detector or controlling the externally input reset
signal. After the power supply is turned off, this LSI should be placed in the STOP mode, or placed in the reset state
by utilizing the voltage detection circuit or controlling the externally input reset signal before the voltage falls below
the operating range. The range of operating voltage varies with the setting of the user option byte (000C2H or
010C2H).
The reset and internal interrupt signals are generated in each mode as follows.
While the voltage detector is operating, whether the internal 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 25 RESET FUNCTION.
N-ch
Internal reset signal
Voltage detection
level selector
Controller
+
VLVDH
Selector
−
VLVDL/VLVD
INTLVI
Internal bus
Note 1 Note 2
Address: FFFA9H After reset: 00H R/W
Symbol <7> 6 5 4 3 2 <1> <0>
Note 3
LVIM LVISEN 0 0 0 0 0 LVIOMSK LVIF
Note 3
LVISEN Specification of whether to enable or disable rewriting the voltage detection level
register (LVIS)
0 Disabling of rewriting the LVIS register (LVIOMSK = 0 (Mask of LVD output is invalid)
1 Enabling of rewriting the LVIS register (LVIOMSK = 1 (Mask of LVD output is valid)
0 Internal power supply voltage (internal VDD) detection voltage (VLVD), or when LVD is off
1 Internal power supply voltage (internal VDD) < detection voltage (VLVD)
Note 1
Address: FFFAAH After reset: 00H/01H/81H R/W
Symbol <7> 6 5 4 3 2 1 <0>
Note 2 Note 2
LVIS LVIMD 0 0 0 0 0 0 LVILV
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
2. Writing “0” can only be allowed in the interrupt & reset mode (option byte LVIMDS1, LVIMDS0 = 1, 0). Do
not set LVIMD and LVILV in other cases. The value is switched automatically when reset or interrupt is
generated in the interrupt & reset mode.
Cautions 1. Rewrite the value of the LVIS register according to Figures 27-8 and 27-9.
2. Specify the LVD operation mode and detection voltage (VLVDH, VLVDL, VLVD) of each mode by
using the option byte 000C1H. Figure 27-4 shows the format of the user option byte
(000C1H/010C1H). For details about the option byte, see CHAPTER 32 OPTION BYTE.
Figure 27-4. LVD Operation Mode and Detection Voltage Settings for User Option Byte (000C1H) (1/2)
Note
Address: 000C1H/010C1H
7 6 5 4 3 2 1 0
VPOC2 VPOC1 VPOC0 1 LVIS1 LVIS0 LVIMDS1 LVIMDS0
1.98 V 1.94 V 0 0 1 1 0 1 1
2.09 V 2.04 V 0 1 0 1
2.50 V 2.45 V 1 0 1 1
2.61 V 2.55 V 1 0 1 0
2.71 V 2.65 V 1 0 0 1
2.81 V 2.75 V 1 1 1 1
2.92 V 2.86 V 1 1 1 0
3.02 V 2.96 V 1 1 0 1
3.13 V 3.06 V 0 1 0 0
3.75 V 3.67 V 1 0 0 0
4.06 V 3.98 V 1 1 0 0
Setting of values other than above is prohibited.
Note Set the same value as 000C1H to 010C1H when the boot swap operation is used because 000C1H is replaced
by 010C1H.
Remarks 1. For details on the LVD circuit, see CHAPTER 27 VOLTAGE DETECTOR.
2. The detection voltage is a TYP. value. For details, see 37.6.6 LVD circuit characteristics.
Figure 27-4. LVD Operation Mode and Detection Voltage Settings for User Option Byte (000C1H) (2/2)
Note
Address: 000C1H/010C1H
7 6 5 4 3 2 1 0
VPOC2 VPOC1 VPOC0 1 LVIS1 LVIS0 LVIMDS1 LVIMDS0
1.98 V 1.94 V 0 0 1 1 0 0 1
2.09 V 2.04 V 0 1 0 1
2.50 V 2.45 V 1 0 1 1
2.61 V 2.55 V 1 0 1 0
2.71 V 2.65 V 1 0 0 1
2.81 V 2.75 V 1 1 1 1
2.92 V 2.86 V 1 1 1 0
3.02 V 2.96 V 1 1 0 1
3.13 V 3.06 V 0 1 0 0
3.75 V 3.67 V 1 0 0 0
4.06 V 3.98 V 1 1 0 0
Setting of values other than above is prohibited.
LVD off setting (use of external reset input via RESET pin)
Detection voltage Option byte Setting Value
VLVD VPOC2 VPOC1 VPOC0 LVIS1 LVIS0 Mode setting
Rising edge Falling edge LVIMDS1 LVIMDS0
1 1
Setting of values other than above is prohibited.
Note Set the same value as 000C1H to 010C1H when the boot swap operation is used because 000C1H is replaced
by 010C1H.
The operation is started in the following initial setting state when the reset mode is set.
Bit 7 (LVISEN) of the voltage detection register (LVIM) is set to 0 (disable rewriting of voltage detection level
register (LVIS))
The initial value of the voltage detection level select register (LVIS) is set to 81H.
Bit 7 (LVIMD) is 1 (reset mode).
Bit 0 (LVILV) is 1 (low-voltage detection level: VLVD).
Figure 27-5 shows the timing of the internal reset signal generated in the LVD reset mode.
Time
Cleared
LVIF flag
Cleared
LVIRF flag
(RESF register)
The operation is started in the following initial setting state when the interrupt mode is set.
Bit 7 (LVISEN) of the voltage detection register (LVIM) is set to 0 (disable rewriting of voltage detection level
register (LVIS))
The initial value of the voltage detection level select register (LVIS) is set to 01H.
Bit 7 (LVIMD) is 0 (interrupt mode).
Bit 0 (LVILV) is 1 (low-voltage detection level: VLVD).
Figure 27-6 shows the timing of the interrupt request signal generated in the LVD interrupt mode.
Note 2 Note 2
Internal power supply voltage
(internal VDD)
VLVD
Time
LVIMD flag
H
LVILV flag
INTLVI
LVIIF flag
The operation is started in the following initial setting state when the interrupt & reset mode is set.
Bit 7 (LVISEN) of the voltage detection register (LVIM) is set to 0 (disable rewriting of voltage detection level
register (LVIS))
The initial value of the voltage detection level select register (LVIS) is set to 00H.
Bit 7 (LVIMD) is 0 (interrupt mode).
Bit 0 (LVILV) is 0 (high-voltage detection level: VLVDH).
Figure 27-7 shows the timing of the internal reset signal and interrupt signal generated in the LVD interrupt & reset
mode.
Figure 27-7. Timing of Voltage Detector Reset Signal and Interrupt Signal Generation
(Option Byte LVIMDS1, LVIMDS0 = 1, 0) (1/2)
Cleared by software
Cleared by Normal Wait for stabilization by software (400 μs or 5 clocks of fIL)Note 3
software operation
{
Operation status RESET Normal Save RESET Normal RESET
operation processing operation
Save processing
Cleared
LVIF flag
LVISEN flag
(set by software)
LVIOMSK flag
LVIMD flag
LVILV flag
Cleared by
LVIRF flag softwareNote 2
Cleared
LVD reset signal
INTLVI
LVIIF flag
Figure 27-7. Timing of Voltage Detector Reset Signal and Interrupt Signal Generation
(Option Byte LVIMDS1, LVIMDS0 = 1, 0) (2/2)
When a condition of VDD is internal VDD < VLVIH after releasing the mask,
a reset is generated because of LVIMD = 1 (reset mode).
Time
LVIMK flag
Note 1
(set by software) H
Cleared by software
Cleared by
software Wait for stabilization by software (400 μs or 5 clocks of fIL)Note 3
Cleared
LVIF flag
LVISEN flag
(set by software)
LVIOMSK flag
LVIMD flag
LVILV flag
Cleared by
softwareNote 2
LVIRF flag
Cleared
INTLVI
LVIIF flag
INTLVI generated
LVILV = 0
Set the LVILV bit to 0 to set the high-voltage
detection level (VLVDH).
No
LVIOMSK = 0
Yes
The MCU returns to normal operation when internal
Yes reset by voltage detector (LVD) is not generated,
LVD reset generated
since a condition of VDD becomes internal power
supply voltage (internal VDD) VLVDH.
No
When setting an interrupt and reset mode (LVIMDS1, LVIMDS0 = 1, 0), voltage detection stabilization wait time for 400
μs or 5 clocks of fIL is necessary after LVD reset is released (LVIRF = 1). After waiting until voltage detection stabilizes,
(0) clear the LVIMD bit for initialization. While voltage detection stabilization wait time is being counted and when the
LVIMD bit is rewritten, set LVISEN to 1 to mask a reset or interrupt generation by LVD.
Figure 27-9 shows the procedure for initial setting of interrupt and reset mode.
Power application
No
LVIRF = 1 ? Check internal reset generation by LVD circuit
Yes
Normal operation
<Action>
After releasing the reset signal, wait for the internal power supply voltage fluctuation period of each system by means
of a software counter that uses a timer, and then initialize the ports.
Figure 27-10. Example of Software Processing If Internal Power Supply Voltage Fluctuation is 50 ms or Less in
Vicinity of LVD Detection Voltage
Reset
Clearing WDT
Note
No 50 ms have passed?
(TMIFmn = 1?)
Yes
Note If reset is generated again during this period, initialization processing <2> is not started.
Remark m = 0, 1
n = 0 to 7
(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 internal power supply voltage (internal VDD) < LVD detection voltage (VLVD) until the
time LVD reset has been generated.
In the same way, there is also some delay from the time LVD detection voltage (VLVD) internal power supply voltage
(internal VDD) until the time LVD reset has been released (see Figure 27-11).
Figure 27-11. Delay from the Time LVD Reset Source Is Generated
Until the Time LVD Reset has Been Generated or Released
VLVD
Time
<1> <1>
(4) Operating voltage fall when LVD is off or LVD interrupt mode is selected
When the operating voltage falls with the LVD is off or with the LVD interrupt mode is selected, this LSI should be
placed in the STOP mode, or placed in the reset state by controlling the externally input reset signal, before the
voltage falls below the operating voltage range defined in 37.4 AC characteristics. When restarting the operation,
make sure that the internal power supply voltage has returned within the range of operation.
This function monitors the supply voltage at the VDD pin, and switches the internal power supply from the dedicated
battery backup power pin (VBAT pin) when the voltage at the VDD pin falls below the detection voltage. The mode used to
supply the internal power from the VBAT pin is referred to as battery backup mode. Even if power supply from the VDD pin
is cut off due to a power outage, operation of real-time clock 2 (RTC2) can be continued by switching to battery backup
mode by hardware. In addition to real-time clock 2 (RTC2), the CPU, the 10-bit A/D converter, the on-chip temperature
sensor, the comparator, external interrupts, and VDD power supply system I/ONote can be operated in battery backup mode.
When the voltage at the VDD pin falls to or below the detection voltage, the internal power supply can be switched
from VDD supply to VBAT supply. When the voltage at the VDD pin rises to or above the detection voltage again, the
internal power supply can be switched from VBAT supply to VDD supply.
When VBAT VDD, internal power supply can be switched to VBAT by software.
A power switching detection interrupt (INTVBAT) can be generated when the power is switched. However, no
interrupt is generated when the power is switched by software, and an interrupt is generated when the supply
voltage at the VDD pin reaches the detection voltage.
Figure 28-1 shows the block diagram of the battery backup function.
VBAT pin
Internal power supply voltage (internal VDD)
VDD pin
VDETBAT
Switch
controller
Interrupt output
controller INTVBAT
Sync
circuit
BUPCTL0 BUPCTL1
VBATCMP M VBATE N VBATSE L VBATIS VBATIE BUPPTR
register register
Data bus
Name Function
28.2 Registers
Figure 28-2. Format of Battery Backup Power Switching Control Register 0 (BUPCTL0) (1/2)
Note 1
Address: F0330H After reset: 00H R/W
Symbol <7> 6 5 4 <3> <2> <1> <0>
Note 2
VBATEN Power switching operation control
Note 3
0 Power switching function stops
1 Power switching function operates
Notes 1. VBATEN (bit 7) and VBATSEL (bit 0) are cleared to 0 only when a power-on reset is generated.
2. To set the VBATEN bit to 1, write 0 and then write 1 to this bit. If a value is written to an SFR other than
BUPCTL0 after 0 has been written, the VBATEN bit cannot be set to 1.
To set the VBATEN bit to 0, write 1 and then write 0 to this bit. If a value is written to an SFR other than
BUPCTL0 after 1 has been written, the VBATEN bit cannot be set to 0.
3. Prohibits the disable switch power supply function (VBATEN =0 ) while supplying internal power with VBAT.
Be sure to check that the VBATCMPM bit is 0 and the internal power supply is VDD before disabling the
switch power supply function (VBATEN = 0).
Figure 28-2. Format of Battery Backup Power Switching Control Register 0 (BUPCTL0) (2/2)
0 Interrupt signal generated when VDD pin voltage < power switching detection voltage (VDETBAT1)
Note
Interrupt generated when VDD is switched to VBAT
Interrupt signal generated when VDD pin voltage power switching detection voltage (VDETBAT2)
1 Note
Interrupt generated when VBAT is switched to VDD
Note
VBATSEL Power supply pin selection
0 The supply source is switched by hardware depending on the potential of VDD pin.
1 Power is supplied from VBAT pin.
Note To set the VBATSEL bit to 1, write 0 and then write 1 to this bit. If a value is written to an SFR other than BUPCTL0
after 0 has been written, the VBATSEL bit cannot be set to 1.
To set the VBATSEL bit to 0, write 1 and then write 0 to this bit. If a value is written to an SFR other than BUPCTL0
after 1 has been written, the VBATSEL bit cannot be set to 0.
Figure 28-3. Format of Battery Backup Power Switching Control Register 1 (BUPCTL1)
BUPCTL1 BUPPRT 0 0 0 0 0 0 0
Note Port pin other than P20 to P25, P121 to P124, and P137.
Because the power supply of the I/O buffer switches to VDD or VBAT pin with the battery backup function, I/O of
P20 to P25, P121 to P124, and P137 can be used even when GDIDIS is set to 1.
See Table 2-1 Pin I/O Buffer Power Supplies for the I/O buffer power of the pins.
28.3 Operation
Figure 28-5. Battery Backup Operation (1) with VBATEN = 1 and VBATSEL = 0
Note For details about the power rising and falling slopes, see CHAPTER 37 ELECTRICAL SPECIFICATIONS.
Figure 28-6. Battery Backup Operation (2) with VBATEN = 1 and VBATSEL = 1
(1) When not using the battery backup function, connect the VBAT and Vss pins to the same potential.
(2) Setting VBATSEL = 1 is prohibited when VDD > VBAT.
(3) Be sure VBAT does not drop below 1.9 V when VBATSEL = 1.
(4) Do not set VBATEN and VBATSEL at the same time.
(5) Do not set VBATEN to 0 while VBATSEL is 1.
(6) For details about the power rising and falling slopes, see CHAPTER 37 ELECTRICAL SPECIFICATIONS.
(7) The self-programming function cannot be used when the internal power is supplied from the VBAT pin.
(8) The on-chip debug function cannot be used when the internal power is supplied from the VBAT pin.
(9) When switching the power supply by hardware (VBATEN = 1, VBATSEL = 0), disable the input buffer with the
GDIDIS register (GDIDIS = 01H) to prevent leak current at the EVDD port pin when the power is switched to VBAT.
(10) When switching the power supply by hardware (VBATEN = 1, VBATSEL = 0), input signal must be designed so
that it does not exceed the EVDD voltage because the input buffer of the EVDD port pin is controlled by the EVDD
voltage when the power is switched to VBAT.
(11) Prohibits the disable switch power supply function (VBATEN = 0) while supplying internal power with VBAT. Be
sure to check that the VBATCMPM bit is 0 and the internal power supply is VDD before disabling the switch power
supply function (VBATEN = 0).
The oscillation stop detection circuit monitors the subsystem clock (fSUB) operating status with a low-speed on-chip
oscillator clock (fIL). If it detects that operation is stopped longer than a predefined interval, it assumes that an XT1
oscillator circuit error has occurred and outputs an oscillation stop interrupt signal.
When the system is reset, operation of the oscillation stop detector must be enabled by software after the reset period
ends.
Operation of the oscillation stop detector is stopped by software. Or, oscillation stop detection operation is stopped by
reset from the RESET pin or internal reset due to execution of an invalid instructionNote. Furthermore, since the oscillation
of XT1 oscillator clock is also stopped with an internal reset, after a reset, enable oscillation stop detection operation after
resuming oscillation of the XT1 oscillation clock with software.
The period used by the oscillation stop detector to judge that oscillation is stopped (oscillation stop judgment time) can
be set by using the OSDCCMP11 to OSDCCMP0 bits of the oscillation stop detection control register (OSDC).
Oscillation stop judgment time = Low-speed on-chip oscillator clock (fIL) cycle × ((value of OSDCCMP11 to OSDCCMP0)
+ 1)
OSDCCMP11 to OSDCCMP0 = 003H: 232 μs (MIN.), 267 μs (TYP.), 314 μs (MAX.)
OSDCCMP11 to OSDCCMP0 = FFFH: 237 ms (MIN.), 273 ms (TYP.), 322 ms (MAX.)
Item Configuration
Clear Clear
fSUB
Count clock
fIL
12-bit counter
Oscillation stop
detection interrupt signal
Oscillation stop
detection signal INTOSDC
output controller
Match
Clear
Oscillation stop
detection control OSDCE OSDCEN Peripheral enable
OSDCCMP11-OSDCCMP0
register (OSDC) register 1 (PER1)
Internal bus
Cautions 1. When using the oscillation stop detector, be sure to set the OSDCEN bit to 1. If OSDCEN
= 0, writing to a control register of the oscillation stop detector is ignored, and, even if
the register is read, only the default value is read.
2. Be sure to set bits 2 and 1 to “0”.
Figure 29-3. Format of Subsystem Clock Supply Mode Control Register (OSMC)
RTCLPC In STOP mode and in HALT mode while the CPU operates using the subsystem clock
WUTMMCK0 Selection of operation clock Selection of clock output from Operation of subsystem
Notes 1, 2, 3
for real-time clock 2, 12-bit PCLBUZn pin of clock clock frequency
interval timer, and LCD output/buzzer output controller measurement circuit.
controller/driver. and selection of operation clock
for 8-bit interval timer.
Notes 1. The fIL clock can be selected (WUTMMCK0 = 1) only when oscillation of the subsystem clock is
stopped (the XTSTOP bit in the CSC register = 1).
2. When WUTMMCK0 is set to 1, the low-speed on-chip oscillator clock oscillates.
3. When WUTMMCK0 is set to 1, the 1 Hz output function of real-time clock 2 cannot be used.
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 = 15 kHz) is selected, only the constant-period
interrupt function is available.
However, the constant-period interrupt interval when fIL is selected will be calculated
with the constant-period (the value selected with RTCC0 register) × 1/fIL.
Symbol 7 6 5 4 3 2 1 0
OSDCCMP11 to
Oscillation stop judgment time
OSDCCMP0
000H Setting prohibited
...
002H
003H These bits specify the oscillation stop judgment time.
... It is judged that oscillation has stopped when oscillation has been stopped for (A-2) to
FFFH (A+1) clock cycles, where A refers to the time specified by these bits.
Oscillation stop judgment time = Low-speed on-chip oscillator clock (fIL) cycle ×
((value of OSDCCMP11 to OSDCCMP0) + 1)
Cautions 1. Be sure to set the OSDCE bit to “0” (to stop operation of the oscillation stop detector) before
changing the setting of the OSDCCMP11 to OSDCCMP0 bits.
2. The oscillation stop detector stops oscillation stop detection by setting the OSDCE bit to 0 by
software or by reset from the RESET pin or internal reset due to execution of an invalid
instructionNote.
Furthermore, since the oscillation of XT1 oscillator clock is also stopped with an internal reset,
after a reset, enable oscillation stop detection operation after resuming oscillation of the XT1
oscillation clock with software.
3. Be sure to set bits 14 to 12 to “0”.
1. The subsystem clock starts operating after the external reset ends.
2. A value is written to the oscillation stop detection control register (OSDC) and the oscillation stop detector starts
operating.
3. While the oscillation stop detector is operating, if the subsystem clock (fSUB) stops oscillating continuously for a
period equal to the oscillation stop judgment time or longer, the oscillation stop detector outputs the oscillation stop
detection interrupt signal (INTOSDC).
Reset state
OSDCEN
OSDCE
fSUB
12-bit counter
Oscillation stop
judgment timeNote
INTOSDC
Note It is judged that oscillation has stopped when oscillation has been stopped for (A-2) to (A+1) clock cycles, where
A refers to the time specified by these bits.
The oscillation stop detector should be used in conjunction with the watchdog timer.
Oscillation stop detection can be used under either of the following conditions:
When bit 0 (WDSTBYON) and bit 4 (WDTON) of the option byte (000C0H) are set to 1 and bit 4 (WUTMMCK0) of the
OSMC register is set to 0
When bit 4 (WUTMMCK0) of the OSMC register is set to 1
The following safety functions are provided in the RL78/I1B 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/I1B 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.
(8) Digital output signal level detection function for I/O pins
When the I/O pins are output mode, the output level of the pin can be read.
Remark For usage examples of the safety functions complying with the IEC60730 safety standards, refer to the
RL78 MCU series IEC60730/60335 self test library application note (R01AN1062, R01AN1296).
The safety functions use the following registers for each function.
Flash memory CRC control register (CRC0CTL) Flash memory CRC operation function
Flash memory CRC operation result register (PGCRCL) (high-speed CRC)
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
Port mode select register (PMS) Digital output signal level detection function for I/O
ports
Caution The CRC operation result might differ during on-chip debugging because the monitor program is
allocated.
Remark The operation result is different between the high-speed CRC and the general CRC, because the general
CRC operates in LSB first order.
Note
FEA2 FEA1 FEA0 High-speed CRC operation range
0 0 0 0000H to 3FFBH (16 K-4 bytes)
0 0 1 0000H to 7FFBH (32 K-4 bytes)
0 1 0 0000H to BFFBH (48 K-4 bytes)
0 1 1 0000H to FFFBH (64 K-4 bytes)
1 0 0 00000H to 13FFBH (80 K-4 bytes)
1 0 1 00000H to 17FFBH (96 K-4 bytes)
1 1 0 00000H to 1BFFBH (112 K-4 bytes)
1 1 1 00000H to 1FFFBH (128 K-4 bytes)
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 30-2. Format of Flash Memory CRC Operation Result Register (PGCRCL)
7 6 5 4 3 2 1 0
Caution The PGCRCL register can only be written if CRC0EN (bit 7 of the CRC0CTL register) = 1.
Figure 30-3 shows the flowchart of flash memory CRC operation function (high-speed CRC).
<Operation flow>
Figure 30-3. Flowchart of Flash Memory CRC Operation Function (High-speed CRC)
Copy HALT and RET instructions to ; Copy the HALT and RET instructions to the
; RAM to execute in the RAM.
RAM, initialize 10 bytes
; Initialize the 10 bytes after the RET instruction.
CRC0EN = 1
; Enable CRC operation
PGCRCL = 0000H
; Initialize the CRC operation result register
CRC operation
completed? No
Yes
; When the CRC operation is complete, the HALT
Execute RET instruction. ; mode is released and control is returned from RAM
Correctly complete
The expected CRC value can be calculated by using the Integrated Development Environment CubeSuite+. See the
Integrated Development Environment CubeSuite+ user’s manual for details.
Bit reverse
Bit reverse data 0001 1110 0110 1010 0010 1100 0100 1000
Bit reverse
Caution Because the debugger rewrites the software break setting line to a break instruction during
program execution, the CRC operation result differs if a software break is set in the CRC operation
target area.
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
1 clock wait (fCLK)
Caution The parity bit is appended when data is written, and the parity is checked when the data is read.
Therefore, while RAM parity error resets are enabled (RPERDIS = 0), be sure to initialize RAM areas
where data access is to proceed before reading data.
The RL78’s CPU executes look-ahead 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, while RAM parity error resets are enabled (RPERDIS = 0), be sure to initialize the RAM
area + 10 bytes when instructions are fetched from RAM areas.
Start of check
Note Yes
RPERF = 1
No
RPERDIS = 1 Disable parity error reset.
Check RAM.
Check RAM. Read RAM.
Yes
Parity error No RPEF = 1 Parity error
generated? generation
No checked
Yes
Enable parity
RPERDIS = 0
error reset.
Note To check internal reset status using a RAM parity error, see CHAPTER 25 RESET FUNCTION.
Figure 30-9. 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.
Figure 30-10. Format of Invalid Memory Access Detection Control Register (IAWCTL)
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)
256 byte
NG
FFF00H
FFEFFH General-purpose register
32 byte OK
FFEE0H
FFEDFH
RAMNote
OK
zzzzzH
OK
Mirror NG NG
F1000H
F0FFFH
Reserved OK
F0800H
F07FFH
OK
Special function register (2nd SFR) NG
2 Kbyte
F0000H
EFFFFH
OK
EF000H
EEFFFH
NG NG NG
Reserved
yyyyyH
xxxxxH
OK OK
Flash memory Note
00000H
Note Code flash memory and RAM address of each product are as follows.
<R> Products Code flash memory RAM Detected lowest address
(00000H to xxxxxH) (zzzzzH to FFEFFH) for read/instruction fetch
(execution) (yyyyyH)
R5F10MME, R5F10MPE 65536 8 bits (00000H to 0FFFFH) 6144 8 bits (FE700H to FFEFFH) 10000H
R5F10MMG, R5F10MPG 131072 8 bits (00000H to 1FFFFH) 8192 8 bits (FDF00H to FFEFFH) 20000H
Figure 30-12. Format of Invalid Memory Access Detection Control Register (IAWCTL)
Note
IAWEN Control of invalid memory access detection
Note Only writing 1 to the IAWEN bit is enabled, not writing 0 to it after setting it to 1.
Remark By specifying WDTON = 1 (watchdog timer operation enable) for the option byte (000C0H), the invalid
memory access function is enabled even IAWEN = 0.
<Clocks to be compared>
<1> CPU/peripheral hardware clock frequency (fCLK):
High-speed on-chip oscillator clock (fIH)
High-speed system clock (fMX)
<2> Input to channel 5 of the timer array unit
Timer input to channel 5 (TI05)
Low-speed on-chip oscillator clock (fIL: 15 kHz (typ.))
Subsystem clock (fSUB)
High-speed on-chip
oscillator clock (fIH)
fCLK
Selector
High-speed system
clock (fMX)
<1>
<2>
array unit 0
Subsystem clock (TAU0)
(fSUB)
If input pulse interval measurement results in an abnormal value, it can be concluded that the clock frequency is
abnormal.
For how to execute input pulse interval measurement, see 7.8.3 Operation as input pulse interval measurement.
<1> Select the ANIx pin for A/D conversion using the ADTES register (ADTES1 = 0, ADTES0 = 0).
<2> Perform A/D conversion for the ANIx pin (conversion result 1-1).
<3> Select the A/D converter’s negative reference voltage for A/D conversion using the ADTES register (ADTES1 = 1,
ADTES0 = 0)
<4> Perform A/D conversion of the negative reference voltage of the A/D converter (conversion result 2-1).
<5> Select the ANIx pin for A/D conversion using the ADTES register (ADTES1 = 0, ADTES0 = 0).
<6> Perform A/D conversion for the ANIx pin (conversion result 1-2).
<7> Select the A/D converter’s positive reference voltage for A/D conversion using the ADTES register (ADTES1 = 1,
ADTES0 = 1)
<8> Perform A/D conversion of the positive reference voltage of the A/D converter (conversion result 2-2).
<9> Select the ANIx pin for A/D conversion using the ADTES register (ADTES1 = 0, ADTES0 = 0).
<10> Perform A/D conversion for the ANIx pin (conversion result 1-3).
<11> Check that the conversion results 1-1, 1-2, and 1-3 are equal.
<12> Check that the A/D conversion result 2-1 is all zero and conversion result 2-2 is all one.
Using the procedure above can confirm that the analog multiplexer is selected and all wiring is connected.
Remarks 1. If the analog input voltage is variable during A/D conversion in steps <1> to <10> above, use another
method to check the analog multiplexer.
2. The conversion results might contain an error. Consider an appropriate level of error when comparing
the conversion results.
ADISS
ADS4 to ADS0
ANI0/AVREFP
ANI1/AVREFM
ANIxx
Temperature
sensor 2Note
Internal reference
voltage (1.45 V)Note
Positive reference voltage
of A/D converter
VDD
ADREFM
Note Temperature sensor output voltage/internal reference voltage (1.45 V) can be used only in HS (high-
speed main) mode.
ADISS ADS4 ADS3 ADS2 ADS1 ADS0 Analog input Input source
channel
0 0 0 0 0 0 ANI0 P20/ANI0/AVREFP pin
0 0 0 0 0 1 ANI1 P21/ANI1/AVREFM pin
0 0 0 0 1 0 ANI2 P22/ANI2 pin
0 0 0 0 1 1 ANI3 P23/ANI3 pin
0 0 0 1 0 0 ANI4 P24/ANI4 pin
0 0 0 1 0 1 ANI5 P25/ANI5 pin
0 1 1 1 0 1 Temperature sensor 2
Note
output voltage
1 0 0 0 0 1 Internal reference voltage
Note
(1.45 V)
Other than above Setting prohibited
30.3.9 Digital output signal level detection function for I/O ports
In the IEC60730, it is required to check that the I/O function correctly operates.
By using the digital output signal level detection function for I/O pins, the digital output level of the pin can be read when
the pin is set to output mode.
PMS 0 0 0 0 0 0 0 PMS0
PMS0 Method for selecting output level to be read when port is output mode (PMmn = 0)
Remark m = 0 to 8, 12
n = 0 to 7
Cautions 1. While the PMS0 bit of the PMS register is “1”, do not change the value of the Px register
by using a read-modify instruction. To change the value of the Px register, use an 8-bit
manipulation instruction.
2. PMS control cannot be used for the dedicated LCD pins and the input-only pins (P121 to
P124 and P137).
3. PMS control cannot be used for alternate-function pins being used as segment output
pins. (“L” is always read when this register is read.)
4. PMS control cannot be used for P61 and P60 when IICA0EN (bit 4 of the PER0 register) is
0.
CHAPTER 31 REGULATOR
The RL78/I1B 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.
REGC
VSS
Caution Keep the wiring length as short as possible for the broken-line part in the above figure.
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/I1B 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. For bits for which no
function is assigned, do not change their initial values.
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.
Caution The option bytes should always be set regardless of whether each function is used.
(1) 000C0H/010C0H
Ο Operation of watchdog timer
Enabling or disabling of counter operation
Enabling or disabling of counter operation in the HALT or STOP mode
Ο Setting of overflow time of watchdog timer
Ο Setting of window open period of watchdog timer
Ο Setting of interval interrupt of watchdog timer
Whether or not to use the interval interrupt is selectable.
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.
Interrupt mode.
LVD off (by controlling the externally input reset signal on the RESET pin)
Ο Setting of LVD detection level (VLVDH, VLVDL, VLVD)
Cautions 1. After power is supplied, the reset state must be retained until the operating voltage
becomes in the range defined in 37.4 AC Characteristics. This is done by utilizing the
voltage detection circuit or controlling the externally input reset signal. After the power
supply is turned off, this LSI should be placed in the STOP mode, or placed in the reset
state by utilizing the voltage detection circuit or controlling the externally input reset
signal, before the voltage falls below the operating range. The range of operating voltage
varies with the setting of the user option byte (000C2H or 010C2H).
2. 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
<R> Make the setting depending on the main system clock frequency (fMAIN) and power supply voltage (VDD)
to be used.
LS (low speed main) mode
HS (high speed main) mode
Ο Setting of the frequency of the high-speed on-chip oscillator
Select from 3 MHz, 6 MHz, 12 MHz, and 24 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.
1.98 V 1.94 V 0 0 1 1 0 1 1
2.09 V 2.04 V 0 1 0 1
2.50 V 2.45 V 1 0 1 1
2.61 V 2.55 V 1 0 1 0
2.71 V 2.65 V 1 0 0 1
2.81 V 2.75 V 1 1 1 1
2.92 V 2.86 V 1 1 1 0
3.02 V 2.96 V 1 1 0 1
3.13 V 3.06 V 0 1 0 0
3.75 V 3.67 V 1 0 0 0
4.06 V 3.98 V 1 1 0 0
Setting of values other than above is prohibited.
Note Set the same value as 000C1H to 010C1H when the boot swap operation is used because 000C1H is replaced
by 010C1H.
1.98 V 1.94 V 0 0 1 1 0 0 1
2.09 V 2.04 V 0 1 0 1
2.50 V 2.45 V 1 0 1 1
2.61 V 2.55 V 1 0 1 0
2.71 V 2.65 V 1 0 0 1
2.81 V 2.75 V 1 1 1 1
2.92 V 2.86 V 1 1 1 0
3.02 V 2.96 V 1 1 0 1
3.13 V 3.06 V 0 1 0 0
3.75 V 3.67 V 1 0 0 0
4.06 V 3.98 V 1 1 0 0
Setting of values other than above is prohibited.
LVD off setting (use of external reset input via RESET pin)
Detection voltage Option byte setting value
VLVD VPOC2 VPOC1 VPOC0 LVIS1 LVIS0 Mode setting
Rising edge Falling edge LVIMDS1 LVIMDS0
1 1
Setting of values other than above is prohibited.
Note Set the same value as 000C1H to 010C1H when the boot swap operation is used because 000C1H is replaced
by 010C1H.
Notes 1. Set the same value as 000C2H to 010C2H when the boot swap operation is used because 000C2H is
replaced by 010C2H.
2. Use at 20C TA +85C.
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 bits 6 to 1 to 000010B.
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 link option, in addition to describing to the
source. When doing so, the contents set by using the link 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 microcontroller 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.
FFFFFH
Special function register (SFR)
256 bytes
FFF00H
FFEFFH General-purpose register
32 bytes
FFEE0H
FFEDFH
RAM
6 or 8 KB
Mirror
F1000H
F0FFFH
Reserved
F0800H
F07FFH
Special function register (2nd SFR)
2 KB
F0000H
EFFFFH
Reserved
Flash memory
64 or 128 KB
00000H
The following three methods for programming the flash memory are available:
The code flash memory can be rewritten to through serial programming using a flash memory programmer or an
external device (UART communication), or through self-programming.
Serial programming using flash memory programmer (see 33.4)
Data can be written to the flash memory on-board or off-board by using a dedicated flash memory programmer.
Serial programming using external device (UART communication) (see 33.2)
Data can be written to the flash memory on-board through UART communication with an external device
(microcontroller or ASIC).
Self-programming (see 33.5)
The user application can execute self-programming of the code flash memory by using the flash self-programming
library.
The following dedicated flash memory programmer can be used to write data to the internal flash memory of the RL78
microcontroller.
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.
Table 33-1. Wiring Between RL78 microcontroller and Dedicated Flash Memory Programmer
Pin Configuration of Dedicated Flash Memory Programmer Pin Name Pin No.
80-pin 100-pin
Signal Name I/O Pin Function LFQFP (1212) LFQFP (1414)
PG-FP5, E1 on-chip
FL-PR5 debugging
emulator
TOOL0 I/O Transmit/receive signal TOOL0/P40 8 14
SI/RxD I/O Transmit/receive signal
RESET Output Reset signal RESET 9 15
/RESET Output
VDD I/O VDD voltage generation/ VDD 17 23
power monitoring
Remark Pins that are not indicated in the above table can be left open when using the flash memory programmer
for flash programming.
E1 VDD
PG-FP5, FL-PR5
RS-232C EVDDNote
VSS, EVSSNote
USB RESET
Dedicated flash TOOL0 (dedicated single-line UART) RL78 microcontroller
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 microcontroller, the TOOL0 pin is used for
manipulation such as writing and erasing via a dedicated single-line UART.
VDD VDD
PG-FP5, FL-PR5 E1 EMVDDNote 1 VDD/EVDDNote 3
FLMD1Note 2
GND VSS/EVSSNote 3/REGCNote 4
RESET Note 1,
RESET
/RESET Note 2
Dedicated flash
memory programmer TOOL0Note 1
TOOL0 RL78 microcontroller
SI/RxDNote 2
The dedicated flash memory programmer generates the following signals for the RL78 microcontroller. See the manual
of PG-FP5, FL-PR5, or E1 on-chip debugging emulator for details.
On-board data writing to the internal flash memory is possible by using the RL78 microcontroller and an external device
(a microcontroller or ASIC) connected to a UART.
On the development of flash memory programmer by user, refer to the RL78 Microcontrollers (RL78 Protocol A)
Programmer Edition Application Note (R01AN0815).
Processing to write data to or delete data from the RL78 microcontroller by using an external device is performed on-
board. Off-board writing is not possible.
The external device generates the following signals for the RL78 microcontroller.
Note2 Note1
GND Ground VSS, EVSS1 , REGC
RESETOUT Output Reset signal output RESET
RxD Input Receive signal TOOLTxD
TxD Output Transmit signal TOOLRxD
PORT Output Mode signal TOOL0
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.
Remark Refer to flash programming mode, see 33.4.2 Flash memory programming mode.
When used as an input pin: Input of low-level is prohibited for tHD period after pin reset release. However, 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.
Remarks 1. tHD: How long to keep the TOOL0 pin at the low level from when the external and internal resets end for
setting of the flash memory programming mode (see 37.12 Timing Specs for Switching Flash
Memory Programming Modes)
2. The SAU and IICA pins are not used for communication between the RL78 microcontroller and
dedicated flash memory programmer, because single-line UART (TOOL0 pin) is used.
RL78 microcontroller
Output pin
Remark In the flash memory programming mode, the high-speed on-chip oscillator clock (fIH) is used.
Start
No
End?
Yes
End
Table 33-4. Relationship Between TOOL0 Pin and Operation Mode After Reset Release
RESET
723 μs + tHD
processing
time 00H reception
(TOOLRxD, TOOLTxD mode)
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 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 (the flash
firmware processing time is excluded)
For details, see 37.12 Timing Specs for Switching Flash Memory Programming Modes.
There are two flash memory programming modes: wide voltage mode and full speed mode. The supply voltage value
applied to the microcontroller during write operations and the setting information of the user option byte for setting of the
flash memory programming mode determine which mode is selected.
When a dedicated flash memory programmer is used for serial programming, setting the voltage on GUI selects the
mode automatically.
Table 33-5. Programming Modes and Voltages at Which Data Can Be Written, Erased, or Verified
Power Supply Voltage User Option Byte Setting for Switching to Flash Memory Flash Programming Mode
(VDD) Programming Mode
Flash Operation Mode Operating Frequency
2.7 V VDD 5.5 V Blank state Full speed mode
HS (high speed main) mode 1 MHz to 24 MHz Full speed mode
LS (low speed main) mode 1 MHz to 8 MHz Wide voltage mode
2.4 V VDD < 2.7 V Blank state Full speed mode
HS (high speed main) mode 1 MHz to 16 MHz Full speed mode
LS (low speed main) mode 1 MHz to 8 MHz Wide voltage mode
1.9 V VDD < 2.4 V Blank state Wide voltage mode
LS (low speed main) mode 1 MHz to 8 MHz Wide voltage mode
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 33.4.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.
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.
Note
Write Programming Writes data to a specified area in the flash memory .
Getting information Silicon Signature Gets the RL78 microcontroller 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.
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.
Product information (such as product name and firmware version) can be obtained by executing the “Silicon Signature”
command.
Table 33-8 is a list of signature data and Table 33-9 shows an example of signature data.
33.5 Self-Programming
The RL78 microcontroller supports a self-programming function that can be used to rewrite the code flash memory via
a user program. Because this function allows a user application to rewrite the code flash memory by using the flash 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. The high-speed on-chip oscillator needs to oscillate during self-programming. When stopping
the high-speed on-chip oscillator, oscillate the high-speed on-chip oscillator clock (HIOSTOP = 0)
and execute the self-programming library after 30 μs elapses.
4. The self-programming function cannot be used when the internal power is supplied from the
VBAT pin.
<R> Remarks 1. For details of the self-programming function, refer to RL78 Microcontroller Flash Self Programming
Library Type01 User’s Manual (R01US0050).
2. For details of the time required to execute self programming, see the notes on use that accompany the
flash self programming library tool.
The self-programming function has two flash memory programming modes; wide voltage mode and full speed mode.
Specify the mode that corresponds to the flash operation mode specified in bits CMODE1 and CMODE0 in option byte
000C2H.
Set to full speed mode when the HS (high speed main) mode is specified. Set to wide voltage mode when the LS (low
speed main) mode is specified.
If the argument fsl_flash_voltage_u08 is 00H when the FSL_Init function of the flash self-programming library provided
by Renesas Electronics is executed, full speed mode is specified. If the argument is other than 00H, the wide voltage
mode is specified.
Remark Using both the wide voltage mode and full speed mode imposes no restrictions on writing, deletion, or
verification.
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 User program 7 User program 7 User program 7 User program 7
Boot 6 User program 6 User program 6 User program 6 6
cluster 1 5 User program 5 User program 5 5 5
4 User 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)
√: Serial programming
Window range Block 05H
Flash memory √: Self programming
area Block 04H
01000H (start block)
00FFFH
Block 03H
Block 00H
00000H
Caution 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.
Table 33-10. 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
flash self programming range. window range.
library.
Serial programming Specify the starting and Block erasing is enabled Writing is enabled also
ending blocks on GUI of also outside the window outside the window
dedicated flash memory range. range.
programmer, etc.
Remark See 33.6 Security Settings to prohibit writing/erasing during serial programming.
The RL78 microcontroller 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.
Disabling write
Execution of the write command for entire blocks in the code flash memory is prohibited during serial programming.
However, blocks can be written by means of self programming.
After the setting of prohibition of writing is specified, releasing the setting by the Security Release command is
enabled by a reset.
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 serial programming and self programming. Each security setting can be used
in combination.
Table 33-11 shows the relationship between the erase and write commands when the RL78 microcontroller security
function is enabled.
Caution The security function of the flash programmer does not support self-programming.
Remark To prohibit writing and erasing during self-programming, use the flash shield window function (see 33.5.3 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 shield window function (see 33.5.3 for
detail).
Prohibition of block erase Set via GUI of dedicated flash memory Cannot be disabled after set.
Prohibition of writing programmer, etc. Set via GUI of dedicated flash memory
programmer, etc.
Prohibition of rewriting boot cluster 0 Cannot be disabled after set.
Caution Releasing the setting of prohibition of writing is enabled only when the security is not set as the
block erase prohibition and the boot cluster 0 rewrite prohibition with code flash memory area being
blanks.
Prohibition of block erase Set by using flash self programming Cannot be disabled after set.
Prohibition of writing library. Cannot be disabled during self-
programming (set via GUI of dedicated
flash memory programmer, etc. during
serial programming).
Prohibition of rewriting boot cluster 0 Cannot be disabled after set.
The RL78 microcontroller 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 microcontroller 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.
Also, note that the debug function is disabled when power is supplied from the VBAT pin with the
battery backup function.
GND
GND VDD/EVDD
1 kΩ
TOOL0 TOOL0
Reset_out RESET
VDD
Reset_out Note 2
10 kΩ 1 kΩ Reset circuit
Reset_in Reset signal
Note 1
Notes 1. Connecting the dotted line is not necessary during serial 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)
Remark 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.
The RL78 microcontroller has an on-chip debug operation control bit in the flash memory at 000C3H (see CHAPTER
32 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 microcontroller 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 link options.
Figure 34-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
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
operation code, refer to the separate document RL78 Family User’s Manual: software (R01US0015).
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
(Blank) Unchanged
0 Cleared to 0
1 Set to 1
Set/cleared according to the result
R Previously saved value is restored
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 code flash 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 code flash 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 code flash 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.
R01UH0407EJ0210 Rev.2.10 945
Apr 25, 2016
RL78/I1B CHAPTER 36 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 code flash 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 code flash 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 code flash 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 code flash 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 × × ×
AAr
Note 3
A, r 2 1 ×
r, A 2 1 RrA ×
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 code flash 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 Ar
Note 3
A, r 2 1 ×
r, A 2 1 r rA ×
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 Ar
Note 3
A, r 2 1 ×
r, A 2 1 r rA ×
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 code flash 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 × 0 0
X 1 1 X – 00H × 0 0
B 1 1 B – 00H × 0 0
C 1 1 C – 00H × 0 0
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 code flash 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 code flash 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 code flash area is accessed.
<R> Caution Disable interrupts when executing the DIVHU or DIVWU instruction in an interrupt servicing routine.
Alternatively, unless they are executed in the RAM area, note that execution of a DIVHU or DIVWU
instruction is possible even with interrupts enabled as long as a NOP instruction is added immediately
after the DIVHU or DIVWU instruction in the assembly language source code. The following compilers
automatically add a NOP instruction immediately after any DIVHU or DIVWU instruction output during
the build process.
- V. 1.71 and later versions of the CA78K0R (Renesas Electronics compiler), for both C and assembly
language source code
- Service pack 1.40.6 and later versions of the EWRL78 (IAR compiler), for C language source code
- GNURL78 (KPIT compiler), for C language source code
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. MACR indicates the multiplication and accumulation register (MACRH, MACRL).
DEC r 1 1 rr–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 code flash 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 code flash 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 code flash 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 code flash 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
Un- BR AX 2 3 PC CS, AX
conditional
$addr20 2 3 PC PC + 2 + jdisp8
branch
$!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 (ZCY)=0
Note3
BH $addr20 3 2/4
PC PC + 3 + jdisp8 if (ZCY)=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 code flash 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 code flash area is accessed.
3. This indicates the number of clocks “when condition is not met/when condition is met”.
4. n indicates the number of register banks (n = 0 to 3).
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 microcontrollers 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 depend on the product. See 2.1 Port Function List to 2.2.1 With functions for
each product.
Remarks 1. In the descriptions in this chapter, read EVDD as EVDD0 and EVDD1, and EVSS as EVSS0 and EVSS1.
2. For 80-pin products, read EVDD as VDD and EVSS as VSS.
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.
3. Do not exceed AV REF(+) + 0.3 V in case of A/D conversion target pin.
4. The power supply voltage (VBAT pin or V DD pin) selected by the battery backup feature.
5. The ∆Σ A/D conversion target pin must not exceed AREGC +0.3 V.
6. Connect AREGC, AVCM, and AVRT terminals to VSS via capacitor (0.47 μF).
This value defines the absolute maximum rating of AREGC, AVCM, and AVRT terminal. Do not use
with voltage applied.
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.
Remarks 1. Unless specified otherwise, the characteristics of alternate-function pins are the same as those of the port
pins.
2. AVREF (+): + side reference voltage of the A/D converter.
3. VSS: Reference voltage
Notes 1. This value only indicates the absolute maximum ratings when applying voltage to the V L1 , VL2 , V L3 ,
and V L4 pins; it does not mean that applying voltage to these pins is recommended. When using
the internal voltage boosting method or capacitance split method, connect these pins to V SS via a
capacitor (0.47 μF 30%) and connect a capacitor (0.47 μF 30%) between the CAPL and CAPH
pins.
2. Must be 6.5 V or lower.
3. The power supply voltage (VBAT pin or V DD pin) selected by the battery backup feature.
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.
Output current, high IOH1 Per pin P00 to P07, P10 to P17, 40 mA
P30 to P37, P40 to P44,
P50 to P57, P70 to P77,
P80 to P85, P125 to P127, P130
Total of all pins P00 to P07, P40 to P44, P130 70 mA
170 mA P10 to P17, P30 to P37, 100 mA
P50 to P57, P70 to P77,
P80 to P85, P125 to P127
IOH2 Per pin P20 to P25 0.5 mA
Total of all pins 2 mA
Output current, low IOL1 Per pin P00 to P07, P10 to P17, 40 mA
P30 to P37, P40 to P44, P50 to P57,
P60 to P62, P70 to P77, P80 to P85,
P125 to P127, P130
Total of all pins P00 to P07, P40 to P44, P130 70 mA
170 mA P10 to P17, P30 to P37, P50 to 100 mA
P57, P60 to P62, P70 to P77, P80
to P85, P125 to P127
IOL2 Per pin P20 to P25 1 mA
Total of all pins 5 mA
Operating ambient TA In normal operation mode 40 to +85 C
temperature In flash memory programming mode
Storage temperature Tstg 65 to +150 C
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.
Notes 1. Indicates only permissible oscillator frequency ranges. See 37.4 AC Characteristics for instruction execution
time. Request evaluation by the manufacturer of the oscillator circuit mounted on a board to check the oscillator
characteristics.
2. Voltage range is the power supply voltage (VBAT pin or VDD pin) selected by the battery backup function.
Caution 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.
Remark When using the X1 oscillator and XT1 oscillator, see 5.4 System Clock Oscillator.
Notes 1. The high-speed on-chip oscillator frequency is selected by using bits 0 to 3 of option byte (000C2H/010C2H)
and bits 0 to 2 of the HOCODIV register.
2. This indicates the oscillator characteristics only. See 37.4 AC Characteristics for the instruction execution
time.
3. The power supply voltage (VBAT pin or V DD pin) selected by the battery backup feature.
37.3 DC Characteristics
Notes 1. Value of current at which the device operation is guaranteed even if the current flows from the EVDD and
VDD pins to an output pin.
2. Do not exceed the total current value.
3. Specification under conditions where the duty factor 70%.
The output current value that has changed to the duty factor > 70% 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 = 80% and IOH = 10.0 mA
Total output current of pins = (10.0 × 0.7)/(80 × 0.01) 8.7 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.
4. The power supply voltage (VBAT pin or V DD pin) selected by the battery backup feature.
Caution P01 to P07, P15 to P17, and P80 to P82 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.
Notes 1. Value of current at which the device operation is guaranteed even if the current flows from an output pin to
the EVSS and VSS pins.
2. However, do not exceed the total current value.
3. Specification under conditions where the duty factor 70%.
The output current value that has changed to the duty factor > 70% 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 = 80% and IOL = 10.0 mA
Total output current of pins = (10.0 × 0.7)/(80 × 0.01) 8.7 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.
4. The power supply voltage (VBAT pin or V DD pin) selected by the battery backup feature.
Remark Unless specified otherwise, the characteristics of alternate-function pins are the same as those of the port
pins.
Input voltage, VIH1 P00 to P07, P10 to P17, P30 to P37, Normal input buffer 0.8EVDD EVDD V
high P40 to P44, P50 to P57, P70 to P77,
P80 to P85, P125 to P127
VIH2 P00, P03, P05, P06, P15, P16, P81 TTL input buffer 2.2 EVDD V
4.0 V EVDD 5.5 V
TTL input buffer 2.0 EVDD V
3.3 V EVDD 4.0 V
TTL input buffer 1.5 EVDD V
1.9 V EVDD 3.3 V
Note Note
VIH3 P20 to P25 0.7VDD VDD V
VIH4 P60 to P62 0.7EVDD 6.0 V
Note Note
VIH5 P121 to P124, P137, EXCLK, EXCLKS 0.8VDD VDD V
Note
VIH6 RESET 0.8VDD 6.0 V
Input voltage, VIL1 P00 to P07, P10 to P17, P30 to P37, Normal input buffer 0 0.2EVDD V
low P40 to P44, P50 to P57, P70 to P77,
P80 to P85, P125 to P127
VIL2 P00, P03, P05, P06, P15, P16, P81 TTL input buffer 0 0.8 V
4.0 V EVDD 5.5 V
TTL input buffer 0 0.5 V
3.3 V EVDD 4.0 V
TTL input buffer 0 0.32 V
1.9 V EVDD 3.3 V
Note
VIL3 P20 to P25 0 0.3VDD V
VIL4 P60 to P62 0 0.3EVDD V
Note
VIL5 P121 to P124, P137, EXCLK, EXCLKS, RESET 0 0.2VDD V
Note The power supply voltage (VBAT pin or V DD pin) selected by the battery backup feature.
Caution The maximum value of VIH of pins P01 to P07, P15 to P17, and P80 to P82 is VDD, 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.
Output voltage, VOH1 P00 to P07, P10 to P17, P30 to P37, 4.0 V EVDD 5.5 V, EVDD 1.5 V
high P40 to P44, P50 to P57, P70 to P77, IOH1 = 10.0 mA
P80 to P85, P125 to P127, P130 4.0 V EVDD 5.5 V, EVDD 0.7 V
IOH1 = 3.0 mA
2.7 V EVDD 5.5 V, EVDD 0.6 V
IOH = 2.0 mA
1.9 V EVDD 5.5 V, EVDD 0.5 V
IOH = 1.5 mA
1.9 V VDD 5.5 V, VDD 0.5
Note
VOH2 P20 to P25 V
IOH2 = 100 μA
Output voltage, VOL1 P00 to P07, P10 to P17, P30 to P37, 4.0 V EVDD 5.5 V, 1.3 V
low P40 to P44, P50 to P57, P70 to P77, IOL1 = 20 mA
P80 to P85, P125 to P127, P130 4.0 V EVDD 5.5 V, 0.7 V
IOL1 = 8.5 mA
2.7 V EVDD 5.5 V, 0.6 V
IOL = 3.0 mA
2.7 V EVDD 5.5 V, 0.4 V
IOL1 = 1.5 mA
1.9 V EVDD 5.5 V, 0.4 V
IOL1 = 0.6 mA
1.9 V VDD 5.5 V,
Note
VOL2 P20 to P25 0.4 V
IOL2 = 400 μA
VOL3 P60 to P62 4.0 V EVDD 5.5 V, 2.0 V
IOL3 = 15.0 mA
4.0 V EVDD 5.5 V, 0.4 V
IOL3 = 5.0 mA
2.7 V EVDD 5.5 V, 0.4 V
IOL3 = 3.0 mA
1.9 V EVDD 5.5 V, 0.4 V
IOL3 = 2.0 mA
Note The power supply voltage (VBAT pin or V DD pin) selected by the battery backup feature.
Caution P01 to P07, P15 to P17, and P80 to P82 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.
<R> On-chip pull- RU1 P10 to P17, P30 to P37, P50 to P57, VI = VSS 2.4 V EVDD 5.5 V 10 20 100 kΩ
<R> up resistance P70 to P77, P80 to P85, P125 to P127 1.9 V EVDD 5.5 V 10 30 100 kΩ
RU2 P00 to P07, P40 to P44 VI = VSS 10 20 100 kΩ
Note The power supply voltage (VBAT pin or V DD pin) selected by the battery backup feature.
Remark Unless specified otherwise, the characteristics of alternate-function pins are the same as those of the port
pins.
(TA = 40 to +85C, 1.9 V VDD = EVDD 5.5 V, VSS = EVSS = 0 V) (1/4)
Parameter Symbol Conditions MIN. TYP. MAX. Unit
Note 3
<R> Supply IDD1 Operating HS (high- fIH = 24 MHz Basic VDD = 5.0 V 1.5 mA
Note 1
current mode speed main) operation VDD = 3.0 V 1.5 mA
<R> Note 5
mode
Normal VDD = 5.0 V 4.1 6.6 mA
operation VDD = 3.0 V 4.1 6.6 mA
mA
Note 3
fIH = 12 MHz Normal VDD = 5.0 V 2.5 3.8
operation VDD = 3.0 V 2.5 3.8 mA
mA
Note 3
fIH = 6 MHz Normal VDD = 5.0 V 1.6 2.5
operation VDD = 3.0 V 1.6 2.5 mA
mA
Note 3
fIH = 3 MHz Normal VDD = 5.0 V 1.2 1.9
operation VDD = 3.0 V 1.2 1.9 mA
mA
Note 3
LS (low- fIH = 6 MHz Normal VDD = 3.0 V 1.3 2.1
speed main) operation VDD = 2.0 V 1.3 2.1 mA
Note 5
mode
mA
Note 3
fIH = 3 MHz Normal VDD = 3.0 V 0.9 1.5
operation VDD = 2.0 V 0.9 1.5 mA
Note 2
HS (high- fMX = 20 MHz , Normal Square wave input 3.4 5.5 mA
speed main) VDD = 5.0 V operation Resonator connection 3.6 5.7 mA
Note 5
mode
mA
Note 2
fMX = 20 MHz , Normal Square wave input 3.4 5.5
VDD = 3.0 V operation Resonator connection 3.6 5.7 mA
mA
Note 2
fMX = 16 MHz , Normal Square wave input 2.8 4.4
VDD = 5.0 V operation Resonator connection 2.9 4.6 mA
mA
Note 2
fMX = 16 MHz , Normal Square wave input 2.8 4.4
VDD = 3.0 V operation Resonator connection 2.9 4.6 mA
mA
Note 2
fMX = 12 MHz , Normal Square wave input 2.3 3.6
VDD = 5.0 V operation Resonator connection 2.4 3.7 mA
mA
Note 2
fMX = 12 MHz , Normal Square wave input 2.3 3.6
VDD = 3.0 V operation Resonator connection 2.4 3.7 mA
mA
Note 2
fMX = 10 MHz , Normal Square wave input 2.1 3.2
VDD = 5.0 V operation Resonator connection 2.1 3.3 mA
mA
Note 2
fMX = 10 MHz , Normal Square wave input 2.1 3.2
VDD = 3.0 V operation Resonator connection 2.1 3.3 mA
mA
Note 2
LS (low- fMX = 8 MHz , Normal Square wave input 1.2 2.0
speed main) VDD = 3.0 V operation Resonator connection 1.2 2.1 mA
Note 5
mode
mA
Note 2
fMX = 8 MHz , Normal Square wave input 1.2 2.0
VDD = 2.0 V operation Resonator connection 1.2 2.1 mA
Note 4
Subclock fSUB = 32.768 kHz , Normal Square wave input 4.8 5.9 μA
operation TA = 40C operation Resonator connection 4.9 6.0 μA
Note 4
fSUB = 32.768 kHz , Normal Square wave input 4.9 5.9 μA
TA = +25C operation Resonator connection 5.0 6.0 μA
Note 4
fSUB = 32.768 kHz , Normal Square wave input 4.9 7.6 μA
TA = +50C operation Resonator connection 5.0 7.7 μA
Note 4
fSUB = 32.768 kHz , Normal Square wave input 5.2 9.3 μA
TA = +70C operation Resonator connection 5.3 9.4 μA
Note 4
fSUB = 32.768 kHz , Normal Square wave input 6.1 13.3 μA
TA = +85C operation Resonator connection 6.2 13.4 μA
Notes 1. Total current flowing into VDD and EVDD, including the input leakage current flowing when the level of the input
pin is fixed to VDD, EVDD or VSS, EVSS. The values below the MAX. column include the peripheral operation
current. However, not including the current flowing into the LCD controller/driver, A/D converter, ∆Σ A/D
converter, LVD circuit, comparator, battery backup circuit, I/O port, and on-chip pull-up/pull-down resistors.
When the VBAT pin (pin for battery backup) is selected, current flowing into VBAT.
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 setting ultra-low current
consumption (AMPHS1 = 1). However, not including the current flowing into real-time clock 2, 12-bit interval
timer, and watchdog timer.
5. Relationship between operation voltage width, operation frequency of CPU and operation mode is as below.
HS (high-speed main) mode: 2.7 V VDD 5.5 V@1 MHz to 24 MHz
2.4 V VDD 5.5 V@1 MHz to 16 MHz
LS (low-speed main) mode: 1.9 V VDD 5.5 V@1 MHz to 8 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)
4. Except subsystem clock operation, temperature condition of the TYP. value is TA = 25C
(TA = 40 to +85C, 1.9 V VDD = EVDD 5.5 V, VSS = EVSS = 0 V) (2/4)
Parameter Symbol Conditions MIN. TYP. MAX. Unit
Note 2 Note 4
Supply I
DD2 HALT HS (high- fIH = 24 MHz VDD = 5.0 V 0.50 1.45 mA
Note 1
current mode speed main) VDD = 3.0 V 0.50 1.45 mA
Note 7
mode Note 4
fIH = 12 MHz VDD = 5.0 V 0.40 0.91 mA
VDD = 3.0 V 0.40 0.91 mA
Note 4
fIH = 6 MHz VDD = 5.0 V 0.33 0.63 mA
VDD = 3.0 V 0.33 0.63 mA
Note 4
fIH = 3 MHz VDD = 5.0 V 0.29 0.49 mA
VDD = 3.0 V 0.29 0.49 mA
Note 4
LS (low- fIH = 6 MHz VDD = 3.0 V 290 620 μA
speed main) VDD = 2.0 V 290 620 μA
Note 7
mode Note 4
fIH = 3 MHz VDD = 3.0 V 250 534 μA
VDD = 2.0 V 250 534 μA
Note 3
HS (high- fMX = 20 MHz , Square wave input 0.31 1.08 mA
speed main) VDD = 5.0 V Resonator connection 0.48 1.28 mA
Note 7
mode Note 3
fMX = 20 MHz , Square wave input 0.31 1.08 mA
VDD = 3.0 V Resonator connection 0.48 1.28 mA
Note 3
fMX = 16 MHz , Square wave input 0.26 0.86 mA
VDD = 5.0 V Resonator connection 0.38 1.00 mA
Note 3
fMX = 16 MHz , Square wave input 0.26 0.86 mA
VDD = 3.0 V Resonator connection 0.38 1.00 mA
Note 3
fMX = 12 MHz , Square wave input 0.22 0.70 mA
VDD = 5.0 V Resonator connection 0.31 0.79 mA
Note 3
fMX = 12 MHz , Square wave input 0.22 0.70 mA
VDD = 3.0 V Resonator connection 0.31 0.79 mA
Note 3
fMX = 10 MHz , Square wave input 0.21 0.63 mA
VDD = 5.0 V Resonator connection 0.28 0.71 mA
Note 3
fMX = 10 MHz , Square wave input 0.21 0.63 mA
VDD = 3.0 V Resonator connection 0.28 0.71 mA
Note 3
LS (low- fMX = 8 MHz , Square wave input 110 360 μA
speed main) VDD = 3.0 V Resonator connection 160 420 μA
Note 7
mode Note 3
fMX = 8 MHz , Square wave input 110 360 μA
VDD = 2.0 V Resonator connection 160 420 μA
Note 5
Subsystem fSUB = 32.768 kHz , Square wave input 0.36 0.77 μA
clock TA = 40C Resonator connection 0.55 0.98 μA
operation Note 5
fSUB = 32.768 kHz , Square wave input 0.42 0.91 μA
TA = +25C Resonator connection 0.61 1.30 μA
Note 5
fSUB = 32.768 kHz , Square wave input 0.50 2.45 μA
TA = +50C Resonator connection 0.69 2.64 μA
Note 5
fSUB = 32.768 kHz , Square wave input 0.86 4.28 μA
TA = +70C Resonator connection 1.05 4.47 μA
Note 5
fSUB = 32.768 kHz , Square wave input 2.29 8.44 μA
TA = +85C Resonator connection 2.48 8.63 μA
TA = 40C
Note 6
IDD3 STOP 0.27 0.70 μA
Note 8
mode TA = +25C 0.33 0.82 μA
TA = +50C 0.41 2.36 μA
TA = +70C 0.77 4.19 μA
TA = +85C 2.20 8.35 μA
(Notes and Remarks are listed on the next page.)
Notes 1. Total current flowing into VDD and EVDD, including the input leakage current flowing when the level of the input
pin is fixed to VDD, EVDD or VSS, EVSS. The values below the MAX. column include the peripheral operation
current. However, not including the current flowing into the LCD controller/driver, A/D converter, ∆Σ A/D
converter, LVD circuit, comparator, battery backup circuit, I/O port, and on-chip pull-up/pull-down resistors.
When the VBAT pin (pin for battery backup) is selected, current flowing into VBAT.
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 2 (RTC2) and setting ultra-low current consumption (AMPHS1 = 1). When high-
speed on-chip oscillator and high-speed system clock are stopped. However, not including the current flowing
into the 12-bit interval timer and watchdog timer.
6. When high-speed on-chip oscillator, high-speed system clock, and subsystem clock are stopped. However, not
including the current flowing into real-time clock 2 (RTC2), 12-bit interval timer, and watchdog timer.
7. Relationship between operation voltage width, operation frequency of CPU and operation mode is as below.
HS (high-speed main) mode: 2.7 V VDD 5.5 V@1 MHz to 24 MHz
2.4 V VDD 5.5 V@1 MHz to 16 MHz
LS (low-speed main) mode: 1.9 V VDD 5.5 V@1 MHz to 8 MHz
8. If operation of the subsystem clock when STOP mode, same as when HALT mode of subsystem clock
operation.
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)
4. Except subsystem clock operation and STOP mode, temperature condition of the TYP. value is TA = 25C
(TA = 40 to +85C, 1.9 V VDD = EVDD 5.5 V, VSS = EVSS = 0 V) (3/4)
Parameter Symbol Conditions MIN. TYP. MAX. Unit
Note 1
Low-speed on- I
FIL 0.24 μA
chip oscillator
operating current
Notes 1, 2, 3
RTC2 operating IRTC fSUB = 32.768 kHz 0.02 μA
current
Notes 1, 2, 4
12-bit interval ITMKA fSUB = 32.768 kHz, fMAIN is stopped 0.04 μA
timer operating
current
8-bit interval ITMT
Notes 1, 2, 5
fSUB = 32.768 kHz, 8-bit counter mode 2 ch operation 0.12 μA
timer operating fMAIN is stopped,
16-bit counter mode operation 0.10 μA
current per unit
Notes 1, 2, 6
Watchdog timer IWDT fIL = 15 kHz, fMAIN is stopped 0.22 μA
operating current
Notes 1, 7
LVD operating ILVD 0.08 μA
current
Note 1
Oscillation stop IOSDC 0.02 μA
detection circuit
operating current
Note 1
Battery backup IBUP 0.05 μA
circuit operating
current
Notes 1, 8
A/D converter IADC When Normal mode, AVREFP = VDD = 5.0 V 1.3 2.4 mA
operating current conversion at Low voltage mode, AVREFP = VDD = 3.0 V 0.5 1.0 mA
maximum speed
Note 1
A/D converter IADREF 75.0 μA
reference voltage
current
Note 1
Temperature ITMPS 105 μA
sensor operating
current
Notes 1, 9
Comparator ICMP VDD = 5.0 V, Window mode 12.5 μA
operating current Regulator output Comparator high-speed mode 6.5 μA
voltage = 2.1 V
Comparator low-speed mode 1.7 μA
VDD = 5.0 V, Window mode 8.0 μA
Regulator output Comparator high-speed mode 4.0 μA
voltage = 1.8 V
Comparator low-speed mode 1.3 μA
VDD = 5.0 V, Window mode 8.0 μA
STOP mode Comparator high-speed mode 4.0 μA
Comparator low-speed mode 1.3 μA
Notes 1, 10
BGO operating IBGO 2.00 12.20 mA
current
Notes 1, 11
Self- IFSP 2.00 12.20 mA
programming
operating current
(TA = 40 to +85C, 1.9 V VDD = EVDD 5.5 V, VSS = EVSS = 0 V) (4/4)
Parameter Symbol Conditions MIN. TYP. MAX. Unit
Notes 1, 12
24-Bit ∆Σ A/D I
DSAD In 4 ch ∆Σ A/D converter operation 1.50 2.25 mA
Converter In 3 ch ∆Σ A/D converter operation 1.18 1.77 mA
operating
current In 1 ch ∆Σ A/D converter operation 0.53 0.80 mA
Notes 1, 13
SNOOZE ISNOZ ADC operation The mode is performed 0.50 0.80 mA
operating The A/D conversion operations are 1.20 1.80 mA
current performed, low voltage mode, AVREFP =
VDD = 3.0 V
CSI/UART operation 0.70 1.05 mA
LCD operating ILCD1Notes1,14, 15 External resistance fLCD = fSUB VDD = 5.0 V, 0.06 μA
current division method LCD clock = 128 Hz VL4 = 5.0 V
1/3 bias, four-time-slices
Notes 1, 14
ILCD2 Internal voltage fLCD = fSUB VDD = 3.0 V, 0.85 μA
boosting method LCD clock = 128 Hz VL4 = 3.0 V
1/3 bias, four-time-slices (VLCD = 04H)
VDD = 5.0 V, 1.55 μA
VL4 = 5.1 V
(VLCD = 12H)
Notes 1, 14
I LCD3 Capacitor split fLCD = fSUB VDD = 3.0 V, 0.20 μA
method LCD clock = 128 Hz VL4 = 3.0 V
1/3 bias, four-time-slices
Notes 1. Current flowing to VDD. When the VBAT pin (battery backup power supply pin) is selected, current flowing to
the VBAT.
2. When high speed on-chip oscillator and high-speed system clock are stopped.
3. Current flowing only to real-time clock 2 (excluding the low-speed on-chip oscillator and operating current of the
XT1 oscillator). The value of the current value of the RL78 microcontrollers is the sum of the values of either
IDD1 or IDD2, and IRTC, when real-time clock 2 operates in operation mode or HALT mode. When the low-speed
on-chip oscillator is selected, IFIL should be added. IDD2 subsystem clock operation includes the operational
current of real-time clock 2.
4. Current flowing only to the 12-bit interval timer (excluding the operating current of the low-speed on-chip
oscillator and XT1 oscillator). The value of the current value of the RL78 microcontrollers is the sum of the
values of either IDD1 or IDD2, and ITMKA, when the 12-bit interval timer operates in operation mode or HALT mode.
When the low-speed on-chip oscillator is selected, IFIL should be added.
5. Current flowing only to the 8-bit interval timer (excluding the operating current of the low-speed on-chip
oscillator and XT1 oscillator). The value of the current value of the RL78 microcontrollers is the sum of the
values of either IDD1 or IDD2, and ITMT, when the 8-bit interval timer operates in operation mode or HALT mode.
When the low-speed on-chip oscillator is selected, IFIL should be added.
6. Current flowing only to the watchdog timer (including the operating current of the low-speed on-chip oscillator).
The current value of the RL78 microcontrollers is the sum of IDD1, IDD2 or IDD3 and IWDT when the watchdog timer
operates.
7 Current flowing only to the LVD circuit. The current value of the RL78 microcontrollers is the sum of IDD1, IDD2 or
IDD3 and ILVD when the LVD circuit operates.
8. Current flowing only to the A/D converter. The current value of the RL78 microcontrollers is the sum of IDD1 or
IDD2 and IADC when the A/D converter operates in an operation mode or the HALT mode.
9. Current flowing only to the comparator circuit. The current value of the RL78 microcontrollers is the sum of IDD1,
IDD2 or IDD3 and ICMP when the comparator circuit operates.
Notes 10. Current flowing only during rewrite of 1 KB code flash memory.
11. Current flowing only during self programming.
12. Current flowing only to the 24-bit ∆Σ A/D converter. The current value of the RL78 microcontrollers is the sum
of IDD1 or IDD2, and IDSAD when the 24-bit ∆Σ A/D converter operates.
13. For shift time to the SNOOZE mode, see 24.3.3 SNOOZE mode.
14. Current flowing only to the LCD controller/driver. The current value of the RL78 microcontrollers is the sum of
the LCD operating current (ILCD1, ILCD2 or ILCD3) to the supply current (IDD1, or IDD2) when the LCD
controller/driver operates in an operation mode or HALT mode. Not including the current that flows through the
LCD panel. Conditions of the TYP. value and MAX. value are as follows.
Setting 20 pins as the segment function and blinking all
Selecting fSUB for system clock when LCD clock = 128 Hz (LCDC0 = 07H)
Setting four time slices and 1/3 bias
15. Not including the current flowing into the external division resistor when using the external resistance division
method.
37.4 AC Characteristics
Notes 1. The power supply voltage (VBAT pin or V DD pin) selected by the battery backup feature.
2. The following conditions are required for low voltage interface:
1.9 V VDD < 2.7 V: MIN. 125 ns
10
1.0
When the high-speed on-chip oscillator clock is selected
Cycle time TCY [μs]
0.1
0.0625
0.05
0.0417
0.01
0 1.0 2.0 3.0 4.0 5.0 5.5 6.0
2.4 2.7
Supply voltage VDD [V]
10
0.125
0.1
0.01
0 1.0 2.0 3.0 4.0 5.0 5.5 6.0
1.9
VIH/VOH VIH/VOH
Test points
VIL/VOL VIL/VOL
1/fEX/
1/fEXS
tEXL/ tEXH/
tEXLS tEXHS
0.7VDD (MIN.)
EXCLK/EXCLKS
0.3VDD (MAX.)
TI/TO Timing
tTIL tTIH
TI00 to TI07
1/fTO
TO00 to TO07
tINTL tINTH
INTP0 to INTP7
tRSL
RESET
VIH/VOH VIH/VOH
Test points
VIL/VOL VIL/VOL
(1) During communication at same potential (UART mode) (dedicated baud rate generator output)
(TA = 40 to +85C, 1.9 V VDD = EVDD 5.5 V, VSS = EVSS = 0 V)
Parameter Symbol Conditions HS (high-speed main) LS (low-speed main) Unit
Mode Mode
MIN. MAX. MIN. MAX.
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).
TxDq Rx
RL78/I1B
User's device
microcontrollers
RxDq Tx
1/Transfer rate
High-/Low-bit width
Baud rate error tolerance
TxDq
RxDq
(2) During communication at same potential (CSI mode) (master mode, SCKp... internal clock output)
(TA = 40 to +85C, 1.9 V VDD = EVDD 5.5 V, VSS = EVSS = 0 V)
Parameter Symbol Conditions HS (high-speed main) LS (low-speed main) Unit
Mode Mode
MIN. MAX. MIN. MAX.
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 SCKp and SOp output lines.
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. p: CSI number (p = 00), m: Unit number (m = 0), n: Channel number (n = 0),
g: PIM and POM numbers (g = 0, 1)
2. fMCK: Serial array unit operation clock frequency
(Operating clock that is set with the serial clock select register m (SPSm) and the CKSmn bit of serial mode
register mn (SMRmn).
m: Unit number, n: Channel number (mn = 00))
(3) During communication at same potential (CSI mode) (slave mode, SCKp... external clock input)
(TA = 40 to +85C, 1.9 V VDD = EVDD 5.5 V, VSS = EVSS = 0 V)
Parameter Symbol Conditions HS (high-speed main) LS (low-speed main) Unit
Mode Mode
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.
5. Transfer rate in the SNOOZE mode: MAX. 1 Mbps
Caution Select the normal 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), m: Unit number (m = 0), n: Channel number (n = 0),
g: PIM number (g = 0, 1)
2. fMCK: Serial array unit operation clock frequency
(Operating clock that is set with the serial clock select register m (SPSm) and the CKSmn bit of serial mode
register mn (SMRmn).
m: Unit number, n: Channel number (mn = 00))
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
2
(4) During communication at same potential (simplified I C mode)
(TA = 40 to +85C, 1.9 V VDD = EVDD 5.5 V, VSS = EVSS = 0 V)
Parameter Symbol Conditions HS (high-speed main) LS (low-speed main) Unit
Mode Mode
MIN. MAX. MIN. MAX.
2
Simplified I C mode connection diagram (during communication at same potential)
VDD
Rb
SDAr SDA
RL78/I1B
User's device
microcontrollers
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 normal 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 g (POMg).
Remarks 1. Rb[Ω]:Communication line (SDAr) pull-up resistance, Cb[F]: Communication line (SDAr, SCLr) load
capacitance
2. r: IIC number (r = 00, 10), g: PIM and POM number (g = 0, 1)
3. fMCK: Serial array unit operation clock frequency
(Operating clock that is set with the serial clock select register m (SPSm) and the CKSmn bit of serial mode
register mn (SMRmn).
m: Unit number (m = 0), n: Channel number (n = 0, 2), mn = 00, 02))
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). For
VIH and VIL, see the DC characteristics with TTL input buffer selected.
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 EVDD 5.5 V and 2.7 V Vb 4.0 V
1
Maximum transfer rate = [bps]
2.2
{Cb × Rb × ln (1 Vb )} × 3
1 2.2
{Cb × Rb × ln (1 Vb )}
Transfer rate 2
Baud rate error (theoretical value) = × 100 [%]
1
( Transfer rate ) × Number of transferred bits
* This value is the theoretical value of the relative difference between the transmission and reception sides.
2. Transfer rate in the SNOOZE mode is 4800 bps only.
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 EVDD < 4.0 V and 2.3 V Vb 2.7 V
1
Maximum transfer rate = [bps]
2.0
{Cb × Rb × ln (1 Vb )} × 3
1 2.0
{Cb × Rb × ln (1 Vb )}
Transfer rate 2
Baud rate error (theoretical value) = × 100 [%]
1
( Transfer rate ) × Number of transferred bits
* 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.
6. Use it with EVDD Vb.
Notes 7. 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 1.9 V EVDD < 2.7 V and 1.6 V Vb 2.0 V
1
Maximum transfer rate = [bps]
1.5
{Cb × Rb × ln (1 Vb )} × 3
1 1.5
{Cb × Rb × ln (1 Vb )}
Transfer rate 2
Baud rate error (theoretical value) = × 100 [%]
1
( Transfer rate ) × Number of transferred bits
* 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.
9. When HS (high-speed main) mode, this value becomes 2.4 V.
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). For VIH
and VIL, see the DC characteristics with TTL input buffer selected.
Vb
Rb
TxDq Rx
RL78/I1B
User's device
microcontrollers
RxDq Tx
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). For VIH
and VIL, see the DC characteristics with TTL input buffer selected.
Remarks 1. Rb[Ω]:Communication line (TxDq) pull-up resistance, Vb[V]: Communication line voltage
2. q: UART number (q = 0 to 2), g: PIM and POM number (g = 0, 1, 8)
(6) Communication at different potential (2.5 V, 3 V) (fMCK/2) (CSI mode) (master mode, SCKp... internal clock output,
corresponding CSI00 only)
(TA = 40 to +85C, 1.9 V VDD = EVDD 5.5 V, VSS = EVSS = 0 V)
Parameter Symbol Conditions HS (high-speed main) LS (low-speed main) Unit
Mode Mode
MIN. MAX. MIN. MAX.
SCKp cycle time tKCY1 tKCY1 2/fCLK 4.0 V EVDD 5.5 V, 200 1150 ns
2.7 V Vb 4.0 V,
Cb = 20 pF, Rb = 1.4 kΩ
2.7 V EVDD < 4.0 V, 300 1150 ns
2.3 V Vb 2.7 V,
Cb = 20 pF, Rb = 2.7 kΩ
SCKp high-level width tKH1 4.0 V EVDD 5.5 V, 2.7 V Vb 4.0 V, tKCY1/2 50 tKCY1/2 50 ns
Cb = 20 pF, Rb = 1.4 kΩ
2.7 V EVDD < 4.0 V, 2.3 V Vb 2.7 V, tKCY1/2 120 tKCY1/2 120 ns
Cb = 20 pF, Rb = 2.7 kΩ
SCKp low-level width tKL1 4.0 V EVDD 5.5 V, 2.7 V Vb 4.0 V, tKCY1/2 7 tKCY1/2 50 ns
Cb = 20 pF, Rb = 1.4 kΩ
2.7 V EVDD < 4.0 V, 2.3 V Vb 2.7 V, tKCY1/2 10 tKCY1/2 50 ns
Cb = 20 pF, Rb = 2.7 kΩ
SIp setup time tSIK1 4.0 V EVDD 5.5 V, 2.7 V Vb 4.0 V, 58 479 ns
Note 1
(to SCKp) Cb = 20 pF, Rb = 1.4 kΩ
2.7 V EVDD < 4.0 V, 2.3 V Vb 2.7 V, 121 479 ns
Cb = 20 pF, Rb = 2.7 kΩ
SIp hold time tKSI1 4.0 V EVDD 5.5 V, 2.7 V Vb 4.0 V, 10 10 ns
Note 1
(from SCKp) Cb = 20 pF, Rb = 1.4 kΩ
2.7 V EVDD < 4.0 V, 2.3 V Vb 2.7 V, 10 10 ns
Cb = 20 pF, Rb = 2.7 kΩ
Delay time from SCKp tKSO1 4.0 V EVDD 5.5 V, 2.7 V Vb 4.0 V, 60 60 ns
Note 1
to SOp output Cb = 20 pF, Rb = 1.4 kΩ
2.7 V EVDD < 4.0 V, 2.3 V Vb 2.7 V, 130 130 ns
Cb = 20 pF, Rb = 2.7 kΩ
SIp setup time tSIK1 4.0 V EVDD 5.5 V, 2.7 V Vb 4.0 V, 23 110 ns
Note 2
(to SCKp) Cb = 20 pF, Rb = 1.4 kΩ
2.7 V EVDD < 4.0 V, 2.3 V Vb 2.7 V, 33 110 ns
Cb = 20 pF, Rb = 2.7 kΩ
SIp hold time tKSI1 4.0 V EVDD 5.5 V, 2.7 V Vb 4.0 V, 10 10 ns
Note 2
(from SCKp) Cb = 20 pF, Rb = 1.4 kΩ
2.7 V EVDD < 4.0 V, 2.3 V Vb 2.7 V, 10 10 ns
Cb = 20 pF, Rb = 2.7 kΩ
Delay time from SCKp tKSO1 4.0 V EVDD 5.5 V, 2.7 V Vb 4.0 V, 10 10 ns
Note 2
to SOp output Cb = 20 pF, Rb = 1.4 kΩ
2.7 V EVDD < 4.0 V, 2.3 V Vb 2.7 V, 10 10 ns
Cb = 20 pF, Rb = 2.7 kΩ
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). For VIH and VIL, see the DC characteristics with TTL input buffer selected.
<Master> Vb Vb
Rb Rb
SCKp SCK
SOp SI
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)
3. fMCK: Serial array unit operation clock frequency
(Operating clock that is set with the serial clock select register m (SPSm) and the CKSmn bit of serial mode
register mn (SMRmn).
m: Unit number, n: Channel number (mn = 00))
4. This specification is valid only when CSI00’s peripheral I/O redirect function is not used.
(7) Communication at different potential (1.8 V, 2.5 V, 3 V) (fMCK/4) (CSI mode) (master mode, SCKp... internal clock
output) (1/2)
(TA = 40 to +85C, 1.9 V VDD = EVDD 5.5 V, VSS = EVSS = 0 V)
Parameter Symbol Conditions HS (high-speed main) LS (low-speed main) Unit
Mode Mode
MIN. MAX. MIN. MAX.
SCKp cycle time tKCY1 tKCY1 4/fCLK 4.0 V EVDD 5.5 V, 300 1150 ns
2.7 V Vb 4.0 V,
Cb = 30 pF, Rb = 1.4 kΩ
2.7 V EVDD < 4.0 V, 500 1150 ns
2.3 V Vb 2.7 V,
Cb = 30 pF, Rb = 2.7 kΩ
EVDD < 3.3 V,
Note 4
1.9 V 1150 1150 ns
1.6 V Vb 2.0 V,
Cb = 30 pF, Rb = 5.5 kΩ
SCKp high-level tKH1 4.0 V EVDD 5.5 V, 2.7 V Vb 4.0 V, tKCY1/2 75 tKCY1/2 75 ns
width Cb = 30 pF, Rb = 1.4 kΩ
2.7 V EVDD < 4.0 V, 2.3 V Vb 2.7 V, tKCY1/2 tKCY1/2 ns
Cb = 30 pF, Rb = 2.7 kΩ 170 170
EVDD < 3.3 V, 1.6 V Vb 2.0 V tKCY1/2 tKCY1/2
Note 4 Note 3
1.9 V , ns
Cb = 30 pF, Rb = 5.5 kΩ 458 458
SCKp low-level tKL1 4.0 V EVDD 5.5 V, 2.7 V Vb 4.0 V, tKCY1/2 12 tKCY1/2 50 ns
width Cb = 30 pF, Rb = 1.4 kΩ
2.7 V EVDD < 4.0 V, 2.3 V Vb 2.7 V, tKCY1/2 18 tKCY1/2 50 ns
Cb = 30 pF, Rb = 2.7 kΩ
EVDD < 3.3 V, 1.6 V Vb 2.0 V , tKCY1/2 50 tKCY1/2 50
Note 4 Note 3
1.9 V ns
Cb = 30 pF, Rb = 5.5 kΩ
(Notes, Caution and Remarks are listed on the page after the next page.)
(7) Communication at different potential (1.8 V, 2.5 V, 3 V) (fMCK/4) (CSI mode) (master mode, SCKp... internal clock
output) (2/2)
(TA = 40 to +85C, 1.9 V VDD = EVDD 5.5 V, VSS = EVSS = 0 V)
Parameter Symbol Conditions HS (high-speed main) LS (low-speed main) Unit
Mode Mode
MIN. MAX. MIN. MAX.
SIp setup time tSIK1 4.0 V EVDD 5.5 V, 2.7 V Vb 4.0 V, 81 479 ns
Note 1
(to SCKp) Cb = 30 pF, Rb = 1.4 kΩ
2.7 V EVDD < 4.0 V, 2.3 V Vb 2.7 V, 177 479 ns
Cb = 30 pF, Rb = 2.7 kΩ
EVDD < 3.3 V, 1.6 V Vb 2.0 V
Note 4 Note 3
1.9 V , 479 479 ns
Cb = 30 pF, Rb = 5.5 kΩ
SIp hold time tKSI1 4.0 V EVDD 5.5 V, 2.7 V Vb 4.0 V, 19 19 ns
Note 1
(from SCKp) Cb = 30 pF, Rb = 1.4 kΩ
2.7 V EVDD < 4.0 V, 2.3 V Vb 2.7 V, 19 19 ns
Cb = 30 pF, Rb = 2.7 kΩ
EVDD < 3.3 V, 1.6 V Vb 2.0 V
Note 4 Note 3
1.9 V , 19 19 ns
Cb = 30 pF, Rb = 5.5 kΩ
Delay time from tKSO1 4.0 V EVDD 5.5 V, 2.7 V Vb 4.0 V, 100 100 ns
SCKp to Cb = 30 pF, Rb = 1.4 kΩ
Note 1
SOp output 2.7 V EVDD < 4.0 V, 2.3 V Vb 2.7 V, 195 195 ns
Cb = 30 pF, Rb = 2.7 kΩ
EVDD < 3.3 V, 1.6 V Vb 2.0 V
Note 4 Note 3
1.9 V , 483 483 ns
Cb = 30 pF, Rb = 5.5 kΩ
SIp setup time tSIK1 4.0 V EVDD 5.5 V, 2.7 V Vb 4.0 V, 44 110 ns
Note 2
(to SCKp) Cb = 30 pF, Rb = 1.4 kΩ
2.7 V EVDD < 4.0 V, 2.3 V Vb 2.7 V, 44 110 ns
Cb = 30 pF, Rb = 2.7 kΩ
EVDD < 3.3 V, 1.6 V Vb 2.0 V
Note 4 Note 3
1.9 V , 110 110 ns
Cb = 30 pF, Rb = 5.5 kΩ
SIp hold time tKSI1 4.0 V EVDD 5.5 V, 2.7 V Vb 4.0 V, 19 19 ns
Note 2
(from SCKp) Cb = 30 pF, Rb = 1.4 kΩ
2.7 V EVDD < 4.0 V, 2.3 V Vb 2.7 V, 19 19 ns
Cb = 30 pF, Rb = 2.7 kΩ
EVDD < 3.3 V, 1.6 V Vb 2.0 V
Note 4 Note 3
1.9 V , 19 19 ns
Cb = 30 pF, Rb = 5.5 kΩ
Delay time from tKSO1 4.0 V EVDD 5.5 V, 2.7 V Vb 4.0 V, 25 25 ns
SCKp to SOp Cb = 30 pF, Rb = 1.4 kΩ
Note 2
output 2.7 V EVDD < 4.0 V, 2.3 V Vb 2.7 V, 25 25 ns
Cb = 30 pF, Rb = 2.7 kΩ
EVDD < 3.3 V, 1.6 V Vb 2.0 V
Note 4 Note 3
1.9 V , 25 25 ns
Cb = 30 pF, Rb = 5.5 kΩ
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). For VIH and VIL, see the DC characteristics with TTL input buffer selected.
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 , n: Channel number (mn = 00),
g: PIM and POM number (g = 0, 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))
<Master> Vb Vb
Rb Rb
SCKp SCK
SOp SI
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). For VIH and VIL, see the DC characteristics with TTL input buffer selected.
Remark p: CSI number (p = 00), m: Unit number, n: Channel number (mn = 00),
g: PIM and POM number (g = 0, 1)
(8) Communication at different potential (1.8 V, 2.5 V, 3 V) (CSI mode) (slave mode, SCKp ... external clock input)
(TA = 40 to +85C, 1.9 V VDD = EVDD 5.5 V, VSS = EVSS = 0 V)
Parameter Symbol Conditions HS (high-speed main) LS (low-speed main) Unit
Mode Mode
MIN. MAX. MIN. MAX.
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). For VIH and VIL, see the DC characteristics with TTL input buffer selected.
<Slave> Vb
Rb
SCKp SCK
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), m: Unit number, n: Channel number (mn = 00),
g: PIM and POM number (g = 0, 1)
3. fMCK: Serial array unit operation clock frequency
(Operating clock that is set with the serial clock select register m (SPSm) and the CKSmn bit of serial mode
register mn (SMRmn).
m: Unit number, n: Channel number (mn = 00))
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). For VIH and VIL, see the DC characteristics with TTL input buffer selected.
Remark p: CSI number (p = 00), m: Unit number, n: Channel number (mn = 00),
g: PIM and POM number (g = 0, 1)
2
(9) Communication at different potential (1.8 V, 2.5 V, 3 V) (simplified I C mode) (1/2)
(TA = 40 to +85C, 1.9 V VDD = EVDD 5.5 V, VSS = EVSS = 0 V)
Parameter Symbol Conditions HS (high-speed main) LS (low-speed main) Unit
Mode Mode
MIN. MAX. MIN. MAX.
Note 1 Note 1
SCLr clock frequency fSCL 4.0 V EVDD 5.5 V, 1000 300 kHz
2.7 V Vb 4.0 V,
Cb = 50 pF, Rb = 2.7 kΩ
Note 1 Note 1
2.7 V EVDD < 4.0 V, 1000 300 kHz
2.3 V Vb 2.7 V,
Cb = 50 pF, Rb = 2.7 kΩ
Note 1 Note 1
4.0 V EVDD 5.5 V, 400 300 kHz
2.7 V Vb 4.0 V,
Cb = 100 pF, Rb = 2.8 kΩ
Note 1 Note 1
2.7 V EVDD < 4.0 V, 400 300 kHz
2.3 V Vb 2.7 V,
Cb = 100 pF, Rb = 2.7 kΩ
Note 1 Note 1
EVDD < 3.3 V,
Note 4
1.9 V 300 300 kHz
1.6 V Vb 2.0 V
Note 2
,
Cb = 100 pF, Rb = 5.5 kΩ
Hold time when SCLr = “L” tLOW 4.0 V EVDD 5.5 V, 475 1550 ns
2.7 V Vb 4.0 V,
Cb = 50 pF, Rb = 2.7 kΩ
2.7 V EVDD < 4.0 V, 475 1550 ns
2.3 V Vb 2.7 V,
Cb = 50 pF, Rb = 2.7 kΩ
4.0 V EVDD 5.5 V, 1150 1550 ns
2.7 V Vb 4.0 V,
Cb = 100 pF, Rb = 2.8 kΩ
2.7 V EVDD < 4.0 V, 1150 1550 ns
2.3 V Vb 2.7 V,
Cb = 100 pF, Rb = 2.7 kΩ
EVDD < 3.3 V,
Note 4
1.9 V 1550 1550 ns
1.6 V Vb 2.0 V
Note 2
,
Cb = 100 pF, Rb = 5.5 kΩ
Hold time when SCLr = “H” tHIGH 4.0 V EVDD 5.5 V, 245 610 ns
2.7 V Vb 4.0 V,
Cb = 50 pF, Rb = 2.7 kΩ
2.7 V EVDD < 4.0 V, 200 610 ns
2.3 V Vb 2.7 V,
Cb = 50 pF, Rb = 2.7 kΩ
4.0 V EVDD 5.5 V, 675 610 ns
2.7 V Vb 4.0 V,
Cb = 100 pF, Rb = 2.8 kΩ
2.7 V EVDD < 4.0 V, 600 610 ns
2.3 V Vb 2.7 V,
Cb = 100 pF, Rb = 2.7 kΩ
EVDD < 3.3 V,
Note 4
1.9 V 610 610 ns
1.6 V Vb 2.0 V
Note 2
,
Cb = 100 pF, Rb = 5.5 kΩ
2
(9) Communication at different potential (1.8 V, 2.5 V, 3 V) (simplified I C mode) (2/2)
(TA = 40 to +85C, 1.9 V VDD = EVDD 5.5 V, VSS = EVSS = 0 V)
Parameter Symbol Conditions HS (high-speed main) LS (low-speed main) Unit
Mode Mode
MIN. MAX. MIN. MAX.
Data setup time (reception) tSU:DAT 4.0 V EVDD 5.5 V, 1/fMCK + 1/fMCK + ns
2.7 V Vb 4.0 V,
Note 3 Note 3
135 190
Cb = 50 pF, Rb = 2.7 kΩ
2.7 V EVDD < 4.0 V, 1/fMCK + 1/fMCK + ns
2.3 V Vb 2.7 V,
Note 3 Note 3
135 190
Cb = 50 pF, Rb = 2.7 kΩ
4.0 V EVDD 5.5 V, 1/fMCK + 1/fMCK + ns
2.7 V Vb 4.0 V,
Note 3 Note 3
190 190
Cb = 100 pF, Rb = 2.8 kΩ
2.7 V EVDD < 4.0 V, 1/fMCK + 1/fMCK + ns
2.3 V Vb 2.7 V,
Note 3 Note 3
190 190
Cb = 100 pF, Rb = 2.7 kΩ
EVDD < 3.3 V,
Note 4
1.9 V 1/fMCK + 1/fMCK + ns
1.6 V Vb 2.0 V
Note 2 Note 3 Note 3
, 190 190
Cb = 100 pF, Rb = 5.5 kΩ
Data hold time tHD:DAT 4.0 V EVDD 5.5 V, 0 305 305 ns
(transmission) 2.7 V Vb 4.0 V,
Cb = 50 pF, Rb = 2.7 kΩ
2.7 V EVDD < 4.0 V, 0 305 305 ns
2.3 V Vb 2.7 V,
Cb = 50 pF, Rb = 2.7 kΩ
4.0 V EVDD 5.5 V, 0 355 355 ns
2.7 V Vb 4.0 V,
Cb = 100 pF, Rb = 2.8 kΩ
2.7 V EVDD < 4.0 V, 0 355 355 ns
2.3 V Vb 2.7 V,
Cb = 100 pF, Rb = 2.7 kΩ
EVDD < 3.3 V,
Note 4
1.9 V 0 405 405 ns
1.6 V Vb 2.0 V
Note 2
,
Cb = 100 pF, Rb = 5.5 kΩ
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). For VIH and VIL, see the DC characteristics with TTL
input buffer selected.
2
Simplified I C mode connection diagram (during communication at different potential)
Vb Vb
Rb Rb
SDAr SDA
RL78/I1B
User's device
microcontrollers
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). For VIH and VIL, see the DC characteristics with TTL
input buffer selected.
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, 10), g: PIM, POM number (g = 0, 1)
3. fMCK: Serial array unit operation clock frequency
(Operating clock that is set with the serial clock select register m (SPSm) and the CKSmn bit of serial mode
register mn (SMRmn).
m: Unit number, n: Channel number (mn = 00, 02))
2
(1) I C standard mode
(TA = 40 to +85C, 1.9 V VDD = EVDD 5.5 V, VSS = EVSS = 0 V)
Parameter Symbol Conditions HS (high-speed LS (low-speed main) Unit
main) Mode Mode
MIN. MAX. MIN. MAX.
SCLA0 clock frequency fSCL Standard mode: 2.7 V EVDD 5.5 V 0 100 0 100 kHz
fCLK 1 MHz 1.9 V
Note 3
EVDD 0 100 0 100 kHz
5.5 V
Setup time of restart condition tSU:STA 2.7 V EVDD 5.5 V 4.7 4.7 μs
EVDD 5.5 V
Note 3
1.9 V 4.7 4.7 μs
Hold time
Note 1
tHD:STA 2.7 V EVDD 5.5 V 4.0 4.0 μs
EVDD 5.5 V
Note 3
1.9 V 4.0 4.0 μs
Hold time when SCLA0 = “L” tLOW 2.7 V EVDD 5.5 V 4.7 4.7 μs
EVDD 5.5 V
Note 3
1.9 V 4.7 4.7 μs
Hold time when SCLA0 = “H” tHIGH 2.7 V EVDD 5.5 V 4.0 4.0 μs
EVDD 5.5 V
Note 3
1.9 V 4.0 4.0 μs
Data setup time (reception) tSU:DAT 2.7 V EVDD 5.5 V 250 250 ns
EVDD 5.5 V
Note 3
1.9 V 250 250 ns
Data hold time (transmission)
Note 2
tHD:DAT 2.7 V EVDD 5.5 V 0 3.45 0 3.45 μs
EVDD 5.5 V
Note 3
1.9 V 0 3.45 0 3.45 μs
Setup time of stop condition tSU:STO 2.7 V EVDD 5.5 V 4.0 4.0 μs
EVDD 5.5 V
Note 3
1.9 V 4.0 4.0 μs
Bus-free time tBUF 2.7 V EVDD 5.5 V 4.7 4.7 μs
EVDD 5.5 V
Note 3
1.9 V 4.7 4.7 μ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.
3. When HS (high-speed main) mode, this value becomes 2.4 V.
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.
2
(2) I C fast mode
(TA = 40 to +85C, 1.9 V VDD = EVDD 5.5 V, VSS = EVSS = 0 V)
Parameter Symbol Conditions HS (high-speed LS (low-speed main) Unit
main) Mode Mode
MIN. MAX. MIN. MAX.
SCLA0 clock frequency fSCL Fast mode: 2.7 V EVDD 5.5 V 0 400 0 400 kHz
fCLK 3.5 MHz 1.9 V
Note 3
EVDD 0 400 0 400 kHz
5.5 V
Setup time of restart condition tSU:STA 2.7 V EVDD 5.5 V 0.6 0.6 μs
EVDD 5.5 V
Note 3
1.9 V 0.6 0.6 μs
Hold time
Note 1
tHD:STA 2.7 V EVDD 5.5 V 0.6 0.6 μs
EVDD 5.5 V
Note 3
1.9 V 0.6 0.6 μs
Hold time when SCLA0 = “L” tLOW 2.7 V EVDD 5.5 V 1.3 1.3 μs
EVDD 5.5 V
Note 3
1.9 V 1.3 1.3 μs
Hold time when SCLA0 = “H” tHIGH 2.7 V EVDD 5.5 V 0.6 0.6 μs
EVDD 5.5 V
Note 3
1.9 V 0.6 0.6 μs
Data setup time (reception) tSU:DAT 2.7 V EVDD 5.5 V 100 100 ns
EVDD 5.5 V
Note 3
1.9 V 100 100 ns
Data hold time (transmission)
Note 2
tHD:DAT 2.7 V EVDD 5.5 V 0 0.9 0 0.9 μs
EVDD 5.5 V
Note 3
1.9 V 0 0.9 0 0.9 μs
Setup time of stop condition tSU:STO 2.7 V EVDD 5.5 V 0.6 0.6 μs
EVDD 5.5 V
Note 3
1.9 V 0.6 0.6 μs
Bus-free time tBUF 2.7 V EVDD 5.5 V 1.3 1.3 μs
EVDD 5.5 V
Note 3
1.9 V 1.3 1.3 μ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.
3. When HS (high-speed main) mode, this value becomes 2.4 V.
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.
2
(3) I C fast mode plus
(TA = 40 to +85C, 1.9 V VDD = EVDD 5.5 V, VSS = EVSS = 0 V)
Parameter Symbol Conditions HS (high-speed LS (low-speed main) Unit
main) Mode Mode
MIN. MAX. MIN. MAX.
SCLA0 clock frequency fSCL Fast mode plus: 2.7 V EVDD 5.5 V 0 1000 kHz
fCLK 10 MHz
Setup time of restart condition tSU:STA 2.7 V EVDD 5.5 V 0.26 μs
Hold time
Note 1
tHD:STA 2.7 V EVDD 5.5 V 0.26 μs
Hold time when SCLA0 = “L” tLOW 2.7 V EVDD 5.5 V 0.5 μs
Hold time when SCLA0 = “H” tHIGH 2.7 V EVDD 5.5 V 0.26 μs
Data setup time (reception) tSU:DAT 2.7 V EVDD 5.5 V 50 ns
Data hold time (transmission)
Note 2
tHD:DAT 2.7 V EVDD 5.5 V 0 0.45 μs
Setup time of stop condition tSU:STO 2.7 V EVDD 5.5 V 0.26 μs
Bus-free time tBUF 2.7 V EVDD 5.5 V 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 tR
SCL0
SDA0
tBUF
(1) When reference voltage (+) = AVREFP/ANI0 (ADREFP1 = 0, ADREFP0 = 1), reference voltage () = AVREFM/ANI1
(ADREFM = 1), target pins: ANI2 to ANI5 and internal reference voltage
(TA = 40 to +85C, 1.9 V VDD = EVDD 5.5 V, VSS = EVSS = 0 V, reference voltage (+) = AVREFP, reference voltage ()
= AVREFM = 0 V)
(2) When reference voltage (+) = VDD (ADREFP1 = 0, ADREFP0 = 0), reference voltage () = VSS (ADREFM = 0), target
pins: ANI0 to ANI5 and internal reference voltage
(TA = 40 to +85C, 1.9 V VDD = EVDD 5.5 V, VSS = EVSS = 0 V, reference voltage (+) = VDD, reference voltage () =
VSS)
Caution When using reference voltage (+) = VDD, taking into account the voltage drop due to the effect of the
power switching circuit of the battery backup function and use the A/D conversion result. In addition,
enter HALT mode during A/D conversion and set VDD port to input.
(3) When reference voltage (+) = Internal reference voltage (ADREFP1 = 1, ADREFP0 = 0), reference voltage () =
AVREFM/ANI1 (ADREFM = 1), target pins: ANI0, ANI2 to ANI5
(TA = 40 to +85C, 2.4 V VDD = EVDD 5.5 V, VSS = EVSS = 0 V, reference voltage (+) = VBGR, reference voltage () =
AVREFM = 0 V, HS (high-speed main) mode)
(TA = 40 to +85C, AVDD VDD + 0.3 V, 2.4 V AVDD 5.5 V, 2.4 V VDD 5.5 V, VSS = AVSS = 0 V)
(TA = 40 to +85C, AVDD VDD + 0.3 V, 2.4 V AVDD 5.5 V, 2.4 V VDD 5.5 V, VSS = AVSS = 0 V)
(TA = 40 to +85C, AVDD VDD + 0.3 V, 2.4 V AVDD 5.5 V, 2.4 V VDD 5.5 V, VSS = AVSS = 0 V)
Operation clock fDSAD fX oscillation clock, input external clock or high- 12 MHz
speed on-chip oscillator clock is used
Sampling frequency fS 3906.25 Hz
Oversampling frequency fOS 1.5 MHz
Output data rate TDATA 256 μs
Data width RES 24 bit
SNDR SNDR x1 gain 80 dB
High-speed system clock is selected as
operating clock of 24-bit ∆Σ A/D converter (bit 0
of PCKC register (DSADCK) = 1)
x16 gain 69 74
High-speed system clock is selected as operating
clock of 24-bit ∆Σ A/D converter (bit 0 of PCKC
register (DSADCK) = 1)
x32 gain 65 69
High-speed system clock is selected as operating
clock of 24-bit ∆Σ A/D converter (bit 0 of PCKC
register (DSADCK) = 1)
Passband (low pass band) fChpf At 3 dB (phase in high pass filter not adjusted) 0.607 Hz
Bits 7 and 6 of DSADHPFCR register
(DSADCOF1, DSADCOF0) = 00
At 3 dB (phase in high pass filter not adjusted) 1.214 Hz
Bits 7 and 6 of DSADHPFCR register
(DSADCOF1, DSADCOF0) = 01
At 3 dB (phase in high pass filter not adjusted) 2.429 Hz
Bits 7 and 6 of DSADHPFCR register
(DSADCOF1, DSADCOF0) = 10
At 3 dB (phase in high pass filter not adjusted) 4.857 Hz
Bits 7 and 6 of DSADHPFCR register
(DSADCOF1, DSADCOF0) = 11
In-band ripple 1 rp1 45 Hz to 55 Hz @50 Hz 0.01 0.01 dB
54 Hz to 66 Hz @60 Hz
In-band ripple 2 rp2 45 Hz to 275 Hz @50 Hz 0.1 0.1
54 Hz to 330 Hz @60 Hz
In-band ripple 3 rp3 45 Hz to 1100 Hz @50 Hz 0.1 0.1
54 Hz to 1320 Hz @60 Hz
Passband (high pass band) fClpf 3 dB 1672 Hz
Stopband (high pass band) fatt 80 dB 2545 Hz
Out-band attenuation ATT1 fS 80 dB
ATT2 2 fS 80 dB
(TA = 40 to +85C, AVDD VDD + 0.3 V, 2.4 V AVDD 5.5 V, 2.4 V VDD 5.5 V, VSS = AVSS = 0 V)
Operation clock fDSAD fX oscillation clock, input external clock or high- 12 MHz
speed on-chip oscillator clock is used
(TA = 40 to +85C, 2.4 V VDD = EVDD 5.5 V, VSS = EVSS = 0 V, HS (high-speed main) mode)
Note Time to drop to output stable value 5LSB (7 mV) or less.
37.6.4 Comparator
Notes 1. Be sure to maintain the reset state until the power supply voltage rises over the minimum VDD value in the
operating voltage range specified in 37.4 AC Characteristics, by using the voltage detector or external reset
pin.
2. If the power supply voltage falls while the voltage detector is off, be sure to either shift to STOP mode or
execute a reset by using the voltage detector or external reset pin before the power supply voltage falls below
the minimum operating voltage specified in 37.4 AC Characteristics.
Detection Supply voltage level VLVD0 When power supply rises 3.98 4.06 4.24 V
voltage When power supply falls 3.90 3.98 4.16 V
VLVD8 VPOC2, VPOC1, VPOC0 = 0, 1, 0, falling reset voltage 2.40 2.45 2.60 V
VLVD7 LVIS1, LVIS0 = 1, 0 Rising release reset voltage 2.56 2.61 2.76 V
VLVD6 LVIS1, LVIS0 = 0, 1 Rising release reset voltage 2.66 2.71 2.86 V
VLVD1 LVIS1, LVIS0 = 0, 0 Rising release reset voltage 3.68 3.75 3.92 V
VLVD5 VPOC2, VPOC1, VPOC0 = 0, 1, 1, falling reset voltage 2.70 2.75 2.91 V
VLVD4 LVIS1, LVIS0 = 1, 0 Rising release reset voltage 2.86 2.92 3.07 V
VLVD3 LVIS1, LVIS0 = 0, 1 Rising release reset voltage 2.96 3.02 3.18 V
VLVD0 LVIS1, LVIS0 = 0, 0 Rising release reset voltage 3.98 4.06 4.24 V
Caution Make sure to keep the internal reset state by the LVD circuit or an external reset until VDD reaches the
operating voltage range shown in 37.4 AC Characteristics.
Power swiching detection voltage VDETBAT1 VDD VBAT 1.92 2.00 2.08 V
VDETBAT2 VBAT VDD 2.02 2.10 2.18 V
VDD fall slope SVDDF 0.06 V/ms
Response time of power switch detector tcmp 300 μs
VBAT
Internal voltage
VDETBAT2
VDETBAT1
VDD
Power switching
signal
tcmp tcmp
Notes 1. This is a capacitor that is connected between voltage pins used to drive the LCD.
C1: A capacitor connected between CAPH and CAPL
C2: A capacitor connected between VL1 and GND
C3: A capacitor connected between VL2 and GND
C4: A capacitor connected between VL4 and GND
C1 = C2 = C3 = C4 = 0.47 μF30 %
2. This is the time required to wait from when the reference voltage is specified by using the VLCD register (or
when the internal voltage boosting method is selected (by setting the MDSET1 and MDSET0 bits of the
LCDM0 register to 01B) if the default value reference voltage is used) until voltage boosting starts (VLCON =
1).
3. This is the wait time from when voltage boosting is started (VLCON = 1) until display is enabled (LCDON = 1).
Notes 1. This is a capacitor that is connected between voltage pins used to drive the LCD.
C1: A capacitor connected between CAPH and CAPL
C2: A capacitor connected between VL1 and GND
C3: A capacitor connected between VL2 and GND
C4: A capacitor connected between VL3 and GND
C5: A capacitor connected between VL4 and GND
C1 = C2 = C3 = C4 = C5 = 0.47 μF30 %
2. This is the time required to wait from when the reference voltage is specified by using the VLCD register (or
when the internal voltage boosting method is selected (by setting the MDSET1 and MDSET0 bits of the
LCDM0 register to 01B) if the default value reference voltage is used) until voltage boosting starts (VLCON =
1).
3. This is the wait time from when voltage boosting is started (VLCON = 1) until display is enabled (LCDON = 1).
Notes 1. This is the wait time from when voltage bucking is started (VLCON = 1) until display is enabled (LCDON = 1).
2. This is a capacitor that is connected between voltage pins used to drive the LCD.
C1: A capacitor connected between CAPH and CAPL
C2: A capacitor connected between VL1 and GND
C3: A capacitor connected between VL2 and GND
C4: A capacitor connected between VL4 and GND
C1 = C2 = C3 = C4 = 0.47 μF30 %
<R> Note The value depends on the POR detection voltage. When the voltage drops, the RAM data is retained before a
POR reset is effected, but RAM data is not retained when a POR reset is effected.
VDD
VDDDR
Notes 1. 1 erase + 1 write after the erase is regarded as 1 rewrite. The retaining years are until next rewrite after the
rewrite.
2. When using flash memory programmer and Renesas Electronics self programming library
3. This characteristic indicates the flash memory characteristic and based on Renesas Electronics reliability test.
Time to complete the tSUINIT POR and LVD reset must be released before 100 ms
communication for the initial setting the external reset is released.
after the external reset is released
Time to release the external reset tSU POR and LVD reset must be released before 10 μs
after the TOOL0 pin is set to the the external reset is released.
low level
Time to hold the TOOL0 pin at the tHD POR and LVD reset must be released before 1 ms
low level after the external reset is the external reset is released.
released
(excluding the processing time of
the firmware to control the flash
memory)
RESET
723 μs + tHD
processing
00H reception
time
(TOOLRxD, TOOLTxD mode)
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 resets end.
tSU: Time to release the external reset after the TOOL0 pin is set to the low level.
tHD: Time to hold the TOOL0 pin at the low level after the external reset is released (excluding the processing
time of the firmware to control the flash memory)
R5F10MMEDFB, R5F10MMGDFB
R01UH0407EJ0210 Rev.2.10
HD
*1
D
51
R5F10MPEDFB, R5F10MPGDFB
75
NOTE)
1. DIMENSIONS "*1" AND "*2"
76 50 DO NOT INCLUDE MOLD FLASH.
2. DIMENSION "*3" DOES NOT
INCLUDE TRIM OFFSET.
bp
b1
E
HE
Reference Dimension in Millimeters
*2
c
c1
Symbol
Min Nom Max
D 13.9 14.0 14.1
E 13.9 14.0 14.1
Terminal cross section A2 1.4
HD 15.8 16.0 16.2
100 HE
26 15.8 16.0 16.2
ZE
A 1.7
1 2 5 A1 0.05 0.1 0.15
Index mark bp 0.15 0.20 0.25
ZD
F b1 0.18
S
c 0.09 0.145 0.20
c1 0.125
A
A2
c
0° 8°
e 0.5
y S *3 L
A1
e bp x 0.08
x
L1 y 0.08
ZD 1.0
Detail F
ZE 1.0
L 0.35 0.5 0.65
L1 1.0
CHAPTER 38 PACKAGE DRAWINGS
1024
RL78/I1B APPENDIX A REVISION HISTORY
(2/4)
Page Description Classification
CHAPTER 14 A/D CONVERTER
p.365 Modification of Figure 14-4 in 14.3.2 A/D converter mode register 0 (c)
p.394 Modification of Figure 14-29 in 14.7.1 Setting up software trigger mode (c)
p.395 Modification of Figure 14-30 in 14.7.2 Setting up hardware trigger no-wait mode (c)
p.396 Modification of Figure 14-31 in 14.7.3 Setting up hardware trigger wait mode (c)
p.397 Modification of Figure 14-32 in 14.7.4 Setup when temperature sensor output (c)
voltage/internal reference voltage is selected
p.398 Modification of Figure 14-33 in 14.7.5 Setting up test mode (c)
p.402 Modification of Figure 14-37 in 14.8 SNOOZE Mode Function (c)
CHAPTER 18 SERIAL ARRAY UNIT
p.456 Modification of Figure 18-1 in 18.2 Configuration of Serial Array Unit (c)
p.457 Modification of Figure 18-2 in 18.2 Configuration of Serial Array Unit (c)
p.467 Modification of description in 18.3.5 Serial data register mn (SDRmn) (c)
p.476 Modification of description in 18.3.12 Serial output register m (c)
p.478 Modification of Figure 18-18 in 18.3.13 Serial output level register m (c)
p.544 Modification of description in 18.5.7 SNOOZE mode function (c)
p.544 Modification of Figure 18-71 in 18.5.7 SNOOZE mode function (a)
p.544 Modification of note in 18.5.7 SNOOZE mode function (c)
p.545 Modification of Figure 18-72 in 18.5.7 SNOOZE mode function (c)
p.546 Modification of Figure 18-73 in 18.5.7 SNOOZE mode function (a)
p.546 Modification of note in 18.5.7 SNOOZE mode function (c)
p.547 Modification of Figure 18-74. in 18.5.7 SNOOZE mode function (c)
p.570 Modification of description in 18.6.3 SNOOZE mode function (c)
p.570 Addition of caution 5 in 18.6.3 SNOOZE mode function (c)
p.572 Modification of Figure 18-90 in 18.6.3 SNOOZE mode function (a)
p.573 Modification of Figure 18-91 in 18.6.3 SNOOZE mode function (a)
p.574 Modification of Figure 18-92 in 18.6.3 SNOOZE mode function (c)
p.575 Modification of Figure 18-93 in 18.6.3 SNOOZE mode function (a)
p.576 Modification of Figure 18-94 in 18.6.3 SNOOZE mode function (c)
p.585 Modification of Figure 18-99 in 18.7.1 LIN transmission (a)
p.587 Modification of Figure 18-100 in 18.7.2 LIN reception (a)
p.588 Modification of Figure 18-101 in 18.7.2 LIN reception (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
(3/4)
Page Description Classification
CHAPTER 19 SERIAL INTERFACE IICA
p.630 Addition of description in 19.3.6 IICA low-level width setting register n (c)
p.649 Modification of calculation formula in 19.5.14 Communication reservation (c)
p.651 Modification of note 1 in Figure 19-27 in 19.5.14 Communication reservation (c)
p.655 Modification of Figure 19-28 in 19.5.16 Communication operations (c)
p.656 Modification of Figure 19-29 (1/3) in 19.5.16 Communication operations (c)
p.657 Modification of note in Figure 19-29 in 19.5.16 Communication operations (c)
p.660 Modification of Figure 19-30 in 19.5.16 Communication operations (c)
CHAPTER 21 LCD CONTROLLER/DRIVER
p.713 Addition of remark in 21.3.2 LCD mode register 1 (c)
p.714 Deletion of remark in 21.3.3 Subsystem clock supply mode control register (moved to (c)
21.3.2)
p.719 Modification of note in 21.3.7 LCD port function registers 0 to 5 (c)
CHAPTER 22 DATA TRANSFER CONTROLLER (DTC)
p.766 Addition of description in CHAPTER 22 DATA TRANSFER CONTROLLER (c)
p.767 Modification of Table 22-1 in 22.1 Functions of DTC (c)
p.771 Modification of Figure 22-3 in 22.3.2 Control data allocation (c)
p.772 Modification of Table 22-4 in 22.3.2 Control data allocation (c)
p.773 Addition of Figure 22-4 in 22.3.3 Vector table (c)
p.784 Modification of description in 22.4.2 Normal mode (c)
p.784 Modification of Figure 22-16 in 22.4.2 Normal mode (c)
p.791 Addition of description in 22.5.3 DTC pending instruction (c)
CHAPTER 23 INTERRUPT FUNCTIONS
p.817, 818 Addition of 23.4.4 Interrupt servicing during division instruction (c)
p.819 Addition of description in 23.4.5 Interrupt request hold (c)
CHAPTER 24 STANDBY FUNCTION
p.823 Modification of Table 24-1 (1/2) in 24.3.1 HALT mode (c)
p.825 Modification of Table 24-1 (2/2) in 24.3.1 HALT mode (c)
p.835 Modification of Table 24-3 in 24.3.3 SNOOZE mode
CHAPTER 25 RESET FUNCTION
p.841 Deletion of caution in 25.1 Timing of Reset Operation (c)
p.846 Modification of title in Figure 25-5 in 25.3.1 Reset control flag register (RESF) (c)
CHAPTER 26 POWER-ON-RESET CIRCUIT
p.850 Modification of note 3,4 in 26.3 Operation of Power-on-reset Circuit (c)
p.852 Modification of note 3 in 26.3 Operation of Power-on-reset Circuit (a)
CHAPTER 27 VOLTAGE DETECTOR
p.854 Modification of description in 27.1 Functions of Voltage Detector (a)
p.854 Modification of table in 27.1 Functions of Voltage Detector (c)
CHAPTER 30 SAFETY FUNCTIONS
p.897 Modification of note in 30.3.6 Invalid memory access detection function (a)
CHAPTER 32 OPTION BYTE
p.907 Modification of description in 32.1.1 User option byte (c)
p.911 Modification of Figure 32-3 in 32.2 Format of User Option Byte (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/4)
Page Description Classification
Here is the revision history of the preceding editions. Chapter indicates the chapter of each edition.
(1/6)
Edition Description Chapter
Rev.1.00 Change of 1.2 Ordering Information CHAPTER 1 OUTLINE
Change of 2.1 Port Function List CHAPTER 2 PIN
Change of 2.2 Functions other than port pins FUNCTIONS
Change of 2.3 Pin I/O Circuits and Recommended Connection of Unused Pins
Addition of 3.1 Overview CHAPTER 3 CPU
Change of 3.2 Memory Space ARCHITECTURE
(2/6)
Edition Description Chapter
Rev.1.00 Change of 12.1 Functions of Clock Output/Buzzer Output Controller CHAPTER 12 CLOCK
Change of 12.2 Configuration of Clock Output/Buzzer Output Controller OUTPUT/BUZZER
OUTPUT CONTROLLER
Change of 12.3 Registers Controlling Clock Output/Buzzer Output Controller
Change of 12.4 Operations of Clock Output/Buzzer Output Controller
Change of 13.1 Functions of Watchdog Timer CHAPTER 13
Change of 13.2 Configuration of Watchdog Timer WATCHDOG TIMER
(3/6)
Edition Description Chapter
Rev.1.00 Change of 22.2 Registers CHAPTER 22 DATA
Change of 22.4 Notes on DTC TRANSFER
CONTROLLER
Change of 23.2 Interrupt Sources and Configuration CHAPTER 23
Change of 23.3 Registers Controlling Interrupt Functions INTERRUPT FUNCTIONS
Change of 33.2 Writing to Flash Memory by Using External Device (that Incorporates UART)
Change of 33.3 Connection of Pins on Board
Change of 33.4 Programming Method
Change of 33.5 Security Settings
Change of 33.6 Self-Programming
Change of 34.1 Connecting E1 On-chip Debugging Emulator to RL78/I1B CHAPTER 34 ON-CHIP
DEBUG FUNCTION
(4/6)
Edition Description Chapter
Rev.1.00 Change of 37.1 Absolute Maximum Ratings CHAPTER 37
Change of 37.2 Oscillator Characteristics ELECTRICAL
SPECIFICATIONS
Change of 37.3 DC Characteristics
Change of 37.4 AC Characteristics
Change of 37.5 Peripheral Functions Characteristics
Change of 37.6 Analog Characteristics
Change of 37.7 Battery Backup Function
Change of 37.8 LCD Characteristics
Addition of 37.11 Dedicated Flash Memory Programmer Communication (UART)
Change of 37.12 Timing Specs for Switching Flash Memory Programming Modes
Rev.2.00 Change of high accuracy RTC to RTC2, and high accuracy real-time clock to real-time clock 2 Throughout
Change of high accuracy temperature sensor to temperature sensor 2
Modification of 1.1 Features CHAPTER 1 OUTLINE
Modification of 1.2 List of Part Numbers
Modification of 1.3 Pin Configuration (Top View)
Modification of 2.1 Port Function List CHAPTER 2 PIN
Modification of 2.2 Functions Other than Port Pins FUNCTIONS
Modification of 2.3 Connection of Unused Pins
Addition of 2.4 Block Diagrams of Pins
Modification of 3.1 Memory Space CHAPTER 3 CPU
Modification of 3.2 Processor Registers ARCHITECTURE
Modification of 3.3 Instruction Address Addressing
Modification of 3.4 Addressing for Processing Data Addresses
Modification of 4.2 Port Configuration CHAPTER 4 PORT
Modification of 4.3 Registers Controlling Port Function FUNCTIONS
Modification of 4.4 Port Function Operations
Modification of 4.5 Register Settings When Using Alternate Function
Modification of 4.6 Cautions When Using Port Function
Modification of 5.3 Registers Controlling Clock Generator CHAPTER 5 CLOCK
Modification of 5.4 System Clock Oscillator GENERATOR
Modification of 5.6 Controlling the Clock
Addition of 5.7 Resonator and Oscillator Constants
Modification of 7.2 Configuration of Timer Array Unit CHAPTER 7 TIMER
Modification of 7.3 Registers Controlling Timer Array Unit ARRAY UNIT
Modification of 7.5 Operation of Counter
Modification of 7.6 Channel Output (TOmn Pin) Control
Addition of 7.7 Timer Input (TImn) Control
Modification of 7.8 Independent Channel Operation Function of Timer Array Unit
Modification of 7.9 Simultaneous Channel Operation Function of Timer Array Unit
Modification of 8.1 Functions of Real-time Clock 2 CHAPTER 8 REAL-TIME
Modification of 8.2 Configuration of Real-time Clock 2 CLOCK 2
Modification of 8.3 Registers Controlling Real-time Clock 2
Modification of 8.4 Real-time Clock 2 Operation
(5/6)
Edition Description Chapter
Rev.2.00 Modification of 10.3 Registers Controlling 12-bit Interval Timer CHAPTER 10 12-BIT
INTERVAL TIMER
Modification of 11.4 Operation CHAPTER 11 8-BIT
Modification of 11.5 Notes on 8-bit Interval Timer INTERVAL TIMER
Modification of 12.5 Cautions of Clock Output/Buzzer Output Controller CHAPTER 12 CLOCK
OUTPUT/BUZZER
OUTPUT CONTROLLER
Modification of 13.2 Configuration of Watchdog Timer CHAPTER 13
WATCHDOG TIMER
Modification of 14.3 Registers Controlling A/D Converter CHAPTER 14 A/D
Modification of 14.4 A/D Converter Conversion Operations CONVERTER
Modification of 14.6 A/D Converter Operation Modes
Modification of 14.7 A/D Converter Setup Flowchart
Modification of 14.8 SNOOZE Mode Function
Modification of 14.10 Cautions for A/D Converter
Modification of 15.1 Functions of Temperature Sensor CHAPTER 15
TEMPERATURE SENSOR
2
Modification of 16.1 Functions of 24-bit A/D Converter CHAPTER 16 24-BIT
Modification of 16.2 Registers A/D CONVERTER
Modification of 17.1 Functions of Comparator CHAPTER 17
Modification of 17.2 Configuration of Comparator COMPARATOR
Modification of 17.3 Registers Controlling Comparator
Modification of 17.4 Operation
Modification of 18.1 Functions of Serial Array Unit CHAPTER 18 SERIAL
Modification of 18.2 Configuration of Serial Array Unit ARRAY UNIT
Modification of 18.3 Registers Controlling Serial Array Unit
Modification of 18.5 Operation of 3-Wire Serial I/O (CSI00) Communication
Modification of 18.6 Operation of UART (UART0 to UART2) Communication
Modification of 18.7 LIN Communication Operation
2
Modification of 18.8 Operation of Simplified I C (IIC00, IIC10) Communication
Modification of 19.1 Functions of Serial Interface IICA CHAPTER 19 SERIAL
Modification of 19.3 Registers Controlling Serial Interface IICA INTERFACE IICA
2
Modification of 19.4 I C Bus Mode Functions
2
Modification of 19.5 I C Bus Definitions and Control Methods
Modification of 20.4 Usage Notes on IrDA CHAPTER 20 IrDA
Modification of CHAPTER 21 LCD CONTROLLER/DRIVER CHAPTER 21 LCD
Modification of 21.1 Functions of LCD Controller/Driver CONTROLLER/DRIVER
Modification of 21.3 Registers Controlling LCD Controller/Driver
Modification of 21.5 Selection of LCD Display Register
Modification of 21.6 Setting the LCD Controller/Driver
Modification of 22.1 Functions of DTC CHAPTER 22 DATA
Modification of 22.2 Configuration of DTC TRANSFER
Modification of 22.3 Registers Controlling DTC CONTROLLER (DTC)
(6/6)
Edition Description Chapter
Rev.2.00 Modification of 24.2 Registers Controlling Standby Function CHAPTER 24 STANDBY
Modification of 24.3 Standby Function Operation FUNCTION
Modification of CHAPTER 25 RESET FUNCTION CHAPTER 25 RESET
Modification of 25.1 Timing of Reset Operation FUNCTION
Modification of 25.2 States of Operation During Reset Periods
Modification of 25.3 Register for Confirming Reset Source
Modification of 26.3 Operation of Power-on-reset Circuit CHAPTER 26 POWER-
ON-RESET CIRCUIT
Modification of 27.1 Functions of Voltage Detector CHAPTER 27 VOLTAGE
Modification of 27.2 Configuration of Voltage Detector DETECTOR
Modification of 27.3 Registers Controlling Voltage Detector
Modification of 27.4 Operation of Voltage Detector
Modification of 29.3 Registers Used by Oscillation Stop Detector CHAPTER 29
OSCILLATION STOP
DETECTOR
Modification of 30.1 Overview of Safety Functions CHAPTER 30 SAFETY
Modification of 30.3 Operation of Safety Functions FUNCTIONS
Modification of 33.1 Serial Programming Using Flash Memory Programmer CHAPTER 33 FLASH
Modification of 33.2 Serial Programming Using External Device (That Incorporates UART) MEMORY
R01UH0407EJ0210