English
Language : 

UPD78F9202MA-CAC-A Datasheet, PDF (264/342 Pages) Renesas Technology Corp – 8-Bit Single-Chip Microcontrollers
CHAPTER 16 FLASH MEMORY
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
; 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
MOV
MOV
HALT
MOV
MOV
PFS,#00H
WDTE,#0ACH
A,PFS
CmdStatus,A
; 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)
;----------------------------
;END
;----------------------------
• Internal verify 2
;----------------------------
;START
;----------------------------
FlashVerify:
MOV
FLCMD,#02H
MOV
FLAPH,#07H
MOV
FLAPL,#00H
MOV
FLAPHC,#07H
MOV
FLAPLC,#20H
; 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)
MOV
MOV
HALT
MOV
MOV
PFS,#00H
WDTE,#0ACH
A,PFS
CmdStatus,A
; 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)
;----------------------------
;END
;----------------------------
262
User’s Manual U18172EJ3V0UD