English
Language : 

M16C65 Datasheet, PDF (762/829 Pages) Renesas Technology Corp – RENESAS MCU M16C FAMILY / M16C/60
Under development
M16C/65 Group
Preliminary Specification
This is a preliminary specification and is subject to change.
30. Flash Memory
30.8.7 EW1 Mode
EW1 mode is selected by setting the FMR60 bit to 1 after setting the FMR01 bit to 1. Figure 30.14
shows Setting and Resetting of EW1 Mode.
The FMR0 register indicates whether or not a program or erase operation has completed as expected.
The status register cannot be read in EW1 mode.
When a program or erase operation is initiated, the CPU halts all program execution until the operation
is completed.
Procedure to Enter EW1 Mode
Program in ROM
Single-chip mode
Set registers CM0, CM1, and PM1
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)
Figure 30.14 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 (suspend function enabled)
Auto-erase operation or auto-program operation suspends after td(SR-SUS) elapses and the
interrupt process is executed. Auto-erase operation or auto-program operation restarts by setting
the FMR31 bit in the FMR3 register to 0 (command restart) after the interrupt process is completed.
• Maskable interrupt (suspend function disabled)
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, oscillation stop/re-oscillation 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
the flash memory is reset. The flash memory restarts after a certain period of time, 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-erasure or auto-programming, but counts during
erase suspend or program suspend. The interrupt request can be generated. Initialize the watchdog
timer regularly by using the suspend function.
REJ09B0484-0030 Rev.0.30 Sep 09, 2008
Page 727 of 791