Before using this material, please visit our website to verify that this is the most
updated document available.
Rev. 2.00
Revision date: Nov. 28, 2005
www.renesas.com
Keep safety first in your circuit designs!
•
Renesas Technology Corporation 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
• These materials are intended as a reference to assist our customers in the selection of the
Renesas Technology Corporation 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 Corporation or a third party.
• Renesas Technology Corporation 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.
• 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 Corporation without notice
due to product improvements or other reasons. It is therefore recommended that customers contact Renesas Technology Corporation or an authorized Renesas Technology Corporation 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 Corporation 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 Corporation by
various means, including the Renesas Technology Corporation Semiconductor home page
(http://www.renesas.com).
• 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 Corporation assumes no responsibility for any damage, liability or other loss resulting from the information contained herein.
• Renesas Technology Corporation 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 Corporation or an authorized Renesas
Technology Corporation 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.
• The prior written approval of Renesas Technology Corporation is necessary to reprint or
reproduce in whole or in part these materials.
• 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.
• Please contact Renesas Technology Corporation 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 the M16C/6N Group (M16C/6NK, M16C/6NM) 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
00
Symbol
XXX
XXX
(b2)
(b4-b3)
*1
Symbol
XXX
Bit
0
1
-
-
Bit Name
XXX Bit
Nothing is assigned. When write, set to "0",
When read, its content is indeterminate.
Reserved BitSet to "0"
Address
XXX
Function
b1b0
0 0: XXX
0 1: XXX
1 0: Do not set a value
1 1: XXX
After Reset
00h
*5
RW
RW
RW
WO
*2
*3
*4
XXX5
XXX
XXX
XXX Bit
6
7
XXX Bit
Function varies depending on
mode of operation
0: XXX
1: XXX
*1
Blank:Set to “0” or “1” according to the application
0 :Set to “0”
1 :Set to “1”
X :Nothing is assigned
*2
RW : Read and write
RO : Read only
WO: Write only
–: Nothing is assigned
*3
• Reserved bit
Reserved bit. Set to specified value.
*4
• Nothing is assigned
Nothing is assigned to the bit concerned. As the bit may be use for future functions, set to “0” when
writing to this bit.
• Do not set to this value
The operation is not guaranteed when a value is set.
• Function varies depending on mode of operation
Bit function varies depending on peripheral function mode.
Refer to respective register for each mode.
*5
Follow the text in each manual for binary and hexadecimal notations.
RW
RW
RO
3. M16C Family Documents
The following documents were prepared for the M16C family
DocumentContents
Short SheetHardware overview
Data SheetHardware overview and electrical characteristics
1.4 Product List ..................................................................................................................................................5
2.5 Program Counter (PC) ...............................................................................................................................17
2.7 Static Base Register (SB) .......................................................................................................................... 17
2.8 Flag Register (FLG) ................................................................................................................................... 17
2.8.1 Carry Flag (C Flag) ............................................................................................................................ 17
2.8.2 Debug Flag (D Flag) .......................................................................................................................... 17
2.8.3 Zero Flag (Z Flag) ..............................................................................................................................17
2.8.4 Sign Flag (S Flag) ..............................................................................................................................17
2.8.5 Register Bank Select Flag (B Flag).................................................................................................... 17
2.8.6 Overflow Flag (O Flag)....................................................................................................................... 17
2.8.7 Interrupt Enable Flag (I Flag) .............................................................................................................17
2.8.8 Stack Pointer Select Flag (U Flag)..................................................................................................... 17
2.8.10 Reserved Area .................................................................................................................................17
5.5 Internal Space ............................................................................................................................................ 37
7. Bus ......................................................................................................................................45
7.1 Bus Mode ................................................................................................................................................... 45
7.1.1 Separate Bus ..................................................................................................................................... 45
7.2 Bus Control ................................................................................................................................................ 46
7.2.1 Address Bus ....................................................................................................................................... 46
7.2.2 Data Bus ............................................................................................................................................ 46
7.2.4 Read and Write Signals ..................................................................................................................... 48
7.2.5 ALE Signal ......................................................................................................................................... 48
________
7.2.6 RDY Signal ........................................................................................................................................49
7.2.7 HOLD Signal ......................................................................................................................................50
7.2.9 External Bus Status When Internal Area Accessed ...........................................................................52
8.1 Types of Clock Generating Circuit .............................................................................................................. 56
8.1.1 Main Clock ......................................................................................................................................... 64
8.1.2 Sub Clock........................................................................................................................................... 65
8.2 CPU Clock and Peripheral Function Clock ................................................................................................ 68
8.2.1 CPU Clock and BCLK ........................................................................................................................68
8.2.2 Peripheral Function Clock .................................................................................................................. 68
8.3 Clock Output Function ............................................................................................................................... 68
8.4 Power Control ............................................................................................................................................ 69
8.4.1 Normal Operation Mode..................................................................................................................... 69
10.1 Type of Interrupts ..................................................................................................................................... 81
10.3.1 Special Interrupts .............................................................................................................................83
10.3.2 Peripheral Function Interrupts.......................................................................................................... 83
10.4 Interrupts and Interrupt Vector .................................................................................................................84
10.5 Interrupt Control .......................................................................................................................................86
10.5.1 I Flag ................................................................................................................................................88
10.5.2 IR Bit ................................................................................................................................................ 88
10.5.3 ILVL2 to ILVL0 Bits and IPL ............................................................................................................. 88
10.6 INT Interrupt ............................................................................................................................................. 94
12.1 Transfer Cycle ........................................................................................................................................ 108
12.1.1 Effect of Source and Destination Addresses .................................................................................. 108
12.1.2 Effect of BYTE Pin Level................................................................................................................ 108
12.1.3 Effect of Software Wait................................................................................................................... 108
________
12.1.4 Effect of RDY Signal ...................................................................................................................... 108
12.2 DMA Transfer Cycles ............................................................................................................................. 110
13.1 Timer A ................................................................................................................................................... 115
16.2 Function ................................................................................................................................................. 216
16.2.1 Resolution Select Function ............................................................................................................ 216
16.2.2 Sample and Hold ........................................................................................................................... 216
16.2.3 Extended Analog Input Pins........................................................................................................... 216
19.4 CAN SFR Registers ...............................................................................................................................228
19.5.1 CAN Reset/Initialization Mode ....................................................................................................... 234
19.5.2 CAN Operation Mode..................................................................................................................... 235
19.5.3 CAN Sleep Mode ........................................................................................................................... 235
19.5.4 CAN Interface Sleep Mode ............................................................................................................ 235
19.5.5 Bus Off State.................................................................................................................................. 236
19.6 Configuration CAN Module System Clock ............................................................................................. 237
19.7 Bit Timing Configuration ......................................................................................................................... 237
19.8.1 Calculation of Bit-rate..................................................................................................................... 238
19.9 Acceptance Filtering Function and Masking Function............................................................................239
19.10 Acceptance Filter Support Unit (ASU)..................................................................................................240
19.11 Basic CAN Mode ..................................................................................................................................241
19.12 Return from Bus Off Function .............................................................................................................. 242
19.13 Time Stamp Counter and Time Stamp Function ..................................................................................242
19.16 CAN Interrupt .......................................................................................................................................246
21.3.6 Data Protect Function .................................................................................................................... 278
21.3.7 Status Register (SRD Register) .....................................................................................................278
21.3.8 Full Status Check ........................................................................................................................... 280
21.4 Standard Serial I/O Mode ...................................................................................................................... 282
21.4.1 ID Code Check Function ................................................................................................................ 282
21.4.2 Example of Circuit Application in Standard Serial I/O Mode .......................................................... 286
23.1 External Bus ........................................................................................................................................... 339
23.4 PLL Frequency Synthesizer ...................................................................................................................341
23.5 Power Control ........................................................................................................................................ 342
23.6 Oscillation Stop, Re-oscillation Detection Function ............................................................................... 344
23.8.5 INT Interrupt ................................................................................................................................... 347
23.8.6 Rewrite Interrupt Control Register ................................................................................................. 348
23.10.1 Timer A ......................................................................................................................................... 350
23.11 Thee-Phase Motor Control Timer Function ..........................................................................................356
23.12 Serial Interface ..................................................................................................................................... 357
23.12.1 Clock Synchronous Serial I/O Mode ............................................................................................357
23.12.2 Special Modes ............................................................................................................................. 358
23.14 CAN Module ......................................................................................................................................... 362
23.18 Mask ROM Version ............................................................................................................................. 370
23.19 Flash Memory Version .........................................................................................................................371
23.20 Flash Memory Programming Using Boot Program .............................................................................. 373
CAN0/1 Wake-up Interrupt Control Register
CAN0 Successful Reception Interrupt Control Register
CAN0 Successful Transmission Interrupt Control Register
INT3 Interrupt Control Register
Timer B5 Interrupt Control Register
SI/O5 Interrupt Control Register
Timer B4 Interrupt Control Register
UART1 Bus Collision Detection Interrupt Control Register
Timer B3 Interrupt Control Register
UART0 Bus Collision Detection Interrupt Control Register
CAN1 Successful Reception Interrupt Control Register
SI/O4 Interrupt Control Register
INT5 Interrupt Control Register
CAN1 Successful Transmission Interrupt Control Register
SI/O3 Interrupt Control Register
INT4 Interrupt Control Register
UART2 Bus Collision Detection Interrupt Control Register
DMA0 Interrupt Control Register
DMA1 Interrupt Control Register
CAN0/1 Error Interrupt Control Register
A/D Conversion Interrupt Control Register
Key Input Interrupt Control Register
UART2 Transmit Interrupt Control Register
UART2 Receive Interrupt Control Register
UART0 Transmit Interrupt Control Register
UART0 Receive Interrupt Control Register
UART1 Transmit Interrupt Control Register
UART1 Receive Interrupt Control Register
Timer A0 Interrupt Control Register
Timer A1 Interrupt Control Register
Timer A2 Interrupt Control Register
INT7 Interrupt Control Register
Timer A3 Interrupt Control Register
INT6 Interrupt Control Register
Timer A4 Interrupt Control Register
Timer B0 Interrupt Control Register
SI/O6 Interrupt Control Register
Timer B1 Interrupt Control Register
INT8 Interrupt Control Register
Timer B2 Interrupt Control Register
INT0 Interrupt Control Register
INT1 Interrupt Control Register
INT2 Interrupt Control Register
Three-Phase PWM Control Register 0
Three-Phase PWM Control Register 1
Three-Phase Output Buffer Register 0
Three-Phase Output Buffer Register 1
Dead Time Timer
Timer B2 Interrupt Occurrence Frequency Set Counter
Interrupt Cause Select Register 2
Timer B3 Register
Timer B4 Register
Timer B5 Register
SI/O6 Transmit/Receive Register
SI/O6 Control Register
SI/O6 Bit Rate Generator
SI/O3, 4, 5, 6 Transmit/Receive Register
Timer B3 Mode Register
Timer B4 Mode Register
Timer B5 Mode Register
Interrupt Cause Select Register 0
Interrupt Cause Select Register 1
SI/O3 Transmit/Receive Register
SI/O3 Control Register
SI/O3 Bit Rate Generator
SI/O4 Transmit/Receive Register
SI/O4 Control Register
SI/O4 Bit Rate Generator
SI/O5 Transmit/Receive Register
SI/O5 Control Register
SI/O5 Bit Rate Generator
UART0 Special Mode Register 4
UART0 Special Mode Register 3
UART0 Special Mode Register 2
UART0 Special Mode Register
UART1 Special Mode Register 4
UART1 Special Mode Register 3
UART1 Special Mode Register 2
UART1 Special Mode Register
UART2 Special Mode Register 4
UART2 Special Mode Register 3
UART2 Special Mode Register 2
UART2 Special Mode Register
UART2 Transmit/Receive Mode Register
UART2 Bit Rate Generator
UART2 Transmit Buffer Register
UART2 Transmit/Receive Control Register 0
UART2 Transmit/Receive Control Register 1
A/D Control Register 0
A/D Control Register 1
D/A Register 0
D/A Register 1
D/A Control Register
Port P14 Control Register
Pull-Up Control Register 3
Port P0 Register
Port P1 Register
Port P0 Direction Register
Port P1 Direction Register
Port P2 Register
Port P3 Register
Port P2 Direction Register
Port P3 Direction Register
Port P4 Register
Port P5 Register
Port P4 Direction Register
Port P5 Direction Register
Port P6 Register
Port P7 Register
Port P6 Direction Register
Port P7 Direction Register
Port P8 Register
Port P9 Register
Port P8 Direction Register
Port P9 Direction Register
Port P10 Register
Port P11 Register
Port P10 Direction Register
Port P11 Direction Register
Port P12 Register
Port P13 Register
Port P12 Direction Register
Port P13 Direction Register
Pull-up Control Register 0
Pull-up Control Register 1
Pull-up Control Register 2
Port Control Register
This document is under development and its contents are subject to change
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Nov 28, 2005
1. Overview
The M16C/6N Group (M16C/6NK, M16C/6NM) of single-chip microcomputers are built using the
high-performance silicon gate CMOS process using an M16C/60 Series CPU core and are packaged in
100-pin and 128-pin plastic molded LQFP. These single-chip microcomputers operate using sophisticated
instructions featuring a high level of instruction efficiency. With 1 Mbyte of address space, they are capable
of executing instructions at high speed. Being equipped with two CAN (Controller Area Network) modules in
M16C/6N Group (M16C/6NK, M16C/6NM), the microcomputer is suited to car audio and industrial control
systems. The CAN modules comply with the 2.0B specification. In addition, this microcomputer contains a
multiplier and DMAC which combined with fast instruction processing capability, makes it suitable for control
of various OA and communication equipment which requires high-speed arithmetic/logic operations.
1.1 Applications
• Car audio and industrial control systems, other (Normal-ver. product)
• Automotive, industrial control systems and other automobile, other (T/V-ver. product)
Rev.2.00
Rev.2.00 Nov 28, 2005 page 1 of 378
REJ09B0124-0200
Under development
This document is under development and its contents are subject to change.
M16C/6N Group (M16C/6NK, M16C/6NM)1. Overview
1.2 Performance Outline
Tables 1.1 and 1.2 list a performance outline of M16C/6N Group (M16C/6NK, M16C/6NM).
Table 1.1 Performance Outline of M16C/6N Group (100-pin Version: M16C/6NK)
1. I2C-bus is a registered trademark of Koninklijke Philips Electronics N.V.
2. IEBus is a registered trademark of NEC Electronics Corporation.
option: All options are on request basis.
Rev.2.00 Nov 28, 2005 page 3 of 378
REJ09B0124-0200
Under development
This document is under development and its contents are subject to change.
M16C/6N Group (M16C/6NK, M16C/6NM)1. Overview
1.3 Block Diagram
Figure 1.1 shows a block diagram of M16C/6N Group (M16C/6NK, M16C/6NM).
8
Port P0
Port P18Port P2
Internal peripheral functions
Expandable up to 26 channels)
Timer (16 bits)
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 ✕ 2 channels)
NOTES:
1: ROM size depends on microcomputer type.
2: RAM size depends on microcomputer type.
3: Ports P11 to P14 are only in the 128-pin version.
4: 8 bits ✕ 2 channels in the 100-pin version.
Clock synchronous serial I/O
CRC arithmetic circuit (CCITT)
8888
A/D converter
(10 bits ✕ 8 channels
UART or
(3 channels)
(Polynomial: X
R0HR0L
R1HR1L
R2
R3
A0
A1
FB
16+X12+X5
+1)
SB
USP
ISP
INTB
PC
FLG
Port P14
(3)
2
Port P5Port P4Port P3
System clock generating circuit
XIN-XOUT
XCIN-XCOUT
PLL frequency synthesizer
On-chip oscillator
Clock synchronous serial I/O
(8 bits ✕ 4 channels)
CAN module
(2 channels)
(4)
MemoryM16C/60 series CPU core
(1)
ROM
(2)
RAM
Multiplier
Port P13
Port P12
(3)
8
(3)
8
8
Port P6
Port P7
8
Port P8
7
Port P8_5
Port P9
8
Port P10
8
Port P11
(3)
8
Figure 1.1 Block Diagram
Rev.2.00 Nov 28, 2005 page 4 of 378
REJ09B0124-0200
Under development
This document is under development and its contents are subject to change.
M16C/6N Group (M16C/6NK, M16C/6NM)1. Overview
1.4 Product List
Table 1.3 lists the M16C/6N Group (M16C/6NK, M16C/6NM) products and Figure 1.2 shows the type numbers,
memory sizes and packages.
Table 1.3 Product List
Type No.ROM Capacity RAM Capacity Package TypeRemarks