MC96F6432
June 22, 2018 Ver. 2.9
311
15.1.9 Write Mode
The sector 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. Check the UserID for to prevent the invalid work
(Note1)
.
6. Set flash mode control register (FMCR).
7. Erase verify
Note) 1. Please refer to the chapter
“Protection for Invalid Erase/Write”
2. All data of the sector should be
“00H” before writing data to a sector
3.
On flash memory erase and write, it should be disabled the RXE0/1 bit of USI0CR2/USI1CR2
register.
Program Tip
–
sector 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,#0
MOV
R0,#SectorSize
;Sector size of Device
MOV
DPH,#0x80
;Page Buffer Address is 8000H
MOV
DPL,#0
Pgbuf_WR: MOVX @DPTR,A
INC
A
INC
DPTR
DJNZ
R0, Pgbuf_WR
;Write data to all page buffer
MOV
FSADRH,#SAH
;Sector Address High Byte
MOV
FSADRM,#SAM
;Sector Address Middle Byte
MOV
FSADRL,#SAL
;Sector Address Low Byte
MOV
FIDR,#0xA5
;Identification value
MOV
A,#ID_DATA_1
;Check the UserID(written by user)
CJNE A,UserID1,No_WriteErase ;This routine for UserID must be needed.
MOV
A,#ID_DATA_2
CJNE A,UserID2,No_WriteErase
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.
LJMP
Write _verify
No_WriteErase:
MOV
FIDR,#00H
MOV
UserID1,#00H
MOV
UserID2,#00H
---
Write_verify:
---
Verify_error:
---
Содержание MC96F6332D
Страница 24: ...MC96F6432 24 June 22 2018 Ver 2 9 4 Package Diagram Figure 4 1 48 Pin LQFP 0707 Package...
Страница 25: ...MC96F6432 June 22 2018 Ver 2 9 25 Figure 4 2 44 Pin MQFP Package...
Страница 26: ...MC96F6432 26 June 22 2018 Ver 2 9 Figure 4 3 32 Pin LQFP Package...
Страница 27: ...MC96F6432 June 22 2018 Ver 2 9 27 Figure 4 4 32 Pin SOP Package...
Страница 28: ...MC96F6432 28 June 22 2018 Ver 2 9 Figure 4 5 28 Pin SOP Package...