CHAPTER 19 FLASH MEMORY
User’s Manual U17446EJ3V1UD
291
19.8.4 Example of shifting normal mode to self programming mode
The operating mode must be shifted from normal mode to self programming mode before performing self
programming.
An example of shifting to self programming mode is explained below.
<1> Disable interrupts if the interrupt function is used (by setting the interrupt mask flag registers (MK0, MK1) to
FFH and executing the DI instruction).
<2> Clear FLCMD (FLCMD = 00H).
<3> Clear the flash status register (PFS).
<4> Set self programming mode using a specific sequence
Note
.
•
Write a specific value (A5H) to PFCMD.
•
Write 01H to FLPMC (writing in this step is invalid).
•
Write 0FEH (inverted value of 01H) to FLPMC (writing in this step is invalid).
•
Write 01H to FLPMC (writing in this step is valid).
<5> Execute NOP instruction and HALT instruction.
<6> Check the execution result of the specific sequence using bit 0 (FPRERR) of PFS.
Abnormal
→
<3>, normal
→
<7>
<7> Mode shift is completed.
Note
If the CPU clock is lower than 1 MHz, set it to be 1 MHz or higher.
Caution Be sure to perform the series of operations described above using the user program at an
address where data is not erased nor written.
<R>
<R>
<R>
Содержание 78K0S/KB1+
Страница 2: ...User s Manual U17446EJ3V1UD 2 MEMO ...