NEC 78K0S/KB1+ User Manual page 325

8-bit single-chip microcontrollers
Hide thumbs Also See for 78K0S/KB1+:
Table of Contents

Advertisement

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

Advertisement

Table of Contents
loading

Table of Contents