NEC 78K0S/KU1+ User Manual page 250

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

Advertisement

An example of a program that performs an internal verify in self programming mode is shown below.
• Internal verify 1
;----------------------------
;START
;----------------------------
FlashVerify:
MOV
FLCMD,#01H
MOV
FLAPH,#07H
MOV
FLAPL,#00H
MOV
FLAPHC,#07H
MOV
FLAPLC,#FFH
MOV
PFS,#00H
MOV
WDTE,#0ACH
HALT
MOV
A,PFS
MOV
CmdStatus,A
;----------------------------
;END
;----------------------------
• Internal verify 2
;----------------------------
;START
;----------------------------
FlashVerify:
MOV
FLCMD,#02H
MOV
FLAPH,#07H
MOV
FLAPL,#00H
MOV
FLAPHC,#07H
MOV
FLAPLC,#20H
MOV
PFS,#00H
MOV
WDTE,#0ACH
HALT
MOV
A,PFS
MOV
CmdStatus,A
;----------------------------
;END
;----------------------------
250
CHAPTER 16 FLASH MEMORY
; Sets flash control command (internal verify 1)
; Set the number of block for which internal verify is
; performed, to FLAPH (Example: Block 7 is specified here)
; Sets FLAPL to 00H
; Sets FLAPLC to FFH
; Clears flash status register
; Clears & restarts WDT
; Self programming is started
; Execution result is stored in variable
; (CmdStatus = 0: normal termination, other than 0: abnormal
; termination)
; Sets flash control command (internal verify 2)
; Set the number of block for which internal verify is
; performed, to FLAPH (Example: Block 7 is specified here)
; Sets FLAPL to the start address for verify (Example: Address
; 00H is specified here)
; Sets FLAPLC to the end address for verify (Example: Address
; 20H is specified here)
; Clears flash status register
; Clears & restarts WDT
; Self programming is started
; Execution result is stored in variable
; (CmdStatus = 0: normal termination, other than 0: abnormal
; termination)
User's Manual U18172EJ2V0UD

Advertisement

Table of Contents
loading

Table of Contents