Past exam question: 2082 Kartik (Back), Q6
Open in the Padhaiko appExplain 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:
- 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 aDACK(DMA Acknowledge) output.
- Priority Resolver & Control Logic:
- Evaluates simultaneous DRQ requests using either Fixed Priority (CH0 > CH1 > CH2 > CH3) or Rotating Priority.
- 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.
- Data Bus Buffer & Read/Write Logic:
- Connects to system data bus D7–D0 for programming registers.
- In slave mode, receives
IOR_barandIOW_barfrom CPU; in master mode, drivesMEMR_bar,MEMW_bar,IOR_bar, andIOW_barto direct transfers.
DMA Handshaking with 8085:
- Peripheral asserts
DRQto 8257. - 8257 asserts
HRQ(Hold Request) to 8085'sHOLDpin. - 8085 completes current machine cycle, tri-states its buses, and asserts
HLDA(Hold Acknowledge). - 8257 takes control of system buses, asserts
DACKto peripheral, places address on address bus, and activates simultaneousMEMR_barandIOW_bar(orIOR_barandMEMW_bar). Data transfers directly between memory and peripheral in a single bus cycle.
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.