Texas Instruments TMS320VC5501/5502 DSP Direct Memory Access (DMA) Controller (Rev. G) User guide

Category
Motherboards
Type
User guide
TMS320VC5501/5502 DSP
Direct Memory Access (DMA) Controller
Reference Guide
Literature Number: SPRU613G
March 2005
3
Preface
Read This First
About This Manual
This manual describes the features and operation of the direct memory access
(DMA) controller that is available on the TMS320VC5501 and
TMS320VC5502 digital signal processors (DSPs) in the TMS320C55xâ„¢
(C55xâ„¢) DSP generation. This DMA controller allows movement of data
among internal memory, external memory, and peripherals to occur without
intervention from the CPU and in the background of CPU operation.
Notational Conventions
This document uses the following conventions:
- In most cases, hexadecimal numbers are shown with the suffix h. For
example, the following number is a hexadecimal 40 (decimal 64):
40h
- Similarly, binary numbers often are shown with the suffix b. For example,
the following number is the decimal number 4 shown in binary form:
0100b
Related Documentation From Texas Instruments
The following documents describe the C55x devices and related support tools.
Copies of these documents are available on the Internet at www.ti.com.
Tip: Enter the literature number in the search box provided at www.ti.com.
TMS320C55x Technical Overview (literature number SPRU393). This
overview is an introduction to the TMS320C55x DSPs, the latest
generation of fixed-point DSPs in the TMS320C5000â„¢ DSP platform.
Like the previous generations, this processor is optimized for high
performance and low-power operation. This book describes the CPU
architecture, low-power enhancements, and embedded emulation
features.
Related Documentation From Texas Instruments
4
TMS320C55x DSP CPU Reference Guide (literature number SPRU371)
describes the architecture, registers, and operation of the CPU for the
TMS320C55x DSPs.
TMS320C55x DSP Peripherals Reference Guide (literature number
SPRU317) describes the peripherals, interfaces, and related hardware
that are available on TMS320C55x DSPs.
TMS320C55x DSP Algebraic Instruction Set Reference Guide (literature
number SPRU375) describes the TMS320C55x DSP algebraic
instructions individually. Also includes a summary of the instruction set,
a list of the instruction opcodes, and a cross-reference to the mnemonic
instruction set.
TMS320C55x DSP Mnemonic Instruction Set Reference Guide (literature
number SPRU374) describes the TMS320C55x DSP mnemonic
instructions individually. Also includes a summary of the instruction set,
a list of the instruction opcodes, and a cross-reference to the algebraic
instruction set.
TMS320C55x Optimizing C/C++ Compiler User’s Guide (literature number
SPRU281) describes the TMS320C55xâ„¢ C/C++ Compiler. This C/C++
compiler accepts ISO standard C and C++ source code and produces
assembly language source code for TMS320C55x devices.
TMS320C55x Assembly Language Tools User’s Guide (literature number
SPRU280) describes the assembly language tools (assembler, linker,
and other tools used to develop assembly language code), assembler
directives, macros, common object file format, and symbolic debugging
directives for TMS320C55x devices.
TMS320C55x DSP Programmer’s Guide (literature number SPRU376)
describes ways to optimize C and assembly code for the TMS320C55x
DSPs and explains how to write code that uses special features and
instructions of the DSPs.
Trademarks
TMS320, TMS320C5000, TMS320C55x, and C55x are trademarks of
Texas Instruments.
Trademarks are the property of their respective owners.
Related Documentation From Texas Instruments / Trademarks
Contents
5
Contents
1 Introduction to the DMA Controller 10. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1.1 Key Features of the DMA Controller 10. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1.2 Block Diagram of the DMA Controller 10. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1.3 DMA Requests Versus CPU Requests for Internal Memory 11. . . . . . . . . . . . . . . . . . . . . . .
2 Channels and Port Accesses 12. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3 Channel Auto-initialization Capability 14. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.1 Auto-initialization with Unchanging Context 17. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.2 Auto-initialization with Changing Context 18. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4 Service Chain 19. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4.1 Service Chain Example 20. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5 Units of Data: Byte, Element, Frame, and Block 22. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6 Start Addresses in a Channel 23. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.1 Start Address in Memory 23. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.2 Start Address in I/O Space 24. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
7 Updating Addresses in a Channel 25. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
8 Data Burst Capability 26. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
9 Data Packing 27. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
10 Write Posting: Buffering Writes to Internal Memory 29. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
11 Synchronizing Channel Activity to an Event 30. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
11.1 Checking the Synchronization Status 31. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
11.2 Dropped Synchronization Event 31. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
12 Monitoring Channel Activity 32. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
12.1 Channel Interrupt 33. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
12.2 Time-Out Error Condition 34. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
12.3 Address Error Condition 34. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
12.4 Bus Error Interrupt 35. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
13 Latency in DMA Transfers 36. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Contents
6
14 Power, Emulation, and Reset Considerations 37. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
14.1 Reducing Power Consumed by the DMA Controller (Idle Configurations) 37. . . . . . . . . . . .
14.2 Emulation Modes of the DMA Controller 37. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
14.3 DMA Controller after DSP Reset 37. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
15 DMA Controller Registers 38. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
15.1 Global Control Register (DMAGCR) 39. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
15.2 Global Time-Out Control Register (DMAGTCR) 40. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
15.3 Channel Control Register (DMACCR) 42. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
15.4 Interrupt Control Register (DMACICR) and Status Register (DMACSR) 49. . . . . . . . . . . . .
15.5 Source and Destination Parameters Register (DMACSDP) 55. . . . . . . . . . . . . . . . . . . . . . . .
15.6 Source Start Address Registers (DMACSSAL and DMACSSAU) 60. . . . . . . . . . . . . . . . . . .
15.7 Destination Start Address Registers (DMACDSAL and DMACDSAU) 61. . . . . . . . . . . . . . .
15.8 Element Number Register (DMACEN) and Frame Number Register (DMACFN) 62. . . . .
15.9 Element Index Registers (DMACSEI, DMACDEI) and Frame Index Registers
(DMACSFI, DMACDFI) 64. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
15.10 Source Address Counter (DMACSAC) and
Destination Address Counter (DMACDAC) 67. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Revision History 69. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Figures
7Contents
Figures
1 Conceptual Block Diagram of the DMA Controller Connections 11. . . . . . . . . . . . . . . . . . . . . . .
2 The Two Parts of a DMA Transfer 12. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3 Registers for Controlling a Channel’s Context 13. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4 Channel Control Register (DMACCR) 14. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5 Auto-initialization Sequence with Unchanging Context (REPEAT = 1) 17. . . . . . . . . . . . . . . . .
6 Auto-initialization Sequence with Changing Context (REPEAT = 0) 18. . . . . . . . . . . . . . . . . .
7 One Possible Configuration for the Service Chains 19. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
8 Service Chain Applied to Three DMA Ports 21. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
9 High-Level Memory Map for TMS320C55x DSPs 24. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
10 High-Level I/O Map for TMS320C55x DSPs 25. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
11 Triggering a Channel Interrupt Request 33. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
12 Global Control Register (DMAGCR) 39. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
13 Global Time-Out Control Register (DMAGTCR) 40. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
14 Channel Control Register (DMACCR) 42. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
15 Interrupt Control Register (DMACICR) and Status Register (DMACSR) 50. . . . . . . . . . . . . . .
16 Source and Destination Parameters Register (DMACSDP) 56. . . . . . . . . . . . . . . . . . . . . . . . . .
17 Source Start Address Registers (DMACSSAL and DMACSSAU) 60. . . . . . . . . . . . . . . . . . . . .
18 Destination Start Address Registers (DMACDSAL and DMACDSAU) 62. . . . . . . . . . . . . . . . .
19 Element Number Register (DMACEN) and
Frame Number Register (DMACFN) 63. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
20 Element Index Registers (DMACSEI, DMACDEI) and
Frame Index Registers (DMACSFI, DMACDFI) 66. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
21 Channel Source Address Counter (DMACSAC) and
Channel Destination Address Counter (DMACDAC) 67. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Tables
8
Tables
1 Event and Non-Event Driven Ports 12. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2 Channel Control Register (DMACCR) Field Descriptions 15. . . . . . . . . . . . . . . . . . . . . . . . . . .
3 Activity Shown in Figure 8 20. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4 Registers Used to Define the Start Addresses for a DMA Transfer 23. . . . . . . . . . . . . . . . . . . .
5 Data Packing Performed by the DMA Controller 27. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6 32-bit Data Packing Conditions 28. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
7 16-bit Data Packing Conditions 28. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
8 Event and Non-Event Driven Ports 30. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
9 DMA Controller Operational Events and Their Associated Bits and Interrupts 32. . . . . . . . . .
10 Registers of the DMA Controller 38. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
11 DMAGCR Bit Field Descriptions 40. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
12 DMAGTCR Bit Field Descriptions 41. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
13 DMACCR Bit Field Descriptions 43. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
14 Synchronization Event Mapping for the TMS320VC5501/5502 DSPs 48. . . . . . . . . . . . . . . . .
15 DMACICR Bit Field Descriptions 50. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
16 DMACSR Bit Field Descriptions 53. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
17 DMACSDP Bit Field Descriptions 56. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
18 DMACSSAL Bit Field Description 61. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
19 DMACSSAU Bit Field Description 61. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
20 DMACDSAL Bit Field Description 62. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
21 DMACDSAU Bit Field Description 62. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
22 DMACEN Bit Field Description 63. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
23 DMACFN Bit Field Description 63. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
24 DMACSEI Bit Field Description 66. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
25 DMACSFI Bit Field Description 66. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
26 DMACDEI Bit Field Description 67. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
27 DMACDFI Bit Field Description 67. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
28 DMACSAC Bit Field Description 67. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
29 DMACDAC Bit Field Description 67. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
30 Document Revision History 69. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
9
DMA Controller
This document describes the direct memory access (DMA) controller of the
TMS320VC5501/TMS320VC5502 digital signal processors (DSPs). This
DMA controller allows movement of data among internal memory, external
memory, and peripherals to occur without intervention from the CPU and in the
background of CPU operation.
Introduction to the DMA Controller
DMA Controller10 SPRU613G
1 Introduction to the DMA Controller
Acting in the background of CPU operation, the DMA controller can transfer
data among internal memory, external memory, and on-chip peripherals.
1.1 Key Features of the DMA Controller
The DMA controller has the following important features:
- Operation that is independent of the CPU.
- Four standard ports: Two for internal dual-access RAM (DARAM), one for
external memory, and one for peripherals.
- Six channels, which allow the DMA controller to keep track of the context
of six independent block transfers among the standard ports.
- Bits for assigning each channel a low priority or a high priority. For details,
see Service Chain on page 19.
- Event synchronization. DMA transfers in each channel can be made
dependent on the occurrence of selected events. For details, see
Synchronizing Channel Activity on page 30.
- An interrupt for each channel. Each channel can send an interrupt to the
CPU on completion of certain operational events. See Monitoring Channel
Activity on page 32.
- Software-selectable options for updating addresses for the sources and
destinations of data transfers.
- A dedicated idle domain. You can put the DMA controller into a low-power
state by turning off this domain. Each multichannel buffered serial port
(McBSP) on the C55x DSP has the ability to temporarily take the DMA
domain out of this idle state when the McBSP needs the DMA controller.
To read about the registers used to program the DMA controller, see section
15 on page 38.
1.2 Block Diagram of the DMA Controller
Figure 1 is a conceptual diagram of connections between the DMA controller
and other parts of the DSP. The DMA controller has four ports:
- Two ports for internal dual-access RAM (DARAM). For ease of reference,
these ports are called internal memory port 0 and internal memory port 1
throughout this document.
- One port for external memory. The external memory interface (EMIF)
connects the port to the external memory.
- One port for peripherals. A peripheral bus controller connects the port to
the peripherals.
Introduction to the DMA Controller
11DMA ControllerSPRU613G
Data transfers among the ports occur in the six DMA channels. (The DMA
channels are described on page 12.) It is possible for multiple channels to
request access to the same port at the same time. To arbitrate simultaneous
requests, the DMA controller has one programmable service chain that is used
by each of the ports. For details on the service chain, see page 19.
Figure 1. Conceptual Block Diagram of the DMA Controller Connections
TMS320VC5501/5502 DSP
DMA controller
EMIF
Peripheral
bus
controller
DARAM
External memory
Peripherals
Port
Port
PortPort
Port
Channels
0-5
1.3 DMA Requests Versus CPU Requests for Internal Memory
If the CPU and the DMA controller simultaneously request access to the same
DARAM block in internal memory, CPU requests always have priority over
DMA requests. The DMA requests to a DARAM block will be serviced when
there are no more CPU requests. Refer to the device-specific data manual for
specific information on the start and end addresses for each DARAM block.
Channels and Port Accesses
DMA Controller12 SPRU613G
2 Channels and Port Accesses
The DMA controller has six paths, called channels, to transfer data among the
four ports (two for DARAM, one for external memory, and one for peripherals).
Each channel reads data from one port (from the source) and writes data to
that same port or another port (to the destination).
Each channel has a first in, first out (FIFO) buffer that allows the data transfer
to occur in two stages (see Figure 2):
Port read access Transfer of data from the source port to the channel
FIFO buffer.
Port write access Transfer of data from the channel FIFO buffer to the
destination port.
The FIFO buffer in each channel is eight 32-bit words deep.
Figure 2. The Two Parts of a DMA Transfer
n = 0, 1, 2, 3, 4, or 5
Source
port
Destination
port
Channel n
FIFO buffer
Read access Write access
The different ports in the DMA can be categorized as event driven and
non−event driven (see Table 1). This difference between ports is significant
when synchronization is used to transfer data, as described in section 11, page
30.
Table 1. Event and Non-Event Driven Ports
Port Category
DARAM Non-event driven
External memory Non-event driven
Peripheral
Event driven
Channels and Port Accesses
13DMA ControllerSPRU613G
The set of conditions under which transfers occur in a channel is called the
channel context. Each of the six channels contains a register structure for
programming and updating the channel context (see Figure 3). Your code
modifies the configuration registers. When it is time for data transferring, the
contents of the configuration registers are copied to the working registers, and
the DMA controller uses the working register values to control channel activity.
The copy from the configuration registers to the working registers occurs
whenever your code enables the channel (EN = 1 in DMACCR). In addition,
if the auto-initialization mode is on (AUTOINIT = 1 in DMACCR), the copy
occurs between block transfers. For more information about the DMA
controller registers, see page 38.
Some configuration registers can be programmed for the next block transfer
while the DMA is still running the current context from the working registers.
The next transfer will use the new configuration without stopping the DMA. The
configuration registers that should not be configured in this manner are
DMAGCR, DMAGTCR, DMACSDP, DMACCR, DMACICR and DMACSR.
Modification of these registers while the DMA channel is running may cause
unpredictable operation of the channel.
Figure 3. Registers for Controlling a Channel’s Context
DMACSDP
DMACCR
DMACICR
DMACSR
DMACSSAL
DMACSSAU
DMACDSAL
DMACDSAU
DMACEN
DMACFN
Configuration registers
(programmed by code)
DMACSDP copy
DMACCR copy
DMACICR copy
DMACSR copy
DMACSSAL copy
DMACSSAU copy
DMACDSAL copy
DMACDSAU copy
DMACEN copy
DMACFN copy
Working registers
(used by DMA controller)
Automatically copied
when channel enabled,
and between block transfers
in auto-initialization mode
DMACSFI
DMACSEI
DMACDEI
DMACDFI
DMACSAC
DMACDAC
DMACSFI copy
DMACSEI copy
DMACDEI copy
DMACDFI copy
DMACSAC copy
DMACDAC copy
Channel Auto-initialization Capability
DMA Controller14 SPRU613G
3 Channel Auto-initialization Capability
After a block transfer is completed (all of the elements and frames in a block
have been moved), the DMA controller automatically disables the channel. If
it is necessary for the channel to be used again, the CPU can reprogram the
new channel context and re-enable the DMA channel, or the DMA controller
can automatically initialize the new context and re-enable the channel.
When auto-initialization is used, after each block transfer is completed, the
DMA controller automatically recopies the channel context from the
configuration registers to the working registers and re-enables the channel
allowing the channel to run again. Auto-initialization is enabled by setting the
AUTOINIT bit in the channel controller register (DMACCR).
Two additional bits in DMACCR, REPEAT and ENDPROG, are used during
the auto-initialization operation. REPEAT controls whether the DMA controller
waits for an indication from the CPU that the configuration registers are ready
to be copied. ENDPROG is a handshaking bit used to communicate between
the CPU and the DMA controller regarding the state of the register copy
process. Figure 4 shows DMACCR and Table 2 describes AUTOINIT,
REPEAT, and ENDPROG. For a complete description of DMACCR, see
section 15.3.
There are two methods for using auto-initialization. The same channel context
can be repeated on each block transfer, or a new context can be provided for
each transfer. These two cases are explained in the following sections.
Figure 4. Channel Control Register (DMACCR)
15 14 13 12 11 10 9 8
ENDPROG REPEAT AUTOINIT
R/W-0 R/W-0 R/W-0
76543210
Legend: R = Read; W = Write; -n = Value after DSP reset
Channel Auto-initialization Capability
15DMA ControllerSPRU613G
Table 2. Channel Control Register (DMACCR) Field Descriptions
Bit Field Value Description
11 ENDPROG
End-of-programming bit. Each DMA channel has two sets of registers:
configuration registers and working registers. When block transfers occur
repeatedly because of auto-initialization (AUTOINIT = 1), you can change the
context for the next DMA transfer by writing to the configuration registers
during the current block transfer. At the end of the current transfer, the contents
of the configuration registers are copied into the working registers, and the
DMA controller begins the next transfer using the new context. For proper
auto-initialization, the CPU must finish programming the configuration
registers before the DMA controller copies their contents.
The DMA controller automatically clears the ENDPROG bit after copying the
configuration registers to the working registers. The CPU can then program the
DMA channel context for the next iteration of the transfer by programming the
configuration registers.
To make sure auto-initialization waits for the CPU, follow this procedure:
1) Make auto-initialization wait for ENDPROG = 1 by clearing the REPEAT
bit (REPEAT = 0)
2) Poll for ENDPROG = 0, which indicates that the DMA controller has
finished copying the previous context. The configuration registers can
now be programmed for the next iteration.
3) Program the configuration registers.
4) Set ENDPROG (ENDPROG = 1) to indicate the end of register
programming.
0 Configuration registers ready for programming / Programming in progress.
1 End of programming.
9
REPEAT
Repeat condition bit. If auto-initialization is selected for a channel
(AUTOINIT = 1), REPEAT specifies one of two special repeat conditions:
0 Repeat only if ENDPROG = 1.
Once the current DMA transfer is complete, auto-initialization will wait for the
end-of-programming bit (ENDPROG) bit to be set.
1 Repeat regardless of ENDPROG.
Once the current DMA transfer is complete, auto-initialization occurs
regardless of whether ENDPROG is 0 or 1.
Channel Auto-initialization Capability
DMA Controller16 SPRU613G
Table 2. Channel Control Register (DMACCR) Field Descriptions (Continued)
Bit DescriptionValueField
8 AUTOINIT Auto-initialization bit. The DMA controller supports auto-initialization, which is
the automatic reinitialization of the channel between DMA block transfers. Use
AUTOINIT to enable or disable this feature.
0 Auto-initialization is disabled.
Activity in the channel stops at the end of the current block transfer. To stop a
transfer immediately, clear the channel enable bit (EN).
1 Auto-initialization is enabled.
Once the current block transfer is complete, the DMA controller reinitializes the
channel and starts a new block transfer. To stop activity in the channel you have
two options:
- To stop activity immediately, clear the channel enable bit (EN = 0).
- To stop activity after the current block transfer, clear AUTOINIT
(AUTOINIT= 0).
Channel Auto-initialization Capability
17DMA ControllerSPRU613G
3.1 Auto-initialization with Unchanging Context
If the desired context for the channel needs to be repeated but does not need
to be changed, then the DMA controller is configured with AUTOINIT = 1 and
REPEAT = 1. When REPEAT = 1, the DMA controller ignores the state of the
ENDPROG handshaking bit. After the CPU has initially configured the DMA
channel, no other CPU intervention is required to keep the channel running.
A detailed sequence of events in this mode is shown in Figure 5.
Figure 5. Auto-initialization Sequence with Unchanging Context (REPEAT = 1)
The CPU programs
desired channel context
into the configuration
registers
The CPU sets AUTOINIT=1
and REPEAT=1 to select
the correct auto-initialization
mode
The CPU sets EN=1 to
enable the DMA channel
The DMA controller
transfers the block of data
according to the channel
context
When the block transfer is
complete, the DMA disables
the channel (EN = 0) and
recopies the configuration
registers to the working
registers.
The DMA controller
reenables the channel
(EN = 1)
Channel Auto-initialization Capability
DMA Controller18 SPRU613G
3.2 Auto-initialization with Changing Context
If the desired context for the channel needs to be repeated and is not the same
on each block transfer, then the DMA controller must be configured with
AUTOINIT = 1 and REPEAT = 0. When REPEAT = 0, the DMA controller
waits for the CPU to write ENDPROG = 1 before it copies the configuration
registers. This provides handshaking for the DMA to prevent it from copying
the registers while they are still being configured by the CPU. A detailed
sequence of events in this mode is shown in Figure 6.
Figure 6. Auto-initialization Sequence with Changing Context (REPEAT = 0)
The CPU sets AUTOINIT=1 and
clears REPEAT= 0 to select the
correct auto-initialization mode
The CPU programs the desired
channel context for the first block
transfer into the configuration
registers and enables the channel
(EN = 1)
The CPU sets ENDPROG = 1 to
indicate it is finished programming
the configuration registers.
The DMA controller copies
the configuration registers to
the working registers
The DMA controller clears
ENDPROG = 0 to indicate it
is finished copying the
configuration registers and
they are available to be
reprogrammmed by the CPU.
The DMA controller enables
the channel and transfers
the block of data according
to the channel context.
ENDPROG = 0 after reset
CPU Polls for
ENDPROG = 0
?
The CPU programs the desired
channel context for the next block
transfer into the configuration
registers.
DMA waits for
ENDPROG = 1
?
Yes
No
No
Yes
When the block transfer is
complete, the DMA disables
the channel (EN = 0).
Handshaking
Using ENDPROG
Service Chain
19DMA ControllerSPRU613G
4 Service Chain
Each of the ports of the DMA controller can arbitrate simultaneous access
requests sent by the six DMA channels. Each of the ports has an
independently functioning service chain—a software- and
hardware-controlled scheme for servicing access requests. Although the four
service chains function independently, they share a common configuration.
For example, if you disable channel 2, it is disabled in all four ports, and if you
make channel 4 high-priority, it is high-priority in all four of the ports. One
possible configuration for the service chains is shown in Figure 7. Important
characteristics of the service chain are listed after the figure.
Section 4.1 contains an example that shows a service chain configuration
applied to three ports.
Figure 7. One Possible Configuration for the Service Chains
Channel
0
High Priority
Channel
1
Low Priority
Channel
2
High Priority
Channel
3
Low Priority
Channel
4
Low Priority
Channel
5
High Priority
- The channels have a programmable priority level. Each channel has a
PRIO bit in DMACCR for selecting a high priority or a low priority. The DMA
controller only services the low-priority items when all the high-priority
items are done or stalled. After a DSP reset, all channels are low priority.
In the figure, channels 0, 2, and 5 are high-priority (in each of these
channels, PRIO = 1). DMA channels 1, 3, and 4 are low priority (in each of
these channels, PRIO = 0).
- The channels have fixed positions in the service chain. Regardless of the
programmed priorities, the port checks the channels in a repeating circular
sequence: 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, and so on. At each position in the
service chain, the port checks whether the channel is ready and able to
be serviced. If so, it is serviced; otherwise, the port skips to the next
position. After a DSP reset, the port restarts its circular sequence,
beginning with channel 0.
Service Chain
DMA Controller20 SPRU613G
-
The channels can be individually connected or disconnected from the
service chain through software. If a channel is enabled (EN = 1 in
DMACCR), it is connected to the service chain; if it is disabled (EN = 0),
it is disconnected. After a DSP reset, all channels are disconnected.
In the figure, only channel 1 is disconnected. As a port checks the
channels in its repeating circular sequence, it will keep skipping channel 1
until the channel is reconnected.
- If a channel is tied to a synchronization event, the channel does not
generate a DMA request (and, therefore, cannot be serviced) until the
synchronization event occurs.
4.1 Service Chain Example
Figure 8 shows a DMA service chain applied to a DARAM port, the external
memory port, and the peripheral port. The service chain has the following
programmed characteristics.
- Channels 0, 2, and 5 are high-priority (PRIO = 1 in DMACCR). Channels
1, 3, and 4 are low-priority (PRIO = 0).
- Channels 1, 2, and 4 are enabled (EN = 1 in DMACCR). Channels 0, 3,
and 5 are disabled (EN = 0).
Table 3 summarizes the activity at the ports in the figure.
Table 3. Activity Shown in Figure 8
Port This Port Arbitrates …
DARAM Write access requests from channel 2
Read access requests from channel 4
External memory Write access requests from channel 1
Write access requests from channel 4
Peripheral Read access requests from channel 1
Read access requests from channel 2
Finally, notice that for each port in the figure, there is a channel that is
connected to the service chain but does not use the port. For example, the
peripheral port is not used by channel 4. If channel 4 were redefined to include
the peripheral port as source or destination, the port would handle channel 4
according to its position and priority in the service chain.
  • Page 1 1
  • Page 2 2
  • Page 3 3
  • Page 4 4
  • Page 5 5
  • Page 6 6
  • Page 7 7
  • Page 8 8
  • Page 9 9
  • Page 10 10
  • Page 11 11
  • Page 12 12
  • Page 13 13
  • Page 14 14
  • Page 15 15
  • Page 16 16
  • Page 17 17
  • Page 18 18
  • Page 19 19
  • Page 20 20
  • Page 21 21
  • Page 22 22
  • Page 23 23
  • Page 24 24
  • Page 25 25
  • Page 26 26
  • Page 27 27
  • Page 28 28
  • Page 29 29
  • Page 30 30
  • Page 31 31
  • Page 32 32
  • Page 33 33
  • Page 34 34
  • Page 35 35
  • Page 36 36
  • Page 37 37
  • Page 38 38
  • Page 39 39
  • Page 40 40
  • Page 41 41
  • Page 42 42
  • Page 43 43
  • Page 44 44
  • Page 45 45
  • Page 46 46
  • Page 47 47
  • Page 48 48
  • Page 49 49
  • Page 50 50
  • Page 51 51
  • Page 52 52
  • Page 53 53
  • Page 54 54
  • Page 55 55
  • Page 56 56
  • Page 57 57
  • Page 58 58
  • Page 59 59
  • Page 60 60
  • Page 61 61
  • Page 62 62
  • Page 63 63
  • Page 64 64
  • Page 65 65
  • Page 66 66
  • Page 67 67
  • Page 68 68
  • Page 69 69
  • Page 70 70
  • Page 71 71
  • Page 72 72
  • Page 73 73
  • Page 74 74
  • Page 75 75

Texas Instruments TMS320VC5501/5502 DSP Direct Memory Access (DMA) Controller (Rev. G) User guide

Category
Motherboards
Type
User guide

Ask a question and I''ll find the answer in the document

Finding information in a document is now easier with AI