English
Language : 

HD64F3437TF16 Datasheet, PDF (432/752 Pages) Hitachi Semiconductor – 12 V must not be applied to the S-mask model (single-power-supply specification), as this may permanently damage the device.
;Execute erase
ERASES: MOV.W
MOV.W
ERASE: ADDS
MOV.W
MOV.W
MOV.W
BSET
LOOPE: NOP
NOP
NOP
NOP
SUBS
MOV.W
BNE
BCLR
MOV.W
MOV.W
#H'0000,
#H'd,
#1,
#H'e,
R4,
R5,
#1,
R6
R5
R6
R4
@TCSR
R4
@FLMCR:8
; Erase-verify fail counter
; Set erase loop count
; Erase-verify fail counter + 1 → R6
;
; Start watchdog timer
; Set erase loop counter
; Set E bit
#1,
R4,
LOOPE
#1,
#H'A500,
R4,
R4
R4
@FLMCR:8
R4
@TCSR
;
;
; Wait loop
; Clear E bit
;
; Stop watchdog timer
; Execute erase-verify
MOV.W
MOV.B
BSET
LOOPEV: DEC
BNE
EVR2: MOV.B
MOV.B
MOV.B
LOOPDW: DEC
BNE
MOV.B
CMP.B
BNE
CMP.W
BNE
BRA
R0,
#H'b,
#3,
R4H
LOOPEV
#H'FF,
R1H,
#H'c,
R4H
LOOPDW
@R3+,
#H'FF,
RERASE
R2,
EVR2
OKEND
R3
R4H
@FLMCR:8
R1H
@R3
R4H
R1H
R1H
R3
; Top address of block to be erased
; Set erase-verify loop counter
; Set EV bit
;
; Wait loop
;
; Dummy write
; Set erase-verify loop counter
;
; Wait loop
; Read
; Read data = H'FF?
; If read data ≠ H'FF, branch to RERASE
; Last address of block?
RERASE: BCLR
SUBS
BRER:
MOV.W
CMP.W
BNE
BRA
OKEND:
BCLR
MOV.B
MOV.B
#3,
@FLMCR:8 ; Clear EV bit
#1,
R3
; Erase-verify address – 1 → R3
#H'0BB8, R4
R4,
R6
ERASE
ABEND2
;
; Erase-verify executed 3000 times?
; If erase-verify not executed 3000 times, erase again
; If erase-verify executed 3000 times, branch to ABEND2
#3,
#H'00,
R6L,
@FLMCR:8 ; Clear EV bit
R6L
;
@EBR*:8 ; Clear EBR*
One block erased
ABEND2: Erase error
403