Before using this material, please visit our website to verify that this is the most
updated document available.
Rev.2.41
Revision Date:Jan 10, 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 appropriate measures such as (i) placement of substitutive, auxiliary circuits, (ii) use of nonflammable 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, programs, algorithms, or circuit application examples contained in these materials.
3.
All information contained in these materials, including product data, diagrams, charts, programs 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 contact Renesas Technology Corp. or an authorized Renesas Technology Corp. product distributor 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 various 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 information 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, liability 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 reproduce 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 imported 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.
How to Use This Manual
1.Introduction
This hardware manual provides detailed information on th e M16C/62P Group (M16C/62P, M16C/62PT) of
microcomputers.
Users are expected to have basic knowledge of electric circuits, logical circuits and microcomputers.
2.Register Diagram
The symbols, and descriptions, used for bit function in each register are shown below.
XXX Register
b7 b6 b5 b4 b3 b2 b1 b0
0
*1
SymbolAddressAfter Reset
XXXXXX00h
Bit NameBit Symbol
XXX Bit
XXX0
XXX1
Nothing is assigned.
(b2)
When write, should set to “0”. When read, its content is indeterminate.
25. Differences Depending on Manufacturing Period383
Appendix 1. Package Dimensions 385
Appendix 2. Difference between M16C/62P and M16C/30P 387
Register Index 390
A - 8
SFR Page Reference
AddressRegisterSymbolPage
0000h
0001h
0002h
0003h
0004hProcessor Mode Register 0PM056
0005hProcessor Mode Register 1PM157
0006hSystem Clock Control Register 0CM084
0007hSystem Clock Control Register 1CM185
0008hChip Select Control RegisterCSR6 1
0009hAddress Match Interrupt Enable RegisterAIER123
000AhProtect RegisterPRCR105
000BhData Bank RegisterDBR73
000ChOscillation Stop Detection RegisterCM28 6
000Dh
000EhWatchdog Timer Start RegisterWDTS125
000FhWatchdog Timer Control RegisterWDC53, 125
0010hAddress Match Interrupt Register 0RMAD0123
0011h
0012h
0013h
0014hAddress Match Interrupt Register 1RMAD1123
0015h
0016h
0017h
0018h
0019hVoltage Detection Register 1VCR146
001AhVoltage Detection Register 2VCR246
001BhChip Select Expansion Control RegisterCSE68
001ChPLL Control Register 0PLC088
001Dh
001EhProcessor Mode Register 2PM287
001FhLow Voltage Detection In terrupt RegisterD4INT47
0020hDMA0 Source PointerSAR0131
0021h
0022h
0023h
0024hDMA0 Destination PointerDAR0131
0025h
0026h
0027h
0028hDMA0 Transfer CounterTCR0131
0029h
002Ah
002Bh
002ChDMA0 Control RegisterDM0CON130
002Dh
002Eh
002Fh
0030hDMA1 Source PointerSAR1131
0031h
0032h
0033h
0034hDMA1 Destination PointerDAR1131
0035h
0036h
0037h
0038hDMA1 Transfer CounterTCR1131
0039h
003Ah
003Bh
003ChDMA1 Control RegisterDM1CON130
003Dh
003Eh
003Fh
NOTES:
1. Blank columns are all reserved space. No access is allowed.
AddressRegisterSymbolPage
0040h
0041h
0042h
0043h
0044hINT3 Interrupt Control RegisterINT3IC112
0045hTimer B5 Interrupt Control RegisterTB5IC111
0046hTimer B4 Interrupt Control Registe r , UART1 BUS
0047hTimer B3 Interrupt Control Registe r , UART0 BUS
0048hSI/O4 Interrupt Control Register, INT5 Interrupt
0049hSI/O3 Interrupt Control Register, IINT4 Interrupt
004Ah
004BhDMA0 Interrupt Control RegisterDM0IC111
004ChDMA1 Interrupt Control RegisterDM1IC111
004DhKey Input Interrupt Control RegisterKUPIC111
004EhA/D Conversion Interrupt Control RegisterADIC11 1
004FhUART2 Transmit Interrupt Control RegisterS2TIC111
0050hUART2 Receive Interrupt Control RegisterS2RIC111
0051hUART0 Transmit Interrupt Control RegisterS0TIC111
0052hUART0 Receive Interrupt Control RegisterS0RIC111
0053hUART1 Transmit Interrupt Control RegisterS1TIC111
0054hUART1 Receive Interrupt Control RegisterS1RIC111
0055hTimer A0 Interrupt Control RegisterTA0IC111
0056hTimer A1 Interrupt Control RegisterTA1IC111
0057hTimer A2 Interrupt Control RegisterTA2IC111
0058hTimer A3 Interrupt Control RegisterTA3IC111
0059hTimer A4 Interrupt Control RegisterTA4IC111
005AhTimer B0 Interrupt Control RegisterTB0IC111
005BhTimer B1 Interrupt Control RegisterTB1IC111
005ChTimer B2 Interrupt Control RegisterTB2IC111
005DhINT0 Interrupt Control RegisterINT0IC112
005EhINT1 Interrupt Control RegisterINT1IC112
005FhINT2 Interrupt Control RegisterINT2IC112
0060h
0061h
0062h
0062h
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
Collision Detection Interrupt Control Register
Collision Detection Interrupt Control Register
Control Register
Control Register
UART2 Bus Collision Detection Interrupt Control Register
UART0 Transmit/Receive Control Register 0
UART0 Transmit/Receive Control Register 1
UART1 Transmit/Receive Control Register 0
UART1 Transmit/Receive Control Register 1
UART Transmit/Receive Control Register 2
U0C0184
U0C1185
U1C0184
U1C1185
UCON186
AddressRegisterSymbolPage
03C0hA/D Register 0AD0237
03C1h
03C2hA/D Register 1AD1237
03C3h
03C4hA/D Register 2AD2237
03C5h
03C6hA/D Register 3AD3237
03C7h
03C8hA/D Register 4AD4237
03C9h
03CAhA/D Register 5AD5237
03CBh
03CChA/D Register 6AD6237
03CDh
03CEhA/D Register 7AD7237
03CFh
03D0h
03D1h
03D2h
03D3h
03D4hA/D Control Register 2ADCON2236
03D5h
03D6hA/D Control Register 0ADCON0235
03D7hA/D Control Register 1ADCON1235
03D8hD/A Register 0DA0252
03D9h
03DAhD/A Register 1DA1252
03DBh
03DChD/A Control RegisterDACON252
03DDh
03DEhPort P14 Control RegisterPC14264
03DFhPull-Up Control Register 3PUR3264
03E0hPort P0 RegisterP0263
03E1hPort P1 RegisterP1263
03E2hPort P0 Direction RegisterPD0262
03E3hPort P1 Direction RegisterPD1262
03E4hPort P2 RegisterP2263
03E5hPort P3 RegisterP3263
03E6hPort P2 Direction RegisterPD2262
03E7hPort P3 Direction RegisterPD3262
03E8hPort P4 RegisterP4263
03E9hPort P5 RegisterP5263
03EAhPort P4 Direction RegisterPD4262
03EBhPort P5 Direction RegisterPD5262
03EChPort P6 RegisterP6263
03EDhPort P7 RegisterP7263
03EEhPort P6 Direction RegisterPD6262
03EFhPort P7 Direction RegisterPD7262
03F0hPort P8 RegisterP8263
03F1hPort P9 RegisterP9263
03F2hPort P8 Direction RegisterPD8262
03F3hPort P9 Direction RegisterPD9262
03F4hPort P10 RegisterP10263
03F5hPort P11 RegisterP11263
03F6hPort P10 Direction RegisterPD10262
03F7hPort P1 1 D ir ec ti on RegisterPD11262
03F8hPort P12 RegisterP12263
03F9hPort P13 RegisterP13263
03FAhPort P12 Direction RegisterPD12262
03FBhPort P13 Direction RegisterPD13262
03FChPull-Up Control Register 0PUR0265
03FDhPull-Up Control Register 1PUR1265
03FEhPull-Up Control Register 2PUR2266
03FFhPort Control RegisterPCR266
NOTES:
1. Blank columns are all reserved space. No access is allowed.
B - 3
M16C/62P Group (M16C/62P, M16C/62PT)
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
1.Overview
The M16C/62P Group (M16C/62P, M16C/62PT) of single-chip microcomputers are built using the high performance
silicon gate CMOS process using a M16C/60 Series CPU core and are packaged in a 80-pin, 100-pin and 128-pin
plastic molded QFP. These single-chip microcom puters operate using soph isticated instructions featuring a high level
of instruction efficiency. With 1M bytes of address space, they are capable of executing instructions at high speed. In
addition, this microcomputer contains a multiplier and DMAC which combined with fast instruction processing
capability, makes it suitable for control of various OA, communication, and industrial equipment which requires highspeed arithmetic/logic operations.
1.1Applications
Audio, cameras, television, home appliance, office/communications/portable/industrial equipment, automobile,
etc.
Specifications written in this manual are believed to be accurate,
but are not guaranteed to be entirely free of error. Specifications in
this manual may be changed for functional or performance
improvements. Please make sure your manual is the latest edition.
Rev.2.41Jan 10, 2006Page 1 of 390
REJ09B0185-0241
M16C/62P Group (M16C/62P, M16C/62PT)1. Overview
1.2Performance Outline
Table 1.1 to 1.3 list Performance Outline of M16C/62P Group (M16C/62P, M16C/62PT)(128-pin version).
Table 1.1Performance Outline of M16C/62P Group (M16C/62P, M16C/62PT)(128-pin version)
ItemPerformance
M16C/62P
CPUNumber of Basic Instructions91 instructions
Minimum Instruction Execution
Time
Operating ModeSingle-chip, memory expansion and microprocessor mode
Address Space
Memory Capacity
Peripheral
Function
PortInput/Output : 113 pins, Input : 1 pin
Multifunction TimerTimer A : 16 bits x 5 channels,
Supply VoltageVCC1=3.0 to 5.5 V, VCC2=2.7V to VCC1 (f(BCLK=24MHz)
Characteristics
Power Consumption14 mA (VCC1=VCC2=5V, f(BCLK)=24MHz)
Flash memory
version
Program/Erase Supply Voltage 3.3±0.3 V or 5.0±0.5 V
Program and Erase Endurance 100 times (all area)
Operating Ambient Temperature-20 to 85°C,
Package128-pin plastic mold LQFP
NOTES:
1. I2C bus is a registered trademark of Koninklijke Philips Electronics N. V.
2. IEBus is a registered trademark of NEC Electronics Corporation.
3. See Table 1.8 Product Code for the program and erase endurance, and operating ambient temperature.
In addition 1,000 times/10,000 times are under development as of Jul., 2005. Please inquire about a release
schedule.
4. All options are on request basis.
41.7ns(f(BCLK)=24MHz, VCC1=3.3 to 5.5V)
100ns(f(BCLK)=10MHz, VCC1=2.7 to 5.5V)
1 Mbyte (Available to 4 Mbytes by memory space expansion
function)
See Table 1.4 to 1.5 Product List
Timer B : 16 bits x 6 channels,
Three phase motor control circuit
Main clock generation circuit (*), Subclock generation circuit (*),
On-chip oscillator, PLL synthesizer
(*)Equipped with a built-in feedback resistor.
Oscillation Stop
Stop detection of main clock oscillation, re-oscillation detection function
Detection Function
(5)
)Absent
VCC1=VCC2=4.0 to 5.5V
(f(BCLK=24MHz)
Electric
Characteristics
Voltage Detection Circuit Available (option
Supply VoltageVCC1=3.0 to 5.5 V, VCC2=2.7V to
VCC1 (f(BCLK=24MHz)
VCC1=2.7 to 5.5 V, VCC2=2.7V to
VCC1 (f(BCLK=10MHz)
Power Consumption
14 mA (VCC1=VCC2=5V, f(BCLK)=24MHz)
8 mA (VCC1=VCC2=3V, f(BCLK)=10MHz)
µ
A (VCC1=VCC2=3V, f(XCIN)=32kHz,
1.8
wait mode)
µ
A (VCC1=VCC2=3V, stop mode)
0.7
Flash memory
version
Program/Erase Supply Voltage
Program and Erase
Endurance
3.3±0.3 V or 5.0±0.5 V5.0±0.5 V
100 times (all area)
or 1,000 times (user ROM area without block A and block 1)
/ 10,000 times (block A, block 1)
Operating Ambient Temperature-20 to 85°C,
-40 to 85°C
(3)
14 mA (VCC1=VCC2=5V, f(BCLK)=24MHz)
2.0
µ
A (VCC1=VCC2=5V, f(XCIN)=32kHz,
wait mode)
µ
A (VCC1=VCC2=5V, stop mode)
0.8
(3)
T version : -40 to 85°C
V version : -40 to 125°C
Package100-pin plastic mold QFP, LQFP
NOTES:
1. I2C bus is a registered trademark of Koninklijke Philips Electronics N. V.
2. IEBus is a registered trademark of NEC Electronics Corporation.
3. See Table 1.8 and 1.9 Product Code for the program and erase endurance, and operating ambient
temperature.
In addition 1,000 times/10,000 times are under development as of Jul., 2005. Please inquire about a release
schedule.
4. Use the M16C/62PT on VCC1=VCC2
5. All options are on request basis.
(4)
Rev.2.41Jan 10, 2006Page 3 of 390
REJ09B0185-0241
M16C/62P Group (M16C/62P, M16C/62PT)1. Overview
Table 1.3Performance Outline of M16C/62P Group (M16C/62P, M16C/62PT)(80-pin version)
ItemPerformance
M16C/62PM16C/62PT
CPU
Number of Basic Instructions
Minimum Instruction
Execution Time
91 instructions
41.7ns(f(BCLK)=24MHz, VCC1=3.3 to 5.5V)
100ns(f(BCLK)=10MHz, VCC1=2.7 to 5.5V)
Main clock generation circuit (*), Subclock generation circuit (*),
On-chip oscillator, PLL synthesizer
(*)Equipped with a built-in feedback resistor.
Oscillation Stop
Stop detection of main clock oscillation, re-oscillation detection function
Detection Function
(4)
)Absent
VCC1=4.0 to 5.5V, (f(BCLK=24MHz)
14 mA (VCC1=5V, f(BCLK)=24MHz)
2.0µA (VCC1=5V, f(XCIN)=32kHz,
wait mode)
0.8µA (VCC1=5V, stop mode)
Electric
Characteristics
Voltage Detection Circuit Available (option
Supply Voltage
VCC1=3.0 to 5.5 V , (f(BCLK=24MHz)
VCC1=2.7 to 5.5 V , (f(BCLK=10MHz)
Power Consumption
14 mA (VCC1=5V, f(BCLK)=24MHz)
8 mA (VCC1=3V, f(BCLK)=10MHz)
µ
A (VCC1=3V, f(XCIN)=32kHz,
1.8
wait mode)
0.7µA (VCC1=3V, stop mode)
Flash memory
version
Program/Erase Supply Voltage
Program and Erase
Endurance
Operating Ambient Temperature-20 to 85°C,
3.3 ± 0.3V or 5.0 ± 0.5V5.0 ± 0.5V
100 times (all area)
or 1,000 times (user ROM area without block A and block 1)
/ 10,000 times (block A, block 1)
(3)
T version : -40 to 85°C
-40 to 85°C
(3)
V version : -40 to 125°C
Package80-pin plastic mold QFP
NOTES:
1. I2C bus is a registered trademark of Koninklijke Philips Electronics N. V.
2. IEBus is a registered trademark of NEC Electronics Corporation.
3. See Table 1.8 and 1.9 Product Code for the program and erase endurance, and operating ambient
temperature.
In addition 1,000 times/10,000 times are under development as of Jul., 2005. Please inquire about a release
schedule.
4. All options are on request basis.
(4)
Rev.2.41Jan 10, 2006Page 4 of 390
REJ09B0185-0241
M16C/62P Group (M16C/62P, M16C/62PT)1. Overview
1.3Block Diagram
Figure 1.1 is a M16C/62P Group (M16C/62P, M16C/62PT) 128-pin and 100-pin version Block Diagram,
Figure 1.2 is a M16C/62P Group (M16C/62P, M16C/62PT) 80-pin version Block Diagram.
8
Port P0
Internal peripheral functions
Port P18Port P2
Timer (16-bit)
Output (timer A): 5
Input (timer B): 6
Three-phase motor
control circuit
Watchdog timer
(15 bits)
DMAC
(2 channels)
D/A converter
(8 bits X 2 channels)
8888
Port P4Port P3
Port P5
8
Port P6
<VCC2 ports>(4)<VCC1 ports>(4)
A/D converter
(10 bits X 8 channels
Expandable up to 26 channels)
UART or
clock synchronous serial I/O
(8 bits X 3 channels)
CRC arithmetic circuit (CCITT )
(Polynomial : X
16+X12+X5
+1)
M16C/60 series16-bit CPU core
R0LR0H
R1HR1L
R2
R3
A0
A1
FB
SB
USP
ISP
INTB
PC
FLG
System clock
generation circuit
XIN-XOUT
XCIN-XCOUT
PLL frequency synthesizer
On-chip oscillator
Clock synchronous serial I/O
(8 bits X 2 channels)
Memory
(1)
ROM
(2)
RAM
Multiplier
Port P7
8
788
<VCC1 ports>(4)
Port P8_5Port P8
Port P9
Port P10
<VCC2 ports>(4)<VCC1 ports>(4)
Port P11Port P12Port P14
(3)
(3)(3)
Port P13
(3)
8882
NOTES :
1. ROM size depends on microcomputer type.
2. RAM size depends on microcomputer type.
3. Ports P11 to P14 exist only in 128-pin version.
4. Use M16C/62PT on VCC1= VCC2.
Figure 1.1 M16C/62P Group (M16C/62P, M16C/62PT) 128-pin and 100-pin version Block Diagram
Rev.2.41Jan 10, 2006Page 5 of 390
REJ09B0185-0241
M16C/62P Group (M16C/62P, M16C/62PT)1. Overview
8
Port P0
Internal peripheral functions
Timer (16-bit)
Output (timer A): 5
Input (timer B): 6
Watchdog timer
(15 bits)
DMAC
(2 channels)
D/A converter
(8 bits X 2 channels)
8
Port P28Port P3
(4)
A/D converter
(10 bits X 8 channels
Expandable up to 26 channels)
UART or
clock synchronous serial I/O (2 channels)
UART(1 channel)
CRC arithmetic circuit (CCITT )
(Polynomial : X
16+X12+X5
M16C/60 series16-bit CPU core
R0LR0H
R1HR1L
R2
R3
A0
A1
FB
4
Port P4
+1)
8
Port P5
System clock
generation circuit
XIN-XOUT
XCIN-XCOUT
PLL frequency synthesizer
(3)
SB
USP
ISP
INTB
PC
FLG
On-chip oscillator
Clock synchronous serial I/O
(8 bits X 2 channels)
8
Port P6
Memory
(1)
ROM
(2)
RAM
Multiplier
Port P7
4778
Port P8_5
(4)
Port P9Port P8
Port P10
NOTES :
1. ROM size depends on microcomputer type.
2. RAM size depends on microcomputer type.
3. To use a UART2, set the CRD bit in the U2C0 register to “1” (CTS/RTS function disabled).
4. There is no external connections for port P1, P4_4 to P4_7, P7_2 to P7_5 and P9_1 in 80-pin version.
Set the direction bits in these ports to “1” (output mode), and set the output data to “0” (“L”) using the program.
Figure 1.2 M16C/62P Group (M16C/62P, M16C/62PT) 80-pin version Block Diagram
Rev.2.41Jan 10, 2006Page 6 of 390
REJ09B0185-0241
M16C/62P Group (M16C/62P, M16C/62PT)1. Overview
1.4Product List
Table 1.4 to 1.7 list the product list, Figure 1.3 sho ws the Type No., Memory Size, and Package, Table 1.8 lists the
Product Code of Flash Memory version and ROMless vers ion for M16C/62P, and Table 1.9 lists the Product Code
of Flash Memory version for M16C/62PT. Figure 1.4 shows the Marking Diagram of Flash Memory version and
ROM-less version for M16C/62P (Top View), and Figure 1.5 shows the Marking Diagram of Flash Memory
version for M16C/62PT (Top View) at the time of ROM order.
Table 1.4Product List (1) (M16C/62P)As of Dec. 2005
1. The old package type numbers of each package type are as follows.
PLQP0128KB-A : 128P6Q-A,
PRQP0100JB-A : 100P6S-A,
PLQP0100KB-A : 100P6Q-A,
PRQP0080JA-A : 80P6S-A
(1)
Remarks
Rev.2.41Jan 10, 2006Page 7 of 390
REJ09B0185-0241
M16C/62P Group (M16C/62P, M16C/62PT)1. Overview
Table 1.5Product List (2) (M16C/62P)As of Dec. 2005
1. The old package type numbers of each package type are as follows.
PLQP0128KB-A : 128P6Q-A,
PRQP0100JB-A : 100P6S-A,
PLQP0100KB-A : 100P6Q-A,
PRQP0080JA-A : 80P6S-A
2. In the flash memory version, there is 4K bytes area (block A).
3. Please use M3062LFGPFP and M3062LFGPGP for your new system instead of M30624FGPFP
and M30624FGPGP. The M16C/62P Group (M16C/62P, M16C/62PT) hardware manual is still good
for M30624FGPFP and M30624FGPGP.
M30624FGPFP256K+4 Kbytes 20 KbytesPRQP0100JB-A Fl ash memory version
M30624FGPGPPLQP0100KB-A
Rev.2.41Jan 10, 2006Page 8 of 390
REJ09B0185-0241
M16C/62P Group (M16C/62P, M16C/62PT)1. Overview
Table 1.6Product List (3) (T version (M16C/62PT))As of Dec. 2005
Type No.ROM Capacity
RAM
Capacity
Package Type
M3062CM6T-XXXFP(D) 48 Kbytes4 KbytesPRQP0100JB-AMask ROM
M3062CM6T-XXXGP (D)PLQP0100KB-A
M3062EM6T-XXXGP (P)PRQP0080JA-A
1. The old package type numbers of each package type are as follows.
PLQP0128KB-A : 128P6Q-A,
PRQP0100JB-A : 100P6S-A,
PLQP0100KB-A : 100P6Q-A,
PRQP0080JA-A : 80P6S-A
2. In the flash memory version, there is 4K bytes area (block A).
Rev.2.41Jan 10, 2006Page 10 of 390
REJ09B0185-0241
M16C/62P Group (M16C/62P, M16C/62PT)1. Overview
Type No. M 3 0 6 2 6 M H P - X X X F P
Package type:
FP : PackagePRQP0100JB-A (100P6S-A)
GP : PackagePRQP0080JA-A (80P6S-A),
PLQP0100KB-A (100P6Q-A),
PLQP0128KB-A (128P6Q-A),
ROM No.
Omitted for flash memory version and
ROMless version
Classification
P : M16C/62P
T : T version (M16C/62PT)
V : V version (M16C/62PT)
Rev.2.41Jan 10, 2006Page 11 of 390
REJ09B0185-0241
M16C/62P Group (M16C/62P, M16C/62PT)1. Overview
Table 1.8Product Code of Flash Memory version and ROMless version for M16C/62P
Flash memory
Version
ROM-less
version
Internal ROM
(User ROM Area Without Block A,
Product
Code
D3 LeadD5 -20°C to 85°C
D7 1,00010,000-40°C to 85°C-40°C to 85°C
D9 -20°C to 85°C-20°C to 85°C
U3 Lead-free1001000°C to 60°C-40°C to 85°C
U5 -20°C to 85°C
U7 1,00010,000-40°C to 85°C-40°C to 85°C
U9 -20°C to 85°C-20°C to 85°C
D3 LeadD5 -20°C to 85°C
U3 Lead-free−−− −-40°C to 85°C
U5 -20°C to 85°C
Package
included
included
Program
and Erase
Endurance
Block 1)
Temperature
Range
1000°C to 60°C1000°C to 60°C-40°C to 85°C
−− − −-40°C to 85°C
Internal ROM
(Block A, Block 1)
Program
and Erase
Endurance
Temperature
Range
Operating
Ambient
Temperature
M1 6 C
M30626FHPFP
BD5
XXXXXXX
The product without marking of chip version of the flash memory version and the ROMless version
corresponds to the chip version “A”.
Figure 1.4Marking Diagram of Flash Memory version and ROM-less version for M16C/62P (Top View)
Type No. (See Figure 1.3 Type No., Memory Size, and Package)
Chip version and product code
B : Shows chip version.
Henceforth, whenever it changes a version, it continues with B, C, and D.
D5 : Shows Product code. (See table 1.8 Product Code)
Date code seven digits
Rev.2.41Jan 10, 2006Page 12 of 390
REJ09B0185-0241
M16C/62P Group (M16C/62P, M16C/62PT)1. Overview
Table 1.9Product Code of Flash Memory version for M16C/62PT
Flash
memory
Version
T
Version
Version
V
Version
T
Version
V
Version
T
Version
V
Version
T
Version
V
Internal ROM
(User ROM Area
Product
Code
Package
B Lead-
included
B7 1,00010,000-40°C to 85°C-40°C to 85°C
U Lead-free100100 0°C to 60°C-40°C to 85°C
U7 1,00010,000-40°C to 85°C-40°C to 85°C
Without Block A, Block 1)
Program
and Erase
Endurance
Temperature
Range
1000°C to 60°C1000°C to 60°C-40°C to 85°C
Internal ROM
(Block A, Block 1)
Program
and Erase
Endurance
Operating
Ambient
Temperature
Range
-40°C to 125°C-40°C to 125°C
-40°C to 125°C-40°C to 125°C
Temperature
-40°C to 125°C
-40°C to 125°C
M1 6 C
M3 0 6 2 J F H TF P
YYYXXXXXXX
Type No. (See Figure 1.3 Type No., Memory Size, and Package)
Date code seven digits
Product code. (See table 1.9 Product Code)
“” : Product code “B”
“ P B F ” : Product code “U”
“ B 7” : Product code “B”
“ U 7” : Product code “U7”
NOTES:
1.: Blank
Figure 1.5Marking Diagram of Flash Memory version for M16C/62PT (Top View)
Rev.2.41Jan 10, 2006Page 13 of 390
REJ09B0185-0241
M16C/62P Group (M16C/62P, M16C/62PT)1. Overview
1.5Pin Configuration
Figures 1.6 to 1.9 show the Pin Configuration (Top View).
Rev.2.41Jan 10, 2006Page 24 of 390
REJ09B0185-0241
M16C/62P Group (M16C/62P, M16C/62PT)1. Overview
1.6Pin Description
Table 1.17Pin Description (100-pin and 128-pin Version) (1)
Signal NamePin NameI/O
Type
Power supply
input
Analog power
supply input
Reset input
VCC1,VCC2
VSS
AVCC
AVSS
RESETIVCC1
CNVSSCNVSSIVCC1Switches processor mode. Connect this pin to VSS to when after
External data
BYTEIVCC1Switches the data bus in external memory space. The data bus is
bus width
select input
Bus control
(4)
pins
D0 to D7I/OVCC2Inputs and outputs data (D0 to D7) when these pins are set as the
D8 to D15I/OVCC2Inputs and outputs data (D8 to D15) when external 16-bit data bus
A0 to A19OVCC2Output address bits (A0 to A19).
A0/D0 to
A7/D7
A1/D0 to
A8/D7
CS0 to CS3OVCC2Output CS0 to CS3 signals. CS0 to CS3 are chip-select signals to
WRL/WR
WRH/BHE
RD
ALEOVCC2ALE is a signal to latch the address.
HOLDIVCC2While the HOLD pin is held "L", the microcomputer is placed in a
HLDAOVCC2In a hold state, HLDA outputs a "L" signal.
RDYIVCC2While applying a "L" signal to the RDY pin, the microcomputer is
I : Input O : Output I/O : Input and output
Power Supply : Power supplies which relate to the external bus pins are separated as VCC2, thus they can be
interfaced using the different voltage as VCC1.
NOTES:
1. In this manual, hereafter, VCC refers to VCC1 unless otherwise noted.
2. In M16C/62PT, apply 4.0 to 5.5 V to the VCC1 and VCC2 pins. Also the apply condition is that VCC1 = VCC2.
3. When use VCC1 > VCC2, contacts due to some points or restrictions to be checked.
4. Bus control pins in M16C/62PT cannot be used.
Power
Supply
(3)
Description
I−Apply 2.7 to 5.5 V to the VCC1 and VCC2 pins and 0 V to the VSS
pin. The VCC apply condition is that VCC1 ≥ VCC2.
(1, 2)
IVCC1Applies the power supply for the A/D converter. Connect the AVCC
pin to VCC1. Connect the AVSS pin to VSS.
The microcomputer is in a reset state when applying “L” to the this pin.
a reset to start up in single-chip mode. Connect this pin to VCC1 to
start up in microprocessor mode.
16 bits long when the this pin is held "L" and 8 bits long when the
this pin is held "H". Set it to either one. Connect this pin to VSS
when an single-chip mode.
separate bus.
is set as the separate bus.
I/OVCC2
Input and output data (D0 to D7) and output address bits (A0 to A7) by
timesharing when external 8-bit data bus are set as the multiplexed bus.
I/OVCC2Input and output data (D0 to D7) and output address bits (A1 to A8)
by timesharing when external 16-bit data bus are set as the
multiplexed bus.
specify an external space.
OVCC2Output WRL, WRH, (WR, BHE), RD signals. WRL and WRH or
BHE and WR can be switched by program.
, WRH and RD are selected
• WRL
The WRL signal becomes "L" by writing data to an even address in
an external memory space.
The WRH
signal becomes "L" by writing data to an odd address in
an external memory space.
The RD
pin signal becomes "L" by reading data in an external
memory space.
, BHE and RD are selected
• WR
The WR signal becomes "L" by writing data in an external memory space.
signal becomes "L" by reading data in an external memory space.
The RD
The BHE signal becomes "L" by accessing an odd address.
Select WR
, BHE and RD for an external 8-bit data bus.
hold state.
placed in a wait state.
Rev.2.41Jan 10, 2006Page 25 of 390
REJ09B0185-0241
M16C/62P Group (M16C/62P, M16C/62PT)1. Overview
Table 1.18Pin Description (100-pin and 128-pin Version) (2)
Signal NamePin NameI/O
Type
Main clock
XINIVCC1I/O pins for the main clock generation circuit. Connect a ceramic
input
Main clock
XOUTOVCC1
output
Sub clock input XCINIVCC1I/O pins for a sub clock oscillation circuit. Connect a crystal
Sub clock
XCOUTOVCC1
output
(2)
BCLK output
BCLKOVCC2Outputs the BCLK signal.
Clock output CLKOUTOVCC2The clock of the same cycle as fC, f8, or f32 is outputted.
interrupt
INT
input
interrupt
NMI
INT0 to INT2
to INT5
NT3
NMI
input
Key input
KI0
to KI3
interrupt input
Timer ATA0OUT to
TA4OUT
TA0IN to
TA4IN
ZPIVCC1Input pin for the Z-phase.
Timer BTB0IN to
TB5IN
Three-phase
motor control
U, U
W, W
, V, V,
output
Serial interface
CTS0
to
CTS2
to
RTS0
RTS2
CLK0 to
CLK4
RXD0 to
RXD2
SIN3, SIN4IVCC1These are serial data input pins.
TXD0 to
TXD2
SOUT3,
SOUT4
CLKS1OVCC1This is output pin for transfer clock output from multiple pins
2
C modeSD A0 to
I
SDA2
SCL0 to
SCL2
I : Input O : Output I/O : Input and output
Power
Supply
(1)
resonator or crystal oscillator between XIN and XOUT
Description
(3)
. To use
the external clock, input the clock from XIN and leave XOUT open.
(3)
oscillator between XCIN and XCOUT
. To use the external clock,
input the clock from XCIN and leave XCOUT open.
I
VCC1Input pins for the INT
I
VCC2
I
VCC1Input pin for the NMI interrupt. Pin states can be read by the P8_5
interrupt.
bit in the P8 register.
IVCC1Input pins for the key input interrupt.
I/OVCC1These are timer A0 to timer A4 I/O pins. (however, output of
TA0OUT for the N-channel open drain output.)
IVCC1These are timer A0 to timer A4 input pins.
IVCC1These are timer B0 to timer B5 input pins.
OVCC1These are Three-phase motor control output pins.
IVCC1These are send control input pins.
OVCC1These are receive control output pins.
I/OVCC1These are transfer clock I/O pins.
IVCC1These are serial data input pins.
OVCC1These are serial data output pins. (however, output of TXD2 for the
N-channel open drain output.)
OVCC1These are serial data output pins.
function.
I/OVCC1These are serial data I/O pins. (however, output of SDA2 for the N-
channel open drain output.)
I/OVCC1These are transfer clock I/O pins. (however, output of SCL2 for the
N-channel open drain output.)
NOTES:
1. When use VCC1 > VCC2, contacts due to some points or restrictions to be checked.
2. This pin function in M16C/62PT cannot be used.
3. Ask the oscillator maker the oscillation characteristic.
Rev.2.41Jan 10, 2006Page 26 of 390
REJ09B0185-0241
M16C/62P Group (M16C/62P, M16C/62PT)1. Overview
Table 1.19Pin Description (100-pin and 128-pin Version) (3)
Signal NamePin NameI/O
Type
Reference
VREFIVCC1Applies the reference voltage for the A/D converter and D/A
voltage input
A/D converter AN0 to AN7,
AN0_0 to
AN0_7,
AN2_0 to
AN2_7
ADTRG
ANEX0I/OVCC1This is the extended analog input pin for the A/D converter, and is
ANEX1IVCC1This is the extended analog input pin for the A/D converter.
D/A converter DA0 , DA1OVCC1This is the output pin for the D/A converter.
I/O portP0_0 to P0_7,
P1_0 to P1_7,
P2_0 to P2_7,
P3_0 to P3_7,
P4_0 to P4_7,
P5_0 to P5_7,
P12_0 to
(2)
P12_7
,
P13_0 to
(2)
P13_7
P6_0 to P6_7,
P7_0 to P7_7,
P9_0 to P9_7,
P10_0 to
P10_7,
P11_0 to
(2)
P11_7
P8_0 to P8_4,
P8_6, P8_7,
P14_0,
(2)
P14_1
Input portP8_5I
I : Input O : Output I/O : Input and output
Power
Supply
(1)
Description
converter.
IVCC1Analog input pins for the A/D converter.
IVCC1This is an A/D trigger input pin.
the output in external op-amp connection mode.
I/OVCC28-bit I/O ports in CMOS, having a direction register to select an
input or output.
Each pin is set as an input port or output port. An input port can
be set for a pull-up or for no pull-up in 4-bit unit by program.
I/OVCC1
8-bit I/O ports having equivalent functions to P0.
(however, output of P7_0 and P7_1 for the N-channel open drain
output.)
I/OVCC1I/O ports having equivalent functions to P0.
VCC1Input pin for the NMI
interrupt.
Pin states can be read by the P8_5 bit in the P8 register.
NOTES:
1. When use VCC1 > VCC2, contacts due to some points or restrictions to be checked.
2. Ports P11 to P14 in M16C/62P (100-pin version) and M16C/62PT (100-pin version) cannot be used.
Rev.2.41Jan 10, 2006Page 27 of 390
REJ09B0185-0241
M16C/62P Group (M16C/62P, M16C/62PT)1. Overview
Table 1.20Pin Description (80-pin Ve rsion) (1)
Signal NamePin NameI/O
Type
Power supply
VCC1, VSS
Power
Supply
I−Apply 2.7 to 5.5 V to the VCC1 pin and 0 V to the VSS pin.
(1)
Description
input
Analog power
supply input
Reset input
CNVSSCNVSS
AVCC
AVSS
RESET
(BYTE)
IVCC1Applies the power supply for the A/D converter. Connect th e
AVCC pin to VCC1. Connect the AVSS pin to VSS.
IVCC1
IVCC1
The microcomputer is in a reset state when applying “L” to the this pin.
Switches processor mode. Connect this pin to VSS to when after a
reset to start up in single-chip mode. Connect this pin to VCC1
start up in microprocessor mode. As for the BYTE pin of the 80-pin
versions, pull-up processing is performed within the microcomputer.
Main clock
input
Main clock
output
XINIVCC1I/O pins for the main clock generation circuit. Connect a ceramic
(3)
. To use
XOUTOVCC1
resonator or crystal oscillator between XIN and XOUT
the external clock, input the clock from XIN and leave XOUT
open.
Sub clock input XCINIVCC1I/O pins for a sub clock oscillation circuit. Connect a crystal
(3)
Sub clock
output
XCOUTOVCC1
oscillator between XCIN and XCOUT
clock, input the clock from XCIN and leave XCOUT open.
. To use the external
Clock output CLKOUTOVCC2The clock of the same cycle as fC, f8, or f32 is outputted.
interrupt
INT
INT0 to INT2
I
VCC1Input pins for the INT interrupt.
input
NMI
interrupt
NMI
I
VCC1Input pin for the NMI interrupt.
input
Key input
KI0 to KI3
IVCC1Input pins for the key input interrupt.
interrupt input
Timer ATA0OUT,
TA3OUT,
I/OVCC1These are Timer A0,Timer A3 and Timer A4 I/O pins. (however,
output of TA0OUT for the N-channel open drain output.)
TA4OUT
TA0IN, TA3IN,
IVCC1These are Timer A0, Timer A3 and Timer A4 input pins.
TA4IN
ZPIVCC1Input pin for the Z-phase.
Timer BTB0IN, TB2IN
IVCC1These are Timer B0, Timer B2 to Timer B5 input pins.
to TB5IN
Serial interface
to CTS1
CTS0
to RTS1
RTS0
CLK0, CLK1,
IVCC1These are send control input pins.
OVCC1These are receive control output pins.
I/OVCC1These are transfer clock I/O pins.
CLK3, CLK4
RXD0 to RXD2IVCC1These are serial data input pins.
SIN4IVCC1This is serial data input pin.
TXD0 to TXD2OVCC1These are serial data output pins. (however, output of TXD2 for
the N-channel open drain output.)
SOUT3,
OVCC1These are serial data output pins.
SOUT4
CLKS1OVCC1This is output pin for transfer clock output from multiple pins
function.
2
C modeSDA0 to SDA2I/OVCC1These are serial data I/O pins. (however, output of SDA2 for the
I
N-channel open drain output.)
SCL0 to SCL2I/OVCC1These are transfer clock I/O pins. (however, output of SCL2 for
the N-channel open drain output.)
I : Input O : Output I/O : Input and output
(1, 2)
to
NOTES:
1. In this manual, hereafter, VCC refers to VCC1 unless otherwise noted.
2. In M16C/62PT, apply 4.0 to 5.5 V to the VCC1 pin.
3. Ask the oscillator maker the oscillation characteristic.
Rev.2.41Jan 10, 2006Page 28 of 390
REJ09B0185-0241
M16C/62P Group (M16C/62P, M16C/62PT)1. Overview
Table 1.21Pin Description (80-pin Ve rsion) (2)
Signal NamePin NameI/O
Type
Reference
voltage input
A/D converter AN0 to AN7,
D/A converter DA0 , DA1OVCC1This is the output pin for the D/A converter.
I/O port
Input portP8_5I
I : Input O : Output I/O : Input and output
(1)
VREFIVCC1Applies the reference voltage for the A/D converter and D/A
AN0_0 to
AN0_7,
AN2_0 to
AN2_7
ADTRG
ANEX0I/OVCC1This is the extended analog input pin for the A/D converter, and is
ANEX1IVCC1This is the extended analog input pin for the A/D converter.
P0_0 to P0_7,
P2_0 to P2_7,
P3_0 to P3_7,
P5_0 to P5_7,
P6_0 to P6_7,
P10_0 to
P10_7
P8_0 to P8_4,
P8_6, P8_7,
P9_0,
P9_2 to P9_7
P4_0 to P4_3,
P7_0, P7_1,
P7_6, P7_7
Power
(1)
Supply
converter.
IVCC1Analog input pins for the A/D converter.
IVCC1This is an A/D trigger input pin.
the output in external op-amp connection mode.
I/OVCC18-bit I/O ports in CMOS, having a direction register to select an
input or output.
Each pin is set as an input port or output port. An input port can
be set for a pull-up or for no pull-up in 4-bit unit by program.
I/OVCC1I/O ports having equivalent functions to P0.
I/OVCC1I/O ports having equivalent functions to P0.
(however, output of P7_0 and P7_1 for the N-channel open drain
output.)
VCC1Input pin for the NMI
Pin states can be read by the P8_5 bit in the P8 register.
Description
interrupt.
NOTES:
1. There is no external connections for port P1, P4_4 to P4_7, P7_2 to P7_5 and P9_1 in 80-pin version. Set the
direction bits in these ports to “1” (output mode), and set the output data to “0” (“L”) using the program.
Rev.2.41Jan 10, 2006Page 29 of 390
REJ09B0185-0241
M16C/62P Group (M16C/62P, M16C/62PT)2. Central Processing Unit (CPU)
2.Central Processing Unit (CPU)
Figure 2.1 shows the CPU registers. The CPU has 13 registers. Of these, R0, R1, R2, R3, A0, A1 and FB comprise a
register bank. There are two register banks.
b31
R2
R3
b15
b19
INTBH
b19
IPL
b15
b15
b15
b15
R0H
R1H
b8b7b0
R2
R3
A0
A1
FB
INTBL
PC
USP
ISP
SB
FLG
b7b8
R0L
R1L
Data Registers
Address Registers
Frame Base Registers
b0
Interrupt Table Register
b0
Program Counter
b0
User Stack Pointer
Interrupt Stack Pointer
Static Base Register
b0
Flag Register
b0
CDZSBOIU
Carry Flag
Debug Flag
Zero Flag
Sign Flag
Register Bank Select Flag
Overflow Flag
Interrupt Enable Flag
Stack Pointer Select Flag
Reserved Area
Processor Interrupt Priorit y Le vel
Reserved Area
(1)
(1)
(1)
NOTES:
1. These registers comprise a register bank. There are two register banks.
Figure 2.1Central Processing Unit Register
2.1Data Registers (R0, R1, R2 and R3)
The R0 register consists of 16 bits, and is used mainly for transfers and arithmetic/logic operations. R1 to R3 are
the same as R0.
The R0 register can be separated between high (R0H) and low (R0L) for use as two 8-bit data registers.
R1H and R1L are the same as R0H and R0L. Conversely, R2 and R0 can be combined for use as a 32-bit data
register (R2R0). R3R1 is the same as R2R0.
Rev.2.41Jan 10, 2006Page 30 of 390
REJ09B0185-0241
M16C/62P Group (M16C/62P, M16C/62PT)2. Central Processing Unit (CPU)
2.2Address Registers (A0 and A1)
The register A0 consists of 16 bits, and is used for address register indirect addressing and address register relative
addressing. They also are used for transfers and logic/logic operations. A1 is the same as A0.
In some instructions, registers A1 and A0 can be combined for use as a 32-bit address register (A1A0).
2.3Frame Base Register (FB)
FB is configured with 16 bits, and is used for FB relative addressing.
2.4Interrupt Table Register (INTB)
INTB is configured with 20 bits, indicating the start address of an interrupt vector table.
2.5Program Counter (PC)
PC is configured with 20 bits, indicating the address of an instruction to be executed.
2.6User Stack Pointer (USP) and Interrupt Stack Pointer (ISP)
Stack pointer (SP) comes in two types: USP and ISP, each configured with 16 bits.
Your desired type of stack pointer (USP or ISP) can be selected by the U flag of FLG.
2.7Static Base Register (SB)
SB is configured with 16 bits, and is used for SB relative addressing.
2.8Flag Register (FLG)
FLG consists of 11 bits, indicating the CPU status.
2.8.1Carry Flag (C Flag)
This flag retains a carry, borrow, or shift-out bit that has occurred in the arithmetic/logic unit.
2.8.2Debug Flag (D Flag)
The D flag is used exclusively for debugging purpose. During normal use, it must be set to “0”.
2.8.3Zero Flag (Z Flag)
This flag is set to “1” when an arithmetic operation resulted in 0; otherwise, it is “0”.
2.8.4Sign Flag (S Flag)
This flag is set to “1” when an arithmetic operation resulted in a negative value; otherwise, it is “0”.
2.8.5Register Bank Select Flag (B Flag)
Register bank 0 is selected when this flag is “0” ; register bank 1 is selected when this flag is “1”.
2.8.6Overflow Flag (O Flag)
This flag is set to “1” when the operation resulted in an overflow; otherwise, it is “0”.
2.8.7Interrupt Enable Flag (I Flag)
This flag enables a maskable interrupt.
Maskable interrupts are disabled when the I flag is “0”, and are enabled when the I flag is “1”. The I flag
is cleared to “0” when the interrupt request is accepted.
Rev.2.41Jan 10, 2006Page 31 of 390
REJ09B0185-0241
M16C/62P Group (M16C/62P, M16C/62PT)2. Central Processing Unit (CPU)
2.8.8Stack Pointer Select Flag (U Flag)
ISP is selected when the U flag is “0”; USP is selected when the U flag is “1”.
The U flag is cleared to “0” when a hardware interrupt request is accepted or an INT instruction for software
interrupt Nos. 0 to 31 is executed.
2.8.9Processor Interrupt Priority Level (IPL)
IPL is configured with three bits, for specification of up to eight processor interrupt priority levels from level 0
to level 7.
If a requested interrupt has priority greater than IPL, the interrupt is enabled.
2.8.10Reserved Area
When write to this bit, write “0”. When read, its content is indeterminate.
Rev.2.41Jan 10, 2006Page 32 of 390
REJ09B0185-0241
M16C/62P Group (M16C/62P, M16C/62PT)3. Memory
3.Memory
Figure 3.1 is a Memory Map of the M16C/62P group. The address space extends the 1M bytes from address 00000h to
FFFFFh.
The internal ROM is allocated in a lower address direction beginning with address FFFFFh . For exam ple, a 64-Kbyte
internal ROM is allocated to the addresses from F0000h to FFFFFh.
As for the flash memory version, 4-Kbyte space (block A) exists in 0F000h to 0FFFFh. 4-Kbyte space is mainly for
storing data. In addition to storing data, 4-Kbyte space also can store programs.
The fixed interrupt vector table is allocated to the addresses from FFFDCh to FFFFFh. Therefore, store the start
address of each interrupt routine here.
The internal RAM is allocated in an upper address direction beginning with address 00400h. For example, a 10-Kbyte
internal RAM is allocated to the addresses from 00400h to 02BFFh. In addition to storing data, the internal RAM also
stores the stack used when calling subroutines and when interrupts are generated.
The SRF is allocated to the addresses from 00000h to 003FFh. Peripheral function control registers are located here.
Of the SFR, any area which has no functions allocated is reserved for future use and cannot be used by users.
The special page vector table is allocated to the addresses from FFE00h to FFFDBh. This vector is used by the JMPS
or JSRS instruction. For details, refer to the M16C/60 and M16C/20 Series Software Manual.
In memory expansion and microprocessor modes, some areas are reserved for future use and cannot be used by users.
Use M16C/62P (80-pin version) and M16C/62PT in single-chip mode. The memory expansion and microprocessor
modes cannot be used
.
00000h
SFR
00400h
Internal RAM
Internal RAMInternal ROM
Address XXXXXh
Size
4 Kbytes013FFh
5 Kbytes
10 Kbytes
12 Kbytes
20 Kbytes
24 Kbytes
31 Kbytes
017FFh
02BFFh
033FFh
043FFh16 Kbytes
053FFh
063FFh
07FFFh
48 Kbytes
64 Kbytes
96 Kbytes
128 Kbytes
192 Kbytes
256 Kbytes
320 Kbytes
384 Kbytes
512 Kbytes
XXXXXh
0F000h
0FFFFh
(3)
Address YYYYYhSize
F4000h
F0000h
E8000h
E0000h
D0000h
C0000h
B0000h
A0000h
80000h
10000h
27000h
28000h
80000h
YYYYYh
FFFFFh
Reserved area
Internal ROM
(data area)
External area
Reserved area
External area
Reserved area
Internal ROM
(program area)
(1)
(3)
(2)
(5)
NOTES:
1. During memory expansion and microprocessor modes, can be used.
2. In memory expansion mode, can be used.
3. As for the flash memory version, 4-Kbyte space (block A) exists.
4. Shown here is a memory map for the case where the PM10 bit in the PM1 register is “1”
and the PM13 bit in the PM1 register is “1”.
5. When using the masked ROM version, write nothing to internal ROM area.
FFE00h
FFFDCh
FFFFFh
Special page
vector table
Undefined instruction
Overflow
BRK instruction
Address match
Single step
Watchdog timer
DBC
NMI
Reset
Figure 3.1Memory Map
Rev.2.41Jan 10, 2006Page 33 of 390
REJ09B0185-0241
M16C/62P Group (M16C/62P, M16C/62PT)4. S pecial Function Register (SFR)
4.Special Function Register (SFR)
SFR(Special Function Register) is the control register of peripheral functions. Tables 4.1 to 4.6 list the SFR
information.
(2)
(6)
(5, 6)
(5, 6)
(1)
PM0
CSR00000001b
(3)
(6)
(6)
DBR00h
CM20X000000b
VCR100001000b
VCR200h
CSE00h
D4INT00h
00000000b(CNVSS pin is “L”)
00000011b(CNVSS pin is “H”)
0005hProcessor Mode Register 1PM100001000b
0006hSystem Clock Control Register 0CM001001000b
0007hSystem Clock Control Register 1CM100100000b
0008hChip Select Control Register
0009hAddress Match Interrupt Enable RegisterAIERXXXXXX00b
000AhProtect RegisterPRCRXX000000b
000BhData Bank Register
000ChOscillation Stop Detection Register
000Dh
000EhWatchdog Timer Start RegisterWDTSXXh
000FhWatchdog Timer Control RegisterWDC00XXXXXXb
0010hAddress Match Interrupt Register 0RMAD000h
0011h00h
0012hX0h
0013h
0014hAddress Match Interrupt Register 1RMAD100h
0015h00h
0016hX0h
0017h
0018h
0019hVoltage Detection Register 1
001AhVoltage Detection Regist er 2
001BhChip Select Expansion Control Register
001ChPLL Control Register 0PLC00001X010b
001Dh
001EhProcessor Mode Register 2PM2XXX00000b
001FhLow Voltage Detection Interrupt Register
0020hDMA0 Source PointerSAR0XXh
0021hXXh
0022hXXh
0023h
0024hDMA0 Destination PointerDAR0XXh
0025hXXh
0026hXXh
0027h
0028hDMA0 Transfer CounterTCR0XXh
0029hXXh
002Ah
002Bh
002ChDMA0 Control RegisterDM0CON00000X00b
002Dh
002Eh
002Fh
0030hDMA1 Source PointerSAR1XXh
0031hXXh
0032hXXh
0033h
0034hDMA1 Destination PointerDAR1XXh
0035hXXh
0036hXXh
0037h
0038hDMA1 Transfer CounterTCR1XXh
0039hXXh
003Ah
003Bh
003ChDMA1 Control RegisterDM1CON00000X00b
003Dh
003Eh
003Fh
NOTES:
1. The blank areas are reserved and cannot be accessed by users.
2. The PM00 and PM01 bits do not change at software reset, watchdog timer reset and oscillation stop detection reset.
3. The CM20, CM21, and CM27 bits do not change at oscillation stop detection reset.
4. The WDC5 bit is “0” (cold start) immediately after power-on. I t can only be set to “1” in a program.
5. This register does not change at software reset, watchdog timer reset and oscillation stop detection reset.
6. This register in M16C/62PT cannot be used.
X : Nothing is mapped to this bit
(6)
Rev.2.41Jan 10, 2006Page 34 of 390
REJ09B0185-0241
M16C/62P Group (M16C/62P, M16C/62PT)4. S pecial Function Register (SFR)
Table 4.2SFR Information (2)
AddressRegisterSymbolAfter Reset
0040h
0041h
0042h
0043h
0044hINT3 Interrupt Control RegisterINT3ICXX00X000b
0045hTimer B5 Interrupt Control RegisterTB5ICXXXXX000b
0046h
0047h
0048hSI/O4 Interrupt Control Register, INT5 Interrupt Control RegisterS4IC, INT5ICXX00X000b
0049hSI/O3 Interrupt Control Register, INT4 Interrupt Control RegisterS3IC, INT4ICXX00X000b
004AhUART2 Bus Collision Detection Interrupt Control RegisterBCNICXXXXX000b
004BhDMA0 Interrupt Control RegisterDM0ICXXXXX000b
004ChDMA1 Interrupt Control RegisterDM1ICXXXXX000b
004DhKey Input Interrupt Control RegisterKUPICXXXXX000b
004EhA/D Conversion Interrupt Control RegisterADICXXXXX000b
004FhUART2 Transmit Interrupt Control RegisterS2TICXXXXX000b
0050hUART2 Receive Interrupt Control RegisterS2RICXXXXX000b
0051hUART0 Transmit Interrupt Control RegisterS0TICXXXXX000b
0052hUART0 Receive Interrupt Control RegisterS0RICXXXXX000b
0053hUART1 Transmit Interrupt Control RegisterS1TICXXXXX000b
0054hUART1 Receive Interrupt Control RegisterS1RICXXXXX000b
0055hTimer A0 Interrupt Control RegisterTA0ICXXXXX000b
0056hTimer A1 Interrupt Control RegisterTA1ICXXXXX000b
0057hTimer A2 Interrupt Control RegisterTA2ICXXXXX000b
0058hTimer A3 Interrupt Control RegisterTA3ICXXXXX000b
0059hTimer A4 Interrupt Control RegisterTA4ICXXXXX000b
005AhTimer B0 Interrupt Control RegisterTB0ICXXXXX000b
005BhTimer B1 Interrupt Control RegisterTB1ICXXXXX000b
005ChTimer B2 Interrupt Control RegisterTB2ICXXXXX000b
005DhINT0 Interrupt Control RegisterINT0ICXX00X000b
005EhINT1 Interrupt Control RegisterINT1ICXX00X000b
005FhINT2 Interrupt Control RegisterINT2ICXX00X000b
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
NOTES:
1. The blank areas are reserved and cannot be accessed by users.
Timer B4 Interrupt Control Register, UART1 BUS Collision Detection Interrupt Control Register
Timer B3 Interrupt Control Register, UART0 BUS Collision Detection Interrupt Control Register
(1)
TB4IC, U1BCNICXXXXX000b
TB3IC, U0BCNICXXXXX000b
X : Nothing is mapped to this bit
Rev.2.41Jan 10, 2006Page 35 of 390
REJ09B0185-0241
M16C/62P Group (M16C/62P, M16C/62PT)4. S pecial Function Register (SFR)
Table 4.3SFR Information (3)
AddressRegisterSymbolAfter Reset
0080h
0081h
0082h
0083h
0084h
0085h
0086h
0087h
to
01AFh
01B0h
01B1h
01B2h
01B3h
01B4hFlash Identificati o n R e gi s t e r
01B5hFlash Memory Control Register 1
01B6h
01B7hFlash Memory Control Register 0
01B8hAddress Match Interrupt Register 2RMAD200h
01B9h00h
01BAhXXh
01BBhAddress Match Interrupt Enable Register 2AIER2XXXXXX00b
01BChAddress Match Interrupt Register 3RMAD300h
01BDh00h
01BEhXXh
01C0h
to
024Fh
0250h
0251h
0252h
0253h
0254h
0255h
0256h
0257h
0258h
0259h
025Ah
025Bh
025Ch
025Dh
025EhPeripheral Clock Select RegisterPCLKR00000011b
025Fh
0260h
to
032Fh
0330h
0331h
0332h
0333h
0334h
0335h
0336h
0337h
0338h
0339h
033Ah
033Bh
033Ch
033Dh
033Eh
033Fh
NOTES:
1. The blank areas are reserved and cannot be accessed by users.
2. This register is included in the flash memory version.
(1)
(2)
(2)
(2)
FIDRXXXXXX00b
FMR10X00XX0Xb
FMR000000001b
X : Nothing is mapped to this bit
Rev.2.41Jan 10, 2006Page 36 of 390
REJ09B0185-0241
M16C/62P Group (M16C/62P, M16C/62PT)4. S pecial Function Register (SFR)
Table 4.4SFR Information (4)
AddressRegisterSymbolAfter Reset
0340hTimer B3, 4, 5 Count Start FlagTBSR000XXXXXb
0341h
0342hTimer A1-1 RegisterTA11XXh
0343hXXh
0344hTimer A2-1 RegisterTA21XXh
0345hXXh
0346hTimer A4-1 RegisterTA41XXh
0347hXXh
0348hThree-Phase PWM Control Register 0INVC000h
0349hThree-Phase PWM Control Register 1INVC100h
034AhThree-Phase Output Buffer Register 0IDB000h
034BhThree-Phase Output Buffer Register 1IDB100h
034ChDead Time TimerDTTXXh
034DhTimer B2 Interrupt Occurrence Frequency Set CounterICTB2XXh
034Eh
034Fh
0350hTimer B3 RegisterTB3XXh
0351hXXh
0352hTimer B4 RegisterTB4XXh
0353hXXh
0354hTimer B5 RegisterTB5XXh
0355hXXh
0356h
0357h
0358h
0359h
035Ah
035BhTimer B3 Mode RegisterTB3MR00XX0000b
035ChTimer B4 Mode RegisterTB4MR00XX0000b
035DhTimer B5 Mode RegisterTB5MR00XX0000b
035EhInterrupt Factor Select Register 2IFSR2A00XXXXXXb
035FhInterrupt Factor Select RegisterIFSR00h
0360hSI/O3 Transmit/Receive RegisterS3TRRXXh
0361h
0362hSI/O3 Control RegisterS3C01000000b
0363hSI/O3 Bit Rate GeneratorS3BRGXXh
0364hSI/O4 Transmit/Receive RegisterS4TRRXXh
0365h
0366hSI/O4 Control RegisterS4C01000000b
0367hSI/O4 Bit Rate GeneratorS4BRGXXh
0368h
0369h
036Ah
036Bh
036ChUART0 Special Mode Register 4U0SMR400h
036DhUART0 Special Mode Register 3U0SMR3000X0X0Xb
036EhUART0 Special Mode Register 2U0SMR2X0000000b
036FhUART0 Special Mode RegisterU0SMRX0000000b
0370hUART1 Special Mode Register 4U1SMR400h
0371hUART1 Special Mode Register 3U1SMR3000X0X0Xb
0372hUART1 Special Mode Register 2U1SMR2X0000000b
0373hUART1 Special Mode RegisterU1SMRX0000000b
0374hUART2 Special Mode Register 4U2SMR400h
0375hUART2 Special Mode Register 3U2SMR3000X0X0Xb
0376hUART2 Special Mode Register 2U2SMR2X0000000b
0377hUART2 Special Mode RegisterU2SMRX0000000b
0378hUART2 Transmit/Receive Mode RegisterU2MR00h
0379hUART2 Bit Rate GeneratorU2BRGXXh
037AhUART2 Transmit Buffer RegisterU2TBXXh
037BhXXh
037ChUART2 Transmit/Receive Control Register 0U2C000001000b
037DhUART2 Transmit/Receive Control Register 1U2C100000010b
037EhUART2 Receive Buffer RegisterU2RBXXh
037FhXXh
NOTES:
1. The blank areas are reserved and cannot be accessed by users.
(1)
X : Nothing is mapped to this bit
Rev.2.41Jan 10, 2006Page 37 of 390
REJ09B0185-0241
M16C/62P Group (M16C/62P, M16C/62PT)4. S pecial Function Register (SFR)
PUR300h
03E0hPort P0 RegisterP0XXh
03E1hPort P1 RegisterP1XXh
03E2hPort P0 Direction RegisterPD000h
03E3hPort P1 Direction RegisterPD100h
03E4hPort P2 RegisterP2XXh
03E5hPort P3 RegisterP3XXh
03E6hPort P2 Direction RegisterPD200h
03E7hPort P3 Direction RegisterPD300h
03E8hPort P4 RegisterP4XXh
03E9hPort P5 RegisterP5XXh
03EAhPort P4 Direction RegisterPD400h
03EBhPort P5 Direction RegisterPD500h
03EChPort P6 RegisterP6XXh
03EDhPort P7 RegisterP7XXh
03EEhPort P6 Direction RegisterPD600h
03EFhPort P7 Direction RegisterPD700h
03F0hPort P8 RegisterP8XXh
03F1hPort P9 RegisterP9XXh
03F2hPort P8 Direction RegisterPD800X00000b
03F3hPort P9 Direction RegisterPD900h
03F4hPort P10 RegisterP10XXh
03F5hPort P11 Register
03F6hPort P10 Direction RegisterPD1000h
03F7hPort P11 Direction Register
03F8hPort P12 Register
03F9hPort P13 Register
03FAhPort P12 Direction Register
03FBhPort P13 Direction Register
(3)
(3)
(3)
(3)
(3)
(3)
P11XXh
PD1100h
P12XXh
P13XXh
PD1200h
PD1300h
03FChPull-Up Control Register 0PUR000h
03FDhPull-Up Control Register 1PUR100000000b
00000010b
03FEhPull-Up Control Register 2PUR200h
03FFhPort Control RegisterPCR00h
NOTES:
1. The blank areas are reserved and cannot be accessed by users.
2. At hardware reset 1 or hardware reset 2, the register is as follows:
• “00000000b” where “L” is inputted to the CNVSS pin
• “00000010b” where “H” is inputted to the CNVSS pin
At software reset, watchdog timer reset and oscillation stop detection reset, the register is as follows:
• “00000000b” where the PM01 to PM00 bits in the PM0 register are “00b” (single-chip mode).
• “00000010b” where the PM01 to PM00 bits in the PM0 register are “01b” (memory expansion mode) or “11b” (microprocessor mode).
3. These registers do not exist in M16C/62P (80-pin version), and M16C /62PT (80-pin version).
X : Nothing is mapped to this bit
(2)
(2)
Rev.2.41Jan 10, 2006Page 39 of 390
REJ09B0185-0241
M16C/62P Group (M16C/62P, M16C/62PT)5. Reset
5.Reset
Hardware reset 1, brown-out detectio n reset (hardware re set 2), software reset, watchdog timer reset and oscillation
stop detection reset are available to reset the microcomputer.
5.1Hardware Reset 1
The microcomputer resets pins, the CPU and SFR by setting the RESET pin. If the supply voltage meets the
recommended operating conditions, the microcomputer resets all pins w hen an “L” si gnal is app lied to the RESET
pin (see Table 5.1 Pin Status When RESET Pin Level is “L”). The oscillation circuit is also reset and the main
clock starts oscillation. The microcomputer resets the CPU and SFR when the signal applied to the RESET
changes low (“L”) to high (“H”). The microcomputer executes the program in an address indicated by the reset
vector. The internal RAM is not reset. When an “L” signal is applied to the RESET
internal RAM, the internal RAM is in an indeterminate state.
Figure 5.1 shows an Example Reset Circuit. Figure 5.2 shows a Reset Sequence. Table 5.1 lists Pin Status When
RESET
Register (SFR) for SFR states after reset.
Pin Level is “L”. Figure 5.3 shows CPU Register Status After Reset. Refer to 4. Special Function
pin while writing data to the
5.1.1Reset on a Stable Supply Voltage
(1) Apply “L” to the RESET pin
(2) Apply 20 or more clock cycles to the XIN pin
(3) Apply an “H” signal to the RESET
pin
pin
5.1.2Power-on Reset
(1) Apply “L” to the RESET pin
(2) Raise the supply voltage to the recommended operating level
(3) Insert td(P-R) ms as wait time for the internal voltage to stabilize
(4) Apply 20 or more clock cycles to the XIN pin
(5) Apply “H” to the RESET
RESET
VCC1
pin
Recommended
operation voltage
VCC1
0V
RESET
0V
0.2VCC1
or below
0.2VCC1 or below
Supply a clock with td(P-R) + 20
or more cycles to the XIN pin
NOTES:
1. If VCC1>VCC2, the VCC2 voltage must be lower than that of VCC1 when the power
is being turned on or off.
Figure 5.1Example Reset Circuit
Rev.2.41Jan 10, 2006Page 40 of 390
REJ09B0185-0241
M16C/62P Group (M16C/62P, M16C/62PT)5. Reset
VCC1, VCC2
XIN
Microprocessor
mode BYTE = H
td(P-R)More than
20 cycles
are needed
RESET
BCLK
Address
RD
WR
CS0
Microprocessor
mode BYTE = L
Address
RD
WR
CS0
Single chip
mode
Address
BCLK 28cycles
FFFFCh
FFFFChFFFFEh
FFFFCh
FFFFDh
Content of reset vector
FFFFEh
Content of reset vector
FFFFEh
Content of reset vector
Figure 5.2Reset Sequence
Rev.2.41Jan 10, 2006Page 41 of 390
REJ09B0185-0241
M16C/62P Group (M16C/62P, M16C/62PT)5. Reset
Table 5.1Pin Status When RESET
Pin Level is “L”
Pin NameStatus
(1)
CNVSS = VSS
CNVSS = VCC1
BYTE = VSSBYTE = VCC1
P0Input port Data inputData input
P1Input port Data inputInput port
P2, P3, P4_0 to P4_3Input port Address output (underfined)Address output (underfined)
P4_4Input port CS0
output (“H” is output)CS0 output (“H” is output)
P4_5 to P4_7Input port Input port (Pulled high)Input port (Pulled high)
P5_0Input port WR
P5_1Input port BHE
P5_2Input port RD
output (“H” is output)WR output (“H” is output)
output (undefined)BHE output (undefined)
output (“H” is output)RD output (“H” is output)
P5_3Input port BCLK outputBCLK output
P5_4Input port HLDA
value
depends on the input to the
HOLD
P5_5Input port HOLD
output (The output
pin)
inputHOLD input
HLDA
output (The output
value
depends on the input to the
HOLD
pin)
P5_6Input port ALE output (“L” is output)ALE output (“L” is output)
P5_7Input port RDY
P6, P7, P8_0 to P8_4,
Input port Input port Input port
inputRDY input
P8_6, P8_7, P9, P10
P11, P12, P13, P14_0,
P14_1
(2)
Input port Input port Input port
NOTES:
1. Shown here is the valid pin state when the internal power supply voltage has stabilized after power
on.
When CNVSS = VCC1, the pin state is indeterminate until the internal power supply voltage
stabilizes.
The microcomputer resets pins, the CPU or SFR by setting the built-in voltage detect circuit. The voltage detect
circuit monitors the voltage applied to the VCC1 pin.
When the VC26 bit in the VCR2 register is set to “1” (reset level detect circuit enabled), the microcomputer
resets pins, the CPU and SFR as soon as the voltage that is applied to the VCC1 pin drops to Vdet3 or below.
The microcomputer resets pins and it is in a reset state when the voltage that is applied to the VCC1 pin is
Vdet3 or below. The microcomputer resets pins, CPU and SFR with Vdet3r or above and it executes the
program from the address determined by the reset vector. The microcomputer executes the program after
detecting Vdet3r and waiting td(S-R) ms. The same pins and registers are reset by the hardware reset 1 and
brown-out detection reset (hardware reset 2), and are also placed in the same reset state.
The microcomputer cannot exit stop mode by the brown-out detection reset (hardware reset 2).
Rev.2.41Jan 10, 2006Page 42 of 390
REJ09B0185-0241
M16C/62P Group (M16C/62P, M16C/62PT)5. Reset
5.3Software Reset
The microcomputer resets pins, the CPU and SFR when the PM03 bit in the PM0 register is set to “1”
(microcomputer reset). Then the microcomputer executes the program in an address determined by the reset vector.
Set the PM03 bit to “1” while the main clock is selected as the CPU clock and the main clock oscillation is stable.
In the software reset, the microcomputer does not reset a part of the SFR. Refer to 4. Special Function Register(SFR) for details.
Processor mode remains unchanged since the PM01 to PM00 bits in the PM0 register are not reset.
5.4 Watchdog Timer Reset
The microcomputer resets pins, the CPU and SFR when the CM06 bi t in the CM0 register is set to “1” (reset) and
the watchdog timer underflows. Then the microcompu ter executes the program in an address determined by the
reset vector.
In the watchdog timer reset , the microcom puter does not reset a part of the SFR. Refer to 4. Special FunctionRegister (SFR) for details. Processor mode remains unchanged since the PM01 to PM00 bits in th e PM0 register
are not reset.
5.5Oscillation Stop Detection Reset
The microcomputer resets and stops pins, the CPU and SFR when the CM27 bit in the CM2 register is 0, if it
detects main clock oscillation circuit stop. Refer to 10.6 Oscillation Stop and Re-oscillation Detect Function for
details.
In the oscillation stop detection reset, the microcomputer does not reset a part of the SFR. Refer to 4. SpecialFunction Register (SFR) for details. Processor mode remains unchanged since the PM01 to PM00 bits in the
PM0 register are not reset.
Rev.2.41Jan 10, 2006Page 43 of 390
REJ09B0185-0241
M16C/62P Group (M16C/62P, M16C/62PT)5. Reset
5.6Internal Space
Figure 5.3 shows CPU Register Status After Reset. Refer to 4. Special Function Register (SFR) for SFR states
after reset.
b15
b15
0000h
0000h
0000h
0000h
0000h
0000h
0000h
b19
00000h
Content of addresses FFFFEh to FFFFCh
b15
0000h
0000h
0000h
b15
0000h
b7b8
IPL
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
CDZSBOIU
Figure 5.3CPU Register Status After Reset
Rev.2.41Jan 10, 2006Page 44 of 390
REJ09B0185-0241
M16C/62P Group (M16C/62P, M16C/62PT)6. Voltage Detection Circuit
6.Voltage Detection Circuit
Note
The M16C/62PT do not use the voltage detection circuit.
However, the cold start-up/warm start-up determine function is available.
The voltage detection circuit consists of the reset level detection circuit and the low voltage detection circuit.
The reset level detection circuit monitors the voltage applied to the VCC1 pin. The microcomputer is reset if the reset
level detection circuit detects VCC1 is Vdet3 or below. This circuit is disabled when the microcomputer is in stop
mode.
The voltage detection circuit also monitors the voltage applied to the VCC1 pin. The low voltage detection signal is
generated when the low voltage detection circuit detects VCC1 is above or below Vdet4. This signal generates the low
voltage detection interrupt. The VC13 bit in the VCR1 register determines whether VCC1 is above or below Vdet4.
The voltage detection circuit is available when VCC1=5.0V.
Figure 6.1 shows a Voltage Detection Circui t Block.
.
Rev.2.41Jan 10, 2006Page 45 of 390
REJ09B0185-0241
M16C/62P Group (M16C/62P, M16C/62PT)6. Voltage Detection Circuit
Vol t age Detect io n Regi s ter 1
b7 b6 b5 b4 b3 b2 b1
0000
NOTES :
1.2.The VC13 bit is useful w hen the VC27 bit in the VCR2 register is set to “1” (low voltage detection circuit enable).
The VC13 bit is always “1” (VCC1 ≥ Vdet4) w hen the VC27 bit is set to “0” (low voltage detection circuit disable).
This register dose not change at softw are reset, watchdog timer reset and oscillation stop detection reset.
b0
0
0
0
Bit SymbolFunctionRW
Symbol
VCR1
AddressAfter Reset
0019h00001000b
Bit Name
—Set to “0”
Reserved Bit
(b2-b0)
Low Voltage Monitor Flag
(1)
0 : VCC1 < Vdet4
1 : VCC1 ≥ Vdet4
—Set to “0”
Reserved Bit
(b7-b4)
(2)
RW
ROVC13
RW
Vol t ag e Det ect i on Regi st er 2
b3 b2 b1 b0b7 b6 b5 b4
0
00
000
(1)
Symbol
VCR2
Bit SymbolFunctionRW
—Set to “0”
Reserved Bit
(b5-b0)
Reset Level Monitor Bit
VC27
Low Voltage Monitor Bit
NOTES :
1.
Write to this register after setting the PRC3 bit in the PRCR register to “1” (w rite enabl e ).
2.
To use low voltage detection (hardw are reset 2), set the VC26 bit to “1” (reset level detection circuit enable).
3.
VC26 bit is disabled in stop mode (the microcom puter is not reset even if the voltage input to VCC1 pin becomes
lower than Vdet3).
4.
Where the VC13 bit in the VCR1 register and D42 bit in the D4INT register are used or the D40 bi t is set to “1” (low
voltage detection interrupt enable), set the VC27 bit to “1” (low voltage detection circuit enable).
5.
This register dose not change at softw are reset, watchdog timer reset and oscillation stop detection reset.
6.
The detection circuit dose not start operation until td(E-A) elapses after the VC26 bit, or VC27 bit is set to “1”.
0 : Disable low voltage detection circuit
1 : Enable low voltage detection circuit
(5)
RW
RWVC26
RW
Rev.2.41Jan 10, 2006Page 46 of 390
REJ09B0185-0241
M16C/62P Group (M16C/62P, M16C/62PT)6. Voltage Detection Circuit
Low Volt age Detect i on Interrupt Regis ter
b7 b6 b5 b4 b3 b2 b1 b0
SymbolAddressAfter Reset
D4INT
Bit SymbolBit NameFunctionRW
D40
D41
D42
D43
DF0
DF1RW
—
(b7-b6)
NOTES :
1.
Write to this register after setting the PRC3 bit in the PRCR register to “1” (w rite enable).
2.
Useful w hen the VC27 bit i n the VCR2 register is set to “1” (low voltage detection circuit enabled). If the VC27 bit is
set to “0” (low voltage detection circuit disabled), the D42 bit is set to “0” (Not detect).
This bit is set to “0” by w riting a “0” in a program. (Writing a “1” has no effect.)
3.
4.
I f the low voltage detection interrupt needs to be used to get out of stop mode again after once used for that
purpose, reset the D41 bit by w riting a “0” and then a “1”.
5.
The D40 bit is effective w hen the VC27 bit = 1. To set the D 40 bit to “1”, set bits in the follow ing order.
(a) Set the VC27 bit to “1”.
(b) Wait for td(E-A) until the detection circuit is actuated.
(c) Wait for the sampl ing time. (See
(d) Set the D40 bit to “1”.
Low Voltage Detection Interrupt
Enable Bit
STOP Mode Deactivation Control
(4)
Bit
Voltage Change Detection Flag
WDT Overflow D etect Flag0 : Not detected
Sampling Clock Select Bit
Nothing is assigned. When write, set to “0”.
When read, their contents are “0”.
(1)
001Fh00h
(5)
0 : Disable
1 : Enable
0 : Disable (do not use the Low voltage
detection interrupt to get out of stop
mode)
1 : Enable (use the low voltage detection
interrupt to get out of stop mode)
(2)
0 : Not detected
1 : Vdet4 passing detection
1 : Detected
b5 b4
0 0 : CPU clock divided by 8
0 1 : CPU clock divided by 16
1 0 : CPU clock divided by 32
1 1 : CPU clock divided by 64
Table 6.2 Sampling Period
.)
RW
RW
RW
RW
RW
(3)
(3)
—
Figure 6.3D4INT Register
Rev.2.41Jan 10, 2006Page 47 of 390
REJ09B0185-0241
M16C/62P Group (M16C/62P, M16C/62PT)6. Voltage Detection Circuit
VCC1
RESET
Internal Reset Signal
VC13 bit in
VCR1 register
VC26 bit in
VCR2 register
VC27 bit in
VCR2 register
(1)
NOTES :
1. VC26 bit is invalid (the microcomputer is not reset even if input voltage of VCC1 pin
becomes lower than Vdet3).
Vdet4
Vdet3r
Vdet3
Vdet3s
VSS
Indefinite
Indefinite
Indefinite
5.0V
5.0V
Set to “1” by program (reset level detect c ircuit enable)
Set to “1” by program
(Low voltage detection circuit enable)
Figure 6.4Typical Operation of Brown-out Detection Reset (Hardwa re Reset 2)
Rev.2.41Jan 10, 2006Page 48 of 390
REJ09B0185-0241
M16C/62P Group (M16C/62P, M16C/62PT)6. Voltage Detection Circuit
6.1Low Voltage Detection Interrupt
If the D40 bit in the D4INT register is set to “1” (low voltage detection interrupt enabled), the low voltage detection
interrupt request is generated when the voltage applied to the VCC1 pin is above or below Vdet4.
The low voltage detection interrupt shares the same interrupt vector with the watchdog timer interru pt and
oscillation stop, re-oscillation detection interrupt.
Set the D41 bit in the D4INT register to “1” (enabled) to use the low voltage detection interrupt to exit stop mode.
The D42 bit in the D4INT register is set to “1” as soon as the voltage applied to the VCC1 pin reaches Vdet4 due to
the voltage rise and voltage drop. When the D42 bit changes “0” to “1”, the low voltage detection interrupt request
is generated. Set the D42 bit to “0” by program. However, when the D41 bit is set to “1” and the microcomputer is
in stop mode, the low voltage detection interru pt request is genera ted regardless of the D42 bi t state if the voltage
applied to the VCC1 pin is detected to be above Vdet4. The microcomputer then exits stop mode.
Table 6.1 shows Low Voltage Detection Interrupt Request Generation Conditions.
The DF1 to DF0 bits in the D4INT register determine the sampling period that detects the voltage appl ied to the
VCC1 pin reaches Vdet4. Table 6.2 shows the Sampling Periods.
Table 6.1Low Voltage Detection Interrupt Request Generation Conditions
Operating ModeVC27 BitD40 BitD41 BitD42 BitCM02 BitVC13 Bit
(3)
Normal Operating
(1)
Mode
Wait Mode
Stop Mode
(2)
(2)
11
−0 to 1−
−0 to 10
1
−10 to 1
−00 to 1
1. The status except the wait mode and stop mode is h andled as the nor mal mode. ( Refer to 10. Clock
Generation Circuit)
2. Refer to 6.2 Limitations on Exiting St op Mode, 6.3 Limitations on Exiting Wait Mode.
3. An interrupt request for voltage reduction is generated a sampling time after the value of the VC13
bit has changed.
See the Figure 6.6 Low Voltage Detection Interrupt Generation Circuit Operation Example for
details.
0 to 1
(3)
1 to 0
(3)
0 to 1
(3)
1 to 0
− : “0”or “1”
Table 6.2Sampling Periods
CPU Clock
(D4INT clock)
(MHz)
163.06.012.024.0
DF1 to DF0=00
(CPU clock divided by 8)
DF1 to DF0=01
(CPU clock divided by 16)
Sampling Clock (µs)
DF1 to DF0=10
(CPU clock divided by 32)
DF1 to DF0=11
(CPU clock divided by 64)
Rev.2.41Jan 10, 2006Page 49 of 390
REJ09B0185-0241
M16C/62P Group (M16C/62P, M16C/62PT)6. Voltage Detection Circuit
Low Voltage detection interrupt generation circuit
DF1, DF0
Low Voltage detection Circuit
VC27
VCC1
+
Noise
VREF
Watchdog Timer Block
Rejection
-
(Rejection Range : 200 ns)
The Low Voltage detection signal
becomes “H” when the VC27 bit is
set to “0” (disabled)
WAIT instruction (wait mode)
D4INT clock (the
clock with which it
operates also in
wait mode)
Low Voltage
detection signal
Watchdog timer
underflow signal
VC13
CM10
CM02
00b
01b
10b
11b
1/2
Noise Rejection
Circuit
1/2
1/21/8
D43
This bit is set to “0” (not detected) by program.
The D42 bit is set to “0” (not detected)
by program. The VC27 bit is set to “0”
(voltage down detect circuit disable d),
the D42 bit is set to “0”.
D42
Digital
Filter
D41
D40
Watchdog
timer interrupt
signal
Low Voltage
detection interrupt
signal
Oscillation stop,
re-oscillation
detection
interrupt signal
Non-maskable
interrupt signal
Figure 6.5Low Voltage detection Interrupt Generation Block
VCC1
VC13 bit in VCR1 register
Output of the digital filter
D42 bit in D4INT register
Low Voltagedetection
interrupt signal
sampling
(2)
samplingsamplingsampling
No low voltage detection interrupt signals are
generated when the D42 bit is “H”.
Set to “0” by program (not detected)
NOTES :
1. D40 bit in the D4INT register is set to “1” (low voltage
detection interrupt enabled).
2. Output of the digital filter is shown in Figure 6.5.
Figure 6.6Low Voltage Detection Interrupt Generation Circuit Operation Example
Rev.2.41Jan 10, 2006Page 50 of 390
REJ09B0185-0241
M16C/62P Group (M16C/62P, M16C/62PT)6. Voltage Detection Circuit
6.2 Limitations on Exiting Stop Mode
The low voltage detection interrupt is immediately generated and the microcomputer exits stop mode if the CM10
bit in the CM1 register is set to “1” under the conditions below.
• the VC27 bit in the VCR2 register is set to “1” (low voltage detection circuit enabled),
• the D40 bit in the D4INT register is set to “1” (low voltage detection interrupt enabled),
• the D41 bit in the D4INT register is set to “1” (low voltage detection interrupt is used to exit stop mode), and
• the voltage applied to the VCC1 pin is higher than Vdet4 (the VC13 bit in the VCR1 register is “1”)
If the microcomputer is set to enter stop mode when the voltage applied to the VCC1 pin drops below Vdet4 and to
exit stop mode when the voltage applied rises to Vdet4 or above, set the CM10 bit to “1” when VC13 bit is “0”
(VCC1 < Vdet4).
6.3Limitations on Exiting Wait Mode
The low voltage detection interrupt is immediately generated and the microcomputer exits wait mode If WAIT
instruction is executed under the conditions below.
• the CM02 bit in the CM0 register is set to “1” (stop peripheral function clock),
• the VC27 bit in the VCR2 register is set to “1” (low voltage detection circuit enabled),
• the D40 bit in the D4INT register is set to “1” (low voltage detection interrupt enabled),
• the D41 bit in the D4INT register is set to “1” (low voltage detection interrupt is used to exit wait mode), and
• the voltage applied to the VCC1 pin is higher than Vdet4 (the VC13 bit in the VCR1 register is “1”)
If the microcomputer is set to enter wait mode when the voltage applied to the VCC1 pin drops below Vdet4 and to
exit wait mode when the voltage applied rises to Vdet4 or above, perform WAIT instruction when VC13 bit is “0”
(VCC1 < Vdet4).
Rev.2.41Jan 10, 2006Page 51 of 390
REJ09B0185-0241
M16C/62P Group (M16C/62P, M16C/62PT)6. Voltage Detection Circuit
6.4Cold Start-up / Warm Start-up Determine Function
As for the cold start-up/warm start-up determine function, the WDC5 flag in the WDC register determines either
cold start-up (reset process) when power-on or warm start-up (reset process) when reset signal is applied during the
microcomputer running.
Default value of the WDC5 bit is “0” (cold start-up) when power-on. It is set to “1” (warm start-up) by writing
desired values to the WDC register. The WDC bit is not reset, regardless of a software reset or a reset operation.
Figure 6.7 shows Cold Start-up/Warm Start-up Determine Function Block Diagram. Figure 6.8 shows the Cold
Start-up/Warm Start-up Determine Function Operation Example. Figure 6.9 shows WDC Register.
WDC5 Bit
Write to WDC register
S
QWARM/COLD
(Cold start, warm start)
Internal power on reset
R
Figure 6.7Cold Start-up/Warm Start-up Determine Function Block Diagram
5V
VCC
0V
RESET
WDC5 Flag
5V
0V
“1”
“0”
T1
T2
Reset Sequence (16MHz, about 20 µsec.)
Pch transistor ON (about 4V)
CPU reset is deasserted
Set to “1” by program
T > 100 µsec.
Program start
“1” is held even if
RESET becomes 0V.
Becomes “0” on the rising
edge of VCC
NOTES:
1. The timing of which WDC5 is set is affected by how the RESET signal rises (Time lag between T1 and T2).
Figure 6.8Cold Start-up/Warm Start-up Determine Function Operation Example
Rev.2.41Jan 10, 2006Page 52 of 390
REJ09B0185-0241
M16C/62P Group (M16C/62P, M16C/62PT)6. Voltage Detection Circuit
W atc hdog Tim er Cont rol Regist e r
b7 b6 b5 b4 b3 b2 b1 b0
0
NOTES :
1.
Writing to the WDC register factors the WDC5 bit to be set to “1” (w arm start). If the voltage applied to VCC1 is less
than 4.0 V, either write to this register when the CPU clock frequency is 2 MHz or w rite twice.
The WDC5 bit is set to “0” (cold start) w hen pow er is turned on and can be set to “1” by program only.
2.
SymbolAddressAfter Reset
WDC
Bit SymbolBit NameFunctionRW
—
(b4-b0)
WDC5RW
—
(b6)
WDC7
High-order Bit of Watchdog Timer
Cold Start / Warm Start Discrimination
(1, 2)
Flag
Rese rved Bi tSet to “0”
Prescaler Select Bit0 : Divided by 16
000Fh00XXXXXXb
0 : Cold Start
1 : Warm S tart
1 : Divided by 128
(2)
RO
RW
RW
Figure 6.9WDC Register
Rev.2.41Jan 10, 2006Page 53 of 390
REJ09B0185-0241
M16C/62P Group (M16C/62P, M16C/62PT)7. Processor Mode
7.Processor Mode
Note
The M16C/62P (80-pin version) and M16C/62PT do not use memory expansion mode, and microprocessor
mode.
7.1Types of Processor Mode
Three processor modes are available to choose from: single-chip mode, memory expansion mode, and
microprocessor mode. Table 7.1 shows the Features of Processor Modes.
Table 7.1Features of Processor Modes
Processor ModesAccess SpacePins which are Assigned I/O Ports
Single-Chip ModeSFR, Internal RAM, Internal ROM All pins are I/O ports or peripheral function I/O
pins
Memory Expansion
Mode
Microprocessor
Mode
NOTES:
1. Refer to 8. Bus.
SFR, Internal RAM, Internal ROM,
External Area
(1)
SFR, Internal RAM, External Area
(1)
Some pins serve as bus control pins
Some pins serve as bus control pins
(1)
(1)
Rev.2.41Jan 10, 2006Page 54 of 390
REJ09B0185-0241
M16C/62P Group (M16C/62P, M16C/62PT)7. Processor Mode
7.2Setting Processor Modes
Processor mode is set by using the CNVSS pin and the PM01 to PM00 bits in the PM0 register.
Table 7.2 shows the Processor Mode After Hardware Reset. Table 7.3 shows the PM01 to PM00 Bits Set Values
and Processor Modes.
Table 7.2Processor Mode After Hardware Reset
CNVSS Pin Input LevelProcessor Modes
VSSSingle-Chip Mode
(1, 2)
VCC1
NOTES:
1. If the microcomputer is reset in hardware by applying VCC1 to the CNVSS pin (hardware reset 1 or
brown-out detection reset (hardware reset 2)), the internal ROM cannot be accessed regardless of
PM10 to PM00 bits.
2. The multiplexed bus cannot be assigned to the entire CS
Table 7.3PM01 to PM00 Bits Set Values and Processor Modes
PM01 to PM00 BitsProcessor Modes
00bSingle-Chip Mode
01bMem or y Expansion Mo de
10bDo not set
11bMicroprocessor Mode
Rewriting the PM01 to PM00 bits places the microcomputer in the corresponding processor mode regardless of
whether the input level on the CNVSS pin is “H” or “L”. Note, however, that the PM01 to PM00 bits cannot be
rewritten to “01b” (memory expansion mode) or “11b” (microprocessor mode) at the same time the PM07 to PM02
bits are rewritten. Note also that these bits cannot be rewritten to enter microprocessor mode in the internal ROM,
nor can they be rewritten to exit microprocessor mode in areas overlapping the internal ROM.
If the microcomputer is reset in hardware by applying VCC1 to the CNVSS pin (hardware reset 1 or brown-out
detection reset (hardware reset 2)), the internal ROM cannot be accessed regardless of PM01 to PM00 bits.
Figures 7.1 and 7.2 show the PM0 Register and PM1 Register. Figure 7.3 show the Memory M ap in Singl e Chip
Mode.
Microprocessor Mode
space.
Rev.2.41Jan 10, 2006Page 55 of 390
REJ09B0185-0241
M16C/62P Group (M16C/62P, M16C/62PT)7. Processor Mode
1 : RD
Setting this bit to “1” resets the microcomputer.
When read, its content is “0”.
b5 b4
0 0 : Multiplexed bus is unused
(Separate bus in the entire CS
0 1 : Allocated to CS2
1 0 : Allocated to CS1
1 1 : Allocated to the entire CS
0 : Address output
1 : Port function (Address is not output)
0 : BCLK is output
1 : BC LK is not output (Pin is left high-impedance)
, BHE
_____
, WRH
___
, WR
, WRL
____
____
____
space
space
__
space
__
space)
NOTES :
1.
Write to this register after setting the PRC1 bit in the PRCR register to “1” (w rite enabl e).
2.
Effective when the PM01 to PM00 bits are set to “01b” (memory expansion mode) or “11b” (microprocessor mode).
3.
To set the PM01 to PM00 bits are “01b” and the PM05 to PM04 bits are “11b” (multiplexed bus assigned to the entire
__
space), apply an “H” signal to the BYTE pin (external data bus is 8 bits w ide). While the CNVSS pin is held “H”
CS
(= VCC1), do not rewrite the PM05 to PM04 bits to “11b” after reset.
I f the P M05 to PM04 bits are set to “11b” during m emory expansion mode, P3_1 to P3_7 and P4_0 to P4_3 become
I /O ports, in which case the accessible area for each CS
4.
The PM01 to PM00 bits do not change at softw are reset, w atchdog timer reset and oscillati on stop detection reset.
__
is 256 bytes.
RW
RW
RW
(3)
RW
RW
RW
Figure 7.1PM0 Register
Rev.2.41Jan 10, 2006Page 56 of 390
REJ09B0185-0241
M16C/62P Group (M16C/62P, M16C/62PT)7. Processor Mode
0b7b6b5b4
Proces sor M ode Regi ster 1
b3b2 b1 b
0
SymbolAddressAfter Reset
PM1
(1)
0005h0X001000b
Bit SymbolBit NameFunctionRW
PM10RW
PM11RW
PM12
PM13RW
CS2 Area Sw itch Bit
(Data Block Enable Bit)
Port P 3_7 to P3_4 Function Select
(3)
Bit
(2)
Watchdog Timer Function Select Bit0 : Watchdog timer interrupt
Internal Reserved Area Expansion
(6)
Bit
Memory Area E xpansion Bit
(3)
PM14RW
0 : 08000h to 26FFFh (Block A disable)
1 : 10000h to 26FFFh (Block A enable)
0 : Address output
1 : Port function
1 : Watchdog timer reset
(4)
(NOTE 7)
b5 b4
0 0 : 1-Mbyte mode (Do not expand)
0 1 : Do not set
1 0 : Do not set
PM15
—
Res erved Bit
1 1 : 4-Mbyte m ode
Set to “0”.
(b6)
(5)
PM17RW
Wait Bit
0 : No wait state
1 : With wait state (1 w ait)
NOTES :
1.
Write to this register after setting the PRC1 bit in the PRCR register to “1” (w rite enable).
2.
Set the PM10 bit to “0” for Mask ROM version. For flash memory version, the PM10 bit controls w hether Block A is
enabled or disabled. When the PM10 bit is set to “1”, 0F000h to 0FFFFh can be used as internal ROM area.
I n addition, the PM10 bit i s automatically set to “1” w hile the FMR01 bit in the FMR0 register is set to “1” (CPU
rew rite mode).
3.
Effective when the PM01 to PM00 bits are set to “01b” (memory expansion mode) or “11b” (m icroprocessor
mode).
4.
PM12 bit is set to “1” by w riting a “1” in a program (writing a “0” has no effect).
5.
When PM17 bit is set to “1” (with wait state), one w ait state is inserted w hen accessing the internal RAM, or
internal ROM.
When PM17 bit is set to “1” and accesses an external area, set the CSiW bit in the CSR register (i=0 to 3) to “0”
(w ith w ait state).
6.
The PM13 bi t is automatically set to “1” w hen the FMR01 bit in the FMR0 register is “1” (CPU rew rite mode).
7.
The access area is changed by the PM13 bit as listed in the table below.
Access Area
I nternal
RAM
ROM
External
Up to Addresses 00400h to 03FF Fh (15 Kbytes)
Up to Addresses D0000h to FFFFFh (192 Kbytes)
Address 04000h to 07FFFh are usable
Address 80000h to CFFFFh are usable
PM13=0PM13=1
The entire area is usable
The entire area is usable
Address 04000h to 07FFFh are reserved
Address 80000h to CFFFFh are reserved
(Memory expansion mode)
RW
RW
RW
Figure 7.2PM1 Register
Rev.2.41Jan 10, 2006Page 57 of 390
REJ09B0185-0241
M16C/62P Group (M16C/62P, M16C/62PT)7. Processor Mode
1. For the mask ROM version, set the PM10 bit to “0” (08000h to 26FFFh for CS2 area).
2. If PM13 bit is set to “0”, 15 Kbytes of the internal RAM and 192 Kbytes of the internal ROM can be used.
Figure 7.3Memory Map in Single Chip Mode
Rev.2.41Jan 10, 2006Page 58 of 390
REJ09B0185-0241
M16C/62P Group (M16C/62P, M16C/62PT)8. Bus
8.Bus
Note
The M16C/62P (80-pin version) and M16C/62PT do not use bus control pins.
During memory expansion or microprocessor mode, some pins serve as the bus control pins to perform data input/
output to and from external devices. These bus control pins include A0 to A19, D0 to D15, CS0
WR
, WRH/BHE, ALE, RDY, HOLD, HLDA and BCLK.
8.1Bus Mode
The bus mode, either multiplexed or separate, can be selected using the PM05 to PM04 bits in the PM0 register.
Table 8.1 shows the Difference Between a Separate Bus and Multiplexed Bus.
8.1.1Separate Bus
In this bus mode, data and address are separate.
8.1.2Multiplexed Bus
In this bus mode, data and address are multiplexed.
to CS3, RD, WRL/
8.1.2.1When the input level on BYTE pin is high (8-bit data bus)
D0 to D7 and A0 to A7 are multiplexed.
8.1.2.2When the input level on BYTE pin is low (16-bit data bus)
D0 to D7 and A1 to A8 are multiplexed. D8 to D15 are not multiplexed. Do not use D8 to D15. External devices
connecting to a multiplexed bus are allocated to only the even addresses of the microcomputer. Odd
addresses cannot be accessed.
Table 8.1Difference Between a Separate Bus and Multiplexed Bus
Pin Name
P0_0 to P0_7/D0 to D7
P1_0 to P1_7/D8 to D15
P2_0/A0 (/D0/-)
P2_1 to P2_7/A1 to A7
(/D1 to D7/D0 to D6)
P3_0/A8 (/-/D7)
(1)
Separate Bus
D0 to D7(NOTE 2)(NOTE 2)
D8 to D15
A0A0 D0A0
A1 to A7A1 to A7 D1 to D7 A1 to A7 D0 to D6
A8A8A8 D7
BYTE = HBYTE = L
I/O Port
P1_0 to P1_7
Multiplex Bus
(NOTE 2)
NOTES:
1. See Table 8.6 Pin Functions for Each Processor Mode for bus control signals other than the
above. Setting Processor Modes.
2. It changes with a setup of PM05 to PM04, and area to access.
See Table 8.6 Pin Functions for Each Processor Mode for details.
Rev.2.41Jan 10, 2006Page 59 of 390
REJ09B0185-0241
M16C/62P Group (M16C/62P, M16C/62PT)8. Bus
8.2Bus Control
The following describes the signals needed for accessing external devices and the functionality of software wait.
8.2.1Address Bus
The address bus consists of 20 lines, A0 to A19. The address bus width can be chosen to be 12, 16 or 20 bits by
using the PM06 bit in the PM0 register and the PM11 bit in the PM1 register. Table 8.2 shows the PM06 and
PM11 Bits Set Value and Address Bus Width.
Table 8.2PM06 and PM11 Bits Set Value and Address Bus Width
Set Value
PM11=1P3_4 to P3_712 bits
PM06=1P4_0 to P4_3
PM11=0A12 to A1516 bits
PM06=1P4_0 to P4_3
PM11=0A12 to A1520 bits
PM06=0A16 to A19
NOTES:
1. No values other than those shown above can be set.
(1)
Pin FunctionAddress Bus Width
When processor mode is changed from single-chip mode to memory extension mode, the address bus is
indeterminate until any external area is accessed.
8.2.2Data Bus
When input on the BYTE pin is high (data bus is 8 bits wide), 8 lines D0 to D7 comprise the data b us; when
input on the BYTE pin is low(data bus is 16 bits wide), 16 lines D0 to D15 comprise the data bus.
Do not change the input level on the BYTE pin while in operation.
8.2.3Chip Select Signal
The chip select (hereafter referred to as the CSi) signals are output from the CSi (i = 0 to 3) pins. These pins
can be chosen to function as I/O ports or as CS
Figure 8.1 shows the CSR Register.
During 1-Mbyte mode, the external area can be separated into up to 4 by the CSi
CSi
pin. During 4-Mbyte mode, CSi signal or bank number is output from the CSi pin. Refer to 9. Memory
Space Expansion Function. Figure 8.2 shows the Example of Address Bus and CSi
mode.
by using the CSi bit in the CSR register.
signal which is output from the
Signal Output in 1-Mbyte
Rev.2.41Jan 10, 2006Page 60 of 390
REJ09B0185-0241
signal is used in the area indicated by CSi
(w ith w ait state).
I f the P M17 bit in the PM1 register is set to “1” (w ith w ait state), set the CSiW bit to “0” (with wait state).
2.
When the CSiW bit = 0 (with wait state), the number of wait states can be selected using the CSEi1W to CSEi0W bits
3.
in the CSE register.
Figure 8.1CSR Register
___
(i = 0 to 3) or the multiplex bus is used, set the CSiW bit to
Rev.2.41Jan 10, 2006Page 61 of 390
REJ09B0185-0241
M16C/62P Group (M16C/62P, M16C/62PT)8. Bus
Example 1
To access the external area indicated by CSj in the next cycle after
accessing the external area indicated by CSi
The address bus and the chip select signal both change state between
these two cycles.
Access to the external
area indicated by CSi
BCLK
Read signal
Data bus
Address bus
CSi
CSj
Example 3
To access the external area indicated by CSi in the next cycle after
accessing the external area indicated by the same CSi
Address
Access to the external
area indicated by CSj
Data
Data
Address
Example 2
To access the internal ROM or internal RAM in the next cycle after
accessing the external area indicated by CSi
The chip select signal changes state but the address bus does not
change state
Access to the external
area indicated by CSi
BCLK
Read signal
Data bus
Address bus
CSi
Example 4
Not to access any area (nor instruction prefetch generated) in the next cycle after
accessing the external area indicated by CSi
Address
Access to the internal
ROM or internal RAM
Data
The address bus changes state but the chip select signal does not
change state
Access to the external
area indicated by CSi
BCLK
Read signal
Data bus
Address bus
CSi
NOTES :
1. These examples show the address bus and chip select signal when accessing areas in two successive cycles. The chip select bus cycle
may be extended more than two cycles depending on a combination of these examples.
Shown above is the case where separate bus is selected and the area is accessed for read without wait states. i = 0 to 3, j = 0 to 3
(not including i, however)
Address
Access to the same
external area
Data
Data
Address
Neither the address bus nor the chip select signal changes state between
these two cycles
No access
Data
Address
BCLK
Read signal
Data bus
Address bus
CSi
Access to the external
area indicated by CSi
Figure 8.2Example of Address Bus and CSi Signal Output in 1-Mbyte mode
Rev.2.41Jan 10, 2006Page 62 of 390
REJ09B0185-0241
M16C/62P Group (M16C/62P, M16C/62PT)8. Bus
8.2.4Read and Write Signals
When the data bus is 16 bits wide, the read and write signals can be chosen to be a combination of RD, BHE
and WR or a combination of RD, WRL and WRH by using the PM02 bit in the PM0 register. When the data
bus is 8 bits wide, use a combination of RD
Table 8.3 shows the Operation of RD
and BHE
Signals.
, WR and BHE.
, WRL, and WRH Signals. Table 8.4 shows the Operation of RD, WRL,
Table 8.3Operation of RD
Data Bus Width
RD
16-bit
(BYTE pin input = L)
, WRL and WRH Signals
WRLWRHStatus of External Data Bus
LHHRead data
HLHWrite 1 byte of data to an even address
HHLWrite 1 byte of data to an odd address
HLLWrite data to both even and odd addresses
Table 8.4Operation of RD
Data Bus Width
16-bit
(BYTE pin input = L)
RD
HLLHWrite 1 byte of data to an odd address
LHLHRead 1 byte of data from an odd address
, WRL and BHE Signals
WRLBHE
A0Status of External Data Bus
HLHLWrite 1 byte of data to an even address
LHHLRead 1 byte of data from an even address
HLLLWrite data to both even and odd addresses
LHLLRead data from both even and odd addresses
8-bit
(BYTE pin input = H)
HLNot usedH or L Write 1 byte of data
LHNot usedH or L Read 1 byte of data
8.2.5ALE Signal
The ALE signal latches the address when accessing the multiplex bus space. Latch the address when the ALE
signal falls.
When BYTE Pin Input = HWhen BYTE Pin Input = L
ALE
A0/D0 to A7/D7
A8 to A19
NOTES :
1. If the entire CS space is assigned a multiplexed bus, these pins function as I/O ports.
AddressData
Address
(1)
Figure 8.3ALE Signal, Address Bus, Data Bus
Rev.2.41Jan 10, 2006Page 63 of 390
REJ09B0185-0241
ALE
A0
A1/D0 to A8/D7
A9 to A19
Address
AddressData
Address
M16C/62P Group (M16C/62P, M16C/62PT)8. Bus
8.2.6RDY Signal
This signal is provided for accessing external devices which need to be accessed at low speed. If input on the
RDY
pin is asserted low at the last falling edge of BCLK of the bus cycle, one wait state is inserted in the bus
cycle. While in a wait state, the following signals retain the state in which they were when the RDY
acknowledged.
signal was
A0 to A19, D0 to D15, CS0
to CS3, RD, WRL, WRH, WR, BHE, ALE, HLDA
Then, when the input on the RDY pin is detected high at the falling edge of BCLK, the remaining bus cycle is
executed. Figure 8.4 shows Example in which the Wait State was Inserted into Read Cycle by RDY
use the RDY
When not using the RDY
In an instance of separate bus
BCLK
RD
CSi
(i=0 to 3)
RDY
signal, set the corresponding bit (CS3W to CS0W bits) in the CSR register to “0” (with wait state).
signal, the RDY pin must be pulled-up.
tsu(RDY - BCLK)
Accept timing of RDY signal
Signal. To
In an instance of multiplexed bus
BCLK
RD
CSi
(i=0 to 3)
RDY
tsu(RDY - BCLK)
: Wait using RDY signal
: Wait using software
Shown above is the case where CSEi1W to CSEi0W (i = 0 to 3) bits in the CSE register are “00b” (one wait state).
Figure 8.4Example in which Wait State was Inserted into Read Cycle by RDY
Accept timing of RDY signal
Signal
Rev.2.41Jan 10, 2006Page 64 of 390
REJ09B0185-0241
M16C/62P Group (M16C/62P, M16C/62PT)8. Bus
8.2.7HOLD Signal
This signal is used to transfer control of the bus from the CPU or DMAC to an external circuit. When the input
on HOLD
finishes. The microcomputer remains in the hold state while the HOLD
HLDA
Table 8.5 shows the Microcomputer Status in Hold State.
Bus-using priorities are given to HOLD
CPU is accessing an odd address in word units, the DMAC cannot gain control of the bus during two separate
accesses.
pin is pulled low, the microcomputer is placed in a hold state after the bus access then in process
pin is held low, during which time the
pin outputs a low-level signal.
, DMAC, and CPU in order of decreasing precedence. However, if the
HOLD > DMAC > CPU
Figure 8.5Bus-Using Priori tie s
Table 8.5Microcompute r Status in Hold State
ItemStatus
BCLKOutput
A0 to A19, D0 to D15, CS0
WR
, BHE
I/O portsP0, P1, P3, P4
HLDA
Internal Peripheral CircuitsON (but watchdog timer stops)
ALE SignalUndefined
NOTES:
1. P11 to P14 are included in the 128-pin version.
2. When I/O port function is selected.
3. The watchdog timer dose not stop when the PM22 bit in the PM2 register is set to “1” (the count
source for the watchdog timer is the on-chip oscillator clock).
to CS3, RD, WRL,WRH,
P6 to P14
(1)
High-impedance
(2)
High-impedance
Maintains status when HOLD signal is received
Output “L”
(3)
8.2.88.2.8 BCLK Output
If the PM07 bit in the PM0 register is set to “0” (output enable), a clock with the same frequency as that of the
CPU clock is output as BCLK from the BCLK pin. Refer to 10.2 CPU Clock and Peripheral Function Clock.
Rev.2.41Jan 10, 2006Page 65 of 390
REJ09B0185-0241
M16C/62P Group (M16C/62P, M16C/62PT)8. Bus
Table 8.6Pin Functions for Each Processor Mode
Processor ModeMemory Expansion Mode or Microprocessor Mode
is for multiplexed bus and
PM05 to PM04 bits00b(separate bus) bits
01b(CS2
others are for separate bus)
10b(CS1 is for multiplexed bus and
others are for separate bus)
Data Bus Width BYTE
Pin
P0_0 to P0_7D0 to D7D0 to D7D0 to D7
P1_0 to P1_7I/O portsD8 to D15I/O portsD8 to D1 5
P2_0A0A0A0/D0
P2_1 to P2_7A1 to A7A1 to A7A1 to A7
P3_0A8A8A8A8/D7
8 bits
“H”
16 bits
“L”
8 bits
“H”
(2)
/D1 to D7
(4)
(2)
16 bits
“L”
D0 to D7
(4)
(4)
A0A0/D0
A1 to A7
/D0 to D6
(2)
(2)
P3_1 to P3_3A9 to A11I/O ports
P3_4 to
P3_7
P4_0 to
P4_3
PM11=0A12 to A15I/O ports
PM11=1I/O ports
PM06=0A16 to A19I/O ports
PM06=1I/O ports
P4_4CS0=0I/O ports
CS0=1
P4_5CS1=0
CS1=1
P4_6CS2=0
CS2=1
P4_7CS3=0
CS3=1
P5_0PM02=0
PM02=1
P5_1PM02=0
PM02=1
P5_2
P5_3
P5_4
P5_5
P5_6
CS0
I/O ports
CS1
I/O ports
CS2
I/O ports
CS3
WR
(3)
−
BHE
(3)
−
RD
BCLK
HLDA
HOLD
ALE
WRL−
WRH−
(3)
(3)
WRL
WRH
P5_7RDY
Memory
Expansion Mode
11b (multiplexed
bus for the entire
space)
(1)
8 bits
“H”
I/O ports
I/O ports
A1 to A7
/D1 to D7
A8
(3)
−
(3)
−
I/O ports : Function as I/O ports or peripheral function I/O pins.
NOTES:
1. To set the PM01 to PM00 bits are set to “01b” and the PM05 to PM04 bits are set to “11b” (multiplexed bus
assigned to the entire CS
pin is held “H” (= VCC1), do not rewrite the PM05 to PM04 bits to “11b” after reset. If the PM05 to PM04 bits are
set to “11b” during memory expansion mode, P3_1 to P3_7 and P4_0 to P4_3 become I/O ports, in which case
the accessible area for each CS
2. In separate bus mode, these pins serve as the address bus.
3. If the data bus is 8 bits wide, make sure the PM02 bit is set to “0” (RD, BHE, WR).
4. When accessing the area that uses a multiplexed bus, these pins output an indeterminate value during a write.
space), apply “H” to the BYTE pin (external data bus 8 bits wide). While the CNVSS
is 256 bytes.
Rev.2.41Jan 10, 2006Page 66 of 390
REJ09B0185-0241
M16C/62P Group (M16C/62P, M16C/62PT)8. Bus
8.2.9 External Bus Status When Internal Area Accessed
Table 8.7 shows the External Bus Status When Internal Area Accessed.
Table 8.7External Bus Status When Internal Area Accessed
ItemSFR AccessedInternal ROM, RAM Accessed
A0 to A19Address outputMaintain status before accessed
address of external area or SFR
D0 to D15When ReadHigh-impedanceHigh-impedance
When WriteOutput dataUndefined
RD
, WR, WRL, WRHRD, WR, WRL, WRH output
BHE
CS0
to CS3Output “H”
ALEOutput “L”Output “L”
BHE output
Output “H”
Maintain status before accessed status
of external area or SFR
Output “H”
Rev.2.41Jan 10, 2006Page 67 of 390
REJ09B0185-0241
M16C/62P Group (M16C/62P, M16C/62PT)8. Bus
_
_
_
_
8.2.10Software Wait
Software wait states can be inserted by using the PM17 bit in the PM1 register, the CS0W to CS3W bits in the
CSR register, and the CSE register. The SFR area is unaffected by these control bits. This area is always
accessed in 2 BCLK or 3 BCLK cycles as determined by the PM20 bit in the PM2 register. See Table 8.8 Bitand Bus Cycle Related to Software Wait for details.
T o use the RDY
CSE Register. Table 8.8 shows the Bit and Bus Cycle Related to Software Wait. Figure 8.7 and 8.8 show the
T ypical Bus Timings Using Software Wait.
Chip S el ec t E xpansion Control Regi st er
b3 b2 b1 b0b7 b6 b5 b4
NOTES :
Set the CSiW bit (i = 0 to 3) in the CSR register to “0” (with wait state) before w riting to the CSEi1W to CSEi0W bits.
1.
I f the CSiW bit needs to be set to “1” (w ithout wait state), set the CSEi1W to CSEi 0W bits to “00b” before setting it.
signal, set the corresponding CS3W to CS0W bit to “0” (with wait state). Figure 8.6 shows the
Symbol
CSE
Bit SymbolFunctionRW
____
CS0
Wait Expansion Bit
CSE01W
____
CS1
CSE10W
Wait Expansion Bit
CSE11W
____
Wait Expansion Bit
CSE20W
CS2
CSE21W
____
Wait Expansion Bit
CSE30W
CS3
CSE31W
AddressAfter Reset
001Bh00h
Bit Name
(1)
b1 b0
0 0 : 1 w ait
0 1 : 2 w aits
1 0 : 3 w aits
1 1 : Do not set
(1)
b3 b2
0 0 : 1 w ait
0 1 : 2 w aits
1 0 : 3 w aits
1 1 : Do not set
(1)
b5 b4
0 0 : 1 w ait
0 1 : 2 w aits
1 0 : 3 w aits
1 1 : Do not set
(1)
b7 b6
0 0 : 1 w ait
0 1 : 2 w aits
1 0 : 3 w aits
1 1 : Do not set
RWCSE00W
RW
RW
RW
RW
RW
RW
RW
Figure 8.6CSE Register
Rev.2.41Jan 10, 2006Page 68 of 390
REJ09B0185-0241
M16C/62P Group (M16C/62P, M16C/62PT)8. Bus
Table 8.8Bit and Bus Cycle Related to Software Wait
AreaBus Mode
SFR
Internal
RAM,
ROM
External
Area
Separate
Bus
Multiplexed
Bus
CSR Register
(5)
CS3W Bit
CS2W Bit
CS1W Bit
CS0W Bit
PM2
Register
PM20 Bit
−1−−−−2 BCLK cycles
−0−−−−3 BCLK cycles
−−0−−No wait1 BCLK cycle
−−1−−1 wait2 BCLK cycles
−0100bNo wait1 BCLK cycle
−−000b1 wait2 BCLK cycle
−−001b2 waits3 BCLK cycles
−−010b3 waits4 BCLK cycle
−1000b1 wait2 BCLK cycle
(2)
−−000b1 wait3 BCLK cycles
−−001b2 waits3 BCLK cycles
−−010b3 waits4 BCLK cycles
−1000b1 wait3 BCLK cycles
PM1
Register
PM17 Bit
(1)
(1)
(1)
(1)
CSE Register
CSE31W to CSE30W Bit
CSE21W to CSE20W Bit
CSE11W to CSE10W Bit
CSE01W to CSE00W Bit
Software
Wait
Bus Cycle
(3)
(3)
(4)
(read)
2 BCLK cycles
(write)
(4)
NOTES:
1. To use the RDY
signal, set this bit to “0”.
2. To access in multiplexed bus mode, set the corresponding bit of CS0W to CS3W to “0” (with wait
state).
3. When the selected CPU clock source is the PLL clock, the number of wait cycles can be altered by
the PM20 bit in the PM2 register. When using a 16 MHz or higher PLL clock, be sure to set the
PM20 bit to “0” (2 wait cycles).
4. After reset, the PM17 bit is set to “0” (without wait state), all of the CS0W to CS3W bits are set to “0”
(with wait state), and the CSE register is set to “00h” (one wait state fo r CS0
to CS3). Therefore, the
internal RAM and internal ROM are accessed with no wait states, and all external areas are
accessed with one wait state.
5. When PM17 bit is set to “1” and accesses an exter nal area, set the CSiW (i=0 to 3) bits to “0” (with
wait state).
Rev.2.41Jan 10, 2006Page 69 of 390
REJ09B0185-0241
M16C/62P Group (M16C/62P, M16C/62PT)8. Bus
(1) Separate Bus, No Wait Setting
BCLK
Write signal
Read signal
Bus cycle
(1)
Bus cycle
(1)
Address bus
(2) Separate Bus, 1-Wait Setting
Write signal
Read signal
Address bus
(3) Separate Bus, 2-Wait Setting
Data bus
CS
BCLK
Data bus
CS
Output
AddressAddress
Bus cycle
(1)
Output
Address
Bus cycle
(1)
Input
Bus cycle
Address
(1)
Input
Bus cycle
(1)
BCLK
Write signal
Read signal
Data bus
Address bus
Address
CS
NOTES :
1. These example timing charts indicate bus cycle length. After this bus cycle sometimes come read and write cycles in
succession.
Figure 8.7Typical Bus Timings Using Software Wait (1)
Rev.2.41Jan 10, 2006Page 70 of 390
REJ09B0185-0241
Output
Input
Address
M16C/62P Group (M16C/62P, M16C/62PT)8. Bus
(1) Separate Bus, 3-Wait Setting
BCLK
Write signal
Read signal
Bus cycle
(1)
Bus cycle (1)
Data bus
Address bus
CS
(2) Multiplexed Bus, 1- or 2-Wait Setting
BCLK
Write signal
Read signal
ALE
Address bus
Address bus/
Data bus
CS
(3) Multiplexed Bus, 3-Wait Setting
Address
Bus cycle
Address
Data output
Bus cycle
Address
(1)
(1)
Output
Address
Bus cycle
Address
(1)
Input
Bus cycle
Input
Address
(1)
BCLK
Write signal
Read signal
ALE
Address bus
Address bus/
Data bus
Address
Address
Data output
CS
NOTES :
1. These example timing charts indicate bus cycle length. After this bus cycle sometimes come read and write cycles in
succession.
Figure 8.8Typical Bus Timings Using Software Wait (2)
Rev.2.41Jan 10, 2006Page 71 of 390
REJ09B0185-0241
Address
Address
Input
M16C/62P Group (M16C/62P, M16C/62PT)9. Memory Space Expansion Function
9.Memory Space Expansion Function
Note
The M16C/62P (80-pin version) and M16C/62PT do not use the memory space expansion function.
The following describes a memory space extension function.
During memory expansion or microprocessor mode, the memory space expansion function allows the access space to
be expanded using the appropriate register bits.
Table 9.1 shows The Way of Setting Memory Space Expansion Function, Memory Space.
Table 9.1The Way of Setting Memory Space Expansion Function, Memory Space
Memory Space Expansion FunctionHow to Set (PM15 to PM14)Memory Space
1-Mbyte Mode00b1 Mbyte (no expansion)
4-Mbyte Mode11b4 Mbytes
9.11-Mbyte Mode
In this mode, the memory space is 1 Mbytes. In 1-Mbyte mode, the external area to be accessed is specified using
the CSi
(i = 0 to 3) signals (hereafter referred to as the CSi area). Figures 9.2 to 9.3 show the Memory Mapping and
CS
Area in 1-Mbyte mode.
9.24-Mbyte Mode
In this mode, the memory space is 4 Mbytes. Figure 9.1 shows the DBR Register. The BSR2 to BSR0 bits in the
DBR register select a bank number which is to be accessed to read or write data. Setting the OFS bit to “1” (with
offset) allows the accessed address to be offset by 40000h.
In 4-Mbyte mode, the CSi
(i=0 to 3) pin functions differently for each area to be accessed.
9.2.19.2.1 Addresses 04000h to 3FFFFh, C0000h to FFFFFh
•The CSi signal is output from the CSi pin (same operation as 1-Mbyte mode. Howe ver, the last address of
CS1
area is 3FFFFh).
9.2.29.2.2 Addresses 40000h to BFFFFh
•The CS0 pin outputs “L”
•The CS1 to CS3 pins output the value of setting as the BSR2 to BSR0 bits (bank number)
Figures 9.4 to 9.5 show the Memory Mapping and CS
areas. Locate the program in bank 7 or the CSi
Area in 4-Mbyte mode. Note that banks 0 to 6 are data-only
area.
Rev.2.41Jan 10, 2006Page 72 of 390
REJ09B0185-0241
M16C/62P Group (M16C/62P, M16C/62PT)9. Memory Space Expansion Function
Data Bank Register
b7 b6 b5 b4 b3 b2 b1 b0
NOTES :
1.
Effective when the PM01 to PM00 bits in the PM0 register are set to “01b” (memory expansion mode) or “11b”
(microprocessor mode).
(1)
SymbolAddressAfter Reset
DBR
Bit SymbolBit NameRW
—
(b1-b0)
OFS
BSR0RW
BSR1RW
BSR2RW
—
(b7-b6)
Figure 9.1DBR Register
000Bh00h
Nothing is assigned. When write, set to “0”.
When read, their contents are “0”.
Offset Bit
Bank Selection Bits
Nothing is assigned. When write, set to “0”.
When read, their contents are “0”.
0 : Not offset
1 : Offset
b5 b4 b3
0 0 0 : Bank 0
0 1 0 : Bank 2
1 0 0 : Bank 4
1 1 0 : Bank 6
Function
—
RW
b5 b4 b3
0 0 1 : Bank 1
0 1 1 : Bank 3
1 0 1 : Bank 5
1 1 1 : Bank 7
—
Rev.2.41Jan 10, 2006Page 73 of 390
REJ09B0185-0241
M16C/62P Group (M16C/62P, M16C/62PT)9. Memory Space Expansion Function
Other than the CS area (Memory expansion mode:256 Kbytes X 8 banks)*
*Two 256 Kbytes X 8 banks can be used by changing the offset.
Other than the CS area(Microprocessor mode : 512 Kbytes X 8 banks)
CS0 (Microprocessor mode : 256 Kbytes)
CS1
28000h to
3FFFFh
External area
CS2
When PM10=0
08000h to 26FFFh
When PM10=1
10000h to 26FFFh
CS3
No area
Other than the CS area
Memory expansion mode
40000h to 7FFFFh
Microprocessor mode
40000h to BFFFFh
(1)
Figure 9.5Memory Mapping and CS Area in 4-Mbyte mode (PM13=1)
Rev.2.41Jan 10, 2006Page 77 of 390
REJ09B0185-0241
M16C/62P Group (M16C/62P, M16C/62PT)9. Memory Space Expansion Function
Figure 9.6 shows the External Memory Connect Example in 4-Mbyte Mode.
In this example, the CS
address input AD21, AD20 and AD19 pins are connected to the CS3
pin of 4-Mbyte ROM is connected to the CS0 pin of microcomputer. The 4 Mbyte ROM
, CS2 and CS1 pins of microcomputer,
respectively. The address input AD18 pin is connected to the A19 pin of microcomputer. Figures Figure 9.7 to 9.9
show the Relationship of Addresses Between the 4-Mbyte ROM and the Microcomputer for the Case of a
Connection Example in Figure 9.6.
In microprocessor mode, or in memory expansion mode where the PM13 bit in th e PM1 register is “0”, banks are
located every 512 Kbytes. Setting the OFS bit in the DBR register to “1” (offset) allows the accessed address to be
offset by 40000h, so that even the data overlapping a bank boundary can be accessed in succession.
In memory expansion mode where the PM13 bit is “1,” each 512-Kbyte bank can be accessed in 256 Kbyte units
by switching them over with the OFS bit.
Because the SRAM can be accessed on condition that the chip select signals S2 = H and S1 =L, CS0
be connected to S2 and S1
active chip select signals(S1
, respectively. If the SRAM does not have the input pins to accept “H” active and “L”
, S2), CS0 and CS2 should be decoded external to the chip.
and CS2 can
D0 to D7
A0 to A16
A17
A19
CS1
CS2
CS3
Microcomputer
RD
CS0
WR
8
17
DQ0 to DQ7
AD0 to AD16
AD17
AD18
AD19
AD20
AD21
OE
CS
DQ0 to DQ7
AD0 to AD16
OE
S2
(1)
S1
W
NOTES:
1. If only one chip select pin (S1 or S2) is present,
decoding by use of an external circuit is requir ed.
Figure 9.6External Memory Connect Example in 4-Mbyte Mode
4M bytes ROM
128K bytes SRAM
Rev.2.41Jan 10, 2006Page 78 of 390
REJ09B0185-0241
M16C/62P Group (M16C/62P, M16C/62PT)9. Memory Space Expansion Function
Figure 9.9Relationship Between Addresses on 4-Mbyte ROM and Those on Microcomputer (3)
Rev.2.41Jan 10, 2006Page 81 of 390
REJ09B0185-0241
M16C/62P Group (M16C/62P, M16C/62PT)10. Clock Generation Circuit
10. Clock Generation Circuit
10.1Types of the Clock Generation Circuit
4 circuits are incorporated to generate the system clock signal :
•Main clock oscillation circuit
•Sub clock oscillation circuit
•On-chip oscillator
•PLL frequency synthesizer
Table 10.1 lists the Clock Generation Circuit Specifications. Figure 10.1 shows the Clock Generation Circuit.
Figures 10.2 to 10.6 show the clock-related registers.
Table 10.1Clock Generation Circuit Specifications
Item
Use of Clock• CPU clock source
Clock Frequency0 to 16 MHz32.768 kHzAbout 1 MHz10 to 24MHz
Usable Oscillator• Ceramic oscillator
Pins to Connect
Oscillator
Oscillation Stop,
Restart Function
Oscillator Status
After Reset
OtherExternally derived clock can be input−−
Main Clock
Oscillation Circuit
• Peripheral function
clock source
• Crystal oscillator
XIN, XOUTXCIN, XCOUT−−
PresencePresencePresencePresence
OscillatingStoppedStoppedStopped
Sub Clock
Oscillation Circuit
• CPU clock source
• Timer A, B's clock
source
• Crystal oscillator−−
On-chip oscillator
• CPU clock source
• Peripheral function clock
source
• CPU and peripheral
function
clock sources when the
main clock stops
oscillating
PLL frequency
synthesizer
• CPU clock source
• Peripheral function
clock source
Rev.2.41Jan 10, 2006Page 82 of 390
REJ09B0185-0241
M16C/62P Group (M16C/62P, M16C/62PT)10. Clock Generation Circuit
CM04
CM10=1(stop mode)
WAIT instruction
RESET
Software reset
NMI
Interrupt request level judgment output
CM02, CM04, CM05, CM06, CM07: Bits in CM0 register
CM10, CM11, CM16, CM17: Bits in CM1 register
PCLK0, PCLK1: Bits in PCLKR register
CM21, CM27 : Bits in CM2 register
Rev.2.41Jan 10, 2006Page 83 of 390
REJ09B0185-0241
M16C/62P Group (M16C/62P, M16C/62PT)10. Clock Generation Circuit
Sy st em Clock Cont rol Regis ter 0
b7 b6 b5 b4 b3 b2 b1 b0
SymbolAddressAfter Reset
CM0
Bit SymbolBit NameFunctionRW
CM00RW
CM01RW
CM02
CM03
CM04
CM05
CM06
CM07
NOTES :
1.
Rewrite this register after setting the PRC0 bit in the PRCR register to “1” (w rite enable).
The CM03 bit i s set to “1” (high) while the CM04 bit is set to “0” (I /O port) or w hen entering stop mode.
2.
Thi s bit is provided to stop the main clock when the low pow er consumptio n mode or on-chip oscillator low pow er
3.
dissipation mode is selected. This bit cannot be used for detection as to whether the main clock stops or not. To
stop the main clock, set bits as follows:
(a) Set the CM07 bit to “1” (sub clock selected) or the CM21 bit in the CM2 register to “1” (On-chip oscillator
selected)
with the sub-clock stably oscillates.
(b) Set the CM20 bit in the CM2 register to “0” (Oscillation stop, re-oscillation detection function disabled).
(c) Set the CM05 bit to “1” (S top).
During external clock input, Set the CM05 bit to “0” (oscillate).
4.
When CM05 bit is set to “1”, the XOUT pin is held “H ”. Because the internal feedback resistor rem ains connected, the
5.
XIN pin is pulled “H” to the same level as XOUT via the feedback resistor.
6.
After setting the CM04 bit to “1” (XCIN-XCOUT oscillator function), w ait until the sub-clock oscillates stably before
sw itching the CM07 bit from “0” to “1” (sub-clock).
7.
When entering stop mode from high-speed or middle-speed mode, on-chip oscillator m ode or on-chip oscillator low
power mode, the CM06 bit is set to “1” (divide-by-8 mode).
8.
The fC32 clock does not stop. In low-speed mode or low power consumption mode, do not set this bit to “1”
(peripheral clock stops in wait mode).
To use a sub-clock, set this bit to “1”. Also make sure ports P8_ 6 and P8_7 are directed for input, with no pull -ups.
9.
When the PM21 bit i n the PM2 register is set to “1” (disable clock modification), this bit rem ains unchanged even if
10.
writing to the CM02, CM05, and CM07 bits.
11.
When setting the PM21 bit to “1”, set the CM07 bit to “0” (main clock) before setting the PM21 bit to “1”.
12.
To use the main clock as the clock source for the CPU clock, set bits as follows.
(a) Set the CM05 bit to “0” (oscillate).
(b) Wait the main clock oscillation stabilizes.
(c) Set the CM11, CM21 and CM07 bits to “0”.
13.
When the CM21 bit is set to “0” (on-chip oscillator stops) and the CM05 bit is set to “1” (main clock stops), the CM06
bit is fixed to “1” (divide-by-8 mode) and the CM15 bit is fixed to “1” (drive capacity Hi gh).
14.
To return from on-chip oscillator mode to high-speed or middle-speed mode, set the CM06 and CM15 bits to “1”.
Clock Output Function
Select Bit
(Valid only in single-chip
mode)
wait mode
1 : Peripheral function clock stops in wait
m ode
(2)
(2)
0 : LOW
1 : HIGH
0 : I/O ports P8_6, P8_7
(8)
1 : XCIN-XCOU T oscillation function
0 : On
(4, 5)
1 : Off
(7, 13, 14)
0 : CM16 and CM17 enabled
1 : Division-by-8 m ode
0 : Main clock, PLL clock, or on-chip oscillator clock
1 : Sub clock
RW
RW
(9)
RW
RW
RW
RW
Figure 10.2CM0 Register
Rev.2.41Jan 10, 2006Page 84 of 390
REJ09B0185-0241
M16C/62P Group (M16C/62P, M16C/62PT)10. Clock Generation Circuit
Sys tem Clock Cont rol Regi st er 1
b3 b2 b1 b0b7 b6 b5 b4
000
SymbolAddressAfter Reset
CM1
(1)
0007h00100000b
Bit SymbolBit NameFunctionR W
CM10
CM11
—
All Clock Stop Control Bit
System Clock Select Bit 1
Reserved BitSet to “0”
(4, 6)
(6, 7)
0 : Clock on
1 : All clocks off (stop mode)
0 : Main clock
1 : PLL clock
(5)
(b4-b2)
CM15
CM16RW
XIN-XOU T Drive Capacity
Select Bit
(2)
Main Clock Division Select Bit 1
0 : LOW
1 : HIGH
(3)
b7 b6
0 0 : No division mode
0 1 : Divide-by-2 mode
CM17RW
1 0 : Divide-by-4 mode
1 1 : Divide-by-16 mode
NOTES :
1.
Rewrite this register after setting the PR C0 bit in the PR CR register to “1” (w rite enable).
2.
When entering stop mode from high-speed or middle-speed mode, or the CM05 bit is set to “1” (main clock stops) in
low speed mode, the CM15 bit is set to “1” (drive capacity high).
3.
Thi s bit is valid when the C M06 bit is set to “0” (CM16 and CM17 bits enabled).
4.
I f the CM10 bit is set to “1” (stop mode), XOUT is held “H” and the internal feedback resistor is disconnected. The
XCI N and XCOUT pins are in high-impe dance state. When the CM11 bit is set to “1” (PLL clock), or the CM20 bit in the
CM2 register is set to “1” (oscillation stop, re-oscillation detection function enabled), do not set the CM10 bit to “1”.
After setting the PLC07 bit in the PLC0 register to “1” (P LL operation), wait tsu (PLL) elapses before setting the CM11
5.
bit to “1” (PLL clock).
When the PM21 bit in the PM2 register is set to “1” (disable clock modification), this bit remai ns unchanged even if
6.
writing to the CM10, CM11 bits.
When the PM22 bit in the PM2 register is set to “1” (on-chip oscillator clock is selected as watchdog timer count
source), this bit remains unchanged even if w riti ng to the CM10 bit.
Thi s bit is valid when the CM07 bit is set to “0” and the CM21 bit is set to “0”.
7.
RW
RW
RW
RW
Figure 10.3CM1 Register
Rev.2.41Jan 10, 2006Page 85 of 390
REJ09B0185-0241
Loading...
+ hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.