Renesas M16C Laptop User Manual


 
Rev.1.10 Jul 01, 2005 page 246 of 318
REJ09B0124-0110
M16C/6N Group (M16C/6NK, M16C/6NM) 20. Flash Memory Version
Under development
This document is under development and its contents are subject to change.
Figure 20.6 Setting and Resetting of EW1 Mode
Figure 20.5 Setting and Resetting of EW0 Mode
Procedure to enter EW0 mode
Set CM0, CM1, and PM1 registers
(1)
Transfer the rewrite control program in CPU rewrite
mode to a space other than the flash memory
(5)
Single-chip mode or boot mode
Execute software commands
Set the FMR01 bit to "0"
(CPU rewrite mode disabled)
Jump to the rewrite control program transferred to
a space other than the flash memory.
(In the following steps, use the rewrite control
program in a space other than the flash memory.)
Rewrite control program
NOTES:
1.In CPU rewrite mode, set the CM06 bit in the CM0 register and CM17 to CM16 bits in the CM1 register to CPU
clock frequency of 10 MHz or less. Set the PM17 bit in the PM1 register to "1" (with wait state).
2.Set the FMR01 bit to "1" immediately after setting it to "0". Do not generate an interrupts or DMA transfer between
setting the bit to "0" and setting it to "1".
Set the bit to "0" if setting to "0". Set this bit in a space other than the flash memory while the NMI pin is held "H".
3.Exit CPU rewrite mode after executing the read array command.
4.When CPU rewrite mode is exited while the FMR05 bit is set to "1", the user ROM area can be accessed.
5.When in CPU rewrite mode, the PM10 and PM13 bits in the PM1 register are set to "1". The rewrite control program
can only be executed in the internal RAM area.
In boot mode only
set the FMR05 bit to "1" (user ROM area access)
Set the FMR01 bit to "1" (CPU rewrite mode
enabled) after writing "0"
(2)
Execute the read array command
(3)
In boot mode only
Set the FMR05 bit to "0" (Boot ROM area
accessed)
(4)
Jump to a desired address in the flash memory
Procedure to enter EW1 mode
Set CM0, CM1, and PM1 registers
(2)
Set the FMR01 bit to "1" (CPU rewrite mode
enabled) after writing "0"
Set the FMR11 bit to "1" (EW1 mode) after
writing "0" (EW1 mode)
(3)
Single-chip mode
(1)
Execute the software commands
Set the FMR01 bit to "0"
(CPU rewrite mode disabled)
NOTES:
1.In EW1 mode, do not enter the boot mode.
2.In CPU rewrite mode, set the CM06 bit in the CM0 register and the CM17 to CM16 bits in the CM1 register to
CPU clock frequency of 10.0 MHz or less. Set the PM17 bit in the PM1 register to "1" (with wait state).
3.Set the FMR01 bit to "1" immediately after setting it to "0". Do not generate an interrupt or a DMA transfer
between setting the bit to "0" and setting it to "1".
Set the FMR11 bit to "1" immediately after setting it to "0" while the FMR01 bit is set to "1".
Do not generate an interrupt or a DMA transfer between setting the FMR11 bit to "0" and setting it to "1".
Set the FMR01 and FMR11 bits while "H" is applied to the NMI pin.
Program in the ROM