NEC 78K0S/KB1+ User Manual page 312

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

Advertisement

MOV
MOV
MOV
HALT
MOV
CMP
BNZ
<R>
MOV
ModeOffLoop:
MOV
MOV
MOV
MOV
MOV
BT
<R>
MOV
MOV
EI
BR
;---------------------------------------------------------------------
;END (abnormal termination processing); Perform processing to shift to
normal mode in order to return to normal processing
;---------------------------------------------------------------------
StatusError:
;---------------------------------------------------------------------
;END (normal termination processing)
;---------------------------------------------------------------------
StatusNormal:
312
CHAPTER 19 FLASH MEMORY
FLAPHC,#07H
; Sets blank check block compare number (same value as of
; FLAPH)
FLAPLC,#0FFH
; Fixes FLAPLC to "FFH"
WDTE,#0ACH
; Clears & restarts WDT
; Self programming is started
A,PFS
A,#00H
$StatusError
; Checks blank check error
; Performs abnormal termination processing when an error
; occurs
FLCMD,#00H
; Clears FLCMD register
PFS,#00H
; Clears flash status register
PFCMD,#0A5H
; PFCMD register control
FLPMC,#00H
; FLPMC register control (sets value)
FLPMC,#0FFH
; FLPMC register control (inverts set value)
FLPMC,#00H
; Sets normal mode via FLPMC register control (sets value)
PFS.0,$ModeOffLoop ; Checks completion of write to specific registers
; Repeats the same processing when an error occurs
; Restore the CPU clock to its setting before the self
; programming, after normal completion of the specific
; sequence
MK0,#INT_MK0
; Restores interrupt mask flag
MK1,#INT_MK1
StatusNormal
User's Manual U17446EJ3V1UD

Advertisement

Table of Contents
loading

Table of Contents