English
Language : 

HD64F3437TF16 Datasheet, PDF (498/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 prewrite
PREWRT: MOV.W
PREW: MOV.B
MOV.W
PREWRS: INC
MOV.B
MOV.B
MOV.W
MOV.W
MOV.W
BSET
LOOPR1: SUBS
MOV.W
BNE
BCLR
MOV.W
MOV.W
@R2+,
#H'00,
#H'a,
R6L
#H'00
R1H,
#H'A579,
R4,
R5,
#0,
#1,
R4,
LOOPR1
#0,
#H'A500,
R4,
R3
; Prewrite starting address
R6L
; Prewrite-verify fail counter
R5
; Prewrite-verify loop counter
; Prewrite-verify fail counter + 1 → R6L
R1H
;
@R3
; Write H'00
R4
;
@TCSR ; Start watchdog timer
R4
; Set prewrite loop counter
@FLMCR:8 ; Set P bit
R4
;
R4
;
; Wait loop
@FLMCR:8 ; Clear P bit
R4
;
@TCSR ; Stop watchdog timer
LOOPR2:
MOV.B
DEC
BNE
MOV.B
BEQ
CMP.B
BEQ
ADD.W
BRA
#H'c,
R4H
R4H
LOOPR2
@R3,
R1H
PWVFOK
#H'06, R6L
ABEND1
R5,
R5
PREWRS
; Set prewrite-verify loop counter
;
; Wait loop
; Read data = H'00?
; If read data = H'00 branch to PWVFOK
; Prewrite-verify executed 6 times?
; If prewrite-verify executed 6 times, branch to ABEND1
; Programming time × 2
; Prewrite again
ABEND1: Programming error
PWVFOK:
PWADD2:
ADDS
MOV.W
CMP.W
BNE
INC
BRA
#1,
R3
@R2,
R4
R4,
R3
PREW
R1L
PRETST
; Address + 1 → R3
; Top address of next block
; Last address?
; If not last address, prewrite next address
; Used to test R1L+1 bit in R0
; Branch to PRETST
; 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
; Erase-verify fail counter
R5
; Set erase loop count
R6
; Erase-verify fail counter + 1 → R6
R4
;
@TCSR ; Start watchdog timer
R4
; Set erase loop counter
@FLMCR:8 ; Set E bit
#1,
R4,
LOOPE
#1,
#H'A500,
R4,
R4
;
R4
;
; Wait loop
@FLMCR:8 ; Clear E bit
R4
;
@TCSR ; Stop watchdog timer
469