Sector Erase - Samsung S3F80JB User Manual

8-bit cmos microcontrollers
Table of Contents

Advertisement

EMBEDDED FLASH MEMORY INTERFACE
PROGRAMMING TIP — Sector Erase
Case1. Erase one sector
ERASE_ONESECTOR:
ERASE_STOP:
Case2.Erase flash memory space from Sector (n) to Sector (n + m)
;;Pre-define the number of sector to erase
ERASE_LOOP:
15-10
SB1
LD
FMUSR,#0A5H
LD
FMSECH,#40H
LD
FMSECL,#00H
LD
FMCON,#10100001B
LD
FMUSR,#00H
SB0
LD
SecNumH,#00H
LD
SecNumL,#128
LD
R6,#01H
LD
R7,#7DH
LD
R2,SecNumH
LD
R3,SecNumL
CALL
SECTOR_ERASE
XOR
P4,#11111111B
INCW
RR2
LD
SecNumH,R2
LD
SecNumL,R3
DECW RR6
LD
R8,R6
OR
R8,R7
CP
R8,#00H
JP
NZ,ERASE_LOOP
; User program mode enable
; Set sector address 4000H,sector 128,
; among sector 0~511
; Select erase mode enable & Start sector erase
; User program mode disable
; Set sector number
; Selection the sector128 ( base address 4000H )
; Set the sector range (m) to erase
; into High-byte(R6) and Low-byte(R7)
; Display ERASE_LOOP cycle
S3F80JB

Advertisement

Table of Contents
loading

Table of Contents