MC97F2664
254
April 11, 2014 Ver. 1.4
The Byte Write program procedure in user program mode
1. Page buffer clear (FMCR=0x01)
2. Write data 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. Write verify
NOTE) Data of the address should be
“00H” before writing data to an address
Program Tip
–
byte write
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,#5
MOV
DPH,#0x80
MOV
DPL,#0
MOVX @DPTR,A
;Write data to page buffer
MOV
A,#6
MOV
DPH,#0x80
MOV
DPL,#0x05
MOVX @DPTR,A
;Write data to page buffer
MOV
FSADRH,#0x00
MOV
FSADRM,#0x7F
MOV
FSADRL,#0x40
;Select sector 509
MOV
FIDR,#0xA5
;Identification value
MOV
FMCR,#0x03
;Start flash write 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
;write verify
MOV
R1,#5
MOV
DPH,#0x7F
MOV
DPL,#0x40
MOVC A,@A+DPTR
SUBB
A,R1
;0x7F40 = 5 ?
JNZ
Verify_error
MOV
A,#0
MOV
R1,#6
MOV
DPH,#0x7F
MOV
DPL,#0x45
MOVC A,@A+DPTR
SUBB
A,R1
;0x7F45 = 6 ?
JNZ
Verify_error
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...