PadhaikoAll subjects

Past exam question: 2082 Kartik (Back), Q6

Microprocessors · 6 marks

Open in the Padhaiko app

Topic: Parallel Interface, Handshaking & the PPI

Question

Explain in brief about 8257 with its block diagram.

Solution

Overview & Function of Intel 8257 DMA Controller: The Intel 8257 is a 4-channel Programmable Direct Memory Access (DMA) controller in a 40-pin package. It is designed to provide high-speed, direct peripheral-to-memory and memory-to-peripheral data transfers without involving the microprocessor CPU in every single byte transfer, overcoming the speed limitation of programmed I/O.

Internal Block Diagram of 8257:

+-------------------------------------------------------------------------+
|                  INTEL 8257 DMA CONTROLLER ARCHITECTURE                 |
|                                                                         |
|  +--------------------+  +--------------------+  +--------------------+ |
|  | Channel 0 Register |  | Channel 1 Register |  | Channel 2 Register | |
|  |  - DMA Address (16)|  |  - DMA Address (16)|  |  - DMA Address (16)| |
|  |  - Terminal Cnt(16)|  |  - Terminal Cnt(16)|  |  - Terminal Cnt(16)| |
|  +---------+----------+  +---------+----------+  +---------+----------+ |
|            |                       |                       |            |
|            +-----------------------+-----------------------+            |
|                                    |                                    |
|  +--------------------+            v             +--------------------+ |
|  | Channel 3 Register |  +--------------------+  | Mode Set Register  | |
|  |  - DMA Address (16)|  | Priority Resolver  |  | (8-bit control)    | |
|  |  - Terminal Cnt(16)|  | & Control Logic    |  +--------------------+ |
|  +--------------------+  +---------+----------+  | Status Register    | |
|                                    |             | (8-bit status)     | |
|  +--------------------+            |             +--------------------+ |
|  | Data Bus Buffer    |            v                                    |
|  | (Bidirectional D7-0|  +--------------------+  +--------------------+ |
|  +--------------------+  | Read / Write Logic |  | Address Buffer     | |
|                          | IOR, IOW, MEMR,    |  | (A7–A4, A3–A0)     | |
|                          | MEMW, CS, RESET    |  +--------------------+ |
+------------------------------------+------------------------------------+
                                     |
    External Handshake Pins:         v
    DRQ0–DRQ3 (Inputs), DACK0–DACK3 (Outputs), HRQ (To CPU), HLDA (From CPU)

Detailed Explanation of Functional Blocks:

  1. Four Independent DMA Channels (CH 0 to CH 3):
    • Each channel contains a 16-bit DMA Address Register (initial memory address) and a 16-bit Terminal Count Register (14-bit byte count plus 2 mode bits).
    • Each channel accepts a DRQ (DMA Request) input from an I/O device and issues a DACK (DMA Acknowledge) output.
  2. Priority Resolver & Control Logic:
    • Evaluates simultaneous DRQ requests using either Fixed Priority (CH0 > CH1 > CH2 > CH3) or Rotating Priority.
  3. Mode Set & Status Registers:
    • Mode Set Register: Programmed by CPU to enable individual channels, set rotating priority, and enable auto-load.
    • Status Register: Informs CPU of terminal count completion (TC) and update status.
  4. Data Bus Buffer & Read/Write Logic:
    • Connects to system data bus D7–D0 for programming registers.
    • In slave mode, receives IOR_bar and IOW_bar from CPU; in master mode, drives MEMR_bar, MEMW_bar, IOR_bar, and IOW_bar to direct transfers.

DMA Handshaking with 8085:

  1. Peripheral asserts DRQ to 8257.
  2. 8257 asserts HRQ (Hold Request) to 8085's HOLD pin.
  3. 8085 completes current machine cycle, tri-states its buses, and asserts HLDA (Hold Acknowledge).
  4. 8257 takes control of system buses, asserts DACK to peripheral, places address on address bus, and activates simultaneous MEMR_bar and IOW_bar (or IOR_bar and MEMW_bar). Data transfers directly between memory and peripheral in a single bus cycle.
Answer:

The Intel 8257 DMA Controller provides four independent channels with Address and Terminal Count registers, priority logic, and read/write control. It requests bus control from the CPU via HRQ/HLDA to execute single-cycle direct memory-to-I/O transfers.

All past exam questions for Microprocessors