R8C/1A Group, R8C/1B Group
18. Flash Memory
Rev.1.30
Dec 08, 2006
Page 259 of 315
REJ09B0252-0130
Figure 18.9 shows How to Set and Exit EW0 Mode. Figure 18.10 shows How to Set and Exit EW1 Mode.
Figure 18.9
How to Set and Exit EW0 Mode
Figure 18.10
How to Set and Exit EW1 Mode
Set registers CM0 and CM1
(1)
Transfer a rewrite control program which uses CPU
rewrite mode to any area other than the flash
memory.
Jump to the rewrite control program which has been
transferred to any area other than the flash memory.
(The subsequent process is executed by the rewrite
control program in an area other than the flash
memory.)
Write 0 to the FMR01 bit before writing 1
(CPU rewrite mode enabled)
(2)
Execute the read array command
(3)
Execute software commands
Write
0
to the FMR01 bit
(CPU rewrite mode disabled)
Jump to a specified address in the flash memory
Rewrite control program
NOTES :
1. Select 5 MHz or below for the CPU clock by the CM06 bit in the CM0 register and bits CM16 to CM17 in the CM1 register.
2. To set the FMR01 bit to 1, write 0 to the FMR01 bit before writing 1. Do not generate an interrupt between writing 0 and 1.
3. Disable the CPU rewrite mode after executing the read array command.
EW0 Mode Operating Procedure
Write 0 to the FMR01 bit before writing 1
(CPU rewrite mode enabled)
(1)
Write 0 to the FMR11 bit before writing 1
(EW1 mode)
Execute software commands
Write 0 to the FMR01 bit
(CPU rewrite mode disabled)
NOTE :
1. To set the FMR01 bit to 1, write 0 to the FMR01 bit before writing 1.
Do not generate an interrupt between writing 0 and 1.
EW1 Mode Operating Procedure
Program in ROM