English
Language : 

UPD78F9234MC-5A4-A Datasheet, PDF (303/419 Pages) Renesas Technology Corp – Old Company Name in Catalogs and Other Documents
<R>
<R>
CHAPTER 19 FLASH MEMORY
An example of a program that performs a block erase in self programming mode is shown below.
;----------------------------
;START
;----------------------------
MOV
B,#48
; Specifies the number of times the erase command can be
; executed.
; (4.0 V to 5.5 V Time for executing block erasure 100 times)
FlashBlockErase:
MOV
FLCMD,#03H
MOV
FLAPH,#07H
MOV
FLAPL,#00H
MOV
FLAPHC,#07H
MOV
FLAPLC,#00H
; Sets flash control command (block erase)
; Sets number of block to be erased (block 7 is specified here)
; Fixes FLAPL to “00H”
; Sets erase block compare number (same value as that of FLAPH)
; Fixes FLAPLC to “00H”
EraseRetry:
MOV
MOV
HALT
MOV
CMP
BZ
DBNZ
PFS,#00H
; Clears flash status register
WDTE,#0ACH
; Clears & restarts WDT
; Self programming is started
A,PFS
A,#00H
; Checks execution result
$StatusNormal ; Normal termination
B,$EraseRetry ; Checks whether to re-execute the erase command.
;---------------------------------------------------------------------
;END (abnormal termination processing); Perform processing to shift to
normal mode in order to return to normal processing
;---------------------------------------------------------------------
StatusError:
;---------------------------------------------------------------------
;END (normal termination processing)
;---------------------------------------------------------------------
StatusNormal:
User’s Manual U17446EJ5V0UD
301