
6
INTERNAL MEMORY
6-29
32185/32186 Group Hardware Manual
Rev.1.10 REJ09B0235-0110 May 15, 07
Figure 6.6.4 Procedure for Programming/Erasing the Internal Flash Memory (when the flash write/erase
program already exists in it)
(2) When the flash write/erase program already exists in the internal flash memory
In this case, the flash write/erase program prepared in the internal flash memory is used to program or erase
the internal flash memory.
For programming/erase operation here, use the internal peripheral circuits in the manner suitable for the
programming system. (All resources of the internal peripheral circuits such as the data bus, serial interface
and ports can be used.)
The following shows an example for programming or erasing the internal flash memory by using SIO0 in
single-chip mode.
SIO0
CPU
Flash write/
erase
program
SIO0
CPU
Flash write/
erase
program
MOD1 = L
SIO0
CPU
Internal RAM
Flash write/
erase
program
FP = L or H
Write data
Internal RAM
<Step 1>
Initial state (Flash write/erase program existing in the internal
flash memory)
An ordinary program in the internal flash memory is being executed.
<Step 2>
Set the FP pin "H," MOD1 pin "L" and MOD0 pin "L" to place
the flash memory in single-chip + flash E/W enable mode.
After determining the FP pin and MOD1 pin levels, transfer the
flash write/erase program from the internal flash memory area
into the internal RAM.
Jump to the flash write/erase program in the internal RAM.
<Step 3>
Using the flash write/erase program in the internal RAM,
set the Flash Control Register 1 (FCNT1) FENTRY bit to 1.
Program or erase the internal flash memory using the flash
write/erase program in the internal RAM.
When finished, jump to the program in the internal flash memory
or apply a reset to enter normal mode.
M32R/ECU
External device
Internal Flash
memory
Flash write
data
Internal Flash
memory
MOD0 = L
MOD1 = L
FP = H
MOD0 = L
MOD1 = L
FP = H
MOD0 = L
Write data
6.6 Programming Internal Flash Memory