Unit 4 1
Unit 4 1
Interrupt
Timer IC 8155
Interfacing I/O devices with 8085
I/O I/O
Interface Devices
System Bus
8085
Memory Memory
Interface Devices
Memory Interfacing
The memory is made up of semiconductor
material used to store the programs and data.
Three types of memory is
1. Process memory
2. Primary or main memory
3. Secondary memory
TYPICAL EPROM AND STATIC RAM:
✓A typical semiconductor memory IC will have N address pins, M data pins (or
output pins).
✓Having two power supply pins (one for connecting required supply voltage (V and
the other for connecting ground).
✓The control signals needed for static RAM are chip select (chip enable), read
control (output enable) and write control (write enable).
✓The control signals needed for read operation in EPROM are chip select (chip
enable) and read control (output enable).
summarizes capacity with address
3FF
7FF
FFF
1FFF
3FFF
7FFF
FFFF
Memory Interfacing
The 8085 has 16 address lines. That means it can
address
The chip select (CS) pin of EPROM is permanently tied to logic low (i.e., tied to
ground). Since the processor is connected to EPROM, the active low RD pin
is connected to active low output enable pin of EPROM.
The range of address for EPROM is 0000H to FFFFH.
EXAMPLE-2
• Consider a system where the available 64kb memory space is equally
• divided between EPROM and RAM. Interface the EPROM and RAM with the 8085
• processor.
• Implement 32kb memory capacity of EPROM using single IC 27256.
• 32kb RAM capacity is implemented using single IC 62256.
• The 32kb memory requires 15 address lines and so the
• address lines A0 - A14 of the processor are connected to 15 address pins of
• both EPROM and RAM.
• The unused address line A15 is used as to chip select.
• If A15 is 1, it select RAM and If A15 is 0, it select EPROM.
• Inverter is used for selecting the memory.
• The memory used is both Ram and EPROM, so the low RD and
• WR pins of processor are connected to low WE and OE
• pins of memory respectively.
• The address range of EPROM will be 0000H to 7FFFH and that of
• RAM will be 7FFFH to FFFFH.
Example 3
• Consider a system in which 32kb memory space is
• implemented using 4 numbers of 8kb memory.
• Interface the EPROM and RAM with 8085 processor.
• The total memory capacity is 32Kb. So, let 2 number of
• 8kb n memory be EPROM and the remaining 2 numbers be RAM.
• Each 8kb memory requires 13 address lines and so the
• address lines A0- A12 of the processor are connected to 13 address pins
of all the memory.
• The address lines and A13 - A14 can be decoded using a
• 2-to-4 decoder to generate four chip select signals.
• These four chip select signals can be used to select one of
• the four memory IC at any one time.
• The address line A15 is used as enable for decoder.
• The simplified schematic memory organization is shown.
The address allotted to each
memory IC is shown in following
table.
Example 4
• Consider a system in which the 64kb memory space is
• implemented using eight numbers of 8kb memory. Interface the EPROM
• and RAM with 8085 processor.
• The total memory capacity is 64Kb.
• So, let 4 numbers of 8Kb EPROM and 4 numbers of 8Kb RAM.
• Each 8kb memory requires 13 address lines.
• So the address line A0 - A12 of the processor are connected to 13address pins
• The address lines A13, A14 and A15 are decoded using a 3-to-8 dcoder
• to generate eight chip select signals.
• These eight chip select signals can be used to select one of the
• eight memories at any one time.
• The memory interfacing is shown in following figure.
The address allocation for
Interfacing 4 no. 8Kb EPROM and
4 no. 8Kb RAM with 8085 is,
Example 5
• Design an memory interface circuits for a given
4K ROM chip. Use all 16 address line . use any
combination of inverter ,NAND gate and
74LS138 decoder to generates the address.
Example 6
• Draw the diagram for interfacing 8KB of
• ROM and 8KB of RAM with 8085 and
• also explain the number of pins used for
• interfacing .the starting address for ROM
• should be 0000H and starting address for
• Ram should be 8000H
Example 7
• Draw the diagram for interfacing such that it
• should contain 16 Kbytes of EPROM and 4 KB
• Ram using 2 8KB EPROM and 2KB of RAM
Example 7
Example 7
Example 8
• Design a memory system such that contains 8K
or EPROM and 4K of RAM with 8085 EPROM
memory address begins at 0000H and Ram
begins at 8000H.write memory address ranges
used for both memory.
Example 9
• Design a memory system that contains 2K
bytes of EPROM ,immediately followed by 1K
bytes of RAM. The EPROM starts at address
0000H and it is implement using 1K of EPROM
and the RAM is implemented using 1K bytes
RAM chip.
Techniques for I/O Interfacing
◼ Memory-mapped I/O
◼ Peripheral-mapped I/O
Memory-mapped I/O
◼ 8085 uses its 16-bit address bus to identify
a memory location
◼ Memory address space: 0000H to FFFFH
◼ 8085 needs to identify I/O devices also
◼ I/O devices can be interfaced using
addresses from memory space
◼ 8085 treats such an I/O device as a memory
location
◼ This is called Memory-mapped I/O
Peripheral-mapped I/O
◼ 8085 has a separate 8-bit addressing scheme
for I/O devices
◼ I/O address space: 00H to FFH
◼ This is called Peripheral-mapped I/O or I/O-
mapped I/O
Peripheral I/O Instructions
◼ IN Instruction
◼ Inputs data from input device into
the accumulator
◼ It is a 2-byte instruction
◼ Format: IN 8-bit port address
◼ Example: IN 01H
◼ OUT Instruction
◼ Outputs the contents of accumulator to
an output device
◼ It is a 2-byte instruction
◼ Format: OUT 8-bit port address
◼ Example: OUT 02H
Memo ry Mapped vs I/O Mapped
1. Absolute Decoding
Using All A7 to A0 address lines
2. Partial Decoding
Using Decoder
2.Generate Timing & Control
Signals
◼ Memory-mapped I/O
◼ Reading Input: IO/M = 0, RD = 0
◼ Write to Output: IO/M = 0, WR = 0
◼ Peripheral-mapped I/O
◼ Reading Input: IO/M = 1, RD = 0
◼ Write to Output: IO/M = 1, WR = 0
Interrupt
Timer IC 8155
Content
Interfacing Concept
Interfacing with memory
Interrupt
Timer IC 8155
8085
8085
IN 18H
8085
OUT 50H
8085
A
8086/
8085
Control Word
BSR Mode
8085
A
MOV A, 0F
OUT CWR
8085
A
Mode 0:
Simple Input or Output In this mode, ports A and B are
used as two simple 8-bit I/O ports, and port C as two 4-bit
ports. Each port can be programmed to function as either an
input port or an output port. The input/output features in
Mode 0 are as follows.
1. Outputs are latched.
2. Inputs are not latched.
3. Ports don’t have a handshake or interrupt capability.
Mode 0
Mode 1
Mode 2
0 0 1 1 0 0 0
0 0 0 1 0 0 0
Mode 1:
Input or Output with Handshake In this mode, handshake
signals are exchanged between the MPU and peripherals
before data transfer. The features of the mode include the
following:
1. Two ports (A and B) function as 8-bit I/O ports. They
can be configured as either as input or output ports.
2. Each port uses three lines from ort C as handshake
signals. The remaining two lines of Port C can be used
for simple I/O operations.
3. Input and Output data are latched. 4. Interrupt logic is
supported.
Write CW for
Port A input port
Port B as out put port
Port C upper –input
Port lower -output
8085
Write CW for
Port A input port
Port B as out put port
Port C upper –input
Port lower -output
0 1 1 1 1 1 0
Mode 2:
Bidirectional Data Transfer This mode is used primarily
in applications such as data transfer between two
computers.
In this mode,
Only Port A can be configured as the bidirectional
port
Port B either in Mode 0 or Mode 1.
The Pc3-Pc7 used to handshake signals for data transfer.
The remaining three signals from port C can be used
either as simple I/O or as handshake for port B.
Pc3-Pc7 used to handshake signals
8085
MVI A,E0
OUT CWR
MVI A, FF
OUT PART A
1
8085
E0 1
1
A
1
E0
1
FF
1