Example Of Shifting Self Programming Mode To Normal Mode - NEC 78K0S/KB1+ User Manual

8-bit single-chip microcontrollers
Hide thumbs Also See for 78K0S/KB1+:
Table of Contents

Advertisement

19.8.5 Example of shifting self programming mode to normal mode

The operating mode must be returned from self programming mode to normal mode after performing self
programming.
An example of shifting to normal mode is explained below.
<R>
<1> Clear FLCMD (FLCMD = 00H).
<2> Clear the flash status register (PFS).
<3> Set normal mode using a specific sequence.
• Write the specific value (A5H) to PFCMD.
• Write 00H to FLPMC (writing in this step is invalid)
• Write 0FFH (inverted value of 00H) to FLPMC (writing in this step is invalid)
• Write 00H to FLPMC (writing in this step is valid)
<4> Check the execution result of the specific sequence using bit 0 (FPRERR) of PFS
Abnormal → <2>, normal → <5>
<5> Enable interrupt servicing (by executing the EI instruction and changing MK0 and MK1) to restore the original
state.
<6> Mode shift is completed
<R>
Note Restore the CPU clock to its setting before self programming, after normal execution of the specific
sequence.
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.
294
CHAPTER 19 FLASH MEMORY
User's Manual U17446EJ3V1UD
Note
.

Advertisement

Table of Contents
loading

Table of Contents