8237 DMA Controller
8237 DMA Controller
DMA Controller
Group XV - SY EC
Team Members
01 02 03 04 05
● Support for Peripherals: Peripheral devices require fast and efficient data
transfer capabilities, such as ADCs, DACs, and storage devices.
Modes of Transfer
Interfacing DUMP 1
1. DREQ - I/O to DMAC
Modes:
2. HOLD/HRQ - DMAC to 8085
1. Single Transfer
3. HLDA - 8085 to DMAC 2. Cascade
3. Block Transfer
4. DACK - DMAC to I/O 4. Demand
- CASCADE MODE
- Both DMAC and microprocessor are constantly stealing bus cycles from each
other. It is the most popular method of DMA, because it keeps the
microprocessor active in the background.
- After a byte is transferred, the CAR and CWCR are adjusted accordingly. The
system bus is returned to the µP. For further bytes to be transferred, the DREQ
line must go active again, and then the entire operation is repeated.
Cascade Mode
- This mode is used to cascade more than one 8237A together for simple
system expansion.
- The HRQ and HLDA signals from the additional 8237A are connected to the
DREQ and DACK signals of a channel of the initial 8237A.
- This allows the DMA requests of the additional device to propagate through
the priority network circuitry of the preceding device. The priority chain is
preserved and the new device must wait for its turn to acknowledge
requests.
- The Slave gives HRQ to the Master on the DREQ of the Master, and the Master
gives HRQ to the µP on the HOLD of the µP.
Block Transfer Mode
- In this mode, the DMAC is programmed to transfer all the bytes in one
complete DMA operation. After a byte is transferred, the CAR and CWCR are
adjusted accordingly.
- The system bus is returned to the µP, only after all the bytes are transferred.
i.e. TC is reached or EOP signal is issued. It is the fastest form of DMA but
keeps the microprocessor inactive for a long time.
- The DREQ signal needs to be active only in the beginning for requesting the
DMA service initially. Thereafter DREQ can become low during the transfer.
Demand Transfer Mode
- It is very similar to Block Transfer, except that the DREQ must active
throughout the DMA operation.
- If during the operation DREQ goes low, the DMA operation is stopped and the
busses are returned to the µP
- In the meantime, the µP can continue with its own operations. Once DREQ
goes high again, the DMA operation continues from where it had stopped.
03
DMA
Programming
Programming the 8237
To implement the DMA transfer, the 8237 should be initialized by writing into
various control registers discussed earlier in the DMA channels and interfacing
section. To initialize the 8237, the following steps are necessary :
1. Write a control word in the Mode register that selects the channel and specifies
the type of transfer (Read, Write, or Verify) and the DMA mode (block, single-byte,
etc.).
2. Write a control word in the Command register that specifies parameters such as
priority among four channels, DREQ and DACK active levels, and timing, and
enables the 8237.
3. Write the starting address of the data block to be transferred in the channel
Memory Address Register (MAR).
4. Write the count (the number of the bytes in the data block) in the channel Count
register.
Write initialization instructions for the DMA
controller in Figure to meet the following specs:
Slave Mode
In slave Mode , DMA controller is treated as peripheral using the following steps :-
2. The MPU writes the control words as illustrated in Example 15.8 in channel
registers and command/status registers by using control signals IOW and IOR.
In this mode, the output signals of the 8237, such as A7-A4, MEMW, and MEMR, are
in tri-state.
5.Next, the DMA as- serts ADSTB (Address Strobe) high that is connected to Latch
Enable (LE) of 373 Latch #1 and places the contents of the data bus, which is a
high-order byte of the starting address, on A15-Ag. At the same time, the DMA also
outputs the low order address A7-A on the low-order address bus.
6. When the entire address As-A, is available on the address bus, the DMA sends
DACK to the peripheral.
7. The DMA controller continues the data transfer by asserting the necessary
control signals (IOR, IOW, MEMR, or MEMW ) until DACK remains high.
8. At the end of the data transfer, the DMA asserts EOP (End of Process) signal low
that can be used to inform the peripheral that the data transfer is complete. The
DMA data transfer can also be terminated by sending a low signal to EOP from
outside.
Master Mode
Master Mode After the initialization, the 8237 in master mode keeps checking for a
DMA request,
The steps in data transfer can be listed as follows:
1. When the peripheral is ready for data transfer, it sends a high signal to DRQ. 2.
When the DRQ has been received and the channel enabled, the control logic sets
HRQ (Hold Request) high. (HRQ is connected to the HOLD signal of the 8085.)
3. In the next cycle, the MPU relinquishes the buses and sends the HLDA (Hold
Acknowledge) signal to the 8237.
4. After receiving the HLDA signal, the DMA asserts AEN (Address Enable) signal high.
The high AEN signal disables 373 Latch #2, thus disconnecting the demultiplexed
bus A7-Ao of the MPU and enables 373 Latch #1 through an inverter.
Thank You !!