Renesas M16C/64A Series User Manual page 709

Table of Contents

Advertisement

M16C/64A Group
30.8.2
EW1 Mode
EW1 mode is selected by setting the FMR60 bit in the FMR6 register to 1 after setting the FMR01 bit in
the FMR0 register to 1. Figure 30.6 shows Setting and Resetting of EW1 Mode.
When a program or erase operation is initiated, the CPU halts all program execution until the operation
is completed.
Figure 30.6
Setting and Resetting of EW1 Mode
The following are interrupts which can be used in EW1 mode and operations when the interrupts occur
during auto-erase operation or auto-program operation:
• Maskable interrupt
Auto-erase operation or auto-program operation has a higher priority level and the interrupt
request has to wait. The interrupt process is executed after auto-erase operation or auto-program
operation is completed.
• NMI , watchdog timer, oscillator stop/restart detect, voltage detect 1, and voltage detect 2 interrupts
Auto-erase operation or auto-program operation forcibly stops 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 stops its counting during auto-erase or auto-programming. Do not use EW1 mode
while the CSPRO bit in the CSPR register is 1 (count source protection mode enabled). Use EW0
mode.
R01UH0136EJ0210 Rev.2.10
Jul 31, 2012
Procedure to Enter EW1 Mode
Set registers CM0, CM1, and PM1
(Set the CPU clock 10 MHz or lower with one wait)
Write 0 and then 1 (CPU rewrite mode enabled) to the FMR01
bit. Set the FMR11 bit to 1 (FMR6 register rewrite enabled),
then set the FMR6 register to 03h (EW1 mode), and then set
the FMR11 bit to 0 (FMR6 register rewrite disabled).
Execute the software commands
Set the FMR01 bit to 0
(CPU rewrite mode disabled)
Program in ROM
Start
Single-chip mode
End
30. Flash Memory
Page 676 of 800

Advertisement

Table of Contents
loading

Table of Contents