CHAPTER 18 FLASH MEMORY
User’s Manual U16898EJ3V0UD
276
18.8.2 Cautions on self programming function
•
No instructions can be executed while a self programming command is being executed. Therefore, clear and
restart the watchdog timer counter in advance so that the watchdog timer does not overflow during self
programming. Refer to Table 18-11 for the time taken for the execution of self programming.
•
Interrupts that occur during self programming can be acknowledged after self programming mode ends. To avoid
this operation, disable interrupt servicing (by setting MK0 and MK1 to FFH, and executing the DI instruction)
before a mode is shifted from the normal mode to the self programming mode with a specific sequence.
•
RAM is not used while a self programming command is being executed.
•
If the supply voltage drops or the reset signal is input while the flash memory is being written or erased,
writing/erasing is not guaranteed.
•
The value of the blank data set during block erasure is FFH.
•
When the oscillator or the external clock is selected as the main clock, a wait time of 16
µ
s is required starting
from the setting of the self programming mode to the execution of the HALT instruction.
•
The state of the pins in self programming mode is the same as that in HALT mode.
•
Since the security function set via on-board/off-board programming is disabled in self programming mode, the
self programming command can be executed regardless of the security function setting. To disable write or
erase processing during self programming, set the protect byte.
•
Be sure to clear bits 4 to 7 of flash address pointer H (FLAPH) and flash address pointer H compare register
(FLAPHC) to 0 before executing the self programming command. If the value of these bits is 1 when executing
the self programming command.
18.8.3 Registers used for self programming function
The following registers are used for the self programming function.
•
Flash programming mode control register (FLPMC)
•
Flash protect command register (PFCMD)
•
Flash status register (PFS)
•
Flash programming command register (FLCMD)
•
Flash address pointers H and L (FLAPH and FLAPL)
•
Flash address pointer H compare register and flash address pointer L compare register (FLAPHC and FLAPLC)
•
Flash write buffer register (FLW)
The 78K0S/KA1+ has an area called a protect byte at address 0081H of the flash memory.
(1) Flash programming mode control register (FLPMC)
This register is used to set the operation mode when data is written to the flash memory in the self
programming mode, and to read the set value of the protect byte.
Data can be written to FLPMC only in a specific sequence (refer to
18.8.3 (2) Flash protect command
register (PFCMD)
) so that the application system does not stop by accident because of malfunctions due to
noise or program hang-ups.
This register is set with an 8-bit memory manipulation instruction.
Reset signal generation makes the contents of this register undefined.