English
Language : 

SH7040 Datasheet, PDF (741/923 Pages) Renesas Technology Corp – Renesas 32-Bit Single-Chip RISC Microprocessor SuperH RISC engine Family/SH7040 Series(CPU Core SH-2)
22.6.2 User Program Mode
After setting FWP, the user should branch to, and execute, the previously prepared
programming/erase control program.
As the flash memory itself cannot be read while flash memory programming/erasing is being
executed, the control program that performs programming and erasing should be run in on-chip
RAM or external memory.
Use the following procedure (figure 22.12) to execute the programming control program that
writes to flash memory (when transferred to RAM).
Write FWP assessment program
1
and transfer program
FWP = 1
2
(user program mode)
3
Transfer programming/erase
control program to RAM
Execute programming/
4 erase control program in RAM
(flash memory rewriting)
Execute user application
5
program
Figure 22.12 User Program Mode Execution Procedure
Notes: 1. When programming and erasing, start the watchdog timer so that measures can be
taken to prevent program runaway, etc. Memory cells may not operate normally if
overprogrammed or overerased due to program runaway.
2. If an address at which a flash memory register resides is read in the mask ROM or
ZTAT version, the value will be undefined. When a flash memory version program is
used in the mask ROM or ZTAT version, the state of the FWP pin cannot be
determined. A modification must therefore be made to prevent operation of the flash
memory rewrite program.
703