NEC 78K0S/KA1+ User Manual page 298

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

Advertisement

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
MOV
PFS,#00H
MOV
WDTE,#0ACH
HALT
MOV
A,PFS
MOV
CmdStatus,A
;----------------------------
;END
;----------------------------
298
CHAPTER 18 FLASH MEMORY
; 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)
; 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 U16898EJ3V0UD

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents