English
Language : 

UPD78F9234MC-5A4-A Datasheet, PDF (324/419 Pages) Renesas Technology Corp – Old Company Name in Catalogs and Other Documents
CHAPTER 19 FLASH MEMORY
CMP
A,#00H
; Checks execution result
BNZ
$StatusError ; Checks blank check error
; Performs abnormal termination processing when an error occurs
CALL
!ModeOff
; Shift to normal mode
<R>
BR
RetryCheck:
DBNZ
StatusNormal
B,$EraseRetry
;---------------------------------------------------------------------
;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 ; Masks all interrupts
MOV
MK1,#11111111B
MOV
FLCMD,#00H
; Clears FLCMD register
DI
ModeOnLoop:
MOV
MOV
MOV
MOV
MOV
PFS,#00H
PFCMD,#0A5H
FLPMC,#01H
FLPMC,#0FEH
FLPMC,#01H
; 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 via FLPMC register control (sets
; value)
NOP
HALT
BT
PFS.0,$ModeOnLoop ; Checks completion of write to specific registers
; Repeats the same processing when an error occurs
RET
322
User’s Manual U17446EJ5V0UD