User`s guide

External Memory LZ87010 Advance User’s Guide
11-4 1/15/03
11.3 Registers
The external memory system is controlled by a single register, XMCFG. This register
enables external memory, determines how much of the Flash memory is replaced by
external memory, and sets the number of wait states to use on memory accesses.
Table 11-2. XMCFG Register
BIT 7 6 5 4 3 2 1 0
FIELD XMCC[3] XMCC[2] XMCC[1] XMCC[0] XMBNK[2] XMBNK[1] XMBNK[0] XMALL
RESET 0000 0 0 01
RW RW RW RW RW RW RW RW RW
ADDR 0xC5
Table 11-3. XMCFG Register Bits
BIT NAME DESCRIPTION
7:4 XMCC[3:0]
External Memory Command Control Sets the number of wait states used
in both read and write cycles. For reads, nPSEN will be asserted for one
CCLK cycle plus the number of wait states specified in this field. For writes,
nPSWR will be asserted for CCLK cycle plus the number of wait states spec-
ified in this field. For example, if XMCC[3:0] is set to 0b0101, five wait states
will be used, meaning that nPSEN will be asserted for six cycles on reads,
and nPSWR will be asserted for six cycles on writes.
Since the external memory interface has no handshaking, this field must be pro-
grammed to take care of the worst-case timing of the external memory device.
3:1 XMBNK[2:0]
External Memory Bank Select These bits determine how much of the in-
ternal Flash memory will be replaced with external memory. See Table 11-4
for the decoding of this field.
0XMALL
External Memory All On-chip Enable When set to ‘1’, all program mem-
ory accesses refer to on-chip Flash. When ‘0’, the mapping given in the
XMBNK[2:0] field determines whether a given access uses on-chip Flash or
external program memory. If the Flash has been placed in Secure Mode, this
bit will be set to ‘1’ and writes to it will be ignored. This prevents external
memory access in Secure Mode. The default on Reset is for this bit to be set,
enabling only the on-chip Flash.
Table 11-4. XMBNK[2:0] Field Encoding
XMBNK[2:0]
FLASH
ADDRESS RANGE
EXTERNAL MEMORY
ADDRESS RANGE
000 0x0000 - 0xDFFF 0xE000 - 0xFFFF
001 0x0000 - 0xBFFF 0xC000 - 0xFFFF
010 0x0000 - 0x9FFF 0xA000 - 0xFFFF
011 0x0000 - 0x7FFF 0x8000 - 0xFFFF
100 0x0000 - 0x5FFF 0x6000 - 0xFFFF
101 0x0000 - 0x3FFF 0x4000 - 0xFFFF
110 0x0000 - 0x1FFF 0x2000 - 0xFFFF
111 None 0x0000 - 0xFFFF