
25. Flash Memory
25.3.1
Flash Memory Control Register (FMR0 and FMR1 Registers)
Figure 25.4
FMR0 Register
25.3.1.1
FMR00 Bit
The FMR00 bit indicates the operating status of the flash memory. Its value is 0 while the program, block erase,
lock bit program, or read lock bit status command is being executed, otherwise, it is 1.
25.3.1.2
FMR01 Bit
The flash memory can accept commands when the FMR01 bit is set to 1 (CPU rewrite mode enabled). Set the
FMR05 bit to 1 (user ROM area accessed) in boot mode.
b7
0
b6 b5 b4
b1
b2
b3
Symbol
FMR0
Address
0057h
After Reset
0000 0001b
b0
Function
Bit Symbol
Bit Name
RW
FMR05
FMR07
Flash memory stop bit(3, 5)
Erase status flag(4)
RW
RO
(b4)
RW
FMSTP
User ROM area select bit(3)
(available in boot mode only)
Program status flag(4)
FMR06
Flash Memory Control Register 0
Reserved bit
CPU rewrite mode select bit(1, 7)
FMR01
RW
Lock bit disable select bit(2)
RW
FMR02
0: BUSY (programming or erasing in progress)(6)
1: READY
RY/BY status flag
FMR00
RO
0: CPU rewrite mode disabled
1: CPU rewrite mode enable
0: Lock bit enabled
1: Lock bit disabled
0: Flash memory started
1: Flash memory stopped
(enters low-power consumption state and flash
memory is initialized)
Set to 0
0: Boot ROM area accessed
1: User ROM area accessed
0: Successfully completed
1: Terminated by error
0: Successfully completed
1: Terminated by error
NOTES:
1. Set the FMR01 bit while the NMI pin level is held "H". Set it by the program located in an area other than the flash memory in
CPU rewrite mode.
2. Set the FMR02 bit to 1 immediately after setting it first to 0 while the FMR01 bit is set to 1. Write the value in bytes. Do not
generate an interrupt or a DMA or DMACII transfer between setting the FMR02 bit to 0 and setting it to 1.
3. Set bits FMSTP and FMR05 by the program located in an area other than the flash memory.
4. Bits FMR07 and FMR06 are set to 0 by executing the clear status command.
5. The FMSTP bit is enabled when the FMR01 bit is set to 1 (CPU rewrite mode enabled). Bits FMSTP can be set to 1 when the
FMR01 bit is set to 0, but the flash memory does not enter low-power consumption state nor is it initialized.
6. Write and read operations by lock bit program command and read lock bit status command are included.
7.
To change the FMR01 register from 0 to 1, set the FMR01 bit to 1 immediately after setting it first to 0. Write the value in
bytes. Do not generate an interrupt or a DMA or DMACII transfer between setting the FMR01 bit to 0 and setting it to 1.
To change the FMR01 bit from 1 to 0, write to the address 0057h in words in read array mode. Write 00h into 8 high-order bits.
e.g., to change the FMR01 bit from 1 to 0;
Assembly language: mov.w #0000h, 0057h