English
Language : 

UPD78F9500MA-CAC-A Datasheet, PDF (275/342 Pages) Renesas Technology Corp – 8-Bit Single-Chip Microcontrollers
CHAPTER 16 FLASH MEMORY
;---------------------------------------------------------------------
; Processing to shift to normal mode
;---------------------------------------------------------------------
ModeOffLoop:
MOV
FLCMD,#00H
; Clears FLCMD register
MOV
PFS,#00H
; Clears flash status register
MOV
PFCMD,#0A5H ; PFCMD register control
MOV
FLPMC,#00H
; FLPMC register control (sets value)
MOV
FLPMC,#0FFH ; FLPMC register control (inverts set value)
MOV
FLPMC,#00H
; Sets normal mode via FLPMC register control (sets value)
BT PFS.0,$ModeOffLoop
MOV
MK0,#INT_MK0
; Checks completion of write to specific registers
; Repeats the same processing when an error occurs.
; After the specific sequence is correctly executed, restore
; the CPU clock to its setting before the self programming
; Restores interrupt mask flag
EI
RET
User’s Manual U18172EJ3V0UD
273