R5F21255SNFP Renesas PDF
R5F21255SNFP Renesas PDF
R5F21255SNFP Renesas PDF
www.DataSheet4U.com
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 Technology Corp. without notice. Please review the latest information published
by Renesas Technology Corp. through various means, including the Renesas Technology
Corp. website (http://www.renesas.com).
Rev.3.00
Revision Date: Feb 29, 2008 www.renesas.com
Notes regarding these materials
1. This document is provided for reference purposes only so that Renesas customers may select the appropriate
Renesas products for their use. Renesas neither makes warranties or representations with respect to the
accuracy or completeness of the information contained in this document nor grants any license to any
intellectual property rights or any other rights of Renesas or any third party with respect to the information in
this document.
2. Renesas shall have no liability for damages or infringement of any intellectual property or other rights arising
out of the use of any information in this document, including, but not limited to, product data, diagrams, charts,
programs, algorithms, and application circuit examples.
3. You should not use the products or the technology described in this document for the purpose of military
applications such as the development of weapons of mass destruction or for the purpose of any other military
use. When exporting the products or technology described herein, you should follow the applicable export
control laws and regulations, and procedures required by such laws and regulations.
4. All information included in this document such as product data, diagrams, charts, programs, algorithms, and
www.DataSheet4U.com
application circuit examples, is current as of the date this document is issued. Such information, however, is
subject to change without any prior notice. Before purchasing or using any Renesas products listed in this
document, please confirm the latest product information with a Renesas sales office. Also, please pay regular
and careful attention to additional and different information to be disclosed by Renesas such as that disclosed
through our website. (http://www.renesas.com )
5. Renesas has used reasonable care in compiling the information included in this document, but Renesas
assumes no liability whatsoever for any damages incurred as a result of errors or omissions in the information
included in this document.
6. When using or otherwise relying on the information in this document, you should evaluate the information in
light of the total system before deciding about the applicability of such information to the intended application.
Renesas makes no representations, warranties or guaranties regarding the suitability of its products for any
particular application and specifically disclaims any liability arising out of the application and use of the
information in this document or Renesas products.
7. With the exception of products specified by Renesas as suitable for automobile applications, Renesas
products are not designed, manufactured or tested for applications or otherwise in systems the failure or
malfunction of which may cause a direct threat to human life or create a risk of human injury or which require
especially high quality and reliability such as safety systems, or equipment or systems for transportation and
traffic, healthcare, combustion control, aerospace and aeronautics, nuclear power, or undersea communication
transmission. If you are considering the use of our products for such purposes, please contact a Renesas
sales office beforehand. Renesas shall have no liability for damages arising out of the uses set forth above.
8. Notwithstanding the preceding paragraph, you should not use Renesas products for the purposes listed below:
(1) artificial life support devices or systems
(2) surgical implantations
(3) healthcare intervention (e.g., excision, administration of medication, etc.)
(4) any other purposes that pose a direct threat to human life
Renesas shall have no liability for damages arising out of the uses set forth in the above and purchasers who
elect to use Renesas products in any of the foregoing applications shall indemnify and hold harmless Renesas
Technology Corp., its affiliated companies and their officers, directors, and employees against any and all
damages arising out of such applications.
9. You should use the products described herein within the range specified by Renesas, especially with respect
to the maximum rating, operating supply voltage range, movement power voltage range, heat radiation
characteristics, installation and other product characteristics. Renesas shall have no liability for malfunctions or
damages arising out of the use of Renesas products beyond such specified ranges.
10. Although Renesas endeavors to improve the quality and reliability of its products, IC products have specific
characteristics such as the occurrence of failure at a certain rate and malfunctions under certain use
conditions. Please be sure to implement safety measures to guard against the possibility of physical injury, and
injury or damage caused by fire in the event of the failure of a Renesas product, such as safety design for
hardware and software including but not limited to redundancy, fire control and malfunction prevention,
appropriate treatment for aging degradation or any other applicable measures. Among others, since the
evaluation of microcomputer software alone is very difficult, please evaluate the safety of the final products or
system manufactured by you.
11. In case Renesas products listed in this document are detached from the products to which the Renesas
products are attached or affixed, the risk of accident such as swallowing by infants and small children is very
high. You should implement safety measures so that Renesas products may not be easily detached from your
products. Renesas shall have no liability for damages arising out of such detachment.
12. This document may not be reproduced or duplicated, in any form, in whole or in part, without prior written
approval from Renesas.
13. Please contact a Renesas sales office if you have any questions regarding the information contained in this
document, Renesas semiconductor products, or if you have any other inquiries.
General Precautions in the Handling of MPU/MCU Products
The following usage notes are applicable to all MPU/MCU products from Renesas. For detailed usage notes
on the products covered by this manual, refer to the relevant sections of the manual. If the descriptions under
General Precautions in the Handling of MPU/MCU Products and in the body of the manual differ from each
other, the description in the body of the manual takes precedence.
Particular
www.DataSheet4U.com attention should be paid to the precautionary notes when using the manual. These notes occur
within the body of the text, at the end of each section, and in the Usage Notes section.
The revision history summarizes the locations of revisions and additions. It does not list all revisions. Refer
to the text of the manual for details.
The following documents apply to the R8C/24 Group, R8C/25 Group. Make sure to refer to the latest versions of these
documents. The newest versions of the documents listed may be obtained from the Renesas Technology Web site.
XXX Register *1
b7 b6 b5 b4 b3 b2 b1 b0
XXX5 WO
XXX6 RW
*1
Blank: Set to 0 or 1 according to the application.
0: Set to 0.
1: Set to 1.
X: Nothing is assigned.
*2
RW: Read and write.
RO: Read only.
WO: Write only.
−: Nothing is assigned.
*3
• Reserved bit
Reserved bit. Set to specified value.
*4
• Nothing is assigned
Nothing is assigned to the bit. As the bit may be used for future functions, if necessary, set to 0.
• Do not set to a value
Operation is not guaranteed when a value is set.
• Function varies according to the operating mode.
The function of the bit varies with the peripheral function mode. Refer to the register diagram for information
on the individual modes.
4. List of Abbreviations and Acronyms
All trademarks and registered trademarks are the property of their respective owners.
Table of Contents
1. Overview ......................................................................................................................................... 1
1.1 Applications ............................................................................................................................................... 1
1.2 Performance Overview .............................................................................................................................. 2
1.3 Block Diagram .......................................................................................................................................... 4
1.4 Product Information .................................................................................................................................. 5
1.5 Pin Assignments ........................................................................................................................................ 9
1.6 Pin Functions ........................................................................................................................................... 11
www.DataSheet4U.com
2. Central Processing Unit (CPU) ..................................................................................................... 13
2.1 Data Registers (R0, R1, R2, and R3) ...................................................................................................... 14
2.2 Address Registers (A0 and A1) ............................................................................................................... 14
2.3 Frame Base Register (FB) ....................................................................................................................... 14
2.4 Interrupt Table Register (INTB) .............................................................................................................. 14
2.5 Program Counter (PC) ............................................................................................................................. 14
2.6 User Stack Pointer (USP) and Interrupt Stack Pointer (ISP) .................................................................. 14
2.7 Static Base Register (SB) ........................................................................................................................ 14
2.8 Flag Register (FLG) ................................................................................................................................ 14
2.8.1 Carry Flag (C) ..................................................................................................................................... 14
2.8.2 Debug Flag (D) ................................................................................................................................... 14
2.8.3 Zero Flag (Z) ....................................................................................................................................... 14
2.8.4 Sign Flag (S) ....................................................................................................................................... 14
2.8.5 Register Bank Select Flag (B) ............................................................................................................ 14
2.8.6 Overflow Flag (O) .............................................................................................................................. 14
2.8.7 Interrupt Enable Flag (I) ..................................................................................................................... 15
2.8.8 Stack Pointer Select Flag (U) .............................................................................................................. 15
2.8.9 Processor Interrupt Priority Level (IPL) ............................................................................................. 15
2.8.10 Reserved Bit ........................................................................................................................................ 15
3. Memory ......................................................................................................................................... 16
3.1 R8C/24 Group ......................................................................................................................................... 16
3.2 R8C/25 Group ......................................................................................................................................... 17
5. Resets ........................................................................................................................................... 25
5.1 Hardware Reset ....................................................................................................................................... 28
5.1.1 When Power Supply is Stable ............................................................................................................. 28
5.1.2 Power On ............................................................................................................................................ 28
5.2 Power-On Reset Function ....................................................................................................................... 30
5.3 Voltage Monitor 0 Reset ......................................................................................................................... 31
5.4 Voltage Monitor 1 Reset ......................................................................................................................... 31
5.5 Voltage Monitor 2 Reset ......................................................................................................................... 31
5.6 Watchdog Timer Reset ............................................................................................................................ 32
5.7 Software Reset ......................................................................................................................................... 32
A-1
6.1.1 Monitoring Vdet0 ............................................................................................................................... 40
6.1.2 Monitoring Vdet1 ............................................................................................................................... 40
6.1.3 Monitoring Vdet2 ............................................................................................................................... 40
6.2 Voltage Monitor 0 Reset ......................................................................................................................... 41
6.3 Voltage Monitor 1 Interrupt and Voltage Monitor 1 Reset ..................................................................... 42
6.4 Voltage Monitor 2 Interrupt and Voltage Monitor 2 Reset ..................................................................... 44
9. Bus ................................................................................................................................................ 72
A-2
11. Protection .................................................................................................................................... 100
A-3
14.3.7 PWM Mode ....................................................................................................................................... 213
14.3.8 Reset Synchronous PWM Mode ....................................................................................................... 226
14.3.9 Complementary PWM Mode ............................................................................................................ 236
14.3.10 PWM3 Mode ..................................................................................................................................... 250
14.3.11 Timer RD Interrupt ........................................................................................................................... 262
14.3.12 Notes on Timer RD ........................................................................................................................... 264
14.4 Timer RE ............................................................................................................................................... 270
14.4.1 Real-Time Clock Mode .................................................................................................................... 271
14.4.2 Output Compare Mode ..................................................................................................................... 279
14.4.3 Notes on Timer RE ........................................................................................................................... 285
www.DataSheet4U.com
A-4
17.4.4 Hardware LIN End Processing ......................................................................................................... 380
17.5 Interrupt Requests .................................................................................................................................. 381
17.6 Notes on Hardware LIN ........................................................................................................................ 382
A-5
21.3.3 Notes on Timer RD ........................................................................................................................... 463
21.3.4 Notes on Timer RE ........................................................................................................................... 469
21.4 Notes on Serial Interface ....................................................................................................................... 472
21.5 Notes on Clock Synchronous Serial Interface ....................................................................................... 473
21.5.1 Notes on Clock Synchronous Serial I/O with Chip Select ............................................................... 473
21.5.2 Notes on I2C bus Interface ................................................................................................................ 473
21.6 Notes on Hardware LIN ........................................................................................................................ 474
21.7 Notes on A/D Converter ........................................................................................................................ 475
21.8 Notes on Flash Memory ........................................................................................................................ 476
21.8.1 CPU Rewrite Mode ........................................................................................................................... 476
www.DataSheet4U.com
21.9 Notes on Noise ...................................................................................................................................... 479
21.9.1 Inserting a Bypass Capacitor between VCC and VSS Pins as a Countermeasure against Noise and
Latch-up ............................................................................................................................................ 479
21.9.2 Countermeasures against Noise Error of Port Control Registers ..................................................... 479
Appendix 2. Connection Examples between Serial Writer and On-Chip Debugging Emulator ............ 482
A-6
SFR Page Reference
Address Register Symbol Page Address Register Symbol Page
0000h 0040h
0001h 0041h
0002h 0042h
0003h 0043h
0004h Processor Mode Register 0 PM0 71 0044h
0005h Processor Mode Register 1 PM1 71 0045h
0006h System Clock Control Register 0 CM0 75 0046h
0007h System Clock Control Register 1 CM1 76 0047h
0008h 0048h Timer RD0 Interrupt Control Register TRD0IC 107
0009h 0049h Timer RD1 Interrupt Control Register TRD1IC 107
000Ah Protect Register PRCR 100 004Ah Timer RE Interrupt Control Register TREIC 106
000Bh 004Bh
000Ch Oscillation Stop Detection Register OCD 77 004Ch
www.DataSheet4U.com
000Dh Watchdog Timer Reset Register WDTR 129 004Dh Key Input Interrupt Control Register KUPIC 106
000Eh Watchdog Timer Start Register WDTS 129 004Eh A/D Conversion Interrupt Control Register ADIC 106
000Fh Watchdog Timer Control Register WDC 128 004Fh SSU/IIC Interrupt Control Register SSUIC/IICIC 107
0010h Address Match Interrupt Register 0 RMAD0 121 0050h
0011h 0051h UART0 Transmit Interrupt Control Register S0TIC 106
0012h 0052h UART0 Receive Interrupt Control Register S0RIC 106
0013h Address Match Interrupt Enable Register AIER 121 0053h UART1 Transmit Interrupt Control Register S1TIC 106
0014h Address Match Interrupt Register 1 RMAD1 121 0054h UART1 Receive Interrupt Control Register S1RIC 106
0015h 0055h INT2 Interrupt Control Register INT2IC 108
0016h 0056h Timer RA Interrupt Control Register TRAIC 106
0017h 0057h
0018h 0058h Timer RB Interrupt Control Register TRBIC 106
0019h 0059h INT1 Interrupt Control Register INT1IC 108
001Ah 005Ah INT3 Interrupt Control Register INT3IC 108
001Bh 005Bh
001Ch Count Source Protection Mode Register CSPR 129 005Ch
001Dh 005Dh INT0 Interrupt Control Register INT0IC 108
001Eh 005Eh
001Fh 005Fh
0020h 0060h
0021h 0061h
0022h 0062h
0023h High-Speed On-Chip Oscillator Control FRA0 78 0063h
Register 0 0064h
0024h High-Speed On-Chip Oscillator Control FRA1 78
Register 1 0065h
0025h High-Speed On-Chip Oscillator Control FRA2 79 0066h
Register 2 0067h
0026h
0068h
0027h
0069h
0028h Clock Prescaler Reset Flag CPSRF 80
006Ah
0029h High-Speed On-Chip Oscillator Control FRA4 79
Register 4 006Bh
002Ah 006Ch
002Bh High-Speed On-Chip Oscillator Control FRA6 79 006Dh
Register 6 006Eh
002Ch High-Speed On-Chip Oscillator Control FRA7 79
Register 7 006Fh
0070h
0030h 0071h
0031h Voltage Detection Register 1 VCA1 36 0072h
0032h Voltage Detection Register 2 VCA2 36, 80 0073h
0033h 0074h
0034h 0075h
0035h 0076h
0036h Voltage Monitor 1 Circuit Control Register VW1C 38 0077h
0037h Voltage Monitor 2 Circuit Control Register VW2C 39 0078h
0038h Voltage Monitor 0 Circuit Control Register VW0C 37 0079h
0039h 007Ah
003Ah 007Bh
003Bh 007Ch
003Ch 007Dh
003Dh 007Eh
003Eh 007Fh
003Fh
NOTE:
1. The blank regions are reserved. Do not access locations
in these regions.
B-1
Address Register Symbol Page Address Register Symbol Page
0080h 00C0h A/D Register AD 386
0081h 00C1h
0082h 00C2h
0083h 00C3h
0084h 00C4h
0085h 00C5h
0086h 00C6h
0087h 00C7h
0088h 00C8h
0089h 00C9h
008Ah 00CAh
008Bh 00CBh
008Ch 00CCh
www.DataSheet4U.com
008Dh 00CDh
008Eh 00CEh
008Fh 00CFh
0090h 00D0h
0091h 00D1h
0092h 00D2h
0093h 00D3h
0094h 00D4h A/D Control Register 2 ADCON2 386
0095h 00D5h
0096h 00D6h A/D Control Register 0 ADCON0 385
0097h 00D7h A/D Control Register 1 ADCON1 386
0098h 00D8h
0099h 00D9h
009Ah 00DAh
009Bh 00DBh
009Ch 00DCh
009Dh 00DDh
009Eh 00DEh
009Fh 00DFh
00A0h UART0 Transmit/Receive Mode Register U0MR 291 00E0h Port P0 Register P0 56
00A1h UART0 Bit Rate Register U0BRG 291 00E1h Port P1 Register P1 56
00A2h UART0 Transmit Buffer Register U0TB 290 00E2h Port P0 Direction Register PD0 56
00A3h 00E3h Port P1 Direction Register PD1 56
00A4h UART0 Transmit/Receive Control Register 0 U0C0 292 00E4h Port P2 Register P2 56
00A5h UART0 Transmit/Receive Control Register 1 U0C1 293 00E5h Port P3 Register P3 56
00A6h UART0 Receive Buffer Register U0RB 290 00E6h Port P2 Direction Register PD2 56
00A7h 00E7h Port P3 Direction Register PD3 56
00A8h UART1 Transmit/Receive Mode Register U1MR 291 00E8h Port P4 Register P4 56
00A9h UART1 Bit Rate Register U1BRG 291 00E9h
00AAh UART1 Transmit Buffer Register U1TB 290 00EAh Port P4 Direction Register PD4 56
00ABh 00EBh
00ACh UART1 Transmit/Receive Control Register 0 U1C0 292 00ECh Port P6 Register P6 56
00ADh UART1 Transmit/Receive Control Register 1 U1C1 293 00EDh
00AEh UART1 Receive Buffer Register U1RB 290 00EEh Port P6 Direction Register PD6 56
00AFh 00EFh
00B0h 00F0h
00B1h 00F1h
00B2h 00F2h
00B3h 00F3h
00B4h 00F4h Port P2 Drive Capacity Control Register P2DRR 58
00B5h 00F5h UART1 Function Select Register U1SR 293
00B6h 00F6h
00B7h 00F7h
00B8h SS Control Register H / IIC bus Control Register 1 SSCRH/ICCR1 308, 338 00F8h Port Mode Register PMR 58, 293,
00B9h SS Control Register L / IIC bus Control Register 2 SSCRL/ICCR2 314, 344
309, 339
00F9h External Input Enable Register INTEN 115
00BAh SS Mode Register / IIC bus Mode Register SSMR/ICMR 310, 340
00BBh SS Enable Register / IIC bus Interrupt Enable Register SSER/ICIER 00FAh INT Input Filter Select Register INTF 116
311, 341
00BCh SS Status Register / IIC bus Status Register SSSR/ICSR 00FBh Key Input Enable Register KIEN 119
312, 342
00BDh SS Mode Register 2 / Slave Address Register SSMR2/SAR 00FCh Pull-Up Control Register 0 PUR0 57
313, 343
00BEh SS Transmit Data Register/IIC bus Transmit SSTDR/ICDRT 00FDh Pull-Up Control Register 1 PUR1 57
314, 343
Data Register 00FEh
00BFh SS Receive Data Register/IIC bus Receive SSRDR/ICDRR 314, 344 00FFh
Data Register
NOTE:
1. The blank regions are reserved. Do not access locations
in these regions.
B-2
Address Register Symbol Page Address Register Symbol Page
0100h Timer RA Control Register TRACR 135 0130h
0101h Timer RA I/O Control Register TRAIOC 135, 137, 140, 0131h
142, 144, 147 0132h
0102h Timer RA Mode Register TRAMR 136 0133h
0103h Timer RA Prescaler Register TRAPRE 136 0134h
0104h Timer RA Register TRA 136 0135h
0105h 0136h
0106h LIN Control Register LINCR 370 0137h Timer RD Start Register TRDSTR 184, 198, 215,
0107h LIN Status Register LINST 371 228, 238, 252
0108h Timer RB Control Register TRBCR 151 0138h Timer RD Mode Register TRDMR 184, 198, 215,
0109h Timer RB One-Shot Control Register TRBOCR 228, 239, 252
151
0139h Timer RD PWM Mode Register TRDPMR 185, 199, 216
010Ah Timer RB I/O Control Register TRBIOC 152, 154, 158,
160, 165 013Ah Timer RD Function Control Register TRDFCR 186, 200, 217,
010Bh Timer RB Mode Register TRBMR 229, 240, 253
www.DataSheet4U.com 152
013Bh Timer RD Output Master Enable Register TRDOER1 201, 218, 230,
010Ch Timer RB Prescaler Register TRBPRE 153 1 241, 254
010Dh Timer RB Secondary Register TRBSC 153 013Ch Timer RD Output Master Enable Register TRDOER2 201, 218, 230,
010Eh Timer RB Primary Register TRBPR 153 2 241, 254
010Fh 013Dh Timer RD Output Control Register TRDOCR 202, 219, 255
0110h 013Eh Timer RD Digital Filter Function Select TRDDF0 187
0111h Register 0
013Fh Timer RD Digital Filter Function Select TRDDF1 187
0112h Register 1
0113h 0140h Timer RD Control Register 0 TRDCR0 188, 203, 219,
0114h 231, 242, 256
0115h 0141h Timer RD I/O Control Register A0 TRDIORA0 189, 204
0116h 0142h Timer RD I/O Control Register C0 TRDIORC0 190, 205
0117h 0143h Timer RD Status Register 0 TRDSR0 191, 206, 220,
232, 243, 257
0118h Timer RE Second Data Register / Counter TRESEC 273, 281
Data Register 0144h Timer RD Interrupt Enable Register 0 TRDIER0 192, 207, 221,
0119h Timer RE Minute Data Register / Compare TREMIN 233, 244, 258
273, 281
Data Register 0145h Timer RD PWM Mode Output Level TRDPOCR0 222
011Ah Timer RE Hour Data Register TREHR 274 Control Register 0
0146h Timer RD Counter 0 TRD0 192, 207, 222,
011Bh Timer RE Day of Week Data Register TREWK 274
0147h 233, 245, 258
011Ch Timer RE Control Register 1 TRECR1 275, 282 0148h Timer RD General Register A0 TRDGRA0 193, 208, 223,
011Dh Timer RE Control Register 2 TRECR2 276, 282 0149h 234, 245, 259
011Eh Timer RE Count Source Select Register TRECSR 277, 283 014Ah Timer RD General Register B0 TRDGRB0 193, 208, 223,
011Fh 014Bh 234, 245, 259
0120h 014Ch Timer RD General Register C0 TRDGRC0 193, 208,
014Dh 223, 234, 259
0121h
014Eh Timer RD General Register D0 TRDGRD0 193, 208, 223,
0122h 014Fh 234, 245, 259
0123h 0150h Timer RD Control Register 1 TRDCR1 188, 203,
0124h 219, 242
0125h 0151h Timer RD I/O Control Register A1 TRDIORA1 189, 204
0126h 0152h Timer RD I/O Control Register C1 TRDIORC1 190, 205
0127h 0153h Timer RD Status Register 1 TRDSR1 191, 206, 220,
232, 243, 257
0128h
0154h Timer RD Interrupt Enable Register 1 TRDIER1 192, 207, 221,
0129h
233, 244, 258
012Ah 0155h Timer RD PWM Mode Output Level TRDPOCR1 222
012Bh Control Register 1
012Ch 0156h Timer RD Counter 1 TRD1 192, 207, 222,
0157h 245
012Dh
0158h Timer RD General Register A1 TRDGRA1 193, 208, 223,
012Eh 0159h 234, 245, 259
012Fh 015Ah Timer RD General Register B1 TRDGRB1 193, 208, 223,
015Bh 234, 245, 259
NOTE: 015Ch Timer RD General Register C1 TRDGRC1 193, 208, 223,
1. The blank regions are reserved. Do not access locations 015Dh 234, 245, 259
in these regions. 015Eh Timer RD General Register D1 TRDGRD1 193, 208, 223,
015Fh 234, 245, 259
B-3
Address Register Symbol Page Address Register Symbol Page
0160h 01A0h
0161h 01A1h
0162h 01A2h
0163h 01A3h
0164h 01A4h
0165h 01A5h
0166h 01A6h
0167h 01A7h
0168h 01A8h
0169h 01A9h
016Ah 01AAh
016Bh 01ABh
016Ch 01ACh
www.DataSheet4U.com
016Dh 01ADh
016Eh 01AEh
016Fh 01AFh
0170h 01B0h
0171h 01B1h
0172h 01B2h
0173h 01B3h Flash Memory Control Register 4 FMR4 408
0174h 01B4h
0175h 01B5h Flash Memory Control Register 1 FMR1 407
0176h 01B6h
0177h 01B7h Flash Memory Control Register 0 FMR0 406
0178h 01B8h
0179h 01B9h
017Ah 01BAh
017Bh 01BBh
017Ch 01BCh
017Dh 01BDh
017Eh 01BEh
017Fh
0180h FFFFh Option Function Select Register OFS 27, 128, 401
0181h
0182h
0183h
0184h
0185h
0186h
0187h
0188h
0189h
018Ah
018Bh
018Ch
018Dh
018Eh
018Fh
0190h
0191h
0192h
0193h
0194h
0195h
0196h
0197h
0198h
0199h
019Ah
019Bh
019Ch
019Dh
019Eh
019Fh
NOTE:
1. The blank regions are reserved. Do not access locations
in these regions.
B-4
R8C/24 Group, R8C/25 Group
REJ09B0244-0300
SINGLE-CHIP 16-BIT CMOS MCU Rev.3.00
Feb 29, 2008
1. Overview
These MCUs are fabricated using a high-performance silicon gate CMOS process, embedding the R8C/Tiny Series
CPU core, and are packaged in a 52-pin molded-plastic LQFP or a 64-pin molded-plastic FLGA. It implements
sophisticated instructions for a high level of instruction efficiency. With 1 Mbyte of address space, they are capable of
executing instructions at high speed.
Furthermore, the R8C/25 Group has on-chip data flash (1 KB x 2 blocks).
The difference between the R8C/24 Group and R8C/25 Group is only the presence or absence of data flash. Their
peripheral
www.DataSheet4U.com
functions are the same.
1.1 Applications
Electronic household appliances, office equipment, audio equipment, consumer products, etc.
8 8 8 6 3 3 8
Peripheral functions
www.DataSheet4U.com
A/D converter System clock
(10 bits × 12 channels) generation circuit
Timers
XIN-XOUT
Timer RA (8 bits) High-speed on-chip oscillator
Timer RB (8 bits) UART or Low-speed on-chip oscillator
Timer RD clock synchronous serial I/O XCIN-XCOUT
(16 bits × 2 channels) (8 bits × 2 channels)
Timer RE (8 bits)
LIN module
(1 channel)
Multiplier
NOTES:
1. ROM size varies with MCU type.
2. RAM size varies with MCU type.
Table 1.3 Product Information for R8C/24 Group Current of Feb. 2008
Type No. ROM Capacity RAM Capacity Package Type Remarks
R5F21244SNFP 16 Kbytes 1 Kbyte PLQP0052JA-A N version
R5F21245SNFP 24 Kbytes 2 Kbytes PLQP0052JA-A Blank product
R5F21246SNFP 32 Kbytes 2 Kbytes PLQP0052JA-A
R5F21247SNFP 48 Kbytes 2.5 Kbytes PLQP0052JA-A
R5F21248SNFP
www.DataSheet4U.com 64 Kbytes 3 Kbytes PLQP0052JA-A
R5F21244SNLG 16 Kbytes 1 Kbyte PTLG0064JA-A
R5F21246SNLG 32 Kbytes 2 Kbytes PTLG0064JA-A
R5F21244SDFP 16 Kbytes 1 Kbyte PLQP0052JA-A D version
R5F21245SDFP 24 Kbytes 2 Kbytes PLQP0052JA-A Blank product
R5F21246SDFP 32 Kbytes 2 Kbytes PLQP0052JA-A
R5F21247SDFP 48 Kbytes 2.5 Kbytes PLQP0052JA-A
R5F21248SDFP 64 Kbytes 3 Kbytes PLQP0052JA-A
R5F21244SNXXXFP 16 Kbytes 1 Kbyte PLQP0052JA-A N version
R5F21245SNXXXFP 24 Kbytes 2 Kbytes PLQP0052JA-A Factory
R5F21246SNXXXFP 32 Kbytes 2 Kbytes PLQP0052JA-A programming
R5F21247SNXXXFP 48 Kbytes 2.5 Kbytes PLQP0052JA-A product(1)
R5F21248SNXXXFP 64 Kbytes 3 Kbytes PLQP0052JA-A
R5F21244SNXXXLG 16 Kbytes 1 Kbyte PTLG0064JA-A
R5F21246SNXXXLG 32 Kbytes 2 Kbytes PTLG0064JA-A
R5F21244SDXXXFP 16 Kbytes 1 Kbyte PLQP0052JA-A D version
R5F21245SDXXXFP 24 Kbytes 2 Kbytes PLQP0052JA-A Factory
R5F21246SDXXXFP 32 Kbytes 2 Kbytes PLQP0052JA-A programming
R5F21247SDXXXFP 48 Kbytes 2.5 Kbytes PLQP0052JA-A product(1)
R5F21248SDXXXFP 64 Kbytes 3 Kbytes PLQP0052JA-A
NOTE:
1. The user ROM is programmed before shipment.
ROM number
Classification
N: Operating ambient temperature -20°C to 85°C
D: Operating ambient temperature -40°C to 85°C
Y: Operating ambient temperature -20°C to 105°C(1)
www.DataSheet4U.com
S: Low-voltage version
ROM capacity
4: 16 KB
5: 24 KB
6: 32 KB
7: 48 KB
8: 64 KB
R8C/24 Group
R8C/Tiny Series
Memory type
F: Flash memory
Renesas MCU
Renesas semiconductor
NOTE:
1. Please contact Renesas Technology sales offices for the Y version.
Figure 1.2 Type Number, Memory Size, and Package of R8C/24 Group
Table 1.4 Product Information for R8C/25 Group Current of Feb. 2008
ROM Capacity RAM
Type No. Package Type Remarks
Program ROM Data flash Capacity
R5F21254SNFP 16 Kbytes 1 Kbyte × 2 1 Kbyte PLQP0052JA-A N version
R5F21255SNFP 24 Kbytes 1 Kbyte × 2 2 Kbytes PLQP0052JA-A Blank product
R5F21256SNFP 32 Kbytes 1 Kbyte × 2 2 Kbytes PLQP0052JA-A
R5F21257SNFP 48 Kbytes 1 Kbyte × 2 2.5 Kbytes PLQP0052JA-A
R5F21258SNFP 64 Kbytes 1 Kbyte × 2 3 Kbytes PLQP0052JA-A
R5F21254SNLG 16 Kbytes 1 Kbyte × 2 1 Kbyte PTLG0064JA-A
R5F21256SNLG
www.DataSheet4U.com 32 Kbytes 1 Kbyte × 2 2 Kbytes PTLG0064JA-A
R5F21254SDFP 16 Kbytes 1 Kbyte × 2 1 Kbyte PLQP0052JA-A D version
R5F21255SDFP 24 Kbytes 1 Kbyte × 2 2 Kbytes PLQP0052JA-A Blank product
R5F21256SDFP 32 Kbytes 1 Kbyte × 2 2 Kbytes PLQP0052JA-A
R5F21257SDFP 48 Kbytes 1 Kbyte × 2 2.5 Kbytes PLQP0052JA-A
R5F21258SDFP 64 Kbytes 1 Kbyte × 2 3 Kbytes PLQP0052JA-A
R5F21254SNXXXFP 16 Kbytes 1 Kbyte × 2 1 Kbyte PLQP0052JA-A N version
R5F21255SNXXXFP 24 Kbytes 1 Kbyte × 2 2 Kbytes PLQP0052JA-A Factory
R5F21256SNXXXFP 32 Kbytes 1 Kbyte × 2 2 Kbytes PLQP0052JA-A programming
R5F21257SNXXXFP 48 Kbytes 1 Kbyte × 2 2.5 Kbytes PLQP0052JA-A product(1)
R5F21258SNXXXFP 64 Kbytes 1 Kbyte × 2 3 Kbytes PLQP0052JA-A
R5F21254SNXXXLG 16 Kbytes 1 Kbyte × 2 1 Kbyte PTLG0064JA-A
R5F21256SNXXXLG 32 Kbytes 1 Kbyte × 2 2 Kbytes PTLG0064JA-A
R5F21254SDXXXFP 16 Kbytes 1 Kbyte × 2 1 Kbyte PLQP0052JA-A D version
R5F21255SDXXXFP 24 Kbytes 1 Kbyte × 2 2 Kbytes PLQP0052JA-A Factory
R5F21256SDXXXFP 32 Kbytes 1 Kbyte × 2 2 Kbytes PLQP0052JA-A programming
R5F21257SDXXXFP 48 Kbytes 1 Kbyte × 2 2.5 Kbytes PLQP0052JA-A product(1)
R5F21258SDXXXFP 64 Kbytes 1 Kbyte × 2 3 Kbytes PLQP0052JA-A
NOTE:
1. The user ROM is programmed before shipment.
ROM number
Classification
N: Operating ambient temperature -20°C to 85°C
D: Operating ambient temperature -40°C to 85°C
Y: Operating ambient temperature -20°C to 105°C(1)
www.DataSheet4U.com
S: Low-voltage version
ROM capacity
4: 16 KB
5: 24 KB
6: 32 KB
7: 48 KB
8: 64 KB
R8C/25 Group
R8C/Tiny Series
Memory type
F: Flash memory
Renesas MCU
Renesas semiconductor
NOTE:
1. Please contact Renesas Technology sales offices for the Y version.
Figure 1.3 Type Number, Memory Size, and Package of R8C/25 Group
P6_7/INT3/RXD1
P6_6/INT2/TXD1
Pin assignments (top view)
P1_2/KI2/AN10
P1_0/KI0/AN8
P1_1/KI1/AN9
P3_0/TRAO
P3_1/TRBO
P6_5/CLK1
P4_5/INT0
P0_7/AN0
P6_3
P6_4
NC
www.DataSheet4U.com
39
38
37
36
35
34
33
32
31
30
29
28
27
NC 40 26 NC
P0_6/AN1 41 25 P1_3/KI3/AN11
P0_5/AN2 42 24 P1_4/TXD0
P0_4/AN3 43 23 P1_5/RXD0/(TRAIO)/(INT1)(2)
P4_2/VREF 44 22 P1_6/CLK0
P6_0/TREO 45 21 P1_7/TRAIO/INT1
R8C/24 Group
P6_2 46 20 P2_0/TRDIOA0/TRDCLK
R8C/25 Group
P6_1 47 19 P2_1/TRDIOB0
P0_3/AN4 48 18 P2_2/TRDIOC0
P0_2/AN5 49 17 P2_3/TRDIOD0
P0_1/AN6 50 16 P2_4/TRDIOA1
P0_0/AN7 51 15 P2_5/TRDIOB1
P3_7/SSO 52 14 P2_6/TRDIOC1
10
11
12
13
1
2
3
4
5
6
7
8
9
P3_3/SSI
P2_7/TRDIOD1
XOUT/P4_7
P3_5/SCL/SSCK
P3_4/SDA/SCS
MODE
VSS/AVSS
P4_4/XCOUT
RESET
NC
P4_3/XCIN
P4_6/XIN
VCC/AVCC
(1)
Package: PLQP0052JA-A(52P6A-A)
0.65 mm pin pitch, 10 mm square body
NOTES:
1. P4_7 is an input-only port.
2. Can be assigned to the pin in parentheses by a program.
NC: Non-Connection
A B C D E F G H
8
3 50 48 46 45 NC 36 NC
8
P3_3/SSI P0_1/AN6 P0_3/AN4 P6_2 P6_0/TREO P6_4
www.DataSheet4U.com
7
4 51 49 NC 44 34 35 NC
7
P3_4/SDA/ P0_0/AN7 P0_2/AN5 P4_2/VREF P3_0/TRAO P6_5/CLK1
SCS
6
NC 5 52 47 43 42 NC 33 6
MODE P3_7/SSO P6_1 P0_4/AN3 P0_5/AN2 P3_1/TRBO
5
7 NC 6 2 37 NC 41 38 5
P4_4/XCOUT P4_3/XCIN P3_5/SCL/ P6_3 P0_6/AN1 P0_7/AN0
SSCK
4
13 12 NC 9 8 32 31 NC
4
P2_7/ VCC/AVCC XOUT/ RESET P1_0/KI0/ P1_1/KI1/
TRDIOD1 P4_7(1) AN8 AN9
3
NC 10 16 19 23 NC NC 30 3
VSS/AVSS P2_4/ P2_1/ P1_5/RXD0/ P1_2/KI2/
TRDIOA1 TRDIOB0 (TRAIO)/(INT1)(2) AN10
2
NC 11 17 20 NC 24 28 NC
2
XIN/P4_6 P2_3/ P2_0/TRDIOA0/ P1_4/TXD0 P6_6/INT2/
TRDIOD0 TRDCLK TXD1
1
14 15 18 21 22 25 27 29 1
P2_6/ P2_5/ P2_2/ P1_7/TRAIO/ P1_6/CLK0 P1_3/KI3/ P4_5/INT0 P6_7/INT3/
TRDIOC1 TRDIOB1 TRDIOC0 INT1 AN11 RXD1
A B C D E F G H
Package: PTLG0064JA-A(64F0G)
0.65 mm pin pitch, 6 mm square body
NOTES: R5F21244S
1. P4_7 is an input-only port. NLG
2. Can be assigned to the pin in parentheses by a program. JAPAN
3. In the figure, the numbers in circles are the pin numbers
of the 52-pin LQFP package (PLQP0052JA-A).
NC: Non-Connection
Pin assignments (top view)
XCIN clock input XCIN I These pins are provided for XCIN clock generation circuit I/O.
Connect a crystal oscillator between the XCIN and XCOUT
XCIN clock output XCOUT O pins. To use an external clock, input it to the XCIN pin and
leave the XCOUT pin open.
INT interrupt input INT0 to INT3 I INT interrupt input pins.
INT0 is timer RD input pin. INT1 is timer RA input pin.
Key input interrupt KI0 to KI3 I Key input interrupt input pins
Timer RA TRAIO I/O Timer RA I/O pin
TRAO O Timer RA output pin
Timer RB TRBO O Timer RB output pin
Timer RD TRDIOA0, TRDIOA1, I/O Timer RD I/O ports
TRDIOB0, TRDIOB1,
TRDIOC0, TRDIOC1,
TRDIOD0, TRDIOD1
TRDCLK I External clock input pin
Timer RE TREO O Divided clock output pin
Serial interface CLK0, CLK1 I/O Transfer clock I/O pin
RXD0, RXD1 I Serial data input pins
TXD0, TXD1 O Serial data output pins
I2C bus interface SCL I/O Clock I/O pin
SDA I/O Data I/O pin
Clock synchronous SSI I/O Data I/O pin
serial I/O with chip SCS I/O Chip-select signal I/O pin
select
SSCK I/O Clock I/O pin
SSO I/O Data I/O pin
Reference voltage VREF I Reference voltage input pin to A/D converter
input
A/D converter AN0 to AN11 I Analog input pins to A/D converter
I/O port P0_0 to P0_7, I/O CMOS I/O ports. Each port has an I/O select direction
P1_0 to P1_7, register, allowing each pin in the port to be directed for input
P2_0 to P2_7, or output individually.
P3_0, P3_1, Any port set to input can be set to use a pull-up resistor or not
P3_3 to P3_5, P3_7, by a program.
P4_3 to P4_5, P2_0 to P2_7 also function as LED drive ports.
P6_0 to P6_7
Input port P4_2, P4_6, P4_7 I Input-only ports
I: Input O: Output I/O: Input and output
b19 b15 b0
PC Program counter
b15 b0
USP User stack pointer
b15 b0
b15 b8 b7 b0
IPL U I O B S Z D C
Carry flag
Debug flag
Zero flag
Sign flag
Register bank select flag
Overflow flag
Interrupt enable flag
Stack pointer select flag
Reserved bit
Processor interrupt priority level
Reserved bit
NOTE:
1. These registers comprise a register bank. There are two register banks.
www.DataSheet4U.com
2.3 Frame Base Register (FB)
FB is a 16-bit register for FB relative addressing.
2.6 User Stack Pointer (USP) and Interrupt Stack Pointer (ISP)
The stack pointers (SP), USP, and ISP, are each 16 bits wide. The U flag of FLG is used to switch between
USP and ISP.
2.8.9
www.DataSheet4U.com
Processor Interrupt Priority Level (IPL)
IPL is 3 bits wide and assigns processor interrupt priority levels from level 0 to level 7.
If a requested interrupt has higher priority than IPL, the interrupt is enabled.
3. Memory
00000h
SFR
(Refer to 4. Special
Function Registers
(SFRs))
002FFh
00400h
Internal RAM
0XXXh
0FFDCh
Undefined instruction
Overflow
BRK instruction
Address match
Single step
0YYYYh Watchdog timer/oscillation stop detection/voltage monitor
NOTE:
1. The blank regions are reserved. Do not access locations in these regions.
00000h
SFR
(Refer to 4. Special
Function Registers
(SFRs))
002FFh
00400h
Internal RAM
0XXXXh
02400h
Internal ROM 0FFDCh
Undefined instruction
(data flash)(1) Overflow
02BFFh BRK instruction
Address match
Single step
0YYYYh Watchdog timer/oscillation stop detection/voltage monitor
NOTES:
1. Data flash block A (1 Kbyte) and B (1 Kbyte) are shown.
2. The blank regions are reserved. Do not access locations in these regions.
0030h
0031h Voltage Detection Register 1(2) VCA1 00001000b
0032h Voltage Detection Register 2(2) VCA2 00h(3)
00100000b(4)
0033h
0034h
0035h
0036h Voltage Monitor 1 Circuit Control Register(5) VW1C 00001000b
0037h Voltage Monitor 2 Circuit Control Register(5) VW2C 00h
0038h Voltage Monitor 0 Circuit Control Register(2) VW0C 0000X000b(3)
0100X001b(4)
0039h
003Ah
003Eh
003Fh
X: Undefined
NOTES:
1. The blank regions are reserved. Do not access locations in these regions.
2. Software reset, watchdog timer reset, and voltage monitor 1 reset or voltage monitor 2 reset do not affect this register.
3. The LVD0ON bit in the OFS register is set to 1 and hardware reset.
4. Power-on reset, voltage monitor 0 reset or the LVD0ON bit in the OFS register is set to 0, and hardware reset.
5. Software reset, watchdog timer reset, and voltage monitor 1 reset or voltage monitor 2 reset do not affect b2 and b3.
6. The CSPROINI bit in the OFS register is set to 0.
X: Undefined
NOTES:
1. The blank regions are reserved. Do not access locations in these regions.
2. Selected by the IICSEL bit in the PMR register.
5. Resets
The following resets are implemented: hardware reset, power-on reset, voltage monitor 0 reset, voltage monitor 1
reset, voltage monitor 2 reset, watchdog timer reset, and software reset.
Table 5.1 lists the Reset Names and Sources.
Hardware reset
RESET SFRs
Bits VCA25,
VW0C0, and
VW0C6
SFRs
Bits VCA25,
VW0C0, and
Power-on reset Power-on reset VW0C6
VCC
circuit
Watchdog timer
Watchdog reset
timer
Pin, CPU, and
SFR bits other than
those listed above
CPU
Software reset
Table 5.2 shows the Pin Functions while RESET Pin Level is “L”, Figure 5.2 shows the CPU Register Status after
Reset, Figure 5.3 shows the Reset Sequence, and Figure 5.4 shows the OFS Register.
www.DataSheet4U.com
b15 b0
b19 b0
b15 b0
b15 b0
b15 b8 b7 b0
IPL U I O B S Z D C
fOCO-S
RESET pin
10 cycles or more are needed(1)
Internal reset
signal
Start time of flash memory
CPU clock × 28 cycles
(CPU clock × 14 cycles)
CPU clock
www.DataSheet4U.com
0FFFCh 0FFFEh
Address
(internal address
signal)
0FFFDh Content of reset vector
NOTES:
1. Hardware reset.
2. When the “L” input width to the RESET pin is set to fOCO-S clock × 32 cycles or more, setting the RESET pin to “H” also sets the internal
reset signal to “H” at the same.
5.1.2 Power On
(1) Apply “L” to the RESET pin.
(2) Let the supply voltage increase until it meets the recommended operating conditions.
(3) Wait for td(P-R) or more to allow the internal power supply to stabilize (refer to 20. Electrical
Characteristics).
(4) Wait for 10 µs or more.
(5) Apply “H” to the RESET pin.
VCC 2.2 V
VCC
0V
RESET
RESET
0.2 VCC or below
0V
www.DataSheet4U.com
td(P-R) + 10 µs or more
NOTE:
1. Refer to 20. Electrical Characteristics.
5V
Supply voltage
detection circuit
VCC 2.2 V
RESET VCC
0V
5V
RESET
0V
td(P-R) + 10 µs or more
Example when
VCC = 5 V
NOTE:
1. Refer to 20. Electrical Characteristics.
Figure 5.6 Example of Hardware Reset Circuit (Usage Example of External Supply Voltage
Detection Circuit) and Operation
VCC
4.7 kΩ
(reference)
RESET
Vdet0(3) Vdet0(3)
2.2V trth
External trth
Power VCC
Vpor2
Vpor1
tw(por1) Sampling time(1, 2)
Internal
reset signal
(“L” valid)
1 1
× 32 × 32
fOCO-S fOCO-S
NOTES:
1. When using the voltage monitor 0 digital filter, ensure that the voltage is within the MCU operation voltage
range (2.2 V or above) during the sampling time.
2. The sampling clock can be selected. Refer to 6. Voltage Detection Circuit for details.
3. Vdet0 indicates the voltage detection level of the voltage detection 0 circuit. Refer to 6. Voltage Detection
Circuit for details.
4. Refer to 20. Electrical Characteristics.
5. To use the power-on reset function, enable voltage monitor 0 reset by setting the LVD0ON bit in the OFS
register to 0, the VW0C0 and VW0C6 bits in the VW0C register to 1 respectively, and the VCA25 bit in the
VCA2 register to 1.
VCC VCA27
b3
Voltage detection 1
+ Noise
signal
filter
-
≥ Vdet1
VW1C register
b3
Voltage detection 0
+ signal
-
≥ Vdet0
VW0F1 to VW0F0
= 00b
= 01b
Voltage detection 0 circuit = 10b
= 11b
fOCO-S 1/2 1/2 1/2
VCA25
VW0C1
VCC +
Digital
Internal Voltage filter
- detection 0
reference
voltage signal
Voltage detection 0
signal is held “H” when Voltage monitor 0
VCA25 bit is set to 0 VW0C1 reset signal
(disabled)
VW0C0
VW0C7 VW0C6
VW1F1 to VW1F0
= 00b
= 01b
Voltage detection 1 circuit = 10b VW1C2 bit is set to 0 (not detected) by
writing 0 by a program.
= 11b When VCA26 bit is set to 0 (voltage
fOCO-S 1/2 1/2 1/2
detection 1 circuit disabled), VW1C2
VCA26 bit is set to 0
VW1C1
VW1C3 Watchdog
timer interrupt
VCC + signal
Digital
Noise filter
Voltage filter
Internal - VW1C2
reference detection
www.DataSheet4U.com
voltage (Filter width: 200 ns) 1 signal
Voltage detection 1 signal
Voltage monitor 1
is held “H” when VCA26 bit
interrupt signal Non-maskable
is set to 0 (disabled)
interrupt signal
VW1C1
Oscillation stop
detection
interrupt signal
VW1C7
VW1C0
VW1C6 Voltage monitor 1
reset signal
VW2F1 to VW2F0
= 00b
= 01b
Voltage detection 2 circuit = 10b VW2C2 bit is set to 0 (not detected) by
= 11b writing 0 by a program.
fOCO-S 1/2 1/2 1/2 When VCA27 bit is set to 0 (voltage
detection 2 circuit disabled), VW2C2
VCA27
bit is set to 0
VCA13 VW2C1
Watchdog
timer interrupt
VCC + signal
Digital
Noise filter
Voltage filter
Internal - VW2C2
reference detection
(Filter width: 200 ns) 2 signal
voltage
Voltage detection 2 signal
is held “H” when VCA27 bit Voltage monitor 2
is set to 0 (disabled) interrupt signal Non-maskable
interrupt signal
VW2C1
Oscillation stop
detection
Watchdog timer block interrupt signal
VW2C3
VW2C7
Watchdog timer
underflow signal This bit is set to 0 (not detected) by writing 0 VW2C0
by a program. VW2C6 Voltage monitor 2
reset signal
Voltage monitor 0 reset When the VW0C1 bit is set to 1 (digital filter
VW0C7 generation condition select disabled mode), set to 1. RW
bit(4)
NOTES:
1. Set the PRC3 bit in the PRCR register to 1 (w rite enable) before w riting to the VW0C register.
2. The value remains unchanged after a softw are reset, w atchdog timer reset, voltage monitor 1 reset, and voltage
monitor 2 reset.
3. The VW0C0 bit is enabled w hen the VCA25 bit in the VCA2 register is set to 1 (voltage detection 0 circuit
enabled). Set the VW0C0 bit to 0 (disable), w hen the VCA25 bit is set to 0 (voltage detection 0 circuit disabled).
4. The VW0C7 bit is enabled w hen the VW0C1 bit set to 1 (digital filter disabled mode).
NOTES:
1. Set the PRC3 bit in the PRCR register to 1 (rew rite enable) before w riting to the VW1C register.
2. To use the voltage monitor 1 interrupt to exit stop mode and to return again, w rite 0 to the VW1C1 bit before w riting
1.
3. Bits VW1C2 and VW1C3 are enabled w hen the VCA26 bit in the VCA2 register is set to 1 (voltage detection 1 circuit
enabled).
4. Set this bit to 0 by a program. When 0 is w ritten by a program, it is set to 0 (and remains unchanged even if 1 is
w ritten to it).
5. The VW1C6 bit is enabled w hen the VW1C0 bit is set to 1 (voltage monitor 1 interrupt/enabled reset).
6. The VW1C0 bit is enabled w hen the VCA26 bit in the VCA2 register is set to 1 (voltage detection 1 circuit enabled).
Set the VW1C0 bit to 0 (disable) w hen the VCA26 bit is set to 0 (voltage detection 1 circuit disabled).
7. The VW1C7 bit is enabled w hen the VW1C1 bit is set to 1 (digital filter disabled mode).
8. Bits VW1C2 and VW1C3 remain unchanged after a softw are reset, w atchdog timer reset, voltage monitor 1 reset,
or voltage monitor 2 reset.
9. When the VW1C6 bit is set to 1 (voltage monitor 1 reset mode), set the VW1C7 bit to 1 (w hen VCC reaches Vdet1 or
below ). (Do not set to 0.)
NOTES:
1. Set the PRC3 bit in the PRCR register to 1 (w rite enable) before w riting to the VW2C register.
2. To use the voltage monitor 2 interrupt to exit stop mode and to return again, w rite 0 to the VW2C1
bit before w riting 1.
3. The VW2C2 bit is enabled w hen the VCA27 bit in the VCA2 register is set to 1 (voltage detection 2 circuit
enabled).
4. Set this bit to 0 by a program. When 0 is w ritten by a program, it is set to 0 (and remains unchanged even if 1 is
w ritten to it).
5. The VW2C6 bit is enabled w hen the VW2C0 bit is set to 1 (voltage monitor 2 interrupt/enables reset).
6. The VW2C0 bit is enabled w hen the VCA27 bit in the VCA2 register is set to 1 (voltage detection 2 circuit
enabled). Set the VW2C0 bit to 0 (disable) w hen the VCA27 bit is set to 0 (voltage detection 2 circuit disabled).
7. The VW2C7 bit is enabled w hen the VW2C1 bit is set to 1 (digital filter disabled mode).
8. Bits VW2C2 and VW2C3 remain unchanged after a softw are reset, w atchdog timer reset, voltage monitor 1 reset,
or voltage monitor 2 reset.
9. When the VW2C6 bit is set to 1 (voltage monitor 2 reset mode), set the VW2C7 bit to 1 (w hen VCC reaches Vdet2
or below ). (Do not set to 0.)
Table 6.2 Procedure for Setting Bits Associated with Voltage Monitor Reset
Step When Using Digital Filter When Not Using Digital Filter
1 Set the VCA25 bit in the VCA2 register to 1 (voltage detection 0 circuit enabled)
2 Wait for td(E-A)
Select the sampling clock of the digital filter Set the VW0C7 bit in the VW0C register to
www.DataSheet4U.com 3 by the VW0F0 to VW0F1 bits in the VW0C 1
register
Set the VW0C1 bit in the VW0C register to Set the VW0C1 bit in the VW0C register to
4(1)
0 (digital filter enabled) 1 (digital filter disabled)
5(1) Set the VW0C6 bit in the VW0C register to 1 (voltage monitor 0 reset mode)
6 Set the VW0C2 bit in the VW0C register to 0
7 Set the CM14 bit in the CM1 register to 0 −
(low-speed on-chip oscillator on)
8 Wait for 4 cycles of the sampling clock of − (No wait time required)
the digital filter
9 Set the VW0C0 bit in the VW0C register to 1 (voltage monitor 0 reset enabled)
NOTE:
1. When the VW0C0 bit is set to 0, steps 3, 4, and 5 can be executed simultaneously (with 1
instruction).
VCC
Vdet0
1
× 32
Sampling clock of fOCO-S
digital filter × 4 cycles
1
× 32
fOCO-S
Table 6.3 Procedure for Setting Bits Associated with Voltage Monitor 1 Interrupt and Reset
When Using Digital Filter When Not Using Digital Filter
Step Voltage Monitor 1 Voltage Monitor 1 Voltage Monitor 1 Voltage Monitor 1
Interrupt Reset Interrupt Reset
1 Set the VCA26 bit in the VCA2 register to 1 (voltage detection 1 circuit enabled)
www.DataSheet4U.com
2 Wait for td(E-A)
Select the sampling clock of the digital filter Select the timing of the interrupt and reset
3 by the VW1F0 to VW1F1 bits in the VW1C request by the VW1C7 bit in the VW1C
register register(1)
Set the VW1C1 bit in the VW1C register to 0 Set the VW1C1 bit in the VW1C register to 1
4(2)
(digital filter enabled) (digital filter disabled)
5(2) Set the VW1C6 bit in Set the VW1C6 bit in Set the VW1C6 bit in Set the VW1C6 bit in
the VW1C register to the VW1C register to the VW1C register to the VW1C register to
0 (voltage monitor 1 1 (voltage monitor 1 0 (voltage monitor 1 1 (voltage monitor 1
interrupt mode) reset mode) interrupt mode) reset mode)
6 Set the VW1C2 bit in the VW1C register to 0 (passing of Vdet1 is not detected)
7 Set the CM14 bit in the CM1 register to 0 −
(low-speed on-chip oscillator on)
8 Wait for 4 cycles of the sampling clock of the − (No wait time required)
digital filter
9 Set the VW1C0 bit in the VW1C register to 1 (voltage monitor 1 interrupt/reset enabled)
NOTES:
1. Set the VW1C7 bit to 1 (when VCC reaches Vdet1 or below) for the voltage monitor 1 reset.
2. When the VW1C0 bit is set to 0, steps 3, 4, and 5 can be executed simultaneously (with 1
instruction).
VCC
Vdet1
2.2 V(1)
1
VW1C3 bit
0
4 cycles of sampling clock of digital filter 4 cycles of sampling clock of digital filter
www.DataSheet4U.com 1
VW1C2 bit
0
Set to 0 by a program
When the VW1C1 bit is set Set to 0 by interrupt request
to 0 (digital filter enabled) acknowledgement
Voltage monitor 1
interrupt request
(VW1C6 = 0)
Set to 0 by a program
1
When the VW1C1 bit is VW1C2 bit
set to 1 (digital filter 0
disabled) and the Set to 0 by interrupt
VW1C7 bit is set to 0 Voltage monitor 1 request
(Vdet1 or above) interrupt request acknowledgement
(VW1C6 = 0)
Set to 0 by a program
1
VW1C2 bit
0
When the VW1C1 bit is Set to 0 by interrupt
set to 1 (digital filter Voltage monitor 1 request acknowledgement
disabled) and the interrupt request
VW1C7 bit is set to 1 (VW1C6 = 0)
(Vdet1 or below)
NOTE:
1. If voltage monitor 0 reset is not used, set the power supply to VCC ≥ 2.2.
Figure 6.10 Example of Voltage Monitor 1 Interrupt and Voltage Monitor 1 Reset Operation
Table 6.4 Procedure for Setting Bits Associated with Voltage Monitor 2 Interrupt and Reset
When Using Digital Filter When Not Using Digital Filter
Step Voltage Monitor 2 Voltage Monitor 2 Voltage Monitor 2 Voltage Monitor 2
Interrupt Reset Interrupt Reset
1 Set the VCA27 bit in the VCA2 register to 1 (voltage detection 2 circuit enabled)
www.DataSheet4U.com
2 Wait for td(E-A)
Select the sampling clock of the digital filter Select the timing of the interrupt and reset
3 by the VW2F0 to VW2F1 bits in the VW2C request by the VW2C7 bit in the VW2C
register register(1)
Set the VW2C1 bit in the VW2C register to 0 Set the VW2C1 bit in the VW2C register to 1
4
(digital filter enabled) (digital filter disabled)
5(2) Set the VW2C6 bit in Set the VW2C6 bit in Set the VW2C6 bit in Set the VW2C6 bit in
the VW2C register to the VW2C register to the VW2C register to the VW2C register to
0 (voltage monitor 2 1 (voltage monitor 2 0 (voltage monitor 2 1 (voltage monitor 2
interrupt mode) reset mode) interrupt mode) reset mode)
6 Set the VW2C2 bit in the VW2C register to 0 (passing of Vdet2 is not detected)
7 Set the CM14 bit in the CM1 register to 0 −
(low-speed on-chip oscillator on)
8 Wait for 4 cycles of the sampling clock of the − (No wait time required)
digital filter
9 Set the VW2C0 bit in the VW2C register to 1 (voltage monitor 2 interrupt/reset enabled)
NOTES:
1. Set the VW2C7 bit to 1 (when VCC reaches Vdet2 or below) for the voltage monitor 2 reset.
2. When the VW2C0 bit is set to 0, steps 3, 4, and 5 can be executed simultaneously (with 1
instruction).
VCC
Vdet2
2.2 V(1)
1
VCA13 bit
0
4 cycles of sampling clock of digital filter 4 cycles of sampling clock of digital filter
www.DataSheet4U.com 1
VW2C2 bit
0
Set to 0 by a program
When the VW2C1 bit is set Set to 0 by interrupt request
to 0 (digital filter enabled) acknowledgement
Voltage monitor 2
interrupt request
(VW2C6 = 0)
Set to 0 by a program
1
When the VW2C1 bit is VW2C2 bit
set to 1 (digital filter 0
disabled) and the Set to 0 by interrupt
VW2C7 bit is set to 0 Voltage monitor 2 request
(Vdet2 or above) interrupt request acknowledgement
(VW2C6 = 0)
Set to 0 by a program
1
VW2C2 bit
0
When the VW2C1 bit is Set to 0 by interrupt
set to 1 (digital filter Voltage monitor 2 request acknowledgement
disabled) and the interrupt request
VW2C7 bit is set to 1 (VW2C6 = 0)
(Vdet2 or below)
NOTE:
1. When voltage monitor 0 reset is not used, set the power supply to VCC ≥ 2.2.
Figure 6.11 Example of Voltage Monitor 2 Interrupt and Voltage Monitor 2 Reset Operation
Table 7.3 Setting of PDi_j Bit when Functioning as I/O Ports for Peripheral Functions (i = 0 to 4, 6 j = 0 to 7)
I/O of Peripheral Functions PDi_j Bit Settings for Shared Pin Functions
Input Set this bit to 0 (input mode).
Output This bit can be set to either 0 or 1 (output regardless of the port setting)
www.DataSheet4U.com
7.3 Pins Other than Programmable I/O Ports
Figure 7.8 shows the Configuration of I/O Pins.
P0 Pull-up selection
Direction
register
(Note 1)
(Note 1)
www.DataSheet4U.com
Analog input
Direction
register
1
(Note 1)
Output from individual peripheral function
Data bus Port latch
(Note 1)
Analog input
Direction
register
1
(Note 1)
Output from individual peripheral function
Data bus Port latch
(Note 1)
NOTE:
1. symbolizes a parasitic diode.
Ensure the input voltage to each port does not exceed VCC.
Direction
register
“1”
(Note 1)
Output from individual peripheral function
Data bus Port latch
(Note 1)
www.DataSheet4U.com
Digital
INT1 input
filter
Direction
register
“1”
(Note 1)
Output from individual peripheral function
Data bus Port latch
(Note 1)
Pull-up selection
Direction
register
“1”
(Note 1)
Output from individual peripheral function
Data bus Port latch
(Note 1)
NOTE:
1. symbolizes a parasitic diode.
Ensure the input voltage to each port does not exceed VCC.
Direction
register
1
(Note 1)
Output from individual peripheral function
Data bus Port latch
(Note 1)
www.DataSheet4U.com
Direction
register
1
(Note 1)
Output from individual peripheral function
Data bus Port latch
(Note 1)
NOTE:
1. symbolizes a parasitic diode.
Ensure the input voltage to each port does not exceed VCC.
P4_2/VREF (Note 1)
Data bus
(Note 1)
www.DataSheet4U.com
Direction
register
(Note 1)
(Note 1)
Clocked inverter(2)
(Note 3)
Direction
register
(Note 1)
(Note 1)
NOTES:
1. symbolizes a parasitic diode.
Ensure the input voltage to each port does not exceed VCC.
2. When CM10 = 1 or CM04 = 0, the clocked inverter is cut off.
3. When CM04 = 0 the feedback resistor is disconnected.
Direction
register
(Note 1)
(Note 1)
www.DataSheet4U.com
Digital
INT0 and Input to individual peripheral function
filter
P4_6/XIN (Note 1)
Data bus
(Note 1)
Clocked inverter(2)
(Note 3)
P4_7/XOUT (Note 1)
(Note 4)
Data bus
(Note 1)
NOTES:
1. symbolizes a parasitic diode.
Ensure the input voltage to each port does not exceed VCC.
2. When CM05 = 1, CM10 = 1, or CM13 = 0, the clocked inverter is cut off.
3. When CM10 = 1 or CM13 = 0, the feedback resistor is disconnected.
4. When CM05 = CM13 = 1 or CM10 = CM13 = 1, this pin is pulled up.
Direction
register
1
(Note 1)
Output from individual peripheral function
Data bus Port latch
(Note 1)
www.DataSheet4U.com
Direction
register
(Note 1)
(Note 1)
Direction
register
1
(Note 1)
Output from individual peripheral function
Data bus Port latch
(Note 1)
NOTE:
1. symbolizes a parasitic diode.
Ensure the input voltage to each port does not exceed VCC.
Direction
register
1
(Note 1)
Output from individual peripheral function
Data bus Port latch
(Note 1)
www.DataSheet4U.com
Digital
INT2 input
filter
Direction
register
(Note 1)
(Note 1)
Digital
INT3 input
filter
NOTE:
1. symbolizes a parasitic diode.
Ensure the input voltage to each port does not exceed VCC.
MODE
(Note 1)
www.DataSheet4U.com
RESET (Note 1)
(Note 1)
NOTE:
1. symbolizes a parasitic diode.
Ensure the input voltage to each port does not exceed VCC.
NOTES:
1. Bits P3_2 and P3_6 in the P3 register are unavailable on this MCU.
If it is necessary to set bits P3_2 and P3_6, set to 0 (“L” level). When read, the content is 0.
2. Bits P4_0 and P4_1 in the P4 register are unavailable on this MCU.
If it is necessary to set bits P4_0 and P4_1, set to 0 (“L” level). When read, the content is 0.
www.DataSheet4U.com
Table 7.15 Port P1_3/KI3/AN11
Register PD1 KIEN ADCON0
Function
Bit PD1_3 KI3EN CH2 CH1 CH0 ADGSEL0
0 X X X X X Input port(1)
Setting 1 X X X X X Output port
Value 0 1 X X X X KI3 input
0 X 1 1 1 1 A/D converter input (AN11)
X: 0 or 1
NOTE:
1. Pulled up by setting the PU02 bit in the PUR0 register to 1.
Bit PD3_7 SSO output control SSO input control SOOS IICSEL
0 0 0 X 0
Input port(1)
0 X X X 1
1 0 0 0 0
Output port
Setting 1 X X 0 1
Value X 0 1 0 0 SSO input
X 1 0 0 0 SSO output (CMOS output)
SSO output (N-channel open-drain
X 1 0 1 0
output)
X: 0 or 1
NOTE:
1. Pulled up by setting the PU07 bit in the PUR0 register to 1.
www.DataSheet4U.com
Table 7.39 Port P4_7/XOUT
Register CM1 CM0 Circuit specifications
Oscillation Feedback Function
Bit CM13 CM10 CM05
buffer resistor
0 X X OFF OFF Input port
1 0 0 ON ON XIN-XOUT oscillation
Setting
1 0 1 OFF ON XOUT is “H” pull-up
Value
1 1 0 OFF OFF XIN-XOUT oscillation stop
1 1 1 OFF OFF XIN-XOUT oscillation stop
X: 0 or 1
MCU
RESET(1)
Port P4_2/VREF
NOTE:
1. When the power-on reset function is in use.
8. Processor Mode
9. Bus
The bus cycles differ when accessing ROM/RAM, and when accessing SFR.
Table 9.1 lists Bus Cycles by Access Space of the R8C/24 Group and Table 9.2 lists Bus Cycles by Access Space of
the R8C/25 Group.
ROM/RAM and SFR are connected to the CPU by an 8-bit bus. When accessing in word (16-bit) units, these areas are
accessed twice in 8-bit units.
Table 9.3 lists Access Units and Bus Operations.
Even address
CPU clock CPU clock
Byte access
However, only following SFRs are connected with the 16-bit bus:
Timer RD: registers TRDi (i = 0,1), TRDGRAi, TRDGRBi, TRDGRCi, and TRDGRDi
Therefore, they are accessed once in 16-bit units. The bus operation is the same as “Area: SFR, data flash, even address
byte access” in Table 9.3 Access Units and Bus Operations, and 16-bit data is accessed at a time.
Clock prescaler
fC4
fC fC32
1/4 1/8
FRA1 register
Frequency adjustable
FRA00 High-speed fOCO40M
on-chip
XCOUT oscillator FRA2 register fOCO128
XCIN Divider
(1/128)
Divider Watchdog SSU /
timer I2C bus
fOCO-F
Voltage
detection
circuit
CM10 = 1 (stop mode) S Q
b f1
RESET R
c f2
Power-on reset
Oscillation
Software reset stop d f4
Interrupt request S Q detection
e f8
WAIT instruction XIN clock
R
OCD2 = 1 g f32
CM13 CM07 = 0
a h
Divider
CPU clock
XIN XOUT OCD2 = 0 fC
CM07 = 1
CM13
CM05
System clock
CM02
d e g
b c
CM06 = 0
CM17 to CM16 = 11b
CM06 = 1
CM06 = 0
h
CM17 to
CM16 = 10b
Detail of divider
Pulse generation
circuit for clock edge Charge,
XIN clock discharge Oscillation stop detection
detection and
charge, discharge circuit interrupt generation Oscillation stop detection,
control circuit circuit detection Watchdog timer,
OCD1 Watchdog timer Voltage monitor 1 interrupt,
interrupt Voltage monitor 2 interrupt
Voltage monitor 1
interrupt
Voltage monitor 2
interrupt
OCD2 bit switch signal
NOTES:
1. Set the PRC0 bit in the PRCR register to 1 (w rite enable) before rew riting the CM1 register.
2. When entering stop mode, the CM15 bit is set to 1 (drive capacity high).
3. When the CM06 bit is set to 0 (bits CM16, CM17 enabled), bits CM16 to CM17 are enabled.
4. If the CM10 bit is set to 1 (stop mode), the on-chip feedback resistor is disabled.
5. When the OCD2 bit is set to 0 (XIN clock selected), the CM14 bit is set to 1 (low -speed on-chip oscillator stopped).
When the OCD2 bit is set to 1 (on-chip oscillator clock selected), the CM14 bit is set to 0 (low -speed on-chip
oscillator on). It remains unchanged even if 1 is w ritten to it.
6. When using the voltage monitor 1 interrupt or voltage monitor 2 interrupt (w hen using the digital filter), set the CM14
bit to 0 (low -speed on-chip oscillator on).
7. When the CM10 bit is set to 1 (stop mode) and the CM13 bit is set to 1 (XIN-XOUT pin), the XOUT (P4_7) pin goes “H”.
When the CM13 bit is set to 0 (input ports, P4_6, P4_7), P4_7 (XOUT) enters input mode.
8. In count source protect mode (Refer to 13.2 Count Source Protection Mode Enabled), the value remains
unchanged even if bits CM10 and CM14 are set.
9. Once the CM13 bit is set to 1 by a program, it cannot be set to 0.
NOTES:
1. Set the PRC0 bit in the PRCR register to 1 (w rite enable) before rew riting the FRA1 register.
2. When changing the values of the FRA1 register, adjust the FRA1 register so that the frequency of the high-speed
on-chip oscillator clock w ill be 40 MHz or less.
Enter low-speed clock mode or low-speed VCA20 ← 0 (internal power low consumption
Step (1) Step (5)
on-chip oscillator mode disabled)(2)
Stop XIN clock and high-speed on-chip Start XIN clock or high-speed on-chip If it is necessary to start
www.DataSheet4U.com
Step (2) Step (6) the high-speed clock or
oscillator clock oscillator clock
the high-speed on-chip
oscillator in the interrupt
routine, execute steps (5)
VCA20 ← 1 (internal power low consumption to (7) in the interrupt
Step (3) Step (7) (Wait until XIN clock oscillation stabilizes)
enabled)(2, 3) routine.
NOTES:
1. Execute this routine to handle all interrupts generated in wait mode.
However, this does not apply if it is not necessary to start the high-speed clock or high-speed on-chip oscillator during the interrupt
routine.
2. Do not set the VCA20 bit to 0 with the instruction immediately after setting the VCA20 bit to 1. Also, do not do the opposite.
3. When the VCA20 bit is set to 1, do not set the CM10 bit to 1 (stop mode).
4. When entering wait mode, follow 10.7.2 Wait Mode.
Figure 10.9 Procedure for Enabling Reduced Internal Power Consumption Using VCA20 bit
The clocks generated by the clock generation circuits are described below.
MCU MCU
(on-chip feedback resistor) (on-chip feedback resistor)
XIN XOUT XIN XOUT
Open
Rf(1) Rd(1)
Externally derived clock
NOTE:
1. Insert a damping resistor if required. The resistance will vary depending on the oscillator and the
oscillation drive capacity setting. Use the value recommended by the manufacturer of the oscillator.
Use high drive when oscillation starts and, if it is necessary to switch the oscillation drive capacity, do so
after oscillation stabilizes.
When the oscillation drive capacity is set to low, check that oscillation is stable. Also, if the oscillator
manufacturer's data sheet specifies that a feedback resistor be added to the chip externally, insert a
feedback resistor between XIN and XOUT following the instructions.
To use this MCU with supply voltage below VCC = 2.7 V, it is recommended to set the CM11 bit in the
CM1 register to 1 (on-chip feedback resistor disabled), the CM15 bit to 1 (high drive capacity), and
connect the feedback resistor to the chip externally.
After reset, the on-chip oscillator clock generated by the high-speed on-chip oscillator stops. Oscillation is
started by setting the FRA00 bit in the FRA0 register to 1 (high-speed on-chip oscillator on). The frequency can
be adjusted by registers FRA1 and FRA2.
The frequency correction data (the value is the same as that of the FRA1 register after a reset) corresponding to
the supply voltage ranges VCC = 2.7 V to 5.5 V is stored in FRA4 register. Furthermore, the frequency
correction data corresponding to the supply voltage ranges VCC = 2.2 V to 5.5 V is stored in FRA6 register. To
use separate correction values to match these voltage ranges, transfer them from FRA4 or FRA6 register to the
FRA1 register.
The frequency correction data of 36.864 MHz is stored in the FRA7 register. To set the frequency of the high-
speed on-chip oscillator to 36.864 MHz, transfer the correction value in the FRA7 register to the FRA1 register
before use. This enables the setting errors of bit rates such as 9600 bps and 38400 bps to be 0% when the serial
interface is used in UART mode (refer to Table 15.7 Bit Rate Setting Example in UART Mode (Internal
Clock Selected)).
Since there are differences in the amount of frequency adjustment among the bits in the FRA1 register, make
adjustments by changing the settings of individual bits. Adjust the FRA1 register so that the frequency of the
high-speed on-chip oscillator clock will be 40 MHz or less.
MCU MCU
(on-chip feedback resistor) (on-chip feedback resistor)
XCIN XCOUT XCIN XCOUT
Open
Rf(1)
Rd(1)
Externally derived clock
10.4.3 Peripheral Function Clock (f1, f2, f4, f8, and f32)
The peripheral function clock is the operating clock for the peripheral functions.
The clock fi (i = 1, 2, 4, 8, and 32) is generated by the system clock divided by i. The clock fi is used for timers
RA, RB, RD, and RE, the serial interface and the A/D converter.
When the WAIT instruction is executed after setting the CM02 bit in the CM0 register to 1 (peripheral function
clock stops in wait mode), the clock fi stop.
10.4.4 fOCO
fOCO is an operating clock for the peripheral functions.
fOCO runs at the same frequency as the on-chip oscillator clock and can be used as the source for timer RA.
When the WAIT instruction is executed, the clocks fOCO does not stop.
10.4.5 fOCO40M
fOCO40M is used as the count source for timer RD. fOCO40M is generated by the high-speed on-chip
oscillator and supplied by setting the FRA00 bit to 1.
When the WAIT instruction is executed, the clock fOCO40M does not stop.
fOCO40M can be used with supply voltage VCC = 3.0 to 5.5 V.
10.4.6 fOCO-F
fOCO-F is used as the count source for the A/D converter. fOCO-F is generated by the high-speed on-chip
oscillator and supplied by setting the FRA00 bit to 1.
When the WAIT instruction is executed, the clock fOCO-F does not stop.
10.4.7 fOCO-S
fOCO-S is an operating clock for the watchdog timer and voltage detection circuit. fOCO-S is supplied by
setting the CM14 bit to 0 (low-speed on-chip oscillator on) and uses the clock generated by the low-speed on-
chip oscillator. When the WAIT instruction is executed or in count source protect mode of the watchdog timer,
fOCO-S does not stop.
10.4.8 fOCO128
fOCO128 is generated by fOCO divided by 128.
The clock fOCO128 is used for capture signal of timer RD (channel 0).
www.DataSheet4U.com
Figure 10.12 shows the Time from Wait Mode to Interrupt Routine Execution.
When using a peripheral function interrupt to exit wait mode, set up the following before executing the WAIT
instruction.
(1) Set the interrupt priority level in bits ILVL2 to ILVL0 in the interrupt control registers of the peripheral
function interrupts to be used for exiting wait mode. Set bits ILVL2 to ILVL0 of the peripheral function
interrupts that are not to be used for exiting wait mode to 000b (interrupt disabled).
(2) Set the I flag to 1.
(3) Operate the peripheral function to be used for exiting wait mode.
When exiting by a peripheral function interrupt, the time (number of cycles) between interrupt request
generation and interrupt routine execution is determined by the settings of the FMSTP bit in the FMR0 register
and the CM07 bit in the CM0 register, as described in Figure 10.12.
www.DataSheet4U.com The CPU clock, when exiting wait mode by a peripheral function interrupt, is the same clock as the CPU clock
when the WAIT instruction is executed.
FMR0 Register CM0 Register Time until Flash Memory Time until CPU Clock Time for Interrupt
Remarks
FMSTP Bit CM07 Bit is Activated (T1) is Supplied (T2) Sequence (T3)
0 Period of system clock Period of CPU clock Period of CPU clock
0 (system clock) × 12 cycles + 30 µs (max.) × 6 cycles × 20 cycles
(flash memory Following total
operates) 1 Period of XCIN clock time is the time
Same as above Same as above
(XCIN clock) × 12 cycles + 30 µs (max.) from wait mode
0 Period of system clock until an interrupt
1 × 12 cycles Same as above Same as above routine is
(system clock)
(flash memory executed.
stops) 1 Period of XCIN clock
Same as above Same as above
(XCIN clock) × 12 cycles
T1 T2 T3
Flash memory
Wait mode CPU clock restart sequence Interrupt sequence
activation sequence
Enter low-speed clock mode or low-speed VCA20 ← 0 (internal power low consumption
Step (1) Step (5)
on-chip oscillator mode disabled)(2)
Stop XIN clock and high-speed on-chip Start XIN clock or high-speed on-chip If it is necessary to start
Step (2) Step (6) the high-speed clock or
oscillator clock oscillator clock
the high-speed on-chip
oscillator in the interrupt
routine, execute steps (5)
VCA20 ← 1 (internal power low consumption to (7) in the interrupt
Step (3) Step (7) (Wait until XIN clock oscillation stabilizes)
enabled)(2, 3) routine.
NOTES:
1. Execute this routine to handle all interrupts generated in wait mode.
However, this does not apply if it is not necessary to start the high-speed clock or high-speed on-chip oscillator during the interrupt
routine.
2. Do not set the VCA20 bit to 0 with the instruction immediately after setting the VCA20 bit to 1. Also, do not do the opposite.
3. When the VCA20 bit is set to 1, do not set the CM10 bit to 1 (stop mode).
4. When entering wait mode, follow 10.7.2 Wait Mode.
Figure 10.13 Procedure for Enabling Reduced Internal Power Consumption Using VCA20 bit
If the clock used immediately before stop mode is a system clock and stop mode is exited by a peripheral
function interrupt, the CPU clock becomes the previous system clock divided by 8.
FMR0 Register CM0 Register Time until Flash Memory Time until CPU Clock Time for Interrupt
is Activated (T2) is Supplied (T3) Sequence (T4) Remarks
FMSTP Bit CM07 Bit
Period of system clock Period of CPU clock Period of CPU clock Following total
0 0 (system clock) × 6 cycles
× 12 cycles + 30 µs (max.) × 20 cycles time of T0 to
(flash memory
operates) Period of XCIN clock T4 is the time
1 (XCIN clock) × 12 cycles + 30 µs (max.) Same as above Same as above
from stop
Period of system clock mode until an
0 (system clock) Same as above Same as above
1 × 12 cycles interrupt
(flash memory stops) Period of XCIN clock handling is
1 (XCIN clock) Same as above Same as above executed.
× 12 cycles
T0 T1 T2 T3 T4
Oscillation time of
Stop Internal power CPU clock source Flash memory CPU clock restart
Interrupt sequence
mode stability time used immediately activation sequence sequence
before stop mode
150 µs
Interrupt (max.)
request
generated
Reset
CM05 = 0 CM07 = 0
CM13 = 1 CM14 = 0
OCD2 = 0 FRA00 = 1 OCD2 = 1
FRA01 = 1 FRA01 = 0
CM04 = 1
High-speed clock mode CM07 = 1
CM05 = 0 Low-speed clock mode
CM07 = 0 CM04 = 1
CM13 = 1 CM07 = 1
OCD2 = 0 CM05 = 0
CM07 = 0
CM13 = 1
CM14 = 0
OCD2 = 0
FRA01 = 0
OCD2 = 1
FRA00 = 1
CM04 = 1
FRA01 = 1
CM07 = 1
CM05 = 0 CM07 = 0
CM13 = 1 OCD2 = 1
OCD2 = 0 High-speed on-chip oscillator mode FRA00 = 1
CM07 = 0 FRA01 = 1
OCD2 = 1
FRA00 = 1
FRA01 = 1
When the XIN clock is the CPU clock source and bits OCD1 to OCD0 are set to 11b, the system is placed in the
following state if the XIN clock stops.
• OCD2 bit in OCD register = 1 (on-chip oscillator clock selected)
• OCD3 bit in OCD register = 1 (XIN clock stops)
• CM14 bit in CM1 register = 0 (low-speed on-chip oscillator oscillates)
• Oscillation stop detection interrupt request is generated.
www.DataSheet4U.com
Table 10.5 Specifications of Oscillation Stop Detection Function
Item Specification
Oscillation stop detection clock and f(XIN) ≥ 2 MHz
frequency bandwidth
Enabled condition for oscillation stop Set bits OCD1 to OCD0 to 11b
detection function
Operation at oscillation stop detection Oscillation stop detection interrupt is generated
Table 10.6 Determining Interrupt Source for Oscillation Stop Detection, Watchdog Timer,
Voltage Monitor 1, and Voltage Monitor 2 Interrupts
Generated Interrupt Source Bit Showing Interrupt Cause
Oscillation stop detection (a) OCD3 bit in OCD register = 1
((a) or (b)) (b) OCD1 to OCD0 bits in OCD register = 11b and OCD2 bit = 1
Watchdog timer VW2C3 bit in VW2C register = 1
Voltage monitor 1 VW1C2 bit in VW1C register = 1
Voltage monitor 2 VW2C2 bit in VW2C register = 1
www.DataSheet4U.com
NO Multiple confirmations
that OCD3 bit is set to 0 (XIN
clock oscillates) ?
YES
End
Figure 10.16 Procedure for Switching Clock Source from Low-Speed On-Chip Oscillator to XIN
Clock
OCD3 = 1 ? NO
(XIN clock stopped)
YES
OCD1 = 1
(oscillation stop detection
www.DataSheet4U.com interrupt enabled) and OCD2 = 1 NO
(on-chip oscillator clock selected
as system clock) ?
YES
VW2C3 = 1 ?
NO
(Watchdog timer
underflow)
YES
VW2C2 = 1 ? NO
(passing Vdet2)
YES
NOTE:
1. This disables multiple oscillation stop detection interrupts.
Figure 10.17 Example of Determining Interrupt Source for Oscillation Stop Detection, Watchdog
Timer, Voltage Monitor 1, or Voltage Monitor 2 Interrupt
11. Protection
The protection function protects important registers from being easily overwritten when a program runs out of control.
Figure 11.1 shows the PRCR Register. The registers protected by the PRCR register are listed below.
• Registers protected by PRC0 bit: Registers CM0, CM1, OCD, FRA0, FRA1, and FRA2
• Registers protected by PRC1 bit: Registers PM0 and PM1
• Registers protected by PRC2 bit: PD0 register
• Registers protected by PRC3 bit: Registers VCA2, VW0C, VW1C, and VW2C
Protect Register
b7 b6 b5 b4 b3 b2 b1 b0
12. Interrupts
NOTES:
1. Peripheral function interrupts in the MCU are used to generate peripheral interrupts.
2. Do not use this interrupt. This is for use with development tools only.
• Maskable Interrupts: The interrupt enable flag (I flag) enables or disables these interrupts. The
interrupt priority order can be changed based on the interrupt priority level.
• Non-Maskable Interrupts: The interrupt enable flag (I flag) does not enable or disable these interrupts.
The interrupt priority order cannot be changed based on interrupt priority
level.
12.1.3.3
www.DataSheet4U.com Voltage Monitor 1 Interrupt
The voltage monitor 1 interrupt is generated by the voltage detection circuit. For details of the voltage detection
circuit, refer to 6. Voltage Detection Circuit.
MSB LSB
Vector address (L)
Low address
Mid address
www.DataSheet4U.com
12.1.6.1 I Flag
The I flag enables or disables maskable interrupts. Setting the I flag to 1 (enabled) enables maskable interrupts.
Setting the I flag to 0 (disabled) disables all maskable interrupts.
12.1.6.2 IR Bit
The IR bit is set to 1 (interrupt requested) when an interrupt request is generated. Then, when the interrupt
request is acknowledged and the CPU branches to the corresponding interrupt vector, the IR bit is set to 0 (=
interrupt not requested).
The IR bit can be set to 0 by a program. Do not write 1 to this bit.
However, the IR bit operations of the timer RD Interrupt, Clock Synchronous Serial I/O with Chip Select
Interrupt and the I 2 C bus Interface Interrupt are different. Refer to 12.5 Timer RD Interrupt, Clock
www.DataSheet4U.com
Synchronous Serial I/O with Chip Select Interrupts, and I2C bus Interface Interrupt (Interrupts with
Multiple Interrupt Request Sources).
The I flag, IR bit, bits ILVL2 to ILVL0, and IPL are independent of each other. They do not affect one another.
Table 12.3 Settings of Interrupt Priority Table 12.4 Interrupt Priority Levels Enabled by
Levels IPL
ILVL2 to ILVL0 Bits Interrupt Priority Level Priority Order IPL Enabled Interrupt Priority Levels
000b Level 0 (interrupt disabled) − 000b Interrupt level 1 and above
001b Level 1 Low 001b Interrupt level 2 and above
010b Level 2 010b Interrupt level 3 and above
011b Level 3 011b Interrupt level 4 and above
100b Level 4 100b Interrupt level 5 and above
101b Level 5 101b Interrupt level 6 and above
110b Level 6 110b Interrupt level 7 and above
111b Level 7 High 111b All maskable interrupts are disabled
After the interrupt sequence is completed, instructions are executed from the starting address of the interrupt
routine.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
CPU Clock
Address Bus Address Undefined SP-2 SP-1 SP-4 SP-3 VEC VEC+1 VEC+2 PC
0000h
Data Bus Interrupt Undefined SP-2 SP-1 SP-4 SP-3 VEC VEC+1 VEC+2
information contents contents contents contents contents contents contents
RD Undefined
WR
The indeterminate state depends on the instruction queue buffer. A read cycle occurs when the instruction queue buffer is
ready to acknowledge instructions.
NOTES:
1. This register cannot be accessed by the user.
2. Refer to 12.5 Timer RD Interrupt, Clock Synchronous Serial I/O with Chip Select Interrupts, and
I2C bus Interface Interrupt (Interrupts with Multiple Interrupt Request Sources) for the IR bit
operations of the timer RD Interrupt, Clock Synchronous Serial I/O with Chip Select Interrupt, and the
I2C bus Interface Interrupt.
Time
www.DataSheet4U.com
Instruction in
Instruction Interrupt sequence
interrupt routine
(a) 20 cycles (b)
(a) Period between interrupt request generation and the completion of execution of an
instruction. The length of time varies depending on the instruction being executed. The
DIVX instruction requires the longest time, 30 cycles (assuming no wait states and that a
register is set as the divisor).
(b) 21 cycles for address match and single-step interrupts.
NOTE:
1. Selectable from registers R0, R1, R2, R3, A0, A1, SB, and FB.
www.DataSheet4U.com
Address Stack Address Stack
MSB LSB MSB LSB
[SP]
m−4 m−4 PCL New SP value
Stack state before interrupt request Stack state after interrupt request
is acknowledged is acknowledged
NOTE:
1. When executing software number 32 to 63 INT instructions,
this SP is specified by the U flag. Otherwise it is ISP.
Figure 12.8 Stack State Before and After Acknowledgement of Interrupt Request
The register saving operation, which is performed as part of the interrupt sequence, saved in 8 bits at a time in
four steps.
Figure 12.9 shows the Register Saving Operation.
Stack
Address
Sequence in which
order registers are
saved
[SP]−5
[SP]−1 (2)
FLGH PCH
PCH : 4 high-order bits of PC
PCM : 8 middle-order bits of PC
[SP] PCL : 8 low-order bits of PC
Completed saving FLGH : 4 high-order bits of FLG
registers in four FLGL : 8 low-order bits of FLG
operations.
NOTE:
1. [SP] indicates the initial value of the SP when an interrupt request is acknowledged.
After registers are saved, the SP content is [SP] minus 4. When executing
software number 32 to 63 INT instructions, this SP is specified by the U
flag. Otherwise it is ISP.
High
Reset
Address break
Watchdog timer
Oscillation stop detection
Voltage monitor 1
Voltage monitor 2
Peripheral function
Single step
Address match
Low
INT3
Timer RB
www.DataSheet4U.com Timer RA
INT0
INT1
UART1 receive
Priority of peripheral function interrupts
UART0 receive (if priority levels are same)
A/D conversion
Timer RE
Timer RD0
INT2
UART1 transmit
UART0 transmit
Key input
Timer RD1
IPL Lowest
Interrupt request level
judgment output signal
Watchdog timer
Voltage monitor 1
Voltage monitor 2
NOTE:
1. The IICSEL bit in the PMR register switches functions.
www.DataSheet4U.com
_______
INT0 Input Filter Select Register
b7 b6 b5 b4 b3 b2 b1 b0
_____ b3 b2
INT1 input filter select bits 0 0 : No filter
INT1F0 RW
0 1 : Filter w ith f1 sampling
1 0 : Filter w ith f8 sampling
INT1F1 1 1 : Filter w ith f32 sampling RW
_____ b5 b4
INT2 input filter select bits 0 0 : No filter
INT2F0 RW
0 1 : Filter w ith f1 sampling
1 0 : Filter w ith f8 sampling
INT2F1 1 1 : Filter w ith f32 sampling RW
_____ b7 b6
INT3 input filter select bits 0 0 : No filter
INT3F0 RW
0 1 : Filter w ith f1 sampling
1 0 : Filter w ith f8 sampling
INT3F1 1 1 : Filter w ith f32 sampling RW
INTiF1 to INTiF0
f1 = 01b
www.DataSheet4U.com = 10b Sampling clock
f8
= 11b
f32 INTiEN
Other than
INTiF1 to INTiF0
INTi = 00b INTi interrupt
Digital filter
(input level
Port direction matches 3x) = 00b INTiPL = 0
register(1)
Both edges
detection
INTiPL = 1
circuit
INTiF0, INTiF1: Bits in INTF register
INTiEN, INTiPL: Bits in INTEN register
i = 0 to 3
NOTE:
1. INT0: Port P4_5 direction register
INT1: Port P1_5 direction register when using the P1_5 pin
Port P1_7 direction register when using the P1_7 pin
INT2: Port P6_6 direction register
INT3: Port P6_7 direction register
INTi input
Sampling
timing
IR bit in
INTiIC register
Set to 0 by a program
KI3EN bit
PD1_3 bit
KI3PL = 0
KI3
KI3PL = 1
KI2EN bit
Pull-up PD1_2 bit
transistor
KI2PL = 0
Interrupt control Key input interrupt
KI2 circuit request
KI2PL = 1
KI1EN bit
Pull-up PD1_1 bit
transistor
KI1PL = 0
KI1
KI1PL = 1
KI0EN bit KI0EN, KI1EN, KI2EN, KI3EN,
Pull-up KI0PL, KI1PL, KI2PL, KI3PL: Bits in KIEN register
PD1_0 bit
transistor PD1_0, PD1_1, PD1_2, PD1_3: Bits in PD1 register
KI0PL = 0
KI0
KI0PL = 1
Set the starting address of any instruction in the RMADi register. Bits AIER0 and AIER1 in the AIER0 register can
be used to select enable or disable of the interrupt. The I flag and IPL do not affect the address match interrupt.
The value of the PC (Refer to 12.1.6.7 Saving a Register for the value of the PC) which is saved to the stack when
an address match interrupt is acknowledged varies depending on the instruction at the address indicated by the
RMADi register. (The appropriate return address is not saved on the stack.) When returning from the address match
interrupt, return by one of the following means:
www.DataSheet4U.com
• Change the content of the stack and use the REIT instruction.
• Use an instruction such as POP to restore the stack as it was before the interrupt request was acknowledged.
Then use a jump instruction.
Table 12.6 lists the Values of PC Saved to Stack when Address Match Interrupt is Acknowledged.
Figure 12.18 shows Registers AIER and RMAD0 to RMAD1.
Table 12.6 Values of PC Saved to Stack when Address Match Interrupt is Acknowledged
Address Indicated by RMADi Register (i = 0 or 1) PC Value Saved(1)
• Instruction with 2-byte operation code(2) Address indicated by
• Instruction with 1-byte operation code(2) RMADi register + 2
ADD.B:S #IMM8,dest SUB.B:S #IMM8,dest AND.B:S #IMM8,dest
OR.B:S #IMM8,dest MOV.B:S #IMM8,dest STZ #IMM8,dest
STNZ #IMM8,dest STZX #IMM81,#IMM82,dest
CMP.B:S #IMM8,dest PUSHM src POPM dest
JMPS #IMM8 JSRS #IMM8
MOV.B:S #IMM,dest (however, dest = A0 or A1)
• Instructions other than the above Address indicated by
RMADi register + 1
NOTES:
1. Refer to the 12.1.6.7 Saving a Register for the PC value saved.
2. Operation code: Refer to the R8C/Tiny Series Software Manual (REJ09B0001).
Chapter 4. Instruction Code/Number of Cycles contains diagrams showing
operation code below each syntax. Operation code is shown in the bold frame in the
diagrams.
Table 12.7 Correspondence Between Address Match Interrupt Sources and Associated Registers
Address Match Interrupt Source Address Match Interrupt Enable Bit Address Match Interrupt Register
Address match interrupt 0 AIER0 RMAD0
Address match interrupt 1 AIER1 RMAD1
12.5 Timer RD Interrupt, Clock Synchronous Serial I/O with Chip Select
Interrupts, and I2C bus Interface Interrupt (Interrupts with Multiple Interrupt
Request Sources)
The timer RD (channel 0) interrupt, timer RD (channel 1) interrupt, clock synchronous serial I/O with chip select
interrupt, and I2C bus interface interrupt each have multiple interrupt request sources. An interrupt request is
generated by the logical OR of several interrupt request factors and is reflected in the IR bit in the corresponding
interrupt control register. Therefore, each of these peripheral functions has its own interrupt request source status
register (status register) and interrupt request source enable register (enable register) to control the generation of
interrupt requests (change the IR bit in the interrupt control register). Table 12.8 lists the Registers Associated with
Timer RD Interrupt, Clock Synchronous Serial I/O with Chip Select Interrupt, and I2C bus Interface Interrupt and
Figure 12.19 shows a Block Diagram of Timer RD Interrupt.
www.DataSheet4U.com
Table 12.8 Registers Associated with Timer RD Interrupt, Clock Synchronous Serial I/O with
Chip Select Interrupt, and I2C bus Interface Interrupt
Status Register of Enable Register of Interrupt Control
Interrupt Request Source Interrupt Request Source Register
Timer RD Channel 0 TRDSR0 TRDIER0 TRD0IC
Channel 1 TRDSR1 TRDIER1 TRD1IC
Clock synchronous serial SSSR SSER SSUIC
I/O with chip select
I2C bus interface ICSR ICIER IICIC
Channel i
IMFA bit
Timer RD (channel i)
IMIEA bit interrupt request
(IR bit in TRDiIC register)
IMFB bit
IMIEB bit
IMFC bit
IMIEC bit
IMFD bit
IMIED bit
UDF bit
OVF bit
OVIE bit
i = 0 or 1
IMFA, IMFB, IMFC, IMFD, OVF, UDF: Bits in TRDSRi register
IMIEA, IMIEB, IMIEC, IMIED, OVIE: Bits in TRDIER register
As with other maskable interrupts, the timer RD (channel 0) interrupt, timer RD (channel 1) interrupt, clock
synchronous serial I/O with chip select interrupt, and I2C bus interface interrupt are controlled by the combination
of the I flag, IR bit, bits ILVL0 to ILVL2, and IPL. However, since each interrupt source is generated by a
combination of multiple interrupt request sources, the following differences from other maskable interrupts apply:
• When bits in the enable register corresponding to bits set to 1 in the status register are set to 1 (enable
interrupt), the IR bit in the interrupt control register is set to 1 (interrupt requested).
• When either bits in the status register or bits in the enable register corresponding to bits in the status register, or
both, are set to 0, the IR bit is set to 0 (interrupt not requested). Basically, even though the interrupt is not
acknowledged after the IR bit is set to 1, the interrupt request will not be maintained. Also, the IR bit is not set
to 0 even if 0 is written to the IR bit.
• Individual bits in the status register are not automatically set to 0 even if the interrupt is acknowledged.
Therefore, the IR bit is also not automatically set to 0 when the interrupt is acknowledged. Set each bit in the
www.DataSheet4U.com status register to 0 in the interrupt routine. Refer to the status register figure for how to set individual bits in the
status register to 0.
• When multiple bits in the enable register are set to 1 and other request sources are generated after the IR bit is
set to 1, the IR bit remains 1.
• When multiple bits in the enable register are set to 1, determine by the status register which request source
causes an interrupt.
Refer to chapters of the individual peripheral functions (14.3 Timer RD, 16.2 Clock Synchronous Serial I/O with
Chip Select (SSU) and 16.3 I2C bus Interface) for the status register and enable register.
Refer to 12.1.6 Interrupt Control for the interrupt control register.
12.6.2 SP Setting
www.DataSheet4U.com
Set any value in the SP before an interrupt is acknowledged. The SP is set to 0000h after reset. Therefore, if an
interrupt is acknowledged before setting a value in the SP, the program may run out of control.
www.DataSheet4U.com
Interrupt source change
Disable interrupts(2, 3)
Change completed
(b) When changing the contents of an interrupt control register after disabling interrupts, be careful to
choose appropriate instructions.
Changing any bit other than IR bit
If an interrupt request corresponding to a register is generated while executing the instruction, the IR bit
may not be set to 1 (interrupt requested), and the interrupt request may be ignored. If this causes a
problem, use the following instructions to change the register: AND, OR, BCLR, BSET
www.DataSheet4U.com
Changing IR bit
If the IR bit is set to 0 (interrupt not requested), it may not be set to 0 depending on the instruction used.
Therefore, use the MOV instruction to set the IR bit to 0.
(c) When disabling interrupts using the I flag, set the I flag as shown in the sample programs below. Refer
to (b) regarding changing the contents of interrupt control registers by the sample programs.
Sample programs 1 to 3 are for preventing the I flag from being set to 1 (interrupts enabled) before the interrupt
control register is changed for reasons of the internal bus or the instruction queue buffer.
Example 1: Use NOP instructions to prevent I flag from being set to 1 before interrupt control register
is changed
INT_SWITCH1:
FCLR I ; Disable interrupts
AND.B #00H,0056H ; Set TRAIC register to 00h
NOP ;
NOP
FSET I ; Enable interrupts
Prescaler
CM07 = 0,
WDC7 = 0
1/16
CSPRO = 0 PM12 = 0
1/128 Watchdog timer
CM07 = 0, interrupt request
WDC7 = 1
CPU clock 1/2 Watchdog timer
CM07 = 1
PM12 = 1
fOCO-S Watchdog
CSPRO = 1
timer reset
Set to
7FFFh(1)
Write to WDTR register
Internal reset signal
(“L” active)
www.DataSheet4U.com
NOTES:
1. Do not generate an interrupt betw een w hen 00h and FFh are w ritten.
2. When the CSPRO bit in the CSPR register is set to 1 (count source protection mode enabled),
0FFFh is set in the w atchdog timer.
Table 13.2 Watchdog Timer Specifications (with Count Source Protection Mode Disabled)
Item Specification
Count source CPU clock
Count operation Decrement
Period Division ratio of prescaler (n) × count value of watchdog timer (32768)(1)
CPU clock
www.DataSheet4U.com n: 16 or 128 (selected by WDC7 bit in WDC register)
Example: When the CPU clock frequency is 16 MHz and prescaler
divided by 16, the period is approximately 32.8 ms
Count start condition The WDTON bit(2) in the OFS register (0FFFFh) selects the operation
of the watchdog timer after a reset
• When the WDTON bit is set to 1 (watchdog timer is in stop state after
reset)
The watchdog timer and prescaler stop after a reset and the count
starts when the WDTS register is written to
• When the WDTON bit is set to 0 (watchdog timer starts automatically
after exiting)
The watchdog timer and prescaler start counting automatically after a
reset
Reset condition of watchdog • Reset
timer • Write 00h to the WDTR register before writing FFh
• Underflow
Count stop condition Stop and wait modes (inherit the count from the held value after exiting
modes)
Operation at time of underflow • When the PM12 bit in the PM1 register is set to 0
Watchdog timer interrupt
• When the PM12 bit in the PM1 register is set to 1
Watchdog timer reset (refer to 5.6 Watchdog Timer Reset)
NOTES:
1. The watchdog timer is reset when 00h is written to the WDTR register before FFh. The prescaler is
reset after the MCU is reset. Some errors in the period of the watchdog timer may be caused by the
prescaler.
2. The WDTON bit cannot be changed by a program. To set the WDTON bit, write 0 to bit 0 of address
0FFFFh with a flash programmer.
Table 13.3 Watchdog Timer Specifications (with Count Source Protection Mode Enabled)
Item Specification
Count source Low-speed on-chip oscillator clock
Count operation Decrement
Period
www.DataSheet4U.com
Count value of watchdog timer (4096)
Low-speed on-chip oscillator clock
Example: Period is approximately 32.8 ms when the low-speed on-
chip oscillator clock frequency is 125 kHz
Count start condition The WDTON bit(1) in the OFS register (0FFFFh) selects the operation
of the watchdog timer after a reset.
• When the WDTON bit is set to 1 (watchdog timer is in stop state
after reset)
The watchdog timer and prescaler stop after a reset and the count
starts when the WDTS register is written to
• When the WDTON bit is set to 0 (watchdog timer starts
automatically after reset)
The watchdog timer and prescaler start counting automatically after
a reset
Reset condition of watchdog • Reset
timer • Write 00h to the WDTR register before writing FFh
• Underflow
Count stop condition None (The count does not stop in wait mode after the count starts.
The MCU does not enter stop mode.)
Operation at time of underflow Watchdog timer reset (Refer to 5.6 Watchdog Timer Reset.)
Registers, bits • When setting the CSPPRO bit in the CSPR register to 1 (count
source protection mode is enabled)(2), the following are set
automatically
- Set 0FFFh to the watchdog timer
- Set the CM14 bit in the CM1 register to 0 (low-speed on-chip
oscillator on)
- Set the PM12 bit in the PM1 register to 1 (The watchdog timer is
reset when watchdog timer underflows)
• The following conditions apply in count source protection mode
- Writing to the CM10 bit in the CM1 register is disabled (It remains
unchanged even if it is set to 1. The MCU does not enter stop
mode.)
- Writing to the CM14 bit in the CM1 register is disabled (It remains
unchanged even if it is set to 1. The low-speed on-chip oscillator
does not stop.)
NOTES:
1. The WDTON bit cannot be changed by a program. To set the WDTON bit, write 0 to bit 0 of address
0FFFFh with a flash programmer.
2. Even if 0 is written to the CSPROINI bit in the OFS register, the CSPRO bit is set to 1.
The CSPROINI bit cannot be changed by a program. To set the CSPROINI bit, write 0 to bit 7 of
address 0FFFFh with a flash programmer.
14. Timers
The MCU has two 8-bit timers with 8-bit prescalers, two 16-bit timers, and a timer with a 4-bit counter and an 8-bit
counter. The two 8-bit timers with 8-bit prescalers are timer RA and timer RB. These timers contain a reload register to
store the default value of the counter. The 16-bit timer is timer RD, and has input capture and output compare
functions. The 4 and 8-bit counters are timer RE, and has an output compare function. All the timers operate
independently.
Table 14.1 lists Functional Comparison of Timers.
www.DataSheet4U.com
14.1 Timer RA
Timer RA is an 8-bit timer with an 8-bit prescaler.
The prescaler and timer each consist of a reload register and counter. The reload register and counter are allocated
at the same address, and can be accessed when accessing registers TRAPRE and TRA (refer to Tables 14.2 to 14.6
the Specifications of Each Mode).
The count source for timer RA is the operating clock that regulates the timing of timer operations such as counting
and reloading.
Figure 14.1 shows a Block Diagram of Timer RA. Figures 14.2 and 14.3 show the registers associated with Timer
RA.
Data bus
Timer RA Register
b7 b0
www.DataSheet4U.com
Count source
Counter of 06h 05h 04h 01h 00h 01h 00h 01h 00h 01h 00h
timer RA prescaler
After writing, the reload register is
written to at the first underflow.
Reloads register of
timer RA Previous value New value (25h)
IR bit in TRAIC
register 0
The IR bit remains unchanged until underflow is
generated by a new value.
Figure 14.5 Operating Example of Timer RA when Counter Value is Rewritten during Count
Operation
n = high level: the contents of TRA register, low level: the contents of TRAPRE register
FFFFh
Count start Underflow
n
Content of counter (hex)
Count stop
Count stop
www.DataSheet4U.com
TSTART bit in 1
TRACR register 0
Measured pulse 1
(TRAIO pin input) 0
Set to 0 when interrupt request is acknowledged, or set by program
IR bit in TRAIC 1
register 0
Set to 0 by program
TEDGF bit in 1
TRACR register 0
Set to 0 by program
TUNDF bit in 1
TRACR register 0
Underflow signal of
timer RA prescaler
Set to 1 by program
TSTART bit in 1
TRACR register 0
Starts counting
1
Measurement pulse
www.DataSheet4U.com (TRAIO pin input) 0
TRA reloads TRA reloads
Contents of TRA 0Fh 0Eh 0Dh 0Fh 0Eh 0Dh 0Ch 0Bh 0Ah 09h 0Fh 0Eh 0Dh 01h 00h 0Fh 0Eh
Underflow
Retained Retained
Contents of read-out
0Fh 0Eh 0Dh 0Bh 0Ah 09h 0Dh 01h 00h 0Fh 0Eh
buffer(1)
TRA read(3)
(Note 2) (Note 2)
TEDGF bit in 1
TRACR register 0
IR bit in TRAIC 1
register 0
Conditions: The period from one rising edge to the next rising edge of the measured pulse is measured (TEDGSEL = 0) with
the default value of the TRA register as 0Fh.
NOTES:
1. The contents of the read-out buffer can be read by reading the TRA register in pulse period measurement mode.
2. After an active edge of the measured pulse is input, the TEDGF bit in the TRACR register is set to 1 (active edge found) when the timer
RA prescaler underflows for the second time.
3. The TRA register should be read before the next active edge is input after the TEDGF bit is set to 1 (active edge found).
The contents in the read-out buffer are retained until the TRA register is read. If the TRA register is not read before the next active edge
is input, the measured result of the previous period is retained.
4. To set to 0 by a program, use a MOV instruction to write 0 to the TEDGF bit in the TRACR register. At the same time, write 1 to the
TUNDF bit in the TRACR register.
5. To set to 0 by a program, use a MOV instruction to write 0 to the TUNDF bit. At the same time, write 1 to the TEDGF bit.
6. Bits TUNDF and TEDGF are both set to 1 if timer RA underflows and reloads on an active edge simultaneously.
NOTE:
1. Registers associated with timer RA: TRACR, TRAIOC, TRAMR, TRAPRE, and TRA.
• When the TRAPRE register is continuously written during count operation (TCSTF bit is set to 1), allow
three or more cycles of the count source clock for each write interval.
• When the TRA register is continuously written during count operation (TCSTF bit is set to 1), allow three
or more cycles of the prescaler underflow for each write interval.
14.2 Timer RB
Timer RB is an 8-bit timer with an 8-bit prescaler.
The prescaler and timer each consist of a reload register and counter (refer to Tables 14.7 to 14.10 the
Specifications of Each Mode).
Timer RB has timer RB primary and timer RB secondary as reload registers.
The count source for timer RB is the operating clock that regulates the timing of timer operations such as counting
and reloading.
Figure 14.12 shows a Block Diagram of Timer RB. Figures 14.13 to 14.15 show the registers associated with timer
RB.
Data bus
TRBSC TRBPR
register register
Reload Reload Reload
register register register
TCK1 to TCK0 bits TCKCUT bit
f1 = 00b
= 01b Timer RB interrupt
f8 Counter Counter (timer RB)
Timer RA underflow = 10b
TRBPRE register (Timer)
f2 = 11b (prescaler)
TMOD1 to TMOD0 bits
= 10b or 11b
TSTART bit
TOSSTF bit
INT0 interrupt
Input polarity
INT0 pin Digital filter selected to be one Polarity
edge or both edges select
INT0PL bit
INOSEG bit INOSTG bit
TMOD1 to TMOD0 bits INT0EN bit
= 01b, 10b, 11b TOPL = 1
TOCNT = 0 Q
Toggle flip-flop CK
TRBO pin Q CLR
P3_1 bit in P3 register TOPL = 0
TOCNT = 1 TCSTF bit
TMOD1 to TMOD0 bits
TSTART, TCSTF: Bit in TRBCR register = 01b, 10b, 11b
TOSSTF: Bit in TRBOCR register
TOPL, TOCNT, INOSTG, INOSEG: Bits in TRBIOC register
TMOD1 to TMOD0, TCK1 to TCK0, TCKCUT: Bits in TRBMR register
When the TWRC bit is set to 0 (write to reload register and counter)
Count source
Counter of 06h 05h 04h 01h 00h 01h 00h 01h 00h 01h 00h
timer RB prescaler
After writing, the reload register is
written on the first underflow.
Reloads register of
timer RB Previous value New value (25h)
IR bit in TRBIC
register 0
Count source
Counter of 06h 05h 04h 03h 02h 01h 00h 01h 00h 01h 00h 01h 00h 01h
timer RB prescaler
After writing, the reload register is
written on the first underflow.
Reloads register of
timer RB Previous value New value (25h)
Reload on
underflow
IR bit in TRBIC
register 0
Only the prescaler values are updated,
extending the duration until timer RB underflow.
Figure 14.17 Operating Example of Timer RB when Counter Value is Rewritten during Count
Operation
Set to 1 by program
Count source
Timer RB prescaler
underflow signal
Counter of timer RB 01h 00h 02h 01h 00h 01h 00h 02h
Set to 0 by program
Waveform
output starts Waveform output inverted Waveform output starts
1
TRBO pin output
0
Primary period Secondary period Primary period
Initial output is the same level
as during secondary period.
Set to 1 by program
Count source
Timer RB prescaler
underflow signal
Count starts Timer RB primary reloads Count starts Timer RB primary reloads
IR bit in TRBIC 1
register 0
Set to 0 by program
TOPL bit in 1
TRBIOC register 0
Waveform output starts Waveform output ends Waveform output starts Waveform output ends
1
TRBIO pin output
0
Note the following points with regard to generating interrupt requests by trigger input from the INT0 pin.
• Processing to handle the interrupts is required. Refer to 12. Interrupts, for details.
• If one edge is selected, use the POL bit in the INT0IC register to select falling or rising edge. (The
INOSEG bit in the TRBIOC register does not affect INT0 interrupts).
• If a one-shot trigger occurs while the TOSSTF bit is set to 1, timer RB operation is not affected, but the
value of the IR bit in the INT0IC register changes.
www.DataSheet4U.com
Set to 1 by program
Count source
Timer RB prescaler
underflow signal
Count starts Timer RB secondary reloads Timer RB primary reloads
Counter of timer RB 01h 00h 04h 03h 02h 01h 00h 01h
Set to 0 by program
TOPL bit in 1
TRBIOC register 0
1
TRBIO pin output
0
NOTE:
1. Registers associated with timer RB: TRBCR, TRBOCR, TRBIOC, TRBMR, TRBPRE, TRBSC, and
TRBPR.
• If the TSTOP bit in the TRBCR register is set to 1 during timer operation, timer RB stops immediately.
• If 1 is written to the TOSST or TOSSP bit in the TRBOCR register, the value of the TOSSTF bit changes
after one or two cycles of the count source have elapsed. If the TOSSP bit is written to 1 during the period
between when the TOSST bit is written to 1 and when the TOSSTF bit is set to 1, the TOSSTF bit may be
set to either 0 or 1 depending on the content state. Likewise, if the TOSST bit is written to 1 during the
period between when the TOSSP bit is written to 1 and when the TOSSTF bit is set to 0, the TOSSTF bit
may be set to either 0 or 1.
(2) To change registers TRBPRE and TRBPR during count operation (TCSTF bit is set to 1), synchronize
the TRBO output cycle using a timer RB interrupt, etc. This operation should be preformed only once in
www.DataSheet4U.com
the same output cycle. Also, make sure that writing to the TRBPR register does not occur during period
A shown in Figures 14.24 and 14.25.
Period A
Count source/
prescaler
underflow signal
(b)
(a) Period between interrupt request generation and the completion of execution of an instruction. The length of time
varies depending on the instruction being executed.
The DIVX instruction requires the longest time, 30 cycles (assuming no wait states and that a register is set as
the divisor).
(b) 20 cycles. 21 cycles for address match and single-step interrupts.
Period A
Count source/
prescaler
www.DataSheet4U.com underflow signal
The TRBO output inversion Upon detecting (i), set the secondary and
is detected at the end of the then the primary register immediately.
secondary period.
Figure 14.25 Workaround Example (b) When TRBO Pin Output Value is Read
(3) To stop the timer counting in the primary period, use the TSTOP bit in the TRBCR register. In this case,
registers TRBPRE and TRBPR are initialized and their values are set to the values after reset.
(2) Do not set both the TRBPRE and TRBPR registers to 00h.
www.DataSheet4U.com
(3) Set registers TRBSC and TRBPR using the following procedure.
(a) To use “INT0 pin one-shot trigger enabled” as the count start condition
Set the TRBSC register and then the TRBPR register. At this time, after writing to the TRBPR
register, allow an interval of 0.5 or more cycles of the count source before trigger input from the
INT0 pin.
(b) To use “writing 1 to TOSST bit” as the start condition
Set the TRBSC register, the TRBPR register, and then TOSST bit. At this time, after writing to the
TRBPR register, allow an interval of 0.5 or more cycles of the count source before writing to the
TOSST bit.
14.3 Timer RD
Timer RD has 2 16-bit timers (channels 0 and 1). Each channel has 4 I/O pins.
The operation clock of timer RD is f1 or fOCO40M. Table 14.11 lists the Timer RD Operation Clocks.
In the input capture function, output compare function, and PWM mode, channels 0 and 1 have the equivalent
functions, and functions or modes can be selected individually for each pin. Also, a combination of these functions
and modes can be used in 1 channel.
In reset synchronous PWM mode, complementary PWM mode, and PWM3 mode, a waveform is output with a
combination of counters and registers in channels 0 and 1.
Channel i
TRDi register
TRDGRAi register
TRDOER2 register
TRDOCR register
i = 0 or 1
TCK2 to TCK0
f1
= 000b
= 001b
f2
= 010b
f4
= 011b Count source
f8 TRDi register
= 100b
f32
= 110b
fOCO40M
= 101b
CKEG1 to CKEG0
STCLK = 1
Valid edge
TRDCLK/ selected
TRDIOA0
STCLK = 0
Set the pulse width of the external clock which inputs to the TRDCLK pin to 3 cycles or above of the operation
clock of timer RD (refer to Table 14.11 Timer RD Operation Clocks).
When selecting fOCO40M for the count source, set the FRA00 bit in the FRA0 register to 1 (high-speed on-
chip oscillator on) before setting bits TCK2 to TCK0 in the TRDCRi register (i = 0 or 1) to 110b (fOCO40M).
TRDIOAi input
(input capture signal)
TRDIOAi input
Transfer
TRDGRAi register m n
Transfer
TRDGRCi register
m
(buffer)
i = 0 or 1
TRDGRAi register m n
Transfer
TRDGRCi register
n
(buffer)
TRDIOAi output
i = 0 or 1
Perform the following for the timer mode (input capture and output compare functions).
When using the TRDGRCi (i = 0 or 1) register as the buffer register of the TRDGRAi register
• Set the IOC3 bit in the TRDIORCi register to 1 (general register or buffer register).
• Set the IOC2 bit in the TRDIORCi register to the same value as the IOA2 bit in the TRDIORAi register.
When using the TRDGRDi register as the buffer register of the TRDGRBi register
• Set the IOD3 bit in the TRDIORDi register to 1 (general register or buffer register).
• Set the IOD2 bit in the TRDIORCi register to the same value as the IOB2 bit in the TRDIORAi register.
Bits IMFC and IMFD in the TRDSRi register are set to 1 at the input edge of the TRDIOCi pin when also using
registers TRDGRCi and TRDGRDi as the buffer register in the input capture function.
When also using registers TRDGRCi and TRDGRDi as buffer registers for the output compare function, reset
synchronous PWM mode, complementary PWM mode, and PWM3 mode, bits IMFC and IMFD in the TRDSRi
register are set to 1 by a compare match with the TRDi register.
TRDIOA0 input
n n is set
Value in
TRD1 register
n n is set
According to the selection of the POL bit in the INT0IC register and change of the INT0 pin input, the IR bit in
the INT0IC register is set to 1 (interrupt request). Refer to 12. Interrupts for details of interrupts.
EA0 bit
EA0 bit
D Q
writing value
INT0 input Timer RD
S TRDIOA0
output data
Port P2_1
www.DataSheet4U.com
output data
Port P2_1
input data
EC0 bit
EC0 bit
D Q
writing value
Timer RD
S
output data
TRDIOC0
Port P2_2
output data
Port P2_2
input data
ED0 bit
ED0 bit writing
D Q
value
Timer RD
S TRDIOD0
output data
Port P2_3
output data
Port P2_3
input data
EA1 bit
EA1 bit writing
D Q
value
Timer RD
S TRDIOA1
output data
Port P2_4
output data
Port P2_4
input data
EB1 bit
EB1 bit writing
D Q
value
Timer RD
S TRDIOB1
output data
Port P2_5
output data
Port P2_5
input data
EC1 bit
EC1 bit
D Q
writing value
Timer RD
S TRDIOC1
output data
Port P2_6
output data
Port P2_6
input data
ED1 bit
ED1 bit
D Q
writing value
Timer RD
S TRDIOD1
output data
Port P2_7
output data
Port P2_7
input data
www.DataSheet4U.com
Input capture
signal
TRDIOAi(3)
TRDGRAi
(Note 1) TRDi register
register
TRDGRCi
register
TRDIOCi
Input capture
signal
Input capture
signal
TRDIOBi
TRDGRBi
(Note 2) register
Divided fOCO128
fOCO
by 128
IOA3 = 0
Input capture
signal
TRDIOA0 IOA3 = 1
TRDGRDi
register
NOTE 3: The trigger input of the TRDGRA0 register
can select the TRDIOA0 pin input or
TRDIODi
Input capture fOCO128 signal.
signal
i = 0 or 1
NOTE 1: When the BFCi bit in the TRDMR register is set to 1 (the TRDGRCi register is used as the buffer register of the
TRDGRAi register).
NOTE 2: When the BFDi bit in the TRDMR register is set to 1 (the TRDGRDi register is used as the buffer register of the
TRDGRBi register).
TRD1 count operation select bit Set to 1 in the input capture function.
CSEL1 RW
CMD1 RW
www.DataSheet4U.com
Normal-phase output level select bit This bit is disabled in the input capture
(in reset synchronous PWM mode or function.
OLS0 complementary PWM mode) RW
Counter-phase output level select bit This bit is disabled in the input capture
(in reset synchronous PWM mode or function.
OLS1 complementary PWM mode) RW
A/D trigger enable bit This bit is disabled in the input capture
ADTRG (in complementary PWM mode) function. RW
A/D trigger edge select bit This bit is disabled in the input capture
ADEG (in complementary PWM mode) function. RW
function 0 0 : f32
DFCK0 0 1 : f8 RW
1 0 : f1
1 1 : Count source (clock selected by
bits TCK2 to TCK0 in the
DFCK1 TRDCRi register) RW
NOTES:
1. This setting is enabled w hen the STCLK bit in the TRDFCR register is set to 1 (external clock input enabled).
2. Bits CKEG1 to CKEG0 are enabled w hen bits TCK2 to TCK0 are set to 101b (TRDCLK input) and the STCLK bit in the
TRDFCR register is set to 1 (external clock input enabled).
3. This setting is enabled w hen the SYNC bit in the TRDMR register is set to 1 (registers TRD0 and TRD1 operate
synchronously).
TRDGRA mode select bit(1) Set to 1 (input capture) in the input capture
IOA2 RW
function.
Input capture input sw itch 0 : fOCO128 Signal
IOA3 RW
bit(3, 4) 1 : TRDIOA0 pin input
TRDGRB control bits b5 b4
0 0 : Input capture to the TRDGRBi register
IOB0 at the rising edge RW
0 1 : Input capture to the TRDGRBi register
at the falling edge
1 0 : Input capture to the TRDGRBi register
IOB1 at both edges RW
1 1 : Do not set.
TRDGRB mode select bit(2) Set to 1 (input capture) in the input capture
IOB2 RW
function.
— Nothing is assigned. If necessary, set to 0.
—
(b7) When read, the content is 1.
NOTES:
1. To select 1 (the TRDGRCi register is used as a buffer register of the TRDGRAi register) for this bit by the BFCi bit in
the TRDMR register, set the IOC2 bit in the TRDIORCi register to the same value as the IOA2 bit in the TRDIORAi
register.
2. To select 1 (the TRDGRDi register is used as a buffer register of the TRDGRBi register) for this bit by the BFDi bit in
the TRDMR register, set the IOD2 bit in the TRDIORCi register to the same value as the IOB2 bit in the TRDIORAi
register.
3. The IOA3 bit is enabled in the TRDIORA0 register only. Set to the IOA3 bit in TRDIORA1 to 1.
4. The IOA3 bit is enabled w hen the IOA2 bit is set to 1 (input capture function).
TRDGRC mode select bit(1) Set to 1 (input capture) in the input capture
IOC2 RW
function.
TRDGRC register function Set to 1 (general register or buffer register) in
IOC3 RW
select bit the input capture function.
TRDGRD control bits b5 b4
0 0 : Input capture to the TRDGRDi register
IOD0 at the rising edge RW
0 1 : Input capture to the TRDGRDi register
at the falling edge
1 0 : Input capture to the TRDGRDi register
IOD1 at both edges RW
1 1 : Do not set.
TRDGRD mode select bit(2) Set to 1 (input capture) in the input capture
IOD2 RW
function.
TRDGRD register function Set to 1 (general register or buffer register) in
IOD3 RW
select bit the input capture function.
NOTES:
1. To select 1 (the TRDGRCi register is used as a buffer register of the TRDGRAi register) for this bit by the BFCi bit in
the TRDMR register, set the IOC2 bit in the TRDIORCi register to the same value as the IOA2 bit in the TRDIORAi
register.
2. To select 1 (the TRDGRDi register is used as a buffer register of the TRDGRBi register) for this bit by the BFDi bit in
the TRDMR register, set the IOD2 bit in the TRDIORCi register to the same value as the IOB2 bit in the TRDIORAi
register.
TRDSR1 register:
Input edge of TRDIOA1 pin(3)
NOTE:
1. Access the TRDi register in 16-bit units. Do not access it in 8-bit units.
NOTE:
1. Access registers TRDGRAi to TRDGRDi in 16-bit units. Do not access them in 8-bit units.
Figure 14.43 Registers TRDGRAi, TRDGRBi, TRDGRCi, and TRDGRDi in Input Capture Function
The following registers are disabled in the input capture function: TRDOER1, TRDOER2, TRDOCR,
TRDPOCR0, and TRDPOCR1.
Set the pulse width of the input capture signal applied to the TRDIOji pin to 3 cycles or more of the timer RD
operation clock (refer to Table 14.11 Timer RD Operation Clocks) for no digital filter (the DFj bit in the
TRDDFi register set to 0).
TRDCLK input
count source
Count value
in TRDi register
FFFFh
0009h
www.DataSheet4U.com 0006h
0000h
TSTARTi bit in 1
TRDSTR register 0
65536
TRDIOAi input
Transfer Transfer
IMFA bit in 1
TRDSRi register 0
1 Set to 0 by a program
OVF bit in
TRDSRi register 0
i = 0 or 1
C C C C 1
Match
Edge detection
TRDIOji input signal D Q D Q D Q D Q detection
circuit
circuit
Latch Latch Latch Latch
0
Timer RD operation clock
f1, fOCO40M)
D Q
Latch
Sampling clock
Recognition of the
signal change with
Input signal through 3-time match
digital filtering
Transmission cannot be
performed without 3-time match
because the input signal is
assumed to be noise.
i = 0 or 1, j = either A, B, C, or D
Channel 0
www.DataSheet4U.com
TRD0
Channel 1
TRD1
Counter-phase output level select bit This bit is disabled in the output compare
(in reset synchronous PWM mode or function.
OLS1 complementary PWM mode) RW
A/D trigger enable bit This bit is disabled in the output compare
ADTRG RW
(in complementary PWM mode) function.
A/D trigger edge select bit This bit is disabled in the output compare
ADEG RW
(in complementary PWM mode) function.
External clock input select bit 0 : External clock input disabled
STCLK RW
1 : External clock input enabled
PWM3 mode select bit(2) Set this bit to 1 (other than PWM3 mode) in
PWM3 RW
the output compare function.
NOTES:
1. Set bits CMD1 to CMD0 w hen both the TSTART0 and TSTART1 bits are set to 0 (count stops).
2. When bits CMD1 to CMD0 are set to 00b (timer mode, PWM mode, or PWM3 mode), the setting of the PWM3 bit is
enabled.
NOTE:
1. Refer to 14.3.4 Pulse Output Forced Cutoff.
NOTES:
1. Write to the TRDOCR register w hen both the TSTART0 and TSTART1 bits in the TRDSTR register are set to 0 (count
stopped).
2. If the pin function is set for w aveform output (refer to Tables 14.12 to 14.19), the initial output level is output w hen
the TRDOCR register is set.
NOTES:
1. This setting is enabled w hen the STCLK bit in the TRDFCR register is set to 1 (external clock input enabled).
2. Bits CKEG1 to CKEG0 are enabled w hen bits TCK2 to TCK0 are set to 101b (TRDCLK input) and the STCLK bit in the
TRDFCR register is set to 1 (external clock input enabled).
3. This setting is enabled w hen the SYNC bit in the TRDMR register is set to 1 (TRD0 and TRD1 operate
synchronously).
TRDGRA mode select bit(1) Set to 0 (output compare) in the output compare
IOA2 RW
function.
Input capture input sw itch Set to 1.
IOA3 RW
bit
TRDGRB control bits b5 b4
0 0 : Disable pin output by the compare match
(TRDIOBi pin functions as programmable
IOB0 RW
I/O port)
0 1 : “L” output at compare match
w ith the TRDGRBi register
1 0 : “H” output at compare match
w ith the TRDGRBi
IOB1 1 1 : Toggle output by compare match RW
w ith the TRDGRBi register
TRDGRB mode select bit(2) Set to 0 (output compare) in the output compare
IOB2 RW
function.
— Nothing is assigned. If necessary, set to 0.
—
(b7) When read, the content is 1.
NOTES:
1. To select 1 (the TRDGRCi register is used as a buffer register of the TRDGRAi register) for this bit by the BFCi bit in
the TRDMR register, set the IOC2 bit in the TRDIORCi register to the same value as the IOA2 bit in the TRDIORAi
register.
2. To select 1 (the TRDGRDi register is used as a buffer register of the TRDGRBi register) for this bit by the BFDi bit in
the TRDMR register, set the IOD2 bit in the TRDIORCi register to the same value as the IOB2 bit in the TRDIORAi
register.
TRDGRC mode select bit(1) Set to 0 (output compare) in the output compare
IOC2 RW
function.
TRDGRC register function 0 : TRDIOA output register
select bit (Refer to 14.3.6.1 Changing Output Pins in
IOC3 Registers TRDGRCi (i = 0 or 1) and RW
TRDGRDi.)
1 : General register or buffer register
TRDGRD control bits b5 b4
0 0 : Disable pin output by compare match
IOD0 0 1 : “L” output at compare match w ith RW
the TRDGRDi register
1 0 : “H” output at compare match w ith
the TRDGRDi register
IOD1 1 1 : Toggle output by compare match RW
w ith the TRDGRDi register
TRDGRD mode select bit(2) Set to 0 (output compare) in the output compare
IOD2 RW
function.
TRDGRD register function 0 : TRDIOB output register
select bit (Refer to 14.3.6.1 Changing Output Pins in
IOD3 Registers TRDGRCi (i = 0 or 1) and RW
TRDGRDi.)
1 : General register or buffer register
NOTES:
1. To select 1 (the TRDGRCi register is used as a buffer register of the TRDGRAi register) for this bit by the BFCi bit in
the TRDMR register, set the IOC2 bit in the TRDIORCi register to the same value as the IOA2 bit in the TRDIORAi
register.
2. To select 1 (the TRDGRDi register is used as a buffer register of the TRDGRBi register) for this bit by the BFDi bit in
the TRDMR register, set the IOD2 bit in the TRDIORCi register to the same value as the IOB2 bit in the TRDIORAi
register.
NOTE:
1. Access the TRDi register in 16-bit units. Do not access it in 8-bit units.
NOTE:
1. Access registers TRDGRAi to TRDGRDi in 16-bit units. Do not access them in 8-bit units.
Figure 14.58 Registers TRDGRAi, TRDGRBi, TRDGRCi, and TRDGRDi in Output Compare Function
The following registers are disabled in the output compare function: TRDDF0, TRDDF1, TRDPOCR0, and
TRDPOCR1.
Count source
www.DataSheet4U.com p
Count
restarts
Count
stops
TSTARTi bit in 1
TRDSTR register 0
m+1 m+1
Output level
held
TRDIOAi output
Output inverted by compare match
Set to 0 by a program
n+1
TRDIOBi output
“H” output by compare match
n+1 Output level
held
Initial output “L”
IMFB bit in 1
TRDSRi register 0
Set to 0 by a program
P+1 Output level
held
“L” output by compare match
TRDIOCi output
Initial output “H”
IMFC bit in 1
TRDSRi register 0
Set to 0 by a program
Channel 0
TRD0
Channel 1
TRD1
Count source
FFFFh
m
www.DataSheet4U.com p
0000h
m+1
n+1 m-n
p+1
q+1 p-q
IMFA bit in 1
TRDSRi register 0
IMFC bit in 1
TRDSRi register 0
IMFB bit in 1
TRDSRi register 0
Figure 14.61 Operating Example When TRDGRCi Register is Used for Output Control of TRDIOAi
Pin and TRDGRDi Register is Used for Output Control of TRDIOBi Pin
www.DataSheet4U.com
TRDi
Comparator TRDGRDi
i = 0 or 1
NOTES:
1. When the BFCi bit in the TRDMR register is set to 1 (the TRDGRCi register is used as the
buffer register of the TRDGRAi register).
2. When the BFDi bit in the TRDMR register is set to 1 (the TRDGRDi register is used as the
buffer register of the TRDGRBi register).
Count start condition 1 (count starts) is written to the TSTARTi bit in the TRDSTR register.
Count stop conditions • 0 (count stops) is written to the TSTARTi bit in the TRDSTR register
when the CSELi bit in the TRDSTR register is set to 1.
The PWM output pin holds output level before the count stops.
• When the CSELi bit in the TRDSTR register is set to 0, the count
stops at the compare match in the TRDGRAi register.
The PWM output pin holds level after output change by compare
match.
Interrupt request generation • Compare match (The content of the TRDi register matches content of
timing the TRDGRhi register.)
• TRDi register overflows
TRDIOA0 pin function Programmable I/O port or TRDCLK (external clock) input
TRDIOA1 pin function Programmable I/O port
TRDIOB0, TRDIOC0, TRDIOD0, Programmable I/O port or pulse output (selectable by pin)
TRDIOB1, TRDIOC1, TRDIOD1
pin functions
INT0 pin function Programmable I/O port, pulse output forced cutoff signal input, or INT0
interrupt input
Read from timer The count value can be read by reading the TRDi register.
Write to timer The value can be written to the TRDi register.
Select functions • 1 to 3 PWM output pins selected per 1 channel
Either 1 pin or multiple pins of the TRDIOBi, TRDIOCi or TRDIODi
pin.
• The active level selected by pin.
• Initial output level selected by pin.
• Synchronous operation (Refer to 14.3.3 Synchronous Operation.)
• Buffer operation (Refer to 14.3.2 Buffer Operation.)
• Pulse output forced cutoff signal input (Refer to 14.3.4 Pulse Output
Forced Cutoff.)
i = 0 or 1
j = either B, C, or D
h = either A, B, C, or D
CMD1 RW
www.DataSheet4U.com
Normal-phase output level select Bit This bit is disabled in PWM mode.
(in reset synchronous PWM mode or
OLS0 complementary PWM mode) RW
Counter-phase output level select bit This bit is disabled in PWM mode.
(in reset synchronous PWM mode or
OLS1 complementary PWM mode) RW
NOTE:
1. Refer to 14.3.4 Pulse Output Forced Cutoff.
CCLR0 TRDi counter clear select bits Set to 001b (the TRDi register cleared at RW
CCLR1 compare match w ith TRDGRAi register) in PWM RW
CCLR2 mode. RW
NOTES:
1. This setting is enabled w hen the STCLK bit in the TRDFCR register is set to 1 (external clock input enabled).
2. Bits CKEG1 to CKEG0 are enabled w hen bits TCK2 to TCK0 are set to 101b (TRDCLK input) and the STCLK bit in the
TRDFCR register is set to 1 (external clock input enabled).
NOTE:
1. Access the TRDi register in 16-bit units. Do not access it in 8-bit units.
NOTE:
1. Access registers TRDGRAi to TRDGRDi in 16-bit units. Do not access them in 8-bit units.
Figure 14.72 Registers TRDGRAi, TRDGRBi, TRDGRCi, and TRDGRDi in PWM Mode
The following registers are disabled in the PWM mode: TRDDF0, TRDDF1, TRDIORA0, TRDIORC0,
TRDIORA1, and TRDIORC1.
Count source
p
www.DataSheet4U.com
m+1
n+1 m-n
IMFC bit in 1
TRDSRi register 0
p
m
q
n
0000h
www.DataSheet4U.com
TSTARTi bit in 1
TRDSTR register Since no compare match in the TRDGRBi register is
0
generated, “L” is not applied to the TRDIOBi output
Rewrite by a program
IMFA bit in 1
TRDSRi register
0
Set to 0 by a program
Set to 0 by a program
IMFB bit in 1
TRDSRi register
0
p
n
0000h
TSTARTi bit in 1
When compare matches with registers TRDGRAi and TRDGRBi are generated
TRDSTR register simultaneously, the compare match with the TRDGRBi register has priority.
0
“L” is applied to the TRDIOBi output without any change.
TRDGRBi register n m p
Rewrite by a program
IMFA bit in 1
TRDSRi register
0
Set to 0 by a program Set to 0 by a program
IMFB bit in 1
TRDSRi register
0
Figure 14.74 Operating Example of PWM Mode (Duty 0%, Duty 100%)
TRDGRC0 TRDGRA0
Period TRDIOC0
register register
Normal-phase
TRDIOB0
TRDGRD0 TRDGRB0 PWM1 Counter-phase
register register TRDIOD0
Normal-phase
TRDGRC1 TRDGRA1 TRDIOA1
PWM2 Counter-phase
register register TRDIOC1
Normal-phase
TRDGRD1 TRDGRB1 TRDIOB1
PWM3 Counter-phase
register register TRDIOD1
NOTE:
1. When bits BFC0, BFD0, BFC1, and BFD1 in the TRDMR register are set to 1 (buffer register).
Normal-phase
m-n
Counter-phase
Count start condition 1 (count starts) is written to the TSTART0 bit in the TRDSTR register.
Count stop conditions • 0 (count stops) is written to the TSTART0 bit in the TRDSTR register
when the CSEL0 bit in the TRDSTR register is set to 1.
The PWM output pin holds output level before the count stops
• When the CSEL0 bit in the TRDSTR register is set to 0, the count
stops at the compare match in the TRDGRA0 register.
The PWM output pin holds level after output change at compare
match.
Interrupt request generation • Compare match (the content of the TRD0 register matches content
timing of registers TRDGRj0, TRDGRA1, and TRDGRB1).
• The TRD0 register overflows
TRDIOA0 pin function Programmable I/O port or TRDCLK (external clock) input
TRDIOB0 pin function PWM1 output normal-phase output
TRDIOD0 pin function PWM1 output counter-phase output
TRDIOA1 pin function PWM2 output normal-phase output
TRDIOC1 pin function PWM2 output counter-phase output
TRDIOB1 pin function PWM3 output normal-phase output
TRDIOD1 pin function PWM3 output counter-phase output
TRDIOC0 pin function Output inverted every PWM period
INT0 pin function Programmable I/O port, pulse output forced cutoff signal input, or
INT0 interrupt input
Read from timer The count value can be read by reading the TRD0 register.
Write to timer The value can be written to the TRD0 register.
Select functions • The active level of normal-phase and counter-phase and initial
output level selected individually.
• Buffer operation (Refer to 14.3.2 Buffer Operation.)
• Pulse output forced cutoff signal input (Refer to 14.3.4 Pulse
Output Forced Cutoff.)
j = either A, B, C, or D
Figure 14.76 Registers TRDSTR and TRDMR in Reset Synchronous PWM Mode
CMD1 RW
www.DataSheet4U.com
Normal-phase output level select bit 0 : Initial output “H”
(in reset synchronous PWM mode or Active level “L”
OLS0 complementary PWM mode) 1 : Initial output “L” RW
Active level “H”
NOTE:
1. Refer to 14.3.4 Pulse Output Forced Cutoff.
CCLR0 TRD0 counter clear select bits Set to 001b (TRD0 register cleared at compare RW
CCLR1 match w ith TRDGRA0 register) in reset RW
CCLR2 synchronous PWM mode. RW
NOTES:
1. This setting is enabled w hen the STCLK bit in the TRDFCR register is set to 1 (external clock input enabled).
2. Bits CKEG1 to CKEG0 are enabled w hen bits TCK2 to TCK0 are set to 101b (TRDCLK input) and the STCLK bit in the
TRDFCR register is set to 1 (external clock input enabled).
3. The TRDCR1 register is not used in reset synchronous PWM mode.
NOTES:
1. Access the TRD0 register in 16-bit units. Do not access it in 8-bit units.
2. The TRD1 register is not used in reset synchronous PWM mode.
Function RW
Refer to Table 14.30 TRDGRji Register Functions in Reset Synchronous PWM Mode.
RW
NOTE:
1. Access registers TRDGRAi to TRDGRDi in 16-bit units. Do not access them in 8-bit units.
Figure 14.83 Registers TRDGRAi, TRDGRBi, TRDGRCi, and TRDGRDi in Reset Synchronous PWM Mode
The following registers are disabled in the reset synchronous PWM mode: TRDPMR, TRDOCR, TRDDF0,
TRDDF1, TRDIORA0, TRDIORC0, TRDPOCR0, TRDIORA1, TRDIORC1, and TRDPOCR1.
Count source
www.DataSheet4U.com
q
0000h
TSTARTi bit in 1
TRDSTR register 0 m+1
m-n
TRDIOB0 output
n+1
TRDIOD0 output
m-p
TRDIOA1 output
p+1
TRDIOC1 output
m-q
TRDIOB1 output
Initial output “H”
q+1 Active level “L”
TRDIOD1 output
TRDIOC0 output
Initial output “H”
IMFA bit in 1
TRDSR0 register 0
IMFA bit in 1
TRDSR1 register 0
Transfer from the buffer register to the Transfer from the buffer register to the
general register during buffer operation general register during buffer operation
TRDGRA0
Period TRDIOC0
register
Normal-phase
TRDIOB0
TRDGRD0 TRDGRB0 PWM1
register register Counter-phase
TRDIOD0
Normal-phase
TRDGRC1 TRDGRA1 TRDIOA1
PWM2 Counter-phase
register register TRDIOC1
Normal-phase
TRDGRD1 TRDGRB1 TRDIOB1
PWM3 Counter-phase
register register TRDIOD1
Normal-phase
Counter-phase
Count start condition 1 (count starts) is written to bits TSTART0 and TSTART1 in the TRDSTR register.
Count stop conditions 0 (count stops) is written to bits TSTART0 and TSTART1 in the TRDSTR register
when the CSEL0 bit in the TRDSTR register is set to 1.
(The PWM output pin holds output level before the count stops.)
Interrupt request generation • Compare match (The content of the TRDi register matches content of the TRDGRji
timing register.)
• The TRD1 register underflows
TRDIOA0 pin function Programmable I/O port or TRDCLK (external clock) input
TRDIOB0 pin function PWM1 output normal-phase output
TRDIOD0 pin function PWM1 output counter-phase output
TRDIOA1 pin function PWM2 output normal-phase output
TRDIOC1 pin function PWM2 output counter-phase output
TRDIOB1 pin function PWM3 output normal-phase output
TRDIOD1 pin function PWM3 output counter-phase output
TRDIOC0 pin function Output inverted every 1/2 period of PWM
INT0 pin function Programmable I/O port, pulse output forced cutoff signal input or INT0 interrupt input
Read from timer The count value can be read by reading the TRDi register.
Write to timer The value can be written to the TRDi register.
Select functions • Pulse output forced cutoff signal input (Refer to 14.3.4 Pulse Output Forced
Cutoff.)
• The active level of normal-phase and counter-phase and initial output level
selected individually
• Transfer timing from the buffer register selected
• A/D trigger generated
i = 0 or 1, j = either A, B, C, or D
NOTE:
1. After a count starts, the PWM period is fixed.
www.DataSheet4U.com
— Nothing is assigned. If necessary, set to 0.
—
(b3-b1) When read, the content is 1.
TRDGRC0 register function select bit Set this bit to 0 (general register) in
BFC0 complementary PWM mode. RW
www.DataSheet4U.com
TRDIOB0 output disable bit 0 : Enable output
EB0 1 : Disable output (The TRDIOB0 pin is RW
used as a programmable I/O port.)
TRDIOC0 output disable bit 0 : Enable output
EC0 1 : Disable output (The TRDIOC0 pin is RW
used as a programmable I/O port.)
TRDIOD0 output disable bit 0 : Enable output
ED0 1 : Disable output (The TRDIOD0 pin is RW
used as a programmable I/O port.)
TRDIOA1 output disable bit 0 : Enable output
EA1 1 : Disable output (The TRDIOA1 pin is RW
used as a programmable I/O port.)
TRDIOB1 output disable bit 0 : Enable output
EB1 1 : Disable output (The TRDIOB1 pin is RW
used as a programmable I/O port.)
TRDIOC1 output disable bit 0 : Enable output
EC1 1 : Disable output (The TRDIOC1 pin is RW
used as a programmable I/O port.)
TRDIOD1 output disable bit 0 : Enable output
ED1 1 : Disable output (The TRDIOD1 pin is RW
used as a programmable I/O port.)
NOTE:
1. Refer to 14.3.4 Pulse Output Forced Cutoff.
TRDi counter clear select bits Set to 000b (disable clearing (free-running
CCLR0 RW
operation)) in complementary PWM mode.
CCLR1 RW
CCLR2 RW
NOTES:
1. This setting is enabled w hen the STCLK bit in the TRDFCR register is set to 1 (external clock input enabled).
2. Set bits TCK2 to TCK0 and bits CKEG1 to CKEG0 in registers TRDCR0 and TRDCR1 to the same values.
3. Bits CKEG1 to CKEG0 are enabled w hen bits TCK2 to TCK0 are set to 101b (TRDCLK input) and the STCLK bit in the
TRDFCR register is set to 1 (external clock input enabled).
www.DataSheet4U.com
NOTE:
1. Access the TRD0 register in 16-bit units. Do not access it in 8-bit units.
NOTE:
1. Access the TRD1 register in 16-bit units. Do not access it in 8-bit units.
NOTES:
1. Access registers TRDGRAi to TRDGRDi in 16-bit units. Do not access them in 8-bit units.
2. The TRDGRC0 register is not used in complementary PWM mode.
Figure 14.94 Registers TRDGRAi, TRDGRBi, TRDGRC1, and TRDGRDi in Complementary PWM Mode
The following registers are disabled in the complementary PWM mode: TRDPMR, TRDOCR, TRDDF0,
TRDDF1, TRDIORA0, TRDIORC0, TRDPOCR0, TRDIORA1, TRDIORC1, and TRDPOCR1.
Since values cannot be written to the TRDGRB0, TRDGRA1, or TRDGRB1 register directly after count
operation starts (prohibited item), use the TRDGRD0, TRDGRC1, or TRDGRD1 register as a buffer register.
However, to write data to the TRDGRD0, TRDGRC1, or TRDGRD1 register, set bits BFD0, BFC1, and BFD1
to 0 (general register). After this, bits BFD0, BFC1, and BFD1 may be set to 1 (buffer register).
Value in TRDGRB0
register
Value in TRDGRA1
register
www.DataSheet4U.com
Value in TRDGRB1
register
0000h
TRDIOB0 output
TRDIOD0 output
TRDIOA1 output
TRDIOC1 output
TRDIOB1 output
TRDIOD1 output
TRDIOC0 output
i = 0 or 1
Count source
m+1
m
n
Value in TRD1 register
www.DataSheet4U.com
0000h
Set to
FFFFh
TRDIOB0 output
Initial output “H”
TRDIOC0 output
Initial output “H”
m+2-p
n+1 m-p-n+1
n+1-p p p n+1-p
TRDGRB0 register n n
Transfer (when bits CMD1 to CMD0 are set to 11b) Transfer (when bits CMD1 to CMD0
are set to 10b)
Buffer
Compare match signal
Output
TRDIOB0 Compare match signal
control
TRDIOA0 output
m-n
TRDIOB0 output
p-q
(When “H” is selected as the active level)
Count start condition 1 (count starts) is written to the TSTART0 bit in the TRDSTR register.
Count stop conditions • 0 (count stops) is written to the TSTART0 bit in the TRDSTR register
when the CSEL0 bit in the TRDSTR register is set to 1.
The PWM output pin holds output level before the count stops
• When the CSEL0 bit in the TRDSTR register is set to 0, the count
stops at the compare match with the TRDGRA0 register.
The PWM output pin holds level after output change by compare
match.
Interrupt request generation • Compare match (The content of the TRDi register matches content
timing of the TRDGRji register.)
• The TRD0 register overflows
TRDIOA0, TRDIOB0 pin PWM output
functions
TRDIOC0, TRDIOD0, TRDIOA1 Programmable I/O port
to TRDIOD1 pin functions
INT0 pin function Programmable I/O port, pulse output forced cutoff signal input, or
INT0 interrupt input
Read from timer The count value can be read by reading the TRD0 register.
Write to timer The value can be written to the TRD0 register.
Select functions • Pulse output forced cutoff signal input (Refer to 14.3.4 Pulse
Output Forced Cutoff.)
• Buffer Operation (Refer to 14.3.2 Buffer Operation.)
• Active level selectable by pin
i = 0 or 1, j = either A, B, C, or D
CMD1 RW
www.DataSheet4U.com
Normal-phase output level select bit This bit is disabled in PWM3 mode.
(enabled in reset synchronous PWM
OLS0 mode or complementary PWM mode) RW
Counter-phase output level select bit This bit is disabled in PWM3 mode.
(enabled in reset synchronous PWM
OLS1 mode or complementary PWM mode) RW
A/D trigger edge select bit This bit is disabled in PWM3 mode.
ADEG (enabled in complementary PWM mode) RW
External clock input select bit Set this bit to 0 (external clock input
STCLK RW
disabled) in PWM3 mode.
PWM3 mode select bit(2) Set this bit to 0 (PWM3 mode) in PWM3
PWM3 RW
mode.
NOTES:
1. Set bits CMD1 to CMD0 w hen both the TSTART0 and TSTART1 bits are set to 0 (count stops).
2. When bits CMD1 to CMD0 are set to 00b (timer mode, PWM mode, or PWM3 mode), the setting of the PWM3 bit is
enabled.
NOTE:
1. Refer to 14.3.4 Pulse Output Forced Cutoff.
TRDIOC0 initial output level These bits are disabled in PWM3 mode.
TOC0 RW
select bit
TRDIOD0 initial output level
TOD0 RW
select bit
TRDIOA1 initial output level
TOA1 RW
select bit
TRDIOB1 initial output level
TOB1 RW
select bit
TRDIOC1 initial output level
TOC1 RW
select bit
TRDIOD1 initial output level
TOD1 RW
select bit
NOTES:
1. Write to the TRDOCR register w hen both bits TSTART0 and TSTART1 in the TRDSTR register are set to 0 (count
2. If the pin function is set for w aveform output (refer to Tables 14.12 and 14.13), the initial output level is output w hen
the TRDOCR register is set.
CKEG0 External clock edge select bits (1) These bits are disabled in PWM3 mode. RW
CKEG1 RW
CCLR0 TRD0 counter clear select bits Set to 001b (the TRD0 register cleared at RW
CCLR1 compare match w ith TRDGRA0 register) in RW
CCLR2 PWM3 mode. RW
NOTES:
1. Bits CKEG1 to CKEG0 are enabled w hen bits TCK2 to TCK0 are set to 101b (TRDCLK input) and the STCLK bit in the
TRDFCR register is set to 1 (external clock input enabled).
2. The TRDCR1 register is not used in PWM3 mode.
NOTES:
1. Access the TRD0 register in 16-bit units. Do not access it in 8-bit units.
2. The TRD1 register is not used in PWM3 mode.
NOTE:
1. Access registers TRDGRAi to TRDGRDi in 16-bit units. Do not access them in 8-bit units.
Figure 14.106 Registers TRDGRAi, TRDGRBi, TRDGRCi, and TRDGRDi in PWM3 Mode
The following registers are disabled in the PWM3 mode function: TRDPMR, TRDDF0, TRDDF1,
TRDIORA0, TRDIORC0, TRDPOCR0, TRDIORA1, TRDIORC1, and TRDPOCR1.
Registers TRDGRC0, TRDGRC1, TRDGRD0, and TRDGRD1 are not used in PWM3 mode. To use them as
buffer registers, set bits BFC0, BFC1, BFD0, and BFD1 to 0 (general register) and write a value to the
TRDGRC0, TRDGRC1, TRDGRD0, or TRDGRD1 register. After this, bits BFC0, BFC1, BFD0, and BFD1
may be set to 1 (buffer register).
Count source
FFFFh
m
www.DataSheet4U.com
q
0000h
TSTART0 bit in 1
TRDSTR register 0
Count stop
Set to 0 by a program
CSEL0 bit in 1
TRDSTR register 0
m+1
n+1 m-n
p+1
q+1 p-q
IMFA bit in 1
TRDSR0 register 0
IMFB bit in 1
TRDSR0 register 0
TRDGRA0 register m m
Transfer Transfer
Channel i
IMFA bit
Timer RD interrupt request
IMIEA bit
(IR bit in TRDiIC register)
IMFB bit
IMIEB bit
IMFC bit
IMIEC bit
IMFD bit
IMIED bit
UDF bit
OVF bit
OVIE bit
i = 0 or 1
IMFA, IMFB, IMFC, IMFD, OVF, UDF: Bits in TRDSRi register
IMIEA, IMIEB, IMIEC, IMIED, OVIE: Bits in TRDIER register
As with other maskable interrupts, the timer RD interrupt is controlled by the combination of the I flag, IR bit,
bits ILVL0 to ILVL2, and IPL. However, since the interrupt source (timer RD interrupt) is generated by a
combination of multiple interrupt request sources, the following differences from other maskable interrupts
apply:
• When bits in the TRDSRi register corresponding to bits set to 1 in the TRDIERi register are set to 1 (enable
interrupt), the IR bit in the TRDiIC register is set to 1 (interrupt requested).
• When either bits in the TRDSRi register or bits in the TRDIERi register corresponding to bits in the
TRDSRi register, or both of them, are set to 0, the IR bit is set to 0 (interrupt not requested). Therefore,
even though the interrupt is not acknowledged after the IR bit is set to 1, the interrupt request will not be
maintained.
• When the conditions of other request sources are met, the IR bit remains 1.
• When multiple bits in the TRDIERi register are set to 1, which request source causes an interrupt is
determined by the TRDSRi register.
• Since each bit in the TRDSRi register is not automatically set to 0 even if the interrupt is acknowledged, set
each bit to 0 in the interrupt routine. For information on how to set these bits to 0, refer to the descriptions
of the registers used in the different modes (Figures 14.40, 14.55, 14.68, 14.80, 14.91, and 14.103).
Refer to Registers TRDSR0 to TRDSR1 in each mode (Figures 14.40, 14.55, 14.68, 14.80, 14.91, and
14.103) for the TRDSRi register. Refer to Registers TRDIER0 to TRDIER1 in each mode (Figures 14.41,
14.56, 14.69, 14.81, 14.92, and 14.104) for the TRDIERi register.
Refer to 12.1.6 Interrupt Control for information on the TRDiIC register and 12.1.5.2 Relocatable Vector
Tables for the interrupt vectors.
www.DataSheet4U.com
• When the CSELi (i = 0 to 1) is set to 0 (the count stops at compare match of registers TRDi and
TRDGRAi), the count does not stop and the TSTARTi bit remains unchanged even if 0 (count stops) is
written to the TSTARTi bit.
• Therefore, set the TSTARTi bit to 0 to change other bits without changing the TSTARTi bit when the
CSELi bit is se to 0.
• To stop counting by a program, set the TSTARTi bit after setting the CSELi bit to 1. Although the CSELi
www.DataSheet4U.com bit is set to 1 and the TSTARTi bit is set to 0 at the same time (with 1 instruction), the count cannot be
stopped.
• Table 14.36 lists the TRDIOji (j = A, B, C, or D) Pin Output Level when Count Stops to use the TRDIOji
(j = A, B, C, or D) pin with the timer RD output.
• When writing the value to the TRDi register and continuously reading the same register, the value before
writing may be read. In this case, execute the JMP.B instruction between the writing and reading.
Program example MOV.W #XXXXh, TRD0 ;Writing
JMP.B L1 ;JMP.B
L1: MOV.W TRD0,DATA ;Reading
• When changing the count source from fOCO40M to another source and stopping fOCO40M, wait 2 cycles
of f1 or more after setting the clock switch, and then stop fOCO40M.
Change procedure
(1) Set the TSTARTi (i = 0 or 1) bit in the TRDSTR register to 0 (count stops).
(2) Change bits TCK2 to TCK0 in the TRDCRi register.
www.DataSheet4U.com
(3) Wait 2 or more cycles of f1.
(4) Set the FRA00 bit in the FRA0 register to 0 (high-speed on-chip oscillator stops).
• If the value in the TRDGRA0 register is assumed to be m, the TRD0 register counts m-1, m, m+1, m, m-1,
in that order, when changing from increment to decrement operation.
When changing from m to m+1, the IMFA bit is set to 1. Also, bits CMD1 to CMD0 in the TRDFCR
register are set to 11b (complementary PWM mode, buffer data transferred at compare match between
registers TRD0 and TRDGRA0), the content in the buffer registers (TRDGRD0, TRDGRC1, and
TRDGRD1) is transferred to the general registers (TRDGRB0, TRDGRA1, and TRDGRB1).
During m+1, m, and m-1 operation, the IMFA bit remains unchanged and data are not transferred to
registers such as the TRDGRA0 register.
m+1
Setting value in
TRDGRA0
register m
Set to 0 by a program
1 No change
IMFA bit in
TRDSR0 register 0
Transferred from
Not transferred from buffer register
buffer register
When bits CMD1 to CMD0 in the
TRDGRB0 register
TRDFCR register are set to 11b
TRDGRA1 register
(transfer from the buffer register to the
TRDGRB1 register
general register at compare match of
between registers TRD0 and
TRDGRA0).
Figure 14.109 Operation at Compare Match between Registers TRD0 and TRDGRA0 in
Complementary PWM Mode
• The TRD1 register counts 1, 0, FFFFh, 0, 1, in that order, when changing from decrement to increment
operation.
The UDF bit is set to 1 when changing between 1, 0, and FFFFh operation. Also, when bits CMD1 to
CMD0 in the TRDFCR register are set to 10b (complementary PWM mode, buffer data transferred at
underflow in the TRD1 register), the content in the buffer registers (TRDGRD0, TRDGRC1, and
TRDGRD1) is transferred to the general registers (TRDGRB0, TRDGRA1, and TRDGRB1). During
FFFFh, 0, 1 operation, data are not transferred to registers such as the TRDGRB0 register. Also, at this
time, the OVF bit remains unchanged.
FFFFh
Set to 0 by a program
UDF bit in 1
TRDSR0 register 0
1 No change
OVF bit in
TRDSR0 register 0
Figure 14.110 Operation when TRD1 Register Underflows in Complementary PWM Mode
• Select with bits CMD1 to CMD0 the timing of data transfer from the buffer register to the general register.
However, transfer takes place with the following timing in spite of the value of bits CMD1 to CMD0 in the
following cases:
www.DataSheet4U.com
n3
m+1
Count value in TRD0
n2 register
n1
Count value in TRD1
0000h register
TRDGRD0 register n2 n3 n2 n1
TRDGRB0 register n1 n2 n3 n2 n1
Transfer with timing set by Transfer at Transfer at Transfer with timing set by
bits CMD1 to CMD0 underflow of TRD1 underflow of TRD1 bits CMD1 to CMD0
register because of register because
n3 > m of first setting to
n2 < m
TRDIOB0 output
TRDIOD0 output
Figure 14.111 Operation when Value in Buffer Register ≥ Value in TRDGRA0 Register in
Complementary PWM Mode
m+1
n1
www.DataSheet4U.com
Count value in TRD1 register
0000h
TRDIOB0 output
TRDIOD0 output
Figure 14.112 Operation when Value in Buffer Register Is Set to 0000h in Complementary PWM
Mode
14.4 Timer RE
Timer RE has the 4-bit counter and 8-bit counter. Timer RE has the following 2 modes:
• Real-time clock mode Generate 1-second signal from fC4 and count seconds, minutes, hours, and days of
the week.
• Output compare mode Count a count source and detect compare matches.
The count source for timer RE is the operating clock that regulates the timing of timer operations.
www.DataSheet4U.com
(1/16) (1/256)
www.DataSheet4U.com (1s)
fC4 1/2 4-bit counter 8-bit counter Overflow
Data bus
H12_H24 PM WKIE
bit bit
Timing Timer RE
DYIE control interrupt
HRIE
INT
MNIE bit
SEIE
BSY
bit
WK0 0 0 0 : Sunday RW
0 0 1 : Monday
0 1 0 : Tuesday
0 1 1 : Wednesday
WK1 RW
1 0 0 : Thursday
1 0 1 : Friday
1 1 0 : Saturday
WK2 1 1 1 : Do not set. RW
Timer RE reset bit When setting this bit to 0, after setting it to 1, the
follow ings w ill occur.
• Registers TRESEC, TREMIN, TREHR, TREWK,
and TRECR2 are set to 00h.
TRERST • Bits TCSTF, INT, PM, H12_H24, and TSTART RW
in the TRECR1 register are set to 0.
• The 8-bit counter is set to 00h and
the 4-bit counter is set to 0h.
Noon
H12_H24 bit = 1
(24-hour mode)
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
Contents of
TREHR Register H12_H24 bit = 0
(12-hour mode)
0 1 2 3 4 5 6 7 8 9 10 11 0 1 2 3 4 5
H12_H24 bit = 1
(24-hour mode)
18 19 20 21 22 23 0 1 2 3 ⋅⋅⋅
Contents of
TREHR Register H12_H24 bit = 0
(12-hour mode)
6 7 8 9 10 11 0 1 2 3 ⋅⋅⋅
RCS1 RW
www.DataSheet4U.com
4-bit counter select bit Set to 0 in real-time clock mode.
RCS2 RW
RCS5 0 0 : f2 RW
0 1 : f4
1 0 : f8
1 1 : Do not set.
RCS6 RW
1s
Approx. Approx.
62.5 ms 62.5 ms
BSY bit
1
PM bit in
(Not changed)
TRECR1 register
0
f4
RCS6 to RCS5
f8
= 00b TOENA bit
RCS1 to RCS0 f2
= 00b = 01b
www.DataSheet4U.com
= 10b TREO pin
= 01b RCS2 = 1
4-bit
= 10b 1/2 = 11b
f32 counter 8-bit T Q
= 11b counter
fC4 R
RCS2 = 0 Reset
TRERST bit
Match
Comparison signal
circuit Timer RE interrupt
COMIE bit
Data bus
www.DataSheet4U.com
Figure 14.124 TRESEC Register in Output Compare Mode
Timer RE reset bit When setting this bit to 0, after setting it to 1, the
follow ing w ill occur.
• Registers TRESEC, TREMIN, TREHR, TREWK,
and TRECR2 are set to 00h.
TRERST • Bits TCSTF, INT, PM, H12_H24, and TSTART RW
in the TRECR1 register are set to 0.
• The 8-bit counter is set to 00h and
the 4-bit counter is set to 0h.
RCS0 0 0 : f4 RW
0 1 : f8
1 0 : f32
www.DataSheet4U.com 1 1 : fC4
RCS1 RW
RCS5 0 0 : f2 RW
0 1 : f4
1 0 : f8
1 1 : Compare output
RCS6 RW
Count starts
Matched
(hexadecimal number)
8-bit counter content
Matched Matched
TREMIN register
setting value
00h
Time
Set to 1 by a program
TSTART bit in 1
TRECR1 register
www.DataSheet4U.com 0
2 cycles of maximum count source
TCSTF bit in 1
TRECR1 register 0
Set to 0 by acknowledgement of interrupt request or a program
IR bit in 1
TREIC register 0
TREO output 1
0
NOTE:
1. Registers associated with timer RE: TRESEC, TREMIN, TREHR, TREWK, TRECR1, TRECR2, and
TRECSR.
Also, set all above-mentioned registers and bits (immediately before timer RE count starts) before setting the
TRECR2 register.
Figure 14.130 shows a Setting Example in Real-Time Clock Mode.
TSTART in TRECR1 = 0
www.DataSheet4U.com
TREIC←00h
(disable timer RE interrupt)
TRERST in TRECR1 = 1
Timer RE register
and control circuit reset
TRERST in TRECR1 = 0
TSTART in TRECR1 = 1
TCSTF in TRECR1 = 1?
• Using an interrupt
Read necessary contents of registers TRESEC, TREMIN, TREHR, and TREWK and the PM bit in the
TRECR1 register in the timer RE interrupt routine.
www.DataSheet4U.com
• Monitoring with a program 1
Monitor the IR bit in the TREIC register with a program and read necessary contents of registers TRESEC,
TREMIN, TREHR, and TREWK and the PM bit in the TRECR1 register after the IR bit in the TREIC
register is set to 1 (timer RE interrupt request generated).
(UART0)
RXD0 TXD0
www.DataSheet4U.com UART reception Receive
1/16 clock
CLK1 to CLK0 = 00b CKDIR = 0 Clock Reception control
Internal circuit Transmit/
f1 synchronous type
= 01b U0BRG register
receive
f8 UART transmission Transmit unit
= 10b 1/(n0+1) 1/16
f32 Transmission clock
Clock control circuit
External synchronous type
CKDIR = 1
1/2 CKDIR = 0
Clock synchronous type
(when internal clock is selected)
Clock synchronous type
(when external clock is selected) CKDIR = 1
Clock synchronous type
(when internal clock is selected)
CLK
polarity
CLK0 switch
circuit
TXD1EN
(UART1)
RXD1 TXD1
UART reception Receive
1/16 clock
CLK1 to CLK0 = 00b CKDIR = 0 Clock Reception control
Internal circuit Transmit/
f1 synchronous type
= 01b U1BRG register
receive
f8 Transmit
= 10b UART transmission unit
f32 1/(n0+1) 1/16 clock
Transmission
Clock control circuit
External synchronous type
CKDIR = 1
1/2 CKDIR = 0
Clock synchronous type
(when internal clock is selected)
Clock synchronous type
(when external clock is selected) CKDIR = 1
U1PINSEL Clock synchronous type
(when internal clock is selected)
CLK U1PINSEL
polarity
CLK1 switch
circuit
Clock
synchronous
PRYE = 0 type
PAR Clock UART (7 bits)
1SP disabled synchronous UART (7 bits) UARTi receive register
type UART (8 bits)
RXDi SP SP PAR
PAR UART Clock
2SP enabled UART (9 bits)
synchronous
PRYE = 1 type
UART (8 bits)
UART (9 bits)
0 0 0 0 0 0 0 D8 D7 D6 D5 D4 D3 D2 D1 D0 UiRB register
www.DataSheet4U.com
MSB/LSB conversion circuit
D8 D7 D6 D5 D4 D3 D2 D1 D0 UiTB register
UART (8 bits)
UART (9 bits)
PRYE = 1 Clock
PAR UART (9 bits) synchronous
2SP enabled UART type
SP SP PAR TXDi
1SP PAR Clock UART (7 bits) UARTi transmit register
UART (7 bits)
disabled synchronous UART (8 bits)
PRYE = 0 type
Clock i = 0 or 1
0 synchronous SP: Stop bit
type PAR: Parity bit
NOTES:
www.DataSheet4U.com
1. Write to this register w hile the serial I/O is neither transmitting nor receiving.
2. Use the MOV instruction to w rite to this register.
3. After setting the CLK0 to CLK1 bits of the UiC0 register, w rite to the UiBRG register.
Table 15.2 Registers Used and Settings in Clock Synchronous Serial I/O Mode(1)
Register Bit Function
UiTB 0 to 7 Set data transmission
UiRB 0 to 7 Data reception can be read
OER Overrun error flag
UiBRG 0 to 7 Set bit rate
UiMR SMD2 to SMD0 Set to 001b
CKDIR Select the internal clock or external clock
UiC0 CLK1 to CLK0 Select the count source in the UiBRG register
www.DataSheet4U.com TXEPT Transmit register empty flag
NCH Select TXDi pin output mode
CKPOL Select the transfer clock polarity
UFORM Select the LSB first or MSB first
UiC1 TE Set this bit to 1 to enable transmission/reception
TI Transmit buffer empty flag
RE Set this bit to 1 to enable reception
RI Reception complete flag
UiIRS Select the UARTi transmit interrupt source
UiRRM Set this bit to 1 to use continuous receive mode
i = 0 or 1
NOTE:
1. Set bits which are not in this table to 0 when writing to the above registers in clock synchronous
serial I/O mode.
Table 15.3 lists the I/O Pin Functions in Clock Synchronous Serial I/O Mode. The TXDi pin outputs “H” level
between the operating mode selection of UARTi (i = 0 or 1) and transfer start. (If the NCH bit is set to 1 (N-channel
open-drain output), this pin is in a high-impedance state.)
Table 15.3 I/O Pin Functions in Clock Synchronous Serial I/O Mode
Pin Name Function Selection Method
TXD0 (P1_4) Output serial data (Outputs dummy data when performing reception only)
RXD0 (P1_5) Input serial data PD1_5 bit in PD1 register = 0
(P1_5 can be used as an input port when performing
transmission only)
CLK0 (P1_6) Output transfer clock CKDIR bit in U0MR register = 0
Input transfer clock CKDIR bit in U0MR register = 1
PD1_6 bit in PD1 register = 0
TXD1 (P6_6) Output serial data U1PINSEL bit in PMR register = 1
(Outputs dummy data when performing reception only)
RXD1 (P6_7) Input serial data U1PINSEL bit in PMR register = 1
PD6_7 bit in PD6 register = 0
(P6_7 can be used as an input port when performing
transmission only)
CLK1 (P6_5) Output transfer clock U1PINSEL bit in PMR register = 1
CKDIR bit in U1MR register = 0
Input transfer clock U1PINSEL bit in PMR register = 1
PD6_5 bit in PD6 register = 0
CKDIR bit in U1MR register = 1
Transfer clock
TE bit in UiC1 1
register 0 Set data in UiTB register
TI bit in UiC1 1
register 0
Transfer from UiTB register to UARTi transmit register
TXDi D0 D1 D2 D3 D4 D5 D6 D7 D0 D1 D2 D3 D4 D5 D6 D7 D0 D1 D2 D3 D4 D5 D6 D7
TXEPT bit in 1
UiC0 register 0
IR bit in SiTIC 1
register 0
RE bit in UiC1 1
register 0
TE bit in UiC1 1
register Write dummy data to UiTB register
0
TI bit in UiC1 1
register 0
Transfer from UiTB register to UARTi transmit register
1/fEXT
CLKi
RXDi D0 D1 D2 D3 D4 D5 D6 D7 D0 D1 D2 D3 D4 D5
IR bit in SiRIC 1
register 0
The following conditions are met when “H” is applied to the CLKi pin before receiving data:
• TE bit in UiC1 register = 1 (enables transmit)
• RE bit in UiC1 register = 1 (enables receive)
• Write dummy data to the UiTB register
fEXT: Frequency of external clock
i = 0 or 1
Figure 15.7 Transmit and Receive Timing Example in Clock Synchronous Serial I/O Mode
• When the CKPOL bit in the UiC0 register = 0 (output transmit data at the falling
edge and input receive data at the rising edge of the transfer clock)
CLKi(1)
TXDi D0 D1 D2 D3 D4 D5 D6 D7
www.DataSheet4U.com
RXDi D0 D1 D2 D3 D4 D5 D6 D7
• When the CKPOL bit in the UiC0 register = 1 (output transmit data at the rising
edge and input receive data at the falling edge of the transfer clock)
CLKi(2)
TXDi D0 D1 D2 D3 D4 D5 D6 D7
RXDi D0 D1 D2 D3 D4 D5 D6 D7
NOTES:
1. When not transferring, the CLKi pin level is “H”.
2. When not transferring, the CLKi pin level is “L”.
i = 0 or 1
CLKi
TXDi D0 D1 D2 D3 D4 D5 D6 D7
RXDi D0 D1 D2 D3 D4 D5 D6 D7
CLKi
TXDi D7 D6 D5 D4 D3 D2 D1 D0
RXDi D7 D6 D5 D4 D3 D2 D1 D0
NOTE:
1. The above applies when the CKPOL bit in the UiC0 register is
set to 0 (output transmit data at the falling edge and input receive
data at the rising edge of the transfer clock).
i = 0 or 1
www.DataSheet4U.com
• Transmit timing when transfer data is 8 bits long (parity enabled, 1 stop bit)
TC
Transfer clock
TE bit in UiC1 1
register 0 Write data to UiTB register
TI bit in UiC1 1
register 0
Transfer from UiTB register to UARTi transmit register Stop pulsing
because the TE bit is set to 0
Start Parity Stop
www.DataSheet4U.com bit bit bit
TXDi ST D0 D1 D2 D3 D4 D5 D6 D7 P SP ST D0 D1 D2 D3 D4 D5 D6 D7 P SP ST D0 D1
TXEPT bit in 1
UiC0 register 0
IR bit SiTIC 1
register 0
The above timing diagram applies under the following conditions: TC=16 (n + 1) / fj or 16 (n + 1) / fEXT
• PRYE bit in UiMR register = 1 (parity enabled) fj: Frequency of UiBRG count source (f1, f8, f32)
• STPS bit in UiMR register = 0 (1 stop bit) fEXT: Frequency of UiBRG count source (external clock)
• UiIRS bit in UiC1 register = 1 (an interrupt request is generated when transmit completes) n: Setting value to UiBRG register
i = 0 to 1
• Transmit timing when transfer data is 9 bits long (parity disabled, 2 stop bits)
TC
Transfer clock
TE bit in UiC1 1
register 0
Write data to UiTB register
TI bit in UiC1 1
register 0
Transfer from UiTB register to UARTi transmit register
TXDi ST D0 D1 D2 D3 D4 D5 D6 D7 D8 SP SP ST D0 D1 D2 D3 D4 D5 D6 D7 D8 SP SP ST D0 D1
TXEPT bit in 1
UiC0 register 0
IR bit in SiTIC 1
register 0
• Example of receive timing when transfer data is 8 bits long (parity disabled, one stop bit)
UiBRG output
UiC1 register 1
RE bit 0
Stop bit
RXDi Start bit D0 D1 D7
Transfer clock
SiRIC register 1
IR bit 0
UART mode
• Internal clock selected
UiBRG register setting value = fj -1
Bit Rate × 16
Fj: Count source frequency of the UiBRG register (f1, f8, or f32)
www.DataSheet4U.com
• External clock selected
UiBRG register setting value = fEXT
-1
Bit Rate × 16
i = 0 or 1
Table 15.7 Bit Rate Setting Example in UART Mode (Internal Clock Selected)
System Clock = 20 MHz System Clock = 18.432 MHz(1) System Clock = 8 MHz
UiBRG
Bit Rate UiBRG Setting UiBRG Setting UiBRG Actual Setting
Count Actual Time Actual Time
(bps) Setting Error Setting Error Setting Time Error
Source (bps) (bps)
Value (%) Value (%) Value (bps) (%)
1200 f8 129 (81h) 1201.92 0.16 119 (77h) 1200.00 0.00 51 (33h) 1201.92 0.16
2400 f8 64 (40h) 2403.85 0.16 59 (3Bh) 2400.00 0.00 25 (19h) 2403.85 0.16
4800 f8 32 (20h) 4734.85 -1.36 29 (1Dh) 4800.00 0.00 12 (0Ch) 4807.69 0.16
9600 f1 129 (81h) 9615.38 0.16 119 (77h) 9600.00 0.00 51 (33h) 9615.38 0.16
14400 f1 86 (56h) 14367.82 -0.22 79 (4Fh) 14400.00 0.00 34 (22h) 14285.71 -0.79
19200 f1 64 (40h) 19230.77 0.16 59 (3Bh) 19200.00 0.00 25 (19h) 19230.77 0.16
28800 f1 42 (2Ah) 29069.77 0.94 39 (27h) 28800.00 0.00 16 (10h) 29411.76 2.12
38400 f1 32 (20h) 37878.79 -1.36 29 (1Dh) 38400.00 0.00 12 (0Ch) 38461.54 0.16
57600 f1 21 (15h) 56818.18 -1.36 19 (13h) 57600.00 0.00 8 (08h) 55555.56 -3.55
115200 f1 10 (0Ah) 113636.36 -1.36 9 (09h) 115200.00 0.00 − − −
i = 0 or 1
NOTE:
1. For the high-speed on-chip oscillator, the correction value in the FRA7 register should be written into the FRA1
register.
This applies when the high-speed on-chip oscillator is selected as the system clock and bits FRA22 to FRA20
in the FRA2 register are set to 000b (divide-by-2 mode). For the precision of the high-speed on-chip oscillator,
refer to 20. Electrical Characteristics.
• When writing data to the UiTB register in the clock asynchronous serial I/O mode with 9-bit transfer data
length, write data to the high-order byte first then the low-order byte, in 8-bit units.
www.DataSheet4U.com
Example (when reading transmit buffer register):
MOV.B #XXH,00A3H ; Write the high-order byte of U0TB register
MOV.B #XXH,00A2H ; Write the low-order byte of U0TB register
Clock synchronous serial I/O with chip select (SSU) Clock synchronous communication mode
The clock synchronous serial interface uses the registers at addresses 00B8h to 00BFh. Registers, bits, symbols, and
functions vary even for the same addresses depending on the mode. Refer to the register diagrams of each function for
details.
Also, the differences between clock synchronous communication mode and clock synchronous serial mode are the
options of the transfer clock, clock output format, and data output format.
Table 16.2 Clock Synchronous Serial I/O with Chip Select Specifications
Item Specification
Transfer data format • Transfer data length: 8 bits
Continuous transmission and reception of serial data are supported since
both transmitter and receiver have buffer structures.
www.DataSheet4U.com
Operating modes • Clock synchronous communication mode
• 4-wire bus communication mode (including bidirectional communication)
Master/slave device Selectable
I/O pins SSCK (I/O): Clock I/O pin
SSI (I/O): Data I/O pin
SSO (I/O): Data I/O pin
SCS (I/O): Chip-select I/O pin
Transfer clocks • When the MSS bit in the SSCRH register is set to 0 (operates as slave
device), external clock is selected (input from SSCK pin).
• When the MSS bit in the SSCRH register is set to 1 (operates as master
device), internal clock (selectable among f1/256, f1/128, f1/64, f1/32, f1/16,
f1/8 and f1/4, output from SSCK pin) is selected.
• Clock polarity and phase of SSCK can be selected.
Receive error detection • Overrun error
Overrun error occurs during reception and completes in error. While the
RDRF bit in the SSSR register is set to 1 (data in the SSRDR register) and
when next serial data receive is completed, the ORER bit is set to 1.
Multimaster error • Conflict error
detection When the SSUMS bit in the SSMR2 register is set to 1 (4-wire bus
communication mode) and the MSS bit in the SSCRH register is set to 1
(operates as master device) and when starting a serial communication, the
CE bit in the SSSR register is set to 1 if “L” applies to the SCS pin input.
When the SSUMS bit in the SSMR2 register is set to 1 (4-wire bus
communication mode), the MSS bit in the SSCRH register is set to 0
(operates as slave device) and the SCS pin input changes state from “L” to
“H”, the CE bit in the SSSR register is set to 1.
Interrupt requests 5 interrupt requests (transmit-end, transmit-data-empty, receive-data-full,
overrun error, and conflict error).(1)
Select functions • Data transfer direction
Selects MSB-first or LSB-first
• SSCK clock polarity
Selects “L” or “H” level when clock stops
• SSCK clock phase
Selects edge of data change and data download
NOTE:
1. Clock synchronous serial I/O with chip select has only one interrupt vector table.
f1
Multiplexer
SSCK
SSCRL register
SSCRH register
Transmit/receive
SCS SSER register
control circuit
SSSR register
Data bus
SSMR2 register
SSTDR register
SSRDR register
Interrupt requests
(TXI, TEI, RXI, OEI, and CEI)
Figure 16.1 Block Diagram of Clock Synchronous Serial I/O with Chip Select
SS Control Register H
b7 b6 b5 b4 b3 b2 b1 b0
SS Control Register L
b7 b6 b5 b4 b3 b2 b1 b0
SS Mode Register
b7 b6 b5 b4 b3 b2 b1 b0
SS Enable Register
b7 b6 b5 b4 b3 b2 b1 b0
SS Status Register(7)
b7 b6 b5 b4 b3 b2 b1 b0
SS Mode Register 2
b7 b6 b5 b4 b3 b2 b1 b0
NOTE:
1. The SSRDR register retains the data received before an overrun error occurs (ORER bit in the SSSR register set to 1
(overrun error)). When an overrun error occurs, the receive data may contain errors and therefore should be
discarded.
16.2.1.1
www.DataSheet4U.com Association between Transfer Clock Polarity, Phase, and Data
The association between the transfer clock polarity, phase and data changes according to the combination of the
SSUMS bit in the SSMR2 register and bits CPHS and CPOS in the SSMR register.
Figure 16.10 shows the Association between Transfer Clock Polarity, Phase, and Transfer Data.
Also, the MSB-first transfer or LSB-first transfer can be selected by setting the MLS bit in the SSMR register.
When the MLS bit is set to 1, transfer is started from the LSB and proceeds to the MSB. When the MLS bit is
set to 0, transfer is started from the MSB and proceeds to the LSB.
• SSUMS = 0 (clock synchronous communication mode), CPHS bit = 0 (data change at odd
edge), and CPOS bit = 0 (“H” when clock stops)
SSCK
SSO, SSI b0 b1 b2 b3 b4 b5 b6 b7
www.DataSheet4U.com • SSUMS = 1 (4-wire bus communication mode) and CPHS = 0 (data change at odd edge)
SSCK
CPOS = 0
(“H” when clock stops)
SSCK
CPOS = 1
(“L” when clock stops)
SSO, SSI b0 b1 b2 b3 b4 b5 b6 b7
SCS
• SSUMS = 1 (4-wire bus communication mode) and CPHS = 1 (data download at odd edge)
SSCK
CPOS = 0
(“H” when clock stops)
SSCK
CPOS = 1
(“L” when clock stops)
SSO, SSI b0 b1 b2 b3 b4 b5 b6 b7
SCS
CPHS and CPOS: Bits in SSMR register, SSUMS: Bits in SSMR2 register
Figure 16.10 Association between Transfer Clock Polarity, Phase, and Transfer Data
SSI SSI
• SSUMS = 1 (4-wire bus communication mode), • SSUMS = 1 (4-wire bus communication mode) and
BIDE = 0 (standard mode), and MSS = 0 (operates BIDE = 1 (bidirectional mode)
as slave device)
SSI SSI
Figure 16.11 Association between Data I/O Pins and SSTRSR Register
Table 16.3 Clock Synchronous Serial I/O with Chip Select Interrupt Requests
Interrupt Request Abbreviation Generation Condition
Transmit data empty TXI TIE = 1, TDRE = 1
Transmit end TEI TEIE = 1, TEND = 1
Receive data full
www.DataSheet4U.com
RXI RIE = 1, RDRF = 1
Overrun error OEI RIE = 1, ORER = 1
Conflict error CEI CEIE = 1, CE = 1
CEIE, RIE, TEIE and TIE: Bits in SSER register
ORER, RDRF, TEND and TDRE: Bits in SSSR register
If the generation conditions in Table 16.3 are met, a clock synchronous serial I/O with chip select interrupt request
is generated. Set each interrupt source to 0 by a clock synchronous serial I/O with chip select interrupt routine.
However, the TDRE and TEND bits are automatically set to 0 by writing transmit data to the SSTDR register and
the RDRF bit is automatically set to 0 by reading the SSRDR register. In particular, the TDRE bit is set to 1 (data
transmitted from registers SSTDR to SSTRSR) at the same time transmit data is written to the SSTDR register.
Setting the TDRE bit to 0 (data not transmitted from registers SSTDR to SSTRSR) can cause an additional byte of
data to be transmitted.
www.DataSheet4U.com
Start
End
NOTE:
1. Write 0 after reading 1 to set the ORER bit to 0.
SSCK
SSO b0 b1 b7 b0 b1 b7
1 frame 1 frame
TDRE bit in 1
SSSR register TEI interrupt request
0
generation
Processing
by program Write data to SSTDR register
Figure 16.13 Example of Clock Synchronous Serial I/O with Chip Select Operation for Data
Transmission (Clock Synchronous Communication Mode)
Start
Initialization
(1) Read TDRE bit in SSSR register (1) After reading the SSSR register and confirming
that the TDRE bit is set to 1, write the transmit
data to the SSTDR register. When the transmit
data is written to the SSTDR register, the TDRE
No
www.DataSheet4U.com TDRE = 1 ? bit is automatically set to 0.
Yes
Data
Yes
(2) transmission (2) Determine whether data transmission continues.
continues?
No
Yes
SSSR register TEND bit ← 0(1)
End
NOTE:
1. Write 0 after reading 1 to set the TEND bit to 0.
Figure 16.14 Sample Flowchart of Data Transmission (Clock Synchronous Communication Mode)
SSCK
SSI b0 b7 b0 b7 b0 b7
1 frame 1 frame
RDRF bit in 1
SSSR register
0
RXI interrupt request RXI interrupt request
RSSTP bit in 1 generation generation
SSCRH register RXI interrupt request
0 generation
Processing Dummy read in Read data in SSRDR Set RSSTP bit to 1 Read data in
by program SSRDR register register SSRDR register
Figure 16.15 Example of Clock Synchronous Serial I/O with Chip Select Operation for Data
Reception (Clock Synchronous Communication Mode)
Start
Initialization
(1) Dummy read of SSRDR register (1) After setting each register in the clock synchronous
serial I/O with chip select register, a dummy read of
the SSRDR register is performed and the receive
operation is started.
(2) Last data Yes
received? (2) Determine whether it is the last 1 byte of data to be
www.DataSheet4U.com received. If so, set to stop after the data is received.
No
Read ORER bit in SSSR register
Yes
(3) ORER = 1 ? (3) If a receive error occurs, perform error
(6) Processing after reading the ORER bit. Then set
the ORER bit to 0. Transmission/reception cannot
No be restarted while the ORER bit is set to 1.
Read RDRF bit in SSSR register
(4) No (4) Confirm that the RDRF bit is set to 1. If the RDRF
RDRF = 1 ? bit is set to 1, read the receive data in the SSRDR
register. When the SSRDR register is read, the
Yes RDRF bit is automatically set to 0.
(5) SSCRH register RSSTP bit ← 1 (5) Before the last 1 byte of data is received, set the
RSSTP bit to 1 and stop after the data is
received.
Yes
(6) ORER = 1 ?
No
Read RDRF in SSSR register
Overrun
SSER register RE bit ← 0 error
processing
End
Figure 16.16 Sample Flowchart of Data Reception (MSS = 1) (Clock Synchronous Communication
Mode)
Start
Initialization
(1) Read TDRE bit in SSSR register (1) After reading the SSSR register and confirming
that the TDRE bit is set to 1, write the transmit
data to the SSTDR register. When the transmit
www.DataSheet4U.com data is written to the SSTDR register, the TDRE
No
TDRE = 1 ? bit is automatically set to 0.
Yes
Yes
Data
Yes (3) Determine whether the data transmission
(3) transmission(2)
continues? continues
No
(4) Read TEND bit in SSSR register (4) When the data transmission is completed, the
TEND bit in the SSSR register is set to 1.
No
TEND = 1 ?
Yes
(5) SSSR register TEND bit ← 0(1) (5) Set the TEND bit to 0 and bits RE and TE in
(6) the SSER register to 0 before ending transmit/
receive mode.
SSER register RE bit ← 0
(6) TE bit ← 0
End
NOTE:
1. Write 0 after reading 1 to set the TEND bit to 0.
Start
(1) SSMR register Set bits CPHS and CPOS (1) The MLS bit is set to 0 for MSB-first transfer.
www.DataSheet4U.com MLS bits ← 0 The clock polarity and phase are set by bits
CPHS and CPOS.
SSMR2 register SCKS bit ← 1 (2) Set the BIDE bit to 1 in bidirectional mode and
Set bits SOOS, CSS0 to set the I/O of the SCS pin by bits CSS0 and
(2) CSS1.
CSS1, and BIDE
End
NOTE:
1. Write 0 after reading 1 to set the ORER bit to 0.
• CPHS bit = 0 (data change at odd edges) and CPOS bit = 0 (“H” when clock stops)
High-impedance
SCS
(output)
SSCK
SSO b7 b6 b0 b7 b6 b0
1 frame 1 frame
www.DataSheet4U.com
TDRE bit in 1
SSSR register TEI interrupt request is
0
generated
TXI interrupt request is TXI interrupt request is
TEND bit in 1
generated generated
SSSR register
0
• CPHS bit = 1 (data change at even edges) and CPOS bit = 0 (“H” when clock stops)
High-impedance
SCS
(output)
SSCK
SSO b7 b6 b0 b7 b6 b0
1 frame 1 frame
TDRE bit in 1
SSSR register TEI interrupt request is
0 generated
Figure 16.19 Example of Clock Synchronous Serial I/O with Chip Select Operation during Data
Transmission (4-Wire Bus Communication Mode)
• CPHS bit = 0 (data download at even edges) and CPOS bit = 0 (“H” when clock stops)
High-impedance
SCS
(output)
SSCK
SSI b7 b0 b7 b0 b7 b0
RDRF bit in 1
SSSR register
0
Processing Dummy read in Data read in SSRDR Set RSSTP Data read in SSRDR
by program SSRDR register register bit to 1 register
• CPHS bit = 1 (data download at odd edges) and CPOS bit = 0 (“H” when clock stops)
High-impedance
SCS
(output)
SSCK
SSI b7 b0 b7 b0 b7 b0
1 frame 1 frame
RDRF bit in 1
SSSR register
0
Processing Dummy read in Data read in SSRDR Set RSSTP Data read in SSRDR
by program SSRDR register register bit to 1 register
Figure 16.20 Example of Clock Synchronous Serial I/O with Chip Select Operation during Data
Reception (4-Wire Bus Communication Mode)
Future transmit operations are not performed while the CE bit is set to 1. Set the CE bit to 0 (no conflict error)
before starting transmission.
www.DataSheet4U.com
SCS input
Internal SCS
(synchronization)
MSS bit in 1
SSCRH register 0
Transfer start
Data write to
SSTDR register
CE
High-impedance
SCS output
Maximum time of SCS internal
synchronization
www.DataSheet4U.com
f1
Transfer clock
generation
circuit
Output
SCL ICCR1 register
control
Transmit/receive
control circuit ICCR2 register
www.DataSheet4U.com Noise
canceller ICMR register
ICDRT register
Data bus
Noise
Address comparison
canceller
circuit
ICDRR register
Arbitration judgment
ICSR register
circuit
ICIER register
Interrupt generation
circuit
Interrupt request
(TXI, TEI, RXI, STPI, NAKI)
VCC VCC
SCL SCL
SCL input
www.DataSheet4U.com
SCL output
SDA SDA
SDA input
SDA output
SCL SCL
(Master) SCL input SCL input
SDA SDA
SDA input SDA input
(Slave 1) (Slave 2)
Figure 16.23 External Circuit Connection Example of Pins SCL and SDA
Receive disable bit After reading the ICDRR register w hile the TRS bit
is set to 0
RCVD 0 : Maintains the next receive operation RW
1 : Disables the next receive operation
NOTES:
1. When w riting to the SDAO bit, w rite 0 to the SDAOP bit using the MOV instruction simultaneously.
2. Do not w rite during a transfer operation.
3. This bit is enabled in master mode. When w riting to the BBSY bit, w rite 0 to the SCP bit using the MOV
instruction simultaneously. Execute the same w ay w hen the start condition is regenerating.
4. This bit is disabled w hen the clock synchronous serial format is used.
BC w rite protect bit When rew riting bits BC0 to BC2, w rite 0
BCWP simultaneously.(2,4) RW
When read, the content is 1.
— Nothing is assigned. If necessary, set to 0.
—
(b4) When read, the content is 1.
— Reserved bit Set to 0.
RW
(b5)
Wait insertion bit(5) 0 : No w ait
(Transfer data and acknow ledge bit
consecutively)
WAIT 1 : Wait RW
(After the clock falls for the final
data bit, “L” period is extended for tw o
transfer clocks cycles)
NOTES:
1. An overrun error interrupt request is generated w hen the clock synchronous format is used.
2. Set the STIE bit to 1 (enable stop condition detection interrupt request) w hen the STOP bit in the ICSR register is set
to 0.
Stop condition detection When the stop condition is detected after the frame
STOP RW
flag(1) is transferred, this flag is set to 1.
No acknow ledge detection When no acknow ledge is detected from the receive
NACKF RW
flag(1,4) device after transmission, this flag is set to 1.
Receive data register When receive data is transferred from in registers
RDRF RW
full(1,5) ICDRS to ICDRR , this flag is set to 1.
Transmit end(1,6) When the 9th clock cycle of the SCL signal in the I2C
bus format occurs w hile the TDRE bit is set to 1, this
TEND flag is set to 1. RW
This flag is set to 1 w hen the final bit of the transmit
frame is transmitted in the clock synchronous format.
Transmit data empty (1,6) In the follow ing cases, this flag is set to 1.
• Data is transferred from registers ICDRT to ICDRS
and the ICDRT register is empty
• When setting the TRS bit in the ICCR1
TDRE register to 1 (transmit mode) RW
• When generating the start condition
(including retransmit)
• When changing from slave receive mode to
slave transmit mode
NOTES:
1. Each bit is set to 0 by reading 1 before w riting 0.
2. This flag is enabled in slave receive mode of the I2C bus format.
3. When tw o or more master devices attempt to occupy the bus at nearly the same time, if the I2C bus Interface
monitors the SDA pin and the data w hich the I2C bus Interface transmits is different, the AL flag is set to 1 and the
bus is occupied by another master.
4. The NACKF bit is enabled w hen the ACKE bit in the ICIER register is set to 1 (w hen the receive acknow ledge bit is
set to 1, transfer is halted).
5. The RDRF bit is set to 0 w hen reading data from the ICDRR register.
6. Bits TEND and TDRE are set to 0 w hen w riting data to the ICDRT register.
7. When accessing the ICSR register continuously, insert one or more NOP instructions betw een the instructions to
access it.
www.DataSheet4U.com
IIC bus Shift Register
b7 b6 b5 b4 b3 b2 b1 b0
Symbol
ICDRS
Function RW
This register is used to transmit and receive data.
The transmit data is transferred from registers ICRDT to the ICDRS and data is transmitted
from the SDA pin w hen transmitting. —
After 1 byte of data received, data is transferred from registers ICDRS to ICDRR w hile
receiving.
When the generation conditions listed in Table 16.7 are met, an I2C bus interface interrupt request is generated.
Set the interrupt generation conditions to 0 by the I2C bus interface interrupt routine. However, bits TDRE and
TEND are automatically set to 0 by writing transmit data to the ICDRT register and the RDRF bit is
automatically set to 0 by reading the ICDRR register. When writing transmit data to the ICDRT register, the
TDRE bit is set to 0. When data is transferred from registers ICDRT to ICDRS, the TDRE bit is set to 1 and by
further setting the TDRE bit to 0, 1 additional byte may be transmitted.
Set the STIE bit to 1 (enable stop condition detection interrupt request) when the STOP bit is set to 0.
1 7 1 1 n 1 1 1
Transfer bit count (n = 1 to 8)
1 m
Transfer frame count (m = from 1)
1 7 1 1 n1 1 1 7 1 1 n2 1 1
1 m1 1 m2
SDA
SCL 1 to 7 8 9 1 to 7 8 9 1 to 7 8 9
The transmit procedure and operation in master transmit mode are as follows.
(1) Set the STOP bit in the ICSR register to 0 to reset it. Then set the ICE bit in the ICCR1 register to 1
(transfer operation enabled). Then set bits WAIT and MLS in the ICMR register and set bits CKS0 to
CKS3 in the ICCR1 register (initial setting).
(2) Read the BBSY bit in the ICCR2 register to confirm that the bus is free. Set bits TRS and MST in the
ICCR1 register to master transmit mode. The start condition is generated by writing 1 to the BBSY bit
www.DataSheet4U.com and 0 to the SCP bit by the MOV instruction.
(3) After confirming that the TDRE bit in the ICSR register is set to 1 (data is transferred from registers
ICDRT to ICDRS), write transmit data to the ICDRT register (data in which a slave address and R/W
are indicated in the 1st byte). At this time, the TDRE bit is automatically set to 0, data is transferred
from registers ICDRT to ICDRS, and the TDRE bit is set to 1 again.
(4) When transmission of 1 byte of data is completed while the TDRE bit is set to 1, the TEND bit in the
ICSR register is set to 1 at the rise of the 9th transmit clock pulse. Read the ACKBR bit in the ICIER
register, and confirm that the slave is selected. Write the 2nd byte of data to the ICDRT register. Since
the slave device is not acknowledged when the ACKBR bit is set to 1, generate the stop condition. The
stop condition is generated by the writing 0 to the BBSY bit and 0 to the SCP bit by the MOV
instruction. The SCL signal is held “L” until data is available and the stop condition is generated.
(5) Write the transmit data after the 2nd byte to the ICDRT register every time the TDRE bit is set to 1.
(6) When writing the number of bytes to be transmitted to the ICDRT register, wait until the TEND bit is
set to 1 while the TDRE bit is set to 1. Or wait for NACK (the NACKF bit in the ICSR register is set to
1) from the receive device while the ACKE bit in the ICIER register is set to 1 (when the receive
acknowledge bit is set to 1, transfer is halted). Then generate the stop condition before setting bits
TEND and NACKF to 0.
(7) When the STOP bit in the ICSR register is set to 1, return to slave receive mode.
SCL
(master output) 1 2 3 4 5 6 7 8 9 1 2
SDA
(master output) b7 b6 b5 b4 b3 b2 b1 b0 b7 b6
Slave address
R/W
SDA
A
(slave output)
1
TDRE bit in
www.DataSheet4U.com ICSR register
0
1
TEND bit in
ICSR register
0
Processing (2) Instruction of (3) Data write to ICDRT (4) Data write to ICDRT (5) Data write to ICDRT
by program start condition register (1st byte) register (2nd byte) register (3rd byte)
generation
Figure 16.33 Operating Timing in Master Transmit Mode (I2C bus Interface Mode) (1)
SCL
(master output) 9 1 2 3 4 5 6 7 8 9
SDA
b7 b6 b5 b4 b3 b2 b1 b0
(master output)
SDA
A A/A
(slave output)
1
TDRE bit in
ICSR register
0
1
TEND bit in
ICSR register
0
Processing (3) Data write to ICDRT (6) Generate stop condition and
by program register set TEND bit to 0
(7) Set to slave receive mode
Figure 16.34 Operating Timing in Master Transmit Mode (I2C bus Interface Mode) (2)
The receive procedure and operation in master receive mode are shown below.
(1) After setting the TEND bit in the ICSR register to 0, switch from master transmit mode to master
receive mode by setting the TRS bit in the ICCR1 register to 0. Also, set the TDRE bit in the ICSR
register to 0.
(2) When performing the dummy read of the ICDRR register and starting the receive operation, the receive
clock is output in synchronization with the internal clock and data is received. The master device
www.DataSheet4U.com outputs the level set by the ACKBT bit in the ICIER register to the SDA pin at the rising edge of the 9th
clock cycle of the receive clock.
(3) The 1-frame data receive is completed and the RDRF bit in the ICSR register is set to 1 at the rise of the
9th clock cycle. At this time, when reading the ICDRR register, the received data can be read and the
RDRF bit is set to 0 simultaneously.
(4) Continuous receive operation is enabled by reading the ICDRR register every time the RDRF bit is set
to 1. If the 8th clock cycle falls after the ICDRR register is read by another process while the RDRF bit
is set to 1, the SCL signal is fixed “L” until the ICDRR register is read.
(5) If the next frame is the last receive frame and the RCVD bit in the ICCR1 register is set to 1 (disables
the next receive operation) before reading the ICDRR register, stop condition generation is enabled
after the next receive operation.
(6) When the RDRF bit is set to 1 at the rise of the 9th clock cycle of the receive clock, generate the stop
condition.
(7) When the STOP bit in the ICSR register is set to 1, read the ICDRR register and set the RCVD bit to 0
(maintain the following receive operation).
(8) Return to slave receive mode.
SCL
(master output) 9 1 2 3 4 5 6 7 8 9 1
SDA
(master output) A
SDA
A b7 b6 b5 b4 b3 b2 b1 b0 b7
(slave output)
www.DataSheet4U.com
1
TDRE bit in
ICSR register
0
1
TEND bit in
ICSR register
0
1
TRS bit in
ICCR1 register
0
1
RDRF bit in
ICSR register
0
Processing (1) Set TEND and TRS bits to 0 before (2) Read ICDRR register (3) Read ICDRR register
by program setting TDRE bits to 0
Figure 16.35 Operating Timing in Master Receive Mode (I2C bus Interface Mode) (1)
SCL
(master output) 9 1 2 3 4 5 6 7 8 9
SDA
(master output) A A/A
SDA
b7 b6 b5 b4 b3 b2 b1 b0
(slave output)
www.DataSheet4U.com
1
RDRF bit in
ICSR register
0
1
RCVD bit in
ICCR1 register
0
Figure 16.36 Operating Timing in Master Receive Mode (I2C bus Interface Mode) (2)
The transmit procedure and operation in slave transmit mode are as follows.
(1) Set the ICE bit in the ICCR1 register to 1 (transfer operation enabled). Set bits WAIT and MLS in the
ICMR register and bits CKS0 to CKS3 in the ICCR1 register (initial setting). Set bits TRS and MST in
the ICCR1 register to 0 and wait until the slave address matches in slave receive mode.
(2) When the slave address matches at the 1st frame after detecting the start condition, the slave device
outputs the level set by the ACKBT bit in the ICIER register to the SDA pin at the rise of the 9th clock
www.DataSheet4U.com cycle. At this time, if the 8th bit of data (R/W) is 1, bits TRS and TDRE in the ICSR register are set to 1,
and the mode is switched to slave transmit mode automatically. Continuous transmission is enabled by
writing transmit data to the ICDRT register every time the TDRE bit is set to 1.
(3) When the TDRE bit in the ICDRT register is set to 1 after writing the last transmit data to the ICDRT
register, wait until the TEND bit in the ICSR register is set to 1 while the TDRE bit is set to 1. When the
TEND bit is set to 1, set the TEND bit to 0.
(4) The SCL signal is released by setting the TRS bit to 0 and performing a dummy read of the ICDRR
register to end the process.
(5) Set the TDRE bit to 0.
SCL
(master output) 9 1 2 3 4 5 6 7 8 9 1
SDA A
(master output)
SCL
(slave output)
www.DataSheet4U.com
SDA b6 b5 b4 b3 b2 b1 b0 b7
A b7
(slave output)
1
TDRE bit in
ICSR register
0
1
TEND bit in
ICSR register
0
1
TRS bit in
ICCR1 register
0
ICDRR register
(1) Data write to ICDRT (2) Data write to ICDRT (2) Data write to ICDRT
Processing
register (data 1) register (data 2) register (data 3)
by program
Figure 16.37 Operating Timing in Slave Transmit Mode (I2C bus Interface Mode) (1)
Slave receive
mode
Slave transmit mode
SCL
(master output) 9 1 2 3 4 5 6 7 8 9
SDA
A A
(master output)
SCL
www.DataSheet4U.com(slave output)
SDA
b7 b6 b5 b4 b3 b2 b1 b0
(slave output)
1
TDRE bit in
ICSR register
0
1
TEND bit in
ICSR register
0
1
TRS bit in
ICCR1 register
0
ICDRR register
Processing (3) Set the TEND bit to 0 (4) Dummy read of ICDRR register
by program (5) Set TDRE bit to 0
after setting TRS bit to 0
Figure 16.38 Operating Timing in Slave Transmit Mode (I2C bus Interface Mode) (2)
The receive procedure and operation in slave receive mode are as follows.
(1) Set the ICE bit in the ICCR1 register to 1 (transfer operation enabled). Set bits WAIT and MLS in the
ICMR register and bits CKS0 to CKS3 in the ICCR1 register (initial setting). Set bits TRS and MST in
the ICCR1 register to 0 and wait until the slave address matches in slave receive mode.
(2) When the slave address matches at the 1st frame after detecting the start condition, the slave device
outputs the level set in the ACKBT bit in the ICIER register to the SDA pin at the rise of the 9th clock
www.DataSheet4U.com cycle. Since the RDRF bit in the ICSR register is set to 1 simultaneously, perform the dummy read (the
read data is unnecessary because it indicates the slave address and R/W).
(3) Read the ICDRR register every time the RDRF bit is set to 1. If the 8th clock cycle falls while the
RDRF bit is set to 1, the SCL signal is fixed “L” until the ICDRR register is read. The setting change of
the acknowledge signal returned to the master device before reading the ICDRR register takes affect
from the following transfer frame.
(4) Reading the last byte is performed by reading the ICDRR register in like manner.
SCL
(master output) 9 1 2 3 4 5 6 7 8 9 1
SDA
(master output) b7 b6 b5 b4 b3 b2 b1 b0 b7
SCL
(slave output)
www.DataSheet4U.com SDA
A A
(slave output)
1
RDRF bit in
ICSR register
0
Processing (2) Dummy read of ICDRR register (2) Read ICDRR register
by program
Figure 16.39 Operating Timing in Slave Receive Mode (I2C bus Interface Mode) (1)
SCL
(master output) 9 1 2 3 4 5 6 7 8 9
SDA
(master output) b7 b6 b5 b4 b3 b2 b1 b0
SCL
(slave output)
SDA
A A
(slave output)
1
RDRF bit in
ICSR register
0
Processing (3) Set ACKBT bit to 1 (3) Read ICDRR register (4) Read ICDRR register
by program
Figure 16.40 Operating Timing in Slave Receive Mode (I2C bus Interface Mode) (2)
When the MST bit in the ICCR1 register is set to 1, the transfer clock is output from the SCL pin, and when the
MST bit is set to 0, the external clock is input.
The transfer data is output between successive falling edges of the SCL clock, and data is determined at the
rising edge of the SCL clock. MSB-first or LSB-first can be selected as the order of the data transfer by setting
www.DataSheet4U.com the MLS bit in the ICMR register. The SDA output level can be changed by the SDAO bit in the ICCR2 register
during transfer standby.
SCL
SDA b0 b1 b2 b3 b4 b5 b6 b7
SCL 1 2 7 8 1 7 8 1
SDA b0 b1 b6 b7 b0 b6 b7 b0
(output)
1
TRS bit in
ICCR1 register
0
1
TDRE bit in
ICSR register
0
Processing (3) Data write to (3) Data write to (3) Data write to (3) Data write to
by program ICDRT register ICDRT register ICDRT register ICDRT register
(2) Set TRS bit to 1
Figure 16.42 Operating Timing in Transmit Mode (Clock Synchronous Serial Mode)
SCL 1 2 7 8 1 7 8 1 2
SDA b0 b1 b6 b7 b0 b6 b7 b0
(input)
1
MST bit in
ICCR1 register
0
TRS bit in 1
ICCR1 register
0
1
RDRF bit in
ICSR register
0
Processing (2) Set MST bit to 1 (3) Read ICDRR register (3) Read ICDRR register
by program (when transfer clock is output)
Figure 16.43 Operating Timing in Receive Mode (Clock Synchronous Serial Mode)
f1 (sampling clock)
www.DataSheet4U.com
C C
SCL or SDA D Q D Q Match
input signal Internal SCL
Latch Latch detection
or SDA signal
circuit
Period of f1
f1 (sampling clock)
www.DataSheet4U.com
Reference clock of
SCL monitor timing
SCL VIH
Internal SCL
Table 16.8 Time between Changing SCL Signal from “L” Output to High-Impedance and
Monitoring of SCL Signal
ICCR1 Register Time for Monitoring SCL
CKS3 CKS2
0 0 7.5Tcyc
1 19.5Tcyc
1 0 17.5Tcyc
1 41.5Tcyc
1Tcyc = 1/f1(s)
Start
Write transmit data to ICDRT register (4) (7) Set the transmit data after 2nd byte (except the last byte)
Yes
Write transmit data to ICDRT register (7)
No (8)
TDRE = 1 ?
Yes
No
Last byte ?
(9)
Yes
Write transmit data to ICDRT register
(10)
No
TEND = 1 ?
Yes
(14)
No
STOP = 1 ?
Yes
ICCR1 register TRS bit ← 0
MST bit ← 0
(15)
ICSR register TDRE bit ← 0
End
Figure 16.46 Example of Register Setting in Master Transmit Mode (I2C bus Interface Mode)
ICSR register TEND bit ← 0 (1) Set the TEND bit to 0 and set to master receive mode.
Set the TDRE bit to 0 (1,2)
ICCR1 register TRS bit ← 0 (1) (2) Set the ACKBT bit to the transmit device (1)
ICSR register TDRE bit ← 0 (3) Dummy read the ICDRR register(1)
ICIER register ACKBT bit ← 0 (2) (4) Wait for 1 byte to be received
Read RDRF bit in ICSR register (7) Set the ACKBT bit of the last byte and set to disable
continuous receive operation (RCVD = 1)(2)
No (9)
RDRF = 1 ?
Yes
ICSR register STOP bit ← 0 (10)
No (12)
STOP = 1 ?
Yes
Read ICDRR register (13)
End
NOTES:
1. Do not generate the interrupt while processing steps (1) to (3).
2. When receiving 1 byte, skip steps (2) to (6) after (1) and jump to process of step (7).
Processing step (8) is dummy read of the ICDRR register.
Figure 16.47 Example of Register Setting in Master Receive Mode (I2C bus Interface Mode)
Read TDRE bit in ICSR register (4) Set the transmit data of the last byte
No (5)
TEND = 1 ?
Yes
ICSR register TEND bit ← 0 (6)
End
Figure 16.48 Example of Register Setting in Slave Transmit Mode (I2C bus Interface Mode)
ICSR register AAS bit ← 0 (1) (1) Set the AAS bit to 0 (1)
No
Read ICDRR register (6)
No (9)
RDRF = 1 ?
Yes
Read ICDRR register (10)
End
NOTE:
1. When receiving 1 byte, skip steps (2) to (6) after (1) and jump to processing step (7).
Processing step (8) is dummy read of the ICDRR register.
Figure 16.49 Example of Register Setting in Slave Receive Mode (I2C bus Interface Mode)
• Transfer rate
Set the transfer rate by 1/1.8 or faster than the fastest rate of the other masters. For example, if the fastest
transfer rate of the other masters is set to 400 kbps, the I2C-bus transfer rate in this MCU should be set to
223 kbps (= 400/1.18) or more.
www.DataSheet4U.com
• Bits MST and TRS in the ICCR1 register setting
(a) Use the MOV instruction to set bits MST and TRS.
(b) When arbitration is lost, confirm the contents of bits MST and TRS. If the contents are other than the
MST bit set to 0 and the TRS bit set to 0 (slave receive mode), set the MST bit to 0 and the TRS bit to 0
again.
(a) In master receive mode while the RDRF bit in the ICSR register is set to 1, read the ICDRR register
before the rising edge of the 8th clock.
(b) In master receive mode, set the RCVD bit in the ICCR1 register to 1 (disables the next receive
operation) to perform 1-byte communications.
17.1 Features
The hardware LIN has the features listed below.
Figure 17.1 shows a Block Diagram of Hardware LIN.
Master mode
• Generates Synch Break
• Detects bus collision
www.DataSheet4U.com
Slave mode
• Detects Synch Break
• Measures Synch Field
• Controls Synch Break and Synch Field signal inputs to UART0
• Detects bus collision
NOTE:
1. The WakeUp function is detected by INT1.
Hardware LIN
Synch Field
RXD0 pin
control Timer RA
circuit
TIOSEL = 0
RXD data
Timer RA
LSTART bit RXD0 input TIOSEL = 1 underflow signal
SBE bit control
LINE bit circuit Timer RA
Interrupt interrupt
control
Bus collision circuit
detection
circuit UART0
BCIE, SBIE,
and SFIE bits
UART0 transfer clock
UART0 TE bit
Timer RA output pulse
MST bit
LINE, MST, SBE, LSTART, BCIE, SBIE, SFIE: Bits in LINCR register
TIOSEL: Bit in TRAIOC register
TE: Bit in U0C1 register
www.DataSheet4U.com
SFDCT bit clear bit When this bit is set to 1, the SFDCT bit is set to
B0CLR 0. RW
When read, the content is 0.
SBDCT bit clear bit When this bit is set to 1, the SBDCT bit is set to
B1CLR 0. RW
When read, the content is 0.
BCDCT bit clear bit When this bit is set to 1, the BCDCT bit is set to
B2CLR 0. RW
When read, the content is 0.
— Nothing is assigned. If necessary, set to 0.
—
(b7-b6) When read, the content is 0.
(1) When the TSTART bit in the TRACR register for timer RA is set by writing 1 in software, the hardware
LIN outputs “L” level from the TXD0 pin for the period that is set in registers TRAPRE and TRA for
timer RA.
(2) When timer RA underflows upon reaching the terminal count, the hardware LIN reverses the output of
www.DataSheet4U.com the TXD0 pin and sets the SBDCT flag in the LINST register to 1. Furthermore, if the SBIE bit in the
LINCR register is set to 1, it generates a timer RA interrupt.
(3) The hardware LIN transmits 55h via UART0.
(4) The hardware LIN transmits an ID field via UART0 after it finishes sending 55h.
(5) The hardware LIN performs communication for a response field after it finishes sending the ID field.
1
TXD0 pin
0
Set by writing 1 to the
B1CLR bit in the LINST
SBDCT flag in the 1 register
LINST register 0
Cleared to 0 upon
acceptance of interrupt
IR bit in the TRAIC 1 request or by a program
register 0
A
Figure 17.5 Example of Header Field Transmission Flowchart (1)
Timer RA Set the timer to start counting Timer RA generates Synch Break.
TSTART bit in TRACR register ← 1 If registers TRAPRE and TRA for
timer RA do not need to be read or
the register settings do not need to be
Timer RA Read the count status flag changed after writing 1 to the
TCSTF flag in TRACR register TSTART bit, the procedure for reading
www.DataSheet4U.com TCSTF flag = 1 can be omitted.
Zero to one cycle of the timer RA
NO count source is required after timer
TCSTF = 1 ?
RA starts counting before the TCSTF
YES flag is set to 1.
Hardware LIN Read the Synch Break detection flag The timer RA interrupt may be used
SBDCT flag in LINST register to terminate generation of Synch
Break.
One to two cycles of the CPU clock
NO are required after Synch Break
SBDCT = 1 ? generation completes before the
SBDCT flag is set to 1.
YES
After timer RA Synch Break is
Timer RA Set the timer to stop counting generated, the timer should be made
TSTART bit in TRACR register ← 0 to stop counting.
If registers TRAPRE and TRA for timer
Timer RA Read the count status flag RA do not need to be read or the
register settings do not need to be
TCSTF flag in TRACR register changed after writing 0 to the TSTART
bit, the procedure for reading TCSTF
flag = 0 can be omitted.
NO Zero to one cycle of the timer RA count
TCSTF = 0 ?
source is required after timer RA stops
YES counting before the TCSTF flag is set
to 0.
UART0 Communication via UART0
TE bit in U0C1 register ← 1 Transmit the Synch Field.
U0TB register ← 0055h
(1) Synch Break detection is enabled by writing 1 to the LSTART bit in the LINCR register of the hardware
LIN.
(2) When “L” level is input for a duration equal to or greater than the period set in timer RA, the hardware
LIN detects it as Synch Break. At this time, the SBDCT flag in the LINST register is set to 1.
Furthermore, if the SBIE bit in the LINCR register is set to 1, the hardware LIN generates a timer RA
interrupt. Then it goes to Synch Field measurement.
www.DataSheet4U.com
(3) The hardware LIN receives a Synch Field (55h). At this time, it measures the period of the start bit and
bits 0 to 6 by using timer RA. In this case, it is possible to select whether to input the Synch Field signal
to RXD0 of UART0 by setting the SBE bit in the LINCR register accordingly.
(4) The hardware LIN sets the SFDCT flag in the LINST register to 1 when it finishes measuring the Synch
Field. Furthermore, if the SFIE bit in the LINCR register is set to 1, it generates a timer RA interrupt.
(5) After it finishes measuring the Synch Field, calculate a transfer rate from the count value of timer RA
and set to UART0 and registers TRAPRE and TRA of timer RA again.
(6) The hardware LIN performs communication for a response field after it finishes receiving the ID field.
1
RXD0 pin
0
Timer RA Set the INT1/TRAIO pin to P1_5 For the hardware LIN
function, set the TIOSEL bit
www.DataSheet4U.com TIOSEL bit in the TRAIOC register ← 1 in the TRAIOC register to 1.
www.DataSheet4U.com
Timer RA waits until the timer starts
Timer RA Set to start a pulse width measurement counting.
TSTART bit in the TRACR register ← 1
1
TXD0 pin
0
1
RXD0 pin
www.DataSheet4U.com 0
1
Transfer clock
0
Set to 1 by a program
LINE bit in the 1
LINCR register 0
Set to 1 by a program
TE bit in the U0C1 1
register 0
Set by writing 1 to
the B2CLR bit in the
BCDCT flag in the 1 LINST register
LINST register 0
Cleared to 0 upon
acceptance of interrupt
IR bit in the TRAIC 1 request or by a program
register 0
Timer RA Read the count status flag Zero to one cycle of the timer
TCSTF flag in TRACR register RA count source is required
after timer RA starts counting
before the TCSTF flag is set to
NO 1.
TCSTF = 0 ?
YES
When the bus collision
UART0 Complete transmission via UART0 detection function is not used,
end processing for the UART0
transmission is not required.
Hardware LIN Clear the status flags
(Bus collision detection, Synch Break
detection, Synch Field measurement)
Bits B2CLR, B1CLR, B0CLR in the LINST After clearing hardware LIN
register ← 1 status flag, stop the
hardware LIN operation.
www.DataSheet4U.com
CKS0 = 1
fOCO-F A/D conversion rate selection
f1 CKS1 = 1
CKS0 = 0 CKS0 = 1
φAD
f2
CKS1 = 0
f4
CKS0 = 0
VCUT = 0
AVSS
VCUT = 1 Resistor ladder
www.DataSheet4U.com VREF
AD register Decoder
Comparator
VIN
Data bus
CH1 RW
www.DataSheet4U.com
CH2 RW
A/D Register
(b15) (b8)
b7 b0 b7 b0
Function RW
When BITS bit in ADCON1 register is set to 1 When BITS bit in ADCON1 register is set to 0
RW
(10-bit mode). (8-bit mode).
8 low -order bits in A/D conversion result A/D conversion result
RO
2 high-order bits in A/D conversion result When read, the content is undefined.
RO
CH1 RW
www.DataSheet4U.com
CH2 RW
CH1 RW
www.DataSheet4U.com
CH2 RW
VCC
VCC VSS
AVCC
ON Resistor
Parasitic Diode ON Resistor Approx. 0.6kΩ
Approx. 2kΩ Wiring Resistor Analog Input C = Approx.1.5pF
AN0 Approx. 0.2kΩ
Voltage AMP
www.DataSheet4U.com VIN
SW1 SW2
Parasitic Diode ON Resistor
Approx. 5kΩ
Sampling
Control Signal SW3
SW4
VSS
i Ladder-type i Ladder-type
i = 12 Switches Chopper-type
Wiring Resistors
AVSS
Amplifier
ON Resistor
Approx. 2kΩ Wiring Resistor
Approx. 0.2kΩ
AN11
SW1
A/D Successive
b4 b2 b1 b0 Reference Conversion Register
A/D Control Register 0 Control Signal
VREF Vref
SW5 Comparison
Resistor voltage
ladder ON Resistor
Approx. 0.6k f
AVSS A/D Conversion
Interrupt Request
Comparison reference voltage
(Vref) generator
Sampling Comparison
SW1 conducts only on the ports selected for analog input.
Connect to
SW2 and SW3 are open when A/D conversion is not in progress;
Control signal their status varies as shown by the waveforms in the diagrams on the left.
for SW2 Connect to
Connect to SW4 conducts only when A/D conversion is not in progress.
NOTE:
1. Use only as a standard for designing this data.
Mass production may cause some changes in device characteristics.
Hence, T
R0 = – ------------------- – R
X
C • ln ----
Y
Figure 18.11 shows the Analog Input Pin and External Sensor Equivalent Circuit. When the difference between
VIN and VC becomes 0.1LSB, we find impedance R0 when voltage between pins VC changes from 0 to VIN-
(0.1/1024) VIN in time T. (0.1/1024) means that A/D precision drop due to insufficient capacitor charge is held to
0.1LSB at time of A/D conversion in the 10-bit mode. Actual error however is the value of absolute precision
added to 0.1LSB.
When f(XIN) = 10 MHz, T = 0.25 µs in the A/D conversion mode without sample & hold. Output impedance R0
for sufficiently charging capacitor C within time T is determined as follows.
T = 0.25 µs, R = 2.8 kΩ, C = 6.0 pF, X = 0.1, and Y = 1024. Hence,
0.25 × 10 – 6 3
- – 2.8 ×10 ≈ 1.7 ×10
3
R0 = – --------------------------------------------------
6.0 × 10 – 12 • ln ----------- 0.1 -
1024
Thus, the allowable output impedance of the sensor equivalent circuit, making the precision (error) 0.1LSB or less,
is approximately 1.7 kΩ. maximum.
MCU
Sensor equivalent
circuit
R0 R (2.8 kΩ)
VIN
C (6.0 pF)
VC
NOTE:
1. The capacity of the terminal is assumed to be 4.5 pF.
Figure 18.11 Analog Input Pin and External Sensor Equivalent Circuit
19.1 Overview
In the flash memory, rewrite operations to the flash memory can be performed in three modes: CPU rewrite,
standard serial I/O, and parallel I/O.
Table 19.1 lists the Flash Memory Performance (refer to Table 1.1 Functions and Specifications for R8C/24
Group and Table 1.2 Functions and Specifications for R8C/25 Group for items not listed in Table 19.1).
13FFFh
User ROM area
NOTES:
1. When the FMR02 bit in the FMR0 register is set to 1 (rewrite enabled) and the FMR15 bit in the FMR1 register is set to 0 (rewrite
enabled), block 0 is rewritable. When the FMR16 bit is set to 0 (rewrite enabled), block 1 is rewritable (only for CPU rewrite mode).
2. This area is for storing the boot program provided by Renesas Technology.
04000h 04000h
13FFFh
User ROM area
0A000h
Block 1: 8 Kbytes(1) Program ROM
0BFFFh
0C000h 0C000h
Block 0: 16 Kbytes(1) Block 0: 16 Kbytes(1)
0E000h
8 Kbytes
0FFFFh 0FFFFh 0FFFFh
User ROM area User ROM area Boot ROM area
(reserved area)(2)
NOTES:
1. When the FMR02 bit in the FMR0 register is set to 1 (rewrite enabled) and the FMR15 bit in the FMR1 register is set to 0 (rewrite
enabled), block 0 is rewritable. When the FMR16 bit is set to 0 (rewrite enabled), block 1 is rewritable (only for CPU rewrite mode).
2. This area is for storing the boot program provided by Renesas Technology.
Address
4 bytes
NOTE:
1. The OFS register is assigned to 00FFFFh.
Refer to Figure 19.4 OFS Register for OFS register details.
Figure 19.5 shows the FMR0 Register. Figure 19.6 shows the FMR1 Register. Figure 19.7 shows the FMR4
Register.
19.4.2.3
www.DataSheet4U.com
FMR02 Bit
Rewriting of blocks 0 and 1 does not accept program or block erase commands if the FMR02 bit is set to 0
(rewrite disabled).
Rewriting of blocks 0 and 1 is controlled by bits FMR15 and FMR16 if the FMR02 bit is set to 1 (rewrite
enabled).
FMR00 bit in 1
Remains 0 during suspend
FMR0 register 0
www.DataSheet4U.com 1
FMR46 bit in
FMR4 register 0
FMR44 bit in 1
FMR4 register 0
FMR43 bit in 1
FMR4 register 0 Remains 1 during suspend
Check that the Check that the Check the status, Check the status,
FMR43 bit is set to 1 FMR44 bit is set to 1 and that the and that the
(during erase (during program programming ends erasure ends
execution), and that execution), and that normally. normally.
the erase-operation the program has not
has not ended. ended.
The above figure shows an example of the use of program-suspend during programming following erase-suspend.
NOTE:
1. If program-suspend is entered during erase-suspend, always restart programming.
Figure 19.9 shows the How to Set and Exit EW0 Mode. Figure 19.10 shows the How to Set and Exit EW1
Mode.
NOTES:
1. Select 5 MHz or below for the CPU clock by the CM06 bit in the CM0 register and bits CM16 to CM17 in the CM1 register.
2. To set the FMR01 bit to 1, write 0 to the FMR01 bit before writing 1. Do not generate an interrupt between writing 0 and 1.
Write to the FMR01 bit in the RAM.
3. Disable the CPU rewrite mode after executing the read array command.
Program in ROM
NOTE:
1. To set the FMR01 bit to 1, write 0 to the FMR01 bit before writing 1.
Do not generate an interrupt between writing 0 and 1.
www.DataSheet4U.com
Jump to the high-speed on-chip oscillator mode, low- Write 1 to the FMSTP bit (flash memory stops.
speed on-chip oscillator mode (XIN clock stops), and low power consumption mode)(1)
low-speed clock mode (XIN clock stops) program
which has been transferred to the RAM.
(The subsequent processing is executed by the
Switch the clock source for the CPU clock.
program in the RAM.)
Turn XIN off
Figure 19.11 Process to Reduce Power Consumption in High-Speed On-Chip Oscillator Mode,
Low-Speed On-Chip Oscillator Mode (XIN Clock Stops) and Low-Speed Clock Mode
(XIN Clock Stops)
Start
No
FMR00 = 1?
Yes
Full status check
Program completed
FMR40 = 1 No
FMR44 = 1 ?
I = 1 (enable interrupt)(3)
www.DataSheet4U.com No
FMR46 = 1 ?
No
FMR44 = 0 ?
FMR42 = 0
Yes
Program completed
REIT
Write the command code 40h
I = 1 (enable interrupt)
FMR42 = 0
No
FMR44 = 0 ?
Yes
Program completed
NOTES:
1. In EW0 mode, the interrupt vector table and interrupt routine for interrupts to be used should be allocated to the RAM area.
2. td(SR-SUS) is needed until the interrupt request is acknowledged after it is generated. The interrupt to enter suspend
should be in interrupt enabled status.
3. When no interrupt is used, the instruction to enable interrupts is not needed.
4. td(SR-SUS) is needed until program is suspended after the FMR42 bit in the FMR4 register is set to 1.
Start
No
FMR00 = 1?
Yes
Full status check
FMR40 = 1 No
FMR43 = 1 ?
FMR41 = 1(4)
I = 1 (enable interrupt)(3)
www.DataSheet4U.com No
FMR46 = 1 ?
Write D0h to any block
address Access flash memory
Yes
I = 1 (enable interrupt)
FMR41 = 0
No
FMR00 = 1 ?
Yes
NOTES:
1. In EW0 mode, the interrupt vector table and interrupt routine for interrupts to be used should be allocated to the RAM area.
2. td(SR-SUS) is needed until the interrupt request is acknowledged after it is generated. The interrupt to enter suspend
should be in interrupt enabled status.
3. When no interrupt is used, the instruction to enable interrupts is not needed.
4. td(SR-SUS) is needed until erase is suspended after the FMR41 bit in the FMR4 register is set to 1.
FMR06 = 1 Yes
and Command sequence error
FMR07 = 1? Check if command is properly input
No
No
Execute the clear status register command
(set these status flags to 0)
Yes
FMR06 = 1? Program error Yes
Program error
Figure 19.16 Full Status Check and Handling Procedure for Individual Errors
This MCU uses Standard serial I/O mode 2 and Standard serial I/O mode 3.
Refer to Appendix 2. Connection Examples between Serial Writer and On-Chip Debugging Emulator.
www.DataSheet4U.com
Contact the manufacturer of your serial programmer for details. Refer to the user’s manual of your serial
programmer for instructions on how to use it.
Table 19.7 lists the Pin Functions (Flash Memory Standard Serial I/O Mode 2), Table 19.8 lists the Pin Functions
(Flash Memory Standard Serial I/O Mode 3), and Figure 19.17 shows Pin Connections for Standard Serial I/O
Mode 3.
After processing the pins shown in Table 19.8 and rewriting the flash memory using the programmer, apply “H” to
the MODE pin and reset the hardware to run a program in the flash memory in single-chip mode.
Table 19.7 Pin Functions (Flash Memory Standard Serial I/O Mode 2)
Pin Name I/O Description
VCC,VSS Power input Apply the voltage guaranteed for programming and
erasure to the VCC pin and 0 V to the VSS pin.
RESET Reset input I Reset input pin.
P4_6/XIN P4_6 input/clock input I Connect a ceramic resonator or crystal oscillator
between the XIN and XOUT pins.
P4_7/XOUT P4_7 input/clock output I/O
P4_3/XCIN P4_3 input/clock input I Connect crystal oscillator between pins XCIN and
XCOUT.
P4_4/XCOUT P4_4 input/clock output I/O
P0_0 to P0_7 Input port P0 I Input “H” or “L” level signal or leave the pin open.
P1_0 to P1_7 Input port P1 I Input “H” or “L” level signal or leave the pin open.
P2_0 to P2_7 Input port P2 I Input “H” or “L” level signal or leave the pin open.
P3_0, P3_1, P3_3 to Input port P3 I Input “H” or “L” level signal or leave the pin open.
P3_5, P3_7
P4_2/VREF, P4_5 Input port P4 I Input “H” or “L” level signal or leave the pin open.
P6_0 to P6_5 Input port P6 I Input “H” or “L” level signal or leave the pin open.
MODE MODE I Input “L” level signal.
P6_6 TXD output O Serial data output pin.
P6_7 RXD input I Serial data input pin.
Table 19.8 Pin Functions (Flash Memory Standard Serial I/O Mode 3)
Pin Name I/O Description
VCC,VSS Power input Apply the voltage guaranteed for programming and
erasure to the VCC pin and 0 V to the VSS pin.
RESET Reset input I Reset input pin.
P4_6/XIN P4_6 input/clock input I Connect a ceramic resonator or crystal oscillator
between the XIN and XOUT pins when connecting
P4_7/XOUT P4_7 input/clock output I/O external oscillator. Apply “H” and “L” or leave the pin
open when using as input port.
www.DataSheet4U.com
P4_3/XCIN P4_3 input/clock input I Connect crystal oscillator between pins XCIN and
XCOUT when connecting external oscillator. Apply “H”
P4_4/XCOUT P4_4 input/clock output I/O and “L” or leave the pin open when using as a port.
P0_0 to P0_7 Input port P0 I Input “H” or “L” level signal or leave the pin open.
P1_0 to P1_7 Input port P1 I Input “H” or “L” level signal or leave the pin open.
P2_0 to P2_7 Input port P2 I Input “H” or “L” level signal or leave the pin open.
P3_0, P3_1, Input port P3 I Input “H” or “L” level signal or leave the pin open.
P3_3 to P3_5,
P3_7
P4_2/VREF, Input port P4 I Input “H” or “L” level signal or leave the pin open.
P4_5
P6_0 to P6_7 Input port P6 I Input “H” or “L” level signal or leave the pin open.
MODE MODE I/O Serial data I/O pin. Connect to the flash programmer.
39
38
37
36
35
34
33
32
31
30
29
28
27
40 26
41 25
42 24
43 23
44 22
www.DataSheet4U.com
45 21
R8C/24 Group
46 20
R8C/25 Group
47 19
48 18
49 17
50 16
51 15
52 14
10
11
12
13
1
2
3
4
5
6
7
8
9
MODE VSS
VCC
MCU
www.DataSheet4U.com
Data Input RXD
MODE
NOTES:
1. In this example, modes are switched between single-chip mode and
standard serial I/O mode by controlling the MODE input with a switch.
2. Connecting the oscillation is necessary. Set the main clock frequency 1
MHz to 20 MHz. Refer to Appendix Figure 2.1 Connection Example
with M16C Flash Starter (M3A-0806).
MCU
NOTES:
1. Controlled pins and external circuits vary depending on the programmer.
Refer to the programmer manual for details.
2. In this example, modes are switched between single-chip mode and
standard serial I/O mode by connecting a programmer.
3. When operating with the on-chip oscillator clock, it is not necessary to
connect an oscillating circuit.
www.DataSheet4U.com
19.7.1.3 Interrupts
Table 19.9 lists the EW0 Mode Interrupts, and Table 19.10 lists the EW1 Mode Interrupts.
NOTES:
1. Do not use the address match interrupt while a command is being executed because the vector of
the address match interrupt is allocated in ROM.
2. Do not use a non-maskable interrupt while block 0 is being automatically erased because the fixed
vector is allocated in block 0.
19.7.1.6 Program
www.DataSheet4U.com Do not write additions to the already programmed address.
P0
P1
P2 30pF
P3
P4
P6
Table 20.5 Flash Memory (Data flash Block A, Block B) Electrical Characteristics(4)
Standard
Symbol Parameter Conditions Unit
Min. Typ. Max.
− Program/erase endurance(2) 10,000(3) − − times
− Byte program time − 50 400 µs
(program/erase endurance ≤ 1,000 times)
− Byte program time − 65 − µs
(program/erase endurance > 1,000 times)
− Block erase time − 0.2 9 s
(program/erase endurance ≤ 1,000 times)
− Block erase time − 0.3 − s
www.DataSheet4U.com (program/erase endurance > 1,000 times)
td(SR-SUS) Time delay from suspend request until − − 97+CPU clock µs
suspend × 6 cycles
− Interval from erase start/restart until 650 − − µs
following suspend request
− Interval from program start/restart until 0 − − ns
following suspend request
− Time from suspend until program/erase − − 3+CPU clock µs
restart × 4 cycles
− Program, erase voltage 2.7 − 5.5 V
− Read voltage 2.2 − 5.5 V
− Program, erase temperature -20(8) − 85 °C
− Data hold time(9) Ambient temperature = 55 °C 20 − − year
NOTES:
1. VCC = 2.7 to 5.5 V at Topr = -20 to 85°C (N version) / -40 to 85°C (D version), unless otherwise specified.
2. Definition of programming/erasure endurance
The programming and erasure endurance is defined on a per-block basis.
If the programming and erasure endurance is n (n = 100 or 10,000), each block can be erased n times. For example, if 1,024
1-byte writes are performed to block A, a 1 Kbyte block, and then the block is erased, the programming/erasure endurance
still stands at one.
However, the same address must not be programmed more than once per erase operation (overwriting prohibited).
3. Endurance to guarantee all electrical characteristics after program and erase. (1 to Min. value can be guaranteed).
4. Standard of block A and block B when program and erase endurance exceeds 1,000 times. Byte program time to 1,000 times
is the same as that in program ROM.
5. In a system that executes multiple programming operations, the actual erasure count can be reduced by writing to sequential
addresses in turn so that as much of the block as possible is used up before performing an erase operation. For example,
when programming groups of 16 bytes, the effective number of rewrites can be minimized by programming up to 128 groups
before erasing them all in one operation. It is also advisable to retain data on the erase count of each block and limit the
number of erase operations to a certain number.
6. If an error occurs during block erase, attempt to execute the clear status register command, then execute the block erase
command at least three times until the erase error does not occur.
7. Customers desiring program/erase failure rate information should contact their Renesas technical support representative.
8. -40°C for D version.
9. The data hold time includes time that the power supply is off or the clock is not supplied.
Suspend request
(maskable interrupt request)
FMR46
Clock-dependent
Fixed time time
Access restart
td(SR-SUS)
www.DataSheet4U.com
Figure 20.2 Time delay until Suspend
Table 20.9 Power-on Reset Circuit, Voltage Monitor 0 Reset Electrical Characteristics(3)
Symbol Parameter Condition Standard Unit
Min. Typ. Max.
Vpor1 Power-on reset valid voltage(4) − − 0.1 V
Vpor2 Power-on reset or voltage monitor 0 reset valid 0 − Vdet0 V
voltage
trth External power VCC rise gradient(2) 20 − − mV/msec
NOTES:
1. The measurement condition is Topr = -20 to 85°C (N version) / -40 to 85°C (D version), unless otherwise specified.
2. This condition (external power VCC rise gradient) does not apply if VCC ≥ 1.0 V.
3. To use the power-on reset function, enable voltage monitor 0 reset by setting the LVD0ON bit in the OFS register to 0, the
www.DataSheet4U.com VW0C0 and VW0C6 bits in the VW0C register to 1 respectively, and the VCA25 bit in the VCA2 register to 1.
4. tw(por1) indicates the duration the external power VCC must be held below the effective voltage (Vpor1) to enable a power on
reset. When turning on the power for the first time, maintain tw(por1) for 30 s or more if -20°C ≤ Topr ≤ 85°C, maintain tw(por1) for
3,000 s or more if -40°C ≤ Topr < -20°C.
Vdet0(3) Vdet0(3)
2.2 V trth
External trth
Power VCC
Vpor2
Vpor1
tw(por1) Sampling time(1, 2)
Internal
reset signal
(“L” valid)
1 1
× 32 × 32
fOCO-S fOCO-S
NOTES:
1. When using the voltage monitor 0 digital filter, ensure that the voltage is within the MCU operation voltage
range (2.2 V or above) during the sampling time.
2. The sampling clock can be selected. Refer to 6. Voltage Detection Circuit for details.
3. Vdet0 indicates the voltage detection level of the voltage detection 0 circuit. Refer to 6. Voltage Detection
Circuit for details.
Table 20.13 Timing Requirements of Clock Synchronous Serial I/O with Chip Select(1)
Standard Unit
Symbol Parameter Conditions
Min. Typ. Max.
tSUCYC SSCK clock cycle time 4 − − tCYC(2)
tHI SSCK clock “H” width 0.4 − 0.6 tSUCYC
tLO SSCK clock “L” width 0.4 − 0.6 tSUCYC
tRISE SSCK clock rising Master − − 1 tCYC(2)
time Slave − − 1 µs
tFALL SSCK clock falling Master − − 1 tCYC(2)
time Slave − − 1 µs
tSU
www.DataSheet4U.com SSO, SSI data input setup time 100 − − ns
tH SSO, SSI data input hold time 1 − − tCYC(2)
tLEAD SCS setup time Slave 1tCYC + 50 − − ns
tLAG SCS hold time Slave 1tCYC + 50 − − ns
tOD SSO, SSI data output delay time − − 1 tCYC(2)
tSA SSI slave access time 2.7 V ≤ VCC ≤ 5.5 V − − 1.5tCYC + 100 ns
2.2 V ≤ VCC < 2.7 V − − 1.5tCYC + 200 ns
tOR SSI slave out open time 2.7 V ≤ VCC ≤ 5.5 V − − 1.5tCYC + 100 ns
2.2 V ≤ VCC < 2.7 V − − 1.5tCYC + 200 ns
NOTES:
1. VCC = 2.2 to 5.5 V, VSS = 0 V at Topr = -20 to 85°C (N version) / -40 to 85°C (D version), unless otherwise specified.
2. 1tCYC = 1/f1(s)
VIH or VOH
SCS (output)
VIH or VOH
SSCK (output)
(CPOS = 1)
tLO
tHI
www.DataSheet4U.com
SSCK (output)
(CPOS = 0)
tLO tSUCYC
SSO (output)
tOD
SSI (input)
tSU tH
VIH or VOH
SCS (output)
VIH or VOH
SSCK (output)
(CPOS = 1)
tLO
tHI
SSCK (output)
(CPOS = 0)
tLO tSUCYC
SSO (output)
tOD
SSI (input)
tSU tH
Figure 20.4 I/O Timing of Clock Synchronous Serial I/O with Chip Select (Master)
VIH or VOH
SCS (input)
VIH or VOH
SSCK (input)
(CPOS = 1)
tLO
www.DataSheet4U.com tHI
SSCK (input)
(CPOS = 0)
tLO tSUCYC
SSO (input)
tSU tH
SSI (output)
tSA tOD tOR
VIH or VOH
SSCK (input)
(CPOS = 1)
tLO
tHI
SSCK (input)
(CPOS = 0)
tLO tSUCYC
SSO (input)
tSU tH
SSI (output)
Figure 20.5 I/O Timing of Clock Synchronous Serial I/O with Chip Select (Slave)
tHI
VIH or VOH
SSCK
VIH or VOH
tLO tSUCYC
SSO (output)
www.DataSheet4U.com tOD
SSI (input)
tSU tH
Figure 20.6 I/O Timing of Clock Synchronous Serial I/O with Chip Select (Clock Synchronous
Communication Mode)
VIH
SDA
VIL
tBUF
tSTAH tSCLH tSP tSTOP
tSTAS
SCL
P(2) S(1) Sr(3) P(2)
tSCLL
tsf tsr tSDAS
tSCL
tSDAH
NOTES:
1. Start condition
2. Stop condition
3. Retransmit start condition
Timing Requirements
(Unless Otherwise Specified: VCC = 5 V, VSS = 0 V at Topr = 25°C) [VCC = 5 V]
tC(XIN) VCC = 5 V
tWH(XIN)
XIN input
tWL(XIN)
tC(XCIN)
tWH(XCIN)
XCIN input
tWL(XCIN)
Figure 20.8 XIN Input and XCIN Input Timing Diagram when VCC = 5 V
tC(TRAIO) VCC = 5 V
tWH(TRAIO)
TRAIO input
tWL(TRAIO)
tC(CK) VCC = 5 V
tW(CKH)
CLKi
tW(CKL)
th(C-Q)
TXDi
td(C-Q) tsu(D-C) th(C-D)
RXDi
i = 0 or 1
VCC = 5 V
tW(INL)
INTi input
tW(INH)
i = 0 to 3
Figure 20.11 External Interrupt INTi Input Timing Diagram when VCC = 5 V
Timing requirements
(Unless Otherwise Specified: VCC = 3 V, VSS = 0 V at Topr = 25°C) [VCC = 3 V]
tC(XIN) VCC = 3 V
tWH(XIN)
XIN input
tWL(XIN)
tC(XCIN)
tWH(XCIN)
XCIN input
tWL(XCIN)
Figure 20.12 XIN Input and XCIN Input Timing Diagram when VCC = 3 V
tC(TRAIO) VCC = 3 V
tWH(TRAIO)
TRAIO input
tWL(TRAIO)
tC(CK) VCC = 3 V
tW(CKH)
CLKi
tW(CKL)
th(C-Q)
TXDi
RXDi
i = 0 or 1
VCC = 3 V
tW(INL)
INTi input
tW(INH)
i = 0 to 3
Figure 20.15 External Interrupt INTi Input Timing Diagram when VCC = 3 V
Timing requirements
(Unless Otherwise Specified: VCC = 2.2 V, VSS = 0 V at Topr = 25°C) [VCC = 2.2 V]
XIN input
tWL(XIN)
tC(XCIN)
tWH(XCIN)
XCIN input
tWL(XCIN)
Figure 20.16 XIN Input and XCIN Input Timing Diagram when VCC = 2.2 V
TRAIO input
tWL(TRAIO)
CLKi
tW(CKL)
th(C-Q)
TXDi
RXDi
i = 0 or 1
VCC = 2.2 V
tW(INL)
INTi input
tW(INH)
i = 0 to 3
Figure 20.19 External Interrupt INTi Input Timing Diagram when VCC = 2.2 V
21.2.2 SP Setting
www.DataSheet4U.com
Set any value in the SP before an interrupt is acknowledged. The SP is set to 0000h after reset. Therefore, if an
interrupt is acknowledged before setting a value in the SP, the program may run out of control.
www.DataSheet4U.com
Interrupt source change
Disable interrupts(2, 3)
Change completed
(b) When changing the contents of an interrupt control register after disabling interrupts, be careful to
choose appropriate instructions.
Changing any bit other than IR bit
If an interrupt request corresponding to a register is generated while executing the instruction, the IR bit
may not be set to 1 (interrupt requested), and the interrupt request may be ignored. If this causes a
problem, use the following instructions to change the register: AND, OR, BCLR, BSET
www.DataSheet4U.com
Changing IR bit
If the IR bit is set to 0 (interrupt not requested), it may not be set to 0 depending on the instruction used.
Therefore, use the MOV instruction to set the IR bit to 0.
(c) When disabling interrupts using the I flag, set the I flag as shown in the sample programs below. Refer
to (b) regarding changing the contents of interrupt control registers by the sample programs.
Sample programs 1 to 3 are for preventing the I flag from being set to 1 (interrupts enabled) before the interrupt
control register is changed for reasons of the internal bus or the instruction queue buffer.
Example 1: Use NOP instructions to prevent I flag from being set to 1 before interrupt control register
is changed
INT_SWITCH1:
FCLR I ; Disable interrupts
AND.B #00H,0056H ; Set TRAIC register to 00h
NOP ;
NOP
FSET I ; Enable interrupts
NOTE:
1. Registers associated with timer RA: TRACR, TRAIOC, TRAMR, TRAPRE, and TRA.
• When the TRAPRE register is continuously written during count operation (TCSTF bit is set to 1), allow
three or more cycles of the count source clock for each write interval.
• When the TRA register is continuously written during count operation (TCSTF bit is set to 1), allow three
or more cycles of the prescaler underflow for each write interval.
NOTE:
1. Registers associated with timer RB: TRBCR, TRBOCR, TRBIOC, TRBMR, TRBPRE, TRBSC, and
TRBPR.
• If the TSTOP bit in the TRBCR register is set to 1 during timer operation, timer RB stops immediately.
• If 1 is written to the TOSST or TOSSP bit in the TRBOCR register, the value of the TOSSTF bit changes
after one or two cycles of the count source have elapsed. If the TOSSP bit is written to 1 during the period
between when the TOSST bit is written to 1 and when the TOSSTF bit is set to 1, the TOSSTF bit may be
set to either 0 or 1 depending on the content state. Likewise, if the TOSST bit is written to 1 during the
period between when the TOSSP bit is written to 1 and when the TOSSTF bit is set to 0, the TOSSTF bit
may be set to either 0 or 1.
(2) To change registers TRBPRE and TRBPR during count operation (TCSTF bit is set to 1), synchronize
the TRBO output cycle using a timer RB interrupt, etc. This operation should be preformed only once in
www.DataSheet4U.com the same output cycle. Also, make sure that writing to the TRBPR register does not occur during period
A shown in Figures 21.2 and 21.3.
Period A
Count source/
prescaler
underflow signal
(b)
(a) Period between interrupt request generation and the completion of execution of an instruction. The length of time
varies depending on the instruction being executed.
The DIVX instruction requires the longest time, 30 cycles (assuming no wait states and that a register is set as
the divisor).
(b) 20 cycles. 21 cycles for address match and single-step interrupts.
Period A
Count source/
prescaler
www.DataSheet4U.com underflow signal
The TRBO output inversion Upon detecting (i), set the secondary and
is detected at the end of the then the primary register immediately.
secondary period.
Figure 21.3 Workaround Example (b) When TRBO Pin Output Value is Read
(3) To stop the timer counting in the primary period, use the TSTOP bit in the TRBCR register. In this case,
registers TRBPRE and TRBPR are initialized and their values are set to the values after reset.
(2) Do not set both the TRBPRE and TRBPR registers to 00h.
www.DataSheet4U.com (3) Set registers TRBSC and TRBPR using the following procedure.
(a) To use “INT0 pin one-shot trigger enabled” as the count start condition
Set the TRBSC register and then the TRBPR register. At this time, after writing to the TRBPR
register, allow an interval of 0.5 or more cycles of the count source before trigger input from the
INT0 pin.
(b) To use “writing 1 to TOSST bit” as the start condition
Set the TRBSC register, the TRBPR register, and then TOSST bit. At this time, after writing to the
TRBPR register, allow an interval of 0.5 or more cycles of the count source before writing to the
TOSST bit.
• When the CSELi (i = 0 to 1) is set to 0 (the count stops at compare match of registers TRDi and
TRDGRAi), the count does not stop and the TSTARTi bit remains unchanged even if 0 (count stops) is
written to the TSTARTi bit.
• Therefore, set the TSTARTi bit to 0 to change other bits without changing the TSTARTi bit when the
CSELi bit is se to 0.
www.DataSheet4U.com • To stop counting by a program, set the TSTARTi bit after setting the CSELi bit to 1. Although the CSELi
bit is set to 1 and the TSTARTi bit is set to 0 at the same time (with 1 instruction), the count cannot be
stopped.
• Table 21.1 lists the TRDIOji (j = A, B, C, or D) Pin Output Level when Count Stops to use the TRDIOji (j
= A, B, C, or D) pin with the timer RD output.
• When writing the value to the TRDi register and continuously reading the same register, the value before
writing may be read. In this case, execute the JMP.B instruction between the writing and reading.
Program example MOV.W #XXXXh, TRD0 ;Writing
JMP.B L1 ;JMP.B
L1: MOV.W TRD0,DATA ;Reading
• When changing the count source from fOCO40M to another source and stopping fOCO40M, wait 2 cycles
of f1 or more after setting the clock switch, and then stop fOCO40M.
Change procedure
(1) Set the TSTARTi (i = 0 or 1) bit in the TRDSTR register to 0 (count stops).
(2) Change bits TCK2 to TCK0 in the TRDCRi register.
www.DataSheet4U.com (3) Wait 2 or more cycles of f1.
(4) Set the FRA00 bit in the FRA0 register to 0 (high-speed on-chip oscillator stops).
• If the value in the TRDGRA0 register is assumed to be m, the TRD0 register counts m-1, m, m+1, m, m-1,
in that order, when changing from increment to decrement operation.
When changing from m to m+1, the IMFA bit is set to 1. Also, bits CMD1 to CMD0 in the TRDFCR
register are set to 11b (complementary PWM mode, buffer data transferred at compare match between
registers TRD0 and TRDGRA0), the content in the buffer registers (TRDGRD0, TRDGRC1, and
TRDGRD1) is transferred to the general registers (TRDGRB0, TRDGRA1, and TRDGRB1).
During m+1, m, and m-1 operation, the IMFA bit remains unchanged and data are not transferred to
registers such as the TRDGRA0 register.
m+1
Setting value in
TRDGRA0
register m
Set to 0 by a program
1 No change
IMFA bit in
TRDSR0 register 0
Transferred from
Not transferred from buffer register
buffer register
When bits CMD1 to CMD0 in the
TRDGRB0 register
TRDFCR register are set to 11b
TRDGRA1 register
(transfer from the buffer register to the
TRDGRB1 register
general register at compare match of
between registers TRD0 and
TRDGRA0).
Figure 21.4 Operation at Compare Match between Registers TRD0 and TRDGRA0 in
Complementary PWM Mode
• The TRD1 register counts 1, 0, FFFFh, 0, 1, in that order, when changing from decrement to increment
operation.
The UDF bit is set to 1 when changing between 1, 0, and FFFFh operation. Also, when bits CMD1 to
CMD0 in the TRDFCR register are set to 10b (complementary PWM mode, buffer data transferred at
underflow in the TRD1 register), the content in the buffer registers (TRDGRD0, TRDGRC1, and
TRDGRD1) is transferred to the general registers (TRDGRB0, TRDGRA1, and TRDGRB1). During
FFFFh, 0, 1 operation, data are not transferred to registers such as the TRDGRB0 register. Also, at this
time, the OVF bit remains unchanged.
FFFFh
Set to 0 by a program
UDF bit in 1
TRDSR0 register 0
1 No change
OVF bit in
TRDSR0 register 0
Figure 21.5 Operation when TRD1 Register Underflows in Complementary PWM Mode
• Select with bits CMD1 to CMD0 the timing of data transfer from the buffer register to the general register.
However, transfer takes place with the following timing in spite of the value of bits CMD1 to CMD0 in the
following cases:
www.DataSheet4U.com
n3
m+1
Count value in TRD0
n2 register
n1
Count value in TRD1
0000h register
TRDGRD0 register n2 n3 n2 n1
TRDGRB0 register n1 n2 n3 n2 n1
Transfer with timing set by Transfer at Transfer at Transfer with timing set by
bits CMD1 to CMD0 underflow of TRD1 underflow of TRD1 bits CMD1 to CMD0
register because of register because
n3 > m of first setting to
n2 < m
TRDIOB0 output
TRDIOD0 output
Figure 21.6 Operation when Value in Buffer Register ≥ Value in TRDGRA0 Register in
Complementary PWM Mode
m+1
n1
www.DataSheet4U.com
Count value in TRD1 register
0000h
TRDIOB0 output
TRDIOD0 output
Figure 21.7 Operation when Value in Buffer Register Is Set to 0000h in Complementary PWM
Mode
NOTE:
1. Registers associated with timer RE: TRESEC, TREMIN, TREHR, TREWK, TRECR1, TRECR2, and
TRECSR.
Also, set all above-mentioned registers and bits (immediately before timer RE count starts) before setting the
TRECR2 register.
Figure 21.8 shows a Setting Example in Real-Time Clock Mode.
TSTART in TRECR1 = 0
www.DataSheet4U.com
TREIC←00h
(disable timer RE interrupt)
TRERST in TRECR1 = 1
Timer RE register
and control circuit reset
TRERST in TRECR1 = 0
TSTART in TRECR1 = 1
TCSTF in TRECR1 = 1?
• Using an interrupt
Read necessary contents of registers TRESEC, TREMIN, TREHR, and TREWK and the PM bit in the
TRECR1 register in the timer RE interrupt routine.
www.DataSheet4U.com
• Monitoring with a program 1
Monitor the IR bit in the TREIC register with a program and read necessary contents of registers TRESEC,
TREMIN, TREHR, and TREWK and the PM bit in the TRECR1 register after the IR bit in the TREIC
register is set to 1 (timer RE interrupt request generated).
• When writing data to the UiTB register in the clock asynchronous serial I/O mode with 9-bit transfer data
length, write data to the high-order byte first then the low-order byte, in 8-bit units.
www.DataSheet4U.com
Example (when reading transmit buffer register):
MOV.B #XXH,00A3H ; Write the high-order byte of U0TB register
MOV.B #XXH,00A2H ; Write the low-order byte of U0TB register
21.5.2.1
www.DataSheet4U.com Multimaster Operation
The following actions must be performed to use the I2C bus interface in multimaster operation.
• Transfer rate
Set the transfer rate by 1/1.8 or faster than the fastest rate of the other masters. For example, if the fastest
transfer rate of the other masters is set to 400 kbps, the I2C-bus transfer rate in this MCU should be set to
223 kbps (= 400/1.18) or more.
(a) In master receive mode while the RDRF bit in the ICSR register is set to 1, read the ICDRR register
before the rising edge of the 8th clock.
(b) In master receive mode, set the RCVD bit in the ICCR1 register to 1 (disables the next receive
operation) to perform 1-byte communications.
www.DataSheet4U.com
21.8.1.3 Interrupts
Table 21.2 lists the EW0 Mode Interrupts, and Table 21.3 lists the EW1 Mode Interrupts.
NOTES:
1. Do not use the address match interrupt while a command is being executed because the vector of
the address match interrupt is allocated in ROM.
2. Do not use a non-maskable interrupt while block 0 is being automatically erased because the fixed
vector is allocated in block 0.
21.8.1.6 Program
www.DataSheet4U.com Do not write additions to the already programmed address.
21.9.1 Inserting a Bypass Capacitor between VCC and VSS Pins as a Countermeasure
against Noise and Latch-up
Connect a bypass capacitor (at least 0.1 µF) using the shortest and thickest write possible.
Connecting and using the on-chip debugger has some special restrictions. Refer to the on-chip debugger manual for
details.
HD
*1
D
39 27
www.DataSheet4U.com
NOTE)
40 26 1. DIMENSIONS "*1" AND "*2"
DO NOT INCLUDE MOLD FLASH.
2. DIMENSION "*3" DOES NOT
bp INCLUDE TRIM OFFSET.
b1
HE
E
*2
c1
c
Reference Dimension in Millimeters
Symbol
Min Nom Max
52 Terminal cross section D 9.9 10.0 10.1
ZE
14
E 9.9 10.0 10.1
1 13 A2 1.4
ZD Index mark HD 11.8 12.0 12.2
HE 11.8 12.0 12.2
A 1.7
F A1 0.05 0.1 0.15
c
A2
A
L c1 0.125
y *3
e bp
x L1 0° 8°
e 0.65
Detail F x 0.13
y 0.10
ZD 1.1
ZE 1.1
L 0.35 0.5 0.65
L1 1.0
b1
S AB
w S B
b
D S AB
w S A
e
A
H
e
E
E
TXD
VCC
52
51
50
49
48
47
46
45
44
43
42
41
40
1 39
www.DataSheet4U.com 2 38
3 37
R8C/25 Group
R8C/24 Group
4 36
MODE 5 35
6 34
7 33
RESET 8 32
Connect oscillation 9 31
circuit(1)
VSS 10 30
11 29
12 28
13 14 27
15
16
17
18
19
20
21
22
23
24
25
26
10
TXD 7 VSS
RXD 4
1 VCC
NOTE:
1. An oscillation circuit must be connected, even when
operating with the on-chip oscillator clock.
Appendix Figure 2.1 Connection Example with M16C Flash Starter (M3A-0806)
VCC
52
51
50
49
48
47
46
45
44
43
42
41
40
4 36
5 35
6 34
7 33
Connect oscillation 8 32
circuit(1) 9 31
12 RESET 12 28
MODE 13 27
10
7 MODE
14
15
16
17
18
19
20
21
22
23
24
25
26
8
VCC 6
4
2
VSS
E8 emulator NOTE:
(R0E000080KCE00) 1. It is not necessary to connect an oscillation circuit
when operating with the on-chip oscillator clock.
VCC
52
51
50
49
48
47
46
45
44
43
42
41
40
1 39
www.DataSheet4U.com 2 38
3 37
4 36
R8C/25 Group
R8C/24 Group
5 35
Connect 6 34
oscillation
7 33
circuit
RESET 8 32
9 31
Connect
oscillation VSS 10 30
circuit 11 29
12 28
13 27
14
15
16
17
18
19
20
21
22
23
24
25
26
NOTE:
1. After reset, the XIN and XCIN clocks stop.
Write a program to oscillate the XIN and XCIN clocks.
Index
[A] PUR1 .....................................................................................57
AD ....................................................................................... 386
ADCON0 ............................................................................. 385
[R]
ADCON1 ............................................................................. 386
ADCON2 ............................................................................. 386 RMAD0 ................................................................................121
RMAD1 ................................................................................121
ADIC .................................................................................... 106
AIER .................................................................................... 121
[S]
[C] S0RIC ..................................................................................106
S0TIC ...................................................................................106
CM0 ....................................................................................... 75
S1RIC ..................................................................................106
CM1 ....................................................................................... 76
www.DataSheet4U.com S1TIC ...................................................................................106
CPSRF .................................................................................. 80
SAR ......................................................................................343
CSPR .................................................................................. 129
SSCRH ................................................................................308
SSCRL .................................................................................309
[F] SSER ...................................................................................311
FMR0 .................................................................................. 406 SSMR ...................................................................................310
FMR1 .................................................................................. 407 SSMR2 .................................................................................313
FMR4 .................................................................................. 408 SSRDR ................................................................................314
FRA0 ..................................................................................... 78 SSSR ...................................................................................312
FRA1 ..................................................................................... 78 SSTDR .................................................................................314
FRA2 ..................................................................................... 79 SSUIC ..................................................................................107
FRA4 ..................................................................................... 79
FRA6 ..................................................................................... 79
[T]
FRA7 ..................................................................................... 79
TRA ......................................................................................136
TRACR .................................................................................135
[I] TRAIC ..................................................................................106
ICCR1 ................................................................................. 338 TRAIOC .......................................135, 137, 140, 142, 144, 147
ICCR2 ................................................................................. 339 TRAMR ................................................................................136
ICDRR ................................................................................. 344 TRAPRE ..............................................................................136
ICDRS ................................................................................. 344 TRBCR .................................................................................151
ICDRT ................................................................................. 343 TRBIC ..................................................................................106
ICIER ................................................................................... 341 TRBIOC ...............................................152, 154, 158, 160, 165
ICMR ................................................................................... 340 TRBMR ................................................................................152
ICSR .................................................................................... 342 TRBOCR ..............................................................................151
IICIC .................................................................................... 107 TRBPR .................................................................................153
INT0IC ................................................................................. 108 TRBPRE ..............................................................................153
INT1IC ................................................................................. 108 TRBSC .................................................................................153
INTEN ................................................................................. 115 TRD0 ............................................192, 207, 222, 233, 245, 258
INTF .................................................................................... 116 TRD0IC ................................................................................107
TRD1 ............................................................192, 207, 222, 245
TRD1IC ................................................................................107
[K] TRDCR0 ......................................188, 203, 219, 231, 242, 256
KIEN .................................................................................... 119 TRDCR1 ......................................................188, 203, 219, 242
KUPIC ................................................................................. 106 TRDDF0 ...............................................................................187
TRDDF1 ...............................................................................187
TRDFCR ......................................186, 200, 217, 229, 240, 253
[L] TRDGRAi (i = 0 to 1) ....................193, 208, 223, 234, 245, 259
LINCR ................................................................................. 370 TRDGRBi (i = 0 to 1) ....................193, 208, 223, 234, 245, 259
LINST .................................................................................. 371 TRDGRCi (i = 0 to 1) ...................193, 208, 223, 234, 245, 259
TRDGRDi (i = 0 to 1) ...................193, 208, 223, 234, 245, 259
TRDIER0 ......................................192, 207, 221, 233, 244, 258
[O]
TRDIER1 ......................................192, 207, 221, 233, 244, 258
OCD ...................................................................................... 77 TRDIORA0 ...................................................................189, 204
OFS ....................................................................... 27, 128, 401 TRDIORA1 ...................................................................189, 204
TRDIORC0 ...................................................................190, 205
[P] TRDIORC1 ...................................................................190, 205
TRDMR ........................................184, 198, 215, 228, 239, 252
P2DRR .................................................................................. 58
TRDOCR ..............................................................202, 219, 255
PDi (i = 0 to 4 and 6) ............................................................. 56
TRDOER1 ............................................201, 218, 230, 241, 254
Pi (i = 0 to 4 and 6) ................................................................ 56
TRDOER2 ............................................201, 218, 230, 241, 254
PM0 ....................................................................................... 71
TRDPMR ..............................................................185, 199, 216
PM1 ....................................................................................... 71
TRDPOCR0 .........................................................................222
PMR .............................................................. 58, 293, 314, 344
TRDPOCR1 .........................................................................222
PRCR .................................................................................. 100
TRDSR0 .......................................191, 206, 220, 232, 243, 257
PUR0 ..................................................................................... 57
www.DataSheet4U.com
[U]
U0BRG ................................................................................ 291
U0C0 ................................................................................... 292
U0C1 ................................................................................... 293
U0MR .................................................................................. 291
U0RB ................................................................................... 290
U0TB ................................................................................... 290
U1BRG ................................................................................ 291
U1C0 ................................................................................... 292
U1C1 ................................................................................... 293
U1MR .................................................................................. 291
U1RB ................................................................................... 290
U1SR ................................................................................... 293
U1TB ................................................................................... 290
[V]
VCA1 ..................................................................................... 36
VCA2 ............................................................................... 36, 80
VW0C .................................................................................... 37
VW1C .................................................................................... 38
VW2C .................................................................................... 39
[W]
WDC .................................................................................... 128
WDTR ................................................................................. 129
WDTS .................................................................................. 129
Description
Rev. Date
Page Summary
0.10 Jul 27, 2005 − First Edition issued
0.20 Jan 16, 2006 all pages • “Preliminary” deleted
• Symbol name “TRDMDR” → “TRDMR”, “SSUAIC” → “SSUIC”,
“IIC2AIC” → “IICIC”, and “TSTOP0, TSTOP1” → “CSEL0, CSEL1”
www.DataSheet4U.com revised
• Pin name “TCLK” → “TRDCLK” revised
• Bit name “TPSC0 to TPSC2” → “TCK0 to TCK2”, “TRD0 count stop bit”
→ “TRD0 count operation select bit”, and “TRD1 count stop bit” →
“TRD1 count operation select bit” revised
2 Table 1.1 Functions and Specifications for R8C/24 Group revised
3 Table 1.2 Functions and Specifications for R8C/25 Group revised
4 Figure 1.1 Block Diagram;
“Peripheral Functions” added,
“System Clock Generation” → “System Clock Generator” revised
5 Table 1.3 Product Information for R8C/24 Group revised
6 Table 1.4 Product Information of R8C/25 Group revised
7 Figure 1.4 Pin Assignment (Top View);
“VSS” → “VSS/AVSS” and “VCC” → “VCC/AVCC” revised
8 Table 1.5 Pin Functions;
“Analog power supply input” added, “Reference voltage input” revised
9 Table 1.6 Pin Name Information by Pin Number
“VSS” → “VSS/AVSS” and “VCC” → “VCC/AVCC” revised
10 Figure 2.1 CPU Registers;
“Reserved Area” → “Reserved Bit” revised
12 2.8.10 Reserved Area;
“Reserved Area” → “Reserved bit” revised
13 Figure 3.1 Memory Map of R8C/24 Group;
“Program area” → “program ROM” revised
14 3.2 R8C/25 Group, Figure 3.2 Memory Map of R8C/25 Group;
“Data area” → “data flash”, “Program area” → “program ROM” revised
15 Table 4.1 SFR Information(1);
0012h: “X0h” → “00h”
0016h: “X0h” → “00h”
0024h: “TBD” → “When shipping”
NOTES 3 and 4 revised
24 Figure 5.4 OFS Register; NOTE1 revised and NOTE3 added
25 5.1.1 When Power Supply is Stable (2) revised
5.1.2 Power On (4) revised
26 Figure 5.5 Example of Hardware Reset Circuit and Operation and Figure
5.6 Example of Hardware Reset Circuit (Usage Example of External
Supply Voltage Detection Circuit) and Operation revised
C-1
REVISION HISTORY R8C/24 Group, R8C/25 Group Hardware Manual
Description
Rev. Date
Page Summary
0.20 Jan 16, 2006 27 5.2 Power-On Reset Function “When a capacitor is ... or more.” added
Figure 5.7 Example of Power-On Reset Circuit and Operation revised
28 5.4 Voltage Monitor 1 Reset;
“When ... VCC pin drops the Vdet1 ...” → “When ... VCC pin reaches to
the Vdet1 ...” revised
www.DataSheet4U.com
30 to 67 “6. Programmable I/O Ports” → “6. Voltage Detection Circuit” and
“7. Voltage Detection Circuit” → “7. Programmable I/O Ports” revised
33 Figure 6.5 Registers VCA1 and VCA2; VCA2 register revised
34 Figure 6.6 VW0C Register revised
46 Figure 7.2 Configuration of Programmable I/O Ports (2) revised
47 Figure 7.3 Configuration of Programmable I/O Ports (3) revised
49 Figure 7.5 Configuration of Programmable I/O Ports (5) revised
50 Figure 7.6 Configuration of Programmable I/O Ports (6) revised
51 Figure 7.7 Configuration of Programmable I/O Ports (7) revised
56 to 66 7.4 Port setting added;
Table 7.4 Port P0_0/AN7 to Table 7.47 Port P6_7/INT3/RXD1 added
67 Table 7.48 Unassigned Pin Handling revised
69 9. Bus revised;
“However, only following SFRs are ... accessed at a time.” added
Table 9.2 Bus Cycles by Access Space of the R8C/25 Group added,
Table 9.3 Access Unit and Bus Operations;
“SFR” → “SFR, data flash”,
“ROM/RAM” → “ROM (program ROM), RAM” revised
71 Figure 10.1 Clock Generation Circuit revised
72 Figure 10.2 CM0 Register revised
73 Figure 10.3 CM1 Register revised
75 Figure 10.5 Registers FRA0 and FRA1; FRA0 register revised
77 Figure 10.8 VCA2 Register added
78 Figure 10.9 Examples of XIN Clock Connection Circuit revised
79 10.2.2 High-Speed On-Chip Oscillator Clock;
“To use the high-speed on-chip ... or more).” added
80 10.3 XCIN Clock “To input an external clock ... pin open.” added
81 10.4.2 CPU Clock “Use the XCIN clock while ... stabilizes.” added
10.4.3 Peripheral Function Clock (f1, f2, f4, f8, f32, fC4, and fC32);
“Use fC4 and fC32 while the XCIN clock oscillation stabilizes.” added
10.4.5 fOCO40M;
“fOCO40M can be ... supply voltage VCC = 3.0 to 5.5 V.” added
10.4.8 fOCO128 added
82 Table 10.2 Settings and Modes of Clock Associated Bits revised
C-2
REVISION HISTORY R8C/24 Group, R8C/25 Group Hardware Manual
Description
Rev. Date
Page Summary
0.20 Jan 16, 2006 83 10.5.1.2 Low-Speed Clock Mode;
“In this mode, stopping the XIN clock ... the VCA20 bit.” added
10.5.1.4 Low-Speed On-Chip Oscillator Mode;
“In this mode, stopping the XIN clock ... the VCA20 bit.” added
84 Figure 10.11 Handling Procedure of Internal Power Low Consumption
www.DataSheet4U.com Enabled by VCA20 bit added
88 Figure 10.12 State Transition in Power Control Mode revised
89 10.6.1 How to Use Oscillation Stop Detection Function;
“• This function cannot be... is 2 MHz or below. ...” →
“• This function cannot be... is below 2 MHz. ...” revised
92 10.7.1 Stop Mode and 10.7.2 Wait Mode → 10.7.1 Stop Mode and Wait
Mode revised
10.7.3 Oscillation Stop Detection Function;
“Since ... is 2 MHz or below, ...” → “Since ... is below 2 MHz. ...” revised
“To use this MCU with supply voltage ... to the chip externally.” added
10.7.4 fOCO40M added
107 Figure 12.11 Interrupt Priority Level Judgement Circuit; NOTE2 deleted
114 Figure 12.18 Registers AIER and RMAD0 to RMAD1;
AIER and RMAD0 to RMAD1 register revised
119 12.6.7 Entering Wait Mode after Oscillation Stop Detection Interrupt is
Detected added
121 Figure 13.2 Registers OFS and WDC; OFS register NOTE1 revised and
NOTE3 added, and WDC register NOTE1 deleted
126 Table 14.1 Functional Comparison of Timers;
Input Pin: Timer RD “TRDCLK” added
127 Figure 14.1 Block Diagram of Timer RA revised
135 Table 14.3 Pulse Output Mode Specifications revised
142 Table 14.6 Pulse Period Measurement Mode Specifications revised
144 Figure 14.11 Operating Example of Pulse Period Measurement Mode revised
146 Figure 14.12 Block Diagram of Timer RB revised
147 Figure 14.13 Registers TRBCR and TRBOCR; TRBOCR register revised
149 Figure 14.15 Registers TRBPRE, TRBSC, and TRBPR;
TRBPR register revised
158 Figure 14.20 TRBIOC Register in Programmable One-Shot Generation
Mode
Figure 14.23 Registers TRBIOC and TRBMR in Programmable One-
Shot Generation Mode; TRBIOC register NOTE2 revised
162 Figure 14.25 Registers TRBIOC and TRBMR in Programmable Wait
One-Shot Generation Mode; TRBIOC register NOTE2 revised
165 -Output compare function;
“(Pin output can be changed at detection)” added
C-3
REVISION HISTORY R8C/24 Group, R8C/25 Group Hardware Manual
Description
Rev. Date
Page Summary
0.20 Jan 16, 2006 166 to 168 Tables 14.12 Pin Functions TRDIOA0/TRDCLK(P2_0)
Tables 14.13 Pin Functions TRDIOB0(P2_1)
Tables 14.14 Pin Functions TRDIOC0(P2_2)
Tables 14.15 Pin Functions TRDIOD0(P2_3)
Tables 14.16 Pin Functions TRDIOA1(P2_4)
www.DataSheet4U.com Tables 14.17 Pin Functions TRDIOB1(P2_5)
Tables 14.18 Pin Functions TRDIOC1(P2_6)
Tables 14.19 Pin Functions TRDIOD1(P2_7)
Tables 14.20 Pin Functions INT0(P4_5) added
170 14.3.1 Mode Selection deleted
170 Table 14.21 Count Source Selection revised
14.3.1 Count Sources;
“TRDCRi register to ...” → “TRDCRi register (i = 0 or 1) to ...” revised
171 Figure14.29 Buffer Operation in Input Capture Function revised
172 Figure14.30 Buffer Operation in Output Capture Function revised
14.3.2 Buffer Operation;
“input capture and ...” → “timer mode (input capture and ...”
“the IOC2 to IOC0 bits in ...” → “the IOC2 bit in ...”
“the IOA2 to IOA0 bits in ...” → “the IOA2 bit in ...”
“the IOD2 to IOD0 bits in ...” → “the IOD2 bit in ...”
“the IOB2 to IOC0 bits in ...” → “the IOB2 bit in ...” revised
“Bits IMFC and IMFD in the TRDSRi...input capture function.” added
173 14.3.3 Synchronous Operation;
“For the synchronous operation, ... register = 110b).” deleted
174 14.3.4 Pulse Output Forced Cutoff;
“P2D” → “PD2”, “P4D” → “PD4”, and “P4_5” → “PD4_5”, revised
“According to the selection ... details of interrupts.” added
176 14.3.5 Input Capture Function;
“The TRDGRA0 register can also ... trigger input.” added
Figure 14.33 Block Diagram of Input Capture Function revised
177 Table 14.23 Specifications of Input Capture Function revised
178 Figure 14.34 Registers TRDSTR and TRDMR in Input Capture Function
revised
179 Figure 14.35 TRDPMR Register in Input Capture Function revised
180 Figure 14.36 TRDFCR Register in Input Capture Function revised
183 Figure 14.39 Registers TRDIORA0 to TRDIORA1 in Input Capture
Function revised
184 Figure 14.40 Registers TRDIORC0 to TRDIORC1 in Input Capture
Function revised
185 Figure 14.41 Registers TRDSR0 to TRDSR1 in Input Capture Function
revised
187 Table 14.25 Input Pin Function in Input Capture Function deleted
189 14.3.5.1 Digital Filter;
“TRDDF register ...” → “TRDDFi register ...” revised
C-4
REVISION HISTORY R8C/24 Group, R8C/25 Group Hardware Manual
Description
Rev. Date
Page Summary
0.20 Jan 16, 2006 192 Figure 14.48 Registers TRDSTR and TRDMR in Output Compare
Function revised
193 Figure 14.49 TRDPMR Register in Output Compare Function revised
194 Figure 14.50 TRDFCR Register in Output Compare Function revised
195 Figure 14.51 Registers TRDOER1 to TRDOER2 in Output Compare
www.DataSheet4U.com
Function;
TRDOER2 register: NOTE1 added
198 Figure 14.54 Registers TRDIORA0 to TRDIORA1 in Output Compare
Function revised
199 Figure 14.55 Registers TRDIORC0 to TRDIORC1 in Output Compare
Function revised
200 Figure 14.56 Registers TRDSR0 to TRDSR1 in Output Compare
Function revised
209 Figure 14.64 Registers TRDSTR and TRDMR in PWM Mode revised
210 Figure 14.65 TRDPMR Register in PWM Mode revised
211 Figure 14.66 TRDFCR Register in PWM Mode revised
212 Figure 14.67 Registers TRDOER1 to TRDOER2 in PWM Mode;
TRDOER2 register: NOTE1 added
214 Figure 14.69 Registers TRDSR0 to TRDSR1 in PWM Mode revised
222 Figure 14.77 Registers TRDSTR to TRDMR in Reset Synchronous
PWM Mode revised
223 Figure 14.78 TRDFCR Register in Reset Synchronous PWM Mode
revised
224 Figure 14.79 Registers TRDOER1 to TRDOER2 in Reset Synchronous
PWM Mode;
TRDOER2 register: NOTE1 added
226 Figure 14.81 Registers TRDSR0 to TRDSR1 in Reset Synchronous
PWM Mode revised
232 Figure 14.87 TRDSTR Register in Complementary PWM Mode revised
233 Figure 14.88 TRDMR Register in Complementary PWM Mode revised
234 Figure 14.89 TRDFCR Register in Complementary PWM Mode revised
235 Figure 14.90 Registers TRDOER1 to TRDOER2 in Complementary
PWM Mode;
TRDOER2 register: NOTE1 added
237 Figure 14.92 Registers TRDSR0 to TRDSR1 in Complementary PWM
Mode revised
244 Figure 14.98 Block Diagram of PWM3 Mode revised
245 Table 14.33 Specifications of PWM3 Mode revised
246 Figure 14.99 TRDSTR Register in PWM3 Mode revised
247 Figure 14.100 TRDMR Register in PWM3 Mode revised
248 Figure 14.101 TRDFCR Register in PWM3 Mode revised
C-5
REVISION HISTORY R8C/24 Group, R8C/25 Group Hardware Manual
Description
Rev. Date
Page Summary
0.20 Jan 16, 2006 249 Figure 14.102 Registers TRDOER1 to TRDOER2 in PWM3 Mode;
TRDOER2 register: NOTE1 added
251 Figure 14.104 TRDCR0 Register in PWM3 Mode NOTE1 deleted
252 Figure 14.105 TRDSR0 Register in PWM3 Mode revised
253 Figure 14.106 TRDIER0 Register in PWM3 Mode revised
www.DataSheet4U.com
255 Table 14.34 TRDGRji Register Functions in PWM3 Mode revised
256 Figure 14.109 Operating Example of PWM3 Mode revised
259 14.3.12.1 TRDSTR Register (i = 0 or 1) added
260 14.3.12.4 “Count Clock Source Switch” → “Count Source Switch”
revised
264 14.3.12.9 Count Source fOCO40M added
275 Table 14.39 Output Compare Mode Specifications revised
281 Figure 14.132 Setting Example in Real-Time Clock Mode revised
285 Figure 15.3 Registers U0TB to U1TB and U0RB to U1RB revised
286 Figure 15.4 Registers U0BRG to U1BRG and U0MR to U1MR; U0BRG
to U1BRG register revised
287 Figure 15.5 Registers U0C0 to U1C0 NOTE1 added
295 Table 15.5 Registers Used and Settings for UART Mode;
UiBRG: “−” → “0 to 7” revised
300 Table 16.1 Mode Selections revised
358 Figure 16.46 Example of Register Setting in Master Transmit Mode
(Clock Synchronous Serial Mode);
“• Set the IICSEL bit in the PMR register to 1” added
377 Table 18.1 Performance of A/D converter revised
378 Figure 18.1 Block Diagram of A/D Converter;
“VSS” → “AVSS” and “Vref” → “Vcom” revised
387 to 389 18.4 A/D Conversion Cycles to 18.6 Inflow Current Bypass Circuit added
390 18.7 Notes on A/D Converter
“• Connect 0.1µF capacitor ... VSS pin.” →
“• Connect 0.1µF capacitor ... AVSS pin.” revised
391 Table 19.1 Flash Memory Version Performance;
• Program and Erase Endurance:(Program area) → (Program ROM),
(Data area) → (Data flash) revised
• NOTE3 added
392 19.2 Memory Map;
“The user ROM ... area ... Block A and B.” →
“The user ROM ... area (program ROM) ... Block A and B (data flash).”
revised
Figure 19.1 Flash Memory Block Diagram for R8C/24 Group revised
393 Figure 19.2 Flash Memory Block Diagram for R8C/25 Group revised
395 Figure 19.4 OFS Register; NOTE1 revised and NOTE3 added
398 19.4.2.4 FMSTP Bit revised
C-6
REVISION HISTORY R8C/24 Group, R8C/25 Group Hardware Manual
Description
Rev. Date
Page Summary
0.20 Jan 16, 2006 399 19.4.2.16 FMR47 Bit revised
402 Figure 19.7 FMR4 Register NOTE4 revised
405 Figure 19.11 Process to Reduce Power Consumption in High-Speed On-
Chip Oscillator Mode, Low-Speed On-Chip Oscillator Mode (XIN Clock
Stops) and Low-Speed Clock Mode (XIN Clock Stops) revised
www.DataSheet4U.com
408 19.4.3.5 Block Erase;
“The block erase command cannot be ... program-suspend.” added
409 Figure 19.14 Block Erase Command (When Using Erase-Suspend
Function) revised
412 Figure 19.15 Full Status Check and Handling Procedure for Individual
Errors revised
414 Figure 19.16 Pin Connections for Standard Serial I/O Mode revised
419 19.7.1.9 Program and Erase Voltage for Flash Memory added
420 Table 20.1 Absolute Maximum Ratings;
“VCC” →”VCC/AVCC” revised
Table 20.2 Recommended Operating Conditions revised
421 Table 20.3 A/D Converter Characteristics revised
422 Table 20.4 Flash Memory (Program ROM) Electrical Characteristics
revised
423 Table 20.5 Flash Memory (Data flash Block A, Block B) Electrical revised
424 Table 20.6 Voltage Detection 0 Circuit Electrical Characteristics revised
Table 20.7 Voltage Detection 1 Circuit Electrical Characteristics revised
Table 20.8 Voltage Detection 2 Circuit Electrical Characteristics revised
425 Table 20.9 Reset Circuit Electrical Characteristics (When Using Voltage
Monitor 0 Reset) NOTE2 revised
426 Table 20.11 High-speed On-Chip Oscillator Circuit Electrical
Characteristics revised
Table 20.12 Low-speed On-Chip Oscillator Circuit Electrical
Characteristics revised
Table 20.13 Power Supply Circuit Timing Characteristics revised
427 Table 20.14 Timing Requirements of Clock Synchronous Serial I/O with
Chip Select revised
431 Table 20.15 Timing Requirements of I2C bus Interface NOTE1 revised
432 Table 20.16 Electrical Characteristics (1) [VCC = 5 V] revised
433 Table 20.17 Electrical Characteristics (2) [VCC = 5 V] revised
434 Table 20.18 XIN Input, XCIN Input revised
435 Table 20.20 Serial Interface revised
436 Table 20.22 Electrical Characteristics (3) [VCC = 3 V] revised
437 Table 20.23 Electrical Characteristics (4) [Vcc = 3 V] revised
438 Table 20.24 XIN Input, XCIN Input revised
439 Table 20.26 Serial Interface revised
440 Table 20.28 Electrical Characteristics (5) [VCC = 2.2 V] revised
C-7
REVISION HISTORY R8C/24 Group, R8C/25 Group Hardware Manual
Description
Rev. Date
Page Summary
0.20 Jan 16, 2006 441 Table 20.29 Electrical Characteristics (6) [Vcc = 2.2 V] revised
442 Table 20.30 XIN Input, XCIN Input revised
Table 20.31 TRAIO Input, INT1 Input revised
443 Table 20.32 Serial Interface revised
Table 20.33 External Interrupt INTi (i = 0, 2, 3) Input
www.DataSheet4U.com
444 21.1.1 Stop Mode and 21.1.2 Wait Mode → 21.1.1 Stop Mode and Wait
Mode revised
21.1.3 Oscillation Stop Detection Function;
“Since ... is 2 MHz or below, ...” → “Since ... is below 2 MHz. ...” revised
“To use this MCU with supply voltage ... to the chip externally.” added
21.1.4 fOCO40M added
447 21.2.7 Entering Wait Mode after Oscillation Stop Detection Interrupt is
Detected added
462 21.7 Notes on A/D Converter
“• Connect 0.1µF capacitor ... VSS pin.” →
“• Connect 0.1µF capacitor ... AVSS pin.” revised
465 21.8.1.9 Program and Erase Voltage for Flash Memory added
467 22. Notes for On-Chip Debugger;
(1) and (6) added, “(2) Do not use addresses ... addresses.” deleted
468 Appendix 1. Package Dimensions;
“TBD” → “PLQP0052JA-A (52P6A-A)” added
469 Appendix Figure 2.1 Connection Example with M16C Flash Starter
(M3A-0806) revised
Appendix Figure 2.2 Connection Example with E8 Emulator
(R0E000080KCE00) revised
470 Appendix Figure 3.1 Example of Oscillation Evaluation Circuit revised
1.00 May 31, 2006 all pages “Under development” deleted
3 Table 1.2 Functions and Specifications for R8C/25 Group revised
4 Figure 1.1 Block Diagram;
“System clock generator” → “System clock generation circuit” revised
5 to 6 Table 1.3 Product Information for R8C/24 Group and Table 1.4 Product
Information for R8C/25 Group; A part of (D) mark is deleted.
9 Table 1.6 Pin Name Information by Pin Number NOTE1 added
15 Table 4.1 SFR Information(1);
001Ch: “00h” → “00h, 10000000b” revised
0029h: High-Speed On-Chip Oscillator Control Register 4 FRA4 When shipping added
002Bh: High-Speed On-Chip Oscillator Control Register 6 FRA6 When shipping added
NOTE6 added
19 Table 4.5 SFR Information(5);
0118h: Timer RE Second Data Register / Counter Data Register,
0119h: Timer RE Minute Data Register / Compare Data Register
register name revised
C-8
REVISION HISTORY R8C/24 Group, R8C/25 Group Hardware Manual
Description
Rev. Date
Page Summary
1.00 May 31, 2006 20 Table 4.6 SFR Information(6);
0143h: “11000000b” → “11100000b” revised
24 Figure 5.4 OFS Register NOTE2 revised
25 5.1.1 When Power Supply is Stable (2) revised
5.1.2 Power On (4) revised
www.DataSheet4U.com
26 Figure 5.5 Example of Hardware Reset Circuit and Operation and Figure
5.6 Example of Hardware Reset Circuit (Usage Example of External
Supply Voltage Detection Circuit) and Operation revised
27 Figure 5.7 Example of Power-On Reset Circuit and Operation revised
28 5.3 Voltage Monitor 0 Reset revised
33 Figure 6.5 Registers VCA1 and VCA2; VCA2 register NOTE6 revised
45 to 51 Figures 7.1 to .7.7 Configuration of Programmable I/O Ports NOTE1 added
53 Figure 7.9 PDi (i = 0 to 4 and 6) Registers NOTE3 added
54 Figure 7.11 Registers PUR0 and PUR1; After Reset revised
62 Table 7.31 Port P3_4/SDA/SCS revised
70 Table 10.1 Specifications of Clock Generation Circuit revised
71 Figure 10.1 Clock Generation Circuit revised
72 Figure 10.2 CM0 Register; NOTE6 deleted and NOTE9 revised
74 Figure 10.4 OCD Register revised
75 Figure 10.5 Registers FRA0 and FRA1; FRA0 register NOTE2 revised
76 Figure 10.6 Registers FRA2, FRA4, and FRA6;
FRA2 register NOTE2 deleted, registers FRA4 and FRA6 added
77 Figure 10.8 VCA2 Register NOTE6 revised
78 Figure 10.9 Examples of XIN Clock Connection Circuit NOTE1 revised
79 10.2.2 High-Speed On-Chip Oscillator Clock revised
81 10.4.3 Peripheral Function Clock (f1, f2, f4, f8, and f32) revised
82 10.4.9 fC4 and fC32 added
83 Table 10.2 Settings and Modes of Clock Associated Bits revised
84 10.5.1.2 Low-Speed Clock Mode revised
85 10.5.2.2 Entering Wait Mode and 10.5.2.3 Pin Status in Wait Mode
revised
86 10.5.2.4 Exiting Wait Mode;
“When using a peripheral ...instruction is executed.” page changed
Table 10.3 Interrupts to Exit Wait Mode and Usage Conditions revised
87 10.5.2.4 Exiting Wait Mode;
“When exiting by a peripheral ... CPU clock supply is started.” →
“When exiting by a peripheral ... CM07 bit in the CM0 register.” revised
Figure 10.11 Time between Wait Mode and Interrupt Routine Execution added
88 10.5.2.5 Reducing the Internal Power Consumption added
Figure 10.12 Handling Procedure of Internal Power Low Consumption
Enabled by VCA20 bit revised
C-9
REVISION HISTORY R8C/24 Group, R8C/25 Group Hardware Manual
Description
Rev. Date
Page Summary
1.00 May 31, 2006 89 Table 10.4 Interrupts to Exit Stop Mode and Usage Conditions revised
90 Figure 10.13 Time between Stop Mode and Interrupt Routine Execution
added
92 10.6.1 How to Use Oscillation Stop Detection Function revised
93 Figure 10.15 Procedure for Switching Clock Source from Low-Speed
www.DataSheet4U.com
On-Chip Oscillator to XIN Clock revised
94 Figure 10.16 Example of Determining Interrupt Source for Oscillation
Stop Detection, Watchdog Timer, Voltage Monitor 1, or Voltage Monitor 2
Interrupt revised
95 10.7.1 Stop Mode and Wait Mode revised and 10.7.4 fOCO40M deleted
97 Figure 12.1 Interrupts revised
107 Table 12.5 IPL Value When Software or Special Interrupt Is
Acknowledged revised
109 Figure 12.10 Priority Levels of Hardware Interrupts revised
122 12.6.7 Entering Wait Mode after Oscillation Stop Detection Interrupt is
Detected deleted
123 Figure 13.1 Block Diagram of Watchdog Timer revised
124 Figure 13.2 Registers OFS and WDC; OFS Register NOTE2 revised
128 14. Timers; “The count source for each timer ... and reloading.” deleted
130 14.1 Timer RA; “The count source for timer RA ... and reloading.” added
Figure 14.1 Block Diagram of Timer RA revised
131 Figure 14.2 Registers TRACR and TRAIOC revised
132 Figure 14.3 Registers TRAMR, TRAPRE, and TRA revised
133 Table 14.2 Timer Mode Specifications revised
Figure 14.4 TRAIOC Register in Timer Mode revised
(Figure 14.4 TRACR Register in Timer Mode deleted, Figure 14.5
Registers TRAIOC and TRAMR in Timer Mode TRAMR register deleted)
134 14.1.1.1 Timer Write Control during Count added
Figure 14.5 Operating Example of Timer RA when Count Value is
Rewritten during Count added
135 Table 14.3 Pulse Output Mode Specifications revised
136 Figure 14.6 TRAIOC Register in Pulse Output Mode revised
(Figure 14.6 Registers TRACR and TRAIOC in Pulse Output Mode TRACR
register deleted, Figure 14.7 TRAMR Register in Pulse Output Mode deleted)
137 Table 14.4 Event Counter Mode Specifications revised
138 Figure 14.7 TRAIOC Register in Event Counter Mode revised
(Figure 14.8 Registers TRACR and TRAIOC in Event Counter Mode
TRACR register deleted, Figure 14.9 TRAMR Register in Event
Counter Mode deleted)
139 Table 14.5 Pulse Width Measurement Mode Specifications revised
C - 10
REVISION HISTORY R8C/24 Group, R8C/25 Group Hardware Manual
Description
Rev. Date
Page Summary
1.00 May 31, 2006 140 Figure 14.8 TRAIOC Register in Pulse Width Measurement Mode revised
(Figure 14.10 Registers TRACR and TRAIOC in Pulse Width
Measurement Mode TRACR register deleted, Figure 14.11 TRAMR
Register in Pulse Width Measurement Mode deleted)
141 Figure 14.9 Operating Example of Pulse Width Measurement Mode revised
www.DataSheet4U.com
142 Table 14.6 Pulse Period Measurement Mode Specifications revised
143 Figure 14.10 TRAIOC Register in Pulse Period Measurement Mode revised
(Figure 14.13 Registers TRACR and TRAIOC in Pulse Period
Measurement Mode TRACR register deleted, Figure 14.14 TRAMR
Register in Pulse Period Measurement Mode deleted)
144 Figure 14.11 Operating Example of Pulse Period Measurement Mode revised
146 14.2 Timer RB; “The count source for timer RB ... and reloading.” added
• Timer mode: ... (peripheral function clock ... added
Figure 14.12 Block Diagram of Timer RB revised
147 Figure 14.13 Registers TRBCR and TRBOCR revised
148 Figure 14.14 Registers TRBIOC and TRBMR revised
149 Figure 14.15 Registers TRBPRE, TRBSC, and TRBPR revised
150 Table 14.7 Timer Mode Specifications revised
Figure 14.16 TRBIOC Register in Timer Mode revised
(Figure 14.20 Registers TRBIOC and TRBMR in Timer Mode TRBMR
register deleted)
151 14.2.1.1 Timer Write Control during Count added
152 Figure 14.17 Operating Example of Timer RB when Count Value is
Rewritten during Count added
153 Table 14.8 Programmable Waveform Generation Mode Specifications
revised
154 Figure 14.18 TRBIOC Register in Programmable Waveform Generation
Mode revised
(Figure 14.20 Registers TRBIOC and TRBMR in Timer Mode TRBMR
register deleted)
Figure 14.19 Operating Example of Timer RB in Programmable
Waveform Generation Mode revised
155 Table 14.9 Programmable One-Shot Generation Mode Specifications revised
156 Figure 14.20 TRBIOC Register in Programmable One-Shot Generation
Mode revised
(Figure 14.23 Registers TRBIOC and TRBMR in Programmable One-
Shot Generation Mode TRBMR register deleted)
157 Figure 14.21 Operating Example of Programmable One-Shot
Generation Mode revised
158 14.2.3.1 Selecting One-shot Trigger added
159 Table 14.10 Programmable Wait One-Shot Generation Mode
Specifications revised
C - 11
REVISION HISTORY R8C/24 Group, R8C/25 Group Hardware Manual
Description
Rev. Date
Page Summary
1.00 May 31, 2006 161 Figure 14.22 TRBIOC Register in Programmable Wait One-Shot
Generation Mode
(Figure 14.25 Registers TRBIOC and TRBMR in Programmable Wait
One-Shot Generation Mode TRBMR register deleted)
162 Figure 14.23 Operating Example of Programmable Wait One-Shot
www.DataSheet4U.com Generation Mode revised
163 14.2.5 Notes on Timer RB;
“• ... Timer RB starts counting at the first ... 1 (during count).” deleted
“• When the TSTOP bit in the TRBCR register ... immediately stops.
• If the TOSST bit or the TOSSP bit ... also be set to 0 or 1.” added
165 Table 14.12 Pin Functions TRDIOA0/TRDCLK(P2_0) revised
167 Table 14.20 Pin Functions INT0(P4_5) revised
179 Figure 14.33 TRDFCR Register in Input Capture Function NOTE2 revised
193 Figure 14.47 TRDFCR Register in Output Compare Function NOTE2 revised
210 Figure 14.63 TRDFCR Register in PWM Mode NOTE2 revised
220 Table 14.29 Reset Synchronous PWM Mode Specifications revised
222 Figure 14.75 TRDFCR Register in Reset Synchronous PWM Mode
NOTES 1 and 3 revised
225 Figure 14.78 Registers TRDSR0 to TRDSR1 in Reset Synchronous
PWM Mode revised
227 Table 14.30 TRDGRji Register Functions in Reset Synchronous PWM
Mode revised
233 Figure 14.86 TRDFCR Register in Complementary PWM Mode NOTES
1 and 4 revised
239 14.3.9 Complementary PWM Mode;
“Since a value cannot be written to ... BFC1, and BFD1.” added
244 Table 14.33 Specifications of PWM3 Mode revised
247 Figure 14.98 TRDFCR Register in PWM3 Mode NOTE2 revised
254 Table 14.34 TRDGRji Register Functions in PWM3 Mode revised,
14.3.10 PWM3 Mode; “Registers TRDGRC0, ... and BFD1.” added
258 14.3.12.1 TRDSTR Register (i = 0 or 1);
“• Table 14.36 lists the TRDIOji (j = A, B, C, ... timer RD output.” added
259 14.3.12.6 Reset Synchronous PWM Mode; Change procedure (2) revised
14.3.12.7 Complementary PWM Mode;
•Change bits CMD1 to CMD0 in the TRDFCR register in the ... ;
Change procedure: When setting to complementary ... (2) ,
Change procedure: When stopping complementary ... (1) and (2) revised
•Do not write to ... ; “However, set to the TRDGRD0, ... BFD1.” added
263 14.3.12.8 PWM3 Mode deleted
264 14.4 Timer RE; “The count source for timer RE ... operations.” added
265 Figure 14.112 Block Diagram of Real-Time Clock Mode revised
C - 12
REVISION HISTORY R8C/24 Group, R8C/25 Group Hardware Manual
Description
Rev. Date
Page Summary
1.00 May 31, 2006 287 Figure 15.6 Registers U0C1 to U1C1, U1SR, and PMR;
U0C1 to U1C1 register NOTE2 added
288 Table 15.1 Clock Synchronous Serial I/O Mode Specifications revised
289 15.1 Clock Synchronous Serial I/O Mode;
“Table 15.3 ... The TXD0 pin ...” → “Table 15.3 ... The TXDi pin ...” revised
www.DataSheet4U.com
294 15.2 Clock Asynchronous Serial I/O (UART) Mode;
“Table 15.6 ... The TXD0 pin ...” → “Table 15.6 ... The TXDi pin ...” revised
296 Figure 15.11 Receive Timing Example in UART Mode;
“RI bit” → “IR bit” revised
300 Table 16.2 Clock Synchronous Serial I/O with Chip Select Specifications;
“φ” → “f1” revised and NOTE2 deleted
304 Figure 16.4 SSMR Register
307 Figure 16.7 SSMR2 Register revised
308 Figure 16.8 Registers SSTDR and SSRDR; SSTDR registers NOTE1 deleted
309 16.2.1 Transfer Clock; “φ” → “f1” revised
314 16.2.5.2 Data Transmission;
“When setting the MCU is set as a slave device, ... enabled.” deleted
316 Figure 16.14 Sample Flowchart of Data Transmission (Clock
Synchronous Communication Mode) NOTE2 deleted
319 16.2.5.4 Data Transmission/Reception;
“When the MCU is set as the slave device, ... enabled.” deleted
320 Figure 16.17 Sample Flowchart of Data Transmission/Reception (Clock
Synchronous Communication Mode) NOTE2 deleted
322 Figure 16.18 Initialization in 4-Wire Bus Communication Mode revised
323 16.2.6.2 Data Transmission;
“When the MCU is set as a slave device, ... enabled.” deleted
358 Figure 16.47 Example of Register Setting in Master Receive Mode (I2C
bus Interface Mode) revised
362 to 375 17. Hardware LIN;
“Sync Break” → “Synch Break” and “Sync Field” → “Synch Field” revised
362 Figure 17.1 Block Diagram of Hardware LIN revised
364 Figure 17.2 LINCR Register revised
365 Figure 17.3 LINST Register revised
366 Figure 17.4 Typical Operation when Sending a Header Field
“RAIC” → “TRAIC” revised
367 Figure 17.5 Example of Header Field Transmission Flowchart (1) revised
368 Figure 17.6 Example of Header Field Transmission Flowchart (2) revised
369 17.4.2 Slave Mode (5) revised
Figure 17.7 Typical Operation when Receiving a Header Field revised
370 Figure 17.8 Example of Header Field Reception Flowchart (1) revised
371 Figure 17.9 Example of Header Field Reception Flowchart (2) revised
C - 13
REVISION HISTORY R8C/24 Group, R8C/25 Group Hardware Manual
Description
Rev. Date
Page Summary
1.00 May 31, 2006 372 Figure 17.10 Example of Header Field Reception Flowchart (3) revised
373 Figure 17.11 Typical Operation when a Bus Collision is Detected;
“RAIC” → “TRAIC” revised
374 17.5 Interrupt Requests;
“There are four ... Sync Break generation completed, ... , and bus collision
www.DataSheet4U.com
detection.” → “There are three ... , and bus collision detection.” revised
Table 17.2 Interrupt Requests of Hardware LIN revised
376 Table 18.1 Performance of A/D converter revised
380 Table 18.2 One-Shot Mode Specifications revised
384 Figure 18.6 ADCON0 Register in Repeat Mode revised
386 18.3 Sample and Hold;
“... to 28 φAD cycles for 8-bit resolution or 33 φAD resolution” and
“When performing A/D conversion, charge the sampling time.” deleted
387 Figure 18.10 Internal Equivalent Circuit of Analog Input revised
388 18.6 Inflow Current Bypass Circuit deleted
18.6 Output Impedance of Sensor under A/D Conversion added
389 18.7 Notes on A/D Converter revised
394 Figure 19.4 OFS Register NOTE2 revised
395 Table 19.3 Differences between EW0 Mode and EW1 Mode revised
397 19.4.2.1 FMR00 Bit
“... (including suspend periods) ...” added
399 Figure 19.5 FMR0 Register NOTE6 added
401 Figure 19.7 FMR4 Register; NOTES 2, 3 and 4 revised and NOTE5 added
402 Figure 19.8 Timing of Suspend Operation revised
405 19.4.3.1 Read Array Command
“The MCU also enters read array mode after a reset.” added
19.4.3.2 Read Status Register Command
“The MCU remains in read status mode ... command is written.” added
406 19.4.3.4 Program Command;
“When suspend function disabled, ...”, “When suspend function
enabled, the FMR44 bit ... when auto-programming completes.” added
Figure 19.12 Program Command (When Suspend Function Disabled) title revised
407 Figure 19.13 Program Command (When Suspend Function Enabled) added
408 19.4.3.5 Block Erase revised
Figure 19.14 Block Erase Command (When Erase-Suspend Function
Disabled) title revised
409 Figure 19.15 Block Erase Command (When Erase-Suspend Function
Enabled) revised
410 Table 19.5 Status Register Bits revised
413 19.5 Standard Serial I/O Mode revised
Table 19.7 Pin Functions (Flash Memory Standard Serial I/O Mode 2) added
414 Table 19.8 Pin Functions (Flash Memory Standard Serial I/O Mode 3) revised
C - 14
REVISION HISTORY R8C/24 Group, R8C/25 Group Hardware Manual
Description
Rev. Date
Page Summary
1.00 May 31, 2006 415 Figure 19.17 Pin Connections for Standard Serial I/O Mode 3 title revised
416 Figure 19.18 Pin Processing in Standard Serial I/O Mode 2 added,
Figure 19.19 Pin Processing in Standard Serial I/O Mode 3 title revised
420 19.7.1.7 Reset Flash Memory deleted
421 Table 20.2 Recommended Operating Conditions revised
www.DataSheet4U.com
422 Figure 20.1 Ports P0 to P4, P6 Timing Measurement Circuit; title revised
423 Table 20.4 Flash Memory (Program ROM) Electrical Characteristics
revised
424 Table 20.5 Flash Memory (Data flash Block A, Block B) Electrical
Characteristics revised
425 Figure 20.2 Time delay until Suspend title revised
426 Table 20.9 Voltage Monitor 0 Reset Electrical Characteristics → Table
20.9 Power-on Reset Circuit, Voltage Monitor 0 Reset Electrical
Characteristics revised
Table 20.10 Power-on Reset Circuit Electrical Characteristics (When Not
Using Voltage Monitor 0 Reset) deleted
Figure 20.3 Power-on Reset Circuit Electrical Characteristics revised
427 Table 20.10 High-speed On-Chip Oscillator Circuit Electrical
Characteristics revised
Table 20.11 Low-speed On-Chip Oscillator Circuit Electrical
Characteristics revised
434 Table 20.16 Electrical Characteristics (2) [Vcc = 5 V] revised
438 Table 20.22 Electrical Characteristics (4) [Vcc = 3 V] revised
442 Table 20.28 Electrical Characteristics (6) [Vcc = 2.2 V] revised
445 21.1.1 Stop Mode and Wait Mode revised and 21.1.4 fOCO40M deleted
448 21.2.7 Entering Wait Mode after Oscillation Stop Detection Interrupt is
Detected deleted
450 21.3.2 Notes on Timer RB;
“• ... Timer RB starts counting at the first ... 1 (during count).” deleted
“• When the TSTOP bit in the TRBCR register ... immediately stops.
• If the TOSST bit or the TOSSP bit ... also be set to 0 or 1.” added
451 21.3.3.1 TRDSTR Register (i = 0 or 1) revised
452 21.3.3.6 Reset Synchronous PWM Mode; Change procedure (2) revised
21.3.3.7 Complementary PWM Mode;
•Change bits CMD1 to CMD0 in the TRDFCR register in the ...;
Change procedure: When setting to complementary ... (2) ,
Change procedure: When stopping complementary ... (1) and (2) revised
•Do not write to ...; “However, set to the TRDGRD0, ... BFD1.” added
456 21.3.3.8 PWM3 Mode deleted
462 21.6 Notes on Hardware LIN; “Sync Break” → “Synch Break” revised
463 21.7 Notes on A/D Converter revised
466 21.8.1.7 Reset Flash Memory deleted
C - 15
REVISION HISTORY R8C/24 Group, R8C/25 Group Hardware Manual
Description
Rev. Date
Page Summary
1.00 May 31, 2006 468 22. Notes on On-Chip Debugger; (2) revised
469 Appendix 1. Package Dimensions
“The latest package ... Renesas Technology website.” added
2.00 Nov 01, 2006 all pages “PTLG0064JA-A (64F0G)” package added
Y version added
www.DataSheet4U.com
Factory programming product added
1 1. Overview; “... or a 64-pin molded-plastic FLGA.“ added
2, 3 Table 1.1 Functions and Specifications for R8C/24 Group, Table 1.2
Functions and Specifications for R8C/25 Group;
Package: “64-pin molded-plastic FLGA” added
9 Figure 1.4 PLQP0052JA-A Package Pin Assignments (Top View);
NOTE3 revised
10 Figure 1.5 PTLG0064JA-A Package Pin Assignments added
18 Table 4.1 revised
36 Figure 6.5 NOTE6 revised
61 Table 7.17 revised
62 Table 7.19 revised
66 Table 7.33, Table 7.35 revised
67 Table 7.36 revised
78 Figure 10.5 NOTE2 added
80 Figure 10.8 NOTE6 revised
81 Figure 10.9 revised
82 10.2.2 “Adjust the FRA1 register so that .... 40 MHz or less.” added
90 Figure 10.11 revised
91 Figure 10.12 revised
93 Figure 10.13 revised
98 10.7.1 revised, 10.7.2 added
123 12.6.3 “and Table 20.18 (VCC = 5V), ... TRAIO Input, INT1 Input.”
deleted
127 Figure 13.2; Watchdog Timer Control Register: After Reset “When read,
the content is undefined.” added
140 Table 14.4; TRAO pin function: Specification “or pulse output” added
198 Figure 14.49 NOTE2 added
215 Figure 14.65 Timer RD Output Control Register NOTE2 added
220 Figure 14.71 revised
252 Figure 14.100 NOTE2 added
262 14.3.12.7 “Do not use the TRDGRC0 register in complementary PWM
mode.” deleted
291 Table 15.1 NOTE2 revised
296 Table 15.4 NOTE1 revised
C - 16
REVISION HISTORY R8C/24 Group, R8C/25 Group Hardware Manual
Description
Rev. Date
Page Summary
2.00 Nov 01, 2006 298 Figure 15.10 revised
306 Figure 16.3 NOTE2 revised
337 Figure 16.26 NOTE3 revised
344 to 349 Figure 16.32, Figure 16.33, Figure 16.34, Figure 16.35, Figure 16.36
revised
www.DataSheet4U.com
370 Figure 17.5 revised
374 Figure 17.9 revised
375 Figure 17.10 revised
377 17.4.4 added
378 Table 17.2 Cause of Interrupt “8” → “6”
384 Table 18.2; Stop condition: Specification “when the ADCAP .... (software
trigger)” added, Input pin: Specification “AN8” → “AN0”
395 Figure 19.1 revised
396 Figure 19.2 revised
411 Figure 19.13 NOTE3 added
413 Figure 19.15 NOTE3 added
416 Figure 19.16 revised
425 Table 20.1 Absolute Maximum Ratings; NOTE1 added
432 Table 20.10; “VCC = 4.5 V to 5.5 V -20°C ≤ Topr ≤ 85°C”, “VCC = 4.5 V to
5.5 V -40°C ≤ Topr ≤ 85°C” added
Oscillation stability time: Condition “VCC = 5.0 V, Topr = 25°C” deleted
Table 5.11; Oscillation stability time: Condition “VCC = 5.0 V,
Topr = 25°C” deleted
438 Table 20.15; IIH, IIL, RPULLUP Condition: “Vcc = 5V” added
439 Table 20.16; Condition: High-speed on-chip oscillator mode revised
440 Table 20.17 added
441 Figure 20.8 revised
443 Table 20.22; IIH, IIL, RPULLUP Condition: “Vcc = 3V” added
444 Table 20.23; Condition “Increase during A/D converter operation” added
445 Figure 20.12 revised
448 Table 20.29; Condition “Increase during A/D converter operation” added
449 Figure 20.16 revised
475 Package Dimensions; “PTLG0064JA-A (64F0G)” added
3.00 Feb 29, 2008 − “RENESAS TECHNICAL UPDATE” reflected:
TN-16C-A164A/E, TN-16C-A165A/E, TN-16C-A166A/E,
TN-16C-A167A/E
2, 3 Table 1.1, Table 1.2 Clock; “Real-time clock (timer RE)” added
5, 7 Table 1.3, Table 1.4 revised
6, 8 Figure 1.2, Figure 1.3; ROM number “XXX” added
16, 17 Figure 3.1, Figure 3.2; “Expanded area” deleted
C - 17
REVISION HISTORY R8C/24 Group, R8C/25 Group Hardware Manual
Description
Rev. Date
Page Summary
3.00 Feb 29, 2008 18 Table 4.1; “002Ch” added, “003Bh” “003Ch” “003Dh” deleted
27 Figure 5.3 revised
27, 128, Figure 5.4, Figure 13.2, Figure 19.4; “OFS Register” revised
401
28 5.1.1, 5.1.2; “Wait for 1/fOCO-S × 20.” → “Wait for 10 µs or more.”
www.DataSheet4U.com
29 Figure 5.5, Figure 5.6 revised
30 5.2, Figure 5.7 revised
36 Figure 6.5 NOTE6 revised
61, 62 Table 7.17, Table 7.19 revised
65 Table 7.29, Table 7.30 revised
70 Table 7.48 revised
73 10. “(with oscillation stop detection function)” deleted
74 Figure 10.1 revised
75 Figure 10.2 NOTE4 revised
78 Figure 10.5 NOTE2 revised
79 Figure 10.6 “FRA7 Register” added
80 Figure 10.8 NOTE6 revised
81 Figure 10.9 added
83 10.2.2 revised
88 10.5.1.2, 10.5.1.4 revised
90 Table 10.3 revised
92 10.5.2.5, Figure 10.13 revised
94 Figure 10.14 revised
96 10.6.1 revised
99 10.7.1, 10.7.2 revised
103 12.1.3.1 revised
105 Table 12.2 “Reference” revised
115 12.2.1 revised
120 Table 12.6 revised, NOTE2 added
124 12.6.4 deleted
125 Figure 12.20 NOTE2 revised
133 Table 14.1 “• fC32” deleted
134 Figure 14.1 “TSTART” → “TCSTF”
138 Figure 14.5 “... to 0 (During count).” → “... to 1 (During count).”
149 14.1.6 revised, “• When the TRAPRE ...” “• When the TRA ...” added
150 14.2 “The reload register ...” deleted
Figure 14.12 revised
153 Table 14.15 revised
156 Figure 14.17 “... to 0 (During count).” → “... to 1 (During count).”
C - 18
REVISION HISTORY R8C/24 Group, R8C/25 Group Hardware Manual
Description
Rev. Date
Page Summary
3.00 Feb 29, 2008 159 Table 14.9 NOTE2 added
“...0 (one-shot stops).” → “...1 (one-shot stops).”
“TRBP pin function” → “TRBO pin function”
160 Figure 14.20 “... When write, ...” → “... If necessary, ...”
164 Table 14.10 NOTE2 added
www.DataSheet4U.com
167 to 170 14.2.5 revised
14.2.5.1, 14.2.5.2, 14.2.5.3, 14.2.5.4 added
197, 214 Table 14.25, Table 14.27;
“at the same time as the TRDi register ... 0000h” deleted
198, 215 Figure 14.47, Figure 14.63; “TRDSTR register” revised
201 Figure 14.50 “TRDOER1 register” revised
206 Figure 14.55 revised
209 Figure 14.59 “of counter clear” deleted
212 Figure 14.61 revised
214 Table 14.27 revised
220 Figure 14.68 revised
227, 251 Table 14.29, Table 14.33;
“at the same time as the TRD0 register ... 0000h” deleted
228 Figure 14.76 revised
232 Figure 14.80 revised
238 Figure 14.86 revised
239 Figure 14.87 revised
243 Figure 14.91 revised
252 Figure 14.98 “TRDSTR register” revised
257 Figure 14.103 revised
261 Figure 14.107 revised
264 14.3.12.1, Table 14.36; “after the count is cleared” deleted
277 Figure 14.121 “00” → “00b”
286 Figure 14.130 revised
291 Figure 15.4 “UARTi Transmit/Receive Mode Register” NOTE2 deleted
293 Figure 15.6 “(b7-b4)” → “(b7-b6)”
300 Table 15.5 NOTE2 added
303 Table 15.7 revised
304 15.3 revised
308 Figure 16.2 NOTE4 deleted
309 Figure 16.3 revised, NOTE4 deleted
310 Figure 16.4 NOTE2 deleted
311 Figure 16.5 NOTE1 deleted
312 Figure 16.6 NOTE2, NOTE7 revised
313 Figure 16.7 NOTE5 revised
C - 19
REVISION HISTORY R8C/24 Group, R8C/25 Group Hardware Manual
Description
Rev. Date
Page Summary
3.00 Feb 29, 2008 314 Figure 16.8;
SSTDR register: NOTE1 deleted, SSRDR register: NOTE2 deleted
328 Figure 16.18 revised
334 16.2.8.1 deleted
338 Figure 16.24 NOTE6 revised
www.DataSheet4U.com
339 Figure 16.25 NOTE5 deleted
340 Figure 16.26 NOTE7 deleted
341 Figure 16.27 NOTE3 revised
342 Figure 16.28 NOTE7 revised
343, 344 Figure 16.29, Figure 16.30; NOTE1 deleted
367 16.3.8.1 revised, 16.3.8.2 added
368 Figure 17.1 revised
373 Figure 17.5 “... in LINST register → 0” → “... in LINST register → 1”
374 Figure 17.6 revised
375 Figure 17.7 revised
377 Figure 17.9 revised
379 Figure 17.11 “SCDCT” → “BCDCT”
380 Figure 17.12 revised
385, 388, Figure 18.2, Figure 18.4, Figure 18.6; NOTE4 revised
391
394 Figure 18.10 revised
396 18.7 revised
397 Table 19.2 revised
402 Table 19.3 revised
403 19.4.1, 19.4.2; “(SR-ES)” → “(SR-SUS)”
404 19.4.2.4 “located outside ... memory.” → “transferred to the RAM.”
405 19.4.2.15 revised
406 Figure 19.5 NOTE3, NOTE5 revised
408 Figure 19.7 NOTE5 revised
410 Figure 19.9 revised
411 Figure 19.11 revised
413 19.4.3.4 revised
414 Figure 19.13 revised
416 Figure 19.15 revised
418 Table 19.6 “FRM00 Register” → “FRM0 Register”
420 Table 19.7 revised
429 Table 20.2 NOTE2 revised
435 Table 20.10 revised, NOTE4 added
454 21.1.1, 21.1.2 revised
C - 20
REVISION HISTORY R8C/24 Group, R8C/25 Group Hardware Manual
Description
Rev. Date
Page Summary
3.00 Feb 29, 2008 455 21.2.4 deleted
456 Figure 21.1 NOTE2 revised
458 21.3.1 revised, “• When the TRAPRE ...” “• When the TRA ...” added
459 to 462 21.3.2 revised
21.3.2.1, 21.3.2.2, 21.3.2.3, 21.3.2.4 added
www.DataSheet4U.com
463 21.3.1.1, Table 21.1; “after the count is cleared” deleted
470 Figure 21.8 revised
472 21.4 revised
473 2.5.1.1 deleted, 2.5.2.1 revised, 2.5.2.2 added
475 21.7 revised
482 Appendix Figure 2.1, Appendix Figure 2.2 revised
483 Appendix Figure 3.1 revised
C - 21
www.DataSheet4U.com