R8C/36T-A Group
29. Usage Notes
Under development Preliminary document
Specifications in this document are tentative and subject to change.
R01UH0241EJ0010 Rev.0.10
Page 716 of 728
Aug 05, 2011
29.16 Notes on Flash Memory
29.16.1 CPU Rewrite Mode
29.16.1.1 Prohibited Instructions
The following instructions cannot be used while the program ROM area is being rewritten in EW0 mode
because they reference data in the flash memory: UND, INTO, and BRK.
29.16.1.2 Interrupts
Tables 29.2 to 29.4 show CPU Rewrite Mode Interrupts.
FMR21, FMR22: Bits in FMR2 register
Table 29.2
CPU Rewrite Mode Interrupts (1)
Mode
Erase/
Write
Target
Status
Maskable Interrupt
EW0
Data
flash
During auto-erasure
(suspend enabled)
When an interrupt request is acknowledged, interrupt handling is executed.
If the FMR22 bit is set to 1 (erase-suspend request enabled by interrupt request), the
FMR21 bit is automatically set to 1 (erase-suspend request). The flash memory suspends
auto-erasure after td(SR-SUS).
If erase-suspend is required while the FMR22 bit is set to 0 (erase-suspend request
disabled by interrupt request), set the FMR21 bit to 1 during interrupt handling. The flash
memory suspends auto-erasure after td(SR-SUS).
While auto-erasure is being suspended, any block other than the block during auto-
erasure execution can be read or written. Auto-erasure can be restarted by setting the
FMR21 bit to 0 (erase restart).
During auto-erasure
(suspend disabled or
FMR22 = 0)
Interrupt handling is executed while auto-erasure or auto-programming is being
performed.
During
auto-programming
Program
ROM
During auto-erasure
(suspend enabled)
Usable by allocating a vector in RAM.
During auto-erasure
(suspend disabled)
During
auto-programming
EW1
Data
flash
During auto-erasure
(suspend enabled)
When an interrupt request is acknowledged, interrupt handling is executed.
If the FMR22 bit is set to 1, the FMR21 bit is automatically set to 1. The flash memory
suspends auto-erasure after td(SR-SUS).
If erase-suspend is required while the FMR22 bit is set to 0, set the FMR21 bit to 1 during
interrupt handling. The flash memory suspends auto-erasure after td(SR-SUS).
While auto-erasure is being suspended, any block other than the block during auto-
erasure execution can be read or written. Auto-erasure can be restarted by setting the
FMR21 bit to 0.
During auto-erasure
(suspend disabled or
FMR22 = 0)
Interrupt handling is executed while auto-erasure or auto-programming is being
performed.
During
auto-programming
Program
ROM
During auto-erasure
(suspend enabled)
Auto-erasure suspends after td(SR-SUS) and interrupt handling is executed. Auto-
erasure can be restarted by setting the FMR21 bit to 0 after interrupt handling completes.
While auto-erasure is being suspended, any block other than the block during auto-
erasure execution can be read or written.
During auto-erasure
(suspend disabled or
FMR22 = 0)
Auto-erasure and auto-programming have priority and interrupt requests are put on
standby. Interrupt handling is executed after auto-erase and auto-program complete.
During
auto-programming