Microprocessor · Unit 5 · 6 hrs
Basic I/O, Memory R/W and Interrupt Operations
Exam-focused notes for Basic I/O, Memory R/W and Interrupt Operations (Microprocessor, CSC167): what the TU syllabus asks and how it has actually been tested, with 10 solved past questions from this unit.
Basic I/O, Memory R/W and Interrupt Operations in short
This chapter covers how the 8085 reads and writes memory and I/O devices, how a DMA controller can move data without the CPU's involvement, and how interrupts let an external device demand the processor's attention.
What this unit covers
- Memory Read
- Memory Write
- I/O Read
- I/O Write
- Direct Memory Access
- Interrupt
- Types
- Interrupt Masking
Interrupt Masking
2081 · 5 marks
What do you mean by vectored interrupt? Explain maskable and non-maskable interrupts in 8085 microprocessor. [5]
Show solved answerHide answer
Vectored Interrupt, Maskable and Non-Maskable Interrupts in 8085
Vectored Interrupt
A vectored interrupt is an interrupt in which the interrupting device not only signals the processor for attention but also identifies itself by providing the address (vector) of its Interrupt Service Routine (ISR) directly.
- When a vectored interrupt occurs, the microprocessor automatically jumps to a fixed, pre-defined memory address associated with that interrupt, without needing to poll or search for the source.
- This makes the response faster and more efficient.
Example: In the 8085, interrupts like TRAP, RST 5.5, RST 6.5, RST 7.5 are vectored interrupts because each one has a fixed call address in memory.
In contrast, a non-vectored interrupt (like INTR) does not provide the address directly; the processor must determine the ISR address through external hardware.
Interrupts in 8085 Microprocessor
The 8085 has 5 hardware interrupt pins:
| Interrupt | Type |
|---|---|
| TRAP | Non-Maskable |
| RST 7.5 | Maskable |
| RST 6.5 | Maskable |
| RST 5.5 | Maskable |
| INTR | Maskable |
1. Maskable Interrupts
- A maskable interrupt is one that can be enabled or disabled (masked) by the programmer using software instructions.
- In 8085, the EI (Enable Interrupt) and DI (Disable Interrupt) instructions are used to enable or disable maskable interrupts.
- When the processor is busy with a critical task, it can ignore (mask) these interrupts temporarily.
- The response to a maskable interrupt can be immediate or delayed.
Maskable interrupts in 8085:
- INTR - General purpose maskable interrupt; requires external hardware to supply the restart address.
- RST 5.5 - Vectored; calls address 002CH
- RST 6.5 - Vectored; calls address 0034H
- RST 7.5 - Vectored; calls address 003CH (highest priority among maskable)
These can also be individually masked using the SIM (Set Interrupt Mask) instruction.
2. Non-Maskable Interrupt
- A non-maskable interrupt is one that cannot be disabled or ignored by the programmer. The processor must respond to it immediately regardless of the state of the interrupt enable flag.
- It is used for emergency or critical situations such as power failure.
Non-maskable interrupt in 8085:
- TRAP - It is the only non-maskable interrupt in 8085.
- It has the highest priority among all interrupts.
- It is both edge-triggered and level-triggered (making it very reliable).
- It calls the fixed address 0024H.
- It cannot be masked by EI/DI instructions or SIM instruction.
Summary Table
| Feature | Maskable Interrupt | Non-Maskable Interrupt |
|---|---|---|
| Can be disabled? | Yes (using DI / SIM) | No |
| Example in 8085 | INTR, RST 5.5, RST 6.5, RST 7.5 | TRAP |
| Priority | Lower | Highest |
| Use case | General I/O requests | Critical emergencies |
2078 · 5 marks
Write short notes on (any two):a. Program Counter b. Von-Neumann Architecture c. Interrupt Masking [5]
2080.1 · 5 marks
What is the significance of interrupt masking? Difference between vectored and polled interrupt. [5]
Direct Memory Access
2080 · 5 marks
What do you mean by Isolated I/O? Explain basic DMA operation in brief. [5]
2079 · 5 marks
Write short notes on (Any TWO):a. LDT b. DMA c. Assemble directives [5]
2078 · 5 marks
Differentiate between interrupt based I/O and DMA based I/O. Explain based DMA operation in brief. [5]
2076 · 10 marks
Describe the working mechanism of DMA. Draw the internal architecture of the 8237 DMAC along with a timing diagram illustrating the process of DMA transfers.[10]
2080.1 · 5 marks
What is the importance of direct memory access? Explain the mechanism of direct memory access. [5]
Show solved answerHide answer
Direct Memory Access (DMA) - Importance and Mechanism
Importance of Direct Memory Access
Direct Memory Access (DMA) is a technique that allows external I/O devices to communicate directly with the memory without involving the processor every time. Its importance includes:
- Frees the CPU: The CPU does not need to supervise every data transfer between I/O devices and memory, allowing it to perform other tasks simultaneously.
- High Speed Data Transfer: Large blocks of data can be transferred at high speed directly between memory and peripherals (e.g., disk drives, network cards) without CPU intervention.
- Reduced CPU Overhead: Since the CPU is not busy handling each byte of data transfer, overall system performance and efficiency is greatly improved.
- Efficient Use of System Resources: The processor and I/O operations can proceed in parallel, making better use of available hardware resources.
- Essential for High-Bandwidth Devices: Devices such as hard disks, graphics cards, and sound cards require fast bulk data transfers that would be too slow if handled byte-by-byte by the CPU.
Mechanism of Direct Memory Access
The DMA mechanism works through a dedicated hardware unit called the DMA Controller (DMAC). The steps involved are as follows:
Step 1: DMA Request
- When an I/O device needs to transfer data to/from memory, it sends a DMA request signal to the DMA controller.
Step 2: HOLD Signal to CPU
- The DMA controller activates the HOLD pin of the microprocessor.
- This signals the CPU to relinquish (release) control of the system buses (address bus, data bus, and control bus).
Step 3: HLDA (Hold Acknowledge)
- The CPU completes its current bus cycle and then sends a Hold Acknowledge (HLDA) signal back to the DMA controller.
- The CPU now enters a hold state and stops using the buses.
Step 4: DMA Takes Control of Buses
- The DMA controller now takes control of:
- Address Bus - to specify memory locations
- Data Bus - to transfer data
- Control Bus - to generate read/write signals
Step 5: Data Transfer
- The DMA controller directly transfers data between the I/O device and memory without CPU involvement.
- This transfer can be:
- Byte by byte (cycle stealing mode)
- Block transfer (burst mode)
Step 6: Release of Buses
- After the data transfer is complete, the DMA controller deactivates the HOLD signal.
- The CPU regains control of the buses and resumes normal operation.
DMA Transfer Diagram
I/O Device ---[DMA Request]---> DMA Controller
|
[HOLD Signal]
|
Microprocessor
|
[HLDA - Acknowledge]
|
DMA Controller takes Address, Data, Control Buses
|
Direct Transfer: I/O Device <-----> Memory
|
DMA releases buses
|
CPU resumes operation
Summary
DMA is important because it enables fast, CPU-independent data transfer between memory and peripherals. The mechanism relies on the HOLD and HLDA handshake between the DMA controller and the CPU, after which the DMA controller directly manages the buses to perform the transfer efficiently.
Interrupt
Memory Read
2079 · 5 marks
Explain memory read operation with suitable figure. [5]
Make Unit 5 stick
Practice CSC167 with flashcards & quizzes