CHAPTER 18 FLASH MEMORY
User’s Manual U16898EJ3V0UD
301
An example of a program that performs an internal verify in self programming mode is shown below.
;----------------------------
;START
;----------------------------
FlashVerify:
MOV
FLCMD,#01H
; Sets flash control command (internal verify)
MOV
FLAPH,#07H
; Sets verify start address with FLAPH (block 7 is specified
;
here)
MOV
FLAPL,#00H
; Sets verify start address with FLAPL (Address 00H is
; specified here)
MOV
FLAPHC,#07H
MOV
FLAPLC,#20H
; Sets verify end address
MOV
PFS,#00H
; Clears flash status register
MOV
WDTE,#0ACH
; Clears & restarts WDT
HALT
; Self programming is started
MOV
A,PFS
MOV
CmdStatus,A
; Execution result is stored in variable
; (CmdStatus = 0: normal termination, other than 0: abnormal
;
termination)
;----------------------------
;END
;----------------------------