56
3850 Group (Spec. H/A)
SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER
MITSUBISHI MICROCOMPUTERS
Software Commands (CPU Rewrite Mode)
Table 12 lists the software commands.
After setting the CPU Rewrite Mode Select Bit of the flash memory
control register to
“
1
”
, execute a software command to specify an
erase or program operation.
Each software command is explained below.
G
Read Array Command (FF
16
)
The read array mode is entered by writing the command code
“
FF
16
”
in the first bus cycle. When an address to be read is input in
one of the bus cycles that follow, the contents of the specified ad-
dress are read out at the data bus (D
0
to D
7
).
The read array mode is retained intact until another command is
written.
G
Read Status Register Command (70
16
)
The read status register mode is entered by writing the command
code
“
70
16
”
in the first bus cycle. The contents of the status regis-
ter are read out at the data bus (D
0
to D
7
) by a read in the second
bus cycle.
The status register is explained in the next section.
G
Clear Status Register Command (50
16
)
This command is used to clear the bits SR1, SR4, and SR5 of the
status register after they have been set. These bits indicate that
operation has ended in an error. To use this command, write the
command code
“
50
16
”
in the first bus cycle.
G
Program Command (40
16
)
Program operation starts when the command code
“
40
16
”
is writ-
ten in the first bus cycle. Then, if the address and data to program
are written in the 2nd bus cycle, program operation (data program-
ming and verification) will start.
Whether the write operation is completed can be confirmed by
reading the status register or the RY/BY Status Flag of the flash
memory control register. When the program starts, the read status
Table 12 List of software commands (CPU rewrite mode)
register mode is entered automatically and the contents of the sta-
tus register is read at the data bus (D
0
to D
7
). The status register
bit 7 (SR7) is set to
“
0
”
at the same time the write operation starts
and is returned to
“
1
”
upon completion of the write operation. In
this case, the read status register mode remains active until the
next command is written.
The RY/BY Status Flag is
“
0
”
(busy) during write operation and
“
1
”
(ready) when the write operation is completed as is the status reg-
ister bit 7.
At program end, program results can be checked by reading bit 4
(SR4) of the status register.
Fig. 60 Program flowchart
S
t
a
r
t
Write 40
16
S
t
a
t
u
s
e
r
a
e
d
g
i
s
t
e
r
r
Program completed
(Read array command
“
FF
16
”
write)
NO
Y
E
S
W
W
r
r
i
i
t
t
e
e
a
d
d
a
d
t
a
r
e
s
s
S
R
4
=
0
P
r
o
e
g
r
r
r
o
a
r
m
NO
Y
E
S
S
R
7
=
r
1
o
Y
R
Y
/
B
=
1
Write
Command
P
r
l
r
o
g
r
a
m
C
l
e
a
r
s
t
a
t
u
s
r
e
g
i
s
t
e
r
R
e
e
a
d
a
r
r
a
y
R
a
d
s
t
a
t
u
s
r
e
g
i
s
t
e
r
X
X
X
First bus cycle
S
e
c
o
n
d
b
u
s
c
y
c
l
e
F
F
1
6
7
5
0
1
0
1
6
6
4
0
1
6
W
r
i
t
e
W
W
r
r
i
i
t
t
e
e
W
r
i
t
e
X
S
R
D
R
e
a
d
W
r
i
t
e
E
a
s
e
a
l
l
b
l
o
c
k
s
2
0
1
6
W
r
i
t
e
X
2
0
1
0
1
6
W
r
i
t
e
(Note 2)
W
A
(Note 3)
W
D
(
N
o
t
e
3
)
B
o
c
k
e
r
a
s
e
2
0
1
6
W
r
i
t
e
D
6
W
r
i
t
e
B
A
(Note 4)
Mode
Address
Mode
A
d
d
r
e
s
s
Data
(D
0
to D
7
)
(
D
0
t
o
D
7
)
(Note 1)
Notes 1:
X denotes a given address in the User ROM area .
2:
SRD = Status Register Data
3:
WA = Write Address, WD = Write Data
4:
BA = Block Address to be erased (Input the maximum address of each block.)
C
y
c
l
e
n
u
m
b
e
r
1
2
1
2
2
2
X
X
X
D
a
t
a