NEC MuPD78F0132H User Manual page 450

8-bit single-chip microcontrollers, 78k0/ke1plus
Table of Contents

Advertisement

(2) Flash protect command register (PFCMD)
If the application system stops inadvertently due to malfunction caused by noise or program hang-up, an
operation to write the flash programming mode control register (FLPMC) may have a serious effect on the
system. PFCMD is used to protect FLPMC from being written, so that the application system does not stop
inadvertently.
Writing FLPMC is enabled only when a write operation is performed in the following specific sequence.
<1> Write a specific value to PFCMD (PFCMD = A5H)
<2> Write the value to be set to FLPMC (writing in this step is invalid)
<3> Write the inverted value of the value to be set to FLPMC (writing in this step is invalid)
<4> Write the value to be set to FLPMC (writing in this step is valid)
This rewrites the value of the register, so that the register cannot be written illegally.
Occurrence of an illegal store operation can be checked by bit 0 (FPRERR) of the flash status register (PFS).
A5H must be written to PFCMD each time the value of FLPMC is changed.
PFCMD can be set by an 8-bit memory manipulation instruction.
RESET input makes this register undefined.
Figure 26-20. Format of Flash Protect Command Register (PFCMD)
Address: FFC0H
Symbol
PFCMD
(3) Flash status register (PFS)
If data is not written to the flash programming mode control register (FLPMC), which is protected, in the correct
sequence (writing the flash protect command register (PFCMD)), FLPMC is not written and a protection error
occurs. If this happens, bit 0 of PFS (FPRERR) is set to 1.
This bit is a cumulative flag. After checking FPRERR, clear it by writing 0 to it.
PFS can be set by a 1-bit or 8-bit memory manipulation instruction.
RESET input clears this register to 00H.
Address: FFC2H
Symbol
PFS
450
CHAPTER 26 FLASH MEMORY
After reset: Undefined
REG7
REG6
REG5
Figure 26-21. Format of Flash Status Register (PFS)
After reset: 00H
R/W
0
0
0
User's Manual U16899EJ2V0UD
W
REG4
REG3
REG2
0
0
0
REG1
REG0
0
FPRERR

Advertisement

Table of Contents
loading

Table of Contents