958
SAM9G45 [DATASHEET]
6438K–ATARM–12-Feb-13
Note:
The values in the LLI.DMAC_DADDRx register location of each Linked List Item (LLI) in memory, although fetched dur-
ing an LLI fetch, are not used.
4.
Write the channel configuration information into the DMAC_CFGx register for channel x.
a.
Designate the handshaking interface type (hardware or software) for the source and destination
peripherals. This is not required for memory. This step requires programming the
SRC_H2SEL/DST_H2SEL bits, respectively. Writing a ‘1’ activates the hardware handshaking inter-
face to handle source/destination requests for the specific channel. Writing a ‘0’ activates the software
handshaking interface to handle source/destination requests.
b.
If the hardware handshaking interface is activated for the source or destination peripheral, assign
handshaking interface to the source and destination peripherals. This requires programming the
SRC_PER and DST_PER bits, respectively.
5.
Make sure that all LLI.DMAC_CTRLBx register locations of the LLI (except the last) are set as shown in
two list items.
6.
Make sure that the LLI.DMAC_DSCRx register locations of all LLIs in memory (except the last) are non-
zero and point to the next Linked List Item.
7.
Make sure that the LLI.DMAC_SADDRx register location of all LLIs in memory point to the start source
buffer address proceeding that LLI fetch.
8.
Make sure that the LLI.DMAC_CTRLAx.DONE field of the LLI.DMAC_CTRLAx register locations of all
LLIs in memory is cleared.
9.
If source picture-in-picture is enabled (DMAC_CTRLBx.SPIP is enabled), program the DMAC_SPIPx reg-
ister for channel x.
10. If destination picture-in-picture is enabled (DMAC_CTRLBx.DPIP is enabled), program the DMAC_DPIPx
register for channel x.
11. Clear any pending interrupts on the channel from the previous DMAC transfer by reading the interrupt sta-
tus register.
12. Program the DMAC_CTRLAx, DMAC_CTRLBx and DMAC_CFGx registers according to Row 2 as shown
13. Program the DMAC_DSCRx register with DMAC_DSCRx(0), the pointer to the first Linked List item.
14. Finally, enable the channel by writing a ‘1’ to the DMAC_CHER.ENABLE[n] bit. The transfer is performed.
Make sure that bit 0 of the DMAC_EN register is enabled.
15. The DMAC fetches the first LLI from the location pointed to by DMAC_DSCRx(0).
Note:
The LLI.DMAC_SADDRx, LLI.DMAC_DADDRx, LLI.DMAC_DSCRx and LLI.DMAC_CTRLA/Bx registers are fetched.
The LLI.DMAC_DADDRx register location of the LLI although fetched is not used. The DMAC_DADDRx register in the
DMAC remains unchanged.
16. Source and destination requests single and chunk DMAC transactions to transfer the buffer of data
(assuming non-memory peripherals). The DMAC acknowledges at the completion of every transaction
(chunk and single) in the buffer and carry out the buffer transfer
17. Once the buffer of data is transferred, the DMAC_CTRLAx register is written out to system memory at the
same location and on the same layer (DMAC_DSCRx.DSCR_IF) where it was originally fetched, that is,
the location of the DMAC_CTRLAx register of the linked list item fetched prior to the start of the buffer
transfer. Only DMAC_CTRLAx register is written out because only the DMAC_CTRLAx.BTSIZE and
DMAC_CTRLAX.DONE fields have been updated by DMAC hardware. Additionally, the
DMAC_CTRLAx.DONE bit is asserted when the buffer transfer has completed.
Note:
Do not poll the DMAC_CTRLAx.DONE bit in the DMAC memory map. Instead, poll the LLI.DMAC_CTRLAx.DONE bit
in the LLI for that buffer. If the poll LLI.DMAC_CTRLAx.DONE bit is asserted, then this buffer transfer has completed.
This LLI.DMAC_CTRLAx.DONE bit was cleared at the start of the transfer.
18. The DMAC does not wait for the buffer interrupt to be cleared, but continues and fetches the next LLI from
the memory location pointed to by current DMAC_DSCRx register and automatically reprograms the
DMAC_SADDRx, DMAC_CTRLAx, DMAC_CTRLBx and DMAC_DSCRx channel registers. The