0% found this document useful (0 votes)
11 views40 pages

Basic I O Interfacings

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)
11 views40 pages

Basic I O Interfacings

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/ 40

Bangladesh Army University of Engineering & Technology (BAUET)

Department of Computer Science and Engineering

Microprocessor and Micro-controller

Basic I/O Interfacing

Prof. Dr. Md. Rabiul Islam


Dept. of Computer Science & Engineering
Rajshahi University of Engineering & Technology
Rajshahi-6204, Bangladesh.
rabiul_cse@yahoo.com
Outline
 Why interfacing is needed in microprocessor?
 Basic I/O Interfacing
 I/O Instructions
 Methods of Interfacings
 Basic Input / Output Interface
 Handshaking
 Programmable Peripheral Interface (PPI) – 82C55
 Basic Description and Pin- Out Diagram and Pin Functions of PPI
 Internal Block Diagram of PPI
 Example for Interfacing of 82C55 with Microprocessor
 Programming with 82C55
 Modes of 82C55
 Example of Mode 0 operation: (Interfacing with 7 segment display)
 Example of Mode 0 operation: (Interfacing with a 4X4 keyboard)
 Mode 1 Strobed Input and Output
 Signal Definition Mode 1 Strobed Input
 Example of Mode 1 Strobed Input
 Example of Mode 1 Strobed Output
 Mode 2 Bidirectional Operation
 Example o Mode 2 Bidirectional Operation for transmitting data
 Example o Mode 2 Bidirectional Operation for receiving data
 82C55 Mode Summary
References
Chapter 10 Barry B. Brey, “The Intel Microprocessors 8086/8088, 80186/80188, 80286, 80386, 80486, Pentium, and
Pentium Pro Processor, Architecture, Programming, And Interfacing”, 4th Edition, Prentice Hall, 1997.
Why interfacing is needed in microprocessor?
Interfacing a microprocessor is to connect it with various peripherals to perform
various operations to obtain a desired output.

Memory Interfacing and I/O Interfacing are the two main types of interfacing.

Memory Interfacing is used when the microprocessor needs to access memory


frequently for reading and writing data stored in the memory. It is used when
reading/writing to a specific register of a memory chip.

I/O Interfacing is achieved by connecting keyboard(input) and display


monitors(output) with the microprocessor.
Basic I/O Interfacing
I/O Instructions:
IN and OUT: Transfer information between I/O device and microprocessor.
Both IN and OUT instructions transfer data between I/O device and
microprocessor accumulator (AL, AX, EAX).
INS and OUTS: Transfer string of data from I/O device and to I/O device
Port Number/ Port Address: Whenever data are transferred using the IN
and OUT instruction, the I/O address often called a port address.
Fixed Port Addressing: 8 bit port address that is stored with the instructions
is called fixed port addressing. For example: IN AL, p8
Variable Port Addressing: 16 bit port address that is stored in DX register is
called variable port addressing. For example: MOV DX, p16; IN AL, DX
Basic I/O Interfacing
I/O Instructions:
Basic I/O Interfacing
Methods of Interfacings:
There are completely two different methods of interfacing to the microprocessor:
Isolated I/O and Memory-mapped I/O.

Isolated I/O:
In Isolated I/O, IN, OUT, INS and OUTS instructions are used for interfacings.
The most common I/O Transfer technique.
In isolated I/O, the memory address space and I/O address space are
separate from each other.
Separate control signal such as I/O read and I/O write signals
are used for the operations.
Basic I/O Interfacing
Methods of Interfacings:
Memory-mapped I/O:

Unlike Isolated I/O, IN, OUT, INS and OUTS instructions are not used for
interfacings. Instead it used any instructions (such as MOV, ADD, SUB etc.) that
transfer data between the microprocessor and memory.

The main advantages of memory-mapped I/O is that any memory transfer can
be used to access the I/O device.

The main disadvantage is that a portion of memory system is used as the I/O
map. This reduces the memory available to the applications.

Separate control signal such as I/O read and I/O write signals
are nor required for the operations.
Basic I/O Interfacing
Methods of Interfacings:

(a) (b)
Fig. Methods of interfacings: (a) Isolated I/O and (b) Memory mapped I/O
Basic I/O Interfacing
Basic Input/Output Interface:
The
Thebasic
basicinput
inputdevice
deviceisisaathree
threestate
statebuffer.
buffer.
The basic output device is a set of data latch.

The Basic Input Interface:


Basic I/O Interfacing
The Basic Output Interface:
Basic I/O Interfacing
Handshaking:
Basic I/O Interfacing
The Programmable Peripheral Interface:

Basic Description of 8255A PPI:


Basic I/O Interfacing
Basic Description of 8255A PPI:
Basic I/O Interfacing
Basic Description of 8255A PPI:
Basic I/O Interfacing
Block Diagram of 8255A PPI:

Figure: Block diagram of 82C55 PPI


Basic I/O Interfacing
Example for Interfacing of 82C55 with Microprocessor:

Figure: The 82C55 is interfaced to a microprocessor.


Basic I/O Interfacing
Programming with 82C55:
Basic I/O Interfacing
Programming with 82C55:
Basic I/O Interfacing
Modes of 82C55:

There are three modes of operations:


Mode 0: Port A, Port B and Port C can work as an simple input or output port.
Mode 1: Port A and Port B can work input and output. Port C is used for
handshaking.
Mode 2: Port B is not used here. Port A can be used as bidirectional port for
input and output and Port C is used for handshaking.
Basic I/O Interfacing
Example of Mode 0 operation: (Interfacing with 7 segment display)
Basic I/O Interfacing
Example of Mode 0 operation: (Interfacing with a 4X4 keyboard)
Basic I/O Interfacing
Example of Mode 0 operation: (Interfacing with a 4X4 keyboard)
Basic I/O Interfacing
Mode 1 Strobed Input:
Basic I/O Interfacing
Mode 1 Strobed Input:
Basic I/O Interfacing
Signal Definition Mode 1 Strobed Input:
Basic I/O Interfacing
Example of Mode 1 Strobed Input:
Basic I/O Interfacing
Example of Mode 1 Strobed Input:
Basic I/O Interfacing
Example of Mode 1 Strobed Input:

Assembly code:
Basic I/O Interfacing
Mode 1 Strobed Output:
Basic I/O Interfacing
Mode 1 Strobed Output:
Basic I/O Interfacing
Mode 1 Strobed Output:
Basic I/O Interfacing
Example of Mode 1 Strobed Output:
Basic I/O Interfacing
Example of Mode 1 Strobed Output:
Basic I/O Interfacing
Example of Mode 1 Strobed Output:

Assembly code:
Basic I/O Interfacing
Mode 2 Bidirectional Operation:
Basic I/O Interfacing
Mode 2 Bidirectional Operation:
Basic I/O Interfacing
Example o Mode 2 Bidirectional Operation for transmitting data:

Assembly code:
Basic I/O Interfacing
Example o Mode 2 Bidirectional Operation for receiving data:

Assembly code:
Basic I/O Interfacing
82C55 Mode Summary:
Thank you

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy