English
Language : 

HD64F3337YCP16V Datasheet, PDF (437/749 Pages) Renesas Technology Corp – Old Company Name in Catalogs and Other Documents
; 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'A578,
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
BRA
#H'c,
R4H
LOOPR2
@R3,
PWVFOK
#H'32,
ABEND1
PREWRS
R4H
R1H
R6L
; Set prewrite-verify loop counter
;
; Wait loop
; Read data = H'00?
; If read data = H'00 branch to PWVFOK
; Prewrite-verify executed 50 times?
; If prewrite-verify executed 50 times, branch to ABEND1
; Prewrite again
ABEND1: Programming error
PWVFOK:
PWADD2:
ADDS
MOV.W
CMP.W
BNE
INC
BRA
#1,
R3
; Address + 1 → R3
@R2,
R4
; Top address of next block
R4,
R3
; Last address?
PREW
; If not last address, prewrite next address
R1L
; Used to test R1L+1 bit in R0
PRETST
; 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
405