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.2.00
Revision Date: Dec 05, 2007
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
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.
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 part number, confirm
that the change will not lead to problems.
The characteristics of MPU/MCU in the same group but having different part numbers may
differ because of the differences in internal memory capacity and layout pattern. When
changing to products of different part 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/2C Group, R8C/2D 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.
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 setR8C/Tiny Series
Application noteInformation 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/2C Group,
R8C/2D Group
Hardware Manual
Software Manual
Available from Renesas
Technology Web site.
REJ03B0183
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 values given in 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
SymbolAddressAfter Reset
XXXXXX00h
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
AbbreviationFull Form
ACIAAsynchronous Communication Interface Adapter
bpsbits per second
CRCCyclic Redundancy Check
DMADirect Memory Access
DMACDirect Memory Access Controller
GSMGlobal System for Mobile Communications
Hi-ZHigh Impedance
IEBusInter Equipment bus
I/OInput/Output
IrDAInfrared Data Association
LSBLeast Significant Bit
MSBMost Significant Bit
NCNon-Connection
PLLPhase Locked Loop
PWMPulse Width Modulation
SFRSpecial Function Registers
SIMSubscriber Identity Module
UARTUniversal Asynchronous Receiver/Transmitter
VCOVoltage Controlled Oscillator
All trademarks and registered trademarks are the property of their respective owners.
Table of Contents
SFR Page Reference ........................................................................................................................... B - 1
1.2Product List ............................................................................................................................................... 6
2.8.1Carry Flag (C) ..................................................................................................................................... 16
2.8.2Debug Flag (D) ................................................................................................................................... 16
2.8.3Zero Flag (Z) ....................................................................................................................................... 16
2.8.4Sign Flag (S) ....................................................................................................................................... 16
2.8.5Register Bank Select Flag (B) ............................................................................................................ 16
2.8.6Overflow Flag (O) .............................................................................................................................. 16
2.8.7Interrupt Enable Flag (I) ................................................................... .................................................. 17
2.8.8Stack Pointer Select Flag (U) .............................................................................................................. 17
3.1R8C/2C Group ......................................................................................................................................... 18
3.2R8C/2D Group ........................................................................................................................................ 19
4.Special Function Registers (SFRs) ............................................................................................... 20
5.1.1When Power Supply is Stable .................................................................... ......................................... 35
5.1.2Power On ............................................................................................................................................ 35
5.2Power-On Reset Function ....................................................................................................................... 37
6.1VCC Input Voltage .................................................................................................................................. 47
10.4.9fC4 and fC32 .................................. .................................. ................................................................. 110
10.5Power Control ........................................................................................................................................ 111
12.1.1Types of Interrupts ............................................................................................................................ 125
12.1.4Peripheral Function Interrupt ............................................................................................................ 127
12.1.5Interrupts and Interrupt Vectors ........................................................................................................ 128
12.1.6Interrupt Control ............................................................................................................................... 130
12.4Address Match Interrupt ........................... ............................................................................................. 145
12.5Timer RC Interrupt, Timer RD Interrupt, Clock Synchronous Serial I/O with Chip Select Interrupts, and
2
I
C bus Interface Interrupt (Interrupts with Multiple Interrupt Request Sources) ................................ 147
12.6Notes on Interrupts ................................................................................................................................ 149
14.1Timer RA ............................................................................................................................................... 161
14.1.5Pulse Period Measurement Mode .......................................... ........................................................... 173
14.1.6Notes on Timer RA ............................................................................................................. .............. 176
14.4.12 Notes on Timer RD ........................................................................................................................... 340
14.5Timer RE ............................................................................................................................................... 346
14.5.3Notes on Timer RE ........................................................................................................................... 361
15.3Notes on Serial Interface ....................................................................................................................... 396
16.Clock Synchronous Serial Interface ............................................................................................ 397
16.2.4Communication Modes and Pin Functions .................................................................................... ... 411
16.2.5Clock Synchronous Communication Mode ...................................................................................... 412
16.2.6Operation in 4-Wire Bus Communication Mode .............................................................................. 419
16.2.7SCS
Pin Control and Arbitration ...................................................................................................... 425
16.2.8Notes on Clock Synchronous Serial I/O with Chip Select ............................................................... 426
16.3I
2
C bus Interface ................................................................................................................................. ... 427
18.1.2Sample and Hold .................................. .................................. ........................................................... 480
20.4.5Full Status Check .............................................................................................................................. 516
A - 5
20.5Standard Serial I/O Mode ...................................................................................................................... 518
20.5.1ID Code Check Function ............................................................................................................... ... 518
22.2Notes on Interrupts ................................................................................................................................ 552
22.2.3External Interrupt and Key Input Interrupt ....................................................................................... 552
22.2.4Changing Int e rrupt Sources .............................................................................................................. 553
22.2.5Changing Interrupt Control Register Contents ................................................................................. 554
22.3Notes on Timers .................................................................................................................................... 555
22.3.1Notes on Timer RA ............................................................................................................. .............. 555
22.3.2Notes on Timer RB ........................................................................................................................... 556
22.3.3Notes on Timer RC ........................................................................................................................... 560
22.3.4Notes on Timer RD ............................................................................................................. .............. 561
22.3.5Notes on Timer RE ........................................................................................................................... 567
22.3.6Notes on Timer RF ........................................................................................................................... 570
22.4Notes on Serial Interface ....................................................................................................................... 571
22.5Notes on Clock Synchronous Serial Interface ....................................................................................... 572
22.5.1Notes on Clock Synchronous Serial I/O with Chip Select ............................................................... 572
22.5.2Notes on I
2
C bus Interface ................................................................................................................ 572
22.6Notes on Hardware LIN ........................................................................................................................ 573
22.7Notes on A/D Converter ........................................................................................................................ 574
22.8Notes on Flash Memory ................................................................................................................ ........ 575
Appendix 2. Connection Examples between Serial Writer and On-Chip Debugging Emulator ............ 582
A - 6
Appendix 3. Example of Oscillation Evaluation Circuit ......................................................................... 583
Index ..................................................................................................................................................... 584
0158h Timer RD General Register A1TRDGRA1263, 279, 295,
0159h
015Ah Timer RD General Register B1TRDGRB1 263, 279, 295,
015Bh
015Ch Timer RD General Register C1TRDGRC1 263, 279, 295,
015Dh
015Eh Timer RD General Register D1TRDGRD1 263, 279, 295,
015Fh
TRCDF207
301, 312, 327
301, 313, 328
302, 314, 329
315, 330
315, 330
TRDDF0257
TRDDF1257
304, 316, 332
305, 317, 333
306, 318, 334
TRDPOCR0294
306, 319, 334
307, 319, 335
307, 319, 335
307, 335
307, 319, 335
316
305, 317, 333
306, 318, 334
TRDPOCR1294
319
307, 319, 335
307, 319, 335
307, 319, 335
307, 319, 335
B - 3
AddressRegisterSymbolPage
0160h UART2 Transmit/Receive Mode RegisterU2MR380
0161h UART2 Bit Rate RegisterU2BRG380
0162h UART2 Transmit Buffer Registe rU2TB381
0163h
0164h UART2 Transmit/Receive Control Register 0U2C0381
0165h UART2 Transmit/Receive Control Register 1U2C1382
0166h UART2 Receive Buffer RegisterU2RB382
0167h
0168h
0169h
016Ah
016Bh
016Ch
016Dh
016Eh
016Fh
0170h
0171h
0172h
0173h
0174h
0175h
0176h
0177h
0178h
0179h
017Ah
017Bh
017Ch
017Dh
017Eh
017Fh
0180h
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.
AddressRegisterSymbolPage
01A0h
01A1h
01A2h
01A3h
01A4h
01A5h
01A6h
01A7h
01A8h
01A9h
01AAh
01ABh
01ACh
01ADh
01AEh
01AFh
01B0h
01B1h
01B2h
01B3h Flash Memory Control Register 4FMR4506
01B4h
01B5h Flash Memory Control Register 1FMR1505
01B6h
01B7h Flash Memory Control Register 0FMR0504
01B8h
01B9h
01BAh
01BBh
01BCh
01BDh
01BEh
01C0h
01C1h
01C2h
01C3h
01C4h
01C5h
01C6h
01C7h
01C8h
01C9h
01CAh
01CBh
01CCh
01CDh
01CEh
01CFh
01D0h
01D1h
01D2h
01D3h
01D4h
01D5h
01D6h
01D7h
01D8h
01D9h
01DAh
01DBh
01DCh
01DDh
01DEh
01DFh
B - 4
AddressRegisterSymbolPage
01E0h
01E1h
01E2h
01E3h
01E4h
01E5h
01E6h
01E7h
01E8h
01E9h
01EAh
01EBh
01ECh
01EDh
01EEh
01EFh
01F0h
01F1h
01F2h
01F3h
01F4h
01F5h
01F6h
01F7h
01F8h
01F9h
01FAh
01FBh
01FCh
01FDh
01FEh
01FFh
0200h
0201h
0202h
0203h
0204h
0205h
0206h
0207h
0208h
0209h
020Ah
020Bh
020Ch
020Dh
020Eh
020Fh
0210h
0211h
0212h
0213h
0214h
0215h
0216h
0217h
0218h
0219h
021Ah
021Bh
021Ch
021Dh
021Eh
021Fh
NOTE:
1. The blank regions are reserved. Do not access locations in these
regions.
AddressRegisterSymbolPage
0220h
0221h
0222h
0223h
0224h
0225h
0226h
0227h
0228h
0229h
022Ah
022Bh
022Ch
022Dh
022Eh
022Fh
0230h
0231h
0232h
0233h
0234h
0235h
0236h
0237h
0238h
0239h
023Ah
023Bh
023Ch
023Dh
023Eh
023Fh
0240h
0241h
0242h
0243h
0244h
0245h
0246h
0247h
0248h
0249h
024Ah
024Bh
024Ch
024Dh
024Eh
024Fh
0250h
0251h
0252h
0253h
0254h
0255h
0256h
0257h
0258h
0259h
025Ah
025Bh
025Ch
025Dh
025Eh
025Fh
B - 5
AddressRegisterSymbolPage
0260h
0261h
0262h
0263h
0264h
0265h
0266h
0267h
0268h
0269h
026Ah
026Bh
026Ch
026Dh
026Eh
026Fh
0270h
0271h
0272h
0273h
0274h
0275h
0276h
0277h
0278h
0279h
027Ah
027Bh
027Ch
027Dh
027Eh
027Fh
0280h
0281h
0282h
0283h
0284h
0285h
0286h
0287h
0288h
0289h
028Ah
028Bh
028Ch
028Dh
028Eh
028Fh
0290h Timer RF RegisterTRF366
0291h
0292h
0293h
0294h
0295h
0296h
0297h
0298h
0299h
029Ah Timer RF Control Register 0TRFCR0367
029Bh Timer RF Control Register 1TRFCR1368
029Ch Capture / Compare 0 RegisterTRFM0366
029Dh
029Eh Compare 1 RegisterTRFM1366
029Fh
NOTE:
1. The blank regions are reserved. Do not access locations in these
regions.
AddressRegisterSymbolPage
02A0h
02A1h
02A2h
02A3h
02A4h
02A5h
02A6h
02A7h
02A8h
02A9h
02AAh
02ABh
02ACh
02ADh
02AEh
02AFh
02B0h
02B1h
02B2h
02B3h
02B4h
02B5h
02B6h
02B7h
02B8h
02B9h
02BAh
02BBh
02BCh
02BDh
02BEh
02BFh
02C0h A/D Register 0AD0477
02C1h
02C2h A/D Register 1AD1477
02C3h
02C4h A/D Register 2AD2477
02C5h
02C6h A/D Register 3AD3477
02C7h
02C8h
02C9h
02CAh
02CBh
02CCh
02CDh
02CEh
02CFh
02D0h
02D1h
02D2h
02D3h
02D4h A/D Control Register 2ADCON2477
02D5h
02D6h A/D Control Register 0ADCON0478
02D7h A/D Control Register 1ADCON1479
02D8h
02D9h
02DAh
02DBh
02DCh
02DDh
02DEh
02DFh
B - 6
AddressRegisterSymbolPage
02E0h Port P7 Direction RegisterPD767
02E1h
02E2h Port P7 RegisterP768
02E3h
02E4h Port P8 Direction RegisterPD867
02E5h Port P9 Direction RegisterPD967
02E6h Port P8 RegisterP868
02E7h Port P9 RegisterP968
02E8h
02E9h
02EAh
02EBh
02ECh
02EDh
02EEh
02EFh
02F0h
02F1h
02F2h
02F3h
02F4h
02F5h
02F6h
02F7h
02F8h
02F9h
02FAh
02FBh
02FCh Pull-Up Control Register 2PUR270
02FDh
02FEh
02FFh Timer RF Output Control RegisterTRFOUT368
FFFFh Option Function Select RegisterOFS34, 155, 499
NOTE:
1. The blank regions are reserved. Do not access locations in these
regions.
B - 7
R8C/2C Group, R8C/2D Group
REJ09B0339-0200
RENESAS MCU
1.Overview
1.1Features
The R8C/2C Group and R8C/2D Group of single-chip MCUs incorporates the R8C/ Tiny Series CPU core,
employing sophisticated instructions for a high level of efficiency. With 1 Mbyte of address space, and it is capable
of executing instructions at high speed. In addition, the CPU core boasts a multiplier for high-speed operation
processing.
Power consumption is low, and the supported operating modes allow additional power control. These MCUs also
use an anti-noise configuration to reduce emissions of electromagnetic noise and are designed to withstand EMI.
Integration of many peripheral functions, including multifunction timer and serial interface, reduces the number of
system components.
Furthermore, the R8C/2D Group has on-chip data flash (1 KB × 2 blocks).
The difference between the R8C/2C Group and R8C/2D Group is only the presence or absence of data flash. Their
peripheral functions are the same.
1.1.1Applications
Electronic household appliances, office equipment, audio equipment, consumer equipment, etc.
Rev.2.00
Dec 05, 2007
Rev.2.00Dec 05, 2007Page 1 of 585
REJ09B0339-0200
R8C/2C Group, R8C/2D Group1. Overview
1.1.2Specifications
Tables 1.1 and 1.2 outlines the Specifications for R8C/2C Group and Tables 1.3 and 1.4 outlines the
Specifications for R8C/2D Group.
Table 1.1Specifications for R8C/2C Group (1)
ItemFunctionSpecification
CPUCentral processing
unit
MemoryROM, RAMRefer to Table 1.5 Product List for R8C/2C Group.
Power Supply
Voltage
Detection
I/O PortsProgrammable I/O
Table 1.5 lists Product List for R8C/2C Group, Figure 1.1 shows a Part Number, Memory Size, and Package of
R8C/2C Group, Table 1.6 lists Product List for R8C/2D Group, and Figure 1.2 shows a Part Number, Memory
Size, and Package of R8C/2D Group.
Table 1.5Product List for R8C/2C GroupCurrent of Dec. 2007
VREFIReference voltage input pin to A/D converter and D/A
I/O Type
Connect a capacitor between AVCC and AVSS.
IInput “L” on this pin resets the MCU.
Connect a ceramic resonator or a crystal oscillator between
the XIN and XOUT pins
to the XIN pin and leave the XOUT pin open.
Connect a crystal oscillator between the XCIN and XCOUT
(1)
pins
. To use an external clock, input it to the XCIN pin and
leave the XCOUT pin open.
INT0 is timer RD input pin. INT1 is timer RA input pin.
IKey input interrupt input pins
I/OTimer RC I/O pins
I/OTimer RD I/O pins
OTimer RF output pins
I/OChip-select signal I/O pin
converter
Description
(1)
. To use an external clock, input it
Rev.2.00Dec 05, 2007Page 13 of 585
REJ09B0339-0200
R8C/2C Group, R8C/2D Group1. Overview
Table 1.10Pin Functions (2)
ItemPin Name
A/D converterAN0 to AN19IAnalog input pins to A/D converter
D/A converterDA0 to DA1OD/A converter output pins
I/O portP0_0 to P0_7,
P1_0 to P1_7,
P2_0 to P2_7,
P3_0 to P3_7,
P4_3 to P4_5,
P5_0 to P5_7,
P6_0 to P6_7,
P7_0 to P7_7,
P8_0 to P8_7,
P9_0 to P9_3
Input portP4_6, P4_7IInput-only ports
I: InputO: OutputI/O: Input and output
I/O Type
I/OCMOS 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.
P2_0 to P2_7 also function as LED drive ports.
Description
Rev.2.00Dec 05, 2007Page 14 of 585
REJ09B0339-0200
R8C/2C Group, R8C/2D Group2. 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
b15b8b7
R0H (high-order of R0)
R1H (high-order of R1)
R0L (low-order of R0)
R1L (low-order of R1)
R2
R3
A0
A1
FB
b15b19
INTBH
The 4 high order bits of INTB are INTBH and
the 16 low order 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.1CPU Registers
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.2.00Dec 05, 2007Page 15 of 585
REJ09B0339-0200
R8C/2C Group, R8C/2D Group2. Central Processing Unit (CPU)
2.1Data Registers (R0, R1, R2, and R3)
R0 is a 16-bit register for transfer, arithmetic, and logic operation s. The same applies to R1 to R3. R0 can be split
into high-order bits (R0H) and low-order bits (R0L) to be used separatel y as 8-bit data regi sters. R1H and R 1L are
analogous to R0H and R0L. R2 can be combined with R0 and used as a 32-bit data regi ster (R2R0). R3R1 is
analogous to R2R0.
2.2Address 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, arithmetic, and logic operations. A1 is analogous to A0. A1 can be combined with A0 and as a 32bit address register (A1A0).
2.3Frame Base Register (FB)
FB is a 16-bit register for FB relative addressing.
2.4Interrupt Table Register (INTB)
INTB is a 20-bit register that indicates the start address of an interrupt vector table.
2.5Program Counter (PC)
PC is 20 bits wide and indicates the address of the next instruction to be executed.
2.6User 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.7Static Base Register (SB)
SB is a 16-bit register for SB relative addressing.
2.8Flag Register (FLG)
FLG is an 11-bit register indicating the CPU state.
2.8.1Carry Flag (C)
The C flag retains carry, borrow, or shift-out bits that have been generated by the arithmetic and logic unit.
2.8.2Debug Flag (D)
The D flag is for debugging only. Set it to 0.
2.8.3Zero Flag (Z)
The Z flag is set to 1 when an arithmetic operation results in 0; otherwise to 0.
2.8.4Sign Flag (S)
The S flag is set to 1 when an arithmetic operation results in a negative value; otherwise to 0.
2.8.5Register 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.6Overflow Flag (O)
The O flag is set to 1 when an operation results in an overflow; otherwise to 0.
Rev.2.00Dec 05, 2007Page 16 of 585
REJ09B0339-0200
R8C/2C Group, R8C/2D Group2. Central Processing Unit (CPU)
2.8.7Interrupt Enable Flag (I)
The I flag enables maskable interrupts.
Interrupt are disabled when the I flag is set to 0, and are enabled when the I flag is set to 1. The I flag is set to 0
when an interrupt request is acknowledged.
2.8.8Stack Pointer Select Flag (U)
ISP is selected when the U flag is set to 0; USP is selected when the U flag is set to 1.
The U flag is set to 0 when a hardware interrupt request is acknowledged or the INT instruction of software
interrupt numbers 0 to 31 is executed.
2.8.9Processor 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.
2.8.10Reserved Bit
If necessary, set to 0. When read, the content is undefined.
Rev.2.00Dec 05, 2007Page 17 of 585
REJ09B0339-0200
R8C/2C Group, R8C/2D Group3. Memory
3.Memory
3.1R8C/2C Group
Figure 3.1 is a Memory Map of R8C/2C Group. The R8C/2C group has 1 Mbyte of address space from addresses
00000h to FFFFFh.
The internal ROM is allocated lower addresses, beginning with address 0FFFFh. For example, a 48-Kbyte internal
ROM area is allocated addresses 04000h to 0FFFFh.
The fixed interrupt vector table is allocated addresses 0FFDCh to 0FFFFh. They store the starting address of each
interrupt routine.
The internal RAM is allocated higher addresses, beginning with address 00400h. For example, a 2.5-Kbyte internal
RAM area is allocated addresses 00400h to 00DFFh. The internal RAM is used not only for storing data but also
for calling subroutines and as stacks when interrupt requests are acknowledged.
Special function registers (SFRs) are allocated addresses 00000h to 002FFh. The peripheral function control
registers are allocated here. All addresses within the SFR, which have nothing allocated are reserved for future use
and cannot be accessed by users.
00000h
002FFh
00400h
0XXXXh
03000h
0WWWWh
0YYYYh
0FFFFh
ZZZZZh
FFFFFh
NOTE:
1. The blank regions are reserved. Do not access locations in these regions.
SFR
(Refer to 4. Special
Function Registers
(SFRs))
Internal RAM
Internal RAM
Internal ROM
(program ROM)
Internal ROM
(program ROM)
Expanded area
0FFDCh
Watchdog timer, oscillation stop detection, voltage monitor
0FFFFh
Undefined instruction
Overflow
BRK instruction
Address match
Single step
(Reserved)
(Reserved)
Reset
Internal ROMInternal RAM
SizeAddress 0YYYYh
48 Kbytes
64 Kbytes
96 Kbytes
128 Kbytes
04000h
04000h
04000h
04000h
Address ZZZZZhSize
13FFFh
1BFFFh
23FFFh
Figure 3.1Memory Map of R8C/2C Group
Rev.2.00Dec 05, 2007Page 18 of 585
REJ09B0339-0200
Address 0XXXXh
−
2.5 Kbytes
3 Kbytes
7 Kbytes
7.5 Kbytes
00DFFh
00FFFh
011FFh
011FFh
Address 0WWWWh
−
−
03DFFh
03FFFh
R8C/2C Group, R8C/2D Group3. Memory
3.2R8C/2D Group
Figure 3.2 is a Memory Map of R8C/2D Group. The R8C/2D group has 1 Mbyte of address space from addresses
00000h to FFFFFh.
The internal ROM (program ROM) is allocated lower addresses, beginning with address 0FFFFh. For example, a
48-Kbyte internal ROM area is allocated addresses 04000h to 0FFFFh.
The fixed interrupt vector table is allocated addresses 0FFDCh to 0FFFFh. They store the starting address of each
interrupt routine.
The internal ROM (data flash) is allocated addresses 02400h to 02BFFh.
The internal RAM area is allocated higher addresses, beginning with address 00400h. For example, a 2.5-Kbyte
internal RAM is allocated addresses 00400h to 00DFFh. The internal RAM is used not only for storing data but
also for calling subroutines and as stacks when interrupt requests are acknowledged.
Special function registers (SFRs) are allocated addresses 00000h to 002FFh. The peripheral function control
registers are allocated here. All addresses within the SFR, which have nothing allocated are reserved for future use
and cannot be accessed by users.
00000h
002FFh
00400h
0XXXXh
02400h
02BFFh
03000h
0WWWWh
0YYYYh
0FFFFh
ZZZZZh
FFFFFh
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.
SFR
(Refer to 4. Special
Function Registers
(SFRs))
Internal RAM
Internal ROM
(data flash)
Internal RAM
Internal ROM
(program ROM)
Internal ROM
(program ROM)
Expanded area
(1)
0FFDCh
Watchdog timer, oscillation stop detection, voltage monitor
0FFFFh
Undefined instruction
Overflow
BRK instruction
Address match
Single step
(Reserved)
(Reserved)
Reset
Internal ROMInternal RAM
SizeAddress 0YYYYh
48 Kbytes
64 Kbytes
96 Kbytes
128 Kbytes
04000h
04000h
04000h
04000h
13FFFh
1BFFFh
23FFFh
Figure 3.2Memory Map of R8C/2D Group
Rev.2.00Dec 05, 2007Page 19 of 585
REJ09B0339-0200
Address 0XXXXhAddress ZZZZZhSize
−
2.5 Kbytes
3 Kbytes
7 Kbytes
7.5 Kbytes
00DFFh
00FFFh
011FFh
011FFh
Address 0WWWWh
−
−
03DFFh
03FFFh
R8C/2C Group, R8C/2D Group4. Special Function Registers (SFRs)
4.Special Function Registers (SFRs)
An SFR (special function register) is a control register for a peripheral function. Tables 4.1 to 4.12 list the special
function registers.
1. The blank regions are reserved. Do not access locations in these regions.
2. Selected by the IICSEL bit in the PMR register.
SS Control Register H / IIC bus Control Register 1
SS Control Register L / IIC bus Control Register 2
SS Mode Register / IIC bus Mode Register
SS Enable Register / IIC bus Interrupt Enable Register
SS Status Register / IIC bus Status Register
SS Mode Register 2 / Slave Address Register
SS Transmit Data Register / IIC bus Transmit Data Register
SS Receive Data Register / IIC bus Receive Data Register
0118hTimer RE Second Data Register / Counter Data RegisterTRESEC00h
0119hTimer RE Minute Data Register / Compare Data RegisterTREMIN00h
011AhTimer RE Hour Data RegisterTREHR00h
011BhTimer RE Day of Week Data RegisterTREWK00h
011ChTimer RE Control Register 1TRECR100h
011DhTimer RE Control Register 2TRECR200h
011EhTimer RE Clock Source Select Register TRECSR00001000b
011Fh
1. The blank regions are reserved. Do not access locations in these regions.
2. The OFS register cannot be changed by a program. Use a flash programmer to write to it.
Rev.2.00Dec 05, 2007Page 31 of 585
REJ09B0339-0200
R8C/2C Group, R8C/2D Group5. Resets
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.
Table 5.1Reset Names and Sources
Reset NameSource
Hardware resetInput voltage of RESET
Power-on resetVCC rises
Voltage monitor 0 resetVCC falls (monitor voltage: Vdet0)
Voltage monitor 1 resetVCC falls (monitor voltage: Vdet1)
Voltage monitor 2 resetVCC falls (monitor voltage: Vdet2)
Watchdog timer resetUnderflow of watchdog timer
Software resetWrite 1 to PM03 bit in PM0 register
pin is held “L”
RESET
VCC
Power-on reset
circuit
Voltage
detection
circuit
Watchdog
timer
CPU
Hardware reset
Power-on reset
Voltage monitor 0 reset
Voltage monitor 1 reset
Voltage monitor 2
reset
Watchdog timer
reset
Software reset
VCA13: Bit in VCA1 register
VCA25, VCA26, VCA27: Bits in VCA2 register
VW0C0, VW0C1, VW0C6, VW0F0, VW0F1, VW0C7: Bits in VW0C register
VW1C2, VW1C3: Bits in VW1C register
VW2C2, VW2C3: Bits in VW2C register
Pin, CPU, and
SFR bits other than
those listed above
Figure 5.1Block Diagram of Reset Circuit
Rev.2.00Dec 05, 2007Page 32 of 585
REJ09B0339-0200
R8C/2C Group, R8C/2D Group5. Resets
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.
Table 5.2Pin Functions while RESET
Pin Level is “L”
Pin NamePin Functions
P0 to P3, P5 to P8Input port
P4_3 to P4_7Input port
P9_0 to P9_3Input port
b15
b15
0000h
0000h
0000h
0000h
0000h
0000h
0000h
b19
00000h
Content of addresses 0FFFEh to 0FFFCh
b15
0000h
0000h
0000h
b15
0000h
b8
b7
b0
Data register(R0)
Data register(R1)
Data register(R2)
Data register(R3)
Address register(A0)
Address register(A1)
Frame base register(FB)
b0
Interrupt table register(INTB)
Program counter(PC)
b0
User stack pointer(USP)
Interrupt stack pointer(ISP)
Static base register(SB)
b0
Flag register(FLG)
b0
IPL
Figure 5.2CPU Register Status after Reset
Rev.2.00Dec 05, 2007Page 33 of 585
REJ09B0339-0200
C
DZSBOIU
R8C/2C Group, R8C/2D Group5. Resets
fOCO-S
RESET pin
Internal reset
signal
CPU clock
Address
(internal address
signal)
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
10 cycles or more are needed
fOCO-S clock × 32 cycles
Start time of flash memory
(CPU clock × 14 cycles)
reset signal to “H” at the same.
(1)
(2)
CPU clock × 28 cycles
Figure 5.3Reset Sequence
Option Function Select Register
b7 b6 b5 b4 b3 b2 b1 b0
111
NOTES:
The OFS register is on the flash memory. Write to the OFS register w ith a program. Af ter w riting is completed, do not
1.
w rite additions to the OFS register.
2.
To use the pow er-on reset, set the LV D0ON bit to 0 (voltage monitor 0 reset enabled after hardw are reset).
3. If the block including the OFS register is erased, FFh is set to the OFS register.
SymbolAddres sWhen Shipping
OFS
Bit SymbolBit NameFunctionRW
WDTONRW
—
(b1)
ROMCR
ROMCP1
—
(b4)
LVD0ON
—
(b6)
CSPROINI
(1)
0FFFFhFFh
Watchdog timer start
select bit
0 : Starts w atchdog timer automatically af ter reset
1 : Watchdog timer is inactive af ter reset
Reserved bitSet to 1.
ROM code protect
disabled bit
0 : ROM c ode protect disabled
1 : ROMCP1 enabled
ROM code protect bit0 : ROM code protect enabled
1 : ROM c ode protect disabled
Reserved bitSet to 1.
Voltage detection 0
circuit start bit
(2)
0 : Voltage monitor 0 reset enabled after hardw are
res et
1 : Voltage monitor 0 reset disabled after hardw are
res et
Reserved bitSet to 1.
Count source protect
mode after reset select
0 : Count source protect mode enabled after reset
1 : Count sourc e protec t mode disabled after reset
bit
0FFFCh0FFFEh
0FFFDh
(3)
Content of reset vector
RW
RW
RW
RW
RW
RW
RW
Figure 5.4OFS Register
Rev.2.00Dec 05, 2007Page 34 of 585
REJ09B0339-0200
R8C/2C Group, R8C/2D Group5. Resets
5.1Hardware Reset
A reset is applied using the RESET pin. When an “L” signal is applied to the RESET pin while the supply voltage
meets the recommended operating conditions, pins, CPU, and SFRs are all reset (refer to Table 5.2 Pi n Functions
while RESET
program is executed beginning with the address indicated by the reset vector. After reset, the low-speed on-chip
oscillator clock divided by 8 is automatically selected as the CPU clock.
Refer to 4. Special Function Registers (SFRs) for the state of the SFRs after reset.
The internal RAM is not reset. If the RESET
contents of internal RAM will be undefined.
Figure 5.5 shows an Example of Hardware Reset Circuit a nd Operation and Figure 5.6 shows an Example o f
Hardware Reset Circuit (Usage Example of External Supply Voltage Detection Circuit) and Operation.
Pin Level is “L”). When the input level applied to the RESET pin changes from “L” to “H”, a
pin is pulled “L” while writing to the internal RAM is in progress, the
5.1.1When Power Supply is Stable
(1) Apply “L” to the RESET pin.
(2) Wait for 10 µs or more.
(3) Apply “H” to the RESET
pin.
5.1.2Power 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 21. Electrical
Characteristics).
(4) Wait for 10 µs or more.
(5) Apply “H” to the RESET
pin.
Rev.2.00Dec 05, 2007Page 35 of 585
REJ09B0339-0200
R8C/2C Group, R8C/2D Group5. Resets
VCC
VCC
0 V
RESET
RESET
0 V
NOTE:
1. Refer to 21. Electrical Characteristics.
2.2 V
td(P-R) + 10 µs or more
Figure 5.5Example of Hardware Reset Circuit and Operation
5 V
VCC
0 V
5 V
RESET
RESETVCC
Supply voltage
detection circuit
0.2 VCC or below
2.2 V
0 V
td(P-R) + 10 µs or more
Example when
VCC = 5 V
NOTE:
1. Refer to
21. Electrical Characteristics.
Figure 5.6Example of Hardware Reset Circui t (Us a ge Exam pl e of Exte rnal Supply Voltage
Detection Circuit) and Operation
Rev.2.00Dec 05, 2007Page 36 of 585
REJ09B0339-0200
R8C/2C Group, R8C/2D Group5. Resets
5.2Power-On Reset Function
When the RESET pin is connected to the VCC pin via a pull-up resistor, and the VCC pin voltage level rises while
the rise gradient is trth or more, the power-on reset function is enabled and the MCU resets its pins, CPU, and SFR.
When a capacitor is connected to the RESET
When the input voltage to the VCC pin reaches the Vdet0 level or above, the low-speed on-chip oscillator clock
starts counting. When the low-speed on-chip oscillator clock count reaches 32, the internal reset signal is held “H”
and the MCU enters the reset sequence (refer to Figure 5.3). The low-speed on-chip oscillator clock divided by 8 is
automatically selected as the CPU clock after reset.
Refer to 4. Special Function Registers (SFRs) for the states of the SFR after power-on reset.
The voltage monitor 0 reset is enabled after power-on reset.
Figure 5.7 shows an Example of Power-On Reset Circuit and Operation.
VCC
4.7 kΩ¶
(reference)
RESET
pin, too, always keep the voltage to the RESET pin 0.8VCC or more.
(3)
Vdet0
External
Power V
reset signal
CC
Vpor1
w(por1)
t
Internal
(“L” valid)
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 21. 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.
trth
1
f
OCO-S
Sampling time
× 32
2.2V
(1, 2)
trth
f
Figure 5.7Example of Power-On Reset Circuit and Operation
Vpor2
1
OCO-S
Vdet0
× 32
(3)
Rev.2.00Dec 05, 2007Page 37 of 585
REJ09B0339-0200
R8C/2C Group, R8C/2D Group5. Resets
5.3Voltage Monitor 0 Reset
A reset is applied using the on-chip voltage detection 0 circuit. The voltage detection 0 circuit monitors the input
voltage to the VCC pin. The voltage to monitor is Vdet0.
When the input voltage to the VCC pin reaches the Vdet0 level or below, the pins, CPU, and SFR are reset.
When the input voltage to the VCC pin reaches the Vdet0 level or above, the low-speed on-chip oscillator clock
start counting. When the low-speed on-chip oscillator clock count reaches 32, the internal reset signal is held “H”
and the MCU enters the reset sequence (refer to Figure 5.3). The low-speed on-chip oscillator clock divided by 8 is
automatically selected as the CPU clock after reset.
The LVD0ON bit in the OFS register can be used to enable or disable voltage monitor 0 reset after a hardware
reset. Setting the LVD0ON bit is only valid after a hardware reset.
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.
The LVD0ON bit cannot be changed by a p rogram. To set the LVD0ON bit, writ e 0 (voltage monitor 0 reset
enabled after hardware reset) or 1 (voltage monitor 0 reset disabled after hardware reset) to bit 5 of address 0FFFFh
using a flash programmer.
Refer to Figure 5.4 OFS Register for details of the OFS register.
Refer to 4. Special Function Registers (SFRs) for the status of the SFR after voltage monitor 0 reset.
The internal RAM is not reset. When the input voltage to the VCC pin reaches the Vdet0 level or below while
writing to the internal RAM is in progress, the contents of internal RAM are undefined.
Refer to 6. Voltage Detection Circuit for details of voltage monitor 0 reset.
5.4Voltage Monitor 1 Reset
A reset is applied using the on-chip voltage detection 1 circuit. The voltage detection 1 circuit monitors the input
voltage to the VCC pin. The voltage to monitor is Vdet1.
When the input voltage to the VCC pin reaches the Vdet1 level or below, the pins, CPU, and SFR are
program is executed beginning with the address indicated by the reset vector. After reset, the low-speed on-chip
oscillator clock divided by 8 is automatically selected as the CPU clock.
The voltage monitor 1 does not reset some portions of the SFR. Refer to 4. Special Function Registers (SFRs) for
details.
The internal RAM is not reset. When the input voltage to the VCC pin reaches the Vdet1 level or below while
writing to the internal RAM is in progress, the contents of internal RAM are undefined.
Refer to 6. Voltage Detection Circuit for details of voltage monitor 1 reset.
reset and a
5.5Voltage Monitor 2 Reset
A reset is applied using the on-chip voltage detection 2 circuit. The voltage detection 2 circuit monitors the input
voltage to the VCC pin. The voltage to monitor is Vdet2.
When the input voltage to the VCC pin
program beginning with the address indicated by the reset vector is executed. After reset, the low-speed on-chip
oscillator clock divided by 8 is automatically selected as the CPU clock.
The voltage monitor 2 does not reset some SFRs. Refer to 4. Special Function Registers (SFRs) for details.
The internal RAM is not reset. When the input voltage to the VCC pin reaches the Vdet2 level or below while
writing to the internal RAM is in progress, the contents of internal RAM are undefined.
Refer to 6. Voltage Detection Circuit for details of voltage monitor 2 reset.
reaches
the Vdet2 level or below, the pins, CPU, and SFR are reset and the
Rev.2.00Dec 05, 2007Page 38 of 585
REJ09B0339-0200
R8C/2C Group, R8C/2D Group5. Resets
5.6Watchdog Timer Reset
When the PM12 bit in the PM1 register is set to 1 (reset when watchdog timer underflows), the MCU resets its pins,
CPU, and SFR if the watchdog timer underflows. Then the program b eginning with the address in dicated by the
reset vector is executed. After reset, the low-speed on-chip oscillator clock divided by 8 is automatically selected as
the CPU clock.
The watchdog timer reset does not reset some SFRs. Refer to 4. Special Function Registers (SFRs) for details.
The internal RAM is not reset. When the watchdog timer underflows, the contents of internal RAM are undefined.
Refer to 13. Watchdog Timer for details of the watchdog timer.
5.7Software Reset
When the PM03 bit in the PM0 register is set to 1 (MCU reset), the MCU resets its pins, CPU, and SFR. The
program beginning with the address indicated by the reset vector is executed. After reset, the low-speed on-chip
oscillator clock divided by 8 is automatically selected for the CPU clock.
The software reset does not reset some SFRs. Refer to 4. Special Function Registers (SFRs) for details.
The internal RAM is not reset.
Rev.2.00Dec 05, 2007Page 39 of 585
REJ09B0339-0200
R8C/2C Group, R8C/2D Group6. Voltage Detection Circuit
6.Voltage Detection Circuit
The voltage detection circuit monitors the input voltage to the VCC pin. This circuit can be used to monitor the VCC
input voltage by a program. Alternately, voltage monitor 0 reset, voltage monitor 1 interrupt, voltage monitor 1 reset,
voltage monitor 2 interrupt, and voltage monitor 2 reset can also be used.
Table 6.1 lists the Specifications of Voltage Detection Circuit and Figures 6.1 to 6.4 show the Block Diagrams. Figures
6.5 to 6.8 show the Associated Registers.
Table 6.1Specifications of Voltage Detection Circuit
InterruptNoneVoltage monitor 1 interrupt Voltage monitor 2 interrupt
enabled/disabled
Sampling time(Divide-by-n of fOCO-S)
through Vdet0 by rising
or falling
Reset at Vdet0 > VCC;
restart CPU operation at
VCC > Vdet0
AvailableAvailableAvailable
× 4
n: 1, 2, 4, and 8
Passing through Vdet1 by
rising or falling
register
Whether VCC is higher or
lower than Vdet1
Reset at Vdet1 > VCC;
restart CPU operation
after a specified time
Interrupt request at Vdet1
> VCC and VCC > Vdet1
when digital filter is
enabled;
interrupt request at Vdet1
> VCC or VCC > Vdet1
when digital filter is
disabled
(Divide-by-n of fOCO-S)
× 4
n: 1, 2, 4, and 8
Passing through Vdet2 by
rising or falling
VCA13 bit in VCA1
register
Whether VCC is higher or
lower than Vdet2
Reset at Vdet2 > VCC;
restart CPU operation
after a specified time
Interrupt request at Vdet2
> VCC and VCC > Vdet2
when digital filter is
enabled;
interrupt request at Vdet2
> VCC or VCC > Vdet2
when digital filter is
disabled
(Divide-by-n of fOCO-S)
× 4
n: 1, 2, 4, and 8
Rev.2.00Dec 05, 2007Page 40 of 585
REJ09B0339-0200
R8C/2C Group, R8C/2D Group6. Voltage Detection Circuit
VCC
Internal
reference
voltage
VCA27
+
-
VCA26
+
-
VCA25
+
-
≥ Vdet2
≥ Vdet1
≥ Vdet0
Noise
filter
Noise
filter
Voltage detection 2
signal
VCA1 register
b3
VCA13 bit
Voltage detection 1
signal
VW1C register
b3
VW1C3 bit
Voltage detection 0
signal
Figure 6.1Block Diagram of Voltage Detectio n Circuit
Voltage monitor 0 reset generation circuit
VW0F1 to VW0F0
= 00b
Voltage detection 0 circuit
fOCO-S
VCA25
VCC
+
Internal
reference
voltage
-
Voltage detection 0
signal is held “H” when
VCA25 bit is set to 0
(disabled)
VW0C0 to VW0C1, VW0F0 to VW0F1, VW0C6, VW0C7: Bits in VW0C register
VCA25: Bit in VCA2 regi ster
Voltage
detection 0
signal
1/21/21/2
= 01b
= 10b
= 11b
VW0C7
Digital
filter
VW0C1
VW0C1
VW0C0
VW0C6
Voltage monitor 0
reset signal
Figure 6.2Block Diagram of Voltage Monitor 0 Reset Generation Circuit
Rev.2.00Dec 05, 2007Page 41 of 585
REJ09B0339-0200
R8C/2C Group, R8C/2D Group6. Voltage Detection Circuit
Voltage monitor 1 interrupt/reset generation circuit
VW1F1 to VW1F0
= 00b
Voltage detection 1 circuit
VCA26
VCC
+
Internal
reference
voltage
VW1C0 to VW1C3, VW1F0, VW1F1, VW1C 6, VW1C7: Bits in VW1C register
VCA26: Bit in VCA2 register
Noise filter
-
(Filter width: 200 ns)
Voltage detection 1 signal
is held “H” when VCA26 bit
is set to 0 (disabled)
fOCO-S
Voltage
detection
1 signal
VW1C3
1/21/21/2
= 01b
= 10b
= 11b
VW1C7
VW1C2 bit is set to 0 (not detected) by
writing 0 by a program.
When VCA26 bit is set to 0 (voltage
detection 1 circuit disabled), VW1C2
bit is set to 0
VW1C1
Digital
filter
VW1C1
VW1C0
VW1C6
VW1C2
Watchdog
timer interrupt
signal
Voltage monitor 1
interrupt signal
Oscillation stop
detection
interrupt signal
Non-maskable
interrupt signal
Voltage monitor 1
reset signal
Figure 6.3Block Diagram of Voltage Monitor 1 Interrupt/Reset Generation Circuit
Voltage monitor 2 interr upt/reset generation circuit
VW2F1 to VW2F0
= 00b
Voltage detection 2 circuit
VCA27
VCC
+
-
(Filter width: 200 ns)
Noise filter
Watchdog timer
underflow signal
Voltage detection 2 signal
is held “H” when VCA27 bit
is set to 0 (disabled)
Internal
reference
voltage
Watchdog timer block
VW2C0 to VW2C3, VW2F0, VW2F1, VW2C6, VW2C7: Bits in VW2C register
VCA13: Bit in VCA1 register
VCA27: Bit in VCA2 register
fOCO-S
VCA13
Voltage
detection
2 signal
1/21/21/2
VW2C3
This bit is set to 0 (not detected) by writing 0
by a program.
= 01b
= 10b
= 11b
VW2C7
VW2C2 bit is set to 0 (not detected) by
writing 0 by a program.
When VCA27 bit is set to 0 (voltage
detection 2 circuit disabled), VW2C2
bit is set to 0
VW2C1
Digital
filter
VW2C1
VW2C0
VW2C6
VW2C2
timer interrupt
Voltage monitor 2
interrupt signal
Oscillation stop
interrupt signal
Watchdog
signal
detection
Non-maskable
interrupt signal
Voltage monitor 2
reset signal
Figure 6.4Block Diagram of Voltage Monitor 2 Interrupt/Reset Generation Circuit
Rev.2.00Dec 05, 2007Page 42 of 585
REJ09B0339-0200
R8C/2C Group, R8C/2D Group6. Voltage Detection Circuit
Voltage Detection Register 1
0
b0
00
SymbolAddressAf ter Reset
VCA1
0031h00001000b
(2)
Bit SymbolBit NameFunctionRW
—
Reserved bits
Set to 0.
(b2-b0)
0 : VCC < Vdet2
1 : VCC ≥ Vdet2 or voltage detection 2
VCA13
Voltage detection 2 signal monitor
(1)
flag
circ uit disabled
—
Reserved bitsSet to 0.
(b7-b4)
RW
RO
RW
b7 b6 b5 b4 b3 b2 b1
0000
NOTES:
The VCA13 bit is enabled w hen the VCA27 bit in the VCA2 register is s et to 1 (voltage detection 2 circuit enabled).
1.
The VCA13 bit is set to 1 (VCC ≥ Vdet 2) w hen the VCA27 bit in the VCA2 register is set to 0 (voltage detection 2
circ uit disabled).
2. The softw are reset, w atchdog timer reset, voltage monitor 1 reset, and voltage monitor 2 reset do not af fect this
register.
Voltage Detection Register 2
b3 b2 b1 b0b7 b6 b5 b4
0000
(1)
SymbolAddressA f ter Reset
(5)
The LVD0ON bit in the OFS register is
set to 1 and hardw are reset : 00h
Pow er-on reset, voltage monitor 0 reset
or LVD0ON bit in the OFS register is
VCA20032h
set to 0, and hardw are res et : 00100000b
Bit SymbolBit NameFunctionRW
VCA20
—
Internal pow er low
consumption enable bit
Reserved bitsSet to 0.
0 : Disables low consumption
(6)
1 : Enables low cons umption
(b4-b1)
VCA25
VCA26
VCA27
Voltage detection 0 enable
(2)
bit
Voltage detection 1 enable
(3)
bit
Voltage detection 2 enable
(4)
bit
0 : Voltage detection 0 circ uit disabled
1 : Voltage detection 0 circ uit enabled
0 : Voltage detection 1 circ uit disabled
1 : Voltage detection 1 circ uit enabled
0 : Voltage detection 2 circ uit disabled
1 : Voltage detection 2 circ uit enabled
NOTES:
Set the PRC3 bit in the PRCR register to 1 (w rite enable) before w riting to the VCA2 register.
1.
2.
To use the voltage monitor 0 reset, set the V CA25 bit to 1.
Af ter the V CA25 bit is set to 1 from 0, the voltage detection circuit w aits f or td(E-A) to elapse bef ore starting
operation.
To use the voltage monitor 1 interrupt/res et or the VW1C3 bit in the VW1C register, set the VCA26 bit to 1.
3.
Af ter the V CA26 bit is set to 1 from 0, the voltage detection circuit w aits f or td(E-A) to elapse bef ore starting
operation.
4.
To use the voltage monitor 2 interrupt/res et or the VCA13 bit in the VCA1 register, set the VCA27 bit to 1.
Af ter the V CA27 bit is set to 1 from 0, the voltage detection circuit w aits f or td(E-A) to elapse bef ore starting
operation.
5.
Softw are res et, w atchdog timer reset, voltage monitor 1 reset, and v oltage monitor 2 reset do not affect this
register.
6. Use the VCA20 bit only w hen entering to w ait mode. To s et the VCA20 bit, follow the procedure show n in
10.10 Procedure for Enabli ng Reduced Internal P ower Consumption Using VCA20 bit
RW
RW
RW
RW
RW
Figur e
.
Figure 6.5Registers VCA1 and VCA2
Rev.2.00Dec 05, 2007Page 43 of 585
REJ09B0339-0200
R8C/2C Group, R8C/2D Group6. Voltage Detection Circuit
Voltage Monit or 0 Circuit Control Register
b7 b6 b5 b4
b3 b2
b1 b0
0
SymbolAddress
VW0C0038h
Bit SymbolBit NameFunctionRW
VW0C0RW
Voltage monitor 0 reset
enable bit
(3)
Voltage monitor 0 digital filter
VW0C1
VW0C2
disable mode select bit
Reserved bit
—
Reserved bit
(b3)
Sampling clock select bits
VW0F0RW
VW0F1RW
Voltage monitor 0 circuit
VW0C6
mode select bit
(1)
After Reset
(2)
The LVD0ON bit in the OFS register is
set to 1 and hardw are reset : 0000X000b
Pow er-on reset, voltage monitor 0 reset
or LVD0ON bit in the OFS register is s et
to 0, and hardw are reset : 0100X001b
0 : Disable
1 : Enable
0 : Digital filter enabled mode
(digital filter circuit enabled)
1 : Digital filter disabled mode
(digital filter circuit disabled)
Set to 0.
When read, the content is undefined.
b5 b4
0 0 : fOCO-S divided by 1
0 1 : fOCO-S divided by 2
1 0 : fOCO-S divided by 4
1 1 : fOCO-S divided by 8
When the VW0C0 bit is set to 1 (voltage monitor 0
reset enabled), set to 1.
RW
RW
RO
RW
VW0C7
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 af ter a sof tw are reset, w atchdog timer res et, 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 s et to 1 (voltage detection 0 circ uit
enabled). Set the VW0C0 bit to 0 (disable), w hen the VCA25 bit is set to 0 (voltage detection 0 circuit disabled).
The VW0C7 bit is enabled w hen the VW0C1 bit set to 1 (digital filter disabled mode) .
4.
Figure 6.6VW0C Register
Voltage monitor 0 reset
generation condition select
(4)
bit
When the VW0C1 bit is set to 1 (digital filter
disabled mode) , set to 1.
RW
Rev.2.00Dec 05, 2007Page 44 of 585
REJ09B0339-0200
R8C/2C Group, R8C/2D Group6. Voltage Detection Circuit
Voltage Monitor 1 Circuit Control Register
b2
b1 b0b3b7 b6 b5 b4
SymbolAddressAf ter Reset
VW1C0036h00001000b
Bit SymbolBit NameFunctionRW
VW1C0RW
VW1C1
VW1C2
VW1C3
VW1F0RW
VW1F1RW
VW1C6
VW1C7
Voltage monitor 1 interrupt/reset
enable bit
(6)
Voltage monitor 1 digital filter
disable mode s elect bit
Voltage change detection
(3, 4, 8)
flag
Voltage detection 1 signal monitor
(3, 8 )
flag
Sampling clock select bits
Voltage monitor 1 circuit mode
select bit
(5)
Voltage monitor 1 interrupt/reset
generation condition select bit
(1)
(8)
0 : Disable
1 : Enable
(2)
0 : Digital filter enabled mode
(digital filter circuit enabled)
1 : Digital filter disabled mode
RW
(digital filter circuit disabled)
0 : Not detected
1 : Vdet1 cros sing detected
RW
0 : V CC < V d e t 1
1 : V CC ≥ Vdet1 or voltage detection 1
RO
circ uit disabled
b5 b4
0 0 : fOCO-S divided by 1
0 1 : fOCO-S divided by 2
1 0 : fOCO-S divided by 4
1 1 : fOCO-S divided by 8
0 : Voltage monitor 1 interrupt mode
1 : Voltage monitor 1 reset mode
0 : When VCC reaches Vdet1 or above
(7, 9 )
1 : When VCC reaches Vdet1 or below
RW
RW
NOTES:
Set the PRC3 bit in the PRCR register to 1 (rew rite enable) before w riting to the VW1C register.
1.
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
2.
1.
Bits VW1C2 and VW1C3 are enabled w hen the VCA26 bit in the VCA2 register is s et to 1 (voltage detection 1 circuit
3.
enabled).
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
4.
w ritten to it) .
The VW1C6 bit is enabled w hen the VW1C0 bit is set to 1 (voltage monitor 1 interrupt/enabled reset).
5.
The VW1C0 bit is enabled w hen the VCA26 bit in the VCA2 register is set to 1 (voltage detection 1 circuit enabled).
6.
Set the VW1C0 bit to 0 (disable) w hen the VCA26 bit is set to 0 (voltage detection 1 circuit disabled).
The VW1C7 bit is enabled w hen the VW1C1 bit is set to 1 (digital filter disabled mode).
7.
Bits VW1C2 and VW1C3 remain unchanged af ter a sof tw are reset, w atchdog timer reset, voltage monitor 1 reset,
8.
or voltage monitor 2 reset.
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
9.
below ). (Do not set to 0.)
Figure 6.7VW1C Register
Rev.2.00Dec 05, 2007Page 45 of 585
REJ09B0339-0200
R8C/2C Group, R8C/2D Group6. Voltage Detection Circuit
Voltage Monitor 2 Circuit Control Register
b7 b6 b5 b4 b3 b2
b1 b0
SymbolA ddressAfter Reset
VW2C0037h00h
Bit SymbolBit NameFunctionRW
VW2C0RW
Voltage monitor 2 interrupt/reset
enable bit
(6)
Voltage monitor 2 digital filter
VW2C1
VW2C2
VW2C3
disable mode select bit
Voltage change detection
(3, 4, 8)
flag
WDT detection flag
Sampling clock select bits
VW2F0RW
VW2F1RW
VW2C6
Voltage monitor 2 circuit mode
select bit
(5)
Voltage monitor 2 interrupt/reset
VW2C7
generation condition select bit
(1)
(4, 8 )
(8)
0 : Disable
1 : Enable
(2)
0 : Digital filter enabled mode
(digital filter circuit enabled)
1 : Digital filter disabled mode
RW
(digital filter circuit disabled)
0 : Not detected
1 : VCC has crossed V det2
0 : Not detected
1 : Detected
b5 b4
RW
RW
0 0 : f OCO-S divided by 1
0 1 : f OCO-S divided by 2
1 0 : f OCO-S divided by 4
1 1 : f OCO-S divided by 8
0 : Voltage monitor 2 interrupt mode
1 : Voltage monitor 2 res et mode
0 : When VCC reaches Vdet2 or abov e
(7, 9 )
1 : When VCC reaches Vdet2 or below
RW
RW
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 ex it 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 circ uit
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 circ uit
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 s of tw are res et, w atchdog timer res et, voltage monitor 1 reset,
or voltage monitor 2 reset.
9. When the VW2C6 bit is set to 1 (v oltage monitor 2 res et mode), set the V W2C7 bit to 1 (w hen VCC reaches Vdet2
or below ). (Do not set to 0.)
Figure 6.8VW2C Register
Rev.2.00Dec 05, 2007Page 46 of 585
REJ09B0339-0200
R8C/2C Group, R8C/2D Group6. Voltage Detection Circuit
6.1VCC Input Voltage
6.1.1Monitoring Vdet0
Vdet0 cannot be monitored.
6.1.2Monitoring Vdet1
Set the VCA26 bit in the VCA2 reg ister to 1 (voltag e detection 1 cir cuit enabled). A fter td(E-A) has e lapsed
(refer to 21. Electrical Characteristics), Vdet1 can be monitored by the VW1C3 bit in the VW1C register.
6.1.3Monitoring Vdet2
Set the VCA27 bit in the VCA2 reg ister to 1 (voltag e detection 2 cir cuit enabled). A fter td(E-A) has e lapsed
(refer to 21. Electrical Characteristics), Vdet2 can be monitored by the VCA13 bit in the VCA1 register.
Rev.2.00Dec 05, 2007Page 47 of 585
REJ09B0339-0200
R8C/2C Group, R8C/2D Group6. Voltage Detection Circuit
6.2Voltage Monitor 0 Reset
Table 6.2 lists the Procedure for Setting Bits Associated with Voltage Monitor Reset and Figure 6.9 shows an
Example of Voltage Monitor 0 Reset Operation. To use the voltage monitor 0 reset to exit stop mode, set the
VW0C1 bit in the VW0C register to 1 (digital filter disabled).
Table 6.2Procedure for Setting Bits Associated with Voltage Monitor Reset
StepWhen Using Digital FilterWhen Not Using Digital Filter
1Set the VCA25 bit in the VCA2 register to 1 (voltage detection 0 circuit enabled)
2Wait for td(E-A)
Select the sampling clock of the digital filter
3
by the VW0F0 to VW0F1 bits in the VW0C
register
(1)
4
(1)
5
Set the VW0C1 bit in the VW0C register to
0 (digital filter enabled)
Set the VW0C6 bit in the VW0C register to 1 (voltage monitor 0 reset mode)
6Set the VW0C2 bit in the VW0C register to 0
7Set the CM14 bit in the CM1 register to 0
(low-speed on-chip oscillator on)
8Wait for 4 cycles of the sampling clock of
the digital filter
9Set the VW0C0 bit in the VW0C register to 1 (voltage monitor 0 reset enabled)
Set the VW0C7 bit in the VW0C register to
1
Set the VW0C1 bit in the VW0C register to
1 (digital filter disabled)
−
− (No wait time required)
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
fOCO-S
1
fOCO-S
× 32
When the VW0C1 bit is set
to 0 (digital filter enabled)
When the VW0C1 bit is set
to 1 (digital filter disabl ed)
and the VW0C7 bit is set
to 1
VW0C1 and VW0C7: Bits in VW0C register
Internal reset signal
Internal reset signal
The above applies under the following conditions.
• VCA25 bit in VCA2 register = 1 (voltage detection 0 circuit enabled)
• VW0C0 bit in VW0C registe r = 1 (voltage monitor 0 reset enabled)
• VW0C6 bit in VW0C register = 1 (voltage monitor 0 reset mode)
When the internal reset signal is held “L”, the pins, CPU and SFR are reset.
The internal reset sign al level changes from “L” to “H”, and a program is executed beginn ing with the address indicated by
the reset vector.
Refer to
Sampling clock of
digital filter
× 4 cycles
4. Special Function Registers (SFRs) for the SFR status after reset.
Figure 6.9Example of Voltage Monitor 0 Reset Operation
Rev.2.00Dec 05, 2007Page 48 of 585
REJ09B0339-0200
R8C/2C Group, R8C/2D Group6. Voltage Detection Circuit
6.3Voltage Monitor 1 Interrupt and Voltage Monitor 1 Reset
Table 6.3 lists the Procedure for Setting Bits Associated with Voltage Monitor 1 Interrupt and Reset. Figure 6.10
shows an Example of Voltage Monitor 1 Interrupt and Voltage Monitor 1 Reset Operation. To use the voltage
monitor 1 interrupt or voltage monitor 1 reset to exit stop mode, set the VW1C1 bit in the VW1C register to 1
(digital filter disabled).
Table 6.3Procedure for Setting Bits Associated with Voltage Monitor 1 Interrupt and Reset
When Using Digital FilterWhen Not Using Digital Filter
Step
1Set the VCA26 bit in the VCA2 register to 1 (voltage detection 1 circuit enabled)
2Wait for td(E-A)
3
(2)
4
(2)
5
6Set the VW1C2 bit in the VW1C register to 0 (passing of Vdet1 is not detected)
7Set the CM14 bit in the CM1 register to 0
8Wait for 4 cycles of the sampling clock of the
9Set 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).
Voltage Monitor 1
Interrupt
Voltage Monitor 1
Reset
Select the sampling clock of the digital filter
by the VW1F0 to VW1F1 bits in the VW1C
register
Set the VW1C1 bit in the VW1C register to 0
(digital filter enabled)
Set the VW1C6 bit in
the VW1C register to
0 (voltage monitor 1
interrupt mode)
Set the VW1C6 bit in
the VW1C register to
1 (voltage monitor 1
reset mode)
(low-speed on-chip oscillator on)
digital filter
Voltage Monitor 1
Interrupt
Voltage Monitor 1
Reset
Select the timing of the interrupt and reset
request by the VW1C7 bit in the VW1C
register
(1)
Set the VW1C1 bit in the VW1C register to 1
(digital filter disabled)
Set the VW1C6 bit in
the VW1C register to
0 (voltage monitor 1
interrupt mode)
Set the VW1C6 bit in
the VW1C register to
1 (voltage monitor 1
reset mode)
-
− (No wait time required)
Rev.2.00Dec 05, 2007Page 49 of 585
REJ09B0339-0200
R8C/2C Group, R8C/2D Group6. Voltage Detection Circuit
When the VW1C1 bit is set
to 0 (digital filter enabled)
When the VW1C1 bit is
set to 1 (digital filter
disabled) and the
VW1C7 bit is set to 0
(Vdet1 or above)
When the VW1C1 bit is
set to 1 (digital filter
disabled) and the
VW1C7 bit is set to 1
(Vdet1 or below)
Vdet1
(1)
2.2 V
VW1C3 bit
VW1C2 bit
Voltage monitor 1
interrupt request
(VW1C6 = 0)
Internal reset signal
(VW1C6 = 1)
VW1C2 bit
Voltage monitor 1
interrupt request
(VW1C6 = 0)
VW1C2 bit
Voltage monitor 1
interrupt request
(VW1C6 = 0)
Internal reset signal
(VW1C6 = 1)
VCC
1
0
4 cycles of sampling clock of
digital filter
1
0
1
0
1
0
4 cycles of sampling clock of
digital filter
Set to 0 by a program
Set to 0 by interrupt request
acknowledgement
Set to 0 by a program
Set to 0 by interrupt
request acknowledgement
Set to 0 by a program
Set to 0 by interrupt
request
acknowledgement
VW1C1, VW1C2, VW1C3, VW1C6, VW1C7: Bit in VW1C Register
The above applies under the following conditions.
• VCA26 bit in VCA2 register = 1 (voltage detection 1 circuit enabled)
• VW1C0 bit in VW1C register = 1 (voltage monitor 1 interrupt and voltage monitor 1 reset enabled)
NOTE:
1. If voltage monitor 0 reset is not used, set the power supply to VCC ≥ 2.2.
Figure 6.10Example of Voltage Monitor 1 Interrupt and Voltage Monitor 1 Reset Operation
Rev.2.00Dec 05, 2007Page 50 of 585
REJ09B0339-0200
R8C/2C Group, R8C/2D Group6. Voltage Detection Circuit
6.4Voltage Monitor 2 Interrupt and Voltage Monitor 2 Reset
Table 6.4 lists the Procedure for Setting Bits Associated with Voltage Monitor 2 Interrupt and Reset. Figure 6.11
shows an Example of Voltage Monitor 2 Interrupt and Voltage Monitor 2 Reset Operation. To use the voltage
monitor 2 interrupt or voltage monitor 2 reset to exit stop mode, set the VW2C1 bit in the VW2C register to 1
(digital filter disabled).
Table 6.4Procedure for Setting Bits Associated with Voltage Monitor 2 Interrupt and Reset
When Using Digital FilterWhen Not Using Digital Filter
Step
1Set the VCA27 bit in the VCA2 register to 1 (voltage detection 2 circuit enabled)
2Wait for td(E-A)
3
4
(2)
5
6Set the VW2C2 bit in the VW2C register to 0 (passing of Vdet2 is not detected)
7Set the CM14 bit in the CM1 register to 0
8Wait for 4 cycles of the sampling clock of the
9Set 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).
Voltage Monitor 2
Interrupt
Voltage Monitor 2
Reset
Select the sampling clock of the digital filter
by the VW2F0 to VW2F1 bits in the VW2C
register
Set the VW2C1 bit in the VW2C register to 0
(digital filter enabled)
Set the VW2C6 bit in
the VW2C register to
0 (voltage monitor 2
interrupt mode)
Set the VW2C6 bit in
the VW2C register to
1 (voltage monitor 2
reset mode)
(low-speed on-chip oscillator on)
digital filter
Voltage Monitor 2
Interrupt
Voltage Monitor 2
Reset
Select the timing of the interrupt and reset
request by the VW2C7 bit in the VW2C
register
(1)
Set the VW2C1 bit in the VW2C register to 1
(digital filter disabled)
Set the VW2C6 bit in
the VW2C register to
0 (voltage monitor 2
interrupt mode)
Set the VW2C6 bit in
the VW2C register to
1 (voltage monitor 2
reset mode)
-
− (No wait time required)
Rev.2.00Dec 05, 2007Page 51 of 585
REJ09B0339-0200
R8C/2C Group, R8C/2D Group6. Voltage Detection Circuit
When the VW2C1 bit is set
to 0 (digital filter enabled)
When the VW2C1 bit is
set to 1 (digital filter
disabled) and the
VW2C7 bit is set to 0
(Vdet2 or above)
When the VW2C1 bit is
set to 1 (digital filter
disabled) and the
VW2C7 bit is set to 1
(Vdet2 or below)
Vdet2
(1)
2.2 V
VCA13 bit
VW2C2 bit
Voltage monitor 2
interrupt request
(VW2C6 = 0)
Internal reset signal
(VW2C6 = 1)
VW2C2 bit
Voltage monitor 2
interrupt request
(VW2C6 = 0)
VW2C2 bit
Voltage monitor 2
interrupt request
(VW2C6 = 0)
Internal reset signal
(VW2C6 = 1)
VCC
1
0
4 cycles of sampling clock of
digital filter
1
0
1
0
1
0
4 cycles of sampling clock of
digital filter
Set to 0 by a program
Set to 0 by interrupt request
acknowledgement
Set to 0 by a program
Set to 0 by interrupt
request acknowledgement
Set to 0 by a program
Set to 0 by interrupt
request
acknowledgement
VCA13: Bit in VCA1 register
VW2C1, VW2C2, VW2C6, VW2C7: Bits in VW2C register
The above applies under the following conditions.
• VCA27 bit in VCA2 register = 1 (voltage detection 2 circuit enabled)
• VW2C0 bit in VW2C register = 1 (voltage monitor 2 interrupt and voltage monitor 2 reset enabled)
NOTE:
1. When voltage monitor 0 reset is not used, set the power supply to VCC ≥ 2.2.
Figure 6.11Example of Voltage Monitor 2 Interrupt and Voltage Monitor 2 Reset Operation
Rev.2.00Dec 05, 2007Page 52 of 585
REJ09B0339-0200
There are 71 programmable Input/Output ports (I/O ports) P0 to P3, P4_3 to P4_5, P5 to P8 and P9_0 to P9_3. Also,
P4_6 and P4_7 can be used as input-only ports if the XIN clock oscillation circuit is not used.
Table 7.1 lists an Overview of Programmable I/O Ports.
Table 7.1Overview of Programmable I/O Ports
PortsI/OType of OutputI/O SettingInternal Pull-Up Resister
P0 to P3, P5 to P8, P9_0
to P9_3
P4_3I/O CMOS3 StateSet per bit
P4_4, P4_5I/O CMOS3 StateSet per bit
P4_6, P4_7
(2)
I/O CMOS3 StateSet per bit
Set every 4 bits
Set every bit
Set every 2 bits
I(No output function)NoneNone
NOTES:
1. In input mode, whether an internal pull-up resistor is connected or not can be selected by registers
PUR0, PUR1, and PUR2.
2. When the XIN clock oscillation circuit is not used, these ports can be used as the input-only ports.
7.1Functions of Programmable I/O Ports
The PDi_j (j = 0 to 7) bit in the PDi (i = 0 to 9) register controls I/O of the ports P0 to P3, P4_3 to P4_5, P5 to P8
and P9_0 to P9_3. The Pi register consists of a port latch to hold output data and a circuit to read pin states.
Figures 7.1 to 7.11 show the Configurations of Programmable I/O Ports. Figure 7.12 shows the Configuration of
I/O Pins. Table 7.2 lists the Functions of Programmable I/O Ports. Also, Figure 7.13 shows the PDi (i = 0 to 9)
Registers. Figure 7.14 shows the Pi (i = 0 to 9) Registers, Figure 7.15 shows the P2DRR Register, Figure 7.16
shows the PMR Register, and Figure 7.17 shows Registers PUR0, PUR1, and PUR2.
(1)
(1)
(1)
Table 7.2Functions of Programmable I/O Ports
Operation When
Accessing
Pi Register
Value of PDi_j Bit in PDi Register
When PDi_j Bit is Set to 0 (Input Mode)When PDi_j Bit is Set to 1 (Output Mode)
(1)
ReadingRead pin input levelRead the port latch
WritingWrite to the port latch
Write to the port latch. The value written to
the port latch is output from the pin.
i = 0 to 9, j = 0 to 7
NOTE:
1. Nothing is assigned to bits PD4_0 to PD4_2, PD4_6, and PD4_7.
Rev.2.00Dec 05, 2007Page 53 of 585
REJ09B0339-0200
Programmable I/O ports function as I/O ports for peripheral functions (Refer to Table 1.7 Pin Name Information
by Pin Number (1) and Table 1.8 Pin Name Information by Pin Number (2)).
Table 7.3 lists the Setting of PDi_j Bit when Functioning as I/O Ports for Peripheral Functions (i = 0 to 9, j = 0 to
7).
Refer to the description of each function for information on how to set peripheral functions.
Table 7.3Setting of PDi_j Bit when Functioning as I/O Ports for Peripheral Functions
(i = 0 to 9, j = 0 to 7)
I/O of Peripheral FunctionsPDi_j Bit Settings for Shared Pin Functions
InputSet this bit to 0 (input mode).
OutputThis bit can be set to either 0 or 1 (output regardless of the port setting)
7.3Pins Other than Programmable I/O Ports
Figure 7.12 shows the Configuration of I/O Pins.
Rev.2.00Dec 05, 2007Page 54 of 585
REJ09B0339-0200
Port Pi_0 direction bit
Port Pi_1 direction bit
Port Pi_2 direction bit
(f unc tions as an input port)
1 : Output mode
(f unc tions as an output port)
PDi _4
PDi _5
PDi _6
Port Pi_5 direction bit
Port Pi_6 direction bit
PDi_7Port Pi_7 direction bit
1.
Write to the PD0 register w ith the next instruction after that used to s et the PRC2 bit in the PRCR register to 1 (w rite
enabled).
2.
Bits PD4_0 to PD4_2, PD4_6, and PD4_7 in the PD4 register are unav ailable on this MCU.
If it is neces sary to set bits PD4_0 to PD4_2, PD4_6 and PD4_7, set to 0. When read, the c ontent is 0.
3. Bits PD9_4 to PD9_7 in the PD9 register are unavailable on this MCU.
If it is neces sary to set bits PD9_4 to PD9_7, set to 0.
RW0 : Input mode
RW
RW
RW
RWPort Pi_4 direction bit
RW
RW
RW
Figure 7.13PDi (i = 0 to 9) Registers
Rev.2.00Dec 05, 2007Page 67 of 585
REJ09B0339-0200
Bits P4_0 to P4_2 in the P4 register are unavailable on this MCU.
Port Pi_1 bit
Port Pi_2 bit
Port Pi_3 bit
Port Pi_4 bit
Port Pi_5 bit
Port Pi_6 bitRW
Port Pi_7 bit
The pin level of any I/O port w hich is s et to
input mode c an be read by reading the
corresponding bit in this register. The pin level
of any I/O port w hich is s et to output mode
can be controlled by w riting to the
corresponding bit in this register.
0 : “L” level
1 : “H” level
If it is neces sary to set bits P4_0 to P4_2, set to 0. When read, the content is 0.
2.
Bits P9_4 to P9_7 in the P9 register are unavailable on this MCU.
If it is neces sary to set bits P9_4 to P9_7, set to 0. When read, the content is 0.
RWPort Pi_0 bit
RW
RW
RW
RW
RW
RW
Figure 7.14Pi (i = 0 to 9) Regi st ers
Rev.2.00Dec 05, 2007Page 68 of 585
REJ09B0339-0200