
PSD813FH - 80C31 Design Example …Application Note
052
WSi Inc. Fremont CA 800-832-6974 www.wsipsd.com
6
Figure 3 - Schematic
System Memory Map
The system memory map is shown in Figures 4 and 5. The labels FSx and CSBOOTx are the
names of internal memory blocks within the MCM device. FSx = blocks of main FLASH (16
Kbytes each), CSBOOTx = blocks of OTP boot ROM (8 Kbytes each).
There are two fundamental modes of operation, one is boot/download mode, and the other is
normal operation. Figure 4 represents the memory map at power on (boot). The system will boot
up from MCM PSD OTP boot ROM, then facilitate a download of the main FLASH memory (if
needed) using the 8031 UART. At this point, all of main FLASH memory is combined in 8031
"data" and "program" space so it can be treated as data. Next, Figure 5 represents the memory
map after the FLASH has been programmed and/or validated. The boot ROM that the system
booted from during power up is now replaced with FLASH memory that contains application
vectors and code. The transition between the two maps is under control of the 8031 by setting a
"SWAP" bit inside the PSD. After the "SWAP" bit is set, all of main FLASH memory resides in
8031 "program" space only, not "data" space.
In this design, paging is used because the system contains more memory than the 8031 can
address linearly. The PSD6XX die in the MCM facilitates paging by using a page register, which
is accessible by the 8031. Because paging is used, an area of common memory is needed for
firmware routines that must be accessible regardless of what page the MCU is executing from.
This common area resides in the lower half of each memory page (Figure 5) in program space
and should contain routines that handle initialization, interrupts, implement page switching, and
drive physical devices. It is also important to keep critical data space items available at all times.
For example, in this design, the PSD control registers, I/O, and system SRAM for the stack and
global variables are available on any memory page (Figures 4 and 5, System RAM & I/O).
Figure 4 - Memory Map - Boot/Download Mode (SWAP bit = 0)
FFFF
0000
4000
8000
C000
1000
FS1
FS1
FS1
FS1
FS2
FS3
FS4
FS5
FS6
FS0
PAGE 0
PAGE 1
PAGE 2
PAGE 3
COMMON
MEMORY
ACROSS ALL
DATA PAGES
SYSTEM RAM & I/O
CSBOOT1
FS7
<<< FLASH KEYHOLE 5555
<<<FLASH KEYHOLE AAAA
(2AAA with a15f grounded)
CSBOOT0
FFFF
0000
4000
8000
C000
2000
PAGE X
NOTHING MAPPED
SYSTEM RAM & I/O
SYSTEM RAM & I/O
SYSTEM RAM & I/O
NOTHING MAPPED
NOTHING MAPPED
NOTHING MAPPED
Execute
from
here
DATA SPACE (RD\, WR\)
PROGRAM SPACE (PSEN\)
IALL OF FLASH
ALSO. HOWEVER,
USED AS DATA
DURING DOWNLOAD.
NOTHING MAPPED