English
Language : 

HD6433044 Datasheet, PDF (601/867 Pages) Hitachi Semiconductor – Hitachi Single-Chip Microcomputer
Sample Program for Programming One Byte: This program uses the following registers.
R0: Program-verify fail counter
R1: Program-verify timing loop counter
ER2: Stores the address to be programmed as long word data. Valid addresses are H'00000000
to H'0001FFFF.
R3H: Stores data to be programmed as byte data
R4: Sets and clears TCSR and FLMCR
E4: Stores the initial program loop counter value
R5: Clears FLMCR
E5: Stores the program loop counter value
Arbitrary data can be programmed at an arbitrary address by setting the address in ER2 and the
data in R3H.
The values of #a, #b, and #g depend on the clock frequency. They can be calculated as indicated
under table 18-14.
FLMCR:
EBR1:
EBR2:
TCSR:
.EQU
.EQU
.EQU
.EQU
FFFF40
FFFF42
FFFF43
FFFFA8
PRGM:
LOOP0:
PRGMS:
LOOP1:
MOV.W
MOV.W
MOV.W
MOV.B
DEC.W
BPL
MOV.B
MOV.B
MOV.B
MOV.W
MOV.W
MOV.W
MOV:W
MOV.W
MOV.B
DEC.W
BPL
MOV.B
MOV.W
MOV.W
#0001,
#g,
#4140,
R4L,
#1,
LOOP0
#**,
R0H,
R3H,
#a,
#A579,
R4,
E4,
#4140,
R4H,
#1,
LOOP1
R4L,
#A500,
R4,
R0
; Program-verify fail count
R1
; Set program loop counter
R4
;
@FLMCR:8 ; Set VPPE bit
R1
;
R0H
;
@EBR*:8 ; Set EBR*
@ER2
; Dummy write
E4
; Set initial program loop counter value
R4
; Start watchdog timer
@TCSR:16 ;
E5
; Set program loop counter
R4
;
@FLMCR:8 ; Set P bit
E5
; Program
;
@FLMCR:8 ; Clear P bit
R4
;
@TCSR:16 ; Stop watchdog timer
LOOP2:
MOV:W
MOV.B
MOV.B
DEC.W
BPL
MOV.B
#b ,
#44,
R4H,
#1,
LOOP2
@ER2,
R1
; Set program-verify loop counter
R4H
;
@FLMCR:8 ; Set PV bit
R1
; Wait
;
R1H
; Read programmed address
592