![](http://datasheet.mmic.net.cn/Renesas-Electronics-America/UPD78F9234CS-CAA-A_datasheet_99865/UPD78F9234CS-CAA-A_297.png)
CHAPTER 19 FLASH MEMORY
User’s Manual U17446EJ5V0UD
295
An example of the program that shifts the mode to self programming mode is shown below.
;----------------------------
;START
;----------------------------
MOV
MK0,#11111111B
; Masks all interrupts
MOV
MK1,#11111111B
MOV
FLCMD,#00H
; Clear FLCMD register
DI
ModeOnLoop:
; Configure settings so that the CPU clock
≥ 1 MHz
MOV
PFS,#00H
; Clears flash status register
MOV
PFCMD,#0A5H
; PFCMD register control
MOV
FLPMC,#01H
; FLPMC register control (sets value)
MOV
FLPMC,#0FEH
; FLPMC register control (inverts set value)
MOV
FLPMC,#01H
; Sets self programming mode with FLPMC register
; control (sets value)
NOP
HALT
BT
PFS.O,$ModeOnLoop
; Checks completion of write to specific registers
; Repeats the same processing when an error occurs
;----------------------------
;END
;----------------------------