
Section 6 ROM
Rev. 6.00 Sep 12, 2006 page 135 of 526
REJ09B0326-0600
Sample Program for Erasing One Block
This program uses the following registers:
R0:
Used for erase block specification. Also stores address used in prewrite and erase-verify.
R1H: Stores read data. Also used in dummy write.
R2:
Stores last address of block to be erased.
R3:
Stores address used in prewrite and erase-verify.
R4:
Used for prewrite, prewrite-verify, erase, and erase-verify loop counter value setting. Also
stores register set values.
R5:
Used for prewrite and erase loop counter value setting.
R6L: Used for prewrite-verify and erase-verify fail count.
The values of #a, #b, #c, #d, and #e in the program depend on the operating frequency. They
should be set as indicated in tables 6.11 and 6.12. Erase block register (EBR1, EBR2) settings
should be made as indicated in sections 6.5.2 and 6.5.3 in section 6.5, Flash Memory Register
Descriptions. For #BLKSTR and #BLKEND, the start address and end address corresponding to
the set erase block register should be set as indicated in table 6.7.
FLMCR: .EQU H'FF80
EBR1: .EQU
H'FF82
EBR2: .EQU
H'FF83
TCSRW: .EQU H'FFBE
TCW: .EQU
H'FFBF
.ALIGN
2
MOV.B
#H'**,
R0H
;
MOV.B
R0H,
@EBR*:8
;
Set EBR
*
; #
BLKSTR is start address of block to be erased
; #
BLKEND is last address of block to be erased
MOV.W
#BLKSTR,
R0 ;
Start address of block to be erased
MOV.W
#BLKEND,
R2 ;
Last address of block to be erased
ADDS
#1,
R2 ;
Last address of block to be 1
→
R2
;
Execute prewrite
MOV.W
R0,
R3 ;
Start address of block to be erased
Содержание F-ZTAT H8/3642A Series
Страница 6: ...Rev 6 00 Sep 12 2006 page iv of xx ...
Страница 8: ...Rev 6 00 Sep 12 2006 page vi of xx ...
Страница 21: ...Rev 6 00 Sep 12 2006 page xix of xx Appendix E Product Code Lineup 522 Appendix F Package Dimensions 524 ...
Страница 22: ...Rev 6 00 Sep 12 2006 page xx of xx ...
Страница 124: ...Section 5 Power Down Modes Rev 6 00 Sep 12 2006 page 102 of 526 REJ09B0326 0600 ...
Страница 188: ...Section 6 ROM Rev 6 00 Sep 12 2006 page 166 of 526 REJ09B0326 0600 ...
Страница 190: ...Section 7 RAM Rev 6 00 Sep 12 2006 page 168 of 526 REJ09B0326 0600 ...
Страница 298: ...Section 9 Timers Rev 6 00 Sep 12 2006 page 276 of 526 REJ09B0326 0600 ...
Страница 378: ...Section 12 A D Converter Rev 6 00 Sep 12 2006 page 356 of 526 REJ09B0326 0600 ...
Страница 446: ...Section 13 Electrical Characteristics Rev 6 00 Sep 12 2006 page 424 of 526 REJ09B0326 0600 ...