Download Print this page

Renesas M16C/50 Series User Manual page 709

Advertisement

M16C/5L Group, M16C/56 Group
26.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 26.10 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 26.10 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, oscillator stop/restart detect, 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. However, counts does not stop during erase suspend or program suspend. As the interrupt
request may be generated, initialize the watchdog timer regularly using the suspend function.
R01UH0127EJ0110 Rev.1.10
Sep 01, 2011
Procedure to Enter EW1 Mode
Set registers CM0, CM1, and PM1
(Set the CPU clock 16 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
26. Flash Memory
Page 672 of 803

Advertisement

loading