Samsung S3F80JB Sectorerase, Btjrf FLAGS.7,NOCARRY, Nocarry, Erasestart SB1 FMUSR,#0A5H, SB0 RET

Models: S3F80JB

1 346
Download 346 pages 34.13 Kb
Page 290
Image 290

S3F80JB

 

 

EMBEDDED FLASH MEMORY INTERFACE

 

 

 

 

SECTOR_ERASE:

 

 

 

LD

R12,SecNumH

 

 

LD

R14,SecNumL

 

 

MULT

RR12,#80H

; Calculation the base address of a target sector

 

MULT

RR14,#80H

; The size of one sector is 128-bytes

 

ADD

R13,R14

; BTJRF FLAGS.7,NOCARRY

 

 

 

NOCARRY:

 

 

; INC R12

LD

R10,R13

 

 

 

 

LD

R11,R15

 

ERASE_START:

SB1

 

 

 

 

 

 

LD

FMUSR,#0A5H

; User program mode enable

 

LD

FMSECH,R10

; Set sector address

 

LD

FMSECL,R11

 

ERASE_STOP:

LD

FMCON,#10100001B

; Select erase mode enable & Start sector erase

LD

FMUSR,#00H

; User program mode disable

 

 

SB0

 

 

 

RET

 

 

15-11

Page 290
Image 290
Samsung S3F80JB Sectorerase, Btjrf FLAGS.7,NOCARRY, Nocarry, Erasestart SB1 FMUSR,#0A5H, FMSECH,R10, FMSECL,R11 Erasestop