Ew0 Mode; Ew1 Mode - Renesas R8C/18 Series Hardware Manual

16-bit single-chip mcu
Table of Contents

Advertisement

R8C/18 Group, R8C/19 Group
17.4.1

EW0 Mode

The MCU enters CPU rewrite mode and software commands can be acknowledged by setting the
FMR01 bit in the FMR0 register to 1 (CPU rewrite mode enabled). In this case, since the FMR11 bit in
the FMR1 register is set to 0, EW0 mode is selected.
Use software commands to control program and erase operations. The FMR0 register or the status
register can be used to determine when program and erase operations complete.
During auto-erasure, set the FMR40 bit to 1 (erase-suspend enabled) and the FMR41 bit to 1
(request erase-suspend). Wait for td(SR-ES) and ensure that the FMR46 bit is set to 1 (read enabled)
before accessing the user ROM area. The auto-erase operation can be restarted by setting the
FMR41 bit to 0 (erase restarts).
To enter program-suspend during the auto-program operation, set the FMR40 bit to 1 (suspend
enabled) and the FMR42 bit to 1 (request program-suspend). Wait for td(SR-ES) and ensure that the
FMR46 bit is set to 1 (read enabled) before accessing the user ROM area. The auto-program
operation can be restarted by setting the FMR42 bit to 0 (program restarts).
17.4.2

EW1 Mode

The MCU is switched to EW1 mode by setting the FMR11 bit to 1 (EW1 mode) after setting the
FMR01 bit to 1 (CPU rewrite mode enabled).
The FMR0 register can be used to determine when program and erase operations complete. Do not
execute the read status register command in EW1 mode.
To enable the erase-suspend function during auto-erasure, execute the block erase command after
setting the FMR40 bit to 1 (erase-suspend enabled). The interrupt to enter erase-suspend should be
in interrupt enabled status. After waiting for td(SR-ES) after the block erase command is executed,
the interrupt request is acknowledged.
When an interrupt request is generated, the FMR41 bit is automatically set to 1 (request
erase-suspend) and the auto-erase operation suspends. If an auto-erase operation does not
complete (FMR00 bit is 0) after an interrupt process completes, the auto-erase operation restarts by
setting the FMR41 bit to 0 (erase restarts).
To enable the program-suspend function during auto-programming, execute the program command
after setting the FMR40 bit to 1 (suspend enabled). The interrupt to enter a program-suspend should
be in interrupt enabled status. After waiting for td(SR-ES) after the program command is executed, an
interrupt request is acknowledged.
When an interrupt request is generated, the FMR42 bit is automatically set to 1 (request
program-suspend) and the auto-program operation suspends. When the auto-program operation
does not complete (FMR00 bit is 0) after the interrupt process completes, the auto-program operation
can be restarted by setting the FMR42 bit to 0 (programming restarts).
Rev.1.30
Apr 14, 2006
REJ09B0222-0130
Page 179 of 233
17. Flash Memory Version

Advertisement

Table of Contents
loading

This manual is also suitable for:

R8c/1 seriesR8c seriesR8c/19 series

Table of Contents