CHAPTER 18 FLASH MEMORY
User’s Manual U16898EJ3V0UD
273
Table 18-9 shows the relationship between the security setting and the operation in each programming mode.
Table 18-9. Relationship Between Security Setting and Operation In Each Programming Mode
On-Board/Off-Board Programming
Self Programming
Programming Mode
Security Setting
Security Setting
Security Operation
Security Setting
Security Operation
Batch erase (chip erase)
Block erase
Write
Possible Valid
Note 1
Impossible
Invalid
Note 2
Notes 1.
Execution of each command is prohibited by the security setting.
2.
Execution of self programming command is possible regardless of the security setting.
18.8 Flash Memory Programming by Self Writing
The 78K0S/KA1+ supports a self programming function that can be used to rewrite the flash memory via a user
program, making it possible to upgrade programs in the field.
Caution Self programming processing must be included in the program before performing self writing.
Remark
To use the internal flash memory of the 78K0S/KA1+ as the external EEPROM for storing data, refer to
“78K0S/Kx1+ EEPROM Emulation AN” (U17379E).
18.8.1 Outline of self programming
To execute self programming, shift the mode from the normal operation of the user program (normal mode) to the
self programming mode. Write/erase processing for the flash memory, which has been set to the register in advance,
is performed by executing the HALT instruction during self programming mode. The HALT state is automatically
released when processing is completed.
To shift to the self programming mode, execute a specific sequence for a specific register. Refer to
18.8.4
Example of shifting normal mode to self programming
for details.
Remark
Data written by self programming can be referenced with the MOV instruction.
Table 18-10. Self Programming Mode
Mode
User Program Execution
Execution of Write/erase for Flash
Memory with HALT Instruction
Normal mode
Enabled
−
Self programming mode
Enabled
Note
Enabled
Note
Maskable interrupt servicing is disabled during self programming mode.
Figure 18-10 shows a block diagram for self programming, Figure 18-11 shows the self programming state
transition diagram, Table 18-11 lists the commands for controlling self programming.