Supply voltage2.7 to 5.5V f(Xin) = 16 MHz, without software wait
Power consumptionTBD
I/O characteristicsI/O withstand voltage5.5V
P3, P40.1 mA (high output), 2.5 mA (low output)
Output current
P6-P105 mA at 5V (excluding pins P7
Device configurationCMOS high performance silicon gate
Package100-pin plastic mold QFP
COM0 to COM34 lines
LCD
SEG0 to SEG3940 lines (16 lines shared with I/O ports)
, P71, P83)
0
1-6
Under
development
Specifications in this manual are tentative and subject to change
Rev. G
Description
Mitsubishi plans to release the following products in the M30222 group:
(1) Support for Flash memory version and mask ROM versions
(2) ROM capacity: 260 K bytes
(3) Package
100P6S-A : Plastic molded QFP (mask ROM version)
100P6Q-A: Plastic molded QFP
M16C Family Group
Figure 1.4 shows the M30222 family.
Type No. M 3 0 2 2 2 F G – X X X F P
MITSUBISHI MICROCOMPUTERS
M30222 Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Package type:
FP: Package 100P6S-A
GP: 100P6Q-A
ROM No.
Omitted for flash memory version
ROM capacity:
G: 260K bytes
Memory type:
F : Flash memory version
M30222 Group
Fig. 1.4. Type No., memory size, and package
Table 1.2 shows the product list for the M30222 family.
Table 1.2. Product list
Type No. ROM Capacity RAM Capacity Package Type Remarks
M30222FGFP 100P6S-A
M30222FGGP 100P6Q-A
260 Kbytes
20 Kbytes
M16C Family
Flash
1-7
Under
development
Specifications in this manual are tentative and subject to change
Rev. G
Description
MITSUBISHI MICROCOMPUTERS
M30222 Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Pin Description
Table 1.3. Pin Description for M30222 group
Pin nameSignal nameI/O typeFunction
Vcc, VssPower supplyInputSupply 2.7 to 5.5V to the Vcc pin and 0V to Vss
VDCVoltage Down
CNVssCNVss
RESET
Xin, XoutMain ClockInput/OutputThese pins are provided for the main clock generating circuit. Connect a ceramic reso-
/P8
P8
4
5
Xcout/XcinSubclockInput/Output
AVcc
AVss
Vref
P3
to P3
0
7
to P4
P4
0
7
to P6
P6
0
7
to P7
P7
0
7
Converter
Reset inputInputAn “L” on this input resets the microcomputer.
I/O PortInput/OutputThese pins are provided for the subclock generating circuit. Connect a ceramic reso-
Analog power
supply + reference
Analog power
supply + reference
Reference voltage
input
I/O Port P3Input/OutputThis is an 8-bit CMOS I/O port. It has an input/output direction register that allows the
RTP0_0 to RTP3_1Output
SEG24 to SEG31OutputPins in this port also function as SEG output for LCD and output for Real-time port.
I/O Port P4Input/OutputThis is an 8-bit I/O port equivalent to P3.
SEG32 to SEG39OutputPins in Port 4 also function as SEG outputs for LCD.
RTP4_0 to RTP7_1OutputPins in Port 4 also function as Real-time port.
I/O Port P6Input/OutputThis is an 8-bit I/O port equivalent to P3.
to KI7InputPins in Port 6 also function as key-input interrupts.
KI0
UART0, UART1Input/OutputPins in Port 6 also function as transmit, receive, clock, and CTS
I/O Port P7Input/OutputThis is an 8-bit I/O port equivalent to P3.
UART2
Timer A/BInput/OutputSome pins in Port 7 serve as input/output for Timer A and Timer B.
INT4
InputConnects capacitor from VDC to Vss; or if not using VDC, connect 3.3V to VDC pin.
This pin is used to enable flash programming. Connect the pull-down resistor from
CNVss to Vss. Connect CNVss to enable flash programming.
nator or crystal between the Xin and the Xout pins. To use an externally derived clock,
input it to the Xin.
nator or crystal between the Xcin pin and leave the Xcout pin open. These pins also
function as CMOS I/O ports.
Input
InputThis pin is a power supply input for A-D converter. Connect this pin to Vss.
InputThis pin is a reference voltage input for the A-D converter.
Input/OutputSome pins in Port 7 serve as transmit, receive, clock, and CTS
InputPins P76 and P77 function as inputs for INT4.
This pin is a power supply input for the A-D converter. Connect this pin to Vcc.
user to set each pin for input or output individually. When used for input, the port can
be set by software to have or not have a pull resistor in units of four bits.
UART1.
UART2 provides I
2
C serial communications.
/RTS pins for UART0,
/RTS for UART2.
to P82, P8
P8
0
P8
3
Three-phase OutputSome pins in Port 7 function as three-phase outputs for V, V
I/O Port P8Input/OutputP80 to P82, P86 are I/O ports equivalent to P3.
Timer AInput/OutputSome pins in Port 8 serve as input/output for Timer A and Timer B.
6
INT5
Three-phaseOutputPins P80 and P81 function as inputs three-phase outputs for U and U.
NMIInput
InputPins P80 and P81 function as inputs for INT5.
P8
is an input only port that also functions for NMI. The NMI interrupt is generated
3
when the input at this pin changes from “H” to “L”. The NMI
celled using software. The pull-up resistor cannot be set for this pin.
1-8
, W, and W.
function cannot be can-
Under
development
Specifications in this manual are tentative and subject to change
Rev. G
Description
Pin nameSignal nameI/O typeFunction
I/O Port P9Input/OutputThis is an 8-bit I/O equivalent to P3.
SIO 3/4Input/OutputPins in Port 9 function as transmit, receive and clock for SIO3 and SIO4.
Timer BInputSome pins in Port 9 serve as TB3 and TB4 pins.
P9
to P9
0
7
D-AOutputP9
, INT3InputPin P90 and P97 can be configured as INT2 and INT3.
INT2
MITSUBISHI MICROCOMPUTERS
M30222 Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
and P94 can be configured to function as a digital to analog output.
3
ANEX0Output
ANEX1Input
I/O Port 10Input/OutputThis is an 8-bit I/O port equivalent to P3.
to P10
P10
0
SEG23
SEG0 to
COM0 to COM3COM portsPins in this port function as COM output for LCD drive circuit.
VL1 to VL3Power supply for
AN0 to AN7InputPins in Port 10 function as analog inputs.
7
INT6
, INT7InputP106 and P107 function as inputs for INT6 and INT7.
SEG drive pinsPins in this port function as SEG output for LCD drive circuit.
LCD driver
These pins are used to connect to an optional external op amp.
Power supply input for LCD drive circuit.
1-9
Under
development
Specifications in this manual are tentative and subject to change
Rev. G
Memory
Operation of Functional Blocks
The M30222 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, serial I/O, D-A converter, DMAC, CRC calculation
circuit, A-D converter, LCD, and I/O ports. The following explains each unit.
Memory
Figure 1.5 is a memory map of the M30222 group. The linear address space of 1M bytes extends from
address 0000016 to FFFFF16. From FFFFF16 down is ROM. For example, in the M30222FG-XXXFP, there
is 256K bytes of internal ROM from C000016 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.
MITSUBISHI MICROCOMPUTERS
M30222 Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
From 0040016 up is RAM. For example, in the M30222FG-XXXFP, 20K bytes of internal RAM is mapped
to the space from 0040016 to 053FF16. 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, and timers, etc. Tables 1.5 to 1.9 show the
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.
00000
16
SFR area
053FF
16
16
Type No.Address YYYYY
M30222MG/FG/GP
Address XXXXX
C0000
For details, see Tables
16
00400
XXXXX
16
D0000
16
YYYYY16
16
16
FFFFF
16
1.5-1.9
Internal RAM area
Internal reserved
area
Internal ROM area
FFE0016
FFFDC
FFFFF
Undefined instruction
16
BRK instruction
Address match
Watchdog timer
16
Special page
vector table
Overflow
Single step
DBC
NMI
Reset
Fig. 1.5. Memory Map
1-10
Under
development
Specifications in this manual are tentative and subject to change
Rev. G
CPU
Central Processing Unit (CPU)
The CPU has a total of 13 registers shown in Figure 1.6. Seven of these registers (R0, R1, R2, R3, A0, A1,
and FB) come in two sets; therefore, these have two register banks.
MITSUBISHI MICROCOMPUTERS
M30222 Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
b15
(Note)
R0
(Note)
R1
(Note)
R2
(Note)
R3
(Note)
A0
(Note)
A1
(Note)
FB
H
b15 b8 b7 b0
H
b15 b0
b15
b15
b15 b0
b15 b0
These registers consist of two register banks.
Note:
b8 b7 b0
L
L
b0
b0
Data
registers
Address
registers
Frame base
registers
IPL
PC
b19
INTB
HL
b15
USP
b15
ISP
b15 b0
SB
b15
FLG
b0 b19
Program counter
b0
Interrupt table
register
b0
User stack pointer
b0
Interrupt stack
pointer
Static base
register
b0
Flag register
CDZSBOIU
Fig. 1.6. 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).
(3) Frame base register (FB)
Frame base register (FB) is configured with 16 bits, and is used for FB relative addressing.
1-11
Under
development
Specifications in this manual are tentative and subject to change
Rev. G
CPU
(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
configured 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.
MITSUBISHI MICROCOMPUTERS
M30222 Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
(8) Flag register (FLG)
Flag register (FLG) is configured with 11 bits, each bit is used as a flag. Figure 1.7 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
“0” when the interrupt is acknowledged.
• Bit 2: Zero flag (Z flag)
This flag is set to “1” when an arithmetic operation resulted in 0; otherwise, cleared to “0”.
• Bit 3: Sign flag (S flag)
This flag is set to “1” when 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 “1” when 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 “0”
when the interrupt is acknowledged.
• 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 “0” when a hardware interrupt is acknowledged or an INT instruction of software
interrupt Nos. 0 to 31 is executed.
1-12
Under
development
Specifications in this manual are tentative and subject to change
Rev. G
CPU
• 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.
IPL
MITSUBISHI MICROCOMPUTERS
M30222 Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
b0b15
CDZSBOIU
Flag register (FLG)
Carry flag
Debug flag
Zero flag
Fig. 1.7. Flag Register
Sign flag
Register bank select flag
Overflow flag
Interrupt enable flag
Stack pointer select flag
Reserved area
Processor interrupt priorit
Reserved area
1-13
Under
development
Specifications in this manual are tentative and subject to change
Rev. G
Reset
Reset
There are two kinds of resets; hardware and software. In both cases, operation is the same after the
reset. (See “Software Reset” for details.) 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.8 shows an example reset circuit. Figure 1.9 shows a reset sequence. Table 1.4 shows the pin
status when reset pin level is "L".
MITSUBISHI MICROCOMPUTERS
M30222 Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
RESET
Example when Vcc = 5V
Fig. 1.8. Example of Reset Circuit
in
X
RESET
BCLK
Address
Fig. 1.9. Reset sequence
V
CC
More than 20
cycles are
BCLK
24cycles
5V
V
CC
0V
5V
RESET
0V
needed
FFFFC
16
FFFFE
Content of reset
vector
16
4.0V
0.8V
Table 1.4. Pin status when Reset pin level is "L"
level
Status
is
output
Pin name
P3, P4
P6 to P10
SEG0 to SEG23
COM0 to COM3
Input port (with a pull-up resistor)
Input port (floating)
"H" level is output
"H"
1-14
Under
development
MITSUBISHI MICROCOMPUTERS
Specifications in this manual are tentative and subject to change
Rev. G
Special function registers
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Special function registers
Table 1.5. Location and value after reset of peripheral unit control registers (1)
M30222 Group
AddressRegister NameAcronym
0000
16
0001
16
0002
16
0003
16
000416Processor mode register 0PM0
000516Processor mode register 1PM1
000616System clock control register 0CM0
000716System clock control register 1CM1
0008
16
000916Address match interrupt enable registerAIER
000A16Protect registerPRCR
000B
16
000C
16
000D
16
000E16Watchdog timer start registerWDTS1.57
000F16Watchdog timer control registerWDC
03A116UART0 bit rate generatorU0BRG1.107
03A2
03A3
03A416UART0 transmit/receive control register 0U0C0
03A516UART0 transmit/receive control register 1U0C1
03A6
03A7
03A816UART1 transmit/receive mode registerU1MR
03A916UART1 bit rate generatorU1BRG1.107
03AA
03AB
03AC16UART1 transmit/receive control register 0U1C0
03AD16UART1 transmit/receive control register 1U1C1
03AE
03AF
03B016UART transmit/receive control register 2UCON
03B1
03B2
03B3
03B416Flash memory control register (Note)FMCR
03B5
03B6
03B7
03B816DMA0 request cause select registerDM0SL
03B9
03BA16DMA1DM1SL
03BB
03BC
03BD
03BE16CRC input registerCRCIN1.164
UART0 transmit buffer registerU0TB1.107
16
16
UART0 receive buffer registerU0RB1.107
16
16
16
UART1 transmit buffer registerU1TB1.107
16
16
UART1 receive buffer registerU1RB1.107
16
16
16
16
16
16
16
16
16
16
CRC data register
16
CRCD
Value after Reset
b7 b6 b5 b4 b3 b2 b1 b0
00
0
0000000
000000
000000
000000
0000000
16
00
16
00
16
00
16
00
16
00
16
00
16
00
16
00
16
08
16
02
16
00
16
08
16
02
16
0001
00
16
00
16
1.71, 1.85, 1.94
1.72, 1.85
1.72
1.72, 1.94
1.71
1.71
1.71, 1.90
1.71, 1.90
1.71
1.71, 1.90
1.83
1.83
1.83, 1.90
1.70, 1.73, 1.74,
1.77, 1.78
1.70, 1.73, 1.74,
1.77, 1.78, 1.95
1.70, 1.73, 1.74,
1.77, 1.78, 1.95
1.70, 1.72, 1.73,
1.77, 1.78
1.70, 1.73, 1.74,
1.77, 1.78, 1.95
1.84, 1.87, 1.90
1.84, 1.87, 1.90
1.84, 1.87, 1.90,
1.95
1.108, 1.114,
1.120
1.109
1.110
1.108, 1.114,
1.120
1.109
1.110
1.111
1.176
1.60
1.61
1.164
Note: This register only exists in flash memory version
? = Undefined
Page Number
1-18
Under
development
MITSUBISHI MICROCOMPUTERS
Specifications in this manual are tentative and subject to change
Rev. G
Special function registers
Table 1.8. Location and value after reset of peripheral unit control registers (4)
Table 1.9. Location and value after reset of peripheral unit control registers (5)
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
M30222 Group
Address
03C0
16
03C1
03C2
03C3
03C4
03C5
03C6
03C7
03C8
03C9
03CA
03CB
03CC
03CD
03CE
03CF
03D0
03D1
03D2
03D3
03D416A-D control register 2ADCON2
03D5
A-D register 0AD0
16
16
A-D register 1AD1
16
16
A-D register 2AD2
16
16
A-D register 3AD3
16
16
A-D register 4AD4
16
16
A-D register 5AD5
16
16
A-D register 6AD6
16
16
A-D register 7AD7
16
16
16
16
16
16
Register NameAcronym
03D616A-D control register 0ADCON0
03D716A-D control register 1ADCON1
Value after ResetSFR
b7 b6 b5 b4 b3 b2 b1 b0
0000
00000
00
16
Page Number
0
1.153, 1.155,
1.156, 1.157,
1.158, 1.159
1.153, 1.155,
1.156, 1.157,
1.158, 1.159
1.154
1.154
1.154
1.154
1.154
1.154
1.154
1.154
1.154
03D816D-A register 0DA01.163
03D9
16
03DA16D-A register 1DA11.163
03DB
16
03DC16D-A control registerDACON
03DD
16
03DE
16
03DF
16
03E0
16
03E1
16
03E2
16
03E3
16
03E4
16
03E516Port P3P31.170
03E6
16
03E716Port P3 direction registerPD3
00
16
00
16
1.163
1.170
03E816Port P4P41.170
03E9
16
03EA16Port P4 direction registerPD4
03EB
16
03EC16Port P6P61.170
03ED16Port P7P71.170
03EE16Port P6 direction registerPD6
03EF16Port P7 direction registerPD7
03F016Port P8P8
03F116Port P9P91.170
03F216Port P8 direction registerPD8
03F316Port P9 direction registerPD9
00
16
00
16
00
000000
00000
16
00
16
1.170
1.170
1.170
0
1.170
0
1.170
1.170
03F416Port P10P101.170
03F5
16
03F616Port P10 direction registerPD10
03F7
16
03F8
16
03F9
16
03FA
16
03FB
16
03FC16Pull-up control register 0PUR0
03FD16Pull-up control register 1PUR1
03FE16Pull-up control register 2PUR2
03FF16Real-time port control registerRTP
00
16
00
16
00
16
00
16
000
1.170
1.171
1.171
1.171
0
1.83
? = Undefined
1-19
Under
development
Specifications in this manual are tentative and subject to change
Rev. G
Software Reset
Software Reset
Writing “1” to bit 3 of the processor mode register 0 (address 000416) applies a (software) reset to the
microcomputer. A software reset has the same effect as a hardware reset. The contents of internal RAM
are preserved.
Figure 1.10 shows processor mode register 0 and 1.
Processor mode register 0 (Note)
b7 b6 b5 b4 b3 b2 b1 b0
0
0
0
Symbol Address When reset
PM0 0004
MITSUBISHI MICROCOMPUTERS
M30222 Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
16
00
16
Nothing is assigned.
Write "0" when writing to this these bits. If read, the value is indeterminate.
PM03
Nothing is assigned.
Write "0" when writing to this these bits. If read, the value is indeterminate.
Reserved bitMust always be set to "0"
Note : Set bit 1 of the protect register (address 000A
values to this register.
Processor mode register 1 (Note )
b7 b6 b5 b4 b3 b2 b1 b0
0
0
0
Note : Set bit 1 of the protect register (address 000A16) to “1” when writing new values
Symbol
PM1
Reserved bit
Nothing is assigned.
Write "0" when writing to this these bits. If read, the value is indeterminate.
PM17
to this register.
Bit nameFunctionBit symbol
Software reset
Bit nameFunctionBit symbol
Wait bit
bit
Address
0005
16
The device is reset when this bit is set
to “1”. The value of this bit is “0” when
read.
16
) to “1” when writing new
Must always be set to “0”
0 : No wait state
1 : Wait state inserted
When reset
0XXXXX00
2
WR
WR
O O
Fig. 1.10. Processor mode register 0 and 1
1-20
Under
development
Specifications in this manual are tentative and subject to change
Rev. G
Clock Generating Circuit
Clock generating Circuit
The clock generating circuit contains two oscillator circuits that supply the operating clock sources to
the CPU and internal peripheral units. Table 1.10 shows some examples of the main clock and
subclock generating circuits.
Table 1.10. Main clock and sub-clock generating circuits
Main clock generating circuitSub-clock generating circuit
MITSUBISHI MICROCOMPUTERS
M30222 Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Use of clockOperating clock source for CPU
Operating clock source for Internal
peripheral
Usable oscillatorCeramic or crystal oscillatorCrystal oscillator
Operating clock source
Count clock source for Timers A/B
Operating clock source for LCD
Figure 1.11 shows some examples of the main clock circuit, one using an oscillator connected to the
circuit, and the other one using an externally derived clock for input. Figure 1.12 shows some ex-
amples of sub-clock circuits, one using an oscillator connected to the circuit, and the other one using
an externally derived clock for input. Circuit constants in Figures 1.11 and 1.12 vary with each oscil-
lator used. Use the values recommended by the manufacturer of your oscillator.
Microcomputer
(Built-in feedback resistor)
Xin
Cin
Note: Insert a damping resistor if required. The resistance will vary depending on the oscillator and the oscillation drive
capacity setting. Use the value recommended by the maker of the oscillator.
When the oscillation drive capacity is set to low, check that oscillation is stable. Also, if the oscillator manufacturer's
data sheet specifies that a feedback resistor be added external to the chip, insert a feedback resistor between X
and X
Fig. 1.11. Examples of main clock
Xout
(Note)
Rd
out
following the instruction.
Cout
Microcomputer
XinXout
Open
Externally derived clock
Vcc
Vss
in
1-21
Under
development
Specifications in this manual are tentative and subject to change
Rev. G
Clock Generating Circuit
MITSUBISHI MICROCOMPUTERS
M30222 Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Microcomputer
(Built-in feedback resistor)
X
cin
X
cout
(Note 1)
R
C
cin
Note 1: Insert a damping resistor if required. The resistance will vary depending on the oscillator and the oscillation drive
capacity setting. Use the value recommended by the maker of the oscillator.
When the oscillation drive capacity is set to low, check that oscillation is stable. Also, if the oscillator manufacturer's
data sheet specifies that a feedback resistor be added external to the chip, insert a feedback resistor between X
and X
cout
following the instruction.
Note 2: Reference XCin to VDC supply.
C
cout
Fig. 1.12. Examples of sub-clock
Figure 1.13 shows a block diagram of the clock generating circuit.
X
CIN
X
COUT
CM04
Sub clock
RESET
Software reset
NMI
Interrupt request
level judgment
output
CM10 "1"
Write signal
WAIT instruction
Q
S
R
QS
R
CM05
X
IN
Main clock
X
OUT
CM02
VDC
1/32
Microcomputer
X
cin
Externally derived clock
(Note 2)
Vss
CM14=1
f
C1
C32
f
f
C
a
CM14=0
f
1
f
AD
c
b
Divider
f
C132
f
f
32
d
f
C
X
cout
Open
8
CM07=0
CM07=1
cin
BCLK
CM0i : Bit i at address 0006
CM1i : Bit i at address 0007
WDCi : Bit i at address 000F
Fig. 1.13. Clock generating circuit
b
a
16
16
16
1/21/21/21/2
CM06=1
CM06=0
CM17,CM16=01
CM06=0
CM17,CM16=00
CM06=0
CM17,CM16=10
CM06=0
CM17,CM16=11
Details of divider
c
1/2
d
1-22
Under
development
Specifications in this manual are tentative and subject to change
Rev. G
Clock Generating Circuit
The following paragraphs describes the clocks generated by the clock generating circuit.
(1) Main clock
The main clock is generated by the main clock oscillation circuit. After a reset, the clock is divided by 8 to
the BCLK. The clock can be stopped using the main clock stop bit (bit 5 at address 0006
clock, after switching the operating clock source of CPU to the sub-clock, reduces the power dissipation.
After the oscillation of the main clock oscillation circuit has stabilized, the drive capacity of the main clock
oscillation circuit can be reduced using the X
Reducing the drive capacity of the main clock oscillation circuit reduces the power dissipation. This bit
changes to “1” when shifting from high-speed/medium-speed mode to stop mode and at a reset. When
shifting from low-speed/low power dissipation mode to stop mode, the value before stop mode is retained.
(2) Sub-clock
The sub-clock is generated by the sub-clock oscillation circuit. No sub-clock is generated after a reset. After
oscillation is started using the port Xc select bit (bit 4 at address 0006
the BCLK by using the system clock select bit (bit 7 at address 0006
oscillation has fully stabilized before switching.
MITSUBISHI MICROCOMPUTERS
M30222 Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
16). Stopping the
IN-XOUT drive capacity select bit (bit 5 at address 000716).
16), the sub-clock can be selected as
16). However, be sure that the sub-clock
After the oscillation of the sub-clock oscillation circuit has stabilized, the drive capacity of the sub-clock
oscillation circuit can be reduced using the XCIN-XCOUT drive capacity select bit (bit 3 at address 000616).
Reducing the drive capacity of the sub-clock oscillation circuit reduces the power dissipation. This bit changes
to “1” when shifting to stop mode and at a reset.
(3) BCLK
The BCLK is the clock that drives the CPU, and is fc or the clock is derived by dividing the main clock by 1, 2,
4, 8, or 16. The BCLK is derived by dividing the main clock by 8 after a reset.
The main clock division select bit 0(bit 6 at address 0006
medium-speed to stop mode and at reset. When shifting from low-speed/low power dissipation mode to stop
mode, the value before stop mode is retained.
16) changes to “1” when shifting from high-speed/
(4) Peripheral function clock (f1, f8, f32, fAD)
The clock for the peripheral devices is derived from the main clock or by dividing it by 1, 8, or 32. The periph-
eral function clock is stopped by stopping the main clock or by setting the WAIT peripheral function clock stop
bit (bit 2 at 000616) to “1” and then executing a WAIT instruction.
(5) fC132
This clock is derived by dividing the sub-clock by 1 or 32. The clock is selected by fC132 clock select bit (bit4
at address 0007
16). It is used for the Timer A and Timer B counts, intermittent pull up operation of key input.
(6) fC
This clock has the same frequency as the sub-clock. It is used for the BCLK and for the Watchdog timer.
Figure 1.14 shows the system clock control registers 0 and 1.
1-23
Under
development
Specifications in this manual are tentative and subject to change
Rev. G
Clock Generating Circuit
System clock control register 0 (Note 1)
b7 b6 b5 b4 b3 b2 b1 b0
SymbolAddressWhen reset
CM00006
16
MITSUBISHI MICROCOMPUTERS
M30222 Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
48
16
CM00
CM01
CM02
CM03
CM04
CM05
CM06
CM07
Bit nameFunctionBit symbol
Clock output function
select bits
WAIT peripheral function
clock stop bit
Xcin-Xout drive capacity
select bit (Note 2)
Port Xc Select Bit
Main clock (Xin-X
stop bit (Note 3, 4)
Main clock division select
bit 0 (Note 6)
System clock select bit
(Note 5)
out
)
b1 b0
0 0 : I/O port P7
0 1 : fC1 output
1 0 : f
1
1 1 : Clock divide counter output
0 : Do not stop peripheral function clock in wait mode
1 : Stop peripheral function clock in wait mode (Note 7)
0 : LOW
1 : HIGH
0 : I/O port
1 : Xcin - Xcout generation
0 : Main clock on
1 : Main clock off
0 : CM16 and CM17 valid
1 : Division by 8 mode
Xin, Xout
0 :
Xcin, Xcout1 :
5
output
WR
Note 1: Set bit 0 of the protect register (address 000A16) to "1" before writing to this register.
Note 2: Changes to "1" when shifting to stop mode and at a reset.
Note 3: When inputting external clock, only clock oscillation buffer is stopped and clock input is acceptable.
Note 4: If this bit is set to "1", X
pulled up to X
Note 5: Set subclock (X
from "0" to "1". Do not write to both bits at the same time. Likewise, set the main clock stop bit (CM05) to "0" and
out
out
("H") via the feedback resistor.
cin
turns "H". The built-in feedback resistor remains being connected, so XIN turns
- X
) enable bit (CM04) to "1" and allow the subclock to stabilize before setting CM07 from
cout
allow the subclock to stabilize before settng CM07 bit from "1" to "0".
Note 6: This bit changes to "1" when shifting from high-speed/medium-speed mode to stop mode and at a reset. When
shifting from low-speed/low power dissipation mode to stop mode, the value before stop mode is retained.
C
, f
C132
, fC1, f
C32
Note 7: f
is not included.
System clock control register 1 (Note 1)
b7 b6 b5 b4 b3 b2 b1 b0
0
00
Note 1: Set bit 0 of the protect register (address 000A16) to "1" before writing to this register.
Note 2: This bit changes to "1" when shifting from high-speed/medium-speed mode to stop mode and at a reset. When
shifting from low-speed/low power dissipation mode to stop mode, the value before stop mode is retained.
Note 3: Can be selected when bit 6 of the system clock control register 0 (address 0006
fixed at 8.
Note 4: If this bit is set to "1", X
impedance state.
SymbolAddressWhen reset
CM10007
16
20
16
Bit nameFunctionBit symbol
CM10
Reserved bit
CM14
CM15
CM16
CM17
out
All clock stop control bit
(Note 4)
C132
clock select bit 0 : f
f
in-Xout
drive capacity
X
select bit (Note 2)
Main clock division
select bit 1 (Note 3)
goes "H", and the built-in feedback resistor is cut off. Xcin and Xcout goes into high
0 : Clock on
1 : All clocks off (stop mode)
Always set to
C32
1 : f
C1
0 : LOW
1 : HIGH
b7 b6
0 0 : No division mode
0 1 : Division by 2 mode
1 0 : Division by 4 mode
1 1 : Division by 16 mode
"0"
16
) is "0". If "1", division mode is
Fig. 1.14. Clock control registers 0 and 1
WR
1-24
Under
development
Specifications in this manual are tentative and subject to change
Rev. G
Clock output
Clock Output
The M30222 provides for a clock output signal (P73/CLKOUT pin) of user defined frequency. The clock
output function select bit (CM00, CM01) allows you to choose the clock source from f1, fC1, or a divide-by-
n clock for output to the P73/CLKOUT pin. The clock divide counter is an 8-bit counter whose count source
is f32, and its divide ratio can be set in the range of 0016 to FF16. Also, the clock divided counter can be
controlled for start or stop by the clock divide counter start flag. Figure 1.15 shows a block diagram of
clock output. Figure 1.16 shows a clock divided counter related register.
Nothing is assigned. Write "0" when writing to these bits.
When read, the value is indeterminate.
CDCS
Clock divided counter
start flg
Fig. 1.16. Clock divided counter related register
Bit name
1-25
0 : Stop
1 : Start
FunctionBit symbolWR
Under
development
Specifications in this manual are tentative and subject to change
Rev. G
Wait Mode
Wait Mode
When a WAIT instruction is executed, the BCLK stops and the microcomputer enters the wait mode. In
this mode, oscillation continues but the BCLK and Watchdog timer stop. Writing “1” to the WAIT periph-
eral function clock stop bit and executing a WAIT instruction stops the clock being supplied to the
internal peripheral functions, allowing power dissipation to be reduced. Table 1.11 shows the status of
the ports in wait mode.
Wait mode is cancelled by a hardware reset or an interrupt. If an interrupt is used to cancel wait mode,
the microcomputer restarts from the interrupt routine using as BCLK, the clock that had been selected
when the WAIT instruction was executed.
Usage Precautions
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 “1” within the instruction queue are
prefetched and then the program stops. So put at least four NOPs in succession either to the WAIT instruc-
tion or to the instruction that sets the every-clock stop bit to “1”.
MITSUBISHI MICROCOMPUTERS
M30222 Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Table 1.11. Port Status during wait mode
Pin
Port
CLKOUT/
P7
5
Mode
C
When f
When f1, clock divided
counter output selected
1 selected
Single-chip mode
Retainsstatus before wait mode
Does not stop
Retains status before stop mode.
Does not stop when the WAIT
peripheral function clock stop bit is "0".
When the WAIT peripheral function
clock stop bit is "1", the status immediately prior to entering wait mode
is maintained.
1-26
Under
development
Specifications in this manual are tentative and subject to change
Rev. G
Stop Mode
Stop Mode
Writing "1" to all-clock stop control bit (bit 0 at address 000716) stops all oscillation and the microcom-
puter enters stop mode. In stop mode, the content of the internal RAM is retained provided that VCC
remains above 2V.
Because the oscillation , BCLK, f1 to f32, fC, fC132, fC1, fC32 and fAD stops in stop mode, peripheral
functions such as the A-D converter and watchdog timer do not function. However, Timer A and Timer
B operate provided that the event counter mode is set to an external pulse, and UART0 to UART2
functions provided an external clock is selected. Table 1.12 shows the status of the ports in stop mode.
Stop mode is cancelled by a hardware reset or an interrupt. If an interrupt is to be used to cancel stop
mode, that interrupt must first have been enabled. If coming out of stop mode is caused by an interrupt,
that interrupt routine is executed.
When shifting from high-speed/medium-speed mode to stop mode and at a reset, the main clock divi-
sion select bit 0 (bit 6 at address 000616) is set to “1”. When shifting from low-speed/low power dissipa-
tion mode to stop mode, the value before stop mode is retained.
MITSUBISHI MICROCOMPUTERS
M30222 Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Usage Precautions
(1) When returning from stop mode by hardware reset, RESET pin must be set to “L” level 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 “1” within the instruction queue are
prefetched and then the program stops. 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”.
Table 1.12 Port status during stop mode
Pin Status
Port
CLKOUT/
P7
5
Mode
selected
fc1
When
When f1, clock divided
output selected
Retains status before stop mode
"H"
Retains
status before
stop
mode
1-27
Under
development
Specifications in this manual are tentative and subject to change
Rev. G
Status Transition of BCLK
Status Transition Of BCLK
Power dissipation can be reduced and low-voltage operation achieved by changing the count source for
BCLK. Table 1.13 shows the operating modes corresponding to the settings of system clock control
registers 0 and 1.
When reset, the device starts in division by 8 mode. The main clock division select bit 0(bit 6 at address
16) changes to “1” when shifting from high-speed/medium-speed to stop mode and at a reset. When
0006
shifting from low-speed/low power dissipation mode to stop mode, the value before stop mode is retained.
The following shows the operational modes of BCLK.
(1) Division by 2 mode
The main clock is divided by 2 to obtain the BCLK.
(2) Division by 4 mode
The main clock is divided by 4 to obtain the BCLK.
MITSUBISHI MICROCOMPUTERS
M30222 Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
(3) Division by 8 mode
The main clock is divided by 8 to obtain the BCLK. When reset, the device starts operating from this
mode. Before the user can go from this mode to no division mode, division by 2 mode, or division by 4
mode, the main clock must be oscillating stably. When going to low-speed or lower power consumption
mode, make sure the sub-clock is oscillating stably.
(4) Division by 16 mode
The main clock is divided by 16 to obtain the BCLK.
(5) No-division mode
The main clock is divided by 1 to obtain the BCLK.
(6) Low-speed mode
fC is used as the BCLK. Note that oscillation of both the main and sub-clocks must have stabilized before
transferring from this mode to another or vice versa. At least 2 to 3 seconds are required after the sub-
clock starts. Therefore, the program must be written to wait until this clock has stabilized immediately
after powering up and after stop mode is cancelled.
(7) Low power dissipation mode
fC is the BCLK and the main clock is stopped.
Note : Before the count source for BCLK can be changed from XIN to XCIN or vice versa, the clock to which
the count source is going to be switched must be oscillating stably. Allow time in software for
the source to stabilize before switching over the clock.
1-28
Under
CM17CM16CM07CM06CM05CM04BCLK operating mode
01000InvalidDivide by 2
10000InvalidDivide by 4
InvalidInvalid010InvalidDivide by 8
11000InvalidDivide by 16
01000InvalidNone
InvalidInvalid1Invalid01Low-speed
InvalidInvalid1Invalid11Low power dissipation
development
Specifications in this manual are tentative and subject to change
Rev. G
Status Transition of BCLK
Table 1.13. Operating modes dictated by settings of system clock control registers 0 and 1
MITSUBISHI MICROCOMPUTERS
M30222 Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
1-29
Under
development
Specifications in this manual are tentative and subject to change
Rev. G
Voltage Down Converter
Voltage Down Converter
The Voltage Down Converter (VDC) is a bandgap reference based voltage regulator used for generating
a low-voltage supply. The VDC block inputs the external supply VCC (up to 5.5 volts) and generates a 3.3-
volt (nominal) supply (VDD). Table 1.14 describes the specified voltage regulation. The VDC is pro-
grammable in terms of drive limit and power level. In low power mode, the VDC can source up to 20mA
and uses less than 10uA bias current. In high-power mode, the VDC can source up to 200mA. There is
a programmable option to limit the current of the VDC in high-power mode to about 80mA. The VDC
default state (from reset) is high-power mode with current limiting enabled. The current limiting is en-
abled at reset in order to avoid a large in-rush current to an external hold capacitor (required) on the
VDC pin. Once the external hold capacitor is charged, the current limiter can be disabled in software.
Figures 1.17 and 1.18 describe the programmable features of the VDC. The external hold capacitor is
required to stabilize the VDC and to minimize voltage ripple on the 3.3 volt supply during operation.
Table 1.15 describes the external hold capacitor requirements.
MITSUBISHI MICROCOMPUTERS
M30222 Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
Table 1.14. VDC voltage regulations
SignalDescription
Package Supply (Vcc)Range: 2.7v to 5.5v (input to VDC)
Internal Supply (Vdd)3.3v (nominal) +/- 10% (output from VDC) OR
Note: Whichever is smaller
Voltage Down Converter control
b7 b6 b5 b4 b3 b2 b1 b0
Vcc - 200mV @ Icc
register
Symbol Address When reset
VDCC 0018
Bit symbolWR
VDCC0
VDCC1
Nothing is assigned. Write "0" when writing to this bit. If read, the
value is indeterminate.
HPOWER
ILIMEN
Nothing is assigned. Write "0" when writing to these bits. If read, the