NEC 78K0S/KA1+ User Manual page 292

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

Advertisement

An example of a program that performs a block erase in self programming mode is shown below.
;----------------------------
;START
;----------------------------
FlashBlockErase:
MOV
FLCMD,#03H
MOV
FLAPH,#07H
MOV
FLAPL,#00H
MOV
FLAPHC,#07H
MOV
FLAPLC,#00H
MOV
PFS,#00H
MOV
WDTE,#0ACH
HALT
MOV
A,PFS
MOV
CmdStatus,A
;----------------------------
;END
;----------------------------
292
CHAPTER 18 FLASH MEMORY
; Sets flash control command (block erase)
; Sets number of block to be erased (block 7 is specified here)
; Fixes FLAPL to "00H"
; Sets erase block compare number (same value as that of FLAPH)
; Fixes FLAPLC to "00H"
; 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