
FLASH MEMORY VERSION
7902 Group User’s Manual
20-20
20.2 Flash memory CPU reprogramming mode
(5) Block erase command
Writing of command code “2016” at the 1st bus
cycle and “D016” to the highest address (here,
A0 = 0) of the block to be erased at the 2nd
bus cycle initiate the automatic erase (erase
and erase-verify) operation for the specified
block. The completion of the automatic erase
operation can be recognized by the WSM status
bit (SR.7 of the status register) or the RY/BY
status bit (bit 0 at address 9E16).
Simultaneously with the start of the automatic
erase operation, the microcomputer enters the
read status register mode, allowing the contents
of the status register to be read. The read status
register mode is maintained until the read array
command (FF16) or the read lock bit status
command (7116) is written or until the flash
memory reset bit is set to “1.”
After the automatic erase operation is completed,
the result of it can be recognized by reading
out the status register. (Refer to section “20.2.6
Full status check.”)
Figure 20.2.4 shows the block erase operation
flowchart.
(6) Erase-all-unlocked-blocks command
When the lock bit invalidity select bit = “0,”
writing of command code “A716” at the 1st bus
cycle and “D016” at the 2nd bus cycle initiate
the automatic erase (erase and erase-verify)
operation for all the blocks whose lock bits are
“1” (unlocked state). The completion of the
automatic erase operation can be recognized
by the WSM status bit (SR.7 of the status
register) or the RY/BY status bit (bit 0 at address
9E16).
Simultaneously with the start of the automatic
erase operation, the microcomputer enters the
read status register mode, allowing the contents
of the status register to be read. The read status
register mode is maintained until the read array
command (FF16) or the read lock bit status
command (7116) is written or until the flash
memory reset bit is set to “1.”
After the automatic erase operation is completed,
the result of it can be recognized by reading
out the status register. (Refer to section “20.2.6
Full status check.”)
Figure 20.2.5 shows the erase-all-unlocked-
blocks operation flowchart.
Fig. 20.2.4 Block erase operation flowchart
Fig. 20.2.5 Erase-all-unlocked-blocks operation flowchart
Full status check
Start
Command code
“2016” is written.
“D016” is written to the highest
address of the block.
Block erase operation is
completed.
YES
See Figure 20.2.8.
RY/BY status bit = “1”?
(bit 0 at address 9E16)
NO
Lock bit invalidity select bit
← “0”
Lock bit invalidity select bit
← “1”
Lock bit invalidity select bit
← “0”
Blocks in locked state are erased.
Blocks in unlocked state are erased.
(Note)
Note: When the erase operation is performed with the lock bits invalida-
ted (the lock bit invalidity select bit = “1”), the lock bits of the blocks
to be erased become “1” (unlocked state) after the automatic erase
operation is completed.
Lock bit invalidity select bit
← “0”
Blocks in locked state are erased.
Blocks in unlocked state are erased.
YES
RY/BY status bit = “1”?
(bit 0 at address 9E16)
NO
Full status check
Start
Command code
“A716” is written.
“D016” is written.
Erase-all-unlocked-blocks
operation is completed.
See Figure 20.2.8.
Lock bit invalidity select bit
← “0”
Lock bit invalidity select bit
← “1”
Lock bit invalidity select bit
← “0”
All blocks are erased.
Only blocks in unlocked state are erased.
Lock bit invalidity select bit
← “0”
All blocks are erased.
Only blocks in unlocked state are erased.
(Note)
Note: When the erase operation is performed with the lock bits invalida-
ted (the lock bit invalidity select bit = “1”), the lock bits of all the
blocks become “1” (unlocked state) after the automatic erase
operation is completed.