CHAPTER 19 FLASH MEMORY
Preliminary User’s Manual U19014EJ1V0UD
467
19.9 Flash Memory Programming by Self-Programming
The
µ
PD78F0730 supports a self-programming function that can be used to rewrite the flash memory via a user
program. Because this function allows a user application to rewrite the flash memory by using the
µ
PD78F0730 self-
programming library, it can be used to upgrade the program in the field.
If an interrupt occurs during self-programming, self-programming can be temporarily stopped and interrupt
servicing can be executed. To execute interrupt servicing, restore the normal operation mode after self-programming
has been stopped, and execute the EI instruction. After the self-programming mode is later restored, self-
programming can be resumed.
Remark
For details of the self-programming function and the 78K0/Kx2 self-programming library, refer to
78K0/Kx2 Flash Memory Self Programming User’s Manual (U17516E)
.
Cautions 1. Input a high level to the FLMD0 pin during self-programming.
2. Be sure to execute the DI instruction before starting self-programming.
The self-programming function checks the interrupt request flags (IF0L, IF0H, IF1L, and IF1H).
If an interrupt request is generated, self-programming is stopped.
3. Self-programming is also stopped by an interrupt request that is not masked even in the DI
status. To prevent this, mask the interrupt by using the interrupt mask flag registers (MK0L,
MK0H, MK1L, and MK1H).
4. Self-programming is executed with the internal high-speed oscillation clock. If the CPU
operates with the X1 clock or external main system clock, the oscillation stabilization wait
time of the internal high-speed oscillation clock elapses during self-programming.
5. Allocate the entry program for self-programming in the common area of 0000H to 7FFFH.
Figure 19-15. Operation Mode and Memory Map for Self-Programming
SFR
USB area
SFR
Normal mode
Flash memory
(common area)
Internal high-
speed RAM
Internal
expansion RAM
Reserved
Reserved
USB area
Flash memory
(common area)
Internal
expansion RAM
Reserved
Reserved
Internal high-
speed RAM
Flash memory
control
firmware ROM
Disable
accessing
Instructions can be fetched
from common area.
Flash memory
control
firmware ROM
Enable
accessing
Instructions can be fetched
from common area and
firmware ROM.
Self-programming mode
0 0 0 0 H
4 0 0 0 H
3 F F F H
F F F F H
F B 0 0 H
F 8 0 0 H
F 7 F F H
F 0 0 0 H
F F 0 0 H
F E F F H
F 9 D 1 H
F 9 D 0 H
0 0 0 0 H
4 0 0 0 H
3 F F F H
F F F F H
F B 0 0 H
F 8 0 0 H
F 7 F F H
F 9 D 1 H
F 9 D 0 H
F 0 0 0 H
F F 0 0 H
F E F F H
electronic components distributor