CHAPTER 16 FLASH MEMORY
User’s Manual U18172EJ2V0UD
233
Figure 16-18. Example of Shifting to Self Programming Mode
Shift to self programming mode
<1> Disable interrupts (by setting
MK0 to FFH and executing DI
PFCMD = A5H
; When interrupt function is used
<3> Clear PFS
FLPMC = 01H (set value)
FLPMC = 0FEH (inverted set value)
FLPMC = 01H (set value)
; Set value is invalid
; Set value is valid
<4>
instruction)
<2> Clear FLCMD
(FLCMD=00H).
<6> Check execution result
(FPRERR flag)
Abnormal
Normal
<7> Termination
NOP instruction
HALT instruction
<5>
Caution Be sure to perform the series of operations described above using the user program at an
address where data is not erased or written.
Remark
<1> to <7> in Figure 16-18 correspond to <1> to <7> in
16.8.4
(previous page).