
88/190
ST90158 - EXTERNAL MEMORY INTERFACE (EXTMI)
REGISTER DESCRIPTION
(Cont’d)
EXTERNAL MEMORY REGISTER 2 (EMR2)
R246 - Read/Write
Register Page: 21
Reset value: 0000 1111 (0Fh)
Bit 7 = Reserved.
Bit 6 =
ENCSR
: Enable Code Segment Register.
This bit affects the ST9 CPU behavior whenever
an interrupt request is issued.
0: The CPU works in original ST9 compatibility
mode concerning stack frame during interrupts.
For the duration of the interrupt service routine,
ISR is used instead of CSR, and the interrupt
stack frame is identical to that of the original
ST9: only the PC and Flags are pushed. This
avoids saving the CSR on the stackin the event
of an interrupt, thus ensuring a faster interrupt
response time. The drawback is that it is not
possible for an interrupt service routine to per-
form inter-segment calls or jumps: theseinstruc-
tions wouldupdate theCSR, which, in this case,
is notused (ISR is used instead). The code seg-
ment sizefor allinterrupt service routinesis thus
limited to 64K bytes.
1: If ENCSR is set, ISR is only used to point to the
interrupt vector table and to initialize the CSR at
thebeginning ofthe interrupt service routine: the
old CSR is pushed onto the stack together with
the PC and flags, and CSR is then loaded with
the contents of ISR. In this case, iret will also re-
store CSR from the stack. This approach allows
interrupt service routines to access the entire
4Mbytes ofaddress space; the drawback is that
the interruptresponse timeis slightly increased,
because of the need to also save CSR on the
stack. Full compatibility with the original ST9 is
lost in this case, because the interrupt stack
frame is different; this difference, however,
should notaffect the vast majority of programs.
Bit 5 =
DPRREM
: Data Page Registers remapping
0: The locations of the four MMU (Memory Man-
agement Unit) Data Page Registers (DPR0,
DPR1, DPR2 and DPR3) are in page 21.
1: The four MMU Data Page Registers are
swapped with that of the DataRegisters of ports
0-3.
Refer to Figure 43
Bit 4 =
MEMSEL
: Memory Selection.
Warning:
Must be set by the user when using the
external memory interface (Reset value is 0).
Bit 3:2 =
LAS[1:0]
: Lower memory address strobe
stretch
These two bits contain the number of wait cycles
(from 0 to 3) to add to the System Clock to stretch
AS during external lower memory block accesses
(MSB of 22-bit internal address=0). The reset val-
ue is 3.
7
0
-
ENCSR DPRREM
MEM
SEL
LAS1
LAS0
UAS1
UAS0
9