Professional Documents
Culture Documents
Unit-7: I/O Interfacing: (MPI) GTU # 3160712
Unit-7: I/O Interfacing: (MPI) GTU # 3160712
(MPI)
GTU # 3160712
Unit-7:
I/O Interfacing
Positive Vibes:MPI is the interesting, easiest and scoring subject.
Introduction to Interfacing
Concepts
Introduction to Interfacing Concepts
Interface is the path for communication between two components. Positive Vibes:MPI is the interesting, easiest and scoring subject.
IO Interfacing
What do you mean by I/O Interfacing?
There are various communication devices like the keyboard, mouse, printer, etc.
So, we need to interface the keyboard and other devices with the microprocessor by using
latches and buffers.
This type of interfacing is known as I/O interfacing.
other devices:
1. A15-A8 (Higher Address Bus)
2. AD7-AD0(Lower Address/Data Bus)
3. ALE
4. RD
5. WR
6. READY
world.
1. Serial Communication Interface
In this type of communication, the interface gets a single bit of data from the microprocessor
and sends it bit by bit to the other system serially and vice-a-versa.
Here Peripheral is identified with an 8-bit address. Here Memory Mapped I/O is identified with a 16-
bit address.
Instructions IN and OUT are used to implement Data transfer is implemented by using memory
data transfer between Microprocessor and related instructions, such as STA, STAX, LDA,
Peripherals. LDAX, MOV etc.
Interrupts in 8085
Interrupts in 8085
An Interrupt is a process where an external device can get the attention of the microprocessor.
Positive Vibes:MPI is the interesting, easiest and scoring subject.
RST 5.5, RST 6.5, RST 7.5 are all automatically INTR Yes No
Classification of Interrupts
Classification of Interrupts
Vector interrupt: Positive Vibes:MPI is the interesting, easiest and scoring subject.
In this type of interrupt, the programmer has to add the instructions into the program to execute the interrupt.
There are 8 software interrupts in 8085
For example: RST0, RST1, RST2, RST3, RST4, RST5, RST6, and RST7.
Hardware Interrupt:
There are 5 interrupt pins in 8085 used as hardware interrupts.
For example: TRAP, RST7.5, RST6.5, RST5.5,INTR
A small program or a routine that when executed, services the corresponding interrupting source is
called an ISR.
When a device interrupts, it actually wants the Microprocessor to give a service which is
equivalent to asking the Microprocessor to call a subroutine.
This subroutine is called ISR (Interrupt Service Routine)
The ‘EI’ instruction is a one byte instruction and is used to Enable the non-maskable interrupts.
The ‘DI’ instruction is a one byte instruction and is used to Disable the non-maskable interrupts.
Programmable Peripheral
Interface 8255A
Programmable Peripheral Interface 8255A
The 8255A is a general purpose programmable, parallel I/O device. Positive Vibes:MPI is the interesting, easiest and scoring subject.
It is designed to transfer the data from simple I/O to interrupt I/O under certain conditions as
required.
It can be used with almost any microprocessor.
It consists of three 8-bit bidirectional I/O ports (24 I/O lines) which can be configured as per the
requirement.
It is flexible, versatile and economical but somewhat complex.
The intent is to provide complete I/O interface in single chip.
This chip directly interfaces to data bus of the processor.
PORT A 8-bit
GROUP A
CU 4-bit
8255A CL 4-bit
PORT C I/O Devices
GROUP B
PORT B 8-bit
Bidirectional
Block diagram : 8255A
Data
bus
Data Bus Group A
D0-D7
Port C I/O
Buffer PC7-PC4
Upper
8-bit Internal data bus
RD Group B I/O
WR Port C PC3-PC0
A1 Read Lower
A0 Write Group B
Control Control
RESET
Logic I/O
Group B
PB7-PB0
Port B
CS
8255A Architecture: Control Logic
RD
Positive Vibes:MPI is the interesting, easiest and scoring subject.
WR
RD (READ) This is an active low signal, that enables Read operation. When A1 Read
signal is low MPU reads data from selected I/O port of 8255A A0 Write
WR (WRITE) This is an active low signal, that enables Write operation. When RESET Control
signal is low MPU writes data into selected I/O port or control Logic
register
RESET This is an active high signal, used to reset the device. That
means clear control registers. CS
CS This is Active Low signal.
(Chip Select) When it is low, then data is transfer to/from 8085.
CS signal is the master Chip Select.
A0 and A1 specify one of the I/O ports or control register
CS A1 A0 Selected
0 0 0 PORT A
0 0 1 PORT B
0 1 0 PORT C
0 1 1 Control Register
1 X X 8255A is not selected
1. Mode 0
2. Mode 1
3. Mode 2
D7 D6 D5 D4 D3 D2 D1 D0
WR
PORT A
Content of this 00 EN
register is known RD
as Control Word Control WR
Register
PORT C_U
CS
EN PORT C_L
10 EN
RD
WR
11
A1 Internal 10 PORT C
A0 Decoding 01
PORT B PORT B
00
PORT A EN
01
GROUP A GROUP B
PORT Cu(PC7-PC4) PORT CL(PC3-PC0)
1= Input 1= Input
0= Output 0= Output
PORT A PORT B
1= Input 1= Input
0= Output 0= Output
Mode Selection Mode Selection
00 = Mode 0 1= Mode 1
01 = Mode 1 0= Mode 0
1= I/O Mode 1X = Mode 2
0= BSR Mode
Configure Port A and Port CU as output ports and Port B and CL as input ports.
D7 D6 D5 D4 D3 D2 D1 D0
1 0 0 0 0 0 1 1
D7 D6 D5 D4 D3 D2 D1 D0
1 0 0 0 0 0 1 1
Control Word = 83 H
Port C.
D7 D6 D5 D4 D3 D2 D1 D0
0 X X X Bit Select S/R
Programmable Interrupt
Controller 8259A
Programmable Interrupt Controller 8259A: Introduction
The Intel 8259 is a Programmable Interrupt Controller (PIC) designed for use with the 8085 and
Positive Vibes:MPI is the interesting, easiest and scoring subject.
8086 microprocessors.
The 8085 has only five number of hardware interrupts: TRAP,RST 7.5,RST 6.5,RST 5.5 and INTR.
The 8259 can be used for applications that use more than five numbers of interrupts from
multiple sources.
D7-D0 CONTROL LOGIC Positive Vibes:MPI is the interesting, easiest and scoring subject.
DATA BUS
I
BUFFER
N
T
E
R
RD N
READ/WRITE A
WR IR0
LOGIC L
A0 IR1
INTERRUPT IR2
CS B IN-SERVICE IR3
PRIORITY REQUEST
U REGISTER IR4
CAS 0 RESOLVER REGISTER
CASCADE S (ISR) IR5
CAS 1 (IRR)
BUFFER/ IR6
CAS2 IR7
COMPARATOR
SP/EN
INTERRUPT MASK REGISTER
(IMR)
Prof. Swati R Sharma Unit 7 – I/O Interfacing 46
8259 Internal Block Diagram
Read/Write Logic Positive Vibes:MPI is the interesting, easiest and scoring subject.
D7-D0 CONTROL LOGIC Positive Vibes:MPI is the interesting, easiest and scoring subject.
DATA BUS
I
BUFFER
N
T
E
R
RD N
READ/WRITE A
WR IR0
LOGIC L
A0 IR1
INTERRUPT IR2
CS B IN-SERVICE IR3
PRIORITY REQUEST
U REGISTER IR4
CAS 0 RESOLVER REGISTER
CASCADE S (ISR) IR5
CAS 1 (IRR)
BUFFER/ IR6
CAS2 IR7
COMPARATOR
SP/EN
INTERRUPT MASK REGISTER
(IMR)
Prof. Swati R Sharma Unit 7 – I/O Interfacing 51
Positive Vibes:MPI is the interesting, easiest and scoring subject.
1 1 1 1 1 1 0 0X7E=0
1 1 1 1 1 1 1 0X7F=8
Thank You