Download Print this page

Renesas M16C/50 Series User Manual page 703

Advertisement

M16C/5L Group, M16C/56 Group
26.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 26.5 shows Setting and Resetting of EW0 Mode
Procedure to Enter EW0 Mode
Single-chip mode
Transfer the rewrite control program to RAM
Set registers CM0, CM1, and PM1
(Set the CPU clock 16 MHz or lower with one wait)
Jump to the rewrite control program transferred to
RAM. (In the following steps, use the rewrite control
program in RAM)
Figure 26.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 (suspend disabled)
To use the interrupt, allocate a variable vector table on RAM.
• Maskable interrupt (suspend enabled)
To use the interrupt, allocate a variable vector table on RAM.
When the FMR00 bit in the FMR0 register is checked in the interrupt routine and the result is 0
(being written or erased), auto-erase operation or auto-program operation suspends after td(SR-
SUS) elapses by setting the FMR31 bit in the FMR3 register to 1 (suspend request). Auto-erase
operation or auto-program operation restarts by setting the FMR31 bit to 0 (command restart) at
the completion of the interrupt.
• NMI , watchdog timer, oscillator stop/restart detect, 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.
R01UH0127EJ0110 Rev.1.10
Sep 01, 2011
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
26. Flash Memory
Page 666 of 803

Advertisement

loading