English
Language : 

UPD78F9500MA-CAC-A Datasheet, PDF (251/342 Pages) Renesas Technology Corp – 8-Bit Single-Chip Microcontrollers
CHAPTER 16 FLASH MEMORY
An example of a program that shifts the mode to normal mode is shown below.
;----------------------------
;START
;----------------------------
MOV
ModeOffLoop:
MOV
MOV
MOV
MOV
MOV
FLCMD,#00H
PFS,#00H
PFCMD,#0A5H
FLPMC,#00H
FLPMC,#0FFH
FLPMC,#00H
; Clear FLCMD register
; Clears flash status register
; PFCMD register control
; FLPMC register control (sets value)
; FLPMC register control (inverts set value)
; Sets normal mode via FLPMC register control (sets value)
BT PFS.0,$ModeOffLoop
; Checks completion of write to specific registers
; Repeats the same processing when an error occurs
; Restore the CPU clock to its setting before the self
; programming
MOV
MK0,#INT_MK0
; Restores interrupt mask flag
EI
;----------------------------
;END
;----------------------------
User’s Manual U18172EJ3V0UD
249