0% found this document useful (0 votes)
154 views21 pages

2 IOInterfacing

This document discusses two techniques for interfacing I/O devices with the 8085 microprocessor: memory-mapped I/O and peripheral-mapped I/O. With memory-mapped I/O, I/O devices are addressed using memory addresses and the 8085 treats I/O devices as memory locations. With peripheral-mapped I/O, I/O devices have their own separate 8-bit address space and are distinguished from memory. The document provides examples of how the 8085 communicates with I/O devices using IN, OUT, LDA, and STA instructions depending on the interfacing technique. It also includes an example of designing a 7-segment LED output port using peripheral components.

Uploaded by

Abdelrahman Amr
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
154 views21 pages

2 IOInterfacing

This document discusses two techniques for interfacing I/O devices with the 8085 microprocessor: memory-mapped I/O and peripheral-mapped I/O. With memory-mapped I/O, I/O devices are addressed using memory addresses and the 8085 treats I/O devices as memory locations. With peripheral-mapped I/O, I/O devices have their own separate 8-bit address space and are distinguished from memory. The document provides examples of how the 8085 communicates with I/O devices using IN, OUT, LDA, and STA instructions depending on the interfacing technique. It also includes an example of designing a 7-segment LED output port using peripheral components.

Uploaded by

Abdelrahman Amr
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 21

Interfacing I/O devices with 8085

I/O
Interface

I/O
Devices

System Bus

8085
Memory
Interface

Memory
Devices

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

8085 Communication with I/O devices


Involves the following three steps
1. Identify

the I/O device (with address)


2. Generate Timing & Control signals
3. Data transfer takes place
8085 communicates with a I/O device only if

there is a Program Instruction to do so

1.Identify the I/O device (with address)


1. Memory-mapped I/O (16-bit address)
2. Peripheral-mapped I/O (8-bit address)

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

3. Data transfer takes place

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

----------Example Program--------- WAP to read a number from input port (port

address 01H) and display it on ASCII display


connected to output port (port address 02H)
IN 01H
;reads data value 03H (example)into
;accumulator, A = 03H
MVI B, 30H;loads register B with 30H
ADD B
;A = 33H, ASCII code for 3
OUT 02H ;display 3 on ASCII display

Memory-mapped I/O Instructions


I/O devices are identified by 16-bit addresses
8085 communicates with an I/O device as if it

were one of the memory locations


Memory related instructions are used
For e.g. LDA, STA
LDA 8000H

Loads A with data read from input device with


16-bit address 8000H

STA 8001H
Stores (Outputs) contents of A to output
device with 16-bit address 8001H

----------Example Program--------- WAP to read a number from input port (port

address 8000H) and display it on ASCII


display connected to output port (port
address 8001H)
LDA 8000H;reads data value 03H (example)into
;accumulator, A = 03H
MVI B, 30H;loads register B with 30H
ADD B
;A = 33H, ASCII code for 3
STA 8001H;display 3 on ASCII display

Memory mapped I/O

Peripheral Mapped I/O


Design a seven segment LED output port with

the device address f5H, using a 74LS138 3to-8 decoder, a 74LS20 4-input NAND gate, a
74LS02 NOR gate, and a common-anode
seven segment LED.
Given WR and IO/M signals from the 8085,
generate the IOW control signal.
Explain the binary codes required to display 0
to F hex digits at seven segment LED.
Write instructions to display digit 7 at the port.

Data Lines D7

D6

D5

D4

D3

D2

D1

D0

Bits

Segment

NC

You might also like