ARM Technical Support Knowledge Articles

Which device can control the data transfer length, to or from a peripheral?

Applies to: PL330 AXI DMA Controller

Answer

Either the DMAC (PL330) or the peripheral can control the length of a data transfer between the two devices.

If the DMAC is to control the length then the program uses the DMALP instruction to construct a loop. The loop contains the loads to, or stores from, the peripheral and the number of loop iterations, set with the encoding of DMALP, controls the length of the data transfer.

If the peripheral is to control the length then the program uses a DMALPFE instruction to construct a loop. The loop contains the loads to, or stores from, the peripheral and the loop iterates continuously until the peripheral sets drlast_<x> HIGH to indicate when the last transfer is in progress. After the assertion of drlast_<x>, the DMAC exits the loop when it executes the DMALPEND instruction.

Example

Example 1 shows the assembler code to transfer a defined number of bursts of data (4 bursts) from peripheral 0 to memory.

Example 1 - DMAC controlling the length of a peripheral transfer

DMALP 4
    DMAWFP P0, burst
    DMALDPB P0
    DMAST
DMALPEND

Example 2 shows the assembler code to transfer an undefined number of bursts of data, or single data, from peripheral 0 to memory.

Example 2 - Peripheral controlling the length of a peripheral transfer

DMALPFE
    DMAWFP P0, periph
    DMALDPB P0
    DMASTB
    DMALDPS P0
    DMASTS
DMALPEND

Rate this article

[Bad]
|
|
[Good]
Disagree? Move your mouse over the bar and click

Did you find this article helpful? Yes No

How can we improve this article?

Link to this article
Copyright © 2011 ARM Limited. All rights reserved. External (Open), Non-Confidential