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, the SHARC
logo, 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 ................................................................. xxi
Intended Audience ......................................................................... xxi
Digital Audio Interface Status Register (DAI_STAT) ........... A-104
DAI Resistor Pull-up Enable Register (DAI_PIN_PULLUP) A-106
DAI Pin Status Register (DAI_PIN_STAT) ......................... A-109
DAI Interrupt Controller Registers ..................................... A-110
INDEX
ADSP-2126x SHARC Processor Peripherals Manualxix
xxADSP-2126x SHARC Processor Peripherals Manual
PREFACE
Thank you for purchasing and developing systems using SHARC®
processors from Analog Devices.
Purpose of This Manual
The ADSP-2126x SHARC Processor Peripherals Manual contains information about the DSP architecture and DSP assembly language for SHARC
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 how assembly instructions execute
on the SHARC processor’s architecture along with reference information
about DSP operations.
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.
ADSP-2126x SHARC Processor Peripherals Manualxxi
Manual Contents
Manual Contents
The manual consists of:
•Chapter 1, “Introduction”
Provides an architectural overview of the ADSP-2126x processor.
•Chapter 3, “Parallel Port”
Describes the processor’s on-chip DMA controller as a mechanism
for transferring data without core interruption.
•Chapter 4, “Serial Ports”
Describes the six 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.
•Chapter 5, “Serial Peripheral Interface Port”
Describes the operation of the 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 6, “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 7, “Digital Audio Interface”
Provides information about the digital audio interface (DAI) which
allows you to attach an arbitrary number and variety of peripherals
to the ADSP-2126x while retaining high levels of compatibility.
•Chapter 8, “Precision Clock Generator”
Details the precision clock generators (PCG) each of which generates a pair of signals derived from a clock input signal.
xxiiADSP-2126x SHARC Processor Peripherals Manual
•Chapter 9, “System Design”
Describes system features of the ADSP-2126x processor. These
include power, reset, clock, JTAG, and booting, as well as pin
descriptions and other system level information.
•Appendix A, “Registers Reference”
Provides ‘at-a-glance’ register figures and bit descriptions.
Preface
L
This hardware reference is a companion document to the
ADSP-2126x SHARC Processor Core Manual.
What’s New in This Manual
Revision 3.0 of the ADSP-2126x SHARC Processor Peripherals Manual differs in a number of ways from the revision 2.0 book. In revision 3.0 all
errata reports against the previous revision have been corrected.
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
•Contact your Analog Devices, Inc. local sales office or authorized
distributor
•Send questions by mail to:
Analog Devices, Inc.
One Technology Way
P.O. Box 9106
Norwood, MA 02062-9106
USA
Supported Processors
The following is the list of Analog Devices, Inc. processors supported in
VisualDSP++®.
TigerSHARC® (ADSP-TSxxx) Processors
The name TigerSHARC refers to a family of floating-point and
fixed-point (8-bit, 16-bit, and 32-bit) processors. VisualDSP++ currently
supports the following TigerSHARC families: ADSP-TS101 and
ADSP-TS20x.
SHARC (ADSP-21xxx) 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, and
ADSP-2136x.
Blackfin® (ADSP-BFxxx) Processors
The name Blackfin refers to a family of 16-bit, embedded processors.
VisualDSP++ currently supports the following Blackfin families:
ADSP-BF53x and ADSP-BF56x.
xxivADSP-2126x SHARC Processor Peripherals Manual
Preface
Product Information
You can obtain product information from the Analog Devices Web site,
from the product CD-ROM, or from the printed publications (manuals).
Analog Devices is online at www.analog.com. Our Web site provides information about a broad range of products—analog integrated circuits,
amplifiers, converters, and digital signal processors.
MyAnalog.com
MyAnalog.com is a free feature of the Analog Devices Web site that allows
the customizing 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. MyAnalog.com provides access to books, application notes, data
sheets, code examples, and more.
Registration
Visit www.myanalog.com to sign up. Click Register to use MyAnalog.com.
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.
Processor Product Information
For information on embedded processors and DSPs, visit our Web site at
www.analog.com/processors, which provides access to technical publica-
tions, data sheets, application notes, product overviews, and product
announcements.
ADSP-2126x SHARC Processor Peripherals Manualxxv
Product Information
You may also obtain additional information about Analog Devices and its
products in any of the following ways.
Online documentation comprises the VisualDSP++ Help system, software
tools manuals, hardware tools manuals, processor manuals, the Dinkum
Abridged C++ library, and Flexible License Manager (FlexLM) network
license manager software documentation. You can easily search across the
entire VisualDSP++ documentation set for any topic of interest. For easy
printing, supplementary .PDF files of most manuals are also provided.
Each documentation file type is described as follows.
File Description
.CHMHelp system files and manuals in Help format
.HTM or
.HTML
.PDFVisualDSP++ and processor manuals in Portable Documentation Format (PDF).
Dinkum Abridged C++ library and FlexLM network license manager software documentation. Viewing and printing the HTML files requires a browser, such as
Internet Explorer 4.0 (or higher).
Viewing and printing the .PDF files requires a PDF reader, such as Adobe Acrobat
Reader (4.0 or higher).
If documentation is not installed on your system as part of the software
installation, you can add it from the VisualDSP++ CD-ROM at any time
by running the Tools installation. Access the online documentation from
the VisualDSP++ environment, Windows® Explorer, or the Analog
Devices Web site.
Accessing Documentation From VisualDSP++
From the VisualDSP++ environment:
•Access VisualDSP++ online Help from the Help menu’s Contents, Search, and Index commands.
•Open online Help from context-sensitive user interface items (toolbar buttons, menu commands, and windows).
Accessing Documentation From Windows
In addition to any shortcuts you may have constructed, there are many
ways to open VisualDSP++ online Help or the supplementary documentation from Windows.
CHM) are located in the Help folder, and .PDF files are
located in the Docs folder of your VisualDSP++ installation CD-ROM.
The Docs folder also contains the Dinkum Abridged C++ library and the
FlexLM network license manager software documentation.
Using Windows Explorer
•Double-click the vdsp-help.chm file, which is the master Help system, to access all the other .CHM files.
•Double-click any file that is part of the VisualDSP++ documentation set.
Using the Windows Start Button
•Access VisualDSP++ online Help by clicking the Start button and
choosing Programs, Analog Devices, VisualDSP++, and
VisualDSP++ Documentation.
•Access the .PDF files by clicking the Start button and choosing
Programs, Analog Devices, VisualDSP++, Documentation for
Printing, and the name of the book.
Select a processor family and book title. Download archive (.ZIP) files, one
for each manual. Use any archive management software, such as WinZip,
to decompress downloaded files.
Printed Manuals
For general questions regarding literature ordering, call the Literature
Center at 1-800-ANALOGD (1-800-262-5643) and follow the prompts.
ADSP-2126x SHARC Processor Peripherals Manualxxix
Product Information
VisualDSP++ Documentation Set
To purchase VisualDSP++ manuals, call 1-603-883-2430. The manuals
may be purchased only as a kit.
If you do not have an account with Analog Devices, you are referred to
Analog Devices distributors. For information on our distributors, log onto
http://www.analog.com/salesdir.
Hardware Tools Manuals
To purchase EZ-KIT Lite® and In-Circuit Emulator (ICE) manuals, call
1-603-883-2430. The manuals may be ordered by title or by product
number located on the back cover of each manual.
Processor Manuals
Hardware reference and instruction set reference manuals may be ordered
through the Literature Center at 1-800-ANALOGD (1-800-262-5643),
or downloaded from the Analog Devices Web site. Manuals may be
ordered by title or by product number located on the back cover of each
manual.
Data Sheets
All data sheets (preliminary and production) may be downloaded from the
Analog Devices Web site. Only production (final) data sheets (Rev. 0, A,
B, C, and so on) can be obtained from the Literature Center at
1-800-ANALOGD (1-800-262-5643); they also can be downloaded from
the Web site.
To have a data sheet faxed to you, call the Analog Devices Faxback System
at 1-800-446-6212. Follow the prompts and a list of data sheet code
numbers will be faxed to you. If the data sheet you want is not listed,
check for it on the Web site.
xxxADSP-2126x SHARC Processor Peripherals Manual
Conventions
Text conventions used in this manual are identified and described as
follows.
ExampleDescription
Preface
Close command
(File menu)
{this | that}Alternative items in syntax descriptions appear within curly brackets
[this | that]Optional items in syntax descriptions appear within brackets and sepa-
[this,…]Optional item lists in syntax descriptions appear within brackets
.SECTIONCommands, directives, keywords, and feature names are in text with
filenameNon-keyword placeholders appear in text with italic style format.
L
a
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).
and separated by vertical bars; read the example as this or that. One
or the other is required.
rated by vertical bars; read the example as an optional
delimited by commas and terminated with an ellipse; read the example
as an optional comma-separated list of this.
letter gothic font.
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.
this or that.
Warn in g: 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 Wa rnin g appears
instead of this symbol.
ADSP-2126x SHARC Processor Peripherals Manualxxxi
Conventions
L
Additional conventions, which apply only to specific chapters, may
appear throughout this document.
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 probability of overflow, using a floating-point DSP can ease 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 error handling. The ADSP-2126x processors are
highly integrated, lower cost 32-bit floating-point DSPs which provide
many of these design advantages.
L
For brevity, the ADSP-21262, ADSP-21266 and ADSP-21267
SHARC processors will be referred to as the ADAP-2126x. For
instances where functionality applies to one or the other processor
specifically, it will be noted in the text.
ADSP-2126x Processor Design
Advantages
The ADSP-2126x processor is a high performance 32-bit processor used
for medical imaging, communications, military, audio, test equipment,
3D graphics, speech recognition, motor control, imaging, and other applications. By adding a dual-ported on-chip SRAM, integrated I/O
ADSP-2126x SHARC Processor Peripherals Manual1-1
ADSP-2126x Processor Design Advantages
peripherals, and an additional processing element for Single-Instruction
Multiple-Data (SIMD) support, this processor builds on the ADSP-21000
Family processor core to form a complete system-on-a-chip.
The SHARC processor architecture balances a high performance processor
core with high performance buses (PM, DM, I/O). In the core, every
instruction can execute in a single cycle. The buses and instruction cache
provide rapid, unimpeded data flow to the core to maintain the execution
rate.
Figure 1-1 shows a detailed block diagram of the processor, illustrating the
following architectural features:
•Two processing elements (PEx and PEy), each containing 32-bit
IEEE floating-point computation units—multiplier, ALU, shifter,
and data register file
•Program sequencer with related instruction cache, interval timer,
and Data Address Generators (DAG1 and DAG2)
•Dual-ported SRAM
•Input/Output (I/O) processor with integrated DMA controller,
SPI-compatible port, and serial ports for point-to-point multiprocessor communications
•JTAG Test Access Port for emulation
•Parallel port for interfacing to off-chip memory and peripherals
Figure 1-1 also shows the three on-chip buses of the ADSP-2126x proces-
sor: the Program Memory (PM) bus, Data Memory (DM) bus, and
Input/Output (I/O) bus. The PM bus provides access to either instructions or data. During a single cycle, these buses let the processor access
two data operands from memory, access an instruction (from the cache),
and perform a DMA transfer.
Further, the ADSP-2126x processor addresses the five central requirements for DSPs:
•Fast, flexible arithmetic computation units
•Unconstrained data flow to and from the computation units
•Extended precision and dynamic range in the computation units
•Dual address generators with circular buffering support
•Efficient program sequencing
ADSP-2126x SHARC Processor Peripherals Manual1-3
ADSP-2126x Processor Design Advantages
CLOCK
ADC
(OPTIONAL)
CLK
SDAT
DAC
(OPTIONAL)
CLK
SDAT
ADSP-2126x
CLKIN
XTAL
2
CLK_CFG1-0
2
BOOTCFG1-0
3
FLAG 3-1
DAI_P1
FS
FS
DAI_P2
DAI_P3
SRU
DAI_P18
DAI _P 19
DA I_P20
CLK
FS
DAI
RESETJTAG
PCGA
PCGB
SCLK 0
SFS 0
SD0 A
SD0 B
SPORT0
SP ORT1
SPORT 2
SPORT3
SPORT4
SPORT5
6
CLKOUT
ALE
AD15-0
RD
WR
Figure 1-2. Typical Single Processor System
CO NTR O L
LATCH
AD DR
PARALLEL
PO RT
DA TA
RAM ROM
OE
BOOT ROM
I/O D EVICE
WE
CSFL AG 0
DATA
ADDRESS
Fast, Flexible Arithmetic. The ADSP-21000 family processors execute all
instructions in a single cycle. They provide fast cycle times and a complete
set of arithmetic operations. The processor is IEEE floating-point compatible and allows either interrupt on arithmetic exception or latched status
exception handling.
Unconstrained Data Flow. The ADSP-2126x processor has a Super Harvard Architecture combined with a ten-port data register file. In every
cycle, the processor can write or read two operands to or from the register
file, supply two operands to the ALU, supply two operands to the
1-4ADSP-2126x SHARC Processor Peripherals Manual
Introduction
multiplier, and receive three results from the ALU and multiplier. The
processor’s 48-bit orthogonal instruction word supports parallel data
transfers and arithmetic operations in the same instruction.
40-Bit Extended-Precision. The processor handles 32-bit IEEE floating-point format, 32-bit integer and fractional formats (twos-complement
and unsigned), and extended-precision 40-bit floating-point format. The
processors carry extended precision throughout their computation units,
limiting intermediate data truncation errors (up to 80 bits of precision are
maintained during multiply-accumulate operations).
Dual Address Generators. The processor has two Data Address Generators (DAGs) that provide immediate or indirect (pre- and post-modify)
addressing. Modulus, bit-reverse, and broadcast operations are supported
with no constraints on data buffer placement.
Efficient Program Sequencing. In addition to zero-overhead loops, the
processor supports single-cycle setup and exit for loops. Loops are both
nestable (six levels in hardware) and interruptable. The processors support
both delayed and non-delayed branches.
High Bandwidth I/O. The processors contain up to a dedicated, 4M bits
on-chip ROM, a parallel port, an SPI port, serial ports, Digital Audio
Interface (DAI), and JTAG. The DAI incorporates a precision clock generator, input data port, and a signal routing unit.
Serial Ports. Provides an inexpensive interface to a wide variety of digital
and mixed-signal peripheral devices. The serial ports can operate at up to
half the processor core clock (
CCLK) rate.
Digital Audio Interface (DAI). The DAI includes a precision clock generator, an input data port and a signal routing unit.
Input Data Port (IDP). The IDP provides an additional input path to the
processor core configurable as eight channels of serial data or seven channels of serial data and a single channel of up to 20-bit wide parallel data.
ADSP-2126x SHARC Processor Peripherals Manual1-5
Architectural Overview
Signal Routing Unit (SRU). Provides configuration flexibility by allowing
software-programmable connections to be made between the DAI components, serial ports, three pulse-width modulation (PWM) timers, and 20
DAI pins.
Serial Peripheral Interface (SPI). The SPI provides master or slave serial
boot through SPI, full-duplex operation, master-slave mode multi-master
support, open drain outputs, Programmable baud rates, clock polarities,
and phases.
I/O Processor (IOP). The IOP manages the SHARC processor’s off-chip
data I/O to alleviate the core of this burden. This unit manages the other
processor peripherals such as the SPI, DAI, and IDP as well as direct
memory accesses (DMA).
Architectural Overview
The ADSP-2126x processor forms 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 ADSP-2126x processor architecture, which
appears in Figure 1-1.
Processor Core
The processor core of the ADSP-2126x processor consists of 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 ADSP-2126x SHARC Processor Core Manual.
1-6ADSP-2126x SHARC Processor Peripherals Manual
Introduction
Processor Peripherals
The term processor peripherals refers to the multiple on-chip functional
blocks used to communicate with off-chip devices. The ADSP-2126x processor peripherals include the JTAG, Parallel, Serial, SPI ports, DAI
components (PCG, Timers, and IDP), and any external devices that connect to the processor.
Dual-Ported Internal Memory (SRAM)
The individual ADSP-2126x processor products contain varying amounts
of memory. For example, the ADSP-21262 processor provides 2M bits of
internal SRAM and 2M bits of internal ROM, each of which is organized
as two blocks of 1M bit. Each memory block of SRAM is dual-ported for
single cycle, independent accesses by the core processor and I/O processor.
The dual-ported memory and separate on-chip buses allow two data transfers from the core and one from I/O, all in a single cycle.
All of the memory can be accessed as 16-, 32-, 48-, or 64-bit words. The
amount of memory for each word size changes, based on the part number.
On the ADSP-2126x processor, the memory can be configured as a maximum of 64K words of 32-bit data, 128K words of 16-bit data, 42K words
of 48-bit instructions (and 40-bit data), or combinations of different word
sizes up to 2M bits.
The processor also supports a 16-bit floating-point storage format, which
effectively doubles the amount of data that may be stored on chip. Conversion between the 32-bit floating-point and 16-bit floating-point
formats completes in a single instruction.
While each memory block can store combinations of code and data,
accesses are most efficient when one block stores data, (using the DM bus
for transfers), and the other block stores instructions and data, (using the
PM bus for transfers). Using the DM bus and PM bus in this way, with
one dedicated to each memory block, assures single-cycle execution with
two data transfers. In this case, the instruction must be available in the
ADSP-2126x SHARC Processor Peripherals Manual1-7
Architectural Overview
cache. The processor also maintains single-cycle execution when one of
the data operands is transferred to or from off-chip, using the processor
parallel port.
I/O Processor
The ADSP-2126x processor Input/Output Processor (IOP) manages the
SHARC processor’s off-chip data I/O to alleviate the core of this burden.
Up to 22 simultaneous DMA transfers (22 DMA channels) are supported
for transfers between internal memory and serial ports (12), the input data
port (IDP) (8), SPI port (1), and the parallel port. The I/O processor can
perform DMA transfers between the peripherals and internal memory at
the full core clock speed. The dual-ported architecture of the internal
memory allows the IOP and the core to access internal memory simultaneously with no reduction in throughput.
Serial Ports. The ADSP-2126x processor features up to six synchronous
serial ports that provide an inexpensive interface to a wide variety of digital and mixed-signal peripheral devices. The serial ports can operate at up
to up to half of the processor core clock rate with maximum of 50M bits
per second. Each serial port features two data pins that function as a pair
based on the same serial clock and frame sync. Accordingly, each serial
port has two DMA channels and serial data buffers associated with it to
service the dual serial data pins. Programmable data direction provides
greater flexibility for serial communications. Serial port data can automatically transfer to and from on-chip memory using DMA. Each of the serial
ports offers a TDM multichannel mode (up to 128 channels) and supports
μ-law or A-law companding. I
2
S support is also provided.
The serial ports can operate with least significant bit first (LSBF) or most
significant bit first (MSBF) transmission order, with word lengths from
three to 32 bits. The serial ports offer selectable synchronization and
transmit modes. Serial port clocks and frame syncs can be internally or
externally generated.
1-8ADSP-2126x SHARC Processor Peripherals Manual
Introduction
Parallel Port. The ADSP-2126x processor parallel port provides the processor interface to asynchronous 8-bit memory. The parallel port supports
a 66M bytes per second transfer rate and 256 word page boundaries. The
on-chip DMA controller automatically packs external data into the appropriate word width during transfers.
The parallel port supports packing of 32-bit words into 8-bit or 16-bit
external memory and programmable external data access duration from 3
to 32 clock cycles.
Serial Peripheral (Compatible) Interface (SPI). The ADSP-2126x processor SPI is an industry standard synchronous serial link that enables the
SPI-compatible port to communicate with other SPI-compatible devices.
SPI is an interface consisting of two data pins, one device select pin, and
one clock pin. It is a full-duplex synchronous serial interface, supporting
both master and slave modes. It can operate in a multi master environment by interfacing with up to four other SPI-compatible devices, either
acting as a master or slave device.
The SPI-compatible peripheral implementation also supports programmable baud rate and clock phase/polarities, as well as the use of open drain
drivers to support the multi master scenario to avoid data contention.
ROM Based Security. For ADSP-2126x processors with application code
in the on-chip ROM, an optional ROM security feature is included. This
feature provides hardware support for securing user software code by preventing unauthorized reading from the enabled code. The processor does
not boot-load any external code, executing exclusively from internal
ROM. The processor also is not freely accessible via the JTAG port.
Instead, a 64-bit key is assigned to the user. This key must be scanned in
through the JTAG or Test Access Port. The device ignores a wrong key.
Emulation features and external boot modes are only available after the
correct key is scanned.
ADSP-2126x SHARC Processor Peripherals Manual1-9
Development Tools
Digital Audio Interface (DAI)
The Digital Audio Interface (DAI) unit is a new addition to the SHARC
processor peripherals. This set of audio peripherals consists of an interrupt
controller, an interface data port, and a signal routing unit.
Interrupt Controller. The DAI contains its own interrupt controller that
indicates to the core when DAI audio events have occurred. This interrupt
controller offers up to 32 independently configurable channels.
Input Data Port (IDP). The input data port provides the DAI with a way
to transmit data from within the DAI to the core. The IDP provides a
means for up to eight additional DMA paths from the DAI into on-chip
memory. All eight channels support 24-bit wide data and share a 16-deep
FIFO.
Signal Routing Unit (SRU). Conceptually similar to a “patch-bay” or
multiplexer, the SRU provides a group of registers that define the interconnection of the serial ports, the interface data port, the DAI pins, and
the precision clock generators.
Development Tools
The ADSP-2126x processor is supported by VisualDSP++, an easy to use
Integrated Development & 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.
1-10ADSP-2126x SHARC Processor Peripherals Manual
Introduction
Differences From Previous SHARCs
This section identifies differences between the ADSP-2126x processor and
previous SHARCs: ADSP-21161, ADSP-21160, ADSP-21060,
ADSP-21061, ADSP-21062, and ADSP-21065L. Like the ADSP-2116x
family, the ADSP-2126x processor family is based on the original
ADSP-2106x SHARC family. The ADSP-2126x processor preserves 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
processors, see the ADSP-2106x SHARC User’s Manual or the
ADSP-21065L SHARC DSP Technical Reference.
Processor Core Enhancements
Computational bandwidth on the ADSP-2126x processor is significantly
greater than that on the ADSP-2106x processors. The increase comes
from raising the operational frequency and adding another processing element: ALU, shifter, multiplier, and register file. The new processing
element lets the processor process multiple data streams in parallel (SIMD
mode). The processor operates at 200 MHz using a three stage pipeline.
Like the ADSP-21160 processor, the program sequencer on the
ADSP-2126x processor differs from the ADSP-2106x processor family,
having several enhancements: new interrupt vector table definitions,
SIMD mode stack and conditional execution model, and instruction
decodes associated with new instructions. Interrupt vectors have been
added that detect illegal memory accesses. Also, mode stack and mode
mask support have been added to improve context switch time.
As with the ADSP-21160 processor, the DAGs on the ADSP-2126x processor differ from the ADSP-2106x processors in that DAG2 (for the PM
bus) has the same addressing capability as DAG1 (for the DM bus). The
DAG registers move 64 bits per cycle. Additionally, the DAGs support the
new memory map and long word transfer capability. Circular buffering on
ADSP-2126x SHARC Processor Peripherals Manual1-11
Differences From Previous SHARCs
the ADSP-2126x processor can be quickly disabled on interrupts and
restored on the return. Data “broadcast”, from one memory location to
both data register files, is determined by appropriate index register usage.
Processor Internal Bus Enhancements
The PM, DM, and I/O data buses have increased from 32 bits on the
ADSP-2106x DSPs to 64 bits. Additional multiplexing and control logic
enable 16-, 32-, or 64-bit wide moves between both register files and
memory. The processor is capable of broadcasting a single memory location to each of the register files in parallel. Also, the processor permits
register contents to be exchanged between the two processing elements’
register files in a single cycle.
Memory Organization Enhancements
The ADSP-2126x processor memory map differs from that of the
ADSP-2106x DSPs. The system memory map supports double-word
transfers each cycle, reflects extended internal memory capacity for derivative designs, and works with an updated control register for SIMD
support. The ADSP-2126x processor family provides enough on-chip
memory for several audio decoders.
Parallel Port Enhancements
The parallel port differs from that of the ADSP-2106x DSPs. A new packing mode permits DMA for instructions and data to and from 8-bit
external memory. The parallel port supports SRAM, EPROM, and flash
memory. There are two modes supported for transfers. In one mode, 8-bit
data and 8-bit address can be transferred. In another mode, data and
address lines are multiplexed to transfer 16 bits of address/data.
1-12ADSP-2126x SHARC Processor Peripherals Manual
Introduction
I/O Architecture Enhancements
The I/O processor on the provides much greater throughput than that on
the ADSP-2106x DSPs.
The ADSP-2126x processor DMA controller supports up to 22 channels
compared to 14 channels on the ADSP-21161 processor. DMA transfers
occur at clock speed in parallel with full speed processor execution.
Instruction Set Enhancements
The ADSP-2126x processor provides source code compatibility with the
previous SHARC processor family members, to the application assembly
source code level. All instructions, control registers, and system resources
available in the ADSP-2106x core programming model are also available
in the ADSP-2126x processor. Instructions, control registers, or other
facilities, required to support the new feature set of the ADSP-2116x core
include:
•Code compatibility to the ADSP-21160 SIMD core
•Supersets of the ADSP-2106x programming model
•Reserved facilities in the ADSP-2106x programming model
•Symbol name changes from the ADSP-2106x programming models
These name changes can be managed through reassembly by using the
development tools to apply the ADSP-2126x processor symbol definitions
header file and linker description file. While these changes have no direct
impact on existing core applications, system and I/O processor initialization code and control code do require modifications.
ADSP-2126x SHARC Processor Peripherals Manual1-13
Differences From Previous SHARCs
Although the porting of source code written for the ADSP-2106x family
to the ADSP-2126x processor has been simplified, code changes will be
required to take full advantage of the new ADSP-2126x processor features.
For more information, see the ADSP-21160 SHARC DSP Instruction Set Reference.
1-14ADSP-2126x SHARC Processor Peripherals Manual
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 ADSP-2126x processor 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. These operations
include the transfer types listed below and shown in Figure 2-3 on
page 2-22:
•Internal memory ↔ external memory devices
•Internal memory ↔ serial port I/O
•Internal memory ↔ SPI I/O
•Internal memory ← Digital Audio Interface (DAI)
By managing DMA, the I/O processor frees the processor core, allowing it
to perform other processor operations while off-chip data I/O occurs as a
background task. The dual-ported internal memory allows the core and
IOP to simultaneously access the same block of internal memory. 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 DMAs of processor memory through the parallel, SPI, input data port (IDP) and serial ports.
Each DMA is referred to as a channel, and each channel is configured
independently.
ADSP-2126x SHARC Processor Peripherals Manual2-1
General Procedure for Configuring DMA
There are 22 channels of DMA available on the ADSP-2126x processor—
one channel for the SPI interface, one channel for the parallel port interface, 12 channels via the serial ports, and eight channels for the input data
port (IDP). Another DMA feature is interrupt generation upon completion of a DMA transfer or upon completion of a chain of DMAs.
General Procedure for Configuring DMA
To configure the ADSP-2126x processor to use DMA, use the following
general procedure.
1. Determine which DMA options you want to use:
•IOP/Core interaction method – Interrupt driven or status
driven (polling)
•DMA transfer method – Chained or Non chained
•Channel priority scheme – fixed or rotating
2. Determine how you want the DMA to operate:
•Determine and set up the data’s source and/or destination
addresses (INDEX)
•Set up the word COUNT (data buffer size)
•Configure the MODIFY values (step size)
3. Configure the peripheral(s):
•Serial ports (SPORTs)
•Parallel port (PP)
•Input data port (IDP)
2-2ADSP-2126x SHARC Processor Peripherals Manual
I/O Processor
4. Enable DMA
•Set the applicable bits in the appropriate registers:
–parallel port–
PPDEN in PPCTL
–serial port–SDEN_x (SCHEN_x for chaining) in SPCTLx
–SPI–SPIDEN (SPICHEN for chaining) in SPIDMAC
–IDP–IDP_DMA_EN in the IDP_CTL
IOP/Core Interaction Options
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.
The following sections describe both methods in detail.
Interrupt Driven I/O
Interrupts on the ADSP-2126x processor are generated at the end of a
DMA transfer. This happens when the count register for a particular
channel decrements to zero. The interrupt vector locations for each of the
channels are listed in Table 2-1. The interrupt register diagram and bit
descriptions are given in the ADSP-2126x SHARC Processor Core Manual
and “DAI Interrupt Controller Registers” on page A-110.
Programs can check the appropriate status register (for example
PPCTL for
the parallel port) to determine which 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. The only exception to
this is the
IDP_DMAx_STAT bits of the DAI_STAT register can become active
even if DMA, through some IDP channel, is not intended.
ADSP-2126x SHARC Processor Peripherals Manual2-3
IOP/Core Interaction Options
The following are some other I/O processor interrupt attributes.
•When an unchained (single block) DMA process reaches completion (as the 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
DAI_IRPTL_H, or DAI_IRPTL_L registers.
•For chained DMA, the I/O processor generates interrupts in one of
two ways: If PCI = 1, an interrupt occurs for each DMA in the
chain; if PCI = 0, an interrupt occurs at the end of a complete
chain. (For more information on DMA chaining, see “DMA Con-
troller Operation” on page 2-8).
•When a DMA channel’s buffer is not being used for a DMA process, the I/O processor can generate an interrupt on single word
writes or reads of the buffer. This interrupt service differs slightly
for each port. For more information on single word interrupt-driven transfers, see “Parallel Port Control Register (PPCTL)”
on page A-55, and SPCTL register in Table 4-6 on page 4-51.
IRPTL, LIRPTL,
During interrupt-driven DMA, programs use the interrupt mask bits in
the IMASK, LIRPTL, DAI_IRPTL_PRI, DAI_IRPTL_RE, and DAI_IRPTL_FE registers to selectively mask DMA channel interrupts that the I/O processor
latches into the IRPTL, LIRPTL, DAI_IRPTL_H, and DAI_IRPTL_L registers.
L
2-4ADSP-2126x SHARC Processor Peripherals Manual
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 more word to be transferred or
received and an interrupt is then generated.
I/O Processor
A channel interrupt mask in the
DAI_IRPTL_RE, and DAI_IRPTL_FE registers determines whether a latched
IMASK, LIRPTL, DAI_IRPTL_PRI,
interrupt is to be serviced or not. When an interrupt is masked, it is
latched but not serviced.
By clearing a channel’s PCI bit during chained DMA, programs
L
mask the DMA complete interrupt for a DMA process within a
chained DMA sequence.
The I/O processor can also generate interrupts for I/O port operations
that do not use DMA. In this case, the I/O processor 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. Care is needed
because multiple interrupts can occur if several I/O ports transmit or
receive data in the same cycle.
The SPI has two interrupts—a lower priority option (
Interrupt
Name
DAIHI
DAILI
DAIHI
DAILI
DMA
Channel
18IDP_FIF0
19IDP_FIF0
Data Buffer
SPILI) and a higher
priority option (SPIHI). This allows two interrupts to have priorities that
are higher and lower than serial ports.
The DAI also has two interrupts—the lower priority option (DAILI) and
higher priority option (DAIHI). This allows two interrupts to have priorities that are higher and lower than serial ports.
Polling/Status Driven I/O
The second method of controlling I/O is through status polling. The I/O
processor monitors the status of data transfers on DMA channels and indicates interrupt status in the
registers. Note that because polling uses processor resources it is not as
efficient as an interrupt-driven system. Also note that polling the DMA
status registers reduces I/O bandwidth. The following provide more information on the registers that control and monitor I/O processes.
IRPTL, LIRPTL, DAI_IRPTL_H, and DAI_IRPTL_L
•All the bits in
IRPTL and LIRPTL registers are shown in the
ADSP-2126x SHARC Processor Core Manual.
•Figure A-59 on page A-112 lists all the bits in DAI_IRPTL_H.
•Figure A-60 on page A-113 lists all the bits in DAI_IRPTL_L.
ADSP-2126x SHARC Processor Peripherals Manual2-7
IOP/Core Interaction Options
The DMA controller in the ADSP-2126x processor maintains the status
information of the channels in each of the peripherals registers,
PPCTL, DAI_STAT, and SPIDMAC. More information on these registers can be
found at the following locations.
•Bit definitions for the SPIDMAC register are illustrated in “SPI DMA
Configuration Register (SPIDMAC)” on page A-50.
•Bit definitions for the SPMCTLxy register are illustrated in “SPORT
Multichannel Control Registers (SPMCTLxy)” on page A-28.
•Bit definitions for the PPCTL register are illustrated in “Parallel Port
Control Register (PPCTL)” on page A-55.
•Bit definitions for the DAI_STAT register are illustrated in
Figure A-56 on page A-105.
SPMCTLxy,
L
L
There is a one cycle latency between a change in DMA channel status and the status update in the corresponding register.
If chaining is enabled on a DMA channel, programs should not use
polling to determine channel status as it can provide inaccurate
information. In this case, the DMA appears inactive if it is sampled
while the next transfer control block (TCB) is loading.
DMA Controller Operation
There are two methods you can use to start DMA sequences: chaining and
non-chaining.
Non-chained DMA. To start a new DMA sequence after the current one
is finished, a program must first clear the DMA enable bit, write new
parameters to the index, modify, and count registers, then set the DMA
enable bit to re-enable DMA.
2-8ADSP-2126x SHARC Processor Peripherals Manual
I/O Processor
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
pointed to by that channel’s chain pointer (
programs can set up consecutive DMA operations and each operation can
have different attributes.
CP) register. Using chaining,
L
In general, a DMA sequence starts when one of the following occurs:
A DMA sequence ends when one of the following occurs:
Chaining is only supported on the SPI and SPORT DMA channels. The parallel port, and IDP port do not support chaining.
•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 nonzero 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.
•The count register decrements to zero, and the CP 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 and the
DMA sequence continues. For more information, see “Inserting a
TCB in an Active Chain” on page 2-15.
Once a program starts a DMA process, the process is influenced by two
external controls—DMA channel priority and DMA chaining. For more
information, see “Managing DMA Channel Priority” on page 2-17 or
“Chaining DMA Processes” below.
ADSP-2126x SHARC Processor Peripherals Manual2-9
IOP/Core Interaction Options
Chaining DMA Processes
The location of the DMA parameters for the next sequence comes from
the chain pointer (
CP) register. In chained DMA operations, the
ADSP-2126x processor automatically initializes and then begins another
DMA transfer when the current DMA transfer is complete. In addition to
the standard DMA parameter registers, each DMA channel (SP and SPI)
also has a CP register that points to the next set of DMA parameters stored
in the processor’s internal memory. In the SPI this is the CPSPI and in the
SPORT it is CPSPxy. Each new set of parameters is stored in a four-word,
user initialized buffer in internal memory known as a transfer control
block (TCB). In TCB chain loading, the ADSP-2126x processor’s IOP
automatically reads the TCB from internal memory and then loads the
values into the channel parameter registers to set up the next DMA
sequence.
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 constantly reiterate the same DMA.
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. This bit must be set to one to
enable chaining. When chaining is enabled, DMA transfers are initiated
by writing a memory address to the
CP register. This is also an easy way to
start a single DMA sequence, with no subsequent chained DMAs.
The CP register can be loaded at any time during the DMA sequence. This
allows a DMA channel to have chaining disabled (
field = 0x0000) until some event occurs that loads the
CP register address
CP register with a
nonzero value. Writing all zeros to the address field of the chain pointer
register (
CP) also disables chaining.
2-10ADSP-2126x SHARC Processor Peripherals Manual
I/O Processor
L
nel. The processor does not support cross-channel chaining.
The parallel port and IDP port do not support DMA chaining.
L
Chained DMA operations may only occur within the same chan-
Address pointer
to next TCB
Chaining is not available on the IDP or parallel ports.
An “x” denotes the DMA channel used.
CPSPx
CSPx
IMSPx
IISPx
Figure 2-1. TCB Chaining
The chain pointer register is 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
ADSP-2126x processor, this offset value is 0x0008 0000.
Lowest
Address
Highest
Address
Bit 19 of the chain pointer register is the Program Controlled Interrupts
(PCI) bit. This bit controls whether an interrupt is latched after each
DMA completes or whether the interrupt is latched after the entire DMA
sequence completes. If set, the
PCI bit enables a DMA channel interrupt to
occur after every DMA in the chain. If cleared, an interrupt occurs at the
completion of the entire DMA sequence.
The PCI bit only effects DMA channels that have chaining enabled.
L
Also, interrupt requests enabled by the
IMASK register.
the
PCI bit are maskable with
ADSP-2126x SHARC Processor Peripherals Manual2-11
IOP/Core Interaction Options
Because the
PCI bit is not part of the memory address in the chain pointer
register, programs must use care when writing and reading addresses to
and from the register. To prevent errors, programs should mask out the
PCI bit (bit 19) when copying the address in a chain pointer to another
IF THIS BIT IS SET, THE I/O PROCESSOR WILLGENERATE A
DMA INTERRUPT AFTER EVERY DMA IN THE CHAIN.
PCI BIT
Figure 2-2. DMA Parameter Registers
Transfer Control Block Chain Loading (TCB)
During TCB chain loading, the I/O processor loads the DMA channel
parameter registers with values retrieved from internal memory. The
address in the chain pointer register points to the highest address of the
2-12ADSP-2126x SHARC Processor Peripherals Manual
I/O Processor
TCB (containing the index parameter). This means that if a program
declares an array to hold the TCB, the
CP register should not point to the
first location of the array. Instead the CP register should point to array[3].
Table 2-2 shows the TCB-to-register loading sequence for the serial port
and SPI port DMA channels. The I/O processor reads each word of the
TCB and loads it into the corresponding register. Programs must set up
the TCB in memory in the order shown in Table 2-2, placing the index
parameter at the address pointed to by the CP 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 CP value of zero.
Table 2-2. TCB Chain Loading Sequence
2
Address
CPSPx + 0x0008 0000IISPxIISPI
CPSPx – 1 + 0x0008 0000IMSPxIMSPI
CPSPx – 2 + 0x0008 0000CSPx CSPI
CPSPx – 3 + 0x0008 0000CPSPxCPSPI
1 Chaining is not available using the IDP or parallel ports.
2 An “x” denotes the DMA channel used. While the TCB is eight locations
in length, SPI and serial ports only use the first four locations.
Serial PortsSPI Port
1
A TCB chain load request is prioritized like all other DMA operations.
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 registers for the highest priority
DMA channel first. A channel that is in the process of chain loading cannot be interrupted by a higher priority channel. For a list of DMA
channels in priority order, see Table 2-5 on page 2-28.
ADSP-2126x SHARC Processor Peripherals Manual2-13
IOP/Core Interaction Options
Setting Up and Starting the Chain
To set up and initiate a chain of DMA operations, use these steps:
1. Set up all TCBs in internal memory.
2. Write to the appropriate DMA control register, setting the DMA
enable bit to one and the chaining enable bit to one.
3. Write the address containing the index register value of the first
TCB to the chain pointer register, which starts the chain.
The I/O processor responds by autoinitializing the first DMA parameter
registers with the values from the first TCB, and then starts the first data
transfer.
Setting Up and Starting Chained DMA over the SPI
Configuring and starting chained DMA transfers over the SPI port is the
same as for the serial port, with one exception. Contrary to SPORT DMA
chaining, (where the first DMA in the chain is configured by the first
TCB), for SPI DMA chaining, the first DMA is not initialized by a TCB.
Instead, the first DMA in the chain must be loaded into the SPI parameter
registers (
points to a TCB that describes the second DMA in the sequence.
IISPI, IMSPI, CSPI), and the chain pointer register (CPSPI)
L
The sequence for setting up and starting a chained DMA is outlined in the
following steps and can also be seen in Listing 5-3 on page 5-60.
2-14ADSP-2126x SHARC Processor Peripherals Manual
Writing an address to the CPSPI register does not begin a chained
DMA sequence unless IISPI, IMSPI, and CSPI are initialized, SPI
DMA is enabled, the SPI port is enabled, and SPI DMA chaining is
enabled.
1. Configure the TCB associated with each DMA in the chain except
for the first DMA in the chain.
I/O Processor
2. Write the first three parameters for the initial DMA to the
IMSPI, and CSPI registers directly.
IISPI,
3. Select a baud rate using the SPIBAUD register.
4. Select which flag to use as the SPI slave select signal in the SPIFLG
register.
5. Configure and enable the SPI port with the SPICTL register.
6. Configure the DMA settings for the entire sequence, enabling
DMA and DMA chaining in the SPIDMAC register.
7. Begin the DMA by writing the address of a TCB (describing the
second DMA in the chain) to the CPSPI register.
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 PCI bit. Programs should clear the upper bits of
the address, then AND the PCI bit separately, if needed. For example:
R0 = next_TCB+3; /* addr of next chain */
R1 = 0x7FFFF; /* mask 19 bits */
R0 = R0 or R1;
CPx = R0;
Inserting a TCB in an Active Chain
This is supported by serial ports only. The SPI interface does not
[
support inserting a TCB in an active chain.
It is possible to insert a single DMA operation or another DMA chain
within an active DMA chain. Programs may need to perform insertion
when a high priority DMA requires service and cannot wait for the current chain to finish.
ADSP-2126x SHARC Processor Peripherals Manual2-15
IOP/Core Interaction Options
When DMA on a channel is disabled and chaining on the channel is
enabled, the DMA channel is in chain insertion mode. This mode lets a
program insert a new DMA or DMA chain within the current chain without effecting the current DMA transfer. Use the following sequence to
insert a DMA subchain for the serial port 0A channel while another chain
is active:
1. Enter chain insertion mode by setting
in the channel’s DMA control register, SPCTL0. The DMA interrupt indicates when the current DMA sequence has completed.
2. Copy the address currently held in the chain pointer register to the
chain pointer position of the last TCB in the chain that is being
inserted.
3. Write the start address of the first TCB of the new chain into the
chain pointer register.
4. Resume chained DMA mode by setting SCHEN_A = 1 and
SDEN_A = 1.
Chain insertion mode operates the same as non-chained DMA mode.
When the current DMA transfer ends, an interrupt request occurs and no
TCBs are loaded. This interrupt request is independent of the PCI bit
state.
L
Chain insertion should not be set up as an initial mode of operation. This mode should only be used to insert one or more TCBs
into an active DMA chaining sequence.
SCHEN_A = 1 and SDEN_A = 0
Setting Up DMA Channel Allocation and Priorities
The ADSP-2126x processor has 22 DMA channels including 12 channels
accessible via the serial ports, one SPI channel, one parallel port channel,
and eight input data port channels. Each channel has a set of parameter
registers which are used to set up DMA transfers. Table 2-3 shows the
2-16ADSP-2126x SHARC Processor Peripherals Manual
I/O Processor
DMA channel allocation and parameter register assignments for the
ADSP-2126x processor. DMA channel 0 has the highest priority and
DMA channel 21 has the lowest priority.
Managing DMA Channel Priority
The default channel priority is: DMA channel 0 as highest priority and
DMA channel 22 as lowest priority. Table 2-5 on page 2-28 lists the
DMA channels in priority order. When a channel becomes the highest
priority requester, the I/O processor services the channel’s request. In the
next clock cycle, the I/O processor starts the DMA transfer.
The I/O data (IOD) bus is 32 bits wide and is the only 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 parallel port may fill its
word into its RXn 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.
RXPP buffer just as a SPORT shifts a
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. Figure 2-4 on page 2-27 shows the
paths for internal DMA requests within the I/O processor.
L
ADSP-2126x SHARC Processor Peripherals Manual2-17
If a DMA channel is disabled (PPDEN, SPIDEN, SDEN, or IDP_DMA_EN
bits =0), the I/O processor does not issue internal DMA grants to
that channel (whether or not the channel has data to transfer).
IOP/Core Interaction Options
The default DMA channel priority is fixed prioritization by DMA channel
group (serial ports, parallel port, IDP, or SPI port). Table 2-5 on
page 2-28 lists the DMA channels in descending order of priority.
For information on programming serial port priority modes, see Table 4-7
on page 4-65.
The I/O processor determines which DMA channel has the highest priority internal DMA request during every cycle between each data transfer.
Processor core accesses of I/O processor registers and TCB chain loading
(both of which occur after the IOD transfer) are subject to the same prioritization scheme as the DMA channels. Applying this scheme uniformly
prevents I/O bus contention, because these accesses are also performed
over the internal I/O bus. For more information, see “Chaining DMA
Processes” on page 2-10.
DMA Bus Arbitration
DMA channel arbitration is the method that the IOP uses to determine
how groups rotate priority with other channels. This feature is enabled by
setting the
DCPR bit in the IOP’s SYSCTL register.
DMA-capable peripherals execute DMA data transfers to and from internal memory over the IOD bus. When more than one of these peripherals
requests access to the IOD bus in a clock cycle, the bus arbiter, which is
attached to the IOD bus, determines which master should have access to
the bus and grants the bus to that master.
IOP channel arbitration can be set to use either a fixed (
SYSCTL[7] = 0) or
rotating (SYSCTL[7] = 1) algorithm.
In the fixed priority scheme, the lower indexed peripheral has the highest
priority.
2-18ADSP-2126x SHARC Processor Peripherals Manual
I/O Processor
In the rotating priority scheme, the default priorities at reset are the same
as that of the fixed priority. However, the peripheral priority is determined by group, not individually. Peripheral groups are shown in
Table 2-3.
Initially, Group A has the highest priority and Group F 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-3). For example in SP01 (group A), SP1 has the
highest priority.
Table 2-3. DMA Channel Allocation and Parameter Register
Assignments
DMA
Channel
Number
0 (highest
priority)
1RXSP1B, TXSP1BA0xC67, 0xC66Serial Port 1B Data
2RXSP0A, TXSP0AA0xC61, 0xC60Serial Port 0A Data
3RXSP0B, TXSP0BA0xC63, 0xC62Serial Port 0
4RXSP3A, TXSP3AB0x465, 0x464Serial Port 3A Data
5RXSP3B, TXSP3BB0x467, 0x466Serial Port 3B Data
6RXSP2A, TXSP2AB0x461, 0x460Serial Port 2A Data
7RXSP2B, TXSP2BB0x463, 0x462Serial Port 2B Data
Data BufferGroupIOP Address of Data
Buffers
RXSP1A, TXSP1AA0xC65, 0xC64Serial Port 1A Data
Description
B Data
ADSP-2126x SHARC Processor Peripherals Manual2-19
Setting Up DMA Parameter Registers
Table 2-3. DMA Channel Allocation and Parameter Register
Assignments (Cont’d)
DMA
Channel
Number
8RXSP5A, TXSP5AC0x865 or 0x864Serial Port 5A Data
9RXSP5B, TXSP5BC0x867 or 0x866Serial Port 5B Data
10RXSP4A, TXSP4AC0x861 or 0x860Serial Port 4A Data
11RXSP4B, TXSP4BC0x863 or 0x862Serial Port 4B Data
12IDP_FIF0D0x24D0DAI IDP Channel 0
13IDP_FIF0D0x24D0DAI IDP Channel 1
14IDP_FIF0D0x24D0DAI IDP Channel 2
15IDP_FIF0D0x24D0DAI IDP Channel 3
16IDP_FIF0D0x24D0DAI IPD Channel 4
17IDP_FIF0D0x24D0DAI IDP Channel 5
18IDP_FIF0D0x24D0DAI IDP Channel 6
19IDP_FIF0D0x24D0DAI IDP Channel 7
20RXSPI, TXSPI E0x1004, 0x1003SPI Data
21 (lowest
priority)
Data BufferGroupIOP Address of Data
Buffers
RXPP, TXPPF0x1809, 0x1808Parallel Port Data
Description
Setting Up DMA Parameter Registers
Once you have determined and configured the DMA options, you can
configure the DMA parameter registers. The parameter registers control
the source and destination of the data, the size of the data buffer, and the
step size used. These topics are described in detail in the following
sections.
2-20ADSP-2126x SHARC Processor Peripherals Manual
I/O Processor
DMA Transfer Direction
DMA transfers between internal memory and external memory devices use
the processor’s parallel port. For these types of transfers, a program provides the DMA controller with the internal memory buffer size, address,
and address modifier, as well as the external memory buffer size, address
and 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-4 on page 2-25 shows the parameter registers for each DMA
channel.
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 I/O port 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-4 on page 2-27 shows more detail on DMA
channel data paths. Figure 2-3 shows the processor’s I/O processor,
related ports, and buses.
ADSP-2126x SHARC Processor Peripherals Manual2-21
Setting Up DMA Parameter Registers
IOA BUS
IOD BUS
DMD, PMD
BUSES(TO CORE)
SPORT
IISP5A-0A,
IISP5B-0B,
IMSP5A-0A,
IMSP5B-0B
CSP5A-0A,
CSP5B-0B,
CPSP5A-0A,
CPSP5B-0B
SPI
IISPI, IMSPI,
CSPI, CPSPI
PARALLEL
PORT
EIPP, EMPP,
ECPP, IIPP,
IMPP, ICPP
IDP
IDP_DMA_IX
IDP_DMA_MX
IDP_DMA_CX
MUX
INTERNAL
DMA
PRIORITI ZER
I/O
PROCESSOR
MUX
SPI D MA
FIFO
(4 DEEP)
Figure 2-3. I/O Processor Block Diagram
SPORTS
TXSP5A-0A,
TXSP5B-0B,
RXSP5A-0A,
RXSP5B-0B
(2 DEEP)
SPI PORT
RXSPI, TXSPI
(1 DEEP EACH)
PARAL LEL
PORT
RXPP, TXPP
(2 DEEP EACH)
EXTERNAL
ADDRESS
GENERATOR
IDP
IDP FIFO
8DEEP
2-22ADSP-2126x SHARC Processor Peripherals Manual
I/O Processor
Data Buffer Registers
The data buffer registers in Figure 2-3 on page 2-22 shows the data buffer
registers for each port. These registers include:
•Serial Port Receive Buffer (RXSPx). These receive buffers for the
serial ports have two position FIFOs for receiving data when connected to another serial device.
•Serial Port Transmit Buffer (TXSPx). These transmit buffers for
the serial ports have two position FIFOs for transmitting data
when connected to another serial device.
•SPI Receive Buffer (RXSPI). This receive buffer for the SPI port has
a single position buffer for receiving data when connected to
another serial device.
•SPI Transmit Buffer (TXSPI). This transmit buffer for the SPI port
has a single position buffer for transmitting data when connected
to another serial device.
•Parallel Port Transmit Buffer (TXPP). This transmit buffer for the
parallel port has two-position FIFOs for transmitting data when
connected to another device.
•Parallel Port Receive Buffer (RXPP). This receive buffer for the par-
allel port has two position FIFOs for receiving data when
connected to another parallel device.
•Input Data Port Buffers (
IDP_FIFO). This receive buffer for the
input data port has eight position buffers for receiving data when
connected to another device.
ADSP-2126x SHARC Processor Peripherals Manual2-23
Setting Up DMA Parameter Registers
Port, Buffer, and DMA Control Registers
The Port, Buffer, and DMA Control Registers in Figure 2-3 shows the
control registers for the ports and DMA channels. These registers include:
•Parallel Port Control register (PPCTL). This register enables the
parallel port system, DMA, and external data width. It also configures wait states, bus hold cycles and identifies the status of the
parallel port FIFO, internal, and external interfaces.
•Input Data Port Control register (IDP_CTL). This is the control
register for input data ports.
•Serial Port Control registers (SPCTLx, SPMCTLxy). These control
registers select the receive or transmit format, monitor FIFO status,
enable chaining, and start DMA for each serial port.
•SPI Port Control register (SPICTL). This control register config-
ures and enables the SPI interface, selects the device as master or
slave, and determines the data transfer and word size. The SPIDMAC
register also controls SPI DMA and FIFO status.
Table 2-4 shows the parameter registers for each DMA channel. These
registers function similarly to data address generator registers and include:
•Internal Index registers (IISPx, IISPI, IIPP, IDP_DMA_Ix). Index
registers provide an internal memory address, acting as a pointer to
the next internal memory DMA read or write location.
•Internal Modify registers (
IMSPx, IMPP, IMSPI, IDP_DMA_Mx). Mod-
ify registers provide the signed increment by which the DMA
controller post-modifies the corresponding internal memory index
register after the DMA read or write.
indicate the number of words remaining to be transferred to or
from internal memory on the corresponding DMA channel.
2-24ADSP-2126x SHARC Processor Peripherals Manual
I/O Processor
•Chain Pointer registers (
CPSPx, CPSPI). 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.
•External Index registers (EIPP). Index registers provide an external
memory address, acting as a pointer to the next external memory
DMA read or write location.
•External Modify registers (EMPP). Modify registers provide the
increment by which the DMA controller post-modifies the corresponding external memory index register after the DMA read or
write.
IIyInternal Index Register19 bitsAddress of buffer in internal
memory
IMxyInternal Modify Register16 bits
CxyInternal Count Register16 bitsLength of internal buffer
CPxyChain Pointer Register20 bitsChain pointer for DMA
EIPPExternal Index Register19 bitsAddress of buffer in external
EMPPExternal Modify Register2 bitsStride for external buffer
ECPPExternal Count Register16 bitsLength of external buffer
1 IDP_DMA_Mx are 6 bits wide only.
1
Stride for internal buffer
chaining
memory
ADSP-2126x SHARC Processor Peripherals Manual2-25
Setting Up DMA Parameter Registers
Addressing
Figure 2-4 shows a block diagram of the I/O processor’s address generator
(DMA controller). Table 2-4 lists the parameter registers for each DMA
channel. The parameter registers are uninitialized following a processor
reset.
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
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.
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 ADSP-2126x processor, this offset value is 0x0008 0000.
DMA addresses must always be normal word (32-bit) memory, and internal memory data transfer sizes are 32 bits. External data transfer sizes may
be 16 or 8 bits. The I/O processor can transfer short word data (16-bit)
using the packing capability of the serial port and SPI port DMA
channels.
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
2-26ADSP-2126x SHARC Processor Peripherals Manual
DMA ADDRESS GENERATOR (INTERNAL ADDRESSES)
LOCAL BUS
I/O Processor
INTERNAL
MEMORY
ADDRESS
IIX
INDEX (ADDRESS)
IMX
MODIFIER
+/-
POST-MODIFY
DMA WORD COUNTER
LOCAL BUS
–1
CX
COUNT
CPX
CHAIN POINTER
+
WORKING REGISTER
MUX
DMA ADDRESS GENERATOR (EXTERNAL ADDRESSES)
LOCAL BUS
EXTERNAL
MEMORY
ADDRESS
EIPP
EXT. INDEX (ADDRESS)
EMPP
EXT. MODIFIER
ECPP
EXT. COUNT
+
–1
POST-MODIFY
+
Figure 2-4. DMA Address Generator
ADSP-2126x SHARC Processor Peripherals Manual2-27
Setting Up DMA Parameter Registers
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.
L
[
L
The processor’s 22 DMA channels are numbered as shown in Table 2-5.
This table also shows the control, parameter, and data buffer registers that
correspond to each channel.
Note: In SP01, SP1 has a higher priority. Similarly, for SP23 and SP45,
the odd numbered SPs have a higher priority (SP3, SP5).
If the I/O processor modifies the index register past the maximum
18-bit value to indicate an address out of internal memory, the
index wraps around to zero. With the offset for the ADSP-2126x
processor, the wraparound address is 0x0008 0000.
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.
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.
Table 2-5. DMA Channel Registers: Controls, Parameters,
and Buffers
DMA
Channel
Number
0SPCTL1IISP1A, IMSP1A,
1SPCTL1IISP1B, IMSP1B,
2-28ADSP-2126x SHARC Processor Peripherals Manual
Control
Registers
Parameter RegistersBuffer RegistersDescription
RXSP1A, TXSP1ASerial Port 1A Data
CSP1A, CPSP1A
RXSP1B, TXSP1BSerial Port 1B Data
CSP1B, CPSP1B
Table 2-5. DMA Channel Registers: Controls, Parameters,
and Buffers (Cont’d)
I/O Processor
DMA
Channel
Number
2SPCTL0IISP0A, IMSP0A,
3SPCTL0IISP0B, IMSP0B,
4SPCTL3IISP3A, IMSP3A,
5SPCTL3IISP3B, IMSP3B,
6SPCTL2IISP2A, IMSP2A,
7SPCTL2IISP2B, IMSP2B,
8SPCTL5 IISP5A, IMSP5A,
9SPCTL5IISP5B, IMSP5B,
10SPCTL4IISP4A, IMSP4A,
Control
Registers
Parameter RegistersBuffer RegistersDescription
CSP0A, CPSP0A
CSP0B, CPSP0B
CSP3A, CPSP3A
CSP3B, CPSP3B
CSP2A, CPSP2A
CSP2B, CPSP2B
CSP5A, CPSP5A
CSP5B, CPSP5B
CSP4A, CPSP4A
RXSP0A, TXSP0ASerial Port 0A Data
RXSP0B, TXSP0BSerial Port 0B Data
RXSP3A, TXSP3ASerial Port 3A Data
RXSP3B, TXSP3BSerial Port 3B Data
RXSP2A, TXSP2ASerial Port 2A Data
RXSP2B, TXSP2BSerial Port 2B Data
RXSP5A, TXSP5ASerial Port 5A Data
RXSP5B, TXSP5BSerial Port 5B Data
RXSP4A, TXSP4ASerial Port 4A Data
11SPCTL4IISP4B, IMSP4B,
CSP4B, CPSP4B
12IDP_CTLIDP_DMA_I0,
IDP_DMA_M0,
IDP_DMA_C0
13IDP_CTLIDP_DMA_I1,
IDP_DMA_M1,
IDP_DMA_C1
14IDP_CTLIDP_DMA_I2,
IDP_DMA_M2,
IDP_DMA_C2
RXSP4B, TXSP4BSerial Port 4B Data
IDP_FIFODAI IDP Channel 0
IDP_FIFODAI IDP Channel 1
IDP_FIFODAI IDP Channel 2
ADSP-2126x SHARC Processor Peripherals Manual2-29
Setting Up DMA
Table 2-5. DMA Channel Registers: Controls, Parameters,
and Buffers (Cont’d)
DMA
Channel
Number
15IDP_CTLIDP_DMA_I3,
16IDP_CTLIDP_DMA_I4,
17IDP_CTLIDP_DMA_I5,
18IDP_CTLIDP_DMA_I6,
19IDP_CTLIDP_DMA_I7,
20SPICTLIISPI, IMSPI, CSPI,
21PPCTLEIPP, EMPP, ECPP, IIPP,
Control
Registers
Parameter RegistersBuffer RegistersDescription
IDP_DMA_M3,
IDP_DMA_C3
IDP_DMA_M4,
IDP_DMA_C4
IDP_DMA_M5,
IDP_DMA_C5
IDP_DMA_M6,
IDP_DMA_C6
IDP_DMA_M7,
IDP_DMA_C7
CPSPI
IMPP, ICPP
IDP_FIFODAI IDP Channel 3
IDP_FIFODAI IPD Channel 4
IDP_FIFODAI IDP Channel 5
IDP_FIFODAI IDP Channel 6
IDP_FIFODAI IDP Channel 7
RXSPI, TXSPISPI Data
RXPP, TXPPParallel Port Data
All of the I/O processor’s registers are memory-mapped, ranging from
address 0x0000 0000 to 0x0003 FFFF. For more information on these
registers, see “I/O Processor Registers” on page A-2.
Setting Up DMA
Because the I/O processor registers are memory-mapped, the processor has
access to program DMA operations. A processor sets up a DMA channel
by writing the transfer’s parameters to the DMA parameter registers. After
2-30ADSP-2126x SHARC Processor Peripherals Manual
I/O Processor
the index, modify, and count registers (among others) are loaded with a
starting source or destination address, an address modifier, and a word
count, the processor is ready to start the DMA.
The SPI port, parallel port, serial ports and input data ports each have a
DMA enable bit (
SPIDEN, PPDEN, SDEN or IDP_DMA_EN) in their channel
control register. 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.
ADSP-2126x SHARC Processor Peripherals Manual2-31
Setting Up DMA
2-32ADSP-2126x SHARC Processor Peripherals Manual
3PARALLEL PORT
The ADSP-2126x processor has a parallel port that allows bidirectional
transfers between it and external parallel devices. Using the parallel port
bus and control lines, the processor can interface to 8-bit or 16-bit wide
external memory devices. The parallel port provides a DMA interface
between internal and external memory and has the ability to support core
driven data transfer modes. Regardless of whether 8-bit or 16-bit external
memory devices are used, the internal data word size is always 32 bits
(normal word addressing), and the parallel port employs packing to place
the data appropriately.
The processor provides two data packing modes, 8/32 and 16/32. For
reads, data packing involves shifting multiple successive 8- or 16-bit elements from the parallel port to the ADSP-2126x processor’s Receive
register to form each 32-bit word, transferring multiple successive 8-bit or
16-bit elements. For writes, packing involves shifting each 32-bit word
out into 8- or 16-bit elements that are placed into the memory device.
This chapter describes the parallel port operation, registers, interrupt
function, and transfer protocol. Figure 3-1 shows a block diagram of the
parallel port.
ADSP-2126x SHARC Processor Peripherals Manual3-1
INTERNAL
MEMORY
CORE
ACCESS
RECEIVE REGISTER
DMA
PARALLEL
PORT
IIPP
IMPP
ICPP
EIPP
EMPP
ECPP
RXPP
TRANSMIT REGISTER
PPCTL
EXTERNAL ADDRESS
PPSI
PPSOTXPP
Figure 3-1. Parallel Port Block Diagram
MUX
PARALLEL PORT
CONTROLLER
AD[7-0]
AD[15-8]
ALE
WR
RD
3-2ADSP-2126x SHARC Processor Peripherals Manual
Parallel Port
Parallel Port Pins
This section describes the pins that the parallel port uses for its operation.
For a complete list of pin descriptions and package pinouts, see the product specific data sheet for your device.
Address/Data (AD15–0) pins. The ADSP-2126x processor provides time
multiplexed address/data pins that are used for providing both address and
data information. The state of the address/data pins is determined by the
8- or 16-bit operating mode and the state of the ALE, RD, and WR pins.
Read strobe (RD) pin. This output pin is asserted low to indicate a read
operation. Data is latched into the processor using the rising edge of this
signal.
Write strobe (WR) pin. This output pin is asserted low to indicate a write
operation. The rising edge of this signal can be used by memory devices to
latch the data from the processor.
Address Latch Enable (ALE) pin. The address latch enable pin is used to
strobe an external latch connected to the address/data pins (AD15–0). The
external latch holds the most significant bits (MSBs) of the external memory address. An ALE cycle is inserted for the first access after the parallel
port is enabled and anytime the upper 16 bits of the address change from a
previous cycle.
In 8-bit mode, a maximum of 24 bits of external address are facilitated
through latching the upper 16 bits,
EA23–8, from AD15–0 into the external
latch during the ALE phase of the cycle. The remaining 8 bits of address
EA7–0 are provided through AD15–8 during the second half of the cycle
when the
RD or WR signal is asserted.
ADSP-2126x SHARC Processor Peripherals Manual3-3
Parallel Port Pins
In 16-bit mode, a maximum of 16 bits of external address are facilitated
through latching the upper 16 bits of
AD15–0 from AD15–0 into the exter-
nal latch during the ALE phase of the cycle. The AD15–0 represent the
external 16 bits of data during the second half of the cycle when the RD or
WR signal is asserted.
The ALE pin is active high by default, but can be set active low via the
PPALEPL bit (bit 13) in the Parallel Port Control (PPCTL) register.
L
port boot mode must use address latching hardware that can process this active high signal.
Alternate Pin Functions
The following sections describe how to make the parallel port pins function as flag pins and how to make the parallel data acquisition port pins
function as address pins. For additional information on pin multiplexing,
see “Pin Multiplexing” on page 9-5.
Parallel Ports as FLAG Pins
Setting (= 1) bit 20 in the SYSCTL register, (PPFLGS) causes the 16 address
pins to function as FLAG0-FLAG15. To use the parallel port for data access,
this bit should be cleared (= 0). For more information, see “System
Design” on page 9-1.
The ADSP-2126x processor supports up to 16 general purpose FLAG pins.
Since ALE polarity is active high by default, systems using parallel
These
several different ways. If the parallel port is disabled, then the 16 address
and data pins become
these same 16
pins. Finally, FLAG0–FLAG3 are available on four separate pins. These pins
are shared with
FLAG signals are multiplexed with other signals, and may be used in
FLAG0–FLAG15. If the parallel port is in use, then
FLAG signals can be routed through the SRU, to 16 DAI
IRQ0–2 and TIMEXP.
3-4ADSP-2126x SHARC Processor Peripherals Manual
Parallel Port
L
Parallel Data Acquisition Port as Address Pins
PDAP use of AD[15:0] pins. When bit 26 of the IDP_PP_CTL register is
set, the Parallel Data Acquisition Port (PDAP) reads from the parallel
port’s AD0–15 pins. When this bit is cleared, the PDAP reads data using
DAI pins DAIP20–5. To use the parallel port, this bit must be cleared (= 0).
For more information, see “Parallel Data Acquisition Port (PDAP)” on
page 6-6.
Configuring the parallel port pins to function as FLAG0–15 also
causes these four dedicated pins to change to their alternate role,
IRQ0–2 and TIMEXP.
Parallel Port Operation
This section describes how the parallel port transfers data. The SYSCTL and
PPCTL registers control the parallel port operating mode. The bits in the
SYSCTL register are listed in the ADSP-2126x SHARC Processor Core Man-
ual. Table 3-3 on page 3-17 lists all the bits in the PPCTL register.
Basic Parallel Port External Transaction
A parallel port external transaction consists of a combination of an ALE
cycle and a data cycle, which is either a read or write cycle. The following
section describes parallel port operation as it relates to processor timing.
Refer to the data sheet for your processor for detailed timing
specifications.
ALE cycle is an address latch cycle. In this cycle the RD and WR signals
An
are inactive and
onto the
AD15–0 remaining valid slightly after de-assertion to ensure a sufficient
hold time for the external latch. The ALE pin always remains high for
2 x
ADSP-2126x SHARC Processor Peripherals Manual3-5
AD15–0 lines, and shortly thereafter the ALE pin is strobed, with
CCLK, irrespective of the data cycle duration values that are set in the
ALE is strobed. The upper 16 bits of the address are driven
Parallel Port Operation
PPCTL register. The parallel port runs at 1/3 the CCLK rate, and so the ALE
cycle is 3 x CCLK. An ALE cycle is inserted whenever the upper 16 bits of
address differs from a previous access, as well as after the parallel port is
enabled.
In a read cycle, the WR and ALE signals are inactive and RD is strobed. If the
upper 16 bits of the external address have changed, this cycle is always preceded by an ALE cycle. In 8-bit mode, the lower 8 bits of the address, EA7–
0, are driven on the AD15–8 pins, and data is sampled from the AD7–0 pins
on the rising edge of RD. In 16-bit mode, address bits are not driven in the
read cycle, the external address is provided entirely by the external latch,
and data is sampled from the AD15–0 pins at the rising edge of RD. Read
cycles can be lengthened by configuring the parallel port data cycle duration bits in the PPCTL register.
In a write cycle, RD and ALE are inactive and WR is strobed. If the upper 16
bits of the external address have changed, this cycle is always preceded by
an ALE cycle. In 8-bit mode, the lower 8 bits of the address are driven on
the AD15–8 pins and data is driven on the AD7–0 pins. In 16-bit mode,
address bits are not driven in the write cycle, the external address is provided entirely by the external latch, 16-bit data is driven onto the AD15-0
pins, and data is written to the external device on the rising edge of the WR
signal. Address and data are driven before the falling edge of WR and deasserted after the rising edge to ensure enough setup and hold time with
respect to the WR signal. Write cycles can be lengthened by configuring the
parallel port data cycle duration bits in the
PPCTL register.
Reading From an External Device or Memory
The parallel port has a two stage data FIFO for receiving data (RXPP). In
the first stage, a 32-bit register (
data pins and packs the 8- or 16-bit data into 32 bits. Once the 32-bit
data is received in
PPSI, the data is transferred into the second 32-bit reg-
3-6ADSP-2126x SHARC Processor Peripherals Manual
PPSI) provides an interface to the external
Parallel Port
ister (
RXPP). Once the receive FIFO is full, the chip cannot initiate any
more external data transfers. The RXPP register acts as the interface to the
core or I/O processor (for DMA).
L
The PPTRAN bit must be zero in order to be read.
The order of 8 to 32-bit data packing is shown in Table 3-1. The first byte
received is [7:0], second [15:8] and so on. The 16- to 32-bit packing
scheme is shown in the third column of the table.
L
Table 3-1. Packing Sequence for 32-Bit Data
TransferAD7–0, 8-bit to 32-bit
FirstWord 1; bits 7–0 Word 1; bits 15–0
SecondWord 1; bits 15–8Word 1; bits 31–16
Third Word 1; bits 23–16
FourthWord 1; bits 31–24
Writing to an External Device or Memory
The parallel port has a two stage data FIFO for transmitting data (TXPP).
The first stage (TXPP) is a 32-bit register that receives data from the internal memory via the DMA controller or a core write. The data in TXPP is
moved to the second 32-bit register, PPSO. The PPSO register provides an
interface to the external pins. Once a full word is transferred out of
TXPP data is moved to PPSO, if TXPP is not empty.
Table 3-1 does not show ALE cycles; it shows only the order of the
data reads and writes.
AD15–0, 16-bit to 32-bit
(8-bit bus, LSW first)
(16-bit bus, LSW first)
PPSO,
L
ADSP-2126x SHARC Processor Peripherals Manual3-7
The PPTRAN bit of the PPCTL register must be set to one in order to
enable writes to it.
Parallel Port Operation
The order of 32- to 8-bit data unpacking is shown in Table 3-2. The first
byte transferred from
32-bit to 16-bit unpacking scheme is shown in column three of the table.
PPSO is [7:0], the second [15:8] and so on. The
L
Table 3-2. Unpacking Sequence for 32-Bit Data
TransferAD7–0, 32-bit to 8-bit
FirstWord 1; bits 7–0 Word 1; bits 15–0
SecondWord 1; bits 15–8Word 1; bits 31–16
ThirdWord 1; bits 23–16
FourthWord 1; bits 31–24
L
Table 3-2 does not show ALE cycles; it shows only the order of the
data reads and writes.
AD15–0, 32-bit to 16-bit
(8-bit bus, LSW first)
Parallel port DMAs can only be performed to 32-bit (normal word)
internal memory.
(16-bit bus, LSW first)
Transfer Protocol
The external interface follows the standard asynchronous SRAM access
protocol. The programmable Data Cycle Duration (PPDUR) and optional
Bus Hold Cycle (
to interface with memories having different access time requirements. The
data cycle duration is programmed via the PPDUR bit in the PPCTL register.
The hold cycle at the end of the data cycle is programmed via the PPBHC
bit in the
PPCTL register.
BHC) addition at the end of each data cycle are provided
L
For standard asynchronous SRAM there are two transfer modes—8-bit
and 16-bit mode. In 8-bit mode, the address range is 0x0 to 0xFFFFFF
which is 16M bytes (4M 32-bit words). In 16-bit mode, the address range
3-8ADSP-2126x SHARC Processor Peripherals Manual
Disabling the parallel port (PPEN bit is cleared) flushes both parallel
port FIFOs, RXPP, and TXPP.
Parallel Port
is 0x0 to 0xFFFF which is a 128K bytes (32K 32-bit words). Although
programs can initiate reads or writes on one and two byte boundaries, the
parallel port always transfers 4 bytes (two 16-bit or four 8-bit words).
8-Bit Mode
An
ALE cycle always precedes the first transfer of data after the parallel port
is enabled. During ALE cycles for 8-bit mode, the upper 16 bits of the
external address (EA23–8) are driven on the 16-bit parallel port bus (pins
AD15–0). In data cycles (reads and writes), the processor drives the lower 8
bits of address EA7–0 on AD15–8. The 8 bits of external data, ED7–0, that
are provided by AD7–0, are sampled by the RD/WR signal respectively. The
processor continues to receive and or send data with the same ALE cycle
until the upper 16 bits of external address differ from the previous access.
For consecutive accesses (EMPP = 1), this occurs once every 256 cycles.
Figure 3-2 shows the connection diagram for the 8-bit mode.
L
Eight-bit mode enables a larger external address range.
8
180⍀
ADSP-2126x
AD[7-0]
AD[15-8]
ALE
RD
WR
D[7-0]
D[15-8]
ALE
SRAMCE
8
LATCH
Q[15-0]
FLASHCE
68⍀
DATA[7-0]
ADDR[7-0]
ADDR[23-8]
RD
WR
CE
Figure 3-2. External Transfer—8-bit Mode
ADSP-2126x SHARC Processor Peripherals Manual3-9
FLASH
DATA[7-0]
SRAM
CE
Parallel Port Operation
16-Bit Mode
In 16-bit mode, the external address range is
EA15–0 (64K addressable
16-bit words). For a nonzero stride value (EMPP = 0), the transfer of data
occurs in two cycles. In cycle one, the processor performs an ALE cycle,
driving the 16 bits of external address, EA15–0, onto the 16-bit parallel
port bus (pins AD15–0), allowing the external latch to hold this address. In
the second cycle, the processor either drives or receives the 16 bits of
external data (ED15–0) through the 16-bit parallel port bus (pins AD15–0).
This pattern repeats until the transfer completes.
However, a special case occurs when the external address modifier is zero,
(EMPP = 0). In this case, the external address is latched only once, using the
ALE cycle before the first data transfer. After the address has been latched
externally, the processor continues receiving and sending 16-bit data on
AD15–0 until the transfer completes. This mode can be used with external
FIFOs and high speed A/D and D/A converters and offers the maximum
throughput available on the parallel port (132 Mbyte/sec).
Figure 3-3 shows the connection diagram in 16-bit mode.
FLASH
DATA[7-0]
SRAM
ADSP-2126x
AD[15-0]
16
180⍀
16
68⍀
DATA[17-0]
ALE
SRAMCE
LATCH
FLASHCE
Q[15-0]
ADDR[23-8]
RD
WR
CE
CE
16
ALE
RD
WR
Figure 3-3. External Transfer—16-bit Mode
3-10ADSP-2126x SHARC Processor Peripherals Manual
Parallel Port
Comparison of 16-Bit and 8-Bit SRAM Modes
When considering whether to employ the 16- or 8-bit mode in a particular design, a few key points should be considered.
•The 8-bit mode provides a 24-bit address, and therefore can access
16M bytes of external memory. In contrast, the 16-bit mode can
only address 64K x 16 bit words, which is equivalent to 128K
bytes. Therefore, the 8-bit mode provides 128 times the storage
capacity of the 16-bit mode.
•For sequential accesses, the 8-bit mode requires only one ALE cycle
per 256 bytes. With minimum wait states selected, this represents a
worst case overhead of:
(1 ALE cycle)/(256 accesses + 1 ALE) x 100% = 0.39% overhead for
ALE cycles. In contrast, the 16-bit mode requires one ALE cycle per
external sequential access. Regardless of length (N), this represents
a worst case overhead of:
(N ALE cycles)/(N accesses + N ALE cycles) x 100% = 50% overhead
for ALE cycles. However, the 16-bit mode delivers two bytes per
cycle. Therefore, the total data transfer speed for sequential
accesses is nearly identical for both 8-bit and 16-bit modes.
The question that arises at this point is: If the total transfer rates are the
same for both 8-bit and 16-bit modes, and the 8-bit mode can also address
128 times as much external memory, why would a system use the 16-bit
mode?
•Sometimes an external device is only capable of interfacing to a
16-bit bus.
•When the DMA external modifier is set to zero, the address does
not change after the first cycle, therefore an ALE cycle is only
inserted on the first cycle. In this case, the 16-bit port can run
ADSP-2126x SHARC Processor Peripherals Manual3-11
Parallel Port Interrupt
twice as fast as the 8-bit port, as the overhead for
ALE cycles is zero.
This is convenient when interfacing to high speed 16-bit
FIFO-based devices, including A/D and D/A converters.
•In situations where a majority of address accesses are non-sequential and cross 256 byte boundaries, the overhead of the ALE cycles
in the 8-bit mode approaches 20%1. In this particular situation,
the 16-bit memory can provide a 40% speed advantage over the
8-bit mode.
Parallel Port Interrupt
The parallel port has one interrupt signal, PPI, (bit 3 in the LIRPTL register). When DMA is enabled, the maskable interrupt PPI occurs when the
DMA block transfer has completed (when the DMA Internal Word Count
register ICPP decrements to zero). When DMA is disabled, the maskable
interrupt is latched in every cycle the receive buffer is not empty or the
transmit buffer is not full.
The parallel port receive (RXPP) and transmit (TXPP) buffers are memory
mapped IOP registers. The PPI bit is located at vector address 0x50. The
latch (PPI), mask (PPIMSK) and mask pointer (PPIMSKP) bits associated
with the parallel port interrupt are all located in the LIRPTL register.
Parallel Port Throughput
As described in “Parallel Port Operation”, each 32-bit word transferred
through the parallel port takes a specific period of time to complete. This
throughput depends on a number of factors, namely parallel port speed
1
This can be realized by recalling that four bytes must be packed/unpacked into a single 32-bit word.
For example when a 32-bit word is written/read, there is a single ALE cycle inserted per four consecutive addresses. This results in: (N/4 ALE cycles)/(N accesses + N/4 ALE cycles) x 100% = 20%.
3-12ADSP-2126x SHARC Processor Peripherals Manual
Parallel Port
(1/3 core instruction rate), memory width (8 bits or 16 bits), and memory
access constraints (occurrence of
of data cycles, and/or addition of hold time cycles).
The maximum parallel port speed is 1/3 of the core. The relationship
between core clock and parallel port speed is static. For a 200 MHz core
clock, the parallel port runs at 66 MHz. Since there is no parallel port
clock signal, it is easiest to think of parallel port throughput in terms of
core clock cycles.
As described in “Parallel Port Operation”, parallel port accesses require
both ALE cycles to latch the external address and additional data cycles to
transmit or receive data. Therefore, the throughput on the parallel port is
determined by the duration and number of these cycles per word. The
duration of each type of cycle is shown below and the frequency is determined by the external memory width.
ALE cycles at page boundaries, duration
L
The following sections show examples of transfers that demonstrate the
expected throughput for a given set of parameters. Each word transfer
sequence is made up of a number of data cycles and potentially one additional ALE cycle.
There is one case where the frequency is also determined by the
external address modifier register (EMPP).
•ALE cycles are fixed at 3 core cycles (CCLK) and are not affected by
the PPDUR or BHC bit settings. In this case, the ALE is high for 2 core
clock cycles. Address for ALE is set up a half core clock cycle before
ALE goes HIGH (active) and remains on bus a half cycle after ALE
goes LOW (inactive). Therefore, the total ALE cycles on the bus are
1/2 + 2 + 1/2 = 3 core clock cycles. Please refer to the data sheet for
more precise timing characteristics.
•Data cycle duration is programmable with a range of 3 to 31 CCLK
cycles. They may range from 4 to 32 cycles if the
BHC bit is set (=1).
ADSP-2126x SHARC Processor Peripherals Manual3-13
Parallel Port Throughput
8-Bit Access
In 8-bit mode, the first data-access (whether a read or a write) always consists of one ALE cycle followed by four data cycles. As long as the upper
16 bits of address do not change, each subsequent transfer consists of four
data cycles. The ALE cycle is inserted only when the parallel port address
crosses an 8-bit boundry page, in other words, after every 256 bytes that
are transferred.
For example, if PPDUR3, BHC = 0, and the processor is in 8-bit mode. The
first byte on a new page takes six core cycles (three for the ALE cycle and
three for the data cycle), and the next sequential 255 bytes consume three
core cycles each.
Therefore, the average data rate for a 256 byte page is:
(3 CCLK x 255 + 6 CCLK x 1) / 256 = 3.01 core clock cycles per byte.
For a 200 MHz core, this results in:
(200M CCLK /sec) x (1 byte/3.008 CCLK) = 66.4M Bytes/sec
16-Bit Access
In 16-bit mode, every word transfer consists of two ALE cycles and two
data cycles. Therefore, for every 32-bit word transferred, at least six
cycles are needed to transfer the data plus an additional six CCLK cycles for
the two
ALE cycles, for a total of 12 CCLK cycles per 32-bit transfer (four
bytes). For a 200 MHz core clock, this results in a maximum sustained
data rate device of:
There is a specific case which allows this maximum rate to be exceeded. If
the external address modifier (
ALE cycle is needed at the very start of the transfer. Subsequent words,
EMPP) is set to a stride of zero, then only one
essentially written to the same address, do not require any ALE cycles, and
every parallel port cycle may be a 16-bit data cycle. In this case, the
throughput is nearly doubled (except for the very first ALE cycle) to over
132M bytes per second. This mode is particularly useful for interfacing to
FPGA’s or other memory-mapped peripherals such as DAC/ADC
converters.
Conclusion
For sequential accesses, the average data rates are nearly identical in 8- and
16-bit modes. For help deciding between the two modes, please refer to
“Comparison of 16-Bit and 8-Bit SRAM Modes” on page 3-11.
Parallel Port Registers
The ADSP-2126x processor’s parallel port contains several user-accessible
registers. The Parallel Port Control Register, PPCTL, contains control and
status bits and is described below. Two additional registers, RXPP and
TXPP, are used for buffering receive and transmit data during DMA opera-
tions and can be accessed by the core. Finally, the following registers are
used for every parallel port access (both core-driven and DMA-driven).
•“Parallel Port DMA Start External Index Address Register (EIPP)”
on page A-59
•“Parallel Port DMA External Modifier Address Register (EMPP)”
on page A-59
ADSP-2126x SHARC Processor Peripherals Manual3-15
Parallel Port Registers
For DMA transfers only, the following registers must also be initialized:
•“Parallel Port DMA Internal Word Count Register (ICPP)” on
page A-59
•“Parallel Port DMA Start Internal Index Address Register (IIPP)”
on page A-59
•“Parallel Port DMA Internal Modifier Address Register (IMPP)”
on page A-59
•“Parallel Port DMA External Word Count Register (ECPP)” on
page A-60
Additional information on Parallel Port registers can be found in “Parallel
Port Registers” on page A-54.
Parallel Port Control Register (PPCTL)
The Parallel Port Control (PPCTL) register is a memory-mapped register
located at address 0x1800 and is used to configure and enable the parallel
port system. This register also contains status information for the TX/RX
FIFO, the state of DMA, and for external bus availability. This read/write
register is also used to program the data cycle duration and to determine
the data transfer format.
Table 3-3 provides the bit descriptions for the
PPCTL register.
Parallel Port DMA Registers
The following registers require initialization only when performing
DMA-driven accesses.
•DMA Start Internal Index Address Register (IIPP)
This 19-bit register contains the offset from the DMA starting
address of 32-bit internal memory.
3-16ADSP-2126x SHARC Processor Peripherals Manual
Parallel Port
Table 3-3. Parallel Port Register (PPCTL) Bit Definitions
BitNameDefinitionDefault
0PPENParallel Port Enable. Enables (if set, =1) or disables (if
cleared, =0) the parallel port. Clearing this bit clears the
FIFO and the parallel status information. If an RD, WR,
or ALE cycle has already started, it completes normally
before the port is disabled. The parallel port is ready to
transmit or receive two cycles after it is enabled.
An ALE cycle always occurs before the first read or write
cycle after PPEN is enabled.
5–1PPDURParallel Port Duration. The duration of Parallel Port
data cycles is determined by these bits. ALE cycles are not
affected by this setting and are fixed at 3 CCLK cycles.
00000 = Reserved
00001 = Reserved
00010 = 3 clock cycles; 66 MHz throughput
00011 = 4 clock cycles; 50 MHz throughput
00100 = 5 clock cycles; 40 MHz throughput
00101 = 6 clock cycles; 33 MHz throughput
...
11111 = 32 clock cycles; 6.25 MHz throughput
6PPBHCBus Hold Cycle. If set (=1), this causes every data-cycle
to be prolonged for 1 CCLK period. If cleared (=0) no
bus hold cycle occurs, and the duration of data-cycle is
exactly the value specified in PPDUR. Bus hold cycles do
not apply to ALE cycles which are always 3 CCLK cycles.
7PP16 Parallel Port External Data Width. Sets the external data
width to 16 bits (if set, =1) or 8 bits (if cleared, =0).
0
Bit 1 = 1
Bit 2 = 1
Bit 3 = 1
Bit 4 = 0
Bit 5 = 1
1
0
8PPDENParallel Port DMA Enable. Enables (if set, =1) DMA on
the parallel port or disables DMA (if cleared, =0). When
PPDEN is cleared, any DMA requests already in the
pipeline complete, and no new DMA requests are made.
This does not affect FIFO status.
9PPTRANParallel Port Transmit/Receive Select. Indicates whether
the processor is reading from external memory (if
cleared, =0) or writing to external memory (if set, =1).
0
0
ADSP-2126x SHARC Processor Peripherals Manual3-17
Parallel Port Registers
Table 3-3. Parallel Port Register (PPCTL) Bit Definitions (Cont’d)
BitNameDefinitionDefault
11–10PPSParallel Port FIFO Status. These read-only bits indicate
the status of the parallel port FIFO:
00 = RXPP/TXPP is empty
01 = RXPP/TXPP is partially full
11 = RXPP/TXPP is full
12PPBHDParallel Port Buffer Hang Disable. When this bit is
cleared (=0), core stalls occur normally. The core stall
occurs when the core attempts to write to a full transmit
buffer or read from the empty receive buffer.
This bit prevents a core hang, when set (=1). Old data
present in the receive buffer is reread if the core tries to
read it. If a write to the transmit buffer is performed, the
core overwrites the current data in the buffer.
13PPALEPLParallel Port ALE Polarity Level. Asserts ALE active low
(if set, =1) or active high (if cleared, =0).
15–14Reserved
16PPDSDMA Status. This read-only bit indicates that the inter-
nal DMA interface is active (if set, =1) or not active (if
cleared, =0).
17PPBSParallel Port Bus Status. Indicates that the external bus
interface is busy (if set, =1) or available (if cleared, =0).
The bus will be “busy” for the duration of the 32-bit
transfer, including the ALE cycles. Note: This bit goes
high 2 cycles after data is ready to transmit (after a data is
written to PPTX, after PPRX is read with PPEN=1, after
writing PPCTL to have PPEN=1 and PPDEN=1).
0
0
0
0
0
31–18Reserved
•DMA Internal Modifier Address register (IMPP)
This 16-bit register contains the internal memory DMA address
modifier.
•DMA Internal Word Count register (ICPP)
3-18ADSP-2126x SHARC Processor Peripherals Manual
Parallel Port
This 16-bit register contains the number of words in internal memory to be transferred via DMA.
•Parallel Port DMA External Word Count Register (
This 24-bit register contains the number of words in external
memory to be transferred via DMA.
ECPP)
Parallel Port External Setup Registers
The following registers must be initialized for both core-driven and
DMA-driven transfers.
•Parallel Port DMA External Index Address Register (EIPP)
This 24-bit register contains the external memory byte address used
for core-driven and DMA driven transfers.
•Parallel Port External Address Modifier Register (EMPP)
This 2-bit register contains the external memory DMA address
modifier. It supports only +1, 0, –1. After each data cycle, the EIPP
register is modified by this value.
Using the Parallel Port
There are a number of considerations to make when interfacing to parallel
external devices. This section describes the different the ways that the parallel port can be used to access external devices. Considerations for
choosing between an 8-bit and a 16-bit wide interface are discussed in
“Comparison of 16-Bit and 8-Bit SRAM Modes” on page 3-11.
External parallel devices can be accessed in two ways, either using
DMA-driven transfers or core-driven transfers. DMA transfers are performed in the background by the I/O Processor and are generally used to
move blocks of data. To perform DMA transfers, the address, word-count,
ADSP-2126x SHARC Processor Peripherals Manual3-19
Using the Parallel Port
and address-modifier are specified for both the source and destination
buffers (one internal, one external). Once initiated, (by setting
PPEN = 1
and PPDEN = 1), the IOP performs the specified transfer in the background
without further core interaction. The main advantage of DMA transfers
over core driven transfers is that the core can continue executing code
while sequential data is imported/exported in the background.
Unlike the external port on previous SHARC processors, the ADSP-2126x
core cannot directly access the external parallel bus. Instead, the core initializes two registers to indicate the external address and address-modifier
and then accesses data through intermediate registers. Then, when the
core accesses either the PPTX or PPRX registers, the parallel port
writes/fetches data to/from the specified external address. The details of
this functionality and the four main techniques to manage each transfer
are detailed below. In general, core-driven transfers are most advantageous
when performing single-word accesses and/or accesses to non-sequential
addresses.
DMA Transfers
To use the parallel port for DMA programs, start by setting up values in
the DMA parameter registers. The program then writes to the PPCTL register to enable PPDEN with all of the necessary settings like cycle duration
value, transfer direction, and so on. While a parallel port DMA is active,
the DMA parameter registers are not writable. Furthermore, only the
and DMAEN bits (in the PPCTL register) can be changed. If any other bit is
changed, the parallel port will malfunction. It is recommended that both
the PPDEN and PPEN bits be set and reset together to ensure proper DMA
operation.
To see an example program that sets up a parallel port DMA, see
Listing 3-1 on page 3-25.
3-20ADSP-2126x SHARC Processor Peripherals Manual
PPEN
Parallel Port
Core Driven Transfers
Core-driven transfers can be managed using four techniques. The transfers
can 1) use interrupts, 2) poll status bits in the PPCTL register, 3) predict
when each access will complete by calculating the data and ALE cycle durations, or 4) rely on the fact that the core stalls on certain accesses to PPRX
and PPTX. For all four of these methods, the core uses the same basic steps
to initiate the transfer. However, each method uses a different technique
to complete it. The following steps provide the basic procedure for setting
up and initiating a data transfer using the core.
1. Write the external byte address to the EIPP register and the external
address modifier to the EMPP register.
Before initializing or modifying any of the parallel port parameter
registers such as EIPP and EMPP, the parallel port must first be disabled (bit 0, PPEN, of the PPCTL register must be cleared). Only
when PPEN=0, can those registers be modified and the port then
re-enabled. This sequence is most often used to perform
non-sequential, external transfers, such as when accessing taps in a
delay line.
For core-driven transfers, the ECPP, IIPP, IMPP, and ICPP are not
used. Although these registers are automatically updated by the
parallel port (the ECPP register decrements for example), they may
be left uninitialized without consequence.
2. Initialize the
These include the parallel port data-cycle duration (
whether the transfer is a receive or transmit operation (
PPCTL register with the appropriate settings.
PPDUR) and
PPTRAN). For
core-driven transfers, be sure to clear the DMA enable bit, PPDEN.
In this same write to
PPEN, to 1.
bit 0,
PPCTL, the port may also be enabled by setting
ADSP-2126x SHARC Processor Peripherals Manual3-21
Using the Parallel Port
When enabling the parallel port (setting
PPEN = 1), the external bus activ-
ity varies, depending on the direction of data transfer (receive or
transmit). For transmit operations (PPTRAN = 1), the parallel port does not
perform any external accesses until valid data is written to the TXPP register
by the core.
For read operations (PPTRAN = 0), two core clock cycles after PPEN is set
(=1), the parallel port immediately fetches two 32-bit data words from the
external byte address indicated by EIPP. Subsequently, additional data is
fetched only when the core reads (empties) RXPP.
The following are guidelines that programs must follow when the processor core accesses parallel port registers.
•While a DMA transfer is active, the core may only write the PPEN
and PPDEN bits of PPCTL. Accessing any of the DMA parameter registers or other bits in PPCTL during an active transfer will cause the
parallel port to malfunction.
•Core reads of the FIFO register during a DMA operation are
allowed but do not affect the status of the FIFO.
If PPEN is cleared while a transfer is underway (whether core or
DMA-driven), the current external bus cycle (ALE cycle or data
cycle) will complete but no further external bus cycles occur. Disabling the parallel port clears the data in the
RXPP and TXPP
registers.
•Core reads and writes to the
TXPP and RXPP registers update the sta-
tus of the FIFO when DMA is not active. This happens even when
the parallel port is disabled.
•The
PPCTL register has a two-cycle effect-latency. This means that if
programs write to this register in cycle N, the new settings will not
be in effect until cycle N + 2. Avoid sampling PPBS until at least 2
cycles after the PPEN bit in PPCTL is set.
3-22ADSP-2126x SHARC Processor Peripherals Manual
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.