RENESAS R8C-1A, R8C-1B User Manual

REJ09B0252-0110
16
R8C/1A Group, R8C/1B Group
Hardware Manual
RENESAS 16-BIT SINGLE-CHIP MICROCOMPUTER
M16C FAMILY / R8C/Tiny SERIES
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.1.10 Revision Date: Mar 17, 2006
www.renesas.com

Keep safety first in your circuit designs!

1.
Renesas Technology Corp. puts the maximum effort into making semiconductor products better and more reliable, but there is always the possibility that trouble may occur with them. Trouble with semiconductors may lead to personal injury, fire or property damage. Remember to give due consideration to safety when making your circuit designs, with ap­propriate measures such as (i) placement of substitutive, auxiliary circuits, (ii) use of non­flammable material or (iii) prevention against any malfunction or mishap.

Notes regarding these materials

1.
These materials are intended as a reference to assist our customers in the selection of the Renesas Technology Corp. product best suited to the customer's application; they do not convey any license under any intellectual property rights, or any other rights, belonging to Renesas Technology Corp. or a third party.
2.
Renesas Technology Corp. assumes no responsibility for any damage, or infringement of any third-party's rights, originating in the use of any product data, diagrams, charts, pro­grams, algorithms, or circuit application examples contained in these materials.
3.
All information contained in these materials, including product data, diagrams, charts, pro­grams and algorithms represents information on products at the time of publication of these materials, and are subject to change by Renesas Technology Corp. without notice due to product improvements or other reasons. It is therefore recommended that customers con­tact Renesas Technology Corp. or an authorized Renesas Technology Corp. product dis­tributor for the latest product information before purchasing a product listed herein. The information described here may contain technical inaccuracies or typographical errors. Renesas Technology Corp. assumes no responsibility for any damage, liability, or other loss rising from these inaccuracies or errors. Please also pay attention to information published by Renesas Technology Corp. by vari­ous means, including the Renesas Technology Corp. Semiconductor home page (http:// www.renesas.com).
4.
When using any or all of the information contained in these materials, including product data, diagrams, charts, programs, and algorithms, please be sure to evaluate all informa­tion as a total system before making a final decision on the applicability of the information and products. Renesas Technology Corp. assumes no responsibility for any damage, liabil­ity or other loss resulting from the information contained herein.
5.
Renesas Technology Corp. semiconductors are not designed or manufactured for use in a device or system that is used under circumstances in which human life is potentially at stake. Please contact Renesas Technology Corp. or an authorized Renesas Technology Corp. product distributor when considering the use of a product contained herein for any specific purposes, such as apparatus or systems for transportation, vehicular, medical, aerospace, nuclear, or undersea repeater use.
6.
The prior written approval of Renesas Technology Corp. is necessary to reprint or repro­duce in whole or in part these materials.
7.
If these products or technologies are subject to the Japanese export control restrictions, they must be exported under a license from the Japanese government and cannot be im­ported into a country other than the approved destination. Any diversion or reexport contrary to the export control laws and regulations of Japan and/ or the country of destination is prohibited.
8.
Please contact Renesas Technology Corp. for further details on these materials or the products contained therein.

General Precautions in the Handling of MPU/MCU Products

The following usage notes are applicable to all MPU/MC U pr o duct s fr om R e nesas. For d et a il ed usa ge not es on the products covered by this manual, refer to the relevant sections of the manual. If the descriptions un der 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.
1. Handling of Unused Pins
Handle unused pins in accord with the directions given under Handling of Unused Pins in the manual.
The input pins of CMOS products are generally in the high-impedance state. In operation with an
unused pin in the open-circuit state, extra electromagnetic noise is induced in the vicinity of LSI, an associated shoot-through current flows internally, and malfunctions occur due to the false recognition of the pin state as an input signal become possible. Unused pins should be handled as described under Handling of Unused Pins in the manual.
2. Processing at Power-on
The state of the product is undefined at the moment when power is supplied.
The states of internal circuits in the LSI are indeterminate and the states of register settings and pins
are undefined at the moment when power is supplied.
In a finished product where the reset signal is applied to the external reset pin, the states of pins are not guaranteed from the moment when power is supplied until the reset process is completed.
In a similar way, the states of pins in a product that is reset by an on-chip power-on reset function are not guaranteed from the moment when power is supplied until the power reaches the level at which resetting has been specified.
3. Prohibition of Access to Reserved Addresses
Access to reserved addresses is prohibited.
The reserved addresses are provided for the possible future expansion of functions. Do not access
these addresses; the correct operation of LSI is not guaranteed if they are accessed.
4. Clock Signals
After applying a reset, only release the reset line after the operating clock signal has become stable. When switching the clock signal during program execution, wait until the target clock signal has stabilized.
When the clock signal is generated with an external resonator (or from an external oscillator) during
a reset, ensure that the reset line is only released after full stabilization of the clock signal. Moreover, when switching to a clock signal produced with an external resonator (or by an external oscillator) while program execution is in progress, wait until the target clock signal is stable.
5. Differences between Products
Before changing from one product to another, i.e. to one with a different type number, confirm that the change will not lead to problems.
The characteristics of MPU/MCU in the same group but having different type numbers may differ
because of the differences in internal memory capacity and layout pattern. When changing to products of different type numbers, implement a system-evaluation test for each of the products.

How to Use This Manual

1. Purpose and Target Readers
This manual is designed to provide the user with an understanding of the hardware functions and electrical characteristics of the MCU. It is intended for users designing application systems incorporating the MCU. A basic knowledge of electric circuits, logical circuits, and MCUs is necessary in order to use this manual. The manual comprises an overview of the product; descriptions of the CPU, system control functions, peripheral functions, and electrical characteristics; and usage notes.
Particular 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/1A Group, R8C/1B Group. Make sure to refer to the latest versions of these documents. The newest versions of the documents li sted may be obtained fro m the Renesas Technology Web site.
Document Type Description Document Title Document No.
Datasheet Hardware overview and electrical characteristics R8C/1A Group,
R8C/1B Group Datasheet
Hardware manual Hardware specifications (pin assignments,
memory maps, peripheral function specifications, electrical characteristics, timing charts) and operation description Note: Refer to the application notes for details on using peripheral functions.
Software manual Description of CPU instruction set R8C/Tiny Series
Application note Information on using peripheral functions and
application examples Sample programs Information on writing programs in assembly language and C
Renesas technical update
Product specifications, updates on documents, etc.
R8C/1A Group, R8C/1B Group Hardware Manual
Software Manual Available from Renesas
Technology Web site.
REJ03B0144
This hardware manual
REJ09B0001
2. Notation of Numbers and Symbols
The notation conventions for register names, bit names, numbers, and symbols used in this manual are described below.
(1) Register Names, Bit Names, and Pin Names
Registers, bits, and pins are referred to in the text by symbols. The symbol is accompanied by the word “register,” “bit,” or “pin” to distinguish the three categories. Examples the PM03 bit in the PM0 register
P3_5 pin, VCC pin
(2) Notation of Numbers
The indication “b” is appended to numeric valu es given i n binary format. However, nothing is appended to the values of single bits. The indication “h” is appended to numeric values given in hexadecimal format. Nothing is appended to numeric values given in decimal format. Examples Binary: 11b
Hexadecimal: EFA0h Decimal: 1234
3. Register Notation
The symbols and terms used in register diagrams are described below.
XXX Register
b7 b6 b5 b4 b3 b2 b1 b0
0
XXX0
XXX1
(b2)
(b3)
XXX4
XXX5
XXX6
XXX7
*1
Symbol Address After Reset XXX XXX 00h
Bit NameBit Symbol
XXX bits
Nothing is assigned. If necessary, set to 0. When read, the content is undefined.
Reserved bits
XXX bits
XXX bit
b1 b0
1 0: XXX 0 1: XXX 1 0: Do not set. 1 1: XXX
Set to 0.
Function varies according to the operating mode.
0: XXX 1: XXX
Function
RW
RW
RW
RW
RW
WO
RW
RO
*2
*3
*4
*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
Abbreviation Full Form ACIA Asynchronous Communication Interface Adapter bps bits per second CRC Cyclic Redundancy Check DMA Direct Memory Access DMAC Direct Memory Access Controller GSM Global System for Mobile Communications Hi-Z High Impedance IEBus Inter Equipment bus I/O Input/Output IrDA Infrared Data Association LSB Least Significant Bit MSB Most Significant Bit NC Non-Connection PLL Phase Locked Loop PWM Pulse Width Modulation SFR Special Function Registers SIM Subscriber Identity Module UART Universal Asynchronous Receiver/Transmitter VCO Voltage Controlled Oscillator

Table of Contents

SFR Page Reference B - 1
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..........................................................................................7
1.6 Pin Functions.............................................................................................10
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/1A Group...........................................................................................16
3.2 R8C/1B Group...........................................................................................17
A - 1
4. Special Function Registers (SFRs) 18
5. Programmable I/O Ports 22
5.1 Functions of Programmable I/O Ports.......................................................22
5.2 Effect on Peripheral Functions..................................................................22
5.3 Pins Other than Programmable I/O Ports..................................................22
5.4 Port Settings..............................................................................................30
5.5 Unassigned Pin Handling..........................................................................35
6. Resets 36
6.1 Hardware Reset ........................................................................................38
6.1.1 When Power Supply is Stable............................................................38
6.1.2 Power On............................................................................................38
6.2 Power-On Reset Function.........................................................................40
6.3 Voltage Monitor 1 Reset ...........................................................................41
6.4 Voltage Monitor 2 Reset............................................................................41
6.5 Watchdog Timer Reset..............................................................................41
6.6 Software Reset..........................................................................................41
7. Voltage Detection Circuit 42
7.1 VCC Input Voltage.....................................................................................48
7.1.1 Monitoring Vdet1 ................................................................................48
7.1.2 Monitoring Vdet2 ................................................................................48
7.1.3 Digital Filter.........................................................................................48
7.2 Voltage Monitor 1 Reset............................................................................50
7.3 Voltage Monitor 2 Interrupt and Voltage Monitor 2 Reset......................... 51
8. Processor Mode 53
8.1 Processor Modes ...................................................................................... 53
9. Bus 55
10. Clock Generation Circuit 56
10.1 Main Clock.................................................................................................63
10.2 On-Chip Oscillator Clocks.........................................................................64
10.2.1 Low-Speed On-Chip Oscillator Clock.................................................64
10.2.2 High-Speed On-Chip Oscillator Clock................................................64
A - 2
10.3 CPU Clock and Peripheral Function Clock................................................65
10.3.1 System Clock......................................................................................65
10.3.2 CPU Clock..........................................................................................65
10.3.3 Peripheral Function Clock (f1, f2, f4, f8, f32)......................................65
10.3.4 fRING and fRING128..........................................................................65
10.3.5 fRING-fast...........................................................................................65
10.3.6 fRING-S..............................................................................................65
10.4 Power Control............................................................................................66
10.4.1 Standard Operating Mode..................................................................66
10.4.2 Wait Mode ..........................................................................................67
10.4.3 Stop Mode..........................................................................................69
10.5 Oscillation Stop Detection Function..........................................................71
10.5.1 How to Use Oscillation Stop Detection Function................................71
10.6 Notes on Clock Generation Circuit............................................................73
10.6.1 Stop Mode and Wait Mode.................................................................73
10.6.2 Oscillation Stop Detection Function....................................................73
10.6.3 Oscillation Circuit Constants...............................................................73
10.6.4 High-Speed On-Chip Oscillator Clock................................................73
11. Protection 74
12. Interrupts 75
12.1 Interrupt Overview.....................................................................................75
12.1.1 Types of Interrupts..............................................................................75
12.1.2 Software Interrupts.............................................................................76
12.1.3 Special Interrupts................................................................................77
12.1.4 Peripheral Function Interrupt..............................................................77
12.1.5 Interrupts and Interrupt Vectors..........................................................78
12.1.6 Interrupt Control..................................................................................80
12.2 INT Interrupt..............................................................................................88
12.2.1 INT0 Interrupt .....................................................................................88
12.2.2 INT0 Input Filter..................................................................................89
12.2.3 INT1 Interrupt .....................................................................................90
12.2.4 INT3 Interrupt .....................................................................................91
12.3 Key Input Interrupt.....................................................................................93
12.4 Address Match Interrupt............................................................................95
A - 3
12.5 Notes on Interrupts....................................................................................97
12.5.1 Reading Address 00000h...................................................................97
12.5.2 SP Setting...........................................................................................97
12.5.3 External Interrupt and Key Input Interrupt ..........................................97
12.5.4 Watchdog Timer Interrupt...................................................................97
12.5.5 Changing Interrupt Sources................................................................98
12.5.6 Changing Interrupt Control Register Contents ...................................99
13. Watchdog Timer 100
13.1 Count Source Protection Mode Disabled................................................103
13.2 Count Source Protection Mode Enabled.................................................104
14. Timers 105
14.1 Timer X....................................................................................................106
14.1.1 Timer Mode ......................................................................................109
14.1.2 Pulse Output Mode...........................................................................110
14.1.3 Event Counter Mode.........................................................................112
14.1.4 Pulse Width Measurement Mode .....................................................113
14.1.5 Pulse Period Measurement Mode....................................................116
14.1.6 Notes on Timer X..............................................................................119
14.2 Timer Z....................................................................................................120
14.2.1 Timer Mode ......................................................................................125
14.2.2 Programmable Waveform Generation Mode....................................127
14.2.3 Programmable One-shot Generation Mode .....................................130
14.2.4 Programmable Wait One-Shot Generation Mode.............................133
14.2.5 Notes on Timer Z..............................................................................137
14.3 Timer C....................................................................................................138
14.3.1 Input Capture Mode..........................................................................144
14.3.2 Output Compare Mode.....................................................................146
14.3.3 Notes on Timer C .............................................................................148
15. Serial Interface 149
15.1 Clock Synchronous Serial I/O Mode .......................................................155
15.1.1 Polarity Select Function....................................................................158
15.1.2 LSB First/MSB First Select Function................................................158
15.1.3 Continuous Receive Mode ...............................................................159
A - 4
15.2 Clock Asynchronous Serial I/O (UART) Mode ........................................160
15.2.1 CNTR0 Pin Select Function..............................................................163
15.2.2 Bit Rate.............................................................................................164
15.3 Notes on Serial Interface......................................................................... 165
16. Clock Synchronous Serial Interface 166
16.1 Mode Selection........................................................................................166
16.2 Clock Synchronous Serial I/O with Chip Select (SSU)............................167
16.2.1 Transfer Clock..................................................................................176
16.2.2 SS Shift Register (SSTRSR)............................................................178
16.2.3 Interrupt Requests............................................................................179
16.2.4 Communication Modes and Pin Functions.......................................180
16.2.5 Clock Synchronous Communication Mode.......................................181
16.2.6 Operation in 4-Wire Bus Communication Mode...............................188
16.2.7 SCS Pin Control and Arbitration.......................................................194
16.2.8 Notes on Clock Synchronous Serial I/O with Chip Select ................195
16.3 I2C bus Interface .....................................................................................196
16.3.1 Transfer Clock..................................................................................206
16.3.2 Interrupt Requests............................................................................207
16.3.3 I2C bus Interface Mode.....................................................................208
16.3.4 Clock Synchronous Serial Mode ......................................................219
16.3.5 Noise Canceller................................................................................222
16.3.6 Bit Synchronization Circuit................................................................223
16.3.7 Examples of Register Setting...........................................................224
16.3.8 Notes on I2C bus Interface...............................................................228
17. A/D Converter 229
17.1 One-Shot Mode.......................................................................................233
17.2 Repeat Mode........................................................................................... 235
17.3 Sample and Hold.....................................................................................237
17.4 A/D Conversion Cycles ...........................................................................237
17.5 Internal Equivalent Circuit of Analog Input Block ....................................238
17.6 Inflow Current Bypass Circuit..................................................................239
17.7 Output Impedance of Sensor under A/D Conversion..............................240
17.8 Notes on A/D Converter..........................................................................242
A - 5
18. Flash Memory 243
18.1 Overview.................................................................................................243
18.2 Memory Map...........................................................................................245
18.3 Functions to Prevent Rewriting of Flash Memory....................................247
18.3.1 ID Code Check Function ..................................................................247
18.3.2 ROM Code Protect Function ............................................................248
18.4 CPU Rewrite Mode..................................................................................249
18.4.1 EW0 Mode........................................................................................250
18.4.2 EW1 Mode........................................................................................250
18.4.3 Software Commands........................................................................259
18.4.4 Status Register.................................................................................263
18.4.5 Full Status Check .............................................................................264
18.5 Standard Serial I/O Mode........................................................................ 266
18.5.1 ID Code Check Function ..................................................................266
18.6 Parallel I/O Mode.....................................................................................270
18.6.1 ROM Code Protect Function ............................................................270
18.7 Notes on Flash Memory..........................................................................271
18.7.1 CPU Rewrite Mode...........................................................................271
19. Electrical Characteristics 273
20. Usage Notes 293
20.1 Notes on Clock Generation Circuit..........................................................293
20.1.1 Stop Mode and Wait Mode...............................................................293
20.1.2 Oscillation Stop Detection Function..................................................293
20.1.3 Oscillation Circuit Constants.............................................................293
20.1.4 High-Speed On-Chip Oscillator Clock..............................................293
20.2 Notes on Interrupts..................................................................................294
20.2.1 Reading Address 00000h.................................................................294
20.2.2 SP Setting.........................................................................................294
20.2.3 External Interrupt and Key Input Interrupt ........................................294
20.2.4 Watchdog Timer Interrupt.................................................................294
20.2.5 Changing Interrupt Sources..............................................................295
20.2.6 Changing Interrupt Control Register Contents .................................296
20.3 Precautions on Timers............................................................................297
20.3.1 Notes on Timer X..............................................................................297
A - 6
20.3.2 Notes on Timer Z..............................................................................297
20.3.3 Notes on Timer C .............................................................................298
20.4 Notes on Serial Interface.........................................................................299
20.5 Precautions on Clock Synchronous Serial Interface...............................300
20.5.1 Notes on Clock Synchronous Serial I/O with Chip Select ................300
20.5.2 Notes on I2C bus Interface...............................................................301
20.6 Notes on A/D Converter..........................................................................302
20.7 Notes on Flash Memory..........................................................................303
20.7.1 CPU Rewrite Mode...........................................................................303
20.8 Notes on Noise........................................................................................305
20.8.1 Inserting a Bypass Capacitor between VCC and VSS Pins as a
Countermeasure against Noise and Latch-Up .................................305
20.8.2 Countermeasures against Noise Error of Port Control Registers.....305
21. Notes on On-Chip Debugger 306 Appendix 1. Package Dimensions 307 Appendix 2. Connection Examples between Serial Writer and On-Chip
Debugging Emulator 309
Appendix 3. Example of Oscillation Evaluation Circuit 310 Register Index 311
A - 7

SFR Page Reference

Address Register Symbol Page 0000h 0001h 0002h 0003h 0004h Processor Mode Register 0 PM0 53 0005h Processor Mode Register 1 PM1 54 0006h System Clock Control Register 0 CM0 58 0007h System Clock Control Register 1 CM1 59 0008h 0009h Address Match Interrupt Enable Register AIER 96 000Ah Protect Register PRCR 74 000Bh 000Ch Oscillation Stop Detection Register OCD 60 000Dh Watchdog Timer Reset Register WDTR 102 000Eh Watchdog Timer Start Register WDTS 102 000Fh Watchdog Timer Control Register WDC 101 0010h Address Match Interrupt Register 0 RMAD0 96 0011h 0012h 0013h 0014h Address Match Interrupt Register 1 RMAD1 96 0015h 0016h 0017h 0018h 0019h 001Ah 001Bh 001Ch Count Source Protection Mode Register CSPR 102 001Dh 001Eh
INT0 Input Filter Select Register 001Fh 0020h High-Speed On-Chip Oscillator Control
Register 0 0021h High-Speed On-Chip Oscillator Control
Register 1 0022h High-Speed On-Chip Oscillator Control
Register 2 0023h 0024h 0025h 0026h 0027h 0028h 0029h 002Ah 002Bh 002Ch 002Dh 002Eh 002Fh 0030h 0031h Voltage Detection Register 1 VCA1 45 0032h Voltage Detection Register 2 VCA2 45 0033h 0034h 0035h 0036h Voltage Monitor 1 Circuit Control Register VW1C 46 0037h Voltage Monitor 2 Circuit Control Register VW2C 47 0038h 0039h 003Ah 003Bh 003Ch 003Dh 003Eh 003Fh
INT0F 88
HRA0 61
HRA1 62
HRA2 62
NOTE:
1. The blank regions are reserved. Do not access locations in these regions.
Address Register Symbol Page 0040h 0041h 0042h 0043h 0044h 0045h 0046h 0047h 0048h 0049h 004Ah 004Bh 004Ch 004Dh Key Input Interrupt Control Register KUPIC 80 004Eh A/D Conversion Interru pt Con trol Register ADIC 80 004Fh SSU/IIC Interrupt Control Register SSUAIC/IIC2AIC 80 0050h Compare 1 Interrupt Control Register CMP1IC 80 0051h UART0 Transmit Interrupt Control Register S0TIC 80 0052h UART0 Receive Interrupt Control Register S0RIC 80 0053h UART1 Transmit Interrupt Control Register S1TIC 80 0054h UART1 Receive Interrupt Control Register S1RIC 80 0055h 0056h Timer X Interrupt Control Register TXIC 80 0057h 0058h Timer Z Interrupt Control Registe r TZIC 80 0059h INT1 Interrupt Control Register INT1IC 80 005Ah INT3 Interrupt Control Register INT3IC 80 005Bh Timer C Interrupt Control Register TCIC 80 005Ch Compare 0 Interrupt Control Register CMP0IC 80 005Dh INT0 Interrupt Control Register INT0IC 81 005Eh 005Fh 0060h 0061h 0062h 0063h 0064h 0065h 0066h 0067h 0068h 0069h 006Ah 006Bh 006Ch 006Dh 006Eh 006Fh 0070h 0071h 0072h 0073h 0074h 0075h 0076h 0077h 0078h 0079h 007Ah 007Bh 007Ch 007Dh 007Eh 007Fh
B - 1
Address Register Symbol Page 0080h Timer Z Mode Register TZMR 121 0081h 0082h 0083h 0084h Timer Z Waveform Output Control Register PUM 123 0085h Prescaler Z Register PREZ 122 0086h Timer Z Secondary Register TZSC 122 0087h Timer Z Primary Register TZPR 122 0088h 0089h 008Ah Timer Z Output Control Register TZOC 123 008Bh Timer X Mode Register TXMR 107 008Ch Prescaler X Register PREX 108 008Dh Timer X Register TX 108 008Eh Timer Count Source Setting Register TCSS 108,124 008Fh 0090h Timer C Register TC 140 0091h 0092h 0093h 0094h 0095h 0096h External Input Enable Register INTEN 88 0097h 0098h Key Input Enable Register KIEN 94 0099h 009Ah Timer C Control Register 0 TCC0 141 009Bh Timer C Control Register 1 TCC1 142 009Ch Capture, Compare 0 Register TM0 140 009Dh 009Eh Compare 1 Register TM1 140 009Fh 00A0h UART0 Transmit/Receive Mode Register U0MR 152 00A1h UART0 Bit Rate Register U0BRG 151 00A2h UART0 Transmit Buffer Register U0TB 151 00A3h 00A4h UART0 Transmit/Receive Control R eg ister 0 U0C0 153 00A5h UART0 Transmit/Receive Control R eg ister 1 U0C1 154 00A6h UART0 Receive Buffer Register U0RB 151 00A7h 00A8h UART1 Transmit/Receive Mode Register U1MR 152 00A9h UART1 Bit Rate Register U1BRG 151 00AAh UART1 Transmit Buffer Register U1TB 151 00ABh 00ACh UART1 Transmit/Receive Control Register 0 U1C0 153 00ADh UART1 Transmit/Receive Control Register 1 U1C1 154 00AEh UART1 Receive Buffer Register U1RB 151 00AFh 00B0h UART Transmit/Receive Control Register 2 UCON 154 00B1h 00B2h 00B3h 00B4h 00B5h 00B6h 00B7h 00B8h SS Control Register H / IIC bus Control
Register 1
00B9h SS Control Register L / IIC bus Control
Register 2 00BAh SS Mode Register / IIC bus Mode Register SSMR / ICMR 171, 201 00BBh SS Enable Register / IIC bus Interrupt
Enable Register 00BCh SS Status Register / IIC bus Status Register SSSR / ICSR 173, 203 00BDh SS Mode Register 2 / Slave Address
Register 00BEh SS Transmit Data Register / IIC bus
Transmit Data Register 00BFh SS Receive Data Register / IIC bus Receive
Data Register
SSCRH / ICCR1 169, 199
SSCRL / ICCR2 170, 200
SSER / ICIER 172, 202
SSMR2 / SAR 174, 204
SSTDR / ICDRT 175, 204
SSRDR / ICDRR 175, 205
NOTE:
1. The blank regions, 0100h to 01B2h, and 01C0h to 02FFh are reserved. Do not access locations in these regions.
Address Register Symbol Page 00C0h A/D Register AD 232 00C1h 00C2h 00C3h 00C4h 00C5h 00C6h 00C7h 00C8h 00C9h 00CAh 00CBh 00CCh 00CDh 00CEh 00CFh 00D0h 00D1h 00D2h 00D3h 00D4h A/D Control Register 2 ADCON2 232 00D5h 00D6h A/D Control Register 0 ADCON0 231 00D7h A/D Control Register 1 ADCON1 231 00D8h 00D9h 00DAh 00DBh 00DCh 00DDh 00DEh 00DFh 00E0h 00E1h Port P1 Register P1 27 00E2h 00E3h Port P1 Direction Register PD1 27 00E4h 00E5h Port P3 Register P3 27 00E6h 00E7h Port P3 Direction Register PD3 27 00E8h Port P4 Register P4 28 00E9h 00EAh Port P4 Direction Register PD4 27 00EBh 00ECh 00EDh 00EEh 00EFh 00F0h 00F1h 00F2h 00F3h 00F4h 00F5h 00F6h 00F7h 00F8h Port Mode Register PMR 28, 175, 205 00F9h 00FAh 00FBh 00FCh Pull-Up Control Register 0 PUR0 29 00FDh Pull-Up Control Register 1 PUR1 29 00FEh Port P1 Drive Capacity Control Register DRR 29 00FFh Timer C Output Control Register TCOUT 143
01B3h Flash Memory Control Register 4 FMR4 255 01B4h 01B5h Flash Memory Control Register 1 FMR1 254 01B6h 01B7h Flash Memory Control Register 0 FMR0 253
0FFFFh Optional Function Select Register OFS 101, 248
B - 2
R8C/1A Group, R8C/1B Group
REJ09B0252-0110
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Mar 17, 2006

1. Overview

These MCUs are fabricated using the high-performance silicon gate CMOS process, embedding the R8C/ Tiny Series CPU core, and is p ackaged in a 20-pin molded- plastic LSSOP, SDIP or a 28-pin plastic molded­HWQFN. 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/1B Group has on-chip data flash ROM (1 KB × 2 blocks). The difference between the R8C/1A Group and R8C/1B Group is only the presence or absence of data flash ROM. Their peripheral functions are the same.

1.1 Applications

Electric household appliances, office equipment, housing equipment (sensors, security systems), general industrial equipment, audio equipment, etc.
Rev.1.10
Rev.1.10 Mar 17, 2006 Page 1 of 312 REJ09B0252-0110
R8C/1A Group, R8C/1B Group 1. Overview

1.2 Performance Overview

Table 1.1 outlines the Functions and Specifications for R8C/1A Group and Table 1.2 outlines the Functions and Specifications for R8C/1B Group.
Table 1.1 Functions and Specifications for R8C/1A Group
Item Specification
CPU Number of fundamental
instructions Minimum instruction execution time Operating mode Single-chip Address space 1 Mbyte
Memory capacity See Table 1.3 Product Information for R8C/1A Group Peripheral Functions
Electric Characteristics
Flash Memory Programming and erasure voltage VCC = 2.7 to 5.5 V
Operating Ambient Temperature -20 to 85°C Package 20-pin molded-plastic LSSOP
NOTE:
1. I2C bus is a trademark of Koninklijke Philips Electronics N. V.
Ports I/O ports: 13 pins (including LED drive port)
LED drive ports I/O ports: 4 pins
Timers Timer X: 8 bits × 1 channel, timer Z: 8 bits × 1 channel
Serial interfaces 1 channel
Clock synchronous serial interface 1 channel
A/D converter 10-bit A/D converter: 1 circuit, 4 channels
Watchdog timer 15 bits × 1 channel (with prescaler)
Interrupts Internal: 9 sources, External: 4 sources, Sof tware: 4 sources,
Clock generation circuits 2 circuits
Oscillation stop detection function Main clock oscillation stop detection function
Voltage detection circuit On-chip
Power-on reset circuit On-chip
Supply voltage VCC = 3.0 to 5.5 V (f(XIN) = 20 MHz)
Current consumption Typ . 9 m A
Programming and erasure
endurance
89 instructions 50 ns (f(XIN) = 20 MHz, VCC = 3.0 to 5.5 V)
100 ns (f(XIN) = 10 MHz, VCC = 2.7 to 5.5 V)
Input port: 3 pins
(Each timer equipped with 8-bit prescaler) Timer C: 16 bits × 1 channel (Input capture and output compare circuits)
Clock synchronous serial I/O, UART
1 channel
UART
2
C bus Interface
I Clock synchronous serial I/O with chip select (SSU)
Reset start selectable, count source protection mode
Priority levels: 7 levels
• Main clock oscillation circuit (with on-chip feedback resistor)
• On-chip oscillator (high speed, low speed)
High-speed on-chip oscillator has frequency adjustment function
VCC = 2.7 to 5.5 V (f(XIN) = 10 MHz)
(VCC = 5.0 V , f(XIN) = 20 M Hz, A/D converter stopped ) Typ. 5 mA Typ. 35 µA (VCC = 3.0 V, wait mode, peripheral clock off) Typ. 0.7 µA (VCC = 3.0 V, stop mode)
100 times
-40 to 85°C (D version) 20-pin molded-plastic SDIP
28-pin molded-plastic HWQFN
(VCC = 3.0 V, f(XIN) = 10 MHz, A/D converter stopped)
(1)
Rev.1.10 Mar 17, 2006 Page 2 of 312 REJ09B0252-0110
R8C/1A Group, R8C/1B Group 1. Overview
Table 1.2 Functions and Specifications for R8C/1B Group
Item Specification
CPU Number of fundamental
instructions Minimum instruction execution time Operating mode Single-chip Address space 1 Mbyte
Memory capacity See Table 1.4 Product Information for R8C/1B Group Peripheral Functions
Electric Characteristics
Flash Memory Programming and erasure voltage VCC = 2.7 to 5.5 V
Operating Ambient Temperature -20 to 85°C Package 20-pin molded-plastic LSSOP
NOTE:
1. I2C bus is a trademark of Koninklijke Philips Electronics N. V.
Ports I/O ports: 13 pins (including LED drive port)
LED drive ports I/O port s: 4 pins
Timers Timer X: 8 bits × 1 channel, timer Z: 8 bits × 1 channel
Serial interfaces 1 channel
Clock synchronous serial interface 1 channel
A/D converter 10-bit A/D converter: 1 circuit, 4 channels
Watchdog timer 15 bits × 1 channel (with prescaler)
Interrupts Internal: 9 sources, External: 4 sources, Software: 4 sources,
Clock generation circuits 2 circuits
Oscillation stop detection function Main clock oscillation stop detection function
Voltage detection circuit On-chip
Power on reset circuit On-chip
Supply voltage VCC = 3.0 to 5.5 V (f(XIN) = 20 MHz)
Current consumption T yp. 9 mA
Programming and erasure
endurance
89 instructions 50 ns (f(XIN) = 20 MHz, VCC = 3.0 to 5.5 V)
100 ns (f(XIN) = 10 MHz, VCC = 2.7 to 5.5 V)
Input port: 3 pins
(Each timer equipped with 8-bit prescaler) Timer C: 16 bits × 1 channel (Input capture and output compare circuits)
Clock synchronous serial I/O, UART
1 channel
UART
2
C bus Interface
I Clock synchronous serial I/O with chip select (SSU)
Reset start selectable, count source protection mode
Priority levels: 7 levels
• Main clock generation circuit (with on-chip feedback resistor)
• On-chip oscillator (high speed, low speed)
High-speed on-chip oscillator has frequency adjustment function
VCC = 2.7 to 5.5 V (f(XIN) = 10 MHz)
(VCC = 5.0 V, f(XIN) = 20 MHz, A/D converter stopped) Typ. 5 mA (VCC = 3.0 V, f(XIN) = 10 MHz, A/D converter stopped) Typ. 35 µA (VCC = 3.0 V, wait mode, peripheral clock off) Typ. 0.7 µA (VCC = 3.0 V, stop mode)
10,000 times (data flash) 1,000 times (program ROM)
-40 to 85°C (D version) 20-pin molded-plastic SDIP
28-pin molded-plastic HWQFN
(1)
Rev.1.10 Mar 17, 2006 Page 3 of 312 REJ09B0252-0110
R8C/1A Group, R8C/1B Group 1. Overview

1.3 Block Diagram

Figure 1.1 shows a Block Diagram.
I/O ports Port P1
Peripheral Functions
Timers
Timer X (8 bits) Timer Z (8 bits)
Timer C (16 bits)
Watchdog timer
(15 bits)
A/D converter
(10 bits
UART or
clock synchronous serial I/O
(8 bits
(8 bits
R8C/Tiny Series CPU core
R0H R0L R1H
R2 R3
A0 A1
FB
8
× 4 channels)
× 1 channel)
UART
× 1 channel)
R1L
4
Port P3 Port P4
System clock generator
XIN-XOUT
High-speed on-chip
oscillator
Low-speed on-chip
oscillator
SSU (8 bits × 1 channel)
or I
2
C bus
Memory
SB
USP
ISP
INTB
PC
FLG
ROM
RAM
Multiplier
1 3
(1)
(2)
Figure 1.1 Block Diagram
NOTES:
1. ROM size varies with MCU t ype.
2. RAM size varies with MCU type.
Rev.1.10 Mar 17, 2006 Page 4 of 312 REJ09B0252-0110
R8C/1A Group, R8C/1B Group 1. Overview

1.4 Product Information

Table 1.3 lists Product Information for R8C/1A Group and Table 1.4 lists Product Information for R8C/1B Group.
Table 1.3 Product Information for R8C/1A Group Current of Mar 2006
Type No. ROM Capacity RAM Capacity Package Type Remarks R5F211A1SP 4 Kbytes 384 bytes PLSP0020JB-A Flash memory version R5F211A2SP 8 Kbytes 512 bytes PLSP0020JB-A R5F211A3SP 12 Kbytes 768 bytes PLSP0020JB-A R5F211A4SP 16 Kbytes 1 Kbyte PLSP0020JB-A R5F211A1DSP (D) 4 Kbytes 384 bytes PLSP0020JB-A D version R5F211A2DSP (D) 8 Kbytes 512 bytes PLSP0020JB-A R5F211A3DSP (D) 1 2 Kby te s 768 by te s PLSP0020JB-A R5F211A4DSP (D) 16 Kbytes 1 Kbyte PLSP0020JB-A R5F211A1DD 4 Kbytes 384 bytes PRDP0020BA-A Flash memory version R5F211A2DD 8 Kbytes 512 bytes PRDP0020BA-A R5F211A3DD 12 Kbytes 768 bytes PRDP0020BA-A R5F211A4DD 16 Kbytes 1 Kbyte PRDP0020BA-A R5F211A2NP 8 Kbytes 512 bytes PWQN0028KA-B Flash memory version R5F211A3NP 12 Kbytes 768 bytes PWQN0028KA-B R5F211A4NP 16 Kbytes 1 Kbyte PWQN0028KA-B
(D): Under development
Type No. R 5 F 21 1A 4 D SP
Package type:
SP: PLSP0020JB-A DD: PRDP0020BA-A NP: PWQN0028KA-B
Classification
D: Operating ambient temperature -40°C to 85°C No Symbol: Operating ambient temperature -20°C to 85°C
ROM capacity
1: 4 KB 2: 8 KB 3: 12 KB
4: 16 KB R8C/1A Group R8C/Tiny Series Memory type
F: Flash memory version Renesas MCU Renesas semiconductors
Figure 1.2 Type Number, Memory Size, and Package of R8C/1A Group
Rev.1.10 Mar 17, 2006 Page 5 of 312 REJ09B0252-0110
R8C/1A Group, R8C/1B Group 1. Overview
Table 1.4 Product Information for R8C/1B Group Current of Mar 2006
Type No.
ROM Capacity
Program ROM Data Flash
RAM
Capacity
Package Type Remarks
R5F211B1SP 4 Kbytes 1 kbyte × 2 384 bytes PLSP0020JB-A Flash memory version R5F211B2SP 8 Kbytes 1 kbyte × 2 512 bytes PLSP0020JB-A R5F211B3SP 12 Kbytes 1 kbyte × 2 768 bytes PLSP0020JB-A R5F211B4SP 16 Kbytes 1 kbyte × 2 1 Kbyte PLSP0020JB-A R5F211B1DSP (D) 4 Kbytes 1 kbyte × 2 384 bytes PLSP0020JB-A D version R5F211B2DSP (D) 8 Kbytes 1 kbyte × 2 512 bytes PLSP0020JB-A R5F211B3DSP (D) 12 Kbytes 1 kbyte × 2 768 bytes PLSP0020JB-A R5F211B4DSP (D) 16 Kbytes 1 kbyte × 2 1 Kbyte PLSP0020JB-A R5F211B1DD 4 Kbytes 1 kbyte × 2 384 bytes PRDP0020B A-A Flash memory version R5F211B2DD 8 Kbytes 1 kbyte × 2 512 bytes PRDP0020BA-A R5F211B3DD 12 Kbytes 1 kbyte × 2 768 bytes PRDP0020BA-A R5F211B4DD 16 Kbytes 1 kbyte × 2 1 Kbyte PRDP0020BA-A R5F211B2NP 8 Kbytes 1 kbyte × 2 512 bytes PWQN0028KA-B Flash memory version R5F211B3NP 12 Kbytes 1 kbyte × 2 768 bytes PWQN0028KA-B R5F211B4NP 16 Kbytes 1 kbyte × 2 1 Kbyte PWQN0028KA-B
(D): Under development
Type No. R 5 F 21 1B 4 D SP
Package type:
SP: PLSP0020JB-A
DD: PRDP0020BA-A
NP: PWQN0028KA-B
Classification
D: Operating ambient temperature -40°C to 85°C
No Symbol: Operating am bient temperature -20
ROM capacity
1: 4 KB
2: 8 KB
3: 12 KB
4: 16 KB
R8C/1B Group R8C/Tiny Series Memory Type
F: Flash memory version
Renesas MCU Renesas semiconductors
Figure 1.3 Type Number, Memory Size, and Package of R8C/1B Group
°C to 85°C
Rev.1.10 Mar 17, 2006 Page 6 of 312 REJ09B0252-0110
R8C/1A Group, R8C/1B Group 1. Overview

1.5 Pin Assignments

Figure 1.4 shows Pin Assignments for PLSP0020JB-A Package (Top View), Figure 1.5 shows Pin Assignments for PRDP0020BA-A Package (Top View) and Figure 1.6 shows Pin Assignments for PWQN0028KA-B Package (Top View).
PIN assignments (top view)
P3_5/SSCK/SCL/CMP1_2
P3_7/CNTR0/SSO/TXD1
RESET
XOUT/P4_7
VSS/AVSS
XIN/P4_6
VCC/AVCC
MODE
P4_5/INT0/RXD1
P1_7/CNTR00/INT10
1 2 3
(1)
4 5 6 7 8 9 10
R8C/1A Group
R8C/1B Group
20 P3_4/SCS/SDA/CMP1_1 19 P3_3/TCIN/INT3/SSI00/CMP1_0 18 P1_0/KI0/AN8/CMP0_0 17 16 P4_2/VREF 15 P1_2/KI2/AN10/CMP0_2 14 P1_3/KI3/AN11/TZOUT 13 P1_4/TXD0 12 P1_5/RXD0/CNTR01/INT11 11 P1_6/CLK0/SSI01
P1_1/KI1/AN9/CMP0_1
NOTE:
1. P4_7 is an input-only port. Package: PLSP0020JB-A (20P2F-A)
Figure 1.4 Pin Assignments for PLSP0020JB-A Package (Top View)
Rev.1.10 Mar 17, 2006 Page 7 of 312 REJ09B0252-0110
R8C/1A Group, R8C/1B Group 1. Overview
PIN assignments (top view)
P3_5/SSCK/SCL/CMP1_2
P3_7/CNTR0/SSO/TXD1
RESET
XOUT/P4_7
VSS/AVSS
XIN/P4_6
VCC/AVCC
MODE
P4_5/INT0/RXD1
P1_7/CNTR00/INT10
1
2
3
(1)
4
5
6
7
8
9
10
R8C/1B Group
NOTE:
1. P4_7 is an input-only port.
R8C/1A Group
20 P3_4/SCS/SDA/CMP1_1
19 P3_3/TCIN/INT3/SSI00/CMP1_0
18 P1_0/KI0/AN8/CMP0_0
17 P1_1/KI1/AN9/CMP0_1
16 P4_2/VREF
15 P1_2/KI2/AN10/CMP0_2
14 P1_3/KI3/AN11/TZOUT
13 P1_4/TXD0
12 P1_5/RXD0/CNTR01/INT11
11 P1_6/CLK0/SSI01
Package: PRDP0020BA-A (20P4B)
Figure 1.5 Pin Assignments for PRDP0020BA-A Package (Top View)
Rev.1.10 Mar 17, 2006 Page 8 of 312 REJ09B0252-0110
R8C/1A Group, R8C/1B Group 1. Overview
PIN Assignment (top view)
P1_3/AN11/KI3/TZOUT
P1_2/AN10/KI2/CMP0_2
NC
NC
P4_2/VREF
NC
21 20 19 18 17 16 15
NC
P1_1/AN9/KI1/CMP0_1 P1_0/AN8/KI0/CMP0_0
P3_3/TCIN/INT3/SSI00/CMP1_0
P3_4/SCS/SDA/CMP1_1
P3_5/SSCK/SCL/CMP1_2
P3_7/CNTR0/SSO/TXD1
RESET
NOTES:
22 23 24 25 26 27 28
R8C/1A Group R8C/1B Group
1 2 3 4 5 6 7
NC
(1)
XOUT/P4_7
NC
VSS/AVSS
1. P4_7 is a port for the input.
P1_4/TXD0 P1_5/RXD0/CNTR01/INT11 P1_6/CLK0/SSI01 P1_7/CNTR00/INT10 P4_5/INT0/RXD1 MODE VCC/AVCC
NC
14 13 12 11 10
9 8
NC
XIN/P4_6
Package: PWQN0028KA-B(28PJW-B)
Figure 1.6 Pin Assignments for PWQN0028KA-B Package (Top View)
Rev.1.10 Mar 17, 2006 Page 9 of 312 REJ09B0252-0110
R8C/1A Group, R8C/1B Group 1. Overview

1.6 Pin Functions

Table 1.5 lists Pin Functions, Table 1.6 lists Pin Name Information by Pin Number of PLSP0020JB-A, PRDP0020BA-A Packages and Table 1.7 lists Pin Name Information by Pin Number of PWQN0028KA­B Package.
Table 1.5 Pin Functions
Type Symbol I/O Type Description
Power Supply Input VCC, VSS I Apply 2.7 V to 5.5 V to the VCC pin.
Apply 0 V to the VSS pin.
Analog Power Supply Input
Reset Input RESET MODE MODE I Connect this pin to VCC via a resistor. Main Clock Input XIN I These pins are provided for main clock generation Main Clock Output XOUT O
INT
Interrupt INT0, INT1, INT3 I INT interrupt input pins Key Input Interrupt KI0 Timer X CNTR0 I/O Timer X I/O pin
Timer Z TZOUT O Timer Z output pin Timer C TCIN I Timer C input pin
Serial Interface CLK0 I/O Transfer clock I/O pin
Clock synchronous serial I/O with chip select (SSU)
2
I
C bus Interface
Reference V oltage Input
A/D Converter AN8 to AN11 I Analog input pins to A/D converter I/O Port P1_0 to P1_7,
Input Port P4_2, P4_6, P4_7 I Input-only ports
I: Input O: Output I/O: Input and output
AVCC, AVSS I Power supply for the A/D converter
Connect a capacitor between AVCC and AVSS.
I Input “L” on this pin resets the MCU.
circuit I/O. Connect a ceramic resonator or a crystal oscillator between the XIN and XOUT pins. To use an external clock, input it to the XIN pin and leave the XOUT pin open.
to KI3 I Key input interrupt input pins
CNTR0
CMP0_0 to CMP0_2, CMP1_0 to CMP1_2
RXD0, RXD1 I Serial data input pins TXD0, TXD1 O Serial data output pins SSI00, SSI01 I/O Data I/O pin. SCS SSCK I/O Clock I/O pin SSO I/O Data I/O pin SCL I/O Clock I/O pin SDA I/O Data I/O pin VREF I Reference voltage input pin to A/D converter
P3_3 to P3_5, P3_7, P4_5
O Timer X output pin
O Timer C output pins
I/O Chip-select signal I/O pin
I/O CMOS I/O ports. Each port has an I/O select
direction register, allowing each pin in the port to be directed for input or output individually. Any port set to input can be set to use a pull-up resistor or not by a program. P1_0 to P1_3 also function as LED drive ports.
Rev.1.10 Mar 17, 2006 Page 10 of 312 REJ09B0252-0110
R8C/1A Group, R8C/1B Group 1. Overview
Table 1.6 Pin Name Information by Pin Number of PLSP0020JB-A, PRDP0020BA-A Packages
I/O Pin Functions for Peripheral Modules
Pin
Number
Control
Pin
Port
Interrupt Timer
Serial
Interface
Clock
Synchronous
Serial I/O with
2
I
C bus
Interface
A/D
Converter
Chip Select 1 P3_5 CMP1_2 SSCK SCL 2P3_7
3
RESET
CNTR0
TXD1 SSO
4XOUTP4_7 5 VSS/AVSS 6XINP4_6 7VCC/AVCC 8MODE 9P4_5
10 P1_7
INT0
INT10
CNTR00
RXD1
11 P1_6 CLK0 SSI01 12 P1_5
INT11
CNTR01 RXD0
13 P1_4 TXD0 14 P1_3
15 P1_2
KI3 KI2
TZOUT AN11
CMP0_2 AN10
16 VREF P4_2 17 P1_1
18 P1_0 19 P3_3
KI1 KI0
INT3
CMP0_1 AN9 CMP0_0 AN8
TCIN/
SSI00
CMP1_0
20 P3_4 CMP1_1
SCS
SDA
Rev.1.10 Mar 17, 2006 Page 11 of 312 REJ09B0252-0110
R8C/1A Group, R8C/1B Group 1. Overview
Table 1.7 Pin Name Information by Pin Number of PWQN0028KA-B Package
I/O Pin Functions for Peripheral Modules
Pin
Number
Control
Pin
Port
Interrupt Timer
Serial
Interface
Clock
Synchronous
Serial I/O with
2
I
C bus
Interface
A/D
Converter
Chip Select 1NC 2XOUTP4_7 3 VSS/AVSS 4NC 5NC 6XINP4_6 7NC 8VCC/AVCC 9MODE 10 P4_5
11 P1_7
INT0
INT10
CNTR00
RXD1
12 P1_6 CLK0 SSI01 13 P1_5
INT11
CNTR01 RX D0
14 P1_4 TXD0 15 NC 16 P1_3
17 P1_2
KI3 KI2
TZOUT AN11
CMP0_2 AN10
18 NC 19 NC 20 VREF P4_2 21 NC 22 P1_1
23 P1_0 24 P3_3
KI1 KI0
INT3
25 P3_4 CMP1_1
CMP0_1 AN9 CMP0_0 AN8
TCIN/CMP1_0 SSI00
SCS
SDA
26 P3_5 CMP1_2 SSCK SCL 27 P3_7
28
RESET
CNTR0
TXD1 SSO
Rev.1.10 Mar 17, 2006 Page 12 of 312 REJ09B0252-0110

R8C/1A Group, R8C/1B Group 2. Central Processing Unit (CPU)

2. Central Processing Unit (CPU)
Figure 2.1 shows the CPU Registers. The CPU contains 13 registers. R0, R1, R2, R3, A0, A1, and FB configure a register bank. There are two sets of register bank.
b31
R2 R3
b15 b8b7
R0H (high-order of R0) R1H (high-order of R1) R1L (low-order of R1)
R0L (low-order of R0)
R2 R3
A0
A1 FB
b15b19
INTBH
The 4 high order bits of INTB are INTBH and the 16 low bits of INTB are INTBL.
b19
INTBL
PC
b15
USP
ISP
SB
b0
Data registers
Address registers
Frame base register
b0
Interrupt table register
b0
Program counter
b0
User stack pointer Interrupt stack pointer Static base register
(1)
(1)
(1)
b15
IPL
NOTE:
1. These registers comprise a register bank. There are two register banks.
Figure 2.1 CPU Register
b15
b0
FLG
b8
b7
b0
C
DZSBOIU
Flag register
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
Rev.1.10 Mar 17, 2006 Page 13 of 312 REJ09B0252-0110
R8C/1A Group, R8C/1B Group 2. Central Processing Unit (CPU)

2.1 Data Registers (R0, R1, R2, and R3)

R0 is a 16-bit register for transfer, arithmetic, and logic operations. T he same applies to R1 to R3. R0 can be split into high-order bits (R0H) and low-order bits (R0L) to be used separately as 8-bit data registers. R1H and R1L are analogous to R0H and R0L. R2 can be combined with R0 and used as a 32­bit data register (R2R0). R3R1 is analogous to R2R0.

2.2 Address Registers (A0 and A1)

A0 is a 16-bit register for address register indirect addressing and address register relative addressing. It is also used for transfer and arithmetic and logic operation s. A1 is analogous to A0. A1 can be combined with A0 and used as a 32-bit address register (A1A0).

2.3 Frame Base Register (FB)

FB is a 16-bit register for FB relative addressing.

2.4 Interrupt Table Register (INTB)

INTB is a 20-bit register that indicates the start address of an interrupt vector table.

2.5 Program Counter (PC)

PC is 20 bits wide indicates the address of the next instruction to be executed.

2.6 User Stack Pointer (USP) and Interrupt Stack Pointer (ISP)

The stack pointer (SP), USP, and ISP, are each 16 bits wide. The U flag of FLG is used to switch between USP and ISP.

2.7 Static Base Register (SB)

SB is a 16-bit register for SB relative addressing.

2.8 Flag Register (FLG)

FLG is an 11-bit register indicating the CPU state.

2.8.1 Carry Flag (C)

The C flag retains a carry, borrow, or shift-out bits that have been generated by the arithmetic and logic unit.

2.8.2 Debug Flag (D)

The D flag is for debugging only. Set it to 0.

2.8.3 Zero Flag (Z)

The Z flag is set to 1 when an arithmetic operation results in 0; otherwise to 0.

2.8.4 Sign Flag (S)

The S flag is set to 1 when an arithmetic operation results in a negative value; otherwise to 0.

2.8.5 Register Bank Select Flag (B)

Register bank 0 is selected when the B flag is 0. Register bank 1 is selected when this flag is set to 1.

2.8.6 Overflow Flag (O)

The O flag is set to 1 when the operation results in an overflow; otherwise to 0.
Rev.1.10 Mar 17, 2006 Page 14 of 312 REJ09B0252-0110
Loading...
+ 305 hidden pages