![](http://datasheet.mmic.net.cn/90000/M37920F8CHP_datasheet_3496268/M37920F8CHP_125.png)
125
M37920F8CGP, M37920F8CHP, M37920FCCGP
M37920FCCHP, M37920FGCGP, M37920FGCHP
PRELIMINAR
Y
Notice:
This
is not
a final
specification.
Some
parametric
limits
are
subject
to change.
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER FLASH MEMORY VERSION
MITSUBISHI MICROCOMPUTERS
Function overview (CPU reprogramming mode)
The CPU reprogramming mode is available in the single-chip mode,
memory expansion mode, and boot mode to reprogram the user
ROM area only.
In the CPU reprogramming mode, the CPU erases, programs, and
reads the internal flash memory by writing software commands. Note
that the user-original reprogramming control software must be trans-
ferred to the internal RAM in advance to be executed.
The CPU reprogramming mode becomes active when “1” is written
into the flash memory control register ’s bit 1 (the CPU reprogram-
ming mode select bit) shown in Figure 120, and software commands
become acceptable.
In the CPU reprogramming mode, software commands and data are
all written to and read from even addresses (Note that address A0 in
byte addresses = “0”.) 16 bits at a time. Therefore, a software com-
mand consists of 8-bit units must be written only to an even address;
therefore, any data written to an odd address will be invalid.
The write state machine (WSM) in the flash memory controls the
erase and programming operations. What the status of the WSM
operation is and whether the programming or erase operation has
been completed normally or terminated by an error can be examined
by reading the status register.
Figure 120 shows the flash memory control register’s bit configura-
tion.
Bit 0 (the RY/BY status bit) is a read-only bit for indicating the WSM
operation. This bit goes to “0” (BUSY) while the automatic program-
ming/erase operation is active and goes to “1” (READY) during the
other operations.
Bit 1 serves as the CPU reprogramming mode select bit. Writing of
“1” to this bit selects the CPU reprogramming mode, and software
commands will be acceptable. Because the CPU cannot directly ac-
cess the internal flash memory in the CPU reprogramming mode,
writing to this bit 1 must be performed by the user-original repro-
gramming control software which has been transferred to the inter-
nal RAM in advance. To set bit 1 to “1”, it is necessary to write “0” and
“1” to this bit 1 successively. On the other hand, to clear this bit to “0”,
it is sufficient only to write “0”.
Bit 2 serves as the lock bit invalidity select bit, and setting this bit to
“1” invalidates the protection by a lock bit against erasing and pro-
gramming (block lock). The lock bit invalidity select bit can invali-
dates the lock bit function but set no lock bit itself. However, if erasing
is performed with this bit = “1”, a lock bit with value “0” (the locked
state) will be set to “1” (the unlocked state) after the erasing has
been completed. To set the lock bit invalidity select bit to “1”, write “0”
and “1” to this bit 2 successively with the CPU reprogramming mode
select bit = “1”. The manipulation of bit 2 is allowed only when the
CPU reprogramming mode select bit = “1”.
Bit 3 (the flash memory reset bit) resets the control circuit of the in-
ternal flash memory and is used when the CPU reprogramming
mode is terminated or when an abnormal access to the flash
memory happens. Writing of “1” to bit 3 with the CPU reprogramming
mode select bit = “1” preforms the reset operation. To remove the
reset, write “0” to bit 3 subsequently.
Bit 5 serves as the user ROM area select bit and is valid only in the
boot mode. Setting this bit to “1” in the boot mode switches an acces-
sible area from the boot ROM area to the user ROM area. To use the
CPU reprogramming mode in the boot mode, set this bit to “1”. Note
that when the microcomputer is booted up in the user ROM area,
only the user ROM area is accessible and bit 5 is invalid; on the other
hand, when the microcomputer is in the boot mode, bit 5 is valid in-
dependent of the CPU reprogramming mode. To rewrite bit 5, ex-
ecute the user-original reprogramming control software transferred
to the internal RAM in advance.
Figure 121 shows the CPU reprogramming mode set/termination
flowchart, and be sure to follow this flowchart. As shown in Note 1 of
Figure 121, before selecting the CPU reprogramming mode, set the
processor mode register 1’s bit 7 (the internal ROM bus cycle select
bit) to “0” and set flag I to “1” to avoid an interrupt request input.
When an NMI interrupt or a watchdog timer interrupt request is gen-
erated in the CPU reprogramming mode, when an input to the
RESET pin is “L”, or when the software reset is performed, the flash
memory control circuit and flash memory control register will be re-
set.
When the flash memory is reset during the erase or programming
operation, this operation is cancelled and the target block’s data will
be invalid. Just before writing a software command related to the
erase/programming operation, be sure to write to the watchdog
timer. Also, be sure to set the NMI pin to “H” to avoid an NMI interrupt
request occurrence.