CHAPTER 19 FLASH MEMORY
User’s Manual U17446EJ3V1UD
325
; Setting internal verify command
FlashVerify:
MOVW
HL,#WriteAdr
; Sets verify address
MOV
FLCMD,#02H
; Sets flash control command (internal verify 2)
MOV
A,H
MOV
FLAPH,A
; Sets verify start address
MOV
A,L
MOV
FLAPL,A
; Sets verify start address
MOV
A,D
MOV
FLAPHC,A
; Sets verify end address
MOV
A,E
MOV
FLAPLC,A
; Sets verify end address
CALL
!ModeOn
; Shift to self programming mode
; Execution of internal verify command
MOV
PFS,#00H
; Clears flash status register
MOV
WDTE,#0ACH
; Clears & restarts WDT
HALT
; Self programming is started
MOV
A,PFS
CMP
A,#00H
BNZ
$StatusError
; Checks internal verify error
; Performs abnormal termination processing when an error occurs
CALL
!ModeOff
; Shift to normal mode
BR StatusNormal
;---------------------------------------------------------------------
;END (abnormal termination processing); Perform processing to shift to
normal mode in order to return to normal processing
;---------------------------------------------------------------------
StatusError:
;---------------------------------------------------------------------
;END (normal termination processing)
;---------------------------------------------------------------------
StatusNormal:
<R>
Содержание 78K0S/KB1+
Страница 2: ...User s Manual U17446EJ3V1UD 2 MEMO ...