14-18
MCF5249UM
MOTOROLA
DMA Transfer Functional Description
The BCR must be loaded with the number of byte transfers that are to occur. This register is decremented
by 1, 2, 4, or 16 at the end of each transfer. The DSR must be cleared for channel startup.
Once the channel has been initialized, it is started by writing a one to the START bit in the DCR or
asserting the REQUEST signal, depending on the status of the EEXT bit in the DCR. Programming the
channel for processor request causes the channel to request the bus and start transferring data
immediately. If the channel is programmed for periphery request, REQUEST must be asserted before the
channel requests the bus.
If any fields in the DCR are modified while the channel is active, that change is effective immediately. To
avoid any problems with changing the setup for the DMA channel, a 1 should be written to the DONE bit in
the DSR to stop the DMA channel.
14.7.2
DATA TRANSFER
14.7.2.1
Periphery Request Operation
All channels can initiate transfers to/from a periphery module by means of REQUEST[3:0]. Source where
REQUEST is coming from is programmed in register DMAROUTE. If the EEXT bit (DCR[30]) is set, when
a REQUEST is asserted, the DMA initiates a transfer provided the channel is idle. If the CS (cycle steal) bit
is set, the read/write transaction on the bus is limited to a single transfer. If the CS bit is clear, multiple
read/write transfers can occur on the bus as programmed. REQUEST does not need to be negated until
the DONE bit (DSR[0]) is set.
14.7.2.2
Auto Alignment
This feature allows for block transfers to occur at the optimum size based on the address, byte count, and
programmed size. To use this feature, AA in the DCR must be set. The source is auto-aligned when the
SSIZE bits indicate a larger transfer size compared to DSIZE. Source alignment takes precedence over
the destination when the source and destination sizes are equal. Otherwise, the destination is
auto-aligned. The address register that is chosen for alignment increments regardless of the value of the
increment bit. Configuration error checking is performed on the registers that are not chosen for alignment.
If the BCR contains a value greater than 16, the address will determine the size of the transfer. Single byte,
word or longword transfers will occur until the address is aligned to the programmed size boundary, at
which time the programmed size accesses begin. When the BCR is less than 16 at the beginning of a
read/write transfer, the number of bytes remaining will dictate the transfer size, longword, word or byte.
For example:
AA = 1, SAR = $0001, BCR = $00f0, SSIZE = 00 (longword) and DSIZE = 01 (byte),
Because the SSIZE > DSIZE, the source is auto-aligned. Error checking is performed on the destination
registers. The sequence of accesses is as follows:
1. Read byte from $0001—write byte, increment SAR
2. Read word from $0002—write 2 bytes, increment SAR
3. Read long word from $0004—write 4 bytes, increment SAR
4. Repeat longwords until SAR = $00f0
5. Read byte from $00f0—write byte, increment SAR.
If DSIZE is set to another size, then the data writes are optimized to write the largest size allowed based on
the address, but not exceeding the configured size.