English
Language : 

UPD78F9500MA-CAC-A Datasheet, PDF (260/342 Pages) Renesas Technology Corp – 8-Bit Single-Chip Microcontrollers
CHAPTER 16 FLASH MEMORY
An example of a program that performs a byte write in self programming mode is shown below.
;----------------------------
;START
;----------------------------
FlashWrite:
MOV
FLCMD,#05H
MOV
FLAPH,#07H
MOV
FLAPL,#20H
MOV
FLW,#10H
; Sets flash control command (byte write)
; Sets address to which data is to be written, with
; FLAPH (block 7 is specified here)
; Sets address to which data is to be written, with
; FLAPL (address 20H is specified here)
; Sets data to be written (10H 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
;----------------------------
258
User’s Manual U18172EJ3V0UD