datasheetbank_Logo
Integrated circuits, Transistor, Semiconductors Search and Datasheet PDF Download Site

ST10F280-JT3 View Datasheet(PDF) - STMicroelectronics

Part Name
Description
View to exact match
ST10F280-JT3 Datasheet PDF : 186 Pages
First Prev 31 32 33 34 35 36 37 38 39 40 Next Last
ST10F280
Example 3 Performing the Block Erase command
We assume that in the initialization phase the lowest 32K Bytes of Flash memory (sector 0) have been
mapped to segment 1.The registers R11/R12 contain an address related to the block to be erased
(segment number in R11, segment offset in R12, for example R11 = 01h, R12= 4000h will erase the block
1 first 8K byte block).
MOV R5, #01554h
;load auxilary register R5 with command address
;(used in command cycle 1)
MOV R6, #02AA8h
SXCT DPPO, #08h
MOV R7, #0A8h
MOV [R5], R7
MOV R7, #054h
MOV [R6], R7
MOV R7, #080h
MOV [R5], R7
MOV R7, #0A8h
MOV [R5], R7
MOV R7, #054h
MOV [R6], R7
POP DPP0
MOV R7, #030h
EXTS R11, #1
MOV [R12], R7
Erase_Polling:
EXTS R11, #1
MOV R7, [R12]
JB R7.7, Erase_OK
;load auxilary register R6 with command address
;(used in command cycle 2)
;push data page pointer 0 and load it to point ;to
;segment 2
;load register R7 with 1st CI enable command
;command cycle 1
;load register R7 with 2cd CI enable command
;command cycle 2
;load register R7 with Block Erase command
;command cycle 3
;load register R7 with 1st CI enable command
;command cycle 4
;load register R7 with 2cd CI enable command
;command cycle 5
;restore DPP0: following addressing to the Flash
;will use EXTended instructions
;R11 contains the segment of the block to be erased
;R12 contains the segment offset address of the
;block to be erased
;load register R7 with erase confirm code
;use EXTended addressing for next MOV instruction
;command cycle 6: the EPC starts execution of
;Erasing Command
;use EXTended addressing for next MOV instruction
;read Flash Status register (FSB) in R7
;Check if FSB.7 = ‘1’ (i.e. R7.7 = ‘1’)
JNB R7.5, Erase_Polling
Erase_Error:
MOV R7, #0F0h
EXTS R11, #1
MOV [R12], R7
...
...
...
;Check if FSB.5 = 1 (Erasing Error)
;Programming failed: Flash remains in Write
;Operation.
;To go back to normal Read operations, a Read/Reset
;command
;must be performed
;load register R7 with Read/Reset command
;use EXTended addressing for next MOV instruction
;address is don’t care for Read/Reset command
;here place specific Error handling code
Erase_OK:
....
....
;When erasing operation finished succesfully,
;Flash is set back automatically to normal Read Mode
33/186
 

Share Link: 

datasheetbank.com [ Privacy Policy ] [ Request Datasheet ] [ Contact Us ]