
25. Flash Memory
Figure 25.6
Setting Procedure in CPU Rewrite Mode
Start
End
Set the MCD register
Set the CPU clock frequency 10 MHz or lower
in CPU rewrite mode
Set the PM12 bit in the PM1 register to 1
Internal memory wait state inserted
Transfer the rewrite control program to an area
other than the flash memory
Jump to the rewrite control program transferred to an
area other than the flash memory
Execute the following procedure using the rewrite
control program transferred to an area other than
the flash memory
Set the FMR05 bit in the FMR0 register to 1
<In boot mode>
User ROM area accessed
Set the FMR01 bit in the FMR0 register to 0
Set the FMR01 bit in the FMR0 register to 1
CPU rewrite mode enabled(2)
Execute the software commands
Execute the read array command(3)
Set the FMR01 bit in the FMR0 register to 0
CPU rewrite mode disabled(4)
Set the FMR05 bit in the FMR 0 register to 0
<In boot mode>
Boot ROM area accessed
Jump to a given address in the flash memory
Rewrite control program
NOTES:
1. In CPU rewrite mode;
- Set the CPU clock frequency to 10 MHz or lower using MCD register.
- Set the PM12 bit in the PM1 register to 1 (internal memory wait state inserted).
2. To set the FMR01 bit to 1, set it to 1 immediately after setting it to 0. Write the value to the FMR0 register in bytes. Do not
generate an interrupt or a DMA or DMACII transfer between setting the FMR01 bit to 0 and to 1. Set it by the program located
in an area other than the flash memory in CPU rewrite mode. Set it while the NMI pin level is held "H".
3. Disable CPU rewrite mode after executing the read array command.
4. To change the FMR01 bit from 1 to 0, write to address 0057h in words in read array mode. Write 00h into 8 high-order bits.
(note 1)