st10f269z1 STMicroelectronics, st10f269z1 Datasheet - Page 30

no-image

st10f269z1

Manufacturer Part Number
st10f269z1
Description
St10f269 16-bit Mcu With Mac Unit, 256k Byte Flash Memory And 12k Byte Ram
Manufacturer
STMicroelectronics
Datasheet

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
st10f269z1Q3
Manufacturer:
STMicroelectronics
Quantity:
10 000
Part Number:
st10f269z1Q3
Manufacturer:
ST
0
Part Number:
st10f269z1Q6
Manufacturer:
ST
Quantity:
1 200
Part Number:
st10f269z1Q6
Manufacturer:
STMicroelectronics
Quantity:
10 000
5 - INTERNAL FLASH MEMORY
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
MOV
SXCT
MOV
MOV
MOV
MOV
MOV
MOV
MOV
MOV
MOV
MOV
POP
MOV
EXTS
MOV
Erase_Polling:
EXTS
MOV
JB
JNB
Erase_Error:
MOV
EXTS
MOV
...
...
...
Erase_OK:
....
30/184
R5, #01554h
R6, #02AA8h
DPPO, #08h
R7, #0A8h
[R5], R7
R7, #054h
[R6], R7
R7, #080h
[R5], R7
R7, #0A8h
[R5], R7
R7, #054h
[R6], R7
DPP0
R7, #030h
R11, #1
[R12], R7
R11, #1
R7, [R12]
R7.7, Erase_OK
R7.5, Erase_Polling
R7, #0F0h
R11, #1
[R12], R7
;load auxilary register R5 with command address
;(used in command cycle 1)
;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’)
;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
;When erasing operation finished succesfully,
;Flash is set back automatically to normal Read Mode
ST10F269

Related parts for st10f269z1