Interfacing I/O devices with 8085 · Interfacing I/O devices with 8085 8085 I/O Interface I/O ......
Transcript of Interfacing I/O devices with 8085 · Interfacing I/O devices with 8085 8085 I/O Interface I/O ......
![Page 1: Interfacing I/O devices with 8085 · Interfacing I/O devices with 8085 8085 I/O Interface I/O ... Peripheral-mapped I/O 8085 has a separate 8-bit ... Given WR’ and IO/M’ signals](https://reader030.fdocuments.us/reader030/viewer/2022012301/5af208687f8b9ac62b90b8e5/html5/thumbnails/1.jpg)
Interfacing I/O devices with 8085
8085
I/O Interface
I/O Devices
Memory Interface
Memory Devices
System Bus
![Page 2: Interfacing I/O devices with 8085 · Interfacing I/O devices with 8085 8085 I/O Interface I/O ... Peripheral-mapped I/O 8085 has a separate 8-bit ... Given WR’ and IO/M’ signals](https://reader030.fdocuments.us/reader030/viewer/2022012301/5af208687f8b9ac62b90b8e5/html5/thumbnails/2.jpg)
Techniques for I/O Interfacing
Memory-mapped I/O Peripheral-mapped I/O
![Page 3: Interfacing I/O devices with 8085 · Interfacing I/O devices with 8085 8085 I/O Interface I/O ... Peripheral-mapped I/O 8085 has a separate 8-bit ... Given WR’ and IO/M’ signals](https://reader030.fdocuments.us/reader030/viewer/2022012301/5af208687f8b9ac62b90b8e5/html5/thumbnails/3.jpg)
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
![Page 4: Interfacing I/O devices with 8085 · Interfacing I/O devices with 8085 8085 I/O Interface I/O ... Peripheral-mapped I/O 8085 has a separate 8-bit ... Given WR’ and IO/M’ signals](https://reader030.fdocuments.us/reader030/viewer/2022012301/5af208687f8b9ac62b90b8e5/html5/thumbnails/4.jpg)
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
![Page 5: Interfacing I/O devices with 8085 · Interfacing I/O devices with 8085 8085 I/O Interface I/O ... Peripheral-mapped I/O 8085 has a separate 8-bit ... Given WR’ and IO/M’ signals](https://reader030.fdocuments.us/reader030/viewer/2022012301/5af208687f8b9ac62b90b8e5/html5/thumbnails/5.jpg)
8085 Communication with I/O devices
Involves the following three steps1. Identify the I/O device (with address)2. Generate Timing & Control signals3. Data transfer takes place
8085 communicates with a I/O device only if there is a Program Instruction to do so
![Page 6: Interfacing I/O devices with 8085 · Interfacing I/O devices with 8085 8085 I/O Interface I/O ... Peripheral-mapped I/O 8085 has a separate 8-bit ... Given WR’ and IO/M’ signals](https://reader030.fdocuments.us/reader030/viewer/2022012301/5af208687f8b9ac62b90b8e5/html5/thumbnails/6.jpg)
1.Identify the I/O device (with address)
1. Memory-mapped I/O (16-bit address)2. Peripheral-mapped I/O (8-bit address)
![Page 7: Interfacing I/O devices with 8085 · Interfacing I/O devices with 8085 8085 I/O Interface I/O ... Peripheral-mapped I/O 8085 has a separate 8-bit ... Given WR’ and IO/M’ signals](https://reader030.fdocuments.us/reader030/viewer/2022012301/5af208687f8b9ac62b90b8e5/html5/thumbnails/7.jpg)
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
![Page 8: Interfacing I/O devices with 8085 · Interfacing I/O devices with 8085 8085 I/O Interface I/O ... Peripheral-mapped I/O 8085 has a separate 8-bit ... Given WR’ and IO/M’ signals](https://reader030.fdocuments.us/reader030/viewer/2022012301/5af208687f8b9ac62b90b8e5/html5/thumbnails/8.jpg)
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
![Page 9: Interfacing I/O devices with 8085 · Interfacing I/O devices with 8085 8085 I/O Interface I/O ... Peripheral-mapped I/O 8085 has a separate 8-bit ... Given WR’ and IO/M’ signals](https://reader030.fdocuments.us/reader030/viewer/2022012301/5af208687f8b9ac62b90b8e5/html5/thumbnails/9.jpg)
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
![Page 10: Interfacing I/O devices with 8085 · Interfacing I/O devices with 8085 8085 I/O Interface I/O ... Peripheral-mapped I/O 8085 has a separate 8-bit ... Given WR’ and IO/M’ signals](https://reader030.fdocuments.us/reader030/viewer/2022012301/5af208687f8b9ac62b90b8e5/html5/thumbnails/10.jpg)
----------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 30HADD B ;A = 33H, ASCII code for 3OUT 02H ;display 3 on ASCII display
![Page 11: Interfacing I/O devices with 8085 · Interfacing I/O devices with 8085 8085 I/O Interface I/O ... Peripheral-mapped I/O 8085 has a separate 8-bit ... Given WR’ and IO/M’ signals](https://reader030.fdocuments.us/reader030/viewer/2022012301/5af208687f8b9ac62b90b8e5/html5/thumbnails/11.jpg)
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
![Page 12: Interfacing I/O devices with 8085 · Interfacing I/O devices with 8085 8085 I/O Interface I/O ... Peripheral-mapped I/O 8085 has a separate 8-bit ... Given WR’ and IO/M’ signals](https://reader030.fdocuments.us/reader030/viewer/2022012301/5af208687f8b9ac62b90b8e5/html5/thumbnails/12.jpg)
----------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 30HADD B ;A = 33H, ASCII code for 3STA 8001H;display 3 on ASCII display
![Page 13: Interfacing I/O devices with 8085 · Interfacing I/O devices with 8085 8085 I/O Interface I/O ... Peripheral-mapped I/O 8085 has a separate 8-bit ... Given WR’ and IO/M’ signals](https://reader030.fdocuments.us/reader030/viewer/2022012301/5af208687f8b9ac62b90b8e5/html5/thumbnails/13.jpg)
![Page 14: Interfacing I/O devices with 8085 · Interfacing I/O devices with 8085 8085 I/O Interface I/O ... Peripheral-mapped I/O 8085 has a separate 8-bit ... Given WR’ and IO/M’ signals](https://reader030.fdocuments.us/reader030/viewer/2022012301/5af208687f8b9ac62b90b8e5/html5/thumbnails/14.jpg)
![Page 15: Interfacing I/O devices with 8085 · Interfacing I/O devices with 8085 8085 I/O Interface I/O ... Peripheral-mapped I/O 8085 has a separate 8-bit ... Given WR’ and IO/M’ signals](https://reader030.fdocuments.us/reader030/viewer/2022012301/5af208687f8b9ac62b90b8e5/html5/thumbnails/15.jpg)
![Page 16: Interfacing I/O devices with 8085 · Interfacing I/O devices with 8085 8085 I/O Interface I/O ... Peripheral-mapped I/O 8085 has a separate 8-bit ... Given WR’ and IO/M’ signals](https://reader030.fdocuments.us/reader030/viewer/2022012301/5af208687f8b9ac62b90b8e5/html5/thumbnails/16.jpg)
Memory mapped I/O
![Page 17: Interfacing I/O devices with 8085 · Interfacing I/O devices with 8085 8085 I/O Interface I/O ... Peripheral-mapped I/O 8085 has a separate 8-bit ... Given WR’ and IO/M’ signals](https://reader030.fdocuments.us/reader030/viewer/2022012301/5af208687f8b9ac62b90b8e5/html5/thumbnails/17.jpg)
![Page 18: Interfacing I/O devices with 8085 · Interfacing I/O devices with 8085 8085 I/O Interface I/O ... Peripheral-mapped I/O 8085 has a separate 8-bit ... Given WR’ and IO/M’ signals](https://reader030.fdocuments.us/reader030/viewer/2022012301/5af208687f8b9ac62b90b8e5/html5/thumbnails/18.jpg)
![Page 19: Interfacing I/O devices with 8085 · Interfacing I/O devices with 8085 8085 I/O Interface I/O ... Peripheral-mapped I/O 8085 has a separate 8-bit ... Given WR’ and IO/M’ signals](https://reader030.fdocuments.us/reader030/viewer/2022012301/5af208687f8b9ac62b90b8e5/html5/thumbnails/19.jpg)
![Page 20: Interfacing I/O devices with 8085 · Interfacing I/O devices with 8085 8085 I/O Interface I/O ... Peripheral-mapped I/O 8085 has a separate 8-bit ... Given WR’ and IO/M’ signals](https://reader030.fdocuments.us/reader030/viewer/2022012301/5af208687f8b9ac62b90b8e5/html5/thumbnails/20.jpg)
Peripheral Mapped I/O
Design a seven segment LED output port with the device address f5H, using a 74LS138 3-to-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.
![Page 21: Interfacing I/O devices with 8085 · Interfacing I/O devices with 8085 8085 I/O Interface I/O ... Peripheral-mapped I/O 8085 has a separate 8-bit ... Given WR’ and IO/M’ signals](https://reader030.fdocuments.us/reader030/viewer/2022012301/5af208687f8b9ac62b90b8e5/html5/thumbnails/21.jpg)
Data Lines D7 D6 D5 D4 D3 D2 D1 D0
Bits X 1 1 1 1 0 0 0
Segment NC G F E D C B A