Microprocessor · Unit 6 · 6 hrs
Input/ Output Interfaces
Exam-focused notes for Input/ Output Interfaces (Microprocessor, CSC167): what the TU syllabus asks and how it has actually been tested, with 8 solved past questions from this unit.
Input/ Output Interfaces in short
This chapter covers how the microprocessor is connected to real peripheral devices: the difference between parallel and serial transfer, the ports and handshaking schemes used to move data reliably, and the two support chips most commonly used for peripheral interfacing, the 8259A interrupt controller and the 8255A parallel interface.
What this unit covers
- Interfacing Concepts
- Ports
- Interfacing Of I/O Devices
- Interrupts In 8085
- Programmable Interrupt Controller 8259A
- Programmable Peripheral Interface 8255A
Programmable Peripheral Interface 8255A
2081 · 5 marks
List out the limitation of parallel communication. Explain the different operation modes of 8255A PPI. [5]
Show solved answerHide answer
Limitations of Parallel Communication and Operation Modes of 8255A PPI
Part 1: Limitations of Parallel Communication
Parallel communication transmits multiple bits simultaneously over multiple lines, but it has the following limitations:
- Cost: Requires more wires/lines (one for each bit), making it more expensive than serial communication.
- Distance Limitation: Suitable only for short distances (typically within a few meters) because signal degradation and crosstalk increase with distance.
- Crosstalk: Interference between adjacent parallel lines causes data errors, especially at high speeds over longer distances.
- Synchronization Problem: All bits must arrive at the same time; skew (timing differences between lines) can cause data corruption.
- Cable Bulk: Multiple wires make the cable thick, heavy, and difficult to manage.
- Higher Power Consumption: More lines mean more drivers and receivers, consuming more power.
- Not Suitable for Long Distance: Cannot be used effectively for long-distance communication unlike serial communication.
Part 2: Operation Modes of 8255A PPI
csc167-8255-block
The 8255A Programmable Peripheral Interface (PPI) has three ports: Port A, Port B, and Port C. It operates in the following modes, determined by the Control Word Register (bit D7 = 1 for I/O mode):
Mode 0: Basic Input/Output Mode
- This is the simplest mode of operation.
- Port A, Port B, and both halves of Port C (upper and lower) can be independently configured as input or output.
- No handshaking signals are required.
- Data is simply written to or read from the ports.
- Suitable for simple I/O operations like reading switches or driving LEDs.
- Port C can be split: upper nibble (PC7-PC4) and lower nibble (PC3-PC0) configured separately.
Example use: Connecting keyboards, displays, or simple peripheral devices.
Mode 1: Strobed Input/Output Mode (Handshaking Mode)
- Used for Port A and Port B only.
- Port C lines are used as handshaking/control signals for Port A and Port B.
- Data transfer occurs with synchronization signals (handshaking).
- Two sub-modes:
- Mode 1 Input: Uses signals like STB (Strobe), IBF (Input Buffer Full), and INTR (Interrupt Request).
- Mode 1 Output: Uses signals like OBF (Output Buffer Full), ACK (Acknowledge), and INTR.
- Suitable when the peripheral needs to signal readiness before data transfer.
Example use: Interfacing with printers or other devices requiring handshaking.
Mode 2: Bidirectional Bus Mode
- Available for Port A only.
- Port A acts as a bidirectional 8-bit data bus (both input and output on the same port).
- Port C lines (PC7-PC3) are used as control/handshaking signals for Port A.
- Port B can still operate in Mode 0 or Mode 1 independently.
- Suitable for communication between two microprocessors or complex peripherals.
Example use: Data transfer between two CPUs sharing a common bus.
Bit Set/Reset (BSR) Mode
- This is a special mode for Port C only.
- When bit D7 = 0 in the control word, Port C operates in BSR mode.
- Individual bits of Port C can be set (1) or reset (0) using a specific control word.
- This does not affect Port A or Port B operations.
- Useful for generating control signals or flags on individual pins.
Summary Table
| Mode | Port | Feature |
|---|---|---|
| Mode 0 | A, B, C | Simple I/O, no handshaking |
| Mode 1 | A and B | Strobed I/O with handshaking |
| Mode 2 | A only | Bidirectional data bus |
| BSR | C only | Individual bit set/reset |
2080 · 5 marks
What are different modes of parallel I/O? Differentiate between synchronous serial communication and asynchronous serial communication. [5]
2079 · 5 marks
What is the purpose of Programmable Peripheral Interface 8255A? Explain about its different ports. [5]
Show solved answerHide answer
Programmable Peripheral Interface 8255A
Purpose of 8255A
The 8255A is a widely used programmable parallel I/O device designed to interface a microprocessor with peripheral devices. Its main purposes are:
- It can be programmed to transfer data under various conditions, ranging from simple I/O to interrupt-driven I/O.
- It is flexible, versatile, and economical, especially when multiple I/O ports are required.
- It is a general-purpose I/O device that can be used with almost any microprocessor (including the 8085).
- It reduces the complexity of interfacing external devices by providing programmable control through a control register.
Ports of 8255A
The 8255A has 24 I/O pins organized into three ports: Port A, Port B, and Port C.
1. Port A (8-bit)
- A full 8-bit parallel port.
- Can be configured as input or output.
- Supports all three operating modes: Mode 0, Mode 1, and Mode 2.
- In Mode 2 (bidirectional), only Port A can be used for bidirectional data transfer.
2. Port B (8-bit)
- A full 8-bit parallel port.
- Can be configured as input or output.
- Supports Mode 0 and Mode 1 only (not Mode 2).
3. Port C (8-bit)
- An 8-bit port that can be used in two ways:
- As a single 8-bit port for simple I/O.
- Split into two 4-bit ports:
- C Upper (C_U) -- upper nibble (bits 7-4)
- C Lower (C_L) -- lower nibble (bits 3-0)
- Port C is often used to provide control/status signals (handshake signals) for Port A and Port B in Mode 1 and Mode 2 operations.
- Individual bits of Port C can be set or reset using the Bit Set/Reset (BSR) feature.
Data Bus Buffer
The 8255A also contains a three-state bidirectional 8-bit buffer that interfaces it to the system data bus. Data is transmitted or received through this buffer upon execution of input/output instructions by the CPU. Control words and status information are also transferred through this buffer.
Summary Table
| Port | Size | Modes Supported | Special Feature |
|---|---|---|---|
| Port A | 8-bit | Mode 0, 1, 2 | Bidirectional in Mode 2 |
| Port B | 8-bit | Mode 0, 1 | Strobed I/O in Mode 1 |
| Port C | 8-bit | Mode 0 | Split into C_U and C_L; Bit Set/Reset |
The functions of all ports are defined by writing a control word into the control register of the 8255A, making it highly programmable and adaptable to various interfacing requirements.
2078 · 5 marks
What are the different modes of parallel communication? Construct a control word for 8255 PPI for following configuration: .a) Port A and Port C_upper = mode 0 .b) Port B and Port C_lower = mode 0 c.) Port A and Port C_upper as input port d.) Port B and Port C_lower as output port [5]
Interfacing Concepts
2076 · 5 marks
Differentiate between synchronous and asynchronous serial communication. Show DTE-DTE and DTE-DCE connection according to RS-232 serial communication standard. [5]
2075 · 5 marks
How DTE and DCE are wired using Rs-232 cables. Explain the process of double handshake I/O. [5]
Programmable Interrupt Controller 8259A
2075 · 5 marks
Differentiate between vectored and non-vectored interrupts. Where and how 8259 PIC can be used to handle interrupts. [5]
2080.1 · 5 marks
List different types of ports. What are the main characteristics of programmable interrupt controller 8259A? [5]
Make Unit 6 stick
Practice CSC167 with flashcards & quizzes