Manual Texas Instruments TMS320C3x

757 pages 2.87 mb
Download

Go to site of 757

Summary
  • Texas Instruments TMS320C3x - page 1

    TMS320C3x User ’ s Guide Literature Number: SPRU031E 2558539-9761 revision L July 1997 Printed on Recycled Paper ...

  • Texas Instruments TMS320C3x - page 2

    IMPORT ANT NOTICE T exas Instruments (TI) reserves the right to make changes to its products or to discontinue any semiconductor product or service without notice, and advises its customers to obtain the latest version of relevant information to verify , before placing orders, that the information being relied on is current. TI warrants performance ...

  • Texas Instruments TMS320C3x - page 3

    iii Preface Read This First About This Manual This user ’s guide serves as an applications reference book for the TMS320C3x generation of digital signal processors (DSPs). These include the TMS320C30, TMS320C31, TMS320LC31, and TMS320C32. Throughout the book, all refer- ences to ’C3x refer collectively to the ’C30, ’C31, ’LC31 and ’C32. ...

  • Texas Instruments TMS320C3x - page 4

    Notational Conventions iv In syntax descriptions, the instruction, command, or directive is in bold typeface and parameters are in an italic typeface . Portions of a syntax that are in bold must be entered as shown; portions of a syntax that are in italics describe the type of information that must be entered. Here is an example of a directive synt ...

  • Texas Instruments TMS320C3x - page 5

    Information About Cautions / Related Documentation from T exas Instruments v Read This First Information About Cautions This book contains cautions. This is an example of a caution statement. A caution statement describes a situation that could potentially damage your software or equipment. The information in a caution is provided for your protecti ...

  • Texas Instruments TMS320C3x - page 6

    Related Documentation from T exas Instruments / References vi TMS320C3x C Source Debugger User ’s Guide (literature number SPRU053) tells you how to invoke the ’C3x emulator , evaluation module, and simulator versions of the C source debugger interface. This book discusses various aspects of the debugger interface, including window management, ...

  • Texas Instruments TMS320C3x - page 7

    References vii Read This First Digital Signal Processing Applications with the TMS320 Family , V ol. III. T exas Instruments, 1990; Prentice-Hall, Inc., 1990. Gold, Bernard, and Rader , C.M. , Digital Processing of Signals. New Y ork, NY : McGraw-Hill Company , Inc., 1969. Hamming, R.W ., Digital Filters . Englewood Cliffs, NJ: Prentice-Hall, Inc., ...

  • Texas Instruments TMS320C3x - page 8

    References viii Parsons, Thomas., V oice and Speech Processing. New Y ork, NY : McGraw Hill Company , Inc., 1987. Rabiner , Lawrence R., and Schafer , R.W ., Digital Processing of Speech Signals. Englewood Cliffs, NJ: Prentice-Hall, Inc., 1978. Shaughnessy , Douglas., Speech Communication. Reading, MA: Addison- Wesley , 1987. Image Processing Andre ...

  • Texas Instruments TMS320C3x - page 9

    References ix Read This First Array Signal Processing Haykin, S., Justice, J.H., Owsley , N.L., Y en, J.L., and Kak, A.C. Array Signal Processing. Englewood Cliffs, NJ: Prentice-Hall, Inc., 1985. Hudson, J.E. Adaptive Array Principles. New Y ork, NY : John Wiley and Sons, 1981. Monzingo, R.A., and Miller , J.W . Introduction to Adaptive Arrays. New ...

  • Texas Instruments TMS320C3x - page 10

    If Y ou Need Assistance x If Y ou Need Assistance . . . World-W ide Web Sites TI Online http://www .ti.com Semiconductor Product Information Center (PIC) http://www .ti.com/sc/docs/pic/home.htm DSP Solutions http://www .ti.com/dsps 320 Hotline On-line http://www .ti.com/sc/docs/dsps/support.htm Microcontroller Home Page http://www .ti.com/sc/micro ...

  • Texas Instruments TMS320C3x - page 11

    If Y ou Need Assistance / T rademarks xi Read This First Documentation When making suggestions or reporting errors in documentation, please include the following information that is on the title page: the full title of the book, the publication date, and the literature number . Mail: T exas Instruments Incorporated Email: comments@books.sc.ti.com T ...

  • Texas Instruments TMS320C3x - page 12

    Contents xiii Contents 1 Introduction 1-1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A general description of the TMS320C30, TMS320C31, and TMS320C32, their key features, and typical applications. 1.1 TMS320C3x Devices 1-2 . . . . . . . . . . . . . . . . ...

  • Texas Instruments TMS320C3x - page 13

    Contents xiv 3 CPU Registers 3-1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Description of the registers in the CPU register file. 3.1 CPU Multiport Register File 3-2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ...

  • Texas Instruments TMS320C3x - page 14

    Contents xv Contents 5.3.3 Single-Precision Floating-Point Format 5-7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.3.4 Extended-Precision Floating-Point Format 5-8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.3.5 Determining the Decimal Equivalent of a TMS320C3x Floating-Point Format 5-9 . . . . . . . . . . . ...

  • Texas Instruments TMS320C3x - page 15

    Contents xvi 7.1.4 RPTS Instruction 7-5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7.1.5 Repeat-Mode Restrictions 7-6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7.1.6 RC Register V alue After Repeat Mode Completes 7-7 . . . . . . . . . . . . . ...

  • Texas Instruments TMS320C3x - page 16

    Contents xvii Contents 9 TMS320C30 and TMS320C31 External-Memory Interface 9-1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . Description of primary and expansion interfaces for the ’C30 and ’C31; external interface timing diagrams; programmable wait-states and bank switching. 9.1 Overview 9-2 . . . . . . . . . . . . . . . . . . . . . ...

  • Texas Instruments TMS320C3x - page 17

    Contents xviii 1 1.1.3 TMS320C31 Boot-Loading Sequence 1 1-4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 1.1.4 TMS320C31 Boot Data Stream Structure 1 1-7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 1.1.5 Interrupt and T rap-V ector Mapping 1 1-1 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ...

  • Texas Instruments TMS320C3x - page 18

    Contents xix Contents 12.3.5 TMS320C32 DMA Internal Priority Schemes 12-62 . . . . . . . . . . . . . . . . . . . . . . . . . 12.3.6 CPU and DMA Controller Arbitration 12-63 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12.3.7 DMA and Interrupts 12-64 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ...

  • Texas Instruments TMS320C3x - page 19

    Figures xx Figures 1–1 TMS320C3x Devices Block Diagram 1-3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2–1 TMS320C30 Block Diagram 2-3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2–2 TMS320C31 Block Diagram 2-4 . . . . . . . . . . . . . . . ...

  • Texas Instruments TMS320C3x - page 20

    Figures xxi Contents 5–1 Short-Integer Format and Sign-Extension of Short Integers 5-2 . . . . . . . . . . . . . . . . . . . . . . . . . 5–2 Single-Precision Integer Format 5-2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5–3 Short Unsigned-Integer Format and Zero Fill 5-3 . . . . . . . . . ...

  • Texas Instruments TMS320C3x - page 21

    Figures xxii 7–8 DMA Interrupt Processing 7-39 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7–9 Parallel CPU and DMA Interrupt Processing 7-40 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7–10 Flow of T raps 7-47 . . . . . . . . . . . . . . . . . . . . . ...

  • Texas Instruments TMS320C3x - page 22

    Figures xxiii Contents 10–5 STRB1 Control Register 10-8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10–6 IOSTRB Control Register 10-9 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10–7 STRB Configuration 10-13 . . . . . ...

  • Texas Instruments TMS320C3x - page 23

    Figures xxiv 1 1–5 Boot-Loader Serial-Port Load Flowchart 1 1-18 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 1–6 Boot-Loader Memory-Load Flowchart 1 1-19 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 1–7 Handshake Data-T ransfer Operation 1 1-20 . . . . . . . . . . ...

  • Texas Instruments TMS320C3x - page 24

    Figures xxv Contents 12–41 TMS320C30 and TMS320C31 CPU/DMA Interrupt-Enable Register 12-60 . . . . . . . . . . . . . . . 12–42 TMS320C32 CPU/DMA Interrupt-Enable Register 12-60 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12–43 Mechanism for No DMA Synchronization 12-65 . . . . . . . . . . . . . . . . . . . . . . . . . . . . ...

  • Texas Instruments TMS320C3x - page 25

    T ables xxvi T ables 1–1 TMS320C30, TMS320C31, TMS320LC31, and TMS320C32 Comparison 1-5 . . . . . . . . . . . . 1–2 T ypical Applications of the TMS320 Family 1-7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2–1 Primary CPU Registers 2-9 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ...

  • Texas Instruments TMS320C3x - page 26

    T ables xxvii Contents 10–2 Data-Access Sequence for a Memory Configuration with T wo Banks 10-14 . . . . . . . . . . . . . . . 10–3 W ait-State Generation 10-16 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10–4 BNKCMP and Bank Size 10-17 . . . . . . . . . . . . . . . . . . . . ...

  • Texas Instruments TMS320C3x - page 27

    Examples xxviii Examples 4–1 Pipeline Effects of Modifying the Cache Control Bits 4-23 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5–1 Positive Number 5-10 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5–2 Negative Number 5-1 1 . . . . . . . . . . . . ...

  • Texas Instruments TMS320C3x - page 28

    Examples xxix Contents 6–19 Indirect Addressing With Postindex Add and Bit-Reversed Modify 6-17 . . . . . . . . . . . . . . . . . . 6–20 Short-Immediate Addressing 6-18 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6–21 Long-Immediate Addressing 6-18 . . . . . . . . . . . . . . . . . . . . ...

  • Texas Instruments TMS320C3x - page 29

    Examples xxx 12–3 Serial-Port Register Setup #1 12-42 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12–4 Serial-Port Register Setup #1 12-43 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12–5 Serial-Port Register Setup #2 12-43 . . . . . . ...

  • Texas Instruments TMS320C3x - page 30

    1-1 Introduction The TMS320C3x generation of digital signal processors (DSPs) are high- performance CMOS 32-bit floating-point devices in the TMS320 family of single-chip DSPs. The ’C3x generation integrates both system control and math-intensive functions on a single controller . This system integration allows fast, easy data movement and high-s ...

  • Texas Instruments TMS320C3x - page 31

    TMS320C3x Devices 1-2 1.1 TMS320C3x Devices The ’C3x family consists of three members: the ’C30, ’C31, and ’C32. The ’C30, ’C31, and ’C32 can perform parallel multiply and arithmetic logic unit (ALU) operations on integer or floating-point data in a single cycle. The processors also possess the following features for high performance ...

  • Texas Instruments TMS320C3x - page 32

    TMS320C3x Devices 1-3 Introduction Figure 1–1. TMS320C3x Devices Block Diagram Primary port memory interface Data access 32-bit (’C30-’C31) 8/16/32-bit (’C32) Program access 32-bit (’C30-’C31) 16/32-bit (’C32) RDY HOLD HOLDA STRB (’C30-’C31) R/W D31-0 A23-0 STRB0_B3-0 (’C32) STRB1_B3-0 (’C32) IOSTRB (’C32) PRGW (’C32) Seri ...

  • Texas Instruments TMS320C3x - page 33

    TMS320C3x Devices 1-4 1.1.4 TMS320C32 The ’C32 is the newest member of the ’C3x generation. They are enhanced versions of the ’C3x family and the lowest cost floating-point processors on the market today . These enhancements include a variable-width memory inter- face, two-channel DMA coprocessor with configurable priorities, flexible boot lo ...

  • Texas Instruments TMS320C3x - page 34

    TMS320C3x Devices 1-5 Introduction T able 1–1. TMS320C30, TMS320C31, TMS320LC31, and TMS320C32 Comparison Memory (words) Cycle On-Chip Off-Chip Peripherals Device Name Freq (MHz) Cycle Time (ns) RAM ROM Cache Parallel Serial DMA Channels Timers Package T ype T emperature 27 75 2K 4K 64 16M 32 8K 32 2 1 2 181 PGA 0 ° to 85 ° (commercial) ’C30 ...

  • Texas Instruments TMS320C3x - page 35

    TMS320C3x Devices 1-6 T able 1–1. TMS320C30, TMS320C31, TMS320LC31, and TMS320C32 Comparison (Continued) Memory (words) Cycle On-Chip Off-Chip Peripherals Device Name Freq (MHz) Cycle Time (ns) RAM ROM Cache Parallel Serial DMA Channels Timers Package T ype T emperature 40 50 512 Boot loader 64 16M 32/16/8 1 2 2 144 PQFP 0 ° to 85 ° (commercial ...

  • Texas Instruments TMS320C3x - page 36

    T ypical Applications 1-7 Introduction 1.2 T ypical Applications The TMS320 family’s versatility , realtime performance, and multiple functions offer flexible design approaches in a variety of applications, which are shown in T able 1–2. T able 1–2. T ypical Applications of the TMS320 Family General-Purpose DSP Graphics/Imaging Instrumentatio ...

  • Texas Instruments TMS320C3x - page 37

    2-1 Architectural Overview This chapter provides an architectural overview of the ’C3x processor . It includes a discussion of the CPU, memory interface, boot loader , peripherals, and direct memory access (DMA) of the ’C3x processor . T opic Page 2.1 Overview 2-2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ...

  • Texas Instruments TMS320C3x - page 38

    Overview 2-2 2.1 Overview The ’C3x architecture responds to system demands that are based on sophisti - cated arithmetic algorithms that emphasize both hardware and software solu- tions. High performance is achieved through the precision and wide dynamic range of the floating-point units, large on-chip memory , a high degree of parallel - ism, an ...

  • Texas Instruments TMS320C3x - page 39

    Overview 2-3 Architectural Overview Figure 2–1. TMS320C30 Block Diagram SHZ ARAU0 ARAU1 DISP0, IR0, IR1 ALU 32-bit barrel shifter PC RAM block 1 (1K × 32) ROM block (4K × 32) Cache (64 × 32) RAM block 0 (1K × 32) RDY HOLD HOLDA STRB R/W D31–D0 A23–A0 RESET IR CPU1 REG1 REG2 XRDY MSTRB IOSTRB XR/W XD31–XD 0 XA12–XA 0 40 32 32 32 32 32 ...

  • Texas Instruments TMS320C3x - page 40

    Overview 2-4 Figure 2–2. TMS320C31 Block Diagram 32-bit barrel shifter ALU 40 24 Boot loader Cache (64 × 32) RAM block 0 (1K × 32) RAM block 1 (1K × 32) RDY HOLD HOLDA STRB R/W D31– D0 A23 – A0 RESET IR PC CPU1 REG1 REG2 Multiplexer 40 32 32 32 32 32 32 32 24 24 24 24 BK ARAU0 ARAU1 DISP0, IR0, IR1 Extended- precision registers (R7–R0) A ...

  • Texas Instruments TMS320C3x - page 41

    Overview 2-5 Architectural Overview Figure 2–3. TMS320C32 Block Diagram 24 24 40 Destination-address register Global-control register Timer0 Timer-period register Timer-counter register Timer-counter register Global-control register Serial-port control register Destination register Source-address register Transfer-counter rregister Boot ROM Progr ...

  • Texas Instruments TMS320C3x - page 42

    Central Processing Unit (CPU) 2-6 2.2 Central Processing Unit (CPU) The ’C3x devices (’C30, ’C31, and ’C32) have a register-based CPU architec- ture. The CPU consists of the following components: Floating-point/integer multiplier Arithmetic logic unit (ALU) 32-bit barrel shifter Internal buses (CPU1/CPU2 and REG1/REG2) Auxiliary register ar ...

  • Texas Instruments TMS320C3x - page 43

    Central Processing Unit (CPU) 2-7 Architectural Overview Figure 2–4. Central Processing Unit (CPU) Multiplexer Multiplier 32-bit barrel shifter Extended- precision registers (R0–R7) Disp † , IR0, IR1 ARAU0 ARAU1 Auxiliary registers (AR0–AR7) Other registers (12) 32 32 40 40 40 40 40 40 40 32 24 24 32 32 32 32 24 24 32 32 BK 40 ALU DADDR1 bu ...

  • Texas Instruments TMS320C3x - page 44

    Central Processing Unit (CPU) 2-8 2.2.1 Floating-Point/Integer Multiplier The multiplier performs single-cycle multiplications on 24-bit integer and 32-bit floating-point values. The ’C3x implementation of floating-point arithmetic allows for floating-point or fixed-point operations at speeds up to 33-ns per instruction cycle. T o gain even highe ...

  • Texas Instruments TMS320C3x - page 45

    CPU Primary Register File 2-9 Architectural Overview 2.3 CPU Primary Register File The ’C3x provides 28 registers in a multiport register file that is tightly coupled to the CPU. T able 2–1 lists the register names and functions. All of the primary registers can be operated upon by the multiplier and ALU and can be used as general-purpose regis ...

  • Texas Instruments TMS320C3x - page 46

    CPU Primary Register File 2-10 T able 2–1. Primary CPU Registers (Continued) Page Section Assigned Function Register Name IR1 Index register 1 3.1.4 3-4 BK Block-size register 3.1.5 3-4 SP System-stack pointer 3.1.6 3-4 ST Status register 3.1.7 3-5 IE CPU/DMA interrupt-enable regis- ter 3.1.8 3-9 IF CPU interrupt flag 3.1.9 3-1 1 IOF I/O flag 3.1 ...

  • Texas Instruments TMS320C3x - page 47

    CPU Primary Register File 2-1 1 Architectural Overview The ARAU uses the 32-bit block size register (BK) in circular addressing to specify the data block size. The system-stack pointer (SP) is a 32-bit register that contains the address of the top of the system stack. The SP always points to the last element pushed onto the stack. A push performs a ...

  • Texas Instruments TMS320C3x - page 48

    Other Registers 2-12 2.4 Other Registers The program-counter (PC) is a 32-bit register containing the address of the next instruction to fetch. Although the PC is not part of the CPU register file, it is a register that can be modified by instructions that modify the program flow . The instruction register (IR) is a 32-bit register that holds the i ...

  • Texas Instruments TMS320C3x - page 49

    Memory Organization 2-13 Architectural Overview 2.5 Memory Organization The total memory space of the ’C3x is 16M (million) 32-bit words. Program, data, and I/O space are contained within this 16M-word address space, allowing the storage of tables, coefficients, program code, or data in either RAM or ROM. In this way , memory usage is maximized a ...

  • Texas Instruments TMS320C3x - page 50

    Memory Organization 2-14 Figure 2–5. Memory Organization of the TMS320C30 RDY HOLD HOLDA STRB R/W D31–D0 A23–A0 XRDY MSTRB IOSTRB XR/W XD31–XD0 XA12–XA0 DMAADDR bus DMADA T A bus DADDR2 bus DADDR1 bus DDA T A bus P ADDR bus PDA T A bus Program counter/ instruction register CPU DMA controller 32 24 24 32 24 24 32 32 24 32 24 24 32 24 32 Pe ...

  • Texas Instruments TMS320C3x - page 51

    Memory Organization 2-15 Architectural Overview Figure 2–6. Memory Organization of the TMS320C31 RDY HOLD HOLDA STRB R/W D31–D0 A23–A0 DMAADDR bus DMADA T A bus DADDR2 bus DADDR1 bus DDA T A bus P ADDR bus PDA T A bus Program counter/ instruction register CPU DMA controller 32 24 24 32 24 24 32 32 24 32 24 24 32 24 32 Peripheral bus Multiplex ...

  • Texas Instruments TMS320C3x - page 52

    STRB0_B3/A-1 HOLD HOLDA PRGW R/W D31 – D0 A23 – A0 DMAADDR bus DMADA T A bus DADDR2 bus DADDR1 bus DDA T A bus P ADDR bus PDA T A bus Program counter/ instruction register CPU DMA controller 32 24 24 32 24 24 32 32 24 32 24 24 32 24 32 Peripheral bus Multiplexer Multiplexer Cache (64 32) RAM block 0 (256 32) RAM block 1 (256 32) Boot ROM Enhanc ...

  • Texas Instruments TMS320C3x - page 53

    Memory Organization 2-17 Architectural Overview 2.5.2 Memory Addressing Modes The ’C3x supports a base set of general-purpose instructions as well as arithmetic- intensive instructions that are particularly suited for digital signal processing and other numeric-intensive applications. See Chapter 6, Addressing Modes , f or m o re information. Fou ...

  • Texas Instruments TMS320C3x - page 54

    Internal Bus Operation 2-18 2.6 Internal Bus Operation Muc h of t he ’ C3x ’s hig h pe rf or ma nce i s d ue to int er na l bu sin g an d parallelism. Separate buses allow for parallel program fetches, data accesses, and DMA accesses: Program buses: P ADDR and PDA T A Data buses: DADDR1, DADDR2, and DDA T A DMA buses: DMAADDR and DMADA T A Thes ...

  • Texas Instruments TMS320C3x - page 55

    External Memory Interface 2-19 Architectural Overview 2.7 External Memory Interface The ’C30 provides two external interfaces: the primary bus and the expansion bus. The ’C31 provides one external interface: the primary bus. The ’C32 pro - vides one enhanced external interface with three independent multi-function strobes. These buses consist ...

  • Texas Instruments TMS320C3x - page 56

    External Memory Interface 2-20 2.7.2 TMS320C32 8-, 16-, and 32-Bit Data Memory The ’C32 external memory interface can load and store 8-, 16-, or 32-bit quanti- ties into external memory and convert them into an internally-equivalent 32-bit representation. The external memory interface accomplishes this without changing the CPU instruction set. Fi ...

  • Texas Instruments TMS320C3x - page 57

    Interrupts 2-21 Architectural Overview 2.8 Interrupts The ’C3x supports four external interrupts (INT3–INT0 ), a number of internal interrupts, and a nonmaskable external RESET signal. These can be used to interrupt either the DMA or the CPU. When the CPU responds to the interrupt, the IACK pin can be used to signal an external interrupt acknow ...

  • Texas Instruments TMS320C3x - page 58

    Peripherals 2-22 2.9 Peripherals All ’C3x peripherals are controlled through memory-mapped registers on a dedi- cated peripheral bus. This peripheral bus is composed of a 32-bit data bus and a 24-bit address bus. This peripheral bus permits straightforward communica- tion to the peripherals. The ’C3x peripherals include two timers and two seria ...

  • Texas Instruments TMS320C3x - page 59

    Peripherals 2-23 Architectural Overview 2.9.1 Timers The two timer modules are general-purpose 32-bit timer/event counters with two signaling modes and internal or external clocking. They can signal internally to the ’C3x or externally to the outside world at specified intervals or they can count external events. Each timer has an I/O pin that ca ...

  • Texas Instruments TMS320C3x - page 60

    Direct Memory Access (DMA) 2-24 2.10 Direct Memory Access (DMA) The on-chip DMA controller can read from or write to any location in the memory map without interfering with the CPU operation. The ’C3x can inter- face to slow , external memories and peripherals without reducing throughput to the CPU. The DMA controller contains its own address gen ...

  • Texas Instruments TMS320C3x - page 61

    Direct Memory Access (DMA) 2-25 Architectural Overview Figure 2–10. DMA Controller DMAADDR bus DMADA T A bus DMA controller Global-control register Source-address register Destination-address register T ransfer-counter register Peripheral address bus Peripheral data bus ...

  • Texas Instruments TMS320C3x - page 62

    TMS320C30, TMS320C31, and TMS320C32 Differences 2-26 2.1 1 TMS320C30, TMS320C31, and TMS320C32 Differences T able 2–2 shows the major differences between the ’C32, ’C31, and the ’C30 devices. ...

  • Texas Instruments TMS320C3x - page 63

    TMS320C30, TMS320C31, and TMS320C32 Differences 2-27 Architectural Overview T able 2–2. Feature Set Comparison Feature ’C30 ’C31 ’C32 External bus T wo buses: Primary bus: 32-bit data 24-bit address STRB active for 0h–7FFFFFh and 80A000h–FFFFFFh Expansion bus: 32-bit data 13-bit addres s MSTRB active for 800000h–801FFFh IOSTRB active ...

  • Texas Instruments TMS320C3x - page 64

    3-1 CPU Registers The central processing unit (CPU) register file contains 28 registers that can be operated on by the multiplier and arithmetic logic unit (ALU). Included in the register file are the auxiliary registers, extended-precision registers, and index registers. Three registers in the ’C32 CPU register file have been modified to support ...

  • Texas Instruments TMS320C3x - page 65

    CPU Multiport Register File 3-2 3.1 CPU Multiport Register File The ’C3x provides 28 registers in a multiport register file that is tightly coupled to the CPU. The program counter (PC) is not included in the 28 registers. All of these registers can be operated on by the multiplier and the ALU and can be used as general-purpose 32-bit registers. T ...

  • Texas Instruments TMS320C3x - page 66

    CPU Multiport Register File 3-3 CPU Registers The registers also have some special functions for which they are particularly appropriate. For example, the eight extended-precision registers are especially suited for maintaining extended-precision floating-point results. The eight auxiliary registers support a variety of indirect addressing modes an ...

  • Texas Instruments TMS320C3x - page 67

    CPU Multiport Register File 3-4 3.1.2 Auxiliary Registers (AR7–AR0) The CPU can access the eight 32-bit auxiliary registers (AR7–AR0), and the two auxiliary register arithmetic units (ARAUs) can modify them. The primary function of the auxiliary registers is the generation of 24-bit addresses. However , they can also operate as loop counters in ...

  • Texas Instruments TMS320C3x - page 68

    CPU Multiport Register File 3-5 CPU Registers 3.1.7 Status (ST) Register The status (ST) register contains global information about the state of the CPU. Operations usually set the condition flags of the status register according to whether the result is 0, negative, etc. This includes register load and store operations as well as arithmetic and lo ...

  • Texas Instruments TMS320C3x - page 69

    CPU Multiport Register File 3-6 T able 3–2. Status Register Bits Bit Name Reset V alue Name Description C 0 Carry flag Carry condition flag V 0 Overflow flag Overflow condition flag Z 0 Zero flag Zero condition flag N 0 Negative flag Negative condition flag UF 0 Floating-point under- flow flag Floating-point underflow condition flag L V 0 Latched ...

  • Texas Instruments TMS320C3x - page 70

    CPU Multiport Register File 3-7 CPU Registers T able 3–2. Status Register Bits (Continued) Bit Name Description Name Reset V alue CF 0 Cache freeze Enables or disables the instruction cache Set CF = 1 to freeze the cache (cache is not updated), including LRU stack manipulation. If the cache is enabled (CE = 1), fetches from the cache are allowed, ...

  • Texas Instruments TMS320C3x - page 71

    CPU Multiport Register File 3-8 T able 3–2. Status Register Bits (Continued) Bit Name Description Name Reset V alue PRGW Dependent on PRGW pin level Program width status (‘C32 only) Indicates the status of the external input PRGW pin. When the signal of the PRGW pin is high, the PRGW status bit is set to 1, indicating a 16-bit memory width. The ...

  • Texas Instruments TMS320C3x - page 72

    CPU Multiport Register File 3-9 CPU Registers 3.1.8 CPU/DMA Interrupt-Enable (IE) Register The CPU/DMA interrupt-enable (IE) register of the ’C30, ’C31, and ’C32 are 32-bit registers (see Figure 3–5 and Figure 3–6). The CPU interrupt-enable bits are in locations 10 – 0 for ’C30 and ’C31 devices, and 1 1 – 0 for ’C32 devices. The ...

  • Texas Instruments TMS320C3x - page 73

    CPU Multiport Register File 3-10 T able 3–3. IE Bits and Functions Abbreviation Reset V alue Description EINT0 (CPU) 0 CPU external interrupt 0 enable EINT1 (CPU) 0 CPU external interrupt 1 enable EINT2 (CPU) 0 CPU external interrupt 2 enable EINT3 (CPU) 0 CPU external interrupt 3 enable EXINT0 (CPU) 0 CPU serial port 0 transmit interrupt enable ...

  • Texas Instruments TMS320C3x - page 74

    CPU Multiport Register File 3-1 1 CPU Registers T able 3–3. IE Bits and Functions(Continued) Abbreviation Description Reset V alue ETINT0 (DMA) 0 DMA timer0 interrupt enable (’C30 and ’C31) ETINT1 (DMA) 0 DMA timer1 interrupt enable (’C30 and ’C31 only) ETINT0 (DMA0) 0 DMA0 timer1 interrupt enable (’C32 only) ETINT1 (DMA0) 0 DMA0 timer1 ...

  • Texas Instruments TMS320C3x - page 75

    CPU Multiport Register File 3-12 Figure 3–7. TMS320C30 CPU Interrupt Flag (IF) Register XINT1 RINT1 yy yy 7 11 15–12 31–16 xx 10 DINT 9 TINT1 8 TINT0 5 RINT0 4 XINT0 3 INT3 2 INT2 1 INT1 60 INT0 R/W R/W R/W R/W R/W R/W R/W R/W R/W R/W R/W R/W Notes: 1) xx = reserved bit, read as 0 2) yy = reserved bit, set to 0 at reset; can store value 3) R ...

  • Texas Instruments TMS320C3x - page 76

    CPU Multiport Register File 3-13 CPU Registers T able 3–4. IF Bits and Functions Bit Name Reset V alue Function INT0 0 External interrupt 0 flag INT1 0 External interrupt 1 flag INT2 0 External interrupt 2 flag INT3 0 External interrupt 3 flag XINT0 0 Serial port 0 transmit flag RINT0 0 Serial port 0 receive flag XINT1 0 Serial port 1 transmit fl ...

  • Texas Instruments TMS320C3x - page 77

    CPU Multiport Register File 3-14 3.1.9.1 Interrupt-Trap T able Pointer (ITTP) Similar to the rest of the ‘C3x device family , the ’C32’ s reset vector location remains at address 0. However , the interrupt and trap vectors are relocatable. This is achieved by the interrupt-trap table pointer (ITTP) bit field in the CPU interrupt flag register ...

  • Texas Instruments TMS320C3x - page 78

    CPU Multiport Register File 3-15 CPU Registers Figure 3–1 1. Interrupt and T rap V ector Locations EA (ITTP) + 3Fh EA (ITTP) + 3Eh EA (ITTP) + 3Dh EA (ITTP) + 3Ch EA (ITTP) + 3Bh EA (ITTP) + 20h TRAP0 EA (ITTP) + 1Fh EA (ITTP) + 0Dh DINT1 EA (ITTP) + 0Ch DINT0 EA (ITTP) + 0Bh TINT1 EA (ITTP) + 0Ah TINT0 EA (ITTP) + 09h EA (ITTP) + 08h EA (ITTP) + ...

  • Texas Instruments TMS320C3x - page 79

    CPU Multiport Register File 3-16 3.1.10 I/O Flag (IOF) Register The I/O flag (IOF) register is shown in Figure 3–12 and controls the function of the dedicated external pins, XF0 and XF1. These pins can be configured for input or output. The pins can also be read from and written to. At reset, 0 is written to this register . T able 3–5 describes ...

  • Texas Instruments TMS320C3x - page 80

    CPU Multiport Register File 3-17 CPU Registers 3.1.1 1 Repeat-Counter (RC) and Block-Repeat (RS, RE) Registers The repeat-counter (RC) register is a 32-bit register that specifies the number of times a block of code is to be repeated when a block repeat is performed. If RC contains the number n , the loop is executed n + 1 times. The 32-bit repeat ...

  • Texas Instruments TMS320C3x - page 81

    Other Registers 3-18 3.2 Other Registers 3.2.1 Program-Counter (PC) Register The program counter (PC) is a 32-bit register containing the address of the next instruction fetch. While the program-counter register is not part of the CPU register file, it can be modified by instructions that modify the program flow . 3.2.2 Instruction Register (IR) Th ...

  • Texas Instruments TMS320C3x - page 82

    Reserved Bits and Compatibility 3-19 CPU Registers 3.3 Reserved Bits and Compatibility T o retain compatibility with future members of the ’C3x family of microprocessors, reserved bits that are read as 0 must be written as 0. Y ou must not modify the current value of a reserved bit that has an undefined value. In other cases, you should maintain ...

  • Texas Instruments TMS320C3x - page 83

    4-1 Memory and the Instruction Cache The ’C3x provides a total memory space of 16M (million) 32-bit words that contain program, data, and I/O space. T wo RAM blocks of 1K 32 bits each (available on the ’C30 and ’C31) or two RAM blocks of 256 32 bits (available on the ’C32) and a ROM block of 4K 32 bits (available only on the ’C30) or boot ...

  • Texas Instruments TMS320C3x - page 84

    Memory 4-2 4.1 Memory The ’C3x accesses a total memory space of 16M (million) 32-bit words of pro- gram, data, and I/O space and allows tables, coefficients, program code, or data to be stored in either RAM or ROM. In this way , you can maximize memory usage and allocate memory space as desired. RAM blocks 0 and 1 are each 1K 32 bits on the ’C3 ...

  • Texas Instruments TMS320C3x - page 85

    Memory 4-3 Memory and the Instruction Cache Microcomputer Mode In microcomputer mode, the 4K on-chip ROM is mapped into locations 0h–0FFFh. There are 192 locations (0h–0BFh) within this block for interrupt vectors, trap vectors, and a reserved space (’C30). Locations 1000h– 7FFFFFh are accessed over the external memory port (STRB active). S ...

  • Texas Instruments TMS320C3x - page 86

    Memory 4-4 Figure 4–1. TMS320C30 Memory Maps Reset, interrupt, trap vectors, and reserved locations (64) (external STRB active) 0h 03Fh 040h External STRB active (8.192M words) 7FFFFFh Expansion bus MSTRB active (8K words) 800000h 801FFFh Reserved (8K words) 802000h 803FFFh Expansion bus IOSTRB active (8K words) 804000h 805FFFh Reserved (8K words ...

  • Texas Instruments TMS320C3x - page 87

    Memory 4-5 Memory and the Instruction Cache 4.1.1.2 TMS320C31 Memory Map The memory map depends on whether the processor is running in micropro- cessor mode (MCBL/MP = 0) or microcomputer mode (MCBL/MP = 1). The memory maps for these modes are similar (see Figure 4–2 on page 4-6). Locations 800000h–807FFFh are reserved. All of the memory-mapped ...

  • Texas Instruments TMS320C3x - page 88

    Memory 4-6 Figure 4–2. TMS320C31 Memory Maps Reset, interrupt, trap vectors, and reserved locations (64) (external STRB active) 0h 03Fh 040h External STRB active (8.192M words) 7FFFFFh Reserved (32K words) 800000h 807FFFh Peripheral bus memory-mapped registers (6K words internal) 808000h 8097FFh RAM block 0 (1K words internal) 809800h 809BFFh RAM ...

  • Texas Instruments TMS320C3x - page 89

    Memory 4-7 Memory and the Instruction Cache 4.1.1.3 TMS320C32 Memory Map The memory map depends on whether the processor is running in micropro- cessor mode (MCBL/MP = 0) or microcomputer mode (MCBL/MP = 1). The memory maps for these modes are similar (see Figure 4–3 on page 4-8 ). Locations 800000h–807FFFh, 809800h–80FFFh, and 830000H–87FD ...

  • Texas Instruments TMS320C3x - page 90

    Memory 4-8 Figure 4–3. TMS320C32 Memory Maps External memory STRB1 active (7.168M words) External memory STRB1 active (7.168M words) Boot 3 External memory STRB0 active (512K words) Microprocessor mode Microcomputer/boot-loader mode 900001h Boot 2 810001h Boot 1 1001h 1000h 0FFFh boot-loader operations Reserved for External memory STRB0 active (8 ...

  • Texas Instruments TMS320C3x - page 91

    Memory 4-9 Memory and the Instruction Cache 4.1.2 Peripheral Bus Memory Map The following sections describe the peripherial bus memory maps for the ’C30, ’C31, and ’C32. 4.1.2.1 TMS320C30 Peripheral Bus Memory Map The ’C30 memory-mapped peripheral registers are located starting at address 808000h. Figure 4–4 on page 4-10 shows the periphe ...

  • Texas Instruments TMS320C3x - page 92

    Memory 4-10 Figure 4–4. TMS320C30 Peripheral Bus Memory-Mapped Registers Serial port 1 data transmit 808064h Primary-bus control 808060h Expansion-bus control 80804Ch Serial port 0 data receive 808048h Serial port 0 data transmit FSR/DR/CLKR serial port 0 control 808046h Serial port 0 R/X timer period 808045h Serial port 0 R/X timer counter 80804 ...

  • Texas Instruments TMS320C3x - page 93

    Memory 4-1 1 Memory and the Instruction Cache 4.1.2.2 TMS320C31 Peripheral Bus Memory Map The ’C31 memory-mapped peripheral registers are located starting at address 808000h. Figure 4–5 shows the peripheral bus memory map. The shaded blocks are reserved. Figure 4–5. TMS320C31 Peripheral Bus Memory-Mapped Registers 808064h Primary-bus control ...

  • Texas Instruments TMS320C3x - page 94

    Memory 4-12 4.1.2.3 TMS320C32 Peripheral Bus Memory Map The ’C32’s memory-mapped peripheral and external-bus control registers are located starting at address 808000h, as shown in Figure 4–6 on page 4-13. Th e shaded blocks are reserved. ...

  • Texas Instruments TMS320C3x - page 95

    Memory 4-13 Memory and the Instruction Cache Figure 4–6. TMS320C32 Peripheral Bus Memory-Mapped Registers 8097FFh 808068h STRB1 bus control 808064h STRB0 bus control 808060h IOSTRB bus control 80804Ch Serial port data receive 808048h Serial port data transmit FSR/DR/CLKR serial port control 808046h Serial port R/X timer period 808045h Serial port ...

  • Texas Instruments TMS320C3x - page 96

    Reset/Interrupt/T rap V ector Map 4-14 4.2 Reset/Interrupt/T rap V ector Map The addresses for the reset, interrupt, and trap vectors are 00h–3Fh, as shown in Figure 4–7 and Figure 4–8. The reset vector contains the address of the reset routine. ’C30 and ’C31 Microprocessor and Microcomputer Modes In the microprocessor mode of the ’C30 ...

  • Texas Instruments TMS320C3x - page 97

    Reset/Interrupt/T rap V ector Map 4-15 Memory and the Instruction Cache Figure 4–7. Reset, Interrupt, and T rap V ector Locations for the TMS320C30 Microprocessor Mode RESET 00h INT0 01h INT1 02h INT2 03h INT3 04h XINT0 05h RINT0 06h XINT1 07h RINT1 08h TINT0 09h TINT1 0Ah DINT 0Bh 0Ch 1Fh TRAP 0 20h TRAP 27 3Bh 3Ch 3Dh 3Eh 3Fh Reserved TRAP 28 ( ...

  • Texas Instruments TMS320C3x - page 98

    Reset/Interrupt/T rap V ector Map 4-16 Figure 4–8. R e s e t , I n t e r r u p t , a n d T ra p V e ct o r L o c a t i o n s f or t h e T M S 320C31 Microprocessor Mode 00h RESET 01h INT0 02h INT1 03h INT2 04h INT3 05h XINT0 06h RINT0 07h XINT1 (Reserved) 08h RINT1 (Reserved) 09h TINT0 0Ah TINT1 0Bh DINT 0Ch 1Fh Reserved 20h TRAP 0 • • • 3B ...

  • Texas Instruments TMS320C3x - page 99

    Reset/Interrupt/T rap V ector Map 4-17 Memory and the Instruction Cache Figure 4–9. Interrupt and T rap Branch Instructions for the TMS320C31 Microcomputer Mode 809FC1h INT0 809FC2h INT1 809FC3h INT2 809FC4h INT3 809FC5h XINT0 809FC6h RINT0 809FC7h XINT1 (reserved) 809FC8h RINT1 (reserved) 809FC9h TINT0 809FCAh TINT1 809FCBh DINT 809FCCh 809FDFh ...

  • Texas Instruments TMS320C3x - page 100

    Reset/Interrupt/T rap V ector Map 4-18 Figure 4–10. Interrupt and T rap V ector Locations for TMS320C32 EA (ITTP) + 3Fh EA (ITTP) + 3Eh EA (ITTP) + 3Dh EA (ITTP) + 3Ch EA (ITTP) + 3Bh EA (ITTP) + 20h TRAP0 EA (ITTP) + 1Fh EA (ITTP) + 0Dh DINT1 EA (ITTP) + 0Ch DINT0 EA (ITTP) + 0Bh TINT1 EA (ITTP) + 0Ah TINT0 EA (ITTP) + 09h EA (ITTP) + 08h EA (IT ...

  • Texas Instruments TMS320C3x - page 101

    Instruction Cache 4-19 Memory and the Instruction Cache 4.3 Instruction Cache A 64 × 32-bit instruction cache speeds instruction fetches and lowers system cost by caching program fetches from external memory . The instruction cache allows the use of slow , external memories while still achieving single-cycle access performances. This reduces the n ...

  • Texas Instruments TMS320C3x - page 102

    Instruction Cache 4-20 Figure 4–12. Instruction-Cache Architecture Segment start address registers Segment words LRU Stack SSA register 0 Segment word 0 Segment word 1 Segment word 30 Segment word 31 Segment word 0 Segment word 1 Segment word 30 Segment word 31 MRU segment number LRU segment number Segment 0 Segment 1 P flags 0 1 30 31 0 1 30 31 ...

  • Texas Instruments TMS320C3x - page 103

    Instruction Cache 4-21 Memory and the Instruction Cache 4.3.2 Instruction-Cache Algorithm When the ’C3x requests an instruction word from external memory , one of two possible actions occurs: a cache hit or a cache miss . Cache Hit. The cache contains the requested instruction, and the following actions occur: The instruction word is read from th ...

  • Texas Instruments TMS320C3x - page 104

    Instruction Cache 4-22 Only instructions may be fetched from the program cache. All reads and writes of data in memory bypass the cache. Program fetches from internal memory do not modify the cache and do not generate cache hits or misses. The pro- gram cache is a single-access memory block. Dummy program fetches (for example, those following a bra ...

  • Texas Instruments TMS320C3x - page 105

    Instructions may be fetched before cache is enabled or frozen. Cache cleared Instructions may be fetched before cache cleared. Instruction Cache 4-23 Memory and the Instruction Cache T able 4–1. Combined Effect of the CE and CF Bits CE CF Effect 0 0 Cache not enabled 0 1 Cache not enabled 1 0 Cache enabled and not frozen 1 1 Cache enabled and fro ...

  • Texas Instruments TMS320C3x - page 106

    5-1 Data Formats and Floating-Point Operation In the ’C3x architecture, data is organized into three fundamental types: integer , unsigned integer , and floating-point. The terms integer and signed integer are equivalent. The ’C3x supports short and single-precision formats for signed and unsigned integers. It also supports short, single-precis ...

  • Texas Instruments TMS320C3x - page 107

    Integer Formats 5-2 5.1 Integer Formats The ’C3x supports two integer formats: a 16-bit short-integer format and a 32-bit single-precision integer format. Note: When extended-precision registers are used as integer operands, only bits 31–0 are used; bits 39–32 remain unchanged. 5.1.1 Short-Integer Format The short-integer format is a 16-bit 2 ...

  • Texas Instruments TMS320C3x - page 108

    Unsigned-Integer Formats 5-3 Data Formats and Floating-Point Operation 5.2 Unsigned-Integer Formats The ’C3x supports two unsigned-integer formats: a 16-bit short format and a 32-bit single-precision format. Note: In extended-precision registers, the unsigned-integer operands use only bits 31– 0; bits 39–32 remain unchanged. 5.2.1 Short Unsig ...

  • Texas Instruments TMS320C3x - page 109

    Floating-Point Formats 5-4 5.3 Floating-Point Formats The ’C3x supports four floating-point formats: A short floating-point format for immediate floating-point operands, consisting of a 4-bit exponent, a sign bit, and an 1 1-bit fraction (’C32 only) A short floating-point format for use with 16-bit floating-point data types, consisting of a 2s- ...

  • Texas Instruments TMS320C3x - page 110

    Floating-Point Formats 5-5 Data Formats and Floating-Point Operation The exponent field is a 2s-complement number that determines the factor of 2 by which the number is multiplied. Essentially , the exponent field shifts the binary point in the mantissa. If the exponent is positive, then the binary point is shifted to the right. If the exponent is ...

  • Texas Instruments TMS320C3x - page 111

    Floating-Point Formats 5-6 The following examples illustrate the range and precision of the short floating- point format: Most positive: x = (2 – 2 –1 1 ) × 2 7 = 2.5594 × 10 2 Least positive: x = 1 × 2 –7 = 7.8125 × 10 –3 Least negative: x = (–1– 2 –1 1 ) × 2 –7 = –7.8163 × 10 –3 Most negative: x = –2 × 2 7 = – 2.560 ...

  • Texas Instruments TMS320C3x - page 112

    Floating-Point Formats 5-7 Data Formats and Floating-Point Operation The following examples illustrate the range and precision of the ‘C32 short floating-point format for external 16-bit data: Most positive: x = (2–2 –8 ) 2 127 = 3.3961775 10 38 Least positive x = 1 2 –127 = 5.8774717541 10 –39 Least negative: x = (–1–2 –8 ) 2 –12 ...

  • Texas Instruments TMS320C3x - page 113

    Floating-Point Formats 5-8 Y ou must use the following reserved values to represent 0 in the single-precision floating-point format: e = – 128 s =0 f =0 The following examples illustrate the range and precision of the single-precision floating-point format: Most positive: x = (2 – 2 –2 3 ) × 2 127 = 3.4028234 × 10 38 Least positive: x = 1 ? ...

  • Texas Instruments TMS320C3x - page 114

    Floating-Point Formats 5-9 Data Formats and Floating-Point Operation The following examples illustrate the range and precision of the extended- precision floating-point format: Most positive: x = (2 – 2 –2 3 ) × 2 127 = 3.4028234 × 10 38 Least positive: x = 1 × 2 –127 = 5.8774717541 × 10 38 Least negative: x = (–1–2 –31 ) × 2 –12 ...

  • Texas Instruments TMS320C3x - page 115

    Floating-Point Formats 5-10 Rewrite the mantissa as: Mantissa 1 0 . 1 0 1 0 0 0 0 0 0 0 0 Step 3: Shift the decimal point of the mantissa according to the value of the exponent. If the exponent is positive, shift the binary point to the right by the value of the exponent. If the exponent is negative, shift the binary point to the left. For example, ...

  • Texas Instruments TMS320C3x - page 116

    Floating-Point Formats 5-1 1 Data Formats and Floating-Point Operation Example 5–2. Negative Number 0 1 C 0 0 0 0 0 Hex value 0000 0001 1100 0000 0000 0000 0000 0000 Binary value Exponent = 0000 0001 2 = 1 Sign = 1 Fraction = .10000 2 Value = 10.1 2 × 2 1 = 101 2 . = –3 Fraction Implied Sign Example 5–3. Fractional Number F B 4 0 0 0 0 0 Hex ...

  • Texas Instruments TMS320C3x - page 117

    Floating-Point Formats 5-12 5.3.6 Conversion Between Floating-Point Formats Floating-point operations assume several different formats for inputs and out- puts. These formats often require conversion from one floating-point format to another (for example, short floating-point format to extended-precision floating- point format). Format conversions ...

  • Texas Instruments TMS320C3x - page 118

    Floating-Point Formats 5-13 Data Formats and Floating-Point Operation Figure 5–12. Converting from Single-Precision Floating-Point Format to Extended-Precision Floating-Point Format Single-precision floating-point format Extended-precision floating-point format 0 y x x yy y x x 31 24 23 22 0 39 32 30 31 0 y y0 87 The 8 LSBs of the mantissa field ...

  • Texas Instruments TMS320C3x - page 119

    Floating-Point Conversion (IEEE Std. 754) 5-14 5.4 Floating-Point Conversion (IEEE Std. 754) The ‘C3x floating-point format is not compatible with the IEEE standard 754 format. The IEEE floating-point format uses sign-magnitude notation for the mantissa, and the exponent is biased by 127. In a 32-bit word representing a floating-point number , th ...

  • Texas Instruments TMS320C3x - page 120

    Floating-Point Conversion (IEEE Std. 754) 5-15 Data Formats and Floating-Point Operation Figure 5–15. TMS320C3x Single-Precision 2s-Complement Floating-Point Format e f 31 23 22 0 24 s Note: Same format as for the ’C4x In comparison, Figure 5–15 shows the the ‘C3x 2s-complement floating-point format. In this format, two cases can be used to ...

  • Texas Instruments TMS320C3x - page 121

    Floating-Point Conversion (IEEE Std. 754) 5-16 Case 1 maps the IEEE positive NaNs and positive infinity to the single-preci- sion 2s-complement most positive number . Overflow is also signaled to allow you to check for these special cases. Case 2 maps the IEEE negative NaNs and negative infinity to the single- precision 2s-complement most negative ...

  • Texas Instruments TMS320C3x - page 122

    Floating-Point Conversion (IEEE Std. 754) 5-17 Data Formats and Floating-Point Operation 5.4.1.1 IEEE-to-TMS320C3x Floating-Point Format Conversion Example 5–4 shows the fast conversion from IEEE to ’C3x floating-point format. It properly handles the general case when 0 < e < 255, and also handles 0s (that is, e = 0 and f = 0). The other ...

  • Texas Instruments TMS320C3x - page 123

    Floating-Point Conversion (IEEE Std. 754) 5-18 Example 5–4. IEEE-to-TMS320C3x Conversion (Fast V ersion) (Continued) * NOTE: SINCE THE STACK POINTER SP IS USED, MAKE SURE TO * INITIALIZE IT IN THE CALLING PROGRAM. * * * CYCLES: 12 (WORST CASE) WORDS: 12 * .global FMIEEE * FMIEEE AND3 R0,*AR1,R1 ; Replace fraction with 0 BND NEG ; Test sign ADDI R ...

  • Texas Instruments TMS320C3x - page 124

    Floating-Point Conversion (IEEE Std. 754) 5-19 Data Formats and Floating-Point Operation Example 5–5. IEEE-to-TMS320C3x Conversion (Complete V ersion) * TITLE IEEE TO TMS320C3x CONVERSION (COMPLETE VERSION) * * * SUBROUTINE FMIEEE1 * * FUNCTION: CONVERSION BETWEEN THE IEEE FORMAT AND THE TMS320C3x * FLOATING-POINT FORMAT. THE NUMBER TO BE CONVERT ...

  • Texas Instruments TMS320C3x - page 125

    Floating-Point Conversion (IEEE Std. 754) 5-20 Example 5–5. IEEE-to-TMS320C3x Conversion (Complete V ersion) (Continued) * HANDLE NaN AND INFINITY TSTB *+AR1(7),R0 RETSNZ ; Return if NaN LDI R0,R0 LDFGT *+AR1(8),R0 ; If positive, infinity = ; most positive number LDFN *+AR1(5),R0 ; If negative, infinity = RETS ; most negative number RETS * HANDLE ...

  • Texas Instruments TMS320C3x - page 126

    Floating-Point Conversion (IEEE Std. 754) 5-21 Data Formats and Floating-Point Operation 5.4.2 Conver ting 2s-Complement TMS320C 3x Floating-Point For mat to IEEE Form at This conversion is performed according to the following table: T able 5–2. Converting 2s-Complement Floating-Point Format to IEEE Format If these values are present Then these v ...

  • Texas Instruments TMS320C3x - page 127

    Floating-Point Conversion (IEEE Std. 754) 5-22 5.4.2.1 TMS320C3x-to-IEEE Floating-Point Format Conversion The vast majority of the numbers represented by the ’C3x floating-point format are covered by the general IEEE format and the representation of 0s. The only special case is e = –127 in the ’C3x format; this corresponds to a denormalized n ...

  • Texas Instruments TMS320C3x - page 128

    Floating-Point Conversion (IEEE Std. 754) 5-23 Data Formats and Floating-Point Operation Example 5–6. TMS320C3x-to-IEEE Conversion (Fast V ersion) (Continued) * CYCLES: 14 (WORST CASE) WORDS: 15 * .global TOIEEE * TOIEEE LDF R0,R0 ; Determine the sign of the number LDFZ *+AR1(4),R0 ; If 0, load appropriate number BND NEG ; Branch to NEG if negati ...

  • Texas Instruments TMS320C3x - page 129

    Floating-Point Conversion (IEEE Std. 754) 5-24 Example 5–7. TMS320C3x-to-IEEE Conversion (Complete V ersion) * * TITLE TMS320C3x TO IEEE CONVERSION (COMPLETE VERSION) * * * SUBROUTINE TOIEEE1 * * * FUNCTION: CONVERSION BETWEEN THE TMS320C3x FORMAT AND THE IEEE * FLOATING-POINT FORMAT. THE NUMBER TO BE CONVERTED * IS IN THE UPPER 32 BITS OF R0. TH ...

  • Texas Instruments TMS320C3x - page 130

    Floating-Point Conversion (IEEE Std. 754) 5-25 Data Formats and Floating-Point Operation Example 5–7. TMS320C3x-to-IEEE Conversion (Complete V ersion) (Continued) * TOIEEE1 LDF R0,R0 ; Determine the sign of the number LDFZ *+AR1(4),R0 ; If 0, load appropriate number BND NEG ; Branch to NEG if negative (delayed) ABSF R0 ; Take the absolute value ; ...

  • Texas Instruments TMS320C3x - page 131

    Floating-Point Multiplication 5-26 5.5 Floating-Point Multiplication A floating-point number α can be written in floating-point format as in the following formula, where α ( man ) is the mantissa and α ( exp ) is the exponent: α = α ( man ) × 2 α ( exp ) The product of α and b is c , defined as: c = α × b = α ( man ) × b ( man ) × 2 ( ...

  • Texas Instruments TMS320C3x - page 132

    Floating-Point Multiplication 5-27 Data Formats and Floating-Point Operation If c ( exp ) has overflowed (step 1 1) in the positive direction, then step 14 sets c ( exp ) to the most positive extended-precision format value. If c ( exp ) has overflowed in the negative direction, then step 14 sets c ( exp ) to the most negative extended-precision fo ...

  • Texas Instruments TMS320C3x - page 133

    Floating-Point Multiplication 5-28 Figure 5–16. Flowchart for Floating-Point Multiplication α ( man ) b ( man ) α ( exp ) b ( exp ) (1) (2) Multiply mantissas Add exponents c ( man ) = α ( man ) x b ( man ) (50-bit result) c ( exp ) = α ( exp ) + b ( exp ) Put c ( man ) in extended pre- cision floating-point format T est for special cases of ...

  • Texas Instruments TMS320C3x - page 134

    Floating-Point Multiplication 5-29 Data Formats and Floating-Point Operation Example 5–8 through Example 5–12 illustrate how floating-point multiplication is performed on the ’C3x. For these examples, the implied most significant nonsign bit is made explicit. Example 5–8. Floating-Point Multiply (Both Mantissas = –2.0) Let: α = –2.0 × ...

  • Texas Instruments TMS320C3x - page 135

    Floating-Point Multiplication 5-30 Example 5–9. Floating-Point Multiply (Both Mantissas = 1.5) Let: α = 1.5 × 2 α ( exp ) = 01.0000000000000000000000 × 2 α ( exp ) b = 1.5 × 2 b ( exp ) = 01.0000000000000000000000 × 2 b ( exp ) Where: a and b are both represented in binary form according to the single-preci- sion floating-point format. The ...

  • Texas Instruments TMS320C3x - page 136

    Floating-Point Multiplication 5-31 Data Formats and Floating-Point Operation Example 5–1 1. Floating-Point Multiply Between Positive and Negative Numbers Let: α = 1.0 x 2 α ( exp ) = 01.00000000000000000000000 x 2 α ( exp ) b = –2.0 x 2 b ( exp ) = 10.00000000000000000000000 x 2 b ( exp ) Then: 01.00000000000000000000000 × 2 α ( exp ) x 10 ...

  • Texas Instruments TMS320C3x - page 137

    Floating-Point Addition and Subtraction 5-32 5.6 Floating-Point Addition and Subtraction In floating-point addition and subtraction, two floating-point numbers α and b can be defined as: α = α ( man ) × 2 α ( exp ) b = b ( man ) × 2 b ( exp ) The sum (or difference) of α and b can be defined as: c = α ± b =( α ( man ) ± ( b ( man ) × 2 ...

  • Texas Instruments TMS320C3x - page 138

    Floating-Point Addition and Subtraction 5-33 Data Formats and Floating-Point Operation Figure 5–17. Flowchart for Floating-Point Addition α ( man ) b ( man ) α ( exp ) b ( exp ) (3) (2) Align mantissas Subtract exponents α ( man ) = α ( man ) > > d Discard LSBs to keep α ( man ) in extended- precision floating- point format d = b ( exp ...

  • Texas Instruments TMS320C3x - page 139

    Floating-Point Addition and Subtraction 5-34 The following examples describe the floating-point addition and subtraction operations. It is assumed that the data is in the extended-precision floating- point format. Example 5–13. Floating-Point Addition In the case of two normalized numbers to be summed, let α = 1.5 = 01.10000000000000000000000000 ...

  • Texas Instruments TMS320C3x - page 140

    Floating-Point Addition and Subtraction 5-35 Data Formats and Floating-Point Operation Example 5–14. Floating-Point Subtraction A subtraction is performed in this example. Let: α = 01.0000000000000000000000000000001 × 2 0 b = 01.0000000000000000000000000000000 × 2 0 The operation performed is α – b . The mantissas are already aligned becaus ...

  • Texas Instruments TMS320C3x - page 141

    Floating-Point Addition and Subtraction 5-36 Example 5–16. Floating-Point Addition/Subtraction With Floating-Point 0 When floating-point addition and subtraction are performed with a floating- point 0, the following identities are satisfied: α ± 0= α ( α ≠ 0) 0 ± 0= 0 0– α =– α ( α ≠ 0) ...

  • Texas Instruments TMS320C3x - page 142

    Normalization Using the NORM Instruction 5-37 Data Formats and Floating-Point Operation 5.7 Normalization Using the NORM Instruction The NORM instruction normalizes an extended-precision floating-point number that is assumed to be unnormalized (see Example 5–17 ). Since the number is assumed to be unnormalized, no implied most significant nonsign ...

  • Texas Instruments TMS320C3x - page 143

    Normalization Using the NORM Instruction 5-38 Figure 5–18. Flowchart for NORM Instruction Operation T est for special cases of c ( man ) c ( exp ) = –128 (1) α ( man ) = 0 T est for special cases of c ( exp ) (6) c ( exp ) underflow (7) c ( exp ) in range c ( exp ) = –128 No change to c ( man ) Set c to final result c = norm( α ) (8) (9) (3 ...

  • Texas Instruments TMS320C3x - page 144

    Rounding (RND Instruction) 5-39 Data Formats and Floating-Point Operation 5.8 Rounding (RND Instruction) The RND instruction rounds a number from the extended-precision floating- point format to the single-precision floating-point format. Rounding is similar to floating-point addition. Given the number a to be rounded, the following opera- tion is ...

  • Texas Instruments TMS320C3x - page 145

    Rounding (RND Instruction) 5-40 Figure 5–19. Flowchart for Floating-Point Rounding by the RND Instruction T est for special cases of c ( man ) c ( exp ) = –128 c ( man ) = 0 T est for special cases of c ( exp ) c ( exp ) overflow c ( exp ) in range Set eight LSBs of c ( man ) to 0 c = rnd( α ) c ( man ) = c ( man ) < < 1 c ( exp ) = α ( ...

  • Texas Instruments TMS320C3x - page 146

    Floating-Point to Integer Conversion (FIX Instruction) 5-41 Data Formats and Floating-Point Operation 5.9 Floating-Point to Integer Conversion (FIX Instruction) Using the FIX instruction, you can convert an extended-precision floating- point number to a single-precision integer in a single cycle. The floating-point to integer conversion of the valu ...

  • Texas Instruments TMS320C3x - page 147

    Floating-Point to Integer Conversion (FIX Instruction) 5-42 Figure 5–20. Flowchart for Floating-Point to Integer Conversion by FIX Instruction T est for special cases of α ( exp ) α ( exp ) > 30 α ( exp ) in range rs = 31 – α ( exp ) Overflow Shift If α ( man ) > 0, c = most positive integer If α ( man ) < 0, c = most negative in ...

  • Texas Instruments TMS320C3x - page 148

    Integer to Floating-Point Conversion (FLOA T Instruction) 5-43 Data Formats and Floating-Point Operation 5.10 Integer to Floating-Point Conversion (FLOA T Instruction) Integer to floating-point conversion, using the FLOA T instruction, allows single-precision integers to be converted to extended-precision floating-point numbers. The flowchart for t ...

  • Texas Instruments TMS320C3x - page 149

    Fast Logarithms on a Floating-Point Device 5-44 5.1 1 Fast Logarithms on a Floating-Point Device The following TMS320C30/C40 function calculates the log base two of a number in about half the time of conventional algorithms. Furthermore, the method can easily be scaled for faster execution if less accuracy is desired. The method is efficient becaus ...

  • Texas Instruments TMS320C3x - page 150

    Fast Logarithms on a Floating-Point Device 5-45 Data Formats and Floating-Point Operation N * l og 2 (mant_old) = EXP_new + log 2 (mant_new) log 2 (mant_old) = EXP_new / N + l og 2 (mant_new) / N This last equation shows that the logarithm of mant_old is indeed related to EXP_new . And as shown earlier , EXP_new can be separated from the new mantis ...

  • Texas Instruments TMS320C3x - page 151

    Fast Logarithms on a Floating-Point Device 5-46 are equivalent to the seven MSBs of the logarithm. If the exponent cou ld ho ld all the bits needed for full accuracy , then it would be possible to continue the op - eration for all 24 bits of the mantissa. Since there are only eight bits in the expo - nent and the MSBs are used for negative values, ...

  • Texas Instruments TMS320C3x - page 152

    Fast Logarithms on a Floating-Point Device 5-47 Data Formats and Floating-Point Operation When finished, the bits representing the finished logarithm are in a fixed-point notation and need to be scaled. This is done by using the FLOA T instruction fol- lowed by a multiplication by a constant scaling factor . If the final result needs to be in any o ...

  • Texas Instruments TMS320C3x - page 153

    Fast Logarithms on a Floating-Point Device 5-48 Figure 5–23. Fast Logarithm for FFT Displays **************************************************************** * * FAST Logarithm for FFT displays * * >>>> NEED ONLY ADD ONE INSTRUCTION IN MANY CASES <<<< * ****************************************************************** || ...

  • Texas Instruments TMS320C3x - page 154

    6-1 Addressing Modes The ’C3x supports five groups of powerful addressing modes. Six types of addressing that allow data access from memory , registers, and the instruction word can be used within the groups. This chapter describes the operation, encoding, and implementation of the addressing modes. It also discusses the management of system stac ...

  • Texas Instruments TMS320C3x - page 155

    Addressing T ypes 6-2 6.1 Addressing T ypes Y ou can access data from memory , registers, and the instruction word by using five types of addressing: Register addressing . A CPU register contains the operand. Direct addressing . The data address is formed by concatenating the eight least significant bits (LSBs) of the data-page (DP) register and th ...

  • Texas Instruments TMS320C3x - page 156

    Register Addressing 6-3 Addressing Modes 6.2 Register Addressing In register addressing, a CPU register contains the operand, as shown in this example: ABSF R1 ; R1 = |R1| The syntax for the CPU registers, the assembler syntax, and the assigned function for those registers are listed in T able 6–1. T able 6–1. CPU Register Address/Assembler Syn ...

  • Texas Instruments TMS320C3x - page 157

    Direct Addressing 6-4 6.3 Direct Addressing In direct addressing, the data address is formed by the concatenation of the eight LSBs of the data-page pointer (DP) with the 16 LSBs of the instruction word (expr). This results in 256 pages (64K words per page), allowing you to access a large address space without requiring a change of the page pointer ...

  • Texas Instruments TMS320C3x - page 158

    Indirect Addressing 6-5 Addressing Modes 6.4 Indirect Addressing Indirect addressing specifies the address of an operand in memory through the contents of an auxiliary register , optional displacements, and index registers as shown in Example 6–2. Only the 24 LSBs of the auxiliary registers and index registers are used in indirect addressing. The ...

  • Texas Instruments TMS320C3x - page 159

    Indirect Addressing 6-6 Figure 6–2. Indirect Addressing Operand Encoding LSB MSB 5 bits mod ARn disp 3 bits 0, 5, or 8 bits Note: Auxiliary Register The auxiliary register (AR n ) is encoded in the instruction word according to its binary representation n (for example, AR3 is encoded as 1 1 2 ), not its register machine address (shown in T able 6 ...

  • Texas Instruments TMS320C3x - page 160

    Indirect Addressing 6-7 Addressing Modes T able 6–2. Indirect Addressing (a) Indirect addressing with displacement Mod Field Syntax Operation Description 00000 *+AR n ( disp ) addr = AR n + disp With predisplacement add 00001 *– AR n ( disp ) addr = AR n – disp With predisplacement subtract 00010 *++AR n ( disp ) addr = AR n + disp AR n = AR ...

  • Texas Instruments TMS320C3x - page 161

    Indirect Addressing 6-8 T able 6–2. Indirect Addressing (Continued) (c) Indirect addressing with index register IR1 Mod Field Syntax Operation Description 10000 *+ AR n (IR1) addr = AR n + IR1 With preindex (IR1) add 10001 * – AR n (IR1) addr = AR n – IR1 With preindex (IR1) subtract 10010 * ++ AR n (IR1) addr = AR n + IR1 AR n = AR n + IR1 W ...

  • Texas Instruments TMS320C3x - page 162

    Indirect Addressing 6-9 Addressing Modes Example 6–3. Indirect Addressing With Predisplacement Add The address of the operand to fetch is the sum of an auxiliary register (AR n ) and the displacement ( disp ). The displacement is either an 8-bit unsigned integer contained in the instruction word or an implied value of 1. Operation: operand addres ...

  • Texas Instruments TMS320C3x - page 163

    Indirect Addressing 6-10 Example 6–5. Indirect Addressing With Predisplacement Add and Modify The address of the operand to fetch is the sum of an auxiliary register (AR n ) and the displacement ( disp ). The displacement is either an 8-bit unsigned integer contained in the instruction word or an implied value of 1. After the data is fetched, the ...

  • Texas Instruments TMS320C3x - page 164

    Indirect Addressing 6-1 1 Addressing Modes Example 6–7. Indirect Addressing With Postdisplacement Add and Modify The address of the operand to fetch is the contents of an auxiliary register (AR n ). After the operand is fetched, the displacement ( disp ) is added to the auxiliary register . The displacement is either an 8-bit unsigned integer con ...

  • Texas Instruments TMS320C3x - page 165

    Indirect Addressing 6-12 Example 6–9. Indirect Addressing With Postdisplacement Add and Circular Modify The address of the operand to fetch is the contents of an auxiliary register (AR n ). After the operand is fetched, the displacement ( disp ) is added to the contents of the auxiliary register using circular addressing. This result is used to u ...

  • Texas Instruments TMS320C3x - page 166

    Indirect Addressing 6-13 Addressing Modes Example 6–1 1. Indirect Addressing With Preindex Add The address of the operand to fetch is the sum of an auxiliary register (AR n ) and an index register (IR0 or IR1). Operation: operand address = AR n + IR m Assembler Syntax :* + A R n (IR m ) Modification Field: 01000 if m = 0 10000 if m = 1 (+) 0 0 31 ...

  • Texas Instruments TMS320C3x - page 167

    Indirect Addressing 6-14 Example 6–13. Indirect Addressing With Preindex Add and Modify The address of the operand to fetch is the sum of an auxiliary register (AR n ) and an index register (IR0 or IR1). After the data is fetched, the auxiliary register is updated with the generated address. Operation : operand address = AR n + IR m AR n = A R n ...

  • Texas Instruments TMS320C3x - page 168

    Indirect Addressing 6-15 Addressing Modes Example 6–15. Indirect Addressing With Postindex Add and Modify The address of the operand to fetch is the contents of an auxiliary register (AR n ). After the operand is fetched, the index register (IR0 or IR1) is added to the auxiliary register . Operation: operand address = AR n AR n = AR n + IR m Asse ...

  • Texas Instruments TMS320C3x - page 169

    Indirect Addressing 6-16 Example 6–17. Indirect Addressing With Postindex Add and Circular Modify The address of the operand to fetch is the contents of an auxiliary register (AR n ). After the operand is fetched, the index register (IR0 or IR1) is added to the auxiliary register . This value is evaluated using circular addressing and replaces th ...

  • Texas Instruments TMS320C3x - page 170

    Indirect Addressing 6-17 Addressing Modes Example 6–19. Indirect Addressing With Postindex Add and Bit-Reversed Modify The address of the operand to fetch is the contents of an auxiliary register (AR n ). After the operand is fetched, the index register (IR0) is added to the auxiliary register . This addition is performed with a reverse-carry pro ...

  • Texas Instruments TMS320C3x - page 171

    Immediate Addressing 6-18 6.5 Immediate Addressing In immediate addressing, the operand is a 16-bit (short) or 24-bit (long) immediate value contained in the 16 or 24 LSBs of the instruction word (expr). Depending on the data types assumed for the instruction, the short-immediate operand can be a 2s-complement integer , an unsigned integer , or a f ...

  • Texas Instruments TMS320C3x - page 172

    PC-Relative Addressing 6-19 Addressing Modes 6.6 PC-Relative Addressing Program counter (PC)-relative addressing is used for branching. It adds the contents of the 16 or 24 LSBs of the instruction word to the PC register . The assembler takes the src (a label or address) specified by the user and generates a displacement. If the branch is a standar ...

  • Texas Instruments TMS320C3x - page 173

    PC-Relative Addressing 6-20 Figure 6–3. Encoding for 24-Bit PC-Relative Addressing Mode (a) BR, BRD: unconditional branches (standard and delayed) 31 25 24 23 0 0 1 1 0 0 0 0 0 Displacement (b) CALL: unconditional subroutine call 31 24 23 0 0 1 1 0 0 0 1 0 Displacement (c) RPTB: repeat block 31 25 24 23 0 0 1 1 0 0 1 0 0 Displacement ...

  • Texas Instruments TMS320C3x - page 174

    Circular Addressing 6-21 Addressing Modes 6.7 Circular Addressing Many DSP algorithms, such as convolution and correlation, require a circular buffer in memory . In convolution and correlation, the circular buffer acts as a sliding window that contains the most recent data to process. As new data is brought in, the new data overwrites the oldest da ...

  • Texas Instruments TMS320C3x - page 175

    Circular Addressing 6-22 Figure 6–6. Logical and Physical Representation of Circular Buffer after Writing Eight Values Start End a) Logical representation value 6 value 7 value 2 value 6 value 2 value 7 b) Physical representation value 5 value 3 value 4 value 3 value 4 value 5 Start End T o implement a circular buffer in the ’C3x, the following ...

  • Texas Instruments TMS320C3x - page 176

    Circular Addressing 6-23 Addressing Modes In circular addressing, index r ef e rs t o t h e K L S B s ( f r o m t h e K - b i t boundary criteria) of the auxiliary register selected, and step is the quantity being added to or subtracted from the auxiliary register . Follow these two rules when you use cir- cular addressing: The step used must be le ...

  • Texas Instruments TMS320C3x - page 177

    Circular Addressing 6-24 Example 6–24. Circular Addressing *AR0 ++ (5)% ; AR0 = 0 (0 value) *AR0 ++ (2)% ; AR0 = 5 (1st value) *AR0 – – (3)% ; AR0 = 1 (2nd value) *AR0++(6)% ; AR0 = 4 (3rd value) *AR0 – – % ; AR0 = 4 (4th value) *AR0 ; AR0 = 3 (5th value) Element 0 Element 1 Element 2 Element 3 Element 4 Element 5 (last element) Last elem ...

  • Texas Instruments TMS320C3x - page 178

    Circular Addressing 6-25 Addressing Modes Example 6–25. FIR Filter Code Using Circular Addressing * Impulse Response .sect ”Impulse_Resp” H .float 1.0 .float 0.99 .float 0.95 . . . .float 0.1 * Input Buffer X .usect ”Input_Buf”,128 .data HADDR .word H XADDR .word X N .word 128 * Initialization * LDP HADDR LDI @N,BK ; Load block size. LDI ...

  • Texas Instruments TMS320C3x - page 179

    Bit-Reversed Addressing 6-26 6.8 Bit-Reversed Addressing The ’C3x can implement fast Fourier transforms (FFT) with bit-reversed ad- dressing. Whenever data in increasing sequence order is transformed by an FFT , the resulting data is presented in bit-reversed order . T o recover this data in the correct order , certain memory locations must be sw ...

  • Texas Instruments TMS320C3x - page 180

    Bit-Reversed Addressing 6-27 Addressing Modes Example 6–26. Bit-Reversed Addressing *AR2++(IR0)B ; AR2 = 0110 0000 (0th value) *AR2++(IR0)B ; AR2 = 0110 1000 (1st value) *AR2++(IR0)B ; AR2 = 0110 0100 (2nd value) *AR2++(IR0)B ; AR2 = 0110 1100 (3rd value) *AR2++(IR0)B ; AR2 = 0110 0010 (4th value) *AR2++(IR0)B ; AR2 = 0110 1010 (5th value) *AR2++ ...

  • Texas Instruments TMS320C3x - page 181

    Aligning Buffers With the TMS320 Floating-Point DSP Assembly 6-28 6.9 Aligning Buffers With the TMS320 Floating-Point DSP Assembly Language T ools T o align buffers to a K-bit boundary , you can use the .sect or .usect assembly directives to define a section in conjunction with the align memory allocation parameter of the sections directive of the ...

  • Texas Instruments TMS320C3x - page 182

    System and User Stack Management 6-29 Addressing Modes 6.10 System and User Stack Management The ’C3x provides a dedicated system-stack pointer (SP) for building stacks in memory . The auxiliary registers can also be used to build a variety of more general linear lists. This section discusses the implementation of the following types of linear li ...

  • Texas Instruments TMS320C3x - page 183

    System and User Stack Management 6-30 6.10.2 Stacks Stacks can be built from low to high memory or high to low memory . T wo cases for each type of stack are shown. Stacks can be built using the preincrement/ decrement and postincrement/decrement modes of modifying the auxiliary registers (AR). Stack growth from high-to-low memory can be implemente ...

  • Texas Instruments TMS320C3x - page 184

    System and User Stack Management 6-31 Addressing Modes Figure 6–1 1. Implementations of Low-to-High Memory Stacks T op of stack Low memory High memory (Free) Bottom of stack AR n T op of stack Low memory High memory (Free) Bottom of stack Case 3 Case 4 AR n . . . . . . → → 6.10.3 Queues A queue is like a FIFO. The implementation of queues is ...

  • Texas Instruments TMS320C3x - page 185

    7-1 Program Flow Control The TMS320C3x provides a complete set of constructs that facilitate software and hardware control of the program flow . Software control includes repeats, branches, calls, traps, and returns. Hardware control includes reset operation, interrupts, and power management. Y ou can select the constructs best suited for your part ...

  • Texas Instruments TMS320C3x - page 186

    Repeat Modes 7-2 7.1 Repeat Modes The repeat modes of the ’C3x can implement zero-overhead looping. For many algorithms, most execution time is spent in an inner kernel of code. Using the repeat modes allows these time-critical sections of code to be executed in the shortest possible time. The ’C3x provides two instructions to support zero-over ...

  • Texas Instruments TMS320C3x - page 187

    Repeat Modes 7-3 Program Flow Control 7.1.1 Repeat-Mode Control Bits T wo bits are important to the operation of RPTB and RPTS: RM bit. The repeat-mode (RM) flag bit in the status register specifies whether the processor is running in the repeat mode. RM = 0: Fetches are not made in repeat mode. RM = 1: Fetches are made in repeat mode. S bit . The ...

  • Texas Instruments TMS320C3x - page 188

    Repeat Modes 7-4 Example 7–1. Repeat-Mode Control Algorithm if RM == 1 ; If in repeat mode (RPTB or RPTS) if S == 1 ; If RPTS if first time through ; If this is the first fetch fetch instruction from memory ; Fetch instruction from memory else ; If not the first fetch fetch instruction from IR ; Fetch instruction from IR RC – 1 → RC ; Decreme ...

  • Texas Instruments TMS320C3x - page 189

    Repeat Modes 7-5 Program Flow Control All block repeats initiated by RPTB can be interrupted. When RPTB src (source) instruction executes, it performs the following sequence: 1) Load the start address of the block into repeat-start-address register (RS). This is the next address following the instruction: RS PC (program-counter) of RPTB + 1 2) Load ...

  • Texas Instruments TMS320C3x - page 190

    Repeat Modes 7-6 The RPTS instruction loads all registers and mode bits necessary for the opera- tion of the single-instruction repeat mode. Step 1 loads the start address of the block into RS. Step 2 loads the end address into the RE (end address of the block). Since this is a repeat of a single instruction, the start address and the end address a ...

  • Texas Instruments TMS320C3x - page 191

    Repeat Modes 7-7 Program Flow Control Example 7–4. Incorrectly Placed Delayed Branch LDI 15,RC ; Load repeat counter with 15 RPTB ENDLOOP ; Execute block of code STLOOP ; from STLOOP to ENDLOOP 16 ; times . . . BRD OOPS ; This branch violates rule 2 ADDF MPYF ENDLOOP SUBF 7.1.6 RC Register V alue After Repeat Mode Completes For the RPTB instructi ...

  • Texas Instruments TMS320C3x - page 192

    Repeat Modes 7-8 7.1.7 Nested Block Repeats Block repeats (RPTB) can be nested. Since the registers RS, RE, RC, and ST control the repeat-mode status, these registers must be saved and restored in order to nest block repeats. For example, if you write an interrupt service routine that requires the use of RPTB, it is possible that the interrupt asso ...

  • Texas Instruments TMS320C3x - page 193

    Delayed Branches 7-9 Program Flow Control 7.2 Delayed Branches The ’C3x offers three main types of branching: standard, delayed, and condi- tional delayed. Standard branches empty the pipeline before performing the branch, ensuring correct management of the program counter and resulting in a ’C3x branch taking four cycles. Included in this clas ...

  • Texas Instruments TMS320C3x - page 194

    Delayed Branches 7-10 Example 7–6. Incorrectly Placed Delayed Branches B1: BD L1 NOP NOP B2: B L2 ; This branch is incorrectly placed. NOP NOP NOP . . . For faster execution, it might still be advantageous to use a delayed branch followed by NOP instructions by trading increased program size for faster speed. This is shown in Example 7–7 where ...

  • Texas Instruments TMS320C3x - page 195

    Calls, T raps, and Returns 7-1 1 Program Flow Control 7.3 Calls, T raps, and Returns Calls and traps provide a means of executing a subroutine or function while providing a return to the calling routine. The CALL, CALL cond, and TRAP cond instructions store the value of the PC on the stack before changing the PC’s contents. The RETS cond or RETI ...

  • Texas Instruments TMS320C3x - page 196

    Calls, T raps, and Returns 7-12 RETI cond returns from traps or calls like the RETS cond , with the addition that RETI cond also sets the GIE bit of the status register , which enables all interrupts whose enabling bit is set to 1. The conditions for RETI cond are the same as for the CALL cond instruction. Functionally , calls and traps accomplish ...

  • Texas Instruments TMS320C3x - page 197

    Interlocked Operations 7-13 Program Flow Control 7.4 Interlocked Operations One of the most common parallel processing configurations is the sharing of global memory by multiple processors. For multiple processors to access this global memory and share data in a coherent manner , some sort of arbitration or handshaking is necessary . This requireme ...

  • Texas Instruments TMS320C3x - page 198

    Interlocked Operations 7-14 The LDFI and LDII instructions perform the following actions: 1) Simultaneously set XF0 to 0 and begin a read cycle. The timing of XF0 is similar to that of the address bus during a read cycle. 2) Execute an LDF or LDI instruction and extend the read cycle until XF1 is set to 0 and a ready (RDY int or XRDY int ) is signa ...

  • Texas Instruments TMS320C3x - page 199

    Interlocked Operations 7-15 Program Flow Control Note: Timing Diagrams for SIGI The timing diagrams for SIGI shown in the data sheets depict a zero wait state condition. Since the device idles until one cycle after XF1 is signaled, the data sheets show the XF1 signal sampled one H1/H3 cycle before setting the XF0 signal low . For the sequence of st ...

  • Texas Instruments TMS320C3x - page 200

    Interlocked Operations 7-16 Example 7–8 shows the implementation of a busy-waiting loop. If location LOCK is the interlock for a critical section of code, and a nonzero means the lock is busy , the algorithm for a busy-waiting loop can be used as shown. Example 7–8. Busy-Waiting Loop LDI 1,R0 ; Put 1 into R0 L1: LDII @LOCK,R1 ; Interlocked oper ...

  • Texas Instruments TMS320C3x - page 201

    Interlocked Operations 7-17 Program Flow Control Figure 7–2. Multiple TMS320C3xs Sharing Global Memory Global memory Arbitration logic ’C3x #2 XF0 XF1 Local memory Local memory ’C3x #1 XF0 XF1 (X)A (X)D CTRL (X)A (X)D CTRL Lock, count , or S ADDR CTRL DA T A Sometimes it may be necessary for several processors to access some shared data or ot ...

  • Texas Instruments TMS320C3x - page 202

    Interlocked Operations 7-18 The ’C3x code for V(S) is shown in Example 7–10 ; code for P(S) is shown in Example 7–1 1 . Compare the code in Example 7–1 1 to the code in Example 7–9, which does not use semaphores. Example 7–10. Implementation of V(S) V: LDII @S,R0 ; Interlocked read of S begins (XFO = 0) ; Contents of S → R0 ADDI 1,R0 ...

  • Texas Instruments TMS320C3x - page 203

    Interlocked Operations 7-19 Program Flow Control Example 7–12. Code to Synchronize T wo TMS320C3x Devices at the Software Level N Code for ’C3x #2 Code for ’C3x #1 T ime O (W AIT) SIGI SIGI Synchronization occurs 7.4.3 Pipeline Effects of Interlocked Instructions Before performing an interlocked instruction, the XF0 pin must be configured as ...

  • Texas Instruments TMS320C3x - page 204

    XF0 set as an output pin and XF1 set as an input pin XF1 sampled XF0 driven low and XF1 sampled XF0 pin driven high XF1 pin sampled XF0 pin driven low Interlocked Operations 7-20 Example 7–13. Pipeline Delay of XF Pin Configuration Pipeline Operation PC Fetch Decode Read Execute n LDI 2h, IOF n+1 NOP LDI 2h, IOF n+2 NOP NOP LDI 2h, IOF n+3 LDII * ...

  • Texas Instruments TMS320C3x - page 205

    Reset Operation 7-21 Program Flow Control 7.5 Reset Operation The ’C3x supports a nonmaskable external reset signal (RESET ), which is used to perform system reset. This section discusses the reset operation. At start-up, the state of the ’C3x processor is undefined. Y ou can use the RESET signal to place the processor in a known state. This si ...

  • Texas Instruments TMS320C3x - page 206

    Reset Operation 7-22 T able 7–3. TMS320C3x Pin Operation at Reset (Continued) Device Signal ‘C32 ‘C31 ‘C30 Operation at Reset HOLDA Reset has no effect PRGW Reset has no effect Expansion Bus Interface XD31 – XD0 Synchronous reset; placed in high-impedance state XA12 – XA0 Synchronous reset; placed in high-impedance state XR/W Synchronou ...

  • Texas Instruments TMS320C3x - page 207

    Reset Operation 7-23 Program Flow Control T able 7–3. TMS320C3x Pin Operation at Reset (Continued) Device Signal ‘C32 ‘C31 ‘C30 Operation at Reset DR1 Asynchronous reset; placed in high-impedance state FSR1 Asynchronous reset; placed in high-impedance state Timer0 Signal TCLK0 Asynchronous reset; placed in high-impedance state Timer1 Signal ...

  • Texas Instruments TMS320C3x - page 208

    Reset Operation 7-24 T able 7–3. TMS320C3x Pin Operation at Reset (Continued) Device Signal ‘C32 ‘C31 ‘C30 Operation at Reset Emulation, T est, and Reserved EMU0 Undefined EMU1 Undefined EMU2 Undefined EMU3 Undefined EMU4 Undefined EMU5 Undefined EMU6 Undefined RSV0 Undefined RSV1 Undefined RSV2 Undefined RSV3 Undefined RSV4 Undefined RSV5 ...

  • Texas Instruments TMS320C3x - page 209

    Reset Operation 7-25 Program Flow Control At system reset, the following additional operations are performed: The peripherals are reset. This is a synchronous operation. Peripheral reset is described in Chapter 12 , Peripherals . The external bus control registers are reset. The reset values of the control registers are described in Chapter 9, ’C ...

  • Texas Instruments TMS320C3x - page 210

    Interrupts 7-26 7.6 Interrupts The ’C3x supports multiple internal and external interrupts, which can be used for a variety of applications. Internal interrupts are generated by the DMA controller , timers, and serial ports. Four external maskable interrupt pins include INT0 – INT3. Interrupts are automatically prioritized allowing interrupts t ...

  • Texas Instruments TMS320C3x - page 211

    Interrupts 7-27 Program Flow Control T able 7–4. Reset, Interrupt, and T rap-Vector Locations for the TMS320C30/ TMS320C31 Microprocessor Mode Address Name Function 00h RESET External reset signal input 01h INT0 External interrupt on the INT0 pin 02h INT1 External interrupt on the INT1 pin 03h INT2 External interrupt on the INT2 pin 04h INT3 Exte ...

  • Texas Instruments TMS320C3x - page 212

    Interrupts 7-28 T able 7–5. Reset, Interrupt, and T rap-Branch Locations for the TMS320C31 Microcomputer Boot Mode Address Name Function 809FC1 INT0 External reset signal input 809FC2 INT1 External interrupt on the INT0 pin 809FC3 INT2 External interrupt on the INT1 pin 809FC4 INT3 External interrupt on the INT2 pin 809FC5 XINT0 External interrup ...

  • Texas Instruments TMS320C3x - page 213

    Interrupts 7-29 Program Flow Control 7.6.2 TMS320C32 Interrupt V ector T able Similarly to the rest of the ’C3x device family , the ’C32’s reset vector location remains at address 0. On the other hand, the interrupt and trap vectors are relocatable. This is achieved by a new bit field in the CPU interrupt flag register called the interrupt-tr ...

  • Texas Instruments TMS320C3x - page 214

    Interrupts 7-30 T able 7–6. Interrupt and T rap-V ector Locations for the TMS320C32 Address Name Function EA[ITTP] + 00h Reserved EA[ITTP] + 01h INT0 External interrupt on the INT0 pin EA[ITTP] + 02h INT1 External interrupt on the INT1 pin EA[ITTP] + 03h INT2 External interrupt on the INT2 pin EA[ITTP] + 04h INT3 External interrupt on the INT3 pi ...

  • Texas Instruments TMS320C3x - page 215

    Interrupts 7-31 Program Flow Control 7.6.3 Interrupt Prioritization When two interrupts occur in the same clock cycle or when two previously received interrupts are waiting to be serviced, one interrupt is serviced before the other . The CPU handles this prioritization by servicing the interrupt with the least priority . The priority of interrupts ...

  • Texas Instruments TMS320C3x - page 216

    Interrupts 7-32 7.6.4 CPU Interrupt Control Bits Three CPU registers contain bits that control interrupt operation: Status (ST) register The CPU global interrupt-enable bit (GIE) located in the CPU status register (ST) controls all maskable CPU interrupts. When this bit is set to 1, the CPU responds to an enabled interrupt. When this bit is cleared ...

  • Texas Instruments TMS320C3x - page 217

    Interrupts 7-33 Program Flow Control Figure 7–5. IF Register Modification Correct Incorrect LDI @MASK, R0 LDI IF , R1 AND R0, IF AN D @M ASK, R1 LDI R1, IF Note: IF Register Load Priority If a load of the IF register occurs simultaneously with a set or reset of a flag by an interrupt pulse, the loading of the flag has higher priority and overwrit ...

  • Texas Instruments TMS320C3x - page 218

    Interrupts 7-34 Figure 7–6. CPU Interrupt Processing DMA proceeds according to SYNC bits If enabled, interrupt is a DMA interrupt Clear interrupt flag DMA continues CPU starts executing ISR routine Complete all fetched instructions PC ← interrupt vector PC → *(++SP) Clear interrupt flag Disable interrupts GIE ← 0 If enabled, interrupt is a ...

  • Texas Instruments TMS320C3x - page 219

    Interrupts 7-35 Program Flow Control If you wish to make the interrupt service routine interruptible, you can set the GIE bit to 1 after entering the ISR. The interrupt acknowledge (IACK) instruction can be used to signal externally that an interrupt has been serviced. If external memory is specified in the operand, IACK drives the IACK pin and per ...

  • Texas Instruments TMS320C3x - page 220

    Interrupts 7-36 T able 7–8. Interrupt Latency Cycle Description Fetch Decode Read Execute 1 Recognize interrupt in single-cycle fetched (prog a + 1) instruction prog a + 1 prog a prog a–1 prog a–2 2 Clear GIE bit. Clear interrupt flag — interrupt prog a prog a–1 3 Read the interrupt vector table — — interrupt prog a 4 Store return add ...

  • Texas Instruments TMS320C3x - page 221

    Interrupts 7-37 Program Flow Control Figure 7–7. Interrupt Logic Functional Diagram INTn To control section Internal interrupt set signal Interrupt flag (n) Internal interrupt processor Internal interrupt clear/acknowledge signal EINTn(DMA) EINTn(CPU) H1 H3 H1 D CLK D CLK D CLK Set RESET GIE(CPU) Q QQ Q These interrupts are prioritized by the sel ...

  • Texas Instruments TMS320C3x - page 222

    DMA Interrupts 7-38 7.7 DMA Interrupts Interrupts can also trigger DMA read and write operations. This is called DMA synchronization. The DMA interrupt processing cycle is similar to that of the CPU. Aft er t he p er ti nent interrupt flag is cleared, the DMA coprocessor proceeds according to the status of the SYNC bits in the DMA coprocessor globa ...

  • Texas Instruments TMS320C3x - page 223

    DMA Interrupts 7-39 Program Flow Control 7.7.2 DMA Interrupt Processing Figure 7–8 shows the general flow of interrupt processing by the DMA coprocessor . Figure 7–8. DMA Interrupt Processing DMA proceeds according to DMA control register SYNC bits Is an enabled interrupt set ? If enabled in the IE register , the interrupt Is a DMA interrupt Cl ...

  • Texas Instruments TMS320C3x - page 224

    DMA Interrupts 7-40 7.7.3 CPU/DMA Interaction If the DMA is not using interrupts for synchronization of transfers, it is not affected by the processing of the CPU interrupts. Detected interrupts are responded to by the CPU and DMA on instruction fetch boundaries only . Since instruction fetches are halted due to pipeline conflicts or when executing ...

  • Texas Instruments TMS320C3x - page 225

    DMA Interrupts 7-41 Program Flow Control 7.7.4 TMS320C3x Interrupt Considerations Give careful consideration to ’C3x interrupts, especially if you make modifications to the status register when the global interrupt-enable (GIE) bit is set. This can result in the GIE bit being erroneously set or reset as described in the following paragraphs. The ...

  • Texas Instruments TMS320C3x - page 226

    DMA Interrupts 7-42 T able 7–9. Pipeline Operation with PUSH ST Cycle Description Fetch Decode Read Execute 1 NOP 2 LDI NOP 3 MPYI LDI NOP 4 Read location V_ADDR PUSH MPYI LDI NOP 5 Load AR1; recognize interrupt – PUSH MPYI LDI 6 Clear GIE bit; clear interrupt flag; read SP Interrupt PUSH MPYI 7 Read interrupt vector table; save ST in stack Int ...

  • Texas Instruments TMS320C3x - page 227

    DMA Interrupts 7-43 Program Flow Control One solution is to use an instruction that is uninterruptible such as RPTS as follows to set the GIE: RPTS 0 AND 2000h, ST ; Set GIE=1 Use the following to reset the GIE: RPTS 0 AND 0DFFFh, ST ; Set GIE=0 Another alternative incorporates the following code fragment, which protects against modifying or saving ...

  • Texas Instruments TMS320C3x - page 228

    DMA Interrupts 7-44 7.7.5 TMS320C30 Interrupt Considerations The ’C30 silicon revisions earlier than 4.0 have two unique exceptions to the interrupt operation. This does not apply to ’C30 silicon revision 4.0 or greater , any ’C31 silicon, or any ’C32 silicon. On ’C30 silicon revisions earlier than 4.0: The status register global interrup ...

  • Texas Instruments TMS320C3x - page 229

    DMA Interrupts 7-45 Program Flow Control Insert two NOP instructions immediately before the TRAP cond instruction. One NOP is insufficient in some cases, as illustrated in the second bulleted item, above. This eliminates the opportunity for any pipeline conflicts in the immediately preceding instructions and enables the conditional trap instruction ...

  • Texas Instruments TMS320C3x - page 230

    DMA Interrupts 7-46 ISR_n: PUSH ST ; PUSH DP ; Save registers PUSH R0 ; LDI 0, DP ; Clear Data-page Pointer LDI @DUMMY_INT, R0 ; If DUMMY_INT is 0 or positive, BNN ISR_n_START ; go to ISR_n_START STI DP, @DUMMY_INT ; Set DUMMY_INT = 0 POP R0 ; POP DP ; P O P S T ; Housekeeping, return from interrupt RETI ; ISR_n_START: . . ; Normal interrupt servic ...

  • Texas Instruments TMS320C3x - page 231

    T raps 7-47 Program Flow Control 7.8 T raps A trap is the equivalent of a software-triggered interrupt. In the ’C3x, traps and interrupts are treated identically , except in the way in which they are triggered. 7.8.1 Initialization of T raps and Interrupts T raps and interrupts are triggered differently in the ’C3x: T raps are always triggered ...

  • Texas Instruments TMS320C3x - page 232

    T raps 7-48 The RETI cond instruction manipulates the status flags as shown in block (3) in Figure 7–10. RETI cond provides a return from a trap or interrupt. The ’C3x supports 32 different traps. When a TRAP cond n instruction is executed, the ’C3x jumps to the address stored in the memory location pointed to by the corresponding trap-vector ...

  • Texas Instruments TMS320C3x - page 233

    Power Management Modes 7-49 Program Flow Control 7.9 Power Management Modes The following ’C3x devices have been enhanced by the addition of two power- down modes: IDLE2 and LOPOWER: ’C30 silicon version 7.0 or greater ’LC31 ’C31 silicon revision 5.0 or greater ’C32 7.9.1 IDLE2 Power-Down Mode The H1 instruction clock is held high until o ...

  • Texas Instruments TMS320C3x - page 234

    Power Management Modes 7-50 The interrupt service routine (ISR) must have been set up before placing the device in IDLE2 mode, because the instruction following the IDLE2 instruction is not executed until the RETI (return from interrupt) instruction is executed. When the device is in emulation mode, the H1 and H3 clocks continue to run normally and ...

  • Texas Instruments TMS320C3x - page 235

    Power Management Modes 7-51 Program Flow Control Figure 7–12. Interrupt Response Timing After IDLE2 Operation 1st address V ector address Data ADDR INT0 Flag INT3 to INT0 INT3 to H1 H3 Fetch first instruction of service routing Interrupt vector read Clocks driven CLKIN 7.9.2 LOPOWER In the LOPOWER (low-power) mode, the CPU continues to execute in ...

  • Texas Instruments TMS320C3x - page 236

    Power Management Modes 7-52 Figure 7–13. LOPOWER Timing 32 CLKIN H1 H3 CLKIN LOPOWER read Figure 7–14. MAXSPEED Timing H1 H3 CLKIN MAXSPEED read 32 CLKIN ...

  • Texas Instruments TMS320C3x - page 237

    8-1 Pipeline Operation Pipeline Operation T wo characteristics of the’C3x that contribute to its high performance are: Pipelining Concurrent I/O and CPU operation The following four functional units control ’C3x operation: Fetch Decode Read Execute Pipelining is the overlapping or parallel operations of the fetch, decode, read, and execute leve ...

  • Texas Instruments TMS320C3x - page 238

    Perfect overlap Pipeline Structure 8-2 8.1 Pipeline Structure The following list describes the four major units of the ‘C3x pipeline structure and their functions: Fetch unit (F) Fetches the instruction words from memory and updates the program counter (PC). Decode unit (D) Decodes the instruction word and performs address generation. Also, the d ...

  • Texas Instruments TMS320C3x - page 239

    Pipeline Structure 8-3 Pipeline Operation For ‘C30 and ‘C31, priorities from highest to lowest have been assigned to each of the functional units of the pipeline and to the DMA controller as follows: Execute (highest) Read Decode Fetch DMA (lowest) Despite the DMA controller ’s low priority , you can minimize or even eliminate conflicts with ...

  • Texas Instruments TMS320C3x - page 240

    Pipeline Conflicts 8-4 8.2 Pipeline Conflicts Pipeline conflicts in the ’C3x can be grouped into the following categories: Branch conflicts Branch conflicts involve most of those instructions or operations that read and/or modify the PC. Register conflicts Register conflicts involve delays that can occur when reading from, or writing to, register ...

  • Texas Instruments TMS320C3x - page 241

    3P C Fetch held for new PC value Pipeline Conflicts 8-5 Pipeline Operation Example 8–1. Standard Branch BR THREE ; Unconditional branch MPYF ; Not executed ADD ; Not executed SUBF ; Not executed AND ; Not executed . . . THREE OR ; Fetched after BR is taken STI . . . Pipeline Operation PC Fetch Decode Read Execute n B R ——— n+1 MPYF BR — ? ...

  • Texas Instruments TMS320C3x - page 242

    No execute delay 3P C Pipeline Conflicts 8-6 Example 8–2. Delayed Branch BRD THREE ; Unconditional delayed branch MPYF ; Executed ADD ; Executed SUBF ; Executed AND ; Not executed . . . THREE MPYF ; Fetched after SUBF is fetched . . . Pipeline Operation PC Fetch Decode Read Execute n BRD — — — n+1 MPYF BRD — — n+2 ADDF MPYF BRD — n+3 ...

  • Texas Instruments TMS320C3x - page 243

    Decode/address generation held until AR write is completed ARs written Pipeline Conflicts 8-7 Pipeline Operation is loaded, and a different auxiliary register is used on the next instruction. Since the decode stage needs the result of the write to the auxiliary register , the decode of this second instruction is delayed two cycles. Every time the d ...

  • Texas Instruments TMS320C3x - page 244

    Decode/address generation held until AR is read ARs read Pipeline Conflicts 8-8 In Example 8–4, two auxiliary registers are added together , with the result going to an extended-precision register . The next instruction uses a different auxiliary register as an address register . Example 8–4. A Read of ARs Followed by ARs for Address Generation ...

  • Texas Instruments TMS320C3x - page 245

    Pipeline Conflicts 8-9 Pipeline Operation Memory pipeline conflicts consist of the following four types: Program wait A program fetch is prevented from beginning. Program fetch Incomplete A program fetch has begun but is not yet complete. Execute only An instruction sequence requires three CPU data accesses in a single cycle. Hold everything A prim ...

  • Texas Instruments TMS320C3x - page 246

    Fetch held until data access completes Data accessed Pipeline Conflicts 8-10 Example 8–5. Program Wait Until CPU Data Access Completes ADDF3 *AR0,*AR1,R0 FIX MPYF ADDF3 NEGB Pipeline Operation PC Fetch Decode Read Execute n ADDF3 — — — n+1 FIX ADDF3 — — n+2 (wait) FIX ADDF3 — n+2 MPYF (nop) FIX ADDF3 n+3 ADDF3 MPYF (nop) FIX n+4 NEGB ...

  • Texas Instruments TMS320C3x - page 247

    2-cycle DMA access Pipeline Conflicts 8-1 1 Pipeline Operation Example 8–6. Program Wait Due to Multicycle Access ADDF ; code in internal memory MPY ; code in internal memory SUBF ; code in internal memory CALL ; code in external memory Pipeline Operation PC Fetch Decode Read Execute n ADDF — — — n+1 MPYF ADDF — — n+2 SUBF MPYF ADDF — ...

  • Texas Instruments TMS320C3x - page 248

    1 wait state required Pipeline Conflicts 8-12 Example 8–7. Multicycle Program Memory Fetches Pipeline Operation PC Fetch Decode Read Execute n MPYF — — — n+1 ADDF MPYF — — n+2 RDY SUBF ADDF MPYF — n+2 RDY SUBF (nop) ADDF MPYF n+3 ADDI SUBF (nop) ADDF Note: PC = program counter 8.2.3.3 Execute Only The execute-only type of memory pipel ...

  • Texas Instruments TMS320C3x - page 249

    Write must complete before the two reads can complete 2 reads performed Pipeline Conflicts 8-13 Pipeline Operation Example 8–8. Single Store Followed by T wo Reads STF R 0,*AR1 ; R0 → *AR1 LDF *AR2,R1 ; *AR2 → R1 in parallel with  LDF *AR3,R2 ; *AR3 → R2 Pipeline Operation PC Fetch Decode Read Execute n STF — — — n+1 LDF  ...

  • Texas Instruments TMS320C3x - page 250

    Read must wait until the writes are completed Writes performed Pipeline Conflicts 8-14 Example 8–9 shows a parallel store followed by a single load or read. Since two parallel stores are required, the next CPU data-memory read must wait one cycle before beginning. One program-memory refetch can occur . Example 8–9. Parallel Store Followed by Si ...

  • Texas Instruments TMS320C3x - page 251

    XF1 = 1, read must wait XF1 = 0, read operation is complete Pipeline Conflicts 8-15 Pipeline Operation Example 8–10. Interlocked Load NOT R1,R0 LDII 300h,AR 2 ADDI *AR2,R2 CMPI R0,R2 Pipeline Operation PC XF1 Fetch Decode Read Execute n 1 NOT — — — n+1 1 LDII NOT — — n+2 1 ADDI LDII NOT — n+3 1 CMPI ADDI LDII NOT n+3 1 — CMPI ADDI L ...

  • Texas Instruments TMS320C3x - page 252

    write access 2-cycle external bus Pipeline Conflicts 8-16 Example 8–1 1. Busy External Port STF R0,@DMA1 LDF @DMA2,R0 Pipeline Operation PC Fetch Decode Read Execute n STF — — — n+1 LDF STF — — n+2 W LDF STF — n+2 W LDF (nop) STF n+2 W LDF (nop) (nop) n+3 X W LDF (nop) n+4 YXW L D F Note: W , X, Y = Instruction representations The sec ...

  • Texas Instruments TMS320C3x - page 253

    2-cycle external bus read access Pipeline Conflicts 8-17 Pipeline Operation Example 8–12. Multicycle Data Reads LDF @DMA,R0 Pipeline Operation PC Fetch Decode Read Execute n LDF — — — n+1 I LDF — — n+2 J I LDF — n+3 K(dummy) I LD F — n+3 K 2 J I LDF Note: I, J, K = Instruction representations The final type of hold-everything confli ...

  • Texas Instruments TMS320C3x - page 254

    PC store cycle Pipeline Conflicts 8-18 Example 8–13. Conditional Calls and T raps Pipeline Operation PC Fetch Decode Read Execute n CALL cond ——— n+1 I CALL cond —— n+1 (nop) (nop) CALL cond — n+1 (nop) (nop) (nop) CALL cond n+1 (nop) (nop) (nop) CALL cond n+2/CALLaddr I (nop) (nop) (nop) Note: I = Instruction representation ...

  • Texas Instruments TMS320C3x - page 255

    ARs read Resolving Register Conflicts 8-19 Pipeline Operation 8.3 Resolving Register Conflicts If the auxiliary registers (AR7–AR0), the index registers (IR1–IR0), data-page pointer (DP), or stack pointer (SP) are accessed for any reason other than address generation, pipeline conflicts associated with the next memory access can occur . The pip ...

  • Texas Instruments TMS320C3x - page 256

    AR2 read AR2 written Resolving Register Conflicts 8-20 Example 8–15. Write to an AR Followed by an AR for Address Generation Without a Pipeline Conflict LDI @TABLE,AR2 MPYF @VALUE,R1 ADDF R2,R1 MPYF *AR2++,R1 SUBF STF Pipeline Operation PC Fetch Decode Read Execute n LDI — — — n+1 MYPF LDI — — n+2 ADDF MYPF LDI — n+3 MYPF ADDF MYPF LD ...

  • Texas Instruments TMS320C3x - page 257

    DP read DP written Resolving Register Conflicts 8-21 Pipeline Operation Example 8–16. Write to DP Followed by a Direct Memory Read Without a Pipeline Conflict LDP TABLE_ADDR POP R0 LDF *–AR3(2),R1 LDI @TABLE_ADDR,AR0 PUSHF R6 PUSH R4 Pipeline Operation PC Fetch Decode Read Execute n LDP — — — n+1 POP LDP — — n+2 LDF POP LDP — n+3 LD ...

  • Texas Instruments TMS320C3x - page 258

    Memory Access for Maximum Performance 8-22 8.4 Memory Access for Maximum Performance If program fetches and data accesses are performed so that the resources being used cannot provide the necessary bandwidth, the pipeline is stalled until the data accesses are complete. Certain configurations of program fetch and data accesses yield conditions unde ...

  • Texas Instruments TMS320C3x - page 259

    Memory Access for Maximum Performance 8-23 Pipeline Operation T able 8–2. One Program Fetch and T wo Data Accesses for Maximum Performance Case No. Primary Bus Accesses Accesses From Dual-Access Internal Memory Expansion † Or Peripheral Bus Accesses 1 1 2 from any combination of internal memory — 2 1 program 1 data 1 data 3 1 data 1 data 1 pr ...

  • Texas Instruments TMS320C3x - page 260

    Clocking Memory Accesses 8-24 8.5 Clocking Memory Accesses This section discusses the role of internal clock phases (H1 and H3) and how the ’C3x handles multiple-memory accesses. The previous section discusses the interaction between sequences of instructions; this section discusses the flow of data on an individual instruction basis. Each major ...

  • Texas Instruments TMS320C3x - page 261

    Clocking Memory Accesses 8-25 Pipeline Operation See Chapter 6, Addressing Modes , for more information. As discussed in Chapter 7, the number of bus cycles for external memory accesses differs in some cases from the number of CPU execution cycles. For external reads, the number of bus cycles and CPU execution cycles is identical. For external writ ...

  • Texas Instruments TMS320C3x - page 262

    Clocking Memory Accesses 8-26 If both source operands are to be fetched from memory , then memory reads can occur in several ways: If both operands are located in internal memory , the src1 read is performed during H3 and the src2 read during H1, completing two memory reads in a single cycle. If src1 is in internal memory and src2 is in external me ...

  • Texas Instruments TMS320C3x - page 263

    2-cycle dummy load of src 2 R0, *AR6 until the store is complete actual read of src 2 and src 1 Clocking Memory Accesses 8-27 Pipeline Operation Example 8–17. Dummy sr2 Read STI R0,*AR6 ; AR6 points to MSTRB space ADDI3 *AR1,*AR3,R0 ; AR3 points to on-chip RAM ( src 1) ; AR1 points to MSTRB space ( src 2) H1 H3 Pipeline Operation PC Fetch Decode ...

  • Texas Instruments TMS320C3x - page 264

    2-cycle store The read of src 2 cannot start until the store is complete 2-cycle read of src 1 and src 2 Clocking Memory Accesses 8-28 Example 8–18. Operand Swapping Alternative Switch the operands of the 3-operand instruction so that the internal read is performed first. STI R0,*AR6 ; AR6 points to MSTRB space ADDI3 *AR3,*AR1,R0 ; AR3 points to ...

  • Texas Instruments TMS320C3x - page 265

    Clocking Memory Accesses 8-29 Pipeline Operation 8.5.2.3 Operations with Parallel Stores The next class of instructions includes every instruction that has a store in parallel with another instruction. Bits 31 and 30 for these instructions are equal to 1 1. The instruction word format for operations that perform a multiply or ALU opera - tion in pa ...

  • Texas Instruments TMS320C3x - page 266

    Clocking Memory Accesses 8-30 If dst1 and dst2 are both written to external memory , a single CPU cycle is still all that is necessary to complete the stores. In this case, four bus cycles are required. 1) In the first cycle, both dst1 and dst2 are written to the port, and the ex- ternal-bus access for dst1 begins. a) The store for dst1 is complete ...

  • Texas Instruments TMS320C3x - page 267

    9-1 TMS320C30 and TMS320C31 External-Memory Interface This chapter describes the ’C30 and ’C31 external-memory interface. See Chapter 10, Enhanced External-Memory Interface , for detailed information on the ’C32 external bus operation. Memories and external peripheral devices are accessible through two external interfaces on the ’C30: Prima ...

  • Texas Instruments TMS320C3x - page 268

    Overview 9-2 9.1 Overview The ’C30 provides two external interfaces: the primary bus and the expansion bus. The TMS320C31 provides one external interface: the primary bus. The primary bus consists of a 32-bit data bus, a 24-bit address bus, and a set of control signals. The expansion bus consists of a 32-bit data bus, a 13-bit address bus, and a ...

  • Texas Instruments TMS320C3x - page 269

    Memory Interface Signals 9-3 TMS320C30 and TMS320C31 External-Memory Interface 9.2 Memory Interface Signals This section describes the differences between the ’C30 and ’C31 memory interface signals. 9.2.1 TMS320C30 Memory Interface Signals The TMS320C30 has two sets of control signals as follows: Primary bus control signals: STRB , R/W , HOLD , ...

  • Texas Instruments TMS320C3x - page 270

    Memory Interface Signals 9-4 T able 9–1. Primary Bus Interface Signals Signal T ype † Description V alue After Reset Idle Status STRB O/Z Primary interface access strobe 1 1 R/W O/Z Specifies memory read (active high) or write (active low) mode 11 HOLD I Hold external memory interface NA ‡ Ignored HOLDA O/ Z Hold ack nowledge for ex ternal me ...

  • Texas Instruments TMS320C3x - page 271

    Memory Interface Signals 9-5 TMS320C30 and TMS320C31 External-Memory Interface T able 9–2. Expansion Bus Interface Signals Signal T ype † Description V alue After Reset Idle Status MSTRB O/Z Expansion bus memory access strobe 1 1 IOSTRB O/Z Expansion bus peripheral-access strobe 1 1 XR/W O/Z Specifies memory (active high) or write (active low) ...

  • Texas Instruments TMS320C3x - page 272

    Memory Interface Signals 9-6 Figure 9–1. Memory-Mapped External Interface Control Registers Expansion-bus control (’C30 only) 808060h 808061h 808062h 808063h 808064h 808065h 808066h 808067h 808068h 808069h 80806Ah 80806Bh 80806Ch 80806Dh 80806Fh Reserved Reserved Reserved Reserved Reserved Reserved Reserved Reserved Reserved Reserved Reserved R ...

  • Texas Instruments TMS320C3x - page 273

    Memory Interface Control Registers 9-7 TMS320C30 and TMS320C31 External-Memory Interface 9.3 Memory Interface Control Registers T wo memory interface control registers, the primary-bus control register and the expansion-bus control register , are described in this section. 9.3.1 Primary-Bus Control Register The primary bus control register is a 32- ...

  • Texas Instruments TMS320C3x - page 274

    Memory Interface Control Registers 9-8 T able 9–3. Primary-Bus Control Register Bits Abbreviation Reset V alue Name Description HOLDST 0 Hold status bit This bit signals whether the port is being held (HOLDST = 1) or is not being held (HOLDST = 0). This status bit is valid whether the port has been held through hardware or software. NOHOLD 0 Port ...

  • Texas Instruments TMS320C3x - page 275

    Memory Interface Control Registers 9-9 TMS320C30 and TMS320C31 External-Memory Interface 9.3.2 Expansion-Bus Control Register The expansion-bus control register is a 32-bit register that contains control bits for the expansion bus (see Figure 9–3 and T able 9–4). Figure 9–3. Expansion-Bus Control Register 21 0 SWW WTCNT xx 3 4 5 6 7 1 1–8 1 ...

  • Texas Instruments TMS320C3x - page 276

    Programmable W ait States 9-10 9.4 Programmable W ait States The ’C3x has its own internal software-configurable ready-generation capability for each strobe. This software wait-state generator is controlled by configuring two bit fields in the primary or expansion bus interface control registers. Use the WTCNT field to specify the number of softw ...

  • Texas Instruments TMS320C3x - page 277

    Programmable W ait States 9-1 1 TMS320C30 and TMS320C31 External-Memory Interface T able 9–5. Wait-State Generation Inputs Output SWW Bit Field /RDY ext /RDYwtcnt /RDYint Functional Description 00 0 1 x x 0 1 W ait until external RDY is signaled 01 x x 0 1 0 1 W ait until internal wait state generator counts down to 0 10 0 0 1 1 0 1 0 1 0 0 0 1 W ...

  • Texas Instruments TMS320C3x - page 278

    Programmable Bank Switching 9-12 9.5 Programmable Bank Switching Programmable bank switching allows you to switch between external memory banks without having to insert wait states externally due to memories that require several cycles to turn off. Bank switching is implemented on the primary bus only . The size of a bank is determined by the numbe ...

  • Texas Instruments TMS320C3x - page 279

    Programmable Bank Switching 9-13 TMS320C30 and TMS320C31 External-Memory Interface The ’C3x has an internal register that contains the MSBs (as defined by the BNKCMP field) of the last address used for a read or write over the primary inter - face. At reset, the register bits are set to 0. If the MSBs of the address being used for the current pri ...

  • Texas Instruments TMS320C3x - page 280

    Programmable Bank Switching 9-14 Figure 9–5. Bank-Switching Example H3 H1 STRB R/W A D RDY Read Read Read Extra cycle Note: After changing BNKCMP , up to three instructions are fetched before the change in the bank size occurs. ...

  • Texas Instruments TMS320C3x - page 281

    External Memory Interface Timing 9-15 TMS320C30 and TMS320C31 External-Memory Interface 9.6 External Memory Interface Timing This section discusses functional timing of operations on the primary bus and the expansion bus, the two independent parallel buses or the ’C3x devices. The parallel buses implement three mutually exclusive address spaces d ...

  • Texas Instruments TMS320C3x - page 282

    External Memory Interface Timing 9-16 The (M)STRB signal is low for the active portion of both reads and writes. The active portion lasts one H1 cycle. Additionally , before and after the active portion ((M)STRB low) of writes only , there is a transition cycle of H1. This transition cycle consists of the following sequence: 1) (M)STRB is high. 2) ...

  • Texas Instruments TMS320C3x - page 283

    External Memory Interface Timing 9-17 TMS320C30 and TMS320C31 External-Memory Interface Figure 9–6. Read-Read-Write for (M)STRB = 0 H3 H1 (M)STRB (X)R/W (X)A (X)D (X)RDY Read Read Write data Note: (x) RDY is sampled low on rising edge of H1. Data is read next falling edge of H1. Note: Back-to-Back Read Operations (M)STRB remains low during back-t ...

  • Texas Instruments TMS320C3x - page 284

    External Memory Interface Timing 9-18 Figure 9–7 illustrates a write-write-read sequence for (M)STRB active and no wait states. The address and data written are held valid approximately one-half cycle after (M)STRB changes. Figure 9–7. Write-Write-Read for (M)STRB = 0 H3 H1 (X)A (X)D (X)R/W (M)STRB (X)RDY Write data Write data Read ...

  • Texas Instruments TMS320C3x - page 285

    External Memory Interface Timing 9-19 TMS320C30 and TMS320C31 External-Memory Interface Figure 9–8 illustrates a read cycle with one wait state. Since (X)RDY = 1, the read cycle is extended. (M)STRB , (X)R/W , and (X)A are also extended one cycle. The next time (X)RDY is sampled, it is 0. Figure 9–8. Use of Wait States for Read for (M)STRB = 0 ...

  • Texas Instruments TMS320C3x - page 286

    External Memory Interface Timing 9-20 Figure 9–9 illustrates a write cycle with one wait state. Since initially (X)RDY = 1, the write cycle is extended. (M)STRB , (X )R /W , and (X)A are extended one cycle. The next time (X)RDY is sampled, it is 0. Figure 9–9. Use of Wait States for Write for (M)STRB = 0 H3 H1 (X)A (X)D (X)RDY (M)STRB (X)R/W Wr ...

  • Texas Instruments TMS320C3x - page 287

    External Memory Interface Timing 9-21 TMS320C30 and TMS320C31 External-Memory Interface 9.6.2 Expansion-Bus I/O Cycles In contrast to primary bus and MSTRB cycles, IOSTRB reads and writes are both two cycles in duration (with no wait states) and exhibit the same timing. During these cycles, address always changes on the falling edge of H1, and IOST ...

  • Texas Instruments TMS320C3x - page 288

    External Memory Interface Timing 9-22 Figure 9–1 1 illustrates a read with one wait state when IOSTRB is active, and Figure 9–12 illustrates a write with one wait state when IOSTRB is active. For each wait state added, IOSTRB , XR/W , and XA are extended one clock cycle. Writes hold the data on the bus one additional cycle. The sampling of XRDY ...

  • Texas Instruments TMS320C3x - page 289

    External Memory Interface Timing 9-23 TMS320C30 and TMS320C31 External-Memory Interface Figure 9–12. Write With One Wait State for IOSTRB = 0 H3 H1 XA XD XR/W IOSTRB XRDY Write data Extra cycle ...

  • Texas Instruments TMS320C3x - page 290

    External Memory Interface Timing 9-24 Figure 9–13 through Figure 9–23 illustrate the various transitions between memory reads and writes, and I/O writes over the expansion bus. Figure 9–13. Memory Read and I/O Write for Expansion Bus H3 H1 XA XD XR/W IOSTRB MSTRB XRDY Memory address I/O address Read I/O write ...

  • Texas Instruments TMS320C3x - page 291

    External Memory Interface Timing 9-25 TMS320C30 and TMS320C31 External-Memory Interface Figure 9–14. Memory Read and I/O Read for Expansion Bus XRDY XD XA XR/W IOSTRB MSTRB H1 H3 I/O read Read I/O address Memory address ...

  • Texas Instruments TMS320C3x - page 292

    External Memory Interface Timing 9-26 Figure 9–15. Memory Write and I/O Write for Expansion Bus H3 H1 XA XD XRDY MSTRB IOSTRB XR/W Memory address I/O address I/O write Memory write ...

  • Texas Instruments TMS320C3x - page 293

    External Memory Interface Timing 9-27 TMS320C30 and TMS320C31 External-Memory Interface Figure 9–16. Memory Write and I/O Read for Expansion Bus H3 H1 XA XD XRDY MSTRB IOSTRB XR/W Memory address I/O address I/O read Memory write ...

  • Texas Instruments TMS320C3x - page 294

    External Memory Interface Timing 9-28 Figure 9–17. I/O Write and Memory Write for Expansion Bus H3 H1 XA XD XRDY MSTRB IOSTRB XR/W I/O address Memory address I/O write Memory write ...

  • Texas Instruments TMS320C3x - page 295

    External Memory Interface Timing 9-29 TMS320C30 and TMS320C31 External-Memory Interface Figure 9–18. I/O Write and Memory Read for Expansion Bus H3 H1 XA XD XRDY MSTRB IOSTRB XR/W I/O address Memory address I/O write Read ...

  • Texas Instruments TMS320C3x - page 296

    External Memory Interface Timing 9-30 Figure 9–19. I/O Read and Memory Write for Expansion Bus I/O address Memory address Memory write XRDY XD XA XR/W IOSTRB MSTRB H1 H3 I/O read ...

  • Texas Instruments TMS320C3x - page 297

    External Memory Interface Timing 9-31 TMS320C30 and TMS320C31 External-Memory Interface Figure 9–20. I/O Read and Memory Read for Expansion Bus Memory address I/O address XRDY XD XA XR/W IOSTRB MSTRB H1 H3 Read I/O read ...

  • Texas Instruments TMS320C3x - page 298

    External Memory Interface Timing 9-32 Figure 9–21. I/O Write and I/O Read for Expansion Bus I/O write XRDY XD XA XR/W IOSTRB MSTRB H1 H3 I/O read I/O address I/O address ...

  • Texas Instruments TMS320C3x - page 299

    External Memory Interface Timing 9-33 TMS320C30 and TMS320C31 External-Memory Interface Figure 9–22. I/O Write and I/O Write for Expansion Bus I/O write I/O write XRDY XD XA XR/W IOSTRB MSTRB H1 H3 I/O address I/O address ...

  • Texas Instruments TMS320C3x - page 300

    External Memory Interface Timing 9-34 Figure 9–23. I/O Read and I/O Read for Expansion Bus I/O read I/O read XRDY XD XA XR/W IOSTRB MSTRB H1 H3 I/O address I/O address ...

  • Texas Instruments TMS320C3x - page 301

    External Memory Interface Timing 9-35 TMS320C30 and TMS320C31 External-Memory Interface Figure 9–24 and Figure 9–25 illustrate the signal states when a bus is inactive (after an IOSTRB or (M)STRB access, respectively). The strobes (STRB , MSTRB and IOSTRB ) an d (X )R / W ) go to 1. The address is driven with last exter - nal bus access, and th ...

  • Texas Instruments TMS320C3x - page 302

    External Memory Interface Timing 9-36 Figure 9–25. Inactive Bus States for STRB and MSTRB H3 H1 (X)A (X)D (X)R/W (M)STRB (X)RDY Write data (X)RDY ignored Bus inactive ...

  • Texas Instruments TMS320C3x - page 303

    External Memory Interface Timing 9-37 TMS320C30 and TMS320C31 External-Memory Interface 9.6.3 Hold Cycles Figure 9–26 illustrates the timing for HOLD and HOLDA . HOLD is an external asynchronous input. There is a minimum of one cycle delay from the time when the processor recognizes HOLD = 0 until HOLDA = 0. When HOLDA = 0, the address, data buse ...

  • Texas Instruments TMS320C3x - page 304

    10-1 TMS320C32 Enhanced External Memory Interface The ’C32 external memory interface provides greater flexibility by improving the ’C3x core with several new features. This chapter describes these features and enhancements in detail. T opic Page 10.1 TMS320C32 Memory Features 10-2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ...

  • Texas Instruments TMS320C3x - page 305

    TMS320C32 Memory Features 10-2 10.1 TMS320C32 Memory Features The ’C32 external memory interface includes the following features: One external pin, PRGW , configures the external-program-memory width to 16 or 32 bits. T wo sets of memory strobes (STRB0 and STRB1 ) and one IOSTRB allow zero glue-logic interface to two banks of memory and one bank ...

  • Texas Instruments TMS320C3x - page 306

    TMS320C32 Memory Overview 10-3 TMS320C32 Enhanced External Memory Interface 10.2 TMS320C32 Memory Overview The following sections describe examples, control register setups, and restrictions necessary to fully understand the operation and functionality of the external memory interface. 10.2.1 External Memory Interface Overview The ’C32 memory int ...

  • Texas Instruments TMS320C3x - page 307

    TMS320C32 Memory Overview 10-4 IOSTRB can access 32-bit data from 32-bit wide memory . It does not have the flexibility of STRB0 and STRB1 since it is composed of a single signal: IOSTRB . IOSTRB bus cycles are dif ferent from those of STRB0 and STRB1 and are discussed in Section 10.10. This timing difference accomodates slower I/O peripherals. The ...

  • Texas Instruments TMS320C3x - page 308

    TMS320C32 Memory Overview 10-5 TMS320C32 Enhanced External Memory Interface The PRGW status bit field of the CPU status (ST) register reflects the setting of the PRGW pin. Figure 10–2 depicts all the bit fields of the CPU status (ST) register . Figure 10–2. Status Register 31–16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 xx PRGW status INT config ...

  • Texas Instruments TMS320C3x - page 309

    TMS320C32 Memory Overview 10-6 10.2.3.2 16- or 32-Bit Floating-Point Data T ypes The ’C32 supports 16- or 32-bit floating point data. For 16-bit floating-point reads, the eight MSBs are the signed exponent and the eight LSBs are the signed mantissa (see Section 5.3.2, ’C32 Short Floating-Point Format for External 16-Bit Data , on page 5-6). Whe ...

  • Texas Instruments TMS320C3x - page 310

    Configuration 10-7 TMS320C32 Enhanced External Memory Interface 10.3 Configuration T o access 8-, 16-, or 32-bit data (types) from 8-, 16-, or 32-bit wide memory , the memory interface of the ’C32 device uses either strobe STRB0 or STRB1 with four pins each. These pins serve as byte-enable and/or additional-address pins. In conjunction with a shi ...

  • Texas Instruments TMS320C3x - page 311

    Configuration 10-8 10.3.1.1 STRB0 Control Register The STRB0 control register (Figure 10–4) is a 32-bit register that contains the control bits for the portion of the external bus memory space that is mapped to STRB0 . The following table lists the register bits with the bit names and functions. At the system reset, 0F10F8h is written to the STRB ...

  • Texas Instruments TMS320C3x - page 312

    Configuration 10-9 TMS320C32 Enhanced External Memory Interface The instruction immediately preceding a change in the data-size or memory-width bit fields should not perform a multicycle store. Do not follow a change in the data-size or memory-width bit fields with a store instruction. Also, do not perform a load in the next two instructions follow ...

  • Texas Instruments TMS320C3x - page 313

    Configuration 10-10 T able 10–1 describes the bits in the STRBO , STRB1 , and the IOSTRB control registers. T able 10–1. STRB0 , STRB1 , and IOSTRB Control Register Bits Abbreviation Reset V alue Name Description HOLDST 0 Hold status bit This bit signals whether the port is being held (HOLDST = 1), or is not being held (HOLDST = 1). This status ...

  • Texas Instruments TMS320C3x - page 314

    Configuration 10-1 1 TMS320C32 Enhanced External Memory Interface T able 10–1. STRB0 , STRB1 , and IOSTRB Control Register Bits (Continued) Abbreviation Description Name Reset V alue Physical memory width 01 or 11 (STRB0 and STRB1 control registers only) Indicates the size of the physical memory connected to the device. The “reset” value depe ...

  • Texas Instruments TMS320C3x - page 315

    Configuration 10-12 T able 10–1. STRB0 , STRB1 , and IOSTRB Control Register Bits (Continued) Abbreviation Description Name Reset V alue Sign ext/ zero-fill 0 (STRB0 and STRB1 control registers only) Selects the method of converting 8- and 16-bit integer data into 32-bit integer data when transferring data from external memory to an internal regi ...

  • Texas Instruments TMS320C3x - page 316

    Configuration 10-13 TMS320C32 Enhanced External Memory Interface Figure 10–7. STRB Configuration STRB0_Bx STRB1_Bx STRB0_Bx STRB config STRB1_Bx 10.3.2 Using Physical Memory Width and Data-T ype Size Fields Consider a ’C32 connected to two banks of external memory . In this configura - tion, one bank is mapped to STRB0 while the other bank is m ...

  • Texas Instruments TMS320C3x - page 317

    Configuration 10-14 By setting the bit fields of the STRB0 bus control register with a physical- memory width of 32 bits and a data type size of 32 bits, the external address referring to the STRB0 location is identical to the internal address used by the ‘C32 CPU. Alternatively , setting the bit fields of the STRB1 bus control register with a ph ...

  • Texas Instruments TMS320C3x - page 318

    Programmable W ait States 10-15 TMS320C32 Enhanced External Memory Interface 10.4 Programmable W ait States The ’C3x has its own internal software-configurable ready-generation capability for each strobe. This software wait-state generator is controlled by configuring two fields in the primary or expansion bus interface control registers. Use the ...

  • Texas Instruments TMS320C3x - page 319

    Programmable W ait States 10-16 T able 10–3. Wait-State Generation Inputs Output SWW Bit Field /RDY ext /RDYwtcnt /RDYint Functional Description 00 0 1 x x 0 1 W ait until external RDY is signaled 01 x x 0 1 0 1 W ait until internal wait state generator counts down to 0 10 0 0 1 1 0 1 0 1 0 0 0 1 W ait until first signal: external RDY or the inte ...

  • Texas Instruments TMS320C3x - page 320

    Programmable Bank Switching 10-17 TMS320C32 Enhanced External Memory Interface 10.5 Programmable Bank Switching Programmable bank switching allows you to switch between external memory banks without having to insert wait states externally due to memories that require several cycles to turn off. Bank switching is implemented on STRB0 and STRB1 only ...

  • Texas Instruments TMS320C3x - page 321

    Programmable Bank Switching 10-18 The ’C3x has an internal register that contains the MSBs (as defined by the BNKCMP field) of the last address used for a read or write over the primary inter - face. At reset, the register bits are set to 0. If the MSBs of the address being used for the current primary interface read do not match those contained ...

  • Texas Instruments TMS320C3x - page 322

    Programmable Bank Switching 10-19 TMS320C32 Enhanced External Memory Interface Note: After changing BNKCMP , up to three instructions are fetched before the change in bank size occurs. ...

  • Texas Instruments TMS320C3x - page 323

    32-Bit-Wide Memory Interface 10-20 10.6 32-Bit-Wide Memory Interface The ’C32 memory interface to 32-bit-wide external memory uses STRBx_B 3 through STRBx_B 0 pins as strobe-byte-enable pins as shown in Figure 10–10. In this manner , the ’C32 can read from, or write to, a single 32-, 16-, or 8-bit value from the external 32-bit-wide memory . ...

  • Texas Instruments TMS320C3x - page 324

    32-Bit-Wide Memory Interface 10-21 TMS320C32 Enhanced External Memory Interface T able 10–5. Strobe Byte-Enable for 32-Bit-Wide Memory With 8-Bit Data-T ype Size Internal A 1 Internal A 0 Active Strobe Byte Enable 0 0 STRBx_B0 0 1 STRBx_B1 1 0 STRBx_B2 1 1 STRBx_B3 Figure 10–1 1. Fu nc ti on a l Di ag ra m fo r 8- Bi t Da ta -T yp e S iz e an d ...

  • Texas Instruments TMS320C3x - page 325

    32-Bit-Wide Memory Interface 10-22 For example, reading from or writing to memory locations 90 4000h to 90 4004h involves the pins listed in T able 10–6. T able 10–6. Example of 8-Bit Data-T ype Size Internal Address Bus External Address Pins Active Strobe Byte Enable Accessed Data Pins 904000h E41000h STRB1_B0 D 7–0 904001h E41000h STRB1_B1 ...

  • Texas Instruments TMS320C3x - page 326

    32-Bit-Wide Memory Interface 10-23 TMS320C32 Enhanced External Memory Interface Figure 10–12. Fu n c t i onal Diagram for 16-Bit Data-T ype Size and 32-Bit External-Memory Widt h A22 A21 A20 A19 . . . A1 A0 CS I/O(7-0) ’C32 A 23 A 22 A 21 A 20 A 19 . . . A 1 A 0 D(31-24) D(23-16) D(15-8) D(7-0) 1 0 Memory interface A22 A21 A20 A19 . . . A1 A0 C ...

  • Texas Instruments TMS320C3x - page 327

    32-Bit-Wide Memory Interface 10-24 Case 3: 32-Bit-Wide Memory With 32-Bit Data-T ype Size When the data size is 32 bits, the ’C32 does not shift the internal address before presenting it to the external address pins. In this case, the memory interface copies the value of the internal address bus to the respective external- address pins. Also, the ...

  • Texas Instruments TMS320C3x - page 328

    32-Bit-Wide Memory Interface 10-25 TMS320C32 Enhanced External Memory Interface For example, reading or writing to memory locations 904000h to 904004h involves the pins listed in T able 10–9. T able 10–9. Example of 32-Bit-Wide Memory With 32-Bit Data-T ype Size Internal Address Bus External Address Pins Active Strobe Byte Enable Accessed Data ...

  • Texas Instruments TMS320C3x - page 329

    16-Bit-Wide Memory Interface 10-26 10.7 16-Bit-Wide Memory Interface The ’C32 memory interface to 16-bit-wide external memory uses STRBx_B3 pin as an additional address pin, A –1 , while using STRBx_B0 and STRBx_B1 as strobe byte-enable pins as shown in Figure 10–14 . Note that the external- memory address pins are connected to the ’C32 add ...

  • Texas Instruments TMS320C3x - page 330

    16-Bit-Wide Memory Interface 10-27 TMS320C32 Enhanced External Memory Interface T able 10–10. St r obe-Byte Enable Behavior for 16-Bit-Wide Memory with 8-Bit Data-T ype Size Internal A 0 Active Strobe Byte Enable 0 STRBx_B0 1 STRBx_B1 Figure 10–15. Fu n c t i onal Diagram for 8-Bit Data-T ype Size and 16-Bit External-Memory Width A22 A21 A20 A1 ...

  • Texas Instruments TMS320C3x - page 331

    16-Bit-Wide Memory Interface 10-28 T able 10–1 1. Example of 8-Bit Data-T ype Size and 16-Bit-Wide External Memory Internal Address Bus External Address Pins STRB0_B3 /A –1 Active Strobe Byte Enable Accessed Data Pins 4000h 1000h 0 STRB0_B0 D 7–0 4001h 1000h 0 STRB0_B1 D 1 5–8 4002h 1000h 1 STRB0_B0 D 7–0 4003h 1000h 1 STRB0_B1 D 1 5–8 ...

  • Texas Instruments TMS320C3x - page 332

    16-Bit-Wide Memory Interface 10-29 TMS320C32 Enhanced External Memory Interface Figure 10–16. Functional Diagram for 16-Bit Data-T ype Size and 16-Bit External-Memory Width A 23 A 22 A 21 A 20 . . . A 2 A 1 A 0 CS I/O(7-0) A 23 A 22 A 21 A 20 . . . A 2 A 1 A 0 CS I/O(7-0) ’C32 . . . D(15-8) D(7-0) A 23 A 22 A 21 A 20 . . . A 2 A 1 A 0 Memory in ...

  • Texas Instruments TMS320C3x - page 333

    16-Bit-Wide Memory Interface 10-30 Case 6: 16-Bit-Wide Memory with 32-Bit Data-T ype Size When the data type size is 32 bits, the ’C32 does not shift the internal address before presenting it to the external address pins. In this case, the memory interface copies the value of the internal address bus to the respective external address pins. The m ...

  • Texas Instruments TMS320C3x - page 334

    16-Bit-Wide Memory Interface 10-31 TMS320C32 Enhanced External Memory Interface T able 10–13. Example of 16-Bit-Wide Memory With 32-Bit Data-T ype Size Internal Address Bus External Address Pins STRB0_B3 /A –1 Active Strobe Byte Enable Accessed Data Pins 4000h 4000h 0 STRB0_B0 and STRB0_B1 D 15–0 4000h 1 STRB0_B0 and STRB0_B1 D 15–0 4001h 4 ...

  • Texas Instruments TMS320C3x - page 335

    8-Bit-Wide Memory Interface 10-32 10.8 8-Bit-Wide Memory Interface ’C32 memory interface to an 8-bit wide external memory uses STRBx_B3 and STRBx_B2 pins as additional address pins, A –1 and A –2 , respectively , while using STRBx_B0 as strobe byte-enable pin as shown in Figure 10–18. The external-memory address pins are connected to the ? ...

  • Texas Instruments TMS320C3x - page 336

    8-Bit-Wide Memory Interface 10-33 TMS320C32 Enhanced External Memory Interface Figure 10–19. Functional Diagram for 8-Bit Data-T ype Size and 8-Bit External-Memory Width A23 A22 A21 A20 . . . A2 CS I/O(7-0) ’C32 A 23 A 22 A 21 A 20 A 19 A 18 . . . A 0 STRBx_B3/A –1 STRBx_B2/A –2 STRBx_B0 D(7-0) A 23 A 22 A 21 A 20 . . . A 2 A 1 A 0 Memory i ...

  • Texas Instruments TMS320C3x - page 337

    8-Bit-Wide Memory Interface 10-34 Case 8: 8-Bit Wide Memory With 16-Bit Data-T ype Size When the data-type size is 16 bits, the ‘C32 shifts the internal address one bit to the right before presenting it to the external-address pins. In this shift, the memory interface copies the value of the internal-address A 23 to the external- address pins A 2 ...

  • Texas Instruments TMS320C3x - page 338

    8-Bit-Wide Memory Interface 10-35 TMS320C32 Enhanced External Memory Interface For example, reading or writing to memory locations A04000h to A04002h involves the pins listed in T able 10–15. T able 10–15. Example of 8-Bit-Wide Memory With 16-Bit Data-T ype Size Internal Address Bus External Address Pins STRB0_B3 /A –1 STRB0_B3 /A –2 Active ...

  • Texas Instruments TMS320C3x - page 339

    8-Bit-Wide Memory Interface 10-36 Figure 10–21. Functional Diagram for 32-Bit Data-T ype Size and 8-Bit External-Memory Width A 24 A 23 A 22 . A 4 A 2 A 1 A 0 CS I / O(7 – 0) ’C32 A 23 A 22 A 21 A 20 A 1 A 0 STRBx_B3/A –1 STRBx_B0 D(7 – 0) A 23 A 22 A 21 A 20 A 2 A 1 A 0 Memory interface toggle STRBx logic STRBx_B2 /A –2 toggle A 25 A 3 ...

  • Texas Instruments TMS320C3x - page 340

    8-Bit-Wide Memory Interface 10-37 TMS320C32 Enhanced External Memory Interface For example, reading or writing to memory locations A04000h to A04001h involves the pins listed in T able 10–16. T able 10–16. Example of 32-Bit Data-T ype Size and 8-Bit-Wide Memory Internal Address Bus External Address Pins STRB0_B3 /A –1 STRB0_B3 /A –2 Active ...

  • Texas Instruments TMS320C3x - page 341

    External Ready Timing Improvement 10-38 10.9 External Ready Timing Improvement The ready (RDY ) timing should relate to the H1 low signal as shown in Figure 10–22 . This is equivalent to the ’C4x ready timing, which increases the time between valid address and the sampling of RDY . This facilitates the memory hardware interface by allowing a lo ...

  • Texas Instruments TMS320C3x - page 342

    Bus Timing 10-39 TMS320C32 Enhanced External Memory Interface 10.10 Bus Timing This section discusses functional timing of operations on the external memory bus. Detailed timing specifications are contained in the TMS320C32 Data Sheet . The timing of STRB0 and STRB1 bus cycles is identical and discussed in subsection 10.10.1 . The abbreviation STRB ...

  • Texas Instruments TMS320C3x - page 343

    Bus Timing 10-40 Figure 10–23. Read-Read-Write Sequence for STRBx Active RDY D A R/W STRBx H1 H3 Read Read Write Figure 10–24 shows a zero wait-state write-write-read sequence for STRBx active. During back-to-back writes, the data is valid when STRBx changes for the first write, but for subsequent writes the data is valid when the address chang ...

  • Texas Instruments TMS320C3x - page 344

    Bus Timing 10-41 TMS320C32 Enhanced External Memory Interface Figure 10–25 shows a one wait-state read sequence and Figure 10–26 shows the write sequence for STRB x active. On the first H1 cycle, RDY is high; therefore, the read or write sequence is extended for one extra cycle. On the second H1 cycle, RDY is low and the read or write sequence ...

  • Texas Instruments TMS320C3x - page 345

    Bus Timing 10-42 Figure 10–26. One Wait-State Write Sequence for STRBx Active RDY D A R/W STRBx H1 H3 Extra cycle Write 10.10.2 IOSTRB Bus Cycles In contrast to STRB0 and STRB1 bus cycles, IOSTRB full speed (zero wait- state) reads and writes consume two H1 cycles. During these cycles, the IOSTRB signal is low from the rising edge of the first H1 ...

  • Texas Instruments TMS320C3x - page 346

    Bus Timing 10-43 TMS320C32 Enhanced External Memory Interface Figure 10–27 illustrates a zero wait-state read and write sequence for IOSTRB active. During writes, the data is valid when IOSTRB changes. Figure 10–27. Zero Wait-State Read and Write Sequence for IOSTRB Active Write Read IOSTRB RDY D A R/W H1 H3 Figure 10–28 depicts a one wait-st ...

  • Texas Instruments TMS320C3x - page 347

    Bus Timing 10-44 Figure 10–28. One Wait-State Read Sequence for IOSTRB Active IOSTRB RDY D A R/W H1 H3 Extra cycle Read Figure 10–29. One Wait-State Write Sequence for IOSTRB Active IOSTRB RDY D A R/W H1 H3 Extra cycle Write Figure 10–30 and Figure 10–31 illustrate the transitions between STRBx reads and IOSTRB writes and reads, respectivel ...

  • Texas Instruments TMS320C3x - page 348

    Bus Timing 10-45 TMS320C32 Enhanced External Memory Interface Figure 10–30. STRBx Read and IOSTRB Write I/O Write Read STRB0,1 IOSTRB RDY D A R/W H1 H3 Figure 10–31. STRBx Read and IOSTRB Read I/O read Read STRB0,1 IOSTRB RDY D A R/W H1 H3 ...

  • Texas Instruments TMS320C3x - page 349

    Bus Timing 10-46 Figure 10–32 and Figure 10–33 illustrate the transitions between STRBx writes and IOSTRB writes and reads, respectively . In these transitions, the address changes on the falling edge of the H3 cycle. Figure 10–32. STRBx Write and IOSTRB Write Write I/O write STRBx IOSTRB RDY D A R/W H1 H3 Figure 10–33. STRBx Write and IOST ...

  • Texas Instruments TMS320C3x - page 350

    Bus Timing 10-47 TMS320C32 Enhanced External Memory Interface Figure 10–34 through Figure 10–37 show the transitions between IOSTRB writes/reads and STRBx writes/reads. In these transitions, the address changes on the rising edge of the H3 cycle. Figure 10–34. IOSTRB Write and STRBx Write I/O write Write STRBx IOSTRB RDY D A R/W H1 H3 ...

  • Texas Instruments TMS320C3x - page 351

    Bus Timing 10-48 Figure 10–35. IOSTRB Write and STRBx Read I/O Write Read STRBx IOSTRB RDY D A R/W H1 H3 Figure 10–36. IOSTRB Read and STRBx Write I/O read Write STRBx IOSTRB RDY D A R/W H1 H3 ...

  • Texas Instruments TMS320C3x - page 352

    Bus Timing 10-49 TMS320C32 Enhanced External Memory Interface Figure 10–37. IOSTRB Read and STRBx Read Read I/O Read STRBx IOSTRB RDY D A R/W H1 H3 Figure 10–38 through Figure 10–40 illustrate the transitions between reads and writes. ...

  • Texas Instruments TMS320C3x - page 353

    Bus Timing 10-50 Figure 10–38. IOSTRB Write and Read I/O write IOSTRB RDY D A R/W H1 H3 I/O read Figure 10–39. IOSTRB Write and Write I/O write I/O write IOSTRB RDY D A R/W H1 H3 ...

  • Texas Instruments TMS320C3x - page 354

    Bus Timing 10-51 TMS320C32 Enhanced External Memory Interface Figure 10–40. IOSTRB Read and Read I/O Read I/O Read IOSTRB RDY D A R/W H1 H3 10.10.3 Inactive Bus States Figure 10–41 and Figure 10–42 show the signal states when a bus becomes inactive after an IOSTRB or STRBx , respectively . The strobes (STRB0, STRB1 , IOSTRB , and R / W ) are ...

  • Texas Instruments TMS320C3x - page 355

    Bus Timing 10-52 Figure 10–42. Inactive Bus States Following STRBx Bus Cycle I/O write STRBx RDY D A R/W H1 H3 Bus inactive RDY ignored ...

  • Texas Instruments TMS320C3x - page 356

    1 1-1 Using the TMS320C31 and TMS320C32 Boot Loaders The ’C31 and ’C32 have on-chip boot loaders that can load and execute pro- grams received from a host processor , standard memory devices (including EPROM), or via serial port. T opic Page 1 1.1 TMS320C31 Boot Loader 1 1-2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ...

  • Texas Instruments TMS320C3x - page 357

    TMS320C31 Boot Loader 1 1-2 1 1.1 TMS320C31 Boot Loader This section describes how to use the ’C31 microcomputer/boot loader (MCBL/ MP ) function. This feature is unique to the ’C31 and ’C32, and is not available on the ’C30 devices. 1 1.1.1 TMS320C31 Boot-Loader Description The boot loader lets you load and execute programs that are receiv ...

  • Texas Instruments TMS320C3x - page 358

    TMS320C31 Boot Loader 1 1-3 Using the TMS320C31 and TMS320C32 Boot Loaders T able 1 1–1. Boot-Loader Mode Selection INT0 INT1 INT2 INT3 Loader Mode Memory Addresses 0 1 1 1 External memory Boot 1 address 0x001000 1 0 1 1 External memory Boot 2 address 0x400000 1 1 0 1 External memory Boot 3 address 0xFFF000 1 1 1 0 32-bit serial Serial port 0 Fig ...

  • Texas Instruments TMS320C3x - page 359

    TMS320C31 Boot Loader 1 1-4 1 1.1.3 TMS320C31 Boot-Loading Sequence The following is the sequence of events that occur during the boot load of a source program. T able 1 1–2 shows the structure of the source program. 1) Select the boot loader by resetting the ’C31 while driving the MCBL / MP pin high and the corresponding INT3 – INT0 pin low ...

  • Texas Instruments TMS320C3x - page 360

    TMS320C31 Boot Loader 1 1-5 Using the TMS320C31 and TMS320C32 Boot Loaders Figure 1 1–2. Boot-Loader Memory-Load Flowchart block loaded address of first Branch to destination Load next block size Block size –1 T ransfer data from source to destination Ye s Ye s address Load destination Load block size control word configuration Set memory Deter ...

  • Texas Instruments TMS320C3x - page 361

    TMS320C31 Boot Loader 1 1-6 Figure 1 1–3. Boot-Loader Serial-Port Load-Mode Flowchart Begin program execution Block size –1 T ransfer data from serial port to destination address port input W ait for serial Load destination address port input W ait for serial- Block size = 0? No Ye s block loaded address of first Branch to destination Ye s No B ...

  • Texas Instruments TMS320C3x - page 362

    TMS320C31 Boot Loader 1 1-7 Using the TMS320C31 and TMS320C32 Boot Loaders 1 1.1.4 TMS320C31 Boot Data Stream Structure T able 1 1–2 shows the data stream structure. The data stream is composed of a header of 1 (serial-port load) or 2 (memory load) words and one or more blocks of source data. The boot loader uses this header to determine the phys ...

  • Texas Instruments TMS320C3x - page 363

    TMS320C31 Boot Loader 1 1-8 T able 1 1–2. Source Data Stream Structure Wor d † Content V alid Data Entries 1 Memory width (8, 16, or 32 bits) where source program resides 8h, 10h, or 20h, respectively 2 V alue to set the STRB control register See subsection 10.7 3 Size of first data block. The block size is the number of 32-bit words in the dat ...

  • Texas Instruments TMS320C3x - page 364

    TMS320C31 Boot Loader 1 1-9 Using the TMS320C31 and TMS320C32 Boot Loaders 1 1.1.4.1 Examples of External TMS320C31 Memory Loads T able 1 1–3 , T able 1 1–4, and T able 1 1–5 show memory images for byte-wide, 16-bit-wide, and 32-bit-wide configured memory (see Figure 4–2 on page 4-6 ). These examples assume the following: An INT0 signal was ...

  • Texas Instruments TMS320C3x - page 365

    TMS320C31 Boot Loader 1 1-10 T able 1 1–4. 16-Bit-Wide Configured Memory Address V alue Comments 0x1000 0x10 Memory width = 16 0x1001 0x0000 0x1002 0x1058 Memory type = SWW = 1 1, WCNT = 2 0x1003 0x0000 0x1004 0x1FF Program block size in words = 0x1FF 0x1005 0x0000 0x1006 0x9C00 Program load starting address = 0x809C00 0x1007 0x0080 T able 1 1– ...

  • Texas Instruments TMS320C3x - page 366

    TMS320C31 Boot Loader 1 1-1 1 Using the TMS320C31 and TMS320C32 Boot Loaders 1 1.1.4.2 Serial-Port Loading Boot loads, by way of the ’C31 serial port, are selected by driving the INT3 pin active (low) following reset. The loader automatically configures the serial port for 32-bit fixed-burst-mode reads. It is interrupt-driven by the frame synchro ...

  • Texas Instruments TMS320C3x - page 367

    TMS320C31 Boot Loader 1 1-12 T able 1 1–6. TMS320C31 Interrupt and T rap Memory Maps Address Description 809FC1 INT0 809FC2 INT1 809FC3 INT2 809FC4 INT3 809FC5 XINT0 809FC6 RINT0 809FC7 XINT1 (Reserved) 809FC8 RINT1 (Reserved) 809FC9 TINT0 809FCA TINT1 809FCB DINT0 809FCC–809FDF Reserved 809FE0 TRAP0 809FE1 TRAP1 •• •• •• 809FFB TRA ...

  • Texas Instruments TMS320C3x - page 368

    TMS320C31 Boot Loader 1 1-13 Using the TMS320C31 and TMS320C32 Boot Loaders 1 1.1.6 TMS320C31 Boot-Loader Precautions The boot loader builds a one-word-deep stack, starting at location 809801h. A void loading code at location 809801h. The interrupt flags are not reset by the boot-loader function. If pending interrupts are to be avoided when interru ...

  • Texas Instruments TMS320C3x - page 369

    TMS320C32 Boot Loader 1 1-14 1 1.2 TMS320C32 Boot Loader This section describes how to use the ’C32 microcomputer/boot loader (MCBL/MP ) functions. 1 1.2.1 TMS320C32 Boot-Loader Description The ’C32 boot loader is an enhanced version of that found in the ’C31. The boot loader can load and execute programs received from a host processor throug ...

  • Texas Instruments TMS320C3x - page 370

    TMS320C32 Boot Loader 1 1-15 Using the TMS320C31 and TMS320C32 Boot Loaders T able 1 1–7. Boot-Loader Mode Selection INT0 INT1 INT2 INT3 Boot Loader Mode Source Program Location 0 1 1 1 External memory Boot 1 address 1000h 1 0 1 1 External memory Boot 2 address 81 0000h 1 1 0 1 External memory Boot 3 address 90 0000h 1 1 1 0 32-bit fixed-burst se ...

  • Texas Instruments TMS320C3x - page 371

    TMS320C32 Boot Loader 1 1-16 4) Otherwise, the boot loader attempts a memory boot load. Figure 1 1–6 shows the boot-loader memory flow . If the IF register ’s INT0 bit field is set, the source program is loaded from memory location 1000h. If the IF regis- ter ’s INT1 bit field is set, the source program is loaded from memory location 810000h. ...

  • Texas Instruments TMS320C3x - page 372

    TMS320C32 Boot Loader 1 1-17 Using the TMS320C31 and TMS320C32 Boot Loaders Figure 1 1–4. TMS320C32 Boot-Loader Mode-Selection Flowchart No Ye s No Ye s MCBL/MP = 1 Reset Begin Serial-port load No Ye s Ye s No register bit INT3 set? register bit INT1 set? register bit INT0 set? register bit INT2 set? Memory load from 81000h Memory load from 1000h ...

  • Texas Instruments TMS320C3x - page 373

    TMS320C32 Boot Loader 1 1-18 Figure 1 1–5. Boot-Loader Serial-Port Load Flowchart According to the destination address, set corresponding STRB control register data- type size field T ransfer one word from serial port to destination address Branch to destination address of first block loaded End of source program code (block size = 0)? Serial-por ...

  • Texas Instruments TMS320C3x - page 374

    TMS320C32 Boot Loader 1 1-19 Using the TMS320C31 and TMS320C32 Boot Loaders Figure 1 1–6. Boot-Loader Memory-Load Flowchart End of source program code (block size = 0)? End of source program code (block size = 0)? Set STRB0 , STRB1 , and IOSTRB control registers to the values read at the beginning of the load T ransfer data source to destination ...

  • Texas Instruments TMS320C3x - page 375

    TMS320C32 Boot Loader 1 1-20 Figure 1 1–7. Handshake Data-T ransfer Operation V alid data V alid data i ii iii iv XF1 XF0 D31-0 IACK 1 1.2.4 TMS320C32 Boot Data Stream Structure T able 1 1–8 shows the data stream structure. The data stream is composed of a header of three (serial-port load) or four (memory load) words and one or more blocks of ...

  • Texas Instruments TMS320C3x - page 376

    TMS320C32 Boot Loader 1 1-21 Using the TMS320C31 and TMS320C32 Boot Loaders T able 1 1–8. Source Data Stream Structure Wor d † Content V alid Data Entries 1 Memory width (8, 16, or 32 bits) where source program resides 8h, 10h, or 20h, respectively 2 V alue to set the IOSTRB control register at end of boot loader process See Section 10.7 on pag ...

  • Texas Instruments TMS320C3x - page 377

    TMS320C32 Boot Loader 1 1-22 T able 1 1–8. Source Data Stream Structure (Continued) V alid Data Entries Content Wor d † m + 2 Last block destination memory width and data-type size in the format given in the V alid Data Entries column. SSSSSS6x h ‡ m + 3 First word of last block. A ’C32 valid instruction or any 8-, 16-, or 32-bit wide data ...

  • Texas Instruments TMS320C3x - page 378

    TMS320C32 Boot Loader 1 1-23 Using the TMS320C31 and TMS320C32 Boot Loaders 1 1.2.5 Boot-Loader Hardware Interface The hardware interface for the memory boot load uses the STRBX_B 3 through STRBX_B 0 pins as strobe byte-enable pins (see Figure 1 1–8). The hardware interface is independent of the boot source memory width . This interface is identi ...

  • Texas Instruments TMS320C3x - page 379

    TMS320C32 Boot Loader 1 1-24 The ’C32 boot loader uses the following peripheral memory-mapped registers as a temporary stack: T imer0 counter register (808024h) T imer0 period register (808028h) DMA0 source address register (808004h) DMA0 destination address register (808006h) DMA0 transfer counter register (808008h) These memory-mapped registers ...

  • Texas Instruments TMS320C3x - page 380

    12-1 Peripherals The ’C3x features two timers, a serial port (two serial ports for the ’C30), a nd an on-chip direct memory access (DMA) controller (2-channel DMA controller on the ’C32). These peripheral modules are controlled through memory- mapped registers located on the dedicated peripheral bus. The DMA controller performs input/output o ...

  • Texas Instruments TMS320C3x - page 381

    Timers 12-2 12.1 Timers The ’C3x has two 32-bit general-purpose timer modules. Each timer has two signaling modes and internal or external clocking. Y ou can use the timer modules to signal to the ’C3x or the external world at specified intervals or to count external events. With an internal clock, the timer can signal an external A/D converter ...

  • Texas Instruments TMS320C3x - page 382

    Timers 12-3 Peripherals 12.1.1 Timer Pins Each timer has one pin associated with the timer clock signal (TCLK) pin. This pin (TCK) is used as a general-purpose I/0 signal, as a timer output, or as an input for an external clock for a timer . Each timer has a TCLK pin: TCLK0 is connected to timer0, TCLK1 to timer1. 12.1.2 Timer Control Registers Thr ...

  • Texas Instruments TMS320C3x - page 383

    Timers 12-4 Figure 12–2. Memory-Mapped Timer Locations T imer0 global control † T imer0 counter ‡ T imer0 period ‡ T imer1 global control † T imer1 counter ‡ T imer1 period ‡ 808020h 808034h 808024h 808028h 808030h 808038h ‡ See Section 12.1.4 † See Section 12.1.3 12.1.3 Timer Global-Control Register The timer global-control regis ...

  • Texas Instruments TMS320C3x - page 384

    Timers 12-5 Peripherals T able 12–1. Timer Global-Control Register Bits Summary Abbreviation Reset V alue Name Description FUNC 0 Function Controls the function of TCLK. If FUNC = 0, TCLK is configured as a general-purpose digital I/O port. If FUNC = 1, TCLK is configured as a timer pin. See section 12.1.6 Timer Operation Modes on page 12-10 for ...

  • Texas Instruments TMS320C3x - page 385

    Timers 12-6 T able 12–1. Timer Global-Control Register Bits Summary (Continued) Abbreviation Description Name Reset V alue C/P 0 Clock/pulse mode control When C/P = 1, clock mode is chosen, and the signal- ing of the TST A T flag and external output has a 50% duty cycle. When C/P = 0, the status flag and external output will be active for one H1 ...

  • Texas Instruments TMS320C3x - page 386

    Timers 12-7 Peripherals 12.1.4 Timer-Period and Counter Registers The 32-bit timer-period register is used to specify the frequency of the timer signaling. The timer-counter register is a 32-bit register , which is reset to 0 whenever it increments to the value of the period register . Both registers are set to 0 at reset. Certain boundary conditio ...

  • Texas Instruments TMS320C3x - page 387

    Timers 12-8 Figure 12–4. Timer Timing 2/f(H1) 1/f(H1) 1/f(CLKSRC) period register/f(CLKSRC) period register/f(CLKSRC) 2 x period register/f(CLKSRC) (a) TST A T and timer output (INV = 0) when C/P = 0 (pulse mode) (b) TST A T and timer output (INV = 0) when C/P = 1 (clock mode) 1/f(CLKSRC) 2/f(H1) TINT TINT TINT TINT TINT The timer signaling is de ...

  • Texas Instruments TMS320C3x - page 388

    Timers 12-9 Peripherals Example 12–1. Timer Output Generation Examples 2H1 2H1 H1 (a) INV = 0, C/P = 0 (pulse mode) timer period = 1 Also, 4H1 H1 (b) INV = 0, C/P = 0 (pulse mode) timer period = 2 6H1 H1 (c) INV = 0, C/P = 0 (pulse mode) timer period = 3 4H1 (d) INV = 0, C/P = 1 (clock mode) timer period = 1 8H1 4H1 (e) INV = 0, C/P = 1 (clock mo ...

  • Texas Instruments TMS320C3x - page 389

    Timers 12-10 12.1.6 Timer Operation Modes The timer can receive its input and send its output in several different modes, depending upon the setting of CLKSRC, FUNC, and I /O. The four timer modes of operation are defined in the following sections. 12.1.6.1 CLKSRC = 1 and FUNC = 0 If CLKSRC = 1 and FUNC = 0, the timer input comes from the internal ...

  • Texas Instruments TMS320C3x - page 390

    Timers 12-1 1 Peripherals 12.1.6.2 CLKSRC = 1 and FUNC = 1 If CLKSRC = 1 and FUNC = 1 (see Figure 12–6), the timer input comes from the internal clock, and the timer output goes to TCLK. This value can be inverted using INV , and you can read in DA TIN the value output on TCLK. Figure 12–6. Timer Configuration with CLKSRC = 1 and FUNC = 1 In Ou ...

  • Texas Instruments TMS320C3x - page 391

    Timers 12-12 12.1.6.4 CLKSRC = 0 and FUNC = 1 If CLKSRC = 0 and FUNC = 1 (see Figure 12–8), TCLK drives the timer . If INV = 0, all 0-to-1 transitions of TCLK increment the counter . If INV = 1, all 1-to-0 transitions of TCLK increment the counter . Y ou can read in DA TIN the value of TCLK. Figure 12–8. Timer Configuration with CLKSRC = 0 and ...

  • Texas Instruments TMS320C3x - page 392

    Timers 12-13 Peripherals 12.1.8 Timer Interrupts A timer interrupt is generated whenever the TST A T bit of the timer control register changes from a 0 to a 1. The frequency of timer interrupts depends on whether the timer is set up in pulse mode or clock mode. In pulse mode, the interrupt frequency is determined by the following equation: = period ...

  • Texas Instruments TMS320C3x - page 393

    Timers 12-14 2) Configure the timer through the timer global-control register (with GO = HLD = 0 ), the timer-counter register , and timer-period register , if necessary . 3) Start the timer by setting the GO/HLD bits of the timer global-control register . Example 12–2 shows how to set up the ‘C3x timer to generate the maximum clock frequency t ...

  • Texas Instruments TMS320C3x - page 394

    Serial Ports 12-15 Peripherals 12.2 Serial Ports The ’C30 has two totally independent bidirectional serial ports. Both serial ports are identical, and there is a complementary set of control registers in each one. Only one serial port is available on the ’C31 and the ’C32. Y ou can configure each serial port to transfer 8, 16, 24, or 32 bits ...

  • Texas Instruments TMS320C3x - page 395

    Serial Ports 12-16 Figure 12–1 1. Serial Port Block Diagram Receive Section Transmit Section Receive timer (16) Transmit timer (16) Bit counter (8/16/24/32) Bit counter (8/16/24/32) RSR (32) XSR (32) DRR (32) DXR (32) Load control Load control CLKR CLKX TST A T CLKR CLKX TST A T Receive Clock RINT FSR FSR FSX FSX Load DX DR DR Load DX DX XINT ...

  • Texas Instruments TMS320C3x - page 396

    Serial Ports 12-17 Peripherals Figure 12–12. Memory-Mapped Locations for the Serial Ports Serial-port 0 global control Serial port 0 FSR/DR/CLKR control § Serial port 0 R/X timer control ¶ Serial port 0 R/X timer counter # Serial port 0 R/X timer period Serial port 0 data transmit 808040h 808042h 808043h 808044h 808045h 808046h 808048h 80804Ch ...

  • Texas Instruments TMS320C3x - page 397

    Serial Ports 12-18 Figure 12–13. Serial-Port Global-Control Register 28 RRESET RTINT XINT XTINT 31 30 29 27 26 25 24 23 22 21 20 19 18 17 16 RLEN XLEN FSRP FSXP R/W R/W R/W R/W R/W R/W R/W R/W R/W R/W R/W CLKXP RFSM XFSM RCLK XCLK 15 14 13 12 1 1 10 9 8 7 6 5 4 3 2 1 0 HS RSR XSR FSXOUT XRDY RRDY SRCE SRCE FULL EMPTY R/W R/W R/W R/W R/W R/W R R R ...

  • Texas Instruments TMS320C3x - page 398

    Serial Ports 12-19 Peripherals T able 12–2. Serial-Port Global-Control Register Bits Summary (Continued) Abbreviation Description Name Reset V alue HS 0 Handshake If HS = 1, the handshake mode is enabled. If HS = 0, the handshake mode is disabled. XCLK SRCE 0 T ransmit clock source If XCLK SRCE = 1, the internal transmit clock is used. If XCLK SR ...

  • Texas Instruments TMS320C3x - page 399

    Serial Ports 12-20 T able 12–2. Serial-Port Global-Control Register Bits Summary (Continued) Abbreviation Description Name Reset V alue CLKRP 0 CLKR polarity If CLKRP = 0, CLKR is active (high). If CLKRP = 1, CLKR is active (low). DXP 0 DX polarity If DXP = 0, DX is active (high). If DXP = 1, DX is active (low). DRP 0 DR polarity If DRP = 0, DR i ...

  • Texas Instruments TMS320C3x - page 400

    Serial Ports 12-21 Peripherals T able 12–2. Serial-Port Global-Control Register Bits Summary (Continued) Abbreviation Description Name Reset V alue RINT 0 Receive interrupt enable If RINT = 0, the receive interrupt is disabled. If RINT = 1, the receive interrupt is enabled. Note: The CPU receive interrupt flag RINT and the serial- port-to-DMA int ...

  • Texas Instruments TMS320C3x - page 401

    Serial Ports 12-22 12.2.2 FSX/DX/CLKX Port-Control Register This 32-bit port-control register controls the function of the serial port FSX, DX, and CLKX pins. The register is shown in Figure 12–14. T able 12–3 shows the register bits, bit names, and bit functions. Figure 12–14. FSX/DX/CLKX Port-Control Register 31–16 15–12 1 1 10 9 8 7 6 ...

  • Texas Instruments TMS320C3x - page 402

    Serial Ports 12-23 Peripherals T able 12–3. FSX/DX/CLKX Port-Control Register Bits Summary (Continued) Abbreviation Description Name Reset V alue FSX FUNC 0 FSX function Controls the function of FSX. If FSX FUNC = 0, FSX is configured as a general-purpose digital I/O port. If FSX FUNC = 1, FSX is configured as a serial port pin. FSX I/O 0 FSX inp ...

  • Texas Instruments TMS320C3x - page 403

    Serial Ports 12-24 T able 12–4. FSR/DR/CLKR Port-Control Register Bits Summary Abbreviation Reset V alue Name Description CLKR FUNC 0 Clock receive function Controls the function of CLKR. If CLKR FUNC = 0, CLKR is configured as a general-purpose digital I/O port. If CLKR FUNC = 1, CLKR is configured as a serial port pin. CLKR I/O 0 Clock receive ...

  • Texas Instruments TMS320C3x - page 404

    Serial Ports 12-25 Peripherals 12.2.4 Receive/T ransmit Timer-Control Register A 32-bit receive/transmit timer-control register contains the control bits for the timer module. At reset, all bits are set to 0. Figure 12–16 shows the register . Bits 5 –0 control the transmitter timer . Bits 1 1 – 6 control the receiver timer . The serial port r ...

  • Texas Instruments TMS320C3x - page 405

    Serial Ports 12-26 T able 12–5. Re c ei ve /T r an s mi t Ti me r - Co n tr ol R e gi s te r Re gi st er B it s Su mm ar y ( Co nt i nu ed ) Abbreviation Function Name Reset V alue XCLKSRC 0 T ransmit clock source Specifies the source of the transmit timer clock. When XCLKSRC = 1, an internal clock with frequency equal to one-half the CLKOUT freq ...

  • Texas Instruments TMS320C3x - page 406

    Serial Ports 12-27 Peripherals T able 12–5. Re c ei ve /T r an s mi t Ti me r - Co n tr ol R e gi s te r Re gi st er B it s Su mm ar y ( C on t in ue d) Abbreviation Function Name Reset V alue RCLKSRC 0 Receive timer clock source Specifies the source of the receive timer clock. When RCLKSRC = 1, an internal clock with frequency equal to one-half ...

  • Texas Instruments TMS320C3x - page 407

    Serial Ports 12-28 12.2.6 Receive/T ransmit Timer-Period Register The receive/transmit timer-period register is a 32-bit register (see Figure 12–18 ). Bits 15 –0 are the timer transmit period, and bits 31 –16 are the receive period. Each register specifies the period of the timer and is cleared to 0 at reset . Figure 12–18. Receive/T ransmi ...

  • Texas Instruments TMS320C3x - page 408

    Serial Ports 12-29 Peripherals Data is shifted to the left (LSB to MSB). Figure 12–20 illustrates what happens when words less than 32 bits are shifted into the serial port. In this figure, it is assumed that an 8-bit word is being received and that the upper three bytes of the receive buffer are originally undefined. In the first portion of the ...

  • Texas Instruments TMS320C3x - page 409

    Serial Ports 12-30 Figure 12–21. Serial-Port Clocking in I/O Mode TST A T Timer in XSR T imer in XSR T imer in XSR T imer in XSR TST A T TST A T TST A T DA TIN DA TOUT DA TOUT (NC) DA TIN DA T AOUT DA TIN DA TOUT (NC) DA TIN Internal CLKX CLKX CLKX FUNC= 0 (I/O mode) CLKX I /O = 0 (CLKX, an input) XCLK SRC = 1 (internal CLK for timer) (c) CLKX FU ...

  • Texas Instruments TMS320C3x - page 410

    Serial Ports 12-31 Peripherals Figure 12–22. Serial-Port Clocking in Serial-Port Mode CLKX FUNC = 1 (serial-port mode) CLKX I /O = 1 (output serial-port CLK) XCLK SRC = 0 or 1 (a) TST A T TST A T TST A T T imer Timer T imer XSR XSR XSR Internal CLKX CLKX CLKX INV INV INV Internal clock Internal clock DA TOUT (NC) DA TIN DA TOUT (NC) DA TIN DA TOU ...

  • Texas Instruments TMS320C3x - page 411

    Serial Ports 12-32 The transmit ready (XRDY) signal specifies that the data-transmit register (DXR) is available to be loaded with new data. XRDY goes active as soon as the data is loaded into the transmit-shift register (XSR). The last word may still be shifting out when XRDY goes active. If DXR is loaded before the last word has completed transmi ...

  • Texas Instruments TMS320C3x - page 412

    Serial Ports 12-33 Peripherals 12.2.10.1 Continuous Transmit and Receive Modes When you choose continuous mode, consecutive writes do not generate or expect new sync pulse signaling. Only the first word of a block begins with an active synchronization. Thereafter , data is transmitted as long as new data is loaded into DXR before the last word has ...

  • Texas Instruments TMS320C3x - page 413

    Serial Ports 12-34 When the serial port is placed in the handshake mode, the insertion and deletion of a leading 1 for transmitted data, the sending of a 0 for acknowledgement of received data, and the waiting for this acknowledge bit are all performed auto- matically . Using this scheme, it is simple to connect processors with no external hardware ...

  • Texas Instruments TMS320C3x - page 414

    Serial Ports 12-35 Peripherals 12.2.12 Serial-Port Functional Operation The following paragraphs and figures illustrate the functional timing of the various serial-port modes of operation. The timing descriptions are presented with the assumption that all signal polarities are configured to be positive (that is, CLKXP = CLKRP = DXP = DRP = FSXP = F ...

  • Texas Instruments TMS320C3x - page 415

    Serial Ports 12-36 12.2.12.1 Fixed Data-Rate Timing Operation Fixed data-rate serial-port transfers can occur in two varieties: burst mode and continuous mode. In burst mode, transfers of single words are separated by periods of inactivity on the serial port. In continuous mode, there are no gaps between successive word transfers; the first bit of ...

  • Texas Instruments TMS320C3x - page 416

    Serial Ports 12-37 Peripherals Figure 12–27. Fixed Standard Mode With Back-to-Back Frame Sync A1 AN B1 BN C1 DXR loaded with A XINT DXR loaded with B XINT RINT XINT RINT CLKX/R FSX (Internal) FSR/FSX (External) DR/DX Load DXR with C read DRR Load DXR with Dread DRR R/XV AREN = 0 R/XFSM = 0 For receive operations and with externally generated FSX, ...

  • Texas Instruments TMS320C3x - page 417

    Serial Ports 12-38 sync inputs are ignored. Additionally , you should set R/XFSM prior to or during the first word transferred; you must set R/XFSM no later than the transfer of the N –1 bit of the first word, except for transmit operations. For transmit operations in the fixed data-rate mode, XFSM must be set no later than the N –2 bit. Y ou m ...

  • Texas Instruments TMS320C3x - page 418

    Serial Ports 12-39 Peripherals Figure 12–29. Exiting Fixed Continuous Mode Without Frame Sync, FSX Internal CLKX FSX (internal) DX LOAD DXR SET XFSM RESET XFSM A1 AN B1 BN C1 CN D1 DN E1 EN F1 FN 1st word 2nd word 3rd word 4th word 5th word 12.2.12.2 Variable Data-Rate T iming Operation The following variations are included in variable data-rate ...

  • Texas Instruments TMS320C3x - page 419

    Serial Ports 12-40 V ariable Standard Mode When you transmit continuously in variable data-rate mode with frame sync, timing is the same as for fixed data-rate mode, except for the differences be tw ee n these two modes as described in Section 12.2.12 Serial-Port Functional Operation , on page 12-35. The only other exception is that you must reload ...

  • Texas Instruments TMS320C3x - page 420

    Serial Ports 12-41 Peripherals Figure 12–32. V ariable Continuous Mode Without Frame Sync CLKX/R FSR/FSX (external) FSX (internal) DX/DR A1 AN B1 BN C1 C2 XINT RINT Load DXR with D read DRR Set R/XFS M DXR loaded with B XINT DXR loaded with A XINT RINT Load DXR with C read DRR R/XV AREN = 1 R/XFSM = 1 12.2.13 Serial-Port Initialization/Reconfigur ...

  • Texas Instruments TMS320C3x - page 421

    Serial Ports 12-42 12.2.14.1 Handshake Mode Example When using the handshake mode, the transmit (FSX/DS/CLKX) and receive (FSR/DR/CLKR) signals transmit and receive data, respectively . Even if the ’C3x serial port is receiving data only with handshake mode, the transmit signals are still needed to transmit the acknowledge signal. Example 12–3 ...

  • Texas Instruments TMS320C3x - page 422

    Serial Ports 12-43 Peripherals Example 12–4 and Example 12–5 are serial-port register setups for the above case. (Assume two ’C3xs have the same system clock.) Example 12–4. Serial-Port Register Setup #1 Global control = 0EBC0064h; 32 bits, fixed data rate, burst mode, Transmit port control = 0111h ; FSX (output), CLKX (output) = F(CLKIN)/8 ...

  • Texas Instruments TMS320C3x - page 423

    Serial Ports 12-44 Example 12–6. CPU T ransfer With Serial Port T ransmit Polling Method * TITLE: CPU TRANSFER WITH SERIAL-PORT TRANSMIT POLLING METHOD * .GLOBAL START .DATA SOURCE .WORD _ARRAY .BSS _ARRAY,128 ; DATA ARRAY LOCATED IN .BSS SECTION ; THE UNDERSCORE USED IS JUST TO MAKE IT ; ACCESSIBLE FROM C (OPTIONAL) SPORT .WORD 808040H ; SERIAL- ...

  • Texas Instruments TMS320C3x - page 424

    Serial Ports 12-45 Peripherals 12.2.14.3 DMA Transfer With Serial Port Interrupt Example 12–8 and Example 12–9 of Section 12.3.1 1 on page 12-74 use the DMA synchronized to serial port interrupts to transfer data (128 words) from an array buffer to the serial port0 output register . 12.2.14.4 Serial Analog Interface Chips Interface Example The ...

  • Texas Instruments TMS320C3x - page 425

    Serial Ports 12-46 12.2.14.5 Serial Analog-to-Digital (A/D) and Digital-to-Analog (D/A) Interface Example The DSP201/2 and DSP101/2 family of D/As and A/Ds from Burr Brown also offer a zero-glue-logic interface to the ’C3x family of DSPs. The interface is shown in Example 12–7. This interface is used as an example of the ’C3x serial port conf ...

  • Texas Instruments TMS320C3x - page 426

    Serial Ports 12-47 Peripherals 4) The bit clock drives both the A/D’ s and D/A ’s XCLK input. 5) The ’C3x transmit clock also acts as the input clock on the receive side of the ’C3x serial port. 6) Since the receive clock is synchronous to the internal clock of the ’C3x, the receive clock can run at full speed (that is, f(H1)/2). Similarl ...

  • Texas Instruments TMS320C3x - page 427

    DMA Controller 12-48 12.3 DMA Controller The DMA controller is a programmable peripheral that transfers blocks of data to any location in the memory map without interfering with CPU operation. The ’C3x can interface to slow , external memories and peripherals without reducing throughput to the CPU. The ’C3x DMA controller features are: Transfer ...

  • Texas Instruments TMS320C3x - page 428

    DMA Controller 12-49 Peripherals 12.3.1.1 TMS320C30 and TMS320C31 DMA Controller The ’C30 and ’C31 have an on-chip direct memory access (DMA) controller that reduces the need for the CPU to perform input/output functions. The DMA controller can perform input/output operations without interfering with the operation of the CPU. Therefore, it is p ...

  • Texas Instruments TMS320C3x - page 429

    DMA Controller 12-50 12.3.2 DMA Basic Operation If a block of data is to be transferred from one region in memory to another region in memory (as shown in Figure 12–34), the following sequence is performed: DMA Registers Initialization 1) The source-address register of a DMA channel is loaded with the address of the memory location to read from. ...

  • Texas Instruments TMS320C3x - page 430

    DMA Controller 12-51 Peripherals After the completion of a block transfer , the DMA controller can be programmed to do several things: Stop until reprogrammed (TC = 1) Continue transferring data (TC = 0) Generate an interrupt to signal the CPU that the block transfer is complete (TCINT = 1) The DMA can be stopped by setting the ST ART bits to 00, 0 ...

  • Texas Instruments TMS320C3x - page 431

    DMA Controller 12-52 At reset, each DMA-channel control register is set to 0. This makes the DMA channels lower-priority than the CPU, sets up the source address and destination address to be calculated through linear addressing, and configures the DMA channel in the unified mode. Figure 12–35. Memory-Mapped Locations for DMA Channels Address Reg ...

  • Texas Instruments TMS320C3x - page 432

    DMA Controller 12-53 Peripherals 12.3.3.1 DMA Global-Control Register The global-control register controls the state in which the DMA controller operates. This register also indicates the status of the DMA, which changes every cycle. Source and destination addresses can be incremented, decrem- ented, or synchronized using specified global-control r ...

  • Texas Instruments TMS320C3x - page 433

    DMA Controller 12-54 T able 12–6. DMA Global-Control Register Bits Summary Abbreviation Reset V alue Name Description ST ART 00 DMA start control Controls the state in which the DMA starts and stops. The DMA may be stopped without any loss of data. The following table summarizes the ST ART bits and DMA operation: Bit 1 Bit 0 Function 0 0 DMA read ...

  • Texas Instruments TMS320C3x - page 434

    DMA Controller 12-55 Peripherals T able 12–6. DMA Global-Control Register Bits Summary (Continued) Abbreviation Reset V alue Name Description INCSRC 0 DMA source address increment mode If INCSRC = 1, the source address is incremented after every read. DECSRC 0 DMA source address decrement mode If DECSRC = 1, the source address is decremented afte ...

  • Texas Instruments TMS320C3x - page 435

    DMA Controller 12-56 T able 12–6. DMA Global-Control Register Bits Summary (Continued) Abbreviation Reset V alue Name Description DMA0 PRI 00 CPU/DMA channel 0 priority mode (on the DMA0 control register) (’C32 only) DMA1 PRI 00 CPU/DMA channel 1 priority mode (on the DMA1 control register) (‘C32 only) Configures CPU/DMA controller priority . ...

  • Texas Instruments TMS320C3x - page 436

    DMA Controller 12-57 Peripherals 12.3.3.2 Destination-Address and Source-Address Registers The DMA destination-address and source-address registers are 24-bit registers whose contents specify destination and source addresses. As specified by control bits DECSRC, INCSRC, DECDST , and INCDST of the DMA global- control register , these registers are i ...

  • Texas Instruments TMS320C3x - page 437

    DMA Controller 12-58 12.3.3.3 Transfer-Counter Register The transfer-counter register is a 24-bit register that contains the number of words to be transmitted. Figure 12–40 shows the transfer-counter operation. It is controlled by a 24-bit counter that decrements at the beginning of a DMA memory write. In this way , it can control the size of a b ...

  • Texas Instruments TMS320C3x - page 438

    DMA Controller 12-59 Peripherals Figure 12–40. T ransfer-Counter Operation Halt ? TC=1 Is DMA interrupt generated ? TCINT=1 Is ? to 0 Compare Decrementer T ransfer-counter register Ye s Ye s No No Ye s No 12.3.4 CPU/DMA Interrupt-Enable Register The CPU/DMA interrupt-enable register (IE) is a 32-bit register located in the CPU register file. The ...

  • Texas Instruments TMS320C3x - page 439

    DMA Controller 12-60 Figure 12–41. TMS320C30 and TMS320C31 CPU/DMA Interrupt-Enable Register xx EDINT ETINT1 ETINT0 ERINT1 EXINT1 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 xx xx xx xx ERINT0 EXINT0 EINT3 EINT2 EINT1 EINT0 (DMA) (DMA) (DMA) (DMA) (DMA) (DMA) (DMA) (DMA) (DMA) (DMA) (DMA) R/W R/W R/W R/W R/W R/W R/W R/W R/W R/W R/W xx EDINT E ...

  • Texas Instruments TMS320C3x - page 440

    DMA Controller 12-61 Peripherals T able 12–7. CPU/ DMA Interrupt -Enable Regist er Bits Abbreviation Reset V alue Description EINT0 (CPU) 0 CPU external interrupt 0 enable EINT1 (CPU) 0 CPU external interrupt 1 enable EINT2 (CPU) 0 CPU external interrupt 2 enable EINT3 (CPU) 0 CPU external interrupt 3 enable EXINT0 (CPU) 0 CPU serial port 0 trans ...

  • Texas Instruments TMS320C3x - page 441

    DMA Controller 12-62 T able 12–7. CPU/DM A Interrupt-Enable R egister Bits (C ontinued) Abbreviation Description Reset V alue ETINT0 (DMA) 0 DMA timer0 interrupt enable (’C30 and ’C31) ETINT1 (DMA) 0 DMA timer1 interrupt enable (’C30 and ’C31 only) ETINT0 (DMA0) 0 DMA0 timer1 interrupt enable (’C32 only) ETINT1 (DMA0) 0 DMA0 timer1 inte ...

  • Texas Instruments TMS320C3x - page 442

    DMA Controller 12-63 Peripherals 12.3.5.2 Rotating Priority Scheme In a rotating priority scheme, the last channel serviced becomes the lowest priority channel. The other channel sequentially rotates through the priority list with the lowest channel next to the last-serviced channel becoming the highest priority on the following request. The priori ...

  • Texas Instruments TMS320C3x - page 443

    DMA Controller 12-64 T able 12–8. TMS320C32 DMA PRI Bits and CPU/DMA Arbitration Rules DMA PRI (Bits 13–12) Description 0 0 DMA access is lower priority than the CPU access. If the DMA channel and the CPU request the same resource, then the CPU has priority . (DMA PRI bits are set to 00 2 at reset.) 0 1 This setting selec ts rotating arbitratio ...

  • Texas Instruments TMS320C3x - page 444

    DMA Controller 12-65 Peripherals The DMA and the CPU can respond to the same interrupt if the CPU is not involved in any pipeline conflict or in any instruction that halts instruction fetching. Refer to section 7.6.2 , Interrupt Vector T able and Prioritization , on page 7-29 for more details. It is also possible for different DMA channels to respo ...

  • Texas Instruments TMS320C3x - page 445

    DMA Controller 12-66 Figure 12–44. Mechanism for DMA Source Synchronization Start Disable DMA interrupts globally DMA channel performs a read DMA channel performs a write Go to start Enable DMA interrupts globally Idle until enabled interrupt is received Clear corresponding IF bit Destination synchronization (SYNC = 1 0) When SYNC = 1 0, the DMA ...

  • Texas Instruments TMS320C3x - page 446

    DMA Controller 12-67 Peripherals Source and destination synchronization (SYNC = 1 1) When SYNC = 1 1, the DMA is synchronized to both the source and destination. A read is performed when an interrupt is received. Then, a write is performed on the following interrupt. Figure 12–46 shows source and destination synchronization when SYNC = 1 1. Figur ...

  • Texas Instruments TMS320C3x - page 447

    DMA Controller 12-68 The data transfer rate for a DMA channel (assuming a single-channel access with no conflicts between CPU or other DMA channels) is as follows: On-chip memory and peripheral DMA read: One cycle DMA write: One cycle External memory (STRB , STRB0, STRB1 , MSTRB) DMA read: T wo cycles (one cycle external read followed by one cycle ...

  • Texas Instruments TMS320C3x - page 448

    DMA Controller 12-69 Peripherals Figure 12–47. DMA Timing When Destination is On Chip Cycles (H1) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 Rate Source on chip R 1 R 2 R 3 R 4 R 5 R 6 R 7 R 8 ( 1+1 ) T Destination on chip W 1 W 2 W 3 W 4 W 5 W 6 W 7 (1 + 1) T Source STRB STRB0 STRB1 MSTRB bus R 1 R 1 R 1 I R 2 R 2 R 2 I R 3 R 3 R 3 I Source ST ...

  • Texas Instruments TMS320C3x - page 449

    DMA Controller 12-70 Figure 12–48. DMA Timing When Destination is an STRB, STRB0, STRB1, MSTRB Bus Cycles (H1) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 Rate Source on chip R 1 R 2 R 3 R 4 R 5 Destination STRB, STRB0, W 1 W 1 W 1 W 1 W 2 W 2 W 2 W 2 W 3 W 3 W 3 W 3 W 4 W 4 W 4 W 4 . . . ( 1 + 2 + C w ) T STRB1, MSTRB bus C w C w C w C w Sou ...

  • Texas Instruments TMS320C3x - page 450

    DMA Controller 12-71 Peripherals Figure 12–48. DMA Timing When Destination is an STRB, STRB0, STRB1, MSTRB Bus (Continued) Cycles (H1) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 Rate Source IOSTRB R 1 R 1 R 1 R 1 I R 2 R 2 R 2 R 2 I † IOSTRB bus C w C w † Destination STRB0, STRB1, or MSTRB bus W 1 W 1 W 1 W 1 W 2 W 2 W 2 W 2 (3 + C r + 2 + ...

  • Texas Instruments TMS320C3x - page 451

    DMA Controller 12-72 Figure 12–49. DMA Timing When Destination is an IOSTRB Bus Cycles (H1) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 Rate Source on chip R 1 R 2 R 3 R 4 R 5 Destination IOSTRB W 1 W 1 W 1 W 1 W 2 W 2 W 2 W 2 W 3 W 3 W 3 W 3 W 4 W 4 W 4 W 4 1+( 2+C w ) T Destination IOSTRB C w C w C w C w 1 + (2 + C w ) T (’ C3 0 o nl y ) Sou ...

  • Texas Instruments TMS320C3x - page 452

    DMA Controller 12-73 Peripherals 12.3.9 DMA Initialization/Reconfiguration Y ou can control the DMA through memory-mapped registers located on the dedicated peripheral bus. Following is the general procedure for initializing and/or reconfiguring the DMA: 1) Halt the DMA by clearing the ST ART bits of the DMA global-control register . Y ou can do th ...

  • Texas Instruments TMS320C3x - page 453

    DMA Controller 12-74 The transfer counter has a zero value. However , the transfer counter is decremented after the DMA read operation finishes (not after the write operation). Nevertheless, a transfer counter with a 0 value can be used as an indication of a transfer completion. The ST A T bits in the DMA channel-control register are set to 00 2 . ...

  • Texas Instruments TMS320C3x - page 454

    DMA Controller 12-75 Peripherals Example 12–8. Array Initialization With DMA * TITLE: ARRAY INITIALIZATION WITH DMA * .GLOBAL START .DATA DMA .WORD 808000H ; DMA GLOBAL-CONTROL REG ADDRESS RESET .WORD 0C40H ; DMA GLOBAL-CONTROL REG RESET VALUE CONTROL .WORD 0C43H ; DMA GLOBAL-CONTROL REG INITIALIZATION SOURCE .WORD ZERO ; DATA SOURCE ADDRESS DEST ...

  • Texas Instruments TMS320C3x - page 455

    DMA Controller 12-76 Example 12–9. DMA T ransfer With Serial-Port Receive Interrupt * TITLE DMA TRANSFER WITH SERIAL PORT RECEIVE INTERRUPT * .GLOBAL START .DATA DMA .WORD 808000H ; DMA GLOBAL-CONTROL REG ADDRESS CONTROL .WORD 0D43H ; DMA GLOBAL-CONTROL REG INITIALIZATION SOURCE .WORD 80804CH ; DATA SOURCE-ADDRESS: SERIAL PORT INPUT REG DESTIN .W ...

  • Texas Instruments TMS320C3x - page 456

    DMA Controller 12-77 Peripherals Example 12–10 sets up the DMA to transfer data (128 words) from an array buffer to the serial port 0 output register with serial port transmit interrupt XINT0. The DMA sends an interrupt to the CPU when the data transfer completes. Serial port 0 is initialized to transmit 32-bit data words with an internally gener ...

  • Texas Instruments TMS320C3x - page 457

    DMA Controller 12-78 Example 12–10. DMA T ransfer With Serial-Port T ransmit Interrupt (Continued) * DMA INITIALIZATION LDI @DMA,AR0 ; POINT TO DMA GLOBAL CONTROL REGISTER LDI @SPORT,AR1 LDI @RESET,R0 STI R0,*+AR1(4) ; RESET SPORT TIMER STI R0,*AR0 ; RESET DMA STI R0,*AR1 ; RESET SPORT LDI @SOURCE,R0 ; INITIALIZE DMA SOURCE-ADDRESS REGISTER STI R ...

  • Texas Instruments TMS320C3x - page 458

    DMA Controller 12-79 Peripherals T ransfer a 128-word block of data from on-chip memory to off-chip memory and generate an interrupt on completion. Invert the memory or- der; the highest addressed member of the block is to become the lowest addressed member . DMA source address: 809800h DMA destination address: 800000h DMA transfer counter: 0000008 ...

  • Texas Instruments TMS320C3x - page 459

    13-1 Assembly Language Instructions The ’C3x assembly language instruction set supports numeric-intensive, signal- processing, and general-purpose applications. (The addressing modes used with the instructions are described in Chapter 5 .) The ’C3x instruction set can also use one of 20 condition codes with any of the 10 conditional instruction ...

  • Texas Instruments TMS320C3x - page 460

    Instruction Set 13-2 13.1 Instruction Set The ’C3x instruction set is well suited to digital signal processing and other numeric-intensive applications. All instructions are a single machine word long, and most instructions require one cycle to execute. In addition to multiply and accumulate instructions, the ’C3x possesses a full complement of ...

  • Texas Instruments TMS320C3x - page 461

    Instruction Set 13-3 Assembly Language Instructions 13.1.2 2-Operand Instructions The ’C3x supports 35 2-operand arithmetic and logical instructions. The two operands are the source and destination. The source operand can be a memory word, a register , or a part of the instruction word. The destination operand is always a register . As shown in T ...

  • Texas Instruments TMS320C3x - page 462

    Instruction Set 13-4 13.1.3 3-Operand Instructions Whereas 2-operand instructions have a single source operand (or shift count ) and a destination operand, 3-operand instructions can have two source operands (or one source operand and a count operand) and a destination operand. A source operand can be a memory word or a register . The destination o ...

  • Texas Instruments TMS320C3x - page 463

    Instruction Set 13-5 Assembly Language Instructions T able 13–4. Program-Control Instructions Instruction Description Instruction Description B cond Branch conditionally (standard) IDLE Idle until interrupt B cond D Branch conditionally (delayed) NOP No operation BR Branch unconditionally (standard) RETI cond Return from interrupt conditionally B ...

  • Texas Instruments TMS320C3x - page 464

    Instruction Set 13-6 T able 13–6. Interlocked-Operations Instructions Instruction Description Instruction Description LDFI Load floating-point value, interlocked STFI Store floating-point value, interlocked LDII Load integer , interlocked STII Store integer , interlocked SIGI Signal, interlocked 13.1.7 Parallel-Operations Instructions The 13 para ...

  • Texas Instruments TMS320C3x - page 465

    Instruction Set 13-7 Assembly Language Instructions T able 13–7. Parallel Instructions (Continued) (a) Parallel arithmetic with store instructions (Continued) Mnemonic Description FLOA T || STF Convert integer to floating-point value and store floating- point value LDF || STF Load floating-point value and store floating-point value LDI || STI Loa ...

  • Texas Instruments TMS320C3x - page 466

    Instruction Set 13-8 T able 13–7. Parallel Instructions (Continued) (b) Parallel load instructions Mnemonic Description LDF || LDF Load floating-point value LDI || LDI Load integer (c) Parallel multiply and add/subtract instructions Mnemonic Description MPYF3 || ADDF3 Multiply and add floating-point value MPYF3 || SUBF3 Multiply and subtract floa ...

  • Texas Instruments TMS320C3x - page 467

    Instruction Set 13-9 Assembly Language Instructions 13.1.8 Illegal Instructions The ’C3x has no illegal instruction-detection mechanism. Fetching an illegal (undefined) opcode can cause the execution of an undefined operation. Proper use of the TI TMS320 floating-point software tools will not generate an illegal opcode. Only the following conditi ...

  • Texas Instruments TMS320C3x - page 468

    Instruction Set Summary 13-10 13.2 Instruction Set Summary T able 13–8 lists the ’C3x instruction set in alphabetical order . Each table entry provides the instruction mnemonic, description, and operation. T able 13–8. Instruction Set Summary Mnemonic Description Operation ABSF Absolute value of a floating-point number | src | → R n ABSI Ab ...

  • Texas Instruments TMS320C3x - page 469

    Instruction Set Summary 13-1 1 Assembly Language Instructions T able 13–8. Instruction Set Summary (Continued) Mnemonic Operation Description B cond Branch conditionally (standard) If cond = true: If C src is a register , C src → PC If C src is a value, C src + PC → PC Else, PC + 1 → PC B cond D Branch conditionally (delayed) If cond = true ...

  • Texas Instruments TMS320C3x - page 470

    Instruction Set Summary 13-12 T able 13–8. Instruction Set Summary (Continued) Mnemonic Operation Description DB cond Decrement and branch conditionally (standard) AR n – 1 → AR n If cond = true and AR n ≥ 0: If C src is a register , C src → PC If C src is a value, C src + PC + 1 → PC Else, PC + 1 → PC DB cond D Decrement and branch c ...

  • Texas Instruments TMS320C3x - page 471

    Instruction Set Summary 13-13 Assembly Language Instructions T able 13–8. Instruction Set Summary (Continued) Mnemonic Operation Description LDI cond Load integer conditionally If cond = true, src → Dreg Else, Dreg is not changed LDII Load integer , interlocked Signal interlocked operation src → Dreg LDM Load floating-point mantissa src (mant ...

  • Texas Instruments TMS320C3x - page 472

    Instruction Set Summary 13-14 T able 13–8. Instruction Set Summary (Continued) Mnemonic Operation Description NOP No operation Modify AR n if specified NORM Normalize floating-point value Normalize ( src ) → R n NOT Bitwise-logical complement src → Dreg OR Bitwise-logical OR Dreg OR src → Dreg OR3 Bitwise-logical OR (3-operand) src 1 OR src ...

  • Texas Instruments TMS320C3x - page 473

    Instruction Set Summary 13-15 Assembly Language Instructions T able 13–8. Instruction Set Summary (Continued) Mnemonic Operation Description RPTB Repeat block of instructions src → RE 1 → ST (RM) Next PC → RS RPTS Repeat single instruction src → RC 1 → ST (RM) Next PC → RS Next PC → RE SIGI Signal, interlocked Signal interlocked ope ...

  • Texas Instruments TMS320C3x - page 474

    Instruction Set Summary 13-16 T able 13–8. Instruction Set Summary (Continued) Mnemonic Operation Description SUBI Subtract integers Dreg – src → Dreg SUBI3 Subtract integers (3-operand) src 1 – src 2 → Dreg SUBRB Subtract reverse integer with borrow src – Dreg – C → Dreg SUBRF Subtract reverse floating-point value src – R n → R ...

  • Texas Instruments TMS320C3x - page 475

    Parallel Instruction Set Summary 13-17 Assembly Language Instructions 13.3 Parallel Instruction Set Summary T able 13–9 lists the ’C3x instruction set in alphabetical order . Each table entry shows the instruction mnemonic, description, and operation. Refer to Section 13.1 for a functional listing of the instructions and individual instruc - ti ...

  • Texas Instruments TMS320C3x - page 476

    Parallel Instruction Set Summary 13-18 T able 13–9. Parallel Instruction Set Summary (Continued) (a) Parallel arithmetic with store instructions (Continued) Mnemonic Description Operation LDF || STF Load floating-point value src 2 → dst 1 || src 3 → dst 2 LDI || STI Load integer src 2 → dst 1 || src 3 → dst 2 LSH3 || STI Logical shift If ...

  • Texas Instruments TMS320C3x - page 477

    Parallel Instruction Set Summary 13-19 Assembly Language Instructions T able 13–9. Parallel Instruction Set Summary (Continued) (a) Parallel arithmetic with store instructions (Continued) Mnemonic Description Operation SUBF3 || STF Subtract floating-point value src 1 – src 2 → dst 1 || src 3 → dst 2 SUBI3 || STI Subtract integer src 1 – s ...

  • Texas Instruments TMS320C3x - page 478

    Group Addressing Mode Instruction Encoding 13-20 13.4 Group Addressing Mode Instruction Encoding The six addressing types (covered in Section 6.1, Addressing T ypes , on page 6-2 ) form these four groups of addressing modes: General addressing modes (G) 3-operand addressing modes (T) Parallel addressing modes (P) Conditional-branch addressing modes ...

  • Texas Instruments TMS320C3x - page 479

    Group Addressing Mode Instruction Encoding 13-21 Assembly Language Instructions Figure 13–1 shows the encoding for the general addressing modes. The notation mod n indicates the modification field that goes with the AR n field. Refer to T able 13–10 on page 13-22 for further information. Figure 13–1. Encoding for General Addressing Modes G De ...

  • Texas Instruments TMS320C3x - page 480

    Group Addressing Mode Instruction Encoding 13-22 T able 13–10. Indirect Addressing (a) Indirect addressing with displacement Mod Field Syntax Operation Description 00000 *+AR n ( disp ) addr = AR n + disp With predisplacement add 00001 *– AR n ( disp ) addr = AR n – disp With predisplacement subtract 00010 *++AR n ( disp ) addr = AR n + disp ...

  • Texas Instruments TMS320C3x - page 481

    Group Addressing Mode Instruction Encoding 13-23 Assembly Language Instructions T able 13–10. Indirect Addressing (Continued) (c) Indirect addressing with index register IR1 Mod Field Syntax Operation Description 10000 *+ AR n (IR1) addr = AR n + IR1 With preindex (IR1) add 10001 * – AR n (IR1) addr = AR n – IR1 With preindex (IR1) subtract 1 ...

  • Texas Instruments TMS320C3x - page 482

    Group Addressing Mode Instruction Encoding 13-24 13.4.2 3-Operand Addressing Modes Instructions that use the 3-operand addressing modes, such as ADDI3, LSH3, CMPF3, or XOR3, usually have this form: src 1 operation src 2 → dst where the destination operand is signified by dst and the source operands by src 1 and src 2; operation defines an operati ...

  • Texas Instruments TMS320C3x - page 483

    Group Addressing Mode Instruction Encoding 13-25 Assembly Language Instructions The following values of AR n and AR m are valid: AR n ,0 ≤ n ≤ 7 AR m ,0 ≤ m ≤ 7 The notation modm or modn indicates the modification field that goes with the AR m or AR n field, respectively . Refer to T able 13–10 on page 13-22 for further information. In in ...

  • Texas Instruments TMS320C3x - page 484

    Group Addressing Mode Instruction Encoding 13-26 address, bits 15–8 the src 3 address, and bits 7–0 the src 4 address. The notations mod n and mod m indicate which modification field goes with which AR n or AR m (auxiliary register) field, respectively . The following list describes the parallel addressing operands: src 1 = R n 0 ≤ n ≤ 7 (e ...

  • Texas Instruments TMS320C3x - page 485

    Group Addressing Mode Instruction Encoding 13-27 Assembly Language Instructions 13.4.4 Conditional-Branch Addressing Modes Instructions using the conditional-branch addressing modes (B cond , B cond D, CALL cond , DB cond , and DB cond D) can perform a variety of conditional operations. Bits 31–27 are set to the value of 01 101, indicating condit ...

  • Texas Instruments TMS320C3x - page 486

    Condition Codes and Flags 13-28 13.5 Condition Codes and Flags The ’C3x provides 20 condition codes (00000–10100, excluding 0101 1) that you can place in the cond field of any of the conditional instructions, such as RETS cond or LDF cond . The conditions include signed and unsigned compari- sons, comparisons to 0, and comparisons based on the ...

  • Texas Instruments TMS320C3x - page 487

    Condition Codes and Flags 13-29 Assembly Language Instructions Figure 13–6. Status Register PRGW status (’C32 only) INT config (’C32 only) Note: xx = reserved bit, read as 0 R = read, W = write GIE CC CE CF xx RM OVM LUF L V UF N Z V C R R/W R/W R/W R/W R/W R/W R/W R/W R/W R/W R/W R/W R/W R/W 15 14 13 12 1 1 10 9 8 7 6 5 4 3 2 1 0 xx 13 16 LU ...

  • Texas Instruments TMS320C3x - page 488

    Condition Codes and Flags 13-30 T able 13–12 lists the condition mnemonic, code, description, and flag for each of the 20 condition codes. T able 13–12. Condition Codes and Flags (a) Unconditional compares Condition Code Description Flag † U 00000 Unconditional Irrevelant (b) Unsigned compares Condition Code Description Flag † LO LS HI HS E ...

  • Texas Instruments TMS320C3x - page 489

    Condition Codes and Flags 13-31 Assembly Language Instructions T able 13–12. Condition Codes and Flags (Continued) (d) Compare to zero Condition Code Description Flag † Z NZ P N NN 00101 001 10 01001 001 1 1 01010 Zero Not zero Positive Negative Non-negative Z ∼ Z ∼ N AND ∼ Z N ∼ N (e) Compare to condition flags Condition Code Descripti ...

  • Texas Instruments TMS320C3x - page 490

    Individual Instructions 13-32 13.6 Individual Instructions This section contains the individual assembly language instructions for the ’C3x. The instructions are listed in alphabetical order . Information for each instruction includes assembler syntax, operation, operands, encoding, description, cycles, status bits, mode bit, and examples. Defini ...

  • Texas Instruments TMS320C3x - page 491

    Individual Instructions 13-33 Assembly Language Instructions T able 13–13. Instruction Symbols Symbol Meaning src src 1 src 2 src 3 src 4 Source operand Source operand 1 Source operand 2 Source operand 3 Source operand 4 dst dst 1 dst 2 disp cond count Destination operand Destination operand 1 Destination operand 2 Displacement Condition Shift co ...

  • Texas Instruments TMS320C3x - page 492

    Individual Instructions 13-34 13.6.2 Optional Assembler Syntax Th e a s s e m b le r a l l o w s a r e l a x e d s y n ta x f o r m f o r s o m e i n s t r u c t i o n s . T he s e optional forms simplify the assembly language so that special-case syntax can be ignored. A list of the optional syntax forms follows. Y ou can omit the destination regi ...

  • Texas Instruments TMS320C3x - page 493

    Individual Instructions 13-35 Assembly Language Instructions Empty expressions are not allowed for the displacement in indirect mode: LDI *+AR0(),R0 is not legal. Y ou can precede long immediate mode operands (destination of BR and CALL) with an @ sign: BR label can be written as BR @label Y ou can use the LDP pseudo-op to load a register (usually ...

  • Texas Instruments TMS320C3x - page 494

    Individual Instructions 13-36 Use the syntax in T able 13–14 to designate CPU registers in operands. Note the alternate notation R n , 0 n 27, which is used to designate any CPU register . T able 13–14. CPU Register Syntax Assemblers Syntax Alternate Register Syntax Assigned Function R0 R1 R2 R3 R4 R5 R6 R7 R0 R1 R2 R3 R4 R5 R6 R7 Extended-prec ...

  • Texas Instruments TMS320C3x - page 495

    Individual Instructions 13-37 Assembly Language Instructions 13.6.3 Individual Instruction Descriptions Each assembly language instruction for the ’C3x is described in this section in alphabetical order . The description includes the assembler syntax, operation, operands, encoding, description, cycles, status bits, mode bit, and examples. ...

  • Texas Instruments TMS320C3x - page 496

    EXAMPLE Example Instruction 13-38 Syntax INST src , dst or INST1 src2 , dst1 || INST2 src3 , dst2 Each instruction begins with an assembler syntax expression. Y ou can place labels either before the command (instruction mnemonic) on the same line or on the preceding line in the first column. The optional comment field that con- cludes the syntax is ...

  • Texas Instruments TMS320C3x - page 497

    Example Instruction EXAMPLE 13-39 Assembly Language Instructions Opcode INST1  INST2 31 24 23 16 8 7 0 15 00 0 src dst G 31 24 23 16 8 7 0 15 11 dst 1 src 2 dst 2 src 3 00 0 or INST Encoding examples are shown using general addressing and parallel addressing. The instruction pair for the parallel addressing example consists of INST1 and INST2 ...

  • Texas Instruments TMS320C3x - page 498

    EXAMPLE Example Instruction 13-40 Example INST @98AEh,R5 Before Instruction After Instruction R5 07 6690 0000 R5 00 6690 1000 R5 decimal 2.30562500e+02 R5 decimal 1.80126953e+00 DP 080 DP 080 LUF 0 LUF 0 LV 0 LV 0 UF 0 UV 0 N 0 N 0 Z 0 Z 0 V 0 V 0 C 0 C 0 Data memory 8098AEh 5CDF 8098AEh 5CDF 0200h 1234 0200h 1234 The sample code presented in the a ...

  • Texas Instruments TMS320C3x - page 499

    Absolute Value of Floating Point ABSF 13-41 Assembly Language Instructions Syntax ABSF src , dst Operation | src | → dst Operands src general addressing modes (G): 0 0 register (R n , 0 ≤ n ≤ 7) 0 1 direct 1 0 indirect (disp = 0–255, IR0, IR1) 1 1 immediate dst register (R n , 0 ≤ n ≤ 7) Opcode 31 24 23 16 8 7 0 15 00 0 00 0 src 0 dst G ...

  • Texas Instruments TMS320C3x - page 500

    ABSF||STF Parallel ABSF and STF 13-42 Syntax ABSF src2 , dst1 || STF src3 , dst2 Operation | src2 | → dst1 || src3 → dst2 Operands src2 indirect ( disp = 0, 1, IR0, IR1) dst1 register (R n 1, 0 ≤ n 1 ≤ 7) src3 register (R n 2, 0 ≤ n 2 ≤ 7) dst2 indirect ( disp = 0, 1, IR0, IR1) This instruction’s operands have been augmented in the fo ...

  • Texas Instruments TMS320C3x - page 501

    Parallel ABSF and STF ABSF||STF 13-43 Assembly Language Instructions Mode Bit OVM Operation is not affected by OVM bit value. Example ABSF *++AR3(IR1) ,R4  STF R4,*– AR7(1) Before Instruction After Instruction R4 07 33C0 0000 R4 05 74C0 0000 AR3 80 9800 AR3 8098AF AR7 80 98C5 AR7 8098C5 IR1 0AF IR1 0AF LUF 0 LUF 0 LV 0 LV 0 UF 0 UF 0 N 0 N ...

  • Texas Instruments TMS320C3x - page 502

    ABSI Absolute V alue of Integer 13-44 Syntax ABSI src , dst Operation | src | → dst Operands src general addressing modes (G): 0 0 any CPU register 0 1 direct 1 0 indirect (disp = 0–255, IR0, IR1) 1 1 immediate dst any CPU register Opcode 31 24 23 16 8 7 0 15 000 00 0 src 0 dst G 1 0 Description The absolute value of the src operand is loaded i ...

  • Texas Instruments TMS320C3x - page 503

    Absolute V alue of Integer ABSI 13-45 Assembly Language Instructions Example 1 ABSI R0,R0 or ABSI R0 Before Instruction After Instruction R0 00 FFFF FFCB R 0 00 0000 0035 –53 53 Example 2 ABSI *AR1,R3 Before Instruction After Instruction R3 00 0000 0000 R3 00 0000 0035 AR1 00 0020 AR1 00 0020 Data memory 20 0FFFFFFCB 2 0 0FFFFFFCB –53 53 –53 ...

  • Texas Instruments TMS320C3x - page 504

    ABSI||STI Parallel ABSI and STI 13-46 Syntax ABSI src2 , dst1 || STI src3, dst2 Operation | src2 | → dst1 || src3 → dst2 Operands src2 indirect ( disp = 0, 1, IR0, IR1) dst1 register (R n 1, 0 ≤ 1 ≤ 7) src3 register (R n 2, 0 ≤ n 2 ≤ 7) dst2 indirect ( disp = 0, 1, IR0, IR1) This instruction’s operands have been augmented in the follo ...

  • Texas Instruments TMS320C3x - page 505

    Parallel ABSI and STI ABSI||STI 13-47 Assembly Language Instructions Status Bits These condition flags are modified only if the destination register is R7 – R0. LUF Unaffected LV 1 if an integer overflow occurs; unchanged otherwise UF 0 N 0 Z 1 if a 0 result is generated; 0 otherwise V 1 if an integer overflow occurs; 0 otherwise C Unaffected Mod ...

  • Texas Instruments TMS320C3x - page 506

    ADDC Add Integer With Carry 13-48 Syntax ADDC src , dst Operation dst + src + C → dst Operands src general addressing modes (G): 0 0 any CPU register 0 1 direct 1 0 indirect (disp = 0–255, IR0, IR1) 1 1 immediate dst any CPU register Opcode 31 24 23 16 8 7 0 15 0 0 000 1 src 0 dst G 0 Description The sum of the dst and src operands and the carr ...

  • Texas Instruments TMS320C3x - page 507

    Add Integer With Carry , 3-Operand ADDC3 13-49 Assembly Language Instructions Syntax ADDC3 src2 , src1 , dst Operation src1 + src2 + C → dst Operands src1 3-operand addressing modes (T): 0 0 any CPU register 0 1 indirect ( disp = 0, 1, IR0, IR1) 1 0 any CPU register 1 1 indirect ( disp = 0, 1, IR0, IR1) src2 3-operand addressing modes (T): 0 0 an ...

  • Texas Instruments TMS320C3x - page 508

    ADDC3 Add Integer With Carry , 3-Operand 13-50 Example 1 ADDC3 *AR5++(IR0),R5,R2 or ADDC3 R5,*AR5++(IR0),R2 Before Instruction After Instruction R2 00 0000 0000 R2 00 0000 0032 R5 00 0000 0066 R5 00 0000 0066 AR5 80 9908 AR5 80 9918 IR0 10 IR0 10 LUF 0 LUF 0 LV 0 LV 0 UF 0 UF 0 N 0 N 0 Z 0 Z 0 V 0 V 0 C 1 C 1 Data memory 809908 0FFFFFFCB 809908 0FF ...

  • Texas Instruments TMS320C3x - page 509

    Add Floating-Point V alues ADDF 13-51 Assembly Language Instructions Syntax ADDF src , dst Operation dst + src → dst Operands src general addressing modes (G): 0 0 register (R n , 0 ≤ n ≤ 7) 0 1 direct 1 0 indirect (disp = 0–255, IR0, IR1) 1 1 immediate dst register (R n , 0 ≤ n ≤ 7) Opcode src 31 2423 16 8 7 0 15 00 000 1 G 1 dst 0 0 D ...

  • Texas Instruments TMS320C3x - page 510

    ADDF Add Floating-Point V alues 13-52 Example ADDF *AR4++(IR1),R5 Before Instruction After Instruction R5 05 7980 0000 R5 09 052C 0000 AR 4 809800 AR4 80992B IR 1 12B IR1 12B LUF 0 LUF 0 LV 0 LV 0 UF 0 UF 0 N 0 N 0 Z 0 Z 0 V 0 V 0 C 0 C 0 Data memory 86B2800 86B2800 5.3268750e+02 4.7031250e+02 4.7013250e+02 6.23750e+01 809800 809800 ...

  • Texas Instruments TMS320C3x - page 511

    Add Floating Point, 3-Operand ADDF3 13-53 Assembly Language Instructions Syntax ADDF3 src2 , src1 , dst Operation src1 + src2 → dst Operands src1 3-operand addressing modes (T): 0 0 register (R n 1, 0 ≤ n 1 ≤ 7) 0 1 indirect ( disp = 0, 1, IR0, IR1) 1 0 register (R n 1, 0 ≤ n 1 ≤ 7) 1 1 indirect ( disp = 0, 1, IR0, IR1) src2 3-operand add ...

  • Texas Instruments TMS320C3x - page 512

    ADDF3 Add Floating Point, 3-Operand 13-54 Example 1 ADDF3 R6,R5,R1 or ADDF3 R5,R6,R1 Before Instruction After Instruction R1 00 0000 0000 R1 09 052C 0000 R5 05 7980 0000 R5 05 7980 0000 R6 08 6B28 0000 R6 08 6B28 0000 LUF 0 LUF 0 LV 0 LV 0 UF 0 UF 0 N 0 N 0 Z 0 Z 0 V 0 V 0 C 0 C 0 6.23750e+01 4.7031250e+02 5.3268750e+02 6.23750e+01 4.7031250e+02 Ex ...

  • Texas Instruments TMS320C3x - page 513

    Parallel ADDF3 and STF ADDF3||STF 13-55 Assembly Language Instructions Syntax ADDF3 src2, src1, dst1 || STF src3, dst2 Operation src1 + src2 → dst1 || src3 → dst2 Operands src1 register (R n 1, 0 ≤ n 1 ≤ 7) src2 indirect ( disp = 0, 1, IR0, IR1) dst1 register (R n 2, 0 ≤ n 2 ≤ 7) src3 register (R n 3, 0 ≤ n 3 ≤ 7) dst2 indirect ( di ...

  • Texas Instruments TMS320C3x - page 514

    ADDF3||STF Parallel ADDF3 and STF 13-56 OVM Operation is not affected by OVM bit value. Example ADDF3 *+AR3(IR1),R2,R5 || STF R4,*AR2 Before Instruction After Instruction R2 07 0C80 0000 R2 07 0C80 0000 R4 05 7B40 0000 R4 05 7B40 0000 R5 00 0000 0000 R5 08 2020 0000 AR2 80 98F3 AR2 80 98F3 AR3 80 9800 AR3 80 9800 IR1 0A5 IR1 0A5 LUF 0 LUF 0 LV 0 LV ...

  • Texas Instruments TMS320C3x - page 515

    Add Integer ADDI 13-57 Assembly Language Instructions Syntax ADDI src, dst Operation dst + src → dst Operands src general addressing modes (G): 0 0 any CPU register 0 1 direct 1 0 indirect (disp = 0–255, IR0, IR1) 1 1 immediate dst any CPU register Opcode 31 24 23 16 8 7 0 15 00 0 00 01 G src dst 00 Description The sum of the dst and src operan ...

  • Texas Instruments TMS320C3x - page 516

    ADDI3 Add Integer , 3-Operand 13-58 Syntax ADDI3 <src2 >,<src1 >,<dst > Operation s rc 1 + src2 → dst Operands src1 3-operand addressing modes (T): 0 0 any CPU register 0 1 indirect ( disp = 0, 1, IR0, IR1) 1 0 any CPU register 1 1 indirect ( disp = 0, 1, IR0, IR1) src2 3-operand addressing modes (T): 0 0 any CPU register 0 1 an ...

  • Texas Instruments TMS320C3x - page 517

    Add Integer , 3-Operand ADDl3 13-59 Assembly Language Instructions Example 1 ADDI3 R4,R7,R5 Before Instruction After Instruction R4 00 0000 00DC R4 00 0000 00DC R5 00 0000 0010 R5 00 0000 017C R7 00 0000 00A0 R7 00 0000 00A0 LUF 0 LUF 0 LV 0 LV 0 UF 0 UF 0 N 0 N 0 Z 0 Z 0 V 0 V 0 C 0 C 0 220 220 16 160 380 160 Example 2 ADDI3 *–AR3(1),*AR6 –– ...

  • Texas Instruments TMS320C3x - page 518

    ADDI3||STI Parallel ADDI3 and STI 13-60 Syntax ADDI3 src2, src1, dst1 || STI src3, dst2 Operation src1 + src2 → dst1 || src3 → dst2 Operands src1 register (R n 1, 0 ≤ n 1 ≤ 7) src2 indirect ( disp = 0, 1, IR0, IR1) dst1 register (R n 2, 0 ≤ n 2 ≤ 7) src3 register (R n 3, 0 ≤ n 3 ≤ 7) dst2 indirect ( disp = 0, 1, IR0, IR1) This instr ...

  • Texas Instruments TMS320C3x - page 519

    Parallel ADDl3 and STI ADDl3||STI 13-61 Assembly Language Instructions OVM Operation is affected by OVM bit value. Example ADDI3 *AR0 –– (IR0),R5,R0  STI R3,*AR7 Before Instruction After Instruction R0 00 0000 0000 R0 00 0000 0208 R3 00 0000 0035 R3 00 0000 0035 R5 00 0000 00DC R5 00 0000 00DC AR0 80 992C AR0 80 9920 AR7 80 983B AR7 80 98 ...

  • Texas Instruments TMS320C3x - page 520

    AND Bitwise-Logical AND 13-62 Syntax AND src, dst Operands dst AND src → dst Operands src general addressing modes (G): 0 0 any CPU register 0 1 direct 1 0 indirect (disp = 0–255, IR0, IR1) 1 1 immediate (not sign extended) dst any CPU register Opcode 31 24 23 16 8 7 0 15 00 00 00 1 dst src 01 G Description The bitwise-logical AND between the d ...

  • Texas Instruments TMS320C3x - page 521

    Bitwise-Logical AND, 3-Operand AND3 13-63 Assembly Language Instructions Syntax AND3 src2, src1, dst Operation src1 AND src2 → dst Operands src1 3-operand addressing modes (T): 0 0 any CPU register 0 1 indirect ( disp = 0, 1, IR0, IR1) 1 0 any CPU register 1 1 indirect ( disp = 0, 1, IR0, IR1) src2 3-operand addressing modes (T): 0 0 any CPU regi ...

  • Texas Instruments TMS320C3x - page 522

    AND3 Bitwise-Logical AND, 3-Operand 13-64 Example 1 AND3 *AR0 –– (IR0),*+AR1,R4 Before Instruction After Instruction R4 00 0000 0000 R4 00 0000 0020 AR0 80 98F4 AR0 80 98A4 AR1 80 9951 AR1 80 9951 IR0 50 IR0 50 LUF 0 LUF 0 LV 0 LV 0 UF 0 UF 0 N 0 N 0 Z 0 Z 0 V 0 V 0 C 0 C 0 Data memory 8098F4h 30 8098F4h 30 809952h 123 809952h 123 Example 2 AND ...

  • Texas Instruments TMS320C3x - page 523

    Parallel AND3 and STI AND3||STI 13-65 Assembly Language Instructions Syntax AND3 src2, src1, dst1  STI src3, dst2 Operation src1 AND src2 → dst1 || src3 → dst2 Operands src1 register (R n 1, 0 ≤ n 1 ≤ 7) src2 indirect ( disp = 0, 1, IR0, IR1) dst1 register (R n 2, 0 ≤ n 2 ≤ 7) src3 register (R n 3, 0 ≤ n 3 ≤ 7) dst2 indirect ( ...

  • Texas Instruments TMS320C3x - page 524

    AND3||STI Parallel AND3 and STI 13-66 OVM Operation is not affected by OVM bit value. Example AND3 *+AR1(IR0),R4,R7 || STI R3,*AR2 Before Instruction After Instruction R0 00 0000 0008 R0 00 0000 0008 R3 00 0000 0035 R3 00 0000 0035 R4 00 0000 A323 R4 00 0000 A323 R7 00 0000 0000 R7 00 0000 0003 AR1 80 99F1 AR1 80 99F1 AR2 80 983F AR2 80 983F LUF 0 ...

  • Texas Instruments TMS320C3x - page 525

    Bitwise-Logical AND With Complement ANDN 13-67 Assembly Language Instructions Syntax ANDN src , dst Operation dst AND ∼ src → dst Operands src general addressing modes (G): 0 0 any CPU register 0 1 direct 1 0 indirect (disp = 0–255, IR0, IR1) 1 1 immediate (not sign extended) dst any CPU register Opcode 31 24 23 16 8 7 0 15 000000 1 dst src 1 ...

  • Texas Instruments TMS320C3x - page 526

    ANDN Bitwise-Logical AND With Complement 13-68 Example ANDN @980Ch,R2 Before Instruction After Instruction R2 00 0000 0C2F R2 00 0000 042D DP 080 DP 080 LUF 0 LUF 0 LV 0 LV 0 UF 0 UF 0 N 0 N 0 Z 0 Z 0 V 0 V 0 C 0 C 0 Data memory 80980Ch 0A02 80980Ch 0A02 ...

  • Texas Instruments TMS320C3x - page 527

    Bitwise-Logical ANDN, 3-Operand ANDN3 13-69 Assembly Language Instructions Syntax ANDN3 src2, src1, dst Operation src1 AND ∼ src2 → dst Operands src1 3-operand addressing modes (T): 0 0 any CPU register 0 1 indirect ( disp = 0, 1, IR0, IR1) 1 0 any CPU register 1 1 indirect ( disp = 0, 1, IR0, IR1) src2 3-operand addressing modes (T): 0 0 any C ...

  • Texas Instruments TMS320C3x - page 528

    ANDN3 Bitwise-Logical ANDN, 3-Operand 13-70 Example 1 ANDN3 R5,R3,R7 Before Instruction After Instruction R3 00 0000 0C2F R3 00 0000 0C2F R5 00 0000 0A02 R5 00 0000 0A02 R7 00 0000 0000 R7 00 0000 042D LUF 0 LUF 0 LV 0 LV 0 UF 0 UF 0 N 0 N 0 Z 0 Z 0 V 0 V 0 C 0 C 0 Example 2 ANDN3 R1,*AR5++(IR0),R0 Before Instruction After Instruction R0 00 0000 00 ...

  • Texas Instruments TMS320C3x - page 529

    Arithmetic Shift ASH 13-71 Assembly Language Instructions Syntax ASH count, dst Operation If ( count ≥ 0): dst << count → dst Else: dst >> | count | → dst Operands count general addressing modes (G): 0 0 any CPU register 0 1 direct 1 0 indirect (disp = 0–255, IR0, IR1) 1 1 immediate dst any CPU register Opcode 31 24 23 16 8 7 0 ...

  • Texas Instruments TMS320C3x - page 530

    ASH Arithmetic Shift 13-72 Status Bits These condition flags are modified only if the destination register is R7 – R0. LUF Unaffected LV 1 if an integer overflow occurs; unchanged otherwise UF 0 N MSB of the output Z 1 if a 0 result is generated; 0 otherwise V 1 if an integer overflow occurs; 0 otherwise C Set to the value of the last bit shifted ...

  • Texas Instruments TMS320C3x - page 531

    Arithmetic Shift, 3-Operand ASH3 13-73 Assembly Language Instructions Syntax ASH3 count, src, dst Operation If ( count ≥ 0): src << count → dst Else: src >> | count | → dst Operands count 3-operand addressing modes (T): 0 0 register (R n 2, 0 ≤ n 2 ≤ 27) 0 1 register (R n 2, 0 ≤ n 2 ≤ 27) 1 0 indirect ( disp = 0, 1, IR0, I ...

  • Texas Instruments TMS320C3x - page 532

    ASH3 Arithmetic Shift, 3-Operand 13-74 Status Bits These condition flags are modified only if the destination register is R7 – R0. LUF Unaffected LV 1 if an integer overflow occurs; unchanged otherwise UF 0 N MSB of the output Z 1 if a 0 result is generated; 0 otherwise V 1 if an integer overflow occurs; 0 otherwise C Set to the value of the last ...

  • Texas Instruments TMS320C3x - page 533

    Arithmetic Shift, 3-Operand ASH3 13-75 Assembly Language Instructions Example 2 ASH3 R1,R3,R5 Before Instruction After Instruction R1 00 FFFF FFF8 R1 00 FFFF FFF8 R3 00 FFFF CB00 R3 00 FFFF CB00 R5 00 0000 0000 R5 00 FFFF FFCB LUF 0 LUF 0 LV 0 LV 0 UF 0 UF 0 N 0 N 1 Z 0 Z 0 V 0 V 0 C 0 C 0 –8 –8 Note: Cycle Count See Section 8.5.2, Data Loads a ...

  • Texas Instruments TMS320C3x - page 534

    ASH3||STI Parallel ASH3 and STI 13-76 Syntax ASH3 count, src2, dst1 || STI src3, dst2 Operation If (coun t ≥ 0): src2 << count → dst1 Else: src2 >> | count | → dst1 || src3 → dst2 Operands count register (R n 1, 0 ≤ n 1 ≤ 7) src2 indirect ( disp = 0, 1, IR0, IR1) dst1 register (R n 2, 0 ≤ n 2 ≤ 7) src3 register (R n 3, 0 ...

  • Texas Instruments TMS320C3x - page 535

    Parallel ASH3 and STI ASH3||STI 13-77 Assembly Language Instructions Arithmetic right shift: sign of src2 → src2 → C If the count operand is 0, no shift is performed, and the C bit is set to 0. The count and dst operands are assumed to be signed integers. All registers are read at the beginning and loaded at the end of the execute cycle. If one ...

  • Texas Instruments TMS320C3x - page 536

    ASH3||STI Parallel ASH3 and STI 13-78 Example ASH3 R1,*AR6++(IR1),R0 || STI R5,*AR2 Before Instruction After Instruction R0 00 0000 0000 R0 00 FFFF FFAE R1 00 0000 FFE8 R1 00 0000 FFE8 R5 00 0000 0035 R5 00 0000 0035 AR2 80 98A2 AR2 80 98A2 AR6 80 9900 AR6 80 998C IR1 8C IR1 8C LUF 0 LUF 0 LV 0 LV 0 UF 0 UF 0 N 0 N 0 Z 0 Z 0 V 0 V 0 C 0 C 0 Data me ...

  • Texas Instruments TMS320C3x - page 537

    Branch Conditionally (Standard) Bcond 13-79 Assembly Language Instructions Syntax B cond src Operation If cond is true: If src is in register-addressing mode (R n , 0 ≤ n ≤ 27), src → PC. If src is in PC-relative mode (label or address), displacement + PC + 1 → PC. Else, continue Operands src conditional-branch addressing modes (B): 0 regis ...

  • Texas Instruments TMS320C3x - page 538

    Bcond Branch Conditionally (Standard) 13-80 Example BZ R0 Before Instruction After Instruction R0 00 0003 FF00 R0 00 0003 FF00 PC 2B00 PC 3 FF00 LUF 0 LUF 0 LV 0 LV 0 UF 0 UF 0 N 0 N 0 Z 1 Z 1 V 0 V 0 C 0 C 0 Note: If a BZ instruction is executed immediately following a RND instruction with a 0 operand, the branch is not performed, because the 0 fl ...

  • Texas Instruments TMS320C3x - page 539

    Branch Conditionally (Delayed) BcondD 13-81 Assembly Language Instructions Syntax B cond D src Operation If cond is true: If src is in register-addressing mode (R n , 0 ≤ n ≤ 27), src → PC. If src is in PC-relative mode (label or address), displacement + PC + 3 → PC. Else, continue Operands src conditional-branch addressing modes (B): 0 reg ...

  • Texas Instruments TMS320C3x - page 540

    BcondD Branch Conditionally (Delayed) 13-82 Example BNZD 36 (36 = 24h) Before Instruction After Instruction PC 0050 PC 0077 LUF 0 LUF 0 LV 0 LV 0 UF 0 UF 0 N 0 N 0 Z 0 Z 0 V 0 V 0 C 0 C 0 Note: Delayed branches disable interrupts until the completion of the three instruc- tions that follow the delayed branch, regardless if the branch is or is not p ...

  • Texas Instruments TMS320C3x - page 541

    Branch Unconditionally (Standard) BR 13-83 Assembly Language Instructions Syntax BR src Operation src → PC Operands src long-immediate addressing mode Opcode 31 24 23 16 8 7 0 15 01 1 0 0 0 0 0 src Description BR performs a PC-relative branch that executes in four cycles, since a pipeline flush also occurs upon execution of the branch (see Sectio ...

  • Texas Instruments TMS320C3x - page 542

    BRD Branch Unconditionally (Delayed) 13-84 Syntax BRD src Operation src → PC Operands src long-immediate addressing mode Opcode 31 24 23 16 8 7 0 15 01 1 0 0 1 0 0 src Description BRD signifies a delayed branch that allows the three instructions after the delayed branch to be fetched before the PC is modified. The effect is a single-cycle branch. ...

  • Texas Instruments TMS320C3x - page 543

    Call Subroutine CALL 13-85 Assembly Language Instructions Syntax CALL src Operation Next PC → *++SP src → PC Operands src long-immediate addressing mode Opcode 31 24 23 16 8 7 0 15 0 1100 0 1 0 src Description A call is performed. The next PC value is pushed onto the system stack. The src operand is loaded into the PC. The src operand is assume ...

  • Texas Instruments TMS320C3x - page 544

    CALLcond Call Subroutine Conditionally 13-86 Syntax CALL cond src Operation If cond is true: Next PC → *++SP If src is in register addressing mode (R n , 0 ≤ n ≤ 27), src → PC. If src is in PC-relative mode (label or address), displacement + PC + 1 → PC. Else, continue Operands src conditional-branch addressing modes (B): 0 register 1 PC ...

  • Texas Instruments TMS320C3x - page 545

    Call Subroutine Conditionally CALLcond 13-87 Assembly Language Instructions Example CALLNZ R5 Before Instruction After Instruction R5 00 0000 0789 R5 00 0000 0789 PC 0123 PC 0789 SP 809835 SP 809836 LUF 0 LUF 0 LV 0 LV 0 UF 0 UF 0 N 0 N 0 Z 0 Z 0 V 0 V 0 C 0 C 0 Data memory 809836h 124 ...

  • Texas Instruments TMS320C3x - page 546

    CMPF Compare Floating-Point V alue 13-88 Syntax CMPF src, dst Operation dst – src Operands src general addressing modes (G): 0 0 register (R n , 0 ≤ n ≤ 7) 0 1 direct 1 0 indirect (disp = 0–255, IR0, IR1) 1 1 immediate dst register (R n , 0 ≤ n ≤ 7) Opcode 31 24 23 16 8 7 0 15 00 0 0 01 0 dst 00 G src Description The src operand is subt ...

  • Texas Instruments TMS320C3x - page 547

    Compare Floating-Point V alue CMPF 13-89 Assembly Language Instructions Example CMPF *+AR4,R6 Before Instruction After Instruction R6 07 0C80 0000 R6 07 0C80 0000 AR4 80 98F2 AR4 80 98F2 LUF 0 LUF 0 LV 0 LV 0 UF 0 UF 0 N 0 N 0 Z 0 Z 1 V 0 V 0 C 0 C 0 Data memory 8098F3h 070C8000 8098F3h 070C8000 1.4050e+02 1.4050e+02 1.4050e+02 1.4050e+02 ...

  • Texas Instruments TMS320C3x - page 548

    CMPF3 Compare Floating-Point V alue, 3-Operand 13-90 Syntax CMPF3 src2, src1 Operation src1 – src2 Operands src1 3-operand addressing modes (T): 0 0 register (R n 1, 0 ≤ n 1 ≤ 7) 0 1 indirect ( disp = 0, 1, IR0, IR1) 1 0 register (R n 1, 0 ≤ n 1 ≤ 7) 1 1 indirect ( disp = 0, 1, IR0, IR1) src2 3-operand addressing modes (T): 0 0 register ( ...

  • Texas Instruments TMS320C3x - page 549

    Compare Floating-Point V alue, 3-Operand CMPF3 13-91 Assembly Language Instructions Example CMPF3 *AR2,*AR3 –– (1) Before Instruction After Instruction AR2 80 9831 AR2 80 9831 AR3 80 9852 AR4 80 9851 LUF 0 LUF 0 LV 0 LV 0 UF 0 UF 0 N 0 N 1 Z 0 Z 0 V 0 V 0 C 0 C 0 Data memory 809831h 77A7000 809831h 77A7000 809852h 57A2000 809852h 57A2000 2.5044 ...

  • Texas Instruments TMS320C3x - page 550

    CMPI Compare Integer 13-92 Syntax CMPI src, dst Operation dst – src Operands src general addressing modes (G): 0 0 register (R n , 0 ≤ n ≤ 27) 0 1 direct 1 0 indirect (disp = 0–255, IR0, IR1) 1 1 immediate dst register (R n , 0 ≤ n ≤ 27) Opcode 31 24 23 16 8 7 0 15 00 00 01 0 dst 01 G src Description The src operand is subtracted from t ...

  • Texas Instruments TMS320C3x - page 551

    Compare Integer , 3-Operand CMPI3 13-93 Assembly Language Instructions Syntax CMPI3 src2, src1 Operation src1 – src2 Operands src1 3-operand addressing modes (T): 0 0 register (R n 1, 0 ≤ n 1 ≤ 27) 0 1 indirect ( disp = 0, 1, IR0, IR1) 1 0 register (R n 1, 0 ≤ n 1 ≤ 27) 1 1 indirect ( disp = 0, 1, IR0, IR1) src 2 3-operand addressing mode ...

  • Texas Instruments TMS320C3x - page 552

    CMPI3 Compare Integer , 3-Operand 13-94 Example CMPI3 R7,R4 Before Instruction After Instruction R4 00 0000 0898 R4 00 0000 0898 R7 00 0000 03E8 R7 00 0000 03E8 LUF 0 LUF 0 LV 0 LV 0 UF 0 UF 0 N 0 N 0 Z 0 Z 0 V 0 V 0 C 0 C 0 2200 1000 2200 1000 Note: Cycle Count See Section 8.5.2, Data Loads and Stores , on page 8-24 for the effects of operand orde ...

  • Texas Instruments TMS320C3x - page 553

    Decrement and Branch Conditionally (Standard) DBcond 13-95 Assembly Language Instructions Syntax DB cond AR n, src Operation AR n – 1 → AR n If cond is true and AR n ≥ 0 : If src is in register addressing mode (R n , 0 ≤ n ≤ 27), src → PC. If src is in PC-relative mode (label or address), displacement + PC + 1 → PC. Else, continue Ope ...

  • Texas Instruments TMS320C3x - page 554

    DBcond Decrement and Branch Conditionally (Standard) 13-96 Cycles 4 Status Bits LUF Unaffected LV Unaffected UF Unaffected N Unaffected Z Unaffected V Unaffected C Unaffected OVM Operation is not affected by OVM bit value. Example CMPI 200,R3 DBLT AR3,R2 Before Instruction After Instruction R2 00 0000 009F R2 00 0000 009F R3 00 0000 0080 R3 00 0000 ...

  • Texas Instruments TMS320C3x - page 555

    Decrement and Branch Conditionally (Delayed) DBcondD 13-97 Assembly Language Instructions Syntax DB cond D AR n , src Operation AR n – 1 → AR n If cond is true and AR n ≥ 0: If src is in register addressing mode (R n , 0 ≤ n ≤ 27) src → PC If src is in PC-relative mode (label or address) displacement + PC + 3 → PC. Else, continue Oper ...

  • Texas Instruments TMS320C3x - page 556

    DBcondD Decrement and Branch Conditionally (Delayed) 13-98 Cycles 1 Status Bits LUF Unaffected LV Unaffected UF Unaffected N Unaffected Z Unaffected V Unaffected C Unaffected OVM Operation is not affected by OVM bit value. Example CMPI 26h,R2 DBZD AR5, $+110h Before Instruction After Instruction R2 00 0000 0026 R2 00 0000 0026 AR5 00 0067 AR5 00 00 ...

  • Texas Instruments TMS320C3x - page 557

    Floating-Point-to-Integer Conversion FIX 13-99 Assembly Language Instructions Syntax FIX src, dst Operation fix (src ) → dst Operands src general addressing modes (G): 0 0 register (R n , 0 ≤ n ≤ 7) 0 1 direct 1 0 indirect (disp = 0–255, IR0, IR1) 1 1 immediate dst any CPU register Opcode 31 24 23 16 8 7 0 15 0 00 001 G dst src 01 0 Descrip ...

  • Texas Instruments TMS320C3x - page 558

    FIX Floating-Point-to-Integer Conversion 13-100 Example FIX R1,R2 Before Instruction After Instruction R1 0A 2820 0000 R1 0A 2820 0000 R2 00 0000 0000 R2 00 0000 0541 LUF 0 LUF 0 LV 0 LV 0 UF 0 UF 0 N 0 N 0 Z 0 Z 0 V 0 V 0 C 0 C 0 1.3454e+3 13454e+3 1345 ...

  • Texas Instruments TMS320C3x - page 559

    Parallel FIX and STI FIX||STI 13-101 Assembly Language Instructions Syntax FIX src2, dst1 || STI src3 , dst2 Operation fix( src2 ) → dst1 || src3 → dst2 Operands src2 indirect ( disp = 0, 1, IR0, IR1) dst1 register (R n 1, 0 ≤ n 1 ≤ 7) src3 register (R n 2, 0 ≤ n 2 ≤ 7) dst2 indirect ( disp = 0, 1, IR0, IR1) This instruction’s operand ...

  • Texas Instruments TMS320C3x - page 560

    FIX||STI Parallell FIX and STI 13-102 Status Bits These condition flags are modified only if the destination register is R7 – R0. LUF Unaffected LV 1 if an integer overflow occurs; unchanged otherwise UF 0 N 1 if a negative result is generated; 0 otherwise Z 1 if a 0 result is generated; 0 otherwise V 1 if an integer overflow occurs; 0 otherwise ...

  • Texas Instruments TMS320C3x - page 561

    Integer-to-Floating-Point Conversion FLOA T 13-103 Assembly Language Instructions Syntax FLOA T src, dst Operation float (src) → dst Operands src general addressing modes (G): 0 0 register (R n , 0 ≤ n ≤ 27) 0 1 direct 1 0 indirect (disp = 0–255, IR0, IR1) 1 1 immediate dst register (R n , 0 ≤ n ≤ 7) Opcode 31 24 23 16 8 7 0 15 00 00 0 ...

  • Texas Instruments TMS320C3x - page 562

    FLOA T Integer-to-Floating-Point Conversion 13-104 Example FLOAT *++AR2(2),R5 Before Instruction After Instruction R5 00 034C 2000 R5 00 72E0 0000 AR2 80 9800 AR2 80 9802 LUF 0 LUF 0 LV 0 LV 0 UF 0 UF 0 N 0 N 0 Z 0 Z 0 V 0 V 0 C 0 C 0 Data memory 809802 0AE 809802 0AE 174 1.27578125e+01 1.74e+02 174 ...

  • Texas Instruments TMS320C3x - page 563

    Parallel FLOA T and STF FLOA T||STF 13-105 Assembly Language Instructions Syntax FLOA T src2, dst1 || STF src3 , dst2 Operation float (src2 ) → dst1 || src3 → dst2 Operands src2 indirect ( disp = 0, 1, IR0, IR1) dst1 register (R n 1, 0 ≤ n 1 ≤ 7) src3 register (R n 2, 0 ≤ n 2 ≤ 7) dst2 register ( disp = 0, 1, IR0, IR1) This instruction? ...

  • Texas Instruments TMS320C3x - page 564

    FLOA T||STF Parallel FLOA T and STF 13-106 Example FLOAT *+AR2(IR0),R6 || STF R7,*AR1 Before Instruction After Instruction R6 00 0000 0000 R6 07 2E00 0000 R7 03 4C20 0000 R7 03 4C20 0000 AR1 80 9933 AR1 80 9933 AR2 80 98C5 AR2 80 98C5 IR0 8 IR0 8 LUF 0 LUF 0 LV 0 LV 0 UF 0 UF 0 N 0 N 0 Z 0 Z 0 V 0 V 0 C 0 C 0 Data memory 8098CD 0AE 8098CD 0AE 80993 ...

  • Texas Instruments TMS320C3x - page 565

    Interrupt Acknowledge IACK 13-107 Assembly Language Instructions Syntax IACK src Operation Perform a dummy read operation with IACK = 0. At end of dummy read, set IACK to 1. Operands src general addressing modes (G): 0 1 direct 1 0 indirect Opcode 31 24 23 16 8 7 0 15 00 01 1 1 src 1 G 0 0 00 000 Description A dummy read operation is performed if o ...

  • Texas Instruments TMS320C3x - page 566

    IACK Interrupt Acknowledge 13-108 Example IACK *AR5 Before Instruction After Instruction IACK 1 IACK 1 PC 300 PC 301 LUF 0 LUF 0 LV 0 LV 0 UF 0 UF 0 N 0 N 0 Z 0 Z 0 V 0 V 0 C 0 C 0 ...

  • Texas Instruments TMS320C3x - page 567

    Idle Until Interrupt IDLE 13-109 Assembly Language Instructions Syntax IDLE Operation 1 → ST(GIE) Next PC → PC Idle until interrupt. Operands None Opcode 31 24 23 16 8 7 0 15 00 0 0 0 0 1 0 1 00 000 0 0 0 0 00 0 0 0 0 0000 00 0 0 Description The global-interrupt-enable bit is set, the next PC value is loaded into the PC, and the CPU idles until ...

  • Texas Instruments TMS320C3x - page 568

    IDLE2 Low-Power Idle 13-1 10 Syntax IDLE2 (supported by: ’LC31, ’C32, ’C30 silicon revision 7.x or greater , ’C31 silicon revision 5.x or greater) Operation 1 → ST(GIE) Next PC → PC Idle until interrupt. Operands None Opcode 31 24 23 16 8 7 0 15 00 0 0 0 0 1 0 1 00 000 0 0 0 0 00 0 0 0 0 0000 00 0 1 Description The IDLE2 instruction ser ...

  • Texas Instruments TMS320C3x - page 569

    Low-Power Idle IDLE2 13-1 1 1 Assembly Language Instructions For correct device operation, the three instructions after a delayed branch should not be IDLE or IDLE2 instructions. Cycles 1 Status Bits LUF Unaffected LV Unaffected UF Unaffected N Unaffected Z Unaffected V Unaffected C Unaffected OVM Operation is not affected by OVM bit value. Example ...

  • Texas Instruments TMS320C3x - page 570

    LDE Load Floating-Point Exponent 13-1 12 Syntax LDE src, dst Operation src ( exp ) → dst ( exp ) Operands src general addressing modes (G): 0 0 register (R n , 0 ≤ n ≤ 7) 0 1 direct 1 0 indirect (disp = 0–255, IR0, IR1) 1 1 immediate dst register (R n , 0 ≤ n ≤ 7) Opcode 31 24 23 16 8 7 0 15 00 0 0 0 0 1 1 1 dst src G Description The ex ...

  • Texas Instruments TMS320C3x - page 571

    Load Floating-Point Exponent LDE 13-1 13 Assembly Language Instructions Example LDE R0,R5 Before Instruction After Instruction R0 02 0005 6F30 R0 02 0005 6F30 R5 0A 056F E332 R5 02 056F E332 LUF 0 LUF 0 LV 0 LV 0 UF 0 UF 0 N 0 N 0 Z 0 Z 0 V 0 V 0 C 0 C 0 4.00066337e+00 1.06749648e+03 4.00066337e+00 4.16990814e+00 ...

  • Texas Instruments TMS320C3x - page 572

    LDF Load Floating-Point V alue 13-1 14 Syntax LDF src, dst Operation src → dst Operands src general addressing modes (G): 0 0 register (R n , 0 ≤ n ≤ 7) 0 1 direct 1 0 indirect (disp = 0–255, IR0, IR1) 1 1 immediate dst register (R n , 0 ≤ n ≤ 7) Opcode 31 24 23 16 8 7 0 15 00 0 0 0 1 1 0 1 dst src G Description The src operand is loade ...

  • Texas Instruments TMS320C3x - page 573

    Load Floating-Point V alue Conditionally LDFcond 13-1 15 Assembly Language Instructions Syntax LDF cond src, dst Operation If cond is true: src → dst. Else: dst is unchanged. Operands src general addressing modes (G): 0 0 register (R n , 0 ≤ n ≤ 7) 0 1 direct 1 0 indirect (disp = 0–255, IR0, IR1) 1 1 immediate dst register (R n , 0 ≤ n ? ...

  • Texas Instruments TMS320C3x - page 574

    LDFcond Load Floating-Point V alue Conditionally 13-1 16 Example LDFZ R3,R5 Before Instruction After Instruction R3 2C FF2C D500 R3 2C FF2C D500 R5 5F 0000 003E R5 2C FF2C D500 LUF 0 LUF 0 LV 0 LV 0 UF 0 UF 0 N 0 N 0 Z 1 Z 1 V 0 V 0 C 0 C 0 1.77055560e+13 3.96140824e+28 1.77055560e+13 1.77055560e+13 ...

  • Texas Instruments TMS320C3x - page 575

    Load Floating-Point V alue, Interlocked LDFI 13-1 17 Assembly Language Instructions Syntax LDFI src, dst Operation Signal interlocked operation src → dst Operands src general addressing modes (G): 0 1 direct 1 0 indirect (disp = 0–255, IR0, IR1) dst register (R n , 0 ≤ n ≤ 7) Opcode 31 24 23 16 8 7 0 15 00 0 0 0 1 1 1 1 dst src G Descriptio ...

  • Texas Instruments TMS320C3x - page 576

    LDFI Load Floating-Point V alue, Interlocked 13-1 18 Example LDFI *+AR2,R7 Before Instruction After Instruction R7 00 0000 0000 R7 05 84C0 0000 AR2 80 98F1 AR2 80 98F1 LUF 0 LUF 0 LV 0 LV 0 UF 0 UF 0 N 0 N 0 Z 0 Z 0 V 0 V 0 C 0 C 0 Data memory 8098F2h 584C000 8098F2h 584C000 –6.28125e+01 –6.28125e+01 –6.28125e+01 ...

  • Texas Instruments TMS320C3x - page 577

    Parallel LDF and LDF LDF||LDF 13-1 19 Assembly Language Instructions Syntax LDF src2, dst2 || LDF src1, dst1 Operation src2 → dst2 || src1 → dst1 Operands src1 indirect ( disp = 0, 1, IR0, IR1) dst1 register (R n 1, 0 ≤ n 1 ≤ 7) src2 indirect ( disp = 0, 1, IR0, IR1) dst2 register (R n 2, 0 ≤ n 2 ≤ 7) This instruction’s operands have ...

  • Texas Instruments TMS320C3x - page 578

    LDF||LDF Parallel LDF and LDF 13-120 Example LDF * –– AR1(IR0),R7 || LDF *AR7++(1),R3 Before Instruction After Instruction R3 00 0000 0000 R0 00 0000 0008 R7 00 0000 0000 R3 05 7B40 0000 AR1 80 985F R7 07 0C80 0000 AR7 80 988A AR1 80 9857 IR0 8 AR7 80 988B LUF 0 LUF 0 LV 0 LV 0 UF 0 UF 0 N 0 N 0 Z 0 Z 0 V 0 V 0 C 0 C 0 Data memory 809857h 70C80 ...

  • Texas Instruments TMS320C3x - page 579

    Parallel LDF and STF LDF||STF 13-121 Assembly Language Instructions Syntax LDF src2, dst1 || STF src3, dst2 Operation src2 → dst1 || src3 → dst2 Operands src2 indirect ( disp = 0, 1, IR0, IR1) dst1 register (R n 1, 0 ≤ n 1 ≤ 7) src3 register (R n 2, 0 ≤ n 2 ≤ 7) dst2 indirect ( disp = 0, 1, IR0, IR1) This instruction’s operands have b ...

  • Texas Instruments TMS320C3x - page 580

    LDF||STF Parallel LDF and STF 13-122 Example LDF *AR2 –– (1),R1 || STF R3,*AR4++(IR1) Before Instruction After Instruction R1 00 0000 0000 R1 07 0C80 0000 R3 05 7B40 0000 R3 05 7B40 0000 AR2 80 98E7 AR2 80 98E6 AR4 80 9900 AR4 80 9910 IR1 10 IR1 10 LUF 0 LUF 0 LV 0 LV 0 UF 0 UF 0 N 0 N 0 Z 0 Z 0 V 0 V 0 C 0 C 0 Data memory 8098E7h 70C8000 8098E ...

  • Texas Instruments TMS320C3x - page 581

    Load Integer LDI 13-123 Assembly Language Instructions Syntax LDI src, dst Operation src → dst Operands src general addressing modes (G): 0 0 any CPU register 0 1 direct 1 0 indirect (disp = 0–255, IR0, IR1) 1 1 immediate dst any CPU register Opcode 31 24 23 16 8 7 0 15 00 0 0 1 0 0 0 0 dst src G Description The src operand is loaded into the d ...

  • Texas Instruments TMS320C3x - page 582

    LDI Load Integer 13-124 Example LDI *–AR1(IR0),R5 Before Instruction After Instruction R5 00 0000 03C5 R5 00 0000 0026 AR1 2C AR1 2C IR0 5 IR0 5 LUF 0 LUF 0 LV 0 LV 0 UF 0 UF 0 N 0 N 0 Z 0 Z 0 V 0 V 0 C 0 C 0 Data memory 27h 26 27h 26 965 38 38 38 ...

  • Texas Instruments TMS320C3x - page 583

    Load Integer Conditionally LDIcond 13-125 Assembly Language Instructions Syntax LDI cond src, dst Operation If cond is true: src → dst, Else: dst is unchanged. Operands src general addressing modes (G): 0 0 any CPU register 0 1 direct 1 0 indirect (disp = 0–255, IR0, IR1) 1 1 immediate dst any CPU register Opcode 31 24 23 16 8 7 0 15 01 01 cond ...

  • Texas Instruments TMS320C3x - page 584

    LDIcond Load Integer Conditionally 13-126 Example LDIZ *ARO++,R6 Before Instruction After Instruction R6 00 0000 0FE2 R6 00 0000 0FE2 AR0 80 98F0 AR0 80 98F1 LUF 0 LUF 0 LV 0 LV 0 UF 0 UF 0 N 0 N 0 Z 0 Z 0 V 0 V 0 C 0 C 0 Data memory 8098F0h 027C 8098F0h 027C 4,066 4,066 636 636 Note: Auxiliary Register Arithmetic The test condition does not affect ...

  • Texas Instruments TMS320C3x - page 585

    Load Integer , Interlocked LDII 13-127 Assembly Language Instructions Syntax LDII src, dst Operation Signal interlocked operation src → dst Operands src general addressing modes (G): 0 1 direct 1 0 indirect (disp = 0–255, IR0, IR1) dst any CPU register Opcode 31 24 23 16 8 7 0 15 00 0 0 1 0 0 1 0 dst src G Description The src operand is loaded ...

  • Texas Instruments TMS320C3x - page 586

    LDII Load Integer , Interlocked 13-128 Example LDII @985Fh,R3 Before Instruction After Instruction R3 00 0000 0000 R3 00 0000 00DC DP 80 DP 80 LUF 0 LUF 0 LV 0 LV 0 UF 0 UF 0 N 0 N 0 Z 0 Z 0 V 0 V 0 C 0 C 0 Data memory 80985Fh 0DC 80985Fh 0DC ...

  • Texas Instruments TMS320C3x - page 587

    Parallel LDI and LDI LDI||LDI 13-129 Assembly Language Instructions Syntax LDI src 2 , dst2 || LDI src1, dst1 Operation src2 → dst2 || src1 → dst1 Operands src1 indirect ( disp = 0, 1, IR0, IR1) dst1 register (R n 1, 0 ≤ n 1 ≤ 7) src2 indirect ( disp = 0, 1, IR0, IR1) dst2 register (R n 2, 0 ≤ n 2 ≤ 7) This instruction’s operands have ...

  • Texas Instruments TMS320C3x - page 588

    LDI||LDI Parallel LDI and LDI 13-130 Example LDI *–AR1(1),R7 || LDI *AR7++(IR0),R1 Before Instruction After Instruction R1 00 0000 0000 R1 00 0000 02EE R7 00 0000 0000 R7 00 0000 00FA AR1 80 9826 AR1 80 9826 AR7 80 98C8 AR7 80 98D8 IR0 10 IR0 10 LUF 0 LUF 0 LV 0 LV 0 UF 0 UF 0 N 0 N 0 Z 0 Z 0 V 0 V 0 C 0 C 0 Data memory 809825h 0FA 809825h 0FA 80 ...

  • Texas Instruments TMS320C3x - page 589

    Parallel LDI and STI LDI||STI 13-131 Assembly Language Instructions Syntax LDI src2, dst1 || STI src3, dst2 Operation src2 → dst1 || src3 → dst2 Operands src2 indirect ( disp = 0, 1, IR0, IR1) dst1 register (R n 1, 0 ≤ n 1 ≤ 7) src3 register (R n 2, 0 ≤ n 2 ≤ 7) dst2 indirect ( disp = 0, 1, IR0, IR1) This instruction’s operands have b ...

  • Texas Instruments TMS320C3x - page 590

    LDI||STI Parallel LDI and STI 13-132 Example LDI *–AR1(1),R2 || STI R7,*AR5++(IR0) Before Instruction After Instruction R2 00 0000 0000 R2 00 0000 00DC R7 00 0000 0035 R7 00 0000 0035 AR1 80 98E7 AR1 80 98E7 AR5 80 982C AR5 80 9834 IR0 8 IR0 8 LUF 0 LUF 0 LV 0 LV 0 UF 0 UF 0 N 0 N 0 Z 0 Z 0 V 0 V 0 C 0 C 0 Data memory 8098E6h 0DC 8098E6h 0DC 8098 ...

  • Texas Instruments TMS320C3x - page 591

    Load Floating-Point Mantissa LDM 13-133 Assembly Language Instructions Syntax LDM src, dst Operation src ( man ) → dst ( man ) Operands src general addressing modes (G): 0 0 register (R n , 0 ≤ n ≤ 7) 0 1 direct 1 0 indirect (disp = 0–255, IR0, IR1) 1 1 immediate dst register (R n , 0 ≤ n ≤ 7) Opcode 31 24 23 16 8 7 0 15 00 0 0 1 1 0 0 ...

  • Texas Instruments TMS320C3x - page 592

    LDP Load Data-Page Pointer 13-134 Syntax LDP src, DP Operation src → data-page pointer Operands src is the 8 MSBs of the absolute 24-bit source address ( src ). The “DP” in the operand is optional. Opcode 31 24 23 16 8 7 0 15 00 0 0 1 0 0 0 0 1 1 1 00 00 00 0 000 00 src Description This pseudo-op is an alternate form of the LDUI instruction, ...

  • Texas Instruments TMS320C3x - page 593

    Divide Clock by 16 LOPOWER 13-135 Assembly Language Instructions Syntax LOPOWER (supported by: ’LC31 and ’C32, ’C31 silicon revision 5.0 or greater , ’C30 silicon revision 7.0 or greater) Operation H1 → H1/16 Operands None Opcode 31 23 0 00 0 1 0 0 0 1 0 0 00 00 00 00 0000 00 1 0 0 000 0 0 Description The device continues to execute instr ...

  • Texas Instruments TMS320C3x - page 594

    LSH Logical Shift 13-136 Syntax LSH count, dst Operation If count ≥ 0: dst << count → dst Else: dst >> | count | → dst Operands count general addressing modes (G): 0 0 any CPU register 0 1 direct 1 0 indirect (disp = 0–255, IR0, IR1) 1 1 immediate dst any CPU register Opcode 31 24 23 16 8 7 0 15 00 0 0 1 1 0 1 0 dst count G Desc ...

  • Texas Instruments TMS320C3x - page 595

    Logical Shift LSH 13-137 Assembly Language Instructions Cycles 1 Status Bits These condition flags are modified only if the destination register is R7 – R0. LUF Unaffected LV Unaffected UF 0 N MSB of the output Z 1 if a 0 output is generated; 0 otherwise V 0 C Set to the value of the last bit shifted out; 0 for a shift count of 0 OVM Operation is ...

  • Texas Instruments TMS320C3x - page 596

    LSH3 Logical Shift, 3-Operand 13-138 Syntax LSH3 count, src, dst Operation If count ≥ 0: src << count → dst Else: src >> | count | → dst Operands src 3-operand addressing modes (T): 0 0 any CPU register 0 1 indirect ( disp = 0, 1, IR0, IR1) 1 0 any CPU register 1 1 indirect ( disp = 0, 1, IR0, IR1) count 3-operand addressing modes ...

  • Texas Instruments TMS320C3x - page 597

    Logical Shift, 3-Operand LSH3 13-139 Assembly Language Instructions Cycles 1 Status Bits These condition flags are modified only if the destination register is R7 – R0. LUF Unaffected LV Unaffected UF 0 N MSB of the output Z 1 if a 0 output is generated; 0 otherwise V 0 C Set to the value of the last bit shifted out; 0 for a shift count of 0; una ...

  • Texas Instruments TMS320C3x - page 598

    LSH3 Logical Shift, 3-Operand 13-140 Example 2 LSH3 *–AR4(IR1),R5,R3 Before Instruction After Instruction R3 00 0000 0000 R3 00 0001 2C00 R5 00 12C0 0000 R5 00 12C0 0000 AR4 80 9908 AR4 80 9908 IR1 4 IR1 4 LUF 0 LUF 0 LV 0 LV 0 UF 0 UF 0 N 0 N 0 Z 0 Z 0 V 0 V 0 C 0 C 0 Data memory 809904h 0FFFFFFF4 809904h 0FFFFFFF4 –12 –12 Note: Cycle Count ...

  • Texas Instruments TMS320C3x - page 599

    Parallel LSH3 and STI LSH3||STI 13-141 Assembly Language Instructions Syntax LSH3 c ount, src2, dst1 || STI src3 , dst2 Operation If count ≥ 0: src2 << count → dst1 Else: src2 >> | count | → dst1 || src3 → dst2 Operands count register (R n 1, 0 ≤ n 1 ≤ 7) src1 indirect ( disp = 0, 1, IR0, IR1) dst1 register (R n 3, 0 ≤ n 3 ...

  • Texas Instruments TMS320C3x - page 600

    LSH3||STI Parallel LSH3 and STI 13-142 Logical right shift: 0 → src2 → C If the count operand is 0, no shift is performed, and the carry bit is set to 0. The count operand is assumed to be a 7-bit signed integer , and the src2 and dst1 operands are assumed to be unsigned integers. All registers are read at the beginning and loaded at the end of ...

  • Texas Instruments TMS320C3x - page 601

    Parallel LSH3 and STI LSH3||STI 13-143 Assembly Language Instructions Example 1 LSH3 R2,*++AR3(1),R0 || STI R4,*–AR5 Before Instruction After Instruction R0 00 0000 0000 R0 00 AC00 0000 R2 00 0000 0018 R2 00 0000 0018 R4 00 0000 00DC R4 00 0000 00DC AR3 80 98C2 AR3 80 98C3 AR5 80 98A3 AR5 80 98A3 LUF 0 LUF 0 LV 0 LV 0 UF 0 UF 0 N 0 N 0 Z 0 Z 0 V ...

  • Texas Instruments TMS320C3x - page 602

    LSH3||STI Parallel LSH3 and STI 13-144 Example 2 LSH3 R7,*AR2 –– (1),R2 || STI R0,*+AR0(1) Before Instruction After Instruction R0 00 0000 012C R0 00 0000 012C R2 00 0000 0000 R2 00 0002 C000 R7 00 FFFF FFF4 R7 00 FFFF FFF4 AR0 80 98B7 AR0 80 98B7 AR2 80 9863 AR2 80 9862 LUF 0 LUF 0 LV 0 LV 0 UF 0 UF 0 N 0 N 0 Z 0 Z 0 V 0 V 0 C 0 C 0 Data memor ...

  • Texas Instruments TMS320C3x - page 603

    Restore Clock to Regular Speed MAXSPEED 13-145 Assembly Language Instructions Syntax M A XSPEED (supported by ’C31, ’C32, ’C31 silicon revision 5.0 or greater , ’C30 silicon revision 7.0 or greater) Operation H1/16 → H1 Operands None Opcode 31 23 16 8 7 0 15 00 0 1 0 0 0 1 0 0 00 00 0 0 0 00 0 00 0 0 00 0 00 0 0 0 Description Exits LOPOWE ...

  • Texas Instruments TMS320C3x - page 604

    MPYF Multiply Floating-Point V alue 13-146 Syntax MPYF src, dst Operation dst × src → dst Operands src general addressing modes (G): 0 0 register (R n , 0 ≤ n ≤ 7) 0 1 direct 1 0 indirect (disp = 0–255, IR0, IR1) 1 1 immediate dst register (R n , 0 ≤ n ≤ 7) Opcode 31 24 23 16 8 7 0 15 00 0 0 1 0 1 0 0 dst G src Description The product ...

  • Texas Instruments TMS320C3x - page 605

    Multiply Floating-Point V alue, 3-Operand MPYF3 13-147 Assembly Language Instructions Syntax MPYF3 src2, src1, dst Operation src1 × src2 → dst Operands src1 3-operand addressing modes (T): 0 0 register (R n 1, 0 ≤ n 1 ≤ 7) 0 1 indirect ( disp = 0, 1, IR0, IR1) 1 0 register (R n 1, 0 ≤ n 1 ≤ 7) 1 1 indirect ( disp = 0, 1, IR0, IR1) src2 3 ...

  • Texas Instruments TMS320C3x - page 606

    MPYF3 Multiply Floating-Point V alue, 3-Operand 13-148 Example 1 MPYF3 R0,R7,R1 Before Instruction After Instruction R0 05 7B40 0000 R0 05 7B40 0000 R1 00 0000 0000 R1 0D 306A 3000 R7 07 33C0 0000 R7 07 33C0 0000 LUF 0 LUF 0 LV 0 LV 0 UF 0 UF 0 N 0 N 0 Z 0 Z 0 V 0 V 0 C 0 C 0 1.79750e+02 6.281250e+01 1.12905469e+04 6.281250e+01 1.79750e+02 Example ...

  • Texas Instruments TMS320C3x - page 607

    Parallel MPYF3 and ADDF3 MPYF3||ADDF3 13-149 Assembly Language Instructions Syntax MPYF3 srcA, srcB, dst1 || ADDF3 srcC, srcD, dst2 Operation srcA × srcB → dst1 || srcC + srcD → dst2 Operands srcA srcB srcC srcD Any two indirect ( disp = 0, 1 IR0, IR1) Any two register (0 R n 7) dst1 register ( d 1): 0 = R0 1 = R1 dst2 register ( d 2): 0 = R2 ...

  • Texas Instruments TMS320C3x - page 608

    MPYF3||ADDF3 Parallel MPYF3 and ADDF3 13-150 This instruction’s operands have been augmented in the following devices: ’C31 silicon version 6.0 or greater ’C32 silicon version 2.0 or greater srcA , srcB , srcC , srcD can be one of the following combinations: Register (0 R n 7) Indirect ( disp = 0, 1, IR0, IR1) Any CPU Register 2 2 – 211 2 ? ...

  • Texas Instruments TMS320C3x - page 609

    Parallel MPYF3 and ADDF3 MPYF3||ADDF3 13-151 Assembly Language Instructions 10 src1 × src2, src3 + src4 11 src3 × src1, src2 + src4 Opcode 31 24 23 16 8 7 0 15 10 0 0 00 src 4 src 3 P src 1 src 2 d1 d2 Description A floating-point multiplication and a floating-point addition are performed in parallel. All registers are read at the beginning and l ...

  • Texas Instruments TMS320C3x - page 610

    MPYF3||ADDF3 Parallel MPYF3 and ADDF3 13-152 Example MPYF3 *AR5++(1),* –– AR1(IR0),R0 || ADDF3 R5,R7,R3 Note: Cycle Count One cycle if: src3 and src4 are in internal memory src3 is in internal memory and src4 is in external memory T wo cycles if: src3 is in external memory and src4 is in internal memory src3 and src4 are in external memory For ...

  • Texas Instruments TMS320C3x - page 611

    Parallel MPYF3 and STF MPYF3||STF 13-153 Assembly Language Instructions Syntax MPYF3 src2, src1, dst || STF src3, dst2 Operation src1 × src2 → dst1 || src3 → dst2 Operands src1 register (R n 1, 0 ≤ n 1 ≤ 7) src2 indirect ( disp = 0, 1, IR0, IR1) dst1 register (R n 3, 0 ≤ n 3 ≤ 7) src3 register (R n 4, 0 ≤ n 4 ≤ 7) dst2 indirect ( d ...

  • Texas Instruments TMS320C3x - page 612

    MPYF3||STF Parallel MPYF3 and STF 13-154 Status Bits These condition flags are modified only if the destination register is R7 – R0. LUF 1 if a floating-point underflow occurs; 0 unchanged otherwise LV 1 if a floating-point overflow occurs; unchanged otherwise UF 1 if a floating-point underflow occurs; 0 otherwise N 1 if a negative result is gene ...

  • Texas Instruments TMS320C3x - page 613

    Parallel MPYF3 and SUBF3 MPYF3||SUBF3 13-155 Assembly Language Instructions Syntax MPYF3 srcA, srcB, dst1 || SUBF3 srcC, srcD, dst2 Operation srcA × srcB → dst1 || srcD – srcC → dst2 Operands srcA srcB srcC srcD Any two register (0 R n 7) Any two indirect ( disp = 0, 1, IR0, IR1) dst1 register ( d1 ): 0 = R0 1 = R1 dst2 register ( d2 ): 0 = ...

  • Texas Instruments TMS320C3x - page 614

    MPYF3||ADDF3 Parallel MPYF3 and ADDF3 13-156 This instruction’s operands have been augmented in the following devices: ’C31 silicon version 6.0 or greater ’C32 silicon version 2.0 or greater srcA , srcB , srcC , srcD can be one of the following combinations: Register (0 R n 7) Indirect ( disp = 0, 1, IR0, IR1) Any CPU Register 2 2 – 211 2 ? ...

  • Texas Instruments TMS320C3x - page 615

    Parallel MPYF3 and SUBF3 MPYF3||SUBF3 13-157 Assembly Language Instructions Opcode 31 24 23 16 8 7 0 15 1 0 00 01 src 4 src 3 P src 1 src 2 d1 d2 Description A floating-point multiplication and a floating-point subtraction are performed in parallel. All registers are read at the beginning and loaded at the end of the execute cycle. If one of the pa ...

  • Texas Instruments TMS320C3x - page 616

    MPYF3||SUBF3 Parallel MPYF3 and SUBF3 13-158 Status Bits These condition flags are modified only if the destination register is R7 – R0. LUF 1 if a floating-point underflow occurs; unchanged otherwise LV 1 if a floating-point overflow occurs; unchanged otherwise UF 1 if a floating-point underflow occurs; 0 otherwise N 0 Z 0 V 1 if a floating-poin ...

  • Texas Instruments TMS320C3x - page 617

    Multiply Integer MPYI 13-159 Assembly Language Instructions Syntax MPYI src, dst Operation dst × src → dst Operands src general addressing modes (G): 0 0 any CPU register 0 1 direct 1 0 indirect (disp = 0–255, IR0, IR1) 1 1 immediate dst any CPU register Opcode 31 24 23 16 8 7 0 15 00 0 0 1 0 1 1 0 dst G src Description The product of the dst ...

  • Texas Instruments TMS320C3x - page 618

    MPYI Multiply Integer 13-160 Example MPYI R1,R5 Before Instruction After Instruction R1 00 0033 C251 R1 00 0033 C251 R5 00 0078 B600 R5 00 E21D 9600 LUF 0 LUF 0 LV 0 LV 1 UF 0 UF 0 N 0 N 1 Z 0 Z 0 V 0 V 1 C 0 C 0 3,392,081 7,910,912 –501,377,536 3,392,081 ...

  • Texas Instruments TMS320C3x - page 619

    Multiply Integer , 3-Operand MPYI3 13-161 Assembly Language Instructions Syntax MPYI3 src2, src1, dst Operation src1 × src2 → dst Operands src1 3-operand addressing modes (T): 0 0 any CPU register 0 1 indirect ( disp = 0, 1, IR0, IR1) 1 0 any CPU register 1 1 indirect ( disp = 0, 1, IR0, IR1) src2 3-operand addressing modes (T): 0 0 any CPU regi ...

  • Texas Instruments TMS320C3x - page 620

    MPYI3 Multiply Integer , 3-Operand 13-162 Example 1 MPYI3 *AR4,*–AR1(1),R2 Before Instruction After Instruction R2 00 0000 0000 R2 00 0000 94AC AR1 80 98F3 AR1 80 98F3 AR4 80 9850 AR4 80 9850 LUF 0 LUF 0 LV 0 LV 0 UF 0 UF 0 N 0 N 0 Z 0 Z 0 V 0 V 0 C 0 C 0 Data memory 809850h 0AD 809850h 0AD 8098F2h 0DC 8098F2h 0DC 173 38,060 220 173 220 Example 2 ...

  • Texas Instruments TMS320C3x - page 621

    Parallel MPYI3 and ADDI3 MPYI3||ADDI3 13-163 Assembly Language Instructions Syntax MPYI3 srcA, srcB, dst1 || ADDI3 srcC, srcD, dst2 Operation srcA × srcB → dst1 || srcD + srcC → dst2 Operands srcA srcB srcC srcD Any two indirect ( disp = 0, 1, IR0, IR1) Any two register (0 R n 7) srcA , srcB , srcC , srcD can be one of the following combinatio ...

  • Texas Instruments TMS320C3x - page 622

    MPYI3||ADDI3 Parallel MPYI3 and ADDI3 13-164 This instruction’s operands have been augmented in the following devices: ’C31 silicon version 6.0 or greater ’C32 silicon version 2.0 or greater srcA , srcB , srcC , srcD can be one of the following combinations: Register (0 R n 7) Indirect ( disp = 0,1,IR0,IR1) Any CPU Register 2 2 – 211 2 – ...

  • Texas Instruments TMS320C3x - page 623

    Parallel MPYI3 and ADDI3 MPYI3||ADDI3 13-165 Assembly Language Instructions Opcode 31 24 23 16 8 7 0 15 10 0 01 0 P src 4 src 3 src 1 src 2 d1 d2 Description An integer multiplication and an integer addition are performed in parallel. All registers are read at the beginning and loaded at the end of the execute cycle. This means that if one of the p ...

  • Texas Instruments TMS320C3x - page 624

    MPYl3||ADDl3 Parallel MPYl3 and ADD13 13-166 Before Instruction After Instruction R0 00 0000 0000 R0 00 0000 07D0 R3 00 0000 0000 R3 00 0000 0000 R4 00 0000 0064 R4 00 0000 0064 R7 00 0000 0014 R7 00 0000 0014 AR3 80 981F AR3 80 981F AR5 80 996E AR5 80 996D LUF 0 LUF 0 LV 0 LV 0 UF 0 UF 0 N 0 N 0 Z 0 Z 0 V 0 V 0 C 0 C 0 Data memory 80981Eh 0FFFFFFC ...

  • Texas Instruments TMS320C3x - page 625

    Parallel MPYI3 and STI MPYI3||STI 13-167 Assembly Language Instructions Syntax MPYI3 src2, src1, dst1 || STI src3, dst2 Operation src1 × src2 → dst1 || src3 → dst2 Operands src1 register (R n 1, 0 ≤ n 1 ≤ 7) src2 indirect ( disp = 0, 1, IR0, IR1) dst1 register (R n 3, 0 ≤ n 3 ≤ 7) src3 register (R n 4, 0 ≤ n 4 ≤ 7) dst2 indirect ( ...

  • Texas Instruments TMS320C3x - page 626

    MPYI3||STI Parallel MPYl3 and STI 13-168 Status Bits These condition flags are modified only if the destination register is R7 – R0. LUF Unaffected LV 1 if an integer overflow occurs; unchanged otherwise UF 0 N 1 if a negative result is generated; 0 otherwise Z 1 if a 0 result is generated; 0 otherwise V 1 if an integer overflow occurs; 0 otherwi ...

  • Texas Instruments TMS320C3x - page 627

    Parallel MPYI3 and SUBI3 MPYI3||SUBI3 13-169 Assembly Language Instructions Syntax MPYI3 srcA, srcB, dst1 || SUBI3 srcC, srcD, dst2 Operation srcA × srcB → dst1 || srcD – srcC → dst2 Operands srcA srcB srcC srcD Any two indirect ( disp = 0, 1, IR0, IR1) Any two register (0 R n 7) srcA , srcB , srcC , srcD can be one of the following combinat ...

  • Texas Instruments TMS320C3x - page 628

    MPYI3||SUBI3 Parallel MPYI3 and SUBI3 13-170 This instruction’s operands have been augmented in the following devices: ’C31 silicon version 6.0 or greater ’C32 silicon version 2.0 or greater srcA , srcB , srcC , srcD can be one of the following combinations: Register (0 R n 7) Indirect ( disp = 0, 1, IR0, IR1) Any CPU Register 2 2 – 211 2 ? ...

  • Texas Instruments TMS320C3x - page 629

    Parallel MPYI3 and SUBI3 MPYI3||SUBI3 13-171 Assembly Language Instructions V ersion 5.0 or later P srcA srcB srcD srcC 00 src3 × src4, src1 + src2 01 src3 × src1, src4 + src2 10 src1 × src2, src3 + src4 11 src3 × src1, src2 + src4 Opcode 31 24 23 16 8 7 0 15 10 0 0 1 1 P src 4 src 3 src 1 src 2 d1 d2 Description An integer multiplication and a ...

  • Texas Instruments TMS320C3x - page 630

    MPYI3||SUBI3 Parallel MPYI3 and SUBI3 13-172 or MPYI3 *++AR0(1),R2,R0 || SUBI3 *AR5 –– (IR1),R4,R2 Before Instruction After Instruction R0 00 0000 0000 R0 00 0000 1324 R2 00 0000 0032 R2 00 0000 0320 R4 00 0000 07D0 R4 00 0000 07D0 AR0 80 98E3 AR0 80 98E4 AR5 80 99FC AR5 80 99F0 IR1 0C IR1 0C LUF 0 LUF 0 LV 0 LV 0 UF 0 UF 0 N 0 N 0 Z 0 Z 0 V 0 ...

  • Texas Instruments TMS320C3x - page 631

    Negative Integer With Borrow NEGB 13-173 Assembly Language Instructions Syntax NEGB src, dst Operation 0 – src – C → dst Operands src general addressing modes (G): 0 0 any CPU register 0 1 direct 1 0 indirect (disp = 0–255, IR0, IR1) 1 1 immediate dst any CPU register Opcode 31 24 23 16 8 7 0 15 00 0 0 1 1 1 0 0 dst G src Description The di ...

  • Texas Instruments TMS320C3x - page 632

    NEGF Negate Floating-Point V alue 13-174 Syntax NEGF src, dst Operation 0 – src → dst Operands src general addressing modes (G): 0 0 register (R n , 0 ≤ n ≤ 7) 0 1 direct 1 0 indirect (disp = 0–255, IR0, IR1) 1 1 immediate dst register (R n , 0 ≤ n ≤ 7) Opcode 31 24 23 16 8 7 0 15 00 0 0 1 1 1 1 0 dst G src Description The difference ...

  • Texas Instruments TMS320C3x - page 633

    Negate Floating-Point V alue NEGF 13-175 Assembly Language Instructions Example NEGF *++AR3(2),R1 Before Instruction After Instruction R1 05 7B40 0025 R1 07 F380 0000 AR3 80 9800 AR3 80 9802 LUF 0 LUF 0 LV 0 LV 0 UF 0 UF 0 N 0 N 0 Z 0 Z 0 V 0 V 0 C 0 C 0 Data memory 809802h 70C8000 809802h 70C8000 6.28125006e+01 –1.4050e+02 1.4050e+02 1.4050e+02 ...

  • Texas Instruments TMS320C3x - page 634

    NEGF||STF Parallel NEGF and STF 13-176 Syntax NEGF src2, dst1 || STF src3, dst2 Operation 0 – src2 → dst1 || src3 → dst2 Operands src2 indirect ( disp = 0, 1, IR0, IR1) dst1 register (R n 1, 0 ≤ n 1 ≤ 7) src3 register (R n 2, 0 ≤ n 2 ≤ 7) dst2 indirect ( disp = 0, 1, IR0, IR1) This instruction’s operands have been augmented in the f ...

  • Texas Instruments TMS320C3x - page 635

    Parallel NEGF and STF NEGF||STF 13-177 Assembly Language Instructions Example NEGF *AR4 –– (1),R7 || STF R2,*++AR5(1) Before Instruction After Instruction R2 07 33C0 0000 R2 07 33C0 0000 R7 00 0000 0000 R7 05 84C0 0000 AR4 80 98E1 AR4 80 98E0 AR5 80 9803 AR5 80 9804 LUF 0 LUF 0 LV 0 LV 0 UF 0 UF 0 N 0 N 0 Z 0 Z 0 V 0 V 0 C 0 C 0 Data memory 809 ...

  • Texas Instruments TMS320C3x - page 636

    NEGI Negate Integer 13-178 Syntax NEGI src, dst Operation 0 – src → dst Operands src general addressing modes (G): 0 0 any CPU register 0 1 direct 1 0 indirect (disp = 0–255, IR0, IR1) 1 1 immediate dst any CPU register Opcode 31 24 23 16 8 7 0 15 00 0 0 1 0 0 0 1 dst G src Description The difference of the 0 and src operands is loaded into t ...

  • Texas Instruments TMS320C3x - page 637

    Parallel NEGI and STI NEGI||STI 13-179 Assembly Language Instructions Syntax NEGI src2, dst1 || STI src3, dst2 Operation 0 – src2 → dst1 || src3 → dst2 Operands src2 indirect ( disp = 0, 1, IR0, IR1) dst1 register (R n 1, 0 ≤ n 1 ≤ 7) src3 register (R n 2, 0 ≤ n 2 ≤ 7) dst2 indirect ( disp = 0, 1, IR0, IR1) This instruction’s operan ...

  • Texas Instruments TMS320C3x - page 638

    NEGI||STI Parallel NEGI and STI 13-180 Example NEGI *–AR3,R2 || STI R2,*AR1++ Before Instruction After Instruction R2 00 0000 0019 R2 00 FFFF FF24 AR1 80 98A5 AR1 80 98A6 AR3 80 982F AR3 80 982F LUF 0 LUF 0 LV 0 LV 0 UF 0 UF 0 N 0 N 1 Z 0 Z 0 V 0 V 0 C 0 C 1 Data memory 80982Eh 0DC 80982Eh 0DC 8098A5h 0 8098A5h 19 25 220 –220 220 25 Note: Cycle ...

  • Texas Instruments TMS320C3x - page 639

    No Operation NOP 13-181 Assembly Language Instructions Syntax NOP src Operation No ALU or multiplier operations. AR n is modified if src is specified in indirect mode. Operands src general addressing modes (G): 0 0 register (no operation) 1 0 indirect (modify AR n , 0 ≤ n ≤ 7) (disp = 0–255, IR0, IR1) Opcode 31 24 23 16 8 7 0 15 00 0 0 1 0 0 ...

  • Texas Instruments TMS320C3x - page 640

    NORM Normalize 13-182 Syntax NORM src, dst Operation norm ( src ) → dst Operands src general addressing modes (G): 0 0 register (R n , 0 ≤ n ≤ 7) 0 1 direct 1 0 indirect (disp = 0–255, IR0, IR1) 1 1 immediate Opcode 31 24 23 16 8 7 0 15 00 0 0 1 1 0 0 1 dst src G Description The src operand is assumed to be an unnormalized floating-point nu ...

  • Texas Instruments TMS320C3x - page 641

    Normalize NORM 13-183 Assembly Language Instructions Example NORM R1,R2 Before Instruction After Instruction R1 04 0000 3AF5 R1 04 0000 3AF5 R2 07 0C80 0000 R2 F2 6BD4 0000 LUF 0 LUF 0 LV 0 LV 0 UF 0 UF 0 N 0 N 0 Z 0 Z 0 V 0 V 0 C 0 C 0 1.12451613e – 04 ...

  • Texas Instruments TMS320C3x - page 642

    NOT Bitwise-Logical Complement 13-184 Syntax NOT src, dst Operation ∼ src → dst Operands src general addressing modes (G): 0 0 any CPU register 0 1 direct 1 0 indirect (disp = 0–255, IR0, IR1) 1 1 immediate dst any CPU register Opcode 31 24 23 16 8 7 0 15 000 0 1 1 0 1 1 dst src G Description The bitwise-logical complement of the src operand ...

  • Texas Instruments TMS320C3x - page 643

    Bitwise-Logical Complement NOT 13-185 Assembly Language Instructions Example NOT @982Ch,R4 Before Instruction After Instruction R4 00 0000 0000 R4 00 FFFF A1D0 DP 080 DP 080 LUF 0 LUF 0 LV 0 LV 0 UF 0 UF 0 N 0 N 1 Z 0 Z 0 V 0 V 0 C 0 C 0 Data memory 80982Ch 5E2F 80982Ch 5E2F ...

  • Texas Instruments TMS320C3x - page 644

    NOT||STI Parallel NOT and STI 13-186 Syntax NOT src2, dst1 || STI src3, dst2 Operation ∼ src2 → dst1 || src3 → dst2 Operands src2 indirect ( disp = 0, 1, IR0, IR1) dst1 register (R n 1, 0 ≤ n 1 ≤ 7) src3 register (R n 2, 0 ≤ n 2 ≤ 7) dst2 indirect ( disp = 0, 1, IR0, IR1) This instruction’s operands have been augmented in the follow ...

  • Texas Instruments TMS320C3x - page 645

    Parallel NOT and STI NOT||STI 13-187 Assembly Language Instructions Example NOT *+AR2,R3 || STI R7,* –– AR4 (IR1) Before Instruction After Instruction R3 00 0000 0000 R3 00 FFFF F3D0 R7 00 0000 00DC R7 00 0000 00DC AR2 80 99CB AR2 80 99CB AR4 80 9850 AR4 80 9840 IR1 10 IR1 10 LUF 0 LUF 0 LV 0 LV 0 UF 0 UF 0 N 0 N 1 Z 0 Z 0 V 0 V 0 C 0 C 0 Data ...

  • Texas Instruments TMS320C3x - page 646

    OR Bitwise-Logical OR 13-188 Syntax OR src, dst Operation dst OR src → dst Operands src general addressing modes (G): 0 0 any CPU register 0 1 direct 1 0 indirect (disp = 0–255, IR0, IR1) 1 1 immediate (not sign-extended) dst any CPU register Opcode 31 24 23 16 8 7 0 15 00 0 1 0 0 0 0 0 dst src G Description The bitwise-logical OR between the s ...

  • Texas Instruments TMS320C3x - page 647

    Bitwise-Logical OR OR 13-189 Assembly Language Instructions Example OR *++AR1(IR1),R2 Before Instruction After Instruction R2 00 1256 0000 R2 00 1256 2BCD AR1 80 9800 AR1 80 9804 IR1 4 IR1 4 LUF 0 LUF 0 LV 0 LV 0 UF 0 UF 0 N 0 N 0 Z 0 Z 0 V 0 V 0 C 0 C 0 Data memory 809804h 2BCD 809804h 2BCD ...

  • Texas Instruments TMS320C3x - page 648

    OR3 Bitwise-Logical OR, 3-Operand 13-190 Syntax OR3 src2, src1, dst Operation src1 OR src2 → dst Operands src1 3-operand addressing modes (T): 0 0 register (R n 1, 0 ≤ n 1 ≤ 27) 0 1 indirect ( disp = 0, 1, IR0, IR1) 1 0 register (R n 1, 0 ≤ n 1 ≤ 27) 1 1 indirect ( disp = 0, 1, IR0, IR1) src2 3-operand addressing modes (T): 0 0 register ( ...

  • Texas Instruments TMS320C3x - page 649

    Bitwise-Logical OR, 3-Operand OR3 13-191 Assembly Language Instructions Example OR3 *++AR1(IR1),R2,R7 Before Instruction After Instruction R2 00 1256 0000 R2 00 1256 0000 R7 00 0000 0000 R7 0 1256 2BCD AR1 80 9800 AR1 80 9804 IR1 4 IR1 4 LUF 0 LUF 0 LV 0 LV 0 UF 0 UF 0 N 0 N 0 Z 0 Z 0 V 0 V 0 C 0 C 0 Data memory 809804h 2BCD 809804h 2BCD Note: Cycl ...

  • Texas Instruments TMS320C3x - page 650

    OR3||STI Parallel OR3 and STI 13-192 Syntax OR3 src2, src1, dst1 || STI src3, dst2 Operation src1 OR src2 → dst1 | src3 → dst2 Operands src1 register (R n 1, 0 ≤ n 1 ≤ 7) src2 indirect ( disp = 0, 1, IR0, IR1) dst1 register (R n 2, 0 ≤ n 2 ≤ 7) src3 register (R n 3, 0 ≤ n 3 ≤ 7) dst2 indirect ( disp = 0, 1, IR0, IR1) This instructio ...

  • Texas Instruments TMS320C3x - page 651

    Parallel OR3 and STI OR3||STI 13-193 Assembly Language Instructions Status Bits These condition flags are modified only if the destination register is R7 – R0. LUF Unaffected LV Unaffected UF 0 N MSB of the output Z 1 if a 0 result is generated; 0 otherwise V 0 C Unaffected OVM Operation is not affected by OVM bit value. Example OR3 *++AR2,R5,R2 ...

  • Texas Instruments TMS320C3x - page 652

    POP Pop Integer 13-194 Syntax POP dst Operation *SP– – → dst Operands dst register (R n , 0 ≤ n ≤ 27) Opcode 31 24 23 16 8 7 0 15 00 0 01 0 1 0 1 dst 1 0 0 0 0 00 0 0 0 0 0 00 0 00 0 Description The top of the current system stack is popped and loaded into the dst register (32 LSBs). The top of the stack is assumed to be a signed integer ...

  • Texas Instruments TMS320C3x - page 653

    Pop Floating-Point V alue POPF 13-195 Assembly Language Instructions Syntax POPF dst Operation *SP– – → dst1 Operands dst register (R n , 0 ≤ n ≤ 7) Opcode 31 24 23 16 8 7 0 15 00 0 0 1 0 1 1 1 dst 0 0 1 0 00 000 0 0 00 0 0 0 0 0 0 Description The top of the current system stack (32 MSBs) is popped and loaded into the dst register . The t ...

  • Texas Instruments TMS320C3x - page 654

    PUSH PUSH Integer 13-196 Syntax PUSH src Operation src → *++SP Operands src register (R n , 0 ≤ n ≤ 27) Opcode 31 24 23 16 8 7 0 15 00 0 0 1 1 1 0 1 src 0 0 1 00 0 0 0 00 0 00 000 00 0 Description The contents of the src register (32 LSBs) are pushed on the current system stack. The src is assumed to be a signed integer . The PUSH is performe ...

  • Texas Instruments TMS320C3x - page 655

    PUSH Floating-Point V alue PUSHF 13-197 Assembly Language Instructions Syntax PUSHF src Operation src → *++SP Operands src register (R n , 0 ≤ n ≤ 7) Opcode 31 24 23 16 8 7 0 15 00 0 0 1 1 1 1 1 src 0 0 1 00 0 0 0 0 0 0 00 0 0 0 0 00 Description The contents of the src register (32 MSBs) are pushed on the current system stack. The src is assu ...

  • Texas Instruments TMS320C3x - page 656

    RETIcond Return From Interrupt Conditionally 13-198 Syntax RETI cond Operation If cond is true: *SP – – → PC 1 → ST (GIE). Else, continue. Operands None Opcode 31 24 23 16 8 7 0 15 01 1 1 1 0 0 0 0 cond 0 0 0 0 00 000 0 0 00 00 00 0 0 Description A conditional return is performed. If the condition is true, the top of the stack is popped to ...

  • Texas Instruments TMS320C3x - page 657

    Return From Interrupt Conditionally RETIcond 13-199 Assembly Language Instructions Example RETINZ Before Instruction After Instruction PC 0456 PC 0123 SP 809830 SP 80982F ST 0 ST 2000 LUF 0 LUF 0 LV 0 LV 0 UF 0 UF 0 N 0 N 0 Z 0 Z 0 V 0 V 0 C 0 C 0 Data memory 809830h 123 809830h 123 ...

  • Texas Instruments TMS320C3x - page 658

    RETScond Return From Subroutine Conditionally 13-200 Syntax RETS cond Operation If cond is true: *SP– – → PC. Else, continue. Operands None Opcode 31 24 23 16 8 7 0 15 01 1 1 1 0 0 1 0 cond 0 0 0 00 0 0 0 0 0 0 00 0 0 0 0 0 0 Description A conditional return is performed. If the condition is true, the top of the stack is popped to the PC. The ...

  • Texas Instruments TMS320C3x - page 659

    Return From Subroutine Conditionally RETScond 13-201 Assembly Language Instructions Example RETSGE Before Instruction After Instruction PC 0123 PC 0456 SP 80983C SP 80983B LUF 0 LUF 0 LV 0 LV 0 UF 0 UF 0 N 0 N 0 Z 0 Z 0 V 0 V 0 C 0 C 0 Data memory 80983Ch 456 80983Ch 456 ...

  • Texas Instruments TMS320C3x - page 660

    RND Round Floating-Point V alue 13-202 Syntax RND src, dst Operation rnd( src ) → dst Operands src general addressing modes (G): 0 0 register (R n , 0 ≤ n ≤ 7) 0 1 direct 1 0 indirect (disp = 0–255, IR0, IR1) 1 1 immediate dst register (R n , 0 ≤ n ≤ 7) Opcode 31 24 23 16 8 7 0 15 00 0 10 1 0 0 0 dst src G Description The result of roun ...

  • Texas Instruments TMS320C3x - page 661

    Round Floating-Point V alue RND 13-203 Assembly Language Instructions Example RND R5,R2 Before Instruction After Instruction R2 00 0000 0000 R2 07 33C1 6F00 R5 07 33C1 6EEF R5 07 33C1 6EEF LUF 0 LUF 0 LV 0 LV 0 UF 0 UF 0 N 0 N 0 Z 0 Z 0 V 0 V 0 C 0 C 0 1.79755599e+02 1.79755599e+02 1.79755600e+02 Note: BZUF Instruction If a BZ instruction is execut ...

  • Texas Instruments TMS320C3x - page 662

    ROL Rotate Left 13-204 Syntax ROL dst Operation dst left-rotated 1 bit → dst Operands dst register (R n , 0 ≤ n ≤ 27) Opcode 31 24 23 16 8 7 0 15 000 1 0 1 0 1 0 dst 1 1 0 0000 0 0 00 000 0 00 1 Description The contents of the dst operand are left rotated one bit and loaded into the dst register . This is a circular rotation, with the MSB sim ...

  • Texas Instruments TMS320C3x - page 663

    Rotate Left Through Carry ROLC 13-205 Assembly Language Instructions Syntax ROLC dst Operation dst left-rotated one bit through carry bit → dst Operands dst register (R n , 0 ≤ n ≤ 27) Opcode 31 24 23 16 8 7 0 15 00 0 1 0 0 1 0 0 dst 1 1 0 0000 0 0 00 000 0 0 0 1 Description The contents of the dst operand are left rotated one bit through the ...

  • Texas Instruments TMS320C3x - page 664

    ROLC Rotate Left Through Carry 13-206 Example 2 ROLC R3 Before Instruction After Instruction R3 00 8000 4281 R3 00 0000 8502 LUF 0 LUF 0 LV 0 LV 0 UF 0 UF 0 N 0 N 0 Z 0 Z 0 V 0 V 0 C 0 C 1 ...

  • Texas Instruments TMS320C3x - page 665

    Rotate Right ROR 13-207 Assembly Language Instructions Syntax ROR dst Operation dst right-rotated one bit through carry bit → dst Operands dst register (R n , 0 ≤ n ≤ 27) Opcode 31 24 23 16 8 7 0 15 00 0 1 0 0 1 1 0 dst 11 1 1 11 1 1 1 1 1 1 1 1 1 11 1 Description The contents of the dst operand are right rotated one bit and loaded into the d ...

  • Texas Instruments TMS320C3x - page 666

    RORC Rotate Right Through Carry 13-208 Syntax RORC dst Operation dst right-rotated one bit through carry bit → dst Operands dst register (R n , 0 ≤ n ≤ 27) Opcode 31 24 23 16 8 7 0 15 00 0 1 0 1 1 0 0 dst 1 1 1 1 1 1 1 1 11 11 1 1 11 1 1 Description The contents of the dst operand are right rotated one bit through the status reg- ister ’s c ...

  • Texas Instruments TMS320C3x - page 667

    Repeat Block RPTB 13-209 Assembly Language Instructions Syntax RPTB src Operation src → RE 1 → ST (RM) Next PC → RS Operands src long-immediate addressing mode Opcode 31 24 23 16 8 7 0 15 01 1 0 0 0 0 1 src Description RPTB allows a block of instructions to be repeated RC register + 1 times with- out any penalty for looping. This instruction ...

  • Texas Instruments TMS320C3x - page 668

    RPTB Repeat Block 13-210 Example RPTB 127h Before Instruction After Instruction PC 0123 PC 0124 RE 0 RE 127 RS 0 RS 124 ST 0 ST 100 LUF 0 LUF 0 LV 0 LV 0 UF 0 UF 0 N 0 N 0 Z 0 Z 0 V 0 V 0 C 0 C 0 Because the block-repeat modes modify the program counter , no other instruction can modify the program counter at the same time. The following two rules ...

  • Texas Instruments TMS320C3x - page 669

    Repeat Single Instruction RPTS 13-21 1 Assembly Language Instructions Syntax RPTS src Operation src → RC 1 → ST (RM) 1 → S Next PC → RS Next PC → RE Operands src general addressing modes (G): 0 0 register 0 1 direct 1 0 indirect (disp = 0–255, IR0, IR1) 1 1 immediate Opcode 31 24 23 16 8 7 0 15 00 0 1 0 1 1 1 0 1 src G 11 1 0 Descriptio ...

  • Texas Instruments TMS320C3x - page 670

    RPTS Repeat Single Instruction 13-212 Example RPTS AR5 Before Instruction After Instruction AR5 00 00FF AR5 00 00FF PC 0123 PC 0124 RC 0 RC 0FF RE 0 RE 124 RS 0 RS 124 ST 0 ST 100 LUF 0 LUF 0 LV 0 LV 0 UF 0 UF 0 N 0 N 0 Z 0 Z 0 V 0 V 0 C 0 C 0 Because the block-repeat modes modify the program counter , no other instruction can modify the program co ...

  • Texas Instruments TMS320C3x - page 671

    Signal, Interlocked SIGI 13-213 Assembly Language Instructions Syntax SIGI Operation Signal interlocked operation. W ait for interlock acknowledge. Clear interlock. Operands None Opcode 31 24 23 16 8 7 0 15 00 0 1 0 0 1 0 10 00 0 00 00 0 0 0 000 0 0 000 00 0 0 Description An interlocked operation is signaled over XF0 and XF1. After the interlocked ...

  • Texas Instruments TMS320C3x - page 672

    STF Store Floating-Point V alue 13-214 Syntax STF src, dst Operation src → dst Operands src register (R n , 0 ≤ n ≤ 7) dst general addressing modes (G): 0 1 direct 1 0 indirect (disp = 0–255, IR0, IR1) Opcode 31 24 23 16 8 7 0 15 00 0 1 0 0 0 0 1 src G dst Description The src register is loaded into the dst memory location. The src and dst ...

  • Texas Instruments TMS320C3x - page 673

    Store Floating-Point V alue, Interlocked STFI 13-215 Assembly Language Instructions Syntax STFI src, dst Operation src → dst Signal end of interlocked operation. Operands src register (R n , 0 ≤ n ≤ 7) dst general addressing modes (G): 0 1 direct 1 0 indirect (disp = 0–255, IR0, IR1) Opcode 31 24 23 16 8 7 0 15 00 0 10 0 0 1 1 src G dst Des ...

  • Texas Instruments TMS320C3x - page 674

    STFI Store Floating-Point V alue, Interlocked 13-216 Note: The STFI instruction is not interruptible because it completes when ready is signaled. See Section 7.4, Interlocked Operations, on page 7-13. ...

  • Texas Instruments TMS320C3x - page 675

    Parallel Store Floating-Point V alue STF||STF 13-217 Assembly Language Instructions Syntax STF src2, dst2 || STF src1 , dst1 Operation src2 → dst2 || src1 → dst1 Operands src1 register (R n 1, 0 ≤ n 1 ≤ 7) dst1 indirect ( disp = 0, 1, IR0, IR1) src2 register (R n 2, 0 ≤ n 2 ≤ 7) dst2 indirect ( disp = 0, 1, IR0, IR1) This instruction’ ...

  • Texas Instruments TMS320C3x - page 676

    STF||STF Parallel Store Floating-Point V alue 13-218 Example STF R4,*AR3 –– || STF R3,*++AR5 Before Instruction After Instruction R3 07 33C0 0000 R3 07 33C0 0000 R4 07 0C80 0000 R4 07 0C80 0000 AR3 80 9835 AR3 80 9834 AR5 80 99D2 AR5 80 99D3 LUF 0 LUF 0 LV 0 LV 0 UF 0 UF 0 N 0 N 0 Z 0 Z 0 V 0 V 0 C 0 C 0 Data memory 809835h 0 809835h 070C8000 8 ...

  • Texas Instruments TMS320C3x - page 677

    Store Integer STI 13-219 Assembly Language Instructions Syntax STI src, dst Operation src → dst Operands src register (R n , 0 ≤ n ≤ 27) dst general addressing modes (G): 0 1 direct 1 0 indirect (disp = 0–255, IR0, IR1) Opcode 31 24 23 16 8 7 0 15 00 0 1 0 1 0 0 1 src G dst Description The src register is loaded into the dst memory location ...

  • Texas Instruments TMS320C3x - page 678

    STII Store Integer , Interlocked 13-220 Syntax STII src, dst Operation src → dst Signal end of interlocked operation Operands src register (R n , 0 ≤ n ≤ 27) dst general addressing modes (G): 0 1 direct 1 0 indirect (disp = 0–255, IR0, IR1) Opcode 31 24 23 16 8 7 0 15 00 0 1 0 1 0 1 1 src G dst Description The src register is loaded into th ...

  • Texas Instruments TMS320C3x - page 679

    Parallel STI and STI STI||STI 13-221 Assembly Language Instructions Syntax STI src2, dst2 || STI src1, dst1 Operation src2 → dst2 || src1 → dst1 Operands src1 register (R n 1, 0 ≤ n 1 ≤ 7) dst1 indirect ( disp = 0, 1, IR0, IR1) src2 register (R n 2, 0 ≤ n 2 ≤ 7) dst2 indirect ( disp = 0, 1, IR0, IR1) This instruction’s operands have b ...

  • Texas Instruments TMS320C3x - page 680

    STI||STI Parallel STI and STI 13-222 Example STI R0,*++AR2(IR0) || STI R5,*AR0 Before Instruction After Instruction R0 00 0000 00DC R0 00 0000 00DC R5 00 0000 0035 R5 00 0000 0035 AR0 80 98D3 AR0 80 98D3 AR2 80 9830 AR2 80 9838 IR0 8 IR0 8 LUF 0 LUF 0 LV 0 LV 0 UF 0 UF 0 N 0 N 0 Z 0 Z 0 V 0 V 0 C 0 C 0 Data memory 809838h 0 809838h 0DC 8098D3h 0 80 ...

  • Texas Instruments TMS320C3x - page 681

    Subtract Integer With Borrow SUBB 13-223 Assembly Language Instructions Syntax SUBB src, dst Operation dst – src – C → dst Operands src general addressing modes (G): 0 0 register (R n , 0 ≤ n ≤ 27) 0 1 direct 1 0 indirect (disp = 0–255, IR0, IR1) 1 1 immediate dst register (R n , 0 ≤ n ≤ 27) Opcode 31 24 23 16 8 7 0 15 00 0 1 0 0 1 ...

  • Texas Instruments TMS320C3x - page 682

    SUBB3 Subtract Integer With Borrow , 3-Operand 13-224 Syntax SUBB3 src2, src1, dst Operation src1 – src2 – C → dst Operands src1 3-operand addressing modes (T): 0 0 register (R n 1, 0 ≤ n 1 ≤ 27) 0 1 indirect ( disp = 0, 1, IR0, IR1) 1 0 register (R n 1, 0 ≤ n 1 ≤ 27) 1 1 indirect ( disp = 0, 1, IR0, IR1) src2 3-operand addressing mod ...

  • Texas Instruments TMS320C3x - page 683

    Subtract Integer With Borrow , 3-Operand SUBB3 13-225 Assembly Language Instructions Example SUBB3 R5,*AR5++(IR0),R0 Before Instruction After Instruction R0 00 0000 0000 R0 00 0000 0032 R5 00 0000 00C7 R5 00 0000 00C7 AR5 80 9800 AR5 80 9804 IR0 4 IR0 4 LUF 0 LUF 0 LV 0 LV 0 UF 0 UF 0 N 0 N 0 Z 0 Z 0 V 0 V 0 C 1 C 0 Data memory 809800h 0FA 809800h ...

  • Texas Instruments TMS320C3x - page 684

    SUBC Subtract Integer Conditionally 13-226 Syntax SUBC src, dst Operation If ( dst – src ≥ 0): ( dst – src << 1) OR 1 → dst Else: dst << 1 → dst Operands src general addressing modes (G): 0 0 register (R n , 0 ≤ n ≤ 27) 0 1 direct 1 0 indirect (disp = 0–255, IR0, IR1) 1 1 immediate dst register (R n , 0 ≤ n ≤ 27) Opc ...

  • Texas Instruments TMS320C3x - page 685

    Subtract Integer Conditionally SUBC 13-227 Assembly Language Instructions Example 1 SUBC @98C5h,R1 Before Instruction After Instruction R1 00 0000 04F6 R1 00 0000 00C9 DP 080 DP 080 LUF 0 LUF 0 LV 0 LV 0 UF 0 UF 0 N 0 N 0 Z 0 Z 0 V 0 V 0 C 0 C 0 Data memory 8098C5h 492 8098C5h 492 201 1170 1270 1170 Example 2 SUBC 3000,R0 (3000 = 0BB8h) Before Inst ...

  • Texas Instruments TMS320C3x - page 686

    SUBF Subtract Floating-Point V alue 13-228 Syntax SUBF src , dst Operation dst – src → dst Operands src general addressing modes (G): 0 0 register (R n , 0 ≤ n ≤ 7) 0 1 direct 1 0 indirect (disp = 0–255, IR0, IR1) 1 1 immediate dst register (R n , 0 ≤ n ≤ 7) Opcode 31 24 23 16 8 7 0 15 00 0 1 0 1 1 1 1 dst G src Description The differ ...

  • Texas Instruments TMS320C3x - page 687

    Subtract Floating-Point V alue SUBF 13-229 Assembly Language Instructions Example SUBF *AR0 –– (IR0),R5 Before Instruction After Instruction R5 07 33C0 0000 R5 05 1D00 0000 AR0 80 9888 AR0 80 9808 IR0 80 IR0 80 LUF 0 LUF 0 LV 0 LV 0 UF 0 UF 0 N 0 N 0 Z 0 Z 0 V 0 V 0 C 0 C 0 Data memory 809888h 70C8000 809888h 70C8000 3.9250e+01 1.4050e+02 1.405 ...

  • Texas Instruments TMS320C3x - page 688

    SUBF3 Subtract Floating-Point V alue, 3-Operand 13-230 Syntax SUBF3 src2, src1, dst Operation src1 – src2 → dst Operands src1 3-operand addressing modes (T): 0 0 register (R n 1, 0 ≤ n 1 ≤ 7) 0 1 indirect ( disp = 0, 1, IR0, IR1) 1 0 register (R n 1, 0 ≤ n 1 ≤ 7) 1 1 indirect ( disp = 0, 1, IR0, IR1) src2 3-operand addressing modes (T): ...

  • Texas Instruments TMS320C3x - page 689

    Subtract Floating-Point V alue, 3-Operand SUBF3 13-231 Assembly Language Instructions Example 1 SUBF3 *AR0 –– (IR0),*AR1,R4 Before Instruction After Instruction R4 00 0000 0000 R4 05 1D00 0000 AR0 80 9888 AR0 80 9808 AR1 80 9851 AR1 80 9851 IR0 80 IR0 80 LUF 0 LUF 0 LV 0 LV 0 UF 0 UF 0 N 0 N 0 Z 0 Z 0 V 0 V 0 C 0 C 0 Data memory 809888h 70C8000 ...

  • Texas Instruments TMS320C3x - page 690

    SUBF3||STF Parallel SUBF3 and STF 13-232 Syntax SUBF3 src1, src2, dst1 || STF src3, dst2 Operation src2 – src1 → dst1 || src3 → dst2 Operands src1 register (R n 1, 0 ≤ n 1 ≤ 7) src2 indirect ( disp = 0, 1, IR0, IR1) dst1 register (R n 2, 0 ≤ n 2 ≤ 7) src3 register (R n 3, 0 ≤ n 3 ≤ 7) dst2 indirect ( disp = 0, 1, IR0, IR1) This in ...

  • Texas Instruments TMS320C3x - page 691

    Parallel SUBF3 and STF SUBF3||STF 13-233 Assembly Language Instructions Example SUBF3 R1,*–AR4(IR1),R0 || STF R7,*+AR5(IR0) Before Instruction After Instruction R0 00 0000 0000 R0 06 1B60 0000 R1 05 7B40 0000 R1 05 7B40 0000 R7 07 33C0 0000 R7 07 33C0 0000 AR4 80 98B8 AR4 80 98B8 AR5 80 9850 AR5 80 9850 IR0 10 IR0 10 IR1 8 IR1 8 LUF 0 LUF 0 LV 0 ...

  • Texas Instruments TMS320C3x - page 692

    SUBI Subtract Integer 13-234 Syntax SUBI src, dst Operation dst – src → dst Operands src general addressing modes (G): 0 0 register (R n , 0 ≤ n ≤ 27) 0 1 direct 1 0 indirect (disp = 0–255, IR0, IR1) 1 1 immediate dst register (R n , 0 ≤ n ≤ 27) Opcode 31 24 23 16 8 7 0 15 00 0 1 1 0 0 0 0 dst G src Description The difference between ...

  • Texas Instruments TMS320C3x - page 693

    Subtract Integer , 3-Operand SUBI3 13-235 Assembly Language Instructions Syntax SUBI3 src2, src1, dst Operation src1 – src2 → dst Operands src1 3-operand addressing modes (T): 0 0 register (R n 1, 0 ≤ n 1 ≤ 27) 0 1 indirect ( disp = 0, 1, IR0, IR1) 1 0 register (R n 1, 0 ≤ n 1 ≤ 27) 1 1 indirect ( disp = 0, 1, IR0, IR1) src2 3-operand a ...

  • Texas Instruments TMS320C3x - page 694

    SUBI3 Subtract Integer , 3-Operand 13-236 Example 1 SUBI3 R7,R2,R0 Before Instruction After Instruction R0 00 0000 0000 R0 00 0000 0032 R2 00 0000 0866 R2 00 0000 0866 R7 00 0000 0834 R7 00 0000 0834 LUF 0 LUF 0 LV 0 LV 0 UF 0 UF 0 N 0 N 1 Z 0 Z 0 V 0 V 0 C 0 C 0 50 2100 2150 2100 2150 Example 2 SUBI3 *–AR2(1),R4,R3 Before Instruction After Instr ...

  • Texas Instruments TMS320C3x - page 695

    Parallel SUBI3 and STI SUBI3||STI 13-237 Assembly Language Instructions Syntax SUBI3 src1, src2, dst1 || STI src3, dst2 Operation src2 – src1 → dst1 || src3 → dst2 Operands src1 register (R n 1, 0 ≤ n 1 ≤ 7) src2 indirect ( disp = 0, 1, IR0, IR1) dst1 register (R n 2, 0 ≤ n 2 ≤ 7) src3 register (R n 3, 0 ≤ n 3 ≤ 7) dst2 indirect ( ...

  • Texas Instruments TMS320C3x - page 696

    SUBI3||STI Parallel SUBI3 and STI 13-238 Example SUBI3 R7,*+AR2(IR0),R1 || STI R3,*++AR7 Before Instruction After Instruction R1 00 0000 0000 R1 00 0000 00C8 R3 00 0000 0035 R3 00 0000 0035 R7 00 0000 0014 R7 00 0000 0014 AR2 80 982F AR2 80 982F AR7 80 983B AR7 80 983C IR0 10 IR0 10 LUF 0 LUF 0 LV 0 LV 0 UF 0 UF 0 N 0 N 0 Z 0 Z 0 V 0 V 0 C 0 C 0 Da ...

  • Texas Instruments TMS320C3x - page 697

    Subtract Reverse Integer With Borrow SUBRB 13-239 Assembly Language Instructions Syntax SUBRB src, dst Operation src – dst – C → dst Operands src general addressing modes (G): 0 0 register (R n , 0 ≤ n ≤ 27) 0 1 direct 1 0 indirect (disp = 0–255, IR0, IR1) 1 1 immediate dst register (R n , 0 ≤ n ≤ 27) Opcode 31 24 23 16 8 7 0 15 00 ...

  • Texas Instruments TMS320C3x - page 698

    SUBRF Subtract Reverse Floating-Point V alue 13-240 Syntax SUBRF src, dst Operation src – dst → dst Operands src general addressing modes (G): 0 0 register (R n , 0 ≤ n ≤ 7) 0 1 direct 1 0 indirect (disp = 0–255, IR0, IR1) 1 1 immediate dst register (R n , 0 ≤ n ≤ 7) Opcode 31 24 23 16 8 7 0 15 000 1 1 1 0 0 0 dst G src Description Th ...

  • Texas Instruments TMS320C3x - page 699

    Subtract Reverse Integer SUBRI 13-241 Assembly Language Instructions Syntax SUBRI src, dst Operation src – dst → dst Operands src general addressing modes (G): 0 0 register (R n , 0 ≤ n ≤ 27) 0 1 direct 1 0 indirect (disp = 0–255, IR0, IR1) 1 1 immediate dst register (R n , 0 ≤ n ≤ 27) Opcode 31 24 23 16 8 7 0 15 00 0 1 1 1 0 1 0 dst ...

  • Texas Instruments TMS320C3x - page 700

    SWI Software Interrupt 13-242 Syntax SWI Operation Performs an emulation interrupt Operands None Opcode 31 24 23 16 8 7 0 15 01 100 0 1 0 1 0 0 0 00 00 0 00 0 0 0 0 0 00 000 0 0 0 00 0 Description The SWI instruction performs an emulator interrupt. This is a reserved instruc - tion and should not be used in normal programming. Cycles 4 Status Bits ...

  • Texas Instruments TMS320C3x - page 701

    T rap Conditionally TRAPcond 13-243 Assembly Language Instructions Syntax TRAP cond N Operation 0 → ST(GIE) If cond is true: Next PC → *++SP , T rap vector N → PC. Else: Set ST(GIE) to original state. Continue. Operands N (0 ≤ N ≤ 31) Opcode 31 24 23 16 8 7 0 15 01 110 0 0 0 1 cond 00 000 0000 0 001 N + 20h Description Interrupts are disa ...

  • Texas Instruments TMS320C3x - page 702

    TRAPcond T rap Conditionally 13-244 Example TRAPZ 16 Before Instruction After Instruction PC 0123 PC 0010 SP 809870 SP 809871 ST 0 ST 0 LUF 0 LUF 0 LV 0 LV 0 UF 0 UF 0 N 0 N 0 Z 0 Z 0 V 0 V 0 C 0 C 0 Data memory T rap V .16 10 809871h 124 ...

  • Texas Instruments TMS320C3x - page 703

    T est Bit Fields TSTB 13-245 Assembly Language Instructions Syntax TSTB src, dst Operation dst AND src Operands src general addressing modes (G): 0 0 register (R n , 0 ≤ n ≤ 27) 0 1 direct 1 0 indirect (disp = 0–255, IR0, IR1) 1 1 immediate dst register (R n , 0 ≤ n ≤ 27) Opcode 31 24 23 16 8 7 0 15 00 0 11 0 1 0 0 dst G src Description T ...

  • Texas Instruments TMS320C3x - page 704

    TSTB T est Bit Fields 13-246 Example TSTB *–AR4(1),R5 Before Instruction After Instruction R5 00 0000 0898 R5 00 0000 0898 AR4 80 99C5 AR4 80 99C5 LUF 0 LUF 0 LV 0 LV 0 UF 0 UF 0 N 0 N 0 Z 0 Z 1 V 0 V 0 C 0 C 0 Data memory 8099C4h 767 8099C4h 767 2200 2200 1895 1895 ...

  • Texas Instruments TMS320C3x - page 705

    T est Bit Fields, 3-Operand TSTB3 13-247 Assembly Language Instructions Syntax TSTB3 src2, src1 Operation src1 AND src2 Operands src1 3-operand addressing modes (T): 0 0 register (R n 1, 0 ≤ n 1 ≤ 27) 0 1 indirect ( disp = 0, 1, IR0, IR1) 1 0 register (R n 1, 0 ≤ n 1 ≤ 27) 1 1 indirect ( disp = 0, 1, IR0, IR1) src2 3-operand addressing mode ...

  • Texas Instruments TMS320C3x - page 706

    TSTB3 T est Bit Fields, 3-Operand 13-248 Example 1 TSTB3 *AR5 –– (IR0),*+AR0(1) Before Instruction After Instruction AR0 80 992C AR0 80 992C AR5 80 9885 AR5 80 9805 IR0 80 IR0 80 LUF 0 LUF 0 LV 0 LV 0 UF 0 UF 0 N 0 N 0 Z 0 Z 1 V 0 V 0 C 0 C 0 Data memory 809885h 898 809885h 898 80992Dh 767 80992Dh 767 2200 2200 1895 1895 Example 2 TSTB3 R4,*AR6 ...

  • Texas Instruments TMS320C3x - page 707

    Bitwise-Exclusive OR XOR 13-249 Assembly Language Instructions Syntax XOR src, dst Operation dst XOR src → dst Operands src general addressing modes (G): 0 0 register (R n , 0 ≤ n ≤ 27) 0 1 direct 1 0 indirect (disp = 0–255, IR0, IR1) 1 1 immediate dst register (R n , 0 ≤ n ≤ 27) Opcode 31 24 23 16 8 7 0 15 00 0 1 1 0 1 1 0 dst G src De ...

  • Texas Instruments TMS320C3x - page 708

    XOR3 Bitwise-Exclusive OR, 3-Operand 13-250 Syntax XOR3 src2, src1, dst Operation src1 XOR src2 → dst Operands src1 3-operand addressing modes (T): 0 0 register (R n 1, 0 ≤ n 1 ≤ 27) 0 1 indirect ( disp = 0, 1, IR0, IR1) 1 0 register (R n 1, 0 ≤ n 1 ≤ 27) 1 1 indirect ( disp = 0, 1, IR0, IR1) src2 3-operand addressing modes (T): 0 0 regis ...

  • Texas Instruments TMS320C3x - page 709

    Bitwise-Exclusive OR, 3-Operand XOR3 13-251 Assembly Language Instructions Example 1 XOR3 *AR3++(IR0),R7,R4 Before Instruction After Instruction R4 00 0000 0000 R4 00 0000 A53C R7 00 0000 FFFF R7 00 0000 FFFF AR3 80 9800 AR3 80 9810 IR0 10 IR0 10 LUF 0 LUF 0 LV 0 LV 0 UF 0 UF 0 N 0 N 0 Z 0 Z 0 V 0 V 0 C 0 C 0 Data memory 809800h 5AC3 809800h 5AC3 E ...

  • Texas Instruments TMS320C3x - page 710

    XOR3||STI Parallel XOR3 and STI 13-252 Syntax XOR3 src2, src1, dst1 || STI src3, dst2 Operation src1 XOR src2 → dst1 || src3 → dst2 Operands src1 register (R n 1, 0 ≤ n 1 ≤ 7) src2 indirect ( disp = 0, 1, IR0, IR1) dst1 register (R n 2, 0 ≤ n 2 ≤ 7) src3 register (R n 3, 0 ≤ n 3 ≤ 7) dst2 indirect ( disp = 0, 1, IR0, IR1) This instr ...

  • Texas Instruments TMS320C3x - page 711

    Parallel XOR3 and STI XOR3||STI 13-253 Assembly Language Instructions Status Bits These condition flags are modified only if the destination register is R7 – R0. LUF Unaffected LV Unaffected UF 0 N MSB of the output Z 1 if a 0 output is generated; 0 otherwise V 0 C Unaffected OVM Operation is not affected by OVM bit value. Example XOR3 *AR1++,R3, ...

  • Texas Instruments TMS320C3x - page 712

    A-1 Appendix A Instruction Opcodes The opcode fields for all TMS320C3x instructions are shown in T able A–1. Bits in the table marked with a hyphen are defined in the individual instruction descriptions (see Chapter 13, Assembly Language Instructions ). T able A–1, along with the instruction descriptions, fully defines the instruction words. Th ...

  • Texas Instruments TMS320C3x - page 713

    Instruction Opcodes A-2 T able A–1. TMS320C3x Instruction Opcodes Instruction 31 30 29 28 27 26 25 24 23 ABSF 0 0 0 0 0 0 0 0 0 ABSI 0 0 0 0 00001 ADDC 0 0 0 0 00010 ADDF 0 0 0 0 00011 ADDI 0 0 0 0 00100 A N D 000000101 ANDN 0 0 0 0 00110 A S H 000000111 CMPF 0 0 0 0 01000 CMPI 0 0 0 0 01001 F I X 000001010 FLOA T 0 0 0 0 01011 IDLE 0 0 0 0 01100 ...

  • Texas Instruments TMS320C3x - page 714

    Instruction Opcodes A-3 Instruction Opcodes T able A–1. TMS320C3x Instruction Opcodes (Continued) Instruction 23 24 25 26 27 28 29 30 31 MPYI 0 0 0 0 1 0 1 0 1 NEGB 0 0 0 0 10110 NEGF 0 0 0 0 10111 NEGI 0 0 0 0 11000 N O P 000011001 NORM 0 0 0 0 11010 N O T 000011011 P O P 000011100 POPF 0 0 0 0 11101 PUSH 0 0 0 0 11110 PUSHF 0 0 0 0 11111 O R 00 ...

  • Texas Instruments TMS320C3x - page 715

    Instruction Opcodes A-4 T able A–1. TMS320C3x Instruction Opcodes (Continued) Instruction 23 24 25 26 27 28 29 30 31 SUBRB 0 0 0 1 1 0 0 0 1 SUBRF 0 0 0 1 10010 SUBRI 0 0 0 1 10011 TSTB 0 0 0 1 10100 X O R 000110101 IACK 0 0 0 1 10110 ADDC3 0 0 1 0 00000 ADDF3 0 0 1 0 00001 ADDI3 0 0 1 0 00010 AND3 0 0 1 0 00011 ANDN3 0 0 1 0 00100 ASH3 0 0 1 0 0 ...

  • Texas Instruments TMS320C3x - page 716

    Instruction Opcodes A-5 Instruction Opcodes T able A–1. TMS320C3x Instruction Opcodes (Continued) Instruction 23 24 25 26 27 28 29 30 31 RPTB 0 1 1 0 0 1 0 – – S W I 0110011–– B cond (D) † 011010––– DBcond(D) † 011011––– CALL cond 011100––– TRAP cond 0111010–– RETI cond 011110000 RETS cond 011110001 MPYF3||ADDF3 ...

  • Texas Instruments TMS320C3x - page 717

    Instruction Opcodes A-6 T able A–1. TMS320C3x Instruction Opcodes (Continued) Instruction 23 24 25 26 27 28 29 30 31 ABSI||STI 1 1 0 0 1 0 1 – – ADDF3||STF 1 1 0 0 110–– ADDI3||STI 1 1 0 0 111–– AND3||STI 1 1 0 1 000–– ASH3||STI 1 1 0 1 001–– FIX||STI 1 1 0 1 010–– FLOA T||STF 1 1 0 1 011–– LDF||STF 1 1 0 1 100–– L ...

  • Texas Instruments TMS320C3x - page 718

    B-1 Appendix A TMS320C31 Boot Loader Source Code This appendix contains the source code for the ’C31 boot loader . Appendix B ...

  • Texas Instruments TMS320C3x - page 719

    TMS320C31 Boot Loader Source Code B-2 ************************************************************************ * C31BOOT – TMS320C31 BOOT LOADER PROGRAM * (C) COPYRIGHT TEXAS INSTRUMENTS INC., 1990 * * NOTE: 1. AFTER DEVICE RESET, THE PROGRAM IS SET TO WAIT FOR * THE EXTERNAL INTERRUPTS. THE FUNCTION SELECTION OF * THE EXTERNAL INTERRUPTS IS AS F ...

  • Texas Instruments TMS320C3x - page 720

    TMS320C31 Boot Loader Source Code B-3 TMS320C31 Boot Loader Source Code .global check .sect ”vectors” reset .word check int0 .word 809FC1h int1 .word 809FC2h int2 .word 809FC3h int3 .word 809FC4h xint0 .word 809FC5h rint0 .word 809FC6h .word 809FC7h .word 809FC8h tint0 .word 809FC9h tint1 .word 809FCAh dint .word 809FCBh .word 809FCCh .word 809 ...

  • Texas Instruments TMS320C3x - page 721

    TMS320C31 Boot Loader Source Code B-4 trap11 .word 809FEBh trap12 .word 809FECh trap13 .word 809FEDh trap14 .word 809FEEh trap15 .word 809FEFh trap16 .word 809FF0h trap17 .word 809FF1h trap18 .word 809FF2h trap19 .word 809FF3h trap20 .word 809FF4h trap21 .word 809FF5h trap22 .word 809FF6h trap23 .word 809FF7h trap24 .word 809FF8h trap25 .word 809FF ...

  • Texas Instruments TMS320C3x - page 722

    TMS320C31 Boot Loader Source Code B-5 TMS320C31 Boot Loader Source Code NOP *AR1++(1) ; jump last half word from mem. word LDI sub_h,AR3 ; half word size subroutine ; address –> AR3 LSH 1,R1 ; test bit 4 of mem. width word BN load0 ; if ’1’ start PGM loading ; (16 bits width) LDI sub_b,AR3 ; byte size subroutine address –> AR3 ADDI 2, ...

  • Texas Instruments TMS320C3x - page 723

    TMS320C31 Boot Loader Source Code B-6 LDI *+AR0(4Ch),R1 LDI R0,R0 ; test load address flag BNN end_s load_s STI R1,*AR4++(1) ; store new word to dest. address end_s RETSU ; return from subroutine .space 22 loop_h RPTB load_h ; PGM load loop sub_h LDI *AR1++(1),R1 ; load LSB half word AND 0FFFFh,R1 LDI *AR1++(1),R2 ; load MSB half word LSH 16,R2 OR ...

  • Texas Instruments TMS320C3x - page 724

    C-1 Appendix A TMS320C32 Boot Loader Source Code This appendix includes a description of the ’C32 boot loader sequence of events and a listing of its source code. T opic Page C.1 Boot-Loader Source Code Description C-2 . . . . . . . . . . . . . . . . . . . . . . . . . . C.2 Boot-Loader Source Code Listing C-4 . . . . . . . . . . . . . . . . . . . ...

  • Texas Instruments TMS320C3x - page 725

    Boot-Loader Source Code Description C-2 C.1 Boot-Loader Source Code Description Figure C–1 shows the boot loader program flow chart. The boot loader pro- gram starts by initializing three registers: AR7 , SP , and IR0 . These registers hold the peripheral bus memory map register base address, the timer counter register (used as a stack), and a fl ...

  • Texas Instruments TMS320C3x - page 726

    Boot-Loader Source Code Description C-3 TMS320C32 Boot Loader Source Code Figure C–1. Boot-Loader Flow Chart Start Initialize regist ers: AR7, SP , IR0 Serial boot? Serial initialize serial global control regis ter Destination address: AR3 Destination strobe pointer: AR4 Destination strobe value: R4 Destination data size: R3 Block size RC Memory ...

  • Texas Instruments TMS320C3x - page 727

    Boot-Loader Source Code Listing C-4 C.2 Boot-Loader Source Code Listing ********************************************************************************** * C32BOOT – TMS320C32 BOOT LOADER PROGRAM (143 words) March–96 * (C) COPYRIGHT TEXAS INSTRUMENTS INCORPORATED, 1994 v.27 *===================================================================== ...

  • Texas Instruments TMS320C3x - page 728

    Boot-Loader Source Code Listing C-5 TMS320C32 Boot Loader Source Code * that to function properly, the boot loader program always expects 32-bit * data from 32-bit wide memory during the boot load operation. Valid boot * EPROM widths are : 1, 2, 4, 8, 16 and 32 bits. * * 5. A single source block cannot cross STRB boundaries. For example, its * dest ...

  • Texas Instruments TMS320C3x - page 729

    Boot-Loader Source Code Listing C-6 * Test for INT3 and, if set exclusively, proceed with serial boot load. Else, * load AR3 with 1000h if INT0, 810000h if INT1 900000h if INT2. Also load , * appropriate boot strobe pointer ––> AR2 and force the boot strobe value to * reflect 32bit memory width. If (INT0 or INT1 or INT2) and INT3, turn on th ...

  • Texas Instruments TMS320C3x - page 730

    Boot-Loader Source Code Listing C-7 TMS320C32 Boot Loader Source Code label4 SUBI 2,AR6 CMPI 0,AR6 ; set flags BN strobes ;*******; total # of mem reads = 32/R5 label5 CALLU read_m ; read memory once DBU AR6,label5 ;****; *================================================================================* * Read and save IOSTRB, STRB0 & STRB1 (to ...

  • Texas Instruments TMS320C3x - page 731

    Boot-Loader Source Code Listing C-8 CALLU AR0 ; 10 – STRB1 LDI R1,R4 AND 6Ch,R1 ; dest mem strb pntr ––> AR4 OR3 AR7,R1,AR4 LSH –8,R4 ; dest memory strobe ––> R4 LDI R4,R3 LSH –16,R3 AND 3,R3 ; dest data size ––> R3 TSTB 0Ch,R1 ; (IOSTRB case) LDIZ 3,R3 *==================================================================== ...

  • Texas Instruments TMS320C3x - page 732

    Boot-Loader Source Code Listing C-9 TMS320C32 Boot Loader Source Code read_s0 TSTB 20h,IF ; look at RINT0 flag BZ read_s0 ; wait for receive buffer full AND 0FDFh,IF ; reset interrupt flag LDI *+AR7(4Ch),R1 ; read data ––> R1 RETSU *––––––––––––––––––––––––––––––––––––? ...

  • Texas Instruments TMS320C3x - page 733

    Boot-Loader Source Code Listing C-10 LDI 2,IOF ;*; assert data acknowledge ;*; (XF0 low to host) loop6 TSTB 80h,IOF ;*; wait for data not ready BZ loop6 ;*; (XF1 high from host) LDI 6,IOF ;*; deassert data acknowledge ;*; (XF0 high to host) RETSU *================================================================================* ...

  • Texas Instruments TMS320C3x - page 734

    D-1 Appendix A Glossary A A0–A23: External address pin s for data/program memory or I/O devices. These pins are on the primary bus. address: The location of program code or data stored in memory . addressing mode: The method by which an instruction interprets its oper- ands to acquire the data it needs. ALU: Arithmetic logic unit. The part of the ...

  • Texas Instruments TMS320C3x - page 735

    Glossary D-2 BK: Block-size register . A 32-bit register used by the ARAU in circular ad- dressing to specify the data block size. boot loader: An on-chip code that loads and executes programs received from a host processor through standard memory devices (including EPROM), with and without handshake, or t hr ough the serial port to RAM at power up ...

  • Texas Instruments TMS320C3x - page 736

    Glossary D-3 Glossary data size: The number of bits (8, 16, or 32) used to represent a particular number . decode phase: The phase of the pipeline in which the instruction is decoded (identified). DMA coprocessor: A peripheral that transfers the contents of memory loca- tions independently of the processor (except for initialization). DMA controlle ...

  • Texas Instruments TMS320C3x - page 737

    Glossary D-4 I IACK: Interrupt acknowledge signal . An output signal indicating that an in- terrupt has been received and that the program counter is fetching the interrupt vector that will force the processor into an interrupt service rou- tine. IE: See internal interrupt enable register . I/O flag (IOF) register: Controls the function (general-pu ...

  • Texas Instruments TMS320C3x - page 738

    Glossary D-5 Glossary M machine cycle: See CPU cycle . mantissa: A component of a floating-point number consisting of a fraction and a sign bit. The mantissa represents a normalized fraction whose binary point is shifted by the exponent. maskable interrupt : A hardware interrupt that can be enabled or disabled through software. memory-mapped regist ...

  • Texas Instruments TMS320C3x - page 739

    Glossary D-6 O overflow flag (OV) bit: A status bit that indicates whether or not an arithme- tic operation has exceeded the capacity of the corresponding register . P PC: Program counte r . A register that contains the address of the next instruction to be fetched. peripheral bus: A bus that is used by the CPU to communicate to the DMA coprocessor ...

  • Texas Instruments TMS320C3x - page 740

    Glossary D-7 Glossary S short floating-point format: A 16-bit representation of a floating point num- ber with a 12-bit mantissa and a 4-bit exponent. short floating-point format for external 16-bit data: A 16-bit representa- tion of a floating point number with an 8-bit mantissa and an 8-bit expo- nent. short integer format: A 2s-complement,16-bit ...

  • Texas Instruments TMS320C3x - page 741

    Glossary D-8 W wait state : A period of time that the CPU must wait for external program, data, or I/O memory to respond when it reads from or writes to that exter- nal memory . The CPU waits one extra cycle for every wait state. wait-state generator : A program that can be modified to generate a limited number of wait states for a given off-chip m ...

  • Texas Instruments TMS320C3x - page 742

    Index Index-1 Index 16-bit-wide configured memory , TMS320C31 1 1-10 2-operand instruction 13-3 2-operand instruction word 8-25 3-operand addressing modes 2-17, 13-24–13-25 3-operand instruction 13-4 add, integer 13-58 arithmetic shift 13-73 bitwise-exclusive OR 13-250 bitwise-logical ANDN 13-69 OR 13-190 compare floating-point value 13-90 intege ...

  • Texas Instruments TMS320C3x - page 743

    Index Index-2 arithmetic logic unit (ALU), definition D-1 assembler syntax expression, example 13-38 assembly language, instruction set 2-operand instructions 13-3 3-operand instructions 13-4 interlocked operations instructions 13-5–13-6 load and store instructions 13-2 low-power control instructions 13-5 program control instructions 13-4–13-5 ...

  • Texas Instruments TMS320C3x - page 744

    Index Index-3 assembly language instructions (continued) normalize (NORM) 13-182–13-183 parallel instructions ABSF and STF 13-42 ABSI and STI 13-46 ADDF3 and STF 13-55 ADDI3 and STI 13-60–13-61 AND3 and STI 13-65–13-66 ASH3 and STI 13-76–13-78 FIX and STI 13-101–13-102 FLOA T and STF 13-105–13-106 LDF and LDF 13-1 19–13-120 LDF and ST ...

  • Texas Instruments TMS320C3x - page 745

    Index Index-4 bitwise-logical AND 13-62 3-operand 13-63 with complement (ANDN) 13-67 complement instruction (NOT) 13-184 OR instruction 13-188 block diagram, TMS320C3x 1-3 repeat-mode control bits 7-3 nested block repeats 7-8 operation 7-3–7-4 RC register value 7-7 registers (RC, RE, RS) 7-2 restrictions 7-6–7-7 RPTB instruction 7-4–7-5 RPTS ...

  • Texas Instruments TMS320C3x - page 746

    Index Index-5 carry bit, definition D-2 carry flag 13-29 central processing unit. See CPU circular addressing 6-21–6-25 algorithm 6-23 buffer 6-21–6-25 definition D-2 FIR filters 6-24 operation 6-23 CLKX pins 12-22 clock mode timer interrupt 12-13 timer pulse generator 12-7–12-9 clock periods, minor 8-24 compare floating-point value instructi ...

  • Texas Instruments TMS320C3x - page 747

    Index Index-6 data-rate timing operation fixed 12-36 burst mode 12-36 continuous mode 12-36 variable 12-39 burst mode 12-35 continuous mode 12-40 data-page pointer (DP) 2-10, 3-4 data-receive register (DRR) 12-28 serial port 12-28–12-29 data-transfer operation, handshake 1 1-20 data-transmit register (DXR) 12-28, 12-32, 12-36, 12-37 data-address ...

  • Texas Instruments TMS320C3x - page 748

    Index Index-7 extended-precision (R7–R0) registers 3-3 definition D-3 floating-point format, definition D-3 external buses (expansion, primary) 2-19 interface control registers 9-2 memory map 9-6 timing, expansion bus I/O cycles 9-21–9-36 timing, primary bus cycles 9-15–9-20 interrupt 7-26, 7-36 buses (expansion, primary) 2-21 definition D-3 ...

  • Texas Instruments TMS320C3x - page 749

    Index Index-8 global-control register DMA 12-53–12-59 serial port 12-15, 12-17–12-21 timer 12-3, 12-4–12-6 H handshake 1 1-20 hardware interrupt, definition D-3 hit, definition D-3 hold cycles 9-37 hold everything 8-15 busy external port 8-16 conditional calls and traps 8-18 multicycle data reads 8-17 I I/O flag (IOF) register 3-16 bits defin ...

  • Texas Instruments TMS320C3x - page 750

    Index Index-9 interface enhanced memory , TMS320C32 2-19 expansion bus 2-19 primary bus 2-19 interlocked instructions 2-21 operations 7-13–7-20 busy-waiting loop 7-15 external flag pins (XF0, XF1) 7-13 instructions 13-5–13-6 instructions used in 7-13 LDFI and LDII instructions 7-14 loads and stores 7-13 multiprocessor counter manipulation 7-16 ...

  • Texas Instruments TMS320C3x - page 751

    Index Index-10 logical shift instruction (LSH) 13-136 LOPOWER 7-51–7-52 timing 7-52 low-power control instructions 13-5 idle instruction (IDLE2) 13-1 10 LRU cache update 4-19 LSB, definition D-4 M mantissa, definition D-5 maskable interrupt, definition D-5 MAXSPEED, timing 7-52 memory 4-2 accesses 2-operand instructions 8-25 3-operand instruction ...

  • Texas Instruments TMS320C3x - page 752

    Index Index-1 1 MSB , definition D-5 MSTRB signal 9-3, 9-15 multiple processors, sharing global memory 7-13 multiplication, floating-point, examples 5-29–5-31 multiplier definition D-5 floating-point/integer 2-8 multiply floating-point value instruction (MPYF) 13-146 integer instruction (MPYI) 13-159 or CPU operation with a parallel store, instru ...

  • Texas Instruments TMS320C3x - page 753

    Index Index-12 peripherals 12-1–12-68 DMA controller 12-48–12-68 CPU/DMA interrupt enable regis- ter 12-59–12-62 destination- and source-address regis- ters 12-57–12-59 global-control register 12-53–12-59 Initialization/reconfiguration 12-73 memory transfer timing 12-67–12-68 programming examples 12-74–12-80 transfer-counter register ...

  • Texas Instruments TMS320C3x - page 754

    Index Index-13 program (continued) RPTB instruction 7-4–7-5 RPTS instruction 7-5–7-6 reset operation 7-21–7-25 TMS320LC31 power management mode IDLE2 7-49–7-51 LOPOWER 7-51–7-52 memory 2-19 wait due to multicycle access 8-1 1 until CPU data access completes 8-10 program-counter (PC) register 2-18, 3-18 programmable bank switching 9-12–9 ...

  • Texas Instruments TMS320C3x - page 755

    Index Index-14 repeat end-address (RE) register 3-17, 7-2 repeat mode, definition D-6 repeat modes 7-2–7-8 control algorithm 7-4 control bits 7-3 maximum number of repeats 7-3 nested block repeats 7-8 operation 7-3–7-4 RC register value 7-7 restrictions 7-6–7-7 RPTB instruction 7-4–7-5 RPTS instruction 7-5 repeat start-address (RS) register ...

  • Texas Instruments TMS320C3x - page 756

    Index Index-15 serial port (continued) loading 1 1-1 1 memory mapped locations for 12-17 operation configurations 12-29–12-31 port control register FSR/DR/CLKR 12-23–12-24 FSX/DX/CLKX 12-22–12-23 receive/transmit timer control register 12-25–12-27 counter register 12-27 period register 12-28 registers 12-15, 12-47 timing 12-31–12-34 short ...

  • Texas Instruments TMS320C3x - page 757

    Index Index-16 timer-period register , definition D-7 timing external interface expansion bus I/O cycles 9-21–9-36 primary bus cycles 9-15–9-20 external memory interface 9-15–9-38 TMS320C30 architecture, block diagram 2-3 DMA controller 12-49 arbitration 12-63 external memory interface 9-1–9-38 interrupt vector table 7-26 memory maps 4-4 me ...

Manufacturer Texas Instruments Category Network Card

Documents that we receive from a manufacturer of a Texas Instruments TMS320C3x can be divided into several groups. They are, among others:
- Texas Instruments technical drawings
- TMS320C3x manuals
- Texas Instruments product data sheets
- information booklets
- or energy labels Texas Instruments TMS320C3x
All of them are important, but the most important information from the point of view of use of the device are in the user manual Texas Instruments TMS320C3x.

A group of documents referred to as user manuals is also divided into more specific types, such as: Installation manuals Texas Instruments TMS320C3x, service manual, brief instructions and user manuals Texas Instruments TMS320C3x. Depending on your needs, you should look for the document you need. In our website you can view the most popular manual of the product Texas Instruments TMS320C3x.

A complete manual for the device Texas Instruments TMS320C3x, how should it look like?
A manual, also referred to as a user manual, or simply "instructions" is a technical document designed to assist in the use Texas Instruments TMS320C3x by users. Manuals are usually written by a technical writer, but in a language understandable to all users of Texas Instruments TMS320C3x.

A complete Texas Instruments manual, should contain several basic components. Some of them are less important, such as: cover / title page or copyright page. However, the remaining part should provide us with information that is important from the point of view of the user.

1. Preface and tips on how to use the manual Texas Instruments TMS320C3x - At the beginning of each manual we should find clues about how to use the guidelines. It should include information about the location of the Contents of the Texas Instruments TMS320C3x, FAQ or common problems, i.e. places that are most often searched by users in each manual
2. Contents - index of all tips concerning the Texas Instruments TMS320C3x, that we can find in the current document
3. Tips how to use the basic functions of the device Texas Instruments TMS320C3x - which should help us in our first steps of using Texas Instruments TMS320C3x
4. Troubleshooting - systematic sequence of activities that will help us diagnose and subsequently solve the most important problems with Texas Instruments TMS320C3x
5. FAQ - Frequently Asked Questions
6. Contact detailsInformation about where to look for contact to the manufacturer/service of Texas Instruments TMS320C3x in a specific country, if it was not possible to solve the problem on our own.

Do you have a question concerning Texas Instruments TMS320C3x?

Use the form below

If you did not solve your problem by using a manual Texas Instruments TMS320C3x, ask a question using the form below. If a user had a similar problem with Texas Instruments TMS320C3x it is likely that he will want to share the way to solve it.

Copy the text from the picture

Comments (0)