Professional Documents
Culture Documents
In I/O data transfer, data is transferred by using microprocessor. The microprocessor will read
data from I.O device and then will write data to memory.
In this case, there are two operations for single data transfer. If the data is less them processor
time will not waste. But to transfer huge amounts of data has to transferred them the rate of
transfer will slow down because of the processor intervention for every cycle.
To overcome this problem, the process can be speeded up by giving the I/O direct access to the
memory. This method of giving the I/O devices direct access to the buses of processor is called
as Direct Memory Access (DMA).
The I/O can have direct access to the processor bus but under supervision. The device which
supervises data transfer is named as DMA Controller.
Intel had first developed a DMA Controller 8257, which has four channels. On behalf of the
I/O devices this controller will request the processor for bus control and performs the operation
and also it has a priority resolver which will help in resolving which one to attend first in case
of multiple simultaneous requests.
Later, an advanced Programmable DMA Controller 8237 was developed, which provides a
better performance.
Comparison of 8257 and 8237:
Both are capable of transferring a byte or a bulk of data between system memory and peripheral
in either direction.
Memory to memory data transfer facility is available in 8237.
Both support four independent DMA channels which may be expanded to any number by
cascading a greater number of 8237.
The TC (Terminal Count) pin of 8257 is called EOP (End of Process), both indicate the same
operation.
When compared to 8257, 8237 provides many programmable controls and dynamic
reconfigurability features which enhance the data transfer rate of the system remarkably.
DMA Operations with 8237:
8237 operates in two cycles. 1. Passive cycle, 2. Active Cycle. Each cycle contains fixed
number of states. 8237 can have six states in Active cycle and during passive cycle it will be
in a single state called as Idle State SI.
Passive Cycle: 8237 will be initially in this cycle. This cycle has a single state called as Idle
State. In idle state 8237 does not have any valid pending DMA request. When there is a DMA
request, idle state ends and 8237 enters into active cycle.
Active Cycle: Once there is a DMA request, 8237 enters into state S0, which is the first state
of DMA operation. 8237 requests the processor for a DMA operation by sending HOLD signal.
If CPU has not acknowledged the request, the 8237 waits in S0 state until it receives the HLDA
signal from CPU. Once the Acknowledge signal is received that means the data transfer can
start.
The stages S1, S2, S3 and S4 are working states of DMA transfer, actual data transfer operation
happens here. If more time is needed to complete the DMA operation Wait states may be
inserted between the above states using READY pin.
A memory to memory transfer is a two-cycle operation, and requires a read from and a write
to memory cycle to complete each DMA transfer. Each of these two types of cycles, require
four states for its completion. Thus, a total of 8 cycles are required for one transfer operation.
The first four states are used for read from memory cycle and denoted by S11, S12, S13, S14
and the next four states are for write to memory cycle and denoted by S21, S22, S23 and S24,
Memory to Memory Transfer
To transfer a block of data from one memory to another memory this transfer method is used.
Using the LSB of Command register this mode can be enabled. Channel 0 is used as source
and channel 1 is used as destination in this transfer.
The channel 0 current address register acts as source pointer. The byte of data read from the
memory is stored in temporary register. Channel 1 current address register acts as destination
pointer to write data from temporary register to destination memory location. The pointers are
automatically incremented or decremented, depending on the programming. The channel 1-
word count register used as counter and on every transfer operation counter decrement and
when count reaches zero, EOP generated.
Internal Architecture of 8237:
• It is an 8-bit register.
• Holds data during memory-to-memory data transfers.
• After the completion of the transfer operation, the last word transferred remains in the
temporary register till it is cleared by a reset operation.
Command Register:
• 8237 has 8-bit command register. This can be programmed by CPU and cleared by a
reset operation.
• B0: Enables the memory-to-memory transfer operation. Set this bit to start a memory
to memory transfer.
• B1: Set this bit to make channel 0 as source channel and enables channel 0 address. If
B0=0 then this bit is ignored.
• B2: To enable or disable to DMA controller.
• B3: If this bit is set, then the channel works will be compressed for the DMA operation
so that the time taken for the total transfer will decrease. This is used only for I/O
devices not for memory to memory transfers.
• B4: Set this bit to rotate the priority of the channels of DMA controller. If this bit is 0
then Controller will follow fixed priority.
Fixed Priority Scheme: In fixed priority scheme, channel 3 has the lowest priority
followed by channels 2 and 1. Channel 0 has the highest priority.
Rotating Priority Scheme: In this scheme the priorities assigned to the channels are not
fixed. The channel which is served will go to lowest priority and immediate channel
will get the highest priority. If channel 0 has highest priority, it gets service and once it
is served it goes to the lowest priority and channel 1 becomes the highest priority
channel. Likewise, priority rotates.
• B5: Set this bit to extend the write cycle while dealing with slow peripherals to prevent
the loss of data. If compressed timing is chosen this bit is ignored.
• B6: If this bit is 1, DREQ pins act as active HIGH otherwise they are active LOW.
• B7: If this bit is 1, DACK pins act as active HIGH otherwise they are active LOW.
Mode Register:
• It is an 8-bit register. Each channel has a request bit associated with it, in request
register.
• B0, B1: to select among the 4 channels.
• B2: If this bit is 1- Request bit corresponding to the channel selected will be set. If this
bit is 0, the request bit corresponding to the channel will be reset.
• All remaining bit will be ignored.
Mask Register:
• It is an 8-bit register.
• It keeps track of all the DMA channel pending requests and the status of their terminal
counts.
• B0-B3: These four bits corresponds to four channels and set every time, when the
corresponding channel reached Terminal count or an external EOP occurs.
• B4-B7: These four bits corresponds to four channel and set if the corresponding channel
has pending request services.
Modes of operation of 8237:
The data transfer in 8237 can take place in 4 different types of transfer modes. These modes
can be programmed using mode register. They are:
Single Transfer Mode:
• In this mode, the device transfers only one byte per request. The word count is
decremented and the address is incremented or decremented after each such transfer.
The TC is reached when count becomes zero.
• For each transfer DREQ must be active until the DACK is activated.
• This mode is also called as ‘cycle stealing’.
Block Transfer Mode:
• In this mode, the transfer takes place until a TC is reached or an external EOP is detected
or the DREQ signal goes inactive.
• A data transfer may exhaust the capacity of data transfer of an I/O device. After the I/O
device is able to catch up, the service may be re-established activating the DREQ signal
again.
• Only the EOP generated by TC or external EOP can cause the auto-initialization when
programmed for.
Cascaded Mode:
• In this mode, one master 8237 will be there and any number of 8237 can be connected
together to provide more than 4 DMA channels.
• The HRQ and HLDA pins of slave 8237 is connected to DREQ and DACK pins of each
channel of host 8237.
• The priorities of DMA requests may be preserved at each level. The first host device is
used only for prioritizing the additional devices, and it does not generate any address
or control signal of its own.
Clock Generator (8284A)
8284A is an important component to the 8086/88 microprocessor. Without this, it requires
many additional circuits to generate the clock in this system. 8284 provides following basic
functions or signals to 8086/88 based system.
1. Clock generation.
2. RESET synchronization
3. READY synchronization
4. A TTL level peripheral clock signal which is important to interfacing
microprocessors.