As these memory maps show, the EVM's Data address space is
addressed fully by the 16-bit auxiliary registers
(ARx) and address-extension words and the
mapping of Data memory is not affected by the
OVLY bit. However, because the Program memory
space is much larger than can be addressed by the 16-bit
addressing register or the 16-bit literals stored in the
program, it is split up into 64K (16-bit) pages by the
hardware. Normal instructions, such as call,
firs, and mvpd accept only 16-bit
addresses, and can therefore only address the current "page"
(usually address in the form 00xxxxh, which
corresponds to the addresses the linker uses for your
program's code). To access the full 23-bit address space,
the DSP offers special accumulator-addressed load, store,
and jump instructions.
Further complicating matters is the fact that the
OVLY bit affects the mapping of the Program
memory space. If you remember, before we load our DSP
program, we have to change the PMST to
FFE0h. We do this to set the OVLY
bit in the PMST, which maps the internal memory
into both the Program and Data spaces of the DSP. If
OVLY is 1, the internal memory appears in both
the Data and Program memory address space at locations
0080h to 07FFFh. Therefore, with
OVLY set, anything written into Data memory
below 07FFFh will overwrite a program stored in
the same location. In addition, copies of the internal memory
also appear in the extended Program address space, occupying
locations 0080h-7FFFh of each
page. Therefore, with OVLY set, any addresses
to Program memory locations in the form of
xx0000h-xx7FFFh reference internal
memory.
When OVLY is zero, internal memory is not
mapped into the Program space at all; in this case, the
Program space includes only external memory. In this mode,
all 192K words of external Program RAM are accessible,
although several wait states will be required for accessing
each item of memory. In the overlay mode, only addresses in
the ranges of 08000h-0FF00h,
1800h-1FFFFh, and
28000h-2FFFFh are available to
store your data buffers; the remaining addresses are
unmapped or map to the on-chip RAM.
To escape this confusion and allow the full 192K-words of
external Program RAM to be used for your data buffers, the
core file provides mechanisms for manipulating the
PMST indirectly. Instead of accessing the
external Program RAM directly, we can use the special macros
to access the RAM that is normally "hidden" by the internal
memory. This allows us to use the full range of external
memory available: addresses
000000h-00FF00h and
010000h-02FFFF. However, since
addresses 00FF00h-00FFFFh are
reserved by the core file, you must be careful not to write
to addresses in this range.