Download UM10362 LPC314x User manual

Transcript
UM10362
NXP Semiconductors
Chapter 9: LPC314x DMA controller
Remark: 6: This setting disables companion-channels, so basically this is the last
transfer.
Remark: 7: The `enable companion channel' option must be set, since there is still1
transfer left.
5.2.1 Ending a linked-list transfer inside the linked list
The last entry of a linked list is a special one. In the example linked-list, there are 4
methods described how to end the linked list transfer:
Method 1 - Just stop the linked list, by disabling the copy-table-enabling in the config
setting.
This can be done for instance if the CPU is not interested in an IRQ on this event.
Method 2 - Re-start the linked list by pointing the last pointer back to the beginning of the
linked list, effectively creating a circular buffer made out of linked list entries.
Method 3 - Write towards the DMA soft interrupt register, which enables the CPU to be
interrupted, so that it can act on the event that a linked-list has ended.
Method 4 - This is a combination of 1 and 3. Now the CPU gets a soft interrupt 1 entry
before the last entry is executed.
Method x - Whatever suits the application.
5.2.2 To start a linked-list operation
• Program into memory the linked-list to <linked-list_base_address>.
• Reserve 2 sequential DMA channels/channels.
• Program the second channel as follows:
Table 176. Linked List Example
Source Address
<Linked_list_base_address>
Destination address
<The alternative source address of the previous
DMA channel>
Transfer Length
0x4 (for 5 addresses per entry)
Configuration
DMA_word + enable_companion_channel
(previous channel)
Enable address
0x1 (start the transfer)
Remark: Please make sure that the ALT_SOURCE_REG is used as the destination
address, and not the normal SOURCE_REG.
5.2.3 Ending a linked list transfer in the middle of a linked-list execution
There may be cases where the CPU needs to stop a linked-list from execution. There are
more ways to do this:
1. Brutally stop the execution. This can be done by:
– Enable [first_channel]=0
– Enable [second_channel]=0
– Enable [first_channel]=0
UM10362
User manual
© NXP B.V. 2012. All rights reserved.
Rev. 1 — 7 December 2012
211 of 577