NEC 78K0S/KU1+ User Manual page 255

8-bit single-chip microcontrollers
Hide thumbs Also See for 78K0S/KU1+:
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
FLCMD,#00H
DI
ModeOnLoop:
MOV
PFS,#00H
MOV
PFCMD,#0A5H
MOV
FLPMC,#01H
MOV
FLPMC,#0FEH
MOV
FLPMC,#01H
NOP
HALT
BT PFS.0,$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
CHAPTER 16 FLASH MEMORY
; Masks all interrupts
; Clears FLCMD register
; Configure settings so that the CPU clock ≥ 1 MHz
; 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 U18172EJ2V0UD
255

Advertisement

Table of Contents
loading

Table of Contents