
1-188
Under
development
Specifications in this manual are tentative and subject to change
Rev. H
CPU Rewrite Mode (Flash Memory Version)
MITSUBISHI MICROCOMPUTERS
M30222 Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
CPU Rewrite Mode
In CPU rewrite mode, the on-chip flash memory can be operated on (read, program, or erase) under
control of the Central Processing Unit (CPU). Only the user ROM area shown in Figure 1.149 can be
rewritten; the boot ROM area cannot be rewritten. Make sure the program and block erase commands
are issued for only the user ROM area and each block area.
The control program for CPU rewrite mode can be stored in either user ROM or boot ROM area. In the
CPU rewrite mode, because the flash memory cannot be read from the CPU, the rewrite control pro-
gram must be transferred to RAM memory before it can be executed.
Microcomputer Mode and Boot Mode
Normal microcomputer mode is entered when the microcomputer is reset with pulling CNVss pin low. In this
case, the CPU starts executing the control program in the user ROM area. When the microcomputer is reset
and both the CNVss pin and P74 (CE) pin are pulled high, the CPU starts operating using the control program
in the boot ROM area (program start address is C000016, 7D00016). This mode is called the "boot" mode.
The control program for CPU rewrite mode must be written into the user ROM or boot ROM area beforehand.
(If the control program is written into the boot ROM area, standard serial I/O mode becomes unusable.) See
Figure 1.149 for details about the boot ROM area.
Outline Performance
In the CPU rewrite mode, the CPU erases, programs, and reads the internal flash memory as instructed by
software commands. This rewrite control program must be transferred to internal RAM before it can be ex-
ecuted.
The CPU rewrite mode is accessed by writing "1" for the CPU rewrite mode select bit (bit 1 in address
034B416). Software commands are accepted once the mode is accessed.
In the CPU rewrite mode, software commands are used to write and read data into even-numbered addresses
("0" for byte address A0) in 16-bit units. Always write 8-bit software comands into even-numbered address.
Commands are ignored with odd-numbered addresses.
Use software commands to control program and erase operations. Whether a program or erase operation has
terminated normally or in error can be verified by reading the status register. Figure 1.150 shows the flash
memory control register.
Bit 0 is the RY/BY status flag used exclusively to read the operating status of the flash memory. During
programming and erase operations, it is "0". Otherwise, it is "1".
Bit 1 is the CPU rewrite mode select bit. When this bit is set to "1", the M30222 accesses the CPU rewrite
mode. Software commands are accepted once the mode is accessed. In CPU rewrite mode, the CPU be-
comes unable to access the internal flash memory directly. Therefore, the control program that sets this bit
must be executed out of RAM. To set this bit to "1", it is necessary to write "0" and then write "1" in succession.
The bit can be set to "0" by only writing a "0".