NEC 78K0 Series User Manual page 574

8-bit single-chip microcontrollers
Hide thumbs Also See for 78K0 Series:
Table of Contents

Advertisement

26.9 Flash Memory Programming by Self-Programming
The 78K0/KE2 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 78K0/KE2 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.
programming can be resumed.
Remark For details of the self-programming function and the 78K0/KE2 self-programming library, refer to a
separate document to be published (document name: 78K0/Kx2 Application Note, release schedule:
Pending).
Cautions 1. The self-programming function cannot be used when the CPU operates with the subsystem
clock.
2. Input a high level to the FLMD0 pin during self-programming.
3. 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.
4. 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).
5. 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.
6. Allocate the entry program for self-programming in the common area of 0000H to 7FFFH.
Figure 26-15. Operation Mode and Memory Map for Self-Programming (
F F F F H
SFR
F F 0 0 H
F E F F H
Internal high-
F B 0 0 H
speed RAM
F A F F H
Reserved
F A 2 0 H
F A 1 F H
Buffer RAM
F A 0 0 H
F 9 F F H
Reserved
F 8 0 0 H
F 7 F F H
Memory bank 2
Internal
expansion RAM
E 0 0 0 H
D F F F H
Reserved
C 0 0 0 H
B F F F H
Flash memory
(memory bank 0)
8 0 0 0 H
7 F F F H
Memory bank 3
Flash memory
(common area)
Memory bank 1
0 0 0 0 H
Normal mode
574
CHAPTER 26 FLASH MEMORY
Memory bank 4
Flash memory
control
firmware ROM
Disable
accessing
Memory bank 5
Instructions can be fetched
from common area and
selected memory bank.
Preliminary User's Manual U17260EJ3V1UD
After the self-programming mode is later restored, self-
F F F F H
SFR
F F 0 0 H
F E F F H
Internal high-
F B 0 0 H
speed RAM
F A F F H
Reserved
F A 2 0 H
F A 1 F H
Buffer RAM
F A 0 0 H
F 9 F F H
Reserved
F 8 0 0 H
F 7 F F H
Memory bank 2
Internal
expansion RAM
E 0 0 0 H
D F F F H
Reserved
C 0 0 0 H
B F F F H
Disable
accessing
8 0 0 0 H
7 F F F H
Memory bank 3
Flash memory
(common area)
Memory bank 1
0 0 0 0 H
Self-programming mode
µ
PD78F0537)
Memory bank 4
Flash memory
control
firmware ROM
Enable
accessing
Memory bank 5
Instructions can be
fetched from common
area and firmware ROM.

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents