NEC 78K0S/KA1+ User Manual page 307

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

Advertisement

INCW
DE
BR
FlashWriteLoop
FlashVerify:
MOVW
HL,#WriteAdr
MOV
FLCMD,#01H
MOV
A,H
MOV
FLAPH,A
MOV
A,L
MOV
FLAPL,A
MOV
A,D
MOV
FLAPHC,A
MOV
A,E
MOV
FLAPLC,A
MOV
WDTE,#0ACH
HALT
MOV
A,PFS
CMP
A,#00H
BNZ
$StatusError
ModeOffLoop:
MOV
PFS,#00H
MOV
PFCMD,#0A5H
MOV
FLPMC,#00H
MOV
FLPMC,#0FFH
MOV
FLPMC,#00H
MOV
A,PFS
CMP
A,#00H
BNZ
$ModeOffLoop
MOV
MK0,#INT_MK0
MOV
MK1,#INT_MK1
EI
BR
StatusNormal
;---------------------------------------------------------------------
;END (abnormal termination processing); Perform processing to shift to
CHAPTER 18 FLASH MEMORY
; Address at which data is to be written + 1
; Sets verify address
; Sets flash control command (internal verify)
; Sets verify start address
; Sets verify start address
; Sets verify end address
; Sets verify end address
; Clears & restarts WDT
; Self programming is started
; Checks internal verify error
; Performs abnormal termination processing when an error
; occurs.
; Clears flash status register
; PFCMD register control
; FLPMC register control (sets value)
; FLPMC register control (inverts set value)
; Sets normal mode via FLPMC register control (sets value)
; Checks completion of write to specific registers
; Repeats the same processing when an error occurs
; Restores interrupt mask flag
User's Manual U16898EJ3V0UD
307

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents