![](http://datasheet.mmic.net.cn/230000/79RC32438-200BB_datasheet_15568909/79RC32438-200BB_255.png)
IDT DMA Controller
Internal DMA Operation
79RC32438 User Reference Manual
9 - 9
November 4, 2002
Notes
DMA Registers
Each DMA channel has five registers. A channel is controlled by a DMA control (DMA[0..9]C) register,
and the status of a DMA channel is reported in a DMA status (DMA[0..9]S) register. The bits in a DMA
status register, which are not masked by the corresponding DMA status mask (DMA[0..9]SM) register, are
ORed together and presented to the interrupt controller. A DMA operation is begun by writing the starting
address of the first descriptor in a descriptor list into the DMA descriptor pointer (DMA[0..9]DPTR) register
of a DMA channel. As a side effect of writing this register, a DMA operation begins and the run (RUN) bit in
the corresponding DMAxC register is set. The DMA channel performs DMA descriptor processing,
executing the dictated DMA descriptor operations until a DMA descriptor is reached with a zero in its LINK
field. This signals the completion of DMA operation and causes the RUN bit in the DMAxC register to be
cleared and the halt (H) bit in the DMAxS register to be set. During DMA descriptor processing, the
DMAxDPTR register may be read to determine the address of the descriptor currently being processed.
DMA Stopping Conditions
A DMA descriptor operation has three stopping conditions:
finished, done
, and
terminated
. The stopping
conditions which cause a descriptor operation to complete is recorded in the finished (F), done (D), and
terminated (T) bits of the first word in a descriptor. When the DMA controller updates the first word of a
descriptor, only the F, D, and T bits are set. For example, if the T bit was initially set in the descriptor and the
DMA stopping condition was
finished
, the T bit would remain set in the descriptor written back to memory.
Finished Condition:
When a DMA operation begins, the COUNT field is loaded from the descriptor in
memory into a byte counter associated with the DMA channel. The byte counter is decremented by the
DMA transfer size after each data transfer. The finished stopping condition occurs when the byte counter
reaches zero (i.e., there are no more bytes to transfer). This causes the F bit in the DMA descriptor to be
set. If the interrupt on finished (IOF) bit in the descriptor has been initialized to a one, then the F bit in the
DMAxS register is also set. If the chain on finished (COF) bit in the descriptor has been initialized to a one,
then a DMA chaining operation takes place.
Done Condition:
The done stopping condition occurs when the selected device signals a done event.
Done events allow a selected peripheral to terminate a DMA operation at an arbitrary point (for example, at
the end of packet). The done stopping condition occurs when a done event is signalled by the selected
peripheral device. This causes the D bit in the DMA descriptor to be set. If the interrupt on done (IOD) bit in
the descriptor has been initialized to a one, then the D bit in the DMAxS register is also set. If the chain on
done (COD) bit in the descriptor has been initialized to a one, then a DMA chaining operation takes place.
It is possible for a DMA descriptor operation to complete due to multiple stopping conditions. For
example, it is possible to have a simultaneous finished and done stopping condition which causes both the
F and D bits in the DMA descriptor to be set.
Terminated Condition:
A DMA operation is halted when the RUN bit in the DMAxC register is cleared.
A halted DMA operation results in a terminated stopping condition for the descriptor being processed and
causes the DMA operation to complete. When this occurs, the DMA controller performs the following:
discontinues the current DMA descriptor operation, sets the T bit, and updates all other status information in
the descriptor. The descriptor contents are then written back to memory. When the descriptor write
completes, the halt (H) bit in the DMAxS register is set to acknowledge that the DMA operation has been
halted. When a DMA operation is halted by clearing the RUN bit, writes to the DMAxDPTR and DMAx-
NDPTR should not be performed until the halt (H) bit is set.
Note:
Under certain conditions the Terminated status bit is not set. An example is when a zero
length DMA operation is performed.
DEVCS
Device Control and Status.
This 32-bit field is initialized with peripheral device specific control infor-
mation. When descriptor processing completes, this field is updated with peripheral specific status
information.
LINK
Link.
This 32-bit field points to the next descriptor in the descriptor list.