Analog Devices, Inc. reserves the right to change this product without
prior notice. Information furnished by Analog Devices is believed to be
accurate and reliable. However, no responsibility is assumed by Analog
Devices for its use; nor for any infringement of patents or other rights of
third parties which may result from its use. No license is granted by implication or otherwise under the patent rights of Analog Devices, Inc.
Trademark and Service Mark Notice
The Analog Devices logo, Blackfin, EZ-KIT Lite, SHARC, TigerSHARC,
and VisualDSP++ are registered trademarks of Analog Devices, Inc.
All other brand and product names are trademarks or service marks of
their respective owners.
Contents
PREFACE
Purpose of This Manual ............................................................... xliii
Thank you for purchasing and developing systems using ADSP-21367/8/9
and ADSP-21371/75 SHARC® processors from Analog Devices, Inc.
Purpose of This Manual
The ADSP-2137x SHARC Processor Hardware Reference contains informa-
tion about the peripheral set and I/O properties for the ADSP-21367/8/9
and ADSP-2137x processors. These are 32-bit, fixed- and floating-point
digital signal processors from Analog Devices for use in computing, communications, and consumer applications.
The manual provides information on the processor’s I/O architecture and
the operation of the peripherals associated with each model.
Intended Audience
The primary audience for this manual is a programmer who is familiar
with Analog Devices processors. This manual assumes that the audience
has a working knowledge of the appropriate processor architecture and
instruction set. Programmers who are unfamiliar with Analog Devices
processors can use this manual, but should supplement it with other texts
(such as the appropriate hardware reference manuals and data sheets) that
describe your target architecture.
•Chapter 1, “Introduction”
Provides an architectural overview of the ADSP-21367/8/9 and
ADSP-2137/75 SHARC processors.
•Chapter 2, “I/O Processor”
Describes the input/output processor architecture, and provides
direct memory access (DMA) procedures for the processor
peripherals.
•Chapter 3, “External Port”
Describes how the processor’s on-chip DMA controller acts as a
machine for transferring data without core interruption.
•Chapter 4, “Memory-to-Memory Port DMA”
The memory-to-memory port DMA module is used for internal
memory transfers only.
•Chapter 5, “Pulse Width Modulation”
Describes the implementation and use of the pulse width modulation module which provides a technique for controlling analog
circuits with the microprocessor’s digital outputs.
•Chapter 6, “Digital Application/Digital Peripheral Interfaces”
Provides information about the digital audio interface (DAI) which
allows you to attach an arbitrary number and variety of peripherals
to the processor while retaining high levels of compatibility.
•Chapter 7, “Serial Ports”
Describes the up to eight dual data line serial ports. Each SPORT
contains a clock, a frame sync, and two data lines that can be configured as either a receiver or transmitter pair.
xlivADSP-2137x SHARC Processor Hardware Reference
Preface
•Chapter 8, “Input Data Port”
Discusses the function of the input data port (IDP) which provides
a low overhead method of routing signal routing unit (SRU) signals back to the core’s memory.
•Chapter 9, “Asynchronous Sample Rate Converter”
Provides information on the sample rate converter (SRC) module.
This module performs synchronous or asynchronous sample rate
conversion across independent stereo channels, without using any
internal processor resources.
•Chapter 10, “Sony/Philips Digital Interface”
Provides information on the use of the Sony/Philips Digital Interface which is a standard audio file transfer format that allows the
transfer of digital audio signals from one device to another without
having to be converted to an analog signal.
•Chapter 11, “Precision Clock Generator”
Details the precision clock generators (PCG), each of which generates a pair of signals derived from a clock input signal.
•Chapter 12, “Serial Peripheral Interface Ports”
Describes the operation of the serial peripheral interface (SPI) port.
SPI devices communicate using a master-slave relationship and can
achieve high data transfer rate because they can operate in
full-duplex mode.
•Chapter 13, “Peripheral Timers”
In addition to the internal core timer, the processors contain identical 32-bit peripheral timers that can be used to interface with
external devices.
•Chapter 14, “UART Port Controller”
Describes the operation of the Universal Asynchronous
Receiver/Transmitter (UART) which is a full-duplex peripheral
compatible with PC-style industry-standard UART.
ADSP-2137x SHARC Processor Hardware Referencexlv
Manual Contents
•Chapter 15, “Two Wire Interface Controller”
The two wire interface is fully compatible with the widely used I
bus standard. It is designed with a high level of functionality and is
compatible with multimaster, multislave bus configurations.
•Chapter 16, “Power Management”
Contains information on managing the clock, PLL and the peripherals in order to maximize system efficiency with minimum power
consumption.
•Chapter 17, “System Design”
Describes system design features of the SHARC processors. These,
include resetting and booting the processor, as well as pin descriptions and other system-level information.
•Appendix A, “Registers Reference”
Provides a graphical presentation of all registers and describes the
bit usage in each register.
•Appendix B “Peripheral Interrupt Control”
Provides a complete listing of the registers that are used to configure and control interrupts.
2
C
•Appendix C “Audio Frame Formats”
Provides specific information on all the serial timing protocols used
for audio inter-chip communications.
xlviADSP-2137x SHARC Processor Hardware Reference
This hardware reference is a companion document to the SHARC Processor Programming Reference. The programming reference provides information relating to the processor core, such as processing
elements, internal memory, and program sequencing. It also provides programming specific information, such as complete
descriptions of the ADSP-21xxx instruction set and the compute
operations, including their assembly language syntax and opcode
fields.
What’s New in This Manual
This is the second edition (Revision 2.1) of this hardware reference. In
previous revisions, this manual was titled ADSP-21368 SHARC Processor Hardware Reference. In order to avoid confusion, this manual has been
retitled ADSP-2137x SHARC Processor Hardware Reference.
All chapters of this document have been revised to correct errors (not
reported through the errata system), to remove redundant information,
and to reorganize information so that it is presented logically and
consistently.
Where appropriate, the chapters contain the following information, presented in this order:
•Primary features
•Hardware interface (pins)
Preface
•Primary registers used by this peripheral
•Peripheral clocking
•Basic function of the peripheral
•Basic peripheral operation, including DMA
•Debug features
•Effect latency
•Programming model (illustrates programming sequences)
The following additional changes should be noted.
•All document errata for this manual has been corrected.
•New sections that deal more extensively with DMA have been
added. See “Scatter/Gather DMA (ADSP-2137x)” on page 3-76,
and “Interrupts” on page 3-85, and “Standard DMA Parameter
Registers” on page 2-3.
•A new table has been created and placed at the beginning of each
chapter that provides a list of the primary features contained in that
peripheral. This is intended to provide an “at-a-glance” summary
so that you may quickly decide whether this module is desirable for
your particular design.
•“Register Listing” on page A-181 provides a listing of all registers
that are user accessible for the products described in this manual
and includes the register mnemonic, address, description, and reset
state.
Technical or Customer Support
You can reach Analog Devices, Inc. Customer Support in the following
ways:
•Visit the Embedded Processing and DSP products Web site at
Analog Devices, Inc.
One Technology Way
P.O. Box 9106
Norwood, MA 02062-9106
USA
Registration for MyAnalog.com
MyAnalog.com is a free feature of the Analog Devices Web site that allows
customization of a Web page to display only the latest information about
products you are interested in. Click Register to use this site. Registration
takes about five minutes and serves as a means to select the information
you want to receive.
If you are already a registered user, just log on. Your user name is your
e-mail address.
EngineerZone
EngineerZone is a technical support forum from Analog Devices. It allows
you direct access to ADI technical support engineers. You can search
FAQs and technical information to get quick answers to your embedded
processing and DSP design questions.
Use EngineerZone to connect with other DSP developers who face similar
design challenges. You can also use this open forum to share knowledge
and collaborate with the ADI support team and your peers. Visit
http://ez.analog.com to sign up.
ADSP-2137x SHARC Processor Hardware Referencexlix
Supported Processors
Social Networking Web Sites
You can now follow Analog Devices SHARC development on Twitter and
LinkedIn. To access:
•Twitter: http://twitter.com/ADISHARC
•LinkedIn: Network with the LinkedIn group, Analog Devices
SHARC:
http://www.linkedin.com
Supported Processors
The name SHARC refers to a family of high-performance, 32-bit,
floating-point processors that can be used in speech, sound, graphics, and
imaging applications. VisualDSP++® currently supports the following
SHARC families:
ADSP-2106x, ADSP-2116x, ADSP-2126x, ADSP-2136x, ADSP-2137x,
ADSP-2146x, ADSP-2147x and ADSP-2148x.
Product Information
Product information can be obtained from the Analog Devices Web site,
VisualDSP++ online Help system, and a technical library CD.
Analog Devices Web Site
The Analog Devices Web site, www.analog.com, provides information
about a broad range of products—analog integrated circuits, amplifiers,
converters, and digital signal processors.
To access a complete technical library for each processor family, go to
http://www.analog.com/processors/technical_library. The manuals
selection opens a list of current manuals related to the product as well as a
lADSP-2137x SHARC Processor Hardware Reference
Preface
link to the previous revisions of the manuals. When locating your manual
title, note a possible errata check mark next to the title that leads to the
current correction report against the manual.
Also note,
MyAnalog.com is a free feature of the Analog Devices Web site
that allows customization of a Web page to display only the latest information on products you are interested in. You can also choose to receive
weekly e-mail notifications containing updates to the Web pages that meet
your interests, including documentation errata against all manuals.
MyAnalog.com provides access to books, application notes, data sheets,
code examples, and more.
Visit www.myanalog.com to sign up. If you are already a registered user, just
log on. Your user name is your e-mail address.
VisualDSP++ Online Documentation
Online documentation comprises the VisualDSP++ Help system, software
tools manuals, hardware tools manuals, processor manuals, Dinkum
Abridged C++ library, and FLEXnet License Tools software
documentation. You can easily search across the entire VisualDSP++ documentation set for any topic of interest.
For easy printing, supplementary Portable Documentation Format (.pdf)
files for all manuals are provided on the VisualDSP++ installation CD.
Each documentation file type is described as follows.
File Description
.chmHelp system files and manuals in Microsoft Help format
.htm or
.html
.pdfVisualDSP++ and processor manuals in PDF format. Viewing and printing the
Dinkum Abridged C++ library and FLEXnet License Tools software documentation. Viewing and printing the .html files requires a browser, such as Internet
Explorer 6.0 (or higher).
.pdf files requires a PDF reader, such as Adobe Acrobat Reader (4.0 or higher).
ADSP-2137x SHARC Processor Hardware Referenceli
Notation Conventions
Technical Library CD
The technical library CD contains seminar materials, product highlights, a
selection guide, and documentation files of processor manuals,
VisualDSP++ software manuals, and hardware tools manuals for the following processor families: Blackfin®, SHARC, TigerSHARC®,
ADSP-218x, and ADSP-219x.
To order the technical library CD, go to http://www.analog.com/proces-
sors/manuals
request CD check mark, and fill out the order form.
Data sheets, which can be downloaded from the Analog Devices Web site,
change rapidly, and therefore are not included on the technical library
CD. Technical manuals change periodically. Check the Web site for the
latest manual revisions and associated documentation errata.
, navigate to the manuals page for your processor, click the
Notation Conventions
Text conventions used in this manual are identified and described as follows. Note that additional conventions, which apply only to specific
chapters, may appear throughout this document.
ExampleDescription
Close command
(File menu)
{this | that} Alternative items in syntax descriptions appear within curly brackets and sepa-
[this | that] Optional items in syntax descriptions appear within brackets and separated by
[this,…]Optional item lists in syntax descriptions appear within brackets delimited by
liiADSP-2137x SHARC Processor Hardware Reference
Titles in reference sections indicate the location of an item within the VisualDSP++ environment’s menu system (for example, the Close command
appears on the File menu).
rated by vertical bars; read the example as
required.
vertical bars; read the example as an optional
commas and terminated with an ellipse; read the example as an optional
comma-separated list of
this.
this or that. One or the other is
this or that.
Preface
ExampleDescription
.SECTIONCommands, directives, keywords, and feature names are in text with letter
gothic font.
filenameNon-keyword placeholders appear in text with italic style format.
Note: For correct operation, ...
A Note: provides supplementary information on a related topic. In the online
version of this book, the word Note appears instead of this symbol.
Caution: Incorrect device operation may result if ...
Caution: Device damage may result if ...
A Caution: identifies conditions or inappropriate usage of the product that
could lead to undesirable results or product damage. In the online version of
this book, the word Caution appears instead of this symbol.
War ni ng : Injury to device users may result if ...
A Warning: identifies conditions or inappropriate usage of the product that
could lead to conditions that are potentially hazardous for devices users. In the
online version of this book, the word War ni ng appears instead of this symbol.
ADSP-2137x SHARC Processor Hardware Referenceliii
Notation Conventions
livADSP-2137x SHARC Processor Hardware Reference
1INTRODUCTION
The ADSP-21367/8/9 and ADSP-21371/75 SHARC processors are high
performance 32-bit processors used for high quality audio, medical imaging, communications, military, test equipment, 3D graphics, speech
recognition, motor control, imaging, and other applications. By adding
on-chip SRAM, integrated I/O peripherals, and an additional processing
element for single-instruction, multiple-data (SIMD) support, this processor builds on the ADSP-21000 family DSP core to form a complete
system-on-a-chip.
Design Advantages
A digital signal processor’s data format determines its ability to handle signals of differing precision, dynamic range, and signal-to-noise ratios.
Because floating-point DSP math reduces the need for scaling and the
probability of overflow, using a floating-point processor can simplify algorithm and software development. The extent to which this is true depends
on the floating-point processor’s architecture. Consistency with IEEE
workstation simulations and the elimination of scaling are clearly two
ease-of-use advantages. High level language programmability, large
address spaces, and wide dynamic range allow system development time to
be spent on algorithms and signal processing concerns, rather than assembly language coding, code paging, and/or error handling. The SHARC
processors are highly integrated, 32-bit floating-point processor which
provides all of these design advantages.
ADSP-2137x SHARC Processor Hardware Reference1-1
Design Advantages
SHARC Family Product Offerings
Table 1-1 provides information on the products covered in this manual.
Note that some models are available for automotive applications with controlled manufacturing. These special models may have specifications that
differ from the general release models. For information on which models
are available as automotive, see the product specific data sheet.
Table 1-1. SHARC Processor Family Features
Feature
RAM2M bit1M bit0.5M bit
ROM6M bit4M bit2M bit
Audio Decoders
in ROM
Serial Ports84
UART21
Pulse Width
Modulation
S/PDIFYesNo
Shared MemoryNoYesNo
SRC
Per formance
Package Option
Processor Speed400 MHz266 MHz
1 The ADSP-21367 processor includes a customer-definable ROM block. Please contact your Analog Devic-
2 Audio decoding algorithms include PCM, Dolby Digital EX, PCM, Dolby Digital EX, Dolby Prologic IIx,
3 Analog Devices offers these packages in RoHS compliant versions.
2
es sales representative for additional details.
DTS 96/24, Neo:6, DTS ES, MPEG2 AAC, MPEG2 2channel, MP3, and functions like bass management,
delay, speaker equalization, graphic equalization, and more. Decoder/post-processor algorithm combination support will vary depending upon the chip version and the system configurations. Please visit
www.analog.com/sharc for complete information.
ADSP-21367
128 db140 dB128 dB No SRC No SRC
3
256-ball BGA
208-lead LQFP,
exposed pad
1
ADSP-21368ADSP-21369ADSP-21371ADSP-21375
YesNo
YesNo
256-ball BGA256-ball BGA
208-lead LQFP,
exposed pad
208-lead LQFP, exposed pad
1-2ADSP-2137x SHARC Processor Hardware Reference
Introduction
Processor Architectural Overview
The ADSP-21367/8/9 and ADSP-2137x processors form a complete system-on-a-chip, integrating a large, high speed SRAM and I/O peripherals
supported by a dedicated I/O bus. The following sections summarize the
features of each functional block in the processor architecture.
Processor Core
The processor core contains two processing elements (each with three
computation units and data register file), a program sequencer, two data
address generators, a timer, and an instruction cache. All digital signal
processing occurs in the processor core. For complete information, see the
SHARC Processor Programming Reference.
I/O Peripherals
These peripherals are coupled with the external port and therefore independent from the routing units.
•Asynchronous Memory Interface (AMI)
•SDRAM controller
•Shared Memory controller (ADSP-21368 only)
•4 PWM modules
I/O Processor
The input/output processor (IOP) manages the off-chip data I/O to free
the core from this burden. Up to thirty-four channels of DMA are available on the ADSP-21367/8/9 and ADSP-2137x processors—sixteen via
the serial ports, 8 via the input data port, 4 for the UARTs, 2 for the SPI
interface, 2 for the external port, and 2 for memory-to-memory transfers.
ADSP-2137x SHARC Processor Hardware Reference1-3
Processor Architectural Overview
The I/O processor can perform DMA transfers between the peripherals
and internal memory at the full core clock speed. The architecture of the
internal memory allows the IOP and the core to access internal memory
simultaneously with no reduction in throughput.
Digital Audio Interface (DAI)
The digital audio interface (DAI) unit consists of an interrupt controller, a
signal routing unit, and many peripherals:
•8 or 4 serial ports (SPORT)
•Input Data Port (IDP)
•Four precision clock generators (PCG)
•Some family members have an S/PDIF receiver/transmitter
•Four asynchronous sample rate converters (ASRC)
•DTCP encryption
Interrupt Controller
The DAI contains its own interrupt controller that indicates to the core
when DAI audio events have occurred. This interrupt controller offer 32
independently configurable channels.
Signal Routing Unit
Conceptually similar to a “patch-bay” or multiplexer, the SRU provides a
group of registers that define the interconnection of the DAI peripherals
to the DAI pins or to other DAI peripherals.
1-4ADSP-2137x SHARC Processor Hardware Reference
Introduction
Digital Peripheral Interface (DPI)
The digital audio interface (DPI) unit consists of an interrupt controller, a
signal routing unit, and many peripherals:
•2 serial peripheral interface ports (SPI)
•2 peripheral timers
•1 or 2 UARTs
•1 TWI controller (I
Interrupt Controller
The DPI contains its own interrupt controller that indicates to the core
when DPI audio events have occurred. This interrupt controller offer 12
independently configurable channels.
Signal Routing Unit 2
Conceptually similar to a “patch-bay” or multiplexer, the SRU2 provides a
group of registers that define the interconnection of the DPI peripherals
to the DPI pins or to other DPI peripherals.
2
C compatible)
Development Tools
The processors are supported by VisualDSP++, an easy to use Integrated
Development and Debugging Environment (IDDE). VisualDSP++ allows
you to manage projects from start to finish from within a single, integrated interface. Because the project development and debug
environments are integrated, you can move easily between editing, building, and debugging activities.
ADSP-2137x SHARC Processor Hardware Reference1-5
Differences from Previous Processors
Differences from Previous Processors
This section identifies differences between the ADSP-21367/8/9 and
ADSP-2137x processors and previous SHARC processors: ADSP-21161,
ADSP-21160, ADSP-21060, ADSP-21061, ADSP-21062, and
ADSP-21065L. Like the ADSP-2116x family, the ADSP-2136x SHARC
processor family is based on the original ADSP-2106x SHARC family.
The ADSP-21367/8/9 and ADSP-2137x processors preserve much of the
ADSP-2106x architecture and is code compatible to the ADSP-21160,
while extending performance and functionality. For background
information on SHARC processors and the ADSP-2106x family DSPs, see
the ADSP-2106x SHARC User’s Manual or the ADSP-21065L SHARC DSP Technical Reference.
I/O Architecture Enhancements
The I/O processor provides much greater throughput than the
ADSP-2106x processors. This architecture incorporates two independent
DMA buses versus the previous SHARC DMA controllers:
•one peripheral DMA bus (IOD0)
•one external port DMA bus (IOD1)
This allows to operate all external port DMA accesses independently from
the peripheral busses since up to four internal memory blocks are addressable without any bus conflicts.
1-6ADSP-2137x SHARC Processor Hardware Reference
2I/O PROCESSOR
In applications that use extensive off-chip data I/O, programs may find it
beneficial to use a processor resource other than the processor core to perform data transfers. The SHARC contains an I/O processor (IOP) that
supports a variety of DMA (direct memory access) operations. Each DMA
operation transfers an entire block of data. The I/O processor specifications are shown in Table 2-1.
Table 2-1. I/O Processor Specifications
FeatureAvailability
Total DMA channels34
Rotating DMA channel priorityYes
SPORT DMA channels16
IDP DMA channel8
UART DMA channel4
SPI DMA channel2
MTM/DTCP DMA channel2
External Port DMA channel2
PDAP DMA channel1
DMA channel interrupts16
Clock OperationPeripheral clock (PCLK)
ADSP-2137x SHARC Processor Hardware Reference2-1
Features
Features
I/O processor features are briefly described in the following list.
By managing DMA, the I/O processor frees the processor core, allowing it
to perform other operations while off-chip data I/O occurs as a background task. The multi-bank architecture of the processor’s internal
memory allows the core and IOP to simultaneously access the internal
memory if the accesses are to different memory banks. This means that
DMA transfers to internal memory do not impact core performance. The
processor core continues to perform computations without penalty.
To further increase off-chip I/O, multiple DMAs can occur at the same
time. The IOP accomplishes this by managing multiple DMAs of processor memory through the different peripherals. Each DMA is referred to as
a channel and each channel is configured independently.
Register Overview
Two global IOP registers control the DMA arbitration over the I/O
buses—the first for the peripheral bus and the second for the external port
bus. This section provides brief descriptions of the major IOP registers.
For complete information, see “System Control Register (SYSCTL)” on
page A-4 and “External Port Registers” on page A-11.
2-2ADSP-2137x SHARC Processor Hardware Reference
I/O Processor
System control register (SYSCTL). Controls the peripheral DMA operation for fixed or rotating DMA channel arbitration.
External port control register (EPCTL). Controls the external port DMA
operation for fixed or rotating DMA channel arbitration and between the
core and DMA.
DMA Channel Registers
The following sections provide information on the registers that control
all DMA operations for each peripheral. Additional information on DMA
operations can be found in specific peripheral chapters. Note that all
DMA parameter registers are read-write (RW). For details of the DMA
related registers, see “Register Listing” on page A-181.
DMA Channel Allocation
Each DMA channel has a set of parameter registers which are used to set
up DMA transfers. Table 2-21 on page 2-29 shows the DMA channel
allocation and parameter register assignments for the ADSP-2136x and
ADSP-2137x processors.
DMA channels vary by processor model. For a breakdown of DMA
channels for a particular model, see the appropriate product data
sheet. Also note that each DMA channel has a specific peripheral
assigned to it.
Standard DMA Parameter Registers
The parameter registers described below control the source and destination of the data, the size of the data buffer, and the step size used.
Index registers. Shown in Table 2-2, provide an internal memory address,
acting as a pointer to the next internal memory DMA read or write
ADSP-2137x SHARC Processor Hardware Reference2-3
DMA Channel Registers
location. All internal index addresses are based on an internal memory offset of 0x80000.
Table 2-2. Index Registers
Register NameWidth (Bits) Description
IISP0-7A19SPORTA
IISP0-7B19SPORTB
IISPI19SPI
IISPIB19SPIB
IDP_DMA_I0-719IDP
IDP_DMA_I0-7A19IDP index A (ping pong)
IDP_DMA_I0-7B19IDP index B (ping pong)
IIUART0RX19UART0 Receiver
IIUART1RX19UART1 Receiver
IIUART0TX19UART0 Transmitter
IIUART1TX19UART1 Transmitter
IIMTMW19MTM Write
IIMTMR19MTM Read
IIEP0-119External Port
EIEP0-128External Port (external)
Modify registers. Shown in Table 2-3, provide the signed increment by
which the DMA controller post-modifies the corresponding memory
index register after the DMA read or write.
Table 2-3. Modify Registers
Register NameWidth (Bits) Description
IMSP0-7A16SPORTA
IMSP0-7B16SPORTB
2-4ADSP-2137x SHARC Processor Hardware Reference
Table 2-3. Modify Registers (Cont’d)
Register NameWidth (Bits) Description
IMSPI16SPI
IMSPIB16SPIB
IDP_DMA_M0-76IDP
IDP_DMA_M0-7A6IDP modify A (ping pong)
IDP_DMA_M0-7B6IDP modify B (ping pong)
IMUART0RX16UART0 Receiver
IMUART1RX16UART1 Receiver
IMUART0TX16UART0 Transmitter
IMUART1TX16UART1 Transmitter
IMMTMW16MTM Write
IMMTMR16MTM Read
IMEP0-116External Port
EMEP0-127External Port (external)
I/O Processor
Count registers. Shown in Table 2-4, indicate the number of words
remaining to be transferred to or from memory on the corresponding
DMA channel.
Table 2-4. Count Registers
Register NameWidth (Bits) Description
ICSP0-7A16SPORTA
ICSP0-7B16SPORTB
ICSPI16SPI
ICSPIB16SPIB
IDP_DMA_C0–716IDP
CUART0RX16UART0 Receiver
CUART1RX16UART1 Receiver
ADSP-2137x SHARC Processor Hardware Reference2-5
DMA Channel Registers
Table 2-4. Count Registers (Cont’d)
Register NameWidth (Bits) Description
CUART0TX16UART0 Transmitter
CUART1TX16UART1 Transmitter
ICMTMW16MTM Write
ICMTMR16MTM Read
ICEP0-116External Port
ECEP0-116External Port (external)
Chain pointer registers. Shown in Table 2-5, chain pointer registers hold
the starting address of the TCB (parameter register values) for the next
DMA operation on the corresponding channel. These registers also control whether the I/O processor generates an interrupt when the current
DMA process ends.
Table 2-5. Chain Pointer Registers
Register NameWidth (Bits) Description
CPSP0-7A29SPORTA
CPSP0-7B29SPORTB
CPSPI20SPI
CPSPIB20SPIB
CPUART0RX20UART0 Receiver
CPUART1RX20UART1 Receiver
CPUART0TX20UART0 Transmitter
CPUART1TX20UART1 Transmitter
CPEP0-121External Port
2-6ADSP-2137x SHARC Processor Hardware Reference
I/O Processor
Extended DMA Parameter Registers
This section describes the enhanced parameter registers used for the external port.
Base registers. Shown in Table 2-6, base registers indicate the start
address of the circular buffer to be transferred to/from memory on the corresponding DMA channel.
Table 2-6. Base Registers
Register NameWidth (Bits)Description
EBEP0–128External Port (external base)
Length registers. Shown in Table 2-7, define the length of the circular
buffer to be transferred to/from memory on the corresponding DMA
channel.
Table 2-7. Length Registers
Register NameWidth (Bits)Description
ELEP0–126External Port (external length)
Miscellaneous External Port Parameter registers. Shown in Table 2-8,
these registers are used for the delay line and scatter/gather DMA to read
from tap list buffers, store counters and index pointers.
Table 2-8. Miscellaneous External Port Parameter Registers
Register NameWidth (Bits)Description
RCEP16Delay line DMA read block size
REIP19Delay line DMA read internal index
RMEP27Delay line DMA read external modifier
ADSP-2137x SHARC Processor Hardware Reference2-7
DMA Channel Registers
Table 2-8. Miscellaneous External Port Parameter Registers (Cont’d)
Register NameWidth (Bits)Description
TCEP16Delay line DMA tap list count
TPEP19Delay line DMA tap list pointer
Data Buffers
The data buffers or FIFOs (shown in Table 2-9) are used by each DMA
channel to store data during the priority arbitration time period. The buffers (depending on the peripheral) are accessed by both DMA and the
core. Note that all transmit buffers are write-only-to-clear (WOC) and all
receive buffers are read-only-to-clear (ROC) bit types.
Table 2-9. Data Buffers
Buffer NameFIFO DepthDescription
TXSP0–7A2SPORTA Transmit
TXSP0–7B2SPORTB Transmit
RXSP0–7A2SPORTA Receive
RXSP0–7B2SPORTB Receive
TXSPI2SPI Transmit
TXSPIB2SPIB Transmit
RXSPI2SPI Receive
RXSPIB2SPIB Receive
RXSPI_SHADOW2SPI Receive Shadow (RO)
RXSPIB_SHADOW2SPIB Receive Shadow (RO)
SPI DMA4DMA only
SPIB DMA4DMA only
IDP_FIFO8IDP FIFO Receive
UARTRBR01UART0 Receiver
2-8ADSP-2137x SHARC Processor Hardware Reference
I/O Processor
Table 2-9. Data Buffers (Cont’d)
Buffer NameFIFO DepthDescription
UARTRBR11UART1 Receiver
UARTTHR01UART0 Transmitter
UARTTHR11UART1 Transmitter
MTM read/write 2DMA only
DFEP0–16DMA only
TPEP0–14Delay Line DMA (ADSP-2136x only)
AMIRX1AMI Receive Packer
AMITX1AMI Transmit Packer
TXTWI81 (1 byte)TWI Transmit
TXTWI161 (2 bytes)TWI Transmit
RXTWI81 (1 byte)TWI Receive
RXTWI161 (2 bytes)TWI Receiver
Chain Pointer Registers
The chain pointer registers, described in Table 2-10 (generic) and
Table 2-11 (external port) are 20 bits wide. The lower 19 bits are the
memory address field. Like other I/O processor address registers, the chain
pointer register’s value is offset to match the starting address of the processor’s internal memory before it is used by the I/O processor. On the
SHARC processor, this offset value is 0x80000.
ADSP-2137x SHARC Processor Hardware Reference2-9
The example chain pointer register shown in Table 2-10 is valid for
all peripherals unless otherwise noted.
DMA Channel Registers
Table 2-10. Generic Chain Pointer Register (CPx)
BitNameDescription
18–0IIx addressNext chain pointer address
19PCIProgram controlled interrupt
0 = interrupt after end of entire chain
1 = interrupt after current TCB
Table 2-11. External Port Chain Pointer Register (EPCPx)
BitNameDescription
18–0IIx addressNext chain pointer address
19PCIProgram controlled interrupt
0 = interrupt after end of entire chain
1 = interrupt after current TCB
20CPDR DMA direction for next TCB
0 = write to internal memory
1 = read from internal memory
(ADSP-2137x only)
Bit 19 of the chain pointer register is the program controlled interrupt
(
PCI) bit. This bit controls whether an interrupt is latched after every
DMA in the chain (when set = 1), or whether the interrupt is latched after
the entire DMA sequence completes (if cleared = 0).
The PCI bit only effects DMA channels that have chaining enabled.
Also, interrupt requests enabled by the PCI bit are maskable with
the
IMASK register.
2-10ADSP-2137x SHARC Processor Hardware Reference
I/O Processor
TCB Storage
This section lists all the different TCB memory allocations used for DMA
chaining on the peripherals. Note that all TCBs must be located in internal memory.
Serial Port TCB
The serial ports support single and chained DMA. Table 2-12 shows the
required TCBs for chained DMA. Note that when using the serial ports,
programs can insert a TCB in an active chain.
Table 2-12. SPORT TCBs
AddressRegister
CP[18:0] CPSPx Chain Pointer
CP[18:0] + 0x1ICSPx Internal Count
CP[18:0] + 0x2 IMSPx Internal Modifier
CP[18:0] + 0x3IISPx Internal Index
SPI TCB
Table 2-13 shows the required TCBs for a SPI chained DMA.
Table 2-13. SPI/SPIB TCBs
AddressRegister
CP[18:0]CPSPI/B Chain Pointer
CP[18:0] + 0x1 ICSPI/B Internal Count
CP[18:0] + 0x2IMSPI/B Internal Modifier
CP[18:0] + 0x3 IISPI/B Internal Index
ADSP-2137x SHARC Processor Hardware Reference2-11
TCB Storage
UART TCB
Table 2-14 shows the required TCBs for chained UART DMA.
The external port interface supports many different types of DMA, resulting in different lengths of TCBs. The TCB size varies from six locations
(chained DMA) to 10 locations (circular scatter/gather DMA). Table 2-15
shows the required TCBs for chained DMA. Note this TCB is also valid
for the ADSP-21367/8/9 processors in circular buffering mode (the EBEP
and ELEP registers are not part of the TCB).
Table 2-15. External Port TCBs for Standard DMA
AddressRegister
CP[18:0]CPEP
CP[18:0] + 0x1EMEP
CP[18:0] + 0x2EIEP
CP[18:0] + 0x3ICEP
CP[18:0] + 0x4IMEP
CP[18:0] + 0x5IIEP
2-12ADSP-2137x SHARC Processor Hardware Reference
I/O Processor
The order the descriptors are fetched with circular buffering enabled is
shown in Table 2-15.
Table 2-16. External Port TCBs for Circular DMA (ADSP-2137x Only)
AddressRegister
CP[18:0]CPEP
CP[18:0] + 0x1ELEP
CP[18:0] + 0x2EBEP
CP[18:0] + 0x3EMEP
CP[18:0] + 0x4EIEP
CP[18:0] + 0x5ICEP
CP[18:0] + 0x6IMEP
CP[18:0] + 0x7IIEP
For delay line DMA, TCB loading is split into two sequences to improve
overall priority. The first TCB loads the write parameters (
IIEP–ELEP) and
the second loads the read parameters (RIEP–CPEP). This two stage loading
is transparent to the application. The order the descriptors are fetched
with circular buffering enabled is shown in Table 2-17.
Table 2-17. External Port TCBs for Delay Line DMA
AddressRegister
Delay Line Read
CP[18:0]CPEP
CP[18:0] + 0x1TPEP
CP[18:0] + 0x2TCEP
CP[18:0] + 0x3RMEP
CP[18:0] + 0x4RCEP
CP[18:0] + 0x5RIEP
ADSP-2137x SHARC Processor Hardware Reference2-13
TCB Storage
Table 2-17. External Port TCBs for Delay Line DMA (Cont’d)
AddressRegister
Delay Line Write
CP[18:0] + 0x6ELEP
CP[18:0] + 0x7EBEP
CP[18:0] + 0x8EMEP
CP[18:0] + 0x9EIEP
CP[18:0] + 0xAICEP
CP[18:0] + 0xBIMEP
CP[18:0] + 0xCIIEP
The order the descriptors are fetched for scatter/gather DMA with circular
buffering enabled is shown in Table 2-18 and Table 2-19.
Table 2-18. External Port TCBs for Scatter/Gather DMA
AddressRegister
CP[18:0]CPEP
CP[18:0] + 0x1TPEP
CP[18:0] + 0x2TCEP
CP[18:0] + 0x3EMEP
CP[18:0] + 0x4EIEP
CP[18:0] + 0x5ICEP
CP[18:0] + 0x6IMEP
CP[18:0] + 0x7IIEP
2-14ADSP-2137x SHARC Processor Hardware Reference
I/O Processor
Table 2-19. External Port TCBs for Circular Scatter/Gather DMA
AddressRegister
CP[18:0]CPEP
CP[18:0] + 0x1ELEP
CP[18:0] + 0x2EBEP
CP[18:0] + 0x3TPEP
CP[18:0] + 0x4TCEP
CP[18:0] + 0x5EMEP
CP[18:0] + 0x6EIEP
CP[18:0] + 0x7ICEP
CP[18:0] + 0x8IMEP
CP[18:0] + 0x9IIEP
Clocking
The fundamental timing clock of the IOP is peripheral clock (PCLK). All
DMA data transfers over the IO0 or IO1 buses are clocked at PCLK speed.
Functional Description
The following several sections provide detail on the function of the I/O
processor.
Automated Data Transfer
Because the IOP registers are memory-mapped, the processors have access
to program DMA operations. A program sets up a DMA channel by writing the transfer's parameters to the DMA parameter registers. After the
index, modify, and count registers (among others) are loaded with a start-
ADSP-2137x SHARC Processor Hardware Reference2-15
Functional Description
ing source or destination address, an address modifier, and a word count,
the processor is ready to start the DMA.
The peripherals each have a DMA enable (
xDEN) bits in their channel con-
trol registers. Setting this bit for a DMA channel with configured DMA
parameters starts the DMA on that channel. If the parameters configure
the channel to receive, the I/O processor transfers data words received at
the buffer to the destination in internal memory. If the parameters configure the channel to transmit, the I/O processor transfers a word
automatically from the source memory to the channel's buffer register.
These transfers continue until the I/O processor transfers the selected
number of words as determined by the count parameter. DMA through
the IDP ports occurs in internal memory only.
DMA Transfer Types
Standard DMA. A standard DMA (once it is configured) transfers data
from location A to location B. An interrupt can be used to indicate the
end of the transfer. To start a new DMA sequence after the current one is
finished, a program must first clear the DMA enable bit (control register),
write new parameters to the index, modify, and count registers (parameter
registers), then set the DMA enable bit to re-enable DMA (control
register).
An instance where standard DMA can be used is to copy data from a
peripheral to internal memory for processor booting. With the help of the
loader tool, the tag (header information) of the boot stream is decoded to
get the storage information which includes the index, modify, and count
of a specific array to start another standard DMA.
Chained DMA. Chained DMA sequences are a set of multiple DMA
operations, each autoinitializing the next in line. To start a new DMA
sequence after the current one is finished, the IOP automatically loads
new index, modify, and count values from an internal memory location
(or external memory location for DMA to external ports) pointed to by
2-16ADSP-2137x SHARC Processor Hardware Reference
I/O Processor
that channel’s chain pointer register. Using chaining, programs can set up
consecutive DMA operations and each operation can have different
attributes.
Chained DMA with direction on the fly (External Port). The external
port DMA controller supports chained DMA sequences with the an additional feature that allows the port to change the data direction for each
individual TCB. An additional bit in the TCB differentiates between a
read or write operation.
The IDP port does not support DMA chaining.
Ping-pong DMA (IDP). In ping-pong DMA, the parameters have two
memory index values (index A and index B), one count value and one
modifier value. The DMA starts the transfer with the memory indexed by
A. When the transfer is completed as per the value in the count register,
the DMA restarts with the memory location indexed by B. The DMA
restarts with index A after the transfer to memory with index B is completed as per the count value. This repeats until the DMA is stopped by
resetting the DMA enable bit.
Circular Buffering DMA (External Port). This mode resembles the
chained DMA mode, however two additional registers (base and length)
are used. This mode performs DMA within the circular buffer, which is
useful for filter implementation since core interaction is limited, conserv-
ing bandwidth.
DMA Direction
The IOP supports DMA in three directions. These are described in the
following sections.
Internal to External Memory
DMA transfers between internal memory and external memory devices use
the processor’s external port. For these types of transfers, the application
ADSP-2137x SHARC Processor Hardware Reference2-17
Functional Description
code provides the DMA controller with the internal memory buffer size,
address, and address modifier, as well as the external memory buffer size,
address, address modifier, and the direction of transfer. After setup, the
DMA transfers begin when the program enables the channel and continues until the I/O processor transfers the entire buffer to processor
memory. Table 2-21 on page 2-29 shows the parameter registers for each
DMA channel.
Peripheral to Internal Memory
Similarly, DMA transfers between internal memory and serial, IDP, or
SPI ports have DMA parameters. When the I/O processor performs DMA
between internal memory and one of these ports, the program sets up the
parameters, and the I/O uses the port instead of the external bus.
The direction (receive or transmit) of the peripheral determines the direction of data transfer. When the port receives data, the I/O processor
automatically transfers the data to internal memory. When the port needs
to transmit a word, the I/O processor automatically fetches the data from
internal memory. Figure 2-1 on page 2-19 shows more detail on DMA
channel data paths.
Internal Memory to Internal Memory
The ADSP-2136x and ADSP-2137x processors can use memory-to-memory DMA to transfer 64-bit blocks of data between internal memory
locations.
DMA Controller Addressing
Figure 2-1 shows a block diagram of the I/O processor’s address generator
(DMA controller). “Standard DMA Parameter Registers” on page 2-3 lists
the parameter registers for each DMA channel. The parameter registers are
uninitialized following a processor reset.
2-18ADSP-2137x SHARC Processor Hardware Reference
LOCAL BUS
MODIFI ER
INTERNAL
MEMORY
ADDRESS
DMA ADDRESS GENERATOR (INTERNAL ADDRESSES)
LOCAL BUS
COUNT
CHAIN POINTER
MUX
DMA WORD COUNTER
–1
WORKING REGISTER
INDEX (ADDRESS)
+/-
POST-MODIFY
+
LOCAL BUS
EXTERNAL
MODIFIER
EXTERNAL
COUNT
–1
EXTERNAL
MEMORY
ADDRESS
POST-MODIF Y
EXTERNAL
INDEX (ADDRESS)
DMA ADDRESS GENERATOR (EXTERNAL ADDRESSES)
+
+
I/O Processor
Figure 2-1. DMA Address Generator
The I/O processor generates addresses for DMA channels much the same
way that the Data Address Generators (DAGs) generate addresses for data
memory accesses. Each channel has a set of parameter registers including
an index register and modify register that the I/O processor uses to address
ADSP-2137x SHARC Processor Hardware Reference2-19
Functional Description
a data buffer in internal memory. The index register must be initialized
with a starting address for the data buffer. As part of the DMA operation,
the I/O processor outputs the address in the index register onto the processor’s I/O address bus and applies the address to internal memory
during each DMA cycle—a clock cycle in which a DMA transfer is taking
place.
Internal Index Register Addressing
All addresses in the index registers are offset by a value matching the processor’s first internal normal word addressed RAM location, before the
I/O processor uses the addresses. For the products in this manual, this offset value is 0x0008 0000.
The following rules for data transfers must be followed.
•DMA index addresses must always be normal word space (32-bit).
•DMA Data packing can only happen in the associated peripheral,
for example external port booting, the AMI does 8 to 32-bit packing via the external port DMA channel 0.
After transferring each data word to or from internal memory, the I/O
processor adds the modify value to the index register to generate the
address for the next DMA transfer and writes the modified index value to
the index register. The modify value in the modify register is a signed integer, which allows both increment and decrement modifies. The modify
value can have any positive or negative integer value. Note that:
2-20ADSP-2137x SHARC Processor Hardware Reference
The DMA controller only supports index addresses in the normal
word space (32-bit).
•If the I/O processor modifies the internal index register past the
maximum 19-bit value to indicate an address out of internal memory, the index wraps around to zero. With the offset for the
SHARC processor, the wraparound address is 0x80000.
I/O Processor
•If a DMA channel is disabled, the I/O processor does not service
requests for that channel, whether or not the channel has data to
transfer.
External Index Register Addressing
The external port DMA channels each contain additional parameter registers: the external index registers (EIEPx), external modify registers (EMEPx),
and external count registers (ECEPx). The DMA controller generates 28-bit
external memory addresses over the IOD1 bus using the EIEPx register
during DMA transfers between internal memory and external memory.
If a program loads the count register with zero, the I/O processor
does not disable DMA transfers on that channel. The I/O processor interprets the zero as a request for 216 transfers. This count
occurs because the I/O processor starts the first transfer before testing the count value. The only way to disable a DMA channel is to
clear its DMA enable bit.
DMA Channel Status
There are two methods the processor uses to monitor the progress of
DMA operations; interrupts, which are the primary method, and status
polling. The same program can use either method for each DMA channel.
Programs can check the appropriate DMA status bits (for example the status bits in the
channels are performing a DMA or chained DMA. All DMA channels can
be active or inactive. If a channel is active, a DMA is in progress on that
channel. The I/O processor indicates the active status by setting the channel’s bit in the status register.
SPMCTL register for the serial ports) to determine which
ADSP-2137x SHARC Processor Hardware Reference2-21
Note that there is 1 PCLK cycle latency between a change in DMA
channel status and the status update in the corresponding register.
Functional Description
The peripheral’s DMA controller tracks status information of the channels
in each of the peripheral registers (for example
DAI_STAT, DMACx, and MTMCTL).
SPMCTLx, SPIDMACx,
•DMA channel status (status bit is set until the DMA terminates)
•TCB chain loading status (status bit is set until TCB loading
completes)
If polling the status of a chained DMA, the DMA status bit is first set
when the TCB has terminated, then it is cleared. The TCB status loading
bit is set until the load is finished and cleared on load completion. This
procedure is repeated for all subsequent DMA blocks.
Note that polling the DMA status registers (especially chained DMA)
reduces I/O bandwidth.
DMA Start and Stop Conditions
The difference between single DMA and chained DMA is based on the
auto-linkage process where the DMA’s attributes are stored in internal
memory and automatically loaded by the IOP if requested.
A DMA sequence starts when one of the following occurs.
•Chaining is disabled, and the DMA enable bit transitions from low
to high.
•Chaining is enabled, DMA is enabled, and the chain pointer register address field is written with a non zero value. In this case, TCB
chain loading of the channel parameter registers occurs first.
•Chaining is enabled, the chain pointer register address field is nonzero, and the current DMA sequence finishes. Again, TCB chain
loading occurs.
2-22ADSP-2137x SHARC Processor Hardware Reference
I/O Processor
A DMA sequence ends when one of the following occurs.
•The count register decrements to zero, and the chain pointer register is zero.
•Chaining is disabled and the channel’s DMA enable bit transitions
from high to low. If the DMA enable bit goes low (=0) and chaining is enabled, the channel enters chain insertion mode (SPORT
only) and the DMA sequence continues.
Once a program starts a DMA process, the process is influenced by two
external controls; DMA channel priority and DMA chaining.
Operating Modes
This section provides information on IOP operating modes.
The SHARC processor contains two independent 32-bit DMA buses
(Figure 2-2). The IOD0 bus is used for the peripherals to the internal
memory and the IOD1 bus is used for external-to-internal memory
transfers.
The IOD0 bus is the path that the IOP uses to transfer data between
internal memory and the peripherals. When there are two or more peripherals with active DMAs in progress, they may all require data to be moved
to or from memory in the same cycle. For example, the SPI port may fill
its buffer just as a SPORT shifts a word into its buffer. To determine
which word is transferred first, the DMA channels for each of the
processor’s I/O ports negotiate channel priority with the I/O processor
using an internal DMA request/grant handshake.
ADSP-2137x SHARC Processor Hardware Reference2-23
The IOD0 and IOD1 buses operate independently. However, in
some cases there may be address conflicts if both buses access the
same internal memory block. In this case, the IOD0 bus has first
priority.
Operating Modes
EXTERNAL
PORT ARBITER
DATA
MUX
PERIPHERAL
ARBITER
DATA
MUX
INTERNAL
MEMORY I/F
ARBITER
IOD1 BUSIOD0 BUS
...
SPORTxAMISDRAMSPI
IDP
MTM
UART
PERIPHERAL DMA BUS
EXTERNAL PORT
DMA BUS
CORE BUS
CORE BUS
Figure 2-2. I/O Processor Bus Structure
Each I/O port has one or more DMA channels, and each channel has a
single request and a single grant. When a particular channel needs to read
or write data to internal memory, the channel asserts an internal DMA
request. The I/O processor prioritizes the request with all other valid
DMA requests. When a channel becomes the highest priority requester,
the I/O processor asserts the channel’s internal DMA grant. In the next
clock cycle, the DMA transfer starts. Table 2-21 on page 2-29 shows the
paths for internal DMA requests within the I/O processor.
DMA Chaining
In the SHARC processors, DMA data transfers can be set up as continuous or periodic. Furthermore, these DMA transfers can be configured to
2-24ADSP-2137x SHARC Processor Hardware Reference
I/O Processor
run automatically using chained DMA. With chained DMA, the attributes of a specific DMA are stored in internal memory and are referred to
as a Transfer Control Block or TCB. The DMA controller loads these attributes in chains for execution. This allows for multiple chains that are an
finite or infinite.
TCB Memory Storage
The location of the DMA parameters for the next sequence comes from
the chain pointer register that points to the next set of DMA parameters
stored in the processor’s internal memory. In chained DMA operations,
the processor automatically initializes and then begins another DMA
transfer when the current DMA transfer is complete. Each new set of
parameters is stored in a user-initialized memory buffer or TCB for a chosen peripheral. Table 2-20 provides a brief description of the TCBs.
Table 2-20. Principal TCB Allocation for a Serial Peripheral
AddressRegisterDescription
CPxChain pointer registerChain pointer for DMA chaining
CPx + 0x1 (ICx)Internal count registerLength of internal buffer
CPx + 0x2 (IMx)Internal modify registerStride for internal buffer
CPx + 0x3 (IIx)Internal index registerInternal memory buffer
If chaining is enabled on a DMA channel, programs should not use
polling to determine channel status as this gives inaccurate information where the DMA appears inactive if it is sampled while the
next TCB is loading.
ADSP-2137x SHARC Processor Hardware Reference2-25
The size of TCB varies and is based on the peripheral to be used:
the SPORTs and SPI require four locations, the external port
requires six to 13 locations. Allowing different TCB sizes reduces
the memory load since only the required TCBs are allocated in
internal memory.
Operating Modes
CPx
IIx
IMx
Cx
CPx
IIx
IMx
Cx
TCB 1
TCB 2
If pointing to zero,
chain operation ends
Chain Assignment
The structure of a TCB is conceptually the same as that of a traditional
linked-list. Each TCB has several data values and a pointer to the next
TCB. Further, the chain pointer of a TCB may point to itself to continuously re run the same DMA. The I/O processor reads each word of the
TCB and loads it into the corresponding register (see Listing 2-1).
address of the TCB (containing the index parameter). This means
that if a program declares an array to hold the TCB, the chain
pointer register should point to the last location of the array and
not to the first TCB location.
Programs must assign the TCB in memory in the order shown in
Figure 2-3, placing the index parameter at the address pointed to by the
chain pointer register of the previous DMA operation of the chain. The
end of the chain (no further TCBs are loaded) is indicated by a TCB with
a chain pointer register value of zero.
Figure 2-3. Chaining in the SPI and Serial Ports
The address in the chain pointer register points to the highest
The address field of the chain pointer registers is only 19 bits wide. If a
program writes a symbolic address to bit 19 of the chain pointer there may
be a conflict with the
address then AND the
PCI bit. Programs should clear the upper bits of the
PCI bit separately, if needed, as shown below.
Clear the chain pointer register before chaining is enabled.
2-26ADSP-2137x SHARC Processor Hardware Reference
I/O Processor
Listing 2-1. Chain Assignment
Chain Assignment (according to Figure 2-3):
R0=0;
dm(CPx)=R0; /* clear CPx register */
/* init DMA control registers */
R2=(TCB1+3) & 0x7FFFF; /* load IIx address of next TCB
and mask address */
R2=bset R2 by 19; /* set PCI bit */
dm(TCB2)=R2; /* write address to CPx location of
current TCB */
R2=(TCB2+3) & 0x7FFFF; /* load IIx address of next TCB and
mask address*/
R2=bclr R2 by 19; /* clear PCI bit */
dm(TCB1)=R2; /* write address to CPx location of
current TCB */
dm(CPx)=R2; /* write IIx address of TCB1 to CPx
register to start chaining*/
Chained DMA operations may only occur within the same chan-
nel. The processor does not support cross-channel chaining.
Starting Chain Loading
A DMA sequence is defined as the sum of the DMA transfers for a single
channel, from when the parameter registers initialize to when the count
register decrements to zero. Each DMA channel has a chaining enable bit
CHEN) in the corresponding control register.
(
To start the chain, write the internal index address of the first TCB to the
chain pointer register. When chaining is enabled, DMA transfers are initiated by writing a memory address to the chain pointer register. This is also
an easy way to start a single DMA sequence, with no subsequent chained
DMAs.
ADSP-2137x SHARC Processor Hardware Reference2-27
Operating Modes
During TCB chain loading, the I/O processor loads the DMA channel
parameter registers with values retrieved from internal memory.
The chain pointer register can be loaded at any time during the DMA
sequence. This allows a DMA channel to have chaining disabled (chain
pointer register address field = 0x0) until some event occurs that loads the
chain pointer register with a non zero value. Writing all zeros to the
address field of the chain pointer register also disables chaining.
TCB Chain Loading Priority
A TCB chain load request is prioritized like all DMA channels. Therefore,
the TCB chain loading request has the same priority level as the DMA
channel itself. The I/O processor latches a TCB loading request and holds
it until the load request has the highest priority. If multiple chaining
requests are present, the I/O processor services the TCB block for the
highest priority DMA channel first.
When starting chain loading, note that the SPI port is an exception
to the above. To execute the first DMA in a chain for this peripheral, the DMA parameter registers also need to be explicitly
programmed. For more information, see “DMA Transfers” on
page 12-19.
A channel that is in the process of chain loading cannot be interrupted by any other request (TCB, DMA channel). The chain
loading sequence is atomic and the I/O bus is locked until all the
DMA parameter registers are loaded. For a list of DMA channels in
priority order, see Table 2-21.
Chain Insert Mode (SPORTs Only)
It is possible to insert a single SPORT DMA operation or another DMA
chain within an active SPORT DMA chain. Programs may need to perform insertion when a high priority DMA requires service and cannot wait
2-28ADSP-2137x SHARC Processor Hardware Reference
I/O Processor
for the current chain to finish. This is supported only for SPORT DMA
channels only. For more information, see Chapter 7, Serial Ports.
Fixed DMA Channel Arbitration
The shaded region in Table 2-21 (DMA channels 32 and 33) illustrates
that the priority shown is only valid if the IOD1 bus (external port DMA
channels) has a memory address block conflict with the IOD0 peripherals
bus. Otherwise, the IOD1 bus operates fully independently. Also note the
external port DMA channel changes priority, depending on the external
index addresses. If an external index address is assigned to an internal
index address, then the DMA channel priority will change.
DMA-capable peripherals execute DMA data transfers to and from internal memory over the IOD0 bus. When more than one of these peripherals
requests access to the IOD0 bus in a clock cycle, the bus arbiter, which is
attached to the IOD0 bus, determines which master should have access to
the bus and grants the bus to that master.
Data Buffer Description
DFEP0
and
AMIRX
AMITX
(AMI only)
DFEP1
and
AMIRX
AMITX
(AMI only)
External Port Memory
DMA 0
External Port Memory
DMA 1.
Note if the DMAC0
channel runs int-int
memory and DMAC1
channel int-ext memory, then DMAC1 has
higher priority
(ADSP-2137x only).
IOP channel arbitration can be set to use either a fixed or rotating algorithm by setting or clearing RPBR bit in the SYSCTL register as follows.
•(=0) fixed arbitration (default)
•(=1) rotating arbitration
ADSP-2137x SHARC Processor Hardware Reference2-33
Operating Modes
In the fixed priority scheme, the lower indexed peripheral has the highest
priority.
External Port DMA Bus
External port DMA channels transfer data between internal memories or
between internal and external memory over the IOD1 bus. When both
external port channels request access to the IOD1 bus in a clock cycle, the
external port bus arbiter, which is attached to the IOD1 bus, determines
which master should have access to the bus and grants the bus to that
master.
IOP/external port channel arbitration can be set to use either a fixed or
rotating algorithm by setting or clearing the
DMAPR bits in the EPCTL regis-
ter as follows.
•(=10) fixed arbitration channel 0
•(=11) rotating arbitration (default)
Note the independency is only broken if there is an internal memory
block conflict. In this case, if both rotating bits are set, the peripheral
DMA channels always have the highest priority and the DMAPR bit allows
the change in priority among the two external port DMA channels.
Rotating DMA Channel Arbitration
DMA channel arbitration is the method that the arbiter uses to determine
how groups rotate priority with other channels. The default DMA channel
priority is fixed prioritization by DMA channel group.
Rotating Priority by Group
In the rotating priority scheme, the default priorities at reset are the same
as that of the fixed priority. However, the peripheral priority is
2-34ADSP-2137x SHARC Processor Hardware Reference
I/O Processor
determined by group, not individually by DMA channel. Peripheral
groups are shown in Table 2-21 on page 2-29.
Initially, group A has the highest priority and group I the lowest. As one
group completes its DMA operation, it is assigned the lowest priority
(moves to the back of the line) and the next group is given the highest
priority.
When none of the peripherals request bus access, the highest priority
peripheral, for example, peripheral 0, is granted the bus. However, this
does not change the currently assigned priorities to various peripherals.
Within a peripheral group, the priority is highest for the higher indexed
peripheral (see Table 2-21 on page 2-29). For example, of the SPORT
pair SP01 (which is in group A), SP1 has the highest priority.
Programs can change DMA arbitration modes between fixed and rotate on
the fly which incurs an effect latency of 2
PCLK cycles.
Interrupts
The primary type of DMA communication is interrupt driven I/O where
the core continues to execute instructions while DMA executes in the
background. This allows high levels of parallelism achieving over all better
system performance. Because the interrupt vector directs the core to
respond to specific transactions very efficiently, programs do not need to
poll status bits.
During interrupt-driven DMA, programs use the interrupt mask bits in
the IMASK, LIRPTL, DPI_IMASK, DAI_IMASK_x registers to selectively mask
DMA channel interrupts that the I/O processor latches into the
LIRPTL, DPI_IRPTL, DAI_IRPTL_x registers. A channel interrupt mask in the
IMASK, LIRPTL, DPI_IMASK, DAI_IMASK_x registers determines whether a
latched interrupt is serviced or not. When an interrupt is masked, it is
latched but not serviced.
ADSP-2137x SHARC Processor Hardware Reference2-35
IRPTL,
Interrupts
Sources
The following sections describe the two sources of interrupts.
Unchained DMA Interrupts
When an unchained (single block) DMA process reaches completion (the
DMA count decrements to zero) on any DMA channel, the I/O processor
latches that DMA channel’s interrupt. It does this by setting the DMA
channel’s interrupt latch bit in the IRPTL, LIRPTL, DPI_IRPTL, or
DAI_IRPTLH_x registers.
Chained DMA Interrupts
For chained DMA, the channel generates interrupts in one of two ways:
1. If PCI = 1, (bit 19 of the chain pointer register is the program controlled interrupts, or PCI bit) an interrupt occurs for each DMA in
the chain.
2. If PCI = 0, an interrupt occurs at the end of a completed chain. For
more information on DMA chaining, see “Functional Description”
on page 2-15.
Figure 2-4 shows the PCI timing during TCB loading. After the DMA
count for the last word of frame N becomes zero, the PCI interrupt is
latched. At the same time the DMA reloads the TCB for that specific
channel (assuming no higher priority DMA requests). Finally the DMA
channel resumes operation for frame N–1.
2-36ADSP-2137x SHARC Processor Hardware Reference
By clearing a channel’s PCI bit during chained DMA, programs
mask the DMA complete interrupt for a DMA process within a
chained DMA sequence.
I/O Processor
DMA Channel
TCB Loading
DMA
Count=1
PCI INTERRUPT
LATCHED FOR
FRAME N
FRAME NFRAME N
-
1
IOD BUS
DMA
Count=N
-
1
DMA
Count=N
DMA
Count=0
Figure 2-4. DMA Chaining
Transfer Completion Types
The next two sections describe the two types of interrupts that are used to
signal interrupt completion. These are based on the type of peripheral
used.
Internal Transfer Completion
This mode of interrupt generation resembles the traditional SHARC
DMA interrupt generation. The interrupt is generated once the DMA
internal transfers are complete, independent of whether the DMA is a
transmit or receive. Therefore, for external transmit DMAs, when the
completion interrupt is generated there may still be an external access
pending at the external DMA interface.
The I/O processor only generates a DMA complete interrupt when
the channel’s count register decrements to zero as a result of actual
DMA transfers. Writing zero to a count register does not generate
the interrupt. To stop a DMA preemptively, write a one to the
count register. This causes one additional word to be transferred or
received, and an interrupt is then generated.
Access Completion
A DMA complete interrupt is generated when accesses are finished. For an
external write DMA, the DMA complete interrupt is generated only after
ADSP-2137x SHARC Processor Hardware Reference2-37
Interrupts
the external writes on the DMA external interface are complete. For an
external read DMA, the complete interrupt is generated when the internal
DMA writes are complete. In this DMA mode the DMA interface could
be disabled as soon as the interrupt is received.
This mode is supported by the external port on the ADSP-2137x processors only.
Core Single Word Transfer Interrupts
When a DMA channel’s buffer is not being used for a DMA process, the
core can generate an interrupt on single word transfers (writes or reads) of
the buffer of the respective peripheral. This interrupt service differs
slightly for each peripheral. In this case, the peripheral’s buffer generates
an interrupt when data becomes available at the receive buffer or when the
transmit buffer is not full (when there is room for the core to write to the
buffer). Generating interrupts in this manner lets programs implement
interrupt-driven I/O under control of the processor core. Refer to the specific peripheral chapter for more information.
Interrupt Versus Channel Priorities
At their default setting shown in Table 2-22, the DMA interrupt priorities
do not match the DMA channel priorities. However, if both priorities
schemes should match, the DMA interrupt priorities can be re-assigned by
dedicated settings of the PICRx registers.
2-38ADSP-2137x SHARC Processor Hardware Reference
Loading...
+ hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.