ST10F269-T3
5.5.2 - Basic Flash Access Control
When accessing the Flash all command write addresses have to be located within the active Flash
memory space. The active Flash memory space is that logical address range which is covered by the
Flash after mapping. When using data page pointer (DPP) for addressing the Flash, make sure that
address bit A15 and A14 of the command addresses are reflected in both LSBs of the selected data page
pointer (A15 - DPPx.1 and A14 - DPPx.0).
In case of the command write addresses, address bit A14, A15 and above are don鈥檛 care. Thus, command
writes can be performed by only using one DPP register. This allow to have a more simple and compact
application software.
Another - advantageous - possibility is to use the extended segment instruction for addressing.
Note: The direct addressing mode is not allowed for write access to the Flash address/command
register. Be aware that the C compiler may use this kind of addressing. For write accesses to
Flash module always the
indirect
addressing mode has to be selected.
The following basic instruction sequences show examples for different addressing possibilities.
Principle example of address generation for Flash commands and registers:
When using data page pointer (DPP0 is this example)
MOV
DPP0,#08h
;adjust data page pointers according to the
;addresses: DPP0 is used in this example, thus
;ADDRESS must have A14 and A15 bit set to 鈥?鈥?
;ADDRESS could be a dedicated command sequence
;address 2AA8h, 1554h ... ) or the Flash write
;address
;DATA could be a dedicated command sequence data
;(xxA0h,xx80h ... ) or data to be programmed
;indirect
addressing
MOV
Rw
m
,#ADDRESS
MOV
MOV
Rw
n
,#DATA
[Rw
m
],Rw
n
When using the extended segment instruction:
MOV
Rw
m
,#ADDRESS
;ADDRESS could be a dedicated command sequence
;address (2AA8h, 1554h ... ) or the Flash write
;address
;DATA could be a dedicated command sequence data
;(xxA0h,xx80h ... ) or data to be programmed
;the value of SEGMENT represents the segment
;number and could be 0, 1, 2, 3 or 4 (depending
;on sector mapping) for 256KByte Flash.
;the value of Rwn determines the 8-bit segment
;valid for the corresponding data access for any
;long or indirect address in the following(s)
;instruction(s). LENGTH defines the number of
;the effected instruction(s) and has to be a value
;between 1...4
;indirect
addressing with segment number from
;EXTS
MOV
MOV
Rw
o
,#DATA
Rw
n
,#SEGMENT
EXTS
Rw
n
,#LENGTH
MOV
[Rw
m
],Rw
o
26/160