234
Chapter 6
Flash Memory
Preliminary User’s Manual U17566EE1V2UM00
6.2 Flash Self-Programming
The internal flash memory can be programmed via the secure self-program-
ming facility. This feature enables the user’s application to re-program the flash
memory. The self-programming functions are part of the internal firmware,
which resides in an extra internal ROM. The user’s application can call the self-
programming functions via the self-programming library, provided by NEC.
Caution
During self-programming make sure to disable all ROM correction facilities, as
enabled ROM corrections may conflict with the internal firmware.
Start of self-
programming
The self-programming functions can be started out of the normal user mode of
the microcontroller.
Self-programming must be in particular enabled in order to avoid unintended
re-programming of the flash. Two ways to enable self-programming are
provided:
• by setting the external FLMD0 pin to high level
This requires some external components or wiring, e.g. connecting an
output port to FLMD0.
• by setting an internal register bit
This way does not need any special external components or wiring.
The following registers are used to enable self-programming internally by
software.
6.2.1
Flash self-programming registers
For safety reasons flash self-programming needs to be explicitly enabled by
use of two registers:
Table 6-1
Flash self-programming enable register overview
Register name
Shortcut
Address
Self-programming enable control register
SELFEN
FFFF FCA0
H
Self-programming enable protection register
SELFENP
FFFF FCA8
H
electronic components distributor