
CPU Rewrite Mode
Specifications in this manual are tentative and subject to change
Rev. E
MITSUBISHI MICROCOMPUTERS
M30245 Group
SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
192
5. Block Erase Command (2016/D016)
By writing the command code “2016” in the first bus cycle and the confirmation command code
“D016” in the second bus cycle to the block address of a flash memory block, the system initiates
an auto erase (erase and erase verify) operation. Figure 1.144 is an example of a block erase
flowchart.
Read the status register or the flash memory control register 0 to confirm the completion of the
auto erase operation. At the same time the auto erase operation starts, the read status register
mode is automatically entered, so the contents of the status register can be read out. The status
register bit 7 (SR7) is set to “0” at the same time the auto erase operation starts and is returned
to “1” when the auto erase operation is completed. The read status register mode remains active
until the Read Array command (FF16) or Read Lock Bit Status command (7116) is written or the
flash memory is reset using its reset bit.
The RY/BY status flag of the flash memory control register 0 is “0” during auto erase operation
and “1” when the auto erase operation and status register bit 7 is completed.
After the auto erase operation is completed, the status register can read for the results of the
auto erase operation. Refer to the status register for more details.
A lock bit protects each block of the flash memory against erasure. Refer to the data protect
function section for more details.
6. Erase All Unlock Blocks Command (A716/D016)
By writing the command code “A716” in the first bus cycle and the confirmation command code
“D016” in the second bus cycle that follows, the system starts erasing blocks successively.
Reading the status register or the flash memory control register 0 confirms whether the erase all
unlock blocks command was terminated in the same way as for block erase. Also, the status
register can read out the results of the auto erase operation.
When the lock bit disable bit of the flash memory control register 0 = “1”, all blocks are erased
regardless of how the lock bit is set. On the other hand, when the lock bit disable bit = “0”, the
function of the lock bit is effective and only unlocked blocks (where lock bit data = “1”) are erased.
Figure 1.144. Block erase flowchart
Write 2016
Write D016
Block address
Check full status check
Block erase
completed
Start
RY/BY status flag
= 1?
NO
YES