Summary of Contents for Analog Devices SHARC ADSP-21368
Page 1
ADSP-21368 SHARC Processor ® Hardware Reference Includes ADSP-21367, ADSP-21369, ADSP-21371, ADSP-21375 Revision 1.0, September 2006 Part Number 82-000100-01 Analog Devices, Inc. One Technology Way Norwood, Mass. 02062-9106...
Page 2
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.
CONTENTS PREFACE Purpose of This Manual ............... xxxi Intended Audience ............... xxxi Manual Contents ................ xxxii What’s New in This Manual ............xxxiv Technical or Customer Support ........... xxxv Supported Processors ..............xxxvi Product Information ..............xxxvi MyAnalog.com ..............xxxvii Processor Product Information ..........
Page 4
Contents Processor Peripherals ............... 1-7 I/O Processor ..............1-7 Digital Audio Interface (DAI) ..........1-9 Digital Peripheral Interface (DPI) ........1-10 Development Tools ..............1-10 Differences From Previous Processors .......... 1-11 I/O Architecture Enhancements ..........1-11 Instruction Set Enhancements ..........1-12 I/O PROCESSOR General Procedure for Configuring DMA ........
Page 5
Contents Port, Buffer, and DMA Control Registers ....... 2-26 Addressing ................2-29 External Port DMA ..............2-35 Setting Up and Starting Chained DMA ........2-36 Delay Line DMA ..............2-38 Serial Port DMA ................. 2-40 Setting Up and Starting Chained DMA ........2-40 Inserting a TCB in an Active Chain ........
Page 6
Contents EMI Registers and Signals ............. 3-16 External Port Arbitration Logic ......... 3-18 Channel Freezing .............. 3-18 Managing Data Paths ............3-18 External Memory Interface Pins ..........3-19 Asynchronous Memory Interface ..........3-20 AMI Timing Control ..............3-21 Wait States ................3-21 Bus Idle Cycles ..............
Page 7
Contents SDRAM Control Status Register (SDSTAT) ......3-49 SDRAM Refresh Rate Control Register (SDRRC) ....3-49 SDRAM Initialization ............3-51 SDRAM Address Mapping ............ 3-51 SDRAM Controller Address Mapping ....... 3-58 SDC Operation ..............3-58 Single Bank Operation ............3-60 Multibank Operation (ADSP-2137x Processors) ....
Page 8
Contents SDRAM Timing ..............3-74 SDRAM Read Optimization ..........3-75 External Memory Access Restrictions ........ 3-78 Shared Memory Interface ............3-79 Shared Memory Bus Arbitration ..........3-79 Bus Arbitration Protocol ........... 3-82 Bus Arbitration Priority (RPBA) ........3-86 Bus Mastership Time-out ..........3-87 Bus Synchronization After Reset ..........
Page 9
Contents Making Connections in the SRUs ..........4-15 DAI/SRU1 Connection Groups ..........4-18 Group A Connections—Clock Signals ....... 4-19 Group B Connections—Data Signals ......... 4-25 Group C Connections—Frame Sync Signals ...... 4-31 Group D Connections—Pin Signal Assignments ....4-36 Group E Connections—Interrupts and Miscellaneous Signals ................
Page 10
Contents Configuring Peripherals Using SRU1 .......... 4-71 Configuring the SPORTs ............4-71 Configuring the PCGs ............4-72 Configuring Peripherals Using SRU2 .......... 4-72 Configuring the SPI .............. 4-72 Choosing the Pin Enable for the SPI Clock ....... 4-72 Configuring the Two Wire Interface ........4-73 Using the SRU() Macro to Configure the DAI ...................
Page 11
Contents Left-Justified Sample Pair Mode Control Bits ..... 5-17 Setting Word Length (SLEN) ..........5-17 Enabling SPORT Master Mode (MSTR) ......5-18 Selecting Transmit and Receive Channel Order (FRFS) ..5-18 Selecting Frame Sync Options (DIFS) ....... 5-18 Enabling SPORT DMA (SDEN) ........5-19 I2S Mode ................
Page 12
Contents Active Low Versus Active High Frame Syncs ......5-39 Sampling Edge for Data and Frame Syncs ......5-39 Early Versus Late Frame Syncs ..........5-40 Data-Independent Frame Syncs ..........5-41 Frame Sync Error Detection ..........5-42 Data Word Formats ..............5-43 Word Length ................
Page 13
Contents SPORT Programming Examples ..........5-82 SERIAL PERIPHERAL INTERFACE PORTS Functional Description ..............6-2 SPI Interface Signals ..............6-4 SPI Clock Signal (SPICLK) ............. 6-4 SPICLK Timing ..............6-5 SPI Slave Select Input (SPIDS) ..........6-6 SPI Flag Signals (SPIFLG3-0) ..........6-6 Master Out Slave In (MOSI) ...........
Page 14
Contents DMA Error Interrupts ............6-25 DMA Chaining ..............6-27 SPI Transfer Formats ..............6-27 Beginning and Ending an SPI Transfer ........6-29 SPI Word Lengths ..............6-31 8-Bit Word Lengths .............. 6-31 16-Bit Word Lengths ............6-32 32-Bit Word Lengths ............6-32 Packing .................
Page 15
Contents Packing Mode 10 .............. 7-10 Packing Mode 01 .............. 7-11 Packing Mode 00 .............. 7-11 Clocking Edge Selection ............7-12 Hold Input ................7-12 PDAP Strobe ................. 7-14 FIFO Control and Status ............7-15 FIFO to Memory Data Transfer ........... 7-16 IDP Transfers Using the Core ..........
Page 16
Contents Switching Frequencies ............. 8-5 Dead Time ................8-6 Duty Cycles ................8-7 Duty Cycles and Dead Time ..........8-8 Over Modulation .............. 8-12 Update Modes ..............8-15 Single Update ..............8-15 Double Update ..............8-15 Configurable Polarity ............8-15 PWM Pins and Signals ............
Page 17
Contents S/PDIF Transmitter Registers ..........9-12 Modes of Operation .............. 9-12 Standalone Mode .............. 9-13 Structure of the Serial Input Data .......... 9-14 S/PDIF Receiver ................. 9-16 S/PDIF Receiver Registers ............. 9-17 SRU1 Receiver Signals ............9-18 Phase-Locked Loop ..............9-19 Channel Status Decoding ............
Page 18
Contents Status Bits ................ 9-26 Interrupted Data Streams on the Receiver ......9-27 ASYNCHRONOUS SAMPLE RATE CONVERTER Theory of Operation ..............10-2 Conceptual Model ..............10-4 Hardware Model ..............10-7 Sample Rate Converter Architecture ..........10-8 Group Delay ............... 10-12 SRC Operation .................
Page 19
Contents SRU Programming .............. 10-22 SRC Mute-Out Interrupt ............. 10-23 Sample Rate Ratio ............... 10-23 Programming Summary ............10-23 UART PORT CONTROLLER Serial Communications ............... 11-2 UART Control and Status Registers ..........11-3 UARTxLCR Registers ............11-3 UARTxLSR Register .............. 11-4 UARTxTHR Register ............
Page 20
Contents TWIDIV Register ..............12-5 Slave Mode Control Register ..........12-5 Slave Mode Address Register ..........12-6 Slave Mode Status Register ............ 12-6 Master Mode Control Register ..........12-6 Master Mode Address Register ..........12-6 Master Mode Status Register ..........12-7 FIFO Control Register ............
Page 22
Contents SYSTEM DESIGN Processor Pin Descriptions ............14-2 Pin Multiplexing ..............14-2 Choosing EP Data Mode ..........14-6 Interrupt and Timer Pins ............14-8 Core-Based Flag Pins ............. 14-8 Programming Flags ............14-9 RESETOUT/CLKOUT/RUNRSTIN ......14-12 JTAG Interface Pins ............14-12 Clock Derivation ..............
Page 23
Contents Designing for High Frequency Operation ........14-33 Clock Specifications and Jitter ..........14-33 Other Recommendations and Suggestions ......14-34 Decoupling Capacitors and Ground Planes ......14-35 Oscilloscope Probes ............. 14-35 Recommended Reading ............14-36 Booting ..................14-37 External Port Booting ............14-39 Booting Through the AMI ..........
Page 24
Contents DMA Stalls ................. 14-56 IOP Buffer Stalls ..............14-56 REGISTER REFERENCE I/O Processor Registers ..............A-2 Notes on Reading Register Drawings ........A-3 System Control Register (SYSCTL) ......... A-5 System Status Register (SYSTAT) ..........A-9 External Port Registers ..............A-10 External Port Control Register (EPCTL) .......
Page 25
Contents SPORT Compand Registers (SPxCCSy) ........ A-47 SPORT Error Control Register (SPERRCTLx) ...... A-48 SPORT Error Status Register (SPERRSTAT) ......A-49 SPORT DMA Index Registers (IISPx) ........A-50 SPORT DMA Modifier Registers (IMSPx) ......A-50 SPORT DMA Count Registers (CSPx) ......... A-51 SPORT Chain Pointer Registers (CPSPx) ......
Page 26
Contents Input Data Port Control Register 1 (IDP_CTL1) ....A-68 Input Data Port FIFO Register (IDP_FIFO) ......A-69 Input Data Port DMA Control Registers ....... A-70 IDP_DMA_Ix ..............A-70 IDP_DMA_Mx ..............A-71 IDP_DMA_Cx ..............A-71 Input Data Port Ping-Pong DMA Registers ......A-72 IDP Ping-Pong Index Registers (IDP_DMA_IxA) .....
Page 27
Contents Sony/Philips Digital Interface Registers ........A-86 Transmitter Control Register (DITCTL) ....... A-86 Left Channel Status for Subframe A Registers (DITCHANAx) ..........A-89 Right Channel Status for Subframe B Registers (DITCHANBx) ..........A-90 User Bits Buffer Registers for Subframe A Registers (DITUSRBITAx) ..........
Page 28
Contents DPI Resistor Pull-up Enable Register (DPI_PIN_PULLUP) ............A-115 DPI Pin Buffer Status Register (DPI_PIN_STAT) ....A-116 DPI Interrupt Controller Registers ........A-116 UART Control and Status Registers .......... A-118 Line Control Registers (UARTxLCR) ........A-118 Line Status Registers (UARTxLSR) ........A-120 Transmit Hold Registers (UARTxTHR) .......
Intended Audience The primary audience for this manual is a programmer who is familiar with Analog Devices processors. This manual assumes that the audience has a working knowledge of the appropriate processor architecture and instruction set. Programmers who are unfamiliar with Analog Devices...
Manual Contents Manual Contents The manual consists of: • Chapter 1, “Introduction” Provides an architectural overview of the ADSP-21367/8/9 and ADSP-2137x SHARC processors. • Chapter 2, “I/O Processor” Describes ADSP-21367/8/9 and ADSP-2137x processors input/output processor architecture and direct memory accesses (DMA) for the peripherals that have this feature.
Page 33
Preface • Chapter 8, “Pulse Width Modulation” Describes the implementation and use of the pulse width modula- tion module which provides a technique for controlling analog circuits with the microprocessor’s digital outputs. • Chapter 9, “S/PDIF Transmitter/Receiver” Provides information on the use of the Sony/Philips Digital Inter- face which is a standard audio file transfer format that allows the transfer of digital audio signals from one device to another without having to be converted to an analog signal.
What’s New in This Manual • Appendix A, “Register Reference” Provides a graphical presentation of all registers and describes the bit usage in each register. • Appendix B, “Interrupts” Provides a complete listing of the registers that are used to config- ure and control interrupts.
Instructions From External Memory” on page 3-3 “Running Reset (ADSP-2137x)” on page 14-22. Technical or Customer Support You can reach Analog Devices, Inc. Customer Support in the following ways: • Visit the Embedded Processing and DSP products Web site at http://www.analog.com/processors/manuals • E-mail tools questions to processor.tools.support@analog.com...
Supported Processors Supported Processors The following is the list of Analog Devices, Inc. processors supported in VisualDSP++®. Blackfin® (ADSP-BFxxx) Processors The name Blackfin refers to a family of 16-bit, embedded processors. VisualDSP++ currently supports the following Blackfin families: ADSP-BF53x, ADSP-BF54x, and ADSP-BF56x.
Preface MyAnalog.com is a free feature of the Analog Devices Web site that allows MyAnalog.com customization of a Web page to display only the latest information on products you are interested in. You can also choose to receive weekly e-mail notifications containing updates to the Web pages that meet your interests.
Related Documents The following publications that describe the ADSP-2136x SHARC pro- cessors (and related processors) can be ordered from any Analog Devices sales office: • ADSP-21362 SHARC Processor Data Sheet • ADSP-21363 SHARC Processor Data Sheet • ADSP-21364 SHARC Processor Data Sheet •...
Preface For information on product related development software and Analog Devices processors, see these publications: • VisualDSP++ User’s Guide • VisualDSP++ C/C++ Compiler and Library Manual for SHARC Processors • VisualDSP++ Assembler and Preprocessor Manual • VisualDSP++ Linker and Utilities Manual •...
Page 40
Product Information File Description Help system files and manuals in Help format .CHM Dinkum Abridged C++ library and FlexLM network license manager software doc- .HTM umentation. Viewing and printing the files requires a browser, such as .HTML .HTML Internet Explorer 4.0 (or higher). VisualDSP++ and processor manuals in Portable Documentation Format (PDF).
To purchase VisualDSP++ manuals, call 1-603-883-2430. The manuals may be purchased only as a kit. If you do not have an account with Analog Devices, you are referred to Analog Devices distributors. For information on our distributors, log onto http://www.analog.com/salesdir/continent.asp...
Page 42
1-800-ANALOGD (1-800-262-5643); they also can be downloaded from the Web site. To have a data sheet faxed to you, call the Analog Devices Faxback System at 1-800-446-6212. Follow the prompts and a list of data sheet code numbers will be faxed to you. If the data sheet you want is not listed, check for it on the Web site.
Preface Conventions Text conventions used in this manual are identified and described as follows. Example Description Close command Titles in reference sections indicate the location of an item within the (File menu) VisualDSP++ environment’s menu system. For example, the Close command appears on the File menu.
Page 44
Conventions Additional conventions, which apply only to specific chapters, may appear throughout this document. xliv ADSP-21368 SHARC Processor Hardware Reference...
1 INTRODUCTION The ADSP-21367/8/9 and ADSP-2137x SHARC processors are high per- formance, 32-bit processors used for high quality audio, medical imaging, communications, military, test equipment, 3D graphics, speech recogni- tion, motor control, imaging, and other applications. By adding on-chip SRAM, integrated I/O peripherals, and an additional processing element for single-instruction, multiple-data (SIMD) support, this processor builds on the ADSP-21000 family DSP core to form a complete system-on-a-chip.
Page 46
Design Advantages and input/output (I/O) buses. In the core, every instruction can execute in a single cycle. The buses and instruction cache provide rapid, unimpeded data flow to the core to maintain the execution rate. Figure 1-1 shows a detailed block diagram of the processor core and the I/O processor (IOP).
Page 47
Introduction from memory, access an instruction (from the cache), and perform a DMA transfer. Figure 1-1 also shows the asychronous memory interface available on the ADSP-21368 processor. INSTRUCTION ON -C HIP M EM OR Y FLAGS 4-15 CACHE 3 2 X 4 8-BI T PW M 2 DAG S ADDR...
Page 48
Design Advantages Unconstrained Data Flow. The ADSP-21367/8/9 and ADSP-2137x pro- cessors have a Super Harvard Architecture combined with a ten-port data register file. In every cycle, the processor can write or read two operands to or from the register file, supply two operands to the ALU, supply two operands to the multiplier, and receive three results from the ALU and multiplier.
Page 49
Introduction Input Data Port (IDP). The IDP provides an additional input path to the processor core, configurable as eight channels of serial data or seven chan- nels of serial data and a single channel of up to 20-bit wide parallel data. Two Serial Peripheral Interfaces (SPI).
Please visit www.analog.com/SHARC for complete information. 3 Analog Devices offers these packages in lead-free (Pb) versions. Architectural Overview The ADSP-21367/8/9 and ADSP-2137x processors form a complete sys- tem-on-a-chip, integrating a large, high speed SRAM and I/O peripherals supported by a dedicated I/O bus.
Introduction Processor Core The processor core of the ADSP-21367/8/9 and ADSP-2137x processors contain two processing elements (each with three computation units and data register file), a program sequencer, two data address generators, a timer, and an instruction cache. All digital signal processing occurs in the processor core.
Page 52
Architectural Overview same serial clock and frame sync. Accordingly, each serial port has two DMA channels and serial data buffers associated with it to service the dual serial data pins. Programmable data direction provides greater flexibility for serial communications. Serial port data can automatically transfer to and from on-chip memory using DMA.
Introduction ROM-Based Security. For those processors with application code in the on-chip ROM, an optional ROM security feature is included. This feature provides hardware support for securing user software code by preventing unauthorized reading from the enabled code. The processor does not boot-load any external code, executing exclusively from internal ROM.
Development Tools Digital Peripheral Interface (DPI) The digital peripheral interface (DPI) unit is a new addition to the SHARC processor peripherals. This set of audio peripherals consists of an interrupt controller, a two wire interface port (TWI), and a signal routing unit, three timers and a Universal Asynchronous Receiver/Transmitter (UART).
Introduction Differences From Previous Processors This section identifies differences between the ADSP-21367/8/9 and ADSP-2137x processors and previous SHARC processors: ADSP-21161, ADSP-21160, ADSP-21060, ADSP-21061, ADSP-21062, and ADSP-21065L. Like the ADSP-2116x family, the ADSP-2136x SHARC processor family is based on the original ADSP-2106x SHARC family. The ADSP-21367/8/9 and ADSP-2137x processors preserve much of the ADSP-2106x architecture and is code compatible to the ADSP-21160, while extending performance and functionality.
Differences From Previous Processors Instruction Set Enhancements The ADSP-21367/8/9 and ADSP-2137x processors provide source code compatibility with the previous SHARC processor family members to the application assembly source code level. All instructions, control registers, and system resources available in the ADSP-2106x core programming model are also available in the ADSP-21367/8/9 and ADSP-2137x proces- sors.
Page 57
2 I/O PROCESSOR In applications that use extensive off-chip data I/O, programs may find it beneficial to use a processor resource other than the processor core to per- form data transfers. The ADSP-21367/8/9 and ADSP-2137x processors contain an I/O processor (IOP) that supports a variety of DMA (direct memory access) operations.
General Procedure for Configuring DMA To further increase off-chip I/O, multiple DMAs can occur at the same time. The IOP accomplishes this by managing DMAs of processor mem- ory through the TWI, UART, SPI, input data port (IDP), and serial ports. Accesses to IOP spaces (from the processor core) should not use Type 1 (dual access) or LW instructions.
I/O Processor • Serial peripheral interface ports (SPI) • Input data port (IDP) 4. Enable DMA • Set the applicable bits in the appropriate control registers For peripheral specific DMA information, see the following sections. • “External Port DMA” on page 2-35 •...
Page 60
Core Access to IOP Registers Table 2-1. I/O Processor Stall Conditions (Cont’d) Type Of Access Number of Core Cycles Aborted conditional I/O processor register read/write Conditional I/O processor register read/write 9/10 1 Applies to memory-mapped registers from Table 2-2. 2 Applies to all other memory-mapped registers not in Table 2-2.
Page 61
I/O Processor Table 2-2. Memory-Mapped Emulation/Breakpoint Registers (Cont’d) Register Description Address DMA1S/E Data memory breakpoint address number 0x300B2/ 1 start/end 0x300B3 DMA2S/E Data memory breakpoint address number 0x300B3/ 2 start/end 0x300B4 PMDAS/E Program memory breakpoint address 0x300B8/ start/end 0x300B9 In addition to the above, the following situations incur additional stall cycles.
Configuring IOP/Core Interaction In order to resolve this issue, use one of the following methods. 1. Read an IOP register from the same peripheral block before execut- ing the RTI. This read forces the write to occur first. dm(TXSPI) = R0; /* Write to TXSPI FIFO */ R0 = dm(SPICTL);...
Page 63
I/O Processor The processors also have programmable interrupts using the peripheral interrupt priority control registers, For more PICRx information, see “Peripheral Interrupt Priority Control Registers” on page A-164. Programs can check the appropriate status or configuration register to determine which channels are performing a DMA or chained DMA. All DMA channels can be active or inactive.
Page 64
Configuring IOP/Core Interaction During interrupt-driven DMA, programs use the interrupt mask bits in , and reg- IMASK LIRPTL DAI_IRPTL_PRI DAI_IRPTL_RE DAI_IRPTL_FE isters to selectively mask DMA channel interrupts that the I/O processor latches into the , and registers. IRPTL LIRPTL DAI_IRPTL_H DAI_IRPTL_L The I/O processor only generates a DMA complete interrupt when...
Configuring IOP/Core Interaction 2. Add sufficient instructions after a write. In the worst case pro- grams need to add ten instructions after a write as shown in the example code below. isr_code: R0 = 0x0; dm(SPICTL) = R0; /* disable SPI */ nop;...
I/O Processor • Bit definitions for the register are illustrated in “SPI Port SPIDMAC Status (SPISTAT, SPISTATB) Registers” on page A-56. • Bit definitions for the register are illustrated in “SPORT SPMCTLx Multichannel Control Registers (SPMCTLx)” on page A-40. • Bit definitions for the register are illustrated in DAI_STAT Figure A-41 on page...
Configuring IOP/Core Interaction In general, a DMA sequence starts when one of the following occurs: • Chaining is disabled, and the DMA enable bit transitions from low to high. • Chaining is enabled, DMA is enabled, and the chain pointer regis- ter address field is written with a nonzero value.
Page 71
I/O Processor parameters stored in the processor’s internal memory. These are the registers for the SPORTs, the register for the external port, CPSPxy CPEP registers for the UART, and the register for the SPI. RXCP_UACx CPSPI Each new set of parameters is stored in a four-word, user-initialized buffer in internal memory known as a transfer control block (TCB).
Configuring IOP/Core Interaction processor’s internal memory before it is used by the I/O processor. On the ADSP-21367/8/9 and ADSP-2137x processors, this offset value is 0x0008 0000. Bit 19 of the chain pointer register is the program-controlled interrupts ) bit. This bit controls whether an interrupt is latched after every DMA in the chain (when set), or whether the interrupt is latched after the entire DMA sequence completes (if cleared).
I/O Processor transfers. Table 2-5 shows the DMA channel allocation and parameter register assignments for the ADSP-21367/8/9 and ADSP-2137x processors. DMA channels vary by processor model. For a breakdown of DMA channels for a particular model, see the processor specific data sheet.
Configuring IOP/Core Interaction If a DMA channel is disabled ( , or EPDEN SPIDEN SDEN IDP_DMA_EN bits =0), the I/O processor does not issue internal DMA grants to that channel (whether or not the channel has data to transfer). The default DMA channel priority is fixed prioritization by DMA channel group (serial ports, TWI, UART, IDP, or SPI port).
Page 77
I/O Processor IOP channel arbitration can be set to use either a fixed or rotating algo- rithm by setting or clearing bit 7 ( ) in the register: DCPR SYSCTL • fixed cleared (0) SYSCTL[7] • rotating set (1) SYSCTL[7] In the fixed priority scheme, the lower indexed peripheral has the highest priority.
Page 78
Configuring IOP/Core Interaction Table 2-5. DMA Channel Allocation and Parameter Register Assignments (Cont’d) Data Buffer Group IOP Address of Description Channel Data Buffers Number RXSP0A, TXSP0A 0xC61, 0xC60 Serial Port 0A Data RXSP0B, TXSP0B 0xC63, 0xC62 Serial Port 0B Data RXSP3A, TXSP3A 0x465, 0x464 Serial Port 3A Data...
Page 79
I/O Processor Table 2-5. DMA Channel Allocation and Parameter Register Assignments (Cont’d) Data Buffer Group IOP Address of Description Channel Data Buffers Number IDP_FIF0 0x24D0 DAI IDP Channel 6 IDP_FIF0 0x24D0 DAI IDP Channel 7 RXSPI, TXSPI 0x1004, 0x1003 SPI Data RXSPIB, TXSPIB 0x2804, 0x2803 SPI Data...
Setting Up DMA Parameter Registers Setting Up DMA Parameter Registers Once you have determined and configured the DMA options, you can configure the DMA parameter registers. The parameter registers control the source and destination of the data, the size of the data buffer, and the step size used.
Setting Up DMA Parameter Registers • Serial port transmit buffers ( ). These transmit buffers for the TXSPx serial ports have two-position FIFOs for transmitting data when connected to another serial device. • SPI receive buffers ( ). These receive buffers for the RXSPI RXSPIB SPI ports have a single-position buffer for receiving data when con-...
Page 83
I/O Processor • Universal asynchronous receiver/transmitter registers ). These control registers configure and RXCTL_UACx TXCTL_UACx enable the UART receiver and transmitter DMA, (chaining and non chaining). • Memory-to-memory DMA control register ( ). This control MTMCTL register contains the MTM DMA read and write channel enable and status bits.
Page 84
Setting Up DMA Parameter Registers • External modify registers ( ). Modify registers provide the EMEPx increment by which the DMA controller post-modifies the corre- sponding external memory index register after the DMA read or write. • External count registers ( ).
I/O Processor Table 2-6. DMA Parameter Registers Register Function Width Description Internal Index Register 19 bits Address of buffer in internal memory IMxy Internal Modify Register 16 bits Stride for internal buffer Internal Count Register 16 bits Length of internal buffer CPxy Chain Pointer Register 20 bits...
Page 86
Setting Up DMA Parameter Registers All addresses in the index registers are offset by a value that matches the processor’s first internal normal word addressed RAM location (before the I/O processor uses the addresses). For the ADSP-21367/8/9 and ADSP-2137x processors, this offset value is 0x0008 0000. DMA ADDRESS GENERATOR (INTERNAL ADDRESSES) LOCAL BUS INTERNAL...
Page 87
I/O Processor The following rules for data transfers must be followed. • DMA addresses must always be normal word (32-bit) memory. • Internal memory data transfer sizes are 32 bits, while external data transfer sizes may be 32, 16, or 8 bits. •...
Page 88
Setting Up DMA Parameter Registers In the serial port pair SP0/1, SP1 has a higher priority. For multichannel pairs, the odd numbered channels have a higher priority (for example SP3, SP5). Table 2-7. DMA Channel Registers: Controls, Parameters, and Buffers Control Registers Parameter Registers Buffer Registers Description...
Page 89
I/O Processor Table 2-7. DMA Channel Registers: Controls, Parameters, and Buffers (Cont’d) Control Registers Parameter Registers Buffer Registers Description Channel Number SPCTL7 IISP7A, IM7P5A, CSP7A, RXSP7A, Serial Port CPSP7A TXSP7A 7A Data SPCTL7 IISP7B, IMSP7B, CSP7B, RXSP7B, Serial Port CPSP7B TXSP7B 7B Data SPCTL6...
Page 90
Setting Up DMA Parameter Registers Table 2-7. DMA Channel Registers: Controls, Parameters, and Buffers (Cont’d) Control Registers Parameter Registers Buffer Registers Description Channel Number IDP_CTL IDP_DMA_I7, IDP_FIFO DAI IDP IDP_DMA_M7, Channel 7 IDP_DMA_C7 SPICTL IISPI, IMSPI, CSPI, CPSPI RXSPI, TXSPI SPI Data SPICTLB IISPIB, IMSPIB, CSPIB,...
External Port DMA Table 2-8. External Port Registers Register Description Address EPCTL External Port Global Control Register 0x1801 DMAC1–0 External Port DMA Control Register 0x180B, 0x180C IIEP1–0 Internal Index Register 0x1823, 0x1833 IMEP1–0 Internal Modifier Register 0x1824, 0x1834 ICEP1–0 Internal Count Register 0x1825, 0x1835 EIEP1–0 External Index Register...
Page 93
I/O Processor 3. If circular buffering is needed, then program additional writes to registers. Note that for normal chained DMA, ELEP EBEP registers are not part of the TCB. So if circular ELEP EBEP buffering is used with the normal chained DMA, all the DMA blocks will have same values.l ELEP...
Page 95
I/O Processor as the external index and is incremented by the external modifier register ( ) after each write. These writes are circular buffered if EMEP circular buffering is enabled. 2. In chained DMA, when the writes are complete, ( = zero) the ICEP register, which serves as the write pointer of the delay line, is...
Serial Port DMA 4. Once the read count completes, the delay line DMA access is com- plete and the DMA complete interrupt is generated. Note that if chaining is enabled, the interrupt is generated based on the setting. For more information on the bit, see “Interrupt-Driven I/O”...
I/O Processor 2. Write to the appropriate DMA control register, setting the DMA enable bit to one and the chaining enable bit to one. 3. Write the address containing the index register value of the first TCB to the chain pointer register, which starts the chain. The I/O processor responds by autoinitializing the first DMA parameter registers with the values from the first TCB, and then starts the first data transfer.
Serial Peripheral Interface DMA Chain insertion mode operates the same as non-chained DMA mode. When the current DMA transfer ends, an interrupt request occurs and no TCBs are loaded. This interrupt request is independent of the state. Chain insertion should not be set up as an initial mode of operation. This mode should only be used to insert one or more TCBs into an active DMA chaining sequence.
Page 99
I/O Processor Writing an address to the register does not begin a chained CPSPI DMA sequence unless the , and registers are ini- IISPI IMSPI CSPI tialized, SPI DMA is enabled, the SPI port is enabled, and SPI DMA chaining is enabled. The sequence for setting up and starting a chained DMA is outlined in the following steps and can also be seen in Listing 6-3 on page...
UART DMA UART DMA In the UART, separate receive and transmit DMA channels move data between the UART and memory. The software does not have to move data, it just has to set up the appropriate transfers either through the descriptor mechanism or through auto buffer mode.
Page 101
I/O Processor DMA through the UART is started by setting up values in the DMA parameter registers and then writing to the transmit and receive control registers, enabling the module using the bits (in the UARTEN UARTxTXCTL registers) and enabling DMA using the bits.
Page 102
UART DMA When performing DMA using the UART module, receive interrupts are generated when: • The receive word block is complete/the DMA is complete. • A receive overrun error is detected. • A receive parity error is detected. • A receive framing error is detected. •...
I/O Processor Notes On Using DMA With the UART The following should be noted when performing DMA in conjunction with the UART module. 1. DMA can be interrupted by resetting the bit, but none of the other control settings should be changed. If the UART is enabled again, then interrupted DMA can be resumed by resetting the bit.
Memory-to-Memory DMA Memory-to-Memory DMA Memory-to-memory (MTM) DMA allows programs to transfer blocks of 64-bit data from one internal memory location to another. This transfer method uses two DMA channels, one for reading data and one for writing data. This data transfer can be set up using the following procedure. 1.
I/O Processor that channel. If the parameters configure the channel to receive, the I/O processor transfers data words received at the buffer to the destination in internal memory. If the parameters configure the channel to transmit, the I/O processor transfers a word automatically from the source memory to the channel’s buffer register.
Page 106
Programming Example .align 2; .var source[100]; /* Main code section */ .global _main; .section/pm seg_pmco; _main: r0=0x11111111; i0=source; /* Fill the source buffer */ lcntr=LENGTH(source), do fill until lce; dm(i0,1)=r0; fill: r0=rot r0 by 1; /* Set the interrupt mask for MTMDMA */ bit set imask MTMI;...
Page 107
I/O Processor /* Read and write sequentially with a step of 1 */ r0=1; dm(IMMTMW)=r0; dm(IMMTMR)=r0; /* Read the number of words in source */ r0=@source; dm(CMTMR)=r0; /* Write the number of words in destination */ r0=@dest; dm(CMTMW)=r0; /* Enable MTMDMA */ r0=MTMEN;...
Page 108
Programming Example 2-52 ADSP-21368 SHARC Processor Hardware Reference...
3 EXTERNAL PORT The external ports of the ADSP-21367/8/9 and ADSP-2137x processors are comprised of the following modules. • An “Asynchronous Memory Interface” on page 3-20 which com- municates with SRAM, FLASH, and other devices that meet the standard asynchronous SRAM access protocol. The AMI supports 16M words of external memory in bank1, bank2, and bank3 and 14M words of external memory in bank0.
External Memory Interface External Memory Interface The external memory interface provides a glueless interface to external memories. The processor’s I/O processor (IOP) supports synchronous DRAMs (SDRAMs), SRAMs, FIFOs, flash memory, and ASIC/FPGA devices. The external memory interface and the SDRAM memory that interfaces to the external port is clocked by the SDRAM clock ( SDCLK The ratio of core clock (...
External Port External memory address space is supported in normal word addressing mode only. Single-instruction, multiple-data (SIMD), extended-precision, short word and long word addressing modes are not supported. Program execution from external memory on the ADSP-2136x processors is also not supported. External Memory Interface on the ADSP-2137x Processors The ADSP-2137x SHARC processors support direct execution of instruc-...
External Memory Interface wide external port. When executing from external asynchronous memory, instruction throughput depends on the settings of asynchronous memory such as the number of wait states, the ratio of core to peripheral clock and other settings. For details, please refer to the external port global control register ( ), asynchronous memory interface control register EPCTL...
External Port When an unmasked interrupt occurs and is serviced, program execution automatically jumps to the location of the corresponding interrupt vector table in internal memory. Upon returning from the interrupt, the sequencer resumes execution from external memory because locating the IVT in external memory is not supported.
Page 114
External Memory Interface Instruction Cache 32-bit x 48-bit *The external bus is 32 bits on the ADSP-21371 and 16 bits on the ADSP-21375. PROGRAM Sequencer 16/32* EXTERNAL PORT PM Address Bus Data SDRAM Controller DM Address Bus PM Data Bus Control Asynchronous DM Data Bus...
Page 115
External Port In other words, the 32-entry 2-way set-associative cache in the SHARC has been modified to act as an instruction cache when the program sequencer executes instructions from external memory, while continuing to work as the traditional conflict cache when the sequencer executes instructions located in internal memory.
Page 116
External Memory Interface The following example shows the innermost loop of a FIR filter. lcntr=FILTER_TAPS-1, do macloop until lce; macloop: f12=f0*f4, f8=f8+f12, f0=dm(i0,m1), f4=pm(i9,m9); In this example, if the code is stored and executed from external memory, the first time through this loop the program sequencer places the appro- priate 24-bit address on the external address bus, and fetches the instruction in line 2 from external memory.
External Port Instruction Storage and Packing The ADSP-2137x processors incorporate a 32-bit SDRAM controller. However, the SDRAM controller supports SDRAMs with data bus widths of 16 as well as 32 bits. The packing logic in the SDRAM controller packs the data from SDRAM into 48-bit instructions. Any address produced by the sequencer which falls in external memory is first translated into the physical address in external memory based on the actual data bus width of external memory as shown in...
Page 118
External Memory Interface “Physical External ADSP-213xx Memory Address” on Bank 0 External address bus “Logical Port Address” Address Address Sequencer Packing Translator Data Unit 16/32 bit* “Instruction Data” on data bus *32-bit on the ADSP-21371 and 16-bit on the ADSP-21375. Figure 3-3.
Page 119
External Port Table 3-2. External Address Space for SDRAM Memory Accesses Bank Size in words Address Range Bank 0 0x0020 0000 – 0x03FF FFFF Bank 1 0x0400 0000 – 0x07FF FFFF Bank 2 0x0800 0000 – 0x0BFF FFFF Bank 3 0x0C00 0000 –...
Page 120
External Memory Interface words and packs them to form the 48-bit instruction to be executed. The address is automatically incremented, and program execution continues with placing the next address on the external address bus, and so on. Table 3-3, the logical to physical translation is a multiplication by a factor of 3/2 and N = 0x8AAAA9.
Page 121
External Port Table 3-4. Logical Versus Physical Address Mapping, 16-Bit Asynchronous Memory Logical Address Dispatched Physical Address Observed Data by Program Sequencer on the External Address Bus 0x200000 0x600000 Instr0[15:0] 0x600001 Instr0[31:16] 0x600002 Instr0[47:32] 0x200001 0x600003 Instr1[15:0] 0x600004 Instr1[31:16] 0x600005 Instr1[47:32] 0x200002 0x600006...
Page 122
External Memory Interface Table 3-5. Logical Versus Physical Address Mapping, 32-Bit SDRAM Memory Logical Address Dispatched Physical Address Observed Data by Program Sequencer on the External Address Bus 0x200000 0x300000 Instr0[31:0] 0x300001 Instr1[15:0] Instr0[47:32] 0x200001 0x300001 Instr1[47:16] 0x300002 Instr2[31:0] 0x200002 0x300002 Instr3[15:0] Instr2[47:32]...
External Memory Interface For the ADSP-21371 processor, the register needs to be SDCTL explicitly programmed for 16-bit wide external memory by setting bit 16 (X16DE) of this register. EMI Registers and Signals The external port global control register is used to set the priority between core and DMA memory accesses and to determine whether SDRAM or asynchronous memory is used on each bank.
Page 125
External Port Table 3-7. External Port Control Register Bit Descriptions (Cont’d) Name Description Default B3SD Bank 3 SDRAM. 1 = Bank 3 (MS3) connected to SDRAM 0 = Bank 3 (MS3) connected to asynchronous memory 5–4 EPBR External Port Bus Priority. 11 = Rotating priority 10 = Core has high priority 01 = DMA has high priority...
External Memory Interface External Port Arbitration Logic The external port arbitration logic controls the arbitration between the two DMA channels and processor core. The following control the arbitra- tion logic. • The register can be programmed to use the various features EPCTL of arbitration between different channels.
External Port External Memory Interface Pins The pins used by the external memory interface are described in Table 3-8. Table 3-8. External Memory Pin Descriptions Pin Name Description for AMI Description for SDRAM DATA31–0 Data bus Data bus ADDR23–0 Address bus Address bus, includes bank selects ADDR [23:0] SDCLK...
Asynchronous Memory Interface Asynchronous Memory Interface Both the processor core and the I/O processor have access to external memory using the AMI. Table 3-9 describes the processor pins used for interfacing to external memory. The processor’s memory control signals also permit direct connection to fast static RAM devices.
External Port Table 3-9. Asynchronous Memory Interface Signals (Cont’d) Type Description MS3–0 Memory Select Lines [FLAG2-3 are muxed and used as MS2 and MS3]. Memory select lines 0–1 are asserted (low) as chip selects for the corresponding banks of external memory. The MS3-0 lines are decoded memory address lines that change at the same time as the other address lines.
AMI Timing Control enabled, the minimum value is = 2 (a wait state value of 0 corresponds to 32 wait cycles). The processor samples the signal after the pro- grammed wait state count expires—it is imperative that the value is initialized when the acknowledge enable bit ( ) is set.
External Port READ IDLE WRITE SDCLK ADDRESS 23 DATA 31 Figure 3-4. Idle Cycle Example, Wait State = 2 Bus Hold Cycles The processor is able to insert bus hold and read hold cycles by setting bits in the AMI control register ( ).
Setting AMI Modes The address, data (if a write), and bank select (if in banked external mem- ory) remain unchanged and are driven for one or more cycles after the read or write strobes are deasserted. Figure 3-5 demonstrates a hold time cycle appended to an asynchronous write access ( = 011).
External Port There is a 3:1 bus conflict resolution ratio at the external port interface (three internal buses to one external bus) in addition to the 2:1 or greater clock ratio between the processor’s internal clock and the external SDRAM clock ( ).
Setting AMI Modes For packed data mode where = 0 and = 1, the packing order PKDIS MSWF = 8 is: first byte received is bits 31–24, the second byte is bits 23–15, and so on. If the bit is set (=1), then the 8- or 16-bit data (based on the bus PKDIS width) is zero appended to 32 bits.
External Port controller or through direct core writes. Writes to the AMI set a status bit , bit 2 in the register) and initiate the external write AMITXS AMISTAT access. Once a full word is transferred out of the AMI, the bit is cleared AMITXS and new writes are allowed.
Setting AMI Modes Read/Write Throughput For a wait state of 2 (which is the smallest wait state), the throughput is shown in Table 3-11. Table 3-11. Read/Write Throughput Bus Width Operation Throughput in SDCLK Cycles 32-bit Write One 32-bit word per 3 SDCLK cycles 32-bit Read One 32-bit word per 3 SDCLK cycles...
Page 137
External Port • For an external bus width of 32 bits, or when packing is disabled with other bus widths ( = 1 and = 16 bits or = 1 and PKDIS PKDIS = 8 bits), then the external physical memory is the same as the lower 24 bits of bits 23–0 in the address being supplied to the external port by the core or DMA controller.
SDRAM Controller External Port DMA The AMI shares the two DMA channels of the external port with the SDRAM controller. Either of these DMA channels can be directed to the external asynchronous memories. For information on external port DMA, Chapter 2, I/O Processor.
External Port • SDC uses open page policy—any open page is closed only if a new access in another page of the same bank occurs • Supports multibank operation within the SDRAM (ADSP-2137x only) • Uses a programmable refresh counter to coordinate between vary- ing clock frequencies and the SDRAM’s required refresh rate •...
Page 140
SDRAM Controller Burst length The burst length determines the number of words that the SDRAM device stores or delivers after detecting a single write or read command, respectively. The SDC supports burst length = 1 mode only. Burst stop command Use of this command is one of several ways to terminate or interrupt a burst read or write operation.
Page 141
External Port CBR (CAS before RAS) Refresh or auto-refresh. When the SDC refresh counter times out, the SDC precharges all four banks of SDRAM and then issues an auto-refresh command to them. This causes the SDRAMs to generate an internal CBR refresh cycle.
Page 142
SDRAM Controller The initial read or write triggers the SDRAM power-up sequence, which programs the SDRAM’s mode register with the CAS latency from the register. This initial read or write to SDRAM takes many cycles to SDCTL complete. Note that for most applications the SDRAM power-up sequence and a write to the mode register is performed only once.
Page 143
External Port tRAS Required delay between issuing a bank activate command and a precharge command, and between issuing the self-refresh command and the exit from self-refresh mode. The bits (7–4) in the register can be SDTRAS SDCTL set to 1 to 15 clock cycles. Required delay between issuing a precharge command and issuing: •...
SDRAM Controller Required delay between issuing successive bank activate commands to the same SDRAM internal bank. This delay is not directly programmable. The t delay is satisfied by programming the fields to SDTRAS SDTRP ≥ t ensure that t tRFC Required delay between issuing an auto-refresh command and a bank acti- vate command, and between issuing successive auto-refresh commands.
Page 145
External Port The SDRAM CAS latency, ( bits), precharge ( bits), SDCL SDTRAS SDTRP RAS to CAS delay ( bits), and write before precharge timing ( SDTRCD SDTWR bits) should be programmed based on the SDRAM clock frequency and the timing specifications of the SDRAM used. All timing parameters are written with valid values based on the clock frequency and the tim- SDCLK...
Page 146
SDRAM Controller PLLD Bit Setting Clock Ratio CCLK divider of 1 CCLK divider of 2 CCLK divider of 4 CCLK divider of 8 SDCKR Bit Setting Clock Ratio SDCLK divider of 2 SDCLK divider of 2.5 SDCLK divider of 3 SDCLK divider of 3.5 SDCLK divider of 4 3.
External Port For more information on SDRAM clocking and programming the PLL, “Clock Derivation” on page 14-13, “Power Management Control Reg- ister” on page 14-14, and “Power Management Control Register (PMCTL)” on page A-170. Parallel Connection of SDRAMs To specify a SDRAM system, multiple possibilities are given based on the different memory sizes.
Page 148
SDRAM Controller SDRAM CAS latency parameter setting. bits 1–0. The column SDCL address strobe (CAS) latency is the delay in clock cycles between when the SDRAM detects the read command and when it provides the data at its output pins. Settings are: 10 = 2 cycles, 11 = 3 cycles. Generally, the frequency of operation determines the value of the CAS latency.
Page 149
External Port The t parameter allows the ADSP-21367/8/9 and ADSP-2137x pro- cessors to adapt to the timing requirements of the system’s SDRAM devices. Any value between 1 and 15 cycles can be selected as shown SDCLK Table 3-14. Table 3-14. Bank Activate Command Delay Bit Settings Bit Setting Clock Cycles Bit Setting...
Page 151
External Port SDRAM power-up sequence start. bit 14. The bit specifies SDPSS SDPM the power-up mode and the bit starts an SDRAM power-up (initial- SDPSS ization) sequence. When this bit is set (=1), the SDRAM power-up sequence starts on the next SDRAM access. When cleared, this bit has no effect.
Page 152
SDRAM Controller • If cleared (=0), a 32-bit SDRAM should be used; should be connected to the SDRAM data pins; DATA[31–0] should be connected SDRAM address pins 14–0. ADDR[15:1] more information, see “SDRAM Address Mapping” on page 3-51. Note that pins are also used.
Page 153
External Port Force auto-refresh. bit 20. When set (=1), forces auto-refresh. Force AR When cleared (=0), has no effect. Note that when bit is set, setting SDORF this bit causes to have no effect. Force AR Force precharge. bit 21. When set (=1), forces precharge. When Force PC cleared (=0), has no effect.
Page 154
SDRAM Controller ADSP-21367 SDRAM #1 4M X 4 X 4 SDWE SDCKE A[15:11] A[14:0] A[9:1] SDA10 SDCLK DATA [3:0] DATA [3:0] DATA[31-0] DATA [7:4] DATA [3:0] SDRAM #2 4M X 4 X 4 DATA [11:8] DATA [3:0] SDRAM #3 4M X 4 X 4 DATA [15:12] DATA [3:0] SDRAM #4...
Page 155
External Port ADDR [15] CTRL [6] SDRAM BANK 1 ADDR & CTRL SDRAM BANK 2 ADDR & CTRL REG ISTERED ADSP-21367 BUFFERS SDRAM #5 4 X 4 X 4 O 1A SDWE SDCKE AA[15:1] A[15:11] A[14:0] OXA[14:0] AB[15:1] A[9:1] OXB[14:0] IX[14:0] SDA10 DATA [19:16]...
Page 156
SDRAM Controller For more information, see “Timing External Memory Accesses” on page 3-36. Any value between 1 and 7 cycles may be selected as SDCLK shown in Table 3-18. Table 3-18. SDRAM t Bit Settings SDTRCD Bit SDRAM Parameter SDTWR Bit SDRAM Parameter Setting Setting...
Page 158
SDRAM Controller To calculate the value to write to the register, use the following SDRRC equation. × ⎛ ⎞ SDCLK ≤ ---------------------------------- - – RDIV ⎝ ⎠ Where: frequency (SDRAM clock frequency) SDCLK SDCLK = SDRAM refresh period NRA = Number of row addresses in SDRAM (refresh cycles to refresh whole SDRAM) = Active to precharge time ( bits in the SDRAM mem-...
External Port 3 – ⎛ × × × ⎞ ⎜ ---------------------------------------------------------------- - ⎟ – RDIV 1030 ⎝ 8192 ⎠ This means is 0x406 (hex) and the SDRAM refresh rate control reg- RDIV ister is written with 0x406. value must be programmed to a nonzero value if the RDIV SDRAM controller is enabled.
Page 160
SDRAM Controller On the ADSP-21367/8/9 and ADSP-2137x processors, bank 0 starts at address 0x20 0000 in external memory and is followed in order by banks 1, 2, and 3. When the processor generates an address located within one of the four banks, it asserts the corresponding memory select line, MS3-0 Bank Unused...
Page 161
External Port lines are decoded memory address lines that change at the same time as the other address lines. When no external memory access is occurring, the lines are inactive. MS3-0 The width of the bank address is only two bits and is shown in Table 3-21.
SDRAM Controller SDRAM Controller Address Mapping To access SDRAM, the SDC multiplexes the internal 32-bit, non-multi- plexed address into a row and column address. The row and column address mappings for 32-bit and 16-bit addresses are shown in Table 3-25. The row and column addresses are muxed to pins of the processor.
Page 167
External Port The internal 32-bit non-multiplexed address is multiplexed into: • SDRAM column address • SDRAM row address • Internal SDRAM bank address The lowest bits are mapped into the column address, next bits are mapped into the row address, and the final two bits are mapped into the internal bank address.
SDRAM Controller Single Bank Operation The SDC keeps only one page open at a time, however, driving four exter- nal memory selects populated with SDRAM, the effective page size is increased up to four pages. Multibank Operation (ADSP-2137x Processors) Since an SDRAM contains four independent internal banks (A–D), the SDC on the ADSP-2137x processors is capable of supporting multibank operation, thus taking advantage of the architecture.
External Port Access to page x Access to page x Bank A Bank A Access to page y Access to page y Bank B Bank B Access to page x Bank C Bank C Access to page y Bank D Bank D Single bank operation Multibank operation...
Page 170
SDRAM Controller In order to set up the SDC and start the SDRAM power-up sequence for the SDRAMs, use the following procedure. Note that the registers must be programmed in order. 1. External port control ( ) register (assign external banks to EPCTL SDC) 2.
External Port • Select and enable the start of the SDRAM power-up sequence SDPM SDPSS • Select the column/row address widths Once the bit in the register is set to 1, and a transfer occurs to SDPSS SDCTL enabled SDRAM address space, the SDC initiates the SDRAM power-up sequence.
SDRAM Controller • Self-refresh entry—places the SDRAM in self-refresh mode, in which the SDRAM powers down and controls its refresh opera- tions internally. • Self-refresh exit—exits from self-refresh mode by expecting auto-refresh commands from SDC. • NOP/command inhibit—no operation used to insert wait states for activate and precharge cycles •...
External Port While executing the load mode register command, the unused address pins are set to zero. During the first cycle following load mode reg- SDCLK ister, the SDC issues only commands. Alternatively, programs can use the Force LMR command by setting bit 22 (=1) in the register.
SDRAM Controller However, if an access to another bank occurs, the SDC closes the current page open and issues another bank activate command before executing the read or write command to that bank. With this method, called single bank operation, Only one page can be open at a time. Multibank Activation (ADSP-2137x Processors) Unlike this command for the ADSP-21367/8/9 processors, if any other access to another bank occurs, the SDC leaves the current page open and...
External Port Read/Write This command is executed if the next read/write access is in the present active page. During the read command, the SDRAM latches the column address. The delay between activate and read commands is determined by the t parameter.
Page 176
SDRAM Controller SDCLK SDA10 COMMAND AC T ADDR RO W BA[1:0] DATA t RCD t RP t RAS t RC Figure 3-11. Read Timing Diagram ADSP-21367/8/9 SD CLK S DA10 CO MMAND BS T CO L RO W ADDR BA[1:0] DATA t WR t RCD...
External Port SDCLK SDA10 COMMAND ADDR RO W SDA10 BA[1:0] DATA t RCD t RP t RAS t RC Figure 3-13. Read Timing Diagram (ADSP-2137x, Full Page Burst) Read/Write (ADSP-2137x Processors) If the optional full page burst is select in the register, the SDC posts SDCTL for every read and write an address on the bus.
SDRAM Controller Auto-Refresh The SDRAM internally increments the refresh address counter and causes a CAS before RAS (CBR) refresh to occur internally for that address when the auto-refresh command is given. The SDC generates an auto-refresh command after the SDC refresh counter times out. The value in the RDIV SDRAM refresh rate control register (...
External Port to exit self-refresh mode. Therefore, the latency from when a transfer is received by the SDC while in self-refresh mode, until the activate com- mand occurs for that transfer, is 2 × (t ) cycles System clock during self-refresh mode. Note that the is not dis- SDCLK abled by the SDC during self-refresh mode.
Page 180
SDRAM Controller commands with no effect, the command is given. When the SDC is not accessing any SDRAM external banks, the command inhibit com- mand is given. A summary of pin states during SDC commands appears in Table 3-26. Note that an X means do not care. Table 3-26.
External Port Changing System Clock During Runtime All timing specifications are normalized to the system clock. Since most of these are minimum specifications, (except t , which is a maximum spec- ification), a variation of the system clock violates a specific specification and causes a performance degradation for the other specifications.
SDRAM Controller SDRAM Timing To support key timing requirements and power-up sequences for different SDRAM vendors, the SDC provides programmability for t and the power-up sequence mode. CAS latency is programmed in the register based on the frequency SDCTL of operation. (Please refer to the SDRAM vendor’s data sheet for more information.) For other parameters, the SDC assumes: •...
External Port Table 3-28. Optimal Data Throughput for 16-Bit Data Accesses (CAS Latency = 2) Access Operation Page Throughput per SDCLK (32-Bit Data) Sequential and Read Same 32 words per 69 cycles uninterrupted Sequential and uninter- Write Same 2 cycles rupted Non Sequential and Read...
Page 184
SDRAM Controller example, if = 1, then 32 locations in the boundary of the exter- SDMODIFY nal banks should not be used. These locations can be used without optimization enabled. If = 2 then 64 locations can not be used at SDMODIFY the boundaries of the external bank (if it is fully populated).
Page 185
External Port Listing 3-3. Nonsequential Reads With Read Optimization I0 = sdram_addr; M0 = 2; /* SET sdmodify to 2 */ Lcntr = 1024, do(PC,2) until lce; R0 = R0 + R1, R0 = dm (I0, M0); NOP; Without read optimization, 1024 reads use 6144 processor cycles if all of the reads are on the same page.
SDRAM Controller The workaround is to break up this instruction into separate instructions and use the workaround similar to case #1. r0=dm(IOP); NOP; r8=pm(Ext_Mem); External Memory Access Restrictions The following restrictions should be noted when writing programs for the ADSP-21367/8/9 and ADSP-2137x processors. 1.
External Port Shared Memory Interface The ADSP-21368 processor supports connections to a common shared external memory of other ADSP-21368 processors. These connections create shared external bus processor systems. This support includes: • Support for asynchronous memory and SDRAM • Distributed, on-chip arbitration for the shared external bus •...
Page 188
Shared Memory Interface ADSP-21368 #N ADDR CLKIN DATA RESET CONTROL ID2-0 ADDR DATA B OOT EPROM (OPTIONAL) A DSP-21368 #1 CLOCK CLKIN ADDR23-0 ADDR RESET RESET GLOBAL DATA31-0 DATA MEMORY PERIPHERALS (OPTIONAL) ID2-0 MS3-0 BR4-2 SDWE SDRAM SDCLK1-0 (O PTIONAL) SDCKE SDA10 DAT A...
Page 189
External Port Table 3-30. Shared Memory Pins Signal Type Definition BR4–1 I/O/S Shared Memory Bus Requests. Used to arbitrate for bus mastership. A processor only drives its own BRx line (corresponding to the value of its ID2-0 inputs) and monitors all others. In a shared memory system with less than four processors, the unused BRx pins should be tied high;...
Shared Memory Interface Conditional instructions can be written that depend upon whether the processor is the current bus master in a shared memory system. The assembly language mnemonic for this condition code is , and its com- plement is (not bus master). The condition indicates whether Not BM the processor is the current bus master.
Page 191
External Port After conditions determine that a bus transition cycle is going to occur, every processor in the system evaluates the priority of the lines asserted within that cycle. For a description of bus arbitration priority, see “Bus Arbitration Priority (RPBA)” on page 3-86.
Page 192
Shared Memory Interface are driven high (inactive) before three-stating occurs. The MS3-0 signal must be sampled high by the new master before it starts a new bus operation. For more information, see Figure 3-16. During bus transition cycle delays, execution of external accesses are delayed.
Page 193
External Port CLKIN OPTIONAL HIGHEST PRIORITY REQUESTER BECOMES BUS MASTER VALID ADDR VALID VALID VALID MS, STROBES DRIVEN INACTIVE BEFORE THREE-STATE DATA VALID VALID BTC DOES NOT OCCUR IF NO OTHER BRS ASSERTED Figure 3-16. Bus Request and Read/Write Timing keep these signals from drifting near input receiver thresholds when all drivers are three-stated.
Shared Memory Interface Bus Arbitration Priority (RPBA) To resolve competing bus requests, there are two available priority schemes—fixed and rotating. The pin selects the scheme. When RPBA RPBA is high, rotating priority bus arbitration is selected, and when is low, RPBA fixed priority is selected.
External Port Table 3-31. Rotating Priority Arbitration Example (Cont’d) Hardwired Processor IDs and Priority Cycle Number 3-BR 2-BR 1-BR 1 The following symbols appear in these cells: 1-3 = assigned priority, M = bus mastership (in that cycle), BR = requesting bus mastership with BRx 2 Initial priority assignments 3 Final priority assignments Bus Mastership Time-out...
Shared Memory Interface BMAX (0x180D) 15 14 13 12 11 10 BMAX = maximum # of bus mastership cycles – 2 Bits 31-16 are reserved. Figure 3-17. BMAX Register When decrements to zero, the bus master first completes its off-chip BCNT read/write and then deasserts its own (any new off-chip accesses are...
Page 197
External Port To synchronize their bus arbitration logic and define the bus master after a system reset, the multiple processors obey the following rules: • All processors except the one with = 001 deassert their line during reset. They keep their deasserted for at least two cycles after reset and until their bus arbitration logic is synchronized.
Page 198
Shared Memory Interface If one processor comes out of reset after the others have synchronized and started program execution, that processor may not be able to synchronize immediately (for example, if it detects more than one line asserted). If the non-synchronized processor tries to execute an instruction with an off-chip read or write, it cannot assert its line to request the bus and execution is delayed until it can synchronize and correctly arbitrate for the...
External Port /* Force an auto-refresh */ ustat1 = dm(SDCTL); bit set ustat1 F_AR; dm(SDCTL) = ustat1; After this code is executed, the processors in the system can start normal external accesses. These steps must be repeated when a pro- cessor is reset.
Shared Memory Interface Only SDRAM clock ( ) ratios of two and four are supported SDCLK in shared memory systems. Bus Lock and Semaphores To allow the processors in shared memory systems to share resources such as memory or I/O, semaphores can be used. A semaphore is a flag that can be read and written by any of the processors sharing the resource.
External Port While the bit is set, the processor can determine if it has acquired BUSLK bus mastership by executing a conditional instruction with the bus master ) or not bus master ( ) condition codes, for example: Not BM IF NOT BM JUMP(PC,0);...
Shared Memory Interface Shared Memory and the SDRAM Controller In a shared memory environment, the SDRAM is shared among two or more ADSP-21368 processors. SDRAM input signals (including clock) are always driven by the bus master. The current bus master continues to hold the bus for t –...
4 DIGITAL AUDIO/DIGITAL PERIPHERAL INTERFACES The digital audio interface (DAI) and the digital peripheral interface (DPI) are comprised of a groups of peripherals and their respective signal routing units (SRU1 and SRU2). The inputs and outputs of the peripher- als are not directly connected to external pins. Rather, the SRUs connect the peripherals to a set of pins and to each other, based on a set of config- uration registers.
Structure of the Interfaces Table 4-1. Signal Routing Unit Peripheral Assignments (Cont’d) DAI SRU1 DPI SRU2 Input Data Port Flags (12) General-Purpose I/O (20 channels) 1 The precision clock generator (PCG) units C and D can also be routed through the DPI.
Digital Audio/Digital Peripheral Interfaces This virtual connectivity design offers a number of distinct advantages: • Flexibility • Increased numbers and kinds of configurations • Connections can be made through software—no hard wiring is required Inputs may only be connected to outputs. DAI/DPI System Design Figure 4-1 Figure 4-2...
Page 206
DAI/DPI System Design DAI PIN BUFFERS DAI PINS SIGNAL ROUTING UNIT DAI_PB11_O DAI_P11 DAI_PB11_I S/PDIF TRANSMITTER DAI_PB11_PE_I DIT_CLK_I DIT_O DIT_DAT_I DAI_PB12_O DIT_FS_I DAI_P12 DAI_PB12_I DIT_HFCLK_I DIT_EXTSYNC_I* DAI_PB12_PE_I BLK_START* DAI_PB13_O S/PDIF RECEIVER DAI_P13 DAI_PB13_I DIR_I DAI_PB13_PE_I DIR_DAT_O DIR_CLK_O DIR_FS_O DAI_PB14_O DIR_TDMCLK_O DAI_P14 DAI_PB14_I SPDIF_PLLCLK_I*...
Page 207
Digital Audio/Digital Peripheral Interfaces DAI PINS DAI PIN BUFFERS SIGNAL ROUTING UNIT DAI_PB01_O DAI_P01 DAI_PB01_I PDAP_STRB_O DAI_PB01_PE_I PDAP DAI_PB02_O DAI_P02 DAI_PB02_I DMA0 IDP0 DAI_PB02_PE_I IDP0_DAT_I IDP0_FS_I IDP0_CLK_I DAI_PB03_O DAI_P03 DAI_PB03_I DAI_PB03_PE_I IDP1 IDP2 DAI_PB04_O IDP3 DAI_P04 DAI_PB04_I IDP4 DAI_PB04_PE_I IDP5 IDP6 IDP7 DAI_PB05_O...
Page 208
DAI/DPI System Design DPI PIN BUFFERS DPI PINS SIGNAL ROUTING UNIT 2 DPI_PB01_O DPI_P01 DPI_PB01_I GENERAL TIMER1_O DPI_PB01_PE_I PURPOSE TIMER1_I COUNTER/ TIMERS DPI_PB02_O TIMER2_O DPI_P02 DPI_PB02_I TIMER2_I DPI_PB02_PE_I TIMER3_O TIMER3_I DPI_PB03_O DPI_P03 DPI_PB03_I FLAGS DPI_PB03_PE_I FLAG [15-4] _PE_O FLAG [15-4] _O DPI_PB04_O DPI_P04 DPI_PB04_I...
Signal Routing Units Signal Routing Units This section describes how to use the signal routing units (SRU1 and SRU2) to connect inputs to outputs. Connecting Peripherals The SRUs can be likened to a set of patch bays, which contains a bank of inputs and a bank of outputs.
Page 211
Digital Audio/Digital Peripheral Interfaces Table 4-2. Pin Signal Group Assignments (Cont’d) Signal Group DAI (SRU1) DPI (SRU2) Group E Interrupts and miscellaneous signals Group F Pin enable signals used to spec- ify whether each DAI pin is used as an output or an input. Each input and output in each group is given a unique mnemonic.
Signal Routing Units Pin Interface Within the context of the SRUs, physical connections to the DAI/DPI pins are replaced by a logical interface known as a pin buffer. This is a three-terminal active device capable of sourcing/sinking output current when its driver is enabled, and passing external input signals when dis- abled.
Digital Audio/Digital Peripheral Interfaces When the pin enable is asserted, the pin output is logically equal to pin input, and the pin is driven. When the pin enable is deasserted, the output of the buffer amplifier becomes high impedance. In this situation, an external device may drive a level onto the line, and the pin is used as an input to the ADSP-21367/8/9 and ADSP-2137x processors.
Signal Routing Units When the DAI/DPI pin is used only as an output, connect the corre- sponding pin buffer enable to logic high as shown in Figure 4-7. This enables the buffer amplifier to operate as a current source and to drive the value present at the pin buffer input onto the DAI/DPI pin and off chip.
Digital Audio/Digital Peripheral Interfaces PIN BUFFER OUTPUT DAI_PBxx_O EXTERNAL PACKAGE CONNECTION PIN BUFFER INPUT DAI_PBxx_O (NOT USED) INTERFACE DAI_PBxx_I DRIVER TO SRU ENABLE PIN BUFFER ENABLE (= LOW) PBENxx_I Figure 4-8. Pin Buffer as Input Although not strictly necessary, it is recommended programming practice to tie the pin buffer input to logic low whenever the pin buffer enable is tied to logic low.
Page 216
Signal Routing Units For example, from an external perspective, when a serial port (SPORT) is completely routed off chip, it uses four pins—clock, frame sync, data channel A, and data channel B. Because all four of these pins comprise the interface that the serial port presents to SRU1, there are a total of 12 con- nections as shown in Figure...
Digital Audio/Digital Peripheral Interfaces page A-29. SRU1 then becomes transparent to the peripheral. Figure 4-10 demonstrates SPORT0 properly routed to DAI pins one through four— although it can be equally well routed to any of the 20 DAI pins. Though SPORT signals are capable of operating in this bidirectional man- ner, it is not required that they be connected to the pin buffer this way.
Page 219
Digital Audio/Digital Peripheral Interfaces another peripheral. All of the possible encodings represent sources that are clock signals (or at least could be clock signals in some systems). Figure 4-11 diagrams the input signals that are controlled by the DAI group A register, .
Making Connections in the SRUs Just as DAI group A routes clock signals, each of the other groups route a collection of compatible signals. Group B routes serial data streams while group C routes frame sync signals. Group D routes signals to pins so that they may be driven off chip.
Digital Audio/Digital Peripheral Interfaces Group A Connections—Clock Signals Group A is used to route the following signals to clock inputs and are selected from the list of group A sources. • SPORTs clock inputs (when the SPORTs are in clock slave mode) •...
Page 222
Making Connections in the SRUs 3. Setting = 0x1C connects to logic SRU_CLK4[4:0] PCG_EXTA_I low, not PCG_CLKA_O Setting = 0x1D connects SRU_CLK4[9:5] PCG_EXTB_I logic low, not PCG_CLKB_O 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 Reset = 0x252630C2 SRU_CLK0 (0x2430) SPORT3_CLK_I...
Digital Audio/Digital Peripheral Interfaces Group B Connections—Data Signals Group B connections are used to route signals to serial data inputs. This includes serial data inputs to both the A and B channels of the SPORTs and to each of the eight IDP channels. The SRCs and SPDIF transmitter are also selected from the list of group B sources and set in the group B registers.
Page 228
Making Connections in the SRUs 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 SRU_DAT1 (0x2441) Reset = 0x0F38B289 SPORT3_DB_I Reserved Serial Port 3 Data SPORT4_DB_I Channel B Input Serial Port 4 Data Channel B Input SPORT4_DA_I Serial Port 4 Data Channel A Input 15 14 13 12 11 10...
Page 230
Making Connections in the SRUs 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 SRU_DAT5 (0x2445) Reset = 0x00000000 IDP6_DAT_I DIR_DAT_I Input Data Port 6 SPDIF Receive Data Input Data Input IDP7_DAT_I Input Data Port 7 Data Input 15 14 13 12 11 10 IDP6_DAT_I IDP4_DAT_I...
Page 231
Digital Audio/Digital Peripheral Interfaces Table 4-5. Group B Sources—Serial Data Selection Code Source Signal Description (Source) 000000 (0x0) DAI_PB01_O Select DAI pin buffer 1 000001 (0x1) DAI_PB02_O Select DAI pin buffer 2 000010 (0x2) DAI_PB03_O Select DAI pin buffer 3 000011 (0x3) DAI_PB04_O Select DAI pin buffer 4...
Page 232
Making Connections in the SRUs Table 4-5. Group B Sources—Serial Data (Cont’d) Selection Code Source Signal Description (Source) 011000 (0x18) SPORT2_DA_O Select SPORT 2A data 011001 (0x19) SPORT2_DB_O Select SPORT 2B data 011010 (0x1A) SPORT3_DA_O Select SPORT 3A data 011011 (0x1B) SPORT3_DB_O Select SPORT 3B data 011100 (0x1C)
Digital Audio/Digital Peripheral Interfaces Table 4-5. Group B Sources—Serial Data (Cont’d) Selection Code Source Signal Description (Source) 110000 (0x30) DIT_O Select SPDIF biphase encoded output 110001 (0x31) –111101 (0x3D) Reserved 111110 (0x3E) Select logic level low (0) 111111 (0x3F) HIGH Select logic level high (1) Group C Connections—Frame Sync Signals Group C connections are used to route signals to frame sync inputs.
Page 234
Making Connections in the SRUs 4. SPORTs 6 and 7 receive frame syncs from other sources but cannot send their own frame syncs to other SPORTs or other peripherals internally through the SRU. If needed, they have to be connected externally through pins. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 Reset = 0x2736B4E3 SRU_FS0 (0x2450)
Making Connections in the SRUs Table 4-6. Group C Sources—Frame Sync (Cont’d) Selection Code Source Signal Description (Source) 11000 (0x18) SPORT4_FS_O Select SPORT 4 frame sync 11001 (0x19) SPORT5_FS_O Select SPORT 5 frame sync 11010 (0x1A) DIR_FS_O SPDIF_RX frame sync output 11011 (0x1B) Reserved 11100 (0x1C)
Page 239
Digital Audio/Digital Peripheral Interfaces 3. If = 0x13, then setting SRU_PIN4[27:21] SRU_PIN4[29] high does not invert the output. , and are 28-bit reg- SRU_PIN0 SRU_PIN1 SRU_PIN2 SRU_PIN3 isters. Reads on bits 28 through 31 always return zero. is a 30-bit register. Reads on bits 31 and 30 always SRU_PIN4 return zero.
Page 240
Making Connections in the SRUs 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 Reset = 0x03668C98 SRU_PIN2 (0x2462) DAI_PB11_I Reserved DAI Pin Buffer 11 Input DAI_PB12_I DAI Pin Buffer 12 Input 15 14 13 12 11 10 DAI_PB11_I DAI_PB09_I DAI Pin Buffer 11 Input...
Page 242
Making Connections in the SRUs Table 4-7. Group D Sources—Pin Signal Assignments (Cont’d) Selection Code Source Signal Description (Source) 0001101 (0xD) DAI_PB14_O Select DAI pin buffer 14 0001110 (0xE) DAI_PB15_O Select DAI pin buffer 15 0001111 (0xF) DAI_PB16_O Select DAI pin buffer 16 0010000 (0x10) DAI_PB17_O Select DAI pin buffer 17...
Page 243
Digital Audio/Digital Peripheral Interfaces Table 4-7. Group D Sources—Pin Signal Assignments (Cont’d) Selection Code Source Signal Description (Source) 0100101 (0x25) SPORT5_CLK_O Select SPORT 5 clock 0100110 (0x26) SPORT0_FS_O Select SPORT 0 frame sync 0100111 (0x27) SPORT1_FS_O Select SPORT 1 frame sync 0101000 (0x28) SPORT2_FS_O Select SPORT 2 frame sync...
Page 244
Making Connections in the SRUs Table 4-7. Group D Sources—Pin Signal Assignments (Cont’d) Selection Code Source Signal Description (Source) 0111111 (0x3F) SRC2_DAT_OP_O SRC2 data output 1000000 (0x40) SRC3_DAT_OP_O SRC3 data output 1000001 (0x41) DIR_DAT_O SPDIF_RX data output 1000010 (0x42) DIR_FS_O SPDIF_RX frame sync output 1000011 (0x43) DIR_CLK_O...
Digital Audio/Digital Peripheral Interfaces Group E Connections—Interrupts and Miscellaneous Signals Group E connections, shown in Table 4-8 on page 4-45, are slightly dif- ferent from the others in that the inputs and outputs being routed vary considerably in function. This group routes control signals (interrupts and miscellaneous signals) and provides a means of connecting signals between groups.
Page 246
Making Connections in the SRUs The following notes apply to group E connections. is a 30-bit register. On reads, bits 30 and 31 SRU_EXT_MISCB always return zero. 2. A detailed description of the DAI interrupt register and its usage is provided in “DAI Interrupt Controller Registers”...
Digital Audio/Digital Peripheral Interfaces Group F—Pin Enable Signals Group F signals, shown in Figure 4-37 through Figure 4-40 and described Table 4-9, are used to specify whether each DAI pin is used as an out- put or an input by setting the source for the pin buffer enables. When a pin buffer enable ( ) is set (= 1) the signal present at the cor- DAI_PBENxx_I...
Page 250
Making Connections in the SRUs 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 SRU_PBEN1 (0x2479) Reset = 0x1348D30F PBEN08_I Reserved DAI Port 8 Pin Buffer Enable Input PBEN10_I DAI Port 10 Pin Buffer Enable Input PBEN09_I DAI Port 9 Pin Buffer Enable Input...
Page 251
Digital Audio/Digital Peripheral Interfaces 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 SRU_PBEN3 (0x247B) Reset = 0x1D71F79B PBEN18_I Reserved DAI Port 18 Pin Buffer Enable Input PBEN20_I PBEN19_I DAI Port 20 Pin Buffer Enable Input DAI Port 19 Pin Buffer Enable Input 15 14 13 12 11 10...
Page 252
Making Connections in the SRUs Table 4-9. Group F Sources—Pin Output Enable (Cont’d) Selection Code Source Signal Description (Output Source) 001101 (0xD) SPORT1_FS_PBEN_O Select serial port 1 frame sync output enable 001110 (0xE) SPORT1_DA_PBEN_O Select serial port 1 data channel A output enable 001111 (0xF) SPORT1_DB_PBEN_O Select serial port 1 data channel B output enable...
Digital Audio/Digital Peripheral Interfaces Table 4-9. Group F Sources—Pin Output Enable (Cont’d) Selection Code Source Signal Description (Output Source) 100101 (0x25) SPORT7_FS_PBEN_O Select serial port 7 frame sync output enable 100110 (0x26) SPORT7_DA_PBEN_O Select serial port 7 data channel A output enable 100111 (0x27) SPORT7_DB_PBEN_O Select serial port 7 data channel B output enable...
Making Connections in the SRUs Table 4-10. DPI/SRU2 Default Configuration (Cont’d) Pin Number Signal Pin Number Signal DPI_06 SPIFLG1 DPI_13 TIMER0_O DPI_07 SPIFLG2 DPI_14 TIMER1_O There are three separate groups of connections that are used in SRU2. The following sections summarize each. Group A Connections—Input Routing Signals Group A is used to route the 14 external pin signals, timer, and UART outputs to the inputs of the other peripherals.
Making Connections in the SRUs Table 4-12. Group B Signals (Cont’d) Binary Decimal Signal Description 110010 PCG_FSD_O Precision clock generator frame sync D out 110011– 51-63 RESERVED 111111 Group C Connections—Pin Enable Signals Group C signals, shown in Table 4-13 on page 4-62, are used to specify whether each DPI pin is used as an output or an input by setting the source for the pin buffer enable.
Page 265
Digital Audio/Digital Peripheral Interfaces Table 4-13. Group C Signals (Cont’d) Binary Decimal Signal Description 001101 SPIFLG0_PE_O Pin enable for slave select 0 from SPI 001110 SPIFLG1_PE_O Pin enable for slave select 1 from SPI 001111 SPIFLG2_PE_O Pin enable for slave select 2 from SPI 010000 SPIFLG3_PE_O Pin enable for slave select 3 from SPI...
General-Purpose I/O (GPIO) and Flags Table 4-13. Group C Signals (Cont’d) Binary Decimal Signal Description 100101 TWI_SCLK_OE Serial clock output enable from TWI 100110 EXT_MISC_3 Miscellaneous control 3 100111 EXT_MISC_4 Miscellaneous control 4 101000 EXT_MISC_5 Miscellaneous control 5 101001 EXT_MISC_6 Miscellaneous control 6 101010 EXT_MISC_7...
Digital Audio/Digital Peripheral Interfaces DPI GPIO and Flags In the DPI, the signals are used for general-purpose I/O. An EXT_MISC interrupt controller processes these signals to generate an interrupt, for example . The signals can also be used to control pin DPI_INT EXT_MISC enables.
DAI/DPI Interrupt Controller generate an interrupt, a signal that a serial port has received data that must be processed, a signal that an SPI has either transmitted or received data, and other software interrupts like the insertion of a trap that causes a breakpoint—all are conditions, which identify to the core that an event has occurred.
Digital Audio/Digital Peripheral Interfaces Just as the core has its own interrupt latch registers ( IRPTL LIRPTL the DAI has its own latch registers ( ). When DAI_IRPTL_L DAI_IRPTL_H a DAI interrupt is configured to be high priority, it is latched in the register.
Page 270
DAI/DPI Interrupt Controller register enables interrupt latching at the falling edge of that DPI_IRPTL_FE signal. A particular interrupt can be latched at the rising or falling edge independently. Keeping corresponding bits reset in both these registers ) disables the corresponding interrupt. DPI_IRPTL_RE DPI_IRPTL_FE interrupt is automatically cleared when the...
Digital Audio/Digital Peripheral Interfaces High and Low Priority Latches In the ADSP-21367/8/9 and ADSP-2137x processors, a pair of registers ) replace functions normally performed by DAI_IRPTL_H DAI_IRPTL_L register. A single register ( ) specifies the latch to IRPTL DAI_IRPTL_PRI which each of these interrupts are mapped. Two registers ( ) replace the DAI periph- DAI_IRPTL_RE...
DAI/DPI Interrupt Controller register is read, the high priority latched interrupts are all cleared. When register is read, the low priority latched interrupts are all DAI_IRPTL_L cleared. Rising and Falling Edge Masks For interrupt sources that correspond to waveforms (as opposed to DAI event signals such as DMA complete or buffer full), the edge of a wave- form may be used as an interrupt source as well.
Page 273
Digital Audio/Digital Peripheral Interfaces registers enables the interrupt level on the DAI_IRPTL_RE DAI_IRPTL_FE rising and falling edges, respectively. For more information on these regis- ters, see “DAI Interrupt Controller Registers” on page A-112. Programs can manage responses to signals by configuring registers. In a sample audio application, for example, upon detection of a change of pro- tocol, the output can be muted.
Configuring Peripherals Using SRU2 Configuring the PCGs “Precision Clock Generators” on page 13-1 provides extensive informa- tion on programming using the DAI. “Clock and Frame Sync Divisors PCG Channel B” on page 13-20 is an example program that uses PCG channel B to output a clock on DAI pin 1 and a frame sync on DAI pin 2.
Digital Audio/Digital Peripheral Interfaces Table 4-14. SPI Pin Enable Selections Mode CLKPL CPHASE Use Pin Enable... HIGH HIGH SPI_CLK_O SPI_CLK_O As an example, the output of the clock to DPI pin 3 would be configured in SPI mode 3 as follows. SRU(SPI_CLK_O,DPI_PB03_I);...
Page 276
Configuring Peripherals Using SRU2 SRU(DPI_PB11_O, TWI_DATA_I); /* DPI pin 11 output connected to TWI data input */ SRU(LOW,DPI_PB12_I) /* Since TWI output is an open-drain output, the TWI pin is connected to logic level low */ SRU2(TWI_CLK_PBEN_O,DPI_PBEN12_I) /* TWI clock connected to DPI pin 12 Listing 4-2.
Page 277
Digital Audio/Digital Peripheral Interfaces Listing 4-3. TWI Slave Transmit Mode SRU(LOW,DPI_PB11_I) /* Since TWI output is an open-drain output the TWI pin is connected to logic level low */ SRU(TWI_DATA_PBEN_O,DPI_PBEN11_I) /* TWI data output connected to DPI pin 11 input */ SRU(DPI_PB11_O,TWI_DATA_I) /* DPI pin 11 output connected to TWI data input */...
Using the SRU() Macro to Configure the DAI SRU2(DPI_PB12_O, TWI_CLK_I) /* Clock signal from DPI pin 12 is connected to the TWI slave clock input */ SRU2(LOW,DPI_PBEN12_I) ) /* Disables DPI pin 12 as input as the clock is not generated by the slave Using the SRU() Macro to Configure the DAI...
Page 279
/* Connect pin buffer enable 19 to logic low */ SRU(LOW,DAI_PBEN19_I); Additional example code is available on the Analog Devices Web site. There is a macro that has been created to connect peripherals used in a DAI configuration. This code can be used in both assembly and C code.
Page 280
Using the SRU() Macro to Configure the DAI 4-78 ADSP-21368 SHARC Processor Hardware Reference...
5 SERIAL PORTS The ADSP-21367/8/9 and ADSP-2137x processors have up to eight inde- pendent, synchronous serial ports (SPORTs) that provide an I/O interface to a wide variety of peripheral devices. They are called SPORT0, SPORT1, SPORT2, SPORT3, SPORT4, SPORT 5, SPORT6, and SPORT7.
Features Features Serial ports offer the following additional features and capabilities: • Two additional SPORTs, each with their own DMA channels and interrupts, have been added to the ADSP-21367, ADSP-21368, ADSP-21369, and ADSP-21371 SHARC processors. • Two bidirectional channels (A and B) per SPORT, configurable as either transmitters or receivers.
Serial Ports New DMA channels are added for SPORT6 and 7. These new SPORTs also have their own interrupt lines. Operation Modes Thee serial ports have four operation modes: standard DSP serial, left-jus- tified sample pair, I S, and multichannel. In standard DSP serial, left-justified sample pair and I S modes, when both A and B channels are used, they transmit or receive data simultaneously, sending or receiving bit...
Page 284
Operation Modes • In multichannel mode, support for packed I S mode is new for the ADSP-21367/8/9 and ADSP-2137x processors. However, it should be noted that packed I S mode is not identical to I S mode in all cases. For more information, see “Packed I2S Mode”...
Serial Ports Serial Port Signals Figure 5-1 shows the SPORT signals (note that not all models have eight SPORTs). Any 20 of these 32 signals can be mapped to digital audio interface ( ) pins through the signal routing unit (SRU1). For more DAI_Px information, see Chapter 4, Digital Audio/Digital Peripheral...
Page 286
Serial Port Signals Pairings of SPORTs (0 and 1, 2 and 3, and 4 and 5, 6 and 7) are used only in loopback mode for testing. A SPORT receives serial data on one of its bidirectional serial data signals configured as inputs, or transmits serial data on the bidirectional serial data signals configured as outputs.
Page 287
Serial Ports Figure 5-2 shows a block diagram of a SPORT. Setting the SPTRAN enables the data buffer path, which, once activated, responds by shifting data in at the rate of . An application program must use the SPORTx_CLK correct SPORT data buffers, according to the value of bit.
Page 288
Serial Port Signals DM DATA BUS I/O DATA BUS PM DATA BUS TXSPxA TXSPxB RXSPxB RXSPxA TRANSMIT DATA TRANSMIT DATA BUFFER RECEIVE DATA BUFFER RECEIVE DATA BUFFER BUFFER HARDWARE HARDWARE COMPANDING COMPANDING (COMPRESSION) (EXPANSION) SPORTS 0, 2, 4 & 6 ONLY SPORTS 1, 3, 5 &...
Serial Ports A channel, the data is (optionally) expanded (SPORT1, 3, and 5 only), then automatically transferred to the buffer. When an entire word RXSPxA is shifted in on the secondary channel, it is automatically transferred to the buffer. RXSPxB When the SPORT is configured as a receiver ( = 0), the SPTRAN...
SPORT Operation Modes ) to the pin buffer input ( ). The connection of SPORTx_CLK_O PBxx_I opens a vulnerability to a glitch coming in even PBxx_O SPORTx_CLK_I though the SPORT is driving the clock as an output. By programming SRU1 to remove this input path, programs can avoid this vulnerability. This is done by leaving the routing of as before, SPORTx_CLK_O...
Serial Ports The operating mode ( ) bit of the register selects between I OPMODE SPCTLx mode/left-justified sample pair mode, and non-I S mode (DSP serial port/multichannel mode). In multichannel mode, the bit in the MCEA SPM- register enables the A channels and the bit in the CTLx MCEB...
Page 292
SPORT Operation Modes Table 5-1. SPORT Operation Modes (Cont’d) Bits OPMODE LAFS FRFS MCEA MCEB SLENx Operating Modes Packed I S Mode A Channel 3-32 Packed I S Mode B Channel 3-32 Packed I S Mode A and B 3-32 Channels Left-justified Sample Pair 8-32...
Serial Ports Standard DSP Serial Mode Control Bits Several bits in the control register enable and configure standard SPCTLx DSP serial mode operation: • Operation mode, master mode enable ( OPMODE • Word length ( SLEN • SPORT enable ( SPEN_A SPEN_B Clocking Options...
SPORT Operation Modes details on this option. Similar to the serial clock, the frame sync can be an external signal or generated internally. The bit in the register SPCTL allows the selection between these options (see the internal frame sync select bit description in Figure 5-10 on page 5-70 for more details).
Serial Ports The endian format (LSB versus MSB first) is selectable by the bit of LSBF register (see “Endian Format” on page 5-45 for more details). SPCTL Data packing of two serial words into a 32-bit word is also selectable. The bit in the register controls this option.
SPORT Operation Modes Left-Justified Sample Pair Mode In left-justified sample pair mode, each frame sync cycle receives or trans- mits two samples of data—one sample on the high segment of the frame sync, the other on the low segment of the frame sync. Prior to develop- ment of the I S standard, many manufacturers used a variety of non-standard stereo modes.
Serial Ports Setting the Internal Serial Clock and Frame Sync Rates The serial clock rate for internal clocks can be set using the CLKDIV field in the register and the frame sync rate for internal frame sync DIVx can be set using the bit field in the register.
SPORT Operation Modes To transmit or receive words continuously in left-justified sample pair mode, load the register with the value the same as . For FSDIV SLEN example, for 8-bit data words where = 7, set = 7. SLEN FSDIV Enabling SPORT Master Mode (MSTR) The SPORTs transmit and receive channels can be configured for master or slave mode.
Serial Ports Enabling SPORT DMA (SDEN) DMA can be enabled or disabled independently on any SPORT transmit and receive channels. For more information, see “Moving Data Between SPORTs and Internal Memory” on page 5-73. (=1) SDEN_A SDEN_B to enable DMA and set the channel in DMA-driven data transfer mode. Clear (=0) to disable DMA and set the channel in an SDEN_A...
SPORT Operation Modes SPORTX_CLK SPORTx_FS/WS LEFT-JUSTIFIED SAMPLE LSB n-1 MSB n LSB n MSB n+1 PAIR MODE DATA OR SPORTX_DA OR SPORTX_DB SAMPLE n-1 SAMPLE n SAMPLE n+1 Figure 5-3. Word Select Timing in Left-Justified Sample Pair Mode 1 This figure illustrates only one possible combination of settings attainable in the left-justified sample pair mode.
Serial Ports The I S bus transmits audio data and control signals over separate lines. The data line carries two multiplexed data channels—the left channel and the right channel. In I S mode, if both channels on a SPORT are set up to transmit, then SPORT transmit channels ( ) transmit TXSPxA...
SPORT Operation Modes Several bits in the register control register enable and configure I SPCTLx operation: • Operation mode enable ( OPMODE • Channel enable ( SPEN_A SPEN_B • Word length ( SLEN • I S channel transfer order ( FRFS •...
Serial Ports Enabling SPORT Master Mode (MSTR) The SPORTs transmit and receive channels can be configured for master or slave mode. In master mode, the processor generates the word select and serial clock signals for the transmitter or receiver. In slave mode, an external source generates the word select and serial clock signals for the transmitter or receiver.
SPORT Operation Modes When using both SPORT channels ( ) as trans- SPORTx_DA SPORTx_DB mitters and = 1, = 1, and = 0, the processor generates a MSTR SPTRAN DIFS frame sync signal only when both transmit buffers contain data because both transmitters share the same .
Serial Ports Interrupt-Driven Data Transfer Mode Both the A and B channels share a common interrupt vector in the inter- rupt-driven data transfer mode, regardless of whether they are configured as a transmitter or receiver. The SPORT generates an interrupt when the transmit buffer has a vacancy or the receive buffer has data.
Page 306
SPORT Operation Modes SPORTX_CLK SPORTX_FS/WS LEFT-JUSTIFI ED SAMPLE LSB n-1 MSB n LSB n MSB n+1 PAIR MODE DATA OR SPORTX_DA OR SPORTX_DB WORD n-1 WORD N WORD N+1 RIGHT CHANNEL LEFT CHANNEL RIG HT CHANNEL Figure 5-4. Word Select Timing in I S Mode serial bit stream occupies a separate channel.
Page 307
Serial Ports Although the eight SPORTs are programmable for data direction in the standard mode of operation, their programmability is restricted for multi- channel operations. The following points summarize these limitations: 1. The primary A channels of SPORT1, 3, 5, and 7 are capable of expansion only, and the primary A channels of SPORT0, 2, 4, and 6 are capable of companding only.
SPORT Operation Modes • The multichannel transfer is received on channel 0 (word 0), and transmits on channels 1 and 2 (word 1 and 2). WORD 0 WORD 1 WORD 2 SPORT1_CLK SPORT1_DA/B IGNORED SPORT1_FS SPORT0_DA/B SPORT0_TDV Figure 5-5. Multichannel Operation Frame Syncs in Multichannel Mode In previous SHARC processors, all receiving and transmitting devices in a multichannel system had to use the same timing reference.
Serial Ports After the transmit buffer is loaded, transmission begins and the TXSPxA signal is generated. When SPORT DMA is used, this signal SPORTx_TDV may occur several cycles after the multichannel transmission is enabled. If a deterministic start time is required, pre-load the transmit buffer. Active State Multichannel Frame Sync Select bit in the , registers selects the logic level of the multichan-...
Page 310
SPORT Operation Modes Multichannel operation is activated three serial clock cycles after the bits are set. Internally-generated frame sync signals activate four MCEA MCEB serial clock cycles after the bits are set. MCEA MCEB Select the number of channels used in multichannel operation by using the 7-bit field in the multichannel control register.
Page 311
Serial Ports This bit is set when the channel has received new data while the RXSPxA buffer is full. New data then overwrites existing data. When the RXSPxB SPORT is configured as a transmitter this bit indicates the transmit underflow status (sticky, read-only). This bit is set, = 1 when multichannel signal (from internal or external source) occurred while the SPORTx_FS TXS buffer was empty.
Page 312
SPORT Operation Modes Table 5-2. Multichannel Selection Registers (Cont’d) Register Names Function SP1CCS(0–3) Multichannel Receive Compand Select. Specifies which active receive SP3CCS(0–3) channels (out of 128 channels) are companded. SP5CCS(0–3) SP7CCS(0–3) SP0CCS(0–3) Multichannel Transmit Compand Select. Specifies which active trans- SP2CCS(0–3) mit channels (out of 128 channels) are companded.
Serial Ports Packed I S Mode A packed I S mode is available in ADSP-21367/8/9 SHARC processor serial ports. This mode allows applications to send more than the standard 32 bits per channel available through standard I S mode. Packed I mode is implemented using standard TDM mode (and is therefore pro- grammed similarly to TDM mode).
Page 314
SPORT Operation Modes Programming Packed I S Mode Since packed I S mode is implemented on top of TDM, programming this modes is the same as programming TDM. Use the serial port control ) and channel selection registers to configure the serial ports to run SPCTLx in packed I S mode as follows.
Serial Ports SPORT Loopback When the SPORT loopback bit, bit 12, is set in the , control SPMCTLx registers, the SPORT is configured in an internal loopback connection as follows: SPORT0 and SPORT1 work as a pair for internal loopback, SPORT2 and SPORT3 work as pairs, SPORT4 and SPORT5 and SPORT6 and SPORT7 work as pairs.
Clock Signal Options not allowed. Only standard DSP serial, left-justified sample pair, and I S modes support internal loopback. In loopback, each SPORT can be configured as transmitter or receiver, and each SPORT is capable of generating an internal frame sync and clock. Any of the four paired SPORTs can be set up to transmit or receive, depending on their bit configurations.
Serial Ports Frame Sync Options Framing signals indicate the beginning of each serial word transfer. A vari- ety of framing options are available on the SPORTs. The SPORTx_FS signals are independent and are separately configured in the control register. Framed Versus Unframed Frame Syncs The use of frame sync signals is optional in SPORT communications.
Frame Sync Options SPORTX_CLK FRAMED DATA UNFRAMED DATA Figure 5-7. Framed Versus Unframed Data Internal Versus External Frame Syncs Both transmit and receive frame syncs can be generated internally or input from an external source. The bit of the control registers deter- SPCTLx mines the frame sync source.
Serial Ports Active Low Versus Active High Frame Syncs Frame sync signals may be active high or active low (for example, inverted). The bit (bit 16) of the control registers determines SPCTLx the frame sync’s logic level: • When is cleared (=0), the corresponding frame sync signal is active high.
Frame Sync Options Early Versus Late Frame Syncs Frame sync signals can be early or late. Frame sync signals can occur dur- ing the first bit of each data word or during the serial clock cycle immediately preceding the first bit. The bit of the control LAFS...
Serial Ports SPORTX_CLK LATE FRAME SYNC EARLY FRAME SYNC DATA Figure 5-8. Normal Versus Alternate Framing Data-Independent Frame Syncs When transmitting data out of the SPORT ( = 1), the inter- SPTRAN nally-generated frame sync signal normally is output-only when the transmit buffer has data ready to transmit.
Frame Sync Options mode of operation allows data to be transmitted only at specific times. When = 0 and = 0, a receive signal is generated DIFS SPTRAN SPORTx_FS only when receive data buffer status is not full. When = 1 and = 1, the internally-generated transmit frame DIFS SPTRAN...
Serial Ports Unlike previous SHARC processors where programs had to poll the SPORT control registers, on the ADSP-21367/8/9 and ADSP-2137x pro- cessors, an interrupt is triggered and programs simply read the SPERRSTAT register (Figure 5-9). This reduces the processor overhead needed to do the register polling.
Page 324
Data Word Formats 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 SP0 FSERR Int Status Reserved SP1 FSERR Int Status SP7 FSERR Int Status SP2 FSERR Int Status SP3 FSERR Int Status SP4 FSERR Int Status SP5 FSERR Int Status SP6 FSERR Int Status...
Serial Ports Transmitting or receiving words smaller than 5 bits may cause incorrect operation when all the DMA channels are enabled with no DMA chaining. Endian Format Endian format determines whether serial words transmit MSB first or LSB first. Endian format is selected by the bit in the control regis- LSBF...
Data Word Formats Data Type field of the control registers specifies one of four data DTYPE SPCTLx formats (for non-multichannel operation) shown in Table 5-3. This bit field is reserved in I S and left-justified mode. In DSP serial mode, if com- panding is selected for primary A channel, the secondary B channel performs a zero-fill.
Serial Ports Linear transfers occur in the primary channel, if the channel is active and companding is not selected for that channel. Companded transfers occur if the channel is active and companding is selected for that channel. The multichannel compand select registers, , specify the transmit and SPxCCSy receive channels that are companded when multichannel mode is enabled.
Page 328
Data Word Formats When companding is enabled, the data in the buffers is the RXSPxA right-justified, sign-extended expanded value of the eight received LSBs. A write to compresses the 32-bit value to eight LSBs (zero-filled to TXSPxA the width of the transmit word) before it is transmitted. If the 32-bit value is greater than the 13-bit A-law or 14-bit μ-law maximum, it is automati- cally compressed to the maximum value.
Serial Ports With companding enabled, interfacing the SPORT to a codec requires lit- tle additional programming effort. If companding is not selected, two formats are available for received data words of fewer than 32 bits—one that fills unused MSBs with zeros, and another that sign-extends the MSB into the unused bits.
Page 330
SPORT Control Registers and Data Buffers Table 5-5 through Table 5-8 provides a complete list of the SPORT regis- ters in IOP address order, showing the memory-mapped IOP address and a brief description of each register. Table 5-5. SPORT0 and SPORT1 Registers Register Function Width...
Page 331
Serial Ports Table 5-5. SPORT0 and SPORT1 Registers (Cont’d) Register Function Width No. of Memory Map Name Registers [17:0] CP0A Chain Pointer for DMA Chaining 00C43 Channel 0A II0B Address for DMA Channel 0B 000C44 IM0B Internal Modifier for DMA Channel 0B 00C45 Counter for DMA Channel 0B 00C46...
Page 332
SPORT Control Registers and Data Buffers Table 5-5. SPORT0 and SPORT1 Registers (Cont’d) Register Function Width No. of Memory Map Name Registers [17:0] TX1B Transmitter FIFO Register in SP1B 00C66 RX1B Receiver FIFO Register in SP1B 00C67 Table 5-6. SPORT2 and SPORT3 Registers Register Function Width...
Page 333
Serial Ports Table 5-6. SPORT2 and SPORT3 Registers (Cont’d) Register Function Width No. of Memory Map Name Registers [17:0] IM2A Internal Modifier for DMA Channel 2A 00441 Counter for DMA Channel 2A 00442 CP2A Chain Pointer for DMA Chaining 00443 Channel 2A II2B Address for DMA Channel 2B...
Page 334
SPORT Control Registers and Data Buffers Table 5-6. SPORT2 and SPORT3 Registers (Cont’d) Register Function Width No. of Memory Map Name Registers [17:0] RX3A Receiver FIFO Register in SP3A 00465 TX3B Transmitter FIFO Register in SP3B 00466 RX3B Receiver FIFO Register in SP3B 00467 Table 5-7.
Page 335
Serial Ports Table 5-7. SPORT4 and SPORT5 Registers (Cont’d) Register Function Width No. of Memory Map Name Registers [17:0] II4A Address for DMA Channel 4A 00840 IM4A Internal Modifier for DMA Channel 4A 00841 Counter for DMA Channel 4A 00842 CP4A Chain Pointer for DMA Chaining 00843...
Page 336
SPORT Control Registers and Data Buffers Table 5-7. SPORT4 and SPORT5 Registers (Cont’d) Register Function Width No. of Memory Map Name Registers [17:0] TX5A Transmitter FIFO Register in SP5A 00864 RX5A Receiver FIFO Register in SP35A 00865 TX5B Transmitter FIFO Register in SP5B 00866 RX5B Receiver FIFO Register in SP5B...
Page 337
Serial Ports Table 5-8. SPORT6 and SPORT7 Registers (Cont’d) Register Name Function Width No. of Memory Map Registers [17:0] Reserved 0481A–0483F II6A Address for DMA Channel 6A 04840 IM6A Internal Modifier for DMA Channel 04841 Counter for DMA Channel 6A 04842 CP6A Chain Pointer for DMA Chaining...
Page 338
SPORT Control Registers and Data Buffers Table 5-8. SPORT6 and SPORT7 Registers (Cont’d) Register Name Function Width No. of Memory Map Registers [17:0] RX6A Receiver FIFO Register in SP6A 04861 TX6B Transmitter FIFO Register in SP6B 04862 RX6B Receiver FIFO Register in SP6B 04863 TX7A Transmitter FIFO Register in SP7A...
Serial Ports Serial Port Control Registers (SPCTLx) The main control registers for each SPORT are the SPORT control regis- ters, . These registers are described in “SPORT Serial Control SPCTLx Registers (SPCTLx)” on page A-29. When changing operating modes, clear the SPORT control registers before the new mode is written to the registers.
Page 340
SPORT Control Registers and Data Buffers Table 5-9. SPCTLx Control Bit Comparison in Four SPORT Operation Modes (Cont’d) Standard DSP Serial Mode Left-justified and I S Mode Multichannel Mode ICLK MSTR ICLK OPMODE OPMODE OPMODE CKRE Reserved CKRE Reserved Reserved Reserved IMFS DIFS...
Page 341
Serial Ports The following bits, listed in bit number order, control SPORT modes and are part of the (transmit and receive) control registers. Other bits SPCTLx in the registers set up DMA and I/O processor-related SPORT fea- SPCTLx tures. For information about configuring a specific operation mode, refer Table 5-1 on page 5-11 “Standard DSP Serial Mode”...
Page 342
SPORT Control Registers and Data Buffers This description applies only to DSP standard serial and multichannel modes only. Serial word endian select. registers, bit 3 ( ). This bit selects SPCTLx LSBF little endian words (LSB first, if set, = 1) or big endian words (MSB first, if cleared, = 0).
Page 343
Serial Ports Frame sync required select. registers, bit 13 ( ). This bit selects SPCTLx whether the SPORT requires (if set, = 1) or does not require (if cleared, = 0) a transfer frame sync. See “Frame Sync Options” on page 5-37 more details.
Page 344
SPORT Control Registers and Data Buffers Frame sync both enable. registers, bit 22 ( ). This bit SPCTLx FS_BOTH applies when the SPORTs channels A and B are configured to trans- mit/receive data. If set (= 1), this bit issues frame sync only when data is present in both transmit buffers, .
Page 345
Serial Ports When set (= 1), the SPORT is configured to transmit on both channels A and B. When configured to transmit, the buffers are TXSPxA TXSPxB activated, while the transmit shift registers are controlled by SPORTx_CLK . The buffers are inactive. This bit SPORTx_FS RXSPxA RXSPxB...
Page 346
SPORT Control Registers and Data Buffers Specifically, the operation of the bit is: ROVF • 0 = No new data while buffer is full. RXSPxA/B • 1 = New data while buffer is full. RXSPxA/B When the bit is cleared (the default setting), the frame sync signal DIFS ) is dependent upon new data being present in the transmit SPORTx_FS...
Serial Ports When the SPORT is configured as a transmitter, these bits reflect transmit buffer status for the buffers. When the TXSPxA TXSPxB SPORT is configured as a receiver, these bits reflect receive buffer status for the buffers. RXSPxA RXSPxB Transmit and Receive Data Buffers (TXSPxA/B, RXSPxA/B) The transmit buffers (...
Page 348
SPORT Control Registers and Data Buffers buffer is ready to accept the next word (for example, the transmit buffer is not full). This interrupt does not occur when SPORT DMA is enabled or when the corresponding mask bit in the register is set.
Serial Ports To support debugging buffer transfers, the ADSP-21367/8/9 and ADSP-2137x processors have a buffer hang disable ( ) bit. When set (= 1), this bit prevents the processor core from detecting a buffer-related stall condition, permitting debugging of this type of stall condition. For more information, see the bit description on on page...
Page 350
SPORT Control Registers and Data Buffers transmitters. The divisor is a 15-bit value, allowing a wide range of serial clock rates. Use the following equation to calculate the serial clock frequency: f CCLK --------------------------------------- SPORTx_CLK 8 CLKDIV The maximum serial clock frequency is equal to one-eighth the processor’s internal clock ( ) frequency, which occurs when is set to zero.
Serial Ports Use the following equation to determine the value of , given the FSDIV serial clock frequency and desired frame sync frequency: SPORTx_CLK --------------------------- - 1 – FSDIV SPORTx_FS The frame sync is continuously active when = 0. The value of FSDIV FSDIV should not be less than the serial word length minus one (the value of the...
SPORT Control Registers and Data Buffers A software reset of the enable bit disables the SPORT(s) SPEN_A SPEN_B and aborts any ongoing operations. Status bits are also cleared. The SPORTs are ready to start transmitting or receiving data two serial clock cycles after they are enabled in the registers.
Serial Ports SPORT interrupts occur on the second system clock ( ) after the last CLKIN bit of the serial word is latched in or driven out. Moving Data Between SPORTs and Internal Memory Transmit and receive data can be transferred between the SPORTs and on-chip memory with single word transfers or with DMA block transfers.
Page 354
Moving Data Between SPORTs and Internal Memory Table 5-11. Serial Port DMA Channels Channel Data Buffer Description Priority RXSP1A/TXSP1A SPORT1 A data Highest RXSP1B/TXSP1B SPORT1 B data RXSP0A/TXSP0A SPORT0 A data RXSP0B/TXSP0B SPORT0 B data RXSP3A/TXSP3A SPORT3 A data RXSP3B/TXSP3B SPORT3 B data RXSP2A/TXSP2A SPORT2 A data...
Serial Ports Although the DMA transfers are performed with 32-bit words, SPORTs can handle word sizes from 3 to 32 bits, with 8 to 32 bits for I S mode. If serial words are 16 bits or smaller, they can be packed into 32-bit words for each DMA transfer.
Moving Data Between SPORTs and Internal Memory Table 5-12. SPORT DMA Parameter Registers Register Width Description (Y = A or B, and x = 0 – 5) IISPxy 19 bits DMA channel; x index; start address for data buffer IMSPxy 16 bits DMA channel;...
Page 357
Serial Ports The DMA channels operate similarly to the processor’s data address gen- erators (DAGs). Each channel has an index register ( ) and a modify IISPxy register ( ) for setting up a data buffer in internal memory. It is nec- IMSPxy essary to initialize the index register with the starting address of the data buffer.
Page 358
Moving Data Between SPORTs and Internal Memory Table 5-13. SPORT DMA Parameter Registers Addresses (Cont’d) Register Address DMA Channel SPORT Buffer IMSP1A 0xC49 RXSP1A or TXSP1A CSP1A 0xC4A RXSP1A or TXSP1A CPSP1A 0xC4B RXSP1A or TXSP1A IISP1B 0xC4C RXSP1B or TXSP1B IMSP1B 0xC4D RXSP1B or TXSP1B...
Page 359
Serial Ports Table 5-13. SPORT DMA Parameter Registers Addresses (Cont’d) Register Address DMA Channel SPORT Buffer Reserved IISP4A 0x840 RXSP4A or TXSP4A IMSP4A 0x841 RXSP4A or TXSP4A CSP4A 0x842 RXSP4A or TXSP4A CPSP4A 0x843 RXSP4A or TXSP4A IISP4B 0x844 RXSP4B or TXSP4B IMSP4B 0x845 RXSP4B or TXSP4B...
Page 360
Moving Data Between SPORTs and Internal Memory Table 5-13. SPORT DMA Parameter Registers Addresses (Cont’d) Register Address DMA Channel SPORT Buffer CPSP6B 0x4847 RXSP6B or TXSP6B IISP7A 0x4848 RXSP7A or TXSP7A IMSP7A 0x4849 RXSP7A or TXSP7A CSP7A 0x484A RXSP7A or TXSP7A CPSP7A 0x484B RXSP7A or TXSP7A...
Serial Ports Therefore, set the direction bit, the SPORT enable bit, and DMA enable bits before initiating any operations on the SPORT data buffers. If the processor operates on the inactive transmit or receive buffers while the SPORT is enabled, it can cause unpredictable results. SPORT DMA Chaining In chained DMA operations, the processor’s DMA controller automati- cally sets up another DMA transfer when the contents of the current...
SPORT Programming Examples To avoid hanging the processor core, check the buffer’s full/empty status when the processor core’s program reads a word from a SPORT’s receive buffer or writes a word to its transmit buffer. The full/empty status can be read in the bits of the registers.
Page 363
Serial Ports The third listing, Listing 5-3, transmits a buffer of data from SPORT1 using DMA chaining and the internal loopback feature of the SPORT0 SPORT. In this example, drives the clock and frame sync, and the SPORT5 two TCBs for each are set up to ping-pong back and forth to con- SPORT tinually send and receive data.
Page 371
Serial Ports _main: SPORT Loopback: Use SPORT0 as RX & SPORT1 as TX /* initially clear SPORT control register */ r0 = 0x00000000; dm(SPCTL0) = r0; dm(SPCTL1) = r0; dm(SPMCTL1) = r0; SPORT_DMA_setup: /* set internal loopback bit for SPORT0 & SPORT1 */ bit set ustat3 SPL;...
Page 372
SPORT Programming Examples SLEN32| /* 32-bit word length */ FSR| /* Frame Sync Required */ SDEN_A| /* Enable Channel A DMA */ SCHEN_A; /* Enable Channel A DMA Chaining */ dm(SPCTL0) = ustat3; /* Next TCB location for tx_tcb2 is tx_tcb1 */ /* Mask the first 19 bits of the TCB location */ r0 = (tx_tcb1 + 3) &...
6 SERIAL PERIPHERAL INTERFACE PORTS The ADSP-21367/8/9 and ADSP-2137x processors are equipped with two synchronous serial peripheral interface ports that are compatible with the industry-standard serial peripheral interface (SPI). The SPI ports are routed through the digital peripheral interface pins (DPI14–1). At reset, SPI functionality is available on DPI pins 1–8.
Functional Description • Programmable baud rates, clock polarities, and phases • Master or slave booting from a master SPI device (“DPI/SRU2 Connection Groups” on page 4-51) • DMA capability to allow data transfers without core overhead Functional Description Each SPI port contain its own transmit shift ( ) and receive TXSR TXSRB...
Page 375
Serial Peripheral Interface Ports SPIDS MOSI MISO SPICLK FLAGX SPI INTERNAL SPI INTERFACE LOGIC CLOCK GENERATOR SPISTAT SPICTL RXSR TXSR RX SHIFT REGISTER TX SHIFT REGISTER TXSPI RXSPI TRANSMIT RECEIVE REGISTER REGISTER SPI IRQ OR DM DATA BUS DMA REQUEST PM DATA BUS I/0 DATA BUS Figure 6-1.
SPI Interface Signals through their pins. The SPI ports also provide a mechanism to dis- SPIDS able the pin for multimaster systems where the slave SHARC MISO processor does not need to transmit any data to the master. SPI Interface Signals The SPI uses a 4-wire protocol to enable full-duplex serial communica- tion.
Serial Peripheral Interface Ports signal is a gated clock that is active only during data transfers, SPICLK and only for the duration of the transferred word. The number of active edges is equal to the number of bits driven on the data lines. The clock rate can be as high as one-fourth the peripheral clock rate.
SPI Interface Signals SPI CLK CPHASE =0 SPIDS TO SLAVE Figure 6-3. SPICLK Timing SPI Slave Select Input (SPIDS) signal is the serial peripheral interface device select input signal. SPIDS This active low signal is used to enable a processor that is configured as a slave device.
Serial Peripheral Interface Ports Master Out Slave In (MOSI) pin is one of the bidirectional I/O data pins. If the MOSI ADSP-21367/8/9 and ADSP-2137x processors are configured as masters, pin becomes a data transmit (output) pin. If the processors are MOSI configured as slaves, the pin becomes a data receive (input) pin.
Serial Peripheral Interface Ports SPI Enable For slaves, the slave-select input acts like a reset for the internal SPI logic. For this reason, the line must be error free. The signal can SPIDS SPIEN also be used as a software reset of the internal SPI logic. An exception to this is the W1C-type (write 1-to-clear) bits in the (SPI status) SPISTATx...
SPI General Operations Master Mode Operation When the SPI is configured as a master, configure the SPI port and start transfers using the following steps: 1. Before enabling the SPI port, programs should specify which of the slave-select signals to use, setting one or more of the required SPI flag select bits ( ) in the registers.
Serial Peripheral Interface Ports In master mode, if the transmit buffer remains empty, or the receive buffer remains full, the device operates according to the states of the SENDZ bits in the registers. SPICTLx • If = 1 and the transmit buffer is empty, the device repeatedly SENDZ transmits zeros on the pin.
SPI General Operations Once the signal’s falling edge is detected, the slave starts SPIDS sending and receiving data on active edges. SPICLK The reception or transmission continues until is released. SPIDS The slave device continues to receive or transmit with each new active clock edge while the signal is active.
Serial Peripheral Interface Ports immediately reconfigured as a slave. In order to safely transition from one master to the other, the SPI port uses open drain outputs for the data pin drivers. This helps to avoid possible damage from data contention. More information on this topic is described in “Mode Fault Error (MME)”...
SPI Data Transfer Operations • When a master is configured with = 00 and the receive buffer TIMOD becomes full the SPI device stalls the SPI clock until all of the data is read from the receive buffer. SPI Operation Using DMA Each SPI has a single DMA channel associated with it that can be config- ured to support either an SPI transmit or a receive, but not both simultaneously.
Serial Peripheral Interface Ports SPI transfers. For example, the registers should not be used as a TXSPIx scratch register for temporary data storage. Writing to the registers TXSPIx sets the bit. When the SPI DMA engine is configured for transmitting: 1.
Page 388
SPI Data Transfer Operations 4. For a single DMA, define the parameters of the DMA transfer by writing to the , and registers. For DMA IISPIx IMSPIx CSPIx chaining, also write the chain pointer address to the regis- CPSPIx ters after the other DMA registers. For more information, see “Setting Up and Starting Chained DMA over the SPI”...
Page 389
Serial Peripheral Interface Ports 3. The SPI generates the signal (as specified by SPICLK CPHASE , and other bit settings) and the data is shifted out of SPIBAUD MOSI and in from simultaneously. MISO 4. The SPI continues sending or receiving words until the SPI DMA word count register decrements to 0.
Page 390
SPI Data Transfer Operations Master Transfer Preparation When the processor is enabled as a master, the initiation of a transfer is defined by the two bit fields (bits 1–0) of in the registers. TIMOD SPICTLx Based on these two bits and the status of the interface, a new transfer is started upon either a read of the registers or a write to the RXSPIx...
Serial Peripheral Interface Ports Slave Mode DMA Operation A slave mode DMA transfer occurs when the SPI port is enabled and con- figured in slave mode, and DMA is enabled. When the signal SPIDS transitions to the low state or when the first active edge of SPICLK detected, it triggers the start of a transfer.
Page 392
SPI Data Transfer Operations Slave Transfer Preparation When enabled as a slave, the device prepares for a new transfer according to the function and actions described in Table 6-1. The following steps illustrate the SPI receive or transmit DMA sequence in an SPI slave in response to a master command: 1.
Serial Peripheral Interface Ports transmit port operates according to the state of the SENDZ in the registers. SPICTLx = 1 and the DMA buffer is empty, the device SENDZ repeatedly transmits zeros on the pin. If = 0 and MISO SENDZ the DMA buffer is empty, it repeatedly transmits the last word it transmitted before the DMA buffer became empty.
Page 394
SPI Data Transfer Operations configuration. In this case, the slave is always selected. Data cor- ruption can be avoided by enabling the slave only after configuring both the master and slave devices. When performing transmit operations with the SPI port, disabling the SPI port prematurely can cause data corruption and/or faulty transmission.
Serial Peripheral Interface Ports 3. Wait for the SPI shift register to finish transferring the last word. This is done when the bit (bit 0 of the registers), SPIF SPISTATx becomes one. 4. Disable the SPI ports by setting the bit (bit 0 of the SPIEN SPICTLx...
SPI Data Transfer Operations 3. Clear all errors by writing to the W1C-type bits in the SPISTATx registers. This ensures that no interrupts occur due to errors from a previous DMA operation. 4. Reconfigure the register to remove the clear condition on SPICTL registers.
Serial Peripheral Interface Ports Without disabling the SPI: 1. Clear the registers and the buffer status without dis- RXSPIx TXSPIx abling the SPI by ORing 0xc0000 with the present value in the registers. Use the (bit 19) and (bit 18) bits SPICTLx RXFLSH TXFLSH...
Page 398
SPI Data Transfer Operations With disabling the SPI: 1. Disable the SPI port by writing 0x00 to the registers. SPICTLx 2. Disable DMA and clear the FIFO by writing 0x80 to the SPIDMACx registers. This ensures that any data from a previous DMA opera- tion is cleared before configuring a new DMA operation.
Serial Peripheral Interface Ports 5. Configure DMA by writing to the DMA parameter registers and register. SPIDMACx DMA Chaining For information about chaining, refer to “Setting Up and Starting Chained DMA over the SPI” on page 2-42. SPI Transfer Formats The SPI ports support four different combinations of serial clock phases and polarity.
Page 400
SPI Transfer Formats When = 0, the slave select line, , must be inactive ( CPHASE SPIDS HIGH between each word in the transfer. When = 1, may either CPHASE SPIDS remain active ( ) between successive transfers or be inactive ( HIGH Figure 6-5 shows the SPI transfer protocol for...
Serial Peripheral Interface Ports CLO CK CYCLE NUMBE R SP ICLK CLKPL=0 (SP I MODE 1 ) SP ICLK CLKPL=1 (SP I MODE 3 ) MOSI MS B FROM MASTE R MISO FROM SLAVE MS B SP IDS TO SLAVE * = UNDEF INED Figure 6-6.
Page 402
SPI Transfer Formats bit defines when the receive buffer can be read. The defines when the transmit buffer can be filled. The end of a single word transfer occurs when the bit is set. This indicates that a new word has been received and latched into the receive buffer, .
Serial Peripheral Interface Ports SPI Word Lengths The processor’s SPI port can transmit and receive the word widths described in the following sections. 8-Bit Word Lengths Programs can use 8-bit word lengths when transmitting or receiving. When transmitting, the SPI port sends out only the lower eight bits of the word written to the SPI buffer.
SPI Word Lengths 16-Bit Word Lengths Programs can use 16-bit word lengths when transmitting or receiving. When transmitting, the SPI port sends out only the lower 16 bits of the word written to the SPI buffer. For example, if the processor executes the following instructions: r0 = 0x12345678 dm(TXSPI) = r0;...
Serial Peripheral Interface Ports When the SPI port is transmitting, two eight-bit words are unpacked from one 32-bit word. When receiving, words are packed into one 32-bit word from two eight-bit words. An example of unpacking the data before transmitting: The value (where is any random value and...
Page 406
SPI Interrupts During IOP-driven transfers (DMA), an SPI interrupt is triggered: 3. At the completion of a single DMA transfer, 4. At the completion of a number of DMA sequences (if DMA chain- ing is enabled), 5. When a DMA error has occurred. Again, the register must be initialized properly to enable DMA SPIDMAC...
Serial Peripheral Interface Ports • See “Interrupt Registers” on page B-6 register IRPTL LIRPTL bit descriptions. • See “SPI DMA Configuration Registers (SPIDMAC, SPID- MACB)” on page A-62 register bit descriptions. SPIDMAC Error Signals and Flags This section describes the error signals and flags that determine the cause of transmission errors for an SPI port.
Page 408
Error Signals and Flags The SPI ports are able to respond appropriately to this situation. To enable this feature, set the bit in the register. As soon as this ISSEN SPICTL error is detected, the following actions are taken: 1. The control bit in is cleared, configuring the SPI SPIMS...
Serial Peripheral Interface Ports Transmission Error Bit (TUNF) bit is set in the register when all of the conditions of TUNF SPISTAT transmission are met and there is no new data in the buffer ( TXSPI TXSPI empty). In this case, the transmission contents depend on the state of the bit in the register.
Programming Notes Programming Notes The following sections provide information to help the programmer use the SPI in an ADSP-21367/8/9 and ADSP-2137x processor system. Routing SPI Signals Using The DPI All signals of both SPI ports are routed to the DPI pins using the SRU2. Special considerations must be made when routing the signals, especially with regards to using the correct pin enables that work with the SPI mode being used.
7 INPUT DATA PORT The signal routing unit (SRU) provides paths among both on-chip and off-chip peripherals. To make this feature effective in a real-world system, a low overhead method of making data from various serial and parallel for- mats and routing them back to the main core memory is needed. The input data port (IDP) provides this mechanism for a large number of asynchronous channels.
Page 420
PARALLEL DATA HANDLING PDAP HOLD Serial DATA Parallel SMODE0 Converter Serial DATA Parallel SMODE1 Converter Serial DATA Parallel SMODE2 Converter Serial FIFO DATA Parallel (8x32) SMODE3 Converter DATA IDP_FIFO (8x3) CH. I/O Serial DATA Parallel SMODE4 Converter Serial DATA Parallel SMODE5 Converter Serial...
Input Data Port DATA [31:12] [19:0] PACKING DAI PINS UNIT [20:1] FIFO SERIAL INPUT PARALLEL DATA ACQUISITION PORT PDAP ENABLE Figure 7-2. Detail of IDP Channel 0 The IDP’s DMA engine implements DMA for all eight channels. Each of the eight channels has a set of DMA parameter registers for directing the data to memory location.
Page 422
Serial Inputs An audio signal that is normally 24 bits wide is contained within the 32-bit word. Four more bits are available for status and formatting data (compliant with the IEC 90958, S/PDIF, and AES3 standards). An addi- tional bit identifies the left/right one-half of the frame. If the data is not in IEC standard format, the serial data can be any data word up to 28 bits wide.
Page 423
Input Data Port Table 7-1. Serial Modes Bit Field Values Mode IDP_SMODEx Left-justified sample pair Left-justified 32 bits. This is a single data and not a left/right channel pair. It can be read as 32-bit data. S-32 bit. This is a single data and not a left/right channel pair.
Page 424
Serial Inputs Channel 20-Bit Spare Bits (11–4) Encoding Audio Set to LOW Bits (2–0) Data (31–12) L/R Encoding Figure 7-6. FIFO Data Packing for Right-Justified (20-Bit Data) Channel 18-Bit Spare Bits (13–4) Encoding Audio Set to LOW Bits (2–0) Data (31–14) L/R Encoding Figure 7-7.
Page 425
Input Data Port Figure 7-10 shows the relationship between frame sync, serial clock, and left-justified sample pair data. SERIAL CLOCK IDPx_CLK_I FRAME SYNC (L/R) IDPx_FS_I LEFT-JUSTIFIED SAMPLE PAI R LSB n-1 MSB n LSB n MSB n SERIAL DATA IDPx_DAT_I FRAME [n-1] F RAME [n] FRAME [n]...
Page 426
Parallel Data Acquisition Port (PDAP) Parallel Data Acquisition Port (PDAP) The input to channel 0 of the IDP is multiplexed, and may be used either in the serial mode, described in “Serial Inputs” on page 7-3, or in a direct parallel input mode.
Input Data Port (bit 26 in the register) selects between the two sets of pins that IDP_PP_CTL may be used as the parallel input port. When is set (= 1), IDP_PORT_SELECT the data bits are read from and the control signals come from DATA31–12 .
Input Data Port Packing Mode 01 Mode 01 packs three acquired samples together. Since the resulting 32-bit word is not divisible by three, up to 10 bits are acquired on the first clock edge and up to 11 bits are acquired on each of the second and third clock edges: •...
Parallel Data Acquisition Port (PDAP) Clocking Edge Selection Notice that in all four packing modes described, data is read on a clock edge, but the specific edge used (rising or falling) is not indicated. Clock edge selection is configured using the bit (bit 29 of the IDP_PDAP_CLKEDGE register).
Page 431
Input Data Port PDAP_CLK PDAP_DAT[19:12] PDAP_HOLD PDAP_CLK PDAP_DAT[19:12] PDAP_HOLD Figure 7-14. Hold Timing for Four 8-Bit Words to 32 Bits (Mode 00) ADSP-21368 SHARC Processor Hardware Reference 7-13...
Parallel Data Acquisition Port (PDAP) PDAP_CLK PDAP_DAT[19:4] PDAP_HOLD PDAP_CLK PDAP_DAT[19:4] PDAP_HOLD Figure 7-15. Hold Timing for Two 16-Bit Words to 32 Bits (Mode 10) As shown in Figure 7-15, are driven by the PDAP_DATA PDAP_HOLD inactive edges of the clock (falling edge in the above figures) and these sig- nals are sampled by the active edge of the clock (rising edge in the above figures).
Input Data Port FIFO Control and Status Several bits can be used to control and monitor FIFO operations: • IDP Enable. The bit (bit 7 of the register) IDP_ENABLE IDP_CTL0 enables the IDP. This is a global control bit. This bit and the corre- sponding IDP channel enable bit ( ) in the IDP_ENx...
FIFO to Memory Data Transfer bit (= 1) prevents the core from hanging on reads from an empty IDP_BHD register. Clearing this bit (= 0) causes the core to hang under the IDP_FIFO conditions described previously. bits track the number of words in the FIFO. This 4-bit IDP_FIFOSZ field identifies the number of valid data samples in the IDP FIFO.
Input Data Port A mechanism is provided to generate an interrupt when more than a specified number of words are in the FIFO. This interrupt signals the core to read the register. IDP_FIFO This method of moving data from the IDP FIFO is described in the next section, “IDP Transfers Using the Core”.
FIFO to Memory Data Transfer Starting an Interrupt-Driven Transfer To start an interrupt-driven transfer: 1. Clear and halt FIFO by setting (= 1) and clearing (= 0) the bit (bit 7 in the register). IDP_ENABLE IDP_CTL0 2. Set the required values for: •...
Page 437
Input Data Port 6. Set the bit (bit 8 of the register) IDP_FIFO_GTN_INT DAI_IRPTL_RE and set the corresponding bit in the register HIGH DAI_IRPTL_FE to low to unmask the interrupt. Set bit 8 of the reg- DAI_IRPTL_PRI ister ( ) as needed to generate a high priority or IDP_FIFO_GTN_INT low priority core interrupt when the number of words in the FIFO is greater than the value of N set.
FIFO to Memory Data Transfer • When the data transfer to the core is 32 bits, as in the case of PDAP data or I S and left-justified modes with 32 bits, there is no channel information in the data. Therefore, PDAP or I S and left-justified 32 bit modes can not be used with other channels in the core/interrupt-driven mode.
Page 439
Input Data Port • Index registers ( IDP_DMA_Ix • Modifier registers ( IDP_DMA_Mx • Counter registers ( IDP_DMA_Cx For each of these registers, x is 0 to 7. Refer to “DMA Channel Parameter Registers” on page 7-27. 3. Keep the clock and the frame sync input of the serial inputs and/or the PDAP connected to low, by setting proper values in the , and registers.
FIFO to Memory Data Transfer 6. Enable DMA, IDP, and PDAP (if required) by setting each of the following bits = 1: • bit (bit 5 of the register) IDP_DMA_EN IDP_CTL0 • bits in register to enable the DMA of IDP_DMA_ENx IDP_CTL1 the selected channel...
Page 441
Input Data Port Starting Ping-Pong DMA Transfers To start a ping-pong DMA transfer from the FIFO to memory: 1. Clear and halt the FIFO by setting (= 1) and then clearing (= 0) the bit (bit 7 in the register). IDP_ENABLE IDP_CTL0 2.
Page 442
FIFO to Memory Data Transfer • bits in the register to specify IDP_Pxx_PDAPMASK IDP_PP_CTL the input mask, if the PDAP is used. For more information, see “Parallel Data Acquisition Port Control Register (IDP_PP_CTL)” on page A-74. • bits in the register to specify IDP_PORT_SELECT IDP_PP_CTL...
Input Data Port DMA Transfer Notes The following items provide general information about DMA transfers. • A DMA can be interrupted by changing the bit in the IDP_DMA_EN register. None of the other control settings (except for IDP_CTL0 bit) should be changed. Clearing the IDP_ENABLE IDP_DMA_EN bit (= 0) does not affect the data in the FIFO, it only stops DMA...
Page 444
FIFO to Memory Data Transfer When an overflow occurs, incoming data from IDP channels is not accepted into the FIFO, and data values are lost. New data is only accepted once space is again created in the FIFO. • For serial input channels, data is received in an alternating fashion from left and right channels.
Input Data Port register. Reading these DAI shadow registers DAI_IRPTL_L ) does not destroy the con- DAI_IRPTL_H_SH DAI_IRPTL_L_SH tents of the registers. DAI_IRPTL_H DAI_IRPTL_L • The IDP can run both simple and ping-pong DMAs in different channels. When running simple DMA, initialize the corresponding , and registers.
FIFO to Memory Data Transfer The IDP DMA parameter registers have these functions: • Internal index registers ( IDP_DMA_Ix IDP_DMA_AIx IDP_DMA_BIx Index registers provide an internal memory address, acting as a pointer to the next internal memory location where data is to be written.
Page 447
Input Data Port The following steps describe how an IDP ISR is handled. 1. When the DMA for a channel completes, an interrupt is generated and program control jumps to the ISR. 2. The program clears the bit in the register IDP_DMA_EN IDP_CTL0...
FIFO to Memory Data Transfer 5. Read the registers to see if more inter- DAI_IRPTL_L DAI_IRPTL_H rupts have been generated. • If the value(s) are not zero, repeat step 4. • If the value(s) are zero, continue to step 6. 6.
Input Data Port Input Data Port Programming Example Listing 7-1 shows a data transfer using an interrupt service routine (ISR). The transfer takes place through the digital applications interface (DAI). This code implements the algorithm outlined in “FIFO to Memory Data Transfer”...
Page 450
Input Data Port Programming Example dm(IDP_CTL0) = r0; /*************************************************/ /* Connect the clock, data and frame sync of IDP */ channel 0 to DAI pin buffers 10, 11 and 12. */ /*************************************************/ Connect IDP0_CLK_I to DAI_PB10_O (SRU_CLK1[19:15] = 01001) Connect IDP0_DAT_I to DAI_PB11_O (SRU_DAT3[11:6] = 001010) Connect IDP0_FS_I to DAI_PB12_O (SRU_FS1[19:15] = 01011)
Page 451
Input Data Port r0 = dm(IDP_CTL0); /* N_SET = 6 */ r0 = BSET r0 BY 0; r0 = BSET r0 BY 1; r0 = BSET r0 BY 2; r0 = BCLR r0 BY 3; dm(IDP_CTL0) = r0; r0 = dm(DAI_IRPTL_RE); /* Unmask for rising edge */ r0 = BSET r0 BY IDP_FIFO_GTN_INT;...
Page 452
Input Data Port Programming Example 7-34 ADSP-21368 SHARC Processor Hardware Reference...
8 PULSE WIDTH MODULATION Pulse width modulation (PWM) is a technique for controlling analog cir- cuits with a microprocessor’s digital outputs. PWM is employed in a wide variety of applications, ranging from measurement to communications to power control and conversion. One of the advantages of PWM is that the signal remains digital all the way from the processor to the controlled system;...
PWM Implementation PWMGSTAT GLOBAL REGISTERS PWMGCTL PWMSTAT CONFIGURATION DUTY CYCLE REGISTERS REGISTERS PWMCHA PWMTM PWMDT PWMCHB PWMCTRL PWMSEG PHB BUS PWMSEG PWM_AH Gate Output Dead PWM_AL Drive Control Time Timing PWM_BH Unit Unit Control Unit PWM_BL Unit SYNC SYNC SR RESET Interrupt Control Unit PWM_SYNC_IRQ...
Pulse Width Modulation of period, it is equal to period ÷ 2 (rounded up). Therefore, for a duty value programmed in two’s-complement, the PWM pulse width is given ÷ Width period duty To generate constant logic high on PWM output, program the duty regis- ter with the value ≥...
Page 456
PWM Implementation Center-aligned, paired mode. Generates complementary signals on two outputs. Center-aligned, non-paired mode. Generates complementary signals on independent signals. In paired mode, the two’s-complement integer value in the 16-bit read/write duty cycle registers, ( ), control the duty cycles PWMAx PWMBx of the four PWM output signals on the...
Pulse Width Modulation registers of that group. The period completion status bits in the PWM_GSTAT register are set independently of the corresponding bit, but PWM_IRQEN interrupt generation depends on the bit. PWM_IRQEN Switching Frequencies The 16-bit read/write PWM period registers, ( ), control the PWMPERIOD3–0 PWM switching frequency.
PWM Implementation The largest value that can be written to the 16-bit register is PWMPERIODx 0xFFFF = 65,535 which corresponds to a minimum PWM switching fre- quency of: × ----------------------- - 763Hz × ) min 65535 Also note that values of 0 and 1 are not defined and should not PWMPERIOD be used when the PWM outputs or PWM sync is enabled.
Pulse Width Modulation maximum value they can contain is 0x3FF (= 1023) which corresponds to a maximum programmed dead time of: 9 – × × × × × T d max 1023 1023 20.5μs PCLK This equates to an f rate of 100 MHz.
PWM Implementation Duty Cycles and Dead Time A typical pair of PWM outputs (in this case for ) from pwm_ah pwm_al the timing unit are shown in Figure 8-2 for operation in single-update mode. All illustrated time values indicate the integer value in the associ- ated register and can be converted to time by simply multiplying by the fundamental time increment, (t ) and comparing this to the...
Page 461
Pulse Width Modulation PWMPERIOD PWMPERIOD PWMPERI OD count PWMCHA PWMCHA pwm_ ah pwm_a l PWMSYNCWT + 1 2xPWMDT 2xPWMDT pw m_pwm sync_out PWMP HASE PWMPERIOD PWMPERIOD Figure 8-2. Center-Aligned Paired PWM in Single-Update Mode, Low Polarity The resulting on-times (active low) of the PWM signals over the full PWM period (two half periods) produced by the PWM timing unit and illustrated in Figure 8-3 on page 8-11...
Page 462
PWM Implementation The range of T × × – PWMPERIOD t PCLK and the corresponding duty cycles are: – PWMCHA PWMDT -------------------------------------------------- - ------- - -- - PWMPERIOD – PWMCHA PWMDT -------------------------------------------------- - ------ - -- - PWMPERIOD The minimum permissible value of T and T is zero, which corre- sponds to a 0% duty cycle, and the maximum value is T...
PWM Implementation where subscript 1 refers to the value of that register during the first half cycle and subscript 2 refers to the value during the second half cycle. The corresponding duty cycles are: – – PWMCHA PWMCHA PWMDT PWMDT --------- - -- - ---------------------------------------------------------------------------------------------------------------------------------------...
Page 465
Pulse Width Modulation • Full on. The PWM for any pair of PWM signals is said to operate in full on when the desired high side output of the three-phase tim- ing unit is in the on state (low) between successive rising PWMSYNC edges.
Page 466
PWM Implementation Figure 8-4 illustrates two examples of such transitions. In Figure 8-4 (A), when transitioning from normal modulation to full on at the half cycle boundary in double-update mode, no special action is needed. However, Figure 8-4 (B), when transitioning into full off at the same boundary, an additional emergency dead time is necessary.
Pulse Width Modulation Update Modes Update modes determine the frequency with which the waveforms are sampled. Single Update In this mode, duty cycle values are programmable only once per PWM period, so that the resultant PWM patterns are symmetrical about the midpoint of the PWM period.
PWM Implementation PWM Pins and Signals The entire PWM module has four groups of four PWM outputs, for a total of 16 PWM outputs. The modules are controlled by the PWM_AH pins which produce high side drive signals and the PWM_BH PWM_AL pins which produce low side drive signals.
Pulse Width Modulation unit so that the signal ultimately appears at the pin. The corresponding low side output of the timing unit is also diverted to the complementary high side output of the output control unit so that the signal appears at pin.
PWM Registers Table 8-1. PWM Accuracy in Single and Double-Update Modes (Cont’d) Resolution (bits) Single-Update Mode Double-Update Mode PWM Frequency (kHz) PWM Frequency (kHz) 24.4 48.8 12.2 24.4 12.2 3.05 PWM Registers The registers described below control the operation and provide the status of pulse width modulation on the ADSP-21367/8/9 and ADSP-2137x processors.
Pulse Width Modulation • PWM period registers. The registers are 16-bit, PWMPERIOD3–0 read/write registers that control the period of the four PWM groups. • PWM dead time registers. The registers are 16-bit, PWMDT3–0 read/write registers that are used to set the switching dead time. •...
PWM Registers • The two’s-complement integer value in the registers controls PWMAx the duty cycle of the signals on the pins. pwm_ah pwm_al • The two’s-complement integer value in the registers control PWMBx the duty cycle of the signals on pins.
Pulse Width Modulation Programming Example The following program shows the four steps used to configure a PWM module. Listing 8-1. Generic PWM Configuration Example #include "def21369.h" .global start; /* define for PWM frequency used in PWMPERIOD0 */ #define fPWM 0x1388; /* 200MHz/2(20kHz) =>...
Page 474
Programming Example /* 1. Configure frequency */ ustat3=fPWM; /* fPCLK/2xfPWM */ dm(PWMPERIOD0)=ustat3; /* PWM Period Register for switching frequency (unsigned integer) */ /* 2. Configure duty cycles Width=[period/2] + duty program in the two’s-complement of the high side width for individual con- trol this only programs AH signal.
Page 475
Pulse Width Modulation /* PWM enables */ PWM_enables: ustat3=dm(SYSCTL); /* System Control Register */ bit set ustat3 PWM0EN | PPFLGS; dm(SYSCTL)=ustat3; /* Selects AD11–8 in PWM0 mode instead of PP mode */ ustat3=dm(PWMSEG0); /* PWM Output Enable. Should probably be changed to PWM Output Disable since you write it to disable it.
Page 476
Programming Example 8-24 ADSP-21368 SHARC Processor Hardware Reference...
Page 477
9 S/PDIF TRANSMITTER/RECEIVER S/PDIF (Sony/Philips Digital Interface) is a standard audio data transfer format that allows the transfer of digital audio signals from one device to another without having to be converted to an analog signal. The ADSP-21367/8/9 and ADSP-2137x processors have AES3-compliant S/PDIF receivers/transmitters that allow programs to interface to other S/PDIF devices.
AES3/SPDIF Stream Format • In regards to handling channel status information, the SPDIF transmitter can operate in standalone and full serial modes. In stan- dalone mode, channel status bits, user bits, and validity bits are taken from the corresponding buffers or control register. In full serial mode, all these bits are transferred with data bits from the pin.
S/PDIF Transmitter/Receiver A frame is uniquely composed of two subframes. The first subframe nor- mally starts with preamble X. However, the preamble changes to preamble Z once every 192 frames. This defines the block of frames structure used to organize the channel status information. The second subframe always starts with preamble Y.
Page 480
AES3/SPDIF Stream Format 24-BIT AUDIO WORD 20-BIT AUDIO WORD Figure 9-2. Subframe Format and the for channel 2) bit is set in the VALIDITY_A VALIDITY_B register. This bit is also set if the corresponding bit SPDIF_TX_CTL given with the sample is set. 2.
S/PDIF Transmitter/Receiver Channel status information is organized in 192-bit blocks, subdi- vided into 24 bytes. The first bit of each block is carried in the frame with preamble Z. For convenience, the first five bytes of the channel status may be written all at once to control registers for both channels A and B , and ).
AES3/SPDIF Stream Format Each bit to be transmitted is represented by a symbol comprising two con- secutive binary states. The first state of a symbol is always different from the second state of the previous symbol. The second state of the symbol is identical to the first if the bit to be transmitted is logic 0.
S/PDIF Transmitter/Receiver A set of three preambles, shown in Table 9-1, are used. These preambles are transmitted in the time allocated to four time slots at the start of each subframe (time slots 0 to 3) and are represented by eight successive states. The first state of the preamble is always different from the second state of the previous symbol (representing the parity bit).
Page 484
S/PDIF Transmitter The S/PDIF transmitter output may be routed to an output pin through SRU1 and then routed to another S/PDIF receiver or to components for off-board connections to other S/PDIF receivers. The output is also avail- able to the S/PDIF receiver for loop-back testing through SRU1. TRANSMITTER CONTROL REGISTER...
S/PDIF Transmitter/Receiver In SCDF mode, the transmitter sends successive audio samples of the same signal across both subframes, instead of channel A and B. This mode also allows programs to select which channel is sent when using bits in the S/PDIF transmit control register.
S/PDIF Transmitter SRU1 Signals for the S/PDIF Transmitter To use the transmitter, route the five required inputs using SRU1 as described below. Also, use SRU1 to connect the two outputs, bi-phase encoded output, and block start to the desired DAI (digital audio inter- face) pin.
Page 487
S/PDIF Transmitter/Receiver DIT_HFCLK_I is the oversampling clock. This clock is divided down according to the bit in the transmitter control register to gener- FREQMULT ate the bi-phase clock. It can also be selected from various sources since it is routed through SRU1. The input to the S/PDIF transmitter is TX_CLK controlled by the 5-bit clock routing (SRU1 group A) register field...
S/PDIF Transmitter S/PDIF Transmitter Registers The SPDIF transmitter contains registers that are used to enable/disable the transmitter, to manage its operation, and to report status. The regis- ters are described below. • DITCTL is the S/PDIF transmit control register. This 32-bit read/write register is located at address 0x24A0.
S/PDIF Transmitter/Receiver Standalone Mode This mode is selected by setting bit 9 in the register. In this mode, DITCTL the block start bit (indicating start of a frame) is generated internally. The channel status bits come from the channel status buffer registers ( DITCHA- ).
S/PDIF Transmitter Structure of the Serial Input Data Figure 9-5 shows the format of data that is sent to the S/PDIF transmitter using a 24-bit I S interface. The upper 24 bits (bits 8 through 31) contain the audio data. Bits 3–7 are used to transmit status information and to generate preambles and or headers.
Page 491
S/PDIF Transmitter/Receiver Bits 27–8: 20-Bit Audio Data BITS 3–0 Validity Bit User Data Channel Status Block Status Padding (zero) Figure 9-7. Data Packing for Right-Justified Format, 20 Bits Bits 27–10: 18-Bit Audio Data BITS 5–0 Validity Bit User Data Channel Status Block Status Padding (zero) Figure 9-8.
S/PDIF Receiver S/PDIF Receiver The S/PDIF receiver is compliant with all common serial digital audio interface standards including IEC-60958, IEC-61937, AES3, and AES11. These standards define a group of protocols that are commonly associated with the S/PDIF interface standard defined by AES3, which was devel- oped and is maintained by the Audio Engineering Society.
S/PDIF Transmitter/Receiver The receiver also detects errors in the S/PDIF stream. These error bits are stored in the status register, which can be read by the core. Optionally, an interrupt may be generated to notify the core on error conditions. The extracted serial data is transmitted on the data pin in I S format.
S/PDIF Receiver SRU1 Receiver Signals The bi-phase encoded data and the external PLL clock inputs to the receiver are routed through the signal routing unit (SRU1). The extracted clock, frame sync, and data are also routed through SRU1. The SRU1 inputs to the S/PDIF receiver are configured through the fol- lowing signals.
PLL. There are various performance characteristics to consider when configuring for analog PLL mode, and more information can be found on the Analog Devices Web site. Channel Status Decoding The S/PDIF receiver processes compressed as well as non-linear audio data according to the supported standards.
Channel Status Decoding Compressed or Non-Linear Audio Data The AES3/SPDIF receiver is required to detect compressed or non-linear audio data according to the AES3, IEC60958, and IEC61937 standards. Bit 1 of byte 0 in the register indicates whether the audio data DIR_B0CHAN is linear PCM, (bit 1 = 0), or non-PCM audio, (bit 1 = 1).
S/PDIF Transmitter/Receiver can be detected by adding the sync detection logic in software by using a software counter to check for the DTS header every 2048 and 4096 frames respectively. Emphasized Audio Data The receiver must indicate to the program whether the received audio data is emphasized using the channel status bits as detailed below.
Error Handling Bits 0–3 of channel status byte 1 are decoded by the receiver to determine one of the following: • 0111 = single-channel, double-frequency mode • 1000 = single-channel, double-frequency mode – stereo left • 1001 = single-channel, double-frequency mode – stereo right Error Handling The following five types of errors can occur in the receiver and are reported on the error flag bits.
Page 499
S/PDIF Transmitter/Receiver audio sample and slowly and linearly decrementing it to zero, over a period of 4096 frames. During this time, the PLL three-states the charge pump until the soft mute has been completed. If non-linear PCM audio data is in the AES3/SPDIF stream when the bit is asserted, the NOSTREAM receiver sends out zeros after the last valid sample.
Interrupts Interrupts The following error/status bits can be used to interrupt the processor core. • The bits can DIR_LOCK DIR_VALID DIR_NOSTREAM DIR_NOAUDIO generate interrupts. Parity errors and bi-phase errors are ORed together to form a interrupt. Whenever PARITY_BIPHASE_ERROR there is a change in channel status information, a interrupt occurs.
S/PDIF Transmitter/Receiver SRU1 Programming for Input and Output Streams Signal routing unit 1 (SRU1) is used to connect the S/PDIF transmitter bi-phase data out to the output pins or to the S/PDIF receiver. The serial data input and the over sampling clock input also needs to be routed through SRU1.
DAI Programming Examples SRU1 Programming The SRU1 needs to be programmed in order to connect the S/PDIF receiver to the output pins or any other peripherals and also for the input bi-phase stream. Program the corresponding SRU1 registers to connect the above outputs to the required destination.
S/PDIF Transmitter/Receiver Interrupted Data Streams on the Receiver When using the SPDIF receiver with data streams that are likely to be interrupted, (in other words unplugged and reconnected), it is necessary to take some extra steps to ensure that the SPDIF receiver’s digital PLL will re lock to the stream.
Page 504
DAI Programming Examples /* Enable Hi-priority DAI interrupt */ dm(DAI_IRPTL_PRI) = ustat1; /* If more than 1 DAI interrupt is being used, it is neces- sary to determine which interrupt occurred here */ /* Interrupt Service Routine for the DAI Hi-Priority Inter- rupt.
S/PDIF receiver. The SRC contains four blocks (SRC0–3). It also is the same core that is used in the Analog Devices AD1896 192 kHz Stereo Asynchronous Sam- ple Rate Converter. The top-level block diagram of the SRC module is...
Theory of Operation multiplexing (TDM) mode for daisy-chaining multiple SRCs to a proces- sor. The serial output data is dithered down to 20, 18, or 16 bits when 20-, 18-, or 16-bit output data is selected. Theory of Operation The SRC sample rate converts the data from the serial input port to the sample rate of the serial output port.
Page 507
Asynchronous Sample Rate Converter Normally, the signal is connected to the signal. The MUTE_OUT MUTE_IN signal is used to softly mute the SRC upon assertion and softly MUTE_IN stop muting the SRC when it is deasserted. The sample rate ratio circuit is used to scale the filter length of the FIR fil- ter for decimation.
Theory of Operation ZERO-ORDER HOLD f S_I N = 1/T1 f S_OUT = 1/T2 ORIGINAL SIGNAL SAMPLED AT f S_I N SIN(X)/X OF ZERO-ORDER HOLD SPECTRUM OF ZERO-ORDER HOLD OUTPUT SPECTRUM OF f S_OUT SAMPLING 2 × f S_OUT f S_OUT FREQUENCY RESPO NSE OF f S_OUT CONVOLVED WITH ZERO-ORDER HOLD SPECTRUM Figure 10-1.
Page 509
Asynchronous Sample Rate Converter INTERPOLATE LOW-PASS ZERO-ORDER BY N FILTER HOLD f S_IN f S_OUT TIME DOMAIN OF f S_IN SAMPLES TIME DOMAIN OUTPUT OF THE LOW-PASS FILTER TIME DOMAIN OF f S_OUT RESAMPLING TIME DOMAIN OF THE Z ERO-ORDER HOLD OUTPUT Figure 10-2.
Page 510
Theory of Operation F is the frequency of the worst-case image which is: S_IN × ± ----------- - S_IN and f S_INTERP × S_IN The following worst-case images would appear for f = 192 kHz: S_IN Image at f – 96 kHz = –125.1 dB S_INTERP Image at f + 96 kHz = –125.1 dB...
Asynchronous Sample Rate Converter Hardware Model The output rate of the low-pass filter of Figure 10-2 is the interpolation × 192 kHz = 201.3 GHz. Sampling at a rate of 201.3 GHz is rate, 2 clearly impractical, not to mention the number of taps required to calcu- late each interpolated sample.
Sample Rate Converter Architecture anti-aliasing filter, the coefficients are dynamically altered and the length of the convolution is increased by a factor of (f ). This tech- S_IN S_OUT nique is supported by the Fourier transform property that if f(t) is F(ω), then f(k ×...
Page 513
Asynchronous Sample Rate Converter LRCLK_I SCLK_I DE-EMPHASIS FILTER SDATA_I SERIAL SAMPLE INPUT RATE SMODE_IN2-0 MUTE_OUT PORT CONVERTER HARD_MUTE_IN MUTE_IN DE-EMPHASIS1-0 SRC_RATIO14-0 TDM_OUT MCLK SMODE_OUT1-0 SDATA_O WLENGTH_OUT1-0 LRCLK_O SERIAL OUTPUT 21BIT_DITHER SCLK_O PORT TDM_IN MATCHED_PHASED_MODE Figure 10-4. Sample Rate Converter Block Diagram The FIFO receives the left and right input data and adjusts the amplitude of the data for both the soft muting of the SRC and the scaling of the input data by the sample rate ratio before storing the samples in RAM.
Page 514
Sample Rate Converter Architecture RIGHT DATA IN ROM A HIGH FIFO LEFT DATA IN ORDER ROM B INTERP ROM C ROM D f S_IN DIGITAL FIR FILTER SERVO LOOP COUNTER L/R DATA OUT SAMPLE RATE RATIO f S_ IN SAMPLE RATE RATIO f S_OUT EXTERNAL...
Page 515
Asynchronous Sample Rate Converter The digital-servo loop is implemented with a multi-rate filter. To settle the digital-servo loop filter quickly at startup or at a change in the sample rate, a fast mode has been added to the filter. When the digital-servo loop starts up or the sample rate is changed, the digital-servo loop kicks into fast mode to adjust and settle on the new sample rate.
SRC Operation differences in their ratios from 0 to 4 f period counts. The S_OUT ratio adjusts the filter length of the SRC, which corresponds S_OUT S_IN directly with the group delay. Thus, the magnitude in the phase difference depends upon the resolution of the f and f counters.
Asynchronous Sample Rate Converter Enabling the SRC When the bit (bit 31 in the SRC control registers) is set SRCx_ENABLE (= 1), the SRC begins its initialization routine where all locations in the FIFO are initialized to zero, is cleared, and any output pins are MUTE_OUT enabled.
Page 518
SRC Operation Table 10-1. Serial Data Input Port Mode SRCx_SMODE_0:2 Interface Format Left-justified RESERVED Right-justified, 16 bits Right-justified, 18 bits Right-justified, 20 bits Right-justified, 24 bits Table 10-3. When the output word width is less than 24 bits, dither is added to the truncated bits.
Asynchronous Sample Rate Converter Table 10-3. Word Width SRCx_LENOUT_0:1 Interface Format 24 bits 20 bits 18 bits 16 bits Time-Division Multiplex (TDM) Output Mode In TDM output mode, several SRCs can be daisy-chained together and connected to the serial input port of an ADSP-21367/8/9 and ADSP-2137x processor or other processor (Figure 10-6).
SRC Operation TDM Input Mode In TDM input mode, several SRCs can be daisy-chained together and connected to the serial input port of an ADSP-21367/8/9 and ADSP-2137x processor or other processor (Figure 10-7). The SRC con- tains a 64-bit parallel load shift register. When the pulse arrives, LRCLK_I each SRC parallel loads its left and right data into the 64-bit shift register.
Page 521
Asynchronous Sample Rate Converter Figure 10-8. The master device can have both its serial ports in slave mode as depicted, or either one in master mode. The slave SRCs must have their bits set to 1, respectively. The MATASE_2 LRCLK_I LRCLK_O signals may be asynchronous with respect to each other in this mode.
Asynchronous Sample Rate Converter • 10 – 44.1 kHz sample rate de-emphasis filter • 11 – 48 kHz sample rate de-emphasis filter After the audio data is passed from the de-emphasis filter to the SRC, the SRC converts the audio data from the input sample rate to the output sample rate.
SRC Operation Muting can also be controlled in software using the bits MUTE ) in the SRC control SRCx_SOFTMUTE SRCx_HARD_MUTE SRCx_AUTO_MUTE register ( ) as described below. For more information, see “SRC SRCCTL Registers” on page 10-21. Soft Mute When the bit in the register is set, the sig-...
Asynchronous Sample Rate Converter SRC Registers The SRC uses five 32-bit registers to configure and operate the SRC module. • SRCCTL0, SRC control 0. This read/write register is used to con- trol the operating modes, filters, and data formats used in the SRC0 and SRC1 modules.
Programming the SRC Module Programming the SRC Module Use the following guidelines when developing programs that include the SRC module. SRC Control Register Programming Initially, programs configure the SRC control registers SRCCTL0 . The register contains control parameters for the SRC0 SRCCTL1 SRCCTL0 and SRC1 modules and the...
Asynchronous Sample Rate Converter For information on using the SRU, see “Making Connections in the SRUs” on page 4-15, and “DAI/SRU1 Connection Groups” on page 4-18. SRC Mute-Out Interrupt Once the SRC is locked (after 4K input samples), the corresponding bit in the register is set.
Page 528
Programming the SRC Module In multichannel, or matched-phase modes, the TDM signals must also be connected. (See Table 10-1 on page 10-14 Table 10-2 on page 10-14.) 2. Initialize the register to enable the SRCs. SRCCTLx 10-24 ADSP-21368 SHARC Processor Hardware Reference...
11 UART PORT CONTROLLER The universal asynchronous receiver/transmitter (UART) is a full-duplex peripheral compatible with the PC-style, industry-standard UART. The UART converts data between serial and parallel formats. The serial format follows an asynchronous protocol that supports various word lengths, stop bits, and parity generation options.
Serial Communications Serial Communications The UART follows an asynchronous serial communication protocol with these options: • 5 – 8 data bits • 1 or 2 stop bits • None, even, or odd parity /(16 × divisor), where • Baud rate = is the system clock fre- PCLK PCLK...
UART Port Controller UART Control and Status Registers The processor provides a set of PC-style, industry-standard control and status registers for each UART. These memory-mapped registers (MMRs) are byte-wide registers that are mapped as half-words with the most signif- icant byte zero-filled. Consistent with industry-standard interfaces, multiple registers are mapped to the same address location.
UART Control and Status Registers UARTxLSR Register The UART line status register ( ) contains UART status informa- UARTxLSR tion as shown in Figure A-49 on page A-120. The break interrupt ( ), overrun error ( ), parity error UARTBI UARTOE ), and framing error ( ) bits are cleared when the UART line...
UART Port Controller This 32-bit write only register uses only 18-bits. The other bits are filled with zeros during writes. In no-pack mode (default), only the lower byte is used—all other bits are zero filled. However in pack mode, both the high and low bytes are used (Figure 11-2).
Page 534
UART Control and Status Registers ZERO-FILLED RX9D1 HIGHER BYTE ZERO-FILLED RX9D0 LOWER BYTE Figure 11-3. Receive Buffer Register (Packing Enabled) A sampling clock equal to 16 times the baud rate samples the data as close to the midpoint of the bit as possible. Because the internal sample clock may not exactly match the asynchronous receive data rate, the sampling point drifts from the center of each bit.
UART Port Controller UARTxIER Register The UART interrupt enable registers ( ) are used to enable UARTxIER requests for system handling of empty or full states of UART data regis- ters. Unless polling is used as a means of action, the and/or UARTRBFIE bits in this register are normally set.
Page 536
UART Control and Status Registers programmed through the register using the code select value for the PICR UART receive interrupt (0x13 for UART0 interrupt and 0x14 for UART1 receive interrupt). Similar to I/O mode, both the transmit and receive interrupts are mapped to the receive interrupt. Then the register UARTxIER can be used to select the transmit or receive interrupt respectively for I/O...
UART Port Controller For information on using the UART for DMA transfers, see “UART DMA” on page 2-44, “DAI/DPI Interrupt Controller” on page 4-65, and “Peripheral Interrupt Priority Control Registers” on page A-164. Even though the UART has two interrupts for receive and trans- mit, in I/O mode, all interrupts are grouped as a single receive interrupt.
Page 538
UART Control and Status Registers interrupt priority using the peripheral interrupt priority control registers. For more information, see “Peripheral Interrupt Priority Control Regis- ters” on page A-164. Table 11-1. IIR Register in I/O Mode Bit Status NINT Interrupt Interrupt Type Cleared When...
UART Port Controller If software stops transmission, it must read the register to reset UARTxIIR the interrupt request. As long as the register reads 0x04 or 0x06 UARTxIIR (indicating that another interrupt of higher priority is pending), the UAR- empty latch cannot be cleared by reading the register.
UART Control and Status Registers The 16-bit divisor formed by the registers UARTxDLH UARTxDLL resets to 0x0001, resulting in the highest possible clock frequency by default. If the UART is not used, disabling the UART clock saves power (see bits 13 and 14 in the “Power Management Con- trol Register (PMCTL)”...
UART Port Controller For information on UART DMA registers, see “UART DMA” on page 2-44. UARTxMODE Register The UART mode register controls miscellaneous settings such as packing and address detection. For more information, see “Mode Registers (UAR- TxMODE)” on page A-126. I/O Mode In I/O mode, data is moved to and from the UART by the processor core.
Page 542
I/O Mode Software can write up to two words into the register before UARTxTHR enabling the UART clock. As soon as the UART DMA engine is enabled, those two words are sent. Alternatively, UART writes and reads can be accomplished by interrupt service routines (ISRs).
UART Port Controller Packing Mode The UART provides packed and unpacked modes of data transfer to and from the internal memory of the ADSP-21367/8/9 and ADSP-2137x pro- cessors. This mode is set using the bit (bit 0) in the UARTPACK UARTxMODE register.
Page 544
Packing Mode register must be read before reading the register, UARTxRBR because the latter clears the bit. Reading the register UARTxRBR clears both the address-detect and the data-ready interrupts. In non-packed mode, when the address-detect interrupt is generated, it means that the data is ready in the buffer while in packed mode, this is not the case.
12 TWO WIRE INTERFACE CONTROLLER The two wire interface (TWI) controller allows a device to interface to an inter-IC bus as specified by the Philips I C Bus Specification version 2.1 dated January 2000. Overview The TWI is fully compatible with the widely used I C bus standard.
Architecture • Separate multiple-byte receive and transmit FIFOs • Low interrupt rate • Individual override control of data and clock lines in the event of a bus lockup • Input filter for spike suppression Table 12-1 shows the pins for the TWI. Two bidirectional pins externally interface the TWI controller to the I C bus.
Page 547
Two Wire Interface Controller TRANSMIT SHIFT REGISTER FIFO ARBITRATION RECEIVE SHIFT REGISTER ADDRESS COMPARE PERIPHERAL PRESCALER INTERFACE REGISTERS CLOCK GENERATION Figure 12-1. TWI Block Diagram The transmit shift register serially shifts its data out externally off chip. The output can be controlled to generate acknowledgements or it can be manually overwritten.
Register Descriptions The clock generation module is used to generate an external serial clock ) when in master mode. It includes the logic necessary for synchroni- zation in a multimaster clock configuration and clock stretching when configured in slave mode. Register Descriptions The TWI controller has 16 registers which are described in the following sections.
Two Wire Interface Controller TWIDIV Register During master mode operation, the serial clock divider register ( TWIDIV values are used to create the high and low durations of the serial clock ). Serial clock frequencies can vary from 400 kHz to less than 20 kHz. The resolution of the generated clock is 1/10 MHz or 100 ns.
Register Descriptions Slave Mode Address Register The TWI slave mode address register ( ) holds the slave mode TWISADDR address, which is the valid address that the slave-enabled TWI controller responds to. The TWI controller compares this value with the received address during the addressing phase of a transfer.
Two Wire Interface Controller controller appends the read/write bit as appropriate based on the state of bit in the master mode control register. For more information, MDIR see “Master Address Register (TWIMADDR)” on page A-139. Master Mode Status Register The TWI master mode status register ( ) holds information dur- TWIMSTAT ing master mode transfers and at their conclusion.
Register Descriptions After servicing the interrupt source associated with a bit, programs must clear that interrupt source bit. All bits are sticky and W1C-type. For more information, see “Interrupt Source Register (TWIIRPTL)” on page A-147. Interrupt Enable Register The TWI interrupt enable register ( ) allows interrupt sources to TWIIMASK assert the interrupt output.
Two Wire Interface Controller bus access times, a double byte transfer data access can be performed. Two data bytes can be written, effectively filling the transmit FIFO buffer with a single access. The data is written in little-endian byte order as shown in Figure 12-2, where byte 0 is the first byte to be transferred and byte 1 is the second byte...
Data Transfer Mechanics 16-Bit Receive FIFO Register The TWI 16- bit FIFO receive register ( ) holds a 16-bit data value RXTWI16 read from the FIFO buffer. Although peripheral bus reads are 32 bits, a read access to the register can only access two receive data bytes RXTWI16 from the FIFO buffer.
Two Wire Interface Controller To better understand the mapping of TWI controller register contents to a basic transfer, Figure 12-4 details the same transfer as above noting the corresponding TWI controller bit names. In this illustration, the TWI controller successfully transmits one byte of data. The slave has acknowl- edged both address and data.
Data Transfer Mechanics HIGH COUNT COUNT TWI CONTROLLER CLOCK SECOND MASTER CLOCK RESULT Figure 12-5. TWI Clock Synchronization Bus Arbitration The TWI controller initiates a master mode transmission ( ) only TWIMEN when the bus is idle. If the bus is idle and two masters initiate a transfer, arbitration for the bus begins.
Page 557
Two Wire Interface Controller SCL (BUS) TWI CONTROLLER DATA SECOND MASTER DATA SDA (BUS) ARBITRATION LOST START Figure 12-6. TWI Bus Arbitration SCL (BUS) SDA (BUS) STOP START Figure 12-7. TWI Start and Stop Conditions The TWI controller’s special-case start and stop conditions include: •...
Data Transfer Mechanics • TWI controller addressed as a slave-transmitter If the master asserts a stop condition during the data phase of a transfer, the TWI controller concludes the transfer ( ) and TWISCOMP indicates a slave transfer error ( TWISERR •...
Two Wire Interface Controller Programming Examples The following sections include programming examples for general setup, slave mode, and master mode, as well as guidance for repeated start condi- tions. For an example of programming the TWI using the digital peripheral interface and SRU2, see “Configuring the Two Wire Interface”...
Page 560
Programming Examples 2. Program the register. These are the initial data TXTWI8 TXTWI16 values to be transmitted in the event the slave is addressed as a transmitter. This is an optional step. If no data is written and the slave is addressed and a transmit is required, the serial clock ( ) is stretched and an interrupt is generated.
Two Wire Interface Controller Master Mode Clock Setup Master mode operation is set up and executed on a per-transfer basis. An example of programming steps for a receive and for a transmit are given separately in following sections. The clock setup programming step listed here is common to both transfer types.
Programming Examples 5. Program the register. This prepares and enables master TWIMCTL mode operation. As an example, programming the value 0x0201 enables master mode operation, generates a 7-bit address, sets the direction to master-transmit, uses standard mode timing, and transmits 8 data bytes before generating a stop condition. Table 12-3 shows what the interaction between the TWI controller and the processor might look like using this example.
Two Wire Interface Controller 4. Program the register. Ultimately this prepares and enables TWIMCTL master mode operation. As an example, programming the value 0x0201 enables master mode operation, generates a 7-bit address, sets the direction to master-receive, uses standard mode timing, and receives 8 data bytes before generating a stop condition.
Page 564
Programming Examples REPEATED START STOP START 7-BIT ADDRESS 8-BIT DATA 7-BIT ADDRESS 8-BIT DATA TWIRXINT INTERRUPT TWITXINT INTERRUPT TWIMCOM INTERRUPT TWIMCOM INTERRUPT Shaded region indicates slave to master transmission. Figure 12-8. Transmit/Receive Data Repeated Start The tasks performed at each interrupt are: •...
Two Wire Interface Controller • Re-program with the desired number of bytes to DCNT receive. • interrupt TWISERR This interrupt is generated due to the arrival of a byte into the receive FIFO. Simple data handling is all that is required. Receive/Transmit Repeated Start Sequence Figure 12-9 illustrates a repeated start data receive followed by a data...
Electrical Specifications • interrupt TWIMCOMP This interrupt has occurred due to the completion of the data receive transfer. At this time the data transmit transfer begins. The field should be set to reflect the number of bytes to be TWIDCNT transmitted.
13 PRECISION CLOCK GENERATORS The precision clock generators (PCG) consist of four units, each of which generates a pair of signals (clock and frame sync) derived from a clock input signal. The units, A B, C, and D, are identical in functionality and operate independently of each other.
Page 568
The core phase-locked loop (PLL) has been designed to provide clocking for the processor core. Although the performance specifications of this PLL are appropriate for the core, they have not been optimized or speci- fied for precision data converters where jitter directly translates into time quantization errors and distortion.
Precision Clock Generators being a clock and frame sync slave. The clock generated by the SPORT is sufficient for most of the serial communications, but it is suboptimal for analog/digital conversion. Therefore, all precision data converters should be synchronized to a clock generated by the PCG or to a clean (low jitter) clock that is fed into SRU1 off-chip through a pin.
Frame Sync Outputs bit (bit 31 in the registers) specifies the input CLKASOURCE PCG_CTLA1 source for the clock of the respective units (A, B, C, and D). When this bit is cleared (= 0), the input is sourced from the external oscillator, as shown Figure 13-1.
Precision Clock Generators Frame sync generation from a unit is independently enabled and con- trolled. Sources for the frame sync generation can be either from the crystal buffer output, , or an external pin source. There is only one PCLK external source pin for both frame sync and clock output for a unit.
Frame Sync Outputs sync appears to lead the clock. If the phase is only slightly less than the divisor, then the frame sync appears to lag the clock. The frame sync phase should not be greater than the divisor. Bypass Mode In bypass mode, the frame sync divisor is either 0 or 1.
Precision Clock Generators Frame Sync Output Synchronization With an External Clock The frame sync output may be synchronized with an external clock by programming the registers (shown in PCG_SYNC PCG_SYNC2 Figure A-77 on page A-160) and the PCG control registers ( PCG_CTLA0–1 , and ) appropriately.
Frame Sync Output Synchronization With an External Clock MCLK EXT CLK FSA OUTPUT Figure 13-2. Clock Output Synchronization With External Clock Frame Sync For a given frame sync, the output is determined by the following: • Divisor. A 20-bit divisor of the input clock that determines the period of the frame sync.
Precision Clock Generators The frequency of the frame sync output is determined by: Frequency of Clock Input Frame Sync Divisor When the divisor is set to any value other than 0 or 1, the processors oper- ate in normal mode. The frame sync divisors ( bits) are specified in bits 19–0 of the cor- FSxDIV...
Phase Shift When using a clock and frame sync as a synchronous pair, the units must be enabled in a single atomic instruction before their parame- ters are modified. Both units must also be disabled in a single atomic instruction. Phase Shift Settings The phase shift between clock and frame sync outputs may be pro- grammed under these conditions:...
Page 577
Precision Clock Generators CLO CK INPUT (FOR BOTH CLOCK AND FRAME SYNC) CLOCK OUTPUT FRAME SYNC OUTPUT (PHASE SHIFT = PERIOD -1) FRAME SYNC OUT PUT (PHASE SHIFT = 0) FRAME SYNC OUT PUT (PHASE SHIFT = 1) FRAME SYNC OUT PUT (PHASE SHIFT = 2) ENABLE OTHER VALUES:...
Phase Shift Bypass Mode When the divisor for the frame sync has a value of 0 or 1, the frame sync is in bypass mode, and the registers have different func- PCG_PW PCG_PW2 tionality than in normal mode. Two bit fields determine the operation in this mode.
Precision Clock Generators Bypass mode also enables the generation of a strobe pulse (one-shot). Strobe usage ignores the counter and looks to SRU1 to provide the input signal. Bypass as a One-Shot When the bits (bit 0, bit 16 of the register) or STROBEA STROBEB...
Programming Examples CLOCK INPUT FOR FRAME SYNC MISCA2_I FRAME SYNC OUTPUT (INVFSA = 0, STROBEA = 1) FRAME SYNC OUTPUT (INVFSA = 1, STROBEA = 1) Figure 13-5. One-Shot (Synchronous Clock Input and MISCA2_I) The second bit (bit 1) of the pulse width control register ( INVFSA PCG_PW determines whether the falling or rising edge is used.
Page 581
Precision Clock Generators PCG Setup for I S or Left-Justified DAI This example shows how to set up two precision clock generators using the S/PDIF receiver and an asynchronous sample rate converter (SRC) to interface to an external audio DAC. In this example an input clock ) of 33.330 MHz is assumed and the PCG is configured to provide CLKIN a fixed SRC/DAC output sample rate of 65.098 kHz.
Page 582
Programming Examples Table 13-2. Precision Clock Generator Division Ratios (33.330 CLKIN) PCG Divisors PCG CLOCK SCLK FSYNC Sample Rate kHz) INPUT 130.195 65.098 43.398 32.549 1024 26.039 1280 21.699 1536 18.599 1792 1 The frame sync divisor should be an even integer in order to produce a 50% duty cycle waveform.
Page 583
Precision Clock Generators The combined PCGs can provide a selection of synchronous clock frequencies to support alternate sample rates for the SRCs and external DACs. However, the range of choices is limited by CLKIN and the ratio of which is normally fixed at PCG_CLKx_O:SCLK:FSYNC 256:64:1 to support digital audio, left-justified, I S, and right-jus-...
Page 584
Programming Examples FS OUT = 65.1 kHz ADSP-21369 24-BIT, LEFT-JUSTIFIED PLAYER SDATA OUT DAI_P8 RxSCLK SDATA IN DAI_P19 DAI_P9 RxLRCLK S/PDIF LRCLK IN SDATA IN DAI_P10 S/PDIF IN SCLK IN (FS IN , 44.1 kHz FSYNC A (FS OUT ) ÷ 512 = 65.1 kHz STEREO DAC PCG A SCLK A (64 FS OUT ) ÷...
Precision Clock Generators PCG Channel A and B Output Example Listing 13-3 uses two PCG channels. Channel A is set up to only generate a clock signal. This clock signal is used as the input to channel B through SRU1. The clock and frame sync are routed to DAI pins 1 and 2, respec- tively, in the same manner as Listing 13-1.
Page 590
Programming Examples /* Bit Definitions */ #define ENCLKA 0x80000000 #define ENFSB 0x40000000 #define ENCLKB 0x80000000 #define CLKBSOURCE 0x80000000 #define FSBSOURCE 0x40000000 /* Main code section */ .global _main; /* Make main global to be accessed by ISR */ .section/pm seg_pmco; _main: /*Route PCG Channel A clock to PCG Channel B Input via SRU*/ r0 = (PCG_CLKA_O<<PCG_EXTB_I);...
14 SYSTEM DESIGN The ADSP-21367/8/9 and ADSP-2137x processors support many system design options. The options implemented in a system are influenced by cost, performance, and system requirements. This chapter provides the following system design information: • “Processor Pin Descriptions” on page 14-2 •...
Processor Pin Descriptions Before proceeding with this chapter it is recommended that you become familiar with the ADSP-21367/8/9 and ADSP-2137x pro- cessor’s core architecture. This information is presented in the ADSP-2136x SHARC Processor Programming Reference. Processor Pin Descriptions Refer to the processor-specific data sheet for pin information, including package pinouts for the currently available package options.
Page 595
System Design The processors also include the multiplexers for pins. The FLAG0–3 pins can act as core , and the pin can act FLAG0–2 FLAGS0–2 IRQ0–2 FLAG3 as a core or as the signal of the system timer. FLAG3 TMREXPEN Table 14-1 on page 14-7 shows the register bit settings for the dif-...
Page 596
Processor Pin Descriptions F LA G S3 - 0 3 - 0 P W M 3 - 0 FLA G S 7 - 4 7 - 4 P W M 7 - 4 FLA G S/P W M 15 - 0 FLA G S1 1 - 8 1 1 - 8 P W M 1 1 - 8...
Processor Pin Descriptions Choosing EP Data Mode (0, 1, 2, 3) and pins are completely independent. FLAG DATA31–0 Any mode of programming in one group does not affect the other. Case 1 If 32-bit external SDRAM/FLASH/SRAM is used, then all data pins should be connected to the memory device so that no other functionality can be programmed in the data pins.
Page 599
System Design Case 5 If no external memory is used, and if the PDAP data lines are connected to DATA pins, and if 8 flags are required, then use MODE 6. Connect the PADP control lines to the DATA pins, and program the flag direction in the register.
Processor Pin Descriptions • pin is not used DATA9 • pin acts as (output) DATA8 PDAP STROBE Interrupt and Timer Pins The processor’s external interrupt pins, flag pins, and timer pin can be used to send and receive control signals to and from other devices in the system.
System Design When the bit (bit 30 in the register) is set (= 1 which SPIPDN PMCTL shuts down the clock to the SPI), the pins cannot be used FLAGx (through the register bits) because the pins are syn- FLAGS7–0 FLAGx chronized with the clock.
Page 603
System Design 2. 32 data pins • All 16 flags can be mapped. • Can be mapped only in groups of four. • Should be programmed through the register. SYSCTL more information, see “System Control Register (SYSCTL)” on page A-5. 3.
Processor Pin Descriptions And for FLAGS4–15 • In output mode, if the same flag is mapped to both data pins and DPI pins, then the output comes from both pins. • In input mode, if the same flag is mapped to both data pins and DPI pins, the input from data pins is given priority.
A detailed discussion of JTAG and its uses can be found in Engi- neer-to-Engineer Note EE-68, Analog Devices JTAG Emulation Technical Reference. This document is available on the Analog Devices Web site at www.analog.com/processors. Clock Derivation...
Clock Derivation Power Management Control Register The ADSP-21367/8/9 and ADSP-2137x processors have a power manage- ment control register ( ) that allows programs to determine the PMCTL amount of power dissipated. This includes the ability to program the PLL dynamically in software, achieving a slower core instruction rate that min- imizes power use.
Page 607
System Design Listing 14-2. PMCTL Example Code ENABLING CLKOUT: ustat2 = dm(PMCTL); bit set ustat2 CLKOUTEN; /* switch pin function from Reset Out (RSTOUT) to CLKOUT */ dm(PMCTL) = ustat2; PLL Divisor modification: ustat2 = dm(PMCTL); bit clr ustat2 PLLM63|PLLD8; /* clear old multiplier and divisor*/ bit set ustat2 DIVEN|PLLD8;...
Clock Derivation When the PLL is programmed using a multiplier and a divisor, the DIVEN bits should NOT be programmed in the same core clock cycle. PLLBP There should be a delay of at least one core clock cycle between program- ming these bits.
Page 609
System Design dm(PMCTL) = ustat2; waiting_loop: r0 = 4096; /* wait for PLL to lock at new rate (requirement for modifying multiplier only) */ lcntr = r0, do pllwait until lce; pllwait: nop; ustat2 = dm(PMCTL); bit clr ustat2 PLLBP; /* take PLL out of Bypass, PLL is now at CLKIN*4 (CoreCLK = CLKIN * M/N = CLKIN* 16/4) */...
Page 610
Clock Derivation Listing 14-4. PLL Programming Example 2 ustat2 = dm(PMCTL); bit clr ustat2 PLLM63|PLLD8; /* clear old multiplier and divisor*/ bit set ustat2 PLLBP | PLLD4 |PLLM16; /* set a multiplier of 16 and a divider of 4 and enable Bypass mode*/ ustat2 = dm(PMCTL);...
Clock Derivation RESET and CLKIN The processor receives its clock input on the pin. The processor uses CLKIN an on-chip, phase-locked loop (PLL) to generate its internal clock, which is a multiple of the frequency. Because the PLL requires some time CLKIN to achieve phase lock, must be valid for a minimum time period...
Page 613
System Design the application is to provide the highest permissible internal frequency for a given frequency. For more information on available clock rates, CLKIN see the processor-specific data sheet. Table 14-3. Selecting Core to CLKIN Ratio Typical Crystal and Clock Oscillators Inputs 12.500 16.667 25.000...
Clock Derivation Running Reset (ADSP-2137x) All members of the SHARC processor family, including the ADSP-21375 and ADSP-21371, continue to support the hardware reset controlled with pin. The de-assertion of this hardware reset enables the PLL and RESET asserting it resets the PLL. In the time it takes the PLL to acquire lock (set to 4096 cycles), the processor, internal memory, and the peripherals CLKIN...
System Design System Design Considerations It is important that an external 10 kΩ pull-up resistor is placed on the pin if it is intended to be used as an input for RESETOUT/CLKOUT/RUNRSTOUT initiating a running reset on the ADSP-2137x processor as shown in Figure 14-4.
Page 616
Clock Derivation There are several possible methods that can be used to implement running reset. The following illustrates one example of a running reset implemen- tation involving an ADSP-2137x processor and a host processor. External Host In an AVR (audio-video receiver) system, a host micro controller may communicate with the ADSP-2137x processor using the serial peripheral interface (SPI).
System Design 2. The ADSP-2137x processor receives the command and completes any unfinished work which may also include writing to the RUN- register. RSTCTL 3. When the ADSP-2137x processor is ready to accept the running reset, it signals the host over the command interface. 4.
Clock Derivation Programming The RUNRSTCTL Register To configure running reset: 1. Set bit 0 (=1) to change pin direction to input. RESETOUT/CLKOUT 2. Ensure that the pin is driven to a proper state, RESETOUT/CLKOUT and then assert to sensitize logic to the state of the RUNRSTEN pin.
The signal should not only offer a suitable RESET delay, but it should also have a clean monotonic edge. Analog Devices has a range of microprocessor supervisory ICs with different features. Features include one or more of the following: •...
Clock Derivation +1.2V DDINT +3.3V DDEXT 10µF V DDINT V DDEXT V CC ADM809-RART ADSP-213xx RESET RESET Figure 14-6. Simple Reset Generator Another part, the ADM706TAR, provides power on and optional RESET manual . It allows designers to create a more complete supervisory RESET circuit that monitors the supply voltage.
Page 621
System Design +3.3V DDEXT LINE SENSE DDEXT V t > 1.3V V CC ADSP-213xx V t > 1.3V RESET LL W ADM8697 3.3V FLAGx OSCSEL OSCIN IRQx RESET Figure 14-7. Reset Generator and Power Supply Monitor To determine switching frequencies for the serial ports, divide down the internal clock, using the programmable divider control of each port ( DIVx for the serial ports).
Conditioning Input Signals Input Synchronization Delay The processor has several asynchronous inputs— RESET TRST IRQ2–0 , and (when configured as inputs). These inputs can be MS3–0 FLAG16-0 asserted in arbitrary phase to the processor clock, . The processor CLKIN synchronizes the inputs prior to recognizing them. The delay associated with recognition is called the synchronization delay.
System Design RESET Input Hysteresis Hysteresis is used only on the input signal. Hysteresis causes the RESET switching point of the input inverter to be slightly above 1.4 V for a rising edge and slightly below 1.4 V for a falling edge. The value of the hysteresis is approximately ±...
Designing for High Frequency Operation Keep the portions of the system that operate at different frequencies as physically separate as possible. The clock supplied to the processor must have a rise time of 3 ns or less and must meet or exceed a high and low voltage of 2 V and 0.4 V, respectively.
System Design Decoupling Capacitors and Ground Planes Extended copper planes must be used for the ground and power supplies. Designs should use an absolute minimum of 12 bypass capacitors (four 0.1 μF, four 10 nF and four 1 nF ceramic) for each VDDEXT VDDINT supply.
Designing for High Frequency Operation ADSP-213xx CASE 1: CASE 2: BYPASS CAPACITORS ON NON-COMPONENT BYPASS CAPACITORS ON COMPONENT (TOP) (BOTTOM) SIDE OF BOARD, BENEATH DSP SIDE OF BOARD, AROUND DSP PACKAGE PACKAGE Figure 14-9. Bypass Capacitor Placement Recommended Reading The text High-Speed Digital Design: A Handbook of Black Magic is recom- mended for further reading.
System Design • Ground Planes and Layer Stacking • Terminations • Vias • Power Systems • Connectors • Ribbon Cables • Clock Distribution • Clock Oscillators High-Speed Digital Design: A Handbook of Black Magic, Johnson & Gra- ham, Prentice Hall, Inc., ISBN 0-13-395724-1. Booting When a processor is initially powered up, its internal SRAM is undefined.
Page 630
Booting 2. The DMA completes and the interrupt associated with the periph- eral that the processor is booting from is activated. The processor jumps to the applicable interrupt vector location and executes the code located there. (Typically, the first instruction at the interrupt vector is a return from interrupt ( ) instruction.) 3.
System Design External Port Booting The ADSP-21367/8/9 processors allow booting through the external port. There are two options, which are described in the following sections. Booting Through the AMI The asynchronous memory interface (AMI) supports an 8-bit user boot called AMI boot. Only the signal is used for AMI(FLASH/EEPROM) booting.
Booting Shared Memory Booting To boot multiple processors from a single EPROM/FLASH, the processor performs the following steps. 1. Arbitrate for the bus. 2. Receive through DMA the 256-word boot kernel, after becoming bus master. 3. Release the bus, allowing the next processor access to the EPROM/FLASH.
Page 633
System Design ADDR DATA ADSP-21368 ADDR ADDR DATA DATA ADSP-21368 EPROM ADDR DATA ADSP-21368 ADDR DATA ADSP-21368 Figure 14-10. Alternating Booting From an EPROM ADSP-21368 SHARC Processor Hardware Reference 14-41...
Booting SPI Port Booting The ADSP-21367/8/9 and ADSP-2137x processors support booting from a host processor through the SPI slave ( = 00), and booting BOOT_CFG1–0 from an SPI flash, SPI PROM, or a host processor through SPI master mode ( = 01).
System Design For 16-bit SPI devices, two words shift into the 32-bit receive shift regis- ter ( ) before a DMA transfer to internal memory occurs. For 8-bit SPI RXSR devices, four words shift into the 32-bit receive shift register before a DMA transfer to internal memory occurs.
Booting The following example shows a 48-bit instructions executed. [0x90000] 0x112233445566 [0x90001] 0x7788AABBCCDD 0x90000 Internal Memory 0x900FF MOSI Figure 14-13. 32-Bit SPI Host Packing The 32-bit SPI host packs or prearranges the data as: SPI word 1 = 0x33445566 SPI word 2 = 0xCCDD1122 SPI word 3 = 0x7788AABB...
Page 637
System Design The following example shows a 48-bit instructions executed. [0x90000] 0x112233445566 [0x90001] 0x7788AABBCCDD 0x90000 Internal Memory (Loader Kernel) 0x900FF MOSI Figure 14-14. 16-Bit SPI Host Packing The 16-bit SPI host packs or prearranges the data as: SPI word 1 = 0x5566 SPI word 2 = 0x3344...
Booting 8-Bit SPI Host Boot Figure 14-15 shows 8-bit SPI host packing of 48-bit instructions executed at PM addresses 0x90000 and 0x90001. For 8-bit hosts, four 8-bit words pack into the shift register to generate a 32-bit word. The 32-bit word shifts to internal program memory during the load of the 256-instruction word kernel.
System Design SPI word 9 = 0xBB SPI word 10 = 0xAA SPI word 11 = 0x88 SPI word 12 = 0x77 The initial boot of the 256-word loader kernel requires an 8-bit host to transmit 1536 8-bit words. The SPI DMA count value of 0x180 is equal to 384 words.
Booting Table 14-11. SPI Slave Boot Bit Settings (Cont’d) Setting Comment DMISO Set (= 1) MISO MISO disabled SENDZ Cleared (= 0) Send last word SPIRCV Set (= 1) Receive DMA enabled CLKPL Set (= 1) Active low SPI clock CPHASE Set (= 1) Toggle SPICLK at the beginning of the first bit...
Page 641
System Design Master boot mode is used when the processor is booting from an SPI-compatible serial PROM, serial FLASH, or slave host processor. The specifics of booting from these devices are discussed individually. On reset, the interface starts up in master mode performing a 384 32-bit word DMA transfer.
Page 642
Booting Table 14-14. Parameter Initialization Value for Master Boot (Cont’d) Parameter Register Initialization Value Comment SPIDMAC 0x0000 0007 Enable receive, interrupt on completion IISPI 0x0008 0000 Start of block 0 normal word memory IMSPI 0x0000 0001 32-bit data transfers CSPI 0x0000 0180 0x100 instructions = 0x180 32-bit words From the perspective of the processor, there is no difference between boot-...
System Design Following that, a 24-bit address (all zeros) is always driven by the proces- sor. On the following cycle (cycle 32), the processor expects the SPICLK first bit of the first word of the boot stream. This transfer continues until the kernel has finished loading the user program into the processor.
Data Delays, Latencies, and Throughput Booting From an SPI PROM (16-Bit address) Figure 14-16 shows the initial 32-bit word sent out from the processor from the perspective of the serial PROM device. As shown in Figure 14-16, SPI EEPROMS only require an 8-bit opcode and a 16-bit address.
System Design Table 14-15. Latencies and Throughput Operation Minimum Data Maximum Throughput Delay (cycles) (cycles/ transfer) Interrupts (IRQ2-0) DMA chain initialization 7–11 Serial ports 1 Processor-to -processor transfers using 32-bit words. Execution Stalls The following events can cause an execution stall for the ADSP-21367/8/9 and ADSP-2137x SHARC processors: •...
Data Delays, Latencies, and Throughput Instruction 3: Instruction involving post-modify addressing involv- ing same register such as . This last instruction R0 = DM(I1,M2); stalls the processor for one cycle. • Any read reference to a memory-mapped register located physically within the core (registers like , which are not situated in the SYSCTL...
System Design When a new external memory instruction fetch occurs on the ADSP-2137x processor due to a jump from internal to external memory, or after a cache hit while executing instructions from external memory, there is one stall cycle present in the fetch1 stage. This stall avoids resource conflicts at the cache interface.
Data Delays, Latencies, and Throughput DMA Stalls • One cycle if an access to a DMA parameter register conflicts with the DMA address generation (for example, writing to the register while a register update is taking place) or reading while a DMA register conflicts with DMA chaining.
REGISTER REFERENCE The ADSP-21367/8/9 and ADSP-2137x processors have general-purpose and dedicated registers in each of their functional blocks. The register ref- erence information for each functional block includes bit definitions, initialization values, and memory-mapped addresses (for I/O processor registers). Information on each type of register is available at the following locations: •...
Register Reference When there is contention among the buses for access to registers in the same I/O processor register group, the processor arbitrates register access as follows: • Data memory (DM) bus accesses • Program memory (PM) bus accesses • I/O processor (IO) bus (lowest priority) accesses The bus with highest priority gets access to the I/O processor register group, and the other buses are held off from accessing that I/O processor register group until that access has been completed.
Page 652
I/O Processor Registers 3. In cases where there are multiple registers that have the same bits (such as serial ports), one register drawing is shown and the names and addresses of the others are simply listed. 4. The bit descriptions are intentionally brief. More detailed informa- tion can be found in the tables that follow the register drawings and in the chapters that describe the particular module.
Register Reference System Control Register (SYSCTL) register configures memory use, interrupts, and many aspects SYSCTL of pin multiplexing. (For more information, see “Pin Multiplexing” on page 14-2.) This register’s address is 0x30024. The reset value for this reg- ister is 0. Bit descriptions for this register are shown in Figure A-1 Figure A-2, and described in...
Page 654
I/O Processor Registers 15 14 13 12 11 10 SYSCTL (0x30024) SRST Reserved Software Reset 1=Software reset IMDW3 0=No software reset Internal Memory Block 3 Data Width Reserved 1=Data bus width is 48 bits 0=Data bus is 32 bits IIVT Internal Interrupt Vector IMDW2 Table...
Page 655
Register Reference Table A-1. SYSCTL Register Bit Descriptions (Cont’d) Name Description RBPR Rotating Priority Bus Arbitration. This bit enables or disables prior- ity rotation among DMA channels. Permits core writes. 0 = Arbiter uses fixed priority 1 = Arbiter uses rotating priority Reserved IMDW0 Internal Memory Data Width 0.
Page 656
I/O Processor Registers Table A-1. SYSCTL Register Bit Descriptions (Cont’d) Name Description TMREXPEN Flag Timer Expired Mode. 0 = Flag3 pin is a general-purpose I/O pin. Permits core writes. 1 = Flag3 pin output is timer expired signal (TIMEXP). MSEN Memory Select.
Register Reference System Status Register (SYSTAT) register’s address is 0x180F. The reset value has all bits initial- SYSTAT ized to zero, except for the , and fields, which are set from CRBM CRAT values on the ADSP-21367/8/9 and ADSP-2137x’s pins. This register is shown in Figure A-3 and described in...
External Port Registers Table A-2. System Status Register (SYSTAT) Bit Descriptions (Cont’d) Name Description Reserved (reset value =0) 10–8 ID Code. These bits indicate the state of the ID pins on the proces- sor. The reset value of IDC is undefined. 31-11 Reserved (reset value =0) External Port Registers...
Page 659
Register Reference 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 EPCTL (0x1801) DATE Reserved DATA Enable In no pack mode, masks those bits of the data lane with zeros. 15 14 13 12 11 10 B0SD DATE Bank 0 SDRAM...
Page 660
External Port Registers Table A-3. EPCTL Register Bit Descriptions (Cont’d) Name Description B2SD Select Bank 2 SDRAM. 1 = Bank 2 SDRAM 0 = Bank 2 Non-SDRAM B3SD Select Bank 3 SDRAM. 1 = Bank 3 SDRAM 0 = Bank 3 Non-SDRAM 5–4 EPBR External Port Bus Priority.
Page 661
Register Reference Table A-3. EPCTL Register Bit Descriptions (Cont’d) Name Description 18–15 DATE Data Enable. In no pack mode of the sdram/ami memory controller, masks those bits of the data lane with zeros. The data lane is 8 bits. The 32-bit data bus has four data lanes. DATA31–0 is mapped to {dl3, dl2, dl1, dl0} For example, If DATE is 1010, then dl3 and dl1 are masked with zeros.
External Port Registers External Port DMA Control Registers (DMACx) registers control the DMA function of their respective DMA DMAC0–1 channels. These registers are shown in Figure A-5 and described in Table A-4. DMAC0 (0x180B) DMAC1 (0x180C) 31 30 29 28 27 26 24 23 22 21 20 19 18 17 16 Reserved DIRS...
Page 663
Register Reference Table A-4. External Port DMA Register Bit Descriptions Name Description DMAEN DMA Enable. 0 = External port channel x DMA is disabled 1 = Enable External port DMA for channel x DMADR DMA Direction 0 = Write to internal memory (external reads) 1 = Read from internal memory (external writes) Note: If delay line DMA is enabled then the DMADR bit doesn’t have any effect.
Page 664
External Port Registers Table A-4. External Port DMA Register Bit Descriptions (Cont’d) Name Description DMA Chaining Status (read-only). 0 = DMA chain loading is not active 1 = DMA chain loading is active Tap List Loading Status (read-only). 0 = Tap list loading is not active 1 = Tap list loading is active Delay Line Write Pointer Write Back Status (read-only).
Register Reference AMI Control Registers (AMICTLx) registers control the mode of operations for the four banks AMICTL0–3 of external memory. These registers are shown in Figure A-6 described in Table A-5. AMICTL0 (0x1804) AMICTL1 (0x1805) 31 30 29 28 27 26 24 23 22 21 20 19 18 17 16 AMICTL2 (0x1806) AMICTL3 (0x1807)
Page 666
External Port Registers Table A-5. AMICTLx Register Bit Descriptions Name Description AMIEN AMI Enable. 0 = AMI is disabled 1 = AMI is enabled 2–1 External Data Bus Width. 00 = 8 bits 01 = 16 bits 10 = 32 bits 11 = Reserved PKDIS Disable Packing/Unpacking.
Page 667
Register Reference Table A-5. AMICTLx Register Bit Descriptions (Cont’d) Name Description 16–14 Bus Idle Cycle. Idle cycle to be inserted whenever read from exter- nal memory is followed by a write to external memory – to avoid contention. 'IC' EP clock cycles are ensured between a read to write.
External Port Registers AMI Status Register (AMISTAT) This 32-bit, read-only register provides status information for the AMI interface and can be read at any time. This register is shown in Figure A-7. AMISTAT (0x180A) 15 14 13 12 11 10 AMIMS Reserved (Bits 31–4) AMI Master...
Register Reference SDRAM Control Register (SDCTL) The SDRAM memory control register includes all programmable parame- ters associated with the SDRAM access timing and configuration. This 32-bit register is located at address 0x1800 and is shown in Figure A-8 and described in Table A-6.
Page 670
External Port Registers 15 14 13 12 11 10 SDCL SDSRF CAS Latency SDRAM Self Refresh Enable 00, 01=Reserved 1=Starts self refresh mode 10=2 cycles, 11=3 cycles 0=No effect DSDCTL SDPSS Disable SDCLK and Control Sig- SDRAM Power-up Sequence Start nals 1=Enable power-up on next 1=Disable...
Page 671
Register Reference Table A-6. SDRAM Control Register Bit Descriptions (Cont’d) Name Description 7–4 SDTRAS tRAS Specification. Based on the system clock frequency and the timing specifications of the SDRAM used. Programmed parame- ters apply to all four banks in the external memory. See t on page 3-35.
Page 672
External Port Registers Table A-6. SDRAM Control Register Bit Descriptions (Cont’d) Name Description X16DE SDRAM External Data Path Width. Selects whether the SDRAM interface is 32 or 16 bits wide. If X16DE = 0, DATA31–0 should be connected to the SDRAM. If X16DE = 1, DATA15–0 should be connected to the SDRAM and 16 to 32-bit packing is performed.
Page 673
Register Reference Table A-6. SDRAM Control Register Bit Descriptions (Cont’d) Name Description 29–27 SDRAW Row Address Width. 000=8, 001=9 010=10, 011=11 100=12, 101=13 110=14, 111=15 PGSZ 128 Program the SDRAM Controller for Page Size of 128 Words. This bit allows programs to configure the SDC for a page size of 128 words (7 bits) which supports most available 32 Mb SDRAMs.
External Port Registers SDRAM Control Status Register (SDSTAT) The SDRAM control status register provides information on the state of the SDC. This information can be used to determine when it is safe to alter SDC control parameters or as a debug aid. This register is located at address 0x1803 and is shown in Figure A-10.
Memory-to-Memory DMA Register Memory-to-Memory DMA Register The memory-to-memory (MTM) DMA register ( ) allows programs MTMCTL to transfer blocks of 64-bit data from one internal memory location to another. This transfer method uses two DMA channels, one for reading data and one for writing data. These transfers are controlled using the register shown in Figure A-12.
Register Reference Serial Port Registers The following section describes serial port (SPORT) registers. SPORT Serial Control Registers (SPCTLx) The SPORT serial control registers’ addresses are: SPCTL0 – 0xC00 SPCTL1 – 0xC01 SPCTL2 – 0x400 SPCTL3 – 0x401 SPCTL4 – 0x800 SPCTL5 –...
Page 678
Serial Port Registers Table A-7. SPORT Operation Modes Bits OPMODE LAFS FRFS MCEA MCEB SLENx Operating Modes Standard DSP Serial Mode 0, 1 3-32 S (Tx/Rx on Left Channel 8-32 First) S (Tx/Rx on Right Channel 8-32 First) Packed I S Mode A Channel 3-32 Packed I...
Page 684
Serial Port Registers SPCTL0 (0xC00) SPCTL1 (0xC01) SPCTL2 (0x400) SPCTL3 (0x401) SPCTL4 (0x800) SPCTL5 (0x801) SPCTL6 (0x4800) SPCTL7 (0x4801) 15 14 13 12 11 10 Reserved Reserved DTYPE IMFS Data Type Internally Generated Multichannel 00=Right-justify, fill MSB with 0’s Frame Sync 01=Right-justify, sign-extend MSB 1=Internal frame sync 10=Compand υ-law...
Page 685
Register Reference Table A-8. SPCTLx Register Bit Descriptions Name Description SPEN_A Enable Channel A Serial Port. 0 = Serial port A channel disabled 1 = Serial port A channel enabled This bit is reserved when the SPORT is in packed I S and multichan- nel modes.
Page 686
Serial Port Registers Table A-8. SPCTLx Register Bit Descriptions (Cont’d) Name Description CKRE Clock Rising Edge Select. Determines clock signal to sample data and the frame sync selection. 0 = Falling edge 1 = Rising edge CKRE is reserved when the SPORT is in I S and left-justified sample pair modes.
Page 687
Register Reference Table A-8. SPCTLx Register Bit Descriptions (Cont’d) Name Description SDEN_B Enable Channel B Serial Port DMA. 0 = Disable serial port channel B DMA 1 = Enable serial port channel B DMA SCHEN_B Enable Channel B Serial Port DMA Chaining. 0 = Disable serial port channel B DMA chaining 1 = Enable serial port channel B DMA chaining FS_BOTH...
Serial Port Registers Table A-8. SPCTLx Register Bit Descriptions (Cont’d) Name Description DERR_A Channel A Error Status (sticky, read-only). Indicates if the serial (TUVF_A or transmit operation has underflowed or a receive operation has over- ROVF_A) flowed in the channel A data buffer. 31–30 DXS_A Channel A Data Buffer Status (read-only).
Page 689
Register Reference SPMCTL0 (0xC04) SPMCTL1 (0xC17) SPMCTL2 (0x404) SPMCTL3 (0x417) SPMCTL4 (0x804) SPMCTL5 (0x817) SPMCTL6 (0x4804) SPMCTL7 (0x4817) 31 30 29 28 27 26 24 23 22 21 20 19 18 17 16 DMACHSxB SPORTx Channel B Status CHNL DMA Chaining Status Current Channel Status x = 0,2,4,6 (read-only)
Page 690
Serial Port Registers Table A-9. SPMCTLx Register Bit Descriptions Name Description MCEA Multichannel Mode Enable. Standard and multichannel modes only. One of two configuration bits that enable and disable mul- tichannel mode on serial port channels. See OPMODE bit on page A-37.
Serial Port Registers SPORT Receive Buffer Registers (RXSPx) The 32-bit registers hold the input data from serial port receive RXSPx operations. The reset value for these registers is undefined. For more information on how receive buffers work, see “Transmit and Receive Data Buffers (TXSPxA/B, RXSPxA/B)”...
Serial Port Registers SPORT Active Channel Select Registers (SPxCSy) Each bit, 31–0, set (= 1) in one of the four registers corresponds to SPxCSy the active channel, 127–0, on a multichannel mode serial port. When the registers activate a channel, the serial port transmits or receives the SPxCSy word in that channel’s position of the data stream.
Register Reference SPORT Compand Registers (SPxCCSy) Each bit, 31–0, set (= 1) in one of the four registers corresponds SPxCCSy to a companded channel, 127–0, on a multichannel mode serial port. When the register activates companding for a channel, the serial SPxCCSy port applies the companding from the serial port’s selection to the...
Serial Port Registers SPORT Error Control Register (SPERRCTLx) registers control and report the status of the interrupts SPERRCTLx generated by each SPORT (see Figure A-21). SPERRCTL0 (0xC18), SPERRCTL1 (0xC19) SPERRCTL2 (0x418), SPERRCTL3 (0x419) SPERRCTL4 (0x818), SPERRCTL5 (0x819) SPERRCTL6 (0x4818), SPERRCTL7 (0x4819) 15 14 13 12 11 10 DERRA_EN Reserved...
Register Reference SPORT Error Status Register (SPERRSTAT) In the ADSP-21367/8/9 and ADSP-2137x processors, there is one global interrupt status register, , that checks the status of SPORT SPERRSTAT interrupts. This read-only register is located at address 0x2300 and is 24 bits wide (see Figure A-22).
Serial Port Registers SPORT DMA Index Registers (IISPx) register is 19 bits wide. It holds an address and acts as a pointer IISPx to memory for a DMA transfer. For more information, see “I/O Proces- sor” on page 2-1. The addresses of the registers are: IISPx IISP0A –...
Register Reference SPORT DMA Count Registers (CSPx) registers are 16 bits wide and they hold the word count for a CSPx DMA transfer. For more information, see “I/O Processor” on page 2-1 The reset value for these registers is undefined. The addresses of the CSPx registers are: CSP0A –...
Serial Peripheral Interface Registers Serial Peripheral Interface Registers The following sections describe the registers associated with the two serial peripheral interfaces (SPIs). The SPI B port is routed through the DAI. SPI Control Registers (SPICTL, SPICTLB) The addresses of these registers are 0x1000 and 0x2800 ( ).
Page 701
Register Reference 15 14 13 12 11 10 SPICTL (0x1000) SPICTLB (0x2800) PACKEN TIMOD 8-Bit Packing Enable Transfer Initiation Mode 1=8- to 16-bit packing 00=Initiate transfer by read of 0=No packing receive buffer 01=Initiate transfer by write of SPIEN transmit buffer SPI System Enable 10=Enable DMA transfer mode 1=Enable...
Page 702
Serial Peripheral Interface Registers Table A-10. SPICTL Register Bit Descriptions Name Description 1–0 TIMOD Transfer Initiation Mode. Defines transfer initiation mode and interrupt generation. 00 = Initiate transfer by read of receive buffer. Interrupt active when receive buffer is full. 01 = Initiate transfer by write to transmit buffer.
Page 703
Register Reference Table A-10. SPICTL Register Bit Descriptions (Cont’d) Name Description CPHASE Clock Phase. Selects the transfer format. 0 = SPICLK starts toggling at the middle of 1st data bit. 1 = SPICLK starts toggling at the start of 1st data bit. CLKPL Clock Polarity.
Serial Peripheral Interface Registers Table A-10. SPICTL Register Bit Descriptions (Cont’d) Name Description ILPBK Internal Loop Back. 0 = No internal loopback 1 = Internal loopback enabled 31–21 Reserved SPI Port Status (SPISTAT, SPISTATB) Registers These registers’ addresses are 0x1002 and 0x2802 ( ).
Page 705
Register Reference Table A-11. SPISTAT Register Bit Descriptions Name Description SPIF SPI Transmit or Receive Transfer Complete. SPIF is set when an SPI single-word transfer is complete. Multimaster Error or Mode-Fault Error. MME is set in a master device when some other device tries to become the master. TUNF Transmission Error.
Serial Peripheral Interface Registers SPI Port Flags Registers (SPIFLG, SPIFLGB) These registers’ addresses are 0x1001 and 0x2801 ( ). The reset SPIFLGB value is 0x0F80.The registers, shown in Figure A-25 SPIFLG SPIFLGB and described in Table A-12, are used to enable individual SPI slave-select lines when the SPI is enabled as a master.
Register Reference SPI Receive Buffer Registers (RXSPI, RXSPIB) These registers’ addresses are 0x1004 (for ) and 0x2804 (for RXSPI RXSPIB The reset values are undefined. These are 32-bit, read-only registers acces- sible by the core or DMA controller. At the end of a data transfer, RXSPIx is loaded with the data in the shift register.
Serial Peripheral Interface Registers SPI Baud Rate Registers (SPIBAUD, SPIBAUDB) These registers’ addresses are 0x1005 (for ) and 0x2805 (for SPIBAUD ) and their reset values are undefined (Table A-13). These SPI SPIBAUDB registers are 16-bit, read-write registers that are used to set the bit transfer rate for a master device.
Register Reference Table A-14. SPI Master Baud Rate Example (Cont’d) BAUDR SPI CLock Divide Factor Baud Rate for CCLK (Decimal Value) 13.9 MHz 10.4 MHz 32,767, (0x7FFF) 262136 1.3 KHz SPI DMA Registers There are ten SPI DMA-specific registers: • “SPI DMA Configuration Registers (SPIDMAC, SPIDMACB)”...
Page 710
Serial Peripheral Interface Registers SPI DMA Configuration Registers (SPIDMAC, SPIDMACB) These registers addresses are 0x1084 (for ) and 0x2884 (for SPIDMAC SPID- ) and their reset value is undefined. These 17-bit SPI registers, shown MACB Figure A-26 and described in Table A-15, are used to control DMA transfers.
Register Reference SPI DMA Chain Pointer Registers (CPSPI, CPSPIB) The reset values for these registers are undefined. These 20-bit, read-write SPI registers contain the address of the next TCB when DMA chaining is enabled. Their addresses are 0x1083 (for ) and 0x2883 (for CPSPI CPSPIB Input Data Port Registers...
Input Data Port Registers Input Data Port Control Register 0 (IDP_CTL0) Use the registers to configure and enable the input data port and IDP_CTL0 each of its channels. This register is shown in Figure A-27 and described Table A-16. The IDP may also be routed through the DAI using its bits. more information, see “DAI/DPI Registers”...
Page 715
Register Reference Table A-16. IDP_CTL0 Register Bit Descriptions Name Description 3–0 IDP_NSET Monitors number of FIFO entries where N > samples raises interrupt controller bit 8. IDP_BHD IDP Buffer Hang Disable. Reads of an empty FIFO or writes to a full FIFO make the core hang. This condi- tion continues until the FIFO has valid data (in the case of reads) or the FIFO has at least one empty location (in the case of writes).
Input Data Port Registers Input Data Port Control Register 1 (IDP_CTL1) Use the register to configure and enable individual IDP chan- IDP_CTL1 nels. This register is shown in Figure A-28 and described in Table A-17. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 IDP_CTL1 (0x24B2) IDP_PINGx IDP_FFCLI...
Register Reference Input Data Port FIFO Register (IDP_FIFO) This register (shown in Figure A-29) provides information about the out- put of the IDP FIFO. Normally, is used only to read and remove IDP_FIFO the top sample from the FIFO. However, the core may also write to this register.
Input Data Port Registers Table A-18. IDP_FIFO Register Bit Descriptions Name Description 2–0 IDP Channel Encoding. These bits indicate the serial input port channel number that provided this serial input data. Note: This information is not valid when data comes from the PDAP. LR_STAT Left/Right Channel Status.
Input Data Port Registers Parallel Data Acquisition Port Control Register (IDP_PP_CTL) Setting enables either the 20 DAI pins or the IDP_PP_CTL[31] DATA31–8 pins to be used as a parallel input channel. These parallel words may be packed into 32-bit words for efficiency. The data then flows through the FIFO and is transferred by a dedicated DMA channel into the core’s memory, as with any IDP channel.
Page 724
Input Data Port Registers Table A-24. IDP_PP_CTL Register Bit Descriptions (Cont’d) Name Description IDP_P05_PDAPMASK Parallel Data Acquisition Port Mask. 0 = Input data from DAI_05/DATA0 is masked 1 = Input data from DAI_05/DATA0 is unmasked IDP_P06_PDAPMASK Parallel Data Acquisition Port Mask. 0 = Input data from DAI_06/DATA1 is masked 1 = Input data from DAI_06/DATA1 is unmasked IDP_P07_PDAPMASK...
Page 725
Register Reference Table A-24. IDP_PP_CTL Register Bit Descriptions (Cont’d) Name Description IDP_P16_PDAPMASK Parallel Data Acquisition Port Mask. 0 = Input data from DAI_16/ADDR3 is masked 1 = Input data from DAI_16/ADDR3 is unmasked IDP_P17_PDAPMASK Parallel Data Acquisition Port Mask. 0 = Input data from DAI_17/ADDR4 is masked 1 = Input data from DAI_17/ADDR4 is unmasked IDP_P18_PDAPMASK Parallel Data Acquisition Port Mask.
Pulse Width Modulation Registers Table A-24. IDP_PP_CTL Register Bit Descriptions (Cont’d) Name Description IDP_PDAP_RESET PDAP Reset. Setting this bit (=1) causes the PDAP reset circuit to strobe, then this bit is cleared auto- matically. This bit always returns a value of zero when read. IDP_PDAP_EN PDAP Enable.
Pulse Width Modulation Registers PWM Control Register (PWMCTLx) These registers, described in Table A-26, are used to set the operating modes of each PWM block. These registers also allow programs to disable interrupts from individual groups. These registers addresses are: PWMCTL0 —...
Register Reference PWM Status Registers (PWMSTATx) These 16-bit read-only registers, described in Table A-27, report the sta- tus of the phase and mode for each PWM group. The addresses for these registers are: PWMSTAT0 — 0x3001 PWMSTAT1 — 0x3011 PWMSTAT2 — 0x3401 PWMSTAT3 —...
Pulse Width Modulation Registers PWM Output Disable Registers (PWMSEGx) These 16-bit read/write registers, described in Table A-28, control the output signals of the four PWM groups. The addresses for these registers are: PWMSEG0 — 0x3008 PWMSEG1 — 0x3018 PWMSEG2 — 0x3408 PWMSEG3 —...
Register Reference PWM Polarity Select Registers (PWMPOLx) These registers, described in Table A-29, control the polarity of the four PWM groups which can be set to either active hi or active lo. The addresses for these registers are: PWMPOL0 — 0x300F PWMPOL1 —...
Pulse Width Modulation Registers PWM Channel Duty Control Registers (PWMAx, PWMBx) The duty cycle control registers, described in Table A-30, directly control the duty cycles of the two pairs of PWM signals. These 16-bit, read/write registers are located at addresses: PWMA0 —...
Register Reference Table A-31. PWMALx/PWMBLx Register Bit Descriptions Name Description 15–0 PWMALx Channel AL Duty Cycle. Program a two’s complement duty cycle with a value of 0x0000 through 0xFFFF. Default = 0 15–0 PWMBLx Channel BL Duty Cycle. Program a two’s complement duty cycle with a value of 0x0000 through 0xFFFF.
Sony/Philips Digital Interface Registers Sony/Philips Digital Interface Registers The following sections describe the registers that are used to configure, enable and report status information for the S/PDIF transceiver. Transmitter Control Register (DITCTL) The S/PDIF transmit control register ( ) is a 32-bit, read/write reg- DITCTL ister located at address 0x24A0.
Page 735
Register Reference 15 14 13 12 11 10 DIT_EN DIT_EXT_SYNCEN Transmitter Enable External Sync Enable 0=Transmitter disabled 0=Internal frame counter not 1=Transmitter enabled set to zero at the next LRCLK DIT_MUTE rising edge 1=Internal frame counter is Mute Serial Data Output set to zero at the next LRCLK 0=Not muted rising edge...
Page 736
Sony/Philips Digital Interface Registers Table A-33. DITCTL Register Bit Descriptions (Cont’d) Name Description 3–2 DIT_FREQ Frequency Multiplier. Sets the oversampling ratio to the fol- lowing: 00 = 256 x Frame sync 01 = 384 x Frame sync 10 = 512 x Frame sync 11 = 768 x Frame sync DIT_SCDF Transmit Single-Channel, Double-Frequency Enable.
Register Reference Table A-33. DITCTL Register Bit Descriptions (Cont’d) Name Description DIT_USERS User Bits Status. This bit is high if user bits buffer has been written but data has not been transmitted completely. Reserved DIT_EXT_SYNCEN External Sync Enable. When this bit is set, the internal frame counter is set to zero at the next LRCLK rising edge.
Sony/Philips Digital Interface Registers Right Channel Status for Subframe B Registers (DITCHANBx) There are six channel status buffer registers associated with subframe B. These registers are listed with their locations in Table A-35. Table A-35. DITCHANBx Registers Register (Address) Bits 7–0 Bits 15–8 Bits 23–16 Bits 31–24...
Register Reference User Bits Buffer Registers for Subframe B Registers (DITUSRBITBx) There are six user bits buffer registers associated with subframe B (right channel). These registers are listed with their locations in Table A-37. Table A-37. DITUSRBITBx Registers Register (Address) Bits 7–0 Bits 15–8 Bits 23–16...
Sony/Philips Digital Interface Registers Receiver Control Register (DIRCTL) This 32-bit read/write register is used to set up error control and sin- gle-channel, double-frequency mode. The register is located at address 0x24A8. The register’s bits are shown in Figure A-34 and described in Table A-38.
Page 741
Register Reference Table A-38. DIRCTL Register Bit Descriptions Name Description 1–0 DIR_BIPHASE Parity Biphase Error Control. 00 = No action taken 01 = Hold last valid sample 10 = Replace invalid sample with zeros 11 = Reserved 3–2 DIR_LOCK Lock Error Control. 00 = No action taken 01 = Hold last valid sample 10 = Send zeros after the last valid sample...
Sony/Philips Digital Interface Registers Receiver Status Register (DIRSTAT) This 32-bit, read-only register is used to store the error bits. The error bits are sticky on read. Once they are set, they remain set until the register is read. This register also contains the lower byte of the 40-bit channel status information.
Page 743
Register Reference Table A-39. DIRSTAT Register Bit Descriptions Name Description DIR_NOAUDIOL Non-Audio Subframe Mode Channel 1. Based on SMPTE 337M. 0 = Not non-audio subframe mode 1 = Non-audio subframe mode, Channel 1 DIR_NOAUDIOR Non-Audio Subframe Mode Channel 2. Based on SMPTE 337M.
Sony/Philips Digital Interface Registers Left Channel Status for Subframe A Register (DIRCHANL) This register ( , described in Table A-40) is a 32-bit, read/write DIRCHANL register located at address 0x24AA. Table A-40. DIRCHANL Register Name Description 7–0 DIR_B1CHANL Channel status byte 1 for subframe A 15–8 DIR_B2CHANL Channel status byte 2 for subframe A...
Register Reference Sample Rate Converter Registers The sample rate converter (SRC) is composed of five registers which are described in the following sections. SRC Control Registers (SRCCTLx) These registers (read/write) control the operating modes, filters, and data formats used in the SRCs and are shown in Figure A-36 through Figure A-39...
Page 747
Register Reference Table A-42. SRCCTL0 Register Bit Descriptions (Cont’d) Name Description 4–2 SRC0_SMODEIN Serial Input Format. Selects the serial input format for SRC 0 as follows. 000 = Default, format is left-justified 001 = I 010 = TDM 100 = 24-bit right-justified 101 = 20-bit right-justified 110 = 18-bit right-justified 111 = 16-bit right-justified...
Page 748
Sample Rate Converter Registers Table A-42. SRCCTL0 Register Bit Descriptions (Cont’d) Name Description 13–12 SRC0_LENOUT Output Word Length Select. Selects the serial output word length on SRC 0 as follows: 00 = 24 bits 01 = 20 bits 10 = 18 bits 11 = 16 bits Any word length less than 24 bits will have dither added to the unused LSBs if SRCx_DITHER is enabled (= 1).
Page 749
Register Reference Table A-42. SRCCTL0 Register Bit Descriptions (Cont’d) Name Description 23–22 SRC1_DEEMPHASIS De-emphasis Filter Select. Enables deemphasis on incoming audio data for SRC 1. 00 = No de-emphasis 01 = 33 kHz 10 = 44.1 kHz 11 = 48 kHz SRC1_SOFTMUTE Soft Mute.
Page 752
Sample Rate Converter Registers Table A-43. SRCCTL1 Register Bit Descriptions (Cont’d) Name Description 4–2 SRC2_SMODEIN Serial Input Format. Selects the serial input format for SRC 2 as follows. 000 =Default, format is left-justified 001 = I 010 = TDM 100 = 24-bit right-justified 101 = 20-bit right-justified 110 = 18-bit right-justified 111 = 16-bit right-justified...
Page 753
Register Reference Table A-43. SRCCTL1 Register Bit Descriptions (Cont’d) Name Description 13–12 SRC2_LENOUT Output Word Length Select. Selects the serial output word length on SRC 2 as follows: 00 = 24 bits 01 = 20 bits 10 = 18 bits 11 = 16 bits Any word length less than 24 bits will have dither added to the unused LSBs if SRCx_DITHER is enabled (= 1).
Page 754
Sample Rate Converter Registers Table A-43. SRCCTL1 Register Bit Descriptions (Cont’d) Name Description 23–22 SRC3_DEEMPHASIS De-emphasis Filter Select. Enables de-emphasis on incoming audio data for SRC 3. 00 = No de-emphasis 01 = 33 kHz 10 = 44.1 kHz 11 = 48 kHz SRC3_SOFTMUTE Soft Mute.
Register Reference SRC Mute Register (SRCMUTE) This read-write register, described in Table A-44, connects an SRCx mute input and output (when cleared) to automatically mute input while the SRC is initializing. Bit 0 controls , bit 1 controls , bit 2 controls SRC0 SRC1 , and bit 3 controls...
Sample Rate Converter Registers SRC Ratio Registers (SRCRATx) These read-only status registers (shown in Figure A-40) report the mute and I/O sample ratio as follows: the register reports for SRC0 and SRCRAT0 1 and the register reports the mute and I/O sample ratio for SRCRAT1 SRC2 and 3.
Register Reference DAI/DPI Registers The registers that are described in the following sections are contained within the digital audio and digital peripheral interfaces. The bits in these registers are used to enable the connection of peripherals and to view sta- tus of data transfers.
Page 758
DAI/DPI Registers 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 DAI_STAT (0x24B8) Reserved IDP_DMA0_STAT IDP_FIFOSZ IDP_DMA1_STAT Number of Valid Data in IDP FIFO IDP_DMA2_STAT Reserved IDP_DMA3_STAT IDP_DMA7_STAT IDP_DMA4_STAT IDP_DMA6_STAT DMA Active Status for IDP_DMA5_STAT IDP Channel 15 14 13 12 11 10...
Register Reference Table A-45. DAI_STAT Register Bit Descriptions (Cont’d) Name Description 24–17 IDP_DMAx_STAT Input Data Port DMA Status. 0 = DMA is not active 1 = DMA is active 27–25 Reserved 31–28 IDP_FIFOSZ IDP FIFO Size. Number of samples in the IDP FIFO. DAI Resistor Pull-up Enable Register (DAI_PIN_PULLUP) This 20-bit, read/write register is shown in...
DAI/DPI Registers DAI Pin Buffer Status Register (DAI_PIN_STAT) This 20-bit, read-only register is shown in Figure A-43. Bits 19–0 of this register indicate the status of . Reads from bits 31–20 always DAI_PB[20:1] return 0. This register is updated at one-half the core clock rate. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 DAI_PIN_STAT (0x24B9) DAI_PB17...
Page 761
Register Reference The DAI interrupt controller is configured using three registers. Each of the 32 interrupt lines can be independently configured to trigger based on the incoming signal’s rising edge, falling edge, both, or neither. Setting a bit in enables that interrupt level on the DAI_IRPTL_RE DAI_IRPTL_FE rising and falling edges, respectively.
DAI/DPI Registers DPI Pin Buffer Status Register (DPI_PIN_STAT) This 16-bit, read-only register is shown in Figure A-46. Bits 13–0 of this register indicate the status of . Reads from bits 15–14 always DPI_PB[14:1] return 0. This register is updated at one-half the core clock rate. DPI_PIN_STAT (0x1C31) 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 Reserved...
Page 765
Register Reference All of the DPI interrupt registers are used primarily to provide the status of the interrupt controller. These registers are shown in Figure A-47 listed in Table A-47. Note that for each of these registers the bit names and numbers are the same.
UART Control and Status Registers UART Control and Status Registers The processor provides a set of PC-style, industry-standard control and status registers for each UART. These memory-mapped registers (MMRs) are byte-wide registers that are mapped as half-words with the most signif- icant byte zero-filled.
Page 767
Register Reference 15 14 13 12 11 10 UART0LCR (0x3C03) UART1LCR (0x4003) Reserved UARTWLS Word Length Select UARTDLAB 00=5-bit word(UARTWLS5) Divisor Latch Access 01=6-bit word(UARTWLS6) 1=Enable access to UARTxDLL and UARTxDLH 10=7-bit word(UARTWLS7) 0=Enable access to UARTxTHR, UARTxRBR, and 11=8-bit word(UARTWLS8) UART_IER UARTSTB UARTSB...
UART Control and Status Registers Line Status Registers (UARTxLSR) The UART line status registers ( ) contain UART status informa- UARTxLSR tion as shown in Figure A-49. There are also shadow registers, , with the following addresses: (0x3C0A) and UARTxLSRSH UART0LSRSH (0x400A).
Register Reference Transmit Hold Registers (UARTxTHR) In no pack mode (default), only the lower byte of these registers is used— all other bits are zero-filled. However in pack mode, both the high and low bytes are used. The are the 9th bit in 9-bit transmission TX9D RX9D mode.
UART Control and Status Registers Receive Buffer Registers (UARTxRBR) These read-only registers (shown in Figure A-51) are mapped to the same address as the write-only registers. To access UARTxTHR UARTxRBR bit in the register must be cleared. When the UARTDLAB UARTxLCR bit is cleared, writes to this address target the registers,...
Register Reference Interrupt Enable Registers (UARTxIER) The UART interrupt enable registers ( ) are used to enable UARTxIER requests for system handling of empty or full states of UART data regis- ters. Unless polling is used as a means of action, the and/or UARTRBFIE bits in these registers are normally set.
UART Control and Status Registers Interrupt Identification Registers (UARTxIIR) For legacy reasons, the UART interrupt identification registers ( UARTxIIR shown in Figure A-53) still reflect the UART interrupt status. Legacy operation may require bundling all UART interrupt sources to a single interrupt channel and servicing them all by the same software routine.
Register Reference Divisor Latch Registers (UARTxDLL, UARTxDLH) The bit rate is characterized by the system clock ( ) and the 16-bit SCLK divisor. The divisor is split into the UART divisor latch low byte register ) and the UART divisor latch high byte register ( UARTxDLL UARTxDLH both shown in...
UART Control and Status Registers Scratch Registers (UARTxSCR) The contents of the 8-bit UART scratch registers ( shown in UARTxSCR Figure A-55) is reset to 0x00. It is used for general-purpose data storage and does not control the UART hardware in any way. UART0SCR (0x3C07) UART1SCR (0x4007) 15 14 13 12 11 10...
Register Reference Table A-48. UART Mode Register Bit Descriptions Name Description UARTPACK Packing Enable. 0 = No pack 1 = Packing enabled. Consecutive data words (example 0xAB and 0xCD) are packed as 0x00CD 00AB in the receiver, and 0x00CD 00AB is transmitted as two words of 0xAB and 0xCD successively from the transmitter.
UART Control and Status Registers DMA Control Registers (UARTxTXCTL, UARTxRXCTL) Use these registers (described in Table A-49 Table A-50) to enable DMA, DMA chaining, and to clear the transmit and receive buffers. The transmit and receive registers are read-write registers and their addresses are: UART0TXCTL –...
Register Reference DMA Status Registers (UARTxTXSTAT, UARTxRXSTAT) These read-only registers (described in Table A-51 Table A-52) pro- vide DMA status information and their addresses are: UART0TXSTAT – 0x3F05 UART1TXSTAT – 0x4305 UART0RXSTAT – 0x3E05 UART1RXSTAT – 0x4205 Table A-51. UARTxTXSTAT Register Bit Descriptions Name Description Reserved...
Two Wire Interface Registers Apart from the DMA control and status registers there are index, modifier, count, and chain pointer registers for both the transmit and receive DMA channels. For more information on these regis- ters, see “Port, Buffer, and DMA Control Registers” on page 2-26, Table 2-13, “UART DMA Registers,”...
Register Reference Table A-53. TWI Register Descriptions (Cont’d) Address Name Description 0x4488 RXTWI8 8-Bit FIFO Receive Register 0x448C RXTWI16 16-Bit FIFO Receive Register Master Internal Time Register (TWIMITR) The TWI control register ( , shown in Figure A-57 and described TWIMITR Table A-54) is used to enable the TWI module as well as to establish a...
Two Wire Interface Registers Table A-54. Master Internal Time Register Bit Descriptions Name Description 0–6 PRESCALE Prescale. The number of peripheral clock (PCLK) periods used in the generation of one internal time reference. The value of PRESCALE must be set to create an internal time reference with a period of 10 MHz.
Register Reference Table A-55. Clock Divider Register Bit Descriptions Name Description 7–0 CLKLOW Clock Low. Number of internal time reference periods the serial clock (SCL) is held low. Represented as an 8-bit binary value. 15–8 CLKHI Clock High. Number of internal time reference periods the serial clock (SCL) waits before a new clock low period begins (assuming a single master).
Page 782
Two Wire Interface Registers Table A-56. Slave Mode Control Register Bit Descriptions Name Description TWISEN Slave Enable. 0 = The slave is not enabled. No attempt is made to identify a valid address. If cleared during a valid transfer, clock stretching ceases, the serial data line is released and the current byte is not acknowledged.
Register Reference Slave Address Register (TWISADDR) The TWI slave mode address register ( , shown in Figure A-60) TWISADDR holds the slave mode address, which is the valid address that the slave-enabled TWI controller responds to. The TWI controller compares this value with the received address during the addressing phase of a transfer.
Two Wire Interface Registers Master Control Register (TWIMCTL) The TWI master mode control register ( , shown in Figure A-62 TWIMCTL and described in Table A-57) controls the logic associated with master mode operation. Bits in this register do not affect slave mode operation and should not be modified to control slave mode functionality.
Page 785
Register Reference Table A-57. Master Control Register Bit Descriptions Name Description TWIMEN Master Mode Enable. Clears itself at the completion of a transfer. This includes transfers terminated due to errors. 0 = Master mode functionality is disabled. If MEN is cleared during operation, the transfer is aborted and all logic associated with master mode transfers are reset.
Page 786
Two Wire Interface Registers Table A-57. Master Control Register Bit Descriptions (Cont’d) Name Description 13–6 TWIDCNT Data Transfer Count. Indicates the number of data bytes to transfer. As each data word is transferred, the data transfer count is decre- mented. When DCNT is zero, a STOP (or restart condition) is issued.
Register Reference Master Address Register (TWIMADDR) During the addressing phase of a transfer, the TWI controller, with its master enabled, transmits the contents of the TWI master mode address register ( , shown in Figure A-63). When programming this regis- TWIMADDR ter, omit the read/write bit.
Two Wire Interface Registers Master Status Register (TWIMSTAT) The TWI master mode status register ( , shown in Figure A-64 TWIMSTAT and described in Table A-58) holds information during master mode transfers and at their conclusions. Generally, master mode status bits are not directly associated with the generation of interrupts but offer informa- tion on the current transfer.
Page 789
Register Reference Table A-58. Master Status Register Bit Descriptions Name Description TWIMPROG Master Transfer In Progress. 0 = Currently no transfer is taking place. This can occur once a transfer is complete or while an enabled master is waiting for an idle bus. 1 = A master transfer is in progress.
Page 790
Two Wire Interface Registers Table A-58. Master Status Register Bit Descriptions (Cont’d) Name Description TWIWERR Buffer Write Error. 0 = The current master receive has not detected a receive buffer write error. 1 = The current master transfer was aborted due to a receive buffer write error.
Register Reference FIFO Control Register (TWIFIFOCTL) The TWI FIFO control register ( , shown in Figure A-65 TWIFIFOCTL described in Table A-59) affects only the FIFO and is not tied in any way with master or slave mode operation. TWIFIFOCTL (0x4428) 15 14 13 12 11 10 TWIBHD TWITXFLUSH...
Page 792
Two Wire Interface Registers Table A-59. TWIFIFOCTL Register Bit Descriptions Name Description TWITXFLUSH Transmit Buffer Flush. 0 = Normal operation of the transmit buffer and its status bits 1 = Flush the contents of the transmit buffer and update the status to indicate the buffer is empty.
Register Reference FIFO Status Register (TWIFIFOSTAT) The fields in the TWI FIFO status register ( , shown in TWIFIFOSTAT Figure A-66 and described in Table A-60) indicate the state of the FIFO buffers’ receive and transmit contents. The FIFO buffers do not discrimi- nate between master data and slave data.
Page 794
Two Wire Interface Registers Table A-60. FIFO Status Register Bit Descriptions Name Description 1–0 TWITXS Transfer FIFO Status. These read-only bits indicate the num- ber of valid data bytes in the FIFO buffer. The status is updated with each FIFO buffer write using the peripheral data bus or read access by the transmit shift register.
Register Reference Interrupt Source Register (TWIIRPTL) The TWI interrupt source register ( , shown in Figure A-67 TWIIRPTL described in Table A-61) contains information about functional areas requiring servicing. Many of the bits serve as an indicator to further read and service various status registers.
Page 796
Two Wire Interface Registers Table A-61. Interrupt Source Register Bit Descriptions Name Description TWISINIT Slave Transfer Initiated. 0 = A transfer is not in progress. An address match has not occurred since the last time this bit was cleared. 1 = The slave has detected an address match and a transfer has been initiated.
Page 797
Register Reference Table A-61. Interrupt Source Register Bit Descriptions (Cont’d) Name Description TWITXINT Transmit FIFO Service. 0 = No errors detected. 1 = The transmit FIFO buffer has one or two 8-bit locations avail- able to be written. If TWITXINT2 is 0, this bit is set each time TWITXS is updated to either 01 or 00.
Two Wire Interface Registers Interrupt Enable Register (TWIIMASK) The TWI interrupt enable register ( , shown in Figure A-68 TWIIMASK described in Table A-62) enables interrupt sources to assert the interrupt output. Each enable bit corresponds with one interrupt source bit in the TWI interrupt source register ( ).
Page 799
Register Reference Table A-62. Interrupt Mask Register Bit Descriptions Name Description TWISINIT Slave Transfer Initiate Interrupt Enable. 0 = The corresponding interrupt source is prevented from asserting the interrupt output. 1 = The corresponding interrupt source asserts the interrupt output. TWISCOMP Slave Transfer Complete Interrupt.
Two Wire Interface Registers Table A-62. Interrupt Mask Register Bit Descriptions (Cont’d) Name Description TWITXINT Transmit FIFO Service Interrupt Enable. 0 = The corresponding interrupt source is prevented from asserting the interrupt output. 1 = The corresponding interrupt source asserts the interrupt output.
Register Reference 16-Bit Transmit FIFO Register (TXTWI16) The TWI FIFO transmit 16-bit register ( , shown in Figure A-70) TXTWI16 holds a 16-bit data value written into the FIFO buffer. To reduce inter- rupt output rates and peripheral bus access times, a 16-bit transfer data access can be performed.
Two Wire Interface Registers 8-Bit Receive FIFO Register (RXTWI8) The TWI FIFO receive data 8-bit register ( , shown in Figure A-71) RXTWI8 holds an 8-bit data value read from the FIFO buffer. Receive data is read from the corresponding receive buffer in a first-in first-out order. Although peripheral bus reads are 32 bits, a read access to can only RXTWI8...
Precision Clock Generator Registers PCG Pulse Width Registers Pulse width is the number of input clock periods for which the frame sync output is . Pulse width should be less than the divisor of the frame HIGH sync. The pulse width control registers are shown in Figure A-75 Figure A-76 and described in...
Precision Clock Generator Registers PCG Frame Synchronization Registers (PCG_SYNCx) These registers, shown in Figure A-77, and Figure A-78 and described in Table A-67 Table A-68, allow programs to synchronize the clock frame syncs units with external frame syncs. For more information, see “Frame Sync”...
Page 809
Register Reference Table A-67. PCG_SYNC Register Bit Descriptions Name Description FSA_SYNC Enable synchronization of frame sync A with external frame sync. 0 = Frame sync disabled 1 = Frame sync enabled CLKA_SYNC Enable synchronization of clock A with external frame sync.
Page 810
Precision Clock Generator Registers PCG_SYNC2 (0x24CB) 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 FSD_SYNC FSD_SOURCE_IOP Enable frame sync D input source. Enable synchronization of 0 = XTAL buffer output selected for frame sync D FSD with external LRCLK 1 = EXT_CLKA_I selected for frame sync D CLKD_SYNC...
Page 811
Register Reference Table A-68. PCG_SYNC2 Register Bit Descriptions (Cont’d) Name Description FSC_SOURCE_IOP Enable frame sync C input source. 0 = XTAL buffer output selected for frame sync C 1 = EXT_CLKA_I selected for frame sync C FSD_SYNC Enable synchronization of frame sync D with external frame sync.
Peripheral Interrupt Priority Control Registers Peripheral Interrupt Priority Control Registers The following sections provide descriptions of the programmable inter- rupts that are used in the ADSP-21367/8/9 and ADSP-2137x processors. For information on the interrupt registers and the interrupt vector table, Appendix B, Interrupts.
Page 813
Register Reference Table A-69. Peripheral Interrupt Controller Routing Table Interrupt Vector Programmable Default Default Function Priority Name Address Interrupt Control Select Register (PICR) Value 0x2C PICR0[4:0] 0x00 DAI1I interrupt HIGHEST 0x30 PICR0[9:5] 0x01 SPIA interrupt 0x34 PICR0[14:10] 0x02 IOP GP timer-0 interrupt 0x38 PICR0[19:15] 0x03...
Page 814
Peripheral Interrupt Priority Control Registers Table A-69. Peripheral Interrupt Controller Routing Table (Cont’d) Interrupt Vector Programmable Default Default Function Priority Name Address Interrupt Control Select Register (PICR) Value UART0TxI 0x15 UART 0 transmit interrupt UART1TxI 0x16 UART 0 transmit interrupt TWII 0x17 Two wire interface interrupt...
Register Reference Peripheral Interrupt Priority0 Control Register (PICR0) This 32-bit, read/write register controls programmable peripheral inter- rupts 0–5 and the default sources shown in Figure A-79. This register is located at address 0x2200. The reset value of this register is 0x0A418820. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 PICR0 (0x2200) RESET=0x0A418820...
Peripheral Interrupt Priority Control Registers Peripheral Interrupt Priority1 Control Register (PICR1) This register controls programmable peripheral interrupts 6–11 and the default sources shown in Figure A-80. This 32-bit, read/write register is located at address 0x2201. The reset value of this register is 0x16A4A0E6. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 PICR1 (0x2201) RESET=0x16A4A0E6...
Register Reference Peripheral Interrupt Priority2 Control Register (PICR2) This register controls programmable peripheral interrupts 12–17 as well as the default sources shown in Figure A-81. This 32-bit, read/write register is located at address 0x2202. The reset value of this register is 0x2307B9AC.
Power Management Control Register (PMCTL) Peripheral Interrupt Priority3 Control Register (PICR3) This register controls programmable peripheral interrupt 18 as shown in Figure A-82. This 32-bit, read/write register is located at address 0x2203. The reset value of this register is 0x00000012. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 PICR3 (0x2203) RESET=0x00000012...
Page 819
Register Reference 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 PMCTL (0x2000) TIMEROFF CRAT0 Timer Enable/Disable PLL Clock Ratio Bit 0 SPIOFF CRAT1 Shut Down Clock to SPIs PLL Clock Ratio Bit 1 SP45POFF SDCKR Shut Down Clock to SPORT4–5...
Page 820
Power Management Control Register (PMCTL) Table A-70. PMCTL Register Bit Descriptions Name Description 5–0 PLLM PLL Multiplier (read/write). PLLM = 0 PLL multiplier = 64 0<PLLM<63 PLL multiplier = PLLM CLK_CFG1–0 reset value 00 = 0000110 01 = 100000 10 = 010000 11 = 000110 7–6 PLLDx...
Page 821
Register Reference Table A-70. PMCTL Register Bit Descriptions (Cont’d) Name Description UART1OFF UART1 Clock Enable. 0 = UART1 is in normal mode 1 = Shut down clock to UART1 PLLBP PLL Bypass Mode Indication. 0 = PLL is in normal mode 1 = Put PLL in bypass mode Reset value = 0 CRAT0...
Page 822
Power Management Control Register (PMCTL) Table A-70. PMCTL Register Bit Descriptions (Cont’d) Name Description SRCOFF SRC Off. 0 = SRC, SPDIF, SRU, PCG, DAI, IDP, PDAP blocks in nor- mal mode 1 = Turn OFF clock to SRC, SPDIF, SRU, PCG, DAI, IDP, PDAP PPPDN External Port Enable/Disable.
Register Reference Hardware Breakpoint Control Register register controls how breakpoints are used if bit 25, , is BRKCTL UMODE set. This user-accessible register, shown in Figure A-84 Figure A-85 and described in Table A-71, is located at address 0x30025. The register is a 32-bit, memory-mapped I/O register. The core can write into this register.
Page 829
Register Reference Table A-72. EEMUSTAT Register Bit Descriptions Name Description STATPA Program Memory Data Breakpoint Hit. 0 = No program memory breakpoint occurs 1 = Program memory breakpoint occurs STATDA0 Data Memory Breakpoint Hit. 0 = No data memory #0 breakpoint occurs 1 = Data memory #0 breakpoint occurs STATDA1 Data Memory Breakpoint Hit...
Page 830
Enhanced Emulation Status Register Table A-72. EEMUSTAT Register Bit Descriptions (Cont’d) Name Description EEMUOUTFULL Enhanced Emulation EEMUOUT FIFO Status. 0 = EEMUOUT FIFO is not full 1 = EEMUOUT FIFO full EEMUINFULL Enhanced Emulation EEMUIN Register Status. 0 = EEMUIN register is empty 1 = EEMUIN register full EEMUENS Enhanced Emulation Feature Enable.
B INTERRUPTS This chapter provides a complete listing of the registers that are used to configure and control interrupts. Table B-2 shows all the processor inter- rupts, listed according to their bit position in the , and IRPTL LIRPTL registers. Also shown are the addresses of the interrupt vectors. Each IMASK vector is separated by four memory locations.
Page 832
Interrupt Vector Tables Note that the SPI has only one interrupt for both transmit and receive operations and each serial port (SPORT) has only one interrupt for both transmit and receive. Table B-2. Interrupt Vector Addresses Interrupt Register IRPTL/ Vector Interrupt Function Number...
Interrupt Vector Tables Table B-2. Interrupt Vector Addresses (Cont’d) Interrupt Register IRPTL/ Vector Interrupt Function Number LIRPTL/ Address Name MASK Bit# IRPTL 0xA0 SFT2I User software interrupt 2 IRPTL 0xA4 SFT3I User software interrupt 3 LOWEST PRIORITY 1 If configured for internal ROM boot mode, then the base address for the interrupt vector table is the starting address of internal ROM or 0x00080000.
Page 835
Interrupts Table B-3. Interrupt Selection Values (Cont’d) Interrupt Source Interrupt Select Comments Value (5-Bits) GPTMR1I 0x0A Genera-purpose Timer 1 interrupt SP7I 0x0B Serial port 7 interrupt 0x0C DAI low priority interrupt EP1I 0x0D External port channel 1 interrupt 0x0E DPI interrupt MTMDMAI 0x0F Memory-to-memory DMA interrupt...
Interrupt Registers Interrupt Registers This section provides information on the registers that are used to config- ure and control interrupts. These registers are: • “Interrupt Register (LIRPTL)” on page B-6 • “Interrupt Latch Register (IRPTL)” on page B-13 • “Interrupt Mask Register (IMASK)” on page B-18 •...
Page 839
Interrupts Table B-4. LIRPTL Register Bit Descriptions (Cont’d) Name Description P8I (SP4I) Programmable Interrupt 8 (SPORT 4 Interrupt). Indicates if an SP4I interrupt is latched and is pending (if set, = 1), or no SP4I is pending (if cleared, = 0). An SP4I interrupt occurs two cycles after the last bit of an input/output serial word is latched into/from RXSP4A/TXSP4A, RXSP4B/TXSP4B.
Page 840
Interrupt Registers Table B-4. LIRPTL Register Bit Descriptions (Cont’d) Name Description P18I (SPIB) Programmable Interrupt 18 (SPI B Interrupt). Indicates if an SPIB interrupt is latched and pending (if set, = 1), or no SPIBI interrupt is pending (if cleared, = 0). P6IMSK Programmable Interrupt Mask 6 (SPORT0 Interrupt (SP0IMSK)
Page 842
Interrupt Registers Table B-4. LIRPTL Register Bit Descriptions (Cont’d) Name Description P13IMASKP Programmable Interrupt 13 Mask Pointer (External Port (EPDMA1IMSKP) DMA Channel 1 Interrupt Mask Pointer). When the processor is servicing another interrupt, this bit indicates if the EPDMA1I is unmasked (if set, = 1) or masked (if cleared, = 0).
Interrupts Interrupt Latch Register (IRPTL) register is a non-memory-mapped, universal, system register IRPTL ). The reset value for this register is 0x0000 0000. The Ureg Sreg register indicates latch status for interrupts. Figure B-3, Figure B-4 IRPTL Table B-5 provide bit definitions for the register.
Page 845
Interrupts Table B-5. Interrupt Latch (IRPTL) Register Bit Descriptions (Cont’d) Name Description IICDI Illegal Input Condition Detected Interrupt. Indicates if an IICDI is latched and is pending (if set, = 1), or no IICDI is pending (if cleared, = 0). An IICDI occurs when a true results from the logical Oring of the illegal I/O processor register access (IIRA) and unaligned 64-bit memory access bits in the STKYx registers.
Page 846
Interrupt Registers Table B-5. Interrupt Latch (IRPTL) Register Bit Descriptions (Cont’d) Name Description IRQ1I IRQ1 Hardware Interrupt. Indicates if an IRQ1I is latched and is pending (if set, = 1), or no IRQ1I is pending (if cleared, = 0). An IRQ1I occurs when an external device asserts the FLAG1 pin config- ured as IRQ1.
Page 847
Interrupts Table B-5. Interrupt Latch (IRPTL) Register Bit Descriptions (Cont’d) Name Description P14I (DPI) Programmable Interrupt 14. Indicates if a DPI interrupt is latched and is pending (if set, = 1), or no DPI interrupt is pending (if cleared, = 0). P15I Programmable Interrupt 15 (MTMDMA Interrupt).
Interrupt Registers Table B-5. Interrupt Latch (IRPTL) Register Bit Descriptions (Cont’d) Name Description EMULI Emulator (Lower Priority) Interrupt. Indicates if an EMULI is latched and is pending (if set, = 1), or no EMULI is pending (if cleared, = 0). An EMULI occurs on reset and when an external device asserts the EMU pin.
Page 849
Interrupts Table B-6. IMASK Register Bit Descriptions Name Description EMUI Emulator Interrupt. This bit is set to 1 (unmasked). An EMUI occurs on reset and when an external device asserts the EMU pin. RSTI Reset Interrupt. This bit is set to 1 (unmasked). An RSTI occurs on reset as an external device asserts the RESET pin.
Page 850
Interrupt Registers Table B-6. IMASK Register Bit Descriptions (Cont’d) Name Description IRQ1I IRQ1 Hardware Interrupt. Unmasks the IRQ1I interrupt (if set, = 1), or masks the IRQ1I interrupt (if cleared, = 0). An IRQ1I occurs when an external device asserts the FLAG1 pin configured as IRQ1. IRQ0I IRQ0 Hardware Interrupt.
Page 851
Interrupts Table B-6. IMASK Register Bit Descriptions (Cont’d) Name Description CB7I DAG1 Circular Buffer 7 Overflow Interrupt. Unmasks the CB7I inter- rupt (if set, = 1), or masks the CB7I interrupt (if cleared, = 0). A circu- lar buffer overflow occurs when the DAG circular buffering operation increments the I register past the end of the buffer.
Interrupt Registers Interrupt Mask Pointer Register (IMASKP) register is a non-memory-mapped, universal, system register IMASKP ). The reset value for this register is 0x0000 0000. Each bit Ureg Sreg in the register corresponds to a bit with the same name in the IMASKP registers.
Page 853
Interrupts Table B-7. IMASKP Register Bit Descriptions Name Description EMUI Emulator Interrupt. When the processor is servicing another interrupt, this bit indicates if the EMUI interrupt is unmasked (if set, = 1), or masked (if cleared, = 0). An EMUI occurs on reset and when an external device asserts the EMU pin.
Page 854
Interrupt Registers Table B-7. IMASKP Register Bit Descriptions (Cont’d) Name Description BKPI Hardware Breakpoint Interrupt. When the processor is servicing another interrupt, this bit indicates if the BKPI interrupt is unmasked (if set, = 1), or masked (if cleared, = 0). Reserved IRQ2I IRQ2 Hardware Interrupt.
Page 855
Interrupts Table B-7. IMASKP Register Bit Descriptions (Cont’d) Name Description SP3I SPORT 3 Interrupt. When the processor is servicing another interrupt, this bit indicates if the SP3I interrupt is unmasked (if set, = 1), or masked (if cleared, = 0). An SP3I interrupt occurs two cycles after the last bit of an input/output serial word is latched into/from RXSP3A/TXSP3A, or RXSP3B/TXSP3B.
Page 856
Interrupt Registers Table B-7. IMASKP Register Bit Descriptions (Cont’d) Name Description FLTUI Floating-Point Underflow Interrupt. When the processor is servicing another interrupt, this bit indicates if the FLTUI interrupt is unmasked (if set, = 1), or masked (if cleared, = 0). FLTII Floating-Point Invalid Operation Interrupt.
INDEX Numerics addressing, 14-53 7-bit in TWI, 12-1, 12-15 128-channel TDM, general call in TWI, 12-14 16-bit to 32-bit word packing enable IOP, 2-29 (PACK), 5-62 pre-modify, 2-39 16-bit word lengths, 5-45, 6-32, 7-14 restrictions on external memory, 32-bit word lengths, 5-45, 6-32, 7-14 transfer phase in TWI, 12-6...
Page 858
Index AMI bits baud rate (continued) ACK pin enable (ACKEN), A-18 SPIBAUD (serial peripheral interface AMI enable (AMIEN), A-18 baud rate) register, 6-5, A-60 buffer flush (FLSH), A-19 UART, 11-4, 11-5, 11-12 bus hold cycle (HC), A-18 beginning and ending an SPI transfer, 6-29 bus idle cycle (HC), A-19...
Page 859
Index booting bus request, shared memory (BRx) pins, boot kernel, 14-37 3-81, 3-92 BOOT_CFGx (boot source bus synchronized (BSYN) bit, 3-89, 3-93, configuration) pins, 14-38 bootstrap loading, 14-37 bus transition cycle (BTC), 3-82 from SPI flash, 14-42 buses SPI port, 14-42 arbitration, 2-20, 3-79, 3-82...
Page 860
Index CAS latency channel B transmit status register bit (SDCL), A-22 (SPDIF_TX_CHSTB), A-90, A-91 definition, 3-32 channel double frequencey mode, single, setting, 3-40 catastrophic interrupts, 4-65 channel mode (SPDIF), two, CBR (CAS before RAS) definition, 3-33 channel number, encoded, 7-19 CBxI (circular buffer x overflow interrupt) channel selection registers, 5-31...
Page 861
Index clocks and system clocking (continued) connections frame sync bypass mode, direct bypass, group A, DAI, clock signals, 4-19 13-6 group A, DPI, input routing signals, frame sync bypass mode, one shot, 13-6 4-52 internal clock select (ICLK) bit, A-37 group B, DAI data signals, 4-25 jitter,...
Page 862
Index (continued) DAI registers (continued) clock routing control registers (group A), DAI_IRPTL_RE register as replacement 4-19 to IMASK register, 4-69 configurable interrupts, A-112 falling edge interrupt mask register configuration macro, 4-77 (DAI_IRPTL_FE), A-115 connecting peripherals with, high priority interrupt default configuration, 4-18 (DAI_IRPTL_H), A-113...
Page 863
Index data (continued) division multiplexed (TDM) mode, time, packing and unpacking, 5-45 9-19 data buffers, in serial ports, divisor data bus (DATA) pins, 3-20 clock output, 13-3 data direction control (SPTRAN) bit, 5-64, reset, UART, 11-12 A-39 SPORT (DIVx) registers, 5-6, A-44 data fetch, external port, 3-25...
Page 865
Index enable equation (continued) breakpoint (ENBx) bit, A-178 PWM dead time, clock outputs, 13-3 PWM switching frequency, DMA, 7-20 SDRAM refresh rate, 3-50 DMA interrupt (INTEN) bit, 6-34 serial clock frequency, 5-70 external port (asynchronous memory serial port clock divisor, 5-70 interface), A-18...
Page 866
Index errors/flags, DMA, external port, host port, execution stalls, bus transition, 3-84 serial port, SPI port, UART port, 6-35 external data path width, setting, 3-43 examples external master clock, 14-21 bidirectional DAI pin buffer, 4-13 external memory DAI pin buffer, 4-10 access timing, 3-36...
Page 867
Index external port (continued) external port registers (continued) modes, setting, 3-24 length and base (ELEP, EBEP), 2-37 read hold cycle (RHC) bits, A-19 external port bits bank select (BxSD), A-11 FE (framing error) bit, 11-4 bus priority (EPBR), A-12 FIFO data enable (DATA), A-13 control and status in input data port,...
Page 868
Index frame sync (continued) glitch vulnerability (SPORTs), 5-10 both enable (FS_BOTH) bit, 5-64 GM (get more data) bit, 6-11, 6-20, 6-37, early vs. late, 5-40 A-54 equations, 13-11 ground plane, in PCB design, 14-34 frequencies, 5-69 groupings of signals in DAI/DPI, in multichannel mode, 5-28 internal vs.
Page 869
Index I/O processor (continued) (continued) chained DMA, 2-14 control bits, 5-21 configuring DMA, example for DAI, 13-15 count registers, 2-27, 2-31 mode, 5-74 DAI interrupt registers (DAI_IRPTL_H, mode (IDP), 7-3, 7-5, 7-21 DAI_IRPTL_L), SPCTLx control bits, 5-22 data (IOD) bus, 2-20 timing (IDP), data buffers in DMA,...
Page 872
Index interrupt mask (IMASK) control register, latching B-18 high and low priority (DAI/DPI), 4-69 interrupt vector, sharing, 5-72 interrupt latch (IRPTL) register, B-13 interrupts, B-15, B-19, B-24 status for interrupts, B-13 (enable RX status interrupt) bit, A-123 latchup, 14-32 assigning priority for UART, 11-11 latency catastrophic,...
Page 873
Index mode broadcast (SPI), making connections via the signal routing chain insertion, 2-14, 2-41 unit, 4-15 chained DMA, 2-41 manual left-justified (SPORT), 5-16 contents, xxxii left-justified sample pair (IDP), conventions, xliii loopback (SPORT), 5-6, A-42 new in this edition, xxxiv master (SPI), 6-38 related documents,...
Page 874
Index MTxCSx (serial port transmit select) OSPID (operating system process ID), 2-4, registers, A-46 A-182 multichannel A and B channels, A-30 OSPIDENS (operating system process ID) multichannel compand select (MTxCCSy register enable bit, A-182 and MRxCCSy) registers, 5-47 output control unit, PWM, 8-17 multichannel operation (SPORT), 5-25...
Page 886
Index SPORT bits (continued) SPORT modes (continued) frame sync both (FS_BOTH), 5-64, operation mode (OPMODE) bit, 5-62 A-39 standard DSP, 5-11, A-30 frame sync required (FSR), A-38 SPORTs FS both enable (FS_BOTH), A-39 See also SPORT bits, modes, registers internal clock select (ICLK), 5-62, A-37 128-channel TDM, internal frame sync select (IFS), 5-63,...
Page 887
Index SPORTs (continued) SPORTs registers (continued) interrupts, priority of, 5-72 divisor (DIVx), latency in writes, 5-58 DMA parameter, 5-76 operation modes, 5-10, 5-11, 5-59 modify (IMSPx), A-50 pairing, 5-27 receive buffer (RXSPx), A-44 primary and secondary data buffers, SPCTLx (serial port control), A-29 pulse code modulation (PCM), 5-20...
Page 888
Index (continued) (continued) sample rate ratio, 10-2, 10-19 group C (frame sync) signals, 4-31 sample rates, input, 10-18 group D (pin assignments) signals, 4-36 servo loop, 10-2 group E (miscellaneous) signals, 4-43 time division multiplexing mode, 10-16, 4-46 10-18 group F signals, 4-47 tracking input and output rates, 10-2...
Page 889
Index STATPA (program memory data SYSCTL register (continued) breakpoint hit) bit, A-181 rotating priority bus arbitration (RBPR) STATUS field, 11-10 bit, strobe period, 13-13 SRST (software reset) bit, strobe pulse, 13-13 timer (flag) expired mode strobe, PDAP output, 7-14 (TMREXPEN) bit, STROBEA (one shot frame sync A) bit, system control register.
Page 890
Index system design (continued) timing (continued) recommendations and suggestions, SPORT framed vs. unframed data, 5-40 14-34 SPORT left-justified sample pair mode, RESET pin, 14-33 5-19 shared memory system diagram, 3-79 SPORT normal vs. alternate framing, stalls, 14-54 5-40 switching frequencies, 14-29 SPORT word select, 5-25...
Page 891
Index TWI controller (continued) slave transmit data valid (TWIDVAL), little endian word order, 12-9 A-134 prescale register, 12-4 TWI controller registers programming examples, 12-15 clock divider (TWIDIV), 12-5, A-132 start and stop conditions, 12-13 RXTWI16 (16-bit receive FIFO) transferring data, 12-10 register, 12-10...
Page 892
Index UART bits (continued) TSR and UARTxTHR empty UART, 11-1 (UARTTEMT), 11-4 assigning interrupt priority, 11-11 UARTNOINT (pending interrupt), baud rate, 11-4, 11-5 A-124 baud rate examples, 11-12 UARTSTAT (interrupt), A-124 data ready flag, 11-13 UART registers data word, 11-4 divisor latch (UARTxDLH), 11-11, divisor, 11-11, A-125...
Need help?
Do you have a question about the SHARC ADSP-21368 and is the answer not in the manual?
Questions and answers