M16C221M8-XXXFP [RENESAS]

SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER; 单芯片16位CMOS微机
M16C221M8-XXXFP
型号: M16C221M8-XXXFP
厂家: RENESAS TECHNOLOGY CORP    RENESAS TECHNOLOGY CORP
描述:

SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
单芯片16位CMOS微机

计算机
文件: 总46页 (文件大小:548K)
中文:  中文翻译
下载:  下载PDF数据表文档文件
To all our customers  
Regarding the change of names mentioned in the document, such as Mitsubishi  
Electric and Mitsubishi XX, to Renesas Technology Corp.  
The semiconductor operations of Hitachi and Mitsubishi Electric were transferred to Renesas  
Technology Corporation on April 1st 2003. These operations include microcomputer, logic, analog  
and discrete devices, and memory chips other than DRAMs (flash memory, SRAMs etc.)  
Accordingly, although Mitsubishi Electric, Mitsubishi Electric Corporation, Mitsubishi  
Semiconductors, and other Mitsubishi brand names are mentioned in the document, these names  
have in fact all been changed to Renesas Technology Corp. Thank you for your understanding.  
Except for our corporate trademark, logo and corporate statement, no changes whatsoever have been  
made to the contents of the document, and these changes do not constitute any alteration to the  
contents of the document itself.  
Note : Mitsubishi Electric will continue the business operations of high frequency & optical devices  
and power devices.  
Renesas Technology Corp.  
Customer Support Dept.  
April 1, 2003  
Mitsubishi microcomputers  
M30221 Group  
Description  
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER  
Description  
The M30221 group of single-chip microcomputers are built using the high-performance silicon gate CMOS  
process using a M16C/60 Series CPU core. The M30221 group has LCD controller/driver. M30221 group is  
packaged in a 120-pin plastic molded QFP. These single-chip microcomputers operate using sophisticated  
instructions featuring a high level of instruction efficiency. With 1M bytes of address space, they are ca-  
pable of executing instructions at high speed.  
Features  
• Basic machine instructions ..................Compatible with the M16C/60 series  
• Memory capacity..................................See Figure 1.1.3 Memory Expansion  
• Shortest instruction execution time......100ns (f(XIN)=10MHz)  
• Supply voltage .....................................4.0 to 5.5V (f(XIN)=10MHz)  
2.7 to 5.5V (f(XIN)=7MHz with software one-wait)  
• Interrupts..............................................24 internal and 8 external interrupt sources, 4 software  
interrupt sources; 7 levels(including key input interrupt)  
• Multifunction 16-bit timer......................Timer A (output) x 8, timer B (input) x 6  
• Real time port outputs..........................8 bits X 3 lines,6 bits X 1 lines  
• Serial I/O..............................................2 channels for UART or clock synchronous  
• DMAC ..................................................2 channels (trigger: 24 souces)  
• A-D converter.......................................10 bits X 7 channels  
• D-A converter.......................................8 bits X 2 channels  
• Watchdog timer....................................1 line  
• Programmable I/O ...............................83 lines (26 lines are shared with LCD outputs)  
• Output port...........................................14 lines (14 lines are shared with LCD outpus)  
Specifications written in this manual  
• Input port..............................................1 line (P77, shared with NMI pin)  
• LCD drive control circuit.......................1/2, 1/3 bias  
2, 3 and 4 duty  
are believed to be accurate, but are  
not guaranteed to be entirely free of  
error.  
4 common outputs  
Specifications in this manual may  
be changed for functional or  
performance improvements. Please  
make sure your manual is the latest  
edition.  
40 segment outputs  
built-in charge pump  
• Key input interrupt................................20 lines  
• Clock generating circuit .......................2 built-in clock generation circuits  
(built-in feedback resistor, and external ceramic or quartz oscillator)  
Applications  
Camera, Home appliances, Portable equipment, Audio, office equipment, etc.  
------Table of Contents------  
Central Processing Unit (CPU) ................................ 9  
Reset...................................................................... 12  
Programmable I/O Port .......................................... 18  
Electric Characteristics .......................................... 28  
Usage precaution peculiar to M30221 Group ........ 41  
1
Mitsubishi microcomputers  
M30221 Group  
Description  
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER  
Pin Configuration  
Figures 1.1.1 show the pin configurations (top view).  
PIN CONFIGURATION (top view)  
P10  
1
/SEG17  
P1  
P1  
P1  
P1  
P2  
P2  
P2  
P2  
P24  
P25  
P26  
P27  
4
/KI  
/KI  
/KI  
/KI  
/KI  
/KI  
/KI10  
/KI11  
/KI12  
/KI13  
/KI14  
4
91  
92  
60  
59  
58  
57  
56  
55  
54  
53  
52  
51  
50  
49  
48  
47  
46  
45  
44  
43  
42  
41  
40  
39  
38  
37  
36  
35  
34  
33  
32  
31  
P100  
/SEG16  
5
5
SEG15  
93  
6
6
94  
SEG14  
SEG13  
SEG12  
SEG11  
SEG10  
7
7
95  
0
8
96  
1
9
97  
2
3
98  
SEG  
SEG  
SEG  
SEG  
SEG  
9
8
7
6
5
99  
100  
101  
102  
103  
104  
/KI15  
/KI16  
P30  
SEG  
SEG  
SEG  
COM  
4
3
2
3
P31  
P32  
P33  
P34  
/KI17  
/KI18  
/KI19  
105  
106  
107  
108  
109  
110  
111  
112  
113  
M30221MX-XXXFP  
COM  
COM  
2
1
P3  
5
P41  
P42  
P46  
P47  
/TA0IN  
/TA1OUT  
/TA3OUT/INT4  
/TA3IN/INT4  
COM  
C
C
0
2
1
V
V
L3  
L2  
P50  
/TB0IN  
P5  
P5  
1/TB1IN  
114  
115  
116  
117  
118  
119  
V
L1  
2
/TB2IN  
/TB3IN  
/INT3  
/CKOUT  
/CTS  
/CLK  
P13  
1/DA  
1
P53  
P56  
AVSS  
P13  
0
/ADTRG/DA  
0
P5  
P6  
P6  
7
V
REF  
0
0
/RTS0  
120  
AVCC  
1
0
Note. N channel open-drain output.  
Package: 120P6R-A  
Figure 1.1.1. Pin configuration for the M30221 group (top view)  
2
Mitsubishi microcomputers  
M30221 Group  
Description  
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER  
Block Diagram  
Figure 1.1.2 is a block diagram of the M30221 group.  
1
6
4
7
5
7
4
Port P4  
Port P7  
Port P7  
7
Port P8  
Port P9  
Port P5  
Port P6  
I/O ports  
Internal peripheral functions  
Timer  
System clock generator  
IN-XOUT  
CIN-XCOUT  
A-D converter  
Timer TA0 (16 bits)  
Timer TA1 (16 bits)  
Timer TA2 (16 bits)  
Timer TA3 (16 bits)  
X
X
(10 bits  
X 7 channels  
Timer TA4 (16 bits)  
Timer TA5 (16 bits)  
Timer TA6 (16 bits)  
Timer TA7 (16 bits)  
UART/clock synchronous SI/O  
(8 bits 2 channels)  
LCD drive control circuit  
(4COM X 40SEG)  
X
Timer TB0 (16 bits)  
Timer TB1 (16 bits)  
Timer TB2 (16 bits)  
Timer TB3 (16 bits)  
Timer TB4 (16 bits)  
Timer TB5 (16 bits)  
M16C/60 series 16-bit CPU core  
Memory  
Program counter  
Registers  
ROM  
(Note 1)  
Watchdog timer  
(15 bits)  
PC  
R0H  
R0H  
R1H  
R0L  
R0L  
R1L  
Stack pointer  
ISP  
USP  
RAM  
(Note 2)  
R2  
DMAC  
R3  
A0  
A1  
(2 channels)  
Vector table  
INTB  
D-A converter  
(8 bits X 2 channels)  
FB  
SB  
Flag register  
FLG  
Multiplier  
Note 1: ROM size depends on MCU type.  
Note 2: RAM size depends on MCU type.  
Figure 1.1.2. Block diagram of M30221 group  
3
Mitsubishi microcomputers  
M30221 Group  
Description  
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER  
Performance Outline  
Table 1.1.1 is performance outline of M30221 group.  
Table 1.1.1. Performance outline of M30221 group  
Item  
Performance  
Number of basic instructions  
91 instructions  
100ns (f(XIN)=10MHz  
Shortest instruction execution time  
Memory  
capacity  
I/O port  
ROM  
24 Kbytes  
RAM  
1.5 Kbytes  
P0 to P13 (except P77)  
8 bits x 4, 2 bits x 1, 6 bits x 3, 7 bits x 2  
5 bits x 1, 4 bits x 3  
Input port  
P77  
1 bit x 1  
Output port  
SEG2 to SEG15  
2 bits x 7  
Multifunction TA0 to TA7  
timer TB0 to TB5  
Real time port outputs  
16 bits x 8  
16 bits x 6  
8 bits x 3 lines,6 bits x 1 lines  
(UART or clock synchronous) x 2  
10 bits x 7 channels  
Serial I/O  
A-D converter  
D-A converter  
DMAC  
UART0 , UART2  
8 bits x 2 channels  
2 channel(trigger:24 sources)  
4 lines  
LCD  
COM0 to COM3  
SEG2 to SEG47  
40 lines (26 lines are shared with I/O ports)  
15 bits x 1 (with prescaler)  
24 internal and 8 external sources, 4 software sources  
2 built-in clock generation circuits  
(built-in feedbackresistor, and external ceramic or  
quartz oscillator)  
Watchdog timer  
Interrupt  
Clock generating circuit  
Supply voltage  
4.0 to 5.5V (f(XIN)=10MHz)  
2.7 to 5.5V (f(XIN)=7MHz with software one-wait)  
18 mW (Vcc=3.3V, f(XIN)=7MHz with software one-wait)  
Power consumption  
I/O withstand voltage (P0 to P13) 5 V  
I/O char-  
acteristics  
Output current P1 to P9,P13  
P0, P10 to P12  
5 mA  
0.1mA("H" output), 2.5mA("L" output)  
CMOS silicon gate  
Device configuration  
Package  
120-pin plastic mold QFP  
4
Mitsubishi microcomputers  
M30221 Group  
Description  
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER  
Mitsubishi plans to release the following products in the M30221 group:  
(1) Support for mask ROM version, flash memory version  
(2) Memory capacity  
(3) Package  
120P6R-A : Plastic molded QFP (mask ROM and flash memory versions)  
Figure 1.1.3 shows the memory expansion and figure 1.1.4 shows the Type No., memory size, and pack-  
age.  
April. 2001  
RAM  
Byte)  
Underdevelopm ent  
M 30221FCFP  
10K  
Underplanningꢀ  
M 30221M C-XXXFP  
Underplanningꢀ  
4K  
M 30221M 8-XXXFP  
Underplanning  
M 30221M 4-XXXFP  
M 30221M 3-XXXFP  
2K  
1.5K  
24K 32K  
64K  
128K  
ROM  
Byte)  
Figure 1.1.3. Memory expansion  
Type No. M30 22 1 M 3  
- XXX FP  
Package type:  
FP:  
Package120P6R-A  
ROM No.  
Omitted for flash memory version  
Shows characteristic, use  
None: General  
ROM capacity:  
3 : 24K bytes  
4 : 32K bytes  
8 : 64K bytes  
C : 128K bytes  
Memory type:  
M : Mask ROM version  
F : Flash memory version  
Shows pin count, etc.  
(The value itself has no specific meaning)  
M16C/22 Group(built-in LCDC)  
M16C Family  
Figure 1.1.4. Type No., memory size, and package  
5
Mitsubishi microcomputers  
M30221 Group  
Pin Description  
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER  
Pin Description  
Pin name  
CC, VSS  
Signal name I/O  
Function  
V
Power supply  
input  
Supply 2.7 to 5.5 V to the VCC pin. Supply 0 V to the VSS pin.  
CNVSS  
RESET  
CNVSS  
I
I
Connect it to the VSS pin.  
Reset input  
A Lon this input resets the microcomputer.  
These pins are provided for the main clock generating.  
circuit.Connect a ceramic resonator or crystal between the XIN  
and the XOUT pins. To use an externally derived clock, input it  
to the XIN pin and leave the XOUT open.  
X
IN  
Clock input  
I
X
OUT  
Clock output  
O
These pins are provided for the sub clock generating  
circuit.Connect a ceramic resonator or crystal between the XCIN  
and the XCOUT pins. To use an externally derived clock, input it  
to the XCIN pin and leave the XCOUT open.  
X
CIN  
Clock input  
I
X
COUT  
Clock output  
O
This pin is a power supply input for the A-D converter. Connect  
it to VCC.  
AVCC  
AVSS  
Analog power  
supply input  
This pin is a power supply input for the A-D converter. Connect  
it to VSS.  
Analog power  
supply input  
V
REF  
I
Reference  
voltage input  
This pin is a reference voltage input for the A-D converter.  
This is an 8-bit CMOS I/O port. It has an input/output port  
direction register that allows the user to set each pin for input or  
output individually. When set for input, the user can specify in  
units of four bits via software whether or not they are tied to a  
pull-up resistor. Pins in this port also use as LCD segment  
output and real time port output.  
P0  
0
to P0  
7
I/O port P0  
I/O  
This is an 8-bit I/O port equivalent to P0. Pins in this port also  
function as input pins for the key input interrupt function and real  
time port output.  
P1  
P2  
P3  
0
0
to P1  
to P2  
to P3  
7
7
I/O port P1  
I/O port P2  
I/O  
I/O  
This is an 8-bit I/O port equivalent to P0. Pins in this port also  
function as input pins for the key input interrupt function and real  
time port output.  
This is a 6-bit I/O port equivalent to P0. P3  
0
to P3  
3 also function  
0
5
I/O port P3  
I/O port P4  
I/O  
I/O  
as input pins for the key input interrupt function.  
P41, P42,  
P46, P4  
This is a 4-bit I/O port equivalent to P0. The P4  
with timer A0 input. The P4 pin is shared with timer A1  
output. The P4 pin is shared with timer A3 output and INT4.  
The P4 pin is shared with timer A3 input and INT4.  
1 pin is shared  
2
7
6
7
This is a 6-bit I/O port equivalent to P0. The P50, P51, P52, and  
P5  
P56, P5  
0 to P53,  
I/O port P5  
I/O port P6  
I/O  
I/O  
P5  
3
pins are shared with timerB0, B1, B2, and B3 input,  
respectively. The P5 pin is shared with INT3. The P5  
shared with CKOUT output.  
This is an 4-bit I/O port equivalent to P0. The P60 pin is shared  
with CTS and RTS . The P6 , P6 , and P6 pins are shared  
with CLK , and TxD , respectively.  
7
6
7 pin is  
P60 to P63  
0
0
1
2
3
0
, RxD  
0
0
6
Mitsubishi microcomputers  
M30221 Group  
Pin Description  
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER  
Pin Description  
Pin name  
P7 to P7  
Signal name  
I/O port P7  
I/O  
I/O  
Function  
P7  
channel open-drain output).  
The P7 , P7 , and P7 pins are shared with TxD  
CLK , respectively. The P7 is shared with CTS  
P7 , P7 and P7 pins are shared with INT , INT  
respectively.  
P7 is an input-only port that also functions for NMI.  
0 to P76 are I/O ports equivalent to P0 (P70 and P71 are N  
0
6
0
1
2
2
, RxD  
and RTS  
1 and INT  
2, and  
2
3
2
2. The  
,
4
5
6
0
2
P77  
7
I
This is a 5-bit I/O port equivalent to P0. The P8  
with timer A4 output and INT5 input . The P8 pin is shared with  
timer A4 input and INT5 input. The P8 pin is shared with timer  
A5 output. The P8 pin is shared with timer A6 output. The P8  
0 pin is shared  
P8  
0
to P8  
, P8  
2,  
I/O port P8  
I/O  
1
P84  
6
2
4
6
pin is shared with timer A7 output.  
This is an 7-bit I/O port equivalent to P0. Pins in this port also  
function as A-D converter input pins.  
P9  
0
to P9  
6
I/O port P9  
I/O  
I/O  
I/O  
I/O  
I/O  
P10  
0
to P10  
3
I/O port P10  
This is an 4-bit I/O port equivalent to P0. Pins in this port also  
function as SEG output for LCD.  
This is an 8-bit I/O port equivalent to P0. Pins in this port also  
function as SEG output for LCD.  
P11  
P12  
P13  
0
0
0
to P11  
to P12  
7
5
I/O port P11  
I/O port P12  
I/O port P13  
This is an 6-bit I/O port equivalent to P0. Pins in this port also  
function as SEG output for LCD and real time port output.  
, P13  
1
This is an 2-bit I/O port equivalent to P0. P13  
0 pins in this port  
also function as D-A converter output pins or start trigger for A-D  
input pins. P13  
output pins.  
1 pins in this port also function as D-A converter  
Segment output  
Pins in this port function as SEG output for LCD drive circuit.  
SEG  
SEG15  
2 to  
O
O
Pins in this port function as common output for LCD drive circuit.  
Power supply input for LCD drive circuit.  
COM  
COM  
0
3
to  
Common  
output  
VL1 to VL3  
Power supply  
input for LCD  
Pins in this port function as external pin for LCD step-up  
C1  
, C  
2
Step-up  
condenser. Connect a condenser between C1 and C2.  
condenser  
connect port  
7
Mitsubishi microcomputers  
M30221 Group  
Memory  
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER  
Operation of Functional Blocks  
The M30221 group accommodates certain units in a single chip. These units include ROM and RAM to  
store instructions and data and the central processing unit (CPU) to execute arithmetic/logic operations.  
Also included are peripheral units such as timers, real time port, serial I/O, LCD drive control circuit, D-A  
converter, A-D converter, DMAC and I/O ports.  
Memory  
Figure 1.4.1 is a memory map of the M30221 group. The address space extends the 1M bytes from ad-  
dress 0000016 to FFFFF16. From FFFFF16 down is ROM. For example, in the M30221M3-XXXFP, there is  
24K bytes of internal ROM from FA00016 to FFFFF16. The vector table for fixed interrupts such as the reset  
_______  
and NMI are mapped to FFFDC16 to FFFFF16. The starting address of the interrupt routine is stored here.  
The address of the vector table for timer interrupts, etc., can be set as desired using the internal register  
(INTB). See the section on interrupts for details.  
From 0040016 up is RAM. For example, in the M30221M3-XXXFP, 1.5K bytes of internal RAM is mapped  
to the space from 0040016 to 009FF6. In addition to storing data, the RAM also stores the stack used when  
calling subroutines and when interrupts are generated.  
The SFR area is mapped to 0000016 to 003FF16. This area accommodates the control registers for periph-  
eral devices such as I/O ports, A-D converter, serial I/O, timers, and LCD, etc. Figures 1.7.1 to 1.7.3 are  
location of peripheral unit control registers. Any part of the SFR area that is not occupied is reserved and  
cannot be used for other purposes.  
The special page vector table is mapped to FFE0016 to FFFDB16. If the starting addresses of subroutines  
or the destination addresses of jumps are stored here, subroutine call instructions and jump instructions  
can be used as 2-byte instructions, reducing the number of program steps.  
0000016  
SFR area  
For details, see  
Figures 1.7.1 to 1.7.3  
0040016  
Internal RAM area  
FFE0016  
XXXXX16  
Address XXXXX16  
009FF16  
RAM size  
1.5K bytes  
2K bytes  
4K bytes  
10K bytes  
Special page  
vector table  
00BFF16  
FFFDC16  
Undefined instruction  
Overflow  
013FF16  
Internal RAM area  
Internal ROM area  
02BFF16  
BRK instruction  
Address match  
Single step  
Address YYYYY16  
FA00016  
ROM size  
24K bytes  
32K bytes  
64K bytes  
128K bytes  
Watchdog timer  
YYYYY16  
FFFFF16  
F800016  
DBC  
NMI  
F000016  
E000016  
FFFFF16  
Reset  
Figure 1.4.1. Memory map  
8
Mitsubishi microcomputers  
M30221 Group  
CPU  
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER  
Central Processing Unit (CPU)  
The CPU has a total of 13 registers shown in Figure 1.5.1. Seven of these registers (R0, R1, R2, R3, A0,  
A1, and FB) come in two sets; therefore, these have two register banks.  
b15  
b15  
b15  
b15  
b15  
b15  
b15  
b8 b7  
b8 b7  
b0  
b0  
b0  
b0  
b0  
b0  
b0  
R0(Note)  
R1(Note)  
R2(Note)  
R3(Note)  
A0(Note)  
A1(Note)  
FB(Note)  
L
L
H
H
b19  
b19  
b0  
PC  
Program counter  
Data  
registers  
b0  
b0  
Interrupt table  
register  
INTB  
H
L
b15  
b15  
b15  
b15  
User stack pointer  
USP  
ISP  
SB  
b0  
b0  
b0  
Interrupt stack  
pointer  
Address  
registers  
Static base  
register  
FLG  
Frame base  
registers  
Flag register  
IPL  
U
I O B S Z D C  
Note: These registers consist of two register banks.  
Figure 1.5.1. Central processing unit register  
(1) Data registers (R0, R0H, R0L, R1, R1H, R1L, R2, and R3)  
Data registers (R0, R1, R2, and R3) are configured with 16 bits, and are used primarily for transfer and  
arithmetic/logic operations.  
Registers R0 and R1 each can be used as separate 8-bit data registers, high-order bits as (R0H/R1H),  
and low-order bits as (R0L/R1L). In some instructions, registers R2 and R0, as well as R3 and R1 can  
use as 32-bit data registers (R2R0/R3R1).  
(2) Address registers (A0 and A1)  
Address registers (A0 and A1) are configured with 16 bits, and have functions equivalent to those of data  
registers. These registers can also be used for address register indirect addressing and address register  
relative addressing.  
In some instructions, registers A1 and A0 can be combined for use as a 32-bit address register (A1A0).  
9
Mitsubishi microcomputers  
M30221 Group  
CPU  
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER  
(3) Frame base register (FB)  
Frame base register (FB) is configured with 16 bits, and is used for FB relative addressing.  
(4) Program counter (PC)  
Program counter (PC) is configured with 20 bits, indicating the address of an instruction to be executed.  
(5) Interrupt table register (INTB)  
Interrupt table register (INTB) is configured with 20 bits, indicating the start address of an interrupt vector  
table.  
(6) Stack pointer (USP/ISP)  
Stack pointer comes in two types: user stack pointer (USP) and interrupt stack pointer (ISP), each config-  
ured with 16 bits.  
Your desired type of stack pointer (USP or ISP) can be selected by a stack pointer select flag (U flag).  
This flag is located at the position of bit 7 in the flag register (FLG).  
(7) Static base register (SB)  
Static base register (SB) is configured with 16 bits, and is used for SB relative addressing.  
(8) Flag register (FLG)  
Flag register (FLG) is configured with 11 bits, each bit is used as a flag. Figure 1.5.2 shows the flag  
register (FLG). The following explains the function of each flag:  
• Bit 0: Carry flag (C flag)  
This flag retains a carry, borrow, or shift-out bit that has occurred in the arithmetic/logic unit.  
• Bit 1: Debug flag (D flag)  
This flag enables a single-step interrupt.  
When this flag is 1, a single-step interrupt is generated after instruction execution. This flag is  
cleared to 0when the interrupt is acknowledged.  
• Bit 2: Zero flag (Z flag)  
This flag is set to 1when an arithmetic operation resulted in 0; otherwise, cleared to 0.  
• Bit 3: Sign flag (S flag)  
This flag is set to 1when an arithmetic operation resulted in a negative value; otherwise, cleared to 0”  
.
• Bit 4: Register bank select flag (B flag)  
This flag chooses a register bank. Register bank 0 is selected when this flag is 0; register bank 1 is  
selected when this flag is 1.  
• Bit 5: Overflow flag (O flag)  
This flag is set to 1when an arithmetic operation resulted in overflow; otherwise, cleared to 0.  
• Bit 6: Interrupt enable flag (I flag)  
This flag enables a maskable interrupt.  
An interrupt is disabled when this flag is 0, and is enabled when this flag is 1. This flag is cleared to  
0when the interrupt is acknowledged.  
10  
Mitsubishi microcomputers  
M30221 Group  
CPU  
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER  
• Bit 7: Stack pointer select flag (U flag)  
Interrupt stack pointer (ISP) is selected when this flag is 0; user stack pointer (USP) is selected  
when this flag is 1.  
This flag is cleared to 0when a hardware interrupt is acknowledged or an INT instruction of software  
interrupt Nos. 0 to 31 is executed.  
• Bits 8 to 11: Reserved area  
• Bits 12 to 14: Processor interrupt priority level (IPL)  
Processor interrupt priority level (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 the processor interrupt priority level (IPL), the interrupt  
is enabled.  
• Bit 15: Reserved area  
The C, Z, S, and O flags are changed when instructions are executed. See the software manual for  
details.  
b15  
b0  
IPL  
Flag register (FLG)  
U
I
O B S Z D C  
Carry flag  
Debug flag  
Zero flag  
Sign flag  
Register bank select flag  
Overflow flag  
Interrupt enable flag  
Stack pointer select flag  
Reserved area  
Processor interrupt priority level  
Reserved area  
Figure 1.5.2. Flag register (FLG)  
11  
Mitsubishi microcomputers  
M30221 Group  
Reset  
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER  
Reset  
There are two kinds of resets; hardware and software. In both cases, operation is the same after the reset.  
(See Software Resetfor details of software resets.) This section explains on hardware resets.  
When the supply voltage is in the range where operation is guaranteed, a reset is effected by holding the  
reset pin level L(0.2VCC max.) for at least 20 cycles. When the reset pin level is then returned to the H”  
level while main clock is stable, the reset status is cancelled and program execution resumes from the  
address in the reset vector table.  
Figure 1.6.1 shows the example reset circuit. Figure 1.6.2 shows the reset sequence.  
5V  
4.0V  
V
CC  
0V  
5V  
VCC  
RESET  
RESET  
0V  
0.8V  
Figure 1.6.1. Example reset circuit  
X
IN  
More than 20 cycles are needed  
RESET  
BCLK  
BCLK 24 cycles  
Content of reset vector  
FFFFC16  
Address  
FFFFE16  
(Internal Address signal)  
Figure 1.6.2. Reset sequence  
____________  
Table 1.6.1 shows the statuses of the other pins while the RESET pin level is L. Figures 1.6.3 and 1.6.4  
show the internal status of the microcomputer immediately after the reset is cancelled.  
____________  
Table 1.6.1. Pin status when RESET pin level is L”  
Status  
Input port(with a pull up resistor)  
Pin name  
P0, P10 to P12  
P1 to P9, P13  
Input port (floating)  
Hlevel is output  
Hlevel is output  
SEG  
2
to SEG15  
to COM  
COM  
0
3
12  
Mitsubishi microcomputers  
M30221 Group  
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER  
Reset  
(1)Processor mode register 0  
(2)Processor mode register 1  
(3)System clock control register 0  
(000416)•••  
(000516)•••  
(000616)•••  
?
?
0
0
0
0
0
0
(27)Timer A0 interrupt control register  
(28)Timer A1 interrupt control register  
(29)Timer A2 interrupt control register  
(30)Timer A3 interrupt control register  
(005516)•••  
(005616)•••  
(005716)•••  
(005816)•••  
0
0
0
0
0
0
0
0
0
1
0
0
1
0
0
0
0
0
1
0
?
?
?
?
?
?
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
?
0
0
0
?
(4)System clock control register 1  
(5)Address match interrupt enable register  
(6)Protect register  
(000716)•••  
(000916)•••  
(000A16)•••  
(000F16)•••  
(31)Timer A4 interrupt control register  
(32)Timer B0 interrupt control register  
(005916)•••  
(005A16)•••  
0
0
0
?
?
?
0
(33)Timer B1 interrupt control register  
(34)Timer B2 interrupt control register  
(35)INT0 interrupt control register  
(36)INT1 interrupt control register  
(005B16)•••  
(005C16)•••  
(005D16)•••  
(005E16)•••  
(7)Watchdog timer control register  
0016  
0016  
0
(8)Address match interrupt register 0  
(001016)•••  
(001116)•••  
(001216)•••  
(001416)•••  
0
0
0
0
0
1
0
0
0
0
0
0
0
?
?
?
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0016  
0016  
0
(37)INT2 interrupt control register  
(38)LCD mode register  
(005F16)•••  
(012016)•••  
(012216)•••  
(012616)•••  
(9)Address match interrupt register 1  
0
0
0
0
(001516)•••  
(001616)•••  
(002C16)•••  
(003C16)•••  
0
0
(39)Segment output enable register  
(40)Key input mode register  
0
0
?
?
0
0
0
0
0
0
0
0
0
1
(10)DMA0 control register  
(11)DMA1 control register  
0
0
0
0
0
0
0
0
0
0
0
0
0
0
(41)Count start flag 1  
(034016)•••  
(034216)•••  
0
0
(42)One-shot start flag 1  
(12)INT3 interrupt control register  
(13)Timer B5 interrupt control register  
(14)Timer B4 interrupt control register  
(15)Timer B3 interrupt control register  
(004416)•••  
(004516)•••  
(004616)•••  
(004716)•••  
?
?
?
0
0
0
0
0
0
(43)Trigger select flag 1  
(44)Up-down flag 1  
(034316)•••  
(034416)•••  
(035616)•••  
(035716)•••  
0
0
(45)Timer A5 mode register  
(46)Timer A6 mode register  
?
?
?
?
0
0
0
0
0
0
0
0
0
0
0
0
0016  
0016  
0016  
0
(16)Timer A7 interrupt control register  
(17)Timer A6 interrupt control register  
(18)Timer A5 interrupt control register  
(19)DMA0 interrupt control register  
(004816)•••  
(004916)•••  
(004A16)•••  
(004B16)•••  
(47)Timer A7 mode register  
(48)Timer B3 mode register  
(49)Timer B4 mode register  
(50)Timer B5 mode register  
(035816)•••  
(035B16)•••  
(035C16)•••  
(035D16)•••  
0
0
0
0
0
0
0
?
?
?
0
0
0
0
0
0
0
0
0
0
0
0
0
?
?
?
?
?
?
?
?
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
(20)DMA1 interrupt control register  
(004C16)•••  
(004D16)•••  
(004E16)•••  
0
(21)Key input interrupt control register  
(22)A-D conversion interrupt control register  
(51)Interrupt cause select register 0  
(035E16)•••  
0
0
(52)Interrupt cause select register 1  
(035F16)•••  
(036016)•••  
0016  
(53)Clock division counter control register  
0
(23)UART2 transmit interrupt control register (004F16)•••  
(24)UART2 receive interrupt control register (005016)•••  
(25)UART0 transmit interrupt control register (005116)•••  
(26)UART0 receive interrupt control register (005216)•••  
(54)UART2 special mode register 2  
(037616)•••  
0016  
0016  
0016  
(55)UART2 special mode register  
(037716)•••  
(037816)•••  
(56)UART2 transmit/receive mode register  
The content of other registers and RAM is undefined when the microcomputer is  
reset. The initial values must therefore be set.  
x : Nothing is mapped to this bit  
? : Undefined  
Figure 1.6.3. Device's internal status after a reset is cleared(1)  
13  
Mitsubishi microcomputers  
M30221 Group  
Reset  
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER  
0016  
(57)UART2 transmit/receive control register 0  
0
0
(03E216)· · ·  
(03E316)· · ·  
(03E616)· · ·  
(037C16)· · ·  
0
0
0
0
0
0
0
0
1
0
0
0
0
1
(83)Port P0 direction register  
(84)Port P1 direction register  
(85)Port P2 direction register  
(58)UART2 transmit/receive control register 1 (037D16)· · ·  
0016  
0016  
0016  
(59)Count start flag 0  
(038016)· · ·  
(038116)· · ·  
(038216)· · ·  
(038316)· · ·  
(038416)· · ·  
(039616)· · ·  
(039716)· · ·  
(039816)· · ·  
(039916)· · ·  
(60)Clock prescaler reset flag  
(61)One-shot start flag 0  
(62)Trigger select flag 0  
(63)Up-down flag 0  
0
(03E716)· · ·  
(03EA16)· · ·  
(03EB16)· · ·  
(03EE16)· · ·  
(03EF16)· · ·  
(03F216)· · ·  
(03F316)· · ·  
(86)Port P3 direction register  
(87)Port P4 direction register  
(88)Port P5 direction register  
(89)Port P6 direction register  
(90)Port P7 direction register  
(91)Port P8 direction register  
(92)Port P9 direction register  
0
0 0 0  
0016  
0
0
0
0
0 0  
0 0 0 0  
0016  
0
0016  
0016  
0016  
0016  
(64)Timer A0 mode register  
(65)Timer A1 mode register  
(66)Timer A2 mode register  
(67)Timer A3 mode register  
0 0 0 0 0  
0016  
0016  
0016  
0016  
0016  
0016  
0016  
0016  
(03F616)· · ·  
(03F716)· · ·  
(93)Port P10 direction register  
(94)Port P11 direction register  
0016  
(68)Timer A4 mode register  
(69)Timer B0 mode register  
(70)Timer B1 mode register  
(039A16)· · ·  
(039B16)· · ·  
(039C16)· · ·  
0
0 ?  
0 0 ?  
0 0  
0
0
0 0  
0 0  
0 0  
0
0
0
(95)Port P12 direction register  
(96)Port P13 direction register  
(97)Pull-up control register 0  
(98)Pull-up control register 1  
(99)Pull-up control register 2  
(03FA16)· · ·  
(03FB16)· · ·  
0
0
1
0
1
?
0
(71)Timer B2 mode register  
(039D16)· · ·  
(03A016)· · ·  
(03FC16)· · · 0 0 0 0 0 0  
0016  
0016  
(72)UART0 transmit/receive mode register  
(03FD16)· · ·  
(73)UART0 transmit/receive control register 0 (03A416)· · ·  
(74)UART0 transmit/receive control register 1 (03A516)· · ·  
(75)UART transmit/receive control register 2 (03B016)· · ·  
(76)Flash memory control register (Note) (03B416)· · ·  
0 0 0 0 1 0 0  
0 0 0 0 0 0 1  
0 0 0 0 0 0  
0
0
0
1
(03FE16)· · · 1 1 1 1 0 0  
0
0
0016  
(100)Real time port control register (03FF16)· · ·  
000016  
000016  
000016  
0000016  
000016  
000016  
000016  
000016  
(101)Data registers (R0/R1/R2/R3)  
(102)Address registers (A0/A1)  
(103)Frame base register (FB)  
(104)Interrupt table register (INTB)  
(105)User stack pointer (USP)  
(106)Interrupt stack pointer (ISP)  
(107)Static base register (SB)  
· · ·  
· · ·  
· · ·  
· · ·  
· · ·  
· · ·  
· · ·  
0
0
0016  
(77)DMA0 cause select register  
(03B816)· · ·  
0016  
0
(78)DMA1 cause select register  
(79)A-D control register 2  
(80)A-D control register 0  
(81)A-D control register 1  
(03BA16)· · ·  
(03D416)· · ·  
(03D616)· · ·  
(03D716)· · ·  
0
?
0
0
0
0 0  
? ?  
0016  
0
0 0  
(82)D-A control register  
(03DC16)· · ·  
(108)Flag register (FLG)  
· · ·  
x : Nothing is mapped to this bit  
? : Undefined  
The content of other registers and RAM is undefined when the microcomputer is reset. The initial values  
must therefore be set.  
Note : This register is only exist in flash memory version.  
Figure 1.6.4. Device's internal status after a reset is cleared(2)  
14  
Mitsubishi microcomputers  
M30221 Group  
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER  
SFR  
004016  
004116  
004216  
004316  
004416  
004516  
004616  
004716  
004816  
004916  
004A16  
000016  
000116  
000216  
000316  
000416  
000516  
000616  
000716  
000816  
000916  
000A16  
000B16  
000C16  
000D16  
000E16  
000F16  
001016  
001116  
001216  
001316  
001416  
001516  
001616  
001716  
001816  
001916  
001A16  
001B16  
001C16  
001D16  
001E16  
001F16  
INT3 interrupt control register (INT3IC)  
Timer B5 interrupt control register (TB5IC)  
Timer B4 interrupt control register (TB4IC)  
Timer B3 interrupt control register (TB3IC)  
Timer A7 interrupt control register (TA7IC)  
Timer A6 interrupt control register (TA6IC)  
Timer A5 interrupt control register (TA5IC)  
Bus collision detection interrupt control register (BCNIC)  
Processor mode register 0 (PM0)  
Processor mode register 1(PM1)  
System clock control register 0 (CM0)  
System clock control register 1 (CM1)  
Address match interrupt enable register (AIER)  
Protect register (PRCR)  
004B16 DMA0 interrupt control register (DM0IC)  
004C16  
DMA1 interrupt control register (DM1IC)  
Key input interrupt control register (KUPIC)  
A-D conversion interrupt control register (ADIC)  
UART2 transmit interrupt control register (S2TIC)  
004D16  
004E16  
Watchdog timer start register (WDTS)  
Watchdog timer control register (WDC)  
004F16  
005016 UART2 receive interrupt control register (S2RIC)  
UART0 transmit interrupt control register (S0TIC)  
UART0 receive interrupt control register (S0RIC)  
UART1 transmit interrupt control register (S1TIC)  
UART1 receive interrupt control register (S1RIC)  
Timer A0 interrupt control register (TA0IC)  
Timer A1 interrupt control register (TA1IC)  
Timer A2 interrupt control register (TA2IC)  
005116  
005216  
005316  
005416  
005516  
005616  
005716  
005816  
Address match interrupt register 0 (RMAD0)  
Address match interrupt register 1 (RMAD1)  
Timer A3 interrupt control register (TA3IC)  
INT4 interrupt control register (INT4IC)  
Timer A4 interrupt control register (TA4IC)  
INT5 interrupt control register (INT5IC)  
Timer B0 interrupt control register (TB0IC)  
Timer B1 interrupt control register (TB1IC)  
005916  
005A16  
005B16  
005C16 Timer B2 interrupt control register (TB2IC)  
005D16 INT0 interrupt control register (INT0IC)  
INT1 interrupt control register (INT1IC)  
INT2 interrupt control register (INT2IC)  
005E16  
002016  
002116  
002216  
002316  
002416  
005F16  
DMA0 source pointer (SAR0)  
010016  
LCD RAM0(LRAM0)  
LCD RAM1(LRAM1)  
LCD RAM2(LRAM2)  
LCD RAM3(LRAM3)  
LCD RAM4(LRAM4)  
LCD RAM5(LRAM5)  
LCD RAM6(LRAM6)  
LCD RAM7(LRAM7)  
010116  
010216  
DMA0 destination pointer (DAR0)  
DMA0 transfer counter (TCR0)  
002516  
002616  
002716  
002816  
002916  
002A16  
002B16  
002C16  
002D16  
002E16  
002F16  
003016  
003116  
003216  
003316  
003416  
003516  
003616  
003716  
003816  
003916  
003A16  
003B16  
003C16  
003D16  
003E16  
003F16  
010316  
010416  
010516  
010616  
010716  
010816  
LCD RAM8(LRAM8)  
LCD RAM9(LRAM9)  
010916  
DMA0 control register (DM0CON)  
DMA1 source pointer (SAR1)  
010A16  
010B16  
010C16  
LCD RAM12(LRAM12)  
LCD RAM13(LRAM13)  
LCD RAM14(LRAM14)  
LCD RAM15(LRAM15)  
LCD RAM16(LRAM16)  
LCD RAM17(LRAM17)  
LCD RAM18(LRAM18)  
010D16  
010E16  
010F16  
011016  
011116  
011216  
DMA1 destination pointer (DAR1)  
DMA1 transfer counter (TCR1)  
DMA1 control register (DM1CON)  
011316  
011416  
LCD RAM20(LRAM20)  
LCD RAM21(LRAM21)  
LCD RAM22(LRAM22)  
LCD RAM23(LRAM23)  
011516  
011616  
011716  
LCD mode register (LCDM)  
012016  
012116  
012216  
012316  
012416  
012516  
Segment output enable register (SEG)  
LCD frame frequency counter (LCDTIM)  
012616 Key input mode register (KUPM)  
Note : Locations in the SFR area where nothing is allocated are reserved areas. Do not access these areas for  
read or write.  
Figure 1.7.1. Location of peripheral unit control registers (1)  
15  
Mitsubishi microcomputers  
M30221 Group  
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER  
SFR  
034016  
038016  
038116  
038216  
038316  
038416  
038516  
038616  
038716  
038816  
038916  
038A16  
038B16  
038C16  
038D16  
038E16  
038F16  
039016  
039116  
039216  
039316  
039416  
039516  
039616  
039716  
039816  
039916  
039A16  
039B16  
039C16  
039D16  
039E16  
039F16  
03A016  
03A116  
03A216  
03A316  
03A416  
03A516  
03A616  
03A716  
03A816  
03A916  
03AA16  
03AB16  
03AC16  
03AD16  
03AE16  
03AF16  
03B016  
03B116  
03B216  
03B316  
03B416  
03B516  
03B616  
03B716  
03B816  
03B916  
03BA16  
03BB16  
03BC16  
03BD16  
03BE16  
03BF16  
Count start flag 0 (TABSR0)  
Clock prescaler reset flag (CPSRF)  
One-shot start flag 0 (ONSF0)  
Trigger select register 0 (TRGSR0)  
Up-down flag 0 (UDF0)  
Count start flag 1 (TABSR1)  
034116  
034216  
034316  
034416  
034516  
034616  
034716  
034816  
034916  
034A16  
034B16  
034C16  
034D16  
034E16  
034F16  
035016  
035116  
035216  
035316  
035416  
035516  
035616  
035716  
035816  
035916  
035A16  
035B16  
035C16  
035D16  
035E16  
035F16  
036016  
036116  
036216  
036316  
036416  
036516  
036616  
036716  
036816  
036916  
036A16  
036B16  
036C16  
036D16  
036E16  
036F16  
037016  
037116  
037216  
037316  
037416  
037516  
One-shot start flag 1 (ONSF1)  
Trigger select register 1 (TRGSR1)  
Up-down flag 1(UDF1)  
Timer A5 register (TA5)  
Timer A6 register (TA6)  
Timer A7 register (TA7)  
Timer A0 register (TA0)  
Timer A1 register (TA1)  
Timer A2 register (TA2)  
Timer A3 register (TA3)  
Timer A4 register (TA4)  
Timer B3 register (TB3)  
Timer B4 register (TB4)  
Timer B5 register (TB5)  
Timer B0 register (TB0)  
Timer B1 register (TB1)  
Timer B2 register (TB2)  
Timer A5 mode register (TA5MR)  
Timer A6 mode register (TA6MR)  
Timer A7 mode register (TA7MR)  
Timer A0 mode register (TA0MR)  
Timer A1 mode register (TA1MR)  
Timer A2 mode register (TA2MR)  
Timer A3 mode register (TA3MR)  
Timer A4 mode register (TA4MR)  
Timer B0 mode register (TB0MR)  
Timer B1 mode register (TB1MR)  
Timer B2 mode register (TB2MR)  
Timer B3 mode register (TB3MR)  
Timer B4 mode register (TB4MR)  
Timer B5 mode register(TB5MR)  
Interrupt cause select register 0 (IFSR0)  
Interrupt cause select register 1 (IFSR1)  
Clock division counter control register (CDCC)  
UART0 transmit/receive mode register (U0MR)  
UART0 bit rate generator (U0BRG)  
UART0 transmit buffer register (U0TB)  
UART0 transmit/receive control register 0 (U0C0)  
UART0 transmit/receive control register 1 (U0C1)  
UART0 receive buffer register (U0RB)  
Clock division counter (CDC)  
UART transmit/receive control register 2 (UCON)  
Flash memory control register (FMCR)(Note)  
037616 UART2 special mode register 2(U2SMR2)  
UART2 special mode register (U2SMR)  
UART2 transmit/receive mode register (U2MR)  
UART2 bit rate generator (U2BRG)  
037716  
037816  
037916  
037A16  
037B16  
037C16  
037D16  
037E16  
037F16  
DMA0 request cause select register (DM0SL)  
DMA1 request cause select register (DM1SL)  
UART2 transmit buffer register (U2TB)  
UART2 transmit/receive control register 0 (U2C0)  
UART2 transmit/receive control register 1 (U2C1)  
UART2 receive buffer register (U2RB)  
Note1 : This register is only exist in flash memory version.  
Note2 : Locations in the SFR area where nothing is allocated are reserved areas. Do not access these areas for  
read or write.  
Figure 1.7.2. Location of peripheral unit control registers (2)  
16  
Mitsubishi microcomputers  
M30221 Group  
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER  
SFR  
03C016  
03C116  
03C216  
03C316  
03C416  
03C516  
03C616  
03C716  
03C816  
03C916  
03CA16  
03CB16  
03CC16  
03CD16  
03CE16  
03CF16  
03D016  
03D116  
03D216  
03D316  
03D416  
03D516  
03D616  
03D716  
03D816  
03D916  
03DA16  
03DB16  
03DC16  
03DD16  
03DE16  
03DF16  
03E016  
03E116  
03E216  
03E316  
03E416  
03E516  
03E616  
03E716  
03E816  
03E916  
03EA16  
03EB16  
03EC16  
03ED16  
03EE16  
03EF16  
03F016  
03F116  
03F216  
03F316  
03F416  
03F516  
03F616  
03F716  
03F816  
03F916  
03FA16  
03FB16  
03FC16  
03FD16  
03FE16  
03FF16  
A-D register 0 (AD0)  
A-D register 1 (AD1)  
A-D register 2 (AD2)  
A-D register 3 (AD3)  
A-D register 4 (AD4)  
A-D register 5 (AD5)  
A-D register 6 (AD6)  
A-D control register 2 (ADCON2)  
A-D control register 0 (ADCON0)  
A-D control register 1 (ADCON1)  
D-A register 0 (DA0)  
D-A register 1 (DA1)  
D-A control register (DACON)  
Port P0 register (P0)  
Port P1 register (P1)  
Port P0 direction register (PD0)  
Port P1 direction register (PD1)  
Port P2 register (P2)  
Port P3 register (P3)  
Port P2 direction register (PD2)  
Port P3 direction register (PD3)  
Port P4 register (P4)  
Port P5 register (P5)  
Port P4 direction register (PD4)  
Port P5 direction register (PD5)  
Port P6 register (P6)  
Port P7 register (P7)  
Port P6 direction register (PD6)  
Port P7 direction register (PD7)  
Port P8 register (P8)  
Port P9 register (P9)  
Port P8 direction register (PD8)  
Port P9 direction register (PD9)  
Port P10 register (P10)  
Port P11 register (P11)  
Port P10 direction register (PD10)  
Port P11 direction register (PD11)  
Port P12 register (P12)  
Port P13 register (P13)  
Port P12 direction register (PD12)  
Port P13 direction register (PD13)  
Pull-up control register 0 (PUR0)  
Pull-up control register 1 (PUR1)  
Pull-up control register 2 (PUR2)  
Real time port control register (RTP)  
Note : Locations in the SFR area where nothing is allocated are reserved areas.  
Do not access these areas for read or write.  
Figure 1.7.3. Location of peripheral unit control registers (3)  
17  
Mitsubishi microcomputers  
M30221 Group  
Programmable I/O Port  
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER  
Programmable I/O Ports  
There are 83 programmable I/O ports: P0 to P13 (excluding P77). Each port can be set independently for  
input or output using the direction register. A pull-up resistance for each block of 4 ports can be set. P77 is  
an input-only port and has no built-in pull-up resistance.  
Figures 1.19.1 to 1.19.4 show the programmable I/O ports. Figure 1.19.5 shows the I/O pins.  
Each pin functions as a programmable I/O port and as the I/O for the built-in peripheral devices.  
To use the pins as the inputs for the built-in peripheral devices, set the direction register of each pin to input  
mode. When the pins are used as the outputs for the built-in peripheral devices (other than the D-A con-  
verter), they function as outputs regardless of the contents of the direction registers. When pins are to be  
used as the outputs for the D-A converter, do not set the direction registers to output mode.  
(1) Direction registers  
These registers are used to choose the direction of the programmable I/O ports. Each bit in these regis-  
ters corresponds one for one to each I/O pin.  
Note: There is no direction register bit for P77.  
(2) Port registers  
These registers are used to write and read data for input and output to and from an external device. A  
port register consists of a port latch to hold output data and a circuit to read the status of a pin. Each bit  
in port registers corresponds one for one to each I/O pin.  
(3) Pull-up control registers  
The pull-up control register can be set to apply a pull-up resistance to each block of 4 ports. When ports  
are set to have a pull-up resistance, the pull-up resistance is connected only when the direction register is  
set for input. The pull-up resistance is not connected for pins that are set for output from peripheral  
functions, regardless of the setting in the pull-up control register. When pull-up is ON for ports P1 and P2,  
an intermittent pull-up that pulls up the port for only a set period of time, can be performed from the key  
input mode register.  
(4) Key input mode register  
With bits 0 and 1 of this register, it is possible to select both edges or the fall edge of the key input for P1  
and P2. Also, with bit 2, it is possible to make the pull-up for a port (P1 or P2), which is set for pull-up using  
the pull-up control register, automatically connect as an intermittent pull-up. And, using the significant 3  
bits, the pull-up resistance can be connected to and disconnected from ports P12 and P13.  
(5) Real-time port control register  
The real-time port control register can be used to set the registers of ports P0, P1, P2 and P12 for real-  
time port output, whereby output is synchronized with timer overflow of timers A0, A1, A5 and A6 in the  
timer mode.  
18  
Mitsubishi microcomputers  
M30221 Group  
Programmable I/O Port  
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER  
P00 to P07, P120 to P125  
VL3/VCC  
VL3/VCC  
V
L2/VCC  
Direction register  
LCD drive timing  
1”  
1”  
Interface logic  
level shift circuit  
Data bus  
Port latch  
Segment output  
V
L1/VSS  
Port/segment  
D
Q
Port ON/OFF  
Timer A  
overflow  
CK  
P10 to P17, P20 to P27  
Intermittent pull-up control  
Pull-up selection  
Direction register  
1”  
Port latch  
Data bus  
D
Q
Timer A  
overflow  
CK  
Q
D
Intermittent pull-up control  
CK  
P3  
P62, P7  
0
to P33, P41, P47, P5  
to P76, P8  
0 to P53, P56,  
4
1
Pull-up selected  
Direction register  
Port latch  
Data bus  
P34, P35  
Pull-up selection  
Direction register  
Port latch  
Data bus  
Figure 1.19.1. Programmable I/O ports (1)  
19  
Mitsubishi microcomputers  
M30221 Group  
Programmable I/O Port  
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER  
Pull-up selection  
Direction register  
P42, P46, P60, P61,  
P72, P73, P80, P82,  
P84, P86  
1”  
Output  
Data bus  
Port latch  
Input respective peripheral functions  
Pull-up selection  
P57, P63  
Direction register  
1”  
Output  
Data bus  
Port latch  
Direction register  
P70, P71  
1”  
Output  
Data bus  
Port latch  
Input respective peripheral functions  
P77  
Data bus  
NMI interrupt input  
Figure 1.19.2. Programmable I/O ports (2)  
20  
Mitsubishi microcomputers  
M30221 Group  
Programmable I/O Port  
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER  
P90 to P9  
6
Pull-up selection  
Direction register  
Port latch  
Data bus  
Analog input  
P100 to P103, P110 to P117  
VL3/VCC VL2/VCC VL3/VCC  
Direction register  
LCD drive timing  
1”  
Interface logic  
level shift circuit  
Data bus  
Port latch  
Segment output  
VL1/VSS  
Port/segment  
Port ON/OFF  
P130  
Pull-up selection  
Direction register  
Port latch  
Data bus  
Input respective peripheral functions  
Analog output  
Figure 1.19.3. Programmable I/O ports (3)  
21  
Mitsubishi microcomputers  
M30221 Group  
Programmable I/O Port  
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER  
P131  
Pull-up selection  
Direction register  
Port latch  
Data bus  
Analog output  
V
L3  
COM0 to COM3, SEG2 to SEG15  
V
V
L2  
L1  
The gate input signal of each  
transistor is controlled by the  
LCD duty ratio and the bias  
value.  
V
SS  
Figure 1.19.4. Programmable I/O ports (4)  
RESET  
RESET signal input  
(Note)  
Note :  
symbolizes a parasitic diode.  
Do not apply a voltage higher than VCC to each pin.  
Figure 1.19.5. I/O pins  
22  
Mitsubishi microcomputers  
M30221 Group  
Programmable I/O Port  
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER  
Table 1.19.1. Example connection of unused pins in single-chip mode  
Pin name  
Connection  
Ports P0 to P13  
(excluding P7  
After setting for output mode, leave these pins open; or after setting for  
input mode, connect every pin to VSS via a resistor.(Note1,Note3)  
7
)
XOUT (Note 2),XCOUT  
Open  
Connect via resistor to VSS (pull-down)  
Connect via resistor to VCC (pull-up)  
Connect to VCC  
X
CIN  
NMI  
AVCC  
AVSS, VREF  
Connect to VSS  
Open  
COM  
SEG  
C1, C2  
0
COM  
3
2
SEG15  
Open  
Open  
V
L2, VL3  
L1  
Connect to VCC  
V
Connect to VSS  
Connect via resistor to VSS  
CNVSS  
Note 1: Ifsetting these pinsin outputm ode and opening them , portsare in inputm ode untillswitched into  
outputm ode by use ofsoftware afterreset. Thus the voltage levels ofthe pins becom e unstable,  
and there can be instancesin which the powersource currentincreaseswhile the portsare in input  
m ode. In view of an instance in which the contents of the direction registers change due to a  
runaway generated by noise or other causes, setting the contents of the direction registers  
periodicallybyuse ofsoftware increasesprogram reliability.  
Note 2: W ith externalclockinputto XIN pin.  
Note 3:Output"L"ifportP70 and P71 are setto outputm ode.PortP70 and P71 are N channelopen drain.  
Microcomputer  
Port P0 to P13 (except for P77)  
(Input mode)  
·
·
·
·
(Input mode)  
Open  
(Output mode)  
NMI  
V
CC  
Open  
Open  
Open  
X
COUT  
AVCC  
VL3  
COM  
0
COM  
3
SEG  
2SEG15  
V
L2  
V
L1  
AVSS  
V
REF  
CIN  
CNVSS  
X
V
SS  
Figure 1.19.13. Example connection of unused pins  
23  
Mitsubishi microcomputers  
M30221 Group  
Usage precaution  
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER  
Usage Precaution  
Timer A (timer mode)  
(1) Reading the timer Ai register while a count is in progress allows reading, with arbitrary timing, the  
value of the counter. Reading the timer Ai register with the reload timing gets FFFF16. Reading the  
timer Ai register after setting a value in the timer Ai register with a count halted but before the counter  
starts counting gets a proper value.  
Timer A (event counter mode)  
(1) Reading the timer Ai register while a count is in progress allows reading, with arbitrary timing, the  
value of the counter. Reading the timer Ai register with the reload timing gets FFFF16by underflow  
or 000016by overflow. Reading the timer Ai register after setting a value in the timer Ai register with  
a count halted but before the counter starts counting gets a proper value.  
(2) When stop counting in free run type, set timer again.  
Timer A (one-shot timer mode)  
(1) Setting the count start flag to 0while a count is in progress causes as follows:  
The counter stops counting and a content of reload register is reloaded.  
The TAiOUT pin outputs Llevel.  
The interrupt request generated and the timer Ai interrupt request bit goes to 1.  
(2) The timer Ai interrupt request bit goes to 1if the timer's operation mode is set using any of the  
following procedures:  
Selecting one-shot timer mode after reset.  
Changing operation mode from timer mode to one-shot timer mode.  
Changing operation mode from event counter mode to one-shot timer mode.  
Therefore, to use timer Ai interrupt (interrupt request bit), set timer Ai interrupt request bit to 0”  
after the above listed changes have been made.  
Timer A (pulse width modulation mode)  
(1) The timer Ai interrupt request bit becomes 1if setting operation mode of the timer in compliance with  
any of the following procedures:  
Selecting PWM mode after reset.  
Changing operation mode from timer mode to PWM mode.  
Changing operation mode from event counter mode to PWM mode.  
Therefore, to use timer Ai interrupt (interrupt request bit), set timer Ai interrupt request bit to 0”  
after the above listed changes have been made.  
(2) Setting the count start flag to 0while PWM pulses are being output causes the counter to stop  
counting. If the TAiOUT pin is outputting an Hlevel in this instance, the output level goes to L, and  
the timer Ai interrupt request bit goes to 1. If the TAiOUT pin is outputting an Llevel in this instance,  
the level does not change, and the timer Ai interrupt request bit does not becomes 1.  
Timer B (timer mode, event counter mode)  
(1) Reading the timer Bi register while a count is in progress allows reading , with arbitrary timing, the  
value of the counter. Reading the timer Bi register with the reload timing gets FFFF16. Reading the  
timer Bi register after setting a value in the timer Bi register with a count halted but before the counter  
starts counting gets a proper value.  
24  
Mitsubishi microcomputers  
M30221 Group  
Usage precaution  
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER  
Timer B (pulse period/pulse width measurement mode)  
(1) If changing the measurement mode select bit is set after a count is started, the timer Bi interrupt  
request bit goes to 1.  
(2) When the first effective edge is input after a count is started, an indeterminate value is transferred to  
the reload register. At this time, timer Bi interrupt request is not generated.  
Real time port  
(1) Make sure timer Ai for real time port output is set for timer mode, and is set to have no gate function”  
using the gate function select bit.  
(2) Before setting the real time port mode select bit to 1, temporarily turn off the timer Ai used and write  
its set value to the timer Ai register.  
Sirial I/O  
(1) In case IIC mode select bit (bit 0 of address 037716) is set to "1" with UART2.When setting up port  
direction P7 (address 03EF16), write immediate values. If you use Read/Modify/Write instructions  
(BSET,BCLR,AND,OR,etc..) on the P7 direction register, the value of P71 direction register may  
change to unknown data.  
(2) MASK ROM version ONRY when IIC mode select bit (bit 0 of address 037716) and the internal/  
external select bit (bit 3 of address 037816) are both set to "1". The function of "SCL wait output bit 2  
(bit 5 of address 037616)" dose not work.  
(3) MASK ROM version ONRY when IIC mode select bit (bit 0 of address 037716) and the internal/  
external select bit (bit 3 of address 037816) are both set to "1". According to the datasheet, when IICM  
is set to "1", the port terminal is readable by the CPU even though "1" is assigned to P71 of the  
direction register. However, the CPU cannot read port P71 data if the P71 direction register is set to  
"1".  
A-D Converter  
(1) Write to each bit (except bit 6) of A-D control register 0, to each bit of A-D control register 1, and to bit  
0 of A-D control register 2 when A-D conversion is stopped (before a trigger occurs).  
In particular, when the Vref connection bit is changed from 0to 1, start A-D conversion after an  
elapse of 1 µs or longer.  
(2) When changing A-D operation mode, select analog input pin again.  
(3) Using one-shot mode or single sweep mode  
Read the correspondence A-D register after confirming A-D conversion is finished. (It is known by A-  
D conversion interrupt request bit.)  
(4) Using repeat mode, repeat sweep mode 0 or repeat sweep mode 1  
Use the undivided main clock as the internal CPU clock.  
Stop Mode and Wait Mode  
____________  
(1) When returning from stop mode by hardware reset, RESET pin must be set to Llevel until main clock  
oscillation is stabilized.  
(2) When switching to either wait mode or stop mode, instructions occupying four bytes either from the  
WAIT instruction or from the instruction that sets the every-clock stop bit to 1within the instruction  
queue are prefetched and then the program stops. So put at least four NOPs in succession either to  
the WAIT instruction or to the instruction that sets the every-clock stop bit to 1.  
(3) When the MCU running in low-speed or low power dissipation mode, do not enter WAIT mode with  
peripheral function clock stop bit (CM02) set to "1".  
25  
Mitsubishi microcomputers  
M30221 Group  
Usage precaution  
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER  
Interrupts  
(1) Reading address 0000016  
When maskable interrupt is occurred, CPU read the interrupt information (the interrupt number  
and interrupt request level) in the interrupt sequence.  
The interrupt request bit of the certain interrupt written in address 0000016 will then be set to 0.  
Reading address 0000016 by software sets enabled highest priority interrupt source request bit to 0.  
Though the interrupt is generated, the interrupt routine may not be executed.  
Do not read address 0000016 by software.  
(2) Setting the stack pointer  
The value of the stack pointer immediately after reset is initialized to 000016. Accepting an  
interrupt before setting a value in the stack pointer may become a factor of runaway. Be sure to  
set a value in the stack pointer before accepting an interrupt.  
_______  
When using the NMI interrupt, initialize the stack point at the beginning of a program. Concerning  
_______  
the first instruction immediately after reset, generating any interrupts including the NMI interrupt is  
prohibited.  
_______  
(3) The NMI interrupt  
_______  
_______  
The NMI interrupt can not be disabled. Be sure to connect NMI pin to Vcc via a pull-up resistor if  
unused.  
_______  
Do not get either into stop mode with the NMI pin set to L.  
(4) External interrupt  
When the polarity of the INT0 to INT5 pins is changed, the interrupt request bit is sometimes set  
to "1". After changing the polarity, set the interrupt request bit to "0".  
26  
Mitsubishi microcomputers  
M30221 Group  
Usage precaution  
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER  
(5) Rewrite the interrupt control register  
To rewrite the interrupt control register, do so at a point that does not generate the interrupt  
request for that register. If there is possibility of the interrupt request occur, rewrite the interrupt  
control register after the interrupt is disabled. The program examples are described as follow:  
Example 1:  
INT_SWITCH1:  
FCLR  
I
; Disable interrupts.  
AND.B #00h, 0055h ; Clear TA0IC int. priority level and int. request bit.  
NOP  
NOP  
FSET  
;
Four NOP instructions are required when using HOLD function.  
I
; Enable interrupts.  
Example 2:  
INT_SWITCH2:  
FCLR  
I
; Disable interrupts.  
AND.B #00h, 0055h ; Clear TA0IC int. priority level and int. request bit.  
MOV.W MEM, R0  
; Dummy read.  
FSET  
I
; Enable interrupts.  
Example 3:  
INT_SWITCH3:  
PUSHC FLG  
; Push Flag register onto stack  
; Disable interrupts.  
FCLR  
I
AND.B #00h, 0055h ; Clear TA0IC int. priority level and int. request bit.  
POPC FLG ; Enable interrupts.  
When a instruction to rewrite the interrupt control register is executed but the interrupt is disabled,  
the interrupt request bit is not set sometimes even if the interrupt request for that register has  
been generated. This will depend on the instruction. If this creates problems, use the below in-  
structions to change the register.  
Instructions : AND, OR, BCLR, BSET  
27  
Mitsubishi microcomputers  
M30221 Group  
Electric characteristics
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER  
Table 1.21.1. Absolute maximum ratings  
Symbol  
Parameter  
Condition  
Rated value  
Unit  
Vcc  
AVcc  
Supply voltage  
Analog supply voltage  
Vcc=AVcc  
Vcc=AVcc  
0.3 to 6.5  
0.3 to 6.5  
V
V
Input  
voltage  
RESET, VREF, XIN  
V
I
P0  
P3  
P5  
P7  
P9  
P11  
P13  
0
0
to P0  
to P3  
to P5  
to P7  
7
5
, P1  
, P4  
, P5  
, P8  
, P10  
7
0
1
to P1  
7
, P2  
0
to P2  
, P4  
to P6  
, P8  
7,  
,P4  
2
, P4  
, P6  
6
7
,
V
0.3 to Vcc+0.3  
0
2
0
3
7
6
6
0
, P5  
7
0
3
,
,
to P8  
to P10  
, P12 to P12  
2
, P8  
3,  
4
6
to P9  
0
0
to P11  
0
5
,
0
, P13  
1
(Mask ROM version CNVss)  
VL1  
0.3 to VL2  
VL2  
VL3  
VL1 to VL3  
VL2 to 6.5  
0.3 to 6.5  
P70, P71, C1, C2  
(flash memory version CNVss)  
P1  
P4  
P5  
0
to P1  
7
, P2  
6
0
0
to P2  
, P4 , P5  
to P6  
, P8  
7
, P3  
0 to P35,  
Output  
voltage  
V
O
1
6
, P4  
2
, P4  
7
0
to P53,  
0.3 to Vcc+0.3  
, P5  
7
, P6  
3
, P7  
, P9  
2
to P7  
6
,
V
P80  
to P8  
2
, P8  
4
6
0
to P96  
,
P13  
0
, P13  
1
, XOUT  
When output port  
0.3 to Vcc  
0.3 to VL3  
P0  
P11  
P7 , P7  
Power dissipation  
0
to P0  
7
, P10  
0
to P10  
3,  
0
to P11  
7
, P12  
0
to P125  
When segment output  
0
1
0.3 to 6.5  
P
d
Ta = 25°C  
mW  
300  
°C  
T
opr  
stg  
Operating ambient temperature  
Storage temperature  
20 to 85  
T
40 to 150  
°C  
28  
Mitsubishi microcomputers  
M30221 Group  
Electric characteristics
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER  
Table 1.21.2. Recommended operating conditions (referenced to VCC = 2.7V to 5.5V at Ta = 20 to 85oC  
unless otherwise specified)  
Standard  
Unit  
Symbol  
Parameter  
Min.  
Typ.  
Max.  
2.7  
5.0  
5.5  
V
Supply voltage  
Vcc  
Vcc  
0
AVcc  
Vss  
V
V
Analog supply voltage  
Analog supply voltage  
Analog supply voltage  
V
V
AVss  
0
P0  
P4  
P8  
P13  
P7 , P7  
P0 to P0  
P4 , P5 to P5  
P8 , P8 , P9 to P9  
P13 , P13 , XIN, RESET, CNVSS  
P0 to P0 , P10 to P10 , P11 to P11  
P1 to P1 , P2 to P2 , P3 to P3 , P4  
P5 to P5 , P5 , P5 , P6 to P6 , P7 to P7  
P8 , P9 to P9 , P13 , P13  
0
to P0  
, P5 to P5  
, P8 , P9 to P9  
, P13 , XIN, RESET, CNVSS  
7
, P1  
0
to P1  
, P5 , P5  
, P10  
7
, P2  
, P6  
to P10  
0
to P2  
to P6  
, P11  
7
, P3  
0
to P3  
to P7  
to P11  
5
, P4  
, P8  
, P12  
1
, P4  
2
, P4  
6
,
,
V
IH  
HIGH input  
voltage  
Vcc  
0.8Vcc  
7
0
3
6
7
0
3
, P7  
2
7
0
to P8  
2
4
6
0
6
0
3
0
7
0
to P12  
5
5
,
,
0
1
6.5  
0
1
0.8Vcc  
0
0
7
, P1  
0
to P1  
7
, P2  
0
to P2  
0
7
, P3  
to P6 , P7  
, P11  
0
to P3  
to P7  
to P11  
5
, P4  
1
, P4  
2
, P4  
6
,
,
LOW input  
voltage  
V
IL  
7
0
3
, P5 , P5  
6
7
, P6  
3
0
7
, P8  
0
to P8  
0
2
0.2Vcc  
V
4
6
0
6
, P10  
0
to P10  
3
0
7
, P12  
to P12  
0
1
IOH (peak)  
HIGH peak  
output current  
(Note 2)  
0.5  
0
7
0
3
0
7
, P12  
, P4 , P4  
, P8  
0
to P12  
, P4  
to P8  
5
mA  
0
7
0
7
0
5
1
2
6
7,  
0
3
6
7
0
3
2
6
0
2
2
, P8  
4
4
,
10.0  
6
0
6
0
1,  
0.1  
5.0  
P0  
0
to P0 , P10 to P10 , P11  
to P1 , P2 to P2 , P3 to P3  
to P5 , P5 , P5 , P6 to P6 , P7  
, P9 to P9 , P13 , P13  
to P0 , P10 to P10 , P11  
to P1 , P2 to P2 , P3 to P3  
to P5 , P5 , P5 , P6 to P6 , P7  
7
0
3
0
to P11  
, P4  
to P7  
7
, P12  
, P4 , P4  
, P8  
0
to P12  
, P4  
to P8  
5
I
OH (avg)  
HIGH average  
mA  
mA  
output current P1  
0
7
0
7
0
5
1
2
6
7,  
(Note 1)  
P5  
0
3
6
7
0
3
2
6
0
, P8  
, P8  
, P8  
,
,
,
P8  
6
0
0
6
0
1,  
IOL (peak)  
LOW peak  
output current  
(Note 2)  
P0  
P1  
P5  
P8  
P0  
P1  
P5  
P8  
7
0
3
0
to P11  
, P4  
to P7  
7
, P12  
, P4 , P4  
, P8  
0
to P12  
, P4  
to P8  
5
5.0  
0
7
0
7
0
5
1
2
6
7,  
10.0  
0
3
6
7
0
3
0
6
0
2
4
4
6
, P9 to P9 , P13 , P131,  
0
6
0
IOL (avg)  
LOW average  
output current  
(Note 1)  
2.5  
5.0  
0
to P0 , P10 to P10 , P11  
to P1 , P2 to P2 , P3 to P3  
to P5 , P5 , P5 , P6 to P6 , P7  
, P9 to P9 , P13 , P13  
7
0
3
0
to P11  
, P4  
to P7  
7
, P12  
, P4 , P4  
, P80  
0
to P12  
, P4  
to P8  
5
mA  
0
7
0
7
0
5
1
2
6
7,  
0
3
6
7
0
3
0
6
2
6
0
6
0
1,  
V
CC=4.0V to 5.5V  
CC=2.7V to 4.0V  
10  
0
0
MHz  
No wait  
With wait  
5 X VCC  
10.000  
V
MHz  
MHz  
Main clock input  
f (XIN  
)
0
0
10  
oscillation frequency  
(Note 3)  
V
CC=4.0V to 5.5V  
2.31 X VCC  
+0.760  
MHz  
kHz  
V
CC=2.7V to 4.0V  
f (XcIN  
)
32.768  
50  
Subclock oscillation frequency  
Note 1: The mean output current is the mean value within 100ms.  
Note 2: The total IOL (peak) for ports P0, P1, P2, P30 to P35, P4, P5, P6, P70 to P76 and P122 to P127 must be 80mA max. The total  
IOH (peak) for ports P0, P1, P2, P30 to P35, P4, P5, P6, P72 to P76 and P122 to P127 must be 80mA max. The total IOL (peak)  
for ports P8, P9, P10, P11, P120, P121 and P130 to P132 must be 80mA max. The total IOH (peak) for ports P8, P9, P10, P11,  
P120,P121 and P130 to P132 must be 80mA max.  
Note 3: Relationship between main clock oscillation frequency and supply voltage.  
Main clock input oscillation frequency  
(No wait)  
Main clock input oscillation frequency  
(With wait)  
10.0  
10.0  
7.0  
2.31 X VCC+0.760MHz  
5 X Vcc10.000MHz  
3.5  
0.0  
0.0  
2.7  
4.0  
5.5  
2.7  
4.0  
5.5  
Supply voltage [V]  
(BCLK: no division)  
Supply voltage [V]  
(BCLK: no division)  
29  
Mitsubishi microcomputers  
M30221 Group  
Electric characteristics (VCC = 5V)  
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER  
VCC = 5V  
o
Table 1.21.3. Electrical characteristics (referenced to VCC = 5V, VSS = 0V at Ta = 25 C, f(XIN)=10MHZ  
unless otherwise specified)  
Standard  
Symbol  
Unit  
Parameter  
Measuring condition  
Typ. Max.  
Min.  
HIGH output  
voltage  
P0  
P11  
0
to P0  
7
, P10  
0
to P10  
3,  
V
OH  
3.0  
I
I
OH= 0.1mA  
V
0
to P11  
7
, P12  
0
to P125  
P1  
0
to P1 , P2  
, P4 , P4 , P4  
to P6 , P7  
, P8 P90 to P9  
7
0
to P2  
7
, P3  
0
to P3  
to P5 , P5  
, P8 to P8  
P130, P13  
5,  
HIGH output  
voltage  
V
OH  
OH= 5mA  
3.0  
4.7  
P4  
P6  
P8  
1
2
6
7
, P5  
0
3
6
, P57,  
V
0
3
2
to P7  
6
0
2
,
I
OH= 200µA  
4
6
,
6
,
1
3.0  
3.0  
HIGHPOWER  
LOWPOWER  
I
I
OH= 1mA  
HIGH output  
voltage  
X
OUT  
V
OH  
V
V
OH= 0.5mA  
HIGHPOWER  
LOWPOWER  
With no load applied  
With no load applied  
3.0  
1.6  
HIGH output  
voltage  
X
COUT  
V
OH  
OL  
P0  
0
0
to P0  
to P3  
to P5  
to P7  
to P9  
to P12  
7
, P1  
, P4  
, P5  
, P8  
, P10  
, P13  
0
to P1  
, P4 , P4  
, P5 , P6  
to P8 , P8  
to P10 , P11  
, P13  
7
, P2  
, P4  
to P6  
, P8  
0
to P2  
7,  
7
,
V
LOW output  
voltage  
I
OL=5mA  
2.0  
V
P3  
P5  
P7  
P9  
P12  
5
1
2
6
0
3
6
7
0
3,  
6,  
0
6
0
2
4
I
OL=200µA  
0.45  
2.0  
0
6
0
3
0 to P117,  
0
5
0
1
HIGHPOWER  
I
I
OH=1mA  
V
OL  
LOW output XOUT  
voltage  
V
V
LOWPOWER  
HIGHPOWER  
LOWPOWER  
OH=0.5mA  
2.0  
With no load applied  
With no load applied  
0
0
V
OL  
LOW output  
voltage  
X
COUT  
Hysteresis  
TA0IN, TA3IN, TA4IN, TB0IN to TB3IN  
INT to INT , ADTRG, CTS , CLK , NMI,  
TA3OUT, TA4OUT, TA7OUT  
KI to KI15 (Note), KI16 to KI19  
,
V
T+-  
V
T-  
T-  
0
5
0
0
V
0.2  
0.2  
0.8  
,
0
V
T+-  
V
Hysteresis  
1.8  
5.0  
V
RESET  
to P0  
HIGH input P0  
0
7
, P1  
, P4  
0
to P1  
, P4 , P4  
, P5 , P6  
to P8 , P8  
to P10 , P11  
, P13 , P13  
IN, RESET, CNVSS  
LOW input P0  
to P0 , P1 to P1  
, P4 , P4  
, P5 , P6  
to P8 , P8  
to P10 , P11  
, P13 , P13  
7
, P2  
, P4  
to P6  
, P8  
0
to P2  
7
,
I
IH  
current  
P3  
0
to P3  
5
1
2
6
7,  
V
I=5V  
µA  
P50  
to P5  
3
, P5  
, P8  
, P10  
6
7
0
3
,
P7  
P9  
0
0
to P7  
to P9  
7
6
0
2
4
6
,
0
3
0
to P11  
7
,
P12  
0
to P12  
5
0
1,  
X
0
7
0
7
, P2  
, P4  
to P6  
, P8  
0
to P2  
7
,
IIL  
current  
P3  
0
0
to P3  
5
, P4  
1
2
7
6
0
7,  
5.0  
V
V
I
=0V  
µA  
P5  
P7  
P9  
to P5  
to P7  
to P9  
3
7
6
, P5  
, P8  
, P10  
6
0
3
,
,
0
0
2
4
6
0
3
0
to P11  
7
,
,
P12  
0
to P12  
5
0
1,  
X
IN, RESET, CNVSS  
P0 to P0 , P1 to P1  
, P4 , P4  
, P5 , P6  
to P8 , P8  
to P10 , P11  
, P13 , P13  
Pull-up  
resistance  
0
7
0
7
, P2  
, P4  
to P6  
, P8  
0
to P2  
7
,
R
PULLUP  
P3  
0
0
to P3  
5
, P4  
1
6
2
7
6
0
7,  
30.0  
167.0  
I=0V  
50.0  
k
P5  
P7  
P9  
to P5  
to P7  
to P9  
3, P5  
3
,
,
2
0
6
6
, P8  
0
2
4
6
, P10  
0
3
0 to P117  
P12  
0
to P12  
5
0
1,  
R
fXIN  
Feedback resistance  
X
IN  
1.0  
6.0  
M
RfXCIN  
M
V
Feedback resistance  
RAM retention voltage  
X
CIN  
When clock is stopped  
2.0  
V
RAM  
Note : Has no effect during intermittent pullup operation.  
30  
Mitsubishi microcomputers  
M30221 Group  
Electric characteristics (VCC = 5V)  
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER  
VCC = 5V  
o
Table 1.21.4. Electrical characteristics (referenced to VCC = 5V, VSS = 0V at Ta = 25 C, f(XIN)=10MHZ  
unless otherwise specified)  
Standard  
Min. Typ. Max.  
Symbol  
Parameter  
Measuring condition  
Unit  
f(XIN)=10MHz  
Square wave, no division  
19.0  
38.0  
mA  
Mask ROM  
version  
f(XCIN)=32kHz  
Square wave  
I/o pin is no  
load applied  
90.0  
µA  
Flash memory  
version  
f(XCIN)=32kHz  
Square wave  
200.0  
4.0  
µA  
µA  
Power supply current  
Icc  
f(XCIN)=32kHz  
When a WAIT instruction is executed  
When clock is stopped  
1.0  
Ta=25 ºC  
µA  
When clock is stopped  
Ta=85 ºC  
20.0  
V
L1  
Supply voltage (VL1)  
When voltage multiplier used  
VL1=1.7V,f(LCDCK)=200Hz  
1.3  
1.7  
3.0  
2.1  
6.0  
V
Power supply current (VL1)  
IL1  
µA  
Table 1.21.5. A-D conversion characteristics (referenced to VCC = AVCC = VREF = 5V, Vss = AVSS = 0V  
at Ta = 25oC, f(XIN) = 10MHZ unless otherwise specified)  
Standard  
Min. Typ. Max.  
Symbol  
Parameter  
Measuring condition  
Unit  
10  
V
REF =VCC  
Bits  
Resolution  
V
REF =VCC = 5V  
Absolute  
accuracy  
Sample & hold function not available  
Sample & hold function available(10bit)  
Sample & hold function available(8bit)  
±3  
LSB  
V
REF =VCC= 5V  
REF = VCC = 5V  
±3  
±2  
LSB  
V
LSB  
k
10  
3.3  
2.8  
40  
R
LADDER  
CONV  
CONV  
SAMP  
REF  
IA  
Ladder resistance  
VREF =VCC  
µs  
µs  
µs  
V
t
Conversion time(10bit)  
t
Conversion time(8bit)  
Sampling time  
t
0.3  
2
V
CC  
V
Reference voltage  
V
REF  
V
Analog input voltage  
0
V
Table 1.21.6. D-A conversion characteristics (referenced to VCC = AVCC =VREF =5V, VSS = AVSS =  
o
0V at Ta = 25 C, f(XIN) = 10MHZ unless otherwise specified)  
Standard  
Symbol  
Parameter  
Measuring condition  
Unit  
Min.  
Typ. Max.  
Resolution  
Absolute accuracy  
Setup time  
Output resistance  
8
1.0  
3
Bits  
%
t
su  
µs  
k
R
O
4
10  
20  
I
VREF  
mA  
Reference power supply input current  
1.5  
(Note)  
Note: This applies when using one D-A converter, with the D-A register for the unused D-A converter set to 0016.  
The A-D converter's ladder resistance is not included.  
Also, when the Vref is unconnected at the A-D control register, IVREF is sent.  
31  
Mitsubishi microcomputers  
M30221 Group  
Timing (VCC = 5V)  
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER  
VCC = 5V  
o
Timing requirements (referenced to VCC = 5V, VSS = 0V at Ta = 25 C unless otherwise specified)  
Table 1.21.7. External clock input  
Standard  
Symbol  
Parameter  
Unit  
Min.  
100  
40  
Max.  
ns  
ns  
ns  
ns  
External clock input cycle time  
t
c
tw(H)  
External clock input HIGH pulse width  
External clock input LOW pulse width  
External clock rise time  
t
w(L)  
40  
15  
15  
t
r
ns  
t
f
External clock fall time  
Table 1.21.8. Timer A input (counter input in event counter mode)  
Standard  
Symbol  
Parameter  
Unit  
Min.  
Max.  
ns  
100  
t
c(TA)  
TAiIN input cycle time  
t
w(TAH)  
40  
40  
ns  
ns  
TAiIN input HIGH pulse width  
TAiIN input LOW pulse width  
t
w(TAL)  
Table 1.21.9. Timer A input (gating input in timer mode)  
Standard  
Parameter  
Unit  
Symbol  
Min.  
400  
Max.  
t
c(TA)  
ns  
ns  
ns  
TAiIN input cycle time  
t
w(TAH)  
200  
200  
TAiIN input HIGH pulse width  
TAiIN input LOW pulse width  
t
w(TAL)  
Table 1.21.10. Timer A input (external trigger input in one-shot timer mode)  
Standard  
Min. Max.  
200  
Parameter  
Unit  
ns  
Symbol  
t
c(TA)  
TAiIN input cycle time  
t
w(TAH)  
w(TAL)  
100  
100  
ns  
ns  
TAiIN input HIGH pulse width  
TAiIN input LOW pulse width  
t
Table 1.21.11. Timer A input (external trigger input in pulse width modulation mode)  
Standard  
Parameter  
Unit  
Symbol  
Min.  
100  
100  
Max.  
t
w(TAH)  
ns  
ns  
TAiIN input HIGH pulse width  
TAiIN input LOW pulse width  
t
w(TAL)  
Table 1.21.12. Timer A input (up/down input in event counter mode)  
Standard  
Symbol  
Parameter  
Unit  
Min.  
Max.  
TAiOUT input cycle time  
t
c(UP)  
2000  
ns  
ns  
ns  
t
w(UPH)  
w(UPL)  
1000  
1000  
TAiOUT input HIGH pulse width  
TAiOUT input LOW pulse width  
TAiOUT input setup time  
t
t
su(UP-TIN  
h(TIN-UP)  
)
400  
400  
ns  
ns  
TAiOUT input hold time  
t
32  
Mitsubishi microcomputers  
M30221 Group  
Timing (VCC = 5V)  
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER  
VCC = 5V  
o
Timing requirements (referenced to VCC = 5V, VSS = 0V at Ta = 25 C unless otherwise specified)  
Table 1.21.13. Timer B input (counter input in event counter mode)  
Standard  
Symbol  
Parameter  
Unit  
Min.  
100  
Max.  
t
c(TB)  
ns  
ns  
ns  
ns  
TBiIN input cycle time (counted on one edge)  
t
w(TBH)  
TBiIN input HIGH pulse width (counted on one edge)  
40  
40  
t
w(TBL)  
TBiIN input LOW pulse width (counted on one edge)  
TBiIN input cycle time (counted on both edges)  
t
c(TB)  
200  
80  
t
w(TBH)  
TBiIN input HIGH pulse width (counted on both edges)  
TBiIN input LOW pulse width (counted on both edges)  
ns  
ns  
t
w(TBL)  
80  
Table 1.21.14. Timer B input (pulse period measurement mode)  
Standard  
Symbol  
Parameter  
Unit  
ns  
Min.  
400  
Max.  
t
c(TB)  
TBiIN input cycle time  
TBiIN input HIGH pulse width  
TBiIN input LOW pulse width  
t
w(TBH)  
200  
200  
ns  
ns  
t
w(TBL)  
Table 1.21.15. Timer B input (pulse width measurement mode)  
Standard  
Symbol  
Parameter  
Unit  
ns  
Min.  
Max.  
t
c(TB)  
TBiIN input cycle time  
400  
200  
t
w(TBH)  
w(TBL)  
ns  
ns  
TBiIN input HIGH pulse width  
TBiIN input LOW pulse width  
t
200  
Table 1.21.16. A-D trigger input  
Standard  
Symbol  
Parameter  
Unit  
Min.  
1000  
125  
Max.  
t
c(AD)  
ns  
ns  
ADTRG input cycle time (trigger able minimum)  
ADTRG input LOW pulse width  
t
w(ADL)  
Table 1.21.17. Serial I/O  
Standard  
Symbol  
Parameter  
Unit  
ns  
Min.  
200  
Max.  
t
c(CK)  
CLKi input cycle time  
t
w(CKH)  
w(CKL)  
ns  
ns  
ns  
CLKi input HIGH pulse width  
CLKi input LOW pulse width  
100  
100  
t
t
t
d(C-Q)  
h(C-Q)  
80  
TxDi output delay time  
TxDi hold time  
ns  
ns  
0
t
su(D-C)  
h(C-D)  
RxDi input setup time  
30  
90  
t
ns  
RxDi input hold time  
_______  
Table 1.21.18. External interrupt INTi inputs  
Standard  
Symbol  
Parameter  
Unit  
Min.  
250  
250  
Max.  
t
w(INH)  
ns  
ns  
INTi input HIGH pulse width  
INTi input LOW pulse width  
t
w(INL)  
33  
Mitsubishi microcomputers  
M30221 Group  
Timing
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER  
P0  
P1  
P2  
P3  
30pF  
P4  
P5  
P6  
P7  
P8  
P9  
P10  
P11  
P12  
P13  
Figure 1.21.1. Port P0 to P13 measurement circuit  
34  
Mitsubishi microcomputers  
M30221 Group  
Timing (VCC = 5V)  
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER  
VCC = 5V  
t
c(TA)  
tw(TAH)  
TAiIN input  
tw(TAL)  
t
c(UP)  
tw(UPH)  
TAiOUT input  
t
w(UPL)  
TAiOUT input  
(Up/down input)  
During event counter mode  
TAiIN input  
(When count on falling  
t
su(UPTIN)  
t
h(TINUP)  
edge is selected)  
TAiIN input  
(When count on rising  
edge is selected)  
tc(TB)  
t
w(TBH)  
TBiIN input  
t
w(TBL)  
tc(AD)  
t
w(ADL)  
ADTRG input  
tc(CK)  
tw(CKH)  
CLKi  
t
w(CKL)  
th(CQ)  
TxDi  
RxDi  
td(CQ)  
tsu(DC)  
t
h(CD)  
tw(INL)  
INTi input  
tw(INH)  
35  
Mitsubishi microcomputers  
M30221 Group  
Electric characteristics (VCC = 3V)  
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER  
VCC = 3V  
o
Table 1.21.19. Electrical characteristics (referenced to VCC = 3V, VSS = 0V at Ta = 25 C, f(XIN) =  
7MHZ, with wait)  
Standard  
Symbol  
Unit  
Parameter  
Measuring condition  
Typ. Max.  
Min.  
HIGH output  
voltage  
P0  
P11  
0
to P0  
7
, P10  
0
to P10  
3,  
V
OH  
V
I
OH= 20µA  
2.0  
0
to P11  
7
, P12  
0
to P125  
P1  
0
to P1 , P2  
, P4 , P4 , P4  
to P6 , P7  
, P8 P90 to P9  
7
0
to P2  
7
, P3  
0
to P3  
to P5 , P5  
, P8 to P8  
P130, P13  
5,  
HIGH output  
voltage  
V
OH  
2.5  
I
OH= 1mA  
V
P4  
P6  
P8  
1
2
6
7
, P5  
0
3
6
, P57,  
0
3
2
to P7  
6
0
2
,
4
6
,
6
,
1
HIGHPOWER  
LOWPOWER  
I
OH= 0.1mA  
2.5  
2.5  
HIGH output  
voltage  
X
OUT  
V
OH  
V
V
V
I
OH= 50µA  
HIGHPOWER  
LOWPOWER  
With no load applied  
With no load applied  
3.0  
1.6  
HIGH output  
voltage  
X
COUT  
V
OH  
OL  
P0  
0
0
to P0  
to P3  
to P5  
to P7  
to P9  
to P12  
7
, P1  
, P4  
, P5  
, P8  
, P10  
, P13  
0
to P1  
, P4 , P4  
, P5 , P6  
to P8 , P8  
to P10 , P11  
, P13  
7
, P2  
, P4  
to P6  
, P8  
0
to P2  
7,  
7
,
V
LOW output  
voltage  
0.5  
I
OL=1mA  
P3  
P5  
P7  
P9  
P12  
5
1
2
6
0
3
6
7
0
3,  
6,  
0
6
0
2
4
0
6
0
3
0 to P117,  
0
5
0
1
HIGHPOWER  
0.5  
0.5  
I
OH=0.1mA  
V
OL  
LOW output XOUT  
voltage  
V
V
V
LOWPOWER  
HIGHPOWER  
LOWPOWER  
I
OH=50µA  
With no load applied  
With no load applied  
0
0
V
OL  
LOW output  
voltage  
X
COUT  
Hysteresis  
TA0IN, TA3IN, TA4IN, TB0IN to TB3IN  
INT to INT , ADTRG, CTS , CLK , NMI,  
TA3OUT, TA4OUT, TA7OUT  
KI to KI15 (Note), KI16 to KI19  
,
V
T+-  
V
T-  
T-  
0.8  
0
5
0
0
0.2  
0.2  
,
0
V
T+-  
V
V
1.8  
4.0  
Hysteresis  
RESET  
to P0  
HIGH input P0  
current  
0
7
, P1  
, P4  
, P5  
0
to P1  
, P4 , P4  
, P5 , P6  
to P8 , P8  
to P10 , P11  
, P13 , P13  
7
, P2  
, P4  
to P6  
, P8  
0
to P2  
7
,
I
IH  
V
V
V
I=3V  
I=0V  
I=0V  
P3  
0
to P3  
5
1
2
6
7,  
µA  
P5  
P7  
P9  
0
to P5  
to P7  
to P9  
3
6
7
0
3
,
0
0
7
6
, P8  
0
2
4
6
,
, P10  
0
3
0
to P11  
7
7
7
,
,
,
P12  
0
to P12  
5
0
1,  
X
IN, RESET, CNVSS  
LOW input P0  
to P0 , P1 to P1  
to P3 , P4 , P4 , P4  
to P5 , P5 , P5 , P6  
, P8  
0
7
0
7
, P2  
, P4  
to P6  
, P8  
0
to P2  
7
,
IIL  
µA  
4.0  
current  
P3  
0
0
5
3
1
6
2
7
6
0
7,  
P5  
3
6
,
,
P7 to P7 , P8 to P8  
2
4
P90  
0
to P97  
0
6
, P100  
0
to P10 , P11  
3
0
to P11  
P12  
to P12  
5
, P13  
0, P131,  
X
IN, RESET, CNVSS  
P0 to P0 , P1 to P1  
P3 to P3 , P4 , P4 , P4  
P5 to P5 , P5 , P5 , P6  
, P8  
Pull-up  
0
7
0
7
, P2  
, P4  
to P6  
, P8  
0
to P2  
7
,
RPULLUP  
500.0  
120.0  
66.0  
k
resistance  
0
0
5
3
1
6
2
7
6
0
7,  
3
6
,
,
P7 to P7 , P8 to P8  
2
4
P9  
0
2 to P96  
6
, P100  
0
to P10 , P11  
3
0
to P11  
P12  
0
to P12  
5
, P13  
0, P131,  
R
fXIN  
Feedback resistance  
X
IN  
3.0  
M
R
fXCIN  
Feedback resistance  
RAM retention voltage  
X
CIN  
M
V
10.0  
V
RAM  
When clock is stopped  
2.0  
Note : Has no effect during intermittent pullup operation.  
36  
Mitsubishi microcomputers  
M30221 Group  
Electric characteristics (VCC = 3V)  
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER  
VCC = 3V  
o
Table 1.21.20. Electrical characteristics (referenced to VCC = 3V, VSS = 0V at Ta = 25 C, f(XIN) =  
7MHZ, with wait)  
Standard  
Min. Typ. Max.  
Symbol  
Parameter  
Measuring condition  
Unit  
f(XIN)=7MHz  
Square wave, no division  
6.0  
15.0  
mA  
Mask ROM  
version  
f(XCIN)=32kHz  
Square wave  
40.0  
µA  
µA  
I/o pin is no  
load applied  
Flash memory  
version  
f(XCIN)=32kHz  
Square wave  
150.0  
Power supply current  
Icc  
f(XCIN)=32kHz  
2.8  
0.9  
µA  
µA  
When a WAIT instruction is executed  
Oscillation capacity High (Note)  
f(XCIN)=32kHz  
When a WAIT instruction is executed  
Oscillation capacity Low (Note)  
When clock is stopped  
Ta=25 ºC  
1.0  
µA  
When clock is stopped  
Ta=85 ºC  
20.0  
V
L1  
Supply voltage (VL1)  
When voltage multiplier used  
VL1=1.7V,f(LCDCK)=200Hz  
1.3  
1.7  
3.0  
2.1  
6.0  
V
Power supply current (VL1)  
IL1  
µA  
Note: With one timer operated using fC32.  
Table 1.21.21. A-D conversion characteristics (referenced to VCC = AVCC = VREF = 3V, VSS = AVSS  
=
o
0V at Ta = 25 C, f(XIN) = 7MHZ, with wait unless otherwise specified)  
Standard  
Min. Typ. Max.  
10  
Symbol  
Parameter  
Measuring condition  
Unit  
Bits  
V
REF =VCC  
Resolution  
Absolute  
Sample & hold function not available(8bit)  
V
REF =VCC = 3V, φAD=fAD/2  
±2  
LSB  
accuracy  
R
LADDER  
V
REF =VCC  
10  
40  
Ladder resistance  
k
t
CONV  
14.0  
2.7  
0
µs  
V
Conversion time(8bit)  
Reference voltage  
V
REF  
V
CC  
V
IA  
V
REF  
V
Analog input voltage  
Table 1.21.22. D-A conversion characteristics (referenced to VCC = AVCC= VREF= 3V, VSS = AVSS =  
o
0V, at Ta = 25 C, f(XIN) = 7MHZ unless otherwise specified)  
Standard  
Min. Typ. Max.  
Symbol  
Parameter  
Measuring condition  
Unit  
Bits  
%
Resolution  
Absolute accuracy  
8
1.0  
t
su  
Setup time  
Output resistance  
3
µs  
k
R
O
20  
4
10  
I
VREF  
mA  
Reference power supply input current  
(Note  
)
1.0  
Note : This applies when using one D-A converter, with the D-A register for the unused D-A converter set to 0016. The  
A-D converter's ladder resistance is not included.  
Also, when the Vref is unconnected at the A-D control register, IVREF is sent.  
37  
Mitsubishi microcomputers  
M30221 Group  
Timing (VCC = 3V)  
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER  
VCC = 3V  
o
Timing requirements (referenced to VCC = 3V, VSS = 0V at Ta = 25 C unless otherwise specified)  
Table 1.21.23. External clock input  
Standard  
Symbol  
Parameter  
External clock input cycle time  
External clock input HIGH pulse width  
External clock input LOW pulse width  
External clock rise time  
Unit  
Min.  
143  
60  
Max.  
t
c
ns  
ns  
ns  
ns  
t
w(H  
)
t
w(L)  
60  
t
t
r
18  
18  
f
ns  
External clock fall time  
Table 1.21.24. Timer A input (counter input in event counter mode)  
Standard  
Symbol  
Parameter  
Unit  
Min.  
150  
Max.  
ns  
t
c(TA)  
TAiIN input cycle time  
t
w(TAH)  
60  
60  
ns  
ns  
TAiIN input HIGH pulse width  
TAiIN input LOW pulse width  
tw(TAL)  
Table 1.21.25. Timer A input (gating input in timer mode)  
Standard  
Symbol  
Parameter  
Unit  
Min.  
600  
Max.  
ns  
ns  
ns  
t
c(TA)  
TAiIN input cycle time  
t
w(TAH)  
300  
300  
TAiIN input HIGH pulse width  
TAiIN input LOW pulse width  
t
w(TAL)  
Table 1.21.26. Timer A input (external trigger input in one-shot timer mode)  
Standard  
Min. Max.  
300  
Parameter  
Unit  
Symbol  
t
c(TA)  
ns  
ns  
ns  
TAiIN input cycle time  
t
w(TAH)  
150  
150  
TAiIN input HIGH pulse width  
TAiIN input LOW pulse width  
t
w(TAL)  
Table 1.21.27. Timer A input (external trigger input in pulse width modulation mode)  
Standard  
Parameter  
Unit  
Symbol  
Min.  
150  
150  
Max.  
t
w(TAH)  
ns  
ns  
TAiIN input HIGH pulse width  
TAiIN input LOW pulse width  
t
w(TAL)  
Table 1.21.28. Timer A input (up/down input in event counter mode)  
Standard  
Min. Max.  
Parameter  
Unit  
Symbol  
t
c(UP)  
ns  
ns  
ns  
ns  
ns  
TAiOUT input cycle time  
3000  
1500  
1500  
600  
t
w(UPH)  
w(UPL)  
su(UP-TIN  
h(TIN-UP)  
TAiOUT input HIGH pulse width  
t
TAiOUT input LOW pulse width  
TAiOUT input setup time  
TAiOUT input hold time  
t
)
t
600  
38  
Mitsubishi microcomputers  
M30221 Group  
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER  
Timing (VCC = 3V)  
VCC = 3V  
o
Timing requirements (referenced to VCC = 3V, VSS = 0V at Ta = 25 C unless otherwise specified)  
Table 1.21.29. Timer B input (counter input in event counter mode)  
Standard  
Symbol  
Parameter  
Unit  
Min.  
150  
60  
Max.  
t
c(TB)  
ns  
ns  
ns  
ns  
TBiIN input cycle time (counted on one edge)  
t
w(TBH)  
TBiIN input HIGH pulse width (counted on one edge)  
t
w(TBL)  
TBiIN input LOW pulse width (counted on one edge)  
TBiIN input cycle time (counted on both edges)  
60  
300  
t
c(TB)  
t
w(TBH)  
TBiIN input HIGH pulse width (counted on both edges)  
TBiIN input LOW pulse width (counted on both edges)  
ns  
ns  
160  
160  
t
w(TBL)  
Table 1.21.30. Timer B input (pulse period measurement mode)  
Standard  
Symbol  
Parameter  
Unit  
ns  
Min.  
600  
Max.  
t
c(TB)  
TBiIN input cycle time  
t
t
w(TBH)  
w(TBL)  
300  
300  
ns  
ns  
TBiIN input HIGH pulse width  
TBiIN input LOW pulse width  
Table 1.21.31. Timer B input (pulse width measurement mode)  
Standard  
Symbol  
Parameter  
Unit  
ns  
Min.  
600  
Max.  
t
c(TB)  
TBiIN input cycle time  
t
w(TBH)  
ns  
ns  
TBiIN input HIGH pulse width  
300  
300  
t
w(TBL)  
TBiIN input LOW pulse width  
Table 1.21.32. A-D trigger input  
Standard  
Symbol  
Parameter  
Unit  
Min.  
1500  
200  
Max.  
t
c(AD)  
ns  
ns  
ADTRG input cycle time (trigger able minimum)  
ADTRG input LOW pulse width  
t
w(ADL)  
Table 1.21.33. Serial I/O  
Standard  
Symbol  
Parameter  
Unit  
ns  
Min.  
300  
Max.  
t
c(CK)  
CLKi input cycle time  
t
w(CKH)  
w(CKL)  
ns  
ns  
ns  
CLKi input HIGH pulse width  
150  
150  
t
CLKi input LOW pulse width  
TxDi output delay time  
t
t
d(C-Q)  
h(C-Q)  
160  
ns  
ns  
ns  
0
TxDi hold time  
t
su(D-C)  
h(C-D)  
RxDi input setup time  
50  
90  
t
RxDi input hold time  
_______  
Table 1.21.34. External interrupt INTi inputs  
Standard  
Symbol  
Parameter  
Unit  
Min.  
380  
380  
Max.  
t
w(INH)  
ns  
ns  
INTi input HIGH pulse width  
INTi input LOW pulse width  
t
w(INL)  
39  
Mitsubishi microcomputers  
M30221 Group  
Timing (VCC = 3V)  
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER  
VCC = 3V  
tc(TA)  
tw(TAH)  
TAiIN input  
tw(TAL)  
tc(UP)  
tw(UPH)  
TAiOUT input  
tw(UPL)  
TAiOUT input  
(Up/down input)  
During event counter mode  
TAiIN input  
(When count on falling  
edge is selected)  
tsu(UPTIN  
)
th(TINUP)  
TAiIN input  
(When count on rising  
edge is selected)  
tc(TB)  
tw(TBH)  
tw(ADL)  
TBiIN input  
tw(TBL)  
tc(AD)  
ADTRG input  
tc(CK)  
tw(CKH)  
CLKi  
tw(CKL)  
th(CQ)  
TxDi  
RxDi  
td(CQ)  
tsu(DC)  
th(CD)  
tw(INL)  
INTi input  
tw(INH)  
40  
Mitsubishi microcomputers  
M30221 Group  
Usage precaution peculiarto M 30221 Group  
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER  
Usage precaution againstthe differencesbetween M 30220 Group and M 30221 Group  
Differencesbetween M 30220 Group and M 30221 Group  
Item s  
M 30220 G roup  
M 30221 G roup  
64K***  
4K***  
96K  
6K  
128K**  
10K**  
24K  
32K***  
2K***  
64K***  
4K***  
128K**  
10K**  
Internal  
M em ory  
ROM (Byte)  
1.5K  
RAM (Byte)  
Inputonly:1 /Outputonly:16 (shared with LCD outputs)  
102 (32 linesare shared with LCD outputs)  
Inputonly:1 /Outputonly:14 (shared with LCD outputs)  
81 (26 linesare shared with LCD outputs)  
Inputonly /Outputonly  
CM OS I/O  
I/O  
Ports  
N-channelopen-drain  
2
2
DM AC (channels)  
16-bittim ers  
8+6  
CRC Operation Circuit  
ClockSync. /UART  
3
2
Serial  
I/O  
ClockSynchronous  
UART only  
A-D Converter(resolution ×channels)  
D-A Converter(resolution ×channels)  
ExternalInterrupts(source)  
10bits×8  
8bits×3  
10bits×7  
8bits×2  
8
W atchdog Tim er  
Available  
Segm ent(lines)  
Com m on (lines)  
Charge pum p  
48  
40  
LCD  
Controller  
/Driver  
4
Available  
RealTim e OutputPorts(bits×ports)  
8×4  
8×3, 6×1  
Key-on W ake up (lines)  
M ax.20 (16 lineshave Interm ittentpull-up operation)  
Available  
Sub ClockGenerating Circuit  
144-pin TQFP (144PFB-A)  
144-pin LQFP (144P6Q-A)  
Packages  
120-pin LQFP (120P6R-A)  
PowerSource Voltage (V)  
2.7 to 5.5 (7M Hzwith 1wait)4.0 to 5.5 (10M Hz)  
Operating Tem perature Range ()  
M inim um Instruction Excution Tim e (ns)  
-20 to 85、-40 to 85  
100 (10M Hz)  
Num berofBasicInstructions  
91  
★★:Underdevelopm ent★★★:Underplanning (April. 2001)  
Deleted pinsfrom M 30220 Group  
Port  
P0  
Deleted pin nam e  
P4  
P5  
P6  
P8  
P9  
P1  
P2  
P3  
P4  
P5  
0
4
4
/TA0OUTP4  
/TB4INP5 /TB5IN  
/CTS /RTS /CLKS1P65/CLK1P66/RXD1P67/TXD1  
3/TA1INP44/TA2OUTP45/TA2IN  
5
1
1
P6  
P7  
P8  
P9  
3
7
/TA5INP8  
/AN  
5
/TA6INP8  
7
/SEG21P10  
/SEG39  
/TA7IN  
7
P10  
P11  
P12  
P13  
P10  
4
/SEG20P10  
5
6/SEG22P107/SEG23  
P12  
P13  
6
2
/SEG38P12  
7
/DA  
2
others  
SEG  
0
SEG1VSS(1 pin)  
41  
Mitsubishi microcomputers  
M30221 Group  
Usage precaution peculiarto M 30221 Group  
Usage precaution againsttim erA  
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER  
M ode  
Function  
Pulse output  
Notavailable tim erAi  
Tim erA0 and A2 are notavailable.  
Tim erm ode  
Tim erA1 , A2 , and A5 to A7 are notavailable.  
Tim erA0 and A2 are notavailable.  
Gate input  
Pulse output  
Countsource input  
Up /down countselectinput  
Two-phase pulse input  
Pulse output  
Tim erA1 , A2 , and A5 to A7 are notavailable.  
Tim erA0 and A2 are notavailable.  
Eventcounter  
m ode  
Tim erA2 and A7 are notavailable.(Note 1)  
Tim erA0 and A2 are notavailable.  
One-shottim er  
m ode  
Triggerinput  
Tim erA1 , A2 , and A5 to A7 are notavailable.  
Tim erA0 and A2 are notavailable.  
Pulse width  
m odulation m ode  
Triggerinput  
Tim erA1 and A5 to A7 are notavailable.  
Note 1.Tim erA3 and A4 are available.  
Usage precaution againsttim erB  
M ode  
Function  
Notavailable tim erBi  
Eventcounter  
m ode  
Countsource input  
Tim erB4 and B5 are notavailable.  
Pulse period  
/pulse width  
m easurem ent  
m ode  
Tim erB4 and B5 are notavailable.  
Usage precaution againstrealtim e portoutputs  
(1)PinsP126 andP127aredeleted.  
Usage precaution againstserialI/O  
(1)UART1isnotavailable.  
Usage precaution againstLCD controller/driver  
(1)PinsSEG0 ,SEG1 ,SEG20 toSEG23 ,SEG38 andSEG39aredeleted.  
(2)AddressesofthedesignatedRAM fortheLCD display010016,010A16,010B16and011316arereservedarea.  
(3)Bit5ofthesegmentoutputenableregister(address012216)isreservedbit.M ustalwaysbeclearto"0".  
42  
Mitsubishi microcomputers  
M30221 Group  
Usage precaution peculiarto M 30221 Group  
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER  
Usage precaution againstA-D converter  
(1)AN7pinisdeleted.  
(2)Donotsettheanaloginputpinselectbit(bit0to2ataddress03D616)to"111"inone-shotmodeandinrepeat  
mode.  
(3)W hentheA-D sweeppinselectbit(bit0, 1ataddress03D716)issetto"11"insinglesweepmode, the  
interruptrequestgenerationtimingoftheA-D conversionistheA-D conversiontimeofall8pins.  
(4)ThesweeptimeistheA-D conversiontimeofall8pins inrepeatsweepmode1andwhentheA-D sweeppin  
selectbit(bit0,1ataddress03D716)issetto"11"inrepeatsweepmode0.  
Usage precaution againstD-A converter  
(1)DA2pinisdeleted.  
(2)Bit2oftheD-A controlregister(address03DC16)isreservedbit.M ustalwaysbeclearto"0".  
(3)Address03DE16 mustalwaysbeclearto"0016".  
Usage precaution againstprogram m able I/O  
(1)ReservedbitsoftheportPidirectionregisterandtheportPiregister  
Register  
PD0P0  
PD1P1  
PD2P2  
PD3P3  
PD4P4  
PD5P5  
PD6P6  
Bit  
Register  
PD7P7  
Bit  
PD8P8  
b3、b5、b7(Note 1)  
b7(Note 1)  
PD9P9  
PD10、P10  
PD11、P11  
PD12、P12  
PD13、P13  
b4~b7(Note 1)  
b0、b3~b5(Note 1)  
b4、b5(Note 1)  
b6、b7(Note 1)  
b2(Note 1)  
b4~b7(Note 1)  
Note 1.These are reserved bits. M ustalwaysbe clearto "0".  
(2)Reservedbitsofthepull-upcontrolregister  
Bit5ofthepull-upcontrolregister1(address03FD16)andbit5ofthepull-upcontrolregister2(address03FE16)  
arereservedbits.M ustalwaysbeclearto"0".  
43  
Keep safety first in your circuit designs!  
Mitsubishi Electric 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 non-flammable 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 Mitsubishi semiconductor 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 Mitsubishi Electric Corporation or a third party.  
Mitsubishi Electric 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 Mitsubishi Electric Corporation  
without notice due to product improvements or other reasons. It is therefore  
recommended that customers contact Mitsubishi Electric Corporation or an authorized  
Mitsubishi Semiconductor product distributor for the latest product information before  
purchasing a product listed herein.  
The information described here may contain technical inaccuracies or typographical  
errors. Mitsubishi Electric 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 Mitsubishi Electric Corporation  
by various means, including the Mitsubishi Semiconductor home page (http://  
www.mitsubishichips.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. Mitsubishi Electric Corporation assumes no  
responsibility for any damage, liability or other loss resulting from the information  
contained herein.  
Mitsubishi Electric 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 Mitsubishi Electric Corporation or an authorized  
Mitsubishi Semiconductor 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 Mitsubishi Electric 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 Mitsubishi Electric Corporation or an authorized Mitsubishi Semicon  
ductor product distributor for further details on these materials or the products con  
tained therein.  
MITSUBISHI SEMICONDUCTORS  
M30221 Group Specification REV.D  
May. First Edition 2001  
Editioned by  
Committee of editing of Mitsubishi Semiconductor  
Published by  
Mitsubishi Electric Corp., Kitaitami Works  
This book, or parts thereof, may not be reproduced in any form without  
permission of Mitsubishi Electric Corporation.  
©2001 MITSUBISHI ELECTRIC CORPORATION  

相关型号:

M16C221MC-XXXFP

SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
RENESAS

M16C26

16-BIT CMOS SINGLE-CHIP MICROCOMPUTER M16C FAMILY / M16C/20 SERIES
RENESAS

M16C26A

16-BIT SINGLE-CHIP MICROCOMPUTER M16C FAMILY / M16C/Tiny SERIES
RENESAS

M16C26A-24NT

Sample Program (24-Number Time-of-Day Clock)
RENESAS

M16C26A-C

Sample Program (Calendar)
RENESAS

M16C26A-EDC

Sample Program (Electronic Desktop Calculator)
RENESAS

M16C26A-LM

Sample Program (Lux Meter)
RENESAS

M16C26A-M

Sample Program (Message)
RENESAS

M16C26A-MS

Sample Program (Musical Scale)
RENESAS

M16C26A-RCT

Sample Program (Remote Control Transmission/Reception)
RENESAS

M16C26A-SC

Standard Characteristics
RENESAS

M16C26A-TS

Sample Program (Terminal Software)
RENESAS