External Memory Interfacing
External Memory Interfacing
RD
P3.7
WR
P3.6
Voc EA PSEN
WR RD
P2.7
CS
P2.6
P2.5 A13
8051 P2.0 A8
ALE
16K x 8
Data
G
RAM
PO.7 A7
P0.0 74LS373 A0
D7 DO
EXAMPLE 2.1
Design a microcontroller system using 8osi microcontroller, 4 Kbytes of ROM and 8 Kbytes of RAM,
Intertace the external memory such that the startingaddress of ROM is 100oHand RAM is CoooH.
Figure 2.10 shows the interfacingof 4 Kbytes of ROM and 8 Kbytes of RAM. Then, PSEN iS USed as
chip select pin for ROM containing program code, and RD (P2.7) is used as read control
WR iS USed as write controlsiqnal for RAM as signal pin, and
shown in Fig. 2.10.
lable 2.5 gives the memory address. ROM requires 12 address lines (A11-Ao) to
registers. The remaining address lines-A15, A14, A13, A12 and PSEN pin -are decode 4o96 x8
OR gate to CS and RD pin of ROM. When the address lines connected through
A15, A14, A13, PSEN are low and A12 is
high, then ROM is selected. RAM requires 13 address lines
The remaining address lines- A15, A14 and A13-are (A12-Ao) to decode 8192 X8 registers.
connected
When the address lines A15, A14 are high and A13 is low, then through OR gate to CS pin of RAM.
is 1000H to 1FFFH and RAM is RAM is selected. The address of ROM
CoooH to DFFFH.
TABLE 2.5
Memory address table
Address A15 A14 A13 A12 A10 A9 A8 A7 A6 AS A4
ROM A0
(4 K) 0
0 (
to
0 0
RAM
(8 K)
)
to ()
0
1
VGc EA P3.6
WR
RD
P3.7 Vcc Vcc
PSEN
P2.7
RD Vpp WA Vpp
P2.6
P2.5 CS RD
P2.7
P2.4 P2.6
8051 P2.5
P2.3
P2.4
P2.0 A11 |A12
A8 |A11
A8
ALE G 4K x 8
Po.7 8K x 8
ROM
PO.0
74LS373 RAM
A7 2
A0 A7
A0
D7 DO
D7 Do
WR Voc
P3.6
Gnd EA RD Vcc
P3.7
WR Vpp
RD Vpp
RD
PSENjt
P2.7 CS 28Cs
P2.7-O
P2.6 P2.6 A14
8051 32K x 8
P2.5 A13 A13
P2.0 A8 A8
ALE 16K x 8
P0.7
ROM RAM
P0.0 74LS373 A7 A7
AC AO
D7 DO D7 DO
Data ROM
(8K) 1 0 0 0 0 0 0 0
to
RD Vcc
EA P3.7 Vcc
P3.6 WR
RD Vpp
PSEN RD Vpp
P2.7
P2.7
P2.6 CS
P2.5 P2.6 CS
P2.4 A12 P2.5
P2.0 A12
8051 A8
ALE
A8
G 8K x8 8K x 8
DATA PROGRAM
PO.7
PO0
74LS373
RAM ROM
A7
A7
A0
A0
D7 DO
D7 DO