MC97F2664
April 11, 2014 Ver. 1.4
251
15.1.8 Erase Mode
The sector erase program procedure in user program mode
1. Page buffer clear (FMCR=0x01)
2. Write
‘0’ to page buffer
3. Set flash sector address register (FSADRH/FSADRM/FSADRL).
4. Set flash identification register (FIDR).
5. Set flash mode control register (FMCR).
6. Erase verify
Program Tip
–
sector erase
MOV
FMCR,#0x01
;page buffer clear
NOP
;Dummy instruction, This instruction must be needed.
NOP
;Dummy instruction, This instruction must be needed.
NOP
;Dummy instruction, This instruction must be needed.
MOV
A,#0
MOV
R0,#64
;Sector size is 64bytes
MOV
DPH,#0x80
MOV
DPL,#0
Pgbuf_clr:
MOVX @DPTR,A
INC
DPTR
DJNZ
R0, Pgbuf_clr
;Write
‘
0
’
to all page buffer
MOV
FSADRH,#0x00
MOV
FSADRM,#0x7F
MOV
FSADRL,#0x40
;Select sector 509
MOV
FIDR,#0xA5
;Identification value
MOV
FMCR,#0x02
;Start flash erase mode
NOP
;Dummy instruction, This instruction must be needed.
NOP
;Dummy instruction, This instruction must be needed.
NOP
;Dummy instruction, This instruction must be needed.
MOV
A,#0
;erase verify
MOV
R0,#64
;Sector size is 64bytes
MOV
R1,#0
MOV
DPH,#0x7F
MOV
DPL,#0x40
Erase_verify:
MOVC A,@A+DPTR
SUBB
A,R1
JNZ
Verify_error
INC
DPTR
DJNZ
R0, Erase_verify
Verify_error:
Содержание MC97F2664
Страница 20: ...MC97F2664 20 April 11 2014 Ver 1 4 4 Package Diagram Figure 4 1 64 Pin LQFP 1010 Package...
Страница 21: ...MC97F2664 April 11 2014 Ver 1 4 21 Figure 4 2 64 Pin LQFP 1414 Package...
Страница 22: ...MC97F2664 22 April 11 2014 Ver 1 4 Figure 4 3 64 Pin QFN Package...
Страница 23: ...MC97F2664 April 11 2014 Ver 1 4 23 Figure 4 4 44 Pin MQFP 1010 Package...