NEC 78K0S/KA1+ User Manual page 306

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

Advertisement

An example of a program when the command execution time (from write to internal verify) should be minimized in
self programming mode is shown below.
;---------------------------------------------------------------------
;START
;---------------------------------------------------------------------
MOV
MK0,#11111111B
MOV
MK1,#11111111B
DI
ModeOnLoop:
MOV
PFS,#00H
MOV
PFCMD,#0A5H
MOV
FLPMC,#01H
MOV
FLPMC,#0FEH
MOV
FLPMC,#01H
MOV
A,PFS
CMP
A,#00H
BNZ
$ModeOnLoop
FlashWrite:
MOVW
HL,#DataAdrTop
MOVW
DE,#WriteAdr
FlashWriteLoop:
MOV
FLCMD,#05H
MOV
A,D
MOV
FLAPH,A
MOV
A,E
MOV
FLAPL,A
MOV
A,[HL]
MOV
FLW,A
MOV
WDTE,#0ACH
HALT
MOV
A,PFS
CMP
A,#00H
BNZ
$StatusError
INCW
HL
MOVW
AX,HL
CMPW
AX,#DataAdrBtm
BNC
$FlashVerify
306
CHAPTER 18 FLASH MEMORY
; Masks all interrupts
; Clears flash status register
; PFCMD register control
; FLPMC register control (sets value)
; FLPMC register control (inverts set value)
; Sets self programming mode with FLPMC register control
; (sets value)
; Checks completion of write to specific registers
; Repeats the same processing when an error occurs
; Sets address at which data to be written is located
; Sets address at which data is to be written
; Sets flash control command (byte write)
; Sets address at which data is to be written
; Sets address at which data is to be written
; Sets data to be written
; Clears & restarts WDT
; Self programming is started
; Checks write error
; Performs abnormal termination processing when an error
; occurs.
; address at which data to be written is located + 1
; Performs internal verify processing
; if write of all data is completed
User's Manual U16898EJ3V0UD

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents