Memory Interfacing With Example
Memory Interfacing With Example
Memory Interfacing With Example
19 Aug. 2013
Module 1
Memory interfacing
Memory structure and its requirements. Basic concepts in memory interfacing. Address decoding and memory address.
Basics of 8085:
Types of memory and memory interfacing. Decoding techniques Absolute and Partial
WR CS
A11
I N T E R N A L D E C O D E R
A0
EPROM 4096 8
Output buffer
RD
CS RD
19 Aug. 2013
Example: If a memory is having 13 address lines and 8 data lines, then the number of registers / memory locations = 2^13 = 8129 word length = 8 bit Note: The number of address lines of a microprocessor depends on the Size of the memory. No. of lines
Memory size in bytes
1 2 3 4 5 6 7
2 4 8 16 32 64 128
8 9 10 11 12 13 14 15 16
256 Bytes 512 Bytes 1024=1k 2048=2k 4096=4k 8129=8k 16384=16k 32768=32k 65536=64k
Q.1) Design a microprocessor system for 8085 such that it should contain 8k byte of EPROM and 8k byte of RAM using 1) Absolute / Full Decoding 2) Partial / Linear Decoding. Solution:
MEMORY ICs
Starting address Of EPROM End address Of EPROM Starting address Of RAM End address Of RAM A15 A14 A13 A12 A11 A10 A9 A8 A7 A6 A5 A4 A3 A2 A1 A0 Address
0 0 0 0 0 0 0 0 0 0 1 1 1
0 0 0 0
0 0
0 0 0 1 1 0 1
1 1 1
1 1 1
1 1
0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1
19 Aug. 2013
1 uF X1
6 MHz X2 1 uF + 5V + 5V
8085
ALE LE
WR A0 A7 RD IO/M
G A 7 Y5
READY
AD0 AD7
75 K RESETIN SW 1 uF
7 4 3 7 3
D0 D7
4 B L Y6 S 1 Y1 C 3 Y2 8
G1 G2
TRAP RST 7.5 RST 6.5 RST 5.5 INTR INTA RESETOUT
A8 A15
A 7 4 A14 L Y0 B S 1 A15 C 3 Y1 8 G1 G2
A13
CS
Q.2) Design a microprocessor system for 8085 such that it should contain 16k byte of EPROM and 4k byte of RAM using 8 Kbyte EPROMs and 2k byte RAMs. Solution:
Memory Ics
s.a of EPROM1 e.a of EPROM1 s.a of EPROM2
A15 A14 A13 A12 A11 A10 A9 A8 A7 A6 A5 A4 A3 A2 A1 A0
ADDRESS
WR RD IO/M
G A 7 Y5
4 B L Y6 S Y1 1 C 3 Y2 8
0 0 0 0 0 0 0 0
0 0 0 0 1 1 1 1
0 0 1 1 0 0 1 1
0 1 0 1 X X X X
0 1 0 1 X X X X
0 1 0 1 0 1 0 1
0 1 0 1 0 1 0 1
0 1 0 1 0 1 0 1
0 1 0 1 0 1 0 1
0 1 0 1 0 1 0 1
0 1 0 1 0 1 0 1
0 1 0 1 0 1 0 1
0 1 0 1 0 1 0 1
0 1 0 1 0 1 0 1
0 1 0 1 0 1 0 1
0 1 0 1 0 1 0 1
G1 G2
A13
s.a of RAM2
19 Aug. 2013
WR
A 7 Y5 4 RD L Y6 B S 1 Y1 IO/M 3 C 8 Y2 G1 G2
Q.3) Interface 2kb EPROM to 8085 using EPROM (1k X 4) chips, 74LS138 decoder and full address decoding and give the address map. Solution:
Memory Ics
s.a of EPROM1 e.a of EPROM1
A15 A14 A13 A12 A11 A10 A9 A8 A7 A6 A5 A4 A3 A2 A1 A0
ADDRESS
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 1 1 1 1
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 1 0 1 0 1 0 1
0 1 0 1 0 1 0 1
0 1 0 1 0 1 0 1
0 1 0 1 0 1 0 1
0 1 0 1 0 1 0 1
0 1 0 1 0 1 0 1
0 1 0 1 0 1 0 1
0 1 0 1 0 1 0 1
0 1 0 1 0 1 0 1
0 1 0 1 0 1 0 1
VCC
D7- D0 A12 A11 A10 A9 A8 A7-A0 OE D7- D0 A12 A11 A10 A9 A8 A7-A0 OE
D7- D0 A10
A9
A8
A7-A0 OE WR
D7- D0 A10 A9
A8
A7-A0
OE WR
A13
A14
G
A 7 Y0 4 L Y1 S 1 Y2 3 8 Y3
A11 A12
A15
G1 G2
A11 A12
VCC
WR
A 7 Y5 4 RD L Y6 B S 1 Y1 IO/M 3 C 8 Y2 G1 G2
Q.4) Design an 8085 based system for the following specifications: (a) CPU working at 3 MHz. (b) 8kB EPROM using 4kB devices. (c) 4kB RAM using 2kB devices. (d) One 8259 PIC in I/O mapped I/O. (e) One 8255 in I/O mapped I/O. Draw the complete interfacing diagram with latches, chip select logic, Reset circuit.
VCC
D7- D4 A9
A8 A7-A0 OE WR D3- D0 A9
A8 A7-A0 OE WR
EPROM (1K) CS
EPROM (1K) CS
EPROM (1K) CS
EPROM (1K) CS
A13
A 7 Y0 4 A14 L B S 1 A15 3 Y1 C 8 G1 G2
A12
A11 A10
19 Aug. 2013
I/O Map
Ports and Registers Port A Port B Port C CWR 8259 Chip
A7 A15 A6 A14 A5 A13 A4 A12 A3 A11 A2 A10 A1 A9 A0 A8 ADDRESS
0 0 0 0 0
1 1 1 1 1
0 0 0 0 0
0 0 0 0 1
0 0 0 0 0
0 0 0 0 0
0 0 1 1 0
0 1 0 1 0/1
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 1 1 1 1
0 0 1 1 0 0 1 1
0 1 0 1 X X X X
0 1 0 1 0 1 0 1
0 1 0 1 0 1 0 1
0 1 0 1 0 1 0 1
0 1 0 1 0 1 0 1
0 1 0 1 0 1 0 1
0 1 0 1 0 1 0 1
0 1 0 1 0 1 0 1
0 1 0 1 0 1 0 1
0 1 0 1 0 1 0 1
0 1 0 1 0 1 0 1
0 1 0 1 0 1 0 1
1 uF X1 WR 6 MHz X2 1 uF + 5V READY
VCC
D0-D7 A0-A7
A8-A15 IOR IOW MEMR MEMW
8085
ALE LE
A0 A7
+ 5V
AD0 AD7
75 K RESETIN SW 1 uF
7 4 3 7 3
D0 D7
A 7 Y5 4 RD L Y6 B S 1 Y1 IO/M 3 C 8 Y2 G1 G2
VCC
A8 A7-A0 OE
D7- D0 A10
A9
A8
A7-A0 OE WR
D7- D0 A10 A9
A8
A7-A0
OE WR
EPROM 1(4K) CS
EPROM2 (4K) CS
RAM1 (2K) CS
RAM2 (2K) CS
TRAP RST 7.5 RST 6.5 RST 5.5 INTR INTA RESETOUT
A 7 Y0 4 A13 L Y1 B S 1 Y2 A14 3 C 8 Y3 G1 G2
A12
A11 A11
A8 A15
A15
19 Aug. 2013
VCC
D0-D7 A0-A7
A8-A15 IOR IOW MEMR MEMW
WR RD
A 7 Y5 4 L Y6 B S 1 Y1 IO/M 3 C 8 Y2 G1 G2
+ 5V
Dec-2012
VCC Vcc A0,A1 D0-D7 A0 D0-D7 SP/EN
IR0
A 7 Y4 4 A13 L B S 1 A14 3 C 8 Y5 G1 G2
A12
OE
PA PB PC
INTR INTA
8 WR 2 5 5
RESET OUT Reset
OE
8 WR 2 5 9
INT INTA CS
IR7
CAS0 CAS1 CAS2
CS
A15
2) Design 8085 based system with following specifications : (i) CPU operating at 3 MHz. (12 Marks) (ii) 16 KB program memory using 4 KB devices. (iii) 4 KB data memory using 2 KB devices. (iv) One 8 bit input port and one 8 bit output port performing interrupt driven I/O and interfaced in I/O mapped I/O mode. Use exhaustive decoding approach. Give detailed I/O map and memory map and neat interfacing diagram.