R01UH0092EJ0110 Rev.1.10
Page 676 of 807
Jul 31, 2012
M16C/64C Group
30. Flash Memory
30.8.1.1
Suspend Function (EW0 Mode)
When using suspend function in EW0 mode, check the status of the flash memory in the interrupt
routine and enter suspend mode. Program suspend or erase suspend is not accepted until td(SR-
SUS) elapses after the FMR31 bit is set to 1. Access to the flash memory after confirming the
acceptance of program suspend or erase suspend by the FMR33 or FMR32 bit. Set the FMR31 bit to
0 (command restart) to restart auto-program and auto-erase operations at the completion of the
access to the flash memory. Figure 30.6 to Figure 30.8 show a flowchart in EW0 mode when the
suspend function is enabled, and Figure 30.9 shows Suspend Operation Example in EW0 Mode.
Figure 30.6
Program Flowchart in EW0 Mode (Suspend Function Enabled)
Start
Write command code xx41h
to WA address
Write WD0 to WA address
FMR00 = 1 ?
Full status check
Program completed
No
Yes
Write 0 and then 1
to the FMR30 bit
Maskable interrupt
(1)
FMR00 = 1 ?
REIT
Yes
FMR31
←
1
(3)
FMR31
←
0
Access flash memory
FMR00 = 0 ?
Yes
No
Access flash memory
No
I flag
←
1
Suspend
enabled
Interrupt
enabled
(2)
Suspend
request
Program suspend accepted
Command
restart
Write WD1 to WA address
I flag
←
0
Interrupt
disabled
Notes:
1. In EW0 mode, set the interrupt vector table for interrupts to be used and the interrupt routine in areas
other than flash memory.
2. When interrupts are not used, an instruction to enable interrupts is not necessary.
3. Program is not suspended until td(SR-SUS) elapses after the FMR31 bit is set to 1.
Содержание M16C Series
Страница 846: ...M16C 64C Group R01UH0092EJ0110...