159
CPU Rewrite Mode
M
i
t
s
u
M
S
b
i
s
3
M
h
0
I
C
i
m
2
R
i
1
O
c
r
8
C
o
c
o
G
M
m
p
r
P
u
t
u
T
e
r
p
R
s
o
U
S
I
N
G
L
E
-
C
H
I
P
1
6
-
B
I
T
C
M
O
O
E
Command
Program verify
Read
Program
03B6
16
First bus cycle
Second bus cycle
00
16
40
16
C0
16
Write
Write
Write
Program
address
Write
Read
Erase verify
A0
16
Write
Verify
address
Verify
data
Read
Erase
20
16
Write
03B6
16
20
16
Write
Verify
address
Reset
FF
16
Write
Mode
Address
Mode
Address
Data
(D
0
to D
7
)
Data
(D
0
to D
7
)
03B6
16
03B6
16
03B6
16
03B6
16
03B6
16
Program
data
Verify
data
FF
16
Write
03B6
16
Software Commands
Table 74 lists the software commands available with the M30218 group (flash memory version).
When CPU rewrite mode is enabled, write software commands to the flash command register to specify
the operation to erase or program.
The content of each software command is explained below.
Table 74. List of Software Commands (CPU Rewrite Mode)
Read Command (00
16
)
The read mode is entered by writing the command code “00
16
” to the flash command register in the
first bus cycle. When an address to be read is input in one of the bus cycles that follow, the content of
the specified address is read out at the data bus (D
0
–D
7
), 8 bits at a time.
The read mode is retained intact until another command is written.
After reset and after the reset command is executed, the read mode is set.
Program Command (40
16
)
The program mode is entered by writing the command code “40
16
” to the flash command register in
the first bus cycle. When the user execute an instruction to write byte data to the desired address (e.g.,
STE instruction) in the second bus cycle, the flash memory control circuit executes the program op-
eration. The program operation requires approximately 20
μ
s. Wait for 20
μ
s or more before the user
go to the next processing.
During program operation, the watchdog timer remains idle, with the value “7FFF
16
” set in it.
Note 1: The write operation is not completed immediately by writing a program command once. The
user must always execute a program-verify command after each program command executed. And if
verification fails, the user need to execute the program command repeatedly until the verification
passes. See Figure 129 for an example of a programming flowchart.