NEC 78K0S/KA1+ User Manual page 312

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

Advertisement

CALL
!ModeOff
BR
StatusNormal
;---------------------------------------------------------------------
;END (abnormal termination processing); Perform processing to shift to
normal mode in order to return to normal processing
;---------------------------------------------------------------------
StatusError:
;---------------------------------------------------------------------
;END (normal termination processing)
;---------------------------------------------------------------------
StatusNormal:
;---------------------------------------------------------------------
;Processing to shift to self programming mode
;---------------------------------------------------------------------
ModeOn:
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
RET
;---------------------------------------------------------------------
; Processing to shift to normal mode
;---------------------------------------------------------------------
ModeOff:
MOV
PFS,#00H
MOV
PFCMD,#0A5H
MOV
FLPMC,#00H
312
CHAPTER 18 FLASH MEMORY
; Shift to normal mode
; 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 via FLPMC register control (sets
; value)
; Checks completion of write to specific registers
; Repeats the same processing when an error occurs
; PFCMD register control
; FLPMC register control (sets value)
User's Manual U16898EJ3V0UD

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents