CHAPTER 19 FLASH MEMORY
User’s Manual U17446EJ3V1UD
305
An example of a program that performs a byte write in self programming mode is shown below.
;----------------------------
;START
;----------------------------
FlashWrite:
MOV
FLCMD,#05H
; Sets flash control command (byte write)
MOV
FLAPH,#07H
; Sets address to which data is to be written, with
; FLAPH (block 7 is specified here)
MOV
FLAPL,#20H
; Sets address to which data is to be written, with
; FLAPL (address 20H is specified here)
MOV
FLW,#10H
; Sets data to be written (10H is specified here)
MOV
PFS,#00H
; Clears flash status register
MOV
WDTE,#0ACH
; Clears & restarts WDT
HALT
; Self programming is started
MOV
A,PFS
MOV
CmdStatus,A
; Execution result is stored in variable
; (CmdStatus = 0: normal termination, other than 0: abnormal
;
termination)
;----------------------------
;END
;----------------------------
Содержание 78K0S/KB1+
Страница 2: ...User s Manual U17446EJ3V1UD 2 MEMO ...