Programming - Samsung S3F80JB User Manual

8-bit cmos microcontrollers
Table of Contents

Advertisement

S3F80JB
PROGRAMMING TIP — Programming
Case1. 1-Byte Programming
WR_BYTE:
SB1
LD
FMUSR,#0A5H
LD
FMCON,#01010000B
LD
FMSECH, #40H
LD
FMSECL, #00H
LD
R9,#0AAH
LD
R10,#40H
LD
R11,#10H
LDC
@RR10,R9
LD
FMUSR,#00H
SB0
Case2. Programming in the same sector
WR_INSECTOR:
LD
R0,#40H
SB1
LD
FMUSR,#0A5H
LD
FMCON,#01010000B
LD
FMSECH,#40H
LD
FMSECL,#00H
LD
R9,#33H
LD
R10,#40H
LD
R11,#40H
WR_BYTE:
LDC
@RR10,R9
INC
R11
DJNZ
R0,WR_BYTE
LD
FMUSR,#00H
SB0
; Write data "AAH" to destination address 4010H
; User program mode enable
; Selection programming mode
; Set the base address of sector (4000H)
; Load data "AA" to write
; Load flash memory upper address into upper register of pair working
; register
; Load flash memory lower address into lower register of pair working
; register
; Write data 'AAH' at flash memory location (4010H)
; User program mode disable
; RR10-->Address copy (R10 –high address,R11-low address)
; User program mode enable
; Selection programming mode and Start programming
; Set the base address of sector located in target address to write data
; The sector 128's base address is 4000H.
; Load data "33H" to write
; Load flash memory upper address into upper register of pair working
; register
; Load flash memory lower address into lower register of pair working
; register
; Write data '33H' at flash memory location
; Reset address in the same sector by INC instruction
; Check whether the end address for programming reach 407FH or not.
; User Program mode disable
EMBEDDED FLASH MEMORY INTERFACE
15-15

Advertisement

Table of Contents
loading

Table of Contents