Renesas M16C/64A Series User Manual page 707

Table of Contents

Advertisement

M16C/64A Group
30.8.1
EW0 Mode
The MCU enters CPU rewrite mode when the FMR01 bit in the FMR0 register is set to 1 (CPU rewrite
mode enabled) and is ready to accept commands. EW0 mode is selected by setting the FMR60 bit in
the FMR6 register to 0. Figure 30.5 shows Setting and Resetting of EW0 Mode
Procedure to Enter EW0 Mode
Single-chip mode or memory expansion mode
Transfer the rewrite control program to an area
other than flash memory
Set registers CM0, CM1, and PM1
(Set the CPU clock 10 MHz or lower with one wait)
Jump to the rewrite control program transferred to
an area other than the flash memory. (In the
following steps, use the rewrite control program in
an area other than the flash memory)
Figure 30.5
Setting and Resetting of EW0 Mode
Do not execute the following instructions in EW0 mode:
UND instruction, INTO instruction, JMPS instruction, JSRS instruction, and BRK instruction.
The following are interrupts which can be used in EW0 mode and operations when the interrupts occur
during auto-erase operation or auto-program operation:
• Maskable interrupt
To use the interrupt, allocate a variable vector table in an area other than the flash memory.
• NMI , watchdog timer, oscillator stop/restart detect, voltage detect 1, and voltage detect 2 interrupts
Auto-erase operation or auto-program operation is forcibly stopped as soon as the interrupt occurs,
and then the interrupt process starts.
After the flash memory restart, execute auto-erase operation again and confirm that it is completed
as expected in order to read the correct value.
The watchdog timer operates even in auto erasing or auto programming operation. Refresh the
watchdog timer regularly.
R01UH0136EJ0210 Rev.2.10
Jul 31, 2012
Start
Rewrite control program
Set the FMR01 bit to 0, and then 1 (CPU rewrite mode
enabled).
Set the FMR11 bit to 1 (FMR6 register write enabled),
then set the FMR6 register to 02h (EW0 mode),
and then set the FMR11 bit to 0 (FMR6 register write
disabled).
Execute the software commands
Execute the read array command
Set the FMR01 bit to 0
(CPU rewrite mode disabled)
Jump to the desired address in the flash memory
End
30. Flash Memory
Page 674 of 800

Advertisement

Table of Contents
loading

Table of Contents