0% found this document useful (0 votes)
12 views33 pages

8237 DMA Controller

The document provides an overview of the 8237 DMA Controller, detailing its pin-out, internal registers, and various modes of operation. It explains how to program the controller, including setting up address and count registers, and the role of software commands in managing DMA transfers. Additionally, it describes the interaction between the 8237 and the 80X86 microprocessor during normal and DMA operations.

Uploaded by

6y8zpdmjr4
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views33 pages

8237 DMA Controller

The document provides an overview of the 8237 DMA Controller, detailing its pin-out, internal registers, and various modes of operation. It explains how to program the controller, including setting up address and count registers, and the role of software commands in managing DMA transfers. Additionally, it describes the interaction between the 8237 and the 80X86 microprocessor during normal and DMA operations.

Uploaded by

6y8zpdmjr4
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 33

8237 DMA Controller

Dr. Gargi Alavani


Department of CS & IS

1
8237 DMA Controller

2
The 8237 DMA Controller Pin-out

3
8237A-5 programmable DMA controller

4
The 8237 DMA Controller Pin-out

5
The 8237 DMA Controller Pin-out

6
The 8237 DMA Controller Pin-out

7
The 8237 DMA Controller Pin-out

8
The 8237 DMA Controller Pin-out

9
The 8237 DMA Controller Pin-out

10
Internal Registers

11
Internal Registers

12
Command Register

13
Mode Register

● The mode register programs the


mode of operation for a channel.
Note that each channel has its
own mode register, as selected
by bit positions 1 and 0.
● The remaining bits of the mode
register select the operation,
auto-initialization,
increment/decrement, and mode
for the channel

14
Mode Register
● Demand mode transfers data until an
external EOP is input or until the DREQ
input becomes inactive.
● Single mode releases the HOLD after
each byte of data is transferred. If the
DREQ pin is held active, the 8237 again
requests a DMA transfer through the
DRQ line to the microprocessor’s HOLD
input.
● Block mode automatically transfers the
number of bytes indicated by the count
register for the channel. DREQ need not
be held active through the block mode
transfer.
● Cascade mode is used when more than
one 8237 is present in a system.
15
Bus request register

● The bus request register


is used to request a DMA
transfer via software
● This is very useful in
memory-to-memory
transfers, where an
external signal is not
available to begin the
DMA transfer.

16
Mask register set/reset

● The mask register set/reset


sets or clears the channel
mask
● If the mask is set, the channel
is disabled.
● Recall that the RESET signal
sets all channel masks to
disable them.

17
The mask register

● clears or sets all of the masks


with one command instead of
individual channels, as with
the MRSR.

18
The Status Register

● The status register shows the status of


each DMA channel
● The TC bits indicate whether the
channel has reached its terminal count
(transferred all its bytes). Whenever the
terminal count is reached, the DMA
transfer is terminated for most modes of
operation.
● The request bits indicate whether the
DREQ input for a given channel is
active.

19
Software Commands

Clear first-last flip-flop:


● This command resets the First/Last flip-flop in 8237 to zero.
● F/L = 0, the low-order byte is selected; if F/L = 1, the high-order byte is
selected

Master Clear:
● This command is used as software RESET.

Clear Mask Register:


● This command is used to clear the mask bits of the DMA channels in order to
enable all four DMA channels.

20
Software Command Examples
➢ Enable or disable the DMA controller (Write Command Register)
➢ Set the transfer mode (block, demand, etc.) for a DMA channel
(Write Mode Register)
➢ Mask or unmask specific DMA channels (Write Single Mask Register
Bit)
➢ Clear internal flip-flops or temporary states (Master Clear, Clear Byte
Pointer Flip-Flop)
➢ Initiate a DMA request via software (Write Request Register)
➢ Read status of DMA channels (Read Status Register)
21
Software Commands

22
Programming the Address and Count Registers

● Four steps are required to program the 8237:


(1) The F/L flip-flop is cleared using a clear F/L command;
(2) The channel is disabled;
(3) The LSB and then MSB of the address are programmed
(4) The LSB and MSB of the count are programmed.

23
Programming the Address and Count Registers

24
The 8237 Connected to the 80X86 Microprocessor
Part A
Normal 8088
Operation (AEN = 0)
Active Latches:
Latch A provides
A19–A16.
Latch C provides A7–
A0.
Multiplexer E
provides control
signals.

25
The 8237 Connected to the 80X86 Microprocessor
Part A

DMA Operation (AEN = 1)


Active Latches:
Latch B provides A19–A16.
Latch D provides A15–A8.
8237 directly provides A7–A0,
completing the 20-bit DMA
address.
Control signals (like MEMR,
MEMW, IOR, IOW) come from
the DMA controller instead of
the CPU.
ADSTB (Address Strobe from
8237) clocks the DMA address
bits into latch D.

26
The 8237 Connected to the 80X86 Microprocessor
Part B
Temporarily stores upper
address bits A15–A8 from
the DMA controller.

Decodes I/O addresses to generate


chip-select signals for
programming:
• DMA controller
• DMA page registers (which
output A19–A16)

Routes control signals


(MEMR MEMW IOR IOW
, , , ) from either:

•The 8088 CPU (normal


operation, AEN = 0), or
•The 8237 DMA (DMA
operation, AEN = 1)

27
The 8237 Connected to the 80X86 Microprocessor

● During normal 8086 operation, the DMA controller and integrated circuits B
and D are disabled.

● During a DMA action, integrated circuits A, C and E are disabled so that 8239
can take control of the system through the buses

28
Programming DMA

• The leftmost digit of the 5-digit address is sent to Latch B.The F/L flip-
flop is cleared.
• Channels are programmed: Channel 0 is set as the source.
Channel 1 is set as the destination (for memory-to-memory transfer).
• The count register is programmed with a value one less than the
number of bytes to be transferred.
• The mode register of each channel is programmed.
• The command register is programmed to select a block move 29
operation.
Programming DMA

• The leftmost digit of the 5-digit address is


sent to Latch B.The F/L flip-flop is cleared.
• Channels are programmed: Channel 0 is
set as the source. Channel 1 is set as the
destination (for memory-to-memory
transfer).
• The count register is programmed with a
value one less than the number of bytes
to be transferred.
• The mode register of each channel is
programmed.
• The command register is programmed to
select a block move operation.

30
Programming DMA

• The count register is programmed with a


value one less than the number of bytes
to be transferred.
• The mode register of each channel is
programmed.
• The command register is programmed to
select a block move operation.
• Channel 0 is enabled.
• A software DMA request is
initiated.Before exiting the procedure,
the status register is tested for a terminal
count.

31
Programming DMA

Before exiting the procedure:


• The status register is checked for
terminal count (TC).
• The TC flag indicates the
completion of the DMA transfer.
• TC also disables the channel,
preventing further transfers.

32
THANK YOU

33

You might also like