104
7641 Group
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER
MITSUBISHI MICROCOMPUTERS
PRELIMINARY
Notice: This is not a final specification.
change.
Some parametric limits are subject to
Outline Performance (CPU Rewrite Mode)
CPU rewrite mode is usable in the single-chip, memory expansion
or Boot mode. The only User ROM area can be rewritten in CPU
rewrite mode.
In CPU rewrite mode, the CPU erases, programs and reads the in-
ternal flash memory as instructed by software commands. This
rewrite control program must be transferred to a memory such as
the internal RAM before it can be executed.
The MCU enters CPU rewrite mode by applying 4.50 V to 5.25 V
to the CNV
SS
pin and setting “1” to the CPU Rewrite Mode Select
Bit (bit 1 of address 006A
16
). Software commands are accepted
once the mode is entered.
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 89 shows the flash memory control register.
Bit 0 is the RY/BY status flag used exclusively to read the operat-
ing status of the flash memory. During programming and erase
operations, it is “0” (busy). Otherwise, it is “1” (ready). This is
equivalent to the RY/BY pin function in parallel I/O mode.
Bit 1 is the CPU Rewrite Mode Select Bit. When this bit is set to
“1”, the MCU enters CPU rewrite mode. Software commands are
F
F
l
M
a
s
C
h
R
m
e
m
o
r
y
c
o
n
t
r
o
l
r
e
g
i
s
t
e
r
(
a
d
d
r
e
s
s
0
0
6
A
1
6
)
R
Y
0
1
P
0
1
P
0
1
l
a
0
1
s
0
1
e
/
:
U
:
:
U
:
:
s
:
:
e
:
:
s
B
B
R
Y
u
e
r
N
C
r
N
C
h
N
R
r
U
B
e
r
s
a
e
o
r
P
e
o
r
P
m
o
e
a
s
e
o
o
v
s
y
d
w
m
U
w
m
U
e
r
m
s
e
r
r
t
e
t
a
(
y
r
i
a
r
r
i
a
r
m
a
t
e
a
R
R
d
t
b
u
e
s
n
f
l
g
a
g
w
:
i
r
i
t
t
e
n
o
r
e
r
a
s
e
d
)
C
t
e
l
e
t
e
l
e
o
l
m
w
m
w
r
o
m
o
d
t
e
o
o
d
i
t
e
y
p
e
d
e
d
e
e
r
a
e
m
e
m
s
t
(
s
S
o
e
(
S
o
e
i
o
e
o
d
n
o
d
t
n
l
e
f
t
e
t
r
f
e
b
i
c
w
(
y
t
w
t
t
a
S
f
a
b
r
o
l
a
r
i
t
w
g
e
(
N
c
o
a
o
m
r
e
t
e
m
c
a
o
2
)
n
m
o
i
e
f
t
d
m
s
a
i
n
n
v
d
a
s
l
i
d
a
)
c
r
m
c
e
p
t
a
b
l
e
)
C
c
o
m
m
a
n
d
s
i
n
v
a
l
i
d
)
r
F
r
(
N
o
t
e
3
)
U
O
O
b
i
/
B
M
M
t
s
o
a
a
(
I
o
r
r
n
t
e
e
d
a
a
e
a
r
a
a
i
n
e
c
c
i
a
c
c
t
e
e
e
s
s
s
a
e
s
s
t
l
e
e
r
e
c
d
d
e
t
b
i
t
f
R
a
d
/
“
0
”
a
t
w
r
i
t
e
)
b0
b7
Notes 1
: The contents of flash memory control register are
“
XXX00001
”
just after reset release.
2
: For this bit to be set to
“
1
”
, the user needs to write
“
0
”
and then
“
1
”
to it in succession. If it is not
this procedure, this bit will not be set to
”
1
”
. Additionally, it is required to ensure that no interrupt
will be generated during that interval.
Use the control program in the area except the built-in flash memory for write to this bit.
3
: This bit is valid when the CPU rewrite mode select bit is
“
1
”
. Set this bit 3 to
“
0
”
subsequently after
setting bit 3 to
“
1
”
.
4
: Use the control program in the area except the built-in flash memory for write to this bit.
accepted once the mode is entered. In CPU rewrite mode, the
CPU becomes unable to access the internal flash memory directly.
Therefore, use the control program in a memory other than inter-
nal flash memory for write to bit 1. 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
“
0
”
.
Bit 2 is the CPU Rewrite Mode Entry Flag. This flag indicates
“
1
”
in
CPU rewrite mode, so that reading this flag can check whether
CPU rewrite mode has been entered or not.
Bit 3 is the flash memory reset bit used to reset the control circuit
of internal flash memory. This bit is used when exiting CPU rewrite
mode and when flash memory access has failed. When the CPU
Rewrite Mode Select Bit is
“
1
”
, setting
“
1
”
for this bit resets the
control circuit. To set this bit to
“
1
”
, it is necessary to write
“
0
”
and
then write
“
1
”
in succession. To release the reset, it is necessary
to set this bit to
“
0
”
.
Bit 4 is the User Area/Boot Area Select Bit. When this bit is set to
“
1
”
, Boot ROM area is accessed, and CPU rewrite mode in Boot
ROM area is available. In Boot mode, this bit is set to
“
1
”
auto-
matically. Reprogramming of this bit must be in a memory other
than internal flash memory.
Figure 90 shows a flowchart for setting/releasing CPU rewrite
mode.
Fig. 89 Structure of flash memory control register