ADSP-219x-2192 DSP Hardware Reference (Rev 1.1, April 2004
ADSP-219x-2192 DSP Hardware Reference (Rev 1.1, April 2004
Hardware Reference
Disclaimer
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 impli-
cation or otherwise under the patent rights of Analog Devices, Inc.
INTRODUCTION
Purpose ......................................................................................... 1-1
Audience ...................................................................................... 1-1
Overview—Why Fixed-Point DSP? ............................................... 1-2
ADSP-219x Design Advantages ..................................................... 1-2
ADSP-219x Architecture Overview ............................................... 1-5
DSP Core Architecture ............................................................ 1-7
DSP Peripherals Architecture ................................................... 1-9
Memory Architecture .............................................................. 1-9
Internal (On-Chip) Memory ............................................. 1-11
Interrupts .............................................................................. 1-12
DMA Controller ................................................................... 1-12
PCI Port ............................................................................... 1-12
USB Port .............................................................................. 1-13
AC’97 Interface ..................................................................... 1-13
Low Power Operation ............................................................ 1-13
Clock Signals ........................................................................ 1-13
Reset Modes .......................................................................... 1-14
JTAG Port ............................................................................. 1-15
COMPUTATIONAL UNITS
Overview ...................................................................................... 2-1
Using Data Formats ...................................................................... 2-4
Binary String ........................................................................... 2-4
Unsigned ................................................................................. 2-4
Signed Numbers: Two’s Complement ....................................... 2-5
Fractional Representation: 1.15 ................................................ 2-5
ALU Data Types ...................................................................... 2-5
Multiplier Data Types .............................................................. 2-6
Shifter Data Types ................................................................... 2-7
Arithmetic Formats Summary .................................................. 2-8
Setting Computational Modes ..................................................... 2-10
Latching ALU Result Overflow Status .................................... 2-10
Saturating ALU Results on Overflow ...................................... 2-11
Using Multiplier Integer and Fractional Formats .................... 2-12
Rounding Multiplier Results .................................................. 2-14
Unbiased Rounding .......................................................... 2-14
Biased Rounding ............................................................... 2-15
Using Computational Status ........................................................ 2-16
Arithmetic Logic Unit (ALU) ...................................................... 2-17
ALU Operation ..................................................................... 2-17
ALU Status Flags ................................................................... 2-18
ALU Instruction Summary .................................................... 2-19
PROGRAM SEQUENCER
Overview ...................................................................................... 3-1
Instruction Pipeline ...................................................................... 3-7
Instruction Cache ......................................................................... 3-9
Using The Cache ................................................................... 3-11
Optimizing Cache Usage ....................................................... 3-12
Branches and Sequencing ............................................................ 3-14
Indirect Jump Page (IJPG) Register ........................................ 3-15
Conditional Branches ............................................................ 3-16
Delayed Branches .................................................................. 3-16
Loops and Sequencing ................................................................. 3-20
Managing Loop Stacks ........................................................... 3-24
Restrictions On Ending Loops ............................................... 3-24
Interrupts and Sequencing ........................................................... 3-24
Sensing Interrupts ................................................................. 3-30
Masking Interrupts ................................................................ 3-31
Latching Interrupts ................................................................ 3-31
Stacking Status During Interrupts .......................................... 3-32
Nesting Interrupts ................................................................. 3-32
Interrupting Idle .................................................................... 3-34
Stacks and Sequencing ................................................................ 3-34
Conditional Sequencing .............................................................. 3-39
Sequencer Instruction Summary .................................................. 3-42
MEMORY
Overview ...................................................................................... 5-1
Internal Address and Data Buses .............................................. 5-3
Internal Data Bus Exchange .................................................... 5-5
ADSP-2192 Memory Map ............................................................ 5-8
P0 DSP Core Internal Memory Space .................................... 5-10
P1 DSP Core Internal Memory Space .................................... 5-11
Shared Memory .................................................................... 5-11
Host (PCI/USB) and DSP Internal Memory Space ................ 5-12
I/O PROCESSOR
Overview ...................................................................................... 7-1
Setting I/O Processor—Host Port Modes .................................... 7-12
Host Port Buffer Modes ........................................................ 7-14
Host Port Scatter-Gather DMA Mode ................................... 7-16
Setting I/O Processor—AC’97 Port Modes .................................. 7-18
Host Port DMA Status ............................................................... 7-19
DMA Controller Operation ........................................................ 7-20
Managing DMA Channel Priority ......................................... 7-21
Chaining DMA Processes ...................................................... 7-22
Host Port DMA .......................................................................... 7-22
AC’97 Port DMA ....................................................................... 7-24
NUMERIC FORMATS
Overview ...................................................................................... C-1
Un/Signed: Twos-Complement Format ......................................... C-1
Integer or Fractional ..................................................................... C-1
Binary Multiplication ................................................................... C-5
Fractional Mode And Integer Mode ......................................... C-6
Block Floating-Point Format ......................................................... C-7
ADSP-2192 TIMER
Overview ..................................................................................... D-1
Timer Architecture ...................................................................... D-2
Resolution ................................................................................... D-4
Timer Operation ......................................................................... D-4
Enabling the Timer ...................................................................... D-6
ADSP-2192 INTERRUPTS
Overview ...................................................................................... E-1
Peripheral Interrupts ..................................................................... E-1
Other Interrupt Types ................................................................... E-4
GLOSSARY
Terms .......................................................................................... G-1
INDEX
Purpose
The ADSP-219x/2192 DSP Hardware Reference provides architectural
information on the ADSP-219x modified Harvard architecture Digital
Signal Processor (DSP) core and ADSP-2192 DSP product. The architec-
tural descriptions cover functional blocks, buses, and ports, including all
features and processes they support. For programming information, see
the ADSP-219x DSP Instruction Set Reference.
Audience
DSP system designers and programmers who are familiar with signal pro-
cessing concepts are the primary audience for this manual. This manual
assumes that the audience has a working knowledge of microcomputer
technology and DSP-related mathematics.
DSP system designers and programmers who are unfamiliar with signal
processing can use this manual, but they should supplement this manual
with other texts that describe DSP techniques.
All readers, particularly system designers, should refer to the DSP’s data
sheet for timing, electrical, and package specifications. For additional sug-
gested reading, see “For More Information About Analog Products” on
page 1-24.
PM ADDRESS BUS 2
4
DM ADDRESS BUS 2
4
P M D A TA B U S 2
4
BUS
CONNEC D M D A TA B U S 1
T 6
(P X )
D A TA CORE
R E G IS TE R IN TE R FA C E
FILE IN P U T
R E G IS TE R S
ADDR D A TA ADDR D A TA ADDR D A TA
R E S U LT
R E G IS TE R S
BARREL
P 0 DM A P 1 DM A
MULT A LU
16 X 16 -B IT S H IFTE R CO NTRO LLE R CO NTRO LL E R
S HARE D DS P
I/O MAP P E D
FIFO S RE G IS TE RS F IF O S
PROCES SOR P0 PROCESSOR P1
G P I/O P INS HO S T P O RT
S E RIAL PO RT
JT AG
(& O P TIO NAL P CI 2.2 E M ULATIO N
AC'97
S E RIAL OR P O RT
CO M P LIANT
E E PRO M ) US B 1.1
Fast, Flexible Arithmetic. The ADSP-219x family DSPs execute all com-
putational instructions in a single cycle. They provide both fast cycle
times and a complete set of arithmetic operations.
40-Bit Extended Precision. The DSP handles 16-bit integer and fractional
formats (twos-complement and unsigned). The processors carry extended
precision through result registers in their computation units, limiting
intermediate data truncation errors.
Dual Address Generators. The DSP has two data address generators
(DAGs) that provide immediate or indirect (pre- and post-modify)
addressing. Modulus and bit-reverse operations are supported with only
memory page constraints on data buffer placement.
Efficient Program Sequencing. In addition to zero-overhead loops, the
DSP supports quick setup and exit for loops. Loops are both nestable
(eight levels in hardware) and interruptable. The processors support both
delayed and non-delayed branches.
Program memory can store both instructions and data, permitting the
ADSP-219x to fetch two operands in a single cycle, one from program
memory and one from data memory. The DSP’s dual memory buses also
let the ADSP-219x core fetch an operand from data memory and the next
instruction from program memory in a single cycle.
Memory Architecture
The ADSP-2192 integrates 128K words of on-chip memory configured as
32K words (24-bit) of program RAM (16K words each on DSP P0 and
DSP P1) and 96K words (16-bit) of data RAM (64K words on DSP P0
and 32K words on DSP P1). Power-down circuitry is also provided to
meet the low power needs of battery operated portable equipment.
For more information on these blocks, see the section “ADSP-2192 Mem-
ory Map” on page 5-8, which discusses the memory map in detail.
Figure 1-2 shows the ADSP-2192’s memory map.
DSP P0 DSP P1
MEMORY MAP MEMORY MAP
ADDRESS ADDRESS
The ADSP-2192 has 4K words of on-chip ROM that holds boot routines.
If peripheral booting is selected, the DSP starts executing instructions
from the on-chip boot ROM, which starts the boot process from the
selected peripheral. For more information, see “Reset Modes” on page
1-14. The on-chip boot ROM is located on Page 255 in the DSP’s mem-
ory map.
Interrupts
The interrupt controller lets the DSP respond to thirteen interrupts with
minimum overhead.
DMA Controller
The ADSP-2192 has a DMA controller that supports automated data
transfers with minimal overhead for the DSP core. Cycle stealing DMA
transfers can occur between the ADSP-2192’s internal memory and any of
its DMA capable peripherals. Additionally, DMA transfers also can be
accomplished between any of the DMA capable peripherals. DMA capable
peripherals include the PCI, USB, and AC’97. Each individual DMA
capable peripheral has one or more dedicated DMA channels. DMA
sequences do not contend for bus access with the DSP core, instead DMAs
“steal” cycles to access memory.
PCI Port
The ADSP-2192 can interface with a host computer through a PCI port.
The PCI port accesses the DSPs via the Peripheral Device Control (PDC)
bus. The PCI port connects through the internal PCI interface to the
PDC bus.
USB Port
The ADSP-2192 can interface with a host computer through a USB port.
The USB port accesses the DSPs via the Peripheral Device Control (PDC)
bus. The USB port connects through the internal USB interface to the
PDC bus.
AC’97 Interface
The ADSP-2192 includes an AC’97 interface that complies with the
AC’97 specification. The AC’97 interface connects the host’s Digital Con-
troller (DC) chip set and between one and four analog codecs.
Clock Signals
The ADSP-2192 can be clocked by a crystal oscillator. If a crystal oscilla-
tor is used, the crystal should be connected across the XTALI/O pins, with
two capacitors connected as shown in Figure 1-3 on page 1-14. Capacitor
values are dependent on crystal type and should be specified by the crystal
manufacturer. A parallel-resonant, fundamental frequency, microproces-
sor-grade 24.576 MHz crystal should be used for this configuration.
24.576 M Hz
X T ALI X T ALO
CLKS E L
ADSP-2192
BUS 1
BUS S E LE CT
BUS 0
P O W E R O N RE S E T P O RS T
(NO CO N NE CT)
P CI CL O CK CLK
P CI RE S E T RS T
Reset Modes
The ADSP-2192 can be reset in three ways: Power On Reset, Software
Reset, or Forced Reset Via PCI or USB.
See “Resetting the Processor” on page 11-13 for more details about
booting.
JTAG Port
The ADSP-2192 includes a JTAG port. Emulators use the JTAG port to
monitor and control the DSP during emulation. Emulators using this port
provide full-speed emulation with access to inspect and modify memory,
registers, and processor stacks. JTAG-based emulation is non-intrusive
and does not affect target system loading or timing. Note that the
ADSP-2192 JTAG does not support boundary scan.
Development Tools
The ADSP-219x is supported by VisualDSP++®, an easy-to-use project
management environment, comprised of an Integrated Development and
Debugging Environment (IDDE). VisualDSP++ lets you 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.
Flexible Project Management. The IDDE provides flexible project man-
agement for the development of DSP applications. It provides you with
access to all the activities necessary to create and debug DSP projects. You
can create or modify source files or view listing or map files with the
IDDE Editor. This powerful Editor includes multiple language syntax
highlighting, OLE drag and drop, bookmarks, and standard editing opera-
tions such as undo/redo, find/replace, copy/paste/cut, and go to.
VisualDSP++ includes access to the DSP C/C++ Compiler, C Run-time
Library, Assembler, Linker, Loader, Splitter, and Simulator. You specify
options for these Tools through property page dialog boxes. These options
control how the tools process inputs and generate outputs, and the
options have a one-to-one correspondence to the tools’ command-line
switches. You can define these options once or modify them to meet
changing development needs. You also can access the Tools from the oper-
ating system command line if you choose.
MF=MR+MX0*MY1(UU); MR=MR+MX0*MY1(UU);
IF NOT MV MR=AR*MF; IF NOT MV MR=AR*SR2;
The SV status condition in the ASTAT bits does not correspond to a condi-
tion code that can be directly used in a conditional instruction. To test for
this status condition, software selects a condition to test by loading a value
into the Condition Code (CCODE) register and uses the Software Condition
The Nop after loading the CCODE register accommodates the one cycle effect
latency of the CCODE register.
The ADSP-218x DSP supports two conditions to detect the sign of the
ALU result. On the ADSP-219x, these two conditions (Pos and Neg) are
supported as AS and Not AS conditions in the CCODE register. For more
information on CCODE register values and SWCOND conditions, see “Condi-
tional Sequencing” on page 3-39.
IOPG = 0x06;
AX0=IO();
AR=Tstbit 11 OF AXO;
If EQ AR=MRO And 8192;
Related Documents
For more information about Analog Devices DSPs and development
products, see the following documents:
• ADSP-2192 DSP Microcomputer Data Sheet
• ADSP-219x DSP Instruction Set Reference
Conventions
Table 1-1 identifies and describes text conventions used in this manual.
Example Description
TMR0E, RESET Pin names appear in UPPERCASE and keyword font; active
low signals appear with an OVERBAR.
DRx, MS3-0 Register and pin names in the text may refer to groups of regis-
ters or pins. When a lowercase “x” appears in a register name
(e.g., DRx), that indicates a set of registers (e.g., DR0, DR1, and
DR2). A range also may be shown with a hyphen (e.g., MS3-0
indicates MS3, MS2, MS1, and MS0).
Example Description
Click Here In the online version of this document, a cross reference acts as
a hypertext link to the item being referenced. Click on blue ref-
erences (Table, Figure, or section names) to jump to the loca-
tion.
Overview
The DSP’s computational units perform numeric processing for DSP
algorithms. The three computational units are the arithmetic/logic unit
(ALU), multiplier/accumulator (multiplier), and shifter. These units get
data from registers in the data register file. Computational instructions for
these units provide fixed-point operations, and each computational
instruction can execute in a single cycle.
The computational units handle different types of operations. The ALU
performs arithmetic and logic operations. The multiplier does multiplica-
tion and executes multiply/add and multiply/subtract operations. The
shifter executes logical shifts and arithmetic shifts. Also, the shifter can
derive exponents.
Data flow paths through the computational units are arranged in parallel,
as shown in Figure 2-1 on page 2-3. The output of any computational
unit may serve as the input of any computational unit on the next instruc-
tion cycle. Data moving in and out of the computational units goes
through a data register file, consisting of sixteen primary registers and six-
teen secondary registers. Two ports on the register file connect to the PM
and DM data buses, allowing data transfer between the computational
units and memory.
The DSP’s assembly language provides access to the data register files. The
syntax lets programs move data to and from these registers and specify a
computation’s data format at the same time. For information on the data
registers, see “Data Register File” on page 2-57.
Figure 2-1 provides a graphical guide to the other topics in this chapter.
First, a description of the MSTAT register shows how to set rounding, data
format, and other modes for the computational units. Next, an examina-
tion of each computational unit provides details on operation and a
summary of computational instructions. Looking at inputs to the compu-
tational units, details on register files, and data buses identify how to flow
data for computations. Finally, details on the DSP’s advanced parallelism
reveal how to take advantage of conditional and multifunction
instructions.
The diagrams in Figure 2-1 on page 2-3 and Figure 2-17 on page 2-62
describe the relationship between the ADSP-219x data register file and
computational units: multiplier, ALU, and shifter.
Figure 2-1 shows how unconditional, single-function multiplier, ALU,
and shifter instructions have unrestricted access to the data registers in the
register file. Figure 2-1 also indicates that the Results Bus lets the compu-
tational units use any result registers (MR2, MR1, MR0, SR1, SR0, or AR) as an
X-input for any operation. The upper part of the Shifter Results (SR) reg-
ister, SR2, may not serve as feedback over the results bus.
The MR2 and SR2 registers differ from the other results registers. As a data
register file register, MR2 and SR2 are 16-bit registers that may be X- or
Y-inputs to the multiplier, ALU, or shifter. As result registers (part of MR
or SR), only the lower 8-bits of MR2 or SR2 hold data (the upper 8-bits are
sign extended). This difference (16-bit as input, 8-bit as output) influ-
ences how code can use the MR2 and SR2 registers. This sign extension
appears in Figure 2-12 on page 2-30.
Using register-to-register move instructions, the data registers can load (or
be loaded from) the Shifter Block (SB) and Shifter Exponent (SE) registers,
but the SB and SE registers may not provide X- or Y-input to the computa-
tional units. The SB and SE registers serve as additional inputs to the
shifter.
M S TA T P M D A TA B U S
D M D A TA B U S
R E G IS TE R F IL E (1 6 × 1 6 - B IT)
SB SE
Y
MAC S H IF TE R A LU
M R2* M R1 M R0 SR 2 * SR 1 ** SR 0 AF AR
RE S U LTS B U S
A S TA T
* Th e M R 2 a n d S R 2 re g iste rs h a v e so m e u sa g e
re stric tio n s th a t d o n o t a p p e a r in th is
S TA TU S TO
d ia g ra m . F o r d e ta ils, se e th e te x t.
PRO G RA M SEQ U EN C ER
** Th e S R 1 re g iste r a lso m a y se rv e a s a Y in p u t
in c o n d itio na l o r m u ltifu n c tio n M A C a n d A LU
in stru c tio n s.
The shaded boxes behind the data register file and the SB, SE, MR, SR, AR,
and AF registers indicate that secondary registers are available for these reg-
isters. For more information, see “Secondary (Alternate) Data Registers”
on page 2-59.
The Mode Status (MSTAT) register input sets arithmetic modes for the
computational units, and the Arithmetic Status (ASTAT) register records
status/conditions for the computation operations’ results.
Binary String
The binary string format is the least complex binary notation; sixteen bits
are treated as a bit pattern. Examples of computations using this format
are the logical operations: NOT, AND, OR, XOR. These ALU operations
treat their operands as binary strings with no provision for sign bit or
binary point placement.
Unsigned
Unsigned binary numbers may be thought of as positive, having nearly
twice the magnitude of a signed number of the same length. The DSP
treats the least significant words of multiple precision numbers as
unsigned numbers.
The logic of the overflow bit (AV) is based on two’s complement arith-
metic. It is set if the MSB changes in a manner not predicted by the signs
of the operands and the nature of the operation. For example, adding two
positive numbers must generate a positive result; a change in the sign bit
signifies an overflow and sets AV. Adding a negative and a positive may
result in either a negative or positive result, but cannot overflow.
The logic of the carry bit (AC) is based on unsigned-magnitude arithmetic.
It is set if a carry is generated from bit 16 (the MSB). The (AC) bit is most
useful for the lower word portions of a multiword operation.
ALU results generate status information. For more information on using
ALU status, see “ALU Status Flags” on page 2-18.
In the integer mode, the left shift does not occur. For example, if the oper-
ands are in the 16.0 format, the 32-bit multiplier result would be in 32.0
format. A left shift is not needed; it would change the numerical represen-
tation. This result format appears in Figure 2-4 on page 2-13.
Multiplier results generate status information. For more information on
using multiplier status, see “Multiplier Status Flags” on page 2-31.
AV AC AR register
! The bit in
AR_SAT only affects the register. Only the results
MSTAT AR
written to the register are saturated. If results are written to the
AR
AF register, wraparound occurs, but the AV and AC flags reflect the
saturated result.
S HIFTE D ZE RO
OUT FILLE D
P S IG N,
7 BITS M ULTIP LIE R P O UTP UT
31 31 31 31 31 31 31 31 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
7 6 5 4 3 2 1 0 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
M R2 M R1 M R0
In the integer mode, the 32-bit Product register is not shifted before being
added to MR. Figure 2-4 shows the integer-mode result placement.
P S IG N,
8 BITS M ULT IP LIE R P O UT P UT
31 31 31 31 31 31 31 31 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
7 6 5 4 3 2 1 0 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
M R2 M R1 M R0
The mode is selected by the M_MODE bit in the Mode Status (MSTAT) regis-
ter. If M_MODE is set (=1), integer mode is selected. If M_MODE is cleared (=0),
the fractional mode is selected. In either mode, the multiplier output
Product is fed into a 40-bit adder/subtracter which adds or subtracts the
new product with the current contents of the MR register to form the final
40-bit result.
Unbiased Rounding
Unbiased rounding uses the multiplier’s capability for rounding the 40-bit
result at the boundary between bit 15 and bit 16. Rounding can be speci-
fied as part of the instruction code. The rounded output is directed to
either MR or SR. When rounding is selected, MR1/SR1 contains the rounded
16-bit result; the rounding effect in MR1/SR1 affects MR2/SR2 as well. The
MR2/MR1 and SR2/SR1 registers represent the rounded 24-bit result.
...MR2..|.......MR1......|.......MR0......
Unrounded value: xxxxxxxx|xxxxxxxx00100101|1xxxxxxxxxxxxxxx
Add 1 and carry: ........|................|1...............
Rounded value: xxxxxxxx|xxxxxxxx00100110|0xxxxxxxxxxxxxxx
The compensation to avoid net bias becomes visible when the lower 15
bits are all zero and bit 15 is one (the midpoint value) as shown in
Figure 2-6.
|.......MR1......|.......MR0......
...MR2
Unrounded value: xxxxxxxx|xxxxxxxx01100110|1000000000000000
Add 1 and carry: ........|................|1...............
MR bit 16=1: xxxxxxxx|xxxxxxxx01100111|0000000000000000
Rounded value: xxxxxxxx|xxxxxxxx01100110|0000000000000000
Biased Rounding
The Biasrnd bit in the ICNTL register enables biased rounding. When the
Biasrnd bit is cleared (=0), the Rnd option in multiplier instructions uses
the normal unbiased rounding operation (as discussed in “Unbiased
Rounding” on page 2-14). When the Biasrnd bit is set to 1, the DSP uses
biased rounding instead of unbiased rounding. When operating in biased
rounding mode, all rounding operations with MR0 set to 0x8000 round up,
rather than only rounding odd MR1 values up. For an example, see
Figure 2-7.
This mode only has an effect when the MR0 register contains 0x8000; all
other rounding operations work normally. This mode allows more effi-
cient implementation of bit-specified algorithms that use biased rounding,
for example, the GSM speech compression routines. Unbiased rounding is
preferred for most algorithms.
MR before RND
Biased RND result
Unbiased RND result
0x 00 0 0 00 8 00 0 0 x0 0 0 00 1 00 0 0 0x 0 0 00 0 0 0 0 00
0x 00 0 0 01 8 00 0 0 x0 0 0 00 2 00 0 0 0x 0 0 00 0 2 0 0 00
0x 00 0 0 00 8 00 1 0 x0 0 0 00 1 00 0 1 0x 0 0 00 0 1 0 0 01
0x 00 0 0 01 8 00 1 0 x0 0 0 00 2 00 0 1 0x 0 0 00 0 2 0 0 01
0x 00 0 0 00 7 FF F 0 x0 0 0 00 0 FF F F 0x 0 0 00 0 0 F F FF
0x 00 0 0 01 7 FF F 0 x0 0 0 00 1 FF F F 0x 0 0 00 0 1 F F FF
ALU Operation
ALU instructions take one or two inputs: X input and Y input. For uncon-
ditional, single-function instructions, these inputs (also known as
operands) can be any data registers in the register file. Most ALU opera-
tions return one result, but in Pass operations the ALU operation returns
no result (only status flags are updated). ALU results are written to the
ALU Result (AR) or ALU Feedback (AF) register.
The DSP transfers input operands from the register file during the first
half of the cycle and transfers results to the result register during the sec-
ond half of the cycle. With this arrangement, the ALU can read and write
the AR register file location in a single cycle.
AZ Zero Logical NOR of all the bits in the ALU result register. True if ALU output
equals zero.
AN Negative Sign bit of the ALU result. True if the ALU output is negative.
AV Overflow Exclusive-OR of the carry outputs of the two most significant adder stages.
True if the ALU overflows.
AS Sign Sign bit of the ALU X input port. Affected only by the ABS instruction.
AQ Quotient Quotient bit generated only by the DIVS and DIVQ instructions.
Flag updates occur at the end of the cycle in which the status is generated
and are available in the next cycle.
16 16
M UX M UX
X Y
AZ
AN
CI AC AF
ALU
AV RE G IS TE R
AR_S A T AS
AV _LA T CH AQ
16 16
M UX
AR
RE G IS T E R
16 R - BUS
The ALU is 16 bits wide with two 16-bit input ports, X and Y, and one
output port, R. The ALU accepts a carry-in signal (CI) which is the carry
bit (AC) from the processor arithmetic status register (ASTAT). The ALU
generates six status signals: the zero (AZ) status, the negative (AN) status,
the carry (AC) status, the overflow (AV) status, the X-input sign (AS) status,
and the quotient (AQ) status.
All arithmetic status signals are latched into the arithmetic status register
(ASTAT) at the end of the cycle. For information on how each instruction
affects the ALU flags, see Table 2-6 on page 2-20.
Depending on the instruction, the X input port of the ALU can accept
data from two sources: the data register file (X-input registers for condi-
tional/multifunction instructions) or the result (R) bus. The R bus
connects the output registers of all the computational units, permitting
them to be used as input operands directly.
Also depending on the instruction, the Y input port of the ALU can accept
data from two sources: the data register file (Y-input registers for condi-
tional/multifunction instructions) and the ALU feedback (AF) register.
The ALU contains a duplicate bank of registers (shown behind the pri-
mary registers in Figure 2-8 on page 2-21). There are two sets of data and
results registers. Only one bank is accessible at a time. The additional
bank of registers can be activated (such as during an interrupt service rou-
tine) for extremely fast context switching. A new task, such as an interrupt
service routine, can be executed without transferring current states to stor-
age. For more information, see “Secondary (Alternate) Data Registers” on
page 2-59.
Multiprecision operations are supported in the ALU with the carry-in sig-
nal and ALU carry (AC) status bit. The carry-in signal is the AC status bit
that was generated by a previous ALU operation. The “add with carry”
(+C) operation is intended for adding the upper portions of multipreci-
sion numbers. The “subtract with borrow” (C–1 is effectively a “borrow”)
operation is intended for subtracting the upper portions of multiprecision
numbers.
15
LE F T S HIFT
L
AX 0 AX 1 AY 1 A F S AY 0
16 LO W E R
DIV IDE ND
M UX M UX
UP P E R
DIV IDE ND
MSB
M SB
DIV IS O R
AQ
R-BU S X Y
ALU
R = P AS S Y
15 LS BS
The ALU output R is offset loaded into AF just as with the DIVS operation.
The AQ bit is computed as the exclusive-OR of the divisor MSB and the
ALU output MSB, and the quotient bit is this value inverted. The quo-
tient bit is loaded into the LSB of the AY0 register which is also shifted left
by one bit. The DIVQ operation is illustrated in Figure 2-10.
15
LE FT S HIFT
AX 1 AF S AY 0
AX 0
B
LOWER
DIV IDE ND
P ART IAL
RE M AIND E R
M UX
16
DIV IS O R M SB
R-BU S X Y AQ
ALU
R=Y +X IF AQ =1
R=Y -X IF AQ =0
1 MSB
15 LS BS
The format of the quotient for any numeric representation can be deter-
mined by the format of the dividend and divisor as shown in Figure 2-11.
Let NL represent the number of bits to the left of the binary point, let NR
represent the number of bits to the right of the binary point of the divi-
dend, let DL represent the number of bits to the left of the binary point,
and let DR represent the number of bits to the right of the binary point of
the divisor. Then, the quotient has NL–DL+1 bits to the left of the binary
point and has NR–DR–1 bits to the right of the binary point.
NL bits NR bits
Divisor BB .BBBBBBBBBBBBBB
DL bits DR bits
Multiply—Accumulator (Multiplier)
The multiplier performs fixed-point multiplication and multiply/accumu-
late operations. Multiply/accumulates are available with either cumulative
addition or cumulative subtraction. Multiplier fixed-point instructions
operate on 16-bit fixed-point data and produce 40-bit results. Inputs are
treated as fractional or integer, unsigned or two’s complement. Multiplier
instructions include:
• Multiplication
• Multiply/accumulate with addition, rounding optional
• Multiply/accumulate with subtraction, rounding optional
• Rounding, saturating, or clearing result register
Multiplier Operation
The multiplier takes two inputs: X input and Y input. For unconditional,
single-function instructions, these inputs (also known as operands) can be
any data registers in the register file. The multiplier accumulates results in
either the Multiplier Result (MR) or Shifter Result (SR) register. The results
can also be rounded or saturated.
The multiplier transfers input operands during the first half of the cycle
and transfers results during the second half of the cycle. With this arrange-
ment, the multiplier can read and write the same result register in a single
cycle.
Depending on the multiplier mode (M_MODE) setting, operands are either
both in integer format or both in fractional format. The format of the
result matches the format of the inputs. Each operand may be either an
unsigned or a two’s complement value. If both inputs are fractional and
signed, the multiplier automatically shifts the result left one bit to remove
the redundant sign bit. Multiplier instruction options (required within the
multiplier instruction) specify inputs’ data format(s)—SS for signed, UU
for unsigned, SU for signed X-input and unsigned Y-input, and US for
unsigned X-input and signed Y-input.
To load the MR2 register with a value other than MR1’s sign extension, pro-
grams must load MR2 after MR1 has been loaded. Loading MR0 affects neither
MR1 nor MR2; no sign extension occurs in MR0 loads. This technique also
applies to SR2, SR1, and SR0.
39 0 39 0
MR SR
15 8 7 0 15 0 15 0 15 8 7 0 15 0 15 0
MR2 M R1 MR0 SR 2 SR 1 SR 0
nine bits in MR are anything other than all 0s or all 1s, setting MV when the
accumulator result—interpreted as a signed, two’s complement number—
crosses the 32-bit boundary and spills over from MR1 into MR2. Otherwise,
the multiplier clears MV = 0.
The operation of the saturation instruction depends on the overflow status
bit MV (or SV) and the MSB of the result, which appear in Table 2-7 on
page 2-32. If MV/SV = 0, no saturation occurs. When MV/SV = 1, the mul-
tiplier examines the MSB of MR2 to determine whether the result has
overflowed or underflowed. If the MSB = 0, the result has overflowed, and
the multiplier saturates the result register, setting it to the maximum posi-
tive value. If the MSB = 1, the result has underflowed, and the multiplier
saturates the MR register, setting it to the maximum negative value.
Table 2-7. Saturation Status Bits and Result Registers
0 0 No change.
0 1 No change.
16 16
M UX M UX
X Y
M ULT IP LIE R
P
S R1
32 32
RE G IS T E R
MV SV
ADD/S UBTRA CT ADD/S UBTRA CT
R R
40 40 40 40
M UX M UX
MR SR
RE G IS T E R RE G IS T E R
40 40
R - BUS
Barrel-Shifter (Shifter)
The shifter provides bitwise shifting functions for 16-bit inputs, yielding a
40-bit output. These functions include arithmetic shift (ASHIFT), logical
shift (LSHIFT), and normalization (NORM). The shifter also performs deriva-
tion of exponent (EXP) and derivation of common exponent (EXPADJ) for
an entire block of numbers. These shift functions can be combined to
implement numerical format control, including full floating-point
representation.
Shifter Operations
The shifter instructions (ASHIFT, LSHIFT, NORM, EXP, and EXPADJ) can be
used in a variety of ways, depending on the underlying arithmetic require-
ments. The following sections present single and multiple precision
examples for these functions:
• “Derive Block Exponent” on page 2-39
• “Immediate Shifts” on page 2-40
• “Denormalize” on page 2-42
• “Normalize, Single Precision Input” on page 2-44
The shift functions (arithmetic shift, logical shift, and normalize) can be
optionally specified with [SR OR] to facilitate multiprecision operations.
[SR OR] logically OR’s the shift result with the current contents of SR. This
option is used to join 16-bit inputs with the 40-bit value in SR. When
[SR OR] is not used, the shift value is passed through to SR directly.
Almost all shifter instructions have two or three options: (Hi), (Lo), and
(Hix). Each option enables a different exponent detector mode that oper-
ates only while the instruction executes. The shifter interprets and handles
the input data according to the selected mode.
For the derive exponent (EXP) and block exponent adjust (EXPADJ) opera-
tions, the shifter calculates the shift code—the direction and number of
bits to shift—then stores the value in SE (for EXP) or SB (for EXPADJ). For
the ASHIFT, LSHIFT, and NORM operations, a program can supply the value
of the shift code directly to the SE register or use the result of a previous
EXP or EXPADJ operation.
Immediate Shifts
An immediate shift shifts the input bit pattern to the right (downshift) or
left (upshift) by a given number of bits. Immediate shift instructions use
the data value in the instruction itself to control the amount and direction
of the shifting operation. For examples using this instruction, see the
ADSP-219x DSP Instruction Set Reference. The data value controlling the
shift is an 8-bit signed number. The SE register is not used or changed by
an immediate shift.
The following example shows the input value downshifted relative to the
upper half of SR (SR1). This is the (Hi) version of the shift:
SI = 0xB6A3;
SR = LSHIFT SI By –5 (Hi);
This next example uses the same input value, but shifts in the other direc-
tion, referenced to the lower half (Lo) of SR:
SI = 0xB6A3;
SR = LSHIFT SI By 5 (LO);
Note that a negative shift cannot place data (except a sign extension) into
SR2, but a positive shift with value greater than 16 puts data into SR2. This
next example also sets the SV bit (because the MSB of SR1 does not match
the value in SR2):
SI = 0xB6A3; SR = LSHIFT SI By 17 (Lo);
This next example uses the same input value, but performs an arithmetic
shift:
SI = 0xB6A3;
SR = ASHIFT SI By –5 (HI);
Denormalize
Denormalizing refers to shifting a number according to a predefined expo-
nent. The operation is effectively a floating-point to fixed-point
conversion.
Denormalizing requires a sequence of operations. First, the SE register
must contain the exponent value. This value may be explicitly loaded or
may be the result of some previous operation. Next, the shift itself is per-
formed, taking its shift value from the SE register, not from an immediate
data value.
Two examples of denormalizing a double-precision number follow. The
first example shows a denormalization in which the upper half of the
number is shifted first, followed by the lower half. Because computations
may produce output in either order, the second example shows the same
operation in the other order—lower half first.
This first denormalization example processes the upper half first. Some
important points here are: (1) always select the arithmetic shift for the
higher half (Hi) of the two’s complement input (or logical for unsigned),
and (2) the first half processed does not use the [SR OR] option.
SR (shifted by):
1111 1111 1111 0110 1101 0100 0110 0000 0000 0000
---sr2---|--------sr1--------|--------sr0--------
Continuing this example, next, the lower half is processed. Some impor-
tant points here are: (1) always select a logical shift for the lower half of
the input, and (2) the second half processed must use the [SR OR] option
to avoid overwriting the previous half of the output value.
SI = 0x765D; {second input, lower half result}
{SE = -3 still}
SR = SR OR LSHIFT SI By –3 (Lo); {must use Lo option}
SR (OR’d, shifted):
1111 1111 1111 0110 1101 0100 0110 1110 1100 1011
---sr2---|--------sr1--------|--------sr0--------
This second denormalization example uses the same input, but processes it
in the opposite (lower half first) order. The same important points from
before apply: (1) the high half is always arithmetically shifted, (2) the low
half is logically shifted, (3) the first input is passed straight through to SR,
and (4) the second half is OR’ed, creating a double-precision value in SR.
SI = 0x765D; {first input, lower half result}
SE = -3; {shifter exponent}
SR = LSHIFT SI By –3 (LO); {must use LO option}
SI = 0xB6A3; {second input, upper half result}
SR (shifted by):
0000 0000 0000 0000 0000 0000 0000 1110 1100 1011
---sr2---|--------sr1--------|--------sr0--------
SR (OR’d, shifted):
1111 1111 1111 0110 1101 0100 0110 1110 1100 1011
---sr2---|--------sr1--------|--------sr0--------
This normalization example for a single precision input. First, the EXP
instruction derives the exponent:
AR = 0xF6D4; {single precision input}
SE = EXP AR (Hi); {Detects Exponent With Hi Modifier}
SR (Normalized):
1111 1111 1011 0110 1010 0000 0000 0000 0000 0000
---sr2---|--------sr1--------|--------sr0--------
For a single precision input, the normalize operation can use either the
(Hi) or (Lo) modifier, depending on whether the result is needed in SR1
or SR0.
SR (Normalized):
0000 0000 0111 1101 0001 1001 0000 0000 0000 0000
---sr2---|--------sr1--------|--------sr0--------
The Hix operation executes properly whether or not there has actually
been an overflow, as demonstrated by this second example:
AR = 1110 0011 0101 1011
AV = 0 (indicating no overflow)
AC = 0 (not meaningful if AV = 0)
1. Detect Exponent, Modifier = Hix
SE set to –2
2. Normalize, Modifier = Hi, SE = –2
AR = 1110 0011 0101 1011
SR (Normalized):
1111 1111 1000 1101 0110 1000 0000 0000 0000 0000
---sr2---|--------sr1--------|--------sr0--------
The AC bit is not used as the sign bit. As Figure 2-15 shows, the Hix mode
is identical to the Hi mode when AV is not set. When the NORM, Lo opera-
tion is done, the extension bit is zero; when the NORM, Hi operation is done,
the extension bit is AC.
into SE (see Figure 2-16). This value is used to control both parts of the
normalization that follows.
For the second stage (SE now contains the correct exponent value), the
order of operations is immaterial. The first half (whether Hi or Lo) is nor-
malized without the [SR OR], and the second half is normalized with
[SR OR] to create one double-precision value in SR. The (Hi) and (Lo)
modifiers identify which half is being processed.
The following example normalizes double precision values:
1. Detect Exponent, Modifier = Hi
First Input: 1111 0110 1101 0100 (upper half)
SE set to: -3
2. Detect Exponent, Modifier = Lo
Second Input: 0110 1110 1100 1011
SE unchanged: -3
SR (Normalized):
1111 1111 1011 0110 1010 0000 0000 0000 0000 0000
---sr2---|--------sr1--------|--------sr0--------
SR (Normalized):
1111 1111 1011 0110 1010 0011 0111 0110 0101 1000
---sr2---|--------sr1--------|--------sr0--------
If the upper half of the double precision input contains all sign bits, the SE
register value is determined by the second derive exponent operation as
shown in this second double precision normalization example:
1. Detect Exponent, Modifier = Hi
First Input: 1111 1111 1111 1111 (upper half)
SE set to: -15
2. Detect Exponent, Modifier = Lo
Second Input: 1111 0110 1101 0100
SE now set to: -19
SR (Normalized):
0000 0000 0000 0000 0000 0000 0000 0000 0000 0000
---sr2---|--------sr1--------|--------sr0--------
Note that all values of SE less than –15 (resulting in a shift of +16
or more) upshift the input completely off scale.
4. Normalize, Modifier=Lo, [SR OR], SE = –19 (negated)
Second Input: 1111 0110 1101 0100
SR (Normalized):
1111 1111 1011 0110 1010 0000 0000 0000 0000 0000
---sr2---|--------sr1--------|--------sr0--------
DM D BUS 16
DRE G /S I
M UX
RE G IS TE R
SB
M UX
RE G IS TE R
E X P O NE NT
CO M P ARE
DE TE CTO R X
SS
I X
HI / LO R
S HIFT E R
ARR AY
M UX C
O
8 SV
40
SE
M UX O R / P AS S
RE G IS TE R
NE G ATE M UX
8 40
SR
FRO M
RE G IS T E R
INS T RUCTIO N
16
R - BUS
The shifter array is a 16x40 barrel shifter. It accepts a 16-bit input and can
place it anywhere in the 40-bit output field, from off-scale right to
off-scale left, in a single cycle. This spread gives 57 possible placements
within the 40-bit field. The placement of the 16 input bits is determined
by a shift control code (C) and a Hi/Lo option.
Depending on the instruction, the input port of the shifter can accept data
from two sources: the data register file or the result (R) bus. Register usage
for shifter input is only restricted in one instruction: the multifunction
shift with memory read or write. In this instruction, only the shifter input
(SI) register or result registers can provide input to the shifter array and
the exponent detector.
Any of the SI, SE, or SR registers can be read and written in the same cycle.
Registers are read at the beginning of the cycle and written at the end of
the cycle. All register reads get values loaded at the end of a previous cycle.
A new value written to a register cannot be read out until a subsequent
cycle. This allows an input register to provide an operand to the shifter at
the beginning of the cycle and be updated with the next operand at the
end of the same cycle. It also allows a result register to be stored in mem-
ory and updated with a new result in the same cycle.
The shifter contains a duplicate bank of registers (shown behind the pri-
mary registers in Figure 2-14). There are actually two sets of SE, SB, SI,
SR2, SR1, and SR0 registers. Only one bank is accessible at a time. The
additional bank of registers can be activated for extremely fast context
switching. A new task, such as an interrupt service routine, can then be
executed without transferring current states to storage. For more informa-
tion, see “Secondary (Alternate) Data Registers” on page 2-59.
The shifting of the input is determined by a control code (C) and a Hi/Lo
option. The control code is an 8-bit signed value that indicates the direc-
tion and number of places the input is to be shifted. Positive codes
indicate a left shift (upshift) and negative codes indicate a right shift
(downshift). The control code can come from three sources: the content
of the shifter exponent (SE) register, the negated content of the SE register,
or an immediate value from the instruction.
The Hi/Lo option determines the reference point for the shifting. In the Hi
state, all shifts are referenced to SR1 (the upper half of the output field),
and in the Lo state, all shifts are referenced to SR0 (the lower half). The
Hi/Lo feature is useful when shifting 32-bit values because it allows both
halves of the number to be shifted with the same control code.The Hi/Lo
option is selectable each time the shifter is used.
The shifter fills any bits to the right of the input value in the output field
with zeros, and bits to the left are filled with the extension bit (X). The
extension bit can be fed by three possible sources depending on the
instruction being performed. The three sources are the MSB of the input,
the AC bit from the arithmetic status register (ASTAT), or a zero.
Figure 2-15 on page 2-56 shows the shifter array output as a function of
the control code and Hi/Lo signal. In the figure, ABCDEFGHIJKLMNPR repre-
sents the 16-bit input pattern, and X stands for the extension bit.
The OR/PASS logic allows the shifted sections of a multiprecision num-
ber to be combined into a single quantity. In some shifter instructions, the
shifted output may be logically OR’ed with the contents of the SR register;
the shifter array is bitwise OR’ed with the current contents of the SR regis-
ter before being loaded there. When the [SR OR] option is not used in the
instruction, the shifter array output is passed through and loaded into the
shifter result (SR) register unmodified.
The exponent detector derives an exponent for the shifter input value.
The exponent detector operates in one of three ways that determine how
the input value is interpreted. In the Hi state, the input is interpreted as a
single precision number or the upper half of a double precision number.
The exponent detector determines the number of leading sign bits and
produces a code that indicates how many places the input must be
up-shifted to eliminate all but one of the sign bits. The code is negative so
that it can become the effective exponent for the mantissa formed by
removing the redundant sign bits.
In the Hi-extend state (Hix), the input is interpreted as the result of an add
or subtract performed in the ALU which may have overflowed. The expo-
nent detector takes the arithmetic overflow ( AV) status into consideration.
If AV is set, then a +1 exponent is output to indicate an extra bit is needed
in the normalized mantissa (the ALU Carry bit); if AV is not set, then
Hi-extend functions exactly like the Hi state. When performing a derive
exponent function in Hi or Hi-extend modes, the exponent detector also
outputs a shifter sign (SS) bit, which is loaded into the arithmetic status
register (ASTAT). The sign bit is the same as the MSB of the shifter input
except when AV is set; when AV is set in Hi-extend state, the MSB is
inverted to restore the sign bit of the overflowed value.
In the Lo state, the input is interpreted as the lower half of a double preci-
sion number. In the Lo state, the exponent detector interprets the SS bit in
the arithmetic status register (ASTAT) as the sign bit of the number. The SE
register is loaded with the output of the exponent detector only if SE con-
tains –15. This occurs only when the upper half (which must be processed
first) contains all sign bits. The exponent detector output is also offset by
–16 to account for the fact that the input is actually the lower 16 bits of a
40-bit value. Figure 2-16 on page 2-58 gives the exponent detector char-
acteristics for all three modes.
The exponent compare logic is used to find the largest exponent value in
an array of shifter input values. The exponent compare logic, in conjunc-
tion with the exponent detector, derives a block exponent. The
comparator compares the exponent value derived by the exponent detector
with the value stored in the shifter block exponent (SB) register and
updates the SB register only when the derived exponent value is larger than
the value in SB register.
S = Sign bit
N = N o n-sig n bit
D = D on’t care bit
H I M ode H IX M ode
1 DD DD DD DD DD DD DD DD +1
SN DD DD DD DD DD DD DD 0 0 S N DD DD DD D DD D DD DD 0
SS ND DD DD DD DD DD DD -1 0 S S ND DD DD D DD D DD DD -1
SS SN DD DD DD DD DD DD -2 0 S S SN DD DD D DD D DD DD -2
SS SS ND DD DD DD DD DD -3 0 S S SS ND DD D DD D DD DD -3
SS SS SN DD DD DD DD DD -4 0 S S SS SN DD D DD D DD DD -4
SS SS SS ND DD DD DD DD -5 0 S S SS SS ND D DD D DD DD -5
SS SS SS SN DD DD DD DD -6 0 S S SS SS SN D DD D DD DD -6
SS SS SS SS ND DD DD DD -7 0 S S SS SS SS N DD D DD DD -7
SS SS SS SS SN DD DD DD -8 0 S S SS SS SS S ND D DD DD -8
SS SS SS SS SS ND DD DD -9 0 S S SS SS SS S SN D DD DD -9
SS SS SS SS SS SN DD DD -1 0 0 S S SS SS SS S SS N DD DD -1 0
SS SS SS SS SS SS ND DD -1 1 0 S S SS SS SS S SS S ND DD -1 1
SS SS SS SS SS SS SN DD -1 2 0 S S SS SS SS S SS S SN DD -1 2
SS SS SS SS SS SS SS ND -1 3 0 S S SS SS SS S SS S SS ND -1 3
SS SS SS SS SS SS SS SN -1 4 0 S S SS SS SS S SS S SS SN -1 4
SS SS SS SS SS SS SS SS -1 5 0 S S SS SS SS S SS S SS SS -1 5
LO M ode
S ND DD D DD D DD DD D DD D - 15
S SN DD D DD D DD DD D DD D - 16
S SS ND D DD D DD DD D DD D - 17
S SS SN D DD D DD DD D DD D - 18
S SS SS N DD D DD DD D DD D - 19
S SS SS S ND D DD DD D DD D - 20
S SS SS S SN D DD DD D DD D - 21
S SS SS S SS N DD DD D DD D - 22
S SS SS S SS S ND DD D DD D - 23
S SS SS S SS S SN DD D DD D - 24
S SS SS S SS S SS ND D DD D - 25
S SS SS S SS S SS SN D DD D - 26
S SS SS S SS S SS SS N DD D - 27
S SS SS S SS S SS SS S ND D - 28
S SS SS S SS S SS SS S SN D - 29
S SS SS S SS S SS SS S SS N - 30
S SS SS S SS S SS SS S SS S - 31
The following example demonstrates how code handles the one cycle of
latency that occurs from the time the instruction sets the bit in MSTAT to
when the secondary registers are available for accessing.
AR = MSTAT;
AR = Setbit SEC_REG Of AR;
MSTAT=AR; /* activate secondary reg. file */
Nop; /* wait for access to secondaries */
AX0 = 7;
Multifunction Computations
Using the many parallel data paths within its computational units, the
DSP supports multiple-parallel (multifunction) computations. These
instructions complete in a single cycle, and they combine parallel opera-
tion of the multiplier, ALU, or shifter with data move operations. The
multiple operations perform the same as if they were in corresponding sin-
gle-function computations. Multifunction computations also handle flags
in the same way as the single-function computations.
To work with the available data paths, the computation units constrain
which data registers may hold the input operands for multifunction com-
putations. These constraints limit which registers may hold the X-input
and Y-input for the ALU, multiplier, and shifter.
Figure 2-17 on page 2-62 shows how some register access restrictions
apply to conditional and/or multifunction instructions. The boxes around
the X- and Y-inputs within the register file only apply for conditional
and/or multifunction instructions. For unconditional, single-function
instructions, any of the registers within the register file may serve as X- or
Y-inputs (see Figure 2-1 on page 2-3). The following code example shows
the differences between conditional versus unconditional instructions and
single-function versus multifunction instructions.
/* Conditional computation instructions begin with an IF
clause. The DSP tests whether the condition is true before
executing the instruction. */
The data paths over the Results Bus from the results registers let the result
registers (MR2, MR1, MR0, SR1, SR0, or AR) serve as X-inputs to the ALU and
multiplier in both the conditional/multifunction and unconditional/sin-
gle-function cases. The upper part of the Shifter Results (SR) register, SR2,
may not serve as feedback over the results bus. For information on the
SR2, SB, SE, MSTAT, and ASTAT registers in Figure 2-17, see the discussion
on page 2-2.
Only the ALU and multiplier X- and Y-operand registers (MX0, MX1, MY0,
MY1, AX0, AY1) have memory data bus access in dual memory read multi-
function instructions.
M S TA T P M D A TA B U S
D M D A TA B U S
R E G IS TE R F IL E (1 6 × 1 6 - B IT)
SB SE
Y
MAC S H IF TE R A LU
M R 2* M R 1 M R 0 SR 2 * SR 1 ** SR 0 AF AR
R E S U LTS B U S
A S TA T
* Th e M R 2 a n d S R 2 re g iste rs h a v e so m e u sa g e
re stric tio n s th a t d o n o t a p p e a r in th is
S TA TU S TO
d ia g ra m . F o r d e ta ils, se e th e te x t.
PRO G RA M SEQ U EN C ER
** Th e S R 1 re g iste r a lso m a y se rv e a s a Y in p u t
in c o n d itio na l o r m u ltifu n c tio n M A C a n d A LU
in stru c tio n s.
Instruction1
|<ALU>, <MAC>|, Xop = DM(Ia += Mb), Yop = PM(Ic += Md);
Xop = DM(Ia += Mb), Yop = PM(Ic += Md);
|<ALU>, <MAC>,<SHIFT> |, Dreg = |DM(Ia += Mb), PM(Ic += Md)|;
|<ALU>, <MAC>, <SHIFT>|, |DM(Ia += Mb), PM(Ic += Md)| = Dreg;
|<ALU>, <MAC>, <SHIFT>|, Dreg = Dreg;
1 Multifunction instructions are sets of instruction that execute in a single cycle. The instructions are
delimited with commas, and the combined multifunction instruction is terminated with a semicolon.
Overview
The DSP’s program sequencer controls program flow by providing the
address of the next instruction to be executed by other parts of the DSP.
Program flow in the DSP is mostly linear, with the processor executing
program instructions sequentially. This linear flow varies occasionally
when the program uses non-sequential program structures, such as those
illustrated in Figure 3-1 on page 3-2. Non-sequential structures direct the
DSP to execute an instruction that is not at the next sequential address.
These structures include:
• Loops. One sequence of instructions executes several times with
near-zero overhead.
• Subroutines. The processor temporarily interrupts sequential flow
to execute instructions from another part of program memory.
• Jumps. Program flow transfers permanently to another part of pro-
gram memory.
• Interrupts. Subroutines in which a runtime event (not an instruc-
tion) triggers the execution of the routine.
• Idle. An instruction that causes the processor to cease operations,
holding its current state until an interrupt occurs. Then, the proces-
sor services the interrupt and continues normal execution.
LIN E A R F LO W LO O P JU M P
A D D R E S S: N IN S TR U C TIO N D O U N TIL JU M P
SU B R O U TIN E IN TE R R U P T ID LE
IR Q
C A LL IN S TR U C TIO N ID LE
R TS R TI
A D S P -2 1 9 X A D S P -2 1 9X D S P C O R E
(C O M M O N TO A D S P -2 1 9 X FA M ILY )
D S P S P E C IF IC
P M DA TA B U S
PR O G R A M M A B LE
C O U N TE R E X P IR E D (C E )
FLA G S
S TA TU S & A R ITH M E TIC S TA TU S
C O N D ITIO N
LO O P S TA TU S
ADDRESS
IN S TR C A C H E
FR O M D A G S P C S TA TU S
LO O P & B R A N C H IN S TR LA TC H
C O N TR O L
IN TE R R U P TS
IN TE R R U P T C O N TR O LLE R LO O P S TA C K P C S TA C K
+1
V E C TO R IN D DIR P C -R E L LO O P RT RB IN C R
A DDR BR A N BR A N B RA N A DDR ADDR A DDR A DDR
IN S TR U C TIO N P IP E LIN E
LO O K A H E A D A D D R E S S (LA )
P R EFE TC H A D D R E S S (P A )
FE TC H A D D R E S S (FA )
D M A R E Q U E S TS
A D D R E S S D E C O D E (A D )
STACK
D M A C O N TR O LLE R IN S TR U C TIO N D E C O D E (ID )
ADDRESS
E X E C U TE (P C )
PM A DDRESS BUS
1 CNTR has a one-cycle latency before an If Not CE instruction, but has zero latency otherwise.
1 Changing MSTAT bits with the Ena or Dis mode instruction has a 0 effect latency; when writing to
MSTAT or performing a Pop Sts the effect latencies vary based on the altered bits.
2 Except for the CFZ bit, which has an effect latency of four cycles.
Instruction Pipeline
The program sequencer determines the next instruction address by exam-
ining both the current instruction being executed and the current state of
the processor. If no conditions require otherwise, the DSP executes
instructions from program memory in sequential order by incrementing
the look-ahead address. Using its instruction pipeline, the DSP processes
instructions in six clock cycles:
• Look-Ahead Instruction (LA). The DSP determines the source for
the instruction from inputs to the look-ahead address multiplexer.
• Prefetch Instruction (PA) and Fetch Instruction (FA). The DSP
reads the instruction from either the on-chip instruction cache or
from program memory.
• Address Decode (AD) and Instruction Decode (ID). The DSP
decodes the instruction, generating conditions that control instruc-
tion execution.
• Execute (PC). The DSP executes the instruction; the operations
specified by the instruction complete in a single cycle.
These cycles overlap in the pipeline, as shown in Table 3-3 on page 3-8.
In sequential program flow, when one instruction is being fetched, the
instruction fetched three cycles previously is being executed. With few
exceptions, sequential program flow has a throughput of one instruction
per cycle. The exceptions are the two-cycle instructions: 16- or 24-bit
immediate data write to memory with indirect addressing, long jump
(Ljump), and long call (Lcall).
Any non-sequential program flow can potentially decrease the DSP’s
instruction throughput. Non-sequential program operations include:
• Program memory data accesses that conflict with instruction fetches
• Jumps
Cycles LA PA FA AD ID PC
1 0x08 !
2 0x09 ! 0x08 !
Look Ahead Address (LA). Prefetch Address (PA). Fetch Address (FA).
Address Decode (AD). Instruction Decode (ID). Execute (PC).
Instruction Cache
Usually, the sequencer fetches an instruction from memory on each cycle.
Occasionally, bus constraints prevent some of the data and instructions
from being fetched in a single cycle. To minimize the impact of these bus
constraints on data flow, the DSP has an instruction cache, as shown in
Figure 3-3. When the DSP executes an instruction that requires data
access over the PM data bus, there is a bus conflict because the sequencer
also uses the PM data bus for fetching instructions. To avoid these con-
flicts and reduce delays, the DSP caches instructions.
When the DSP encounters a fetch conflict, it must wait to fetch the
instruction on the following cycle, causing a delay. The DSP automati-
cally writes the fetched instruction to the cache to prevent the same delay
from happening again. The sequencer checks the instruction cache on
every program memory data access. If the appropriate instruction is in the
cache, the instruction fetch (from the cache) occurs in parallel with the
data access (from the PM data bus), without incurring a delay.
Because of the six-stage instruction pipeline, as the DSP executes an
instruction (at address n) that requires a program memory data access, this
execution creates a conflict with the instruction fetch (at address n+3).
The cache stores the fetched instruction (n+3), not the instruction requir-
ing the program memory data access.
If the instruction needed to avoid a conflict is in the cache, the cache pro-
vides the instruction while the program memory data access is performed.
If the needed instruction is not in the cache, the instruction fetch from
memory takes place in the cycle following the program memory data
access, incurring one cycle of overhead. If the cache is enabled and not fro-
zen, the fetched instruction is loaded into the cache, so that it is available
the next time the same conflict occurs.
Figure 3-3 shows a block diagram of the instruction cache. The cache
holds 64 instruction-address pairs. These pairs (or cache entries) are
arranged into 32 (31-0) cache sets according to the instruction address’
five least significant bits (4-0). The two entries in each set (entry 0 and
entry 1) have a valid bit, indicating whether the entry contains a valid
instruction. The least recently used (LRU) bit for each set indicates which
entry was not used last (0=entry 0 and 1=entry 1).
SE T 0 EN TR Y 0 00000
EN TR Y 1
SE T 1 EN TR Y 0 00001
EN TR Y 1
SE T 2 EN TR Y 0 00010
EN TR Y 1
SE T 2 9 EN TR Y 0 11101
EN TR Y 1
SE T 3 0 EN TR Y 0 11110
EN TR Y 1
SE T 3 1 EN TR Y 0 11111
EN TR Y 1
The cache places instructions in entries according to the five LSBs of the
instruction’s address. When the sequencer checks for an instruction to
fetch from the cache, it uses the five address LSBs as an index to a cache
set. Within that set, the sequencer checks the addresses and valid bits of
the two entries, looking for the needed instruction. If the cache contains
the instruction, the sequencer uses the entry and updates the LRU bit to
indicate the entry did not contain the needed instruction.
When the cache does not contain a needed instruction, the cache loads a
new instruction and its address, placing these in the least recently used
entry of the appropriate cache set and toggling the LRU bit.
! Because the least significant five address bits determine which cache
set store an instruction, instructions in the same cache set are mul-
tiples of 64 address locations apart. As demonstrated in the optimi-
zation example, it is a rare combination of instruction sequences
that can lead to “cache thrashing”—iterative swapping of cache
entries.
At power up, the DSP initializes the IJPG register to 0x0. Initializing the
page register is only necessary when the instruction is located on a page
other than the current page.
Conditional Branches
The sequencer supports conditional branches. These are Jump or
Call/return instructions whose execution is based on testing an If condi-
tion. For more information on condition types in If condition
instructions, see “Conditional Sequencing” on page 3-39.
Delayed Branches
The instruction pipeline influences how the sequencer handles branches.
For immediate branches—Jump and Call/return instructions not specified
as delayed branches (DB), four instruction cycles are lost (Nops) as the pipe-
line empties and refills with instructions from the new branch.
As shown in Table 3-5 and Table 3-6, the DSP does not execute the four
instructions after the branch, which are in the fetch and decode stages. For
a Call, the next instruction (the instruction after the Call) is the return
address. During the four lost (no-operation) cycles, the pipeline fetches
and decodes the first instruction at the branch address.
For delayed branches—Jump and Call/return instructions with the delayed
branches (DB) modifier, only two instruction cycles are lost in the pipeline,
because the DSP executes the two instructions after the branch while the
pipeline fills with instructions from the new branch.
Cycles LA PA FA AD ID PC
Note that n is the branching instruction, and j is the instruction branch address. Notes: (1) n+1, n+2,
n+3, and n+4 are suppressed. (2) For call, return address (n+1) is pushed on PC stack.
Cycles LA PA FA AD ID PC
Note that n is the branching instruction, and r is the instruction branch address. Notes: (1) n+1, n+2,
n+3, and n+4 are suppressed. (2) r (n+1 in Table 3-5) the return address is popped from PC stack.
As shown in Table 3-7 and Table 3-8, the DSP executes the two instruc-
tions after the branch, while the instruction at the branch address is
fetched and decoded. In the case of a Call, the return address is the third
instruction after the branch instruction. While delayed branches use the
instruction pipeline more efficiently than immediate branches, it is impor-
tant to note that delayed branch code can be harder to understand because
of the instructions between the branch instruction and the actual branch.
Cycles LA PA FA AD ID PC
Note that n is the branching instruction, and j is the instruction branch address. Notes: (1) n+3 and
n+4 are suppressed. (2)Delayed branch slots. (3) For call, return address (n+3) is pushed on PC stack.
Cycles LA PA FA AD ID PC
Note that n is the branching instruction, and r is the instruction branch address. Notes: (1) r (n+1
in Table 3-7) the return address is popped from PC. (2) stackn+3 and n+4 are suppressed. (3) De-
layed branch slots.
Besides being somewhat more challenging to code, there are also some
limitations on delayed branches that stem from the instruction pipeline
architecture. Because the delayed branch instruction and the two instruc-
tions that follow it must execute sequentially, the instructions in the two
locations (delayed branch slots) that follow a delayed branch instruction
may not be any of the following:
• Other branches (no Jump, Call, or Rti/Rts instructions)
• Any stack manipulations (no Push or Pop instructions or writes to
the PC stack)
• Any loops or other breaks in sequential operation (no Do/Until or
Idle instructions)
The Do/Until instruction uses the sequencer’s loop and condition features,
which appear in Figure 3-2 on page 3-4. These features provide efficient
software loops, without the overhead of additional instructions to branch,
test a condition, or decrement a counter. The following code example
shows a Do/Until loop that contains three instructions and iterates 30
times.
CNTR=30; Do the_end Until CE; {loop iterates 30 times}
AX0=DM(I0+=M0), AY0=PM(I4+=M4);
AR=AX0-AY0;
the_end: DM(I1+=M0)=AR; {last instruction in loop}
Table 3-9 and Table 3-10 show the pipeline states for loop iteration and
termination.
Cycles LA PA FA AD ID PC
Note that e is the loop end instruction, and b is the loop begin instruction.
1. Termination condition tests false.
2. Loop start address is top of loop-begin stack.
3. For loops of less than six instructions (shorter than the pipeline), the pipeline retains the instructions
in the loop (e through b+4). On the first iteration of such a short loop, there is a branch penalty of
four Nops while the pipeline sets up for the short loop.
Cycles LA PA FA AD ID PC
Cycles LA PA FA AD ID PC
Note that n is the single-cycle instruction, and v is the interrupt vector instruction.
1. Interrupt occurs.
2. Interrupt recognized.
3. n+1 pushed on PC stack; ASTAT/MSTAT pushed onto status stack; n+1 suppressed.
4. Interrupt vector output.
Cycles LA PA FA AD ID PC
Note that n is the single-cycle instruction, and v is the interrupt vector instruction.
1. Interrupt occurs.
2. Interrupt recognized, but not processed; PM data access.
3. Interrupt processed.
4. n+1 pushed on PC stack; ASTAT/MSTAT pushed onto status stack; n+1 suppressed.
5. Interrupt vector output.
Cycles LA PA FA AD ID PC
Note that n is the delayed branch instruction, j is the instruction at the branch address, and v is the
interrupt vector instruction.
1. Interrupt occurs.
2. Interrupt recognized, but not processed.
3. Interrupt processed.
4. ASTAT/MSTAT pushed onto status stack; n+3 suppressed.
5. j pushed on PC stack; j+1 suppressed.
6. Interrupt vector output.
For most interrupts, internal and external, only one instruction is exe-
cuted after the interrupt occurs (and before the two instructions are
aborted) while the processor fetches and decodes the first instruction of
the service routine. For more information on interrupt latency, see
“ADSP-2192 Interrupts” on page E-1.
If nesting is enabled and a higher priority interrupt occurs immediately
after a lower priority interrupt, the service routine of the higher priority
interrupt is delayed by at least three additional cycles. For more informa-
tion, see “Nesting Interrupts” on page 3-32.
Certain DSP operations that span more than one cycle hold off interrupt
processing. If an interrupt occurs during one of these operations, the DSP
latches the interrupt, but delays processing the interrupt. The operations
that delay interrupt processing are as follows:
• A branch (Jump or Call/return) instruction and the following cycle,
whether it is an instruction (in a delayed branch) or a Nop (in a
non-delayed branch)
• The first of the two cycles used to perform a program memory data
access and an instruction fetch
• The set up cycles for loops shorter than the instruction pipeline (<5
instructions).
• Any waitstates for external memory accesses
• Any external memory access that is required when the DSP does not
have control of the external bus or during a host bus grant
Sensing Interrupts
The DSP supports two types of interrupt sensitivity—the signal shape that
triggers the interrupt. On interrupt pins, either the input signal’s edge or
level can trigger an external interrupt. For more information on interrupt
sensitivity and timing, see “ADSP-2192 Interrupts” on page E-1.
Masking Interrupts
The sequencer supports interrupt masking—latching an interrupt, but not
responding to it. Except for the emulator (EMU), reset (RESET), and power-
down interrupts, all interrupts are maskable. If a masked interrupt is
latched, the DSP responds to the latched interrupt if it is later unmasked.
Interrupts can be masked globally or selectively. Bits in the ICNTL and
IMASK registers control interrupt masking. Table A-11 on page A-20 lists
the bits in ICNTL, and Table A-10 on page A-19 lists the bits in IMASK.
These bits control interrupt masking as follows:
• Global interrupt enable. ICNTL, Bit 5 (GIE) directs the DSP to
enable (if 1) or disable (if 0) all interrupts
• Interrupt mask. IMASK, Bits 15-0 direct the DSP to enable (if 1) or
disable/mask (if 0) the corresponding interrupt
Except for the non-maskable interrupts and boot interrupts, all interrupts
are masked at reset. For booting, the DSP automatically unmasks and uses
the selected peripheral as the source for boot data.
Latching Interrupts
When the DSP recognizes an interrupt, the DSP’s interrupt latch (IRPTL)
register latches the interrupts and sets a bit to record that the interrupt
occurred. The bits in this register indicate all interrupts that are currently
pending or are being serviced. Because these registers are readable and
writable, any interrupt can be set or cleared in software.
When responding to an interrupt, the sequencer clears the corresponding
bit in IRPTL. During execution of the interrupt’s service routine, the DSP
can latch the same interrupt again while the service routine is executing.
The interrupt latch bits in IRPTL correspond to interrupt mask bits in the
IMASK register. In both registers, the interrupt bits are arranged in order of
priority. The interrupt priority is from 0 (highest) to 15 (lowest). Inter-
rupt priority determines which interrupt is serviced first when more than
one occurs in the same cycle. Priority also determines which interrupts are
nested when the DSP has interrupt nesting enabled. For more informa-
tion, see “Nesting Interrupts” on page 3-32.
Depending on the assignment of interrupts to peripherals, one event can
cause multiple interrupts, and multiple events can trigger the same inter-
rupt. For more information, see “ADSP-2192 Interrupts” on page E-1.
Nesting Interrupts
The sequencer supports interrupt nesting—responding to another inter-
rupt while a previous interrupt is being serviced. Bits in the ICNTL, IMASK,
and IRPTL registers control interrupt nesting. Table A-11 on page A-20
lists the bits in ICNTL, Table A-10 on page A-19 lists the bits in IMASK and
IRPTL. These bits control interrupt nesting as follows:
Interrupting Idle
The sequencer supports placing the DSP in Idle—until an interrupt
occurs. When executing an Idle instruction, the sequencer fetches one
more instruction at the current fetch address and then suspends operation.
The DSP’s I/O processor is not affected by the Idle instruction. DMA
transfers to or from internal memory continue uninterrupted.
The processor’s on-chip peripherals continue to run during Idle. When
an interrupt occurs, the processor responds normally. After two cycles
used to fetch and decode the first instruction of the interrupt service rou-
tine, the processor resumes execution with the service routine.
2 4 B ITS 2 4 B ITS
PC D O /U N TIL LO O P-E N D -A D D R E S S
(IM P LIC IT P U S H )
IN TE R R U P T R E TU R N
(IM P LIC IT P U S H ) (IM P LIC IT P O P ) DO PO P
U N TIL LO O P
(IM P LIC IT (EX P LIC IT
PU S H P C PO P PC PU SH PO P
PU S H ) P O P)
OR OR
LO O P LO O P OR
LO O P LO O P PU S H
(EX P LIC IT (EX P LIC IT (EX P LIC IT (EX P LIC IT
PUSH) PO P ) PUSH) P O P) LO O P
(EX P LIC IT
PUSH)
P C S TA C K LO O P B E G IN S TA C K LO O P E N D S TA C K C O U N TE R S TA C K
(3 3 E N TR IE S) (8 E N TR IE S) (8 E N TR IE S) (8 E N TR IE S)
9 B ITS 7 B ITS
A S TA T M S TA T
TH E D S P U S E S TH E S E S TA C K S F O R :
• D O /U N TIL LO O P S
IN TE R R U P T RE TU R N
(IM P LIC IT P U S H ) (IM P LIC IT P O P )
• C A LL/R E TU R N IN S TR U C TIO N S
OR OR
• IN TE R R U P T S E R V IC E R O U N TIN E S
PU S H S TS P O P S TS
(EX P LIC IT P U S H ) (EX P LIC IT P O P )
S TA TU S S TA C K
(1 6 E N TR IE S)
Table A-7 on page A-14 lists the bits in the SSTAT register. The SSTAT bits
that indicate stack status are:
• PC stack empty. Bit 0 (PCSTKEMPTY) indicates that the PC stack con-
tains at least one pushed address (if 0) or PC stack is empty (if 1).
• PC stack full. Bit 1 (PCSTKFULL) indicates that the PC stack contains
at least one empty location (if 0) or PC stack is full (if 1).
• PC stack level. Bit 2 (PCSTKLVL) indicates that the PC stack contains
between 3 and 28 pushed addresses (if 0) or PC stack is at or above
the high-water mark—28 pushed addresses, or it is at or below the
low-water mark—3 pushed addresses (if 1).
• Loop stack empty. Bit 4 (LPSTKEMPTY) indicates that the Loop stack
contains at least one pushed address (if 0) or Loop stack is empty
(if 1).
• Loop stack full. Bit 5 (LPSTKFULL) indicates that the Loop stack con-
tains at least one empty location (if 0) or Loop stack is full (if 1).
• Status stack empty. Bit 6 (STSSTKEMPTY) indicates that the Status
stack contains at least one pushed status (if 0) or Status stack is
empty (if 1).
• Stacks overflowed. Bit 7 (STKOVERFLOW) indicates that an Over-
flow/underflow has not occurred (if 0) or indicates that at least one
of the stacks (PC, loop, counter, status) has overflowed, or the PC
or status stack has underflowed (if 1). Note that STKOVERFLOW is only
cleared on reset. Loop stack underflow is not detected because it
occurs only as a result of a Pop Loop operation.
Stack status conditions can cause a STACK interrupt. The stack interrupt
always is generated by a stack overflow condition, but also can be gener-
ated by OR’ing together the stack overflow status (STKOVERFLOW) bit and
stack high/low level status (PCSTKLVL) bit. The level bit is set when:
• The PC stack is pushed and the resulting level is at or above the high
water-mark.
• The PC stack is popped and the resulting level is at or below the low
water-mark.
This spill-fill mode (using the stacks’ status to generate a stack interrupt)
is disabled on reset. Bits in the ICNTL register control whether the DSP
generates this interrupt based on stack status. Table A-11 on page A-20
lists the bits in the ICNTL register. The bits in ICNTL that enable the STACK
interrupt are:
• Global interrupt enable. Bit 5 (GIE) globally disables (if 0) or
enables (if 1) unmasked interrupts
• PC stack interrupt enable. Bit 10 (PCSTKE) directs the DSP to dis-
able (if 0) or enable (if 1) spill-fill mode—OR’ing of stack status—
to generate the STACK interrupt.
As shown in Figure 3-4, the source for the pushed values and destination
for the pop value differs depending on whether the stack operations is
implicit or explicit.
In implicit stack operations, the DSP places values on the stacks from reg-
isters (PC, CNTR, ASTAT, MSTAT) and from calculated addresses (end-of-loop,
PC+1). For example a Call/return instruction directs the DSP to branch
execution to the called subroutine and push the return address (PC+1) onto
the PC stack. The matching return from subroutine instruction (Rts)
causes the DSP to pop the return address off of the PC stack and branch
execution to the address following the Call.
A second instruction that makes the DSP perform implicit stack opera-
tions is the Do/Until instruction. It takes the following steps to set up a
Do/Until loop:
Conditional Sequencing
The sequencer supports conditional execution with conditional logic that
appears in Figure 3-4 on page 3-35. This logic evaluates conditions for
conditional (If) instructions and loop (Do/Until) terminations. The con-
ditions are based on information from the arithmetic status registers
(ASTAT), the condition code register (CCODE), the flag inputs, and the loop
counter. For more information on arithmetic status, see “Using Computa-
tional Status” on page 2-16.
Each condition that the DSP evaluates has an assembler mnemonic. The
condition mnemonics for conditional instructions appear in Table 3-14.
For most conditions, the sequencer can test both true and false states. For
example, the sequencer can evaluate ALU equal-to-zero (EQ) and ALU
not-equal-to-zero (NE).
To test conditions that do not appear in Table 3-14, a program can use
the Test Bit (Tstbit) instruction to test bit values loaded from status reg-
isters. For more information, see the ADSP-219x DSP Instruction Set
Reference.
The two conditions that do not have complements are CE/Not CE (loop
counter expired/not expired) and True/Forever. The context of these con-
dition codes determines their interpretation. Programs should use True
and Not CE in conditional (If) instructions. Programs should use Forever
and CE to specify loop (Do/Until) termination. A Do Forever instruction
executes a loop indefinitely, until an interrupt, jump, or reset intervenes.
There are some restrictions on how programs may use conditions in
Do/Until loops. For more information, see “Restrictions On Ending
Loops” on page 3-24.
Overview
The DSP’s Data Address Generators (DAGs) generate addresses for data
moves to and from Data Memory (DM) and Program Memory (PM). By
generating addresses, the DAGs let programs refer to addresses indirectly,
using a DAG register instead of an absolute address. The DAG architec-
ture, which appears in Figure 4-1, supports several functions that
minimize overhead in data access routines. These functions include:
• Supply address and post-modify—provides an address during a
data move and auto-increments the stored address for the next
move.
• Supply pre-modified address—provides a modified address during
a data move without incrementing the stored address.
• Modify address—increments the stored address without perform-
ing a data move.
• Bit-reverse address—provides a bit-reversed address during a data
move without reversing the stored address.
As shown in Figure 4-1, each DAG has five types of registers. These regis-
ters hold the values that the DAG uses for generating addresses. The types
of registers are:
• Index registers (I0-I3 for DAG1 and I4-I7 for DAG2). An index
register holds an address and acts as a pointer to memory. For exam-
ple, the DAG interprets DM(I0) and PM(I4) syntax in an instruction
as addresses.
• Modify registers (M0-M3 for DAG1 and M4-M7 for DAG2). A
modify register provides the increment or step size by which an
index register is pre- or post-modified during a register move. For
example, the dm(I0+=M1) instruction directs the DAG to output the
address in register I0 then modify the contents of I0 using the M1
register.
• Length and Base registers (L0-L3 and B0-B3 for DAG1 and L4-L7
and B4-B7 for DAG2). Length and base registers setup the range of
addresses and the starting address for a circular buffer. For more
information on circular buffers, see “Addressing Circular Buffers”
on page 4-11.
• DAG Memory Page registers (DMPG1 for DAG1 and DMPG2
for DAG2). Page registers set the upper eight bits address for DAG
memory accesses; the 16-bit Index and Base registers hold the lower
16 bits. For more information on about DAG page registers and
addresses from the DAGs, see “DAG Page Registers (DMPGx)” on
page 4-6.
D M O R P M D A TA B U S
IM M E D IA TE
16 VA LU E FR O M 16 16 16
IN S TR U C TIO N
I M L B
R E G IS TE RS RE G IS TE RS RE G IS TE RS R E G IS TE RS
4 X 16 4 X 16 4 X 16 4 X 16
16
P O S T-M O D IFY
M UX A D D R E S S IN G M O D U LU S
LO G IC
16 A DD
PR E -M O D IFY
M UX A D D R E S S IN G
16 U P D A TE
16
D A G P A G E (D M P G 1 O R D M P G 2 ) P R O V ID E S U P P E R 8 B ITS O F A D D R E S S
(O P TIO N A L B IT-R E V E R S E D O E S N O T A P P LY TO P A G E )
M S TA T
24 24
P M A D D R E S S BU S (E ITH E R D A G 1 O R D A G 2 )
D M A D D R E S S B U S (E ITH E R D A G 1 O R D A G 2 )
! The secondary register sets for the DAGs are described in this sec-
tion. For more information on secondary data and results registers,
see “Secondary (Alternate) Data Registers” on page 2-59.
M S TA T S E LE C T B IT D A G 1 R E G IS TE R S
I0 M0 L0 B0
I1 M1 L1 B1
SEC_DA G
I2 M2 L2 B2
I3 M3 L3 B3
D A G 2 R E G IS TE R S
I4 M4 L4 B4
I5 M5 L5 B5
I6 M6 L6 B6
I7 M7 L7 B7
System power-up and reset enable the primary set of DAG address regis-
ters. To enable or disable the secondary address registers, programs set or
clear the SEC_DAG bit in MSTAT. The instruction set provides three methods
for swapping the active set. Each method incurs a latency, which is the
delay between the time the instruction affecting the change executes until
the time the change takes effect and is available to other instructions.
Table A-3 on page A-5 shows the latencies associated with each method.
When switching between primary and secondary DAG registers, the pro-
gram needs to account for the latency associated with the method used.
For example, after the MSTAT = data12; instruction, a minimum of three
cycles of latency occur before the mode change takes effect. So for this
method, the program must issue at least three instructions after
MSTAT = 0x20; before attempting to use the other set of DAG registers.
The Ena/Dis mode instructions are more efficient for enabling and dis-
abling DSP modes because these instructions incur no cycles of effect
latency. For example:
CCODE = 0x9; Nop;
If SWCOND Jump do_data;/* Jump to do_data */
do_data:
Ena SEC_REG; /* Switch to 2nd Dregs */
Ena SEC_DAG; /* Switch to 2nd DAGs */
AX0 = DM(buffer); /* if buffer empty, go */
AR = Pass AX0; /* right to fill and */
If EQ Jump fill; /* get new data */
Rti;
fill: /* fill routine */
Nop;
buffer: /* buffer data */
Nop;
The DAGs provide the sixteen LSBs of the 24-bit address, specifying the
exact location of the data on the page.
• The DMPG1 page register is associated with DAG1 (registers I0—I3)
indirect memory accesses and immediate addressing.
• The DMPG2 page register is associated with DAG2 (registers I4—I7)
indirect memory accesses.
At power up, the DSP initializes both page registers to 0x0. Initializing
page registers is only necessary when the data is located on a page other
than the current page. Programs should set the corresponding page regis-
ter when initializing a DAG index register to set up a data buffer.
For example,
DMPG1 = 0x12; /* set page register */
/* or the syntax: DMPG1 = page(data_buffer);
for relative addressing */
I2 = 0x3456; /* init data buffer; 24b addr=0x123456 */
L2 = 0; /* define linear buffer */
M2 = 1; /* increment address by one */
/* two stall cycles inserted here */
DM(I2 += M2) = AX0; /* write data to buffer and update I2 */
Typically, programs load both page registers with the same page value
(0-255), but programs can increase memory flexibility by loading each
with a different page value. For example, by loading the page registers
with different page values, programs could perform high-speed data trans-
fers between pages.
DAG Operations
The DSP’s DAGs perform several types of operations to generate data
addresses. As shown in Figure 4-1 on page 4-3, the DAG registers and the
MSTAT register control DAG operations. The following sections provide
details on DAG operations:
• “Addressing with DAGs” on page 4-9
• “Addressing Circular Buffers” on page 4-11
• “Modifying DAG Registers” on page 4-19
An important item to note from Figure 4-1 is that each DAG automati-
cally uses its DAG memory page (DMPGx) register to include the page
number as part of the output address. By including the page, DAGs can
generate addresses for the DSP’s entire memory map. For details on these
address adjustments, see “DAG Page Registers (DMPGx)” on page 4-6.
P R E -M O D IF Y P O S T-M O D IF Y
N O I R E G IS TE R U P D A TE I R E G IS TE R U P D A TE
S Y N TA X : P M (Ix + M x ) S Y N TA X : P M (Ix + = M x )
D M (Ix + M x ) D M (Ix + = M x )
2 . U P D A TE
I 1. O UTPUT I
+ +
M M
O U TP U T I+ M I+ M
Modify (M) registers can work with any index (I) register in the same
DAG (DAG1 or DAG2). For a list of I and M registers and their DAGs,
see Figure 4-2 on page 4-5.
The starting address that the DAG wraps around is called the buffer’s base
address (B register). There are no restrictions on the value of the base
address for a circular buffer.
" Do not place the index pointer for a circular buffer such that it
crosses a memory page boundary during post-modify addressing. All
memory locations in a circular buffer must reside on the same mem-
ory page. For more information on the DSP’s memory map, see
“Memory” on page 5-1.
As shown in Figure 4-4, programs use the following steps to set up a circu-
lar buffer:
1. Load the memory page address into the selected DAG’s DMPGx reg-
ister. This operation is needed only once per page change in a
program.
2. Load the starting address within the buffer into an I register in the
selected DAG.
3. Load the modify value (step size) into an M register in the corre-
sponding DAG as the I register. For corresponding registers list, see
Figure 4-2 on page 4-5.
4. Load the buffer’s length into the L register that corresponds to the
I register. For example, L0 corresponds to I0.
5. Load the buffer’s base address into the B register that corresponds
to the I register. For example, B0 corresponds to I0.
After this setup, the DAGs use the modulus logic in Figure 4-1 on page
4-3 to process circular buffer addressing.
0 1 0 0 0
1 1 4 1 1
2 2 2 7 2
3 3 3 3 10
4 2 4 4 4
5 5 5 5 5
6 6 6 8 6
7 7 7 7 11
8 3 8 8 8
9 9 6 9 9
10 10 10 9 10
TH E C O LU M N S A B O V E S H O W TH E S E Q UE N C E IN O R D E R O F LO C A TIO N S A C C E S S E D IN O N E P A S S.
N O TE TH A T "0 " A B O V E IS A D D R E S S D M (0X 1 0 0 0 ). TH E S E Q U E N C E R E P E A TS O N S U B S E Q U E N T P A S S E S.
On the first post-modify access to the buffer, the DAG outputs the I regis-
ter value on the address bus then modifies the address by adding the
modify value. If the updated index value is within the buffer length, the
DAG writes the value to the I register. If the updated value is outside the
buffer length, the DAG subtracts (positive) or adds (negative) the L regis-
ter value before writing the updated index value to the I register.
In equation form, these post-modify and wrap around operations work as
follows:
• If M is positive:
Inew = Iold + M if Iold + M < Buffer base + length (end of buffer)
• If M is negative:
Inew = Iold + M if Iold + M ≥ Buffer base (start of buffer)
The DAGs use all types of DAG registers for addressing circular buffers.
These registers operate as follows for circular buffering:
• The index (I) register contains the value that the DAG outputs on
the address bus.
• The modify (M) register contains the post-modify amount (positive
or negative) that the DAG adds to the I register at the end of each
memory access. The M register can be any M register in the same
DAG as the I register. The modify value also can be an immediate
value instead of an M register. The size of the modify value, whether
from an M register or immediate, must be less than the length (L
register) of the circular buffer.
• The length (L) register sets the size of the circular buffer and the
address range that the DAG circulates the I register through. L is
positive and cannot have a value greater than 216 – 1. If an L regis-
ter’s value is zero, its circular buffer operation is disabled.
• The base (B) register, or the B register plus the L register, is the value
that the DAG compares the modified I value with after each access.
Bit reversal operates on the binary number that represents the position of
a sample within an array of samples. Using 3-bit addresses, Table 4-1
shows the position of each sample within an array before and after the
bit-reverse operation. Sample 0x4 occupies position b#100 in sequential
order and position b#001 in bit-reversed order. Bit reversing transposes the
bits of a binary number about its midpoint, so b#001 becomes b#100,
b#011 becomes b#110, and so on. Some numbers, like b#000, b#111, and
b#101, remain unchanged and retain their original position within the
array.
Table 4-1. 8-point array sequence before and after bit reversal
In full 16-bit reversed addressing, bits 7 and 8 of the 16-bit address are the
pivot points for the reversal:
Normal 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Bit-reversed 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
The Fast Fourier Transform (FFT) algorithm is a special case for bit-rever-
sal. FFT operations often need only a few address bits reversed. For
example, a a 16-point sequence requires four reversed bits, and a 1024-bit
sequence requires ten reversed bits. Programs can bit-reverse address val-
ues less than 16-bits—which reverses a specified number of LSBs only.
Bit-reversing less than the full 16-bit index register value requires that the
program adds the correct modify value to the index pointer after each
memory access to generate the correct bit-reversed addresses.
To set up bit-reversed addressing for address values < 16 bits, determine:
1. The number of bits to reverse (N)—permits calculating the modify
value
2. The starting address of the linear data buffer—this address must
be zero or an integer multiple of the number of bits to reverse
(starting address = 0, N, 2N, …)
3. The first bit-reversed address that the DAG outputs—the buffer’s
starting address with the N LSBs bit-reversed
4. The initialization value for the index register—the bit-reversed
value of the first bit-reversed address the DAG outputs
5. The modify register value for updating (correcting) the index
pointer after each memory access—calculated from the formula:
Mreg = 2(16-N).
0x0020 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0
0x0004 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0
0x0004 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0
0x2000 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0
Instruction
Overview
Each DSP core in the ADSP-2192 contains large internal memory. This
chapter describes the DSP’s memory and how to use it. The two DSP
cores also have shared memory and memory-mapped registers. For infor-
mation on using the shared memory, see “Dual DSP Cores” on page 6-1.
There are 140K words of internal memory on the ADSP-2192. Within
this space, the P0 DSP core has 80K words of SRAM and 4K words of
ROM, and the P1 DSP core has 48K words of SRAM and 4K words of
ROM. The P0 and P1 DSP cores also have 4K words of shared memory
space. The memory is divided into 16K word blocks for access. For more
information on these blocks, see “ADSP-2192 Memory Map” on
page 5-8.
Most microprocessors use a single address and data bus for memory access.
This type of memory architecture is called Von Neumann architecture.
But, DSPs require greater data throughput than Von Neumann architec-
ture provides, so many DSPs use memory architectures that have separate
buses for program and data transfer. The two buses let the DSP get a data
word and an instruction simultaneously. This type of memory architecture
is called Harvard architecture.
ADSP-219x family DSPs go a step farther by using a modified Harvard
architecture. This architecture has program and data buses, but provides a
single, unified address space for program and data storage. While the Data
Memory (DM) bus only carries data, the Program Memory (PM) bus han-
dles instructions or data, allowing dual-data accesses.
DSP core and I/O processor share accesses to internal memory. Each
block of memory can be accessed by the DSP core or I/O processor in
every cycle, but the DSP is held off if contending with the I/O processor
core for accesses to the same block.
A memory access conflict can occur when the DSP core attempts two
accesses to the same internal memory block in the same cycle. When this
conflict happens, an extra cycle is incurred. The DM bus access completes
first and the PM bus access completes in the following (extra) cycle.
During a single-cycle, dual-data access, the DSP core uses the independent
PM and DM buses to simultaneously access data from two separate mem-
ory blocks. Though dual-data accesses provide maximum data
throughput, it is important to note some limitations on how programs
may use them. The limitations on single-cycle, dual-data accesses are:
• The two pieces of data must come from different memory blocks.
If the core tries to access two words from the same memory block
for a single instruction, an extra cycle is needed. For more informa-
tion on how the buses access these blocks, see “Internal Data Bus
Exchange” on page 5-5.
• The PM data access execution may not conflict with an instruction
fetch operation.
If the cache contains the conflicting instruction, the data access
completes in a single-cycle and the sequencer uses the cached
instruction. If the conflicting instruction is not in the cache, an
extra cycle is needed to complete the data access and cache the con-
flicting instruction. For more information, see “Instruction Cache”
on page 3-9.
Efficient memory usage relies on how the program and data are arranged
in memory and how the program accesses the data. For more information,
see “Arranging Data in Memory” on page 5-13.
As shown in Figure 5-1, the DSP has three internal buses connected to its
internal memory, the Program Memory (PM) bus, Data Memory (DM)
bus, and I/O Processor (IO) bus. The PM bus, DM bus, and IO bus share
two memory ports; one for each block. Memory accesses from the DSP’s
core (computational units, data address generators, or program sequencer)
use the PM or DM buses, while the I/O processor uses the IO bus for
memory accesses. Using the IO bus and cycle-stealing DMA, the I/O pro-
cessor can provide data transfers between internal memory and the DSP’s
communication ports (host PCI/USB port or AC’97 port) without hin-
dering the DSP core’s access to memory (except for stealing a cycle).
There are some bus arbitration issues involved in memory accesses. A DSP
core’s PM and DM buses can try to access the same block of memory in
the same cycle. Also, the DSP cores’ DM buses can try to access shared
memory space in the same cycle. The ADSP-2192 has an arbitration sys-
tem to handle this conflicting access. Arbitration for accesses to a DSP
core’s internal memory is fixed at the following priority: (highest priority)
I/O processor accesses over the DMA bus, core accesses over the DM bus,
and core accesses over the PM bus (lowest priority). Also, I/O processor
accesses may not be sequential, so the DSP core’s buses are never held off
for more than one cycle. Arbitration for accesses to shared memory is fixed
with the highest priority for DSP P0 and the lowest priority for DSP P1.
P0 DSP CORE
INTERNAL MEMORY*
ANY TWO PATHS SIMULTANEOUSLY
PAGE 1, BLOCK 0
(0X10000 - 0X13FFF, 24 BIT) ADDRESSES AND DATA FOLLOW PARALLEL PATHS
PAGE 0, BLOCK 3
(0XC000 - 0XFFFF, 16 BIT)
PAGE 0, BLOCK 2
(0X8000 - 0XBFFF, 16 BIT)
SHARED MEMORY
ARBITRATION
24 24 16 24
PM ADDRESS
BUS
PM DATA
BUS 8
24 16
PX REGISTER
DM ADDRESS
BUS
DM DATA
BUS
DMA DMA DMA DMA
ADDRESS DATA I/O REGISTERS DATA ADDRESS
ARBITRATION
DSP P0 DSP P1
DMA CONTROLLER DMA CONTROLLER
IO ADDR IO DATA
I/O REGISTERS
*NOTE: EACH MEMORY BLOCK HAS A SEPARATE CONNECTION TO THE PM AND DM BUSES.
Because the DSP’s blocks of internal memory have different widths, plac-
ing 16-bit data in a Program Memory block leaves some space unused. For
more information on how the DSP works with memory words, see “P0
DSP Core Internal Memory Space” on page 5-10.
The PM data bus is 24 bits wide, and the DM data bus is 16 bits wide.
Both data buses can handle data words (16-bit), but only the PM data bus
carries instruction words (24-bit).
23 0
PM Data Bus (24-bit)
PX Register
15 0
DM Data Bus (16-bit)
! When reading data from program memory and data memory simul-
taneously, there is a dedicated path from the upper 16 bits of the
PM data bus to the Y registers of the computational units. This
read-only path does not use the bus exchange circuit.
For transferring data from the PM data bus, the PX register is:
1. Loaded automatically whenever data (not an instruction) is read
from program memory to any register. For example:
AX0 = PM(I4,M4);
In this example, the 16 bits of AX0 are stored into the upper 16 bits
of a 24-bit program memory word. The 8 bits of PX are automati-
cally stored to the 8 lower bits of the memory word.
For transferring data from the DM data bus, the PX register may be:
1. Loaded with a data move instruction, explicitly specifying the PX
register as the destination. The lower 8 bits of the data value are
used and the upper 8 are discarded.
PX = AX0;
Whenever any register is written out to program memory, the source regis-
ter supplies the upper 16 bits. The contents of the PX register are added as
the lower 8 bits for instructions (such as the Type-1 and Type-32) that use
the PX register, but the PX register is not used for other instructions (such
as the Type-4, Type-12, and Type-29). If these lower 8 bits of data to be
transferred to program memory (through the PM data bus) are important,
and any instructions will be using the PX register, you should load the PX
register from DM data bus before the program memory write operation.
DSP P0 DSP P1
MEM ORY M AP MEM ORY M AP
ADDRE S S ADDRE S S
P AG E 2
0x02 0F FF
P AG E 2
S HARE D RAM S HARE D RAM 0x02 0FF F
S AM E
(16x 4K) 0x02 0000 (16x 4K) 0x02 0000
0x01 FF FF 0x01 FF FF
RE S E RV E D RE S E RV E D
P AG E 1
24x 4K 0x01 4000 24x 4K 0x01 4000
0x00 FF FF 0x00 FF FF
DATA RAM
BLO C K3
(16x 16K ) 0x00 C000
SH A R E D
RE S E RV E D
0x00 BFF F D S P I/O
DATA RAM
BLO C K2 M APPED
(16x 16K ) ADDRE S S
R E G IS TE R S
P AG E 0
0x00 8000
P AG E 0
0x00 8000
0x00 7F FF 0xFF FF
0x00 7FF F
DATA RAM DATA RAM
BLO C K1 BLO C K1
(16x 16K ) 0x00 4000 (16x 16K ) 0x00 4000
P AG E S 0-255
0x00 3F FF (16x 256 ) 0x00 3FF F
DATA RAM DAT A RAM
BLO C K0 BLO C K0
(16x 16K ) 0x00 0000 0x00 00 (16x 16K ) 0x00 0000
! ToADSP-2192
execute programs and use data in internal memory, the
operates very similarly to previous ADSP-218x DSPs.
For most internal memory operations, paging is not required, and
the page registers remain at their reset values (Page 0).
The DSP’s memory architecture permits either bus to access either inter-
nal memory block and also permits dual accesses—a single cycle operation
where each bus accesses a block of memory. To arbitrate simultaneous
access, the memory interface:
• Processes a memory read before memory write
• Processes a DM bus access before a PM bus access
! Also on-chip, the DSP has an internal boot kernel ROM in the
upper part of Page 1. Programs should treat this area as reserved and
should not access this area at runtime.
Shared Memory
The ADSP-2192’s shared memory space contains one 4K word block of
memory. Because this memory is outside of each DSP core and because
access is arbitrated between the two cores, access to shared memory has
core stall and latency issues. Some points on these issues include:
• Every access to shared memory incurs at least one cycle of stall (to
perform synchronization), therefore minimum latency is 2 cycles.
• Arbitrated access leads to stalls for the loser of the arbitration.
• When accessing shared memory, a DSP locks out the other DSP for
several cycles. A DSP can completely lock out the other DSP from
shared memory by performing back to back or nearly back to back
cycles to shared memory.
• Once a particular DSP “owns” the shared memory, it takes two
cycles of inactivity to shared memory from that DSP to relinquish
the interface.
If, for example, both DSP's are accessing the shared memory with the fol-
lowing code loop:
ar = dm(shared_memory);
nop;
nop;
/* REPEAT */
Instruction
Reg = Reg;
Reg3 = <Data12>;
IO(<Addr10>) = Dreg;
Dreg = IO (<Addr10>);
REG(<Addr8>) = Dreg;
Dreg = REG(<Addr8>);
Overview
The ADSP-2192 contains two ADSP-219x DSP cores. The two cores are
independent, but the ADSP-2192’s architecture provides a number of
interactive DSP core features. These features include shared memory,
shared I/O mapped registers, inter-core flags and interrupts, and mailbox
registers. For information on shared memory, see “Memory” on page 5-1.
Although code execution is independent on the two cores, some
ADSP-2192 settings must apply for both cores. These settings include
clock and reset modes, some power down features, and general-purpose
I/O settings.
The I/O registers are grouped by related function onto pages to minimize
the need for frequent changes of the IOPG register. To access I/O registers,
programs use the following instructions:
IO(eight_bit_address) = Dreg; {write access}
Dreg = IO(eight_bit_address); {read access}
A Dreg is one of the 16 data registers within the DSP computation unit.
I/O accesses take one or more cycles within the ADSP-2192. The addi-
tional cycles often occur because the access must cross a clock boundary
within the part to reach these registers. Additional cycles may also occur
due to latencies for getting ownership of the internal register access bus.
These additional cycles are transparent to the program.
Because each DSP core may access I/O registers simultaneously, these
accesses are arbitrated. Also, the PCI interface and the USB interface can
access the I/O registers using the same bus as the DSP cores. The prioriti-
zation for I/O register access among these possible masters is fixed. The
priorities from highest to lowest are: DSP core P0, DSP core P1, PCI
interface, and USB interface.
A Dreg is one of the 16 data registers within the DSP computation unit.
There are two sets of system control registers on the ADSP-2192, one for
each core. For a list of system registers, see “ADSP-219x DSP Core Regis-
ters” on page A-1.
System Control
The following bits in SYSCON control PCI bus, I/O voltage, and reset
modes for the ADSP-2192. Table B-4 on page B-14 lists all the bits in
SYSCON. These modes affect operations for both DSP cores:
• PCI Reset. SYSCON Bit 15 (PCIRST) This bit indicates the RST pin is
asserted (if =0) or is not asserted (if =1).
• Vaux Present. SYSCON Bit 14 (VAUX) This bit indicates the VAUX sup-
ply is not powered (if =0) or is powered (if =1). (read only)
• PCI 5V level. SYSCON Bit 13 (PCI_5V) This bit indicates the PCI,
ISA, and Card Bus interface supply (PCIVDD pins) is powered from
nominal 3.3V (if =0) or is powered from nominal 5V (if =1). (read
only)
• Bus Mode. SYSCON Bits 11–10 (BUS1–0) These bits indicate the state
of the BUSMODE1–0 pins when sampled at power-on reset as: 00=PCI,
01=CardBus, 10=USB, or 11= Sub-ISA. (read only)
• Chip Reset Source. SYSCON Bits 9–8 (CRST1–0) These bits indicate
the source of the last chip reset as: 00=power-on reset; 01=reserved;
10=PCI, ISA, CardBus, or USB bus interface hard reset; or 11=Soft
Reset from the RST bit in SYSCON. A fifth possible reset source—
PWRPx Soft Reset—is indicated by a PWRPx register’s RD=1. Each
DSP must check its PWRPx register’s RD bit and clear it to zero upon
reset. (read only)
• Reset Disable. SYSCON Bit 2 (RDIS) If Bit 2 = 0 (if=0), a host bus reset
of the DSPs, AC’97 codec, and the host interface is enabled. If
Bit 2 = 1 (if=1), a host bus reset of the ADSP-2192 is disabled—
except for the bus interface itself. (If RDIS is set, the DSP can detect
that the bus is in reset by the PCIRST bit in the SYSCON register.)
Un-masked, a bus reset affects the DSPs, the GPIOs, the AC’97,
and the PCI/USB interface. Un-masked, a bus reset does not affect
the Mailboxes.
! The DSP memory pipeline (last 2 writes per bank) is lost upon reset.
If desired, it may be flushed by three writes in a row to the same
location.
• Soft Chip Reset. SYSCON Bit 0 (RST) When set (=1), this bit performs
a soft reset of the ADSP-2192. Clearing RST (=0) has effect—always
reads 0.
Soft reset affects the DSPs and the GPIOs. Soft reset does not affect
the PCI, USB, Mailboxes, AC’97, or serial EPROM.
! The DSP memory pipeline (last 2 writes per bank) is lost upon reset.
If desired, it may be flushed by three writes in a row to the same
location.
on-chip control registers when the part is powered down. If the chip
and the XTAL oscillator are powered off, attempting to write I/O reg-
isters—including this one—results in powering up the XTAL and set-
ting the XON bit. The write succeeds, after a delay for the oscillator
to stabilize. Subsequent writes or reads should not be attempted
until the oscillator has stabilized, about 8K clocks or 333 µs.)
• Power Management Event (Status/Clear). PWRCFGx Bit 15 (PME)
This bit indicates that a power management event has not (if = 0) or
has (if =1) been detected for this PCI configuration (Config0, 1, or
2). Setting (=1) this bit clears PME. Clearing (=0) this bit has no
effect. (This bit is an alias of the PME bit in the Power Management
Control/Status Register in PCI Configuration Space for this
function.)
• Power Management Event (Set). PWRCFGx Bit 14 (SPME) Setting (=1)
this bit sets (=1) the PME bit. Clearing this bit (=0) has no effect.
Always reads 0.
• Power Management Event Enable. PWRCFGx Bit 8 (PME_EN) This bit
clears (=0) or sets (=1) the PME_EN bit in the PMCSR register in PCI
Configuration space.
• GPIO Power Management Event Enable. PWRCFGx Bit 6 (GPME) This
bit disables (if =0) or enables (if =1) setting this configuration’s PME
bit upon a GPIO wake up event.
• AC’97 Power Management Event Enable. PWRCFGx Bit 5 (APME)
This bit disables (if =0) or enables (if =1) setting this configuration’s
PME bit upon an AC’97 interrupt/wake event.
• DSP Interrupt Enable for AC’97 Input. PWRPx Bit 9 (AIEN) This bit
disables (if =0) or enables (if =1) a DSP interrupt on AC’97 input.
When disabled (=0), AC’97 input does not signal an interrupt, and
the DSP does not set the corresponding Interrupt Pending bit on
AC’97 input. When enabled (=1), the DSP responds to an interrupt
on AC’97 input. (read/write)
• Power Management Interrupt Enable. PWRPx Bit 8 (PMIEN) This bit
disables (if =0) or enables (if =1) the DSP’s interrupt on a Power
Management State Change event.
• DSP Wake up on GPIO Input Enable. PWRPx Bit 6 (GWE) This bit
disables (if =0) or enables (if =1) the DSP to wake from power down
on GPIO input. (read/write)
• DSP Wake up on AC’97 Input Enable. PWRPx Bit 5 (AWE) This bit
disables (if =0) or enables (if =1) the DSP to wake from power down
on AC’97 input. (read/write)
• Power Management Wake up Enable. PWRPx Bit 4 (PMWE) This bit
disables (if =0) or enables (if =1) the DSP to wake up on a Power
Management State Change event. (read/write)
• DSP Interrupt on AC’97 Frame Input Enable. PWRPx Bit 3 (FIEN)
This bit disables (if =0) or enables (if =1) an AC’97 Frame interrupt.
If disabled (=0), no interrupt is signalled (read/write).
The actual interrupt occurs once per AC’97 Frame, at the second bit
of Slot 12.
• DSP Soft Reset. PWRPx Bit 2 (RSTD) This bit causes a soft reset to
this DSP core when set (=1). The bit remains set until cleared (=0)
with a write. (If the DSP core is powered down, it must be powered
up first—PWRPx register PU bit set—before resetting.
• DSP Power Up. PWRPx Bit 1 (PU) This bit causes the DSP to power
up —exit the IDLE within its power down handler—when set (=1).
Programs also can use this bit to abort a power down by setting PU
while the DSP is within its power down handler prior to the IDLE.
At this point, setting PU causes execution to immediately continue
through the IDLE without stopping clocks. On a read, PU=1 indi-
cates that this DSP is in the power down interrupt handler, whether
or not it has executed the power down IDLE.
• DSP Power Down. PWRPx Bit 0 (PD) This bit causes the DSP to
power down—enter its power down handler—when set (=1). Pro-
grams also can use this bit to abort a power up by setting PD while
the DSP is in the power down handler after executing an IDLE. At
this point, setting PD causes the DSP to immediately re-enter the
Power Down interrupt handler after it executes the RTI. On a read,
PD=1 indicates that this DSP is powered down: either (a) it is in the
power down handler and has executed an IDLE instruction), and/or
(b) the DSP Clock Generator (PLL) is not running and stable.
Whenever both DSPs are powered down, the DSP Clock Generator
is powered down and is automatically restarted when either DSP
wakes up.
! DSP memory cannot be accessed via PCI when the DSP clock gen-
erator is powered down. There is a delay after powering up the DSPs
with the PU bit. During this delay, memory reads must not be per-
formed because the XTAL or the DSP PLL is not yet running and
stable. After powering up by writing a 1 to the PU bit, the PD bit
must be polled until it becomes 0. After it becomes 0, you know the
clock generator is running and it is safe to access DSP memory
again.
( DPLLM + 1 ) × ( DPLLK + 1 )
F OUT = F IN × ---------------------------------------------------------------------------
2 × ( DPLLN + 1 )
Where: FIN = 24.576 MHz; reset values for selects are DPLLM=11,
DPLLK=0, and DPLLN=0; and FOUT = 6×FIN = 147.456 MHz.
! To(163.840
achieve the maximum possible ADSP-2192 clock rate
MHz), programs should change the DSP PLL divisor
selects to: DPLLM=9, DPLLK=3, and DPLLKN=2.
• DSP PLL Resistor Select. PLLCTL Bit 3 (DSELR) is reserved—leave at
reset value.
• DSP PLL Capacitor Select. PLLCTL Bit 2 (DSELC) is reserved—leave
at reset value.
• DSP PLL Boost. PLLCTL Bit 1 (DBOOST) is reserved—leave at reset
value.
• DSP PLL Adjust. PLLCTL Bit 0 (DADJ) This bit selects whether the
PLLCTL bits for the DSP are not (if =0) or are (if =1) applied from
PLLCTL bits 11-1. When DADJ is cleared (=0), the PLL uses reset val-
ues for the DSP PLL. These reset values also are returned on reading
the register. When DADJ is set (=1), the PLL uses the values in bits
11–1 for the DSP PLL.
The clock speed for the DSP cores may not be changed while the DSP
cores are powered. Programs should use the following procedure to change
the core clock speed through the host interface:
1. Put the DSP cores into Idle, waiting to go into power management
interrupt service routine (power management event interrupt is
enabled).
2. Power down the DSP cores using the host interface to set (=1) the
PD bit in the PWRP0 and PWRP1 registers.
3. Load the clock divisor selects into the PLLCTL register using the
host interface--for the maximum core clock rate of 163.840 MHz
(and defaults for the other settings), load 0x0B91 into PLLCTL.
4. Power up the cores by setting the PU bit in the PWRP0 and PWRP1
registers.
After the clocks stabilize, the DSP cores service the power management
event interrupt, exiting the Idle state and resuming execution after the
RTI.
4 5 Mailbox 0x10
5 6 Timer 0x14
6 7 Reserved 0x18
8 9 DSP-DSP 0x20
13 14 Reserved 0x34
14 15 Reserved 0x38
3 Output Reserved
4 Output Reserved
5 Output Reserved
6 Output Reserved
11 Input Reserved
13 Input DSPRG_STAT—DSP I/O register bus status (pending write from DSP).
14 Input
Figure 6-2 shows how the bits in the FLAGS register on one DSP core affect
the state of the FLAGS register on the other DSP core. Because the two
cores’ FLAGS are interconnected this way, programs can use interrupt
driven or polled techniques for DSP-to-DSP communications.
When a 1 is written to bit 0 of the core FLAGS register of DSP core P0, the
related core flag of DSP core P1, bit 8, is set. The DSP-to-DSP Flag1
works the same way.
The DSP-DSP interrupt lets DSP core P0 interrupt DSP core P1 if the
DSP-DSP interrupt is unmasked in the IMASK register of DSP core P1.
The DSP-DSP interrupts can either be nested with higher priority inter-
rupts taking precedence or they can be processed sequentially.
The following example illustrates how code could initialize the DSP-DSP
interrupt.
/* Initialize DSP-to-DSP Interrupt */
AY0=IMASK;
AY1=0x0100;
AR = AY0 or AY1;
/* Unmask DSP-DSP Interrupts */
IMASK=AR;
/* Enable global interrupts */
ENA INT;
The content of IMASK is OR'd with 0x0100 and written back to IMASK.
This unmasks DSP-DSP interrupt for that particular DSP core. The last
instruction globally enables interrupt servicing. If the above DSP-DSP
interrupt initialization executes on DSP core P1, DSP core P0 could ini-
tiate the DSP-DSP interrupt by asserting bit 2 of its FLAGS register.
! Programs should be careful to avoid locking the I/O register bus for
extended periods of time.
The I/O register bus is a shared resource that affects almost all aspects of
operation of an ADSP-2192. On this bus, either a DSP core or the exter-
nal bus interface (whether PCI, USB or sub-ISA) initiates transactions.
Transactions may be targeted at I/O registers for PCI, USB, system con-
trol, AC’97 codec, GPIO, and serial EEPROM functions. Only one
transaction may be in progress at a time, and all other initiators must wait
for the current transaction to complete.
While waiting for I/O register bus access, DSP execution halts at the I/O
register access instruction, and the DSP is unable to complete any other task.
A DSP core in this halt state ignores interrupts, does not process DMA,
and does not execute other instruction. For example,
• DSP P1 is in the middle of an I/O register bus transaction, and every
initiator wants to launch a I/O register bus transaction.
• DSP P1 can not start a new transaction until the current I/O register
access instruction completes.
• DSP P0 will halt, waiting for the bus, until its transaction is granted
and completed. Alternately, DSP P0 may attempt to lock the bus
and then check for bus lock status. If the bus was not locked by DSP
P0, it knows a transaction is in progress and may choose to remove
the lock request and try again later.
• The PCI bus cannot initiate a transaction and receives a Retry
semantic.
• The USB bus cannot initiate a transaction and receives a Retry
semantic.
• The sub-ISA bus cannot initiate a transaction and does not receive
an ISA acknowledge until the transaction is granted and completed.
A zero wait state I/O register transaction consumes approximately 12 DSP
cycles. Most transactions are zero wait state, but some—such as transac-
tions that must be mapped through external interfaces—may be much
longer. For example, an access to AC97 codec registers must go through
the AC’97 interface.
Writes to AC’97 codec registers are posted, but only one may complete
per AC’97 frame. Up to two writes may be pending at any one time. The
first write will complete with zero I/O register bus wait states. A second
write launched immediately after the first incurs I/O register bus wait
states equivalent to a few AC’97 BITCLKs. A third write in a row blocks
for an entire AC’97 frame.
Programs should make use of the Frame interrupt to time AC’97 codec
writes out to one per frame, assuring that the writes all complete with zero
wait states.
Reads from AC’97 codec registers must always wait for the data to be
returned. A read must also wait for any pending AC’97 codec register
writes to complete before it can begin. In the best case, a read takes one
full AC’97 frame plus another three AC’97 slots (25.39 µs, or approxi-
mately 3,744 DSP cycles). This should also be the typical case if the
AC’97 Frame Interrupt is used to time the read.
The worst case AC’97 read time is 4 frames plus 3 slots (87.89 µs, or
approximately 12,960 DSP cycles). This occurs only if there were already
two AC’97 codec register writes pending just after the start of a frame.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
DSP2 OUT1 PEND
OUT0 Valid
IN1 Valid
IN0 Valid
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
DSP2 OUT1 ENA
15:12 Reserved
Overview
The DSP’s I/O processor manages Direct Memory Accessing (DMA) of
DSP memory through the host (PCI) port and AC’97 codec port. Each
DMA operation transfers an entire block of data. By managing DMA, the
I/O processor lets programs move data as a background task while using
the processor core for other DSP operations. The I/O processor’s architec-
ture, which appears in Figure 7-1 on page 7-3, supports a number of
DMA operations. These operations include the following transfer types:
• Internal memory ↔ host (PCI)
• Internal memory ↔ AC’97 codec port I/O
! This chapter describes the I/O processor and how the I/O processor
controls host port and AC’97 port operations. For information on
connecting external devices to the Host port or AC’97 ports, see
“Host (PCI/USB) Port” on page 8-1 or “AC’97 Codec Port” on
page 9-1.
DMA transfers between internal memory and a host use the DSP’s host
port. For these types of transfers, a DSP program sets up the DSP core’s
DMA controller with the internal memory DMA address, DMA next
(process) address, DMA count, and DMA current count. These DMA set
up parameters are the Transfer Control Block (TCB) for the DMA
transfer.
A host program needs to set up the PCI interfaces’ DMA controller with
similar parameters for the host system to receive or transmit the DMA.
After setup, the DMA transfers begin when the DSP or host program
enables the channel and continue until the I/O processor transfers the
entire buffer to or from DSP memory.
Similarly, DMA transfers between internal memory and the AC’97 port
have DMA parameters (a TCB). When the I/O processor performs DMA
between internal memory and one of these ports, the DSP program sets up
the parameters and the I/O goes through the port.
The direction (receive or transmit) of the I/O port determines the direc-
tion 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.
To further minimize loading on the processor core, the I/O processor sup-
ports chained DMA operations through the DMA next (process) address
feature. When using chained DMA, a program can set up a DMA transfer
to automatically start the next DMA transfer after the current one
completes.
Figure 7-1 on page 7-3 shows the DSP’s I/O processor, related ports, and
buses. Figure 7-2 on page 7-4 shows more detail on DMA channel data
paths.
DSP P0 DSP P1
IN TE R N A L M E M O R Y IN TE R N A L M E M O R Y
DSP P0 DSP P1
PM A DDR BUS DSP P0 PM A DDR BUS DSP P1
P M D A TA B U S P M D A TA B U S
DSP P0 DSP P1
D M A C O N TR O LLE R D M A C O N TR O LLE R
X D M A C H A N N E LS: S IX D M A C H A N N E LS:
4 C O DEC 4 C O DEC
1 M A S TE R P C I 1 M A S TE R P C I
1 S LA V E P C I 1 S LA V E P C I
A C '9 7 IN TE R FA C E P C I IN TE R FA C E
TO D M A C O N TR O LLE R S
DM AP AG E
DS P P 0 AC'97
xxxA DDR , P O RT
xxxNX T ADDR , DS P P 0
xxxCNT , DS P P 0
S RCTL1-0,
xxx CUR CNT T X 1-0, RX 1-0
S TCT L1-0
DS P P 1 DS P P 0
xxxA DDR , DS P P 1
S RCTL1-0,
xxxNX T ADDR , T X 1-0, RX 1-0
S TCT L1-0
xxxCNT ,
xxx CUR CNT
P CI P O RT
P CI_RX 0/1CTL , DAT A
P CI_RX 0/1 BADDRH/L ,
P CI_TX 0/1CTL ,
P CI_TX 0/1BA DDRH/L,
P CI_DM AC0/1 ,
P CI_RX 0 /1CURAD DRH/L,
P CI_CF G CTL ,
P CI_TX 0/1 CURADDRH /L, (NO T V IS IBLE
P CI_IRQ S TAT,
P CI_RX 0/1CNTH/L, AS
P CI_RX 0/1IRQ CNTH/L,
P CI_TX 0/1CNTH/L, RE G IS TE RS)
P CI_TX 0/1IRQ CNTH/L,
P CI_RX 0/1C URCNTH/L,
P CI_RX 0/1IRQ BCNT H/L,
P CI_TX 0/1C URCNTH/L
P CI_TX 0/1IRQ BCNTH/L
P CI P O RT
DMA PO R T, B U FFE R , & B U FFE R ADDRE S S
PA R A M E TE R D M A CO N TR O L DA TA
R E G IS TE R S R E G IS TE R S R E G IS TE R S
Each DSP core has four Codec DMA FIFOs (RX0/1, TX0/1). These FIFOs
can be connected to the AC’97 codec. These FIFOs are eight levels deep
and are located in system control register space (in the cores). These
FIFOs’ control registers are located in system control register space and
configure the codec connection and DMA enable (STCTL0/1, SRCTL0/1).
The codec DMA FIFOs’ DMA parameter registers are located in system
control register space and configure the DMA address (xxxADDR in DSP
memory), DMA next address (xxxNXTADDR in DSP memory), DMA count
(xxxCNT), and DMA current count (xxxCURCNT). These registers permit cir-
cular buffering (through the next address feature).
The PCI interface in the host port has four DMA FIFOs (two receive, two
transmit). These FIFOs are connected to the PCI master DMA channel.
These FIFO’s are four levels deep and are not visible as registers. These
FIFO’s control registers are located in shared I/O register space and con-
figure the DMA mode as plain or scatter-gather (PCI_Rx0/1CTL,
PCI_Tx0/1CTL) and control the PCI FIFOs and enable DMA
(PCI_DMAC0/1).
Because the PCI interface has more FIFO features than the core FIFOs,
the PCI FIFOs also have registers for control and status of PCI interrupts
(PCI_CFGCTL, PCI_IRQSTAT) and have registers for the DMA interrupt
count (PCI_Rx0/1IRQCNTH/L, PCI_Tx0/1IRQCNTH/L, PCI_Rx0/1IRQBCNTH/L,
PCI_Tx0/1IRQBCNTH/L).
Each DSP core has parameter registers for PCI master channel DMA
(DSP-side) located in the core’s system control register space. These
parameter registers configure the DMA address (MASTADDR in DSP mem-
ory), DMA next address (MASTNXTADDR in DSP memory), DMA count
(MASTCNT), and DMA current count (MASTCURCNT). These registers permit
circular buffering (through the next address feature). The address and
count information in the PCI master channel DMA parameter registers
refers to addresses in the DSP core’s internal memory. These master chan-
nel DMAs are controlled by the PCI FIFO’s control registers.
Although PCI slave transfers use a DMA channel, there are no DMA
parameters associated with these slave transfers.
Figure 7-3 on page 7-7 shows block diagrams of the I/O processor’s
address generator (DMA controller); Figure 7-4 on page 7-8 shows those
block diagrams for Host/PCI. Table 7-1 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 that the
I/O processor uses to address a data buffer in internal memory. The xxxA-
DDR 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 on
the DSP’s DM address bus and applies the address to internal memory
during each DMA cycle—a clock cycle in which a DMA transfer is taking
place.
D M A AD D R E S S GE N E R A TO R (IN TE R N A L A D D R E S S E S)
LO CAL BUS
xxxN X T AD DR
M UX
xxx AD DR
IN TE R N A L
MEM O RY
ADDRESS
+ +1
D M A W O R D C O U N TE R (IN TE R N A L AD D R E S S E S )
LO CAL BUS
xxxC NT
M UX
+ – 1
D M A A D D R E S S G E N E R A T O R (H O S T /P C I A D D R E S S E S )
LOCAL BUS
P C I_ x x x B A S E A D D R H /L *
MUX
P C I_ x x x C U R A D D R H /L *
IN T E R N A L
M EM O RY
ADDRESS
+ +1
D M A W O R D C O U N T E R (H O S T /P C I A D D R E SS E S )
LOCAL BUS
P C I_ x x x B A S E C N T H /L *
M UX
P C I_ x x x C U R C N T H /L *
+ – 1
* 3 2 -b it re g is te r (H /L = h ig h /lo w ) do in g a 3 2 -b it in c re m e n t/d e c re m e n t
After transferring each data word to or from internal memory, the I/O
processor adds the modify value to the address register to generate the
address for the next DMA transfer and writes the modified address value
to the address register. The modify value is +1.
" Ifprocessor
a program loads the count ( ) register with zero, the I/O
xxxCNT
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.
Each DMA channel also has a chain pointer register (xxxNXTADDR).
Chained DMA sequences are a set of multiple DMA sequences, the next
starting when the previous one is complete. For more information, see
“Chaining DMA Processes” on page 7-22.
The host port DMA channels each contain additional parameter registers
that set up the host side DMA. The I/O processor generates 32-bit PCI
host memory addresses during DMA transfers between internal memory
and a PCI host.
! Ifrequests
a DMA channel is disabled, the I/O processor does not service
for that channel, whether or not the channel has data to
transfer.
Each DSP core’s six DMA channels are numbered as shown in Table 7-1.
This table also shows the control, parameter, and data buffer registers that
correspond to each channel.
The codec channel DMA control and parameter registers are system con-
trol registers in each DSP core, and the host channel DMA control and
parameter registers are I/O memory-mapped registers. For more informa-
tion on these registers, see “ADSP-2192 DSP Peripheral Registers” on
page B-1.
To set up DMA on the “DSP-side”, the DSP program must load the con-
trol and parameter registers. Because the I/O processor registers are
memory-mapped, the DSP and host have access to program the host side
of DMA operations. A processor sets up a DMA channel by writing the
transfer’s parameters to the DMA parameter registers. After these registers
are loaded, the DSP (or host) is ready to start the DMA.
The host port and AC’97 port each have a DMA enable bit (DEN or SDEN)
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 trans-
fers 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 (count parameter).
! Tois finished,
start a new (non-chained) DMA sequence after the current one
programs must disable the channel (clear its bit);
DEN
write new parameters to the registers; then enable the channel (set
its DEN bit). For looped or chained DMA operations, this dis-
able-enable process is not necessary. For more information, see
“Chaining DMA Processes” on page 7-22.
• DMA FIFO Empty Status. PCI_DMAC0-1 Bit 8 (EMPTY) This bit indi-
cates the FIFO status as: 0 = not empty or 1 = empty. A one written
to this bit clears it. This bit is also cleared by writing the DEN bit to
initiate a DMA transaction.
• DMA Channel Halt Status. PCI_DMAC0-1 Bit 9 (HALT) This bit is set
to one when the master DMA channel is disabled by the PCI address
generation logic. This occurs if the host interface receives an error
signal for an attempted DMA transfer. A one written to this bit
clears it. This bit is also cleared by writing the DEN bit to initiate a
DMA transaction.
• DMA Channel Loop Status. PCI_DMAC0-1 Bit 10 (LOOP) This bit
indicates DMA loop status as: 0 = no looping occurred or 1 = loop-
ing occurred. A one written to this bit clears it. This bit is also
cleared by writing the DEN bit to initiate a DMA transaction.
P A C K IN G M O D E
(P a c k in g e n a b le d /d is a b le d w ith D M A c o n tro l b it in b u s m a s te rin g )
1 6 -B IT D S P M E M O R Y
15 0 DSP
ADDR
1 0 N
3 2 N+1
5 4 N+2
7 6 N+3
PCI BY TE 31 0
31 0 ADDR
3 2 1 0 M 1 0
7 6 5 4 M +4 3 2 PC I
M +8 5 4 SPAC E
P A C K IN G E N A B L E D M +12 7 6
2 4 -B IT D S P M E M O R Y P A C K IN G D IS A B L E D
23 0 DSP
ADDR
C B A N
F E D N+1
I H G N+2
L K J N+3
31 0 31 0
PCI BY TE
ADDR
F E C B
L K I H M C B A
M +4 F E D PCI
P A C K IN G E N A B L E D M +8 I H G SPACE
M +12 L K J
P A C K IN G D IS A B L E D
! When a program sets the bit (=1) after a single DMA finishes,
DEN
the DMA sequence continues from where it left off (for
non-chained operations only). To start a new DMA sequence after
the current one is finished, a program must first clear the DEN enable
bit, write new parameters to the registers, then set the DEN bit to
re-enable DMA. For chained DMA operations, these steps are not
necessary. For more information, see “Chaining DMA Processes”
on page 7-22.
" Ifbefore
a DMA operation completes and the count register is rewritten
the DMA enable bit is cleared, the DMA transfer will restart
at the new count.
Once a program starts a DMA process, the process is influenced by two
external controls: DMA channel priority and DMA chaining.
4. The host begins writing data to the PCI bus, which is buffered
through the host port.
5. The host port PCI buffer detects data is present and asserts an
internal DMA request to the I/O processor.
6. The I/O processor grants the request and performs the internal
DMA transfer, emptying the host port PCI buffer FIFO.
In general, the following sequence describes a typical internal to external
DMA operation where an external device transfers a block of data from
the DSP’s internal memory:
1. The DSP writes the DMA channel’s (DSP-side) parameter registers
(MSTRADDR, MSTRCNT, and optionally MSTRNXTADDR).
2. The host (or DSP) writes the DMA channel’s (host-side) parameter
registers (PCI_xxxADDR and PCI_xxxCNT) and control registers
(PCI_DMACx and PCI_XXXCTL), initializing the channel for transmit
(TRAN=1).
3. The host (or DSP) sets (=1) the channel’s DEN bit enabling the
DMA process.
Because this is a transmit, setting DEN automatically asserts an inter-
nal DMA request to the I/O processor.
4. The I/O processor grants the request and performs the internal
DMA transfer, filling the host port PCI buffer’s FIFO.
5. The host begins reading data from the PCI bus, which is buffered
through the host port.
6. The host port PCI buffer detects that there is room in the buffer (it
is now “partially empty”) and asserts another internal DMA
request to the I/O processor, continuing the process.
Overview
The ADSP-2192 can interface with a host computer through its USB port
or through its PCI port. Both ports provide access to the host computer
via the Peripheral Device Control (PDC) bus, which is connected directly
to the IDMA ports on each DSP. The USB port connects through the
internal USB interface to the PDC bus, and the PCI port connects
through the internal PCI interface to the PDC bus. This chapter describes
the PCI parallel interface, and then describes the USB serial interface. The
type of bus connection is determined by the BUSMODE[1:0] pins.
Bus Type BUS MODE1 Bus MODE0 SCFG:BUS(1:0) Register field (bits 11:10)
Configuration Spaces
The ADSP-2192 has three separate configuration spaces that can be
defined to support user functions by writing to the class code register for
that function during bootup. Additionally, during boot time, the DSP can
disable one or more of the functions. If only two functions are enabled,
they will be functions zero and one. If only one function is enabled, it will
be function 0.
0x07-0x06 Status Register 0x0 Bits enabled: Capabilities List, Fast B2B,
Medium Decode
0x0B-0x09 Class Code 0x078000 Writable from the DSP during initializa-
tion
0x13-0x10 Base Address 1 0x08 Register Access for all ADSP-2192 Reg-
isters, Prefetchable Memory
0x1F-0x1C Base Address 4 0x01 I/O access for control registers and DSP
memory
0x2B-0x28 Cardbus CIS Pointer 0x1FF03 CIS RAM Pointer - Function 0 (Read
Only).
0x2D-0x2C Subsystem Vendor 0x11D4 Writable from the DSP during initializa-
ID tion
0x2F-0x2E Subsystem Device 0x2192 Writable from the DSP during initializa-
ID tion
0x43-0x42 Power Management 0x6C22 Writable from the DSP during initializa-
Capabilities tion
Command Register I/O Space Enable Enables are separate in each function, go
Bit 0 along with the function’s base addresses
Command Register Memory Space Enable Enables are separate in each function, go
Bit 1 along with the function’s base addresses
Command Register Bus Master Enable Enables are separate in each function, go
Bit 2 along with the function’s base addresses
Command Register Memory Write and No function generates Memory Write and
Bit 4 Invalidate Invalidate commands, read-only
Command Register Parity Error Response If any function has the bit set, PERR# may
Bit 6 be asserted
Command Register SERR# Enable If any function enables SERR# driver, then
Bit 8 SERR# may be asserted
Status Register Master Data Parity Separate for each function, no interaction
Bit 8 Error
Status Register Signaled Target Abort Separate for each function, no interaction
Bit 11
Status Register Received Target Abort Separate for each function, no interaction
Bit 12
Status Register Received Master Abort Separate for each function, no interaction
Bit 13
Status Register Signaled System Error Separate for each function, set if SERR#
Bit 14 enabled and SERR# asserted
Status Register Detected Parity Error Separate for each function, but set in all
Bit 15 functions simultaneously
Revision ID Read-only.
Min_Gnt Read-only.
Max_Lat Read-only.
I/O type accesses are supported via BAR4. Both the control registers
accessible via BAR1 and the DSP memory accessible via BAR2 and BAR3
can be accessed with I/O accesses. Indirect access is used to read and write
the control registers and the DSP memory. For control register accesses,
an address register points to the word to be accessed and a separate register
is used to transfer the data. Read/write control is part of the address regis-
ter. Only 16-bit accesses are possible via the I/O space. A separate set of
registers performs the same function for DSP memory access. Control for
these accesses includes a 24-bit/16-bit select as well as direction control.
The data register for DSP memory access is 24-bits wide. 16-bit accesses
are loaded into the lower 16 bits of the register.
There are interactions within the Power Management section of the con-
figuration blocks. The device stays in the highest power state of the three
functions. When one of the functions is in a low power state, it can
respond only to configuration accesses, regardless of the power state of the
other functions. Similarly, when a function transitions from power man-
agement state D3 to D0 (see Chapter 11 “System Design”), that
function’s configuration space is reinitialized. Each function has a separate
PME enable bit and PME status bit. When no determination is possible,
both PME status bits are set.
Capability ID Read-only.
Next_Cap_Ptr Read-only.
Power State Power Management Control/Status Part will be in highest power state
Bit 1:0 of the three functions
PME Status Power Management Control/Status Separate for each function, may be
Bit 15 set in all functions by a wakeup
12.0M HZ US B
US B P O RT
1/8.192 P LL &
CL OC K
CLO CK RE CO V E RY
DO M AIN
X4 33M HZ
P CI CL K
PLL
P CI
CL OC K
24.576M HZ 49.152M HZ
1/2 DO M AIN
X TAL I (S UB-IS A M O DE )
147.45 6M HZ
X6 DS P
PLL CLO CK DO M AIN
1/2 12.288M HZ
AC’97
CLO CK DO M AIN
BITCLK
To Lock the Bus, the DSP writes a “1” to Bit7 of the FLAGS register. This
Flag output bit is assigned to the Bus Lock Request functionality and gen-
erates a continuous request on the Peripheral Device Control Bus. Once
the Bus is granted to the DSP, it remains granted until the bit is cleared.
The DSP can check to see if the bus has been granted by examining Bit15
of the FLAGS register. A “1” in this bit indicates that the bus has been
granted to the DSP.
Once the Bus is Locked, the DSP can perform Read-Modify-Write opera-
tions without the danger of the other DSP or the PCI/USB interface
changing the register. Avoid locking the Bus for extended periods of time.
The PDC bus is a shared resource that affects almost all aspects of opera-
tion of an ADSP-2192 system. Transactions may be initiated by either
DSP or by the external bus interface (whether PCI, USB or sub-ISA).
Transactions may be targeted at registers for PCI, USB, system control,
AC’97, and GPIO functions. Only one transaction may be in progress at a
time; all other initiators must wait for the current transaction to complete.
Each DSP IO space transaction is translated into a PDC bus transaction in
hardware. The initiating DSP waits for its IO Acknowledge (IOACK) signal
until the transaction is granted and completed. While waiting, DSP execu-
tion is halted at the IO space access instruction, and the DSP cannot
complete any other task. In this state, interrupts are ignored, DMA cannot
take place, and no other instruction may execute.
Example
DSP#2 is in the middle of a PDC bus transaction, and every initiator
wants to launch a PDC bus transaction. DSP #2 cannot start a new trans-
action until the current IO space access instruction completes. DSP #1
halts, waiting for IOACK, until its transaction is granted and completed.
DSP #1 may attempt to lock the bus and check for bus lock status. If the
bus was not locked by DSP #1, it assumes that a transaction is in progress
and may remove the lock request and try again later.
The PCI bus cannot initiate a transaction and is issued a Retry semantic.
The USB bus cannot initiate a transaction and is issued a Retry semantic.
The sub-ISA bus cannot initiate a transaction and does not receive an ISA
acknowledge until the transaction is granted and completed.
A zero wait state PDC transaction consumes approximately 12 DSP
cycles. Most transactions have zero wait states, but some transactions
(those that must be mapped through external interfaces, for example) may
be much longer.
Resets
In addition to power-on and system resets described in other chapters, the
ADSP-2192 can be reset by the PCI or USB bus. The Reset Handler that
gets executed is dictated by the CRST[1:0] bits in the Chip Mode/Status
Register (CMSR). For PCI or USB Reset, set the CRST bits to [1:0].
Interrupts
Table 8-5 on page 8-15 shows a variety of potential sources of interrupts
to the PCI host. The PCI Interrupt Register consolidates all of the possi-
ble interrupt sources and the bits of this register to a single interrupt pin,
INTA#, used to signal the interrupts back to the host. The register bits are
set by the various sources and can be cleared by writing a 1 to the bits to
be cleared.
Interrupts may be sensitive either to edges or levels, as indicated in
Table 8-5 on page 8-15. The PCI GPIO interrupt is level sensitive, and is
asserted when any of the GPIO’s individual sticky status bits is true. If an
interrupt service routine is in the process of acknowledging one GPIO
interrupt (by clearing its sticky status and then writing a 1 to PCI-
INT:GPIO) while an event occurs on another GPIO, it is possible for the
ISR to miss the second event, should it occur between the time the ISR
reads the GPIO’s status and when the ISR clears the PCIINT:GPIO bit.
The GPIO interrupt is level sensitive to accommodate this case; the PCI-
INT:GPIO interrupt bit and the INTA# pin immediately reassert after
clearing. The ISR may be written in two ways to detect this case: it may
exit and be immediately retriggered, or it may read back the PCIINT regis-
ter after the clear to see if any bit has been set again, which indicates the
occurrence of some new interrupt.
15 Reserved
10 Reserved
9 Reserved
0 Reserved
1 The Interrupt Status is Latched even when the Interrupt Source is not enabled. Therefore, the
Interrupt should be cleared before being enabled unless previous Interrupt history is considered
important.
15 Reserved
10 Reserved
9 Reserved
4 Reserved
3 Reserved
InBoxes
The incoming mailboxes (InBox0 and InBox1) are 16 bits wide. They may
be read or written by the PCI device or the DSP core. PCI writes to the
InBoxes may generate DSP interrupts. DSP reads of InBoxes may generate
PCI interrupts.
OutBoxes
The outgoing mailboxes (OutBox0 and OutBox1) are 16 bits wide. They
may be read or written by the PCI device or the DSP core. DSP writes to
the OutBoxes may generate PCI interrupts.
PCI reads of OutBoxes may generate DSP interrupts with special han-
dling. The PC host must perform the following sequence when reading an
outbox:
1. Read OutBox
2. Write a 1 to the OutBox Valid bit to clear it
Status
This register consists of read/write-one-clear status bits (denoted R/WC). A
read/write-one-clear bit is cleared when a one is written to it. Writing a
zero has no effect. See “ADSP-2192 DSP Peripheral Registers” on
page B-1 for the bit names of the MBXSTAT register.
0 R/WC InBox0 PCI Interrupt Pending. This bit is set when the
DSP reads valid data from InBox0, if enabled by the corre-
sponding Mailbox Control Register bit.
1 R/WC InBox1 PCI Interrupt Pending. This bit is set when the
DSP reads valid data from InBox1, if enabled by the corre-
sponding Mailbox Control Register bit.
2 R/WC OutBox0 PCI Interrupt Pending. This bit is set when the
DSP writes valid data to OutBox0, if enabled by the corre-
sponding Mailbox Control Register bit.
3 R/WC OutBox1 PCI Interrupt Pending. This bit is set when the
DSP writes valid data to OutBox1, if enabled by the corre-
sponding Mailbox Control Register bit.
4 R/WC InBox0 DSP 1 Interrupt Pending. This bit is set when the
PCI writes valid data to InBox0, if enabled by the corre-
sponding Mailbox Control Register bit.
5 R/WC InBox1 DSP 1 Interrupt Pending. This bit is set when the
PCI writes valid data to InBox1, if enabled by the corre-
sponding Mailbox Control Register bit.
8 R/WC InBox0 DSP 2 Interrupt Pending. This bit is set when the
PCI writes valid data to InBox0, if enabled by the corre-
sponding Mailbox Control Register bit.
9 R/WC InBox1 DSP 2 Interrupt Pending. This bit is set when the
PCI writes valid data to InBox1, if enabled by the corre-
sponding Mailbox Control Register bit.
Control
This register consists of read/write interrupt enable control bits (denoted
R/W). See “ADSP-2192 DSP Peripheral Registers” on page B-1 for the bit
names of the MBXCTL register.
15:12 RO Reserved
2. Read the IOREGD register for the appropriate data. The Ready status
is not necessary in PCI mode, since the IOREGD access is retried
until the data is ready.
3. For writes, the register transaction is initiated when the IOREGD reg-
ister is written.
14 Write/Read
IOMEMA 23 Write/Read
22 16bit/24bit
USB Interface
Overview
The USB port on the ADSP-2192 complies with the Universal Bus Speci-
fication, Version 1.1 and allows you to interface with a compatible host.
An 8051 compatible MCU is supported on board, which allows you to
soft download different configurations and support any number of class
specific commands.
In addition to the 8051 core, the interface includes USB accessible regis-
ters, an interrupt subsystem, configuration and clock control, and a data
path that allows USB Endpoint data transfer directly between the DSP
internal memory and a USB-host. The module interfaces with an on-chip
USB transceiver on the USB side and the DMA and PDC bus on the
ADSP-2192 system side.
USB Requirements
This section describes some features of the protocol upon which this USB
implementation has been based. A separate reference section lists the
resources that provide the detailed description of the USB.
USB is a master-slave bus, in which a single master generates data transfer
requests to the attached slaves and allocates bandwidth on the serial cable
according to a specific algorithm. The bus master is referred to as the USB
host, and the bus slaves are referred to as USB devices. Each USB device
implements one or more USB Endpoints which are akin to virtual data
channels. Each Endpoint on a USB device operates independently of all
others.
Data flows between the USB Host and attached devices in packets that are
8, 16, 32, or 64 bytes. The packets are grouped into larger units called
transfers.
Implementation
The USB module in ADSP-2192 has the following features:
• Control Endpoint for all USB control transactions including down-
loading application-specific MCU firmware
• 3 Endpoints dedicated to downloading DSP code
• 8 User-Programmable Endpoints for DSP data
• 4 registers per Data Endpoint to define a DSP memory buffer asso-
ciated with each Endpoint
• Support for all four USB transaction types (Bulk, Control, Inter-
rupt, and Isochronous)
USB-SIE
This block interfaces to the outside interface. All the USB data traffic goes
through it. Its two paths, I/P and O/P, support both control and data traf-
fic flow. On the Receive side, the clock employs recovery, error checking,
and bit stuffing as it decodes the NRZ data. On the transmit side, it does
the opposite: NRZ encodes it, appends the CRC, bit-stuffs it if necessary,
and transmits the data. It also sends out the sync header and end-of-packet
fields.
USB SIE
Endpoint 0 Control
This block manages all traffic duties for Endpoint 0, serving as the com-
munication link between the USB host and the MCU. For host-to-device
transfers, it notifies the MCU when valid SETUP commands or OUT
packet data arrives for processing by the MCU. In responding to
device-to-host transfers, it transmits the proper data packet or handshake
packet under MCU guidance.
MCU
The MCU is an 8-bit 8051 compatible MCU within the USB. It acts as
the controller for the USB block. It handles all the command and data
processing for the Endpoint 0. It also parameterizes the DSP code and
data Endpoints. There is no involvement in the actual data transfer for the
DSP code and data endpoints.
Endpoint Types
The USB supports four different transfer types: Bulk, Control, Interrupt,
and Isochronous. The Endpoint 0 (EP0) is configured for Control Type
transaction with a fixed packet size of 8. The other user specific Endpoints
(EP4-11) can be defined as Bulk, Interrupt, and Isochronous. Endpoints
1, 2, and 3 are reserved for downloading DSP code and are hard-wired to
be Bulk Out pipes with a maximum packet size of 64. They cannot be
used for data transfers for user-specific purpose.
Data Transfers
The USB supports four different data transfer types: Bulk, Control, Isoch-
ronous, and Interrupt. These types are described in the subsections that
follow.
Bulk
Bulk transactions guarantee error-free delivery of data between the host
and a function Endpoint. Bulk transactions start with the host issuing an
IN or an OUT token. For example, if the host is writing data, it issues an OUT
transaction followed by a DATA0 (PID) packet. Upon receiving the packet,
the function can respond by:
• Issuing an ACK to signify the proper receipt of data. The host can
then send the next data packet (if it has any) in the data sequence.
• Not acknowledging the transaction to force a timeout if there is a
CRC error or bit stuffing errors in the data packet. In this situation,
the host retransmits the data packet using the same PID as the failed
packet.
Packet sizes for the Bulk data are limited to 8, 16, 32, and 64 bytes. Each
USB Endpoint is assigned one of these sizes and may not switch between
them. Large data transfers are broken down into units of these basic
packet sizes. For example, a 1044 byte file transfer across USB to a 64 byte
bulk Endpoint consists of 17 packet transfers as follows: 16 packets of 64
bytes each and 1 packet of 20 bytes. The USB Host assumes that the short
packet represents an end of transfer indicator.
Bulk Transactions do not have a guaranteed bandwidth associated with
them. They use whatever bandwidth that has been left over after all other
types of transactions have been serviced. They are the preferred transac-
tion type if guaranteed error free delivery of data is required.
Isochronous
The isochronous transaction is used when there is a requirement for guar-
anteed constant bandwidth for the data transfer. These transfers occur in
every frame and guarantee one packet transfer per USB frame. The maxi-
mum packet size (up to 1023 bytes) is specified in the Endpoint descriptor
table. These transfers are not acknowledged. The data in the Isochronous
transfers must be error tolerant. In the presence of CRC, an error may be
detected, but the data cannot be retransmitted.
Control
Control Transfers are used for short command/control messages between
a host and a function. Control transactions start with a setup stage. The
format and contents of the packet are defined in the USB specification. If
a data stage follows, the transfer is essentially similar to the bulk transfer.
The status stage completes the handshaking sequence.
During the setup stage, the USB Host sends an 8-byte setup packet to the
USB Device. The packet specifies information such as the types of com-
mand (standard-request, vendor-specific, device-class specific), direction
and size of the data phase (if any), and the specific command code.
After receiving the command, the device (function) can either process the
command and proceed through the data and status phase or ignore the
command. Functions cannot issue a NAK or STALL to ignore setup tokens.
If the setup token packet is corrupt, it is ignored and a timeout occurs.
Interrupt
In the USB system, only a host can initiate a USB transaction. The func-
tion can have the host make regularly scheduled polls of itself. The
frequency of the polling is specified by the function during the bus enu-
meration process. This process consists of a host sending out an IN token
packet to the function and the function responding with either a data
packet (if available) or a NAK or STALL (if a data packet is not available).
This is an Interrupt transaction. The maximum allowable data payload for
an interrupt transaction is 64 bytes.
References
The following are references that you might want to use:
• Universal Serial Bus Specification, Revision 1.1, USB Implementers
Forum, www.usb.org
• OHCI Specification, Revision 1.0 USB Implementers Forum,
www.usb.org
• Tools – Keil Software Developer’s Kit P.No. DK51
Keil Software Inc., 16990 Dallas Parkway, Suite 120, Dallas, TX
• USB Device Class Specifications, www.usb.org.Device Developers
can use this to make use of standardized device drivers on the USB
host
• USB System Architecture, Don Anderson, Mindshare Inc.
0x0XXX This address range defines general-purpose USB status and control registers
0x1XXX This address range defines registers that are specific to Endpoint setup and control
0x2XXX This address range defines the registers used for REGIO accesses to the DSP register
space
0x3XXX This address range defines the MCU program memory write address space
0x1040-0x1043 USB EP1 Code Download Starting address for code download on
Base Address Endpoint 1
0x1044-0x1047 USB EP2 Code Download Starting address for code download on
Base Address Endpoint 2
0x1048-0x104B USB EP3 Code Download Starting address for code download on
Base Address Endpoint 3
0x1060-0x1063 USB EP1 Code Current Current write pointer offset for code
Write Pointer Offset download on Endpoint 1
0x1064-0x1067 USB EP2 Code Current Current write pointer offset for code
Write Pointer Offset download on Endpoint 2
0x1068-0x106B USB EP3 Code Current Current write pointer offset for code
Write Pointer Offset download on Endpoint 3
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
TB LT LT TY TY DR PS PS PS PS PS PS PS PS PS PS
The USB Endpoint Description Register provides the USB core with
information about the Endpoint type, direction, and maximum packet
size. This register is read/write by the MCU only. This register is defined
for Endpoints[4:11].
TB Toggle bit for Endpoint. Reflects the current state of the DATA toggle bit.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
X X X X X X X X X X NE ST NC NC NC NC
The USB Endpoint NAK Counter Register contains the individual NAK
count, stall control, and NAK counter enable bits for Endpoints 4-11. This
register is read/write by the MCU only.
NC[3:0] NAK counter. Number of sequential NAKs that have occurred on a given Endpoint.
When N[3:0] is equal to the base NAK counter NK[3:0] value in the Endpoint Stall
Policy register, a zero-length packet or packet less than maxpacketsize will be issued.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
The USB Endpoint Stall Policy Register contains the base NAK count and
FIFO error policy bits for Endpoints 4-11. The STALL status and Data tog-
gle bits for Endpoints 1-3 are included as well. This register is read/write
by the MCU only.
ST[3:1] A value of 1 means the Endpoint is stalled. ST[1] maps to Endpoint 1, ST[2]
maps to Endpoint 2, etc.
TB[3:1] Toggle bit for Endpoint. Reflects the current state of the DATA toggle bit. ST[1]
maps to Endpoint 1, ST[2] maps to Endpoint 2, etc.
NK[3:0] Base NAK counter. Determines how many sequential NAKs are issued before
sending zero length packet, or a packet less than the maximum packet size, on any
given Endpoint.
LSW
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
AD AD AD AD AD AD AD AD AD AD AD AD AD AD AD AD
MSW
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
X X X X X X X X X X X X X X DS AD
LSW
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
AD AD AD AD AD AD AD AD AD AD AD AD AD AD AD AD
MSW
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
X X X X X X X X X X X X X X DS AD
LSW
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
AD AD AD AD AD AD AD AD AD AD AD AD AD AD AD AD
MSW
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
X X X X X X X X X X X X X X DS AD
LSW
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
AD AD AD AD AD AD AD AD AD AD AD AD AD AD AD AD
MSW
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
X X X X X X X X X X X X X X AD AD
The USB Endpoint 1 Code Download Current Write Pointer Offset Reg-
ister contains an 18-bit address that corresponds to the current write
pointer offset from the base address register for DSP code download on
Endpoint 1. The sum of this register and the EP1 code download base
address register represents the last DSP PM location written.
This register is read by the MCU only and is cleared to 3FFFF (-1) when
the Endpoint 1 Code Download Base Address Register is updated.
LSW
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
AD AD AD AD AD AD AD AD AD AD AD AD AD AD AD AD
MSW
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
X X X X X X X X X X X X X X AD AD
The USB Endpoint 2 Code Download Current Write Pointer Offset Reg-
ister contains an 18-bit address that corresponds to the current write
pointer offset from the base address register for DSP code download on
Endpoint 2. The sum of this register and the EP2 code download base
address register represents the last DSP PM location written.
This register is read by the MCU only and is cleared to 3FFFF (-1) when
the Endpoint 2 Code Download Base Address Register is updated.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
AD AD AD AD AD AD AD AD AD AD AD AD AD AD AD AD
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
X X X X X X X X X X X X X X AD AD
The USB Endpoint 3 Code Download Current Write Pointer Offset Reg-
ister contains an 18-bit address that corresponds to the current write
pointer offset from the base address register for DSP code download on
Endpoint 3. The sum of this register and the EP3 code download base
address register represents the last DSP PM location written.
This register is read by the MCU only and is cleared to 3FFFF (-1) when
the Endpoint 3 Code Download Base Address Register is updated.
The USB SETUP Token Command Register is defined as 8 bytes long
and contains the data sent on the USB from the most recent SETUP
transaction. This register is read by the MCU only.
Byte 7 0
0 bmRequest
1 b Request
2 w Value (L)
3 w Value (H)
4 w Index (L)
5 w Index (H)
6 w Length (L)
7 w Length(H)
If the most recent SETUP transaction involves a data OUT stage, the USB
SETUP Token Data Register is defined as 8 bytes long and contains the
data sent on the USB during the data stage. This is also where the MCU
writes data to be sent in response to a SETUP transaction involving a data
IN stage. This register is read/write by the MCU only.
Byte 7 0
0 Data 0
1 Data 1
2 Data 2
3 Data 3
4 Data 4
5 Data 5
6 Data 6
7 Data 7
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
X X X X X X X X X X X X C3 C2 C1 C0
The USB SETUP Counter Register provides information about the total
size of the SETUP transaction data stage. This register is read/write by the
MCU only.
The counter hardware is a modulo 4-bit down counter used for tallying
data bytes in both the IN and OUT data stages of SETUP transactions. As
such, the count value stored has different meanings.
IN Transfers: The MCU loads the counter with the number of bytes to transfer (must be 8
or less since the USB Setup Token Data Register file is 8 bytes maximum).
The USB interface then decrements the count value after each byte is trans-
ferred to the host.
OUT Transfers: Starting from a cleared value of 0, the counter is decremented with each byte
received from the host, including the two CRC bytes. For example, if 8 bytes
are received, the count value progresses from 15, 14, 13, etc. to a value of 6
(inclusive is the 2 CRC bytes). The MCU reads the value and subtracts it
from 14 to determine the actual number of data bytes in the USB Setup
Token Register file (14 - 6 = 8 bytes).
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
The USB Register I/O Address Register contains the address of the
ADSP-2192 register to be read/written. This register is read/write by the
MCU only.
A[15] MCU sets to 1 to notify the PDC Register Interface block to start ADSP-2192
read/write cycle. PDC Register Interface block clears to 0 to notify MCU the
read/write cycle has completed.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
The USB Register I/O Address Register contains the data of the
ADSP-2192 register that has been read or is to be written. This register is
read/write by the MCU only.
D[15:0] During READ this register contains the data read from the ADSP-2192, during
WRITE this register is the data to be written to the ADSP-2192
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
The USB Control Register controls various USB functions. This register is
read/write by the MCU only.
MO A value of 1 means: MCU has completed boot sequence and is ready to respond to
USB commands
DI A value of 1 means: Disconnect CONFIG device and enumerate again using the
downloaded MCU configuration
BB A value of 1 means: After reset boot from MCU RAM, 0 = after reset boot from
MCU ROM
IIN Current interrupt is for an IN token sent with a non zero length data stage
IOU Current interrupt is for an OUT token received with a non zero length data stage
BY Busy bit. A value of 1 means: MCU is busy processing a command. USB interface
responds with NAK to further IN/OUT requests from the host until MCU clears this
bit.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
The USB Address/Endpoint Register contains the USB address and active
Endpoint. This register is read/write by the MCU only.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
X X X X FN1 FN9 FN8 FN7 FN6 FN5 FN4 FN3 FN2 FN1 FN1 FN0
The USB Frame Number Register contains the last USB frame number.
This register is read by the MCU only.
Vendor-Specific Commands
In addition to the normally defined USB standard device requests, the fol-
lowing vendor-specific device requests are supported with the use of EP0.
These requests are issued from the host driver via normal SETUP transac-
tions on the USB.
! Address <15:0> is the first address where code download begins; the
address is incremented automatically after each byte is written. USB
MCUCODE is a three-stage control transfer with an OUT data
stage. Stage 1 is the SETUP stage, stage 2 is the data stage involving
the OUT packet, and stage 3 is the status stage. The length of the
data stage is determined by the driver and is specified by the total
length of the MCU code to be downloaded.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
X X X X X X X X X X X X X X DS BA
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
BA BA BA BA BA BA BA BA BA BA BA BA BA BA BA BA
The DSP Memory Buffer Base Addr Register points to the base address for
the DSP memory buffer assigned to this Endpoint.
DS DSP Memory select bit. 0 = DSP1 memory space, 1 = DSP2 memory space
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
SZ SZ SZ SZ SZ SZ SZ SZ SZ SZ SZ SZ SZ SZ SZ SZ
The DSP Memory Buffer Size Register indicates the size of the DSP mem-
ory buffer assigned to this Endpoint.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
RD RD RD RD RD RD RD RD RD RD RD RD RD RD RD RD
The DSP Memory Buffer RD Pointer Offset Register provides the offset
from the base address for the read pointer of the memory buffer assigned
to this Endpoint.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
WR WR WR WR WR WR WR WR WR WR WR WR WR WR WR WR
The DSP Memory Buffer WR Pointer Offset Register provides the offset
from the base address for the write pointer of the memory buffer assigned
to this Endpoint.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
C7 C6 C5 C4 C3 C2 C1 C0 1 SP RW 0 0 0 0 0
C[7:0] Power consumption from bus expressed in 2mA units (default = 0xFA 500mA)
Since three possible interfaces are supported, each interface has its own
DSP download address and uses its own BULK pipe to download code.
The driver for each interface must set the download address before using
the BULK pipe to download DSP code. The download address increments
as each byte of data is sent on the BULK pipe to the DSP.
Since DSP instructions are 3 bytes long and USB BULK pipes have even
number packet sizes, the instructions to be downloaded must be formatted
into 4-byte groups with the least significant byte always zero. The USB
interface strips off the least significant bits and formats the DSP instruc-
tion before writing it into the program memory. For example, to write the
3-byte opcode, 0x400000, to DSP program memory, the driver sends
0x40000000 down the BULK pipe.
The following example illustrates the proper order of commands and syn-
chronizing that the driver must follow:
1. Device enumerates with two interfaces. Each interface has the capa-
bility to download DSP code and can initiate at any time.
2. The driver for Interface 1 begins code download by sending the
USB REGIO (write) command with the starting download
address. The driver must wait for this command to finish before
starting code download.
3. The driver for Interface 2 begins code download by sending the
USB REGIO (write) command with the starting download
address. The driver must wait for this command to finish before
starting code download.
4. Each driver now streams the code to be downloaded to the DSP:
Driver 1 onto BULK EP1 for Interface 1, and Driver 2 onto BULK
EP2 for Interface 2. The code is written to the DSP in three-byte
instructions starting at the location specified by the USB REGIO
(Write) command. The driver waits for each command to finish
before sending a new code download address.
General Comments
DSP code download is available only after the ADSP-2192 has re-enumer-
ated using application-specific, MCU RAM-based firmware. The DSP
code download functionality is not available in the MCU boot ROM for
the default CONFIG device.
After setting the download addresses using the USB REGIO (write) com-
mand, code download can be initiated for any length using normal BULK
traffic.
Some facts to keep in mind on the behavior of the USB Data Endpoints:
• DSP Data Endpoints follow a pre-increment addressing scheme.
The first address written is: Write Pointer + 1 + Base Address
• The Read and Write pointers control data movement in and out of
the DSP Memory Buffers and are not allowed to move past one
another. Therefore, to download instructions to DM, the Read
Pointer must be positioned so that it does not interfere with the
auto-incrementing/auto-rolling nature of the Write Pointer. Since
this example calls for 3 writes to DM, the Read Pointer must be
positioned at least 4 locations greater than the starting Write
Pointer value.
• The Size value indicates the length of the memory buffer and is used
as a trigger mechanism for both the Write and Read pointers to
automatically roll back to the top of the buffer as indicated by the
Base Address value.
The following is an outline of the steps involved using EndPoints 4 and 5
to download these Jump patches:
1. Program EndPoints 4 and 5 Data Memory Buffer Registers as
follows:
Base Address = 0x00000 for DSP 1, 0x20000 for DSP 2
Size Value = 0x0003 (Causes Write Pointer to roll back to top:
location 0x00000 for DSP 1, 0x20000 for DSP 2)
Read Pointer = 0x0010 (A non-essential value that allows the
Write Pointer to increment and roll properly.)
Write Pointer = 0x0000
Type: BULK
Direction: OUT
Steps 1 and 2 can be performed only after MCU RAM-based firmware has
been downloaded and the device has been enumerated for a second time.
These steps could be programming steps executed as part of MCU startup
code. See the section on device initialization process for more details on
USB interface configuration.
3. Start USB OUT transaction of a 6-byte packet that contains the
NOP Opcode, the Jump Address and the Jump Opcode.
a. Data packet bytes 1 and 2 are the NOP Opcode and are written
to DM locations 0x00001 for DSP 1 or 0x20001 for DSP 2.
b. Data packet bytes 3 and 4 are the Jump Address and are written
to DM locations 0x00002 for DSP 1 or 0x20002 for DSP 2.
c. Data packet bytes 5 and 6 are the Jump Opcode and are written
to DM locations 0x00000 for DSP 1 or 0x20000 for DSP 2.
Once the Jump Opcode is loaded, the DSPs vector to the desired address
and begin executing user code. This code can re-program the DSP Mem-
ory Buffer Register values of Endpoints 4 and 5 for normal buffer use.
Be sure to load the Jump Address location before loading the Jump
Opcode to insure the DSP has a valid address for vectoring. The above
programming sequence of the endpoint memory buffer registers provides
for this behavior.
5. Sets the least significant bit of DSP Mailbox register 0x24 as a sig-
nal to the DSP that the MCU has completed reading the Serial
EEPROM registers and updating the USB descriptor tables.
6. Writes the MCU OK bit (bit 2 of USB Control Register) to signal
the USB Endpoint 0 hardware that the MCU has completed ini-
tialization and is ready to respond to USB commands.
Once it has finished the above sequence, the MCU enters an idle loop,
waiting from an interrupt from the USB Endpoint 0 hardware. When the
MCU gets an interrupt, it jumps to its interrupt service routine in which
it decodes the USB command and calls the appropriate command service
routine.
As stated earlier, the MCU initially sets the USB interface into the device
Default State. As the enumeration process with the USB host takes place,
the MCU controls the movement of the USB interface from the Default
State to the Addressed State, and finally to the Configuration State.
Application-specific MCU RAM-based firmware should be based on the
structures used in the MCU ROM firmware for supporting the standard
USB commands and the two vendor-specific commands. Typical
RAM-based code should be designed as follows:
1. Additional Interface, Endpoint, and/or String Descriptor tables
which detail the characteristics of the DSP Code download and
Data Endpoints to be enumerated.
2. A copy of the ROM code which supports the standard USB com-
mands and the two vendor-specific commands.
3. If not initial entry (processing the data from the OUT transaction):
a. Read the USB Setup Counter Register to determine how many
bytes arrived. (# of bytes transferred = 14 – count value. See USB
Setup Counter Register description).
b. Read the proper number of bytes from the USB Setup Token
Data Register and write them to MCU PM RAM.
c. Determine if the host is trying to send more bytes in the Data
Stage than what was told the MCU during the SETUP stage
(Length bytes 6 and 7 of the USB Setup Token Command Reg-
ister).
d. If true, instruct the Endpoint 0 block to send STALL condition:
(1.) Clear the USB SETUP Counter Register
(2.) Set ER bit in the USB Control Register
(3.) Return to the MCU idle loop
e. If not true, determine if additional data stages are needed.
If more data stages are expected:
(1.) Clear USB Setup Counter Register.
(2.) Clear the high byte of USB Control Register
(3.) Return to the MCU idle loop to await the next interrupt
from the Endpoint 0 hardware block, which indicates more
data has arrived.
6 INT IN 16 STATUS
9 INT IN 16 STATUS
5. The user driver now writes the USB Config Register, causing the
device to disconnect and reconnect. The system enumerates all
interfaces and loads the appropriate drivers.
6. The modem driver downloads code to DSP for service. The DSP
also initializes the DSP Memory Buffer Base Addr Register, and
DSP Memory Buffer Size Register, DSP Memory Buffer RD
Pointer Offset, DSP Memory Buffer WR Pointer Offset registers
for each Endpoint. Endpoints can be used only when the above
registers have been written. Modem service is now available.
7. The FAX driver downloads code to DSP for FAX service. The DSP
also initializes the DSP Memory Buffer Base Addr Register, DSP
Memory Buffer Size Register, DSP Memory Buffer RD Pointer
Offset, DSP Memory Buffer WR Pointer Offset registers for each
Endpoint. Endpoints can be used only when the above registers
have been written. FAX service is now available.
CTL EP0
Generic EP 6
Generic EP 4
Generic EP 7
Generic EP 8
Generic EP 9
CTL EP0
CTL EP0
Interface 1 Interface 2
Fixed Endpoints
CONTROL Endpoint 0
Type: Control
Dir: Bidirectional
Maxpacketsize: 8
Fixed Endpoints
CONTROL Endpoint 0
Type: Control
Dir: Bidirectional
Maxpacketsize: 8
Type: Bulk
Dir: OUT
Maxpacketsize: 64
Programmable Endpoints
Generic Endpoints 4, 5, 6, 7, 8, 9, 10, 11
Programmable by:
Memory Allocation: via DSP Memory Buffer Base Addr, DSP Memory Buffer Size,
DSP Memory Buffer RD Pointer Offset,
DSP Memory Buffer Write Pointer Offset Registers
C[7:0] Power consumption from bus expressed in 2mA units (default = 0xFA 500mA)
The string descriptors supported in the CONFIG DEVICE are the fol-
lowing and cannot be overwritten by the Serial EEPROM.
Manufacturer ADI
All descriptors can be changed when downloading the RAM based MCU
re-numeration code; however the above mentioned restrictions hold for
the CONFIG DEVICE.
DSP Memory
USB Bus SIE USB Core FIFO's
The USB data FIFOs for these generic Endpoints exist in DSP memory
space. For each Endpoint, there exists the following memory buffer regis-
ters (IO Page 0x0C):
Since these FIFOs exist in DSP memory, the DSP is responsible for shar-
ing some of the pointer management duties with the USB core. For OUT
transactions, the write pointer is controlled by the USB core and the read
pointer is governed by the DSP. The opposite is true for IN transactions.
Both the write and read pointers for each memory buffer would start off as
0.
All USB buffers operate in a circular fashion. Once a pointer reaches the
end of the buffer, it needs to be set back to zero. The USB core handles
this automatically. You can use the DSP DAGS to control auto incre-
menting and wrapping of the pointers or you can write code to
manipulate them manually.
Below is a listing of Read/Write Pointer characteristics:
1. Both pointers reflect the value of the last memory location on
which action took place. The write offset pointer contains the value
of the last location written while the read offset pointer contains
the value of the last location read.
2. The USB core pre-increments the pointers before using their value.
The DSP code that governs pointer control should follow the same
model.
3. The USB core recognizes when a memory buffer FIFO is empty
when the Read pointer = Write pointer. This has certain ramifica-
tions, depending upon whether the USB core is handling an OUT
transaction or an IN transaction. This is explained in more detail
in the following sections concerning USB traffic direction. The
USB core recognizes when a memory buffer FIFO is full when the
Write pointer is 1 location behind the Read pointer. The DSP code
that governs pointer control needs to mimic this behavior.
In summary, before the USB host can send traffic to the data Endpoints,
they need to be programmed in 2 ways:
• MCU: Programs the traits of the Endpoints such as type, direction,
maxpacketsize, etc. This is accomplished via writes to the Endpoint
Description, NAK Counter, and Stall Policy registers. A convenient
method of doing this is to have the MCU firmware program these
registers prior to responding to USB control traffic for enumeration
on the USB bus.
• DSP: Programs the traits of the DSP DM memory buffers. This is
accomplished via IO writes to the Base/Size/Read Offset/Write Off-
set registers as part of some DSP initialization code.
If for some reason the host sends more data than the maxpacketsize, the
USB core will accept it as long as there is sufficient room in the FIFO.
The USB core will write data to the FIFO to all free locations until the
pointers collide. For example, if the FIFO has 32 free bytes and 64 bytes
are sent from the host, the USB core will write the first 32 bytes to the
FIFO and block the second 32 bytes. During the handshake, the USB core
will send a NAK handshake and rewind the write pointer back to its set-
ting prior to the start of the transaction. The USB core never allows the
write pointer to be equal to the read pointer as this indicates FIFO empty.
A full FIFO is indicated by the write pointer being one location behind
the read pointer.
Since the DSP is governing the read pointer, it must perform a similar cal-
culation to determine if there is sufficient data in the FIFO to begin
processing. Once it has consumed some amount of data, the DSP will
need to update the Memory Buffer Read Offset register. The DSP code
cannot program the read pointer to move beyond the write pointer. The
DSP can drain all the data from the FIFO, in which case it can program
the read pointer to equal the write pointer. Such a condition indicates to
the USB core that this FIFO is empty.
If the amount of read data is less than the maxpacketsize (a short packet),
the USB core will determine whether to send the data based upon a NAK
count limit. This is 4-bit field in the Endpoint Stall Policy register that
the user can program with a value indicating how many sequential NAKs
should be sent prior to transmitting a short packet. The individual end-
point NAK count (NC bits of the Endpoint NAK Counter Register) is
incremented each time a sequential NAK is sent on that particular end-
point. Once this value exceeds the base NAK count value, a short packet is
transmitted. The endpoint-specific NC bits are cleared to zero each time a
data stage is successfully transmitted for the particular endpoint. This
NAK counter system will allow flexibility in how IRPs get retired via short
packets.
Along with programming the NK field of the Endpoint Stall Policy Regis-
ter, the user must program the NE (NAK counter enable) bit to enable this
counter function. If this bit is set to zero, the USB core will continuously
respond with a NAK handshake to the IN token until the number of bytes
in the FIFO is greater than or equal to the maxpacketsize.
Since the DSP is governing the write pointer, it must determine if there is
sufficient room in the FIFO for placing new data. Once it has completed
writes to the FIFO, it needs to update the Memory Buffer Write Offset
register. The DSP can fill the FIFO up to the point where the write
pointer is one location behind the read pointer. This will be interpreted as
a FIFO full condition by the USB core.
Note: This file is based on preliminary technical data and is subject to change.
Updates will be posted on the Analog Devices FTP site:
ftp.analog.com
-----------------------------------------------------------------------------*/
#ifndef __DEF2192_PCI_H_
#define __DEF2192_PCI_H_
#endif
The following example definitions file is for the ADSP-2192 DSP USB.
For the most current definitions file, programs should use the version of
this file that comes with the software development tools. The version of
the file that appears here is included as a guide only.
/* -----------------------------------------------------------------------------
def2192_USB.h - SYSTEM & IOP REGISTER BIT & ADDRESS DEFINITIONS FOR ADSP-2192
Note: This file is based on preliminary technical data and is subject to change.
Updates will be posted on the Analog Devices FTP site:
ftp.analog.com
-----------------------------------------------------------------------------*/
#ifndef __DEF2192_USB_H_
#define __DEF2192_USB_H_
#endif
Overview
AC’97 is a digital interface for the transport of audio and modem samples
that was originally developed by Analog Devices, Creative Labs, Intel,
National Semiconductor, and Yamaha and documented in the AC’97
specification. For ADSP-2192, the AC’97 specification provides a high
audio architecture for the 1997 and 1998 volume platform segments.
The AC’97 interface, which complies with the AC’97 specification, con-
nects the host's Digital Controller (DC) chip set and one to four analog
audio (AC), modem (MC), or Audio/Modem (AMC) codecs.
0x10 STCTL0
0x20 STCTL1
0x11 SRCTL0
0x21 SRCTL1
0x12 TX0
0x22 TX1
0x13 RX0
0x23 RX1
Reserved
CE[1:0]
SMSEL
DME
TFE
TFF
TU
2 Reserved
12 Reserved
If FIFO is enabled and a valid request for data comes that the FIFO can-
not fulfill, the transmitter underflow bit will be set. This indicates that an
invalid value was sent over the selected slot. Similarly, on the receive side,
if the FIFO is full and another valid word is received, the Overflow bit
will be set to indicate the loss of data.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
SLOT[3:0]
FIP[2:0]
Reserved
Reserved
CE[1:0]
SMSEL
DME
RFE
RFF
RO
2 Reserved
12 Reserved
This is the 16-bit register specifying the current address of the DMA
channel. This will be the address used for the next DMA access. After each
access, the address will be incremented. The register will be loaded from
the channel’s NextAddress register when the count for the channel reaches
zero.
This is the 16-bit register specifying the current count of the particular
DMA channel. The count is decremented after each DMA transfer for
that channel. When the count reaches zero, it is reloaded from the Count
register, the Address register is reloaded from the NextAddress register,
and an interrupt is generated.
This 16-bit register specifies the number of DMA transfers for a channel
between interrupts and reloading of the address and current count regis-
ters. Count is loaded into Current Count when Current Count reaches
zero.
This is the 16-bit register specifying the next start address to be loaded
into the Address register at the end of the current buffer.
0x12 TX0
0x22 TX1
A C '9 7 C O D E C A D S P -2 1 9 2
SY N C
B ITC L K
SD I
SD O
A C RST
! Atasserted.
power-on reset, the AC'97 Link is stopped with ACRST#
When any other type of reset occurs, it may interrupt a
running AC '97 link. In general, the hardware will not reset the link
and the ADSP-2192 ROM code makes no attempt to return the AC
'97 link to a known state. The host must download and run DSP
code at reset time to stop (if desired) and restart the AC '97 link.
Refer to the Audio Hardware Developer section of Intel's web site
(www.intel.com).
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Reserved
Reserved
ACWE
BCOE
BCEN
ARPD
LKEN
AGPE
SYEN
AFD
AFR
AFS
Table 9-5. AC97LCTL Register Bit Definitions
12:10 Reserved
2:0 Reserved
12:3 ACSE Each bit enables the corresponding AC’97 slot to handle
data. Effectively, by setting the bit, the DSP FIFO(s) commit
to take RX data in every selected frame slot with an RX slot
valid bit asserted, and they commit to transmitting data in
every frame slot with a DAC request bit asserted. Overruns
and underruns are possible but must be detected and toler-
ated by the FIFOs. The controller needs the ASCE register to
process DAC request bits into TX Slot valid bits (like the
RQE[1:0] bits) and to know when to generate internal
SPORT framing signals as well.
Setting ACSE[12] is supported only when AC97LCTL:
AGPE=0.
Each ACSE bit enables sample transfers in both directions.
No independent control of transmit (SDO) and receive
(SDI) is possible.
15:13 Reserved
! and
The and
AC97SVAL registers are provided for diagnostic
AC97SREQ
debugging purposes only. All necessary processing of Slot Valid
In/Out bits and Slot Request bits occurs automatically in dedicated
hardware.
2:0 Reserved
14:3 ACSV Each bit reports the state of the corresponding slot valid bit
from the previous frame (SDI Slot 0 data).
[1:12]
Frame Number
F0 F1 F2 F3 F4
AC97STAT:SYNC
AC97STAT:REG F4
2:0 Reserved
12:3 ACRQ Each bit reports the state of the corresponding slot request
bit from the previous frame (SDI Slot 2 data). Bits are active
[3:12]
low when the corresponding DAC is enabled and always low
when the corresponding DAC is disabled.
15:13 Reserved
15-0 AGS Reads. Reports the state of the corresponding AC’97 GPIO
pin during the previous frame.
[15:0]
Writes. The AC97SIF register is sampled at the beginning of
Slot 12 to provide pin state data to AC’97 GPIO pins pro-
grammed as outputs (provided AC97LCTL:AGPE=1).
Resource Allocation
System design involves allocating the following resources among the sup-
ported devices:
• SDI pins. There are three SDI (Serial Data In) pins on the
ADSP-2192. One SDI pin must be connected to each added codec.
• AC’97 sample stream slots. There are ten bidirectional sample slots
per AC’97 frame (slots 3 through 12, although 12 is almost always
used for GPIO.) Monaural streams use one slot, while stereo streams
take two adjacent slots. While different streams may have different,
unsynchronized sample rates, the left and right streams in a stereo
pair are locked together. (The AC’97 2.1 specification suggests cer-
tain slot assignments for various functions. While external codecs
may require such specific slots, the ADSP-2192 AC’97/FIFO hard-
ware is general and may be programmed to any slot in the range 3
to 12).
• DSP DMA FIFOs. There are four FIFOs, two on each DSP. Each
is capable of handling one monaural or stereo sample stream when
assigned to AC’97 sample slots. (Rx and Tx may be assigned to dif-
ferent slots.)
This implies that a maximum of eight AC’97 sample slots may be
operated at any time.
• Computational resources (MIPS and DSP Memory), as appropri-
ate.
Table 9-12. AC’97 Pin Listing
For most purposes, the AC’97 protocol describes SDI as a single input
stream rather than three distinct streams. This stream is derived by ORing
(combining by using the logical OR function) all three SDI pins. Unused
SDI pins must be tied to GND for proper operation of the other devices.
! When powering down the link, ensure that an AC’97 control regis-
ter write be performed to the or PR4 bits of the nonexistent pri-
MLNK
mary codec. The write function causes the external secondary
devices to search the link for this control register write in order to
time their own transition into powerdown properly.
Slot # 0 1 2 3 4 5 6 7 8 9 10 11 12
SYNC
TAG CMD CMD PCM PCM LINE1 PCM PCM PCM PCM LINE2 HSET I/O
SDO ADDR DATA L R DAC CNTR LSURR SURR LFE DAC DAC CTRL
TAG STATUS STATUS PCM PCM LINE1 MIC RSRVD RSRVD RSRVD LINE2 HSET I/O
SDI[2:0] ADDR DATA L R ADC ADC ADC ADC STATUS
Note that, in addition to the DSPs, the PCI/USB/sub-ISA host may also
directly access AC’97 Codec registers, to aid in debugging.
Each case involves changing one controller register and one Codec regis-
ter. The controller delays the effect in the controller register until the
Codec receives its serial register write. Before launching the Codec register
write, you must make sure that any previously posted Codec register
writes have completed. Therefore, you must wait through two frames (two
AC’97 Frame Interrupts) and then write the controller and Codec regis-
ters in close succession.
Changes to AC97SEN take effect at the next AC’97 Codec Control/Status
Register (CSR) write. The value read back from AC97SEN is updated imme-
diately after it is written by a DSP. This makes it possible, if timed
properly, for DSP #1 and then DSP #2 to each read-modify-write AC97SEN
to enable their respective allotted slots and have all the slot enable changes
take effect in the same frame. Unfortunately, in the standard AC’97 pro-
tocol you can not enable all the codecs at the same time, as it takes
multiple AC’97 writes-and therefore multiple Frames-to address them. It
is possible to enable multiple codecs in one Frame if using ADI Chaining
Mode.
When powered down, a wakeup protocol is defined using the SDI pins. A
high level on SDI asynchronously signals a wakeup condition to the con-
troller. If it is enabled to do so, the controller may then restart the link
upon receiving this wakeup signal.
LKEN=1
De-assert
ACRST#
“Cold Reset”
1us Pulse
SYNC SYEN=1
“Warm
Cold Warm Reset” IDLE
(ACRST# (BITCLK (BITCLK on, SYEN=0 Running
asserted) halted) SYNC halted)
LKEN=0, then
Assert MLNK or PR4=1 1
ACRST# 1
ACRST#
1
BITCLK
SYNC
SDO
SDI
Wake Wake
Event Event
Cold Reset
(ACRST# Controller Warm Reset Controller
deasserted) Enabled (SYNC pulse) Enabled
State Transitions
The state transitions are: powerup and powerdown.
Power-Up Transitions
• The simplest way to power up the ADSP-2192 AC’97 link control-
ler from any power-down state is to write AC97LCTL:LKEN=1, and
then poll for AC97STAT:LKOK=1. The ADSP-2192 hardware will
make the appropriate transitions to bring the interface to a running
state.
• From the Cold state, de-assertion of ACRST# by the controller (for
example, clearing AC97LCTL:AFR) causes the BITCLK generator to
start, resulting in an IDLE state. Note that the BITCLK generator
may be either in an external Primary codec, or the ADSP-2192’s
internal BITCLK generator, as selected by the AC97LCTL:BCOE bit.
• From Warm, assertion of SYNC for the bus by the controller causes
the BITCLK to start (upon de-assertion of SYNC), resulting in the
IDLE state.
• From IDLE, writing the bit AC97LCTL:SYEN=1 starts the SYNC pulse
generator and places the link in a running state. Note that addi-
tional configuration is needed to power up devices, associate FIFOs
with AC’97 Slots, and to enable sample transmission (see below).
Power-Down Transitions
• The link must be powered down to a Warm state in this sequence:
a. Power down all codec blocks by writing PRn bits to 1, except for
the primary codec’s PR4 or MLNK bit.
b. Wait for two AC’97 Frame Interrupts.
c. Write AC97LCTL:LKEN=0. This tells the controller that the link is
about to be stopped.
d. Write the primary codec’s PR4 bit (if audio) or MLNK bit (if
modem) to 1. At the end of slot 2 of this access, the primary
codec will stop BITCLK; if BITCLK is internally generated
(AC97LCTL:BCOE=1), the generator will also stop at this point
(AC97LCTL:BCEN is cleared). External codecs will snoop the link
watching for this register write, and will fully power down at this
point. The controller’s SYEN bit should now be cleared (it will be
cleared automatically if the LKEN bit was used to power down the
link).
• The link may then be brought from a Warm to a Cold state by
asserting ACRST#, which is done by either writing AC97LCTL:AFR to
1, powering down the DSPs with the AC97LCTL:ARPD bit set to 1, or
asserting the interface RST# pin while SCFG:RDIS is 0 (the power-on
default).
The recommended way to enable and disable the link is through use
of the LKEN bit.
When LKEN is written to 1 (from 0):
• If the link was already running (LKOK=1), there is no effect.
• If the link was in Cold reset, ACRST# is deasserted (clearing
AC97LCTL:AFR if necessary).
When LKEN is written with the same value (0==>0 or 1==>1), there
is no effect. The safest way to restart the Link when it is in an
unknown state (such as at a reset other than power on) is to write
LKEN to a zero (0) and then to one (1).
4. Wait for one AC’97 Frame Interrupt in order to let the CSR write
complete.
5. Disable RX/TX interrupts in the corresponding DSP, if needed.
6. Drain the RX FIFO, if needed.
7. Clear the Connection Enable bits in the Transmit and/or Receive
FIFO Control Register (STCTL/SRCTL) in the correct DSP FIFO to
00.
The ADSP-2192 contains a JTAG test access port. The emulator uses
JTAG logic for ADSP-2192 communications and control. This JTAG
logic consists of a state machine, a five pin Test Access Port (TAP), and
shift registers. Note that the ADSP-2192 JTAG does not support bound-
ary scan.
The TAP pins appear in Table 10-1.
Pin Function
TCK (input) Test Clock: pin used to clock the TAP state machine.1
TMS (input) Test Mode Select: pin used to control the TAP state machine sequence.1
TDI (input) Test Data In: serial shift data input pin.
TDO (output) Test Data Out: serial shift data output pin.
TRST (input) Test Logic Reset: resets the TAP state machine
1 Asynchronous with XTALI
For more information about JTAG, see application note EE-68. Engineer-
ing application notes are available at www.analog.com.
Overview
This chapter describes the basic system interface features of the
ADSP-219x family processors, including the ADSP-2192. The system
interface includes various hardware and software features used to control
the DSP processor. Processor control pins include a PORST (power on reset)
signal, clock signals, flag inputs and outputs, and interrupt requests. This
chapter describes only the logical relationships of control signals; consult
individual processor data sheets (including the data sheet for the
ADSP-2192) for actual timing specifications.
Pin Descriptions
The ADSP-2192 processor comes in a 144-LQFP package configuration.
This section provides functional descriptions of the ADSP-2192 pins.
Table 11-1 through Table 11-7 provide ADSP-2192 processor pin
descriptions.
Number
Pin Name(s) I/O Description
of Pins
Number
Pin Name(s) I/O Description
of Pins
IGND 1 I IGND
NC 1 O No Connect
Number
Pin Name(s) I/O Description
of Pins
Number
Pin Name(s) I/O Description
of Pins
Number
Pin Name(s) I/O Description
of Pins
Number
Pin Name(s) I/O Description
of Pins
Number
Pin Name(s) I/O Description
of Pins
AIOGND 2 IO Ground
IOVDD 2 IO Vdd
AIOGND 1 IO Ground
Number
Pin Name(s) I/O Description
of Pins
Clock Signals
The ADSP-2192 can be clocked by a crystal oscillator. If a crystal oscilla-
tor is used, the crystal should be connected across the XTALI/O pins, with
two capacitors connected as shown in Figure 11-1 on page 11-8. Capaci-
tor values are dependent on crystal type and should be specified by the
crystal manufacturer. A parallel-resonant, fundamental frequency, micro-
processor-grade 24.576 MHz crystal should be used for this configuration.
The ADSP-2192 processor can also be operated with an external fre-
quency generator or integrated oscillator supplying the clock signal. If an
external clock is used, the input should be connected to the XTALI pin, and
the XTALO pin must be left unconnected. If the input waveform exceeds a
2.5V signal level, the CLKSEL pin should be tied to VBYP (2.5V) to protect
the internal oscillator. The XTALI signal may not be halted, changed, or
operated below the specified frequency during normal operation.
The internal phase locked loop (PLL) of the processors generates an inter-
nal clock that is, by default, six times the input frequency. This clock rate
is configurable, and the multiplier’s default value of six can be changed,
according to the bit settings of DPLLN, DPLLK, and DPLLM in the DSP’s PLL
control register.
For more information about the programmable PLL, see “Setting Dual
DSP Core Features” on page 6-3.
24.576 M Hz
X TALI X TALO
CLKS E L
ADSP-2192
BUS 1
BUS S E LE CT
BUS 0
P O W E R O N RE S E T P O RS T
(NO CO N NE CT)
P CI CLO CK CLK
P CI RE S E T RS T
The ADSP-2192 defines the following clock domains: PCI, USB, AC’97,
DSP clock, and the Peripheral Device Control (PDC) bus. Figure 11-2 on
page 11-9 shows these clock domains and their relationships to each other.
24.576M HZ
X T ALI
12.0M HZ
US B
US B P O RT
1/8.192 P LL & CLO C K
CLO CK RE CO V E RY DO M AIN
X4 33M HZ
PLL P CI CL K
P CI
49.152M HZ CLO C K
1/2 (S UB-IS A M O DE ) DO M AIN
147.45 6M HZ
X6 DS P
PLL CLO CK DO M AIN
1/2 12.288M HZ
AC’97
CLO CK DO M AIN
BIT CLK
Synchronization Delay
Each peripheral has several asynchronous inputs (interrupt requests, for
example), which can be asserted in arbitrary phase to the processor clock.
The processor synchronizes such signals before recognizing them. The
delay associated with signal recognition is called synchronization delay.
Different asynchronous inputs are recognized at different points in the
processor cycle. Any asynchronous input must be valid prior to the recog-
nition point to be recognized in a particular cycle. If an input does not
meet the setup time on a given cycle, it is recognized either in the current
cycle or during the next cycle if it remains valid.
Power On Reset
The ADSP-2192 has an internal Power On Reset circuit that resets the
DSP when power is applied. A Power On Reset (PORST) signal can also ini-
tiate this master reset. When the Power On Reset is invoked, program
flow jumps to the first location of the loader kernel at address 0x14000 and
begins execution.
Software Reset
The DSP can generate a software reset by using the RSTD bit in the DSP
Interrupt/Powerdown Registers. (See “ADSP-2192 DSP Peripheral Regis-
ters” on page B-1 for more information about the RSTD bit.) Generally,
reset conditions are handled by forcing the DSPs to execute ROM- or
RAM-based Reset Handler code. The Reset Handler to be executed can be
dictated by the Reset Source as defined by the CRST[1:0] bits in the Chip
Mode/Status Register (CMSR). If not otherwise defined, the loader kernel
jumps to the first location of internal PM memory at address 0x10000 and
commences execution.
The exact Reset Functionality is therefore defined by the ROM and RAM
Reset Handler Code and as such is programmable.
Reset Progression
Once a reset has occurred and the loader kernel begins running, it does the
following:
• Determines the type of reset (Power On Reset, PCI/USB Reset, or
Software Reset),
• Configures interrupts
Table 11-9 shows the values and descriptions for the supported functions.
For commands that require multiple arguments, the arguments are placed
in Data Memory addresses 0x0001, 0x0002, and 0x0003 respectively.
During booting (and rebooting), all interrupts are masked, and auto-
buffering is disabled. The timers run during a reboot. If a timer interrupt
occurs during the reboot, it is masked. Thus, if more than one timer inter-
rupt occurs during the reboot, the processor latches only the first, and a
timer overrun can occur.
AX0 no unchanged
AX1 no unchanged
MX0 no unchanged
MX1 no unchanged
AY0 no unchanged
AY1 no unchanged
MY0 no unchanged
MY1 no unchanged
MR2 no unchanged
SR2 no unchanged
AR no unchanged
SI no unchanged
MR1 no unchanged
SR1 no unchanged
MR0 no unchanged
SR0 no unchanged
I0 no unchanged
I1 no unchanged
I2 no unchanged
I3 no unchanged
M0 no unchanged
M1 no unchanged
M2 no unchanged
M3 no unchanged
L0 no unchanged
L1 no unchanged
L2 no unchanged
L3 no unchanged
IMASK yes 0
IRPTL yes 0
ICNTL yes 0
STACKA no unchanged
I4 no unchanged
I5 no unchanged
I6 no unchanged
I7 no unchanged
M4 no unchanged
M5 no unchanged
M6 no unchanged
M7 no unchanged
L4 no unchanged
L5 no unchanged
L6 no unchanged
L7 no unchanged
TX0 no unchanged
TX1 no unchanged
CNTR no unchanged
LPSTCKA no unchanged
ASTAT yes 0
MSTAT yes 0
LPSTCKP no unchanged
SE no unchanged
SB no unchanged
PX no unchanged
DMPG1 yes 0
DMPG2 yes 0
IOPG yes 0
IJPG yes 0
RX0 no unchanged
RX1 no unchanged
STACKP no unchanged
AF no unchanged
B0 no unchanged
B1 no unchanged
B2 no unchanged
B3 no unchanged
B4 no unchanged
B5 no unchanged
B6 no unchanged
B7 no unchanged
SYSCTL no unchanged
DMAPAGE no unchanged
CACTL yes 0
STCTL0 no unchanged
SRCTL0 no unchanged
TX0 no unchanged
RX0 no unchanged
STCTL1 no unchanged
SRCTL1 no unchanged
TX1 no unchanged
RX1 no unchanged
TPERIOD no unchanged
TCOUNT no unchanged
TSCALE no unchanged
TSCALECNT no unchanged
FLAGS yes 0
Interrupts
See “ADSP-2192 Interrupts” on page E-1 for information about inter-
rupts on the ADSP-2192.
Flag Pins
The ADSP-2192 processor has eight dedicated general-purpose flag pins,
IO0-7. These flags can be programmed as either inputs or outputs; they
default to inputs following reset. The IOx pins are programmed with the
use of two memory-mapped registers. The value of the GPIO configura-
tion register determines the flag direction: 0=output and 1=input. The
Programmable Flag Data register is used to read and write the values on
the pins. (Refer to “ADSP-2192 DSP Peripheral Registers” on page B-1
and “Setting Dual DSP Core Features” on page 6-3 for more information
about these registers.)
Data being read from a pin configured as an input is synchronized to the
processor’s clock. Pins configured as outputs drive the appropriate output
value. When the GPIO status register is read, any pins configured as out-
puts will read back the value being driven out; the status is “sticky”;
writing a zero clears it, but writing a one has no effect.
Powerup Issues
The ADSP-219x dual-voltage processor (ADSP-2192) has special issues
related to powerup. These issues include the powerup sequence and the
dual-voltage power supplies. This section discusses both of these issues. It
also gives information about reset generators, which provide a reliable
active reset once the power supplies and internal clock circuits have
stabilized.
Powerup Sequence
Each of the DSPs on the ADSP-2192 has a register to control powerup
and powerdown functions. These registers are PWRP0 (the DSP1 Inter-
rupt/Powerdown Register) and PWRP1 (the DSP2 Interrupt/Powerdown
Register).
To power up one of the DSPs, write a 1 to the PU (power up) control bit of
that DSP’s Interrupt/Powerdown Register. Writing this value causes the
DSP to exit the IDLE within its powerdown handler, effectively powering
up. The same process can also be used to abort a powerdown; if the DSP is
in the powerdown handler prior to the IDLE, writing a 1 causes execution
to immediately continue through the IDLE without stopping the clocks.
To power down one of the DSPs, write a 1 to the PD (power down) control
bit of that DSP’s Interrupt/Powerdown Register. Writing this value causes
the DSP to enter its powerdown handler. The same process can be used to
abort a powerup. If the DSP is in the powerdown handler after executing
an IDLE, writing a 1 causes the DSP to immediately re-enter the power-
down handler after executing the RTI.
The current value of the PD and PU control bits indicate the current state of
the DSP. If PD=1, this DSP is powered down; either it is in the powerdown
handler and has executed an IDLE instruction, or the DSP Clock Genera-
tor (PLL) is not running and stable. If PU=1, this DSP is in the powerdown
interrupt handler, whether or not it has executed the powerdown IDLE.
If both DSPs are powered down, the DSP clock generator is also powered
down. The DSP clock generator restarts automatically when either DSP
wakes up. DSP memory cannot be accessed via PCI when the DSP clock
generator is powered down, and memory reads must not be performed
while the DSPs are powering up.
VD D E X T VD D IN T
(3.3-5.0V ) (2.5V )
200-300
IO Pin
In ternal Lo gic
Power Regulators
The ADSP-2192 is intended to operate in a variety of different systems.
These include PCI, CardBus, USB and embedded (Sub-ISA) applications.
The PCI and USB specifications define power consumption limits that
constrain the ADSP-2192 design; see “Host (PCI/USB) Port” on page 8-1
for more information.
DS P T A N T AL U M CE RAM IC
INTE RNAL OR
CIRCUIT E LE CT RO L Y T IC
P CI V DD
2.5V @ 500M A IV DD 3.0V -> 5.5V
10 µ F .1 µ F
ZE TE X
V CT RLV DD F ZT 951
E X TE RNAL
C O M P O NE NT S
-
P CI VAUX
+ 3.0V -> 3.6V
VRE F
Z E TE X
FZ T951
V CT RLAUX
Powerdown
In addition to supporting powerdown modes for the PCI, USB, and
AC’97 standards, the ADSP-2192 supports additional powerdown modes
for the DSP cores and peripheral buses. The powerdown modes are con-
trolled by the DSP1 and DSP2 Interrupt/Powerdown registers.
The ADSP-2192 processor provides a powerdown feature that allows the
processor to enter a very low power dormant state through hardware or
software control. (Refer to the processor data sheet for exact power con-
sumption specifications.)
The powerdown feature is useful for applications where power conserva-
tion is necessary (for example in battery-powered operation).
The powerdown feature has the following effects:
• Internal clocks are disabled
• Processor registers and memory contents are maintained
• The chip can recover from powerdown in less than 100 XTALI cycles
• The chip can disable internal oscillator when using crystal
• Processor does not need to shut down clock for lowest power when
using external oscillator
• Interrupt support enables “housekeeping” code to execute before
entering powerdown and after recovering from powerdown
• User-selectable powerup context is provided
Even though the processor is put into the powerdown mode, the lowest
level of power consumption still might not be achieved if certain guide-
lines are not followed. Lowest possible power consumption requires no
additional current flow through processor output pins and no switching
activity on active input pins. Therefore, a careful analysis of pin loading in
the circuit is required.
The following sections detail the proper powerdown procedure and pro-
vide guidelines for clock and output pin connections required for
optimum low-power performance. Refer to “AC’97 Codec Port” on
page 9-1 for more information about powering the ADSP-2192 up or
down through the AC’97 interface, or to “Host (PCI/USB) Port” on
page 8-1 for more information about doing this through the USB or PCI
interfaces.
Powerdown Control
The ADSP-2192 supports two states with distinct power management and
functionality capabilities. These states are referred to as Platform States
and are denoted PS0 and PS1.
These platform states encompass both hardware and software states. The
driver and DSP code take responsibility for detailed power management,
and minimum power levels are achieved regardless of OS or BIOS. The
driver and DSPs manage power by changing platform states as necessary in
response to events. Such events may include changes in the function’s
PCI/USB power management D-state or PME_Enable state (set via the
external PME pin), or external wakeup events detected on the external ded-
icated general-purpose flag pins (IO0-7). See Table B-5 on page B-18 for
more information about the PME bit.
The PS0 platform state indicates that the platform is running and is opera-
tional. The power state is D0 and the chip is at full power.
The PS1 platform state indicates that the platform is shut down and is in
the lowest power state. The power state may be D0, D3, or D3cold. The
DSPs are powered down, the AC’97 is shut down, and XTAL and the clocks
to the DSPs are stopped. No wakeup is enabled, and any enabled wake
events signal PME directly without DSP intervention.
If both DSPs are powered down, the DSP clock generator is also powered
down; the DSP clock generator restarts automatically when either DSP
wakes up. DSP memory cannot be accessed via PCI when the DSP clock
generator is powered down, and memory reads must not be performed
while the DSPs are powering up.
While the processor is in the powerdown mode, the processor is in CMOS
standby. This feature allows the lowest level of power consumption where
most input pins are ignored. Active inputs need to be held at CMOS levels
to achieve lowest power. More information can be found in the section
“Processor Operation During Powerdown” on page 11-36.
Entering Powerdown
The powerdown sequence is defined as follows:
1. Initiate the powerdown sequence by writing a 1 to the PD bits of the
PWRP1 and PWRP2 registers.
Exiting Powerdown
The powerdown mode can be exited with the use of the PU bit of the PWRP1
and PWRP2 registers. Writing a 1 to that bit causes the powerdown
sequence to be aborted. There are also several user-selectable modes for
start-up from powerdown which specify a start-up delay and also specify
the program flow after start-up. This feature allows the program to resume
from where it left off before powerdown, or the program context to be
cleared.
Ending Powerdown
Applying a low-to-high transition to the PU bits of the PWRP1 and PWRP2
registers takes the processor out of powerdown mode. The processor auto-
matically selects the amount of time to wait before coming out of the
powerdown mode. The PLL waits until it is stable before starting the
clocks to the rest of the system; it stabilizes more quickly when the XON bit
(the Xtal Force On bit in the CMSR register) is set because the crystal oscil-
lator remains active. For more information, see “Using an External
TTL/CMOS Clock” on page 11-36.
Emulation
Analog Devices DSP emulators use the JTAG test access port of the
ADSP-2192 processor to monitor and control the target board processor
during emulation. The emulator provides full-speed emulation, allowing
inspection and modification of memory, registers, and processor stacks.
Non-intrusive in-circuit emulation is assured by the use of the processor’s
JTAG interface; the emulator does not affect target system loading or
timing.
Note that the ADSP-2192 JTAG port does not support boundary scan.
For more information about JTAG emulation, see the “JTAG Test-Emu-
lation Port” on page 10-1.
EZ-KIT Lite
To make it easier to evaluate the ADSP-219x DSP family for your applica-
tion, Analog Devices sells the ADSP-2192 EZ-KIT Lite™. This kit
provides developers with a cost-effective method for evaluating of the
ADSP-219x family of DSPs.
The EZ-KIT Lite includes an ADSP-2192 DSP evaluation board and fun-
damental debugging software. The evaluation board in this kit contains an
ADSP-2192 digital signal processor, Audio type Codec, breadboard area,
Flag LED, Reset/Interrupt/Flag push buttons, and ADSP-2192 peripheral
port connectors. The peripheral connectors include a JTAG test and emu-
lation port connector that supports the Analog Devices emulators and PCI
and USB connections.
The ADSP-2192 EZ-KIT Lite comes with an evaluation suite of the Visu-
alDSP++ integrated development environment with the C/C++ compiler,
assembler, and linker that supports typical debug functions, including
memory/register read and write, halt, run, and single step. The use of all
software tools is limited to the EZ-KIT Lite product.
For more information, refer to the documentation shipped with the
EZ-KIT Lite.
Recommended Reading
The text High-Speed Digital Design: A Handbook of Black Magic is recom-
mended for further reading. This book is a technical reference that covers
the problems encountered in state-of-the-art, high-frequency digital cir-
cuit design, and is an excellent source of information and practical ideas.
Topics covered in the book include:
• High-Speed Properties of Logic Gates
• Measurement Techniques
• Transmission Lines
• Ground Planes and Layer Stacking
• Terminations
• Vias
• Power Systems
• Connectors
• Ribbon Cables
• Clock Distribution
• Clock Oscillators
Reference: Johnson and Graham, High-Speed Digital Design: A Handbook
of Black Magic, Prentice Hall, Inc., ISBN 0-13-395724-1
Overview
The DSP core has general-purpose and dedicated registers in each of its
functional blocks. The register reference information for each functional
block includes bit definitions, initialization values, and (for system control
registers) memory-mapped addresses. Information on each type of register
is available at the following locations:
• “Core Status Registers” on page A-8
• “Computational Unit Registers” on page A-15
• “Program Sequencer Registers” on page A-18
• “Data Address Generator Registers” on page A-24
• “Memory Interface Registers” on page A-26
Outside of the DSP core, a set of registers control I/O peripherals. For
information on these product-specific registers, see “ADSP-2192 DSP
Peripheral Registers” on page B-1.
When writing DSP programs, it is often necessary to set, clear, or test bits
in the DSP’s registers. While these bit operations can all be done by refer-
ring to the bit’s location within a register or (for some operations) the
register’s address with a hexadecimal number, it is much easier to use sym-
bols that correspond to the names of bits or registers.
Computational AX0, AX1, AY0, AY1, AR, Data register file registers provide Xop and Yop
Units AF, MX0, MX1, MY0, inputs for computations. AR, SR, and MR
MY1, MR0, MR1, MR2, receive results. In this text, the word Dreg
SI, SE, SB, SR0, SR1, SR2 denotes unrestricted use of data registers as a data
register file, while the words XOP and YOP
denote restricted use. The data registers (except
AF, SE, and SB) serve as a register file, for uncon-
ditional, single-function instructions.
System control B0, B1, B2, B3, B4, B5, B6, DAG1 base address registers (B0-3), DAG2 base
B7, CACTL address registers (B4-7), Cache control
0101 AY1 M1 M5 SE
0110 MY0 M2 M6 SB
0111 MY1 M3 M7 PX
1010 AR L2 L6 IOPG
1011 SI L3 L7 IJPG
Register Bits REG = value ENA/DIS mode POP STS SET/CLR INT
Register Bits REG = value ENA/DIS mode POP STS SET/CLR INT
CDE 5 cycles NA NA NA
CFZ 4 cycles NA NA NA
1 This latency applies only to IF COND instructions, not to the DO UNTIL instruction. Loading the
CNTR register has 0 effect latency for the DO UNTIL instruction.
! Abut a or POP PC has one cycle of latency for all SSTAT register bits,
PUSH
or POP LOOP or STS has one cycle of latency only for the
PUSH
STKOVERFLOW bit in the SSTAT register.
When loading some Group 2 and 3 registers (see Table A-3 on page A-5),
the effect of the new value is not immediately available to subsequent
instructions that might use it. For interlocked registers (DAG address and
page registers, IOPG, IJPG), the DSP automatically inserts stall cycles as
needed. However, for non-interlocked registers (to accommodate the
required latency), programs must insert either the necessary number of
NOP instructions or other instructions that are not dependent upon the
effect of the new value.
! Load latency applies only to the time it takes the loaded value to
effect the change in operation, not to the number of cycles required
to load the new value. A loaded value is always available to a read
access on the next instruction cycle.
0 AZ ALU result zero. Logical NOR of all bits written to the ALU result register
(AR) or ALU feedback register (AF).
0 = ALU output ≠ 0
1 = ALU output = 0
1 AN ALU result negative. Sign of the value written to the ALU result register
(AR) or ALU feedback register (AF).
0 = ALU output positive (+)
1 = ALU output negative (−)
4 AS ALU x input sign. Sign bit of the ALU x-input operand; set by the ABS
instruction only.
0 = Positive (+)
1 = Negative (−)
5 AQ ALU quotient. Sign of the resulting quotient; set by the DIVS or DIVQ
instructions.
0 = Positive (+)
1 = Negative (−)
2 AV_LATCH ALU overflow latch mode. Determines how the ALU overflow flag,
AV, gets cleared.
0 = Disable
Once an ALU overflow occurs and sets the AV bit in the
ASTAT register, the AV bit remains set until explicitly
cleared or is cleared by a subsequent ALU operation that does
not generate an overflow.
1 = Enable
Once an ALU overflow occurs and sets the AV bit in the
ASTAT register, the AV bit remains set until the application
explicitly clears it. For details on clearing the AV bit, see “Bit
Manipulation: TSTBIT, SETBIT, CLRBIT, TGLBIT” and
“Register to Register Move” in the ADSP-219x DSP
Instruction Set Reference.
3 Reserved
! The register lets programs transfer data between the data buses,
PX
but the data cannot be an input or output in a calculation.
3 STACK Stack interrupt. Generated from any of the following stack status
states: (if PCSTKE enabled) PC stack is pushed or popped and hits
high-water mark, any stack overflows, or the status or PC stacks under-
flow.
4–14 User-defined
0 reserved write 0
1 reserved write 0
2 reserved write 0
3 reserved write 0
6 reserved write 0
Refer to Table 6-2 on page 6-14 for more information regarding the FLAGS
register.
5 CDE Enable caching of instructions that conflict with DMDAs (=1, enabled
on reset)
/* -----------------------------------------------------------------------------
def2192_core.h - SYSTEM REGISTER BIT & ADDRESS DEFINITIONS FOR ADSP-219x DSPs
The def2192_core.h file defines ADSP-219x DSP family common symbolic names; for
names that are unique to particular ADSP-219x family DSPs, see that DSP's
definitions file (such as the def2191.h file) instead. This include file
(def2192_core.h) contains a list of macro "defines" that let programs use symbolic
names for the following ADSP-219x facilities:
ax0 = 0x0800;
REG(B0) = ax0; >>> this uses the define for the B0 register's address
-----------------------------------------------------------------------------*/
#ifndef __DEF2192_core_H_
#define __DEF2192_core_H_
/*---------------------------------------------------------------------------*/
#endif
Overview
The DSP has general-purpose and dedicated registers in each of its func-
tional blocks. The register reference information for each functional block
includes bit definitions, initialization values, and (for I/O processor regis-
ters) memory-mapped addresses. Information on each type of register is
available at the following locations:
• “Core Status Registers” on page A-8
• “Computational Unit Registers” on page A-16
• “Program Sequencer Registers” on page A-19
• “Data Address Generator Registers” on page A-26
• “Peripheral Registers” on page B-2
When writing DSP programs, it is often necessary to set, clear, or test bits
in the DSP’s registers. While these bit operations can be done by referring
to the bit’s location within a register or (for some operations) the register’s
address with a hexadecimal number, it is much easier to use symbols that
correspond to the bit’s or register’s name.
For convenience and consistency, Analog Devices provides header files
that define these bit and register definitions (def2192_IO.h,
def2192_PCI.h, def2192_USB.h, def2192-12.h, and def219x.h). Note
that the def2192-12.h file also contains the definitions from the IO, PCI,
and USB header files.
Peripheral Registers
There are three groups of registers for the ADSP-2192:
• “ADSP-219x DSP Core Registers” on page A-1
• “ADSP-2192 System Control Registers” on page B-6
• “ADSP-2192 Peripheral Device Control Registers” on page B-11
This appendix describes system control registers and peripheral device
control registers. A general description of DSP peripheral architecture,
which follows, provides an overview of peripheral registers.
PM ADDRESS B US 24
DM ADDRESS BUS 24
PM DATA BUS 24
BUS
CONN ECT DM DATA BUS 16
( PX)
DA TA CO R E
REGI STER INT ERFACE
FI LE I NPUT
REGI STERS
AD D R DA T A AD D R DA TA AD D R DA TA
RESU LT
REGI STERS
BAR REL
P0 DMA P1 DMA
MU LT AL U
16 X 16- BIT SHI FTER CONTROLLER CONTROLLER
SHARED DSP
I / O MAPPED
FI FOS REGI STERS FI FOS
PROCESSOR P 0 PROCESSOR P 1
GP I / O PI NS HOST PORT
SERI AL PORT
J TA G
(& OPTI ONAL PCI 2. 2 EMULATI ON
AC'9 7 OR
SERI AL PO RT
COMPLI ANT USB 1. 1
EEPROM)
Summary
Each of the DSPs integrated within the ADSP-2192 and the interfaces
(PCI, USB Sub-ISA, Cardbus) needs to be capable of controlling and
monitoring a variety of registers external to the DSP core. This section
describes how the DSPs access these Peripheral Device Control (PDC)
registers. The operation of the Peripheral Device Control (PDC) Bus that
connects the DSPs and Interfaces to the PDC Registers is also described in
this section.
Writes to AC’97 codec registers are posted, but only one may complete
per AC’97 frame. Up to two writes may be pending at any one time. The
first write completes with zero PDC wait states. A second write launched
immediately after the first incurs PDC wait states equivalent to a few
AC’97 BITCLKs. A third write in a row blocks for an entire AC’97 frame.
Use the Frame interrupt to time AC’97 codec writes out to one per frame,
assuring that they will all complete with zero wait states.
Reads from AC’97 codec registers must always wait for the data to be
returned. A read must also wait for any pending AC’97 codec register
writes to complete before it can begin. In the best case, a read takes one
full AC’97 frame plus another three AC’97 slots (25.39 µs, or approxi-
mately 3,744 DSP cycles). This is also the typical case when the AC’97
Frame Interrupt is used to time the Read.
The worst case AC’97 read time is four frames plus three slots (87.89 µs,
or approximately 12,960 DSP cycles). This occurs only when there are
already two AC’97 codec register writes pending just after the start of a
frame.
Most AC’97 codec registers may be shadowed, and actual reads should be
rare.
Example
In the worst case, DSP core P1 posts two AC’97 codec register writes just
after the start of a new Frame. DSP core P0 immediately follows with a
read to an AC’97 codec register. DSP core P0 will be unable to compute,
DMA, or interrupt for 87.89 µs. DSP core P1 can compute with data in
its own memory, but cannot communicate with DSP core P0 or access any
PDC bus register for 87.89 µs. The external bus interface can communi-
cate with DSP core P1, but cannot communicate with DSP core P0 or
access any PDC bus register for 87.89 µs. In the state, the entire
ADSP-2192 system is highly constrained.
00 B0 Base Register0
01 B1 Base Register1
02 B2 Base Register2
03 B3 Base Register3
04 B4 Base Register4
05 B5 Base Register5
06 B6 Base Register6
07 B7 Base Register7
08 - 0B Reserved
0D - 0E Reserved
14 - 1F Reserved
24 - 2F Reserved
35 - 3F Reserved
40 - 43 Reserved
58-5F Reserved
66-FF Reserved
LOOP
SDEN
SDEN
SSEL3
SSEL2
SSEL1
SSEL0
SPEN
FULL
FLSH
FIP2
FIP1
FIP0
DSP
SRCTLx FIFO Receive Control Register
These include the SRCTL0 and SRCTL1 registers in each DSP core.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
EMPTY
FLOW
LOOP
SSEL3
SSEL2
SSEL1
SSEL0
SDEN
SDEN
SPEN
FULL
FLSH
FIP2
FIP1
FIP0
DSP
0x00 0x00-0x0F ADSP-2192 Chip Control DSP / PCI / USB page B-13
Registers
0x02-0x03 Reserved
0x04 0x00-0x7E AC’97 Codec Register DSP / PCI / USB page B-45
Space,
Primary Codec 0
0x05 0x00-0x7E AC’97 Codec Register DSP / PCI / USB page B-45
Space,
Secondary Codec 1
0x06 0x00-0x7E AC’97 Codec Register DSP / PCI / USB page B-46
Space,
Secondary Codec 2
0x07 Reserved
0x0D-0xFF Reserved
1 PCI configuration spaces should be accessed only by the DSP, and only during the boot process.
After the PCI interface has been configured, bit 2 (ConfRdy) of the PCI_CFGCTL register
should be set by the DSP. This allows the PCI interface access to these registers while at the same
time denying the DSP access.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
CRST<1:0>
BUS<1:0>
PCI RST
Reserved
PCI_5V
VXPW
REGD
VXPD
ACVX
VAUX
RDIS
XON
RST
B5V
1 Reserved
5 Reserved Reserved
6 Reserved Reserved
15 14 13:9 8 7 6 5 4 3 2 1 0
PWRST[1:0]
Reserved
Reserved
Reserved
PME EN
GPME
APME
SPME
PME
4:2 Reserved
7 Reserved Reserved
13:9 Reserved
PMIEN
PMWE
RSTD
GINT
GIEN
RINT
AINT
RIEN
AIEN
GWE
FIEN
RWE
AWE
PD
PU
0 PD DSP PowerDown.
When written to a 1, causes the DSP to power down (enter its
power-down handler). Can also be used to abort a power-up:
if the DSP is in the power-down handler after executing an
IDLE, writing a 1 will cause the DSP to immediately re-enter
the PowerDown interrupt handler after it executes the RTI.
When read, PD=1 indicates that this DSP is powered down:
either (a) it is in the powerdown handler and has executed an
IDLE instruction), and/or (b) the DSP Clock Generator
(PLL) is not running and stable. When both DSPs are pow-
ered down, the DSP Clock Generator is powered down, and
automatically restarts when either DSP wakes up.
Note: DSP memory cannot be accessed via PCI or USB when
the DSP is powered down. There is a delay after powering up
the DSPs with the PU bit during which memory reads must
not be performed, because the XTAL or the DSP PLL is not
yet running and stable. After powering up by writing a 1 to
the PU bit, the PD bit must be polled until it becomes 0, after
which the clock generator will be running and it is safe to
access DSP memory again.
1 PU DSP PowerUp.
When written to a 1, causes the DSP to power up (exit the
IDLE within its power-down handler). Can also be used to
abort a powerdown: when written to 1 while the DSP is
within its powerdown handler prior to the IDLE, writing a 1
will cause execution to immediately continue through the
IDLE without stopping clocks.
When read, PU=1 indicates that this DSP is in the power-
down interrupt handler, whether or not it has executed the
powerdown IDLE.
11 Reserved
15 Reserved
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
DPLLM
DPLLN
DPLLK
Dboost
Cboost
DselC
DselR
CselC
CselR
DAdj
CAdj
GPIOCTL GPIO Control (w), Init (r) 0x01A 0x001A 0x00 0x1A
Read = Power-on state;
Write: Set state of out-
put pins
GSTKY
GPIO Wakeup Control (GPIOWAKECTL) Register
GCTL[7:0]
Reserved
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Reserved
Reserved
SDAI
SCKI
SENI
SDA
SCK
SEN
4:0 Reserved
12:8 Reserved
Overview
DSP Mailbox registers allow you to construct an efficient communications
protocol between the PCI device driver and the DSP code. The mailbox
functions consist of an InBox0, InBox1, OutBox0, OutBox1, a control
register, and a status register.
InBoxes. The incoming mailboxes (InBox0 and InBox1) are 16 bits wide.
They may be read or written by the PCI device or the DSP core. PCI
writes to the InBoxes may generate DSP interrupts. DSP reads of InBoxes
may generate PCI interrupts.
OutBoxes. The outgoing mailboxes (OutBox0 and OutBox1) are 16 bits
wide. They may be read or written by the PCI device or the DSP core.
DSP writes to the OutBoxes may generate PCI interrupts.
PCI reads of OutBoxes may generate DSP interrupts with special han-
dling. The PC host must perform the following sequence when reading an
OutBox: (1) read OutBox, (2) write a 1 to the OutBox Valid bit to clear
it. (PCI reads of OutBoxes cannot generate interrupts directly, as they
would be “read side-effects” which are prohibited by system design consid-
erations in the PCI Specification.)
Control. This register consists of read/write interrupt enable control bits.
(denoted R/W).
Status. This register consists of read/write-one-clear status bits (denoted
R/WC). A read/write-one-clear bit is cleared when a one is written to it.
Writing a zero has no effect.
Table B-10 lists the Peripheral Device Control Register Space for
PCI/USB Mailbox registers. For register bit names and descriptions for
each register, see the topic “Using DSP and PCI Mailbox Registers” in
Chapter 6 Dual DSP Cores.
CSTSCHG Signal
In CardBus systems, power management events are signaled to the host by
an active-high signal called CSTSCHG. An external FET or inverter is used
with the ADSP-2192’s active-low PME signal to create CSTSCHG. In CardBus
mode, PME is asserted under the following conditions:
• The function’s INTRM master interrupt/wakeup mask bit is 1
• The function’s WKUPM master wakeup mask bit is 1
INTA Signal
In CardBus systems, assertion of the INTA pin is controlled by the INTRM
master interrupt mask bit, in addition to the other interrupt control regis-
ters on the ADSP-2192. The INTR_E bit indicates if an interrupt is
pending. The INTA pin is asserted under the following conditions:
• The function’s INTRM master interrupt/wakeup mask bit is 1
• The function’s INTRE interrupt pending bit is 1
INTRE is set when any of the conditions occurs which would cause INTA to
be asserted in PCI systems, according to the settings in the PCI Interrupt
Register. All three functions are controlled by the same interrupt-detect
signal. Additionally, writing a 1 to the INTRF bit in a function’s Function
Event Force register sets that function’s INTRE bit and, if the correspond-
ing INTRM bit is set, the INTA pin is asserted. Writing INTRF directly is the
only way for an individual function to set its INTRE bit and hence signal an
interrupt independently of the other functions.
! The four Function Event Registers for each function are pointed to
by a data structure in CIS (Card Information Services) RAM, which
must be initialized by the DSP from ROM at power-up. A
CISTPL_CONFIG_CB CIS tuple must be provided for each function to
point to the function event registers in BAR1 at the appropriate off-
set:
Reserved
GWKE
INTE
3:0 Reserved
14:5 Reserved
Reserved
WKUP
INTM
PWM
BAM
Table B-13. CB_FEM0 Register Bit Descriptions
Bit Position Bit Name Description
3:0 Reserved
5 Reserved
6 Reserved
13:7 Reserved
Reserved
GWAKE
INTR
3:0 Reserved
14:5 Reserved
Reserved
GWKF
INTF
3:0 Reserved
14:5 Reserved
EYE-BOX
Reserved
ACWE
BCOE
BCEN
ARPD
LKEN
AGPE
SYEN
AFD
AFR
AFS
AC’97 Link Status Register (AC97STAT)
The following illustration shows the AC’97 Link Status Register Bit
Definitions
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
BGS[3:1]
AGI[2:0]
Reserved
ACR[2:0]
BCOK
LCOK
SYNC
REG
Reserved
ACSE10
ACSE11
ACSE3
ACSE12
ACSE4
ACSE5
ACSE6
ACSE7
ACSE8
ACSE9
! The bits in the ACSE register reset to zero.
AC’97 Input Slot Valid Register (AC97SVAL)
The numbers indicated after the bit name (ACSV12, for example) indicate
the relative slot number. Slots are numbered in increasing order (0 first),
and bits are numbered in decreasing order (MSB first).
ACSV11
ACSV12
ACSV1
ACSV3
ACSV2
ACSV4
ACSV5
ACSV6
ACSV7
ACSV8
ACSV9
ACR
ACRQ10
ACRQ11
ACRQ12
Reserved
Reserved
ACRQ3
ACRQ4
ACRQ5
ACRQ6
ACRQ7
ACRQ8
ACRQ9
AGS14
AGS12
AGS13
AGS11
AGS10
AGS5
AGS4
AGS2
AGS9
AGS8
AGS7
AGS6
AGS3
AGS1
AGS0
INTMODE
Reserved
SGDEN
LP EN
SGVL
EOL
FLG
PCI Interrupt, Control Registers
Use the PCI registers to access the PCI DSP interface.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Word Count
DSP2/DSP1
Flush FIFO
Reserved
PACK DIS
DMA EN
<2:0>
WR/RD
EMPTY
LOOP
HALT
15:11 Reserved
MBox 1 OUT
MBox 0 OUT
MBox 1 IN
MBox 0 IN
TX1 DMA
TX0 DMA
RX1 DMA
RX0 DMA
Reserved
Reserved
Reserved
Reserved
Master
AC’97
Target
GPIO
Abort
Abort
0 Reserved
9 Reserved
10 Reserved Reserved
15 Reserved
D2PM1 IENE
P2DM1 IEN
P2DM0 IEN
D2PM0 IEN
MAbort IEN
TAbort IEN
Reserved
AC’97 IEN
GPIO INE
Conf Rdy
Reserved
Reserved
Reserved
PCIF1
PCIF0
Table B-24. PCI_CFGCTL Register Bit Descriptions
Bit Bit name Description
position
4:3 Reserved
9 Reserved
10 Reserved Reserved
15 Reserved
Each function contains four base address registers that access ADSP-2192
control registers and DSP memory. Base address register (BAR1) accesses
the ADSP-2192 control registers. Accesses to the control registers via
BAR1 use PCI memory accesses. BAR1 requests a memory allocation of
1024 bytes. Access to DSP memory occurs via BAR2 and BAR3. BAR2 is
accesses 24-bit DSP memory (i.e. for DSP program downloading) and
BAR3 accesses 16-bit DSP memory. BAR4 provides I/O space access to
both the control registers and the DSP memory.
The configuration space headers are defined by Function 0 (register infor-
mation shown in Table B-28 on page B-60), Function 1 (register
information shown in Table B-29 on page B-63), and Function 2 (register
information shown in Table B-30 on page B-65).
Each function is defined by writing to the class code register of that func-
tion during bootup. Additionally, during boot time, the DSP will have the
possibility of disabling one or more of the functions. If only two functions
are enabled, they will be functions zero and one. If only one function is
enabled, it will be function zero.
! Access to these registers is controlled by the PCI RDY bit in the PCI
Interrupt Control Register (Page 0x08, Address 0xA2). See
“General-purpose I/O (GPIO) Control Registers” on page B-24.
0x0B-0x09 Class Code 0x078000 Writable from the DSP during initial-
ization
0x13-0x10 Base Address 1 0x08 Register Access for all ADSP-2192 Reg-
isters, Prefetchable Memory
0x1F-0x1C Base Address 4 0x01 I/O access for control registers and DSP
memory
0x2B-0x28 Cardbus CIS Pointer 0x1FF03 CIS RAM Pointer - Function 0 (Read
Only).
0x2D-0x2C Subsystem Vendor ID 0x11D4 Writable from the DSP during initial-
ization
0x2F-0x2E Subsystem Device ID 0x2192 Writable from the DSP during initial-
ization
0x43-0x42 Power Management 0x6C22 Writable from the DSP during initial-
Capabilities ization
0x0B-0x09 Class Code 0x078000 Writable from the DSP during initial-
ization
0x13-0x10 Base Address 1 0x08 Register Access for all ADSP-2192 Reg-
isters, Prefetchable Memory
0x1F-0x1C Base Address 4 0x01 I/O access for control registers and DSP
memory
0x2B-0x28 Cardbus CIS Pointer 0x1FE03 CIS RAM Pointer - Function 1 (Read
Only).
0x43-0x42 Power Management 0x6C22 Writable from the DSP during initial-
Capabilities ization
0x0B-0x09 Class Code 0x040100 Writable from the DSP during initial-
ization
0x13-0x10 Base Address 1 0x08 Register Access for all ADSP-2192 Reg-
isters, Prefetchable Memory
0x1F-0x1C Base Address 4 0x01 I/O access for control registers and DSP
memory
0x2B-0x28 Cardbus CIS Pointer 0x1FD03 CIS RAM Pointer - Function 2 (Read
Only).
0x2D-0x2C Subsystem Vendor ID 0x11D4 Writable from the DSP during initial-
ization
0x2F-0x2E Subsystem Device ID 0x219E Writable from the DSP during initial-
ization
0x43-0x42 Power Management 0x6C22 Writable from the DSP during initial-
Capabilities ization
Name Comments
Parity Error Response 6 If any function has the bit set, PERR
may be asserted
Name Comments
Reserved 6 Read-only
Detected Parity Error 15 Separate for each function, but set in all
functions simultaneously
Name Comments
Revision ID Read-only
Min_Gnt Read-only
Max_Lat Read-only
Name Comments
Capability ID Read-only
Next_Cap_Ptr Read-only
Reserved 4 Read-only
D1 Support 9 Read-only
D2 Support 10 Read-only
Power Manage- Power State 1-0 Part will be in highest power state of the
ment Control/ three functions
Status Bits
Name Comments
Overview
The USB registers control the USB interface, specifically the operation
and configuration of the USB Interface. Most of these registers are accessi-
ble only via the USB Bus, although a subset is accessible to the DSP.
The ADSP-2192 USB allows you to configure and attach a single device
with multiple interfaces and various endpoint configurations. The advan-
tages to this design are:
• Programmable descriptors and class specific command interpreter.
An MCU is supported on board, which allows you to soft download
different configurations and support any number of standard or
class specific commands.
• Eight user defined endpoints are provided. Endpoints can be con-
figured as either BULK, ISO, or INT and can be grouped and assigned
to any interface.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
X X X X X X X X X X X X X X DS BA
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
BA BA BA BA BA BA BA BA BA BA BA BA BA BA BA BA
Points to the base address for the DSP memory buffer assigned to this
Endpoint.
DS DSP Memory select bit. 0 = DSP1 memory space, 1 = DSP2 memory space
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
SZ SZ SZ SZ SZ SZ SZ SZ SZ SZ SZ SZ SZ SZ SZ SZ
Indicates the size of the DSP memory buffer assigned to this Endpoint.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
RD RD RD RD RD RD RD RD RD RD RD RD RD RD RD RD
The offset from the base address for the read pointer of the memory buffer
assigned to this Endpoint.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
WR WR WR WR WR WR WR WR WR WR WR WR WR WR WR WR
The offset from the base address for the write pointer of the memory
buffer assigned to this Endpoint.
0x1XXX Defines registers that are specific to Endpoint setup and control
0x2XXX Defines the registers used for REGIO accesses to the DSP register space
0x1040-0x1043 USB EP1 Code Download Starting address for code download on End-
Base Address point 1
0x1044-0x1047 USB EP2 Code Download Starting address for code download on End-
Base Address point 2
0x1048-0x104B USB EP3 Code Download Starting address for code download on End-
Base Address point 3
0x1060-0x1063 USB EP1 Code Current Current write pointer offset for code down-
Write Pointer Offset load on Endpoint 1
0x1064-0x1067 USB EP2 Code Current Current write pointer offset for code down-
Write Pointer Offset load on Endpoint 2
0x1068-0x106B USB EP3 Code Current Current write pointer offset for code down-
Write Pointer Offset load on Endpoint 3
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
TB LT LT TY TY DR PS PS PS PS PS PS PS PS PS PS
Provides the USB core with information about the Endpoint type, direc-
tion, and maximum packet size. This register is read/write by the MCU
only. This register is defined for Endpoints[4:11].
TB Toggle bit for Endpoint. Reflects the current state of the DATA toggle bit.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
X X X X X X X X X X NE ST NC NC NC NC
Contains the individual NAK count, stall control, and NAK counter enable
bits for Endpoints 4-11. This register is read/write by the MCU only.
NC[3:0] NAK counter. Number of sequential NAKs that have occurred on a given Endpoint.
When N[3:0] is equal to the base NAK counter NK[3:0] value in the Endpoint Stall
Policy register, a zero-length packet or packet less than maxpacketsize will be issued.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Contains the base NAK count and FIFO error policy bits for Endpoints
4-11. The STALL status and Data toggle bits for Endpoints 1-3 are
included as well. This register is read/write by the MCU only.
ST[3:1] A value of 1 means the Endpoint is stalled. ST[1] maps to Endpoint 1, ST[2] maps
to Endpoint 2, etc.
TB[3:1] Toggle bit for Endpoint. Reflects the current state of the DATA toggle bit. ST[1]
maps to Endpoint 1, ST[2] maps to Endpoint 2, etc.
NK[3:0] Base NAK counter. Determines how many sequential NAKs are issued before send-
ing zero length packet, or a packet less than the maximum packet size, on any given
Endpoint.
LSW
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
AD AD AD AD AD AD AD AD AD AD AD AD AD AD AD AD
MSW
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
X X X X X X X X X X X X X X DS AD
LSW
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
AD AD AD AD AD AD AD AD AD AD AD AD AD AD AD AD
MSW
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
X X X X X X X X X X X X X X DS AD
LSW
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
AD AD AD AD AD AD AD AD AD AD AD AD AD AD AD AD
MSW
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
X X X X X X X X X X X X X X DS AD
LSW
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
AD AD AD AD AD AD AD AD AD AD AD AD AD AD AD AD
MSW
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
X X X X X X X X X X X X X X AD AD
LSW
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
AD AD AD AD AD AD AD AD AD AD AD AD AD AD AD AD
MSW
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
X X X X X X X X X X X X X X AD AD
LSW
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
AD AD AD AD AD AD AD AD AD AD AD AD AD AD AD AD
MSW
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
X X X X X X X X X X X X X X AD AD
Byte 7 0
0 bmRequest
1 b Request
2 w Value (L)
3 w Value (H)
4 w Index (L)
5 w Index (H)
6 w Length (L)
7 w Length(H)
Byte 7 0
0 Data 0
1 Data 1
2 Data 2
3 Data 3
4 Data 4
5 Data 5
6 Data 6
7 Data 7
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
X X X X X X X X X X X X C3 C2 C1 C0
The counter hardware is a modulo 4 bit down counter used for tallying
data bytes in both the IN and OUT data stages of SETUP transactions. As
such, the count value stored has different meanings.
IN Transfers: The MCU loads the counter with the number of bytes to transfer (must be 8
or less since the USB Setup Token Data Register file is 8 bytes maximum).
The USB interface then decrements the count value after each byte is trans-
ferred to the host.
OUT Transfers: Starting from a cleared value of 0, the counter is decremented with each byte
received from the host, including the two CRC bytes. For example, if 8 bytes
are received, the count value progresses from 15, 14, 13, etc. to a value of 6
(inclusive is the 2 CRC bytes). The MCU reads the value and subtracts it
from 14 to determine the actual number of data bytes in the USB Setup
Token Register file (14 - 6 = 8 bytes).
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
A[15] MCU sets to 1 to notify the PDC Register Interface block to start ADSP-2192
read/write cycle. PDC Register Interface block clears to 0 to notify MCU the
read/write cycle has completed.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Contains the data of the ADSP-2192 register which has been read or is to
be written. This register is read/write by the MCU only.
D[15:0] During READ this register contains the data read from the ADSP-2192, during
WRITE this register is the data to be written to the ADSP-2192
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
MO A value of 1 means: MCU has completed boot sequence and is ready to respond to
USB commands
DI A value of 1 means: Disconnect CONFIG device and enumerate again using the
downloaded MCU configuration
BB A value of 1 means: After reset boot from MCU RAM, 0 = after reset boot from
MCU ROM
IIN Current interrupt is for an IN token sent with a non zero length data stage
IOU Current interrupt is for an OUT token received with a non zero length data stage
BY Busy bit. A value of 1 means: MCU is busy processing a command. USB interface
responds with NAK to further IN/OUT requests from the host until MCU clears this
bit.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Contains the USB address and active Endpoint. This register is read/write
by the MCU only.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
X X X X FN1 FN9 FN8 FN7 FN6 FN5 FN4 FN3 FN2 FN1 FN1 FN0
Contains the last USB frame number. This register is read by the MCU
only.
-------------------------------------------------------------
*/
#ifndef __DEF2192_12_H_
#define __DEF2192_12_H_
//-----------------------------------------------------------
// System Register bit definitions
//-----------------------------------------------------------
//**************************************************
// IRPTL and IMASK registers
//**************************************************
// Bit Positions
#define INT_MAILBXI_P 4 // Bit 4: Offset: 10: Mailbox
#define INT_TMZHI_P 5 // Bit 5: Offset: 14: Timer (High
Priority)
#define INT_INT6_P 6 // Bit 6: Offset: 18: Unused
#define INT_PCIBMI_P 7 // Bit 7: Offset: 1c: PCI
#define INT_DSPDSPI_P 8 // Bit 8: Offset: 20: DSP
#define INT_FIFO0TXI_P 9 // Bit 9: Offset: 24: FIFO 0 Transmit
Empty
// Bit Masks
#define INT_MAILBXI MK_BMSK_(INT_MAILBXI_P) // Offset: 10:
Mailbox
#define INT_TMZHI MK_BMSK_(INT_TMZHI_P) // Offset: 14: Timer
// (High Priority)
#define INT_INT6 MK_BMSK_(INT_INT6_P) // Offset: 18: Unused
#define INT_PCIBMI MK_BMSK_(INT_PCIBMI_P) // Offset: 1c: PCI
#define INT_DSPDSPI MK_BMSK_(INT_DSPDSPI_P) // Offset: 20: DSP
#define INT_FIFO0TXI MK_BMSK_(INT_FIFO0TXI_P) // Offset: 24:
// FIFO 0 Transmit Empty
#define INT_FIFO0RXI MK_BMSK_(INT_FIFO0RXI_P) // Offset: 28:
// FIFO 0 Receive Full
#define INT_FIFO1TXI MK_BMSK_(INT_FIFO1TXI_P) // Offset: 2c:
// FIFO 1 Transmit Empty
#define INT_FIFO1RXI MK_BMSK_(INT_FIFO1RXI_P) // Offset: 30:
// FIFO 1 Receive Full
#define INT_INT13 MK_BMSK_(INT_INT13_P) // Offset: 34: Unused
#define INT_INT14 MK_BMSK_(INT_INT14_P) // Offset: 38: Unused
#define INT_AC97FR MK_BMSK_(INT_AC97FR_P) // Offset: 3c: AC97
serial port
//**************************************************
// SRCTLx and STCTLx registers
//**************************************************
// Bit Positions
#define SCTL_SPEN_P 0 // AC'97 FIFO
Connection Enable
#define SCTL_SSEL3_P 7 // AC'97 Slot Select
#define SCTL_SSEL2_P 6 // AC'97 Slot Select
#define SCTL_SSEL1_P 5 // AC'97 Slot Select
#define SCTL_SSEL0_P 4 // AC'97 Slot Select
#define SCTL_FIP2_P 10 // AC'97 FIFO
Interrupt Position
// Bit Masks
#define SCTL_SPEN MK_BMSK_(SCTL_SPEN_P) // AC'97 FIFO
Connection Enable
#define SCTL_SSEL3 MK_BMSK_(SCTL_SSEL3_P) // AC'97 Slot Select
#define SCTL_SSEL2 MK_BMSK_(SCTL_SSEL2_P) // AC'97 Slot Select
#define SCTL_SSEL1 MK_BMSK_(SCTL_SSEL1_P) // AC'97 Slot Select
#define SCTL_SSEL0 MK_BMSK_(SCTL_SSEL0_P) // AC'97 Slot Select
#define SCTL_FIP2 MK_BMSK_(SCTL_FIP2_P ) // AC'97 FIFO
Interrupt Position
#define SCTL_FIP1 MK_BMSK_(SCTL_FIP1_P ) // AC'97 FIFO
Interrupt Position
#define SCTL_FIP0 MK_BMSK_(SCTL_FIP0_P ) // AC'97 FIFO
Interrupt Position
#define SCTL_SDEN MK_BMSK_(SCTL_SDEN_P ) // AC'97 Port DMA
Enable
#define SCTL_FULL MK_BMSK_(SCTL_FULL_P ) // FIFO Full,
read-only
#define SCTL_EMPTY MK_BMSK_(SCTL_EMPTY_P) // FIFO Empty,
read-only
#define SCTL_FLOW MK_BMSK_(SCTL_FLOW_P ) // FIFO
Over/Underflow, sticky,
// write-one-clear
//-----------------------------------------------------------
-----------
// I/O Processor Register Map
//-----------------------------------------------------------
-----------
//**************************************************
// SYSCON register
//**************************************************
// Bit Positions
#define SCON_PCIRST_P 15 // PCI Reset
#define SCON_VAUX_P 14 // Vaux Present
#define SCON_PCI_5V_P 13 // PCI 5V level
#define SCON_BUS1_P 11 // Bus Mode
#define SCON_BUS0_P 10 // Bus Mode
#define SCON_CRST1_P 9 // Chip Reset Source
#define SCON_CRST0_P 8 // Chip Reset Source
#define SCON_REGD_P 7 // 2.5V Regulator Control Disable
#define SCON_VXPD_P 6 // Vaux Policy for AC'97 Pad Drivers
#define SCON_VXPW_P 5 // Vaux Policy for AC'97 Pad Well Bias
#define SCON_ACVX_P 4 // AC'97 External Devices Vaux Powered
#define SCON_XON_P 3 // XTAL Force On
#define SCON_RDIS_P 2 // Reset Disable
#define SCON_RST_P 0 // Soft Chip Reset
// Bit Masks
#define SCON_PCIRST MK_BMSK_(SCON_PCIRST_P) // PCI Reset
#define SCON_VAUX MK_BMSK_(SCON_VAUX_P ) // Vaux Present
#define SCON_PCI_5V MK_BMSK_(SCON_PCI_5V_P) // PCI 5V level
#define SCON_BUS1 MK_BMSK_(SCON_BUS1_P ) // Bus Mode
#define SCON_BUS0 MK_BMSK_(SCON_BUS0_P ) // Bus Mode
#define SCON_CRST1 MK_BMSK_(SCON_CRST1_P ) // Chip Reset
Source
#define SCON_CRST0 MK_BMSK_(SCON_CRST0_P ) // Chip Reset
Source
#define SCON_REGD MK_BMSK_(SCON_REGD_P ) // 2.5V Regulator
// Control Disable
#define SCON_VXPD MK_BMSK_(SCON_VXPD_P) // Vaux Policy for
AC'97
// Pad Drivers
//**************************************************
// PWRPx register
//**************************************************
// Bit Positions
#define PWRP_AINT_P 13 // DSP Interrupt Pending from AC'97
Input
#define PWRP_PMINT_P 12 // Power Management Interrupt Pending
#define PWRP_GIEN_P 10 // DSP Interrupt Enable for GPIO Input
#define PWRP_GWE_P 6 // DSP Wake up on GPIO Input Enable
#define PWRP_PMWE_P 4 // Power Management Wake up Enable
#define PWRP_RSTD_P 2 // DSP Soft Reset
#define PWRP_PU_P 1 // DSP Power Up
#define PWRP_PD_P 0 // DSP Power Down
// Bit Masks
#define PWRP_AINT MK_BMSK_(PWRP_AINT_P) // DSP Interrupt
Pending
// from AC'97 Input
#define PWRP_PMINT MK_BMSK_(PWRP_PMINT_P) // Power
Management
// Interrupt Pending
#define PWRP_GIEN MK_BMSK_(PWRP_GIEN_P) // DSP Interrupt
Enable
// for GPIO Input
#define PWRP_GWE MK_BMSK_(PWRP_GWE_P ) // DSP Wake up
on GPIO
// Input Enable
#define PWRP_PMWE MK_BMSK_(PWRP_PMWE_P ) // Power
Management
// Wake up Enable
#define PWRP_RSTD MK_BMSK_(PWRP_RSTD_P ) // DSP Soft Reset
#define PWRP_PU MK_BMSK_(PWRP_PU_P ) // DSP Power Up
#define PWRP_PD MK_BMSK_(PWRP_PD_P ) // DSP Power Down
//**************************************************
// PLLCTL register
//**************************************************
// Bit Positions
#define PLLC_DPLLN1_P 11 // DSP PLL N
Divisor Selects
#define PLLC_DPLLN0_P 10 // DSP PLL N
Divisor Selects
#define PLLC_DPLLK1_P 9 // DSP PLL K
Divisor Selects
#define PLLC_DPLLK0_P 8 // DSP PLL K
Divisor Selects
#define PLLC_DPLLM3_P 7 // DSP PLL M
Divisor Selects
#define PLLC_DPLLM2_P 6 // DSP PLL M
Divisor Selects
#define PLLC_DPLLM1_P 5 // DSP PLL M
Divisor Selects
#define PLLC_DPLLM0_P 4 // DSP PLL M
Divisor Selects
#define PLLC_DADJ_P 0 // DSP PLL Adjust
// Bit Masks
#define PLLC_DPLLN1 MK_BMSK_(PLLC_DPLLN1_P) // DSP PLL N
Divisor Selects
#define PLLC_DPLLN0 MK_BMSK_(PLLC_DPLLN0_P) // DSP PLL N
Divisor Selects
#define PLLC_DPLLK1 MK_BMSK_(PLLC_DPLLK1_P) // DSP PLL K
Divisor Selects
#define PLLC_DPLLK0 MK_BMSK_(PLLC_DPLLK0_P) // DSP PLL K
Divisor Selects
#define PLLC_DPLLM3 MK_BMSK_(PLLC_DPLLM3_P) // DSP PLL M
Divisor Selects
#define PLLC_DPLLM2 MK_BMSK_(PLLC_DPLLM2_P) // DSP PLL M
Divisor Selects
#define PLLC_DPLLM1 MK_BMSK_(PLLC_DPLLM1_P) // DSP PLL M
Divisor Selects
#define PLLC_DPLLM0 MK_BMSK_(PLLC_DPLLM0_P) // DSP PLL M
Divisor Selects
#define PLLC_DADJ MK_BMSK_(PLLC_DADJ_P) // DSP PLL Adjust
//**************************************************
// PWRCFGx register
//**************************************************
// Bit Positions
#define PWRC_SPME_P 14 // Power Management Event Set
#define PWRC_GPME_P 6 // GPIO Power Management Event Enable
#define PWRC_PWRST1_P 1 // PCI Function Power State
#define PWRC_PWRST0_P 0 // PCI Function Power State
// Bit Masks
#define PWRC_SPME MK_BMSK_(PWRC_SPME_P) // DSP PLL N Divisor
Selects
#define PWRC_GPME MK_BMSK_(PWRC_GPME_P) // DSP PLL N Divisor
Selects
#define PWRC_PWRST1 MK_BMSK_(PWRC_PWRST1_P) // DSP PLL K
Divisor Selects
#define PWRC_PWRST0 MK_BMSK_(PWRC_PWRST0_P) // DSP PLL K
Divisor Selects
//-----------------------------------------------------------
-----------
// System Register address definitions
//-----------------------------------------------------------
-----------
#endif
Overview
ADSP-219x family processors support 16-bit fixed-point data in hard-
ware. Special features in the computation units allow you to support other
formats in software. This appendix describes various aspects of the 16-bit
data format. It also describes how to implement a block floating-point
format in software.
Integer or Fractional
The ADSP-219x family supports both fractional and integer data formats.
In an integer, the radix point is assumed to lie to the right of the LSB, so
that all magnitude bits have a weight of 1 or greater. This format is shown
in Figure C-1, which can be found on the following page. Note that in
twos-complement format, the sign bit has a negative weight.
Bit 15 14 13 2 1 0
15 14 13 2 1 0
W eight –(2 ) 2 2 • • • 2 2 2
Sign
Bit
Signed Integer Radix
Point
Bit 15 14 13 2 1 0
15 14 13 2 1 0
W eight 2 2 2 • • • 2 2 2
In a fractional format, the assumed radix point lies within the number, so
that some or all of the magnitude bits have a weight of less than 1. In the
format shown in Figure C-2 on page C-3, the assumed radix point lies to
the left of the 3 LSBs, and the bits have the weights indicated.
The notation used to describe a format consists of two numbers separated
by a period (.); the first number is the number of bits to the left of radix
point, the second is the number of bits to the right of the radix point. For
example, 16.0 format is an integer format; all bits lie to the left of the
radix point. The format in Figure C-2 is 13.3.
Bit 15 14 13 4 3 2 1 0
12 11 10 1 0 –1 –2 –3
Weight –(2 ) 2 2 • • • 2 2 2 2 2
Sign
Bit
Signed Fractional (13.3)
Radix
Point
Bit 15 14 13 4 3 2 1 0
12 11 10 1 0 –1 –2 –3
Weight 2 2 2 • • • 2 2 2 2 2
Table C-1 shows the ranges of numbers representable in the fractional for-
mats that are possible with 16 bits.
Binary Multiplication
In addition and subtraction, both operands must be in the same format
(signed or unsigned, radix point in the same location) and the result for-
mat must be the same as the input format. Addition and subtraction are
performed the same way whether the inputs are signed or unsigned.
In multiplication, however, the inputs can have different formats, and the
result depends on their formats. The ADSP-219x family assembly lan-
guage allows you to specify whether the inputs are both signed, both
unsigned, or one of each (mixed-mode). The location of the radix point in
the result can be derived from its location in each of the inputs.
Figure C-3 illustrates this point. The product of two 16-bit numbers is a
32-bit number. If the inputs’ formats are M.N and P.Q, the product has
the format (M+P).(N+Q). For example, the product of two 13.3 numbers
is a 26.6 number. The product of two 1.15 numbers is a 2.30 number.
Sign Bit
Figure C-5 on page C-8 shows the data after processing but before adjust-
ment. The block floating-point adjustment is performed as follows.
Initially, the value of SB is –2, corresponding to the two guard bits. Dur-
ing processing, each resulting data value is inspected by the EXPADJ
instruction, which counts the number of redundant sign bits and adjusts
SB as if the number of redundant sign bits is less than 2. In this example,
SB=–1 after processing, which indicates that the block of data must be
shifted right one bit to maintain the two guard bits. If SB were 0 after pro-
cessing, the block would have to be shifted two bits right. In either case,
the block exponent is updated to reflect the shift.
1. Check for Bit Growth
Sign Bit
2 Guard Bits
Sign Bit
Overview
The programmable interval timer can generate periodic interrupts based
on multiples of the processor’s cycle time. When enabled, a 16-bit count
register is decremented every n cycles, where n-1 is a scaling value stored
in a 16-bit register. When the value of the count register reaches zero, an
interrupt is generated and the count register is reloaded from a 16-bit
period register (TPERIOD).
The scaling feature of the timer allows the 16-bit counter to generate peri-
odic interrupts over a wide range of periods. Given a processor cycle time
of 6.25 ns, the timer can generate interrupts with periods of 6.25 ns up to
0.4 ms with a zero scale value. When scaling is used, time periods can
range up to 26.875 seconds.
Timer interrupts can be masked, cleared and forced in software if desired.
For additional information, refer to “Interrupts and Sequencing” on
page 3-24.
Timer Architecture
The timer includes four 16-bit registers: TCOUNT, TPERIOD, TSCALE, and
TSCLCNT. The extended Mode Control instruction enables and disables the
timer by setting and clearing bit 5 in the Mode Status register, MSTAT. For
a description of the Mode Control instructions, refer to the ADSP-219x
DSP Instruction Set Reference. The timer registers, which reside in the core
register space of each core, are shown in Figure D-1.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
D M D B us 16
16 16
16 1
6
TS C A LE TP E R IO D
DSP
C LO C K
Tim er
Interrupt
Resolution
TSCALE provides the capability to program longer time intervals between
interrupts, extending the range of the 16-bit TCOUNT register. Table D-1
shows the range and the relationship between period length and resolution
for TPERIOD = maximum (65536).
Timer Operation
Table D-2 shows the effect of operating the timer with TPERIOD=5,
TSCALE=1 and TCOUNT=5. After the timer is enabled (cycle n–1) the counter
begins. Because TSCALE is 1, TCOUNT is decremented on every other cycle.
The reloading of TCOUNT and continuation of the counting occurs, as
shown, during the interrupt service routine.
Table D-2. Example Of Timer Operation
n+2 4 No decrement
n+4 3 No decrement
n+6 2 No decrement
n+8 1 No decrement
n+10 0 No decrement
n+12 5 No decrement
n+14 4 No decrement
Listing D-1. Code for Enabling the Timer and Generating Interrupts
// init timer
ay0 = 0xf000;
ay1 = 0x0200;
reg(0x30) = ay0; // set tperiod
reg(0x32) = ay1; // set tscale
Overview
The DSP has two core-to-core flags to control interrupts between the two
DSPs. The interrupt controller lets the DSP respond to thirteen interrupts
with minimum overhead. The controller implements an interrupt priority
scheme as shown in Table E-1 on page E-1. Applications can use the unas-
signed slots for software and peripheral interrupts. The DSP’s Interrupt
Control (ICNTL) register (shown in Table E-2 on page E-3) provides con-
trols for global interrupt enable, stack interrupt configuration, and
interrupt nesting.
Peripheral Interrupts
Table E-1 shows the interrupt vector and DSP-DSP semaphores of each of
the peripheral interrupts at reset. (For information about DSP-DSP sema-
phores, see “Using Dual-DSP Interrupts and Flags” on page 6-13.) The
peripheral interrupt’s position in the IMASK and IRPTL register and its vec-
tor address depend on its priority level, as shown in Table E-1.
4 5 Mailbox 0x10
5 6 Timer 0x14
8 9 DSP-DSP 0x20
13 14 Reserved 0x34
14 15 Reserved 0x38
1 The interrupt vector address values are represented as offsets from address
0x01 0000. This address corresponds to the start of Program Memory in DSP
P0 and P1.
Interrupt routines can either be nested with higher priority interrupts tak-
ing precedence or they can be processed sequentially. Interrupts can be
masked or unmasked with the IMASK register. Individual interrupt requests
are logically ANDed with the bits in IMASK; the highest priority unmasked
interrupt is then selected. The emulation, power down, and reset inter-
rupts are nonmaskable with the IMASK register, but software can use the
DIS INT instruction to mask the power down interrupt.
Bit Description
0–3 Reserved
6 Reserved
8–9 Reserved
13–15 Reserved
The IRPTL register is used to force and clear interrupts. On-chip stacks
preserve the processor status and are automatically maintained during
interrupt handling. To support interrupt, loop, and subroutine nesting,
the PC stack is 33 levels deep, the loop stack is eight-levels deep, and the
status stack is 16 levels deep. To prevent stack overflow, the PC stack can
generate a stack level interrupt if the PC stack falls below 3 locations full
or rises above 28 locations full.
The following instructions globally enable or disable interrupt servicing,
regardless of the state of IMASK.
Ena Int;
Dis Int;
Interrupts to the DSP can also be generated by DMA (in regular or scat-
ter-gather modes), by PCI, when some words have been received in the
input FIFOs, or when the Transmit FIFOs are empty. Internal interrupts,
including serial EEPROM port, PCI, USB, AC’97, Sub-ISA, timer, and
DMA interrupts, are discussed elsewhere in this book. (“Host (PCI/USB)
Port” on page 8-1 discusses USB, PCI, Sub-ISA, serial EEPROM, and
DMA; “AC’97 Codec Port” on page 9-1 discusses the AC’97 interface.)
Additional information about interrupt masking, set up, and operation
can be found in “Interrupts and Sequencing” on page 3-24.
Terms
Arithmetic Logic Unit (ALU). This part of a processing element performs
arithmetic and logic operations on fixed-point data.
Asynchronous transfers. Asynchronous host accesses of the DSP. After
acquiring control of the DSP's external bus, the host must assert the CS
pin of the DSP it wants to access.
Base address. The starting address of a circular buffer to which the DAG
wraps around. This address is stored in a DAG Bx register.
Base registers. A base (Bx) register is a Data Address Generator (DAG)
register that sets up the starting address for a circular buffer.
Bit-reverse addressing. The Data Address Generator (DAG) provides a
bit-reversed address during a data move without reversing the stored
address.
Circular buffer addressing. The DAG uses the Ix, Mx, Lx, and Bx register
settings to constrain addressing to a range of addresses. This range con-
tains data that the DAG steps through repeatedly, “wrapping around” to
repeat stepping through the range of addresses in a circular pattern.
Companding (compressing/expanding). This is the process of logarithmi-
cally encoding and decoding data to minimize the number of bits that
must be sent.
Conditional branches. These are Jump or Call/return instructions whose
execution is based on testing an If condition.
JTAG port. This port supports the IEEE standard Joint Test Action
Group (JTAG) standard for system test. This standard defines a method
for serially scanning the I/O status of each component in a system. Note
that the ADSP-2192 does not support boundary scan.
Jumps. Program flow transfers permanently to another part of program
memory.
Length registers. A length register is a Data Address Generator (DAG)
register that sets up the range of addresses a circular buffer.
Level-sensitive interrupts. The DSP detects this type of interrupt if the
signal input is low (active) when sampled on the rising edge of XTALI.
Loops. One sequence of instructions executes several times with zero
overhead.
Memory blocks. The DSP’s internal memory is divided into blocks that
are each associated with different data address generators.
Modified addressing. The DAG generates an address that is incremented
by a value or a register.
Modify address. The Data Address Generator (DAG) increments the
stored address without performing a data move.
Modify registers. A modify register is a Data Address Generator (DAG)
register that provides the increment or step size by which an index register
is pre- or post-modified during a register move.
Multifunction computations. Using the many parallel data paths within
its computational units, the DSP supports parallel execution of multiple
computational instructions. These instructions complete in a single cycle,
and they combine parallel operation of the computational units and mem-
ory accesses. The multiple operations perform the same as if they were in
corresponding single-function computations.
Z
V
Zero, ALU (AZ) bit A-9
Vaux bit B-17