
R8C/36T-A Group
26. Flash Memory
Under development Preliminary document
Specifications in this document are tentative and subject to change.
R01UH0240EJ0010 Rev.0.10
Page 638 of 728
Aug 05, 2011
26.5.1
EW0 Mode
When the FMR01 bit in the FMR0 register is set to 1 (CPU rewrite mode enabled), the MCU enters CPU
rewrite mode and software commands can be accepted. Since the FMR02 bit in the FMR0 register is set to 0 at
this time, EW0 mode is selected.
Software commands are used to control program and erase operations. The FST register can be used to confirm
whether programming or erasure has completed.
To enter erase-suspend during auto-erasure, set the FMR20 bit to 1 (erase-suspend enabled) and the FMR21 bit
to 1 (erase-suspend request). Next, verify that the FST7 bit in the FST register is set to 1 (ready), and then verify
that the FST6 bit is set to 1 (during erase-suspend) before accessing the flash memory. When the FST6 bit is set
to 0, erasure completes.
When the FMR21 bit in the FMR2 register is set to 0 (erase restart), auto-erasure restarts. To confirm whether
auto-erasure has restarted, verify that the FST7 bit in the FST register is set to 0, and then verify that the FST6
bit is set to 0 (other than erase-suspend).
26.5.2
EW1 Mode
After the FMR01 bit in the FMR0 register is set to 1 (CPU rewrite mode enabled), EW1 mode is selected by
setting the FMR02 bit to 1.
The FST register can be used to confirm whether programming or erasure has completed.
To enable the erase-suspend function during auto-erasure, execute the block erase command after setting the
FMR20 bit in the FMR2 register to 1 (suspend enabled). To enter erase-suspend while auto-erasing the user
ROM area, set the FMR22 bit in the FMR2 register to 1 (erase-suspend request enabled by interrupt request).
Also, the interrupt to enter erase-suspend must be enabled in advance.
When an interrupt request is generated, the FMR21 bit in the FMR2 register is automatically set to 1 (erase-
suspend request) and auto-erasure suspends after td(SR-SUS). After interrupt handling completes, set the
FMR21 bit to 0 (erase restart) to restart auto-erasure.