Lecture:15-17 Memory Interfacing in 8085: Course Instructor: Dr. Devyani Gupta
Lecture:15-17 Memory Interfacing in 8085: Course Instructor: Dr. Devyani Gupta
INTERFACING IN 8085
COURSE INSTRUCTOR: DR. DEVYANI GUPTA
Recall…
• uP does not have any memory, it needs to be interfaced
• External memory support in 8085:
• Address bus size = 16 bits
• Max. number of address = 216 = 64kb
• Every location can store 1 byte
• Max. memory that can be interfaced with 8085 = 64KB
• We can interface a memory chip with max size 64KB or
several memory chips with combined size not exceeding
64KB
MEMORY
1. Primary Memory:
Also called main memory, it is directly accessible by the CPU. It includes:
•RAM (Random Access Memory):
• Volatile memory, meaning data is lost when the power is turned off.
• Used to store data that the CPU needs to access quickly for ongoing tasks.
• Types:
• SRAM (Static RAM): Faster and more expensive; used for cache memory.
• DRAM (Dynamic RAM): Slower and less expensive; used for system memory.
•ROM (Read-Only Memory):
• Non-volatile memory that holds data permanently, even when the power is off.
• Contains critical boot-up programs (firmware) for the system.
• Types:
• PROM (Programmable ROM): Can be programmed once.
• EPROM (Erasable Programmable ROM): Can be erased using UV light and
reprogrammed.
• EEPROM (Electrically Erasable Programmable ROM): Can be erased and
reprogrammed electronically, making it more flexible.
2. Secondary Memory:
Also known as auxiliary memory or storage, it is used to store data and programs long-term. It is slower
than primary memory but can store much larger amounts of data.
MEMORY ICs
SIZE EPROM RAM
1KB 2708 6108
2KB 2716 6116
4KB 2732 6132
8KB 2764 6164
16KB 27128 61128
32KB 27256 61256
FUNCTIONAL PIN DIAGRAM OF MEMORY CHIPS
What is the starting address of this chip?
MULTIPLE MEMORY ADDRESS RANGE
ADDRESS DECODING TECHNIQUES
• PARTIALLY DECODED ADDRESSING
• some address lines are in ‘don’t care’ state for CHIP SELECT
• FULLY DECODED ADDRESSING
• All address lines are used for CHIP SELECT
Q: If the starting address is 0351 H. Find the ending address of 1KB
memory when interfaced with 8085 uP.
Memory Mapping
Memory Chip 𝐴15 𝐴14 𝐴13 𝐴12 𝐴11 𝐴10 𝐴9 𝐴8 𝐴7 𝐴6 𝐴5 𝐴4 𝐴3 𝐴2 𝐴1 𝐴0 Memory Address
4K EPROM 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 2000 H
0 0 1 0 1 1 1 1 1 1 1 1 1 1 1 1 2FFF H
𝐴11 − 𝐴0 𝐷7 − 𝐷0 𝑦1−
𝐴15 − 𝐴8
ALE G
Latch 𝐴7 − 𝐴0 Add. Data OE*
𝐴𝐷7 − 𝐴𝐷0 74LS373
OC* EPROM 4K
8085 uP
𝐷7 − 𝐷0 CS*
IO/M* C 𝑦0−
RD* B 𝑦1− MEMR*
WR* A 𝑦2− MEMW*
𝑦3−
74138 𝑦4−
3:8 𝑦5− IOR*
decoder 𝐴15 𝐴14 𝐴13 𝐴12
𝑦6− IOW*
𝑦7−
Q: Interfacing 4K EPROM and 16K RAM with 8085 uP. Write the address range
for both the memory chips and also the address decoding logic.
For memory interfacing, 4 types of signals are required:
1. Address Lines
2. Data Lines
3. Control Lines
4. Chip Select
Address Lines = 4K = 22 × 210 = 212 = 12 lines Address Lines = 16K = 24 × 210 = 214 = 14 lines
Data Lines = 8 Lines Data Lines = 8 Lines
Control Signals = RD* Control Signals = RD*, WR*
Chip Select = remaining address lines Chip Select = remaining address lines
Memory Mapping
Memory Chip 𝐴15 𝐴14 𝐴13 𝐴12 𝐴11 𝐴10 𝐴9 𝐴8 𝐴7 𝐴6 𝐴5 𝐴4 𝐴3 𝐴2 𝐴1 𝐴0 Memory Address
4K EPROM 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0000 H
0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 0FFF H
0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 7FFF H
𝐴11 − 𝐴0
𝐷7 − 𝐷0
𝐴13 − 𝐴0
𝐷7 − 𝐷0
𝑦1−
𝑦2−
𝑦1−
𝐴15 − 𝐴8
IO/M* C 𝑦0−
RD* B 𝑦1− MEMR*
WR* A 𝑦2− MEMW* 𝐴15 𝐴14 𝐴13 𝐴12 𝐴15 . 𝐴14
𝑦3−
74138 𝑦4−
3:8 𝑦5− IOR*
decoder
𝑦6− IOW*
𝑦7−
Q: Interface 8K EPROM and 16K RAM with 8085 uP using chips of 4K EPROM
and 8K RAM. Show decoding of IC with 74LS138 Decoder.
4K EPROM 8K RAM
Address Lines = 4K = 22 × 210 = 212 = 12 lines Address Lines = 8K = 23 × 210 = 213 = 13 lines
Data Lines = 8 Lines Data Lines = 8 Lines
Control Signals = RD* Control Signals = RD*, WR*
Chip Select = remaining address lines Chip Select = remaining address lines
Memory Mapping
Memory Chip 𝐴15 𝐴14 𝐴13 𝐴12 𝐴11 𝐴10 𝐴9 𝐴8 𝐴7 𝐴6 𝐴5 𝐴4 𝐴3 𝐴2 𝐴1 𝐴0 Memory Address
4K EPROM-1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0000 H
0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 0FFF H
4K EPROM-2 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1000 H
0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1FFF H
8K RAM-1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 2000 H
0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 3FFF H
8K RAM-2 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 4000 H
0 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 5FFF H
𝐴12 − 𝐴0
𝐴11 − 𝐴0
𝐷7 − 𝐷0
𝐷7 − 𝐷0
𝑦1−
𝑦1−
𝑦2−
𝐴15 − 𝐴8
Add. Data OE* Add. Data OE* WR*
ALE G 𝐴7 − 𝐴0
Latch 4K EPROM -1 8K RAM-1
𝐴𝐷7 − 𝐴𝐷0 74LS373
CS* CS*
OC*
𝐴12 − 𝐴0
𝐴11 − 𝐴0
𝐷7 − 𝐷0
𝐷7 − 𝐷0
𝑦1−
𝑦1−
𝑦2−
IO/M* C 𝑦0−
RD* B 𝑦1− MEMR* Add. Data OE* Add. Data OE* WR*
WR* A 𝑦2− MEMW*
4K EPROM -2 8K RAM-1
𝑦3−
𝑦4− CS* CS*
74138
𝑦5−
𝐷7 𝐷6 𝐷5 𝐷4 𝐷3 𝐷2 𝐷1 𝐷0
PRACTICE QUESTIONS
Q1: Interface 12KB RAM with 8085 uP using IC 6232. Use IO/M* in CS* logic
generation
Q2: Interface 1KB RAM with 8085 uP using 1K X 4 RAM (IC 2114/2142).
Q3: Interface 4KB RAM with 8085 uP using 1K X 4 ICs. Allot addresses starting
from 4000H, 4800H, C400H and CC00H. Use IO/M* in CS* generation
Q4: Interface 2KB EPROM and 2KB RAM with 8085 uP such that there is 2K gap
in between addresses.