. . TEXAS Suggested Retail Price: $19.95 INsrRUMENTS TMS320C2x 1993 1993 Digital Signal Processing Products TMS320C2x User's Guide 1604907-9721 revision C January 1993 TEXAS INsrRUMENTS IMPORTANT NOTICE Texas Instruments Incorporated (Tl) 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. Tl warrants performance of its semiconductor products and related software to current specifications in accordance with Tl's standard warranty. Testing and other quality control techniques are utilized to the extent Tl deems necessary to support this warranty. Specific testing of all parameters of each device is not necessarily performed, except those mandated by government requirements. Please be aware that Tl products are not intended for use in life-support appliances, devices, or systems. Use of Tl product in such applications requires the written approval of the appropriate Tl officer. Certain applications using semiconductor devices may involve potential risks of personal injury, property damage, or loss of life. In order to minimize these risks, adequate design and operating safeguards should be provided by the customer to minimize inherent or procedural hazards. Inclusion of Tl products in such applications is understood to be fully at the risk of the customer using Tl devices or systems. Tl assumes no liability for applications assistance, customer product design, software performance, or infringement of patents or services described herein. Nor does Tl warrant or represent that any license, either express or implied, is granted under any patent right, copyright, mask work right, or other intellectual property right of Tl covering or relating to any combination, machine, or process in which such semiconductor products or services might be or are used. Copyright© 1992, Texas Instruments Incorporated Read This First About This Manual The purpose of this user's guide is to serve as a reference book for the TMS320C2x digital signal processors. Chapters 2 through 6 provide specific information about the architecture and operation of the devices. Appendices A through E furnish electrical specifications and mechanical data. How to Use This Manual This document contains the following chapters: Chapter 1 Introduction Description and key features of the TMS320C2x generation of digital signal processors. Chapter 2 Pinouts and Signal Descriptions Package drawings for TMS320C2x devices. Functional listings of the signals, their pin locations, and descriptions. Chapter 3 Architecture TMS320C2x design description, hardware components, and device operation. Functional block diagram and internal hardware summary table. Chapter 4 Assembly Language Instructions Addressing modes and format descriptions. Instruction set summary listed according to function. Alphabetized individual instruction descriptions with examples. Chapter 5 Software Applications Software application examples for the use of various TMS320C2x instruction set features. Chapter 6 Hardware Applications Hardware design techniques and application examples for interfacing to memories, peripherals, or other microcomputers/microprocessors. XDS design considerations. System applications. iii How to Use This Manual Eleven appendices are included to provide additional information. Appendix A TMS320C25 Digital Signal Processor Electrical specifications, timing, and mechanical data for the TMS320C25 devices. Appendix B TMS320C26 Digital Signal Processor Data sheet information for the TMS320C26 digital signal processor. Appendix C TMS320C28 Digital Signal Processor Data sheet information for the TMS320C28 digital signal processor. Appendix D SMJ320C2x Digital Signal Processors Data sheet information for the SMJ320C2x digital signal processors family. Appendix E Instruction Cycle Timings Listings of the number of cycles for an instruction to execute in a given memory configuration on the TMS320C25. Appendix F TMS320E25 EPROM Programming Programming hardware description and methodology. Appendix G Analog Interface Peripherals and Applications Discussion of various analog input/output devices that interface directly to TMS320 DSPs and their applications. Appendix H Memories, Analog Converters, Sockets, and Crystals Listings of the Tl memories, analog converters, and sockets available to support the TMS320C2x devices in DSP applications. Crystal specifications and vendors. Appendix I ROM Codes Discussion of ROM codes (mask options) and the procedure for implementation. Appendix J Quality and Reliability Discussion of Texas Instruments quality and reliability criteria for evaluating performance. Appendix K Development Support Listings of the hardware and software available to support the TMS320C2x devices. iv Read This First Style and Symbol Conventions .....,.....,...,..._,___ ._.._,,,-==-=--=-=-==--w-----~~~~~,~=-=-===--==== Style and Symbol Conventions This document uses the following conventions. O Program listings, program examples, interactive displays, filenames, and symbol names are shown in a special typeface similar to a typewriter's. Examples use a bold version of the special typeface for emphasis; interactive displays use a bold version of the special typeface to distinguish commands that you enter from items that the system displays (such as prompts, command output, error messages, etc.). Here is a sample program listing: 0011 0005 0001 .field 1, 2 0012 0005 0003 .field 3, 4 0013 0005 0006 .field 6, 3 0014 0006 .even Here is an example of a system prompt and a command that you might enter: C: csr -a /user/ti/simuboard/utilities O In syntax descriptions, the instruction, command, or directive is in a bold typeface font and parameters are in an italic typeface. Portions of a syntax that are in bold should be entered as shown; portions of a syntax that are in italics describe the type of information that should be entered. Here is an example of a directive syntax: .asect "section name", address .asect is the directive. This directive has two parameters, indicated by section name and address. When you use .asect, the first parameter must be an actual section name, enclosed in double quotes; the second parameter must be an address. O Square brackets ( [ and ] ) identify an optional parameter. If you use an optional parameter, you specify the 'information within the brackets; you don't enter the brackets themselves. Here's an example of an instruction that has an optional parameter: LALK 16-bit constant [, shiffl The LALK instruction has two parameters. The first parameter, 16-bit constant, is required. The second parameter, shift, is optional. As this syntax shows, if you use the optional second parameter, you must precede it with a comma. Square brackets are also used as part of the pathname specification for VMS pathnames; in this case, the brackets are actually part of the pathname (they are not optional). v Conventions O Braces ( {and} ) indicate a list. The symbol I (read as ory separates items within the list. Here's an example of a list: { * I *+ I *- } This provides three choices: *, *+, or *-. Unless the list is enclosed in square brackets, you must choose one item from the list. O Some directives can have a varying number of parameters. For example, the .byte directive can have up to 100 parameters. The syntax for this directive is: .byte value1 [, ... , valuen] This syntax shows that .byte must have at least one value parameter, but you have the option of supplying additional value parameters, separated by commas. Information about Cautions This book may contain cautions. A caution describes a situation that could potentially damage your software or equipment. The information in a caution is provided for your protection. Please read each caution carefully. vi Read This First Related Documentation From Texas Instruments Related Documentation From Texas Instruments General Digital Signal Processing: Antoniou, Andreas, Digital Filters: Analysis and Design. New York, NY: McGraw-Hill Company, Inc., 1979. Brigham, E. Oran, The Fast Fourier Transform. Englewood Cliffs, NJ: Prentice-Hall, Inc., 1974. Burrus, C.S. and Parks, T.W., DFT/FFT and Convolution Algorithms. New York, NY: John Wiley and Sons, Inc., 1984. Digital Signal Processing Applications with the TMS320 Family, Texas Instruments, 1986; Prentice-Hall, Inc., 1987. Gold, Bernard and Rader, C.M., Digital Processing of Signals. New York, NY: McGraw-Hill Company, Inc., 1969. Hamming, R.W., Digital Filters. Englewood Cliffs, NJ: Prentice-Hall, Inc., 1977. IEEE ASSP DSP Committee (Editor), Programs for Digital Signal Processing. New York, NY: IEEE Press, 1979. Jackson, Leland B., Digital Filters and Signal Processing. Hingham, MA: Kluwer Academic Publishers, 1986. Jones, D.L. and Parks, T.W., A Digital Signal Processing Laboratory Using the TMS32010. Englewood Cliffs, NJ: Prentice-Hall, Inc., 1987. Lim, Jae and Oppenheim, Alan V. (Editors), Advanced Topics in Signal Processing. Englewood Cliffs, NJ: Prentice-Hall, Inc., 1988. Morris, L. Robert, Digital Signal Processing Software. Ottawa, Canada: Carleton University, 1983. Oppenheim, Alan V. (Editor), Applications of Digital Signal Processing. Englewood Cliffs, NJ: Prentice-Hall, Inc., 1978. Oppenheim, Alan V. and Schafer, R.W., Digital Signal Processing. Englewood Cliffs, NJ: Prentice-Hall, Inc., 1975. Oppenheim, Alan V. and Willsky, A.N. with Young, l.T., Signals and Systems. Englewood Cliffs, NJ: Prentice-Hall, Inc., 1983. Parks, T.W. and Burrus, C.S., Digital Filter Design. New York, NY: John Wiley and Sons, Inc., 1987. Rabiner, Lawrence R., Gold and Bernard, Theory and Application of Digital Signal Processing. Englewood Cliffs, NJ: Prentice-Hall, Inc., 1975. Treichler, J.R., Johnson, Jr., C.R. and Larimore, M.G., A Practical Guide to Adaptive Filter Design. New York, NY: John Wiley and Sons, Inc., 1987. vii Related Documentation From Texas Instruments Speech: Gray, A.H. and Markel, J.D., Linear Prediction of Speech. New York, NY: Springer-Verlag, 1976. Jayant, N.S. and Noll, Peter, Digital Coding of Waveforms. Englewood Cliffs, NJ: Prentice-Hall, Inc., 1984. Papamichalis, Panos, Practical Approaches to Speech Coding. Englewood Cliffs, NJ: Prentice-Hall, Inc., 1987. Rabiner, Lawrence R. and Schafer, R.W., Digital Processing of Speech Signals. Englewood Cliffs, NJ: Prentice-Hall, Inc., 1978. Image Processing: Andrews, H.C. and Hunt, B.R., Digital Image Restoration. Englewood Cliffs, NJ: Prentice-Hall, Inc., 1977. Gonzales, Rafael C. and Wintz, Paul, Digital Image Processing. Reading, MA: Addison-Wesley Publishing Company, Inc., 1977. Pratt, William K., Digital Image Processing. New York, NY: John Wiley and Sons, 1978. Digital Control Theory: Jacquot, R., Modern Digital Control Systems. New York, NY: Marcel Dekker, Inc., 1981. Katz, P., Digital Control Using Microprocessors. Englewood Cliffs, NJ: Prentice-Hall, Inc., 1981. Kuo, B.C., Digital Control Systems. New York, NY: Holt, Reinholt and Winston, Inc., 1980. Moroney, P., Issues in the Implementation of Digital Feedback Compensators. Cambridge, MA: The MIT Press, 1983. Phillips, C. and Nagle, H., Digital Control System Analysis and Design. Englewood Cliffs, NJ: Prentice-Hall, Inc., 1984. Trademarks MS, and MS-DOS are trademarks of Microsoft Corp. VAX, VMS, and Ultrix are trademarks of Digital Equipment Corp. PC-DOS is a trademark of International Business Machines Corp. Sun 3 is a trademark of Sun Microsystems, Inc. UNIX is a registered trademark of UNIX Systems Laboratories. XDS is a trademark of Texas Instruments Incorporated. viii Read This First If You Need Assistance If You Need Assistance. .. If you want to . .. Do this ... Request more information about Write to: Texas Instruments Digital Signal Texas Instruments Incorporated Processing (DSP) products Market Communications Manager, MS 736 P.O. Box 1443 Houston, Texas 77251-1443 Order Texas Instruments Call the Tl Literature Response Center: documentation (800) 477-8924 Ask questions about product Call the DSP hotline: operation or report suspected (713) 274-2320 problems Report mistakes in this document Send your comments to: or any other Tl documentation Texas Instruments Incorporated Technical Publications Manager, MS 702 P.O. Box 1443 Houston, Texas 77251-1443 ix x Read This First Contents 1 Introduction ..................................................................... 1-1 1.1 General Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-2 1.2 Key Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-6 1.3 Typical Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-8 2 Plnouts and Signal Descriptions .................................................. 2-1 2.1 TMS320C2x Pinouts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-2 2.2 TMS320C2x Signal Descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-4 3 Architecture ..................................................................... 3-1 3.1 Architectural Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-2 3.2 Functional Block Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-6 3.3 Internal Hardware Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-9 3.4 Memory Organization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-12 3.4.1 Data Memory ...................................................... 3-12 3.4.2 Program Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-12 3.4.3 TMS320C2x Memory Maps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-15 3.4.4 TMS320C26 Memory Maps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-16 3.4.5 Memory-Mapped Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-22 3.4.6 Auxiliary Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-22 3.4.7 Memory Addressing Modes .......................................... 3-25 3.4.8 Memory-to-Memory Moves . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-27 3.5 Central Arithmetic Logic Unit (CALU) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-28 3.5.1 Scaling Shifter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-30 3.5.2 ALU and Accumulator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-30 3.5.3 Multiplier, T and P Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-32 3.6 System Control ............................................................ 3-35 3.6.1 Program Counter and Stack . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-35 3.6.2 Pipeline Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-37 3.6.3 Reset ............................................................. 3-47 3.6.4 Status Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-49 3.6.5 Timer Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-52 3.6.6 Repeat Counter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-53 3.6.7 Powerdown Modes (TMS320C25) .................................... 3-53 3.7 External Memory and 1/0 Interface ........................................... 3-54 3. 7.1 Memory Combinations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-54 3.7.2 Internal Clock Timing Relationships ................................... 3-56 3.7.3 General-Purpose 1/0 Pins (BIO and XF) ............................... 3-56 xi Contents 3.8 Interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-59 3.8.1 Interrupt Operation .. .. .. . . .. .. .. .. . .. .. . .. .. .. . .. . .. .. .. . .. .. . .. . .. 3-59 3.8.2 External Interrupt Interface .......................................... 3-60 3.9 Serial Port . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-63 3.9.1 Transmit and Receive Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-65 3.9.2 Timing and Framing Control .. .. . . . .. . .. . . .. . . .. . . . . . . . . .. . . . . . . . . . .. 3-67 3.9.3 Burst-Mode Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-68 3.9.4 Continuous Operation Using Frame Sync Pulses (TMS320C25) . . . . . . . . . . 3-69 3.9.5 Continuous Operation Without Frame Sync Pulses (TMS320C25) ........ 3-71 3.9.6 Initialization of Continuous Operation Without Frame Sync Pulses ........ 3-73 3.10 Multiprocessing and Direct Memory Access (OMA) ............................. 3-75 3.10.1 Synchronization .................................................... 3-75 3.10.2 Global Memory ..................................................... 3-76 3.10.3. The Hold Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-78 3.11 General Description of the TMS320C26 .. . .. . . . .. .. . . . .. . . . . . .. .. . . . . .. . . . .. . 3-82 3.12 General Description of the TMS320C28 . . .. . . . .. . . .. . . . . . .. . . .. . .. . . .. . . . .. .. 3-83 4 Assembly Language Instructions ................................................. 4-1 4.1 Memory Addressing Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-2 4.1.1 Direct Addressing Mode .. . . . .. . . . . .. .. . .. . . .. . . . .. . . . . . . . . . . . .. . . . . . . 4-2 4.1.2 Indirect Addressing Mode . . . .. .. . . .. . . . .. . . .. . . . . . . . .. . . . .. . . .. . . . .. . . 4-4 4.1.3 Immediate Addressing Mode . . .. . . . . . .. . . . .. . . .. . . . . . . .. .. . . .. .. . . .. . . 4-8 4.2 Instruction Set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-11 4.2.1 Symbols and Abbreviations . .. . . .. . .. .. . . . . .. . . . . . .. .. .. . . . .. .. . .. . . . 4-11 4.2.2 Instruction Set Summary ............................................ 4-13 4.3 Individual Instruction Descriptions ............................................ 4-18 5 Software Appllcatlons • . . . . . . . . . . . • • . . . . . • . • . . . . • . . • . . . . . . • . . . . . . . . . . . . . . . . • . . . . . 5-1 5.1 Processor Initialization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-2 5.1.1 TMS320C26 Download/Bootstrapping Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-6 5.2 Program Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-22 5.2.1 Subroutines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-22 5.2.2 Software Stack . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-24 5.2.3 Timer Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-25 5.2.4 Single-Instruction Loops . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-26 5.2.5 Computed GOTOs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-28 5.3 Interrupt Service Routine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-29 5.3.1 Context Switching . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-29 5.3.2 Interrupt Priority . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-32 5.4 Memory Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-33 5.4.1 Block Moves . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-33 5.4.2 Configuring On-Chip RAM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-35 5.4.3 Using On-Chip RAM for Program Execution . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-38 5.5 Fundamental Logical and Arithmetic Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-43 5.5.1 Status Register Effect on Data Processing . . . .. . . . . . . . . . . . . . . .. . .. . . .. . 5-43 5.5.2 Bit Manipulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-44 xii Table of Contents Contents 5.6 Advanced Arithmetic Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-46 5.6.1 Overflow Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-46 5.6.2 Scaling ............................................................ 5-47 5.6.3 Shifting Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-47 5.6.4 Moving Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-51 5.6.5 Multiplication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-53 5.6.6 Division . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-57 5.6.7 Floating-Point Arithmetic ............................................ 5-60 5.6.8 Indexed Addressing ................................................. 5-62 5.6.9 Extended-Precision Arithmetic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-62 5. 7 Application-Oriented Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-68 5.7.1 Companding ....................................................... 5-68 5.7.2 FIR/llR Filtering .................................................... 5-70 5.7.3 Adaptive Filtering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-71 5.7.4 Fast Fourier Transforms (FFT) ....................................... 5-75 5.7.5 PID Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-82 6 Hardware Appllcatlons . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-1 6.1 System Control Circuitry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-2 6.1.1 Powerup Reset Circuit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-2 6.1 .2 Crystal Oscillator Circuit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-5 6.1 .3 User Target Design Considerations for the XDS . . . . . . . . . . . . . . . . . . . . . . . . . 6-7 6.2 Interfacing Memories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-11 6.2.1 Interfacing PROMs ................................................. 6-12 6.2.2 Wait-State Generator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-19 6.2.3 Interfacing EPROMs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-22 6.2.4 Interfacing Static RAMs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-26 6.2.5 Interface liming Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-29 6.3 Direct Memory Access (DMA) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-32 6.4 Global Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-35 6.5 Interfacing Peripherals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-37 6.5.1 Combo-Codec Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-37 6.5.2 AIC Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-40 6.5.3 Digital-to-Analog (D/A) Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-42 6.5.4 Analog-to-Digital (ND) Interface .. .. . .. . . . . . .. . . . . .. . . .. . . . . . . . . . . .. .. 6-43 6.5.5 1/0 Ports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-46 6.6 System Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-48 6.6.1 Echo Cancellation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-48 6.6.2 High-Speed Modem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-48 6.6.3 Voice Coding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-49 6.6.4 Graphics and Image Processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-50 6.6.5 High-Speed Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-51 6.6.6 Instrumentation and Numeric Processing .............................. 6-51 xiii Contents A TMS320C25 Digital Signal Processors ............................................ A-1 B TMS320C26 Digital Signal Processor ................................•............. B-1 C TMS320C28 Digital Signal Processor .............................................. C-1 D SMJ320C2x Digital Signal Processors ............................................. D-1 E Instruction Cycle Timings ........................................................ E-1 E.1 TMS320C2x Instruction Cycle Timings ........................................ E-2 F TMS320E25 EPROM Programming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . • . . . . . . . . . . . . . F-1 F.1 Using the EPROM Programmer Adapter Socket . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . F-2 F.1.1 Supplying External Power . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . F-2 F.2 Programming and Verification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . F-4 F.2.1 Erasure ............................................................ F-7 F.2.2 FAST Programming .................................................. F-7 F.2.3 SNAP! Pulse Programming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . F-8 F.2.4 Program Verify . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . F-8 F.2.5 Program Inhibit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . F-11 F.2.6 Read . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . F-11 F.2.7 Output Disable ..................................................... F-11 F.3 EPROM Protection and Verification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . F-12 F.3.1 EPROM Protection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . F-12 F.3.2 How the RBITWorks ................................................ F-14 F.3.3 Protect Verify . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . F-15 G Analog Interface Peripherals and Applications .........................•........... G-1 G.1 Multimedia Applications ..................................................... G-2 G.1.1 System Design Considerations ........................................ G-2 G.1.2 Multimedia-Related Devices .......................................... G-4 G.2 Telecommunications Applications ............................................. G-5 G.3 Dedicated Speech Synthesis Applications .................................... G-1 O G.4 Servo Control/Disk Drive Applications ........................................ G-12 G.5 Modem Applications ....................................................... G-15 G.6 Advanced Digital Electronics Applications for Consumers ....................... G-18 H Memories, Analog Converters, Sockets, and Crystals .............................. H-1 H.1 Memories and Analog Converters ............................................. H-2 H.2 Sockets ................................................................... H-3 H.3 Crystals ................................................................... H-4 ROM Codes ...................................................................... 1-1 J Quality and Reliability ........................................................... J-1 J.1 Reliability Stress Tests . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . J-2 K Development Support ........•................................................... K-1 K.1 Device and Development Support Tool Nomenclature . . . . . . . . . . . . . . . . . . . . . . . . . . . K-2 xiv Table of Contents Figures 1-1 TMS320 Device Evolution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-3 2-1 TMS320C2x Pin Assignments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-2 2-2 TMS320C28 Pin Assignments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-3 3-1 TMS320C2x Simplified Block Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-3 3-2 TMS320C25/E25 Block Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-7 3-3 TMS320C26 Block Diagram .................................................... 3-8 3-4 TMS320C2x On-Chip Data Memory . . .. . . . .. . . .. . . . . . .. . . .. . . .. . . .. .. . .. .. .. . .. 3-13 3-5 TMS320C26 On-Chip Data Memory .. .. . . . .. . . .. .. . . . .. . . . . . . .. . . .. . . . .. . . .. . .. 3-14 3-6 Comparison of Internal RAM Configured as Data Space .......................... 3-18 3-7 Comparison of Internal RAM Configured as Program Space ....................... 3-18 3-8 TMS320C2x Memory Maps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-19 3-9 TMS320C26 Memory Maps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-20 3-1 O Indirect Auxiliary Register Addressing Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-23 3-11 Auxiliary Register File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-24 3-12 Methods of Instruction Operand Addressing ..................................... 3-26 3-13 Central Arithmetic Logic Unit (CALU), TMS320C2x . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-29 3-14 Examples of TMS320C25 Carry Bit Operation ................................... 3-31 3-15 Program Counter, Stack, and Related Hardware . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-35 3-16 Three-Level Pipeline Operation (TMS320C25) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-38 3-17 Two-Level Pipeline Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-38 3-18 TMS320C25 Standard Pipeline Operation ....................................... 3-39 3-19 Pipeline Operation of ADD Followed by SACL ................................... 3-41 3-20 Pipeline Operation With Wait States . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-42 3-21 Pipeline With External Data Bus Conflict . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-43 3-22 Pipeline Operation of Branch to On-Chip RAM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-44 3-23 Pipeline Operation of RET From On-Chip RAM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-44 3-24 TMS320C2x Status Register Organization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-49 3-25 TMS320C26 Status Register Organization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-50 3-26 Timer Block Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-52 3-27 Four-Phase Clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-56 3-28 BIO Timing Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-57 3-29 External Flag Timing Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-58 3-30 Interrupt Mask Register (IMR) ................................................. 3-60 3-31 Internal Interrupt Logic Diagram ................................................ 3-61 3-32 Interrupt Timing Diagram (TMS320C25) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-62 3-33 The ORR and DXR Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-64 3-34 Serial Port Block Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-65 3-35 Serial Port Transmit Timing Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-66 3-36 Serial Port Receive Timing Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-67 xv Figures 3-37 Burst-Mode Serial Port Transmit Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-68 3-38 Burst-Mode Serial Port Receive Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-68 3-39 Byte-Mode ORR Operation (TMS320C25) .. .. .. .. .. . .. .. .. .. .. . .. .. . .. . . .. .. .. . . 3-69 3-40 = Serial Port Transmit Continuous Operation (FSM 1) ............................. 3-70 3-41 Serial Port Receive Continuous Operation (FSM = 1) ............................. 3-70 3-42 Serial Port Transmit Continuous Operation (FSM = 0) ............................. 3-72 3-43 Serial Port Receive Continuous Operation (FSM = 0) ............................. 3-72 3-44 Continuous Transmit Operation Initialization ..................................... 3-74 3-45 Continuous Receive Operation Initialization ...................................... 3-74 3-46 Synchronization Timing Diagram (TMS320C25) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-76 3-47 Global Memory Access Timing ................................................. 3-77 3-48 TMS320C25 Hold Timing Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-80 4-1 Direct Addressing Block Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-3 4-2 Indirect Addressing Block Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-4 5-1 BIO-XF Handshake ........................................................... 5-7 5-2 Sequence for 8-Bit Transfers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-8 5-3 Sequence for 16-Bit Transfers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-8 5-4 Building LENGTH From STATUS and PROGRAM LENGTH Words . . . . . . . . . . . . . . . . . . 5-9 5-5 RS232 Connection to the TMS320C26 .......................................... 5-11 5-6 Sequence for RS232 Transfer (8 Data Bits Only) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-13 5-7 Building LENGTH From STATUS and PROGRAM LENGTH Words . . . . . . . . . . . . . . . . . 5-14 5-8 External Memory Byte Ordering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-16 5-9 On-Chip RAM Configurations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-36 5-1 O MACO Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-52 5-11 Execution Time vs. Number of Multiply-Accumulates (TMS320C25) . . . . . . . . . . . . . . . . 5-55 5-12 Program Memory vs. Number of Multiply-Accumulates . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-56 5-13 An In-Place DIT FFT With In-Order Outputs and Bit-Reversed Inputs ............... 5-76 5-14 An In-Place DIT FFTWith In-Order Inputs but Bit-Reversed Outputs ................ 5-76 6-1 Powerup Reset Circuit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-3 6-2 Voltage on TMS320C25 Reset Pin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-4 6-3 Crystal Oscillator Circuit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-5 6-4 Magnitude of Impedance of Oscillator LC Network ................................. 6-6 6-5 Direct Interface of TBP38L 165-35 to TMS320C25 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-14 6-6 Interface Timing of TBP38L 165-35 to TMS320C25 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-15 6-7 Interface of TBP38L 165-35 to TMS320C25 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-17 6-8 Interface Timing of TBP38L 165-35 to TMS320C25 (Address Decoding) . . . . . . . . . . . . . 6-18 6-9 One Wait-State Memory Access Timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-20 6-10 Wait-State Generator Design .................................................. 6-21 6-11 Wait-State Generator Timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-22 6-12 Interface of WS57C65F-12 to TMS320C25 ...................................... 6-23 6-13 Interface Timing of WS57C65F-12 to TMS320C25 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-24 6-14 Interface of TMS27C64-20 to TMS320C25 ...................................... 6-25 6-15 Interface Timing of TMS27C64-20 to TMS320C25 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-26 6-16 Interface of CY7C169-25 to TMS320C25 . .. .. .. .. .. . .. .. . . . .. . . .. . . . .. . .. . .. . .. . 6-28 6-17 Interface Timing of CY7C169-25 to TMS320C25 ................................. 6-29 xvi Table of Contents 6-18 Direct Memory Access Using a Master-Slave Configuration ........................ 6-33 6-19 Direct Memory Access in a PC Environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-34 6-20 Global Memory Communication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-36 6-21 Interface of TMS320C25 to TCM29C16 Codec .. . .. .. . . . .. .. . . .. . .. .. . .. . . . . .. . .. 6-38 6-22 Interface of TLC32040 to TMS320C2x .......................................... 6-41 6-23 Synchronous Timing of TLC32040 to TMS320C2x . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-41 6-24 Asynchronous Timing of TLC32040 to TMS320C2x . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-42 6-25 Interface of TLC7524 to TMS320C2x . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-42 6-26 Interface Timing of TLC7524 to TMS320C2x ..................................... 6-43 6-27 Interface of TLC0820 to TMS320C2x ........................................... 6-44 6-28 Interface Timing of TLC0820 to TMS320C2x ..................................... 6-45 6-29 1/0 Port Addressing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-46 6-30 1/0 Port Processor-to-Processor Communication ................................. 6-47 6-31 Echo Canceler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-48 6-32 High-Speed Modem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-49 6-33 Voice Coding System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-49 6-34 Graphics System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-50 6-35 Robot Axis Controller Subsystem .............................................. 6-51 6-36 Instrumentation System ....................................................... 6-51 F-1 EPROM Programming Adapter Socket ........................................... F-2 F-2 Vee and Vpp Jumper Settings for External Power ................................. F-3 F-3 EPROM Programming Data Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . F-4 F-4 TMS320E25 EPROM Conversion to TMS27C64 EPROM Pinout . . . . . . . . . . . . . . . . . . . . F-5 F-5 FAST Programming Flowchart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . F-9 F-6 SNAP! Pulse Programming Flowchart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . F-1 O F-7 Programming Timing ......................................................... F-11 F-8 EPROM Protection Flowchart .................................................. F-13 F-9 How the RBIT Fits Into the TMS320E25 Block Diagrams .......................... F-14 F-1 O EPROM Protection Timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . F-15 G-1 System Block Diagram ......................................................... G-2 G-2 Multimedia Speech Encoding and Modem Communication ......................... G-3 G-3 TMS320C25 to TLC32047 Interface ............................................. G-3 G-4 Typical DSP/Combo Interface ................................................... G-6 G-5 DSP/Combo Interface Timing ................................................... G-7 G-6 General Telecom Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . G-9 G-7 Generic Telecom Application ................................................... G-9 G-8 Generic SeNo Control Loop ................................................... G-12 G-9 Disk Drive Control System Block Diagram ....................................... G-13 G-10 TMS320C14-TLC32071 Interface ............................................. G-14 G-11 High-Speed V.32 Bis and Multistandard Modem With the TLC320AC01 AIC ......... G-16 G-12 Applications Performance Requirements ........................................ G-18 G-13 Video Signal Processing Basic System ......................................... G-19 G-14 Typical Digital Audio Implementation ............................................ G-19 H-1 Crystal Connection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . H-4 1-1 TMS320 ROM Code Flowchart .................................................. 1-2 K-1 TMS320 Device Nomenclature .................................................. K-3 K-2 TMS320 Development Tool Nomenclature . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . K-4 xvii Tables 1-1 TMS320C2x Processors Overview .............................................. 1-4 1-2 Typical Applications of the TMS320 Family . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-8 2-1 TMS320C2x Signal Descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-4 3-1 TMS320C2x Internal Hardware ................................................. 3-9 3-2 TMS320C25/26 Memory Blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-17 3-3 Memory-Mapped Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-22 3-4 PM Shift Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-33 3-5 Instruction Pipeline Sequence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-40 3-6 Status Register Field Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-50 3-7 Interrupt Locations and Priorities ............................................... 3-59 3-8 Serial Port Bits, Pins, and Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-63 3-9 Global Data Memory Configurations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-77 4-1 Indirect Addressing Arithmetic Operations ........................................ 4-6 4-2 Bit Fields for Indirect Addressing . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . .. . . . . . . 4-7 4-3 Instruction Symbols .......................................................... 4-12 4-4 Instruction Set Summary ...................................................... 4-14 5-1 Program Space and Time Requirements for µ-/A-Law Companding . . . . . . . . . . . . . . . . . 5-69 5-2 256-Tap Adaptive Filtering Memory Space and Time Requirements ................. 5-74 5-3 Bit-Reversal Algorithm for an 8-Point Radix-2 DIT FFT ............................ 5-77 5-4 FFT Memory Space and Time Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-81 6-1 Timing Parameters of TBP38L165-35 Direct Interface to TMS320C25 . . . . . . . . . . . . . . . 6-15 6-2 Timing Parameters of TBP38L165-35 to TMS320C25 (Address Decoding) . . . . . . . . . . 6-19 6-3 Wait States Required for Memory/Peripheral Access . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-20 6-4 Timing Parameters of WS57C64F-12 Interface to TMS320C25 . . . . . . . . . . . . . . . . . . . . . 6-24 6-5 Timing Parameters of TMS27C64-20 Interface to TMS320C25 . . . . . . . . . . . . . . . . . . . . . 6-26 6-6 Timing Parameters of CY7C169-25 Interface to TMS320C25 . . . . . . . . . . . . . . . . . . . . . . 6-27 E-1 TMS320C2x Instructions by Cycle Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . E-2 E-2 Cycle Timings for Cycle Classes When Not in Repeat Mode . . . . . . . . . . . . . . . . . . . . . . . . E-3 E-3 Cycle Timings for Cycle Classes When in Repeat Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . E-5 F-1 Pin Nomenclature (TMS320E25) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . F-5 F-2 TMS320E25 Programming Mode Levels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . F-6 F-3 TMS320E25 EPROM Protect and Protect Verify Mode Levels . . . . . . . . . . . . . . . . . . . . . . F-12 G-1 Data Converter ICs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . G-4 G-2 Switched-Capacitor Filter ICs ................................................... G-4 G-3 Telecom Devices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . G-8 G-4 Switched-Capacitor Filter ICs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . G-8 xviii Table of Contents Tables G-5 Voice Synthesizers ........................................................... G-1 O G-6 Speech Memories ............................................................ G-10 G-7 Switched-Capacitor Filter ICs .................................................. G-11 G-8 Control-Related Devices ...................................................... G-13 G-9 Modem AFE Data Converters .................................................. G-15 G-10 AudioNideo Analog/Digital Interface Devices .................................... G-20 H-1 Commonly Used Crystal Frequencies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . H-4 J-1 Microprocessor and Microcontroller Tests . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . J-5 J-2 TMS320C2x Transistors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . J-5 xix Examples 5-1 Processor Initialization (TMS320C25) . . . . .. . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-3 5-2 Processor Initialization (TMS320C26) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-4 5-3 BIO-XF Transfer Protocol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-7 5-4 RS232 Transfer Protocol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-12 5-5 TMS320C26BFNL Bootloader ................................................. 5-17 5-6 Subroutines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-22 5-7 Software Stack Expansion .................................................... 5-24 5-8 Clock Divider Using Timer (TMS320C25) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-26 5-9 Instruction Repeating ......................................................... 5-27 5-10 Computed GOTO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-28 5-11 Context Save (TMS320C25) .. .. .. .. .. .. .. . . .. .. .. . .. .. . .. .. .. .. .. .. . .. .. .. . . .. 5-30 5-12 Context Restore (TMS320C25) ................................................ 5-31 5-13 Interrupt Service Routine ...................................................... 5-32 5-14 Moving External Data to Internal Data Memory With BLKD . . . . . . . . . . . . . . . . . . . . . . . . 5-33 5-15 Moving Program Memory to Data Memory With BLKP . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-33 5-16 Moving Program Memory to Data Memory With TBLR . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-34 5-17 Moving Internal Data Memory to Program Memory With TBLW . . . . . . . . . . . . . . . . . . . . . 5-34 5-18 Moving Data From 1/0 Space Into Data Memory With IN .......................... 5-34 5-19 Moving Data From Data Memory to 1/0 Space With OUT . . . . . . . . . . . . . . . . . . . . . . . . . . 5-35 5-20 Configuring and Using On-Chip RAM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-37 5-21 Program Execution From On-Chip Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-39 5-22 Program Execution From On-Chip Memory (TMS320C26) . . . . . . . . . . . . . . . . . . . . . . . . . 5-41 5-23 Using BIT and BBZ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-45 5-24 Using BITT and BBNZ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-45 5-25 Bit-Reversed Carry Addition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-48 5-26 FFT Bit Reversals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-48 5-27 Using the ARO Test Bit to Calculate the Square Root of a Long Integer .............. 5-50 5-28 Using MACO for Moving Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-52 5-29 Multiply ..................................................................... 5-53 5-30 Multiply-Accumulate Using the MAC Instruction (TMS320C25) . . . . . . . . . . . . . . . . . . . . . 5-54 5-31 Multiply-Accumulate Using the LTA-MPY Instruction Pair .......................... 5-54 5-32 Using SQRA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-57 5-33 Divide 33 by 5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-58 5-34 Using SUBC for Integer Division ............................................... 5-59 5-35 Using SUBC for Fractional Division ............................................. 5-59 5-36 Using NORM for Floating-Point Multiply . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-61 xx Table of Contents Examples 5-37 Using LACT for Denormalization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-61 5-38 Row limes Column . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-62 5-39 64-Bit Addition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-64 5-40 64-Bit Subtraction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-65 5-41 32 x 32-Bit Multiplication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-66 5-42 Implementing an llR Filter ..................................................... 5-70 5-43 256-Tap Adaptive FIR Filter ................................................... 5-73 5-44 Adaptive Filter Routine Concluded ............................................. 5-74 5-45 FFT Macros . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-79 5-46 An 8-Point DIT FFT .......................................................... 5-81 5-47 PIO Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-83 xxi xxii Table of Contents Chapter 1 Introduction The TMS320 family of 16/32-bit single-chip digital signal processors combines the flexibility of a high-speed controller with the numerical capability of an array processor, offering an inexpensive alternative to custom VLSI and multichip bit-slice processors for signal processing. The TMS32010, the first digital signal processor in the TMS320 family, was introduced in 1982. Since that time, the TMS320 family has established itself as the industry standard for digital signal processing. The powerful instruction set, inherentflexibility, high-speed number-crunching capabilities, and innova- tive architecture make these high-performance, cost-effective processors ideal for many telecommunications, computer, commercial, industrial, and mil- itary applications. Note: Throughout this document, TMS320C2x refers to the TMS320C25, TMS320C25-33, TMS320C25-50, TMS320E25, TMS320C26, and TMS320C28 unless stated otherwise. Where applicable, ROM includes the on-chip EPROM of the TMS320E25. Topics in this chapter include Topic Page 1-1 1.1 General Description The TMS320 family currently consists of five generations: TMS320C1x, TMS320C2x, TMS320C3x, TMS320C4x, and TMS320C5x (see Figure 1-1). The family expansion includes enhancements of existing generations and more powerful new generations of digital signal processors. Many features are common among these generations. Some specific features are added in each processor to provide different cost/performance tradeoffs. Software compati- bility is maintained throughout the family to protect the user's investment in ar- chitecture. Each processor has software and hardware tools to facilitate rapid design. This document discusses the TMS320C2x devices: O TMS320C25, a CMOS 40-MHz digital signal processor capable of twice the performance of the TMS320C1 x devices 0 TMS320C25-33 a CMOS 33-MHz version of the TMS32025 O TMS320C25-50, a CMOS enhanced-speed (50-MHz) version of the TMS320C25 O TMS320E25, a version of the TMS320C25 (40-MHz) with on-chip ROM replaced by secure, on-chip EPROM O TMS320C26, a version of the TMS320C25 (40-MHz) with expanded confi- gurable program/data RAM O The TMS320C28, a version of the TMS320C25 (40-MHz) with expanded SK-word on-chip ROM and an added power-down mode. 1-2 Introduction Figure 1-1. TMS320 Device Evolution p E R F 0 R M A N c E M I p s I M TMS320C1x F TMS320C10 L TMS320C10-14/-25 0 TMS320C14 p TMS320E14/P14 s TMS320C15/LC15 TMS320E15/P15 TMS320C15-25 TMS320E15-25 TMS320C16 TMS320C17/LC17 TMS320E17/P17 GENERATION LJ Fixed-Point Generations ~ Floating-Point Generations Plans for expansion of the TMS320 family include more spinoffs of the existing generations as well as more powerful future generations of digital signal pro- cessors. The TMS320 family combines the high performance and specialized features necessary in digital signal processing (DSP) applications with an extensive program of development support, including hardware and software develop- ment tools, product documentation, textbooks, newsletters, DSP design work- shops, and a variety of application reports. See Appendix K for a discussion of the wide range of development tools available. 1-3 General Description The combination of the TMS320's Harvard-type architecture (separate pro- gram and data buses) and its special digital signal processing instruction set provide speed and flexibility to execute 12.8 Ml PS (million instructions per se- cond). The TMS320 family optimizes speed by implementing functions in hardware that other processors implement through software or microcode. This hardware-intensive approach provides the design engineer with power previously unavailable on a single chip. The TMS320C2x generation includes six members: TMS320C25, TMS320C25-33, TMS320C25-50, TMS320E25, TMS320C26, and TMS320C28. Table 1-1 provides an overview of the TMS320C2x generation of processors with comparisons of memory, 1/0, cycle timing, and package type. Table 1-1. TMS320C2x Processors Overview Memory Device On-chip ROM/ Off-chip 1/0 Ports t Cycle Package RAM EPROM Prog Data Time Type* Ser Par OMA (ns) PGA PLCC CER QFP TMS320C25:j: 544 4K 64K 64K Yes 16 x 16 Con 100 68 68 - - TMS320C25-33 544 4K 64K 64K Yes 16 x 16 Con 120 - 68 - - TMS320C25-50§ 544 4K 64K 64K Yes 16 x 16 Con 80 - 68 - - TMS320E25§ 544 4K 64K 64K Yes 16 x 16 Con 100 - - 68 80 TMS320C26 1568 256 64K 64K Yes 16 x 16 Con 100 - 68 - - TMS320C28 544 SK 64K 64K Yes 16 x 16 Con 100 - 68 - 80 tSer = serial; Par = parallel; OMA = direct memory access; Con = concurrent OMA. :!:Military version available; contact nearest Tl Field Sales Office for availability. §Military version planned; contact nearest Tl Field Sales Office for details. *PGA = 68-pin grid array; PLCC =plastic-leaded chip carrier; CER =surface mount ceramic-leaded chip carrier (CER-QUAO); QFP = plastic quad flat package The TMS320C25, like all members of the TMS320C2x generation, is pro- cessed in CMOS technology. The TMS320C25 is capable of executing 10 mil- lion instructions per second. Enhanced features such as 24 additional instruc- tions (133 total), eight auxiliary registers, an eight-level hardware stack, 4K words of on-chip program ROM, a bit-reversed indexed addressing mode, and the low power dissipation inherent to the CMOS process contribute to the high performance. The TMS320C25-33 is a 33-MHz version of the TMS320C25. It is capable of an instruction cycle of 120 ns. It is architecturally identical to the 40-MHz ver- sion of the TMS320C25 and is pin-for-pin and object-code compatible with the TMS320C25. The TMS320C25-50 is a high-speed version of the TMS320C25. It is capable of an instruction cycle time of 80 ns. It is architecturally identical to the 40-MHz version of the TMS320C25 and is pin-for-pin and object-code compatible with the TMS320C25. 1-4 Introduction The TMS320E25 is identical to the TMS320C25, except that the on-chip 4K-word program ROM is replaced with a 4K-word on-chip program EPROM. On-chip EPROM allows realtime code development and modification for im- mediate evaluation of system performance. The TMS320C26 is pin-for-pin and object-code compatible (except for RAM configuration instructions) with the TMS320C25. It is capable of an instruction cycle time of 100 ns. The enhancement over the TMS320C25 consists of a larger, configurable, on-chip RAM divided into 4 blocks, for a total 1568-word program/data space. The TMS320C26 is similar to the TMS320C25 except for its internal memory configuration. This is discussed in Section NO TAG and in Appendix NO TAG. The TMS320C28 is object code-compatible with the TMS320C25. It is capable of an instruction cycle time of 100 ns. The TMS320C28 contains an expanded BK words of on-chip program ROM and an added power-down mode, which conserves power while saving the contents of on-chip SRAM (BO, B1, and 82). 1-5 Features 1.2 Key Features Key features of the TMS320C2x devices are listed below. Those that pertain to a particular device are followed by the device name within parentheses. D Instruction cycle timing: 80-ns {TMS320C25-50) 100-ns (TMS320C25, TMS320E25, TMS320C26, and TMS320C28) 120-ns (TMS320C25-33) D 544-word programmable on-chip data RAM D 1568-word configurable program/data RAM (TMS320C26 only) D 4K-word on-chip program ROM (TMS320C25, TMS302C25-33, and TMS320C25-50) D SK-word on-chip program ROM (TMS320C28 only) D Secure 4K-word on-chip program EPROM (TMS320E25) D 128K-word total data/program memory space D 32-bit ALU/accumulator D 16- x16-bit parallel multiplier with a 32-bit product D Single-cycle multiply/accumulate instructions D Repeat instructions for efficient use of program space and enhanced execution D Block moves for data/program management D On-chip timer for control operations D Up to eight auxiliary registers with dedicated arithmetic unit D Up to eight-level hardware stack D Sixteen input and sixteen output channels D 16-bit parallel shifter D Wait states for communication to slower off-chip memories/peripherals D Serial port for direct codec interface D Synchronization input for synchronous multiprocessor configurations 1-6 Introduction Features O Global data memory interface O TMS320C1x source-code upward compatibility O Concurrent DMA using an extended hold operation O Instructions for adaptive filtering, FFT, and extended-precision arithmetic O Bit-reversed indexed-addressing mode for radix-2 FFT O On-chip clock generator O Single 5-V supply O Power-down mode (TMS320C28 only) O Device packaging: 68-pin PGA (TMS320C25) 68-lead PLCC {TMS320C25, TMS320C26, and TMS320C28) 68-lead GER-QUAD (TMS320E25) 80-pin QFP (TMS320C28) O Commercial and military versions available 1-7 Typical Applications 1.3 Typical Applications The TMS320 family's unique versatility and realtime performance offer flexible design approaches in a variety of applications. In addition, TMS320 devices can simultaneously provide the multiple functions often required in those com- plex applications. Table 1-2 lists typical TMS320 family applications. Table 1-2. Typical Applications of the TMS320 Family General-Purpose DSP Graphics/Imaging Instrumentation Digital Filtering 3-D Rotation Spectrum Analysis Convolution Robot Vision Function Generation Correlation Image Transmission/ Pattern Matching Hilbert Transforms Compression Seismic Processing Fast Fourier Transforms Pattern Recognition Transient Analysis Adaptive Filtering Image Enhancement Digital Filtering Windowing Homomorphic Processing Phase-Locked Loops Waveform Generation Workstations Animation/Digital Map Voice/Speech Control Military Voice Mail Disk Control Secure Communications Speech Vocoding Servo Control Radar Processing Speech Recognition Robot Control Sonar Processing Speaker Verification Laser Printer Control Image Processing Speech Enhancement Engine Control Navigation Speech Synthesis Motor Control Missile Guidance Text-to-Speech Radio Frequency Modems Telecommunications Automotive Echo Cancellation FAX Engine Control ADPCM Transcoders Cellular Telephones Vibration Analysis Digital PBXs Speaker Phones Antiskid Brakes Line Repeaters Digital Speech Adaptive Ride Control Channel Multiplexing Interpolation (OSI) Global Positioning 1200 to 19200-bps Modems X.25 Packet Switching Navigation Adaptive Equalizers Video Conferencing Voice Commands DTMF Encoding/Decoding Spread Spectrum Digital Radio Data Encryption Communications Cellular Telephones Consumer Industrial Medical Radar Detectors Robotics Hearing Aids Power Tools Numeric Control Patient Monitoring Digital Audio/TV Security Access Ultrasound Equipment Music Synthesizer Power Line Monitors Diagnostic Tools Toys and Games Prosthetics Solid-State Answering Fetal Monitors Machines Many of the TMS320C2x features, such as single-cycle multiply/accumulate instructions, 32-bit arithmetic unit, large auxiliary register file with a separate arithmetic unit, and large on-chip RAM and ROM make the device particularly applicable in digital signal processing systems. At the same time, general-pur- pose applications are greatly enhanced by the large address spaces, on-chip timer, serial port, multiple interrupt structure, provision for external wait states, and capability for multiprocessor interface and direct memory access. 1-8 Introduction Typical Applications The TMS320C2x has the flexibility to be configured to satisfy a wide range of system requirements. This allows the device to be applied in systems currently using costly bit-slice processors or custom ICs. These are examples of such system configurations: O A standalone system using on-chip memory, O Parallel multiprocessing systems with shared global data memory, or O HosVperipheral coprocessing using interface control signals. 1-9 1-10 Introduction Chapter 2 Pinouts and Signal Descriptions ~~ewrw 1; 1 u11 The TMS320C2x generation digital signal processors are available in one or more of four package types. The TMS320C25 (40-MHz version only) is avail- able in a 68-pin grid array (PGA) package. The TMS320C25 (33-MHz, 40-MHz, and 50-MHz versions) and the TMS320C26 are available in a plastic 68-lead chip carrier (PLCC) package. The TMS320E25 is packaged in a ce- ramic surface mount 68-lead chip carrier (CER-QUAD) package. The TMS320C28 is available in a 80-pin quad flat package (QFP). All TMS320 packages conform to JEDEC specifications. Conversion sockets that accept PLCC and CER-QUAD packages and have a PGA footprint are commercially available. For more information, refer to Ap- pendix E. When using the XDS emulator, refer to subsection 6.1 .3 for user target design considerations. The TMS320C26 is similar to the TMS320C25 except for its internal memory configuration. This is discussed in Section 3.4 and in Appendix B. Topics in this chapter include Topic Page 2-1 TMS320C2x Pinouts 2.1 TMS320C2x Pinouts Figure 2-1 shows pinouts of the PGA, PLCC, and CER-QUAD packages for the TMS320C2x devices. Note that the pinout and external dimensions of PLCC and CER-QUAD are identical. Figure 2-2 shows preliminary pinouts of the QFP package for the TMS320C28 device. Figure 2-1. TMS320C2x Pin Assignments 68-Pln GB Pin Grid Array Ceramic Package (Top View) ,, 2 3 4 5 6 7 8 9 10 11 A e • • • • • • • • B $ e e e e e e e e $ e c •• • • D • • • • E • • • • F • • • • G • • • • H • • • • • • • • K • • • • • $ • • • $ • L • • • • • • • • • Vss ~ D7 59 ~ D6 58 CLKOUT1 D5 57 CLKOUT2 D4 56 XF D3 55 ROIJ»!i: D2 54 DX D1 17 53 FSX DO 18 52 X2 CLKIN SYfifC 19 51 X1 TlilTO 20 50 B"R" TlilT1 21 49 STRB TlilT2 22 48 R/W Vee 23 47 I'S DR 24 46 TS FSR 25 45 OS AO 26 44 Vss vn~~~~•M••~~-~~aa 2-2 Pinouts and Signal Descriptions TMS320C2x Pinouts Figure 2-2. TMS320C28 Pin Assignments 80-Pln PH Quad Flat Package t (Top View) i'.: ~ ~ :::> :::> <( li::: uoo lg en~~u.O igxx d ~a:g:I I'° en en l::e u u x :i:: > o ~ ~ xlai en1~la.l!alc IACR: WARE1JP POT Vss Vee A15 Vee A14 CLKX A13 Vss CLKR A12 Vss z 0 RS READY ROl:D A11 A10 A9 -!;:( BTO AS MP~ Vee ~ D15 Vss Vee A7 a: D14 AS 0 D13 Vss u.. Vee D12 AS A4 z D11 D10 A3 A2 w DO 21 A1 () D6 22 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 4 43 PDACK z ~ Vss Vss Vss 24r-. "' IO """ "' C\I en~ o lo ,~ IC\I a: a:'l1 lu u AO OOOOOO~OOz!z!z!z UC~ in---:> c < t Packages are shown for pinout reference only. 2-3 TMS320C2x Descriptions 2.2 TMS320C2x Signal Descriptions The signal descriptions for the TMS320C2x devices are provided in this sec- tion. Table 2-1 lists each signal, its pin location (PGA, PLCC, and CER- QUAD), function, and operating mode(s): that is, input, output, or high-imped- ance state as indicated by I, 0, or Z. The signals in Table 2-1 are grouped ac- cording to function and alphabetized within that grouping. Table 2-1. TMS320C2x Signal Descriptions Signal Pin 1/0/Z* Description (PGA/PLCCt) Address/Data Buses A15 MSB L 10/43 0/Z Parallel address bus A15 (MSB) through AO (LSB). A14 K9/42 Multiplexed to address external data/program memory or 1/0. A13 L9/41 Placed in high-impedance state in the hold mode. A12 KB/40 A11 LB/39 A10 K7/3B A9 L7/37 AB K6/36 A7 K5/34 A6 L5/33 AS K4/32 A4 L4/31 A3 K3/30 A2 L3/29 A1 K2/2B AOLSB K1/26 D15 MSB 86/2 1/0/Z Parallel data bus D15 (MSB) through DO (LSB). Multiplexed to D14 A5/3 transfer data between the TMS320C2x and external data/pro- D13 85/4 gram memory or 1/0 devices. Placed in the high-impedance state D12 A4/5 when not outputting or when RS or HOm is asserted. D11 84/6 D10 A3/7 D9 83/B DB A2/9 D7 82/11 D6 C1/12 D5 C2/13 D4 D1/14 D3 D2/15 D2 E1/16 D1 E2/17 DO LSB F1/ 1B Interface Control Signals ITS K10/45 0/Z Data, program, and 1/0 space select signals. Always high unless PS J10/47 low level asserted for communicating to a particular external TS J11/46 space. Placed in high-impedance state in the hold mode. READY BB/66 I Data ready input. Indicates that an external device is prepared for the bus transaction to be completed. If the device is not ready (READY = 0), the TMS320C2x waits one cycle and checks READY again. READY also indicates a bus grant to an external device after a SR (bus request) signal. t Pin numbers apply to CEA-QUAD as well as to PLCC. :j: Input/Output/High-impedance state. 2-4 Pinouts and Signal Descriptions TMS320C2x Descriptions Table 2-1. TMS320C2x Signal Descriptions (Continued) Signal Pin 110/Zi Description (PGA/PLCCt) Interface Control Signals (Continued) R/W H11/48 0/Z Read/write signal. Indicates transfer direction when communicat- ing to an external device. Normally in read mode (high), unless low level asserted for per1orming a write operation. Placed in high-impedance state in the hold mode. STRB H10/49 O/Z Strobe signal. Always high unless asserted low to indicate an ex- ternal bus cycle. Placed in high-impedance state in the hold mode. Multiprocessing Signals BR G11/50 0 Bus request signal. Asserted when the TMS320C2x requires ac- cess to an external global data memory space. READY is as- serted to the device when the bus is available and the global data memory is available for the bus transaction. ROID A7/67 I Hold input. When this signal is asserted, the TMS320C2x places the data, address, and control lines in the high-impedance state. RDrnA E10/55 0 Hold acknowledge signal. Indicates that the TMS320C2x has gone into the hold mode and that an external processor may ac- cess the local external memory of the TMS320C2x. SYf\fC F2/19 I Synchronization input. Allows clock synchronization of two or more TMS320C2xs. SYf\fC is an active-low signal and must be asserted on the rising edge of CLKIN. Interrupt and Miscellaneous Signals 8TO B?/68 I Branch control input. Polled by BIOZ instruction. If 8TO is low, the TMS320C2x executes a branch. This signal must be active during the BIOZ instruction fetch. TACK B11/60 0 Interrupt acknowledge signal. Output is valid only while CLKOUT1 is low. Indicates receipt of an interrupt and that the pro- gram is branching to the interrupt-vector location designated by A15-AO. TITT2 H1/22 I External user interrupt inputs. Prioritized and maskable by the in- TITT1 G2/21 terrupt mask register and the interrupt mode bit. TITTO G1/20 MPi'MC A6/1 I Microprocessor/microcomputer mode select pin for the TMS320C25. When asserted low (microcomputer mode), the pin causes the internal ROM to be mapped into the lower 4K words of the program memory map. In the microprocessor mode, the lower 4K words of program memory are external. t Pin numbers apply to CEA-QUAD as well as to PLCC. :j: Input/Output/High-impedance state. 2-5 TMS320C2x Signal Descriptions Table 2-1. TMS320C2x Signal Descriptions (Continued) Signal Pin 1/0/Z* Description (PGA/PLCCt) Interrupt and Miscellaneous Signals (Continued) fiiJSC C10/59 0 Microstate complete signal. Asserted low and valid only during CLKOUT1 low when the TMS320C2x has just completed a memory operation, such as an instruction fetch or a data memory read/write.~ can be used to generate a one wait-state READY signal for slow memory. RS AB/65 I Reset input. Causes the TMS320C2x to terminate execution and forces the program counter to zero. When RS is brought to a high level, execution begins at location zero of program memory. RS affects various registers and status bits. XF 011/56 0 External flag output (latched software-programmable signal). Used for signaling other processors in multiprocessor configura- tions or as a general-purpose output pin. Supply/Oscillator Signals CLKOUT1 C11/58 0 Master clock output signal (CLKIN frequency/4). CLKOUT1 rises atthe beginning of quarter-phase 3 (03) and falls atthe beginning of quarter-phase 1 (01). CLKOUT2 010/57 0 A second clock output signal. CLKOUT2 rises at the beginning of quarter-phase 2 (02) and falls at the beginning of quarter-phase 4 (04). Vee A10/61 I Four 5-V supply pins, tied together externally. 810/62 H2/23 L6/35 Vss 81/10 I Three ground pins, tied together externally. K11/44 L2/27 X1 G10/51 0 Output pin from the internal oscillator for the crystal. If a crystal is not used, this pin should be left unconnected. X2/CLKIN F11 /52 I Input pin to the internal oscillator from the crystal. If crystal is not used, a clock may be input to the device on this pin t Pin numbers apply to CER-OUAD as well as to PLCC. *Input/Output/High-impedance state. 2-6 Pinouts and Signal Descriptions TMS320C2x Table 2-1. TMS320C2x Signal Descriptions (Continued) Signal Pin 1/0/Z* Description (PGA/PLCCt) Serial Port Signals CLKR 89/64 I Receive clock input. External clock signal for clocking data from the DR (data receive) pin into the RSR (serial port receive shift register). Must be present during serial port transfers. CLKX A9/63 I Transmit clock input. External clock signal for clocking data from the XSR (serial port transmit shift register) to the DX (data trans- mit) pin .. Must be present during serial port transfers. DR J1/24 I Serial data receive input. Serial data is received in the RSA (serial port receive shift register) via the DR pin. DX E11/54 0/Z Serial data transmit output. Serial data transmitted from the XSR (serial port transmit shift register) via the DX pin. Placed in high- impedance state when not transmitting. FSR J2/25 I Frame synchronization pulse for receive input. The falling edge of the FSA pulse initiates the data-receive process, beginning the clocking of the RSA. FSX F10/53 1/0 Frame synchronization pulse for transmit input/output. The falling edge of the FSX pulse initiates the data- transmit process, begin- ning the clocking of the XSR. Following reset, the default operat- ing condition of FSX is as an input. This pin may be selected by software to be an output when the TXM bit in the status register is set to 1. t Pin numbers apply to CER-QUAD as well as to PLCC. :j: Input/Output/High-impedance state. Note: See Appendix C for TMS320C28 signal descriptions. 2-7 2-8 Pinouts and Signal Descriptions Chapter 3 Ji 11 It !! J Willi ill! Ji L ti Ji I !J t t i I it J Architecture t i I l 11 l The architectural design of the TMS320C2x emphasizes overall system speed, communication, and flexibility in processor configuration. Control sig- nals and instructions provide block memory transfers, communication to slow- er off-chip devices, and multiprocessing implementations. Single-cycle multi- ply/accumulate instructions, two large on-chip RAM Blocks, eight auxiliary registers with a dedicated arithmetic unit, a serial port, a hardware timer, and a faster 1/0 for data-intensive signal processing are features that increase throughput for DSP applications. The TMS320C26 is similar to the TMS320C25 except for its internal memory configuration. This is discussed in Section 3.4 and in Appendix B. Topics in this chapter include: Topic Page 3-1 Architectural Overview 3.1 Architectural Overview Harvard Architecture. The TMS320C2x high-performance digital signal pro- cessors, like the TMS320C1 x devices, implement a Harvard-type architecture that maximizes processing power by maintaining two separate memory bus structures, program and data, for full-speed execution. Instructions are in- cluded to provide data transfers between the two spaces. Externally, the pro- gram and data memory can be multiplexed over the same bus so as to maxi- mize the address range for both spaces while minimizing the pin count of the device. On-Chip Memory. The TMS320C25 provides increased flexibility in system design by two large on-chip data RAM blocks {a total of 544 16-bit words), one of which is configurable either as program or data memory {see Figure 3-1). The TMS320C26 provides three large on-chip RAM blocks, configurable ei- ther as separate program and data spaces or as three continuous data blocks, to provide increased flexibility in system design. An off-chip 64K-word directly addressable data memory address space is included to facilitate implementa- tions of DSP algorithms. The large on-chip 4K-word masked ROM on the TMS320C25 can reduce the cost of systems, thus providing for a true single-chip DSP solution {see Figure 3-1). Programs of up to 4K words can be masked into the internal pro- gram ROM. The remainder of the 64K-word program memory space is located externally. Large programs can execute at full speed from this memory space. Programs may also be downloaded from slow external memory to on-chip RAM for full-speed operation. The 4K-word on-chip EPROM on the TMS320E25 allows realtime code devel- opment and modification for immediate evaluation of system performance. Instructions can be executed from the EPROM at full speed. The EPROM is equipped with a security mechanism allowing you to protect proprietary in- formation. A programming adapter socket is available from Texas Instruments that provides 68- to 28-pin conversion for programming with standard PROM programmers. Refer to Appendix F for details. 3-2 Architecture Architectural Overview Figure 3-1. TMS320C2x Simplified Block Diagram +5V Gnd t Data/Prog t Data RAM RAM 288-Word A Interrupts ~ .J'.. ... 256-Word (1568-Word V Data (16} -v TMS320C26) " Multiprocessor 4-K Words ROM/EPROM (TMS320C25/E25} Interface ..._ ,,,.- .. --... _ Multiplier Serial .,. Interface..., 32-Bit ALU/ACC ....- --.. G D Shifters L Timer Address (16) v Arithmetic Logic Unit. The TMS320C2x performs 2s-complement arithmetic using the 32-bit ALU and accumulator. The ALU is a general-purpose arithme- tic unit that operates using 16-bit words taken from data RAM or derived from immediate instructions or using the 32-bit result of the multiplier's product reg- ister. In addition to the usual arithmetic instructions, the ALU can perform Bool- ean operations, providing the bit manipulation ability required of a high-speed controller. The accumulator stores the output from the ALU and is the second input to the ALU. The accumulator is 32 bits in length and is divided into a high- order word (bits 31 through 16) and a low-order word (bits 15 through 0). Instructions are provided for storing the high- and low-order accumulator words in memory. Multiplier. The multiplier performs a 16 x 16-bit 2s-complement multiplication with a 32-bit result in a single instruction cycle. The multiplier consists of three elements: the T register, P register, and multiplier array. The 16-bit T register temporarily stores the multiplicand; the P register stores the 32-bit product. Multiplier values come from data memory, from program memory when using the MAC/MACO instructions, or immediately from the MPYK (multiply immedi- ate) instruction word. The fast on-chip multiplier allows the device to perform efficiently the fundamental DSP operations such as convolution, correlation, and filtering. 3-3 Architectural Overview The TMS320C2x scaling shifter has a 16-bit input connected to the data bus and a 32-bit output connected to the ALU. The scaling shifter produces a left- shift of O to 16 bits on the input data, as programmed in the instruction. The LSBs of the output are filled with zeros, and the MSBs may be either filled with zeros or sign-extended, depending upon the state of the sign-extension mode bit of status register ST1. Additional shift capabilities enable the processor to perform numerical scaling, bit extraction, extended arithmetic, and overflow prevention. Memory Interface. The TMS320C2x local memory interface consists of a 16-bit parallel data bus (D15-DO), a 16-bit address bus (A 15-AO), three pins for data/program memory or 1/0 space select (OS, PS, and TS), and various system control signals. The R/W signal controls the direction of a data transfer, and the STRB signal provides a timing signal to control the transfer. When us- ing on-chip program RAM, ROM/EPROM, or high-speed external program memory, the TMS320C2x runs at full speed without wait states. The use of a READY signal allows wait-state generation for communicating with slower off- chip memories. Up to eight levels of hardware stack are provided for saving the contents of the program counter during interrupts and subroutine calls. Instructions are avail- able for saving the device's complete context. PUSH and POP instructions permit a level of nesting restricted only by the amount of available RAM. The interrupts used in these devices are maskable. All control operations are supported on the TMS320C2x by an on-chip memory-mapped 16-bit timer, a repeat counter, three external maskable user interrupts, and internal interrupts generated by serial port operations or by the timer. A built-in mechanism protects from instructions that are repeated or be- come multicycle due to the READY signal and from holds and interrupts. Serial Port. An on-chip full-duplex serial port provides direct communication with serial devices such as codecs, serial ND converters, and other serial sys- tems. The interface signals are compatible with codecs and many other serial devices with a minimum of external hardware. The two serial port memory- mapped registers (the data transmit/receive registers) may be operated in ei- ther an 8-bit byte or 16-bit word mode. Each register has an external clock in- put, a framing synchronization input, and associated shift registers. Multiprocessing Applications. The TMS320C2x has the capability of allo- cating global data memory space and communicating with that space via the BR (bus request) and READY control signals. The 8-bit memory-mapped global memory allocation register (GREG) specifies up to 32K words of the TMS320C2x data memory as global external memory. The contents of the reg- ister determine the size of the global memory space. If the current instruction addresses an operand within that space, BR is asserted to request control of the bus. The length of the memory cycle is controlled by the READY line. 3-4 Architecture Architectural OveNiew Direct Memory Access. The TMS320C2x supports direct memory access (OMA) to its external program/data memory using the ROCO and HOLDA sig- nals. Another processor can take complete control of the TMS320C2x external memory by asserting ROCO low. This causes the TMS320C2x to place its ad- dress, data, and control lines in the high-impedance state. Signaling between the external processor and the TMS320C2x can be performed by using inter- rupts. On the TMS320C2x, two modes are available: a mode in which execu- tion is suspended during assertion of ROCO, and a concurrent OMA mode in which the TMS320C2x continues to execute its program while operating from internal RAM or ROM, thus greatly increasing throughput in data-intensive ap- plications. 3-5 Functional Block Diagram 3.2 Functional Block Diagram The functional block diagram shown in Figure 3-2 and Figure 3-3 outlines the principal blocks and data paths within the TMS320C2x processors. Further details of the functional blocks are provided in the succeeding sections. Refer to Section 3.3, Internal Hardware Summary, for definitions of the symbols used in Figure 3-2. The block diagram also shows all of the TMS320C2x interface pins. Figure 3-3 shows the block diagram of the TMS320C26. The TMS320C2x architecture is built around two major buses: the program bus and the data bus. The program bus carries the instruction code and im- mediate operands from program memory. The data bus interconnects various elements, such as the central arithmetic logic unit (CALU} and the auxiliary register file, to the data RAM. Together, the program and data buses can carry data from on-chip data RAM and internal or external program memory to the multiplier in a single cycle for multiply/accumulate operations. The TMS320C2x has a high degree of parallelism; for example, while the data is being operated upon by the CALU, arithmetic operations may also be imple- mented in the auxiliary register arithmetic unit (ARAU). Such parallelism re- sults in a powerful set of arithmetic, logic, and bit-manipulation operations that may all be performed in a single machine cycle. LEGEND: ACCH = Accumulator high IFR = Interrupt flag register PC = Program Counter ACCL = Accumulator low IMR = Interrupt mask register PFC = Prefetch counter ALU = Arithmetic logic unit IR = Instruction register RPTC = Repeat Instruction counter ARAU = Auxiliary register arithmetic unit MCS = Microcall stack GREG =Global memory allocation register ARB = Auxiliary register pointer buffer QIR = Queue Instruction register RSR = Serial port receive shift register ARP = Auxiliary register pointer PR = Product register XSR = Serial port transmit shift register DP = Data memory page pointer PRO = Period register for timer ARO-AR = Auxiliary registers ORR = Serial port data receive register TIM ="Timer STO.ST = Status registers DXR = Serial port data transmit register TR =Temporary register C =Carry bit 3-6 Architecture Functional Block Diagram Figure 3-2. TMS320C25/E25 Block Diagram SYNC Program Bus IS z~5 -~ OS" I'S ill :iloo ~~:il:i:J X OU 16 16 16 16 QIR(16) ~ [ PFC(16)] ~:::::: ~ IR(16) 16 READY- ST0(16) BR--- } 16 ST1(16) XF--- A~:::= ~ -- 6 RPTC(B) - IFR(6) MCS(16)j-+-+--/ L PC(16) ~--- ~ :r DR ~=== 12 cLKR FS R l 16 16 ~--- DX MP/fE 3 16 Address G Stack (Bx 16) 16 8 RSR(16) l CLKX x FS 00(2·0) Program ROM/ XSR(16) 16 EPROM ~ 16 A15·A x :;) (4096x16) DRR(16) ~ :IE DXR(16) Instruction TIM(16) ~ RBIT 16 l . 16 16 ~ PRD(16) IMR(6) , +~ -... GREG(B) ~[ ~ D15-nn.. 16 16 1 Data Bus ; Program Bus ~ 16 ) ts ~ 16 16 16 i16 3 9 ..--------' AR0(16) TR(16) 7LSB 3 AR1(16) FromlR L ARP(3) AR2(16) L DP(9) Multiplier 6 AR3(16) AR4(16) 9 LShilter(0·16) 3 AR5(16) 4 PR(32) AR6(16) v--' 32 32 AR7(16) 16 [ ARB(3) ] v (Shifter(~. 0, 1, 41) J 3 ARAU(16) 16~. MUX 16 u 16 16 32 ~ ·~ MUX 32 6 16 ALU(32)?; DATA/PROG 32 Block B2 RAM (256 x 16) c I ACCH(16) I ACCL(16)] (32x16) t- Data RAM, -1 Block BO #t Block B1 j32 J.256 x 1fil. _l u [ Shilter(0-7)f] 1 16 1 16 J16 ~ Data Bus ~ NOTE: Shaded areas indicate a bus. 3-7 Functional Block Diagram Figure 3-3. TMS320C26 Block Diagram sYNc Program Bus xi~~ IS" cs PS l 16 PFq{:!6 j 16 ~ 16 01®~ 18 s;:---i blJ IR(18) :___, f.Y READY- 18 ST0(16) l I--- 16 ST1(16) ~-- H0=---1 J L MCSJ16 J-++--1 L PQ{1_6} J 6 RPTC:@: IF~6) DR BIO ~:I -- CLKR ~-- 8 ~ 16 16 FS R DX MP/MC lm(2-0) J 3 16 16 Address Bootload Program Stack :.@x 16 16 "8 'l RS®~ XSR(18) l cLKX FSx 15.A ROM ~ DRR(16) ~ A15- ~ (256x16) DXR:]~ Instruction TIM(16) 16 ~ PRD(1~ 16 .A 16 ~ IMR(6) ~ GREG(~ D15-DO ~I ... 16 16 16 "" 1 Data Bus i Program Bus ~ 16 ts ' .---- 16 16 16 16 Li 16 3 9 ARQL16 7LSB TR 1~ ~ 3 ARtl1~ FromlR u [ ARP(3) ]- AR~6 DP(9) ] 6 AR~16 + Multiplier AR~16 9 LShlfter(0-1~ 3 AR~6 ARfil:!6 v-- 4 PR3~ [ AR~ ' ] ARW6 :I ::I 1§_ 16 32 32 v (Shifter '-6, 0, 1, 4)] 3 J (ARA@&] 16 ~)' u ~ j ~~ 32 ~~7 16 16 ~AL@~Q r l DATA RAM(32X16) Block B2 DATA/PROG Block B3 DATA/PROG Block B1 r DATA/PROG RAM (512x16) 1 RAM (512x16) 1 RAM (512x16) Block BO r 32 [ cI 32 ACCH(16lI ACCL(16)j -rt ~ 1i j32 _i L Shifter(0-7) J 16 16 18 16 16 ~ 16 ' ' ' Data Bus NOTE: Shaded areas indicate a bus. 3-8 Architecture Internal Hardware Summary =----------~~~~~~:'.~~~~-:.~<",'(<'.:;:>-:.%X'.::::.O::-<~«:.<:::<>X'.X.'<<->.-:.-:.-;:-,¥,::.-::",-:;:.'(.-:_-:::,:;(,<::,::;::..~.;<:X:::,:::.-:,,<[·:'!<:f<'::::.<:*W..:'%W.<"<"«'0'"/h:':':':<'W<'<':::"X<':"-:«:::::Y'.O::Wh:<~;::::-.@W'Ml'/M'/$-/.#$:1'~ 3.3 Internal Hardware Summary The TMS320C2x internal hardware implements functions that other proces- sors typically perform in software or microcode. For example, the device con- tains hardware for single-cycle 16 x 16-bit multiplication, data shifting, and ad- dress manipulation. This hardware-intensive approach provides computing power previously unavailable on a single chip. Table 3-1 presents a summary of the TMS320C2x internal hardware. This summary table, which includes the internal processing elements, registers, and buses, is alphabetized within each functional grouping. All of the symbols used in this table correspond to the symbols used in the block diagram of Section 3.2, the succeeding block diagrams in this section, and the text throughout this document. Table 3-1. TMS320C2x Internal Hardware Unit Symbol Function Accumulator ACC (31-0) A32-bit accumulator split in two halves: ACCH (accumulator high) and ACCH (31-16) ACCL (accumulator low). Used for storage of ALU output. ACCL (15-0) Arithmetic Logic Unit ALU A 32-bit twos-complement arithmetic logic unit having two 32-bit input ports and one 32-bit output port feeding the accumulator. Auxiliary Register Arithmetic ARAU A 16-bit unsigned arithmetic unit used to perform operations on auxilia- l Unit ry register data. Auxiliary Register File ARO--AR7 A register file containing eight 16-bit auxiliary registers (ARO--AR7), (15-0) used for addressing data memory, temporary storage, or integer arith- metic processing through the ARAU. Auxiliary Register File Bus AFB(15-0) A 16-bit bus that carries data from the AR pointed to by the ARP. Auxiliary Register Pointer ARP(2-0) A 3-bit register used to select one of five or eight auxiliary registers. Auxiliary Register Pointer ARB(2-0) A 3-bit register used to buffer the ARP. Each time the ARP is loaded, Buffer the old value is written to the ARB, except during an LST (load status register) instruction. When the ARB is loaded with an LST1, the same value is also copied into ARP. Central Arithmetic Logic Unit CALLI The grouping of the ALU, multiplier, accumulator, and scaling shifter. Data Bus D(15-0) A 16-bit bus used to route data. Data Memory Address Bus DAB(15-0) A 16-bit bus that carries the data memory address. Data Memory Page Pointer DP(B-0) A 9-bit register pointing to the address of the current page. Data pages are 128 words each, resulting in 512 pages of addressable data memory space (some locations are reserved). Direct Data Memory Address DRB(15-0) A 16-bit bus that carries the direct address for the data memory, which Bus is the concatenation of the DP register with the seven LSBs of the instruction. Global Memory Allocation GREG(7-0) An 8-bit memory-mapped register for allocating the size of the global Register memory space. 3-9 Internal Hardware Summary Table 3-1. TMS320C2x Internal Hardware (Continued) Unit Symbol Function Instruction Register IR{15-0) A 16-bit register used to store the currently executing instruction. Interrupt Flag Register IFR{5-0) A 6-bit flag register used to latch the active-low external user interrupts TfIT{2--0), the internal interrupts XINT/RINT {serial port transmit/re- ceive), and TINT {timer) interrupts. The IFR is not accessible through software. Interrupt Mask Register IMR{5-0) A 6-bit memory-mapped register used to mask interrupts. Microcall Stack MCS {15-0) A single-word stack that temporarily stores the contents of the PFC while the PFC is being used to address data memory with the block move {BLKD/BLKP), multiply-accumulate {MAC/MACO), and table read/write {TBLR/TBLW)and table read/write {TBLR/TBLW) instruction Multiplier MULT A 16 x 16-bit parallel multiplier. Period Register PRO {15-0) A 16-bit memory-mapped register used to reload the timer. Prefetch Counter PFC {15-0) A 16-bit counter used to prefetch program instructions. The PFC con- tains the address of the instruction currently being prefetched. It is up- dated when a new prefetch is initiated. The PFC is also used to address program memory when using the block move {BLKP), multiply-accu- mulate {MAC/MACO), and table read/write {TBLR/TBLW) instructions and to address data memory when using the block move (BLKD) instruction. Product Register PR(31--0) A32-bit product register used to hold the multiplier product. The PR can also be accessed as the most or least significant words by using the SPH/SPL {store P register high/low) instructions. Program Bus P{15-0) A 16-bit bus used to route instructions {and data for the MAC and MACO instructions). Program Counter PC {15-0) A 16-bit program counter used to address program memory. The PC always contains the address of the next instruction to be executed. The PC contents are updated following each instruction decode operation. Program Memory Address PAB{15-0) A 16-bit bus that carries the program memory address. Bus Queue Instruction Register QIR(15-0) A 16-bit register used to store prefetched instructions. Random Access Memory RAM {BO) A RAM block with 256 x 16 locations configured as either data or pro- {data or program) gram memory. (512 x 16 for TMS320C26) Random Access Memory RAM (B1) A data RAM block, organized as 256 x 16 locations. {512 x 16 can be (data only) configured as program or data for TMS320C26) Random Access Memory RAM (B2) A data RAM block, organized as 32 x 16 locations. (data only) Random Access Memory RAM (B3) A RAM block with 512 x 16 locations configured as either data or pro- (data or program) {TMS320C26 only) gram memory {TMS320C26 only). Read Only Memory ROM A ROM block, 4096 x 16 (256 x 16 for TMS320C26; 8192 x 16 for TMS320C28). Repeat Counter RPTC {7--0) An 8-bit counter to control the repeated execution of a single instruction. Serial Port Data DRR{15-0) A 16-bit memory-mapped serial port data receive register. Only the Receive Register eight LSBs are used in the byte mode. Serial Port Data Transmit DXR{15-0) A 16-bit memory-mapped serial port data transmit register. Only the Register eight LSBs are used in the byte mode. 3-10 Architecture Internal Hardware Table 3-1. TMS320C2x Internal Hardware (Concluded) Unit Symbol Function Serial Port Receive Shift RSR(15-0) A 16-bit register used to shift in serial port data from the RX pin. RSR Register contents are sent to the DRR after a serial transfer is completed. RSR is not directly accessible through software. Serial Port Transmit Shift XSR(15-0) A 16-bit register used to shift out serial port data onto the DX pin. XSR Register contents are loaded from DXR at the beginning of a serial port transmit operation. XSR is not directly accessible through software. Shifters - Shifters are located at the ALU input, the accumulator output, and the product register output. Also, an in-place shifter is located within the ac- cumulator. Stack Stack(15--0) A 4 x 16 or 8 x 16 hardware stack used to store the PC during interrupts or calls. The ACCL and data memory values may also be pushed onto and popped from the stack. Status Registers Temporary STO,ST1 Two 16-bit status registers that contain status and control bits. A 16-bit Register (15--0) register that holds either an operand for the multiplier or a shift code for the scaling shifter. Temporary Register TR(15--0) A 16-bit register that holds either an operand for the multiplier or a shift code for the scaling shifter. Timer TIM (15--0) A 16-bit memory-mapped timer (counter) for timing control. 3-11 Memory Organization 3.4 Memory Organization The TMS320C2x provides a total of 54416-bit words of on-chip data RAM, of which 288 words are always data memory and the remaining 256 words may be configured as either program or data memory. The TMS320C26 provides a total of 1568 words of 16 bit on-chip RAM, divided into four separate bolcks (BO, B1, B2, and B3). The TMS320C25 also provides 4K words of maskable program ROM, while the TMS320E25 provides 4K words of EPROM. This sec- tion explains memory management using the on-chip data and program memory, memory maps, memory-mapped registers, auxiliary registers, memory addressing modes, and memory-to-memory moves. 3.4.1 Data Memory The 544 words of on-chip data RAM are divided into three separate blocks (BO, B1, and B2), as shown in Figure 3-4. Of the 544 words, 256 words (block BO) are configurable as either data or program memory by instructions provided for that purpose; 288 words (blocks B1 and B2) are always data memory. A data memory size of 544 words allows the TMS320C2x to handle a data array of 512 words (256 words if on-chip RAM is used for program memory), while still leaving 32 locations for intermediate storage. See subsection 3.4.3 for memory map configurations. In the TMS320C26, of the 1568 words, 32 words (block B2) are always data memory, and all other words are programmable as either data or program memory, as shown in Figure 3-5. A data memory size of 1568 words allows the TMS320C26 to handle a data array of 1536 words, while still leaving 32 locations for intermediate storage. When using BO, B1, or B3 as program memory, instructions can be downloaded from external program memory into on-chip RAM, and then executed. The TMS320C2x can address a total of 64K words of data memory. The on- chip data memory and internally reserved locations are mapped into the lower 1K words of the data memory space. Data memory is directly expandable up to 64K words while still maintaining full-speed operation. A READY line is pro- vided for interface to slower, less expensive memories, such as DRAMs. 3.4.2 Program Memory On-chip program RAM, ROM/EPROM, or high-speed external program memory can be used at full speed with no wait states. Alternatively, the READY line can interface the TMS320C2x to slower, less expensive external memory. A total of 64K words of memory space is available. Internal RAM block BO can be configured as program memory using instructions for that purpose. Execu- tion from this block can be initiated after the memory space has been reconfi- gured. See subsection 3.7.1 for a description of instruction execution using various memory configurations. 3-12 Architecture Memory Organization Additionally, the TMS320C25 is internally equipped with 4K words of program- mable ROM. This on-chip program ROM can be mask programmed at the fac- tory with a customer's program. The TMS320E25 provides a 4K-word, on-chip EPROM. Either on-chip ROM or EPROM allows program execution at full speed without the need for high-speed external program memory. The use of this memory also allows the external data bus to be freed for access of external data memory. Figure 3-4. TMS320C2x On-Chip Data Memory From From Program Counter Auxiliary Registers or or From Data Page Pointer Prefetch Counter and Direct Memory Address 16 16 16 16 Block B2 _ _ (32~16) _ DataRAM Data/Prag Block B1 RAM (256 x 16) (256 x 16) Block BO 16 16 To Program Bus 3-13 Memory Organization Figure 3-5. TMS320C26 On-Chip Data Memory From Auxiliary Registers From Data Memory Page Pointer From Program Counter 16 16 16 16 Data Data/Prog Data/Prog Data/Prog RAM (32x16) RAM (512 x 16) RAM (512 x 16) RAM (512 x 16) Block B2 Block B3 Block B1 Block BO 16 16 To Program Bus ~/ .:./ "},· . )"& Mapping of the first 4K-word block of off-chip/on-chip program memory is user- selectable by means of the MP/MC (microprocessor/microcomputer) pin on the TMS320C2x. Setting MP~to a high maps in the block of off-chip memory; holding the pin at a low maps in the block of on-chip ROM. Conse- quently, compatible products that depend upon external memory from the ROM can be manufactured in a shorter time frame than the TMS320C2x. Eventually, the off-chip memory device can be replaced by an on-chip memory device at a lower cost because the PC board will not require any modification. In another mapping technique, the XF (external flag) pin is used to toggle the MP/MC pin by dynamically enabling or disabling the on-chip ROM. Note that care must be taken and the instruction pipeline operation (see subsection 3.6.2) must be understood when using this method. 3-14 Architecture Memory Organization 3.4.3 TMS320C2x Memory Maps The TMS320C2x provides three separate address spaces for program memory, data memory, and 1/0, as shown in Figure 3-8. These spaces are distinguished externally by means of the PS, OS, and TS (program, data, and 1/0 space select} signals. The PS, OS, TS, and STRB signals are active only for external bus accesses. During an internal addressing cycle, these signals remain inactive high, thus preventing conflicts in memory addressing, for ex- ample, when block BO is configured as program memory. The on-chip memory blocks (BO, 81, and B2} consist of a total of 544 words of RAM. Program/data RAM block BO (256 words} resides in pages 4 and 5 of the data memory map when configured as data RAM and at addresses OFFOOh to OFFFFh when configured as program RAM. Block B1 (always data RAM} resides in pages 6 and 7, while block B2 resides in the upper 32 words of page 0. Note that the remainder of page O is composed of the memory- mapped registers and internally reserved locations, and pages 1-3 of the data memory map consist of internally reserved locations. The internally reserved locations may not be used for storage, and their contents are undefined when read. See subsection 3.4.4 for further information on the memory-mapped reg- isters. The on-chip RAM is mapped into eitherthe 64K-word data memory or program memory space, depending on the memory configuration (see Figure 3-5). The CNFD/CNFP instructions are used to configure block BO as either data or program memory, respectively. The BLKP (block move from program memory to data memory} instruction may be used to download program in- formation to block BO when it is configured as data RAM. Then a CNFP (config- ure block as program memory} instruction may be used to convert it to program RAM (see the code example in subsection 5.4.2). Regardless of the cdnfigura- tion, you may still execute from external program memory. Note that when accessing internal program memory, external control lines remain inactive. Reset configures all internal RAM as data. Note that, due to internal pipelining, when the CNFD or CNFP instruction is used to remap RAM block BO, there is a delay before the new configuration becomes effective. This delay is one fetch cycle if execution is from internal program RAM. On the TMS320C2x, there is a delay of two fetch cycles if execution is from ROM or external program memory. This is particularly important if program execution is from the loca- tions around OFFOOh. Accordingly, a CNFP instruction must be placed at loca- tion OFEFDh in external memory if execution is to continue from the first loca- tion in block BO. If a CNFP is placed at location OFEFDh, and the instruction at location OFEFFh is a two-word instruction, the second word of the instruction will be fetched from the first location in block BO. If execution is from above location OFFOOh and block BO is reconfigured, care must be taken to assure that execution resumes at the appropriate point in a new configuration. 3-15 Memory Organization " The on-chip program ROM can be mapped into the lower 4K words of program memory. This ROM is enabled when MP/MC is set to a logic low. To disable the on-chip ROM and use these lower addresses externally, MP/MC must be set to a logic high. If all internal RAM blocks are configured as data memory, a program address in the range FFOO to FFFFh accesses external program memory. 3.4.4 TMS320C26 Memory Maps The memory map of the TMS320C26 is similar to that of the TMS320C25 and is shown in Figure 3-9. The on-chip memory-mapped register and block B2 with 32 words on page O are unchanged. The ROM is reduced to 256 words and contains a multi-purpose bootloader. (See Subsection 5.1.1 and Appendix B.) Additional RAM is included, making the TMS320C26 ideal for many applications. If the TMS320C26 is in microcomputer mode, the address space from O to OFFFh is internal. External program memory, selected via PS (Program Se- lect), can be used starting at address 1OOOh. The missing space from 01 OOh to OFFFh, which would correspond to the larger ROM of the 'C25/E25, is also reserved. If one or more of the blocks BO, B 1, or B3 is configured as program memory, the program address space from hexadecimal FAOOh to FFFFh is in- ternally reserved for these blocks and can not access external program memory. If all internal RAM blocks are configured as data memory, a program address in the range FAOOh to FFFFh accesses external program memory. The external data memory, selected with OS (Data Select), always starts at address 800h (2048 decimal), regardless of the configuration mode of the in- ternal memory. Because internal memory blocks BO, B 1, and B3 (new) are of different size, the internal data memory blocks of the TMS320C26 reside in pages O and 4 to 15, while those of the TMS320C25 reside in, pages O and 4 to 7. Table 3-2 shows both processors and their internal memory locations. Program memory is also affected by the different block sizes, and the results are given in Table 3-2. 3-16 Architecture Memory Organization Figure 3-6. Comparison of Internal RAM Configured as Data Space TMS320C25 TMS320C28 TMS320C26 0 Memory-Mapped Memory-Mapped 0 OSh Registers Registers 05h 06h 06h Reserved Reserved 05Fh 05Fh 060h 060h B2 B2 07Fh 07Fh 080h 080h Reserved Reserved 01FFh 01FFh 0200h 0200h BO 2FFh 300h ,... .............. BO B1 03FFh .............. 03FFh 0400h 0400h B1 OSFFh 0600h External B3 New RAM Block 07FFh 0800h External FFFF Figure 3-7. Comparison of Internal RAM Configured as Program Space TMS320C25 TMS320C28 TMS320C26 External/ROM External/ROM External FBFF I FAOO I I BO I External I FBFF I -~ FCOO I I I I B1 New Block I I I I FDFF I I FEOO FEFF FFOO vII 83 New Block FFFF BO vI FFFF 3-18 Architecture Figure 3-8. TMS320C2x Memory Maps (a) Memory Maps After a CNFD Instruction O(OOOOh) Program 0 (OOOOh) Program Interrupts 0 (OOOOh) Data On-Chip ,, Interrupts and Reserved and Reserved Memory-Mapped (On-Chip Registers 31 (001Fh) (External) 31 (001 Fh) ROM/EPRO~ 5(0005h) 32 (0020h) 32 (0020h) 6(0006h) On-Chip Reserved Page O EPROM/ROM 95(005Fh) 4015 (OFAFh) 96(0060h) 4016 (OFBOh) On-Chip Reserved Block B2 4095 (OFFFh) 127(007Fh) I__, 4096 (1 OOOh) 128(0080h) Reserved Pa ges 1-3 511 (01FFh) 512 (0200h) On-Chip Block BO Pages 4-5 External External 767(02FFh) 768(0300h) On-Chip Pa ges &-7 Block B1 1023 (03FFh) 1024(0400h) External Pa ges 8-511 65,535 (OFFFFh) - - - - - - 65,535 (OFFFFh ) 65,535 (OFFFFh) If MP/IVlC = 1 If MP)f;ifC = 0 (Microprocessor Mode) (Microcomputer Mode on TMS320C25) (b) Memory Maps After a CNFP Instruction Program Program Data O(OOOOh) O(OOOOh) Interrupts O(OOOOh) Interrupts On-Chip and Reserved and Reserved (On-Chip Memory-Mapped (External) ROM/EPROM) Registers 31 (001Fh) 31 (001Fh) 5(0005h) 32 (0020h) t - - - - - - - - 1 32(0020h) 6(0006h) Reserved Page 0 On-Chip ROM/EPROM 95(005Fh) 4015(0FAFh) 96(0060h) 4016(0FBOh) On-Chip Reserved Block B2 4095(0FFFh) 127(007Fh) 4096 (1 OOOh) 128(0080h) Reserved Pages 1-3 511 (01FFh) 512 (0200h) Does Not Pages 4-5 External External Exist 767(02FFh) 768(0300h) On-Chip Pages &-7 Block B1 65,279 (OFEFFh) I - _ _ _ _ 65,279 (OFEFFh) t - - - - - 1023 (03FFh) 65,280 (OFFOOh ) 65,280 (OFFOOh ) 1024(0400h) On-Chip On-Chip External Pages 8-511 Block BO Block BO 65,535 (OFFFFh) ...__ _ _ __ 65,535 (OFFFFh) 65,535 (OFFFFh ) If MP/IVlC = 1 If MP)f;ifC = 0 (Microprocessor Mode) (Microcomputer Mode on TMS320C25) 3-19 Memory Organization :,:·:·::>:•:•:···:•:•:•:•:····;:,:, •Y•:•:··-<:•::::::<:::•:::::•::>:::::::::•:::::•:>~!:<'::::!:::::::::: •:···:•:•:•:•:•:•:•:···:•:•:•:•:•>:;:;:,:::;:;:;:;:;:,;;:,;;:;:;:, •:•:·:•:·!·:•:•:•:":;:;:;:,:;:;:,:::;:,:;:;:,:,:,:,;::;:,:;:;:;;,:,:;:;:,;,:,;,;•::::::«:Of.!;:;:;:;:,:,:,:,:;:;:;:,:,:;:;:;:;;;;r.,>;;:;:,;;;,;;::!:!:::! ··:•:·:·:·!·'·l;!;:;;,:;:;:,:;:;:;:;!;:,:,:;:,:•:;!:!:!::;:;!;!: .;.•.;.;.;;:·:·:;;:;:;:;:;:,:;:;:;:;:,:;:;:;:,:,:,:,:;:,:,:,;,!;!;::::!:!:!;:,;,:;;.;;;,;,;.;,:,'<;:<';:!;!;:::::::;:;:,:,:;:,:,;,;,:,:,:;:(.::,:;:,;,:,;~%:!::;:,:,:;!;;,:,;,;,:,:,;;:;:;:,:;!;!;:;!,:;:,:;:;:;:(«:::~«:;;;:,:,;,;;:;!:!·!·!·:···'·'·'"' Figure 3-9. TMS320C26 Memory Maps Program Program Data (OOOOh) (OOOOh) r (OOOOh) Interrupts Interrupts On-Chip and ReseNed and ReseNed Memory-Mapped (External) Boatload ROM Registers (001Fh) (OOFFh) (0005h) (0020h) (0100h) (0006h) ReseNed Page O ReseNed (005Fh) (OFFFh) (0060h) (1000h) On-Chip Block B2 (007Fh) (0080h) ReseNed Pages 1-3 (01FFh) (0200h) On-Chip Block BO Pages 4-7 External External (03FFh) (0400h) On-Chip Pages 8-11 Block B1 (05FFh) (0600h) On-Chip Pages 12-15 Block B3 (07FFh) (0800h) External Pages 16-511 (FFFFh) (FFFFh) (FFFFh) If MP/MC= 1 If MP/MC= 0 (Microprocessor Mode) (Microcomputer Mode) (a) Memory Maps After a CONF O Instruction and After Reset Program Program Data (OOOOh) (OOOOh) (OOOOh) Interrupts Interrupts On-Chip and ReseNed and ReseNed Memory-Mapped (External) Boatload ROM Registers (001Fh) (OOFFh) (0005h) (0020h) (0100h) (0006h) ReseNed ReseNed Page o (OFFFh) (005Fh) (1000h) (0060h) On-Chip Block B2 (007Fh) (0080h) External ReseNed Pages 1-3 External (01FFh) (0200h) Does Not Exist Pages 4-7 (F9FFh) (03FFh) (FAOOh) (F9FFh) (0400h) On-Chip (FAOOh) On-Chip Pages 8-11 Block BO On-Chip (FBFFh) Block B1 Block BO (05FFh) (FCOOh) (FBFFh) (0600h) (FCOOh) On-Chip External Pages 12-15 External Block B3 (FDFFh) (07FFh) ! (FDFFh) (FEOOh) (0800h) (FEOOh) External External Pages 16-511 External (FFFFh) (FFFFh) (FFFFh) lfMPIMC= 1 If MP/MC= 0 (Microprocessor Mode) (Microcomputer Mode (a) Memory Maps After a CONF 1 Instruction 3-20 Architecture Figure 3-9. TMS320C26 Memory Maps (continued) Program Program Data (OOOOh) (OOOOh) (OOOOh) I' Interrupts Interrupts On-Chip and Reserved and Reserved Memory-Mapped (External) Boatload ROM Registers (001Fh) (OOFFh) (0005h) (0020h) (0100h) (0006h) Reserved Page O Reserved (005Fh) (OFFFh) (0060h) On-Chip (1000h) Block B2 (007Fh) External (0080h) Reserved Pa ges 1-3 External (01FFh) (0200h) Does Not Pa gas 4-7 Exist (03FFh) (F9FFh) (0400h) (FAOOh) (F9FFh) Does Not Pa ges 8-11 On-Chip (FAOOh) On-Chip Exist Block BO (05FFh) (FBFFh) Block BO (FBFFh) (0600h) (FCOOh) On-Chip (FCOOh) On-Chip Pages 12-15 Block B1 On-Chip Block B3 (FDFFh) (FDFFh) Block B1 (07FFh) (FEOOh) (FEOOh) (0800h) External External External Pages 16-511 (FFFFh) (FFFFh) (FFFFh) If MP/IVIC = 1 If MP/IVIC = 0 (Microprocessor Mode) (Microcomputer Mode) (c) Memory Maps After a CONF 2 Instruction (OOOOh) Program Interrupts (OOOOh) Program Interrupts (OOOOh) Data On-Chip ,, and Reserved and Reserved Memory-Mapped (External) Boatload ROM Registers (001Fh) (OOFFh) (0005h) (0020h) (0100h) (0006h) Reserved Reserved Page 0 (OFFFh) (005Fh) (1000h) (0060h) On-Chip Block B2 External (007Fh) (0080h) ,..... External Reserved Pa ges 1-3 (01FFh) (0200h) Does Not Exist Pa ges 4-7 (F9FFh) (03FFh) (F9FFh) (FAOOh) (0400h) On-Chip (FAOOh) On-Chip Does Not Pa ges 8-11 Block BO Block BO Exist (FBFFh) (FBFFh) (05FFh) (FCOOh) (FCOOh) (0600h) On-Chip On-Chip Does Not Block B1 Exist Pa ges 12-15 Block B1 (FDFFh) (FDFFh) (07FFh) (FEOOh) (FEOOh) (0800h) On-Chip On-Chip Block B3 External Pages 16-511 Block B3 (FFFFh) (FFFFh) (FFFFh) If MP/IVIC = 1 If MPllVIC = o (Microprocessor Mode) (Microcomputer Mode (d) Memory Maps After a CONF 3 Instruction 3-21 Memory Organization 3.4.5 Memory-Mapped Registers The six registers mapped into the data memory space are listed in Table 3-2 and are shown in the block diagram of Figure 3-2. The memory-mapped registers may be accessed in the same manner as any other data memory location, with the exception that block moves using the BLKD {block move from data memory to data memory) instruction cannot be performed from the memory-mapped registers. Table 3-3. Memory-Mapped Registers Register Address Name Location Definition DRR(15--0) 0 Serial port data receive register DXR(15--0) 1 Serial port data transmit register TIM(15--0) 2 Timer register PRD(15--0) 3 Period register IMR (5--0) 4 Interrupt mask register GREG(7-0) 5 Global mem~ allocation register 3.4.6 Auxiliary Registers The TMS320C2x provides a register file containing eight auxiliary registers {ARO-AR7). This section discusses each register's function and how an auxil- iary register is selected and stored. The auxiliary registers may be used for indirect addressing of data memory or for temporary data storage. Indirect auxiliary register addressing {see Figure 4-2) allows placement of the data memory address of an instruction operand into one of the auxiliary registers. These registers are pointed to by a three-bit auxiliary register pointer {ARP) that is loaded with a value from O through 7, designating ARO through AR7, respectively. The auxiliary registers and the ARP may be loaded either from data memory or by an immediate oper- and defined in the instruction. The contents of these registers may also be stored in data memory. {Chapter 4 describes the programming of the indirect addressing mode.) 3-22 Architecture Figure 3-10. Indirect Auxiliary Register Addressing Example Auxiliary Register File Data Memory ARO 0 5 3 7 h Map Location , . . . - - - - - - . AR1 5 1 5 0 h OOOh Internal Auxiliary 03FFh i - - - - - - - - t Register 0400h Pointer AR2 0 E 9 F c h External (in STO) t------ ARP~.... AR3 0 F F 3 A h - - . . . OFF3Ah 3 1 2 1 h t------ AR4 AR5 1 0 3 B h 2 6 B h OFFFFh ----- AR6 0 0 0 8 h AR? 8 4 3 D h The auxiliary register files (ARO-AR? on the TMS320C2x) are connected to the auxiliary register arithmetic unit (ARAU), shown in Figure 3-11. The ARAU may autoindex the current auxiliary register while the data memory location is being addressed. Indexing by either 1 or by the contents of ARO may be per- formed. As a result, accessing tables of information does not require the cen- tral arithmetic logic unit (CALU) for address manipulation, thus freeing it for other operations. 3-23 Figure 3-11. Auxiliary Register File Auxiliary Register 7 (AR7) (16) Auxiliary Register 6 (AR6) (16) Auxiliary Register 5 (AAS) (16) Auxiliary Register 4 (AR4) (16) Auxiliary Auxiliary Auxiliary Register 3 (AR3) (16) 3 Register 3 Register Auxiliary Register 2 (AR2) (16) Pointer Buffer 8 LSB (ARP) (3) (ARP) (3) Auxiliary Register 1 (AR1) (16) or 1Rt 16 Auxiliary Register O (ARO) (16) 16 16 16 In B Out 3 Auxiliary Register Arithmetic 3 Unit (ARAU) (16) 3 LSB Auxiliary Register File Bus (AFB) 16 3 or IR 3 MSB 3 MSB As shown in Figure 3-11, auxiliary register 0 (ARO) or the eight LSBs of the instruction registers can be connected to one of the inputs of the ARAU. The other input is fed by the current AR (being pointed to by ARP). AR(ARP) refers to the contents of the current AR pointed to by ARP. The ARAU performs the following functions: AR (ARP) + ARO - AR (ARP) Index the current AR by adding a 16-bit integer contained in ARO. AR (ARP) - ARO - AR (ARP) Index the current AR by subtracting a 16-bit integer contained in ARO. AR (ARP) + 1 - AR (ARP) Increment the current AR by one. AR (ARP) - 1 - AR (ARP) Decrement the current AR by one. AR (ARP) - AR (ARP) AR(ARP) is unchanged. In addition to the above functions, the ARAU on the TMS320C25 performs functions as follows: AR(ARP) + IR(7-0) - AR(ARP) Add 8-bit immediate value to the current AR. AR (ARP) - IR (7 - 0) - AR (ARP) Subtract 8-bit immediate value to the current AR. 3-24 Architecture Memory Organization """""'"""""'"""""'""" =-""""'*""""""""""'"""""""""""""'"""""""'""'=""'""'""'"'"""'>~~ssss~~ss~=i:i~~~---=-==-=ss~=~m-~~~=~ffl1.1$fflffl1Wmnn~=• AR (ARP) + rcARO - AR (ARP) Bit-reversed indexing, add ARO with reverse-carry (re) propagation (see subsection 4. 1.2) AR (ARP) - rcARO - AR (ARP) Bit-reversed indexing, subtract ARO with reverse-carry (re) propagation (see subsection 4.1.2). Although the ARAU is useful for address manipulation in parallel with other op- erations, it may also serve as an additional general-purpose arithmetic unit, since the auxiliary register file can directly communicate with data memory. The ARAU implements 16-bit unsigned arithmetic, whereas the CALU imple- ments 32-bit 2s-complement arithmetic. Instructions provide branches depen- dent on the comparison of the auxiliary register pointed to by ARP with ARO. The BANZ instruction permits the auxiliary registers to be used also as loop counters. The three-bit auxiliary register pointer buffer (ARB), shown in Figure 3-8, pro- vides storage for the ARP on subroutine calls and interrupts. 3.4.7 Memory Addressing Modes The TMS320C2x can address a total of 64K words of program memory and 64K words of data memory. The on-chip data memory is mapped into the 64K- word data memory space. The on-chip ROM in the TMS320C25 is mapped into the program memory space when in the microcomputer mode. The memory maps, which change with the configuration of block BO, B1, and B3, are described in detail in subsections 3.4.3 and 3.4.4. The 16-bit data address bus (DAB) addresses data memory in one of the fol- lowing two ways: 1) By the direct address bus (ORB) using the direct addressing mode (for example, ADD 10h), or 2) By the auxiliary register file bus (AFB) using the indirect addressing mode (for example, ADD*). Operands are also addressed by the contents of the program counter in the immediate addressing mode. Figure 3-12 illustrates operand addressing in the direct, indirect, and immedi- ate addressing modes. 3-25 Memory Organization Figure 3-12. Methods of Instruction Operand Addressing In the direct addressing mode, the 9-bit data memory page pointer (DP} points to one of 512 pages, each page consisting of 128 words. The data memory address (dma}, specified by the seven LSBs of the instruction, points to the desired word within the page. The address on the direct address bus (ORB} is formed by concatenating the 9-bit DP with the 7-bit dma. In the indirect addressing mode, the currently selected 16-bit auxiliary register AR(ARP} addresses the data memory through the auxiliary register file bus (AFB}. While the selected auxiliary register provides the data memory address and the data is being manipulated by the CALU, the contents of the auxiliary register may be manipulated through the ARAU. See Figure 3-12 for an ex- ample of indirect auxiliary register addressing. The direct and indirect addres- sing modes are described in detail in Section 4.1. When an immediate operand is used, it is contained either within the instruc- tion word itself or, in the case of 16-bit immediate operands, in the word follow- ing the instruction opcode. 3-26 Architecture Memory Organization 3.4.8 Memory-to-Memory Moves The TMS320C2x provides instructions for data and program block moves and for data move functions that efficiently utilize the configurable on-chip RAM. The BLKD instruction moves a block within data memory, and the BLKP instruction moves a block from program memory to data memory. When used with the repeat instructions (RPT/RPTK), the BLKD/BLKP instructions effi- ciently perform block moves from on- or off-chip memory. Implemented in on-chip RAM, the DMOV (data move) function on the TMS320C2x is equivalent to that of the TMS320C 1x. DMOV allows a word to be copied from the currently addressed data memory location in on-chip RAM to the next higher location while the data from the addressed location is being operated upon in the same cycle (for example, by the CALU). An ARAU opera- tion may also be performed in the same cycle when using the indirect addres- sing mode. The DMOV function is useful for implementing algorithms that use the z-1 delay operation, such as convolutions and digital filtering where data is being passed through a time window. The data move function can be used anywhere within blocks BO, B1, and B2 (and block 83 with the TMS320C26). It is continuous across the boundary of blocks BO and B1 but cannot be used with off-chip data memory. The MACO (multiply and accumulate with data move) and the LTD (load T register, accumulate previous product, and move data) instructions use the data move function. The TBLR/TBLW (table read/write) instructions allow words to be transferred between program and data spaces. TBLR is used to read words from on-chip ROM or off-chip program ROM/RAM into the data RAM. TBLW is used to write words from on-chip data RAM to off-chip program RAM. 3-27 Central Arithmetic 3.5 Central Arithmetic Logic Unit (CALLI) The TMS320C2x central arithmetic logic unit (CALU) contains a 16-bit scaling shifter, a 16 x 16-bit parallel multiplier, a 32-bit arithmetic logic unit (ALU), a 32-bit accumulator (ACC), and additional shifters at the outputs of both the ac- cumulator and the multiplier. This section describes the CALU components and their functions. Figure 3-13 is a block diagram showing the components of the CALU. In the figure, note that SFL and SFR indicate shifts to the left or right, respectively. The following steps occur in the implementation of a typical ALU instruction: 1) Data is fetched from the RAM on the data bus, 2) Data is passed through the scaling shifter and the ALU where the arithme- tic is performed, and 3) The result is moved into the accumulator. One input to the ALU is always provided from the accumulator, and the other input may be transferred from the product register (PR) of the multiplier or from the scaling shifter that is loaded from data memory. 3-28 Architecture Central Arithmetic Figure 3-13. Central Arithmetic Logic Unit (CALU), TMS320C2x 16 16 TR(16) 16 16 Shifter Multiplier 0 (0-16) PR(32) SX ---+- Shifter(-6, 0, 1, 4) -+-- o 32 sx 32 ACCL(16) 0 3-29 Central Arithmetic 3.5.1 Scaling Shifter The TMS320C2x provides a scaling shifter that has a 16-bit input connected to the data bus and a 32-bit output connected to the ALU (see Figure 3-13). The scaling shifter produces a left shift of 0 to 16 bits on the input data, as pro- grammed in the instruction. The LSBs of the output are filled with zeros, and the MSBs may be either filled with zeros or sign-extended, depending upon the status programmed into the SXM (sign-extension mode) bit of status regis- ter ST1. The TMS320C2x also contains several other shifters, which allow it to perform numerical scaling, bit extraction, extended-precision arithmetic, and overflow prevention. These shifters are connected to the output of the multiplier and the accumulator. 3.5.2 ALU and Accumulator The TMS320C2x 32-bit ALU and accumulator implement a wide range of arith- metic and logical functions, the majority of which execute in a single clock cycle. Once an operation is performed in the ALU, the result is transferred to the accumulator where additional operations such as shifting may occur. Data that is input to the ALU may be scaled by the scaling shifter. The ALU is a general-purpose arithmetic unit that operates on 16-bit words taken from data RAM or derived from immediate instructions. In addition to the usual arithmetic instructions, the ALU can perform Boolean operations that make possible the bit manipulation required of a high-speed controller. One input to the ALU is always provided from the accumulator, and the other input may be provided from the product register (PR) of the multiplier or the input scaling shifter that has fetched data from the RAM on the data bus. After the ALU has performed the arithmetic or logical operations, the result is stored in the accumulator. The 32-bit accumulator (see Figure 3-13) is split into two 16-bit segments for storage in data memory: ACCH (accumulator high) and ACCL (accumulator low). Shifters at the output of the accumulator provide a left-shift of 0 to 7 places on the TMS320C2x. This shift is performed while the data is being transferred to the data bus for storage. The contents of the accumulator re- main unchanged. When the ACCH data is shifted left, the LSBs are transferred from the ACCL, and the MSBs are lost. When ACCL is shifted left, the LSBs are zero-filled, and the MSBs are lost. The TMS320C2x supports floating-point operations for applications requiring a large dynamic range. The NORM (normalization) instruction performs left shifts to normalize fixed-point numbers contained in the accumulator. The LACT {load accumulator with shift specified by the T register) instruction de- normalizes a floating-point number by arithmetically left-shifting the mantissa through the input scaling shifter. The shift count, in this case, is the value of 3-30 Architecture Central Arithmetic the exponent specified by the four low-order bits of the T register (TR}. ADDT and SUBT (add to/subtract from accumulator with shift specified by the T regis- ter) instructions have also been provided to allow additional arithmetic opera- tions. The accumulator overflow saturation mode may be programmed through the SOVM and ROVM (set/reset overflow mode) instructions. When the accumu- lator is in the overflow saturation mode and an overflow occurs, the overflow flag is set and the accumulator is loaded with either the most positive or the most negative number, depending upon the direction of overflow. The value of the accumulator upon saturation is 7FFFFFFFh (positive) or 80000000h (negative). If the OVM (overflow mode) status register bit is reset and an over- flow occurs, the overflowed results are loaded into the accumulator without modification. (Note that logical operations cannot result in overflow.) The TMS320C2x can execute a variety of branch instructions that depend on the status of the ALU and accumulator. These instructions include the BV (branch on overflow) and BZ (branch on accumulator equal to zero). In addi- tion, the BACC (branch to address in accumulator) instruction provides the ability to branch to an address specified by the accumulator. Bit test instruc- tions (BIT and BITT), which do not affect the accumulator, allow the testing of a specified bit of a word in data memory. The accumulator on the TMS320C25 also has an associated carry bit that is set or reset, depending on various operations within the device. The carry bit allows more efficient computation of extended-precision products and addi- tions or subtractions. It is also useful in overflow management. The carry bit is affected by most arithmetic instructions as well as the shift and rotate instruc- tions. It is not affected by loading the accumulator, logical operations, or other such nonarithmetic or control instructions. It is also not affected by the multiply (MPY, MPYK, and MPYU) instructions, but is affected by the accumulation pro- cess in the MAC and MACD instructions. Examples of carry bit operation are shown in Figure 3-14. Figure 3-14. Examples of TMS320C25 Carry Bit Operation c MSB LSB c MSB LSB x F F F F F F F F ACC x 0 0 0 0 0 0 0 0 ACC + 1 1 0 0 0 0 0 0 0 0 0 F F F F F F F F x 7 F F F F F F F ACC x 8 0 0 0 0 0 0 0 ACC + 1 (OVM=O) 1 (OVM=O) 0 8 0 0 0 0 0 0 0 7 F F F F F F F 0 0 0 0 0 0 0 0 ACC 0 F F F F F F F F ACC + 0 (ADD 0 (SUBB Instruction) Instruction) 0 0 0 0 0 0 0 0 1 F F F F F F F E 3-31 Central Arithmetic The value added to or subtracted from the accumulator, shown in the exam- ples of Figure 3-14, may come from either the input scaling shifter or the shift- er at the output of the P register. The carry bit is set if the result of an addition or accumulation process generates a carry; it is reset to zero if the result of a subtraction generates a borrow. Otherwise, it is reset after an addition or set after a subtraction. The ADDC (add to accumulator with carry) and SUBB (subtract from accumu- lator with borrow) instructions provided on the TMS320C25 use the previous value of carry in their addition/subtraction operation (see these instructions in Chapter 4 for more detailed information). The one exception to operation of the carry bit, as shown in Figure 3-14, is in the use of the ADDH (add to high accumulator) and SUBH (subtract from high accumulator) instructions. The ADDH instruction can set the carry bit only if a carry is generated, and the SUBH instruction can reset the carry bit only if a borrow is generated; otherwise, neither instruction can affect it. Two branch instructions, BC and BNC, can execute branching on the status of the carry bit. The SC, RC, and LST1 instructions can also be used to load the carry bit. The carry bit is set to one on a hardware reset. The SFL and SFR (in-place one-bit shift to the left/right) instructions on the TMS320C2x and the ROL and ROR (rotate to the left/right) instructions on the TMS320C25 implement shifting or rotating of the contents of the accumulator through the carry bit. The SXM bit affects the definition of the SFR (shift accu- mulator right) instruction. When SXM = 1, SFR performs an arithmetic right shift, maintaining the sign of the accumulator data. When SXM = 0, SFR per- forms a logical shift, shifting out the LSB and shifting in a zero for the MSB. The SFL (shift accumulator left) instruction is not affected by the SXM bit and be- haves the same in both cases, shifting out the MSB and shifting in a zero. Re- peat (RPT or RPTK) instructions may be used with the shift and rotate instruc- tions for multiple shift counts. 3.5.3 Multiplier, T and P Registers The TMS320C2x utilizes a 16 x 16-bit hardware multiplier, which is capable of computing a signed or unsigned 32-bit product in a single machine cycle. All multiply instructions, except the MPYU (multiply unsigned) instruction on the TMS320C25, perform a signed multiply operation in the multiplier. That is, the two numbers being multiplied are treated as 2s complement numbers, and the result is a 32-bit 2s complement number. As shown in Figure 3-13, the fol- lowing two registers are associated with the multiplier: D A 16-bit temporary register (TR) that holds one of the operands for the multiplier, D A 32-bit product register (PR) that holds the product. 3-32 Architecture Central Arithmetic The output of the product register can be left-shifted 1 or 4 bits. This is useful for implementing fractional arithmetic or justifying fractional products. The out- put of the PR can also be right-shifted 6 bits to enable the execution of up to 128 consecutive multiply/accumulates without the possibility of overflow. An LT {load T register) instruction normally loads the TR to provide one oper- and (from the data bus), and the MPY (multiply) instruction provides these- cond operand (also from the data bus). A multiplication can also be performed with an immediate operand using the MPYK instruction. In either case, a prod- uct can be obtained every two cycles. Two multiply/accumulate instructions {MAC and MACD) fully utilize the com- putational bandwidth of the multiplier, allowing both operands to be processed simultaneously. The data for these operations may reside anywhere in internal or external memory or can be transferred to the multiplier each cycle via the program and data buses. This provides for single-cycle multiply/accumulates when used with repeat (RPT/RPTK) instructions. Note that the DMOV portion of the MACD instruction will not function with external data memory address- es. On the TMS320C2x, the MAC and MACD instructions can be used with both operands in either internal or external memory or one each in on-chip RAM. The SORA (square/add) and SQRS (square/subtract) instructions pass the same value to both inputs of the multiplier for squaring a data memory val- ue. The MPYU instruction on the TMS320C2x performs an unsigned multiplica- tion, which greatly facilitates extended-precision arithmetic operations. The unsigned contents of the T register are multiplied by the unsigned contents of the addressed data memory location, with the result placed in the P register. This allows operands of greater than 16 bits to be broken down into 16-bit words and processed separately to generate products of greater than 32 bits. After the multiplication of two 16-bit numbers, the 32-bit product is loaded into the PR on the TMS320C2x. The product from the PR may be transferred to the ALU. Four product shift modes (PM) are available at the PR output and are useful when performing multiply/accumulate operations and fractional arithmetic, or when justifying fractional products. The PM field of status register ST1 speci- fies the PM shift mode, as shown in Table 3-4. Table 3-4. PM Shift Modes If PM Is: Result 00 No shift 01 Left shift of 1 bit 10 Left shift of 4 bits 11 Right shift of 6 bits 3-33 Central Arithmetic Logic Unit (CALU) Left shifts specified by the PM value are useful for implementing fractional arithmetic or justifying fractional products. For example, the product of either two normalized, 16-bit, 2s-complement numbers or two 015 numbers con- tains two sign bits, one of which is redundant. 015 format, one of the various types of 0 format, is a number representation commonly used when perform- ing operations on noninteger numbers (see subsection 5.6.7 for an explana- tion and examples of 015 representation). The single-bit left shift eliminates this extra sign bit from the product when it is transferred to the accumulator. This results in the accumulator contents being formatted in the same manner as the multiplicands. Similarly, the product of either a normalized, 16-bit, 2s- complement or 015 number and a 13-bit, 2s-complement constant contains five sign bits, four of which are redundant. This is the case, for example, when using the MPYK instruction. Here the four-bit shift properly aligns the result as it is transferred to the accumulator. Using the right-shift PM value allows the execution of up to 128 consecutive multiply/accumulate operations without the threat of an arithmetic overflow, thereby avoiding the overhead of overflow management. The shifter can be disabled to cause no shift in the product when working with integer or 32-bit precision operations. This allows compatibility with TMS320C1 x code to be maintained. Note that the PM right shift is always sign-extended, regardless of the state of SXM. The four least significant bits of the T register (TR) also define a variable shift through the scaling shifter for the LACT/ADDT/SUBT (load/add-to/subtract- from accumulator with shift specified by the TR) instructions. These instruc- tions are useful in floating-point arithmetic where a number needs to be de- normalized, that is, floating-point to fixed-point conversion. The BITI (bit test) instruction allows testing of a single bit of a word in data memory based on the value contained in the four LSBs of the TR. 3-34 Architecture System Control 3.6 System Control System control on the TMS320C2x is supported by the program counter, hard- ware stack, PC-related hardware, the external reset signal, interrupts (see Section 3.8), the status registers, the on-chip timer, and the repeat counter. The following sections describe the function of each of these components in system control and pipeline operation. 3.6.1 Program Counter and Stack The TMS320C2x contains a 16-bit program counter (PC) and a hardware stack of eight locations for PC storage (see Figure 3-15). The program count- er addresses internal and external program memory in fetching instructions. The stack is used during interrupts and subroutines. Figure 3-15. Program Counter, Stack, and Related Hardware MCS (16) To Program Address Bus 16 (8 x 16) 16 16 The program counter addresses program memory, either on-chip or off-chip, via the program address bus (PAB). Through the PAB, an instruction is fetched from program memory and loaded into the instruction register (IR). When the IR is loaded, the PC is ready to start the next instruction fetch cycle. The PC may address any on-chip RAM blocks configured as program memory, or the 3-35 Control on-chip ROM provided on the TMS320C25. The PC also addresses off-chip program memory through the external address bus A 15-AO and the external data bus 015-DO. Data memory is addressed by the program counter during a BLKD instruction, which moves data blocks from one section of data memory to another. The contents of the accumulator may be loaded into the PC to implement com- puted GOTO operations. This can be accomplished using the BACC (branch to address in accumulator) or GALA (call subroutine indirect) instructions. To start a new fetch cycle, the PC is loaded either with PC+ 1 or with a branch address (for instructions such as branches, calls, or interrupts). In the case of conditional branches where the branch is not taken, the PC is incremented once more beyond the location of the branch address. The TMS320C2x also has a feature that allows the execution of the next single instruction N+ 1 times. N is defined by loading an 8-bit counter RPTC (repeat counter). If this repeat feature is used, the instruction is executed, and the RPTC is decremented until the RPTC goes to zero. This feature is useful with many instructions, such as NORM (normalize contents of accumulator), MACO (multiply and accumulate with data move), and SUBC (conditional sub- tract). When used with some multicycle instructions, such as MACO, the re- peat features can result in these instructions effectively executing in a single cycle. The stack is 16 bits wide and eight levels deep. The PC stack is accessible through the use of the PUSH and POP instructions. Whenever the contents of the PC are pushed onto the top of the stack, the previous contents of each level are pushed down, and the bottom (eighth) location of the stack is lost. Therefore, data will be lost if more than eight successive pushes occur before a pop. The reverse happens on pop operations. Any pop after seven sequen- tial pops yields the value at the bottom stack level. All of the stack levels then contain the same value. Two additional instructions, PSHD and POPD, push a data memory value onto the stack or pop a value from the stack to data memory. These instructions allow a stack to be built in data memory for the nesting of subroutines/interrupts beyond four/eight levels. Note that on the TMS320C2x, the TBLR/TBLW, MAC/MACO, and BLKD/BLKP instructions use a separate stack, MCS (microcall stack); no level of the PC stack is used. 3-36 Architecture System Control 3.6.2 Pipeline Operation Instruction pipelining consists of the sequence of external bus operations that occurs during instruction execution. The prefetch-decode-execute pipeline is essentially invisible to the user, except in some cases where the pipeline must be broken (such as for branch instructions). In the operation of the pipeline, the prefetch, decode, and execute operations are independent, which allows instruction executions to overlap. Thus, during any given cycle, three different instructions can be active, each at a different stage of completion, resulting in the three-level pipeline on the TMS320C2x. The difference in pipeline levels does not necessarily affect instruction execu- tion speed, but merely changes the fetch/decode sequence. Most instructions execute in the same number of cycles, regardless of whether they are executed from internal RAM, ROM, or external program memory. The effects of pipelining are included in the instruction cycle timings for the TMS320C25 listed in Appendix E. Additional PC-related hardware (see Figure 3-15} is provided on the TMS320C25 to allow three-level pipelining for higher performance. Included in the related hardware are the prefetch counter (PFC), the 16-bit microcall stack (MCS) register, the instruction register (IR}, and the queue instruction register (QIR}. In the three-level pipeline on the TMS320C25, the PFC contains the address of the next instruction to be prefetched. Once an instruction is prefetched, the instruction is loaded into the IR, unless the IR still contains an instruction cur- rently executing, in which case the prefetched instruction is stored in the QIR. The PFC is then incremented, and after the current instruction has completed execution, the instruction in the QIR is loaded into the IR to be executed. The PC contains the address of the next instruction to be executed and is not used directly in instruction fetch operations, but merely serves as a reference pointer to the current position within the program. The PC is incremented as each instruction is executed. When interrupts or subroutine call instructions occur, the contents of the PC are pushed onto the stack to preserve return link- age to the previous program context. The prefetch, decode, and execute operations of the pipeline are independent, thus allowing instruction executions to overlap. During any given cycle, three different instructions can be active, each at a different stage of completion. Figure 3-16 shows the operation of the three-level pipeline for single-word, single-cycle instructions executing from either internal program ROM or exter- nal memory with no wait states. 3-37 System Control Figure 3-16. Three-Level Pipeline Operation (TMS320C25) I I I I I I I I CLKOUT1 - - - , I II II L I I I I I 1111 N N+1 N+2 prefetch ..14 ..14 ..1111 I I I I I N-1 I N I N+1 .. 14 decode r' 111111 ..I"' I I N-2 I N-1 I N I execute 14 ..1111 111111 """' Pipelining is reduced to two levels when execution is from internal program RAM due to the fact that an instruction in internal RAM can be fetched and de- coded in the same cycle. Thus, separate prefetch and decode operations are not required, as shown in Figure 3-17. Figure 3-17. Two-Level Pipeline Operation I I I I I I I I CLKOUT1 - - - , I II II L I I I I I N N+1 prefetch ~ ..14 111111 N+2 111111 I I I I I N I N+1 I N+2 1114 decode ..I"' ..I"' I"' I I N-1 I N I N+1 I execute 14 1114 ..14 ..I"' The following paragraphs describe, in detail, the operation of the TMS320C25 pipeline. This description, in conjunction with Appendix E, gives sufficient in- formation for predicting the operation of the TMS320C25 for hardware inter- face optimization, accurate program cycle counting, and simulation modelling. Often, it is not necessary to understand the intricate detail of the pipeline to design with the TMS320C25. Therefore, if you are not specifically interested in these details, you can skip this description. 3-38 Architecture Control The TMS320C25 executes most of its instructions in a single cycle because all the instructions are straight decodes and highly pipelined as opposed to mi- crocode. The basic pipeline operation is 3.25 cycles deep where the device sequence on any given cycle is fetching the third instruction, decoding these- cond instruction, and executing the first. Figure 3-18 shows the internal op- eration of the TMS320C25 pipeline in reference to quarter phases 1 through 4 (01-04). Figure 3-18. TMS320C25 Standard Pipeline Operation Cycle 1 Cycle 2 Cycle 3 I 02 I 03 I 04 01 I 02 I 03 I 04 01 I 02 I 03 I 04 01 I Clock CLKOUT1 I I 11 I I II II I 1- - 1_.... II II I CLKOUT2 _jJI 11 I I I :1__-;.--........,11 1 :1 11 I Ir I I I I I I I I I m!J I 11 11,....-+----+'I11---1"1-..... 1L II 11 1! I I_ _,,__ _,..I. I I F I I Address ; IN~T1 ; H ; INS~2 ; ~-:--.--IN~T3 - : Data I I-----1 '"') i I I'""; . . .-1--1- INST1; I I I I I 1 Decode INSTO I I RAM RD INST2 Execute INST Status AUXREG INSTOARAU RAM WR The TMS320C25 machine cycle, externally referenced by the falling edges of the CLKOUT1 signal, consists of four internal cycles (or CLKIN cycles). This allows internal operations of the pipeline to execute as fast as 1/4 the machine cycle. The sequence of a general instruction execution in the pipeline is shown in Table 3-5. 3-39 System Control Table 3-5. Instruction Pipeline Sequence Cycle Q Phase Operation 1 1 New PC is output on address bus 2 External read of instruction 3 External read of instruction 4 External read of instruction 2 1 2 Instruction decode 3 Instruction decode/ARAU execution 4 On-chip RAM access/ARAU execution 3 1 On-chip RAM access/load new AR value/update ARP 2 ALU execution 3 ALU execution 4 Load accumulator 4 1 Load status register When using an add instruction (for example, ADD *+, 12,AR4}, the device fetches the instruction in cycle 1. During 02 and 03 of cycle 2, the instruction is decoded. This includes the ALU command decode as well as generation of the data operand fetch address. In this case, the address comes from an auxil- iary register. During 04 of cycle 2 and 01 of cycle 3, the operand is fetched from the RAM location. The increment of the auxiliary register is performed during 03 and 04 of cycle 2, and the value is loaded into the auxiliary register in 01 of cycle 3. The ARP is also updated in 01 of cycle 3. During 02 and 03 of cycle 3, the data is passed through the barrel shifter to execute the 12-bit left-shift, and the data is added by the ALU to the contents in the accumulator. In 04 of the third cycle, the ALU result is loaded into the accumulator. The sta- tus of the ALU operation is loaded into the status register in 01 of the fourth cycle. The bits being loaded into the status register at this time consist of the current ALU status and the ARP associated with the next instruction. In the case of a store instruction (for example, SACL *0-,3,AR2}, the device operates the first two cycles in the same manner as the ADD instruction. In 01 and 02 of the third cycle, the data in the accumulator is passed through a barrel shifter, left-shifted 3 bits, and zero-filled. The lower 16 bits of the shifted value are written to the address specified by the current auxiliary register. During 03 and 04 of the third cycle, the index register (ARO} is added to the contents of the current auxiliary register and loaded back into the current auxiliary register in 01 of the fourth phase. In 01 of the fourth cycle, the auxiliary register pointer is changed to AR2. There is no execution phase of this instruction. Figure 3-19 shows the ADD and SACL instructions operating back-to-back in a program sequence. It is assumed that both instructions reside in external, zero wait- state memory and that the data resides in on-chip RAM. 3-40 Architecture System Control Figure 3-19. Pipeline Operation of ADD Followed by SACL Clock CLKOUT1 CLKOUT2 Address Data Decode RAM Execute AUXREG When the device is reading instructions out of on-chip ROM, the basic internal operation of the pipeline is the same. The only difference is that the control lines (that is, STRB, PS, and R/W) are inactive. If the device is fetching the instructions from on-chip RAM, the pipeline is shortened to 2.5 cycles, since the device can fetch the instruction in half a cycle as opposed to the full cycle required in an external or on-chip ROM fetch. The instruction is fetched durinq Q4 and Q1, then decoded in Q2 and Q3. The rest of the pipeline tracks as de- scribed above. Some operations add additional machine cycles to the instruction execution without damaging the integrity of the program or hardware. External wait states, multiplexed data bus conflicts, two-word instructions, and program counter discontinuities are included in these operations, as described in the following paragraphs. Wait States. The TMS320C25 is designed to be interfaced to slower external devices through the use of hardware-generated wait states. This applies to the program, data, and 1/0 memory spaces of the Ha1vard architecture. Wait states are a direct delay on the instruction pipeline. Each wait state inserted during the instruction fetch contributes an additional machine cycle in the pipe- line execution of the instruction. In addition, any wait state incurred when accessing external data or 1/0 space also contributes an additional machine cycle to the pipeline execution of the instruction. This factor applies to all instructions. Figure 3-20 describes how the pipeline reacts to wait states in external program memory. Note that the wait state added in cycle 2 results in a no-execution operation in cycle 4. 3-41 System Control Figure 3-20. Pipeline Operation With Wait States . .Cycle .1 . Cycle 2 . . Cycle 3 . . . . Cycle. 4 . . Cycle 5 . . . 1~1001~1~1~1001~1~1~1001~1~1~1001~1~1~1001 Clock CLKOUT1 CLKOUT2 ~ I 11 I 11 I 11 I 11 I 11 I 11 I 11 l 11 l IL I I I I I I I I I I I I I I I Address Data Decode RAM Execute AUXREG AR4·ARO Multiplexed External Data Bus. The external data bus is multiplexed to sup- port all three memory spaces of the TMS320C25. Therefore, external fetches to multiple spaces in the same instruction add additional machine cycles to the pipeline execution of the instruction. This is due to the fact that the external fetch takes a full cycle, whereas the internal equivalent takes two quarter phases and can be included in the execution stage of the three-deep pipeline. Accessing the data memory space is controlled by setting of the data page pointer or the value contained in the auxiliary register used in any instruction. Also affecting the pipeline is the access of the 1/0 bus or the tables in program memory (that is, IN, OUT, TBLR, and TBLW). Figure 3-21 shows how the pipe- line processes an instruction with external program and data access. 3-42 Architecture System Control Figure 3-21. Pipeline With External Data Bus Conflict Two-Word Instructions. All two-word instructions take an additional cycle to fetch the 16-bit immediate operand following the instruction mnemonic. The first set of instructions for which this applies is the long immediate instructions. The instruction mnemonic is followed by a 16-bit immediate operand to be executed in the ALU. The second set applies to those instructions that use the PFC register as a second data addressing unit on some optimized instruc- tions-for example, the multiply/accumulate and block move instructions (MAC, MACD, BLKP, and BLKD). In the second set, the extra cycle appears only once in a repeat loop. The third set involves conditional branches not tak- en. Program Counter Discontinuities. Because the TMS320C25 is pipelined, a change (other than an increment) in the program counter requires that the pipeline be flushed. This applies to all branches, subroutine calls, software traps, interrupt traps, and returns. The pipeline, being three deep, has the next instruction already loaded when the branch occurs. At this point, this instruc- tion will not affect any data or registers, so it is cleared from the pipeline. There- fore, two dead execution cycles are inserted while waiting for the pipeline to reload. The device takes only one additional cycle if the destination of the branch is in on-chip RAM block 0. The pipeline is only two-deep in this case and takes only one cycle to reload. Figure 3-22 shows a branch from normal execution to an address in on-chip RAM, and Figure 3-23 shows an example of a return executed from on-chip RAM to a location in off-chip memory. 3-43 System Control Figure 3-22. Pipeline Operation of Branch to On-Chip RAM Cycle 1 Cycle 2 Cycle 3 Cycle 4 Cycle 5 Clock CLKOUT1 CLKOUT2 STF!B" Address Data Decode INTRAM DATARAM Status Execute AUXREG ARx-1 3-44 Architecture System Control Reset. The reset interrupt is a totally nonmaskable interrupt. When executed, it stops operation of the pipeline and flushes the unexecuted parts. The reset pulse must be at least three CLKOUT cycles wide. After the second CLKOUT cycle has completed (before the third rising edge of CLKOUT1), the device has brought all outputs into a high-impedance state. After the rising edge of RS, the device begins to fetch the reset vector. Since the pipeline is empty, it does not execute the reset vector branch until two cycles later. If the ROCO line is brought low during the active reset, the device does not start the fetch of the reset vector until after the active ROCO is removed and the device deactivates the HOLDA line. When ROCO is activated with RS to allow bootloading of the code, the HOLDA line will go active low in three cycles, regardless of whether or not the RS line has gone high. This is useful in that the HOLDA line can be used to enable the release of the RS line and guarantee the required three- cycle reset. Interrupts. The effects of an interrupt become apparent on the hardware when a interrupt acknowledge (TACR) signal is valid on the rising edge of CLKOUT2. This signifies the fetch of the first word of the interrupt vector. If wait states are generated in the memory segment where the interrupt vector re- sides, an additional TACK pulse occurs for each wait state added. If this causes a problem with the external interface, TACK can be gated with READY to ac- cept only the last interrupt acknowledge pulse. Note that the BIOZ instruction tests the level of the mo pin during the instruction fetch phase of the pipeline. Hold/Hold Acknowledge.The hold operation, like that of interrupt, takes se- cond priority to algorithm execution; therefore, the hold will not be acknowl- edged until after the currently running instruction is completed (a minimum of three cycles). This includes repeated instructions. The next instruction, after the final instruction executed before HOLDA, is latched into the pipeline and executed two cycles after the HOLDA line goes inactive high. The second instruction after the last instruction executed is fetched two cycles again after the HOLDA line goes inactive high. If the HM bit of status register ST1 is set high, the TMS320C25 stops execution and sits idle until the hold is removed. This lowers power consumption by removing the drive of the memory address and control lines and also stopping major parts of the internal CPU circuits from switching and drawing power. This can be used as a hardware powerdown mode. If the HM bit is low, the TMS320C25 continues executing any instruction that can be executed with on-chip resources only. This means both program and data reside in on-chip memory. The device will continue to operate normal- ly unless an off-chip access is required by an instruction, at which time the pro- cessor adds wait states until the hold state is removed. When running from on- chip resources with HM = O, the processor acknowledges ROCO with HOLDA during a multicycle instruction. On-Chip Program Access. When you execute from on-chip resources, the pipeline is visible only in the MSC line, which signals microstate complete when active low on the rising edge of CLKOUT2. Note that executing from on- chip program memory does not allow instruction accessing of external data 3-46 Architecture System Control memory to run in a single cycle. The normal operation of the instruction takes only two quarter phases of the execution cycle to fetch the on-chip data memory, whereas off-chip access requires all four quarter phases. The pipe- line is, however, optimized to handle a repeated instruction that accesses ex- ternal data memory with only one extra cycle for the first external fetch. External Program/Data Access. Visibility of the pipeline when using external program and data memory requires a monitoring of the MSC, STRB, PS, and O'S lines. The MSC line indicates at the rising edge of CLKOUT2 whether or not the cycle is the beginning of a new instruction fetch; that is, MSC"active low indicates the completion of an instruction and the acquisition of another instruction. The PS (program select) line indicates thatthe data bus is currently being used to fetch an instruction. A step in the pipeline is not indicated, since the PS line remains while the pipeline is fetching instructions externally. To track the fetches, the STRB line, which frames external accesses, must be monitored. The PS line being active low does not necessarily mean that the device is fetching an instruction. In the cases of table read/write (TBLR/TBLW), multiply/ accumulate (MAC/MACO), and block transfer (BLKP) instructions, the device uses the-pg line active low to access tables. To monitor external data memory fetches, watch the data select (OS) line in conjunction with the STRB line. An active low on the OS line indicates the data bus is currently being used to access data memory space. This line remains low for two memory fetches in the case of an accumulator store followed by an ALU instruction, both operating with off-chip memory. However, two STRB pulses will identify the individual access. Likewise, the line remains low for many cycles in the case of a repeated instruction. 1/0 space access operates similarily to data space operation with the OUT and IN instructions replacing the save and ALU instruction. A clear understanding of this information in conjunction with the data in Appen- dix E should be sufficient to predict the operation of the TMS320C25 pipeline. 3.6.3 Reset Reset (RS) is a nonmaskable external interrupt that can be used at any time to put the TMS320C2x into a known state. Reset is typically applied after pow- erup when the machine is in a random state. Driving the RS signal low causes the TMS320C2x to terminate execution and forces the program counter to zero. RS affects various registers and status bits. At powerup, the state of the processor is undefined. For correct system operation after powerup, a reset signal must be asserted low for at least three clock cycles to guarantee a reset of the device (see Section 5.1 for other impor- tant reset considerations). Processor execution begins at location 0, which normally contains a B (branch) statement to direct program execution to the system initialization routine (also see Section 5.1 for an initialization routine example). Section 6.1 provides system control circuitry design examples. 3-47 System Control When an RS signal is received, the following actions take place: 1} RAM configuration bits are set so that all on-chip RAM resides in data space. 2) The program counter (PC} is set to 0, and the address bus A 15-AO is driv- en with all zeros while RS is low. 3) The data bus 015-DO is placed in the high-impedance state. 4} All memory and 1/0 space control signals (PS, OS, TS, R/W, STRB', and BR) are deasserted by setting them to high levels while RS is low. 5) All interrupts are disabled by setting the INTM (interrupt mode} bit to 1. (Note that RS is nonmaskable.} The interrupt flag register (IFR} is reset to all zeros. 6) Status bits are set: For all TMS320C2x devices, 0 -+ OV, 1 -+ XF, 0 -+ FO, 0 -+ TXM, 0-+ CNF (0-+ CNFO, O-+ CNF1 for the TMS320C26}, 1 -+ SXM, 0-+ PM, 1 -+ HM, 1 -+ C, and 1 -+ FSM. The remaining status bits on the TMS320C2x are unchanged. 7) The global memory allocation register (GREG} is cleared to make all memory local. 8) The RPTC (repeat counter} is cleared. 9) The DX (data transmit} pin is placed in the high-impedance state. Any transmit/receive operations on the serial port are terminated, and the TXM (transmit mode} bit is reset to a low level. This configures the FSX framing pulse to be an input. A transmit/receive operation may be started by fram- ing pulses only after the removal of RS. 1O} The Tl M register is set to the maximum value (OFFFFh} on reset. Also, the PRO register on the TMS320C25 is initialized by reset to OFFFFh. (See Example 5-1). The TIM register begins decrementing only after RS is deasserted. 11} The JACK (interrupt acknowledge} signal is generated in the same manner as a maskable interrupt. 12) The state of the RAM is undefined following RS. 13) The ARB, ARP, DP, IMR, OVM, and TC bits are not initialized by reset. Therefore, it is critical that you initialize these bits in software following re- set. 3-48 Architecture System Control --=-"""'""'=-'"""""-==----=-· ~~----~~».;:W.w:<:;,.-m~:::m~~:m:~~.«;:::::;::-);:®".,:,::::-/~»'~~..x:~~~~ Execution starts from location Oof program memory when the RS signal is tak- en high. Note that if RS is asserted while in the hold mode, normal reset opera- tion occurs internally, but all buses and control lines remain in the high-imped- ance state. Upon release of HOLD and RS, execution starts from location zero. The TMS320C2x can be held in the reset state indefinitely. Note: Reset does not have internal Schmidt hysteresis. To insure proper reset op- eration, avoid slow rise and fall times. 3.6.4 Status Registers Two status registers, STO and ST1, contain the status of various conditions and modes. The status registers can be stored into data memory and loaded from data memory, thus allowing the status of the machine to be saved and restored for interrupts and subroutines. All status bits are written to and read from using LST/LST1 and SST/SST1 instructions, respectively (with the ex- ception of INTM, which cannot be loaded via an LST instruction). Figure 3-24 shows the organization of both status registers, indicating all sta- tus bits contained in each. Notethatthe DP, ARP, and ARB registers are shown as separate registers in the processor block diagram of Figure 3-2. Because these registers do not have separate instructions for storing them into RAM, they are included in the status registers. As shown in Figure 3-24, several bits in the status registers are reserved and read as logic 1s by the LST and LST1 instructions. Figure 3-24. TMS320C2x Status Register Organization 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 STol ARP DP 15 14 13 12 11 10 9 8 7 6 5 4 3 21 0 s11I ARB 1 I HM I FSM I XF I FO jno----i1'--' PC SYNC Interrupt I FF Flag Interrupt Processor I Register I Interrupt I CLK CLK Active Machine State I I 02 a, I I Logic for each ex1ernal Interrupt J From 1_ - - - - - - - - - - - - - - - - - - - - Internal Interrupts Due to the level sensitivity of the external interrupts and the synchronization of the interrupts (first on 02, then on 01 of the following machine cycle), the Tf\JT line must be set to an inactive high at least two cycles before the enabling interrupts (EINT). If this criteria is not met, the TMS320C25 will immediately take the interrupt trap following the EINT plus the next instruction. If the INTM bit and mask register have been properly enabled, the interrupt sig- nal is accepted by the processor. An TACK (interrupt acknowledge) signal is then generated. The TACK clears the appropriate interrupt edge flip-flop and disables the INTM latch. The logic is the same for Tf\JT1 and Tf\JT2. In a typical interrupt (Tf\JT2-Tf\JTO) operation, the interrupt is generated by a negative-going edge, and the IFR bit is set. Because INTM is disabled when the interrupt is acknowledged, the level may continue to be present on the Tf\JT input without generating further interrupts. If the level is removed before an EINT instruction is executed, no further interrupts are generated. If a low level continues to be present after the El NT, another interrupt is generated after the El NT/next instruction sequence. In addition, if the Tf\JT pin is pulsed between the previous TACK and EINT, another interrupt is generated after EINT/RET because the corresponding IFR bit is again set. 3-61 lntedupts Figure 3-32 shows an interrupt, interrupt acknowledge, and various other sig- nals for the special case of single-cycle instructions. An interrupt generated during the current (N} fetch cycle still allows the fetch and execution of that instruction. The N+1 and N+2 instructions are also fetched, then discarded, and the address N+ 1 is pushed onto the top of the stack. The instruction is fetched again upon a return command from the interrupt routine. Figure 3-32. Interrupt Timing Diagram (TMS320C25) CLKOUT1 CLKOUT2 Notes: 1) N is the program memory location for the current instruction. 2) I is the interrupt vector location in program memory for the active interrupt. 3) For simplicity, this example shows only the execution of single-cycle instructions fetched from external program memory, rather than multicycle instructions. Three dummy execute cycles occur on an interrupt, as shown in the timing dia- gram for the TMS320C25 (Figure 3-32}. The TACK signal is asserted low dur- ing CLKOUT1 low when the device initiates a fetch from the interrupt location I. Note that TACK is a valid signal only when CLKOUT1 is low. An external de- vice can determine which interrupt had occurred by latching the address bus value present on A4-A 1 with the rising edge of CLKOUT2 when TACK is low. 3-62 Architecture Serial Port 3.9 Serial Port A full-duplex on-chip serial port provides direct communication with serial de- vices such as codecs, serial AID converters, and other serial systems. The in- terface signals are compatible with codecs and many other serial devices with a minimum of external hardware. The serial port may also be used for inter- communication between processors in multiprocessing applications. Both receive and transmit operations are double-buffered on the TMS320C2x, thus allowing a continuous bit stream even if FSX is an output. The use of the frame sync mode (FSM) bit provides continuous operation that, once initiated, requires no further frame synchronization pulses. No minimum CLKR/CLKX frequency {fmin =O Hz) is required for serial port operation. The bits, pins, and registers that control serial port operation are listed in Table 3-8. Availability of a function on a particular device is also indicated. Table 3-8. Serial Port Bits, Pins, and Registers Serlal Port Bits/Pins/Registers TMS320C25 FO Format bit Yes TXM Transmit mode bit Yes FSM Frame synchronization mode bit Yes CLKX Transmit clock signal Yes CLKR Receive clock signal Yes DX Transmitted serial data signal Yes DR Received serial data signal Yes FSX Transmit framing synchronization signal Yes FSA Receive framing synchronization signal Yes DXR Data transmit register Yes ORR Data receive register Yes XSR Transmit shift register Yes RSA Receive shift register Yes The serial port uses two memory-mapped registers: the data transmit register (DXR) that holds the data to be transmitted by the serial port, and the data re- ceive register (ORR) that holds the received data (see Figure 3-33). Both reg- isters operate in either the 8-bit byte mode or 16-bit word mode, and may be accessed in the same manner as any other data memory location. Each regis- ter has an external clock, a framing synchronization pulse, and associated shift registers. Any instruction accessing data memory can be used to read from or write to these registers; however, the BLKD (block move from data memory to data memory) instruction cannot be used to read these registers. The OXR and ORR registers are mapped into locations Oand 1 in the data ad- dress space. The XSR and RSA registers are not directly accessible through software. 3-63 Serial Port Figure 3-33. The ORR and DXR Registers Address MSB LSB OOOOh ORR 0001h DXR If the serial port is not being used, the DXR and ORR registers can be used as general-purpose registers. In this case, the CLKR or FSA should be con- nected to a logic low to prevent a possible receive operation from being initi- ated. Three bits in status register ST1 are used to control the serial port operation: FO, TXM, and FSM. The FO (format) bit defines whether data to be transmitted and received is an 8-bit byte or a 16-bit word. If FO =0, the data is formatted in 16-bit words. If FO = 1, the data is formatted in 8-bit bytes. In the 8-bit mode, only the eight least significant bits are used for transmit/receive operations. The FO bit is loaded by the FORT (format serial port registers) instruction. On reset, FO is set to 0. The TXM (transmit mode) bit is used to determine if the frame synchronization pulse for the transmit operation is generated externally or internally. If TXM = 1, the FSX pin becomes an output pin, and a framing pulse is produced on the FSX pin every time the DXR register is loaded. This framing pulse is synchro- nized with the rising edge of CLKX. If TXM = 0, the FSX pin becomes an input pin. The TMS320C2x then waits for an external synchronization pulse before beginning transmission. On a reset, TXM is set to zero, configuring FSX to be an input. The TXM bit can be loaded by the LST1, STXM, or RTXM instruc- tions. The FSM (frame synchronization mode) status register bit is used to determine whether frame sync pulses are required for each serial port transfer. When FSM = 1, frame sync pulses are required; consequently, they are not required when FSM = 0. FSM is set by the SFSM (set frame synchronization mode) instruction and cleared by the RFSM (reset frame synchronization mode) instruction. When FSM = 1 and frame sync pulses are required, an FSX pulse will cause the XSR to be loaded with data from the DXR, and transmission will begin. If an FSX is presented prior to the last bit of the current transmission, the XSR will be reloaded from the DXR, thus aborting the current transmission and immediately beginning a new one. The frame sync mode is useful in communicating to PCM highways. For An T1 and CCITI G711/712 lines, the processor can communicate directly in these formats by counting the transmitted/received bytes in software and per- forming SFSM/RFSM instructions as needed to set/reset the FSM bit. 3-64 Architecture Serial Port 3.9.1 Transmit and Receive Operations The transmit and receive sections of the serial port are implemented separate- ly to allow independent transmit and receive operations. Externally, the serial port interface is implemented using the six serial port pins. Figure 3-34 shows the registers and pins used in transmit and receive operations. Figure 3-34. Serial Port Block Diagram DAR (16) DXR (16) Load (Load) 16 Control 16 Logic RSA (16) XSR (16) (Carry) (Carry) Byte/Word Counter (Clear) (Clear) Byte/Word Counter FSA FSX DR RINT CLKR CLKX XINT DX Data is clocked onto the DX pin from the XSR of the TMS320C25 by a CLKX signal. Data is clocked into the RSR of the TMS320C25 from the DR pin by a CLKR signal. CLKX and CLKR are required to be present only during actual serial port transfers, and may be stopped (at a valid logic level) when no data is being transferred. Data bits can be transferred in either 8-bit bytes or 16-bit words. Data is clocked out to DX on the rising edges of CLKX, while data is clocked in from DR on the falling edges of CLKR. The MSB of the data is trans- ferred first. The XSR and RSR are connected to the DXR and ORR, respectively. For transmit operations, the contents of DXR are transferred to XSR when a new transmission begins. For a receive operation, the contents of RSR are trans- ferred to ORR when all of the bits have been received. Thus, the serial port is double-buffered because data may be transferred to or from the DXR or ORR while another transmit or receive operation is being performed. Serial port transfers on the TMS320C25 are generally initiated by a frame sync pulse. The exception to this is when the continuous mode of operation is used with FSM = O, as described in a subsequent paragraph. Frame sync pulses are input on FSX for transmit operations and on FSR for receive operations. 3-65 Serial Port The transmit timing diagram is shown in Figure 3-35. The transmit operation begins when data is written into the data transmit register (DXR}. The TMS320C2x begins transmitting data when the frame synchronization pulse (FSX} goes low while CLKX is high or going high. The data, starting with the MSB, is then shifted out via the DX pin with the rising edge of CLKX. When all bits have been transmitted, an internal transmit interrupt (XINT} is generated on the rising edge of CLKX. When the serial port is not transmitting, DX is placed in the high-impedance state. Figure 3-35. Serial Port Transmit Timing Diagram CLKX I I I I I I I I I I FSXJ, (TXM=1} I I I \I I I I I I I I ~S I I I I I r I DX I I I I 1( MSB I x ~ I I LSB )I I I I I 1.. I I 8 or 16 Bits I ..1 I I I I I I I I I XINT I I I SI I Y\ I I I DX and FSX are unaffected by assertion of the ROIO input. Upon assertion of ROIO, any serial port transmission in progress on the DX pin is completed before DX is placed in the high-impedance state. FSX remains configured as either an input or output, remaining low if it is an output. The receive operation is similar to the transmit operation. The receive timing diagram is shown in Figure 3-36. Reception is initiated by a frame synchro- nization pulse on the FSR pin. After FSR goes low, data on the DR pin is clocked into the RSR register on the TMS320C25 on every negative-going edge of CLKR. The first data bit is considered the MSB, and RSR is filled ac- cordingly. After all the bits have been received (as specified by FO}, an internal receive interrupt (RI NT} is generated on the rising edge of CLKR, and the con- tents of RSR are transferred to ORR. 3-66 Architecture Serial Port Figure 3-36. Serial Port Receive Timing Diagram CLKR I I I I FSA _/ \1 I ~ I DR MSB LSB I I 1.. 8or16 Bits ..! I I I RINT 11 I If\ 3.9.2 Timing and Framing Control Upon completion of a serial port transfer, an internal interrupt is generated. The RI NT interrupt is generated for a receive operation, and XI NT is generated for a transmit operation. RINT and XINT are generated on the rising edge of CLKR and CLKX, respectively, after the last bit is transferred. Note that if ORR is read before a RINT is received, it will contain the data from the previous op- eration. Similarly, if DXR is loaded more than once after an XINT is generated (in the continuous transmission mode), only the last value written will be loaded into XSR for the next transmit operation. When the TMS320C2x is reset, TXM is cleared to zero, and DX is placed in the high-impedance state. Any transmit or receive operation that is in progress when the reset occurs is terminated. The transmit framing synchronization pulse can be generated internally or ex- ternally. The maximum speed of the serial port is 5 MHz. The timing of the seri- al port signals is compatible with the Tl/Intel 29C1x series codecs. The timing is also compatible with the AMI S3506 series codecs ifthe frame synchroniza- tion signals are inverted. Serial port transfers on the TMS320C25 are generally initiated by a frame sync pulse, except when the continuous mode of operation is used with FSM = 0. Frame sync pulses are input on FSX for transmit operations and on FSR for receive operations. If FSM = 1, frame sync pulses are required; if FSM = 0, they are not required. FSM is set by the SFSM (set frame synchronization mode) instruction and cleared by the RFSM (reset frame synchronization mode) instruction. 3-67 Serial Port 3.9.3 Burst-Mode Operation In burst-mode serial port operation, transfers are separated in time by periods of no serial port activity (the serial port does not operate continuously}. For burst-mode operation, FSM must be set to one. Timing of the serial port in this mode of operation is shown in Figure 3-37 and Figure 3-38. Figure 3-37. Burst-Mode Serial Port Transmit Operation XINT ~----~--~--~--~--~--~-----~- I t DXR Loaded XSR DXR Reloaded I Loaded XSR (During CLKX Low) Reloaded Figure 3-38. Burst-Mode Serial Port Receive Operation CLKR ORR Loaded From RSR 3-68 Architecture Serial Port When TXM = 1 (FSX is an output) and the serial port register DXR is loaded, a framing pulse is generated on the next rising edge of CLKX. The XSR is loaded with the current contents of DXR while FSX is high and CLKX is low. Transmission begins when FSX goes low while CLKX is high or is going high. Figure 3-37 shows the timing for the byte mode (FO = 1). XI NT is generated on the rising edge of CLKX after all 8 or 16 bits have been transmitted and DX is placed in the high-impedance state. If DXR is reloaded before the next rising edge of CLKX after XINT, FSX will again be generated as shown, and XSR will be reloaded. The receive operation is similar to the transmit operation. The contents of RSR are loaded into ORR while CLKR is low, just after reception of the last bit sent by the transmitting device (see Figure 3-38). RINT is generated on the next rising edge of CLKR, and ORR may be read at any time before the reception of the final bit of the next transmission. When operating in the byte mode, the eight MSBs of the ORR are the contents of the eight LSBs of the ORR prior to reception of the current byte, as shown in Figure 3-39 for the TMS320C25. Figure 3-39. Byte-Mode ORR Operation (TMS320C25) MSB LSB I Initial Condition x y I After 1st Receive (Byte '/:\) I y A I After 2nd Receive (Byte 'B') I A B I 3.9.4 Continuous Operation Using Frame Sync Pulses (TMS320C25) The TMS320C25 provides two modes of operation that allow the use of a con- = tinuous stream of serial data. When FSM 1 , frame sync pulses are required. Because DXR is double-buffered, continuous operation is achieved even if TXM = 1. Writing to DXR during a serial port transmission does not abort the transmission in progress, but, instead, DXR stores that data until XSR can be reloaded. As long as DXR is reloaded before the CLKX rising edge on the final bit being transmitted, the FSX pulse will go high on the rising edge of CLKX during the transmission of the final bit and fall on the next rising edge when transmission of the word just loaded begins. If DXR is not reloaded within this period and FSM = 1 , the DX pin will be placed in a high-impedance state for at least one CLKX cycle until DXR is reloaded (as described in the previous section). Figure 3-40 and Figure 3-41 show the timing diagrams for the con- tinuous operation with frame sync pulses. 3-69 Serial Port Figure 3-40. Serial Port Transmit Continuous Operation (FSM = 1) CLKX FSX (TXM=1) __._ _. DX -..i1_..-..-....,......!""W......-~........,~~"-~~.....,_...,....,........1.~--.1........-..1~.......-•~....,..,,_ (F0=1) -11""""-.-,'~~----·"---.""""....._,,.._-....."""'"__,.;,,,,,,..,;;,,,,r"""""'~......_"""'..-.-....-=~ XINT--~-- f f DXR XSR DXR XSR Loaded Loaded Loaded Loaded WithB WithC Figure 3-41. Serial Port Receive Continuous Operation (FSM = 1) CLKR FSR __._......., DR --.1......--.1---.1,........ .. -,~--1~....--"--~1.-,..._,,_..--.11_...._ _.__,,...,.._,~--r- (F0=1) RINT _.____,,_ _ ORR ORR Loaded Loaded From RSR From RSR Continuous receive operation with FSM =1 is identical to that of burst-mode operation with the exception that FSR is pulsed during reception of the final bit. 3-70 Architecture Serial Port 3.9.5 Continuous Operation Without Frame Sync Pulses (TMS320C25) The continuous mode of operation on the TMS320C25 allows transmission and reception of a continuous bit stream without requiring frame sync pulses every 8 or 16 bits. This mode is selected by setting FSM =0. Figure 3-42 and Figure 3-43 show operation of the serial port for both states of TXM to illustrate differences in operation for each case. FSM is initially set to one, and frame sync pulses are required to initiate serial transfers. Before the completion of the transmission (that is, before the next serial port interrupt), the FSM must be reset to zero by means of an RFSM (reset FSM) instruction. RFSM can occur either before or after the write to DXR or read from ORR. From this point on, the FSX and FSR inputs are ignored, with transmission oc- curring every CLKX cycle and reception occurring every CLKR cycle as long as those clocks are present. If FSX is configured as an output, it will remain low until FSM is set back to one and DXR is reloaded. If DXR is not reloaded with new data every XINT (every 8or16 CLKX cycles, depending on FO), the last value loaded will be trans- mitted on DX continuously. Note that this is different from the case with FSM =1 where DX is placed into a high-impedance state if DXR is not reloaded before transmission of the last bit of the current word in XSR. For example, if byte C is not loaded into DXR as indicated in Figure 3-42, bits of byte B (81-88) will be retransmitted instead of bits of byte C as shown. For receive operations, ORR is loaded from RSR (and an RINT is generated) every 8or16 CLKR cycles (depending on FO), regardless of whether or not ORR has been read. An overrun of ORR is also possible with FSM =1 if ORR is not read before the next RI NT. The only way to stop continuous transmission or reception once started, when FSM =0, is either to stop CLKX or CLKR or to perform an SFSM (set FSM) instruction. Continuous transmission without frame sync pulses is very useful in communi- cating directly to telephone system PCM highways. For ATT T1 and CCITT G711 /712 lines, FSX and FSR pulses are generated only every 24 or 32 bytes. By counting the transmitted and received bytes in software after an initial FSX or FSR and performing SFSM and RFSM instructions as required, the TMS320C25 can easily be made to communicate in these formats. 3-71 Serial Port Figure 3-42. Serial Port Transmit Continuous Operation (FSM = O) CLKX I I I I I I I I I XINT ----~ OXR t Loaded With B I 1 RFSM t 1 I XSR OXR XSR Loaded Loaded Loaded From OXR WithC Figure 3-43. Serial Port Receive Continuous Operation (FSM = O) I I I I I CLKR RINT ----- r Read ORR 1 ORR Read ORR Loaded ORR Loaded From RSR From RSR 3-72 Architecture Serial Port 3.9.6 lnltlallzatlon of Continuous Operation Without Frame Sync Pulses FSM is normally initialized during an XINT or RINT service routine to enable or disable FSX and FSR, respectively, for the next serial port operation. It is necessary to start this mode with FSM =1 so that the first data transferred out of the serial port is the data written to the DXR register. Otherwise, the serial port starts transmitting the contents of the shift register before loading it with the value stored in the DXR register. Upon each completion of a data packet transmission, it loads the data contained in the DXR register into the shift regis- ter and continues transmitting. After the first frame pulse has been generated by or sent to the TMS320C25, the FSM bit must be reset to Ousing the RFSM instruction. This must be done before the next serial port interrupt to ensure continuous transmission. If continuous transmission is stopped via software, this initiation sequence must be repeated to restart the continuous mode op- eration. As shown in Figure 3-44 and Figure 3-45, RFSM may occur before a write to DXR, regardless of the state of TXM. If TXM = 1, FSX is generated in a normal manner on the next rising edge of CLKX, but only once. If TXM = 0, the TMS320C25 waits to transmit until FSX is pulsed, but from then on, the FSX input is ignored. Note that just as in the case of continuous-mode operation without sync pulses described in subsection 3.9.5, the first data written to DXR (byte A) is output twice unless DXR is reloaded before the second transmis- sion is started. It is important to consider this dummy cycle when using continu- ous-mode serial operation. The receive timings are the same as those for the transmit operations with TXM =O. The TMS320C25 waits to receive data until FSR is pulsed, but there after the FSR input is ignored. No dummy cycle is associated with the receive operation; this is because ORR has a post-buffering nature as opposed to the prebuffering nature of DXR. 3-73 Serial Port Figure 3-44. Continuous Transmit Operation Initialization CLKX FSX I I I I I I I I I I I I (TXM=1) --;-~n I I I I I I I I I i (TX~~~ DX n (F0=1) ~l--'--~.;.;A-..1 ""---...'"-"__,"---..,,r~""""......,._,"".......""---..,."-"....._,n..,;.-.,,r'- 1 I MSB I XINT I I I RF~L j 1 xiR Loaded 1 XSR Reloaded DXR Loaded With A Figure 3-45. Continuous Receive Operation Initialization CLKR r RFSM ORR Loaded From RSR 3-74 Architecture Multiprocessing and Direct Memory Access (DMA) 3.1 o Multiprocessing and Direct Memory Access (OMA) The flexibility of the TMS320C2x allows configurations to satisfy a wide range of system requirements. Some of the system configurations using the TMS320C2x are as follows: O A standalone system (single processor), O A multiprocessor with devices in parallel, O A host/slave multiprocessor with shared global data memory space, or O A peripheral processor interfaced using processor-controlled signals to another device. These system configurations are made possible by three specialized features of the TMS320C2x: the synchronization function utilizing the SYFJC input, the global memory interface, and the hold function implemented with the HO'CO and HOLDA pins. The following sections describe these functions in detail. 3.10.1 Synchronization In a multiprocessor environment, the SYFJC input can be used to greatly ease interface between processors. This input is used to cause each TMS320C2x in the system to synchronize its internal clock, thereby allowing the processors to run in lock-step operation. Multiple TMS320C2x devices are synchronized by using common SYFJC and external clock inputs. A negative transition on SYFJC sets each processor to internal quarter-phase one (01). This transition must occur synchronously with the rising edge of CLKIN. On the TMS320C25, there is a two-CLKIN-cycle delay following the cycle in which SYFJC goes low, before the synchronized 01 occurs. The timing diagram for the SYFJC input is shown in Figure 3-46 for the TMS320C2x. 3-75 Multiprocessing and Direct Memory Access (OMA) Figure 3-46. Synchronization Timing Diagram (TMS320C25} CLKIN I I I I I I I I I I I I I I iI YiI I I I I I I I I I I I I l 'lI CLKOUT1 CLKOUT2 "I I I I I I I lI I I I I I I tI I I I 1I )t I I I I I t I I I I Normally, SYNC is applied while RS is active. If SYNC is asserted after a reset, the following can occur: 1) The processor machine cycle is reset to 01, provided that the timing re- quirements for SYNC are met. If SYNC is asserted at the beginning of 01, 03, or 04, the current instruction is improperly executed. If SYNC is as- serted at the beginning of 02, the current instruction is executed properly. 2) If SYNC does not meet the timing requirements, unpredictable processor operation occurs. A reset should then be executed to place the processor back in a known state. 3.10.2 Global Memory For multiprocessing applications, the TMS320C2x is capable of allocating global data memory space and communicating with that space via the BR (bus request) and READY control signals. Global memory is memory shared by more than one processor; therefore, ac- cess to it must be arbitrated. When using global memory, the processor's ad- dress space is divided into local and global sections. The local section is used by the processor to perform its individual function, and the global section is used to communicate with other processors. A memory-mapped global memory allocation register (GREG) specifies part of the TMS320C2x's data memory as global external memory. GREG, which is memory-mapped at data memory address location 5, is an eight-bit register connected to the eight LSBs of the internal D bus. The upper eight bits of loca- tion 5 are nonexistent and read as 1s. 3-76 Architecture Multiprocessing and Direct Memory Access (OMA) The contents of GREG determine the size of the global memory space. The legal values of GREG and corresponding global memory spaces are shown in Table 3-9. Note that values other than those listed in the table lead to frag- mented memory maps. Table 3-9. Global Data Memory Configurations GREG Value Local Memory Global Memory Range #Words Range #Words ooooooxx Oh - OFFFFh 65,536 0 10000000 Oh - 07FFFh 32,768 08000h - OFFFFh 32,768 11000000 Oh - OBFFFh 49,152 OCOOOh - OFFFFh 16,384 11100000 Oh - ODFFFh 57,344 OEOOOh - OFFFFh 8,192 11110000 Oh - OEFFFh 61,440 OFOOOh - OFFFFh 4,096 11111000 Oh - OF7FFh 63,488 OF800h - OFFFFh 2,048 11111100 Oh - OFBFFh 64,512 OFCOOh - OFFFFh 1,024 11111110 Oh - OFDFFh 65,024 OFEOOh - OFFFFh 512 11111111 Oh - OFEFFh 65,280 OFFOOh - OFFFFh 256 When a data memory address, either direct or indirect, corresponds to a global data memory address (as defined by GREG), BR is asserted low with DS to indicate that the processor wishes to make a global memory access. External logic then arbitrates for control of the global memory, asserting READY when the TMS320C2x has control. The length of the memory cycle is controlled by the READY line. One wait-state timing is shown in Figure 3-47. Note that all signals not shown have the same timing as in the normal read or write case. Figure 3-47. Global Memory Access Timing I I I I I CLKOUT1~ { ~ { ~ I I I I I STRB I \ I I I I I I I I I I A15-AO Valid I I ~ ' BR, OS I I Valid I I READY~ ~ 3-77 Multiprocessing and Direct Memory Access (DMA) 3.10.3 The Hold Function The TMS320C2x supports direct memory access (OMA) to its local (off-chip) program, data, and 1/0 spaces. Two signals, ROm and HOLDA, are provided to allow another device to take control of the processor's buses. Upon receiv- ing a ROm signal from an external device, the processor acknowledges by bringing HOLDA low. The processor then places its address and data buses as well as all control signals (PS, OS, TS, R/W, and STRB) in the high-imped- ance state. The serial port output pins, DX and FSX, are not affected by ROm. Signaling between the external processor and the TMS320C2x can be per- formed by using interrupts. The timing for the ROm and HOLDA signals is shown in Figure 3-48. ROm has the same setup time as READY and is sampled at the beginning of quar- ter-phase 3. If the setup time is met, it takes three machine cycles before the buses and control signals go to the high-impedance state. Note that unlike the external interrupts {JNT2-TNTO), ROm is not a latched input. The external device must keep ROm low until it receives a HOLDA from the TMS320C2x. If the TMS320C2x is in the middle of a multicycle instruction, it will finish the instruction before entering the hold state. After the instruction is completed, the buses are placed in the high-impedance state. This also applies to instruc- tions that become multicycle due to insertion of wait states or to the use of RPTI RPTK instructions. After ROm is deasserted, program execution resumes from the same point at which it was halted. HOLDA is removed synchronously with ROm, as shown in Figure 3-48. If the setup time is met, two machine cycles are required before the buses and control signals become valid. ROm is not treated as an interrupt. If the TMS320C2x was executing the IOLE instruction before entering the hold state, it resumes executing IDLE once it leaves the hold state. The hold function on the TMS320C25 has two distinct operating modes: O A mode in which execution is suspended during assertion of ROm, and O A TMS320C25 concurrent OMA mode, in which the TMS320C25 contin- ues to execute its program while operating from internal RAM or ROM, thus greatly increasing throughput in data-intensive applications. 3-78 Architecture Multiprocessing and Direct Memory Access (DMA) The operating mode is selected by the HM (hold mode) status register bit on the TMS320C25. The ROm signal is pulled low, as shown in the first part of Figure 3-48. When HM =1, the TMS320C25 halts program execution and en- ters the hold state directly. When HM =0, the processor enters the hold state directly, as shown in Figure 3-48, if program execution is from external memory or if external data memory is being accessed. If program execution is from internal memory, however, and if no external data memory accesses are required, the processor enters the hold state externally, but program execution continues internally. This allows more efficient system operation be- cause a program may continue executing while an external OMA operation is being performed. Program execution ceases until ROm is removed if the processor is in a hold state with HM =0 and an internally executing program requires an external ac- cess, or if the program branches to an external address. Also, if a repeat instruction that requires the use of the external bus is executing with HM = O and a hold occurs, the hold state is entered after the current bus cycle. If this situation occurs with HM =1, the hold state will not be entered until the repeat count is completed. HM is set and reset by the SHM (set hold mode) and RHM (reset hold mode) instructions, respectively. All interrupts are disabled while ROm is active with HM =1. If an interrupt is received during this period, the interrupt is latched and remains pending. Therefore, ROm itself does not affect any interrupt flags or registers. When HM =0, interrupts function normally. 3-79 Multiprocessing and Direct Memory Access (DMA) Figure 3-48. TMS320C25 Hold Timing Diagram CLKOUT1 STAB I I I I I I I I I I ROCO -i\I I I I I I I I I I I I I I I I ~ ~ * * A15-AO N N+1 N+2 I I I I I I I ~ =* * ~ PS,OS, Valid Valid I or TS I I I I I I I I I I I R/W I I I ~ I I I I I I I I I I I 015-DO I @ II @ II I I I I I fetch 1.. ~ ..1.. N+l .,I,,. ..1 .. .,I 1.. N-2 ..1.. N-1 ..1.. N ..1 .. ..1 execute I I I I I ROCOA I I I I I I ~ I Notes: 1} N is the program memory location for the current instruction. 2) This example shows only the execution of single-cycle instructions fetched from external program memory. 3-80 Architecture Multiprocessing and Direct Memory Access (OMA) . . . . . . , . . . . . . , , , _ _ . . . . . . . , . . . . , . _ , , , . . . . , . . . , _ , , , . . . . . . , . _ , , ,. . . . . ., , _ _ . . . , . , . . . . . . , _ , _ . _ _ . . , . ,. . . . . . . .. . . . , , _ , . , , , _. . . . . ._..~.~ Ml>AW: Figure 3-48. TMS320C25 Hold Timing Diagram (Continued) CLKOUT1 STRB I I I I I I I I I I I I I I I I I I HO[O I 1/ I I I I I I I I I I I I I I I I I I I I I ~ N+3 ~ K N+2 ** * t A15-AO N+2 N+4 I I I I I I I I I ~ I I ~ Valid * PS,OS, Valid Valid or TS I I I I I I I I I I I I I I I I R/W I I it I I I I I I I I I I I I I I I I I I I I I I I 015-DO I I I I @ N+2 I I .,I,. @ N+3 I 0+- II fetch 1.. ..1.. .. 1.. . 1.. ..1.. N+4 .. I,. ..1.. ..1.. ..1.. N+1 Dummy I N+2 ..1 execute I I I I .. 1.. I ..I.. I RO[O}i; I 1/ I I I I I I I I I I I I Notes: 3) N is the program memory location for the current instruction. 4) This example shows only the execution of single-cycle instructions fetched from external program memory. 3-81 General Description of the TMS320C26 3.11 General Description of the TMS320C26 The TMS320C26 is a spin-off of the TMS320C25. It is processed in CMOS technology, is capable of an instruction cycle time of 100 ns, and is pin-for-pin and object code-compatible with the TMS320C25, with the exception of the instructions for on-chip-memory configuration. The TMS320C26's enhance- ment over the TMS320C25 is basically the larger on-chip RAM (see the block diagram in Figure 3-3), divided into 4 blocks with 1568 words altogether. The three blocks, BO, 81, and 83-each with 512x16 bits-are configurable as data or program memory. The block 82 with 32 x 16 bits is identical with the same block of the TMS320C25 and is usable as data memory. The ROM of the TMS320C26 consists of 256 words with a factory-programmed bootloader. In many applications, the large internal memory of the TMS320C26 allows you to build single-chip solutions with all data and programs internal and the option to reload programs or algorithms. A memory size of 1568 words allows the TMS320C26 to handle a data array of, for example, 1024 words with an on- chip program RAM of 512 words and additional 32 words of data RAM. When using internal blocks as program memory, instructions can be downloaded from external program memory into on-chip RAM and then executed. The TMS320C26 allows the DMOVfunction in all internal data memory blocks. An- FIR filter programmed with the MAC or MACO instructions can use the internal program RAM for storing the coefficients. 3-82 Architecture General Description of the TMS320C28 3.12 General Description of the TMS320C28 The TMS320C28 is the newest member of the TMS320C2x family. Like the TMS320C26, it is also processed in CMOS technology, is capable of 100-ns instruction cycle time, and is object code-compatible with the TMS320C25. The enhancements of the TMS320C28 over the TMS320C25 are the larger on-chip ROM (SK words) and a new powerdown mode. The TMS320C2S comes in an 80-pin QFP package that includes three new pins (PDT, PDACK, and WAKEUP) to support the powerdown feature. This mode decreases the current to about 100 µA compared with the 50-mA current in the TMS320C25 idle mode. See Appendix C for more details about the TMS320C2S power- down feature. The TMS320C2S has more on-chip memory (SK-word ROM and 544-word RAM) than the TMS320C26. The SK-word on-chip ROM re- duces system cost and allows large programs to execute at full speed from memory. The large internal memory and the powerdown feature of the TMS320C2S allow you to build a single-chip solution with all data and pro- grams internal, while conserving power. 3-83 3-84 Architecture Chapter 4 Assembly Language Instructions The TMS320C2x instruction set supports numeric-intensive signal processing operations as well as general-purpose applications, such as multiprocessing and high-speed control. TMS320C1x source code is upward-compatible with TMS320C2x source code. The TMS320C26 is similar to the TMS320C25 except for its internal memory configuration. This is discussed in Section 3.4 and in Appendix B. This chapter describes the assembly language instructions for the TMS320C2x microprocessor. Topics include: Topic Page 4-1 Memory Addressing Modes 4.1 Memory Addressing Modes The TMS320C2x instruction set provides three memory addressing modes: O Direct addressing mode O Indirect addressing mode O Immediate addressing mode Both direct and indirect addressing can be used to access data memory. Direct addressing concatenates seven bits of the instruction word with the nine bits of the data memory page pointer to form the 16-bit data memory address. Indi- rect addressing accesses data memory through the auxiliary registers. In im- mediate addressing, the data is based on a portion of the instruction word(s). The following sections describe each addressing mode and give the opcode formats and some examples for each mode. 4.1.1 Direct Addressing Mode In the direct memory addressing mode, the instruction word contains the lower seven bits of the data memory address (dma). This field is concatenated with the nine bits of the data memory page pointer (DP) register to form the full 16-bit data memory address. Thus, the DP register points to one of 512 pos- sible 128-word data memory pages, and the 7-bit address in the instruction points to the specific location within that data memory page. The DP register is loaded through the LOP (load data memory page pointer), LDPK (load data memory page pointer immediate), or LST (load status register STO) instruc- tions. Note: The data page pointer is not initialized by reset and is therefore undefined after powerup. The TMS320C2x development tools, however, utilize default values for many parameters, including the data page pointer. Because of this, programs that do not explicitly initialize the data page pointer may execute improperly, depending on whether they are executed on a TMS320C2x device or by using a development tool. Thus, it is critical that all programs initialize the data page pointer in software. 4-2 Assembly Language Instructions Memory Addressing Modes -------------------------:Wm~~:;::::i::0"!':>:::::0 :::::::::::::::::::ii~~:::o:<-~------ Figure 4-1 illustrates how the 16-bit data address is formed. Figure 4-1. Direct Addressing Block Diagram 9 7 LSBs From 1..-.1--+-- 7- Instruction Register (IA) 16 Direct addressing can be used with all instructions except CALL, the branch instructions, immediate operand instructions, and instructions with no oper- ands. The direct addressing format is as follows: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 0 Opcode dma Bits 15 through 8 contain the opcode. Bit 7 = 0 defines the addressing mode as direct, and bits 6 through O contain the data memory address (dma). Example of Direct Addressing Format: ADD9,5 Add to accumulator the contents of data memory location 9 left-shifted 5 bits. 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 lo o o o o 1 o 1 lol o o o o o 1 I The opcode of the ADD 9,5 instruction is OSh and appears in bits 15 through 8. The notation nnh indicates nn is a hexadecimal number. The shift count of Sh appears in bits 11 through 8 of the opcode. The data memory address 09h appears in bits 6 through 0. 4-3 Memory Addressing Modes 4.1.2 Indirect Addressing Mode The auxiliary registers (AR) provide flexible and powerful indirect addressing. Eight auxiliary registers (ARO-AR?) are provided on the TMS320C2x. To se- lect a specific auxiliary register, the auxiliary register pointer (ARP) is loaded with a value from Othrough 7 designating ARO through AR? (see Figure 4-2). Figure 4-2. Indirect Addressing Block Diagram 3 3 Auxiliary Registers 3 ARB (3) ARP (3) ARO {16) (ARP =2) 3 AR1 {16) AR2 (16) AR3 {16) AR4 (16) AR5 (16) AR6 {16) 16 AR7 (16) 16 16 ARAU (16) 16-Bit Data Address The contents of the auxiliary registers may be operated upon by the auxiliary register arithmetic unit (ARAU), which implements 16-bit unsigned arithmetic. The ARAU performs auxiliary register arithmetic operations in the same cycle as the execution of the instruction. (Note that the increment or decrement of the indicated AR is always executed after the use of that AR in the instruction.) In indirect addressing, any location in the 64K data memory space can be ac- cessed via the 16-bit addresses contained in the auxiliary registers. These can be loaded by the instructions LAR (load auxiliary register), LARK (load auxilia- ry register immediate), and LRLK (load auxiliary register long immediate). The auxiliary registers on the TMS320C2x can be modified by ADRK (add to auxil- iary register short immediate) or SBRK (subtract from auxiliary register short immediate). The TMS320C2x auxiliary registers can also be modified by the MAR (modify auxiliary register) instruction or, equivalently, by the indirect ad- dressing field of any instruction supporting indirect addressing. AR(ARP) de- notes the auxiliary register selected by ARP. 4-4 Assembly Language Instructions The following symbols are used in indirect addressing, including bit-reversed (BR) addressing: * Contents of AR(ARP) are used as the data memory ad- dress. *- Contents of AR(ARP) are used as the data memory ad- dress, then decremented after the access. *+ Contents of AR(ARP) are used as the data memory ad- dress, then incremented after the access. *0- Contents of AR(ARP) are used as the data memory ad- dress, and the contents of ARO subtracted from it after the access. *O+ Contents of AR(ARP) are used as the data memory ad- dress, and the contents of ARO added to it after the access. *BRO- Contents of AR(ARP) are used as the data memory ad- dress, and the contents of ARO subtracted from it, with re- verse carry (re) propagation, after the access. *BRO+ Contents of AR(ARP) are used as the data memory ad- dress, and the contents of ARO added to it, with reverse carry (re) propagation, after the access. There are two main types of indirect addressing with indexing: O Regular indirect addressing with increment or decrement, and O Indirect addressing with indexing based on the value of ARO: Indexing by adding or subtracting the contents of ARO, or Indexing by adding or subtracting the contents of ARO with the carry propagation reversed (for FFTs on the TMS320C2x}. In either case, the contents of the auxiliary register pointed to by the ARP regis- ter are used as the address of the data memory operand. Then, the ARAU per- forms the specified mathematical operation on the indicated auxiliary register. Additionally, the ARP may be loaded with a new value. All indexing operations are performed on the current auxiliary register in the same cycle as the original instruction. Indirect auxiliary register addressing allows for post-access adjustments of the auxiliary register pointed to by the ARP. The adjustment may be an increment or decrement by one, or it may be based upon the contents of ARO. Bit-reversed addressing modes on the TMS320C2x allow efficient 1/0 to be performed for the resequencing of data points in a radix-2 FFT program. The direction of carry propagation in the ARAU is reversed when this mode is se- lected and ARO is added to/subtracted from the current auxiliary register. Typi- cal use of this addressing mode requires that ARO first be set to a value corre- 4-5 Memory Addressing Modes sponding to one-half of the array size, and AR (ARP) be set to the base address of the data (the first data point). See subsection 5.7.4for an FFTexample using bit-reversed addressing modes. Indirect addressing can be used with all instructions except immediate oper- and instructions and instructions with no operands. The indirect addressing format is as follows: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 Opcode II I I I I 1 IDV INC DEC NAR y Bits 15 through 8 contain the opcode, and bit 7 = 1 defines the addressing mode as indirect. Bits 6 through 0 contain the indirect addressing control bits. Bit 6 contains the increment/decrement value (IDV). The IDV determines whether ARO will be used to increment or decrement the current auxiliary reg- ister. If bit 6 = O, an increment or decrement (if any) by one occurs to the current auxiliary register. If bit 6 = 1, ARO may be added to or subtracted from the cur- rent auxiliary register as defined by bits 5 and 4. Bits 5 and 4 control the arithmetic operation to be performed with AR(ARP) and ARO. When set, bit 5 indicates that an increment is to be performed. If bit 4 is set, a decrement is to be performed. Table 4-1 shows the correspondence of bit pattern and arithmetic operation. Table 4-1. Indirect Addressing Arithmetic Operations Bits Arithmetic Operation 6 5 4 0 0 0 No operation on AR(ARP) 0 0 1 AR(ARP) -1 -+ AR(ARP) 0 1 0 AR(ARP) + 1 -+ AR(ARP) 0 1 1 Reserved 1 0 0 AR(ARP) -ARO-+ AR(ARP) [reverse carry propagation] 1 0 1 AR(ARP) -ARO -+ AR(ARP) 1 1 0 AR(ARP) +ARO-+ AR(ARP) 1 1 1 AR(ARP) +ARO-+ AR(ARP) [reverse carry propagation] Bit 3 and bits 2 through O control the auxiliary register pointer (ARP). Bit 3 (NAR) determines if a new value is loaded into the ARP. If bit 3 = 1, the contents of bits 2 through O\'( = next ARP) are loaded into the ARP. If bit 3 = 0, the con- tents of the ARP remain unchanged. 4-6 Assembly Language Instructions Memory Addressing Modes Table 4-2 shows the bit fields, notation, and operation used for indirect ad- dressing. For some instructions, the notation in Table 4-2 includes a shift code: for example, *0+,8,3 where 8 is the shift code and Y =3. Table 4-2. Bit Fields for Indirect Addressing Instruction Fleld Bits Notation Operation 15 - 8765432 1 0 +-Opcode-1 o o o o .... y ..... * No manipulation of ARs/ARP +-Opcode-1 o o o 1 .... y ..... *,Y Y-ARP +-Opcode-1 O o 1 O .... y ..... *- AR(ARP)-1 -AR(ARP) -opcode-1 o o 1 1 .... y ..... *-,Y AR(ARP)-1 ..... AR(ARP) Y ..... ARP .... Opcode -1 o 1 o o .... Y ..... *+ AR(ARP) +1 ..... AR(ARP) .... Opcode --1 0101-v-- *+,Y AR(ARP)+1 ..... AR(ARP) Y ..... ARP +-Opcode --.1 1000-v-- *BRO- AR(ARP)-rcARO ..... AR(ARP) .... Opcode --1 1001-v-- *BRO-,Y AR(ARP)-rcARO ..... AR(ARP) Y--.ARP +-Opcode --.1 1 0 1 0 .... y ..... *0- AR(ARP)-ARO ..... AR(ARP) +-Opcode --1 1 0 1 1 .... y ..... *0-,Y AR(ARP)-ARO ..... AR(ARP) Y--.RP +-Opcode --.1 1 1 0 0 .... y ..... *O+ AR(ARP)+ARO ..... AR(ARP) +-Opcode ..... 1 1 1 0 1 .... y ..... *O+,Y AR(ARP)+ARO ..... AR(ARP) Y--.ARP +-Opcode --1 1 1 1 0 .... y ..... *BRO+ AR(ARP)+rcARO ..... AR(ARP) +-Opcode --.1 1 1 1 1 .... y ..... *BRO+,Y AR(ARP)+rcARO ..... AR(ARP) Y--.ARP The CMPR (compare auxiliary register with ARO), and BBZ/BBNZ (branch if TC bit equal/not equal to zero) instructions facilitate conditional branches based on comparisons between the contents of ARO and the contents of AR(ARP). The auxiliary registers may also be used for temporary storage via the load and store auxiliary register instructions, LAR and SAR, respectively. 4-7 Memory Addressing Modes The following examples illustrate the indirect addressing format: Example 1 ADD *+,8 Add to the accumulator the contents of the data memory address defined by the contents of the current auxiliary register. This data is left-shifted 8 bits before being added. The cur- rent auxiliary register is autoincremented by one. The opcode is OSAOh, as shown below. 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 Ia a a a o o o o al Example 2 ADD *,8 As in Example 1 , but with no autoincrement; the opcode is 0880h. Example 3 ADD *-,8 As in Example 1, except that the current auxiliary register is decremented by one; the opcode is 0890h. Example 4 ADD *0+,8 As in Example 1, except that the contents of auxil- iary register ARO are added to the current auxiliary register; the op- code is OSEOh. Example 5 ADD *0-,8 As in Example 1 , except that the contents of auxil- iary register ARO are subtracted from the current auxiliary register; the opcode is OSDOh. Example 6 ADD *+,8,3 As in Example 1 , except that the auxiliary register pointer (ARP) is loaded with the value 3 for subsequent instruc- tions;the opcode is 08ABh. Example 7 ADD *BR0-,8 The contents of auxiliary register ARO are sub- tracted from the current auxiliary register with reverse carry propa- gation; the opcode is OSCOh. Example B ADD *BR0+,8 The contents of auxiliary register ARO are added to the current auxiliary register with reverse carry propagation; the opcode is OSFOh. 4.1.3 Immediate Addressing Mode In immediate addressing, the instruction word(s) contains the value of the im- mediate operand. The TMS320C2x has both single-word (8-bit and 13-bit constant) short immediate instructions and two-word (16-bit constant) long im- mediate instructions. The immediate operand is contained within the instruc- tion word itself in short immediate instructions. In long immediate instructions, the word following the instruction opcode is used as the immediate operand. The following short immediate instructions contain the immediate operand in the instruction word and execute within a single instruction cycle. The length of the constant operand is instruction-dependent. 4-8 Assembly Language Instructions ADDK Add to accumulator short immediate (8-bit absolute constant) ADRK Add to auxiliary register short immediate (8-bit absolute constant) LACK Load accumulator short immediate (8-bit absolute constant) LARK Load auxiliary register short immediate (8-bit absolute constant) LARP Load auxiliary register pointer (3-bit constant) LDPK Load data memory page pointer immediate (9-bit constant) MPYK Multiply immediate (13-bit 2s-complement constant) RPTK Repeat instruction as specified by immediate value (8-bit constant) SBRK Subtract from auxiliary register short immediate (8-bit absolute constant) SUBK Subtract from accumulator short immediate (8-bit absolute constant). Example of short immediate addressing format: RPTK 99 Execute the instruction following this instruction 100 times. With the RPTK instruction, the immediate operand is contained as a part of the instruction opcode. The instruction format for RPTK is as follows: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 0 0 0 0 8-Bit Constant For long immediate instructions, the constant is a 16-bit value in the word fol- lowing the opcode. The 16-bit value can be optionally used as an absolute constant or as a 2s-complement value. ADLK Add to accumulator long immediate with shift (absolute or 2s complement) ANDK AND immediate with accumulator with shift LALK Load accumulator long immediate with shift (absolute or 2s complement) LRLK Load auxiliary register long immediate ORK OR immediate with accumulator with shift SBLK Subtract from accumulator long immediate with shift (ab- solute or 2s complement) XORK Exclusive-OR immediate with accumulator with shift. 4-9 Memory Addressing Modes Example of long immediate addressing format: ADLK 16384,2 Add to the accumulator the value 16384 with a shift to the left of two, effectively adding 65536 to the contents of the accumulator. The ADLK instruction uses the word following the instruction opcode as the immediate operand. The instruction format for ADLK is as follows: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0 Shift I 0 0 0 0 0 0 1 1• 16-Bit Constant 4-10 Assembly Language Instructions Instruction Set 4.2 Instruction Set The following sections list the symbols and abbreviations used in the instruc- tion set summary and in the instruction descriptions. The complete instruction set summary is organized according to function. A detailed description of each instruction is listed in the instruction set summary. 4.2.1 Symbols and Abbreviations Table ~lists symbols and abbreviations used in the instruction set summary (in Table 4-4} and the individual instruction descriptions. 4-11 Instruction Set Table 4-3. Instruction Symbols Symbol Meaning A Port address ACC Accumulator ARB Auxiliary register pointer buffer ARn Auxiliary register n (ARO, AR1 assembler symbols equal to Oor 1) ARP Auxiliary register pointer B 4-bit field specifying a bit code BIO Branch control input c Carry bit CM 2-bit field specifying compare mode CNF On-chip RAM configuration control bit D Data memory address field DATn Label assigned to data memory location n dma Data memory address DP Data page pointer FO Format status bit FSM Frame synchronization mode bit HM Hold mode bit INTM Interrupt mode flag bit K Immediate operand field M Addressing mode bit MCS Microcall stack nnh nnh = hexadecimal number (others are decimal values) ov Overflow mode flag bit OVM Overflow mode bit p Product register PA Port address (PAO-PA15 assembler symbols equal to 0 through 15) PC Program counter PFC Prefetch counter PM 2-bit field specifying P register output shift code pma Program memory address PRGn Label assigned to program memory location n R 3-bit operand field specifying auxiliary register RPTC Repeat counter s 4-bit left-shift code STn Status register n (STO or ST1) SXM Sign-extension mode bit T Temporary register TC Test control bit TOS Top of stack TXM Transmit mode bit x 3-bit accumulator left-shift field XF XF pin status bit 4-12 Assembly Language Instructions Instruction Set Table 4-3. Instruction Symbols (Continued) Symbol Meaning -11 italics Is assigned to An absolute value User-defined items [l Optional items () Contents of {} Alternative items, one of which must be entered Blanks or spaces must be entered where shown. 4.2.2 Instruction Set Summary Table 4-4 shows the instruction set summary for the TMS320C2x processor, which is a superset of the TMS320C1x instruction set. Included in the instruc- tion set are four special groups of instructions to improve overall processor throughput and ease of use. 0 Extended-precision arithmetic (ADDC, SUBS, MPYU, BC, BNC, SC, and RC) 0 Adaptive filtering (MPYA, MPYS, and ZALR) 0 Control and 1/0 (RHM, SHM, RTC, STC, RFSM, and SFSM) 0 Accumulator and register (SPH, SPL, ADDK, SUBK, ADRK, SBRK, ROL, and ROR). The instruction set summary is arranged according to function and alphabet- ized within each functional grouping. Additional information is presented in the individual instruction descriptions in the following section. 4-13 Instruction Set Table 4-4. Instruction Set Summary ACCUMULATOR MEMORY REFERENCE INSTRUCTIONS Mnemonic and Description Words 16-Blt Opcode MSB LSB ABS Absolute value of accumulator 1 1100 1110 0001 1011 ADD Add to accumulator with shift 1 0000 ssss MDDD DODD ADDC Add to accumulator with carry 1 0100 0011 MDDD DODD ADDH Add to high accumulator 1 0100 1000 MDDD DODD ADDK Add to accumulator short immediate 1 1100 1100 KKKK KKKK ADDS Add to low accumulator with sign-extension suppressed 1 0100 1001 MDDD DODD ADDT Add to accumulator with shift specified by T register 1 0100 1010 MDDD DODD ADLK Add to accumulator long immediate with shift 2 1101 ssss 0000 0010 AND AND with accumulator 1 0100 1110 MDDD DODD ANDK AND immediate with accumulator with shift 2 1101 ssss 0000 0100 CMPL Complement accumulator 1 1100 1110 0010 0111 LAC Load accumulator with shift 1 0010 ssss MDDD DODD LACK Load accumulator short immediate 1 1100 1010 KKKK KKKK LACT Load accumulator with shift specified by T register 1 0100 0010 MDDD DODD LALK Load accumulator long immediate with shift 2 1101 ssss 0000 0001 NEG Negate accumulator 1 1100 1110 0010 0011 NORM Normalize contents of accumulator 1 1100 1110 1010 0010 OR OR with accumulator 1 0100 1101 MDDD DODD ORK OR immediate with accumulator with shift 2 1101 ssss 0000 0101 ROL Rotate accumulator left 1 1100 1110 0011 0100 ROA Rotate accumulator right 1 1100 1110 0011 0101 SAC Store high accumulator with shift 1 0110 lXXX MDDD DODD SACL Store low accumulator with shift 1 0110 oxxx MDDD DODD SBLK Subtract from accumulator long immediate with shift 2 1101 ssss 0000 0011 SFL Shift accumulator left 1 1100 1110 0001 1000 SFR Shift accumulator right 1 1100 1110 0001 1001 SUB Subtract from accumulator with shift 1 0001 ssss MDDD DODD SUBB Subtract from accumulator with borrow 1 0100 1111 MDDD DDDD SUBC Conditional subtract 1 0100 0111 MDDD DDDD SUBH Subtract from high accumulator 1 0100 0100 MDDD DODD SUBK Subtract from accumulator short immediate 1 1100 1101 KKKK KKKK SUBS Subtract from low accumulator with sign extension 0100 0101 MDDD DODD suppressed SUBT Subtract from accumulator with shift specified by 1 0100 0110 MDDD DODD T register XOR Exclusive-OR with accumulator 1 0100 1100 MDDD DODD XORK Exclusive-OR immediate with accumulator with 2 1101 ssss 0000 0110 shift ZAC Zero accumulator 1 1100 1010 0000 0000 ZALH Zero low accumulator and load high accumulator 1 0100 0000 MDDD DODD ZALR Zero low accumulator and load high accumulator 1 0111 1011 MDDD DODD with rounding ZALS Zero accumulator and load low accumulator with 1 0100 0001 MDDD DDDD sign extension suppressed 4-14 Assembly Language Instructions Instruction Set Table 4-4. Instruction Set Summary (Continued) AUXILIARY REGISTERS AND DATA PAGE POINTER INSTRUCTIONS Mnemonic and Description Words 16-Blt Opcode MSB LSB ADRK Add to auxiliary register short immediate 1 0111 1110 KKKK KKKK CMPR Compare auxiliary register with auxiliary 1 1100 1110 0101 OOKK register ARO LAA Load auxiliary register 1 0011 ORRR MDDD DDDD LARK Load auxiliary register short immediate 1 1100 ORRR KKKK KKKK LARP Load auxiliary register pointer 1 0101 0101 1000 lRRR LOP Load data memory page pointer 1 0101 0010 MDDD DDDD LDPK Load data memory page pointer immediate 1 1100 lOOK KKKK KKKK LRLK Load auxiliary register long immediate 2 1101 ORRR 0000 0000 MAR Modify auxiliary register 1 0101 0101 MDDD DDDD SAR Store auxiliary register 1 0111 ORRR MDDD DDDD SBRK Subtract from auxiliary register short immediate 1 0111 1111 KKKK KKKK T REGISTER, P REGISTER, AND MULTIPLY INSTRUCTIONS Mnemonic and Description Words 16-Bit Opcode MSB LSB APAC Add P register to accumulator 1 1100 1110 0001 0101 LPH Load high P register 1 0101 0011 MDDD DDDD LT Load T register 1 0011 1100 MDDD DDDD LTA Load T register and accumulate previous product 1 0011 1101 MDDD DDDD LTD Load T register, accumulate previous product and 1 0011 1111 MDDD DDDD move data LTP Load T register and store P register in accumulator 1 0011 1110 MDDD DDDD LTS Load T register and subtract previous product 1 0101 1011 MDDD DDDD MAC Multiply and accumulate 2 0101 1101 MDDD DDDD MACO Multiply and accumulate with data move 2 0101 1100 MDDD DDDD MPY Multiply (with T register, store product in P register) 1 0011 1000 MDDD DDDD MPYA Multiply and accumulate previous product 1 0011 1010 MDDD DDDD MPYK Multiply immediate 1 101K KKKK KKKK KKKK MPYS Multiply and subtract previous product 1 0011 1011 MDDD DDDD MPYU Multiply unsigned 1 1100 1111 MDDD DDDD PAC Load accumulator with P register 1 1100 1110 0001 0100 SPAC Subtract P register from accumulator 1 1100 1110 0001 0110 SPH Store high P register 1 0111 1101 MDDD DDDD SPL Store low P register 1 0111 1100 MDDD DDDD SPM Set P register output shift mode 1 1100 1110 0000 lOKK SORA Square and accumulate 1 0011 1001 MDDD DDDD SQRS Square and subtract previous product 1 0101 1010 MDDD DDDD 4-15 Instruction Set Table 4-4. Instruction Set Summary (Continued) BRANCH/CALL INSTRUCTIONS Mnemonic and Description Words 16-Bit Opcode MSB LSB 1/0 AND DATA MEMORY OPERATIONS B Branch unconditionally 2 1111 1111 lDDD DDDD BACC Branch to address specified by accumulator 1 1100 1110 0010 0101 BANZ Branch on auxiliary register not zero 2 1111 1011 lDDD DDDD BBNZ Branch if TC bit ,. O 2 1111 1001 lDDD DDDD BBZ Branch if TC bit = O 2 1111 1000 lDDD DDDD BC Branch on carry 2 0101 1110 lDDD DDDD BGEZ Branch if accumulator ,. 0 2 1111 0100 lDDD DDDD BGZ Branch if accumulator > 0 2 1111 0001 lDDD DDDD BIOZ Branch on 1/0 status = 0 2 1111 1010 lDDD DDDD BLEZ Branch if accumulator s O 2 1111 0010 lDDD DODD BLZ Branch if accumulator < 0 2 1111 0011 lDDD DDDD BNC Branch on no carry 2 0101 1111 lDDD DDDD BNV Branch if no overflow 2 1111 0111 lDDD DDDD BNZ Branch if accumulator ,. 0 2 1111 0101 lDDD DDDD BV Branch on overflow 2 1111 0000 lDDD DDDD BZ Branch if accumulator= 0 2 1111 0110 lDDD DDDD CALA Call subroutine indirect 1 1100 1110 0010 0100 CALL Call subroutine 2 1111 1110 lDDD DDDD RET Return from subroutine 1 1100 1110 0010 0110 TRAP Software interrupt 1 1100 1110 0001 1110 1/0 AND DATA MEMORY OPERATIONS Mnemonic and Description Words 16-Blt Opcode MSB LSB BLKD Block move from data memory to data memory 2 1111 1101 MDDD DDDD BLKP Block move from program memory to data memory 2 1111 1100 MDDD DDDD DMOV Data move in data memory 1 0101 0110 MDDD DDDD FORT Format serial port registers 1 1100 1110 0000 lllK IN Input data from port 1 1000 AAAA MDDD DDDD OUT Output data to port 1 1110 AAAA MDDD DDDD RFSM Reset serial port frame synchronization mode 1 1100 1110 0011 0110 RTXM Reset serial port transmit mode 1 1100 1110 0010 0000 RXF Reset external flag 1 1100 1110 0000 1100 SFSM Set serial port frame synchronization mode 1 1100 1110 0011 0111 STXM Set serial port transmit mode 1 1100 1110 0010 0001 SXF Set external flag 1 1100 1110 0000 1101 TBLR Table read 1 0100 1000 MDDD DDDD TBLW Table write 1 0101 1001 MDDD DDDD 4-16 Assembly Language Instructions Instruction Set Table 4-4. Instruction Set Summary (Continued) CONTROL INSTRUCTIONS Mnemonic and Description Words 16-Blt Opcode MSB LSB BIT Test bit 1 1001 BBBB MDDD DDDD SITT Test bit specified by T register 1 0101 0111 MDDD DDDD CNFDt Configure block as data memory 1 1100 1110 0000 0100 CNFPt Configure block as program memory 1 1100 1110 0000 0101 CON Ft Configure block as data/program memory 1 1100 1110 0011 llKK DINT Disable interrupt 1 1100 1110 0000 0001 EINT Enable interrupt 1 1100 1110 0000 0000 IDLE Idle until interrupt 1 1100 1110 0001 1111 LST Load status register STO 1 0101 0000 MDDD DDDD LST1 Load status register ST1 1 0101 0001 MDDD DDDD NOP No operation 1 0101 0101 0000 0000 POP Pop top of stack to low accumulator 1 1100 1110 0001 1101 POPD Pop top of stack to data memory 1 0111 1010 MDDD DDDD PSHD Push data memory value onto stack 1 0101 0100 MDDD DDDD PUSH Push low accumulator onto stack 1 1100 1110 0001 1100 RC Reset carry bit 1 1100 1110 0011 0000 RHM Reset hold mode 1 1100 1110 0011 1000 ROVM Reset overflow mode 1 1100 1110 0000 0010 RPT Repeat instruction as specified by data memory 1 0100 1011 MDDD DDDD value RPTK Repeat instruction as specified by immediate value 1 1100 1011 KKKK KKKK RSXM Reset sign-extension mode 1 1100 1110 0000 OllO RTC Reset test/control flag 1 1100 1110 0011 0010 SC Set carry bit 1 1100 1110 0011 0001 SHM Set hold mode 1 1100 1110 0011 1001 SOVM Set overflow mode 1 1100 1110 0000 0011 SST Store status register STO 1 0111 1000 MDDD DDDD SST1 Store status register ST1 1 0111 1001 MDDD DDDD SSXM Set sign-extension mode 1 1100 1110 0000 0111 STC Set test/control flag 1 1100 1110 0011 0011 t The CONF instruction is specific to the TMS320C26 instruction set; the instructions CNFD and CNFP are undefined. 4-17 Individual Instruction Descriptions 4.3 Individual Instruction Descriptions Each instruction in the instruction set summary is described in the following pages. Instructions are listed in alphabetical order. Information, such as as- sembler syntax, operands, operation, encoding, description, words, cycles, and examples, is provided for each instruction. An example instruction is pro- vided to familiarize you with the special format used and to explain its content. Refer to Section 4.1 for further information on memory addressing. Code ex- amples using many of the instructions are given in Chapter 5, Software Applications. 4-18 Assembly Language Instructions Syntax Direct: [ label] EXAMPLE dma [, shift] Indirect: [label] EXAMPLE {ind} [, shift [ next ARP]] Immediate: [label] EXAMPLE [constant] Each instruction begins with an assembler syntax expression. The optional comment field that concludes the syntax is not included in the syntax expres- sion. Space(s) are required between each field ( label, command, operand, and comment fields) as shown in the syntax. The syntax example illustrates both direct and indirect addressing, as well as immediate addressing in which the operand field includes constant. The indirect addressing operand options, including bit-reversed (BR) addres- sing, are as follows: TMS320C25: { * I * + I * - I * 0 + I * 0 - I * BRO + I * BRO -} Operands Os dma s 127 0 s next ARP s 7 O s constant s 255 Operands may be constants or assembly-time expressions referring to memory, 1/0 and register addresses, pointers, shift counts, and a variety of constants. The operand values used in the example syntax are shown. Execution (PC)+ 1 --+PC (ACC) + [(dma) x 2 shift] --+ ACC If SXM = 1: Then (dma) is sign-extended. If SXM = 0: Then (dma) is not sign-extended. Affects OV; affected by OVM and SXM. Affects C. 4-19 An example of the instruction operation sequence is provided, describing the processing that takes place when the instruction is executed. Conditional ef- fects of status register specified modes are also given. Those bits in the TMS320C2x status registers affected by the instruction are also listed. Encoding 15 14 13 12 11 10 9 8 7 6 5 4 3 2 0 Direct: I 0 0 0 0 I shift II 0 Data Memory Address Indirect: I 0 0 0 0 shift II See Section 4.1 Immediate: I 0 0 13-Bit Constant Opcode examples are shown of both direct and indirect addressing or of the use of an immediate operand. Description Instruction execution and its effect on the rest of the processor or memory con- tents are described. Any constraints on the operands imposed by the proces- sor or the assembler are discussed. The description parallels and supple- ments the information given by the execution block. Words The digit specifies the number of memory words required to store the instruc- tion and its extension words. Cycles Cycle Timings for a Single Instruction Pl/DI Pl/DE PE/DI PE/DE PR/DI PR/DE 1 1 1+p 1+p 1 1 Cycle Timings for a Repeat Execution n n n+p n+p n n The table shows the number of cycles required for a given TMS320C2x instruction to execute in a given memory configuration when executed as a single instruction or in the repeat mode. The column headings in the tables in- dicate the program source location (Pl, PE, or PR) and data destination or source (DI or DE), defined as follows: 4-20 Assembly Language Instructions Pl The instruction executes from internal program memory (RAM). PR The instruction executes from internal program memory (ROM). PE The instruction executes from external program memory. DI The instruction executes using internal data memory. DE The instruction executes using external data memory. The number of cycles required for each instruction is given in terms of the pro- gram/data memory and 1/0 access times as defined in the following listing: p Program memory wait states. Represents the number of clock cycles the device waits for external program memory to respond to an ac- cess. Tac is the access time, in nanoseconds, (maximum) required by the TMS320C2x for an external memory access to be made with no wait states. T mem is the memory device access time, and T P is the clock period (4/crystal frequency). p =0; If T mem s Tac p =1; If Tac< Tmem s (Tp +Tac) p = 2; If (Tp +Tad < T mem s (Tp x 2 +Tad p = k; If [Tp x (k-1) + Tacl < T mem s (Tp x k + Tad d Data memory wait states. Represents the number of cycles the device must wait for external data memory to respond to an access. Thi~ number is calculated in the same way as the p number. 1/0 memory wait states. Represents the number of cycles the device must wait for external 1/0 memory to respond to an access. This num- ber is calculated in the same way as the p number. Other abbreviations used in the tables and their meanings are as follows: br Branch from ... int Internal program memory. INT Interrupt. ext External program memory. n The number of times an instruction is executed when using the RPT or RPTK instruction. Refer to Appendix E for further information on instruction cycle classifications and timings. 4-21 EXAMPLE Example Instructions Example ADD DATl,3 ; (DP = 10) or ADD *,3 ;If current auxiliary register contains 1281. Before Instruction After Instruction Data Memory 12S1 I Sh Data Memory 12S1 I Sh I ACC 01 2h ACC GI 42h I c c The sample code presented in the above format shows the effect of the code on memory and/or registers. The use of the carry bit (C) provided on the TMS320C25 is shown in the small box. 4-22 Assembly Language Instructions ABS Absolute Value of Accumulator Example ABS Before Instruction After Instruction ACC 01 1234h I ACC GI 1234h I c c ACC 01 OFFFFFFFFh I ACC GI 1h I c c 4-24 Assembly Language Instructions Syntax Direct: [label] ADD dma[, shift] Indirect: [label] ADD {ind} [, shift [, next ARP]] Operands Os dma:s 127 0 :s next ARP :s 7 O :s shift :s 15 (defaults to 0) Execution (PC)+ 1-+ PC (ACC) + [(dma) x 2 shift] -+ ACC If SXM = 1: Then (dma) is sign-extended. If SXM = O: Then (dma) is not sign-extended. Affects OV; affected by OVM and SXM. Affects C. Encoding 15 14 13 12 11 10 9 8 7 6 5 4 3 2 0 Direct:! o 0 0 0I shift II 0 Data Memory Address Indirect: Io 0 0 oI shift II 1 See Section 4.1 Description The contents of the addressed data memory location are left- shifted and add- ed to the accumulator. During shifting, low-order bits are zero-filled. High-order bits are sign-extended if SXM =1 and zero-filled if SXM = 0. The result is stored in the accumulator. Words Cycles Cycle Timings for a Single Instruction Pl/DI Pl/DE PE/DI PE/DE PR/DI PR/DE 1 2+d 1+p 2+d+p 1 2+d Cycle Timings for a Repeat Execution n 1+n+nd n+p 1+n+nd+p n 1+n+nd 4-25 ADD Add to Accumulator With Shift Example ADD DATl,3 ; (DP = 10) or ADD *,3 ;If current auxiliary register contains 1281. Before Instruction After Instruction Data Memory 1281 I Sh Data Memory 1281 I Sh I ACC 01 2h ACC GI 42h I c c 4-26 Assembly Language Instructions Add to Accumulator With Carry ADDC Syntax Direct: [label] ADDC dma Indirect: [label] ADDC {ind} [, next ARP] Operands O :s: dma:s:127 0 :s: next ARP :s: 7 Execution {PC)+ 1 ... PC {ACC) + {dma) + {C) - ACC Affects OV and C; affected by OVM. Encoding 15 14 13 12 11 10 9 8 7 6 5 4 3 2 0 Direct: I 0 0 0 0 0 0 II 0 Data Memory Address Indirect: I 0 0 0 0 0 II 1 See Section 4.1 Description The contents of the addressed data memory location and the value of the carry bit are added to the accumulator. The carry bit is then affected in the normal manner. The ADDC instruction can be used in performing multiple-precision arithmetic. Words 1 Cycles Cycle Timings for a Slngle Instruction Pl/DI Pl/DE PE/DI PE/DE PR/DI PR/DE 1 2+d 1+p 2+d+p 1 2+d Cycle Timings for a Repeat Execution n 1+n+nd n+p 1+n+nd+p n 1+n+nd Example 1 ADDC OATS ; (DP = 8) or ADDC * ;If current auxiliary register contains 1029. Before Instruction After Instruction Data Memory 1029 I 4h Data Memory 1029 I 4h I ACC El I 13h ACC 01c 18h I c 4-27 ADDC Add to Accumulator With Car'.X. Example2 ADDC OATS ; (DP = 8) or ADDC * ;If current auxiliary register contains 1029. Before Instruction After Instruction Data Data Memory Oh Memory 1029 1029 ACC (2] ._I_ _o_F_FF_F_F_F_F_F_h_, Ace 0 .I. ____oh_,I c c 4-28 Assembly Language Instructions Add to High Accumulator ADDH Syntax Direct: [label] ADDH dma Indirect: [label] ADDH {ind} [, next ARP] Operands Os dma s 127 0 s next ARP s 7 Execution (PC)+ 1 -. PC (ACC) + [(dma) x 2 101 -Ace Affects OV; affected by OVM. Affects C. Low-order bits of the ACC not affected. Encoding 15 14 13 12 11 10 9 8 7 6 5 4 3 2 0 Direct:! o 0 0 0 0 0 II 0 Data Memory Address Indirect: I o 0 0 0 0 0 II 1 See Section 4.1 Description The contents of the addressed data memory location are added to the upper half of the accumulator (bits 31 through 16). Low-order bits are unaffected by ADDH. The carry bit (C) on the TMS320C2x is set if the result of the addition generates a carry; otherwise, C is unaffected. The carry bit can only be set, not reset, by the ADDH instruction. The ADDH instruction may be used in performing 32-bit arithmetic. Words 1 Cycles Cycle Timings for a Single Instruction Pl/DI Pl/DE PE/DI PE/DE PR/DI PR/DE 1 2+d 1+p 2+d+p 1 2+d Cycle Timings for a Repeat Execution n 1+n+nd n+p 1+n+nd+p n 1+n+nd 4-29 ADDH Add to Hig,h Accumulator Example ADDH OATS HDP = 8) or ADDH * i i f current auxiliary register contains 1029. Before Instruction After Instruction Data Memory 1029 I 4h Data Memory 1029 I 4h I ACC l2J I 13h ACC [2] I 40013h I c c 4-30 Assembly Language Instructions Add to Accumulator Short Immediate ADDK Syntax [label] ADDK constant Operands O :s; constant :s; 255 Execution (PC)+ 1 - PC (ACC) + 8-bit positive constant - ACC Affects OVM and C; affected by OVM. Not affected by SXM. Encoding 15 14 13 12 11 10 9 8 7 6 5 4 3 2 0 0 0 0 0 8-Bit constant Description The 8-bit immediate value is added, right-justified, to the accumulator with the result replacing the accumulator contents. The immediate value is treated as an 8-bit positive number, regardless of the value of SXM. Words Cycles Cycle Timings for a Single Instruction . Pl/DI Pl/DE PE/DI PE/DE PR/DI PR/DE 1 1 1+p 1+p 1 1 Cycle Timings for a Repeat Execution not repeatable Example ADDK Sh Before Instruction After Instruction ACC G.I.___ 1s_e_2E_1_h__.. Ace GI..____1s_e_2E_eh~' c c 4-31 ADDS Add to Accumulator With Sign-Extension sueeressed Syntax Direct: [ label] ADDS dma Indirect: [label] ADDS {ind}[, next ARP] Operands 0 s dmas127 0 s next ARP s 7 Execution (PC)+ 1 ... PC (ACC) + (dma) - ACC (dma) is a 16-bit unsigned number. Affects OV; affected by OVM. Affects C. Not affected by SXM. Encoding 15 14 13 12 11 10 9 8 7 6 5 4 3 2 0 Direct:! o 0 0 0 0 1 II 0 Data Memory Address I Indirect: 0 0 0 0 0 1 II 1 See Section 4.1 Description The contents of the specified data memory location are added with sign-exten- sion suppressed. The data is treated as a 16-bit unsigned number, regardless of SXM. The accumulator behaves as a signed number. Note that ADDS pro- duces the same results as an ADD instruction with SXM = 0 and a shift count of 0. Words 1 Cycles Cycle Timings for a Slngle Instruction Pl/DI Pl/DE PE/DI PE/DE PR/DI PR/DE 1 2+d 1+p 2+d+p 1 2+d Cycle Timings for a Repeat Execution n 1+n+nd n+p 1+n+nd+p n 1+n+nd 4-32 Assembly Language Instructions Add to Accumulator With Sig_,n-Extension Sue,e,ressed ADDS Example ADDS DATU ; (DP = 6) or ADDS * ;If current auxiliary register contains 779. Before Instruction After Instruction Data Memory 779 I OF006h Data Memory 779 I OF006h I ACC 01 3h ACC GI OF009h I c c 4-33 ADDT Add to Accumulator With Shift se,ecirf!d by T !Jegist~---'""""""''"'""''"""'"""""'"'""""""""""""""""""-""'"'""""""""""""""""""" Syntax Direct: [label] ADDT dma Indirect: [label] ADDT {ind}[, next ARP] Operands O :s: dma :s: 127 0 :s: next ARP :s: 7 Execution (PC)+ 1 .... PC (ACC) + [(dma) x 2T register(3-0)] _ (ACC) If SXM 1: = Then (dma) is sign-extended. If SXM = O: Then (dma) is not sign-extended. Affects OV; affected by SXM and OVM. Affects C. Encoding 15 14 13 12 11 10 9 8 7 6 5 4 3 2 0 Direct: I 0 0 0 0 1 0 II0 Data Memory Address Indirect: I 0 0 0 0 1 0 II1 See Section 4.1 Description The data memory value is left- shifted and added to the accumulator, with the result replacing the accumulator contents. The left- shift is defined by the four LSBs of the T register, resulting in shift options from Oto 15 bits. Sign extension on the data memory value is controlled by SXM. Words Cycles Cycle Timings for a Single Instruction Pl/DI Pl/DE PE/DI PE/DE PR/DI PR/DE 1 2+d 1+p 2+d+p 1 2+d ~• I T I f,... C.o"'.o. t v ,.. .. n 1+n+nd n+p 1+n+nd+p n 1+n+nd 4-34 Assembly Language Instructions Add to Accumulator With Shift seecified bl;'. T Register ADDT Example ADDT DAT127 ; (DP == 4) or ADDT * ;If current auxiliary register contains 639. Before Instruction After Instruction Data Memory 639 9h Data Memory 639 9h I T I OFF94h T I OFF94h I ACC GI OF715h ACC GI OF7A5h I c c 4-35 ADLK Add to Accumulator Long Immediate With Shift Syntax [label] ADLK constant[, shift] Operands 16-bit constant O :s: shift :s: 15 (defaults to O) Execution (PC)+ 2 .... PC (ACC) + [ constant x 2 shift] --+ ACC If SXM = 1: Then -32768 :s: constant :s: 32767. If SXM =O: Then O:s: constant :s: 65535. Affects OV; affected by OVM and SXM. Affects C. Encoding 15 14 13 12 11 10 9 8 7 6 5 4 3 2 0 Io o o o o o I' 0 shift 16-Bit Constant Description The 16-bit immediate value, left- shifted as specified, is added to the accumu- lator. The result replaces the accumulator contents. SXM determines whether the constant is treated as a signed 2s-complement number or as an unsigned number. The shift count is optional and defaults to zero. Words 2 Cycles Cycle Timings for a Single Instruction Pl/DI Pl/DE PE/DI PE/DE PR/DI PR/DE 2 2 2+2p 2+2p 2 2 Cycle Timings for a Repeat Execution not repeatable Example ADLK 5,8 Before Instruction After Instruction ACC 01 10EFh ACC GI 15EFh I c c 4-36 Assembly Language Instructions Syntax [label) ADRK constant Operands 0 s constant s 255 Execution (PC)+ 1 - PC AR(ARP) + 8-bit positive constant - AR(ARP) Encoding 15 14 13 12 11 10 9 8 7 6 5 4 3 2 0 Direct: I O o I 8-Bit constant Description The 8-bit immediate value is added, right-justified, to the currently selected auxiliary register with the result replacing the auxiliary register contents. The addition takes place in the ARAU, with the immediate value treated as an 8-bit positive integer. Words Cycles Cycle Timings for a Single Instruction Pl/DI Pl/DE PE/DI PE/DE PR/DI PR/DE 1 1 1+p 1+p 1 1 Cycle Timings for a Repeat Execution not repeatable Example ADRK BOh ;(ARP= 5) Before Instruction After Instruction ARS 4321h ARS 43A1h I 4-37 AND AND With Accumulator Syntax Direct: [label] AND dma Indirect: [label] AND {ind} [, next ARP] Operands O :s: dma :s:127 O :s: next ARP :s: 7 Execution (PC)+ 1 - PC (ACC(15-0)) AND (dma) - ACC{15-0) 0 -ACC(31-16) Not affected by SXM. Encoding 15 14 13 12 11 10 9 8 7 6 5 4 3 2 0 Direct:j o 0 0 1 0 II 0 Data Memory Address Indirect: Io 0 0 1 0 II 1 See Section 4.1 Description The lower half of the accumulator is AN Ded with the contents of the addressed data memory location. The upper half of the accumulator is ANDed with all ze- roes. Therefore, the upper half of the accumulator is always zeroed by the AND instruction. Words 1 Cycles Cycle Timings for a Single Instruction Pl/DI Pl/DE PE/DI PE/DE PR/DI PR/DE 1 2+d 1+p 2+d+p 1 2+d Cycle Timings for a Repeat Execution n 1+n+nd n+p 1+n+nd+p n 1+n+nd 4-38 Assembly Language Instructions AND With Accumulator AND Example AND DAT16 1 (DP = 4) or AND * ;If current auxiliary register contains 528. Before Instruction After Instruction Data Memory 528 OFFh Data Memory 528 OFFh I ACC 01 12345678h ACC 01 00000078h I c c 4-39 ANDK AND Immediate With Accumulator With Shift Syntax [label] AN DK constant [, shift] Operands 16-bit constant O :s: shift :s: 15 (defaults to 0) Execution (PC)+ 2 ... PC (ACC(30-0)) AND [(constant x 2 shift)] - ACC(30-0) O -ACC(31) and all other bit positions unoccupied by shifted constant. Not affected by SXM. Encoding 15 14 13 12 11 10 9 8 7 6 5 4 3 2 0 Direct:l 1 0 1 I shift I 0 0 0 0 0 0 0 I Indirect: 16-Bit constant Description The 16-bit immediate constant is left-shifted as specified and ANDed with the accumulator. The result is left in the accumulator. Low-order bits below and high-order bits above the shifted value are treated as zeros, clearing the corre- sponding bits in the accumulator. Note that the accumulator's most-significant bit is always zeroed regardless of the shift-code value. Words 2 Cycles Cycle Timings for a Single Instruction Pl/DI Pl/DE PE/DI PE/DE PR/DI PR/DE 2 2 2+2p 2+2p 2 2 Cycle Timings for a Repeat Execution not repeatable Example ANDK OFFFFh,12 Before Instruction After Instruction ACC 0 .I.___ 1_23_4_ss_?_a_h_. ACC 01b...------'J 02345000h c c 4-40 Assembly Language Instructions Syntax [ label] APAC Operands None Execution (PC)+ 1---. PC (ACC) + ( shifted P register) - ACC Affects OV; affected by PM and OVM. Affects C. Not affected by SXM. Encoding 15 14 13 12 11 10 9 8 7 6 5 4 3 2 0 0 0 0 0 0 0 0 o 1 I Description The contents of the P register are shifted as defined by the PM status bits and added to the contents of the accumulator. The result is left in the accumulator. APAC is not affected by the SXM bit of the status register; the P register is al- ways sign-extended. The APAC instruction is a subset of the LTA, LTD, MAC, MACO, MPYA, and SORA instructions. Words Cycles Cycle Timings for a Single Instruction Pl/DI Pl/DE PE/DI PE/DE PR/DI PR/DE 1 1 1+p 1+p 1 1 Cycle Timings for a Repeat Execution n n n+p n+p n n Example APAC ; (PM = 0) Before Instruction After Instruction p I 40h p I 40h I ACC GI 20h ACC GI 60h I c c 4-41 Syntax [label] B pma [,{ind} [, next ARP] ] Operands O s pma s 65535 0 s next ARP s 7 Execution pma-PC Modify AR(ARP) and ARP as specified. Encoding 15 14 13 12 11 10 9 8 7 6 5 4 3 2 0 1 J See Section 4.1 Program Memory Address Description The current auxiliary register and ARP are modified as specified, and control passes to the designated program memory address (pma). Note that no AR or ARP modification occurs if nothing is specified in those fields. The pma can be either a symbolic or a numeric address. Words 2 Cycles Cycle Timings for a Single Instruction Pl/DI I Pl/DE Destination on-chip RAM: ] PE/DI ] PE/DE l PR/DI ] PR/DE 2 2 2+2p 2+2p 2 2 Destination on-chip ROM: 3 3 3+2p 3+2p 3 3 Destination external memory: 3+p 3+p 3+3p 3+3p 3+p 3+p Cycle Timings for a Repeat Execution not repeatable Example B PRG191 ;191 is loaded into the program counter, ;and the program continues running from ;that location. 4-42 Assembly Language Instructions Syntax [label] BACC Operands None Execution (ACC{15-0)) - PC 15 14 13 12 11 10 9 8 7 6 5 4 3 2 0 Encoding I 1 0 0 0 0 0 0 0 0 Description The branch uses the lower half of the accumulator (bits 15 - 0) for the branch address. Words Cycles Cycle Timings for a Single Instruction Pl/DI l Pl/DE j PE/DI l PE/DE l PR/DI l PR/DE Destination on-chip RAM: 2 2 2+p 2+p 2 2 Destination on-chip ROM: 3 3 3+p 3+p 3 3 Destination external memory: 3+p 3+p 3+2p 3+2p 3+p 3+p Cycle Timings for a Repeat Execution not repeatable Example BACC Before Instruction After Instruction PC I 16E4h PC I 9545h I ACC 01 OF7FF9545h ACC 01 OF7FF9545h I c c 4-43 BANZ Branch 02 Auxiliary Register Not z,ero Syntax [label] BANZ pma [,{ind}[, next ARP]] Operands O :s pma :s 65535 0 :s next ARP :s 7 Execution If AR (ARP} .. 0: Then pma - PC; Else (PC} + 2 - PC. Modify AR (ARP} as specified. Encoding 15 14 13 12 11 10 9 8 7 6 5 4 3 2 0 0 1 l See Section 4.1 Program Memory Address Description Control is passed to the designated program memory address (pma} if the cur- rent auxiliary register is not equal to zero. Otherwise, control passes to the next instruction. The current auxiliary register and ARP are also modified as speci- fied. Description The current auxiliary register is either incremented or decremented from zero when the branch is not taken. Note that the AR modification defaults to *- (decrement current AR by one} when nothing is specified, making it compat- ible with the TMS320C1 x. The pma can be either a symbolic or a numeric ad- dress. Words 2 Cycles Cycle Timings for a Single Instruction Pl/DI I True Conditions: Pl/DE l PE/DI l PE/DE l PR/DI l PR/DE Destination on-chip RAM: 2 2 2+2p 2+2p 2 2 Destination on-chip ROM: 3 3 3+2p 3+2p 3 3 Destination external memory: 3+p 3+p 3+3p 3+3p 3+p 3+p False Condition: Destination anywhere: 2 2 2+2p 2+2p 2 2 Cycle Timings for a Repeat Execution not repeatable 4-44 Assembly Language Instructions Example 1 BANZ PRG35, *- Before Instruction After Instruction AR 1h I AR Ohl PC 46h I PC 35hl or AR Oh I AR OFFFFhl PC 46h I PC 48hl Example2 BANZ PRG64, * + Before Instruction After Instruction AR OFFFFhl AR Ohl PC 117h I PC 64hl or AR Oh I AR 1h I PC 117h I PC 119hl Note: BANZ is designed for loop control using the auxiliary registers as loop count- ers. Using *O + or *O - allows modification of the loop counter by a variable step size. Care must be exercised when doing this, however, because the auxiliary registers behave as modulo 65536 counters, and zero may be passed without being detected if ARO > 1. 4-45 Syntax [label] BBNZ pma [,{ind} [, next ARP]] Operands O s pma s 65536 0 s next ARP s 7 Execution If test/control (TC) status =1: Then pma - PC; Else (PC) + 2 - PC. Modify AR (ARP) and ARP as specified. Affected by TC bit Encoding 15 14 13 12 11 10 9 8 7 6 5 4 3 2 0 0 0 See Section 4. 1 Program Memory Address Description The current auxiliary register and ARP are modified as specified. Control then passes to the designated program memory address if TC =1. Otherwise, con- trol passes to the next instruction. Note that no AR or ARP modification occurs if nothing is specified in those fields. The pma can be either a symbolic or nu- meric address. Note that the TC bit may be affected by the BIT, BITT, CMPR, LST1, NORM, RTC, and STC instructions. Words 2 Cycles Cycle Timings for a Slngle Instruction Pl/DI I True Conditions: Pl/DE I PE/DI l PE/DE l PR/DI l PR/DE Destination on-chip RAM: 2 2 2+2p 2+2p 2 2 Destination on-chip ROM: 3 3 3+2p 3+2p 3 3 Destination external memory: 3+p 3+p 3+3p 3+3p 3+p 3+p False Condition: Destination anywhere: 2 2 2+2p 2+2p 2 2 Cycle Timings for a Repeat Execution not repeatable Example BBNZ PRG650 ;If TC = 1, 650 is loaded into the program ;counter ; otherwise, the program counter ;is incremented by 2. 4-46 Assembly Language Instructions Zero BBZ Syntax [label) BBZ pma [,{ind} [, next ARP]) Operands O s pma s 65536 0 s next ARP s 7 Execution If test/control (TC} status bit = 0: Then pma --+ PC; Else (PC) + 2 --+ PC. Modify AR (ARP) and ARP as specified. Affected by TC bit Encoding 15 14 13 12 11 10 9 8 7 6 5 4 3 2 0 See Section 4.1 Program Memory Address Description The current auxiliary register and ARP are modified as specified. Control then passes to the designated program memory address if TC= 0. Otherwise, con- trol passes to the next instruction. No AR or ARP modification occurrs if noth- ing is speciified in those fields. The pma can be either a symbolic or a numeric address. Note that the TC bit is affected by the BIT, BITI, CMPR, LST1, NORM, RTC, and STC instructions. Words 2 Cycles Cycle Timings for a Single Instruction Pl/DI ] Pl/DE ] PE/DI J PE/DE J PR/DI l PR/DE True Conditions: Destination on-chip RAM: 2 2 2+2p 2+2p 2 2 Destination on-chip ROM: 3 3 3+2p 3+2p 3 3 Destination external memory: 3+p 3+p 3+3p 3+3p 3+p 3+p False Condition: Destination anywhere: 2 2 2+2p 2+2p 2 2 Cycle Timings for a Repeat Execution not repeatable Example BBZ PRG325 ;If TC = O, 325 is loaded into the program ;counter; otherwise, the program counter ;is incremented by 2. 4-47 Syntax [label] BC pma [,{ind}[, next ARP]] Operands O s pma s 65536 O s next ARP s 7 Execution If carry bit C = 1 : Then pma - PC; Else (PC)+ 2 - PC. Modify AR (ARP) and ARP as specified. Affected by TC bit Encoding 15 14 13 12 11 10 9 8 7 6 5 4 3 2 0 0 0 See Section 4.1 Program Memory Address Description The current auxiliary register and ARP are modified as specified. Control then passes to the designated program memory address if the carry bit C is high. Otherwise, control passes to the next instruction. Note that no AR or ARP mod- ification occurs if nothing is specified in those fields. The pma can be either a symbolic or a numeric address. Note that the carry bit C is affected by all add, subtract, and accumulate instructions as well as the ABS, LST1, NEG, RC, SC, rotate, and shift instruc- tions. The carry bit is not affected by execution of BC, BNC, or nonarithmetic instructions. Words 2 Cycles Cycle Timings for a Single Instruction Pl/DI l True Conditions: Pl/DE l PE/DI j PE/DE l PR/DI l PR/DE Destination on-chip RAM: 2 2 2+2p 2+2p 2 2 Destination on-chip ROM: 3 3 3+2p 3+2p 3 3 Destination external memory: 3+p 3+p 3+3p 3+3p 3+p 3+p False Condition: Destination anywhere: 2 2 2+2p 2+2p 2 2 Cycle Timings for a Repeat Execution not repeatable Example BC PRG512 ;If the carry bit C = 1, 512 is loaded into the ;program counter. Otherwise, the PC is ;incremented by 2. 4-48 Assembly Language Instructions Syntax [label] BGEZ pma [,{ind} [, next ARP]] Operands 0 s pma s 65536 0 s next ARP s 7 Execution If (ACC) O: Then pma - PC; Else (PC) + 2 - PC. Modify AR (ARP) and ARP as specified. Encoding 15 14 13 12 11 10 9 8 7 6 5 4 3 2 0 0 0 0 See Section 4.1 Program Memory Address Description The current auxiliary register and ARP are modified as specified. Control then passes to the designated program memory address (pma) if the contents of the accumulator are greater than zero. Otherwise, control passes to the next instruction. Note that no AR or ARP modification occurs if nothing is specified in those fields. The pma can be either a symbolic or a numeric address. Words 2 Cycles Cycle Timings for a Single Instruction Pl/DI I True Conditions: Pl/DE I PE/DI I PE/DE 1 PR/DI I PR/DE Destination on-chip RAM: 2 2 2+2p 2+2p 2 2 Destination on-chip ROM: 3 3 3+2p 3+2p 3 3 Destination external memory: 3+p 3+p 3+3p 3+3p 3+p 3+p False Condition: Destination anywhere: 2 2 2+2p 2+2p 2 2 Cycle Timings for a Repeat Execution not repeatable Example BGZ PRG342 ;342 is loaded into the program counter if the ;accumulator is greater than or equal to zero. 4-50 Assembly Language Instructions Syntax [label] BIOZ pma [ , {ind} [ , next ARP] ] Operands O s pma s 65536 0 s next ARP s 7 Execution If mo= o: Then pma - PC; Else (PC) + 2 - PC. Modify AR (ARP) and ARP as specified. Encoding 15 14 13 12 11 10 9 8 7 6 5 4 3 2 0 0 See Section 4.1 Program Memory Address Description The current auxiliary register and ARP are modified as specified. Control then passes to the designated program memory address (pma) if the BTrrpin is low. Otherwise, control passes to the next instruction. Note that no AR or ARP mod- ification occurs if nothing is specified in those fields. The pma can be either a symbolic or a numeric address. BIOZ in conjunction with the mo pin can be used to test if a peripheral is ready to send or receive data. Polling the mo pin by using BIOZ may be preferable to an interrupt when executing time-critical loops. Words 2 Cycles Cycle Timings for a Single Instruction Pl/DI l True Conditions: Pl/DE l PE/DI l PE/DE l PR/DI l PR/DE Destination on-chip RAM: 2 2 2+2p 2+2p 2 2 Destination on-chip ROM: 3 3 3+2p 3+2p 3 3 Destination external memory: 3+p 3+p 3+3p 3+3p 3+p 3+p False Condition: Destination anywhere: 2 2 2+2p 2+2p 2 2 Cycle Timings for a Repeat Execution not repeatable Example BIOZ PRG64 ;If the BIO pin is active (low), then a branch ;to location 64 occurs. 4-51 BIT Test Bit Syntax Direct: [label] BIT dma , bit code Indirect: [label] BIT {ind} , bit code [, next ARP] Operands Os dma s 127 0 s next ARP s 7 O s bit code s 15 Execution (PC)+ - PC (dma bit at bit address (15-bit code) ) - TC. Affects TC. Encoding 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 Direct:l 1 0 0 1 I Bit Code II 0 Data Memory Address Indirect: I 1 0 0 1 I Bit Code II 1 See Section 4.1 Description The BIT instruction copies the specified bit of the data memory value to the TC bit of status registerST1. Note that the BITT, CMPR, LST1, and NORM instruc- tions also affect the TC bit in status register ST1 . A bit code value is specified that corresponds to a certain bit address in the instruction, as given by the fol- lowing table: Bit Code Bit Address l l 1Q .2. .a (LSB) 0 1 1 1 1 1 1 1 1 0 2 1 1 0 1 3 1 1 0 0 4 1 0 1 1 5 1 0 1 0 6 1 0 0 1 7 1 0 0 0 8 0 1 1 1 9 0 1 1 0 10 0 1 0 1 11 0 1 0 0 12 0 0 1 1 13 0 0 1 0 14 0 0 0 1 (MSB) 15 0 0 0 0 Words Cycles 4·52 Assembly Language Instructions Test BIT Cycle Timings for a Single Instruction Pl/DI Pl/DE PE/DI PE/DE PR/DI PR/DE 1 2+d 1+p 2+d+p 1 2+d Cycle Timings for a Repeat Execution n 1+n+nd n+p 1+n+nd+p n 1+n+nd Example BIT Oh, Sh ;(DP= 488) or BIT *,8 ;If current auxiliary register contains OF400h. Data Before Instruction Data After Instruction Memory F400h 7E98h Memory F400h 7E98h I TC Ohl TC 1h I 4-53 Syntax Direct: [label] BITT dma Indirect: [label] BITT {ind} [, next ARP] Operands 0 s dma s127 0 s next ARP s 7 Execution (PC)+ 1--+ PC (dma bit at bit address (15-T register(3-0) )) --+ TC Affects TC. Encoding 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 Direct: Io 0 0 1 1 I I 0 Data Memory Address Indirect: Io 0 0 1 1 II 1 See Section 4.1 Description The BITT instruction copies the specified bit of the data memory value to the TC bit of status register ST1. Note that the BIT, CMPR, LST1 , and NORM instructions also affect the TC bit in status register ST1. The bit address is spe- cified by a bit code value contained in the LSBs of the T register, as given in the following table: Bit Code Bit Address l 2. l Q ( LSB) 0 1 1 1 1 1 1 1 1 0 2 1 1 0 1 3 1 1 0 0 4 1 0 1 1 5 1 0 1 0 6 1 0 0 1 7 1 0 0 0 8 0 1 1 1 9 0 1 1 0 10 0 1 0 1 11 0 1 0 0 12 0 0 1 1 13 0 0 1 0 14 0 0 0 1 (MSB) 15 0 0 0 0 Words Cycles 4-54 Assembly Language Instructions Cycle Timings for a Single Instruction Pl/DI Pl/DE PE/DI PE/DE PR/DI PR/DE 1 2+d 1+p 2+d+p 1 2+d Cycle Timings for a Repeat Execution n 1+n+nd n+p 1+n+nd+p n 1+n+nd Example BITT Oh ;Value ih T register points to bit 14 of ;data word (DP= 240). or BITT * ;If current auxiliary register contains 7800h. Before Instruction After Instruction Data Memory 7800h 4DC8h I Data Memory 7800h 4DC8h I TR I 1h TR I 1h I TC D TC L3 4-55 -------------""""""""""'""""'"'"""""""""""""'~ck Move From Data Memox to Data Memoz BLKD Syntax Direct: [label] BLKD dma 1 , dma2 Indirect: [label] BLKD dma1 ,{ind}[, next ARPJ Operands O s dma1 s 65535 0 s dma2 s127 0 s next s ARP s 7 Execution (PC)+ 2- PC (PFC) - MCS dma1--+ PFC If (repeat counter) .. 0: Then (dma1, addressed by PFC) - dma2, Modify AR(ARP) and ARP as specified, (PFC) + 1 - PFC, (repeat counter) - 1 - repeat counter. Else (dma1, addressed by PFC) - dma2 Modify AR(ARP) and ARP as specified. (MCS) - PFC 4-57 BLKD Block Move From Data Memoz.. to Data Memoz.. Encoding 15 14 13 12 11 10 9 8 7 6 5 4 3 2 0 Direct: 1 Data Memory Address Data Memory Address 1 Indirect: 1 See Section 4.1 Data Memory Address 1 Description Consecutive memory words are moved from a source data memory block to a destination data memory block. The starting address (lowest) of the source block is defined by the second word of the instruction. The starting address of the destination block is defined by either the dma contained in the opcode (for direct addressing) or the current AR (for indirect addressing). In the indi- rect addressing mode, both the current AR and ARP may be modified in the usual manner. In the direct addressing mode, dma2 is used as the destination address for the block move but is not modified upon repeated executions of the instruction. Thus, the contents of memory at the dma2 address will be the same as the contents of memory at the last dma1 address in a repeat se- quence. RPT or RPTK must be used with the BLKD instruction, in the indirect addres- sing mode, if more than one word is to be moved. The number of words to be moved is one greater than the number contained in the repeat counter RPTC atthe beginning of the instruction. Atthe end of this instruction, the RPTC con- tains zero and, if using indirect addressing, AR(ARP) will be modified to con- tain the address after the end of the destination block. Note that the source and destination blocks do not have to be entirely on-chip or off-chip. However, BLKD cannot be used to transfer data from a memory-mapped register to any other location in data memory. The PC points to the instruction following BLKD after execution. Interrupts are inhibited during a BLKD operation used with RPT or RPTK. Words 2 Cycles 4-58 Assembly Language Instructions Cycle Timings for a Slngle Instruction Pl/DI l Pl/DE l PE/DI l PE/DE l PR/DI l PR/DE Source data in on-chip RAM: 3 3+d 3+2p 3+d+2p 3 3+d Source data in external memory: 4+d 4+2d 4+d+2p 4+2d+2p 4+d 4+2d Cycle Timings for a Repeat Execution Source data in on-chip RAM: 2+n 2+n+nd 2+n+2p 2+n+nd+2p 2+n 2+n+nd Source data in external memory: 3+n+nd 2+n+ nd 3+n+nd+2p 2+2n+2nd+ 2p 3+n+nd 2+2n+2nd Example RPTK 2 BLKD OF400h,*+ ;If current auxiliary register contains 1030. dma1 Before Instruction After Instruction Data Memory 62464 7F98hl Data Memory 62464 7F98h I Data Memory 62465 OFFE6hl Data Memory 62465 OFFE6h I Data Memory 62466 9522hl Data Memory 62466 9522h I dma2 Before Instruction After Instruction Data Memory 1030 7F98hl Data Memory 1030 7F98h I Data Memory 1031 9315hl Data Memory 1031 OFFE6h I Data Memory 1032 2531 hi Data Memory 1032 9522h I 4-59 BLKP Block Move From Prog_ram Memoi;x, to Dt;~ Memo'l, Syntax Direct: [label] BLKP pma, dma Indirect: [label] BLKP pma,{ind}[, next ARPJ Operands O :s: pma :s: 65535 O :s: dma :s:127 O :s: next ARP :s: 7 Execution (PC)+ 2 - PC (PFC) -Mes pma-PFC If (repeat counter) "' O: Then (pma, addressed by PFC) - dma, Modify AR(ARP) and ARP as specified, (PFC) + 1 - PFC, (repeat counter) - 1 - repeat counter. Else (pma, addressed by PFC) - dma Modify AR(ARP) and ARP as specified. (MCS) - PFC Encoding 15 14 13 12 11 10 9 8 7 6 5 4 3 2 0 Direct: 1 o o I oI Data Memory Address Program Memory Address Indirect: 1 0 0 l l 1 See Section 4.1 Program Memory Address Description Consecutive memory words are moved from a source program memory block to a destination data memory block. The starting address (lowest) of the source block is defined by the second word of the instruction. The starting ad- dress of the destination block is defined by either the dma contained in the op- code (for direct addressing) or the current AR (for indirect addressing). In the indirect addressing mode, both the ARP and the current AR may be modified in the usual manner. In the direct addressing mode, dma is used as the des- tination address for the block move but is not modified by repeated executions of the instruction. Thus, the contents of memory at the dma address will be the same as the contents of memory at the last pma address in a repeat se- quence. RPT or RPTK must be used with the BLKP instruction if more than one word is to be moved. The number of words to be moved is one greaterthan the num- ber contained in the repeat counter RPTC at the beginning of the instruction. At the end of this instruction, the RPTC contains zero and, if using indirect ad- dressing, AR(ARP) will be modified to contain the address after the end of the destination block. Note that source and destination blocks do not have to be entirely on-chip or off-chip. 4-60 Assembly Language Instructions The PC points to the instruction following BLKP after execution. Interrupts are inhibited during a BLKP operation. If the MP/MC pin on the TMS320C25 is low at the time of execution of this instruction and the program memory address used is less than 4096, an on- chip ROM location will be read. Words 2 Cycles Cycle Timings for a Single Instruction Pl/DI l Pl/DE Table in on-chip RAM: l PE/DI l PE/DE l PR/DI l PR/DE 3 3+d 4+2p 4+d+2p 4 4+d Table in on-chip ROM: 4 4+d 4+2p 4+d+2p 4 4+d Table in external memory: 4+p 4+d+p 4+3p 4+d+3p 4+p 4+d+p Cycle Timings for a Repeat Execution Table in on-chip RAM: 2+n 2+n+nd 2+n+2p 2+n+nd+2p - - Table in on-chip ROM: 3+n 3+n+nd 3+n+2p 3+n+nd+2p 3+n 3+n+nd Table in external memory: 3+n+np 2+2n+nd+np 3+n+np+2p 2+2n+nd+ np+2p 3+n+n p 2+2n+nd+np 4-61 Example RPTK 2 BLKP 65120,*+ ;If current auxiliary register contains 2048. pma Before Instruction After Instruction Data Data Memory OA089hl Memory OA089hl 65120 65120 Data Memory 65121 2DCEh I Data Memory 65121 2DCEhl Data Data Memory 3A9Fhl Memory 3A9Fhl 65122 65122 dma Before Instruction After Instruction Data Data Memory 2048 1234hl Memory 2048 [ OA089hl Data Data Memory 2005hl Memory 2DCEhl 2049 2049 Data Memory 2050 OE98Ch I Data Memory 2050 3A9Fhl 4-62 Assembly Language Instructions Branch if Accumulator Less Than Zero BLZ Syntax [label] BLZ pma [,{ind} [, next ARP]] Operands O:s pma :s 65535 0 :s next ARP :s 7 Execution If {ACC) < 0: Then pma --+ PC; Else (PC) + 2 --+ PC. Modify AR(ARP) and ARP as specified. Encoding 15 14 13 12 11 10 9 8 7 6 5 4 3 2 0 1 1 0 0 See Section 4.1 Program Memory Address Description The current auxiliary register and ARP are modified as specified. Control then passes to the designated program memory address (pma) if the contents of the accumulator are less than zero. Otherwise, control passes to the next instruction. Note that no AR or ARP modification occurs when nothing is speci- fied in those fields. The pma can be either a symbolic or a numeric address. Words 2 Cycles Cycle Timings for a Single Instruction Pl/DI I True Conditions: Pl/DE 1 PE/DI l PE/DE l PR/DI I PR/DE Destination on-chip RAM: 2 2 2+2p 2+2p 2 2 Destination on-chip ROM: 3 3 3+2p 3+2p 3 3 Destination external memory: 3+p 3+p 3+3p 3+3p 3+p 3+p False Condition: Destination anywhere: 2 2 2+2p 2+2p 2 2 Cycle Timings for a Repeat Execution not repeatable Example BLZ PRG481 ;481 is loaded into the program counter if ;the accumulator is less than zero. 4-63 Syntax [label] BNC pma [,{ind} [, next ARP]] Operands O s pma s 65535 0 s next ARP s 7 Execution If carry bit C = 0: Then pma - PC; Else (PC) + 2 - PC. Modify AR(ARP) and ARP as specified. Affected by C. Encoding 15 14 13 12 11 10 9 8 7 6 5 4 3 2 0 0 1 0 See Section 4.1 Program Memory Address Description The current auxiliary register and ARP are modified as specified. Control then passes to the designated program memory address if the carry bit C is low. Otherwise, control passes to the next instruction. Note that no AR or ARP modification occurs when nothing is specified in those fields. The pma can be either a symbolic or a numeric address. Note that the carry bit C is affected by all add, subtract, and accumulate instructions as well as the ABS, LST1, NEG, RC, SC, rotate, and shift instruc- tions. The carry bit is not affected by execution of the BC, BNC, or nonarith- metic instructions. Words 2 Cycles Cycle Timings for a Single Instruction Pl/DI I True Conditions: Pl/DE I PE/DI I PE/DE I PR/DI I PR/DE Destination on-chip RAM: 2 2 2+2p 2+2p 2 2 Destination on-chip ROM: 3 3 3+2p 3+2p 3 3 Destination external memory: 3+p 3+p 3+3p 3+3p 3+p 3+p False Condition: Destination anywhere: 2 2 2+2p 2+2p 2 2 Cycle Timings for a Repeat Execution not repeatable Example BNC PRG325 ;If the carry bit c = 0, 325 is loaded into ;program counter. Otherwise, the PC is the ;incremented by 2. 4-64 Assembly Language Instructions Branch if No Overflow BNV Syntax [label] BNV pma [,{ind} [, next ARP]] Operands 0 s pma s 65535 0 s next ARP s 7 Execution If overflow OV status bit = 0: Then pma - PC; Else (PC) + 2 - PC and 0 - OV. Modify AR(ARP) and ARP as specified. Affects OV; affected by OV. Encoding 15 14 13 12 11 10 9 8 7 6 5 4 3 2 0 1 1 0 See Section 4.1 Program Memory Address Description The current auxiliary register and ARP are modified as specified. Control then passes to the designated program memory address (pma) if the OV (overflow flag) is clear. Otherwise, the OV is cleared, and control passes to the next instruction. Note that no AR or ARP modification occurs if nothing is specified in those fields. The pma can be either a symbolic or a numeric address. Words 2 Cycles Cycle Timings for a Single Instruction Pl/DI l True Conditions: Pl/DE l PE/DI l PE/DE l PR/DI l PR/DE Destination on-chip RAM: 2 2 2+2p 2+2p 2 2 Destination on-chip ROM: 3 3 3+2p 3+2p 3 3 Destination external memory: 3+p 3+p 3+3p 3+3p 3+p 3+p False Condition: Destination anywhere: 2 2 2+2p 2+2p 2 2 Cycle Timings for a Repeat Execution not repeatable Example BNV PRG315 ;315 is loaded into the program counter if the ;overflow flag is clear. OV is cleared. 4-65 BNZ Branch if Accumulator to Zero Syntax [label] BNZ pma [,{ind} [, next ARPJ] Operands O s pma s 65535 0 s next ARP s 7 Execution If (ACC) "'O: Then pma - PC; Else (PC)+ 2 - PC. Modify AR(ARP) and ARP as specified. Encoding 15 14 13 12 11 10 9 8 7 6 5 4 3 2 0 1 1 0 0 See Section 4.1 Program Memory Address Description The current auxiliary register and ARP are modified as specified. Control then passes to the designated program memory address (pma) if the contents of the accumulator are not equal to zero. Otherwise, control passes to the next instruction. Note that no AR or ARP modification occurs if nothing is specified in those fields. The pma can be either a symbolic or a numeric address. Words 2 Cycles Cycle Timings for a Single Instruction Pl/DI l True Conditions: Pl/DE l PE/DI l PE/DE l PR/DI l PR/DE Destination on-chip RAM: 2 2 2+2p 2+2p 2 2 Destination on-chip ROM: 3 3 3+2p 3+2p 3 3 Destination external memory: 3+p 3+p 3+3p 3+3p 3+p 3+p False Condition: Destination anywhere: 2 2 2+2p 2+2p 2 2 Cycle Timings for a Repeat Execution not repeatable Example BNZ PRG320 ;320 is loaded into the program counter if the ;accumulator does not equal zero. 4-66 Assembly Language Instructions Branch on Overflow BV Syntax [label] BV pma [,{ind}[, next ARPJ] Operands O :s pma :s 65535 0 :s next ARP :s 7 Execution If overflow (OV) status bit = 1 : Then pma - PC and 0 - OV; Else (PC) + 2 - PC. Modify AR(ARP) and ARP as specified. Affects OV; affected by OV. Encoding 15 14 13 12 11 10 9 8 7 6 5 4 3 2 0 0 0 0 0 See Section 4.1 Program Memory Address Description The current auxiliary register and ARP are modified as specified, and the over- flow flag is cleared. Control passes to the designated program memory ad- dress (pma) if the OV (overflow flag) is set. Otherwise, control passes to the next instruction. Note that no AR or ARP modification occurs if nothing is spe- cified in those fields. The pma can be either a symbolic or a numeric address. Words 2 Cycles Cycle Timings for a Single Instruction Pl/DI I True Conditions: Pl/DE I PE/DI I PE/DE I PR/DI I PR/DE Destination on-chip RAM: 2 2 2+2p 2+2p 2 2 Destination on-chip ROM: 3 3 3+2p 3+2p 3 3 Destination external memory: 3+p 3+p 3+3p 3+3p 3+p 3+p False Condition: Destination anywhere: 2 2 2+2p 2+2p 2 2 Cycle Timings for a Repeat Execution not repeatable Example BV PRG610 ;If an overflow has occurred since the overflow ;flag was last cleared, then 610 is loaded in ;the program counter and OV is cleared. 4-67 Syntax [label] BZ pma [,{ind} [, next ARPJ] Operands O s pma s 65535 0 s next ARP s 7 Execution If (ACC) = 0: Then pma -+ PC; Else (PC) + 2 -+ PC. Modify AR(ARP) and ARP as specified. Encoding 15 14 13 12 11 10 9 8 7 6 5 4 3 2 0 1 1 0 0 1 1 See Section 4.1 Program Memory Address Description The current auxiliary register and ARP are modified as specified. Control then passes to the designated program memory address (pma) if the contents of the accumulator are equal to zero. Otherwise, control passes to the next instruction. Note that no AR or ARP modification occurs if nothing is specified in those fields. The pma can be either a symbolic or a numeric address. Words 2 Cycles Cycles Cycle Timings for a Single Instruction Pl/DI l True Conditions: Pl/DE J PE/DI I PE/DE I PR/DI 1 PR/DE Destination on-chip RAM: 2 2 2+2p 2+2p 2 2 Destination on-chip ROM: 3 3 3+2p 3+2p 3 3 Destination external memory: 3+p 3+p 3+3p 3+3p 3+p 3+p False Condition: Destination anywhere: 2 2 2+2p 2+2p 2 2 Cycle Timings for a Repeat Execution not repeatable Example BZ PRG102 ;102 is loaded into the program counter if ;the accumulator is equal to zero. 4-68 Assembly Language Instructions Call Subroutine Indirect CALA Syntax [label] GALA Operands None Execution (PC) + 1 -+ TOS (ACC(15-0)) - PC Encoding 15 14 13 12 11 10 9 8 7 6 5 4 3 2 0 I 1 1 0 0 0 0 0 1 0 0 0 0 I Description The current program counter is incremented and pushed onto the top of the stack. Then, the contents of the lower half of the accumulator are loaded into the PC. The carry bit on the TMS320C25 is unaffected by this instruction. The GALA instruction is used to perform computed subroutine calls. Words Cycles Cycle Timings for a Single Instruction Pl/DI l Pl/DE Destination on-chip RAM: l PE/DI l PE/DE l PR/DI l PR/DE 2 2 2+p 2+p 2 2 Destination on-chip ROM: 3 3 3+p 3+p 3 3 Destination external memory: 3+p 3+p 3+2p 3+2p 3+p 3+p Cycle Timings for a Repeat Execution not repeatable 4-69 CALA ~m~m Ca// Subroutine Indirect ~ Example CALA Before Instruction After Instruction PC 25h PC 83hl ACC 83h ACC 83hl Stack 32h Stack 26h 75h 32h 84h 75h 49h 84h Oh 49h Oh Oh Oh Oh Oh Oh 4-70 Assembly Language Instructions Call Subroutine CALL Syntax [label] CALL pma [,{ind} [, next ARP]] Operands O s pma s 65535 0 s next ARP s 7 Execution (PC)+ 2-+ TOS pma-+PC Encoding 15 14 13 12 11 10 9 8 7 6 5 4 3 2 0 See Section 4.1 Program Memory Address Description The current auxiliary register and ARP are modified as specified, and the PC (program counter) is incremented by two and pushed onto the top of the stack. The specified program memory address (pma) is then loaded into the PC. Note that no AR or ARP modification occurs if nothing is specified in those fields. The pma can be either a symbolic or a numeric address. Words 2 Cycles Cycle Timings for a Single Instruction Pl/DI l Pl/DE Destination on-chip RAM: l PE/DI l PE/DE l PR/DI l PR/DE 2 2 2+2p 2+2p 2 2 Destination on-chip ROM: 3 3 3+2p 3+2p 3 3 Destination external memory: 3+p 3+p 3+3p 3+3p 3+p 3+p Cycle Timings for a Repeat Execution not repeatable 4-71 CALL Call Subroutine Example CALL PRG109 pma Before Instruction After Instruction PC 33h I PC 6Dh I Stack 71h Stack 35h 48h 71h 16h 48h 80h 16h Oh 80h Oh Oh Oh Oh Oh Oh 4-72 Assembly Language Instructions Come,tement Accumulator CMPL Syntax [label] CMPL Operands None Execution (PC)+ 1 - PC (ACC)-ACC Encoding 15 14 13 12 11 10 9 8 7 6 5 4 3 2 0 I 1 0 0 0 0 0 0 0 1 I Description The contents of the accumulator are replaced with its logical inversion (1 s complement). Words Cycles Cycle Timings for a Slngle Instruction Pl/DI l Pl/DE l PE/DI l PE/DE l PR/DI l PR/DE 1 I 1 I 1+p l 1+p _L 1 l 1 Cycle Timings for a Repeat Execution n l n l n+p l n+p l n l n Example CMPL Before Instruction After Instruction ACC 0 .I.__o_F_1s_s_2s_1_3_h_, Ace 0 l.____os_e_1o_A_E_ch__,I c c 4-73 CMPR Compare Auxiliaz. ReqJster With Auxilia[l Register,6,fiq.,,,,.,,.., Syntax [label] CMPR constant Operands O:s:CM:s:3 Execution (PC)+ 1-+ PC Compare AR(ARP) to ARO, placing result in TC bit of status register ST1. Affects TC. Not affected by SXM; does not affect SXM. Encoding 15 14 13 12 11 10 9 8 7 6 5 4 3 2 0 0 0 0 0 0 0 0 CM Description The CMPR instruction performs the following comparisons dependent on the value of CM: If CM =00, test if AR(ARP) =ARO If CM = 01 , test if AR(ARP) < ARO If CM = 10, test if AR(ARP) > ARO If CM = 11, test if AR(ARP) .. ARO If the result of a test is true, a one is loaded into the TC status bit. Otherwise, TC is loaded with a zero. The auxiliary registers are treated as unsigned inte- gers in the comparison. Words 1 Cycles Cycle Timings for a Single Instruction Pl/DI I Pl/DE I PE/DI I PE/DE I PR/DI I PR/DE 1 I 1 I 1+p I 1+p I 1 I 1 Cycle Timings for a Repeat Execution n l n l n+p l n+p l n l n Example CMPR 2 ; (ARP = 4) Before Instruction After Instruction ARO I OFFFFh ARO I OFFFFh I AR4 I 7FFFh AR4 I 7FFFh I TC LI TC LJ 4-74 Assembly Language Instructions Syntax [label] CNFD Operands None Execution (PC)+ 1 - PC 0 - RAM configuration control (CNF) status bit Affects CNF. Encoding 15 14 13 12 11 10 9 8 7 6 5 4 3 2 0 0 0 0 0 0 0 0 0 0 0 Description On-chip RAM block 0 is configured as data memory. The block is mapped to locations 512 through 767 in data memory. This instruction is the complement of the CNFP instruction and sets the CNF bit in status register ST1 to a zero. CNF is also loaded by the CNFP and LST1 instructions. On the TMS320C25, the next two instruction fetches immediately following a CNFD or CNFP instruction use the old value of CNF. On the TMS320C26 this instruction is not valid and is undefined. Words Cycles Cycle Timings for a Single Instruction Pl/DI I Pl/DE l PE/DI l PE/DE l PR/DI l PR/DE 1 I 1 l 1+p l 1+p l 1 l 1 Cycle Timings for a Repeat Execution n I n l n+p l n+p l n l n Example CNFD ;A zero is loaded into the CNF status bit, ;thus configuring block BO as data memory ;(see memory maps in Section 3.4). 4-75 Syntax [label] CNFP Operands None Execution (PC)+ 1 - PC 1 - RAM configuration control (CNF) status bit Affects CNF. Encoding 15 14 13 12 11 10 9 8 7 6 5 4 3 2 0 0 0 0 0 0 0 0 0 o 1 I Description On-chip RAM block Ois configured as program memory. The block is mapped to locations 65280 through 65535 in program memory space. This instruction is the complement of the CNFD instruction and sets the CNF bit in status regis- ter ST1 to a one. CNF is also loaded by the CNFD and LST1 instruction. Configuring this block as program memory allows the use of the program counter as an address generator to access data from on-chip RAM. Used in conjunction with the repeat instructions, this allows two data memory locations to be addressed simultaneously, one from the auxiliary registers and one from the program counter. Instructions that take advantage of this feature are the MAC, MACO, BLKD, and BLKP instructions. On the TMS320C25, the next two instruction fetches immediately following a CNFD or CNFP instruction use the old value of CNF. On the TMS320C26, this instruction is not valid and is undefined. Words Cycles Cycle Timings for a Single Instruction Pl/DI I Pl/DE T PE/DI I PE/DE I PR/DI I PR/DE 1 l 1 l 1+p l I 1+p Cycle Timings for a Repeat Execution 1 I 1 n I n I n+p l n+p l n l n Example CNFP ;The CNF bit is set to a logic 1, thus ;configuring block BO as program memory ;(see memory maps in Section 3.4). 4-76 Assembly Language Instructions Configure Blocks as Data/Program Memor;x, [MS320C26 Onlr), CONF Syntax [label] CONF constant Operands o :s: constant :s: 3 Execution (PC)+ 1 - PC Constant - program/data memory configuration mode status bits Encoding 15 14 13 12 11 10 9 8 7 6 5 4 3 2 0 0 0 0 0 0 1 CNF1 CNFol Description The two low-order CNF bits of the instruction word are copied into the CNFO and CNF1 field of status register ST1. The CNFO and CNF1 status bits config- ure the on-chip RAM blocks into program or data memory. The bit combina- tions and their meanings are shown below in the CONF mode decoding table. Words Cycles Cycle Timings for a Single Instruction Pl/DI I Pl/DE ] PE/DI ] PE/DE I PR/DI l PR/DE TMS320C26 1 I 1 ] 1+p I 1+p I 1 l 1 Cycle Timings for a Repeat Execution TMS320C26 n I n ] n+p ] n+p I n l n CONF Mode Decoding Table CNF1 CNFO BO 81 82 83 0 0 data data data data 0 1 program data data data 1 0 program program data data 1 1 program program data program Example CONF 2 ;Status register bit CNFl is set to 1 and ;Status register bit CNFO is set to 0, thus ;configuring the blocks BO and Bl as ;program memory, B2 and B3 as data memory. 4-77 Syntax [label] DINT Operands None Execution (PC)+ 1-+ PC 1 -+interrupt mode (INTM) status bit Affects INTM. Encoding 15 14 13 12 11 10 9 8 7 6 5 4 3 2 0 0 0 0 0 0 0 0 Description The interrupt mode (INTM) status bit is set to logic 1. Maskable interrupts are disabled immediately after the DINT instruction executes. Note that the LST instruction does not affect INTM. The unmaskable interrupt, RS, is not disabled by this instruction, and the inter- rupt mask register (IMR) is unaffected. Interrupts are also disabled by a reset. Words 1 Cycles Cycle Timings for a Single Instruction Pl/DI I Pl/DE I PE/DI I PE/DE I PR/DI I PR/DE 1 I 1 I 1+p I 1+p I 1 I 1 Cycle Timings for a Repeat Execution n l n l n+p l n+p l n l n Example DINT ;Maskable interrupts are disabled, and INTM is ;set to one. 4-78 Assembly Language Instructions Syntax Direct: [label] DMOV dma Indirect: [label] DMOV {ind} [,] Operands O :s dma :s 127 0 :s next ARP :s 7 Execution (PC)+ 1-+ PC (dma) -+ dma + 1 Affected by CNF. Encoding 15 14 13 12 11 10 9 8 7 6 5 4 3 2 0 Direct:! o 0 0 1 0 II 0 Data Memory Address Indirect: I o 0 0 1 0 II 1 See Section 4.1 Description The contents of the specified data memory address are copied into the con- tents of the next higher address. DMOV works only within the on-chip data RAM blocks BO, B1, and 82. It works within block BO if it is configured as data memory and the data move function is continuous across the boundaries of blocks BO and B 1; that is, it works for locations 512 to 1023. The data move function cannot be used on external data memory. If used on external data memory or memory-mapped registers, DMOV will read the specified memory location but will perform no other operations. When data is copied from the addressed location to the next higher location, the contents of the addressed location remain unaltered. The data move function is useful in implementing the z- 1 delay encountered in digital signal processing. The DMOV function is included in the LTD and MACO instructions (see the LTD and MACO instructions or more information). Words Cycles Cycle Timings for a Single Instruction Pl/DI l Pl/DE l PE/DI l PE/DE l PR/DI l PR/DE 1 l 2+d I 1+p l 2+d+p I 1 l 2+d Cycle Timings for a Repeat Execution n I 1+n+nd I n+p J 1+n+nd+p J n I 1+n+nd 4-79 DMOV Data Move in Data Memory Example DMOV OATS ; (DP=4) or DMOV * ;If current auxiliary register contains 520. Before Instruction After Instruction Data Memory 520 43h Data Memory 520 43h I Data Memory 521 2h Data Memory 521 43h I 4-80 Assembly Language Instructions Enable tnterruet EINT Syntax [label] EINT Operands None Execution (PC)+ 1 - PC O- interrupt-mode (INTM) status bit Affects INTM. Encoding 15 14 13 12 11 10 9 8 7 6 5 4 3 2 0 0 0 0 0 0 0 0 o o o o I Description The interrupt-mode flag (INTM) in the status register is cleared to logic o. Maskable interrupts are enabled after the instruction following EINT executes. This allows an interrupt service routine to re-enable interrupts and execute a RET instruction before any other pending interrupts are processed. Note that the LST instruction does not affect INTM. (See the DI NT instruction for further information.) Words 1 Cycles Cycle Timings for a Slngle Instruction Pl/DI I Pl/DE I PE/DI I PE/DE I PR/DI I PR/DE 1 I 1 I 1+p I 1+p I 1 I 1 Cycle Timings for a Repeat Execution n L n l n+p L n+p L n L n Example EINT ;Unmasked interrupts are enabled, and INTM is ;set to zero. 4-81 FORT Format Serial Port Reg_isters Syntax [label] FORT constant Operands Constant = 0 or 1 Execution (PC)+ 1-+ PC Constant -+ format (FO) status bit Affects FO. Encoding 15 14 13 12 11 10 9 8 7 6 5 4 3 2 0 0 0 0 0 0 0 0 Description The format (FO) status bit is loaded by the instruction with the LSB specified in the instruction. The FO bit is used to control the formatting of the transmit and receive shift registers of the serial port. If FO = 0, the registers are config- ured to receive/transmit 16-bit words. If FO = 1, the registers are configured to receive/transmit 8-bit bytes. FO is set to zero on a reset. Words 1 Cycles Cycle Timings for a Slngle Instruction Pl/DI l Pl/DE l PE/DI l PE/DE l PR/DI l PR/DE 1 l 1 l 1+p l 1+p l 1 l 1 Cycle Timings for a Repeat Execution n l n l n+p l n+p l n l n Example FORT 1 ;The FO status bit is loaded with 1, making the ;bit length of the serial port 8 bits. 4-82 Assembly Language Instructions Idle Until lnterruet IDLE Syntax [label] IDLE Operands None Execution TMS320C25: {PC)+ 1 - PC O - interrupt mode {INTM) status bit Affects INTM. Encoding 15 14 13 12 11 10 9 8 7 6 5 4 3 2 0 0 0 0 0 0 0 Description The IDLE instruction forces the program being executed to wait until an inter- rupt or reset occurs. The PC is incremented only once, and the device remains in an idle state until interrupted. On the TMS320C25, INTM is automatically set to zero. Execution of the IOLE instruction causes the TMS320C25 to enter the powerdown mode {see subsection 3.6. 7). The on-chip timer continues to oper- ate normally after execution of an IDLE instruction. Words 1 Cycles Cycle Timings for a Single Instruction Pl/DI I Pl/DE I PE/DI I PE/DE I PR/DI I PRIDE (Interrupt) destination on-chip ROM 3 (min waits for INT) (Interrupt) destination external memory: 3+2p (min waits for INT) Cycle Timings for a Repeat Execution not repeatable Example IDLE ;The processor idles until a reset or ;unmasked interrupt occurs. 4-83 IN Input Data From Port Syntax Direct: [label] IN dma,PA Indirect: [label] IN {ind}, PA[, next ARP] Operands 0 s dma s127 0 s next ARP s 7 O s port address PA s 15 Execution (PC)+ 1 - PC Port address - address bus A3-AO 0 - address bus A 15-A4 Data bus 015-DO- dma Encoding 15 14 13 12 11 10 9 8 7 6 5 4 3 2 0 Direct: I 0 0 0 I Port Address II 0 Data Memory Address Indirect: I 0 0 0 I Port Address II See Section 4.1 Description The IN instruction reads a 16-bit value from one of the external 1/0 ports into the specified data memory location. The TS line goes low to indicate an 1/0 ac- cess, and the STAB, R/W, and READY timings are the same as for an external data memory read. Words Cycles Cycle Timings for a Single Instruction Pl/DI Pl/DE PE/DI PE/DE PR/DI PR/DE 2+i 2+d+i 2+p+i 3+d+p+i 2+i 2+d+i Cycle Timings for a Repeat Execution 1+n+ni 2n+nd+ni 1+n+p+ni 1+2n+nd+p+ 1+n+ni 2n+nd+ni ni Example IN STAT,PA5 ;Read in word from peripheral on port address ;5. Store in data memory location STAT. or LRLK 1,520 ;Load ARl with decimal 520. LARP 1 ;Load ARP with decimal 520. IN *-,PAl,O ;Read in word from peripheral on port address ;l. Store in data memory location 520. ;Decrement ARl to 519. ;Load the ARP with O. 4-84 Assembly Language Instructions Load Accumulator With Shift LAC Syntax Direct: [label] LAC dma [, shift] Indirect: [label] LAC {ind}[, shift[, next ARP]] Operands O:s: dma:s: 127 0 :s: next ARP :s: 7 O:s: shift :s: 15 (defaults to 0) Execution (PC)+ 1-+ PC (dma) x 2 shift -+ ACC If SXM = 1: Then (dma) is sign-extended. If SXM =0: Then (dma) is not sign-extended. Affected by SXM. Encoding 15 14 13 12 11 10 9 8 7 6 5 4 3 2 0 Direct:! o 0 0 I Shift II 0 Data Memory Address I Indirect: o 0 0 I Shift II 1 See Section 4.1 Description The contents of the specified data memory address are left-shifted and loaded into the accumulator. During shifting, low-order bits are zero-filled. High-order bits are sign-extended if SXM = 1 and zeroed if SXM =0. Words 1 Cycles Cycle Timings for a Single Instruction Pl/DI I Pl/DE I I PE/DE I PR/DI I PR/DE PE/DI 1 I 2+d I I 2+d+p I 1 I 2+d 1+p Cycle Timings for a Repeat Execution n l 1+n+nd l n+p l 1+n+nd+p l n l 1+n+nd Example LAC DAT6,4 1 (DP = 8) or LAC *,4 ;If current auxiliary register contains 1030. Before Instruction After Instruction Data Memory 1030 I 1h Data Memory 1030 I 1h I ACC EJ I 12345678h I ACC EJ I 10h I c c 4-85 LACK Load Accumulator Immediate Short Syntax [label] LACK constant Operands O s constant s 255 Execution (PC)+ 1-+ PC 8-bit positive constant - ACC Not affected by SXM. Encoding 15 14 13 12 11 10 9 8 7 6 5 4 3 2 0 0 0 0 0 8-Bit Constant Description The 8-bit constant is loaded into the accumulator right-justified. The upper 24 bits of the accumulator are zeroed (that is, sign extension is suppressed). Words 1 Cycles Cycle Timings for a Single Instruction Pl/DI l Pl/DE l PE/DI l PE/DE l PR/DI l PR/DE 1 l 1 l 1+p l 1+p l 1 l 1 Cycle Timings for a Repeat Execution not repeatable Example LACK 15h Before Instruction After Instruction ACC 0 ._I_ _ _ _ 3_1h.....1 Ace 01._____1_sh.....I c c 4-86 Assembly Language Instructions Load Accumulator With Shift Specified bi T Register LACT Syntax Direct: [label] LACT dma Indirect: [label] LACT {ind} [, next ARP] Operands O :s; dma :s; 127 0 :s; next ARP :s; 7 Execution {PC)+ 1-+ PC {dma) x 2T register{3--0) -+ ACC If SXM = 1: Then {dma) is sign-extended. If SXM = O: Then {dma) is not sign-extended. Affected by SXM. Encoding 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 Direct:! o 0 0 0 0 1 0 II 0 Data Memory Address Indirect:! o 0 0 0 0 1 0 II 1 See Section 4.1 Description The LACT instruction loads the accumulator with a data memory value that has been left-shifted. The left-shift is specified by the four LSBs of the T register, resulting in shift options from Oto 15 bits. Using the T register's contents as a shift code provides a variable shift mechanism. LACT may be used to denormalize a floating-point number if the actual expo- nent is placed in the four LSBs of the T register and the mantissa is referenced by the data memory address. Note that this method of denormalization can be used only when the magnitude of the exponent is four bits or less. Words Cycles Cycle Timings for a Slngle Instruction Pl/DI l Pl/DE l l PE/DE l PR/DI l PR/DE PE/DI 1 I 2+d I 1+p I 2+d+p I 1 I 2+d Cycle Timings for a Repeat Execution n l 1+n+nd l n+p J 1+n+nd+p J n l 1+n+nd 4-87 LACT Load Accumulator With Shift Specified by T Register Example LACT DATl J(DP = 6) or LACT * ;If current auxiliary register contains 769. Betore Instruction After Instruction Data Memory 769 I 1376h Data Memory 769 I 1376h I ACC ~I 98F7EC83h ACC ~I 13760h I c c T 3014h T 3014h I 4-88 Assembly Language Instructions ,.,,,...................................................=-......=-=--=====,==m=·""="''='f;-,_,,~.!!,f!lulator.,~~-Q!J, Immediate With Shift LALK Syntax [label] LALK constant [, shift] Operands 16-bit constant Os shifts 15 (defaults to 0) Execution (PC)+ 2-+ PC Constant x 2shift -+ ACC If SXM = 1: Then -32768 s constants 32767. If SXM = O: Then O s constant s 65535. Affected by SXM. Encoding 15 14 13 12 11 10 9 8 7 6 5 4 3 2 0 0 ~m o o o o o 0 0 I' 16-Bit Constant Description The left-shifted 16-bit immediate value is loaded into the accumulator. The shifted 16-bit constant is sign-extended if SXM = 1; otherwise, the high-order bits of the accumulator (past the shift) are set to zero. Note that the MSB of the accumulator can be set only if SXM = 1 and a negative number is loaded. The shift count is optional and defaults to zero. Words 2 Cycles Cycle Timings for a Single Instruction Pl/DI l Pl/DE l PE/DI PE/DE l PR/DI l l PR/DE 2 I 2 I 2+2p 2+2p I 2 I I 2 Cycle Timings for a Repeat Execution not repeatable Example 1 LALK OF794h,8 ;(SXM=l): Before Instruction After Instruction ACC 01 12345678h I ACC 01 OFFF79400h I c c Example2 LALK OF794h,8 ; ( SXM=O): Before Instruction After Instruction ACC 01 12345678h I ACC 01 OF79400h I c c 4-89 Syntax Direct: [ label] LAR AR dma Indirect:[ label] LAR AR, {ind} [, next ARP] Operands O :s: dma :s: 127 0 :s: auxiliary register AR :s: 7 0 :s; next ARP :s; 7 Execution (PC)+ 1 - PC (dma) - auxiliary register AR Encoding 15 14 13 12 11 10 9 8 7 6 5 4 3 2 0 Direct: I 0 0 0 I AR II 0 Data Memory Address Indirect: I o 0 0 I AR II 1 See Section 4.1 Description The contents of the specified data memory address are loaded into the desig- nated auxiliary register (AR). The LAR and SAR (store auxiliary register) instructions can be used to load and store the auxiliary registers during subroutine calls and interrupts. If an auxiliary register is not being used for indirect addressing, LAR and SAR en- able the register to be used as an additional storage register, especially for swapping values between data memory locations without affecting the con- tents of the accumulator. Words Cycles Cycle Timings for a Single Instruction Pl/DI Pl/DE PE/DI PE/DE PR/DI PR/DE 1 2+d 1+p 2+d+p 1 2+d Cycle Timings for a Repeat Execution n 2n+nd n+p 2n+nd+p n 2n+nd 4-90 Assembly Language Instructions Example 1 LAR AR0,DAT10 ;(DP= 4) Before Instruction After Instruction Data Memory 522 18h Data Memory 522 18h I ARO 6h ARO 18h I Example2 LARP AR4 LAR AR4,*- Before Instruction After Instruction Data Memory 617 32h Data Memory 617 32h I AR4 617h AR4 32h I Note: LAR, in the indirect addressing mode, ignores any AR modifications if the AR specified by the instruction is the same as that pointed to by the ARP. There- fore, in Example 2, AR4 is not decremented after the LAR instruction. 4-91 Syntax [label] LARK AR, constant Operands O s constant s 255 O s auxiliary register AR s 7 Execution (PC)+ 1 - PC 8-bit constant - auxiliary register AR Encoding 15 14 13 12 11 10 9 8 7 6 5 4 3 2 0 0 0 0 I AR 8-Bit Constant Description The 8-bit positive constant is loaded into the designated auxiliary register (AR) right-justified and zero-filled (that is, sign-extension suppressed). LARK is useful for loading an initial loop counter value into an auxiliary register for use with the SANZ instruction. Words Cycles Cycle Timings for a Single Instruction Pl/DI Pl/DE PE/DI PE/DE PR/DI PR/DE 1 1 1+p 1+p 1 1 Cycle Timings for a Repeat Execution not repeatable Example LARK AR0,15 Before Instruction After Instruction ARO Oh I ARO 15h I 4-92 Assembly Language Instructions Syntax [label] LARP constant Operands 0 s constant s 7 Execution (PC)+ 1 -+PC (ARP)-+ ARB Constant-+ ARP Affects ARP and ARB. Encoding 15 14 13 12 11 10 9 8 7 6 5 4 3 2 0 0 0 0 0 0 0 ARP Description The auxiliary register pointer is loaded with the contents of the three LSBs of the instruction (a 3-bit constant identifying the desired auxiliary register). The old ARP is copied to the ARB field of status register ST1 . ARP can also be mo- dified by the LST, LST1, and MAR instructions, as well as any instruction that is used in the indirect addressing mode. The LARP instruction is a subset of MAR; that is, the opcode is the same as MAR in the indirect addressing mode. The following instruction has the same effect as LARP: MAR *,constant Words Cycles Cycle Timings for a Single Instruction Pl/DI Pl/DE PE/DI PE/DE PR/DI PR/DE 1 1 1+p 1+p 1 1 Cycle Timings for a Repeat Execution n n n+p n+p n n Example LARP 1 ;Any succeeding instructions will use auxiliary ;register ARl for indirect addressing. 4-93 Pointer Syntax Direct: [label] LOP dma Indirect: [label] LOP {ind}[, next ARP] Operands O :s dma :s127 0 :s next ARP :s 7 Execution (PC)+ 1 - PC Nine LSBs of (dma) - data page pointer register (DP) status bits Affects DP. Encoding 15 14 13 12 11 10 9 8 7 6 5 4 3 2 0 Direct: I 0 0 0 0 0 II 0 Data Memory Address Indirect: I 0 0 0 0 0 II 1 See Section 4.1 Description The nine LSBs of the contents of the addressed data memory location are loaded into the DP (data memory page pointer) register. The DP and 7-bitdata memory address are concatenated to form 16-bit data memory addresses. The DP may also be loaded by the LST and LDPK instructions. Words Cycles Cycle Timings for a Single Instruction Pl/DI Pl/DE PE/DI PE/DE PR/DI PR/DE 1 2+d 1+p 2+d+p 1 2+d Cycle Timings for a Repeat Execution n 2n+nd n+p 2n+nd+p n 2n+nd Example LDP DAT127 ;(DP= 511) or LDP * ;If current auxiliary register contains 65535. Before Instruction After Instruction Data Memory I OFEDCh Data Memory I OFEDCh I 65535 -------~ 65535 -------~- DP~ DP~ 4-94 Assembly Language Instructions Syntax [label] LDPK constant Operands Os constants 511 Execution (PC)+ 1 - PC Constant - data memory page pointer (DP) status bits Affects DP. Encoding 15 14 13 12 11 10 9 8 7 6 5 4 3 2 0 0 0 a a I DP Description The DP (data memory page pointer) register is loaded with a 9-bit constant. The DP and 7-bit data memory address are concatenated to form 16-bit direct data memory addresses. DP :i: 8 specifies external data memory. DP = 4 through 7 specifies on-chip RAM blocks BO or B1. Block B2 is located in the upper 32 words of page 0. DP may also be loaded by the LST and LOP instruc- tions. Words Cycles Cycle Timings for a Single Instruction Pl/DI Pl/DE PE/DI PE/DE PR/DI PR/DE 1 1 1+p 1+p 1 1 Cycle Timings for a Repeat Execution not repeatable Example LDPK 64 ;The data page pointer is set to 64. 4-95 LPH Load Hig,_h P Register Syntax Direct: [label] LPH dma Indirect: [label] LPH {ind} [, next ARP] Operands 0 s dmas127 0 s next ARP s 7 Execution (PC)+ 1 .:..+PC (dma) -+ P register (31 - 16) Encoding 15 14 13 12 11 10 9 8 7 6 5 4 3 2 0 Direct: I 0 0 0 0 II 0 Data Memory Address Indirect: I 0 0 0 0 II 1 See Section 4.1 Description The P register high-order bits are loaded with the contents of data memory. The low-order P register bits are unaffected. The LPH instruction is particularly useful for restoring the high-order bits of the P register after subroutine calls or interrupts. Words Cycles Cycle Timings for a Single Instruction Pl/DI Pl/DE PE/DI PE/DE PR/DI PR/DE 1 2+d 1+p 2+d+p 1 2+d Cycle Timings for a Repeat Execution n 1+n+nd n+p 1+n+nd+p n 1+n+nd Example LPH DATO ; (DP = 4) or LPH * ;If current auxiliary register contains 512. Before Instruction After Instruction Data Memory 512 OF79Ch I Data Memory 512 OF79Ch I p 30079844h I p F79C9844h I 4-96 Assembly Language Instructions Syntax [label] LRLK AR, constant Operands O s auxiliary register s 7 O s constant s 65535 Execution (PC)+ 2 - PC Constant - AR Not affected by SXM; does not affect SXM. Encoding 15 14 13 12 11 10 9 8 7 6 5 4 3 2 0 0 o I AR I 0 0 0 0 0 0 0 0 I' 16-Bit Constant Description The 16-bit immediate value is loaded into the auxiliary register specified by the AR field. The specified constant must be an unsigned integer, and its value is not affected by SXM. Words 2 Cycles Cycle Timings for a Slngle Instruction Pl/DI Pl/DE PE/DI PE/DE PR/DI PR/DE 2 2 2+2p 2+2p 2 2 Cycle Timings for a Repeat Execution not repeatable Example LRLK AR3,3080h Before Instruction After Instruction AR3 7F80h I AR3 3080h I 4-97 Syntax Direct: [label] LST dma Indirect: [label] LST {ind} [, next ARP] Operands Os dma s 127 0 s next ARP s 7 Execution (PC)+ 1 - PC (dma) - status register STO Affects ARP, OV, OVM, and DP. Does not affect INTM or ARB. Encoding 15 14 13 12 11 10 9 8 7 6 5 4 3 2 0 Direct: Io 0 0 0 0 0 II 0 Data Memory Address Indirect: I o 0 0 0 0 0 II 1 See Section 4. 1 Description Status register STO is loaded with the addressed data memory value. Note that the INTM (interrupt mode) bit is unaffected by LST. ARB is also unaffected even though a new ARP is loaded. If a next ARP value is specified via the indi- rect addressing mode, the specified value is ignored. Instead, ARP is loaded with the value contained within the addressed data memory word. The LST instruction is used to load status register STO after interrupts and sub- routine calls. The STO contains the status bits: OV (overflow flag) bit, OVM (overflow mode) bit, INTM (interrupt mode) bit, ARP (auxiliary register pointer), and DP (data memory page pointer). These bits were stored (by the SST instruction) in the data memory word as follows: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 0 ARP I ov IOVM I I1NTM I 1 DP Words Cycles . Cvcle Timings for a Single Instruction Pl/DI Pl/DE PE/DI PE/DE PR/DI PR/DE 1 2+d 1+p 2+d+p 1 2+d Cycle Timings for a Repeat Execution -'- n 2n+nd n+p 2n+nd+p n 2n+nd 4-98 Assembly Language Instructions Example 1 LARP 0 LST *,l ;The data memory word addressed by the contents ;of auxiliary register ARO is loaded into ;status register STO, except for the INTM bit. ;Note that even though a next ARP value is ;specified, that value is ignored, and even ;though a new ARP is loaded, the old ARP is not ;loaded into ARB. Example2 LST 60h ; (DP = 0) Before Instruction After Instruction Data Memory 96 2404h Data Memory 96 2404h I STO 6EOOh STO 2604h I ST1 0580h ST1 0580h I Example3 LARP AR4 ; (AR4 3FFh) LST *- Before Instruction After Instruction AR4 3FFh AR4 3FEh I Data Memory 1023 OCE06h I Data Memory 1023 OCE06h I STO OFC04h I STO OCC06h I ST1 OE780h I ST1 OE780h I Example4 LARP AR4 ; (AR4= 3FFh) LST *-, 1 Before Instruction After Instruction AR4 3FFh AR4 3FEhI Data Memory 1023 OEE04h I Data Memory 1023 OEE04h I STO OEEOOh I STO OEE04h I ST1 OF780h I ST1 OF780h I 4-99 Syntax Direct: [label] LST1 dma Indirect: [label] LST1 {ind}[, next ARP] Operands Os dma s 127 0 s next ARP s 7 Execution (PC)+ 1 - PC (dma) - status register ST1 (ARB)-+ARP Affects ARP, ARB, CNF, TC, SXM, XF, FO, TXM, and PM. Affects C, HM, and FSM (TMS320C25) Encoding 15 14 13 12 11 10 9 8 7 6 5 4 3 2 0 Direct: Io 0 0 0 0 1 I I 0 Data Memory Address Indirect: Io 0 0 0 0 1 II 1 See Section 4.1 Description Status register ST1 is loaded with the data memory value. The bits of the data memory value, which are loaded into ARB, are also loaded into ARP to facili- tate context switching. Note that if a next ARP value is specified via the indirect addressing mode, the specified value is ignored. LST1 is used to load status bits after interrupts and subroutine calls. ST1 con- tains these status bits: ARB (auxiliary register pointer buffer), CNF (RAM con- figuration control), TC (test/control), SXM (sign-extension mode), XF (external flag), FO (serial port format), TXM (transmit mode), and the PM (product regis- ter shift mode). ST1 on the TMS320C25 also contains status bits: C (carry), HM (hold mode), and FSM (frame synchronization mode). The bits loaded into status register ST1 from the data memory word are as follows: 15 14 13 12 11 10 9 8 7 6 5 43210 ARB ICNF ti TC I SXM I c I 1 t On the TMS320C26, bits 12 and 7 hold CONFO and CNF1, respectively (see the CONF instruction for decoding). Words 4-100 Assembly Language Instructions Load Status ReFJ,,ister ST1 LST1 Cycles Cycle Timings for a Single Instruction Pl/DI Pl/DE PE/DI PE/DE PR/DI PR/DE 1 2+d 1+p 2+d+p 1 2+d Cycle Timings for a Repeat Execution n 2n+nd n+p 2n+nd+p n 2n+nd Example 1 LARP 3 LS Tl *- ;The data memory word addressed by the contents ;of auxiliary register AR3 replaces the status ;bits of status register STl, and AR3 is ;decremented. Example2 LSTl 61h ; (DP = 0) Before Instruction After Instruction Data Memory 97 0580h Data Memory 97 0580h I STO OACOOh STO OCOOh I ST1 0581h ST1 0580h I Example3 LARP AR4 ; (AR4 = 3FEh) LSTl *- Before Instruction After Instruction AR4 3FEh AR4 3FDh I Data Memory 1022 4F90h I Data Memory 1022 4F90h I STO OFC04h I STO 5C04h I ST1 OE780h I ST1 4F90h I 4-101 LST1 Load Status Register ST1 Example4 LARP AR4 ; (AR4 = 3FEh) LSTl *-, 1 Before Instruction After Instruction AR4 3FEh AR4 3FDh I Data Memory 1022 6190h I Data Memory 1022 6190h I STO OFE04h I STO 7E04h I ST1 0593h I ST1 6190h I 4-102 Assembly Language Instructions Syntax Direct: [label] LT dma Indirect: [label] LT {ind}[, next ARP] Operands Os dma s 127 0 s next ARP s 7 Execution (PC)+ 1 - PC (dma) - T register Encoding 15 14 13 12 11 10 9 8 7 6 5 4 3 2 0 Direct: Io O O O Io I Data Memory Address Indirect: _o__o_________o_o_ l...._1_._l_ _ _s_e_e_s_ec_t_io_n_4._1_ _ ___, ._I Description The T register is loaded with the contents of the specified data memory ad- dress (dma). The LT instruction may be used to load the T register in prepara- tion for multiplication. Seethe LTA, LTD, LTP, LTS, MPV, MPYK, MPYA, MPYS, and MPYU instructions. Words Cycles Cycle Timings for a Single Instruction Pl/DI Pl/DE PE/DI PE/DE PR/DI PR/DE 1 2+d 1+p 2+d+p 1 2+d Cycle Timings for a Repeat Execution n 1+n+nd n+p 1+n+nd+p n 1+n+nd Example LT DAT24 ; (DP = 8) or LT * ;If current auxiliary register contains 1048. Before Instruction After Instruction Data Memory 1048 62h Data Memory 1048 62h I T 3h T 62h I 4-103 LTA Load T Re2ister and Accumulate Previous Product Syntax Direct: [label] LTA dma Indirect: [label] LTA {ind}[, next ARP] Operands Os: dma s: 127 0 s: next ARP s: 7 Execution (PC)+ 1 - PC (dma) - T register (ACC) + (shifted P register) - ACC Affects OV; affected by OVM and PM. Affects C. Encoding 15 14 13 12 11 10 9 8 7 6 5 4 3 2 0 Direct:! o 0 0 1 II 0 Data Memory Address I Indirect: o 0 0 1 II 1 See Section 4.1 Description The T register is loaded with the contents of the specified data memory ad- dress (dma). The contents of the product register, shifted as defined by the PM status bits, are added to the accumulator, with the result left in the accumulator. The function of the LTA instruction is included in the LTD instruction. Words Cycles Cycle Timings for a Single Instruction Pl/DI Pl/DE PE/DI PE/DE PR/DI PR/DE 1 2+d 1+p 2+d+p 1 2+d Cycle Timings for a Repeat Execution n 1+n+nd n+p 1+n+nd+p n 1+n+nd 4-104 Assembly Language Instructions Load T Rei,ister and Accumulate Previous Product LTA Example LTA DAT36 ;(DP= 6, PM= 0) or LTA * ;If current auxiliary register contains 804. Before Instruction After Instruction Data Memory 804 62h Data Memory 804 62h I T 3h I T 62h I p OFh I p OFh I Acc01 Sh I Ace@) I 14h I c c 4-105 LTD Load T Register, Accumulate Previous Product, and Move Data Syntax Direct: [label] LTD dma Indirect: [label] LTD {ind}[, next ARP] Operands O :s: dma :s: 127 0 :s: next ARP :s: 7 Execution {PC)+ 1-+ PC {dma) -+ T register {dma) -+ dma + 1 {ACC) + {shifted P register) -+ ACC Affects OV; affected by OVM and PM. Affects C. Encoding 15 14 13 12 11 10 9 8 7 6 5 4 3 2 0 Direct:! o 0 1 II 0 Data Memory Address I Indirect: 0 0 II 1 See Section 4.1 Description The T register is loaded with the contents of the specified data memory ad- dress {dma). The contents of the P register, shifted as defined by the PM status bits, are added to the accumulator, and the result is placed in the accumulator. The contents of the specified data memory address are also copied to the next higher data memory address. This instruction is valid for blocks B1 and B2 and is also valid for block BO if block BO is configured as data memory. The data move function is continuous across the boundary of blocks BO and B1 but cannot be used with external data memory or memory-mapped registers. This function is described under the instruction DMOV. Note that if used with external data memory, the function of LTD is identical to that of LTA. Words Cycle Timings for a Single Instruction Pl/DI Pl/DE PE/DI PE/DE PR/DI PRIDE 1 2+d 1+p 2+d+p 1 2+d Cycle Timings for a Repeat Execution n 1+n+nd n+p 1+n+nd+p n 1+n+nd 4-106 Assembly Language Instructions Example LTD DAT126 ;(DP= 7, PM= 0) or LTD * ;If current auxiliary register contains 1022. Before Instruction After Instruction Data Memory 1022 62h Data Memory 1022 62h I Data Data Memory 1023 Oh Memory 1023 62h I T 3h I T 62hI p OFh I p OFh I Ace GI Sh I Ace@] I 14h I c c 4-107 Syntax Direct: [label] LTP dma Indirect: [label] LTP {ind} [, next ARP] Operands Os dma s 127 0 s next ARP s 7 Execution (PC)+ 1 - PC (dma) - T register (shifted P register) - ACC Affected by PM. Encoding 15 14 13 12 11 10 9 8 7 6 5 4 3 2 0 Direct: I 0 0 0 Io I Data Memory Address Indirect: I 0 0 0 l I 1 See Section 4.1 Description The T register is loaded with the contents of the addressed data memory loca- tion, and the product register is stored in the accumulator. The shift at the out- put of the product register is controlled by the PM status bits. Words 1 Cycles Cycle Timings for a Single Instruction Pl/DI Pl/DE PE/DI PE/DE PR/DI PR/DE 1 2+d 1+p 2+d+p 1 2+d Cycle Timings for a Repeat Execution n 1+n+nd n+p 1+n+nd+p n 1+n+nd Example LTP DAT36 ;(DP= 6, PM= 0) or LTP * ;If current auxiliary register contains 804. Before Instruction After Instruction Data Data Memory 804 62h Memory 804 62h I T T 62h I p OFh I p OFh I Ace E) _ l_ _ _ s__.hI ACC~I Fh I c c 4-108 Assembly Language Instructions LTS Load T Register and Subtract Previous Product Example LTS DAT36 ;(DP= 6, PM= 0) or LTS * ;If current auxiliary register contains 804. Before Instruction After Instruction Data Memory 804 62h Data Memory 804 62h I T 3h I T 62h I p OFh I p OFh I ACC E1 c I 5h I Acc~I c OFFFFFFF6hl 4-11 o Assembly Language Instructions Syntax Direct: [label] MAC pma, dma Indirect: [label] MAC pma, {ind} [, next ARP] Operands O :s pma :s 65535 0 :s dma :s127 0 :s next ARP :s 7 Execution TMS320C25: (PC)+ 2- PC (PFC) - MCS (pma) - PFC If (repeat counter) .. 0: Then (ACC) + (shifted P register) - ACC, (dma) - T register, (dma) x (pma, addressed by PFC) - P register, Modify AR(ARP) and ARP as specified, (PFC) + 1 - PFC, (repeat counter) - 1 - repeat counter. Else (ACC) + (shifted P register) - ACC (dma) - T register {dma) x (pma, addressed by PFC) - P register Modify AR(ARP) and ARP as specified. (MCS) - PFC Affects C and OV; affected by OVM and PM. Encoding 15 14 13 12 11 10 9 8 7 6 5 4 3 2 0 Direct: O 0 Data Memory Address Program Memory Address Indirect: 0 0 See Section 4.1 Program Memory Address Description The MAC instruction multiplies a data memory value (specified by dma) by a program memory value (specified by pma). It also adds the previous product, shifted as defined by the PM status bits, to the accumulator. The data and program memory locations on the TMS320C25 may be any non- reserved, on-chip or off-chip memory locations. If the program memory is block BO of on-chip RAM, then the CNF bit must be set to one. Note that the upper eight bits of the program memory address should be set to OFFh in order to address BO program RAM, and the upper six bits of dma should be set to 0 to address a location below 1024. When used in the direct addressing mode, the dma cannot be modified during repetition of the instruction. 4-111 MAC Multiply and Accumulate When the MAC instruction is repeated, the program memory address con- tained in the PC/PFC is incremented by one during its operation. This enables accessing a series of operands in memory. MAC is useful for long sum-of- products operations, since MAC becomes a single-cycle instruction once the RPT pipeline is started. Words 2 Cycles Cycle Timings for a Single Instruction Pl/DI 1 Pl/DE l PE/DI 1 PE/DE 1 PR/DI J PR/DE Table in on-chip RAM: 3 4+d 4+2p 5+d+2p 4 5+d Table in on-chip ROM: 4 5+d 4+2p 5+d+2p 4 5+d Table in external memory: 4+p 5+d+p 4+3p 5+d+3p 4+p 5+d+p Cycle Timings for a Repeat Execution Table in on-chip RAM: 2+n 2+2n+nd 3+n+2p 3+2n+nd+2p 3+n 3+2n+nd Table in on-chip ROM: 3+n 3+2n+nd 3+n+2p 3+2n+nd+2p 3+n 3+2n+nd Table in external memory: 3+n+np 3+2n+nd 3+n+np 3+2n+nd+p 3+n+np 3+2n+nd +np +2p +2p +np 4-112 Assembly Language Instructions Example SPM 3 ;Select a shift-right-by-6 mode on PR output. ;on PR output. CNFP ;Configure block BO as program memory ; ( OFFXXh). LARP 1 ;Use ARl to address block Bl. LRLK 1,768 ;Point to lowest location in RAM block Bl RPTK 255 ;Compute 256 sum-of-product operations. MAC OFFOOh,*+ ;Multiply/accumulate and increment ARl. The following example shows register and memory contents before and after the third step repeat loop: Before Instruction After Instruction AA1 302h I AA1 303h I APT OFDh I APT OFCh I PC/PFC OFF02h I PC/PFC OFF03h I Data Memory 770 23h I Data Memory 770 23h I Program Memory 65282 OFAAAh I Program Memory 65282 OFAAAh I p 458972h I p OFFFF453Eh I ACC 01 723EC41h I Ace@] I 7250266hl c c 4-113 MACO Multiply a~d Accumulate With D~J:..,Move Syntax Direct: [label] MACO pma, dma Indirect: [label] MACO pma, {ind} [, next ARPJ Operands O :s: pma :s: 65535 O :s: dma :s: 127 0 :s: next ARP s 7 Execution TMS320C25: (PC}+ 2 - PC (PFC)- MCS (pma) - PFC If (repeat counter) "' 0: Then (ACC) + (shifted P register) - ACC, (dma) - T register, (dma) x (pma, addressed by PFC) - P register, (dma) - dma + 1, Modify AR(ARP) and ARP as specified, (PFC} + 1 - PFC, (repeat counter) - 1 - repeat counter. Else (ACC) + (shifted P register) - ACC (dma) -T register, (dma) x (pma, addressed by PFC) - P register (dma) - dma + 1, Modify AR(ARP) and ARP as specified. (MCS) - PFC Affects C and OV; affected by OVM and PM. Encoding 15 14 13 12 11 10 9 8 7 6 5 4 3 2 0 Direct: o 0 0 0 l l 0 Data Memory Address Program Memory Address Indirect: O 0 0 0 l l 1 See Section 4.1 Program Memory Address Description The MACO instruction multiplies a data memory value (specified by dma) by a program memory value (specified by pma). It also adds the previous product, shifted as defined by the PM status bits, to the accumulator. The data and program memory locations on the TMS320C25 may be any non- reserved, on-chip or off-chip memory locations. If the program memory is block BO of on-chip RAM, then the CNF bit must be set to one. Note that the upper eight bits of the program memory address should be set to OFFh in order 4-114 Assembly Language Instructions Multiply and Accumulate With Data Move MACO to address BO program RAM, and the upper six bits of dma should be set to Oto address a location below 1024. When used in the direct addressing mode, the dma cannot be modified during repetition of the instruction. If MACO ad- dresses one of the memory-mapped registers or external memory as a data memory location, the effect of the instruction will be that of a MAC instruction (see the OMOV instruction description). MACO functions in the same manner as MAC, with the addition of data move for block BO, B1, or B2. Otherwise, the effects are the same as for MAC. This feature makes MACO useful for applications such as convolution and trans- versal filtering. When the MACO instruction is repeated, the program memory address con- tained in the PC/PFC is incremented by one during its operation. This enables accessing a series of operands in memory. When used with RPT or RPTK, MACO becomes a single-cycle instruction, once the RPT pipeline is started. Note: The data move function for MACO can occur only within the data blocks BO - B2 of the on-chip RAM. B3 can also be used for the TMS320C26. Words 2 Cycles Cycle Timings for a Single Instruction Pl/DI J Pl/DE _l PE/DI l PE/DE l PR/DI l PR/DE Table in on-chip RAM: 3 4+d 4+2p 5+d+2p 4 5+d Table in on-chip ROM: 4 5+d 4+2p 5+d+2p 4 5+d Table in external memory: 4+p 5+d+p 4+3p 5+d+3p 4+p 5+d+p Cycle Timings for a Repeat Execution Table in on-chip RAM: 2+n 2+2n+nd 3+n+2p 3+2n+nd+2p 3+n 3+2n+nd Table in on-chip ROM: 3+n 3+2n+nd 3+n+2p 3+2n+nd+2p 3+n 3+2n+nd Table in external memory: 3+n+np 3+2n+nd 3+n+np 3+2n+nd+np 3+n+np 3+2n+nd +np +2p +2p +np 4-115 MACO Multiply and Accumulate With Data Move Example SPM 0 ;Select no shift mode on PR output. SOVM ;Set overflow mode. CNFP ;Configure block BO as program memory ; ( OFFXXh). LARP 3 ;Use AR3 to address block Bl. LRLK 3,1023 ;Point to highest location in RAM block Bl. RPTK 255 ;Compute 1 sample of a length-256 ;convolution. MACO OFFOOh,*- ;Multiply/accumulate, shift data word in ;block Bl and decrement AR3. The following example shows register and memory contents before and after the third step repeat loop: Before Instruction After Instruction AR1 3FDh I AR1 3FChl RPT OFDh I RPT OFChl PC/PFC OFF02h I PC/PFC OFF03h I Data Memory 1021 23h I Data Memory 1021 23h I Data Memory 1022 7FCh I Data Memory 1022 23h I Program Memory 65282 OFAAAh I Program Memory 65282 OFAAAh I p 458972hl p OFFFF453Eh I ACC ~I 723EC41hl Acc~l 76975B3h I c c 4-116 Assembly Language Instructions Syntax Direct: [label] MAR dma Indirect: [label] MAR {ind} [, next ARP] Operands 0 s dmas127 0 s next ARP s 7 Execution (PC)+ 1 - PC Modifies ARP, AR(ARP) as specified by the indirect addressing field (acts as a NOP in direct addressing). Encoding 15 14 13 12 11 10 9 8 7 6 5 4 3 2 0 Direct:! o 0 0 0 1 II 0 Data Memory Address Indirect: I o 0 0 0 1 II 1 See Section 4.1 Description The MAR instruction acts as a no-operation instruction in the direct addressing mode. In the indirect addressing mode, the auxiliary registers and the ARP are modified; however, no use is made of the memory being referenced. MAR is used only to modify the auxiliary registers or the ARP. If a next ARP is specified, the old ARP is copied to the ARB field of status register ST1 . Note that any op- eration that MAR performs can also be performed with any instruction that sup- ports indirect addressing. ARP may also be loaded by an LST instruction. In the direct addressing mode, MAR is a NOP. Also, the instruction LARP is a subset of MAR (that is, MAR *,4 performs the same function as LARP 4). Words 1 Cycles Cycle Timings for a Single Instruction Pl/DI Pl/DE PE/DI PE/DE PR/DI PR/DE 1 1 1+p 1+p 1 1 Cycle Timings for a Repeat Execution n n n+p n+p n n 4-117 Example 1 MAR *,l ;Load the ARP with 1. Before Instruction After Instruction ARP 0 ARP Example2 MAR *- ;Decrement current auxiliary register (in this ;case, ARl). Before Instruction After Instruction AR1 35h AR1 34h I Example3 MAR *+,5 ;Increment current auxiliary register (ARl) and ;load ARP with 5. Before Instruction After Instruction AR1 34h AR1 ARP ARP 5 4-118 Assembly Language Instructions Multiely MPV Syntax Direct: [label] MPV dma Indirect: [label] MPV {ind} [, next ARPJ Operands o s dma s 127 0 s next ARP s 7 Execution (PC)+ 1-+ PC (T register) x (dma) - P register Encoding 15 14 13 12 11 10 9 8 7 6 5 4 3 2 0 Direct: I 0 0 0 0 0 II 0 Data Memory Address Indirect: I 0 0 0 0 0 II 1 See Section 4. 1 Description The contents of the T register are multiplied by the contents of the addressed data memory location. The result is placed in the P register. Words 1 Cycles Cycle Timings for a Slngle Instruction Pl/DI Pl/DE PE/DI PE/DE PR/DI PR/DE 1 2+d 1+p 2+d+p 1 2+d Cycle Timings for a Repeat Execution n 1+n+nd n+p 1+n+nd+p n 1+n+nd Example MPY DAT13 HOP = 8) or MPY * ;If current auxiliary register contains 1037. Before Instruction After Instruction Data Memory 1037 7h Data Memory 1037 7h I T 6h T 6h I p 36h I p 2Ahl 4-119 Syntax Direct: [label] MPYA dma Indirect: [label] MPYA {ind} [, next ARPJ Operands O:s dma :s 127 0 :s next ARP :s 7 Execution (PC)+ 1 - PC (ACC) + (shifted P register) - ACC (T register) x (dma) - P register Affects C and OV; affected by OVM and PM. Encoding 15 14 13 12 11 10 9 8 7 6 5 4 3 2 0 Direct: I 0 0 0 0 II 0 Data Memory Address Indirect: I 0 0 0 1 0 I I See Section 4.1 Description The contents of the T register are multiplied by the contents of the addressed data memory location. The result is placed in the P register. The previous prod- uct, shifted as defined by the PM status bits, is also added to the accumulator. Words Cycles Cycle Timings for a Single Instruction Pl/DI Pl/DE PE/DI PE/DE PR/DI PR/DE 1 2+d 1+p 2+d+p 1 2+d Cycle Timings for a Repeat Execution n 1+n+nd n+p 1+n+nd+p n 1+n+nd Example MPYA DAT13 ;(DP; 6, PM; 0) or MPYA * ;If current auxiliary register contains 781. Before Instruction After Instruction Data Data Memo~ ?h ~.1emcr; 781 781 T Sh I T p 36h I p ACC 01 54h I ACC@] .__I_ _ _ 8A__,h I c c 4-120 Assembly Language Instructions Syntax [label] MPYK constant Operands -4096 s constant s 4095 -212 s constants 212 - 1 Execution (PC)+ 1 - PC (T register) x constant - P register Not affected by SXM. Encoding 15 14 13 12 11 10 9 8 7 6 5 4 3 2 0 I 1 a 13-Bit Constant Description The contents of the T register are multiplied by the signed, 13-bit constant. The result is loaded into the P register. The immediate field is right-justified and sign-extended before multiplication, regardless of SXM. Words Cycles Cycle Timings for a Slngle Instruction Pl/DI Pl/DE PE/DI PE/DE PR/DI PR/DE 1 1 1+p 1+p 1 1 Cycle Timings for a Repeat Execution not repeatable Example MPYK -9 Before Instruction After Instruction T 7h T 7h I p 2Ah I p OFFFFFFC1hl 4-121 MPYS Mult~l"t_ and s~_.b_tra_c_t_P_re_v:_io_u_s_P_ro_d_u_ct______________________ Syntax Direct: [label] MPYS dma Indirect: [label] MPYS {ind} [, next ARPJ Operands Os dma s 127 0 s next ARP s 7 Execution (PC)+ 1 - PC (ACC) - (shifted P register) - ACC {T register) x (dma) - P register Affects C and OV; affected by OVM and PM. Encoding 15 14 13 12 11 10 9 8 7 6 5 4 3 2 0 Direct: I O 0 0 Io I Data Memory Address lndirect:._j_o__o________ o____..l_1_._l_ _ _s_e_e_s_ect_io_n_4_.1_ _ ___. Description The contents of the T register are multiplied by the contents of the addressed data memory location. The result is placed in the P register. The previous prod- uct, shifted as defined by the PM status bits, is also subtracted from the accu- mulator. Words 1 Cycles Cycle Timings for a Slngle Instruction Pl/DI Pl/DE PE/DI PE/DE PR/DI PR/DE 1 2+d 1+p 2+d+p 1 2+d Cycle Timings for a Repeat Execution n 1+n+nd n+p 1+n+nd+p n 1+n+nd Example MPYS DAT13 ;(DP= 6, PM= 0) or MPYS * ;If current auxiliary register contains 781. Before Instruction After Instruction Data Data ~.4emory ?h I ~.4emory 781 781 T T p 36h I p Ace G c . _ I_ _ _ _ s_4h_.I ACC @JI._____1E__,hI c 4-122 Assembly Language Instructions Syntax Direct: [label] MPYU dma Indirect: [label] MPYU {ind}[, next ARP] Operands Os dma s 127 0 s next ARP s 7 Execution (PC)+ 1 -+PC Unsigned (T register) x unsigned (dma) -+ P register Encoding 15 14 13 12 11 10 9 8 7 6 5 4 3 2 0 Direct: I 1 0 0 II 0 Data Memory Address Indirect: I 1 0 0 II 1 See Section 4. 1 Description The unsigned contents of the T register are multiplied by the unsigned con- tents of the addressed data memory location. The result is placed in the P reg- ister. Note that the multiplier acts as a 17 x17-bit signed multiplier for this instruction, with the MSB of both operands forced to zero. The shifter at the output of the P register will always invoke sign-extension on the P register when PM= 3 (right-shift by 6 mode). Therefore, this shift mode should not be used if unsigned products are desired. The MPYU instruction is particularly useful for computing multiple-precision products, such as when multiplying two 32-bit numbers to yield a 64-bit prod- uct. Words 1 Cycles Cycle Timings for a Slngle Instruction Pl/DI Pl/DE PE/DI PE/DE PR/DI PR/DE 1 2+d 1+p 2+d+p 1 2+d Cycle Timings for a Repeat Execution n 1+n+nd n+p 1+n+nd+p n 1+n+nd 4-123 MPYU Multiplr, Unsigned Example MPYU DAT16 ; (DP = 4) or MPYU * ;If current auxiliary register contains 528. Before Instruction After Instruction Data Memory 528 OFFFFh Data Memory 528 OFFFFh I T OFFFFh I T OFFFFh I p 1h I p OFFFE0001 h I 4-124 Assembly Language Instructions ---------------------==--='""""""""'*'=--=--NegateAccumulator NEG Syntax [label] NEG Operands None Execution (PC)+ 1 - PC (ACC) x-1 -ACC Affects OV; affected by OVM. Affects C. Encoding 15 14 13 12 11 10 9 8 7 6 5 4 3 2 0 I 1 0 0 0 0 0 0 0 0 Description The contents of the accumulator are replaced with its arithmetic complement (2s complement). The OV bit is set when taking the NEG of 80000000h. If OVM = 1, the accumulator contents are replaced with 7FFFFFFFh. If = OVM 0, the result is 80000000h. The carry bit C on the TMS320C2x is reset to zero by this instruction for all nonzero values of the accumulator and is set to one if the accumulator equals zero. Words 1 Cycles Cycle Timings for a Slngle Instruction Pl/DI Pl/DE PE/DI PE/DE PR/DI PR/DE 1 1 1+p 1+p 1 1 Cycle Timings for a Repeat Execution n n n+p n+p n n Example NEG Before Instruction After Instruction Ace 0c .I. __ o_FF_FF_F_22_ah_,I Ace@) .... c I ___o_oo_a_,hI 4-125 Syntax [label] NOP Operands None Execution (PC)+ 1-+ PC Encoding 15 14 13 12 11 10 9 8 7 6 5 4 3 2 0 Io 0 0 0 1 0 0 0 0 0 0 0 0 I Description No operation is performed. The NOP instruction affects only the PC. NOP functions in the same manner as the MAR instruction in the direct addressing mode; NOP has the same opcode as MAR in the direct addressing mode with dma = 0. The NOP instruction is useful as a pad or temporary instruction during program development. Words Cycles Cycle Timings for a Single Instruction Pl/DI Pl/DE PE/DI PE/DE PR/DI PR/DE 1 1 1+p 1+p 1 1 Cycle Timings for a Repeat Execution n n n+p n+p n n Example NOP 4-126 Assembly Language Instructions Syntax [label] NORM {ind} (TMS320C25) Operands None Execution TMS320C25: (PC)+ 1 - PC If (ACC) 0: = Then 1 -TC; Else, if (ACC(31)) XOR (ACC(30)) = 0: Then a-re, (ACC) x 2 - ACC, Modify AR(ARP) as specified; Else 1 -re. Affects TC. Encoding 15 14 13 12 11 10 9 8 7 6 5 4 3 2 0 0 0 1 0 1 I Modify AR Io 0 Description The NORM instruction is provided for normalizing a signed number that is con- tained in the accumulator. Normalizing a fixed-point number separates it into a mantissa and an exponent. To do this, the magnitude of a sign-extended number must be found. ACC bit 31 is exclusive-ORed with ACC bit 30 to deter- mine if bit 30 is part of the magnitude or part of the sign extension. If they are the same, they are both sign bits, and the accumulator is left-shifted to elimi- nate the extra sign bit. The AR(ARP) is modified as specified to generate the magnitude of the expo- nent. It is assumed that AR(ARP) is initialized before the normalization begins. The default modification of the AR(ARP) is an increment. Multiple executions of the NORM instruction may be required to completely normalize a 32-bit number in the accumulator. Although using NORM with APT or RPTK does not cause execution of NORM to fall out of the repeat loop automatically when the normalization is complete, no operation is performed for the remainder of the repeat loop. Note that NORM functions on both posi- tive and negative 2s-complement numbers. Words 1 Cycles 4-127 NORM Normalize Contents of Accumulator Cycle Timings for a Single Instruction Pl/DI Pl/DE PE/DI PE/DE PR/DI PR/DE 1 1 1+p 1+p 1 1 Cycle Timings for a Repeat Execution n n n+p n+p n n Example 1 31-Bit Normalization: LARP 1 ;Use ARl for exponent storage. LARK 1,0 ;Clear out exponent counter. LOOP NORM *+ ;One bit is normalized. BBZ LOOP ;If TC = O, magnitude not found yet. Example2 15-Bit Normalization: ARP 1 ;Use ARl to store the exponent. LARKl,15 ;Initialize exponent counter. RPTK 14 ;15-bit normalization is specified ;(yielding a 4-bit exponent and ;16-bit mantissa). NORM*- ;NORM automatically stops shifting ;when the first significant magnitude ;bit is found, performing NOPs for ;the remainder of the repeat loop. The first method is used to normalize a 32-bit number and yields a 5-bit expo- nent magnitude. The second method is used to normalize a 16-bit number and yields a 4-bit exponent magnitude. If the number requires only a small amount of normalization, the first method may be preferable to the second. This results because Example 1 runs only until normalization is complete. Example 2 al- ways executes all 15 cycles of the repeat loop. Specifically, Example 1 is more efficient if the number requires five or less shifts. If the number requires six or more shifts, Example 2 is more efficient. 4-128 Assembly Language Instructions Syntax Direct: [label] OR dma Indirect: [label] OR {ind}[. next ARPJ Operands Q:s; dma:s; 127 0 :s; next ARP :s; 7 Execution (PC)+ 1 - PC (ACC(15-0)) OR dma - ACC(15-0) (ACC(31-16)) -ACC(31-16) Not affected by SXM. Encoding 15 14 13 12 11 10 9 8 7 6 5 4 3 2 0 Direct: I 0 0 0 0 1 I I 0 Data Memory Address Indirect: I 0 0 0 0 1 I I 1 See Section 4.1 Description The low-order bits of the accumulator are ORed with the contents of the ad- dressed data memory location. The high-order bits of the accumulator are ORed with all zeros. Therefore, the upper half of the accumulator is unaffected by this instruction. Words Cycles Cycle Timings for a Single Instruction Pl/DI Pl/DE PE/DI PE/DE PR/DI PR/DE 1 2+d 1+p 2+d+p 1 2+d Cycle Timings for a Repeat Execution n 1+n+nd n+p 1+n+nd+p n 1+n+nd Example OR OATS ; (DP = 8) or OR* ;Where current auxiliary register contains ;1032. Before Instruction After Instruction Data Memory 1032 OFOOOh Data Memory 1032 OFOOOh I Acc~I 100002h I Ace DI 10F002h I c c 4-129 ORK OR Immediate With Accumulator With Shift Syntax [label] ORK constant [,shift] Operands 16-bit constant O :s shift :s 15 (defaults to 0) Execution (PC)+ 2- PC {ACC{30-0)) OR [constant x 2shift] - ACC{30-0) (ACC{31)) - ACC{31) Not affected by SXM. Encoding 15 14 13 12 11 10 9 8 7 6 5 4 3 2 0 I' 0 Shift 16-Bit Constant 0 0 0 0 0 0 Description The left-shifted 16-bit immediate constant is ORed with the accumulator. The result is left in the accumulator. Low-order bits below and high-order bits above the shifted value are treated as zeroes. The corresponding bits of the accumu- lator are unaffected. Note that the most significant bit of the accumulator is not affected, regardless of the shift code value. Words 2 Cycles Cycle Timings for a Slngle Instruction Pl/DI I Pl/DE I PE/DI I PE/DE I PR/DI I PR/DE 2 J 2 l 2+2p I 2+2p I 2 I 2 Cycle Timings for a Repeat Execution not repeatable Example ORK OFFFFh, 8 Before Instruction After Instruction ACC ~I . .___ 12_34_s_s1_sh__.I ACC ~ 1...._ _1_2_FF_F_F1_sh....I c c 4-130 Assembly Language Instructions Syntax Direct: [label] OUT dma, PA Indirect: [label] OUT {ind}, PA [, next ARP] Operands Os dma s 127 0 s next ARP s 7 O s port address PA s 15 Execution (PC)+ 1-+ PC Port address PA -+ address bus A3 - AO O -+ address bus A 15 - A4 (dma) -+data bus D15 - DO Encoding 15 14 13 12 11 10 9 8 7 6 5 4 3 2 0 Direct: I 0 Port Address 0 Data Memory Address Indirect: I 0 Port Address II 1 See Section 4.1 Description The OUT instruction writes a 16-bit value from a data memory location to the specified 1/0 port. The TS line goes low to indicate an 1/0 access, and the STRB, R/W, and READY timings are the same as for an external data memory write. OUT is a single-cycle instruction when in the Pl/DI memory configuration (see Appendix E). Words 1 Cycles Cycle Timings for a Slngle Instruction Pl/DI Pl/DE PE/DI PE/DE PR/DI PR/DE 1+i 2+d+i 2+p+i 3+d+p+i 1+i 2+d+i Cycle Timings for a Repeat Execution n+ni 2n+nd+ni 1+n+p+ni 1+2n+nd+p n+ni 2n+nd+ni +ni Example OUT 78h,7 ;(DP= 4) Output data word stored in data ;memory location 78h to peripheral on port ;address 7. or OUT *,OFh ;Output data word referenced by current ;auxiliary register to peripheral on port ;address OFh. 4-131 Syntax [label] PAC Operands None Execution (PC)+ 1 - PC (shifted P register) - ACC Affected by PM. Encoding 15 14 13 12 11 10 9 8 7 6 5 4 3 2 0 I 1 0 0 0 0 0 0 0 0 0 Description The contents of the P register are loaded into the accumulator, shifted as spe- cified by the PM status bits. Words Cycles Cycle Timings for a Single Instruction Pl/DI l Pl/DE l PE/DI l PE/DE l PR/DI l PR/DE 1 I 1 I 1+p l 1+p I 1 l 1 Cycle Timings for a Repeat Execution n I n I n+p I n+p I n I n Example PAC ; (PM = 0) Before Instruction After Instruction p 144h p 144h I ACCG I 23h I Ace GI 144h I c c 4-132 Assembly Language Instructions Syntax [label] POP Operands None Execution (PC)+ 1 - PC (TOS) - ACC(15 - 0) 0 -ACC(31 -16) Pop stack one level. Encoding 15 14 13 12 11 10 9 8 7 6 5 4 3 2 0 I 1 0 0 0 0 0 0 o 1 I Description The contents of the top of the stack (TOS) are copied to the low accumulator, and the stack is popped after the contents are copied. The upper half of the accumulator is set to all zeros. The hardware stack is a last-in, first-out stack with eight (TMS320C2x) loca- tions. Any time a pop occurs, every stack value is copied to the next higher stack location, and the top value is removed from the stack. After a pop, the bottom two stack words will have the same value. Because each stack value is copied, if more than seven pops (due to POP, POPD, or RET instructions) occur before any pushes occur, all levels of the stack contain the same value. No provision exists to check stack underflow. Words 1 Cycles Cycle Timings for a Single Instruction Pl/DI I Pl/DE l PE/DI l PE/DE l PR/DI l PR/DE 1 l 1 l 1+p l 1+p l 1 l 1 Cycle Timings for a Repeat Execution n I n I n+p I n+p I n I n Example POP Before Instruction After Instruction ACC Elc I 82h I ACC@] I 45h I c Stack 45h Stack 16h 16h 7h 7h 33h 33h 42h 42h 56h 56h 37h 37h 61h 61h 61h 4-133 POPD Pop Toe_ of Stack to Data Memo[X,, Syntax Direct: [label] POPD dma Indirect: [label] POPD {ind} [, next ARPJ Operands Os dma s 127 0 s next ARP s 7 Execution (PC)+ 1 - PC (TOS) -dma POP stack one level. Encoding 15 14 13 12 11 10 9 8 7 6 5 4 3 2 0 l Direct: ...._o____________ 0 II 0 __.._..__ 0 __________ Data Memory Address __, I_o_____________...._..__ Indirect: ... I I _____________, 0 0 1 See Section 4.1 Description The value from the top of the stack is transferred into the data memory location specified by the instruction. The values are also popped in the lower seven locations (TMS320C2x) of the stack. The hardware stack is described in the previous instruction POP. The lowest stack location remains unaffected. No provision exists to check stack underflow. Words 1 Cycles Cycle Timings for a Single Instruction Pl/DI I Pl/DE I I PE/DE I PR/DI I PE/DI PR/DE 1 I 1+d I 1+p I 2+d+p I 1 l 1+d Cycle Timings for a Repeat Execution n l n+nd l n+p J 1+n+nd+p J n l n+nd Example POPD DAT100 ; (DP = 8) or POPD * ;If current auxiliary register contains 1124. Before Instruction After Instruction Data lA,f!'•u·n nru l'llWlllVl1 ssh I Data ~llemor1 1124 1124 Stack 92h Stack 72h 72h Sh Sh 44h 44h 81h 81h 75h 75h 32h 32h OAAh OAAh OAAh 4-134 Assembly Language Instructions PSHD ; ; ~; Syntax Direct: [label] PSHD dma Indirect: [label] PSHD {ind} [, next ARP] Operands O :s: dma :s: 127 0 :s: next ARP- 7 Execution (dma) -TOS (PC)+ 1 - PC Push all stack locations down one level. Encoding 15 14 13 12 11 10 9 8 7 6 5 4 3 2 0 Direct: I0 0 0 0 0 II0 Data Memory Address Indirect: I o 0 0 0 0 II1 See Section 4.1 Description The value from the data memory location specified by the instruction is trans- ferred to the top of the stack. The values are also pushed down in the lower seven locations (TMS320C2x) of the stack, as described in the instruction PUSH. The lowest stack location is lost. Words Cycles Cycle Timings for a Single Instruction Pl/DI l Pl/DE I I PE/DE I PR/DI I PE/DI PR/DE 1 l 2+d l l 2+d+p l 1 l 1+p 2+d Cycle Timings for a Repeat Execution n I 1+n+nd I n+p J 1+n+nd+p J n I 1+n+nd Example PSHD DAT127 ;(DP= 3) or PSHD * ;If current auxiliary register contains 511. Before Instruction After Instruction Data Memory 511 65h I Data Memory 511 65h I Stack 2h Stack 65h 33h 2h 78h 33h 99h 78h 42h 99h 50h 42h Oh 50h Oh Oh 4-135 PUSH Push Low Accumulator Onto Stack Syntax [label] PUSH Operands None Execution (PC)+ 1 - PC Push all stack locations down one level. (ACC(15-0)) - TOS Encoding 15 14 13 12 11 10 9 8 7 6 5 4 3 2 0 11 0 0 0 0 0 0 o o I Description The contents of the lower half of the accumulator are copied onto the top of the hardware stack. The stack is push~d down before the accumulator value is copied. The hardware stack is a last-in, first-out stack with eight locations (TMS320C2x). If more than eight pushes (due to CALA, CALL, PSHD, PUSH, or TRAP instructions) occur before a pop, the first data values written will be lost with each succeeding push. Words Cycles Cycle Timings for a Single Instruction Pl/DI l Pl/DE l PE/DI l PE/DE l PR/DI l PR/DE 1 l 1 I 1+p 1 1+p 1 1 I 1 Cycle Timings for a Repeat Execution n I n I n+p 1 n+p 1 n I n Example PUSH: Before Instruction After Instruction ACC 01 7h I ACC GI 7h I Stack C I 2h 5h I Stack c I 7h 2h I ;:in on Oh 3h 12h Oh 86h 12h 54h 86h 3Fh 54h 4-136 Assembly Language Instructions Syntax [label] RC Operands None Execution (PC)+ 1 - PC 0 - carry bit C in status register ST1 Affects C. Encoding 15 14 13 12 11 10 9 8 7 6 5 4 3 2 0 11 0 0 0 0 0 0 0 0 0 Description The carry bit C in status register ST1 is reset to logic zero. The carry bit may also be loaded directly by the LST1 and SC instructions. Words Cycles Cycle Timings for a Single Instruction Pl/DI 1 Pl/DE I PE/DI J PE/DE I PR/DI I PR/DE 1 l 1 l 1+p l 1+p l 1 l 1 Cycle Timings for a Repeat Execution n 1 n l n+p l n+p l n l n Example RC ;The carry bit C is reset to logic zero. 4-137 RET Return From Subroutine Syntax [label] RET Operands None Execution (TOS)-+ PC Pop stack one level. Encoding 15 14 13 12 11 10 9 8 7 6 5 4 3 2 0 I 1 0 0 0 0 0 1 0 0 0 Description The contents of the top stack register are copied into the program counter. The stack is then popped one level. RET is used with CALA and CALL for subrou- tines. Words 1 Cycles Cycle Timings for a Single Instruction Pl/DI 1 Pl/DE l PE/DI l PE/DE 1 PR/DI 1 PR/DE Destination on-chip RAM: 2 2 2+p 2+p 2 2 Destination on-chip ROM: 3 3 3+p 3+p 3 3 Destination external memory: 3+p 3+p 3 + 2p 3 + 2p 3+p 3+p Cycle Timings for a Repeat Execution not repeatable Example RET Before Instruction After Instruction PC 96hl PC 37h I Stack 37h Stack 45h 45h 75h 75h 21h 21h 3Fh 3Fh 45h 45h 6Eh 6Eh 6Eh 6Eh 6Eh 4-138 Assembly Language Instructions Syntax [label] RFSM Operands None Execution (PC)+ 1-+ PC O - FSM status bit in status register ST1 Affects FSM. Encoding 15 14 13 12 11 10 9 8 7 6 5 4 3 2 0 11 0 0 0 0 0 0 0 Description The RFSM status bit resets the FSM status bit to logic zero. In this mode, exter- nal FSR pulses are not required to initiate the receive operation for each word received, but rather only one FSR pulse is required to initiate a continuous mode of operation. The same holds true for FSX when TXM = 0. After the first FSR/FSX pulse, these inputs are then in a don't care state. If TXM = 1, FSX is pulsed the first time DXR is loaded but remains low thereafter. See Section 3.9 for further details on the operation of the serial port. FSM may also be loaded by the LST1 and SFSM instructions. Words Cycles Cycle Timings for a Single Instruction Pl/DI l Pl/DE 1 PE/DI l PE/DE l PR/DI l PR/DE 1 l 1 1 1+p l 1+p l 1 l 1 Cycle Timings for a Repeat Execution n l n 1 n+p 1 n+p l n l n Example RFSM ;FSM is reset, putting the serial port in a ;mode of operation where frame ;synchronization pulses are not required. ;This allows a continuous bit stream to be ;transmitted/received without FSX/FSR pulses ;every 8/16 bits. 4-139 RHM Reset Hold Mode Syntax [label] RHM Operands None Execution (PC)+ 1-+ PC O - HM status bit in status register ST1 Affects HM. Encoding 15 14 13 12 11 10 9 8 7 6 5 4 3 2 0 I 1 0 0 0 0 0 a a a I Description The RHM instruction clears internal execution when acknowledging an active HOLD (HM= 1). When HM= 0, the processor may continue execution out of internal memory but puts its external interface in a high-impedance state. HM can also be loaded by the LST1 and SHM instructions. Words 1 Cycles Cycle Timings for a Slngle Instruction Pl/DI l Pl/DE I PE/DI I PE/DE I PR/DI I PR/DE 1 I 1 I 1+p I 1+p I 1 I 1 Cycle Timings for a Repeat Execution n l n I n+p I n+p I n I n Example RHM ;HM is reset, implementing the TMS320C25 hold ;mode for on-chip program execution. 4-140 Assembly Language Instructions Syntax [label] ROL Operands None Execution (PC)+ 1 - PC (ACC(31)) - C (ACC(30-0)) -ACC(31 -1) (C, before ROL) - ACC(O) Affects C. Not affected by SXM. Encoding 15 14 13 12 11 10 9 8 7 6 5 4 3 2 0 11 0 0 0 0 0 o o o I Description The ROL instruction rotates the accumulator left one bit. The MSB is shifted into the carry bit, and the value of the carry bit from before the execution of the instruction is shifted into the LSB. Words Cycles Cycle Timings for a Slngle Instruction Pl/DI l Pl/DE l PE/DI l PE/DE l PR/DI l PR/DE 1 I 1 I 1+p 1 1+p l 1 l 1 Cycle Timings for a Repeat Execution n I n I n+p l n+p l n l n Example ROL Before Instruction After Instruction Ace ~ l.___o_so_o_o_12_34_h_.I Ace ~ 1...._ _ _os_o_o_o2_4_ss_h_.l c c 4-141 ROR Rotate Accumulator Rig,,ht Syntax [label] ROR Operands None Execution (PC)+ 1 - PC (ACC(O)) -c (ACC(31-1)) -ACC(30-0) (C, before ROR) -ACC(31) Affects C. Not affected by SXM. Encoding 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0 0 0 o 1 I Description The ROR instruction rotates the accumulator right one bit. The LSB is shifted into the carry bit, and the value of the carry bit from before the execution of the instruction is shifted into the MSB. Words Cycles Cycle Timings for a Single Instruction Pl/DI I Pl/DE I PE/DI I PE/DE I PR/DI I PRIDE 1 I 1 I 1+p I 1+p I 1 I 1 Cycle Timings for a Repeat Execution n l n l n+p l n+p I n I n Example ROR Before Instruction After Instruction ACC @]c I.._____ __,I OB0001234h ACC @]c I.._____ __,I 5800091 Ah 4-142 Assembly Language Instructions Reset Overflow Mode ROVM Syntax [label] ROVM Operands None Execution (PC)+ 1 - PC O - OVM status bit in status register STO Affects OVM. Encoding 15 14 13 12 11 10 9 8 7 6 5 4 3 2 0 0 0 0 0 0 0 o I Description The OVM status bit is reset to logic zero, which disables the overflow mode. If an overflow occurs with OVM reset, the OV (overflow flag) is set, and the overflowed result is placed in the accumulator. OVM may also be loaded by the LST and SOVM instructions. Words 1 Cycles Cycle Timings for a Slngle Instruction Pl/DI l Pl/DE l PE/DI l PE/DE l PR/DI l PRIDE 1 I 1 I 1+p I 1+p I 1 I 1 Cycle Timings for a Repeat Execution n I n I n+p I n+p I n 1 n Example ROVM ;The overflow mode bit OVM is reset, disabling ;the overflow mode on any subsequent arithmetic ;operations. 4-143 Syntax Direct: [label] RPT dma Indirect: [label] RPT {ind} [,next ARP] Operands Os dma s 127 0 s next ARP s 7 Execution (PC)+ 1 - PC (dma(?-0)) - RPTC Encoding 15 14 13 12 11 10 9 8 7 6 5 4 3 2 0 Direct:! o 0 0 0 1 II 0 Data Memory Address Indirect: I 0 0 0 0 1 II 1 See Section 4.1 Description The eight LSBs of the addressed data memory value are loaded into the repeat counter (RPTC). This causes the following instruction to be executed one time more than the number loaded into the RPTC (provided that it is a repeatable instruction). Interrupts are masked out until the next instruction has been executed the specified number of times. (Interrupts cannot be allowed during the RPT/next instruction sequence, because the RPTC cannot be saved dur- ing a context switch.) The RPTC counter is cleared on a RS. RPT and RPTK are especially useful for repeating instructions, such as BLKP, BLKD, IN, MAC, MACO, NORM, OUT, TBLR, TBLW, and others. Words Cycles Cycle Timings for a Single Instruction Pl/DI j Pl/DE j PE/DI l PE/DE j PR/DI j PR/DE 1 ] 2+d l 1+p l 2+d+p j 1 j 2+d Cycle Timings for a Repeat Execution not repeatable Example RPT DAT127 ;(DP= 31) SFR Oi RPT * ;If current auxiliary register contains 4095. SFR Before Instruction After Instruction Data Data Memory OCh Memory OCh I 4095 4095 ACC 0c . . 1 ___ 12_a4_5_s1_sh__.I Ace@] c _ I_ _ _ 12_a4_5h_I 4-144 Assembly Language Instructions Ree,eat Instructions as Se_ecified by Immediate Value RPTK Syntax [label] RPTK constant Operands O :s: constant :s: 255 Execution (PC)+ 1-+ PC Constant - RPTC Encoding 15 14 13 12 11 10 9 8 7 6 5 4 3 2 0 0 0 0 8-Bit Constant Description The 8-bit immediate value is loaded into the RPTC (repeat counter). This causes the following instruction to be executed one time more than the number loaded into the RPTC (provided that it is a repeatable instruction). Interrupts are masked out until the next instruction has been executed the specified num- ber of times. (Interrupts cannot be allowed during the RPT/next instruction se- quence, because the RPTC cannot be saved during a context switch.) The RPTC is cleared on a RS. RPT and RPTK are especially useful for repeating instructions, such as BLKP, BLKD, IN, MAC, MACO, NORM, OUT, TBLR, TBLW, and others. Words Cycles Cycle Timings for a Single Instruction Pl/DI l Pl/DE I PE/DI I PE/DE I PR/DI I PR/DE 1 l 1 l 1+p l 1+p l 1 J 1 Cycle Timings for a Repeat Execution not repeatable Example LRLK AR2,200h ;Load AR2 with the address of x. LARP 2 ZAC ;Clear the accumulator. MPYK 0 ;Clear the P register. RPTK 2 ;Repeat next instruction 3 times. SQRA *+ ;Compute X**2 + Y**2 + Z**2. APAC 4-145 RSXM Reset Sigp-Extension Mode Syntax [label] RSXM Operands None Execution (PC)+ 1 - PC O - SXM sign-extension mode status bit Affects SXM. Encoding 15 14 13 12 11 10 9 8 7 6 5 4 3 2 0 11 0 0 0 0 0 0 0 0 0 Description The RSXM instruction resets the SXM status bit to logic zero, which sup- presses sign-extension on shifted data memory values for the following arith- metic instructions: ADD, ADDT, ADLK, LAC, LACT, LALK, SBLK, SUB, and SUBT. The RSXM instruction affects the definition of the SFR instruction. SXM may also be loaded by the LST1 and SSXM instructions. Words Cycles Cycle Timings for a Single Instruction Pl/DI I Pl/DE I PE/DI I PE/DE I PR/DI I PR/DE 1 I 1 I 1+p I 1+p I 1 I 1 Cycle Timings for a Repeat Execution n I n I n+p I n+p I n I n Example RSXM ;SXM is reset, disabling sign-extension on ;subsequent instructions. 4-146 Assembly Language Instructions Reset Test/Control Flag RTC Syntax [label] RTC Operands None Execution (PC)+ 1-+ PC O -+ TC test/control flag in status register ST1 Affects TC. Encoding 15 14 13 12 11 10 9 8 7 6 5 4 3 2 0 I 1 0 0 0 0 0 0 0 Description The TC (test/control) flag in status register ST1 is reset to logic zero. TC can also be loaded by the LST1 and STC instructions. Words 1 Cycles Cycle Timings for a Slngle Instruction Pl/DI I Pl/DE I PE/DI I PE/DE I PR/DI I PR/DE 1 l 1 I 1+pI I 1+p 1 J 1 Cycle Timings for a Repeat Execution n l n l n+p l n+p l n J n Example RTC ;TC (test/control) flag is reset to logic zero. 4-147 RTXM Reset Serial Port Transmit Mode Syntax [label] RTXM Operands None Execution {PC)+ 1 - PC O - TXM transmit mode status bit Affects TXM mode bit. Encoding 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 11 0 0 0 0 0 0 0 0 0 0 Description The RTXM instruction resets the TXM status bit, which configures the serial port transmit section in a mode where it is controlled by an FSX {external fram- ing pulse). The transmit operation is started when an external FSX pulse is ap- plied. TXM may also be loaded by the LST1 and STXM instructions. Words 1 Cycles Cycle Timings for a Slngle Instruction Pl/DI l Pl/DE l PE/DI l PE/DE l PR/DI l PR/DE 1 l 1 l 1+p l 1+p l 1 l 1 Cycle Timings for a Repeat Execution n l n l n+p l n+p l n l n Example RTXM ;TXM is reset, configuring FSX as an input. 4-148 Assembly Language Instructions Rest External Flag RXF Syntax [label] RXF Operands None Execution (PC)+ 1 - PC O - XF external flag pin and status bit Affects XF. Encoding 15 14 13 12 11 10 9 8 7 6 5 4 3 2 0 11 0 0 0 0 0 0 0 0 0 Description The XF pin and XF status bit in status register ST1 are reset to logic zero. XF may also be loaded by the LST1 and SXF instructions. Words Cycles Cycle Timings for a Single Instruction Pl/DI l Pl/DE l PE/DI l PE/DE l PR/DI l PR/DE 1 l 1 l 1+p l 1+p l 1 l 1 Cycle Timings for a Repeat Execution n I n I n+p I n+p I n I n Example RXF ;XF pin and status bit are reset to logic zero. 4-149 SACH Store High Accumulator With Shift Syntax Direct: [label] SACH dma [, shift] Indirect: [label] SACH {ind}[, shift[, next ARP]] Operands O :s: dma :s:127 0 :s: next ARP :s: 7 O :s: shift :s: 7 (defaults to O} Execution (PC}+ 1 -PC 16 MSBs of (ACC} x 2shift - dma Not affected by SXM. Encoding 15 14 13 12 11 10 9 8 7 6 5 4 3 2 0 I Direct: 0 0 1 I Shift I I 0 Data Memory Address Indirect: I o 0 1 I Shift I I 1 See Section 4.1 Description The SACH instruction copies the entire accumulator into a shifter, where it shifts the entire 32-bit number anywhere from Oto 7 bits on the TMS320C2x. It then copies the upper 16 bits of the shifted value into data memory. The accu- mulator itself remains unaffected. Words 1 Cycles Cycle Timings for a Slngle Instruction Pl/DI l Pl/DE l l PE/DE l PR/DI l PE/DI PR/DE 1 l 1+d l l 2+d+p l 1 l 1+p 1+d Cycle Timings for a Repeat Execution n I n+nd I n+p I 1+n+nd+p J n l n+nd Example SACH DATl0,4 ; (DP = 4) or SACH *,4 ;If current auxiliary register contains 522. Before Instruction After Instruction ACC r--1 ~I 4208001h ACC 01 42oaoo1h I c c Data Memory 522 Oh I Data Memory 522 4208h I 4-150 Assembly Language Instructions Syntax Direct: [label] SACL dma [ , shift] Indirect: [label] SACL {ind} [, shift [, next ARP]] Operands 0 s dma s127 0 s next ARP s 7 O s shift s 7 (defaults to 0) Execution (PC)+ 1 - PC 16 LSBs of (ACC) x 2shift - dma Not affected by SXM. Encoding 15 14 13 12 11 10 9 8 7 6 5 4 3 2 0 Direct: I 0 0 0 I Shift I I 0 Data Memory Address Indirect: I 0 0 0 I Shift I I 1 See Section 4.1 Description The low-order bits of the accumulator are shifted left O to 7 bits on the TMS320C2x, as specified by the shift code, and stored in data memory. The low-order bits are filled with zeros, and the high-order bits are lost. The accu- mulator itself is unaffected. Words Cycles Cycle Timings for a Single Instruction Pl/DI I Pl/DE I PE/DI PE/DE l I PR/DI l PR/DE 1 I 1+d I 1+p 2+d+p l 1I l 1+d Cycle Timings for a Repeat Execution n I n+nd I n+p J 1+n+nd+p J n I n+nd Example SACL DATll, 1 ; (DP = 4) or SACL *,l ;If current auxiliary register contains 523. Before Instruction After Instruction ACC 01 7C638421h I Acc01 7C638421h I c c Data Memory 523 5h I Data Memory 523 I 842h I 4-151 SAR Store Auxiliaz. Register Syntax Direct: [label] SAR AR,dma Indirect: [label] SAR AR , {ind} [, next ARP] Operands O:s:dma:s: 127 O :s: auxiliary register AR :s: 7 0 :s: next ARP :s: 7 Execution (PC)+ 1 - PC (AR)-dma Encoding 15 14 13 12 11 10 9 8 7 6 5 4 3 2 0 Direct:! o 0 I AR I I 0 Data Memory Address Indirect: Io 0 I AR I I 1 See Section 4. 1 Description The contents of the designated auxiliary register (AR) are stored in the ad- dressed data memory location. When you are modifying the contents of the current auxiliary register in the in- direct addressing mode, SAR ARn (when n =ARP) stores the value of the aux- iliary register contents before it is incremented, decremented, or indexed by ARO. Words 1 Cycles Cycle Timings for a Slngle Instruction Pl/DI l Pl/DE l l PE/DE I PR/DI I PR/DE PE/DI 1 l 1+d l 1+p l 2+d+p l 1 l 1+d Cycle Timings for a Repeat Execution n I n+nd I n+p I 1+n+nd+p I n 1 n+nd 4-152 Assembly Language Instructions Example 1 SAR AR0,DAT30 ;(DP= 6) or SAR ARO,* ;If current auxiliary register contains 798. Before Instruction After Instruction ARO 37h ARO 37h I Data Memory 798 18h I Data Memory 798 37h I Example2 LARP ARO SAR AR0,*0+ Before Instruction After Instruction ARO 401h ARO 802h I Data Memory 1025 Oh I Data Memory 1025 401h I 4-153 SBLK Subtract From Accumulator Long Immediate With Shift Syntax [label] SBLK constant [, shift] Operands 16-bit constant O :S shift :S 15 (defaults to 0) Execution (PC)+ 2- PC (ACC) -[constant x 2shittJ -ACC If SXM = 1: Then -32768 :S constant :S 32767. If SXM = 0: Then 0 :S constant :S 65535. Affects OV; affected by OVM and SXM. Affects C. Encoding 15 14 13 12 11 10 9 8 7 6 5 4 3 2 0 o 1 I Shift I 0 0 0 0 0 0 16-Bit Constant Description The immediate field of the instruction is subtracted from the accumulator. The result replaces the accumulator contents. SXM determines whether the constant is treated as a signed 2s-complement number or as an unsigned number. The shift count is optional and defaults to zero. Words 2 Cycles Cycle Timings for a Single Instruction Pl/DI l Pl/DE l PE/DI 1 PE/DE l PR/DI l PR/DE 2 l 2 1 2+2p l 2+2p l 2 l 2 Cycle Timings for a Repeat Execution not repeatable Example SBLK 5,12 Before Instruction After !nstruction ACC Elc I...._______,I 3FCOEFh ACC [2]c I._______ 3F70EFh_,I 4-154 Assembly Language Instructions Syntax [label) SBRK constant Operands O :s constant :s 255 Execution (PC)+ 1 - PC AR(ARP) - 8-bit positive constant - AR(ARP) Encoding 15 14 13 12 11 10 9 8 7 6 5 4 3 2 0 8-Bit Constant Description The 8-bit immediate value is subtracted, right-justified, from the currently se- lected auxiliary register with the result replacing the auxiliary register contents. The subtraction takes place in the ARAU, with the immediate value treated as an 8-bit positive integer. Words 1 Cycles Cycle Timings for a Single Instruction Pl/DI l Pl/DE l PE/DI l PE/DE l PR/DI l PR/DE 1 I 1 I 1+p l 1+p l 1 l 1 Cycle Timings for a Repeat Execution not repeatable Example SBRK OFFh ; (ARP = 7) Before Instruction After Instruction AR7 Oh I AR7 OFF01h I 4-155 Syntax [label] SC Operands None Execution (PC)+ 1 - PC 1 - carry bit C in status register ST1 Affects C. Encoding 15 14 13 12 11 10 9 8 7 6 5 4 3 2 0 11 0 0 0 0 0 0 0 0 Description The carry bit C in status register ST1 is set to logic one. The carry bit may also be loaded directly by the LST1 and RC instructions. Words Cycles Cycle Timings for a Single Instruction Pl/DI I Pl/DE I PE/DI I PE/DE I PR/DI I PR/DE 1 I 1 I 1+p I 1+p I 1 I 1 Cycle Timings for a Repeat Execution n I n I n+p I n+p I n I n Example SC ;Carry bit C is set to logic one. 4-156 Assembly Language Instructions Syntax [label] SFL Operands None Execution (PC)+ 1 - PC (ACC(31) ) - C (ACC(30-0)) -ACC(31-1) O -ACC(O) Affects C. Not affected by SXM bit. Encoding 15 14 13 12 11 10 9 8 7 6 5 4 3 2 0 0 0 0 0 0 0 a o o I Description The SFL instruction shifts the entire accumulator left one bit. The least signifi- cant bit is filled with a zero. On the TMS320C2x, the most significant bit is shifted into the carry bit (C). Note that SFL, unlike SFR, is unaffected by SXM. Words Cycles Cycle Timings for a Single Instruction Pl/DI I Pl/DE I PE/DI I PE/DE I PR/DI I PR/DE 1 I 1 I 1+p I 1+p I 1 I 1 Cycle Timings for a Repeat Execution n l n l n+p l n+p I n l n Example SFL Before Instruction After Instruction Ace ~ 1....._ _o_so_o_o_12_34_h.....1 Ace ~l. . ___oa_o_o_o2_4_as_h..... I c c 4-157 SFR Shift Accumulator Syntax [label] SFR Operands None Execution (PC)+ 1 - PC If SXM = 0: Then (ACC{O}} - C (ACC(31-1}} - ACC (30-0) and 0 -ACC(31) If SXM = 1: Then (ACC{O)) - C (ACC{31-1}} - ACC{30-0) and (ACC{31}} - ACC(31) Affects C. Affected by SXM bit. Encoding 15 14 13 12 11 10 9 8 7 6 5 4 3 2 0 I 1 0 0 0 0 0 0 0 0 1 I Description The SFR instruction shifts the accumulator right one bit. If SXM = 1, the instruction produces an arithmetic right shift. The sign bit (MSB) is unchanged and is also copied into bit 30. Bit 0 is shifted into the carry bit (C). If SXM = 0, the instruction produces a logical right shift. All of the accumulator bits are shifted by one bit to the right. The least significant bit is shifted into the carry bit, and the most significant bit is filled with a zero. Words Cycles Cycle Timings for a Single Instruction Pl/DI I Pl/DE I PE/DI I PE/DE I PR/DI I PR/DE 1 l 1 l 1+p l Cycle Timings for a Repeat Execution 1+p I 1 I 1 n l n l n+p l n+p l n l n Example 1 SFR ; (SXM = 0) Before Instruction After Instruction Ace§ I OB0001234h I Acc~I 5800091Ah I c c Example2 SFR ;(SXM = 1) Before Instruction After Instruction Ace§ I OB0001234h I Ace@) I 00800091 Ah I c c 4-158 Assembly Language Instructions Syntax SFSM Operands None Execution (PC)+ 1 - PC 1 - FSM status bit in status register ST1 Affects FSM. Encoding 15 14 13 12 11 10 9 8 7 6 5 4 3 2 0 11 0 0 0 0 0 0 Description The SFSM instruction sets the FSM status bit to logic one. In this mode, an external FSR pulse is required for a receive operation, and an external FSX pulse is required if TXM =0. If TXM = 1, FSX pulses are generated in the nor- mal manner every time the transmit shift register XSR is loaded. See Section 3.7 for details on the operation of the serial port. FSM may also be loaded by the LST1 and RFSM instructions. Words Cycles Cycle Timings for a Slngle Instruction Pl/DI I Pl/DE I PE/DI I PE/DE I PR/DI I PR/DE 1 l 1 l 1+p l 1+p Cycle Timings for a Repeat Execution I 1 I 1 n l n l n+p l n+p l n l n Example SFSM ;FSM is set, putting the serial port in a mode ;of operation where frame synchronization ;pulses are required for each word to be ;transmitted or received. 4-159 SHM Set Hold Mode ::::..~.;»;,.:::.:::;::i:::;;,:::~::::::m::::::;m;;;m~;~;,w;m:::::::::~'™~~~~~-~~~~::::::~;::::::~.mw.-::w~~™~~~ Syntax [label] SHM Operands None Execution (PC)+ 1 - PC 1 - HM status bit in status register ST1 Affects HM. Encoding 15 14 13 12 11 10 9 8 7 6 5 4 3 2 0 11 0 0 0 0 0 o o 1 I Description The SHM instruction halts internal execution when acknowledging an active HOLD (HM= 1). When HM= 0, the processor may continue execution out of internal memory but puts its external interface in a high-impedance state. This bit is set to 1 by a reset. Words Cycles Cycle Timings for a Single Instruction Pl/DI l Pl/DE l PE/DI l PE/DE l PR/DI l PR/DE 1 J 1 l 1+p l 1+p l 1 l 1 Cycle Timings for a Repeat Execution n J n J n+p J n+p l n l n Example SHM ;HM is set 4-160 Assembly Language Instructions Set Overflow Mode SOVM Syntax [label] SOVM Operands None Execution (PC)+ 1 - PC 1 - overflow mode (OVM) status bit Affects OVM. Encoding 15 14 13 12 11 10 9 8 7 6 5 4 3 2 0 0 0 0 0 0 0 0 0 0 Description The OVM status bit is set to logic one, which enables the overflow (saturation) mode. If an overflow occurs with OVM set, the overflow flag OV is set, and the accumulator is set to the largest representable 32-bit positive (7FFFFFFFh) or negative (80000000h) number according to the direction of overflow. OVM may also be loaded by the LST and ROVM instructions. Words Cycles Cycle Timings for a Slngle Instruction Pl/DI l Pl/DE l PE/DI l PE/DE l PR/DI l PR/DE 1 l 1 l 1+p l 1+p l 1 l 1 Cycle Timings for a Repeat Execution n l n l n+p 1 n+p l n l n Example SOVM ;The overflow mode bit OVM is set, enabling the ;overflow mode on any subsequent arithmetic ;operations. 4-161 SPAC Subtract P Register From Ac~'!,mf!lator Syntax [label] SPAC Operands None Execution PC)+ 1-+ PC (ACC) - (shifted P register) - ACC Affects OV; affected by PM and OVM. Affects C. Not affected by SXM. Encoding 15 14 13 12 11 10 9 8 7 6 5 4 3 2 0 I 1 0 0 0 0 0 0 0 0 Description The contents of the P register, shifted as defined by the PM status bits, are sub- tracted from the contents of the accumulator. The result is stored in the accu- mulator. Note that SPAC is unaffected by SXM; the P register is always sign- extended. The SPAC instruction is a subset of LTS, MPYS, and SQRS. Words 1 Cycles Cycle Timings for a Single Instruction Pl/DI l Pl/DE l PE/DI l PE/DE l PR/DI l PR/DE 1 l 1 l 1+p l 1+p l 1 l 1 Cycle Timings for a Repeat Execution n I n I n+p I n+p I n I n Example SPAC i (PM = 0) Before Instruction After Instruction p 24h I p 24h I Acc01 3Ch I Acc~I 18h I c c 4-162 Assembly Language Instructions Store SPH Syntax Direct: [label] SPH dma Indirect: [label] SPH {ind}[, next ARP] Operands O :s dma :s 127 0 :s next ARP :s 7 Execution (PC)+ 1 - PC (PR shifter output (31-16)) - dma Affected by PM. Encoding 15 14 13 12 11 10 9 8 7 6 5 4 3 2 0 Direct: I 0 0 I I 0 Data Memory Address Indirect: I 0 0 1 I I 1 See Section 4.1 Description The high-order bits of the P register, shifted as specified by the PM bits, are stored in data memory. Neither the P register nor the accumulator are affected by this instruction. High-order bits are sign-extended when the right-shift by 6 mode is selected. Low-order bits are taken from the low P register when left- shifts are selected. Words Cycles Cycle Timings for a Single Instruction Pl/DI I Pl/DE I I PE/DE I PR/DI I PE/DI PR/DE 1 I 1+d I 1+p I 2+d+p I 1 I 1+d Cycle Timings for a Repeat Execution n l n + nd l n+p J1 + n +nd +p J n l n + nd Example SPH DAT3 ; (DP = 4 I PM= 2) or SPH * ;If current auxiliary register contains 515. Before Instruction After Instruction p OFE079844h I p OFE079844h I Data Memory 515 4567h I Data Memory 515 OE079h I 4-163 Syntax Direct: [label] SPL dma Indirect: [label] SPL {ind} [, next ARP] Operands Os dma s 127 0 s next ARP s 7 Execution (PC)+ 1 - PC (PR shifter output (15-0)) - dma Affected by PM. Encoding 15 14 13 12 11 10 9 8 7 6 5 4 3 2 0 Direct: Io 0 0 Io I Data Memory Address Indirect: Io 0 0 II 1 See Section 4.1 Description The low-order bits of the P register, shifted as specified by the PM bits, are stored in data memory. Neither the P register nor the accumulator are affected by this instruction. High-order bits are taken from the high P register when the right-shift by 6 mode is selected. Low-order bits are zero-filled when left-shifts are selected. Words Cycles Cycle Timings for a Slngle Instruction Pl/DI I Pl/DE I PE/DI I PE/DE I PR/DI I PR/DE 1 l 1+d l 1+p l 2+d+p l 1 l 1+d Cycle Timings for a Repeat Execution n l n+nd l n+p J 1+n+nd+p 1 n 1 n+nd Example SPL DAT3 ; (DP = 4, PM = 2) or SPL * ;If current auxiliary register contains 515. Before Instruction After Instruction p OFE079844h I p OFE079844h I Data Memory 515 4567h I Data Memory 515 9844h I 4-164 Assembly Language Instructions Syntax [label] SPM constant Operands O s constant s 3 Execution (PC)+ 1 - PC Constant - product register shift mode (PM) status bits Affects PM. Encoding 15 14 13 12 11 10 9 8 7 6 5 4 3 2 0 I 1 0 0 0 0 0 0 0 0 I PM Description The two low-order bits of the instruction word are copied into the PM field of status register ST1 . The PM status bits control the P register output shifter. This shifter has the ability to shift the P register output either one or four bits to the left or six bits to the right, or to perform no shift. The bit combinations and their meanings are shown below. PM ACTION 00 No shift of multiplier output 01 Output left-shifted 1 place and zero-filled 1O Output left-shifted 4 places and zero-filled 11 Output right-shifted 6 places, sign-extended; LSB bits lost. The left-shifts allow the product to be justified for fractional arithmetic. The right-shift by six bits has been incorporated to implement up to 128 multiply- accumulate processes without the possibility of overflow occurring. PM may also be loaded by an LST1 instruction. Words Cycles Cycle Timings for a Slngle Instruction Pl/DI I Pl/DE I PE/DI I PE/DE I PR/DI I PR/DE 1 I 1 l 1+p I I 1+p 1 I 1 Cycle Timings for a Repeat Execution not repeatable Example SPM 3 ;Product register shift mode 3 is selected, ;causing all subsequent transfers from the ;product register to the ALU to be shifted ;to the right six places. 4-165 SQRA sguare and Acc!!mulate Previous Product Syntax Direct: [label] SORA dma Indirect: [label] SORA {ind} [, next ARP] Operands Os dma s 127 0 s next ARP s 7 Execution (PC)+ 1 - PC (ACC) + (shifted P register) - ACC (dma) - T register (dma) x (dma) - P register Affects OV; affected by PM and OVM. Affects C. Encoding 15 14 13 12 11 10 9 8 7 6 5 4 3 2 0 Direct:! o o o o 1 1 oI Data Memory Address I Indirect: ...._0__0_ _ _ _ _ _ _ _ 0 __ 1 ~I_1_1_ _ _s_e_e_s_ec_t_io_n_4._1_ _ ___. 0 __ Description The contents of the P register, shifted as defined by the PM status bits, are add- ed to the accumulator. The addressed data memory value is then loaded into the T register, squared, and stored in the P register. Words Cycles Cycle Timings for a Single Instruction Pl/DI I Pl/DE I I PE/DE l PR/DI l PE/DI PR/DE 1 I 2+d 1+pI l 2+d+p l 1 l 2+d Cycle Timings for a Repeat Execution n I 1+n+nd I n+p J 1+n+nd+p J n I 1+n+nd Example SQRA DAT30 ;(DP= 6, PM= 0) or SQRA * ;If current auxiliary register contains 798. Before Instruction After Instruction Data Memory 798 OFh I Data Memory 798 OFh I T I 3h I T OFh I p I 12Ch I p OE1h I ACC GI 1F4h Ace@] I 320h I c c 4-166 Assembly Language Instructions Syntax Direct: [label] SQRS dma Indirect: [label] SQRS {ind} [, next ARP] Operands 0 s dma s127 0 s next ARP s 7 Execution (PC)+ 1 - PC (ACC) - (shifted P register) - ACC (dma) - T register (dma) x (dma) - P register Affects OV; affected by PM and OVM. Affects C. Encoding 15 14 13 12 11 10 9 8 7 6 5 4 3 2 0 Direct: I 0 0 0 0 I I 0 Data Memory Address Indirect: Io 0 0 0 I I 1 See Section 4.1 Description The contents of the P register, shifted as defined by the PM status bits, are sub- tracted from the accumulator. The addressed data memory value is then loaded into the T register, squared, and stored into the P register. Words 1 Cycles Cycle Timings for a Single Instruction Pl/DI I Pl/DE I PE/DI I PE/DE I PR/DI I PR/DE 1 I 2+d I 1+p I 2+d+p l 1 l 2+d Cycle Timings for a Repeat Execution n I 1+n+nd l n+p J 1+n+nd+p J n I 1+n+nd Example SQRS DAT9 ;(DP= 6, PM= 0) or SQRS * ;If current auxiliary register contains 777. Before Instruction After Instruction Data Memory 777 Bh I Data Memory 777 Bh I T I 1124h I T Bh I p I 190h I p 40h I ACC GI 1450h ACC~I 12COh I c c 4-167 Syntax Direct: [label] SST dma Indirect: [label] SST {ind} [, next ARP] Operands 0 s dma s127 0 s next ARP s 7 Execution (PC)+ 1-+ PC (status register STO) - dma Encoding 15 14 13 12 11 10 9 8 7 6 5 4 3 2 0 Direct: I 0 0 0 0 II 0 Data Memory Address Indirect: Io 0 0 0 II 1 See Section 4.1 Description Status register STO is stored in data memory. In the direct addressing mode, status register STO is always stored in page 0, regardless of the value of the DP register. The processor automatically forces the page to be 0, and the specific location within that page is defined in the instruction. Note that the DP register is not physically modified. This allows/ storage of the DP register in the data memory on interrupts, etc., in the direct addressing mode without having to change the DP. In the indirect addressing mode, the data memory address is obtained from the auxiliary register se- lected. (See the LST instruction for more information.) The SST instruction can be used to store status register STO after interrupts and subroutine calls. The STO contains the status bits: OV (overflow flag), OVM (overflow mode), INTM (interrupt mode), ARP (auxiliary register pointer), and DP (data memory page pointer). The status bits are stored in the data memory word as follows: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 0 I ARP DP Note that SST * may be used to store status register STO anywhere in data memory, while SST in the direct addressing mode is forced to page 0. Words Cycles 4-168 Assembly Language Instructions Cycle Timings for a Slngle Instruction Pl/DI l Pl/DE l PE/DIl PE/DE l PR/DI l PR/DE 1 1 1+d l l 2+d+p l 1+p 1 I 1+d Cycle Timings for a Repeat Execution n J n+nd l n+p l 1+n+nd+p J n I n+nd Example SST DAT96 ;(DP= don't care) or SST * ;If current auxiliary register contains 96. Before Instruction After Instruction Status Re~ster s0 OA408h I Status Re~ster s 0 OA408h I Data Memory 96 OAh I Data Memory 96 OA408h I 4-169 SST1 Store Status Register ST1 Syntax Direct [ label] SST1 dma Indirect : [ label] SST1 {ind} [, next ARP] Operands 0 s dma s127 0 s next ARP s 7 Execution (PC)+ 1 - PC (status register ST1) - dma Encoding 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 Direct! o 0 0 1 I I 0 Data Memory Address Indirect: Io 0 0 1 I I 1 See Section 4.1 Description Status register ST1 is stored in data memory. In the direct addressing mode, status register ST1 is always stored in page 0, regardless of the value of the DP register. The processor automatically forces the page to be 0, and the spe- cific location within that page is defined in the instruction. Note that the DP reg- ister is not physically modified. This allows the storage of the DP in the data memory on interrupts, etc., in the direct addressing mode without having to change the DP. In the indirect addressing mode, the data memory address is obtained from the auxiliary register selected. (See the LST1 instruction for more information.) SST1 is used to store status bits after interrupts and subroutine calls. ST1 con- tains the status bits: ARB (auxiliary register pointer buffer), CNF (RAM configu- ration control), TC (test/control), SXM (sign-extension mode), XF (external flag), FO (serial port format), TXM (transmit mode), and the PM (product regis- ter shift mode). ST1 on the TMS320C2x also contains the status bits: C (carry) bit, HM (hold mode), and FSM (frame synchronization mode). The bits loaded into status register ST1 from the data memory word are as follows: 15 14 13 12 11 10 9 8 76 5 4 3 210 t On the TMS320C26, bits 12 and 7 hold CNFO and CNF1, respectively (see the CONF instruction for decoding). Note that SST1 * may be used to store status register ST1 anywhere in data memory, while SST1 in the direct addressing mode is forced to page 0. Words Cycles 4-170 Assembly Language Instructions Cycle Timings for a Slngle Instruction Pl/DI l Pl/DE 1 PE/DI l PE/DE 1 PR/DI I PR/DE 1 l 1+d I 1+p 1 2+d+p 1 1 I 1+d Cycle Timings for a Repeat Execution n l n+nd 1 n+p J 1+n+nd+p J n I n+nd Example SSTl DAT97 ;(DP= don't care) or SSTl * ;If current auxiliary register contains 97. Before Instruction After Instruction Status Re~ster s 1 OA7EOh I Status Re~ster s 1 OA7EOh I Data Memory 97 OBh I Data Memory 97 OA7EOh I 4-171 SSXM Set Sign-Extension Mode Syntax [label] SSXM Operands None Execution (PC)+ 1 - PC 1 - SXM status bit in status register ST1 Affects SXM. Encoding 15 14 13 12 11 10 9 8 7 6 5 4 3 2 0 11 0 0 0 0 0 0 0 0 Description The SSXM instruction sets the SXM status bit to logic 1, which enables sign- extension on shifted data memory values for the following arithmetic instruc- tions: ADD, ADDT, ADLK, LAC, LACT, LALK, SBLK, SUB, and SUBT. In addition, SSXM affects the definition of the SFR instruction. You can load SXM with the LST1 and RSXM instructions, as well. Words 1 Cycles Cycle Timings for a Single Instruction Pl/DI l Pl/DE J PE/DI J PE/DE I PR/DI I PR/DE 1 I 1 J 1+p I 1+p I 1 I 1 Cycle Timings for a Repeat Execution n I n I n+p I n+p I n I n Example SSXM ;SXM is set, enabling sign extension on ;subsequent instructions. 4-172 Assembly Language Instructions Set Test/Control Flag STC Syntax [label] STC Operands None Execution (PC)+ 1-+ PC 1 - TC test/control flag in status register ST1 Affects TC. Encoding 15 14 13 12 11 10 9 8 7 6 5 4 3 2 0 11 0 0 0 0 0 0 0 Description The TC (test/control) flag in status register ST1 is set to logic one. TC may also be loaded by the LST1 and RTC instructions. Words Cycles Cycle Timings for a Sing le Instruction Pl/DI ] Pl/DE ] PE/DI I PE/DE I PR/DI l PR/DE 1 j 1 j 1+p l 1+ p l 1 l 1 Cycle Timings for a Repeat Execution n ] n 1 n+p l n+p l n l n Example STC ;TC (test/control) flag is set to logic one. 4-173 STXM Set Serial Port Transmit Mode Syntax [label] STXM Operands None Execution (PC)+ 1 -PC 1 - TXM status bit in status register ST1 Affects TXM. Encoding 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 0 1 1 0 0 0 0 0 0 0 1 Description The STXM instruction sets the TXM status bit to logic 1, which configures the serial port transmit section to a mode where the FSX pin behaves as an output. A pulse is produced on the FSX pin each time the DXR register is loaded inter- nally. The transmission is initiated by the negative edge of this pulse. TXM may also be loaded by the LST1 and RTXM instructions. If the FSM status bit is a logic zero and serial port operation has already started, the FSX pin will be driv- en low if TXM =1. Words 1 Cycles Cycle Timings for a Single Instruction Pl/DI l Pl/DE l PE/DI l PE/DE l PR/DI l PR/DE 1 I 1 I 1+p l 1+p l 1 l 1 Cycle Timings for a Repeat Execution n I n I n+p I n+p I n I n Example STXM :TXM is set, configuring FSX as an output. 4-174 Assembly Language Instructions Syntax Direct: [label] SUB dma [, shi'ft] Indirect: [label] SUB {ind} [, shift [ next ARP]] Operands O:sdma:s127 0 :s next ARP :s 7 0 :s shift :s 15 (defaults to 0) Execution (PC)+ 1 - PC (ACC) - ((dma) x 2shift] - ACC If SXM = 1: Then (dma) is sign-extended. If SXM = O: Then (dma) is not sign-extended. Affects OV; affected by OVM and SXM. Affects C. Encoding 15 14 13 12 11 10 9 8 7 6 5 4 3 2 0 Direct: oI o o 1 I Shift Io I Data Memory Address Indirect: I o o o Shift See Section 4.1 Description The contents of the addressed data memory location are left-shifted and sub- tracted from the accumulator. During shifting, low-order bits are zero-filled. High-order bits are sign-extended if SXM is high and zero-filled if SXM is low. The result is stored in the accumulator. Words Cycles Cycle Timings for a Single Instruction Pl/DI I Pl/DE I PE/DI I PE/DE I PR/DI I PR/DE 1 I 2+d I 1+p I 2+d+p I 1 I 2+d Cycle Timings for a Repeat Execution n I 1+n+nd l n+p I 1+n+nd+p I n I 1+n+nd Example SUB DATBO ;(DP= 8) or SUB * ;If current auxiliary register contains 1104. Before Instruction After Instruction Data Memory 1104 11 h I Data Memory 1104 I 11h I ACC El I 24h I ACC~I 13h I c c 4-175 SU BB Subtract from Accumulator with Borrow Syntax Direct: [label] SUBB dma Indirect: [label] SUBB {ind} [, next ARP] Operands 0 s dma s127 0 s next ARP s 7 Execution (PC)+ 1 - PC (ACC) - (dma) - (C) - ACC Affects C and OV; affected by OVM. Encoding 15 14 13 12 11 10 9 8 7 6 5 4 3 2 0 Direct: I0 0 0 II 0 Data Memory Address Indirect: Io 0 0 1 I I 1 See Section 4.1 Description The contents of the addressed data memory location and the value of the carry bit are subtracted from the accumulator. The carry bit is then affected in the normal manner (see subsection 3.5.2). Words Cycles Cycle Timings for a Single Instruction Pl/DI l Pl/DE l l PE/DE l PR/DI l PE/DI PR/DE 1 l 2+d l 1 2+d+p l 1 l 1+p 2+d Cycle Timings for a Repeat Execution n I 1+n+nd I n+p I 1+n+nd+p J n I 1+n+nd Example SUBB OATS ; (DP = 8) or SUBB * ;If current auxiliary register contains 1029. Before Instruction After Instruction Data Memory 1029 6h Data Memory 1029 6h I ri r-1 ACC~I ah I ACC~I OFFFFFFFFhl c c In the above example, C is originally zeroed, presumably from the result of a previous subtract instruction that performed a borrow. The effective operation performed was 6 - 6 - (0)-1, generating another borrow (and resetting carry again) in the process. The SUBB instruction can be used in performing multiple-precision arithmetic. 4-176 Assembly Language Instructions Syntax Direct: [label] SUBC dma Indirect: [label] SUBC {ind}[, next ARP] Operands 0 s dma s127 0 s next ARP s 7 Execution (PC)+ 1 -+PC (ACC) - [(dma) x 215]-+ ALU output If ALU output ~ O: Then (ALU output) x 2 + 1 -+ ACC; Else (ACC) x 2 -+ ACC. Affects OV. Affects C. Not affected by OVM (no saturation); is affected by SXM. Encoding 15 14 13 12 11 10 9 8 7 6 5 4 3 2 0 Direct:! o 0 0 0 1 II 0 Data Memory Address Indirect: Io 0 0 0 1 I I 1 See Section 4.1 Description The SUBC instruction performs conditional subtraction, which may be used for division. The 16-bit numerator is placed in the low accumulator, and the high accumulator is zeroed. The denominator is in data memory. SUBC is executed 16 times for 16-bit division. After completion of the last SUBC, the quotient of the division is in the lower-order 16-bitfield of the accumulator, and the remain- der is in the high-order 16 bits of the accumulator. SUBC provides the normally expected results for division when both the denominator and numerator are positive. The denominator is affected by the SXM bit. If SXM=1, then the de- nominator must have a Ovalue in the MSB. If SXM=O, then any 16-bit denomi- nator value will produce the expected results. The numerator, which is in the accumulator, must initially be positive (that is, bit 31 must be 0) and must re- main positive following the accumulator shift, which occurs during the SUBC operation. If the 16-bit numerator contains less than 16 significant bits, the numerator may be placed in the accumulator left-shifted by the number of leading nonsig- nificant zeroes. The number of executions of SUBC is reduced from 16 by that number. One leading zero is always significant. Note that SUBC affects OV but is not affected by OVM, and therefore the accu- mulator does not saturate upon positive or negative overflows when this instruction is executed. Words 4-177 SUBC Conditional Subtract Cycles Cycle Timings for a Single Instruction l J PE/DE J l Pl/DI 1 l Pl/DE 2+d ! PE/DI 1+p I 2+d+p Cycle Timings for a Repeat Execution I PR/DI 1 l PR/DE 2+d n l 1+n+nd l n+p J 1+n+nd+p J n l 1+n+nd Example RPTK 15 SUBC DAT2 ; (DP 4) or RPTK 15 SUBC * ;If current auxiliary register contains 514. Before Instruction After Instruction Data Memory 514 7h Data Memory 514 7h I Acc0 I 41h I AccQJ I 20009h I c c 4-178 Assembly Language Instructions Syntax Direct: [label] SUBH dma Indirect: [label] SUBH {ind}[, next ARP] Operands Os dma s 127 o s next ARP s 7 Execution (PC)+ 1 - PC (ACC) - [(dma) x 216] -Ace Affects OV; affected by OVM Affects C. Encoding 15 14 13 12 11 10 9 8 7 6 5 4 3 2 0 Direct:! o 0 0 0 0 0 II 0 Data Memory Address Indirect: I 0 0 0 0 0 0 II See Section 4.1 Description The contents of the addressed data memory location are subtracted from the upper 16 bits of the accumulator. The 16 low-order bits of the accumulator are unaffected. The result is stored in the accumulator. The carry bit C on the TMS320C2x is reset if the result of the subtraction generates a borrow; other- wise, C is unaffected. The SUBH instruction can be used for performing 32-bit arithmetic. Words Cycles Cycle Timings for a Single Instruction Pl/DI l Pl/DE l PE/DI l PE/DE l PR/DI l PR/DE 1 I 2+d I 1+p I 2+d+p I 1 I 2+d Cycle Timings for a Repeat Execution n I 1+n+nd I n+p I 1+n+nd+p I n I 1+n+nd Example SUBH DAT33 ; (DP = 6) or SUBH * ;If current auxiliary register contains 801. Before Instruction After Instruction Data Memory 801 4h Data Memory 801 4h I ACC 01 OA0013h I Acc[2J I 60013h I c c 4-179 SUBK Subtract from Accumulator Short Immediate Syntax [label] SUBK constant Operands O s constant s 255 Execution (PC)+ 1-+ PC (ACC) - 8-bit positive constant -+ ACC Affects C and OV: affected by OVM. Not affected by SXM. Encoding 15 14 13 12 11 10 9 8 7 6 5 4 3 2 0 I 1 0 0 0 8-Bit Constant Description The 8-bit immediate value is subtracted, right-justified, from the accumulator with the result replacing the accumulator contents. The immediate value is treated as an 8-bit positive number, regardless of the value of SXM. Words Cycles Cycle Timings for a Single Instruction Pl/DI I Pl/DE I PE/DI I PE/DE I PR/DI I PR/DE 1 I 1 I 1+p I 1+p I 1 I 1 Cycle Timings for a Repeat Execution not repeatable Example SUBK 12h Before Instruction After Instruction ACC ~ 3_7h~I AccEJI____ I 2s_h c _ I_ _ _ _ c 4-180 Assembly Language Instructions Subtract from Low Accumulator with Sign-Extension Supressed SUBS Syntax Direct: [label] SUBS dma Indirect: [label] SUBS {ind} [, next ARP] Operands O :s dma :s 127 0 :s next ARP :s 7 Execution (PC)+ 1 - PC (ACC) - (dma) - ACC Affects OV; affected by OVM. Affects C. Not affected by SXM. Encoding 15 14 13 12 11 10 9 8 7 6 5 4 3 2 0 Direct: I 0 0 0 0 0 II0 Data Memory Address lndirect:j 0 0 0 0 0 II1 See Section 4.1 Description The contents of the addressed data memory location are subtracted from the accumulator with sign-extension suppressed. The data is treated as a 16-bit unsigned number, regardless of SXM. The accumulator behaves as a signed number. SUBS produces the same result as a SUB instruction with SXM =o and a shift count of 0. Words 1 Cycles Cycle Timings for a Single Instruction Pl/DI I Pl/DE I J PE/DE J PR/DI I PR/DE PE/DI 1 l l 2+d l 2+d+p l 1 I 2+d 1+p Cycle Timings for a Repeat Execution n I 1+n+nd I n+p } 1+n+nd+p J n 1 1+n+nd Example SUBS DAT2 ; (DP = 16) or SUBS * ;If current auxiliary register contains 2050. Before Instruction After Instruction Data Memory 2050 OF003h Data Memory 2050 OF003h I Before Instruction After Instruction AccE)I OF105h I Acc(2] I 102h I c c 4-181 SU BT Subtract from Accumulator with Shift Se,ecified by T Register Syntax Direct: [label] SUBT dma Indirect: [label] SUBT {ind}[, next ARP] Operands o :s; dma:s;127 0 :s; next ARP :s; 7 Execution (PC}+ 1 -PC (ACC} - [(dma} x 2 T register (3 - O)] - (ACC} If SXM = 1: Then (dma} is sign-extended. If SXM =0: Then (dma} is not sign-extended. Affects OV; affected by SXM and OVM. Affects C. Encoding 15 14 13 12 11 10 9 8 7 s 5 4 3 2 0 Direct:! o 0 0 0 0 II 0 Data Memory Address I Indirect: o 0 0 0 0 II 1 See Section 4.1 Description The data memory value is left-shifted and subtracted from the accumulator. The left-shift is defined by the four LSBs of the T register, resulting in shift op- tions from Oto 15 bits. The result replaces the accumulator contents. Sign-ex- tension on the data memory value is controlled by the SXM status bit. Words 1 Cycles Cycle Timings for a Single Instruction Pl/DI l Pl/DE l l PE/DE l PR/DI l PE/DI PR/DE 1 l 2+d I I 2+d+p l 1 I 1+p 2+d Cycle Timings for a Repeat Execution n I 1+n+nd I n+p I 1+n+nd+p I n I 1+n+nd Example SUBT DAT127 ;(DP= 4) or SUBT * ;If current auxiliary register contains 639. Before Instruction After Instruction Data Memory S39 Sh I Data Memory S39 Sh I T OFF98h I T OFF98h I ACC El I OFDA5h I Acc~I OF7A5hl c c 4-182 Assembly Language Instructions Set External Flafl, SXF Syntax [label] SXF Operands None Execution (PC)+ 1 - PC 1 - external flag (XF) pin and status bit Affects XF. Encoding 15 14 13 12 11 10 9 8 7 6 5 4 3 2 0 I 1 0 0 1 0 0 0 0 0 o 1 I Description The XF pin and the XF status bit in status register ST1 are set to logic 1. XF may also be loaded by the LST1 and RXF instructions. Words Cycles Cycle Timings for a Single Instruction Pl/DI I Pl/DE I PE/DI I PE/DE I PR/DI I PR/DE 1 I 1 I 1+p I 1+p I 1 I 1 Cycle Timings for a Repeat Execution n l n l n+p l n+p l n l n Example SXF ;The XF pin and status bit are set to logic 1. 4-183 TBLR Table Read Syntax Direct: [label] TBLR dma Indirect: [label] TBLR {ind} [, next ARP]] Operands Os dma s 127 O s next ARP s 7 Execution (PC)+ 1-+ PC (PFC)-+ MCS (ACC(15-0))-+ PFC If (repeat counter) .. O: Then (pma, addressed by PFC) - dma, Modify AR(ARP) and ARP as specified, (PFC) + 1 -+ PFC, (repeat counter) - 1 - repeat counter. Else (pma, addressed by PFC) - dma Modify AR(ARP) and ARP as specified. (MCS)-+ PFC Encoding 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 Direct:! o 0 0 0 0 II 0 Data Memory Address I Indirect: o 0 0 0 0 II 1 See Section 4.1 Description The TBLR instruction transfers a word from a location in program memory to a data memory location specified by the instruction. The program memory ad- dress is defined by the low-order 16 bits of the accumulator. For this operation, a read from program memory is performed, followed by a write to data memory. In the repeat mode, TBLR effectively becomes a single-cycle instruction, and the program counter that contains the ACCL is incremented once each cycle. If the MP/MC pin on the TMS320C25 is low at the time of execution of this instruction and the program memory address used is less than 4096, an on- chip ROM location will be read. Words 4-184 Assembly Language Instructions Table Read TBLR Cycles Cycle Timings for a Single Instruction Pl/DI l Pl/DE Table in on-chip RAM: l PE/DI l PE/DE l PR/DI l PR/DE 2 2+d 3+p 3+d+p 3 3+d Table in on-chip ROM: 3 3+d 4+p 4+d+p 4 4+d Table in external memory: 3+p 3+d+p 4+2p 4+d+2p 4+p 4+d+p Cycle Timings for a Repeat Execution Table in on-chip RAM: 1+n 1+n+nd 2+n+p 2+n+nd+p 2+n 2+n+nd Table in on-chip ROM: 2+n 2+n+nd 3+n+p 3+n+nd+p 3+n 3+n+nd Table in external memory: 2+n+np 1+2n+nd+np 3+n+np+p 2+2n+nd+np 3+n+np 2+2n+nd+np +p Example TBLR DAT6 ;(DP= 4) or TBLR * ;If current auxiliary register contains 518. Before Instruction After Instruction ACC 23h I ACC 23h I Program Memory 23 306h I Program Memory 23 306h I Data Memory 518 75h I Data Memory 518 306h I 4-185 TBLW Table Write Syntax Direct: [label] TBLW dma Indirect: [label] TBLW {ind} [, next ARP] Operands Os dma s 127 O s next ARP s 7 Execution (PC)+ 1 - PC (PFC)- MCS (ACC(15--0)) - PFC If (repeat counter) .. O: Then dma - (pma, addressed by PFC), Modify AR(ARP) and ARP as specified, (PFC) + 1 - PFC, (repeat counter) - 1 - repeat counter. Else dma - (pma, addressed by PFC), Modify AR(ARP) and ARP as specified. (MCS) - PFC Encoding 15 14 13 12 11 10 9 8 7 6 5 4 3 2 0 Direct:! o 0 0 0 1 II 0 Data Memory Address Indirect: I o 0 0 0 1 II 1 See Section 4.1 Description The TBLW instruction transfers a word in data memory to program memory. The data memory address is specified by the instruction, and the program memory address is specified by the lower 16 bits of the accumulator. A read from data memory is followed by a write to program memory to complete the instruction. In the repeat mode, TBLW effectively becomes a single-cycle instruction, and the program counter that contains the ACCL is incremented once each cycle. If the MP/MC pin on the TMS320C25 is low at the time of execution of this instruction and the program memory address used is less than 4096, an on- chip ROM location will be addressed but not written to. Words 1 4-186 Assembly Language Instructions Table Write TBLW Cycles Cycle Timings for a Single Instruction Pl/DI I Pl/DE Table in on-chip RAM: l PE/DI I PE/DE l PR/DI l PR/DE 2 3+d 3+p 4+d+p 3 4+d Table in on-chip ROM: not applicable Table in external memory: 2+p 3+d+p 3+2p 4+d+2p 3+p 4+d+p Cycle Timings for a Repeat Execution Table in on-chip RAM: 1+n 2+n+nd 2+n+p 3+n+nd+p 2+n 3+n+nd Table in on-chip ROM: not applicable Table in external memory: 1+n+np 1+2n+nd+np 2+n+np+p 2+2n+nd+np 2+n+np 2+2n+nd+np +p Example TBLW OATS ; (DP = 32) or TBLW * ;If current auxiliary register contains 4101. Before Instruction After Instruction ACC 257h I ACC 257h I Data Memory 4101 4339h I Data Memory 4101 4339h I Program Memory 257 306h I Program Memory 257 4339h 1 4-187 Syntax [label] TRAP Operands None Execution (PC) + 1 - stack 30-PC Not affected by INTM; does not affect INTM. Encoding 15 14 13 12 11 10 9 8 7 6 5 4 3 2 0 11 0 0 0 0 0 0 0 Description The TRAP instruction is a software interrupt that transfers program control to program memory location 30 and pushes the program counter plus one onto the hardware stack. The instruction at location 30 may contain a branch instruction to transfer control to the TRAP routine. Putting PC+ 1 onto the stack enables an RET instruction to pop the return PC (points to instruction after the TRAP) from the stack. Words Cycles Cycle Timings for a Single Instruction Pl/DI I Pl/DE Destination on-chip RAM: I PE/DI I PE/DE I PR/DI I PR/DE 2 2 2+p 2+p 2 2 Destination on-chip ROM: 3 3 3+p 3+p 3 3 Destination external memory: 3+p 3+p 3+2p 3+2p 3+p 3+p Cycle Timings for a Repeat Execution not repeatable Example TRAP ;Control is passed to program memory location ;30. PC + 1 is pushed on to the stack. 4-188 Assembly Language Instructions XOR Syntax Direct: [label) XOR dma Indirect: [label] XOR {ind} [, next ARP] Operands 0 s dma s 127 0 s next ARP s 7 Execution (PC)+ 1 - PC (ACC{15-0)) XOR dma - ACC{15-0) (ACC(31-16)) -ACC(31-16) Not affected by SXM. Encoding 15 14 13 12 11 10 9 8 7 6 5 4 3 2 0 Direct: I 0 0 0 0 0 I I 0 Data Memory Address Indirect: I 0 0 0 0 0 I I See Section 4.1 Description The low half of the accumulator is exclusive-ORed with the contents of the ad- dressed data memory location. The upper half of the accumulator is not af- fected by this instruction. Words Cycles Cycle Timings for a Single Instruction Pl/DI l Pl/DE 1 PE/DI 1 PE/DE 1 PR/DI 1 PR/DE 1 I 2+d I 1+p I 2+d+p 1 1 1 2+d Cycle Timings for a Repeat Execution n J 1+n+nd I n+p J 1+n+nd+p I n I 1+n+nd Example XOR DAT127 ; (DP = 511) or XOR * ;If current auxiliary register contains 65535. Before Instruction After Instruction Data Memory 65535 OFOFOh I Data Memory 65535 OFOFOh I Acc01 12345678h I Acc0 I 1234A688h I c c 4-189 XORK XOR Immediate with Accumulator with Shift "" Syntax [label] XORK constant [, shift] Operands 16-bit constant 0 :s; shift :s; 15 (defaults to 0) Execution (PC)+ 2 - PC (ACC(30-0)) XOR [constant x 2shift] - ACC(30-0) (ACC(31)) - ACC(31) Encoding 15 14 13 12 11 10 9 8 7 6 5 4 3 2 0 I I' 0 Shift 0 16-Bit Constant 0 0 0 0 0 Description The left-shifted 16-bit immediate constant is exclusive-ORed with the accumu- lator, leaving the result in the accumulator. Low-order bits below and high-or- der bits above the shifted value are treated as zeros, thus not affecting the cor- responding bits of the accumulator. Note that the MSB, most significant bit, of the accumulator is not affected, regardless of the shift code value. Words 2 Cycles Cycle Timings for a Single Instruction Pl/DI Pl/DE PE/DI PE/DE PR/DI PR/DE 2 2 2+2p 2+2p 2 2 Cycle Timings for a Repeat Execution not repeatable Example XORK OFFFFh,8 Before Instruction After Instruction ACC 0I 012345678h I ACC 0I 12CBA978h I c c 4-190 Assembly Language Instructions Zero Accumulator ZAC Syntax [label] ZAC Operands None Execution (PC)+ 1 s; PC 0 s; ACC Encoding 15 14 13 12 11 10 9 8 7 6 5 4 3 2 0 11 0 0 0 0 0 0 0 0 0 0 0 0 Description The contents of the accumulator are replaced with zero. The ZAC instruction has been implemented as a special case of LACK. (ZAC assembles as LACK 0.) Words Cycles Cycle Timings for a Single Instruction Pl/DI Pl/DE PE/DI PE/DE PR/DI PR/DE 1 1 1+p 1+p 1 1 Cycle Timings for a Repeat Execution not repeatable Example ZAC Before Instruction After Instruction ACC 01 OA5A5A5A5h I c 4-191 Syntax Direct: [label] ZALH dma Indirect: [label] ZALH [{ind} [, next ARP] Operands O :S dma :S127 0 :S next ARP :S 7 Execution (PC)+ 1 - PC O - ACC(15-0) (dma) - ACC(31-16) Encoding 15 14 13 12 11 10 9 8 7 6 5 4 3 2 0 Direct: I 0 0 0 0 0 0 0 I I 0 Data Memory Address Indirect: I 0 0 0 0 0 0 0 I I See Section 4.1 Description ZALH loads a data memory value into the high-order half of the accumulator. The low-order bits of the accumulator are zeroed. ZALH is useful for 32-bit arithmetic operations. Words Cycles Cycle Timings for a Single Instruction Pl/DI l Pl/DE l PE/DI l PE/DE l PR/DI l PR/DE 1 I 2+d I 1+p I 2+d+p l 1 l 2+d Cycle Timings for a Repeat Execution n I 1+n+nd I n+p J 1+n+nd+p J n 1 1+n+nd Example ZALH DAT3 ;(DP= 32) or ZALH * ;If current auxiliary register contains 4099. Before Instruction After Instruction Data Memory 4099 3F01 h I Data Memory 4099 3F01h I Acc01 77FFFFh I Acc0 I 3F010000h I c c 4-192 Assembly Language Instructions Syntax Direct: [label] ZALR dma Indirect: [label] ZALR {ind} [, next ARP] Operands 0 :s; dma s127 0 s next ARP s 7 Execution (PC)+ 1 - PC 8000h -ACC(15-0) (dma) - ACC(31-16) Encoding 15 14 13 12 11 10 9 8 7 6 5 4 3 2 0 Direct: I 0 0 1 I I 0 Data Memory Address Indirect: I 0 0 1 I I 1 See Section 4.1 Description The ZALR instruction loads a data memory value into the high-order half of the accumulator and rounds the value by adding 1/2 LSB; that is, the 15 low bits (bits 0 -14) of the accumulator are set to zero, and bit 15 of the accumulator is set to one. ZALR is a derivative instruction from ZALH. Words Cycles Cycle Timings for a Single Instruction Pl/DI I Pl/DE I PE/DI I PE/DE I PR/DI I PR/DE 1 I 2+d I 1+p I I 2+d+p 1 I 2+d Cycle Timings for a Repeat Execution n l 1+n+nd l n+p J 1+n+nd+p J n I 1+n+nd Example ZALR DAT3 ;(DP=32) or ZALR * ;If current auxiliary register contains 4099. Before Instruction After Instruction Data Memory 4099 3F01 h I Data Memory 4099 3F01h I Acc01 77FFFFh I Acc0 I 3F018000h I c c 4-193 ZALS Zero Accumulator, Load Low Accu__mulat~ with Sifi.'!:.€.>1!.'1~i£n Suppressed, "' Syntax Direct: [label] ZALS dma Indirect: [label] ZALS {ind} [ next ARP] Operands O :s; dma :s:127 0 :s; next ARP :s; 7 Execution (PC)+ 1 - PC O -ACC(31-16) (dma) - ACC(15-0) Not affected by SXM. Encoding 15 14 13 12 11 10 9 8 7 6 5 4 3 2 0 Direct: I 0 0 0 0 0 0 II0 Data Memory Address Indirect: I 0 0 0 0 0 0 II See Section 4.1 Description The contents of the addressed data memory location are loaded into the 16 low-order bits of the accumulator. The upper half of the accumulator is zeroed. The data is treated as a 16-bit unsigned number rather than a 2s-complement number. Therefore, there is no sign-extension with this instruction, regardless of the state of SXM. (ZALS behaves the same as a LAC instruction with no shift, and SXM = 0.) ZALS is useful for 32-bit arithmetic operations. Words Cycles Cycle Timings for a Single Instruction Pl/DI I Pl/DE I PE/DI I PE/DE I PR/DI I PR/DE 1 l 2+d l l1+p l 2+d+p 1 l 2+d Cycle Timings for a Repeat Execution n l 1+n+nd l n+p J 1+n+nd+p J n l 1+n+nd Example ZALS DATl ;(DP= 6) or ZALS * ;If current auxiliary register contains 769. Before Instruction After Instruction Data Data Memory OF7FFh I Memory OF7FFh I 769 769 ACC 0 . _ I_ _ 1_F_Fo_o_o3_3h__,I Ace GJ l.____o_F_1F_Fh__.I c c 4-194 Assembly Language Instructions Chapter 5 The TMS320C2x microprocessor/microcomputer design emphasizes overall speed, communication, and flexibility. Many instructions are tailored to digital signal processing tasks and provide single-cycle multiply/accumulates, adap- tive filtering support, and many other features. General-purpose instructions support floating-point, extended-precision, logical processing, and control ap- plications. This chapter provides explanations of how to use the various TMS320C2x pro- cessor and instruction set features along with assembly language coding ex- amples. More information about specific applications can be found in the book, Digital Signal Processing Applications with the TMS320 Family (literature number SPRA012A). The assembly source code examples in this chapter contair. directives and commands specific to the Texas Instruments Assembly Language Tools. Pub- lication TMS320 Fixed-Point DSP Assembly Language Tools (literature num- ber SPRU0188) is highly recommended as a reference. The TMS320C26 is similar to the TMS320C25 except for its internal memory configuration. This is discussed in Section 3.4 and in Appendix B. Topics in this chapter include: Topic Page 5-1 Processor Initialization 5.1 Processor Initialization Prior to the execution of a digital signal processing algorithm, it is necessary to initialize the processor. Generally, initialization takes place anytime the pro- cessor is reset. When reset is activated by applying a low level voltage to the RS (reset) input for at least three cycles, the TMS320C2x terminates execution and forces the program counter (PC) to zero. Program memory location 0 normally contains a B (branch) instruction to direct program execution to the system initialization routine. The hardware reset also initializes various registers and status bits. After reset, the processor should be initialized to meet the requirements of the system. Instructions should be executed that set up operational modes, memory pointers, interrupts, and the remaining functions necessary to meet system requirements. To configure the processor after reset, the following internal functions should be initialized: O Memory-mapped registers O Interrupt structure 0 Mode control (OVM, SXM, FO, TXM, PM; plus HM and FSM on TMS320C25) O Memory control (CNF) O Auxiliary registers and the auxiliary register pointer (ARP) O Data memory page pointer (DP) The OVM (overflow mode), TC (test/control flag), and IMR (interrupt mask reg- ister) bits are not initialized by reset. The auxiliary register pointer (ARP), auxil- iary register pointer buffer (ARB), and data memory page pointer (DP) are also not initialized by reset. Example 5--1, and Example 5--2 show coding for initializing the TMS320C25, and TMS320C26, respectively, to the following machine state, in addition to the initialization performed during the hardware reset: O All interrupts enabled O OVM disabled O DP set to zero 0 ARP set to seven (TMS320C25 and TMS320C26) O Internal memory filled with zeros 5-2 Software Applications Processor Initialization Example 5-1. Processor Initialization (TMS320C25} .title 'PROCESSOR INITIALIZATION' .def RESET,INTO,INT1,INT2 .def TINT,RINT,XINT,USER .ref ISRO,ISR1,ISR2 .ref TIME,RCV,XMT,PROC * * PROCESSOR INITIALIZATION FOR THE TMS320C25. * RESET AND INTERRUPT VECTOR SPECIFICATION. * BRANCHES FOR EXTERNAL AND INTERNAL INTERRUPTS. * .sect "vectors" RESET B INIT RS-BEGINS PROCESSING HERE. * INTO B ISRO INTO- BEGINS PROCESSING HERE. INTl B ISRl INTl- BEGINS PROCESSING HERE. INT2 B ISR2 INT2- BEGINS PROCESSING HERE. * .space (18h-($-RESET))*l6 TINT B TIME TIMER INTERRUPT PROCESSING. RINT B RCV SERIAL PORT RECEIVE PROCESSING. XINT B XMT SERIAL PORT TRANSMIT PROCESSING. * USER B PROC TRAP VECTOR PROCESSING BEGINS. * * THE BRANCH INSTRUCTION AT PROGRAM MEMORY LOCATION 0 DIRECTS EXECUTION TO BEGIN * HERE FOR RESET PROCESSING THAT INITIALIZES THE PROCESSOR. WHEN RESET IS * APPLIED, THE FOLLOWING CONDITIONS ARE ESTABLISHED FOR THE STATUS AND OTHER * INTERNAL REGISTERS: * * ARP ov OVM 1 INTM DP * STO: XXX 0 x 1 1 xxxxxxxxx * * ARB CNF TC SXM C 11 HM FSM XF FO TXM PM * STl: XXX 0 x 1 1 11 1 1 1 0 0 00 * * REGISTER ADDRESS DATA * DRR OOOOh xx xx xx xx xx xx xx xx * DXR OOOlh xxxx xxxx xx xx xx xx * TIM 0002h 1111 1111 1111 1111 * PRD 0003h 1111 1111 1111 1111 * IMR 0004h 1111 1111 llXX xx xx * GREG 0005h 1111 1111 0000 0000 * * RESERVED XINT RINT TINT INT2 INTl INTO * MR: 1111111111 X X x x x x * .text INIT ROVM DISABLE OVERFLOW MODE. LDPK 0 POINT DP REGISTER TO DATA PAGE 0. LARP 7 POINT TO AUXILIARY REGISTER 7. LACK 3Fh LOAD ACCUMULATOR WITH 3Fh. SACL 4 ENABLE ALL INTERRUPTS VIA IMR. * * INTERNAL DATA MEMORY INITIALIZATION. * 5-3 Processor Initialization ZAC ZERO THE ACCUMULATOR. LARK AR7,60h POINT TO BLOCK B2. RPTK 31 SACL *+ STORE ZERO IN ALL 32 LOCATIONS. * LRLK AR7,200h POINT TO BLOCK BO. RPTK 255 SACL *+ ZERO ALL OF PAGES 4 AND 5. * LRLK AR7,300h POINT TO BLOCK Bl. RPTK 255 SACL *+ ZERO ALL OF PAGES 6 AND 7. * * THE PROCESSOR IS INITIALIZED. THE REMAINING APPLICATION-DEPENDENT PART OF * THE SYSTEM (BOTH ON- AND OFF-CHIP) SHOULD NOW BE INITIALIZED. * EINT ; ENABLE ALL INTERRUPTS. Example 5-2. Processor Initialization (TMS320C26) .title 'INIT26' .title 'TMS320C26 PROCESSOR INITIALIZATION' .width 100 .option x .def RESET,INTO,INT1,INT2 .def TINT,RINT,XINT,USER .ref ISRO,ISR1,ISR2 .ref TIME,RCV,XMT,PROC * * RESET AND INTERRUPT VECTOR SPECIFICATION: BRANCHES FOR EXTERNAL AND INTERNAL INTERRUPTS * * RESET B !NIT RS-will begin processing here * INTO B !SRO INTO- PROCESSING INTl B ISRl INTl- PROCESSING INT2 B ISR2 INT2- PROCESSING .space 16*16 RESERVED TIME TINT B TIME TIMER INTERRUPT PROCESSING RINT B RCV SERIAL PORT RECEIVE PROCESSING XINT B XMT SERIAL PORT TRANSMIT PROCESSING USER B PROC TRAP VECTOR PROCESSING * * THE BRANCH INSTRUCTION AT LOCATION 0 DIRECTS EXECUTION TO BEGIN HERE FOR RESET * PROCESSING TO INITIALIZE THE PROCESSOR. WHEN RESET IS APPLIED, THE FOLLOW- ING * CONDITIONS ARE ESTABLISHED FOR THE STATUS AND OTHER INTERNAL REGISTER. * * IN THIS EXAMPLE THE BRANCH INCLUDES THAT THE ARP IS SET TO 7. * THE AUXILIARY REGISTIER POINTER IS NOT SET FROM RESET. * 5-4 Software Applications Processor Initialization * ARP ov OVM 1 INTM DP * STO: 111 0 x 1 1 xxxxxxxxx * * ARB CNFO TC SXM c 1 CNFl HM FSM XF FO TXM PM * STl: xxx x 1 1 1 0 1 1 1 0 0 00 * * REGISTER ADDRESS DATA * DRR OOOOh xxxx xxxx xxxx xx xx * DXR OOOlh xxxx xxxx xxxx xx xx * TIM 0002h 1111 1111 1111 1111 * PRD 0003h xxxx xxxx xxxx xx xx * IMR 0004h 1111 1111 llXX xx xx * GREG 0005h 1111 1111 0000 0000 * * RESERVED XINT RINT TINT INT2 INTl INTO IMR: 1111111111 X X x x x x * def !NIT BO .set 0200h DATA MEMORY BLOCK BO B2 .set 0060H DATA MEMORY BLOCK B2 IMR .set 4 INTERRUPT MASK REGISTER .TEXT !NIT ROVM DISABLE OVERFLOW MODE LDPK 0 POINT TO DATA MEMORY PAGE 0 LARP 7 POINT TO AUXILIARY REGISTER 7 CONF 0 CONFIGURE ALL INTERNAL RAM BLOCKS AS DATA MEMORY LACK 03FH LOAD ACCUMULATOR WITH INTERRUPT MASK SACL IMR ENABLE ALL INTERRUPTS * * INTERNAL DATA ~MORY INITIALIZATION * .sect "INIT_RAM" ZAC ZERO THE ACCUMULATOR LARK AR7 ,B2 POINT TO BLOCK B2 RPTK 31 SACL *+ STORE ZERO IN ALL 32 LOCATIONS * LRLK AR7,BO POINT TO BLOCK BO LARK AR6,5 REPEAT LOOPl 6 TIMES LOOPl: RPTK 255 ZEROING BLOCK BO, Bl AND B3 SACL *+ ZERO THE PAGES: 4-15 LARP AR6 BANZ LOOP1,*-,AR7 REPEAT 6 TIMES * * THE PROCESSOR IS INITIALIZED. THE REMAINING APPLICATION DEPENDENT PART OF THE SYSTEM (BOTH ON- AND OFF-CHIP) SHOULD NOW BE INITIALIZED. * EINT ; ENABLE ALL INTERRUPTS 5-5 Processor Initialization 5.1.1 TMS320C26 Download/Bootstrapping Modes The TMS320C26 boot program allows three types of download: O Mode 1: parallel download from an 1/0 port O Mode 2: serial download from an RS232 port O Mode 3: external memory (EPROM) download. Note: In all three modes, O The download begins at data block BO (0200h) in internal space and con- tinues until the length specified by the download mode is reached. The appropriate memory blocks are then configured as program, and execu- tion transfers to the first address in program block BO (OFAOOh). O The ROM interrupt vector table uses AR modification. To save context on an interrupt, the user-defined vector table in program block BO should not modify the auxiliary registers. This is especially important in external global memory downloads in which an unrryodified B(ranch) instruction is used to identify valid code. O If the RS signal is not a clean TTL signal, the various processor sections may not be properly synchronized with each other. This is because the RS pin does not have an internal Schmidt trigger built into it. It is there- fore recomended that you use a Schmidt-triggered gate with an RC time constant and external switch to avoid this. 5.1.1. 1 Mode 1: Parallel Download From an 1/0 Port You can perform a parallel download through a parallel interface to a host pro- cessor via parallel 1/0 port zero (PAO). Both 8- and 16-bit wide data words can be transferred. BIO and XF are used as handshake signals to the host. If the BIO signal is low at reset, a parallel 1/0 mode download will be initiated. Otherwise, bootloader control passes to modes 2 and 3. The BIOZ (BIO pin) test is made 36+2d cycles after reset, but it is recommended that the BIO pin be initialized at power-up or reset. The value of dis the number of wait states used at global memory address 08000h. In this case, a read of memory loca- tion 08000h is used as a delay and is part of the global EPROM download op- tion. However, the status of that test is not used until after the BIO pin has been polled. Each transfer of program data from the host is accomplished through a BIO and XF handshake with the host. A data transfer is initiated by the host, driving 5-6 Software Applications Processor Initialization the BTO pin low. When the BTO pin goes low, the C26 inputs the data from port address zero and stores it in the currently available memory location. The C26 then drives the XF pin high to indicate to the host that the data has been re- ceived. The C26 then waits for the BTO pin to go high before setting the XF pin low. The low status of the XF line can then be polled by the host to indicate that the C26 is ready for another piece of data. Example 5-3. 810-XF Transfer Protocol BIO low ;at reset initiates parallel I/O mode BIO high ;host requests to transmit XF low ;C26 indicates ready to receive BIO low ;host indicates data valid; C26 inputs STATUS XF high ;C26 indicates word was received BIO high ;host requests to transmit XF low ;C26 indicates ready to receive BIO low ;host indicates data valid; C26 inputs INTERRUPT XF high ;C26 indicates word was received BIO high ;host requests to transmit XF low ;C26 indicates ready to receive ;This is repeated as many times as needed BIO high ;host requests to transmit XF low ;C26 indicates ready to receive BIO low ;host indicates data valid; C26 inputs CHECKSUM XF/PAO ;C26 indicates CHECKSUM status; HIGH=pass LOW=fail ;~~~~~~~~~~~~~~~~~~~~~~~~~~ ; Synchronization word BIO high ;host requests transmit XF low ;C26 indicates ready to receive BIO low ;C26 branches to execute program (data input but not used) BRANCH PROG;program is now running Figure 5-1. 810-XF Handshake mo__J \ y XF I I Requests I Host \'C26 Ready Data I Data \ I Repeat Transmit to Receive Input Was Received Note: The falling edge of BTO acts like a latch, causing the C26 to input the data. 5-7 Processor Initialization Figure 5-2. Sequence for 8-Bit Transfers 15 8 7 0 xxxxxxxx STATUS WORD xxxxxxxx INTERRUPT WORD xxxxxxxx PROGRAM LENGTH xxxxxxxx xxxxxxxx xxxxxxxx PROG WORD 1 LOW PROG WORD 1 HIGH PROG WORD 2 LOW T 2x Length Transfers xxxxxxxx xxxxxxxx PROG WORD 2 HIGH REPEAT J_ xxxxxxxx CHECKSUM LOW xxxxxxxx CHECKSUM HIGH xxxxxxxx SYNCHRO (DUMMY) Figure 5-3. Sequence for 16-Bit Transfers 15 8 7 0 xxxxxxxx STATUS WORD xxxxxxxx INTERRUPT WORD xxxxxxxx PROGRAM LENGTH PROGRAM WORD 1 PROGRAM WORD 2 T Length Transfers REPEAT _L CHECKSUM xxxxxxxx SYNCHRO (DUMMY) Note: In all transfers, the XF pin can be ignored as long as the host allows sufficient time for the C26 to get ready for the next transfer. 5-8 Software Applications Processor Initialization Configuration Word Definitions STATUS (1 BIO-XF transfer) This is the first word sent to the C26. The bit fields for this word are given below. Bits DO, D1, D2 are the MSBs of the program length. Bit D3 selects the reset/download mode: 0 =reset only (no download) 1 = start download of the program Bit D4 selects the transmission/memory format: O = 8-bit format 1 = 16-bit format (not allowed in serial mode) Bits D5-D7 should be set low (Do not use them.) INTERRUPT (1 BIO-XF transfer) This word defines the interrupt and final memory configuration to be installed after bootstrapping. During the boatload process, blocks BO, B1, and B3 are configured as data and always loaded first. This word is loaded into the C26 by a single transfer with the upper bits being masked off. The configuration is as follows. Bits DO-D5 are loaded into the interrupt mask register (IMR). Bits D6 & D7 define the memory configuration after download: D7 D6 Program Memory Data Memory 0 0 BO B1, 82, 83 0 1 BO,B1 B2,B3 0 BO, B1, B3 B2 PROGRAM LENGTH (1 BIO-XF transfer) The third word to be transferred is the program length, starting at block BO (0200h) followed by B1 and B3. The 8 LSBs of the LENGTH word are com- bined with bits DO, D1, and D2 of the STATUS word to form the total program length (up to 2K words in length). The length does not include any of the con- trol, CHECKSUM, or SYNCHRONIZATION words. Figure 5-4. Building LENGTH From STATUS and PROGRAM LENGTH Words I Don't Caret STATUS Word Bits ~ PROGRAM LENGTH Word Bits -:-j D2 D1 DO D7 D6 D5 04 D3 D2 D1 DO Ix x x x x LA Ls Ls I L7 L6 L5 L4 L3 L2 L1 Loi 5-9 Processor Initialization PROGRAM WORD (1 or 2 BTO-XF transfers) The next LENGTH program words are then loaded into the internal RAM fol- lowed by external data RAM at 0800h. In the 8-bit mode, two words are trans- ferred for each complete program word. That is, 4K transfers will result in up to 2K program words received. Also note that the maximum length can extend past the last address of block B3, into external data memory, by 512 words. In the 8-bit mode, the byte sequence is low to high. CHECKSUM (1 or 2 BTO-XF transfers) The CHECKSUM word verifies the correct result of the transfer. The checksum is defined as the lower 16 bits of the sum of all program words transferred. The checksum does not include any control words or the final checksum sent by the host. After completing the program transfer, the host transmits a precalcu- lated checksum, and the C26 returns the status on the XF line and port PAO. The checksum status definitions are shown below. In the 8-bit mode, the byte sequence is low to high. XF=O or PAO= OOh, indicates a checksum error. XF=1 or PAO=OFFh, indicates a correct checksum. Note: If a checksum error occurs, this will cause the normal mo-XF hand- shake to fail. A host timeout (loop count) can be used to verify a failed handshake and is a good method to detect a failed checksum as well. SYNCHRONIZATION (1 BTO-XF transfer) After loading the CHECKSUM, the value previously transmitted in the configu- ration word reconfigures the internal memory and interrupts. The C26 then waits for a falling edge on the mo pin before program control is passed to the first address of BO. If a checksum error has occurred, this allows the host to check the status and possibly reboot the system. When mo goes low, program control is always passed to the first address of program block BO, regardless of the checksum status. Note: Because the XF pin is used as a handshake signal during transfers with the .host, suitable software control must verify the correct sum check status. 5-10 Software Applications Processor Initialization 5. 1. 1.2 Mode 2: Serial Download From an RS232 Port (8 Data Bits, 2 Stop Bits, 1 Start Bit) If themo signal is found to be high 39+2d cycles after reset, a test is made to determine if external global memory (EPROM, mode 3) is present. If this fails, a serial download is performed. It is recommended that you initialize the mo pin at reset to avoid inadvertently selecting the wrong mode. The value of dis the number of wait states for global memory address 08000h and be- comes part of the delay before polling the pin.mo The presence of an unmodified B instruction in the global data space (but not in normal data space) determines whether there is an external EPROM in glob- al memory. For more information, refer to subsection 5.1 .1.3. The serial link is RS232 standard, using TTL levels at the mo and XF pins. In this case, themo pin receives the data from the host via an RS232 line receiv- er, and the XF pin sends status back to the host via a line driver. The receive levels and data format are shown below. Figure 5-5. RS232 Connection to the TMS320C26 RS232 (DB25) TMS320C26 1/4 75189 TX 2 // - BTO 1/475188 3 RX -. // - i-. XF 7 GNDt---// Vss C26 BIO PIN (RS232 TRANSMIT DATA 'TX') Stop Bits = TTL logic high (1) Start Bit = TTL logic low (0) Data Bits = MSB received first Start Data 06 Bit 07 MSB 5-11 Processor Initialization C26 XF PIN {RS232 RECEIVE DATA 'RX') On reset, XF is driven high, indicating that a transfer has been initiated. If the download is not successful and the checksum fails, XF is driven low, indicating a failure. The host should wait until this time to poll the checksum verification status. The levels are given below. Logic high (1) = Transmission in progress or checksum valid Logic low (0) =Checksum error Example 5-4. RS232 Transfer Protocol BIO high ;at reset signals either serial or EPROM load EPROM ? ;Global and normal data space is checked for an EPROM ;signiture. If found mode 3 download is entered. ;~~~~~~~~~~~~~~~~~~~~~ BIO high ;stop bit (has been high since reset) BIO low ;start bit, this bit is timed for baud rate BIO DATA_? ;high, signals end of start bit for baud rate detect BIO DATA_6 ;rest of data bits for baud rate detect are don't care BIO DATA_S ;don't care BIO DATA_4 ;don't care BIO DATA_3 ;don't care BIO DATA_2 ;don't care BIO DATA_l ;don't care BIO DATA 0 ;don't care BIO high- ;stop bit 1, end of baud rate detect transfer BIO high ;stop bit 2, BIO low ;start bit, begin STATUS word transfer BIO DATA_? ; ;This process is repeated until all the control words, ;program words and checksum have been transferred. ;Finally, one final word (SYNCH) is used to hold the ;C26 momentarily before execution of the users program. ; BIO high ;stop bit, signals end of CHECKSUM HIGH transfer XF/PAO ;C26 indicates CHECKSUM status HIGH=pass Low=fail BIO low ;C26 branches to execute program (data input but not used) BRANCH PROG;program is now running 5-12 Software Applications Processor Initialization Figure 5-6. Sequence for RS232 Transfer (8 Data Bits Only) BAUD DETECT WORD STATUS WORD INTERRUPT WORD PROGRAM LENGTH PROG WORD 1 LOW PROG WORD 1 HIGH PROG WORD 2 LOW T 2x Length Transfers PROG WORD 2 HIGH REPEAT CHECKSUM LOW l CHECKSUM HIGH SYNCHRO (DUMMY) Configuration Word Definitions BAUD DETECT (1 RS232 transfer) The first word transmitted by the host detects the baud rate by sampling the low period of the start bit. In this case, the stop bits have been previously hold- ing the BIO line high, and the start bit drives the line low. The next bit is data and must be driven high. Since the data is received MSB first, the synchroniza- tion word sent to the serial port may be 1xxxxxxx. The low period of the start bit is sampled by using a software timing loop. The C26 then times out the re- maining data bits {dummy bits) and waits for the next start bit (BIO going low). Notethatthe serial link is not interrupt driven and therefore uses all of the avail- able processor overhead for timing the incoming data stream. STATUS (1 RS232 transfer) The second word sent to the C26 is the 8-bit STATUS word. The bit fields are given below. Bits DO, D1, and D2 are the MSBs of the program length. Bit D3 selects the reset/download mode: O = reset only (no download) 1 = start download of the program Bit D4 selects the transmission/memory format: O = 8-bit format 1 = 16-bit format (not allowed in serial mode) Bits D4-D7 should be set low. (Do not use them). 5-13 Processor Initialization INTERRUPT (1 RS232 transfer) The third word defines the interrupt and final memory configuration to be installed after bootstrapping. During the bootload process, blocks BO, B1 and B3 are configured as data and are always loaded first. This word is loaded into the C26 with a single transfer with the upper bits being masked off. The config- uration is as follows. Bits DO-D5 are loaded into the interrupt mask register (IMR) Bits D6 & D7 define the memory configuration after download D7 QQ Program Memory Data Memory 0 0 BO B 1, B2, B3 0 1 BO, B1 B2, B3 0 BO, B1, B3 B2 PROGRAM LENGTH (1 RS232 transfer) The fourth word is the program length to be transferred starting at block BO (0200h) followed by B1 and B3. The 8 LSBs of the LENGTH word are com- bined with bits DO, D1, and D2 of the STATUS word to form the total program length (up to 2K words in length). The length does not include any of the con- trol, CHECKSUM, or SYNCHRONIZATION words. :t-: Figure 5-7. Building LENGTH From STATUS and PROGRAM LENGTH Words I Don't Caret STATUS Word Bits PROGRAM LENGTH Word Bits -:--j D2 D1 DO D7 D6 D5 D4 D3 D2 D1 DO I x x x x x LA Ls La I L7 Ls L5 L4 L3 L2 L1 Loi PROGRAM WORD (2 RS232 transfers each) The next LENGTH program words are then loaded into the internal RAM fol- lowed by external data RAM at 0800h. In the RS232 mode, two words are transferred for each complete program word. That is, 4Kword transfers will re- sult in up to 2K program words received. Also note that the maximum length can extend past the last address of block B3, into external data memory, by 512 words. In the RS232 mode, the byte sequence is low to high. CHECKSUM (2 RS232 transfers) The CHECKSUM word is used to verify correct result of the transfer, The checksum is defined as the lower 16 bits of the sum of all program words trans- ferred. The checksum does not include any control words or the final check- sum sent by the host. After completing the program transfer, the hosttransmits 5-14 Software Applications Processor Initialization a precalculated checksum, and the C26 returns the status on the XF line and port PAO. The checksum status definitions are shown below. In the RS232 mode, the byte sequence is low to high. XF=O or PAO= OOh, indicates a checksum error. XF=1 or PAO=OFFh, indicates a correct checksum. SYNCHRONIZATION (1 RS232 transfer) After loading the CHECKSUM, the value previously transmitted in the configu- ration word reconfigures the internal memory and interrupts. The C26 then waits for a falling edge on the BTO pin before program control is passed to the first address of BO. If a checksum error has occurred, this allows the host to check the status and possibly reboot the system. When BTO goes low, program control is always passed to the first address of program block BO, regardless of the checksum status. Note: XF is driven high by reset and remains high to indicate that a transfer is in progress. A high level on XF also indicates that a checksum is cor- rect. If needed, a host timeout can be used to determine ifthe XF status indicates a transfer is in progress or a correct checksum has been re- ceived. 5. 1. 1.3 Mode 3: External Memory (EPROM) Download If the BTO signal is found to be high 39+2d cycles after reset, a test is made to determine if external global memory is present. If this fails, a serial download (mode 2) is performed. It is recommended that BTO pin be initialized at power- up or reset to avoid inadvertently selecting the wrong mode. The value of dis the number of wait states used at global memory address 08000h and be- comes part of the delay before polling the status of BTO. The presence of an EPROM is determined by a test pattern check for an un- modified B instruction in the first download location. Both global and normal data spaces are checked. The test pattern must be found in the global data space but not in normal data space. This bit pattern test was chosen because the ROM-coded vector table uses ARP modification while branching to your vector table in block BO. If your pro- gram were also to use ARP modification, the ARP buffer (ARB) would be over- written, and ARP recovery during an interrupt service routine would not be pos- sible. The conclusion is that the unmodified B instruction is an excellent test because you should never modify it. Furthermore, since most systems do not decode the global memory space when selecting external memory, a random bit pattern resembling an unmodified branch instruction will be rejected as a valid EPROM signature. Global memory decoding must therefore be used to download from external memory (EPROM). 5-15 Processor Initialization The signature test subtracts the value of a B instruction (OFF80h) from the re- sulting combined 16 bits of the first two words in location 08000h. If a zero is returned in the accumulator, it indicates that a branch was found. The TMS320C26 performs this test in global memory by setting GREG=080h. If a B instruction is present, it indicates that a valid EPROM may have been found. The 'C26 performs the same test in normal data space by setting GREG=Oh. If a B instruction is present again, mode 3 is aborted and mode 2 (RS232 serial port) operation is entered. The downloading then continues until all of BO, 81, and 83 are filled with data (1536 words). If additional data recovery is needed, your downloaded program can take over. The memory to be loaded is recovered from the lower 8 data bits (D0-07) in a Hl,LO,Hl,LO order. The upper byte is masked out. The byte ordering for the first few words, including the test branch, is shown in Figure 5-8. Figure 5-8. External Memory Byte Ordering Ext_Global_ Mem lnt_Data_Mem D15 DB D7 DO D15 DO 08000h xxxxxxxx 11111111 08001h xxxxxxxx 10000000 LJ B (OFF80h) 0200h 08002h xxxxxxxx PA High 08003h xxxxxxxx PA Low 0 Prog_Addr 0201h 08004h xxxxxxxx 11111111 p ~ 08005h xxxxxxxx 10000000 i - - 8 (OFF80) 0202h 08006h xxxxxxxx 11111111 t--- I I In this mode, no checksum is performed because no host connection is used to perform the download. If you still want a checksum, your program can per- form this task. 5-16 Software Applications Processor Initialization Example 5-5. TMS320C26BFNL Bootloader TMS320C26BFNL Bootloader 1/15/92 .text .title "*** Texas Instruments TMS320C26 Bootloader ***" .nunregs MEMORY: .set 060h ;Temporary Register LENGTH: .set 061h ;Program-Length CHECK: .set 062h ;Checksum MASKFF: .set 063h ;Low-Byte-Mask WORDSL: .set 064h ;Low-Byte Data Word WORDSH: .set 065h ;High-Byte Data Word BITLEN: .set 066h ;RS232 bit length MODE: .set 067h ;Functional mode STATUS: .set 07Eh ;Statusword INTER: .set 07Fh ;Interrupt-Word *************************************************** POSST: .set OBh ;Statusbit-Position POSRD: .set OCh ;Reset\Downl.-Bit-Pos BCBl: .set 09h ;Block-Config-Bitl-Po BCB2: .set 08h ;Block-Config-Bit2-Po ADRESS: .set 0200h ;Data-Adress of BO PROG: .set OFAOOh ;Prog-Adress of BO EPROM: .set 08000h ;EPROM address LEPROM: .set OBFFh ;EPROM length * * * RESET AND INTERRUPTS * * * B START,*,AR7 ;Reset B PROG+2,*,ARO ;Interrupt 0 B PROG+4,*,ARO ;Interrupt 1 B PROG+6,*,ARO ;Interrupt 2 .space 16 * 16 ;reserve 16 words B PROG+S,*,ARO ;Timer-Interrupt B PROG+lO,*,ARO;Serial-Port-Int. B PROG+l2,*,ARO;Serial-Port-Int. B PROG+14,*,ARO;Software-Interrupt * * * DOWNLOAD PROGRAM AREA * * * GLITCH: START ldpk 0 rsxm ; lack OFFh ;Clear Checksum and load Mask sacl MASKFF sach CHECK lark ARl, 0 ;Load ARl+l words (last in accum) call Test Loadl ;Test GLOBAL EPROM(must return 0) * 5-17 Processor Initialization * READ FUNCTIONAL MODE 36+2d CYCLES AFTER RESET * BIO 0 - > COPROCESSOR (PARALLEL I/O) LOAD * BIO = 1 - > MULTIPROCESSOR (SERIAL) MODE * -OR- BYTE WIDE EPROM LOAD <~ NEW *~~~~~~~~~~~~~~~~~~~~~~~~~ bi oz COPROl ;BIO low -> COPROCESSOR bnz MULTI ;Zero indicates B ->PASS lark ARl, 0 ;if pass test NORMAL data space call Test Load2 ; bz MULTI ;Zero indicates B ->FAIL call Full Load ;OK to load EPROM conf 3 ;BO, Bl & B3 as program ;NOP ;NOP adds extra latency B NEED2 ;Double B for CONF 3 latency MULTI: MULTIPROCESSOR (SERIAL) MODE (BIO=INPUT) *** WARNING *** First word must be 1 (ONE)to synchronize low period. Treated as a dummy word. (Not used) lark ARl,O ;init. bitlen counter LACK 1 ;MODE=l MULTIPROCESSOR/UART AUTO BO bi oz STBIT,*,ARl ;wait for start bit b AUTO BO STBIT BIOZ STBIT,*+ ;Bit length = 3*(ARO) cycles SAR ARl,BITLEN ; LARK AR2,9 ;wait for 8 bits + 2 stop bit SACL MODE ; MODE=l (MULTIPROCESSOR) AUTOB2 LAR ARl, BITLEN , BANZ $,*- ;wait (BITLEN +2) cycles LARP AR2 BANZ AUTOB2,*-,AR1;last bit in word? B COMMON ;execute common download PG COPROl COPROCESSOR (PARALLEL I/O) MODE BIOZ COPRO ;BIO low -> COPROCESSOR B GLITCH ;BIO high -> Made mistake COPRO LACK 0 ; SACL MODE ;init MODE O=COPROCESSOR COMMON: CALL READ ;read status word SACL MEMORY BIT MEMORY,POSRD ;D3 (download) = high? BBZ BLOCK ;No, then >BLOCK CONFIG LAC MEMORY ;Store Statusword in SACL STATUS ;STATUS CALL READ ;read interrupt mask SACL INTER CALL READ ;Read Program-Length AND MASKFF ;mask unused bit SACL LENGTH LAC STATUS,8 ;high-Byte ANDK 0700h ;mask unused bit OR LENGTH ;High-Byte and Low-Byte 5-18 Software Applications Processor Initialization SACL LENGTH ;into Program-Length LRLK AR7,ADRESS ;Init. address LAR AR6,LENGTH ;Init. counter value BIT STATUS,POSST ;D4 (16 bit format)= high? BBZ LOW8L,*,AR7 ;No, then go to LOW8L ZAC LOW16 BIOZ LOW16 ;BIO-Input = high? RXF ;Set Ready-Signal HIGH16 BIOZ READ16 ;BIO-Input = low? B HIGH16 , READ16 IN *,PAO ;Read Program-Data SXF ;Reset Ready-Signal ADD *+,0,AR6 ;Accumulate Checksum BANZ LOW16,*-,AR7 ;Last Word? SACL CHECK ; CALL READ ;read checksum CALL CHKSUM ;test checksum B BLOCK LOW8L CALL READ ;Read Program-Data LSB AND MASKFF ;mask unused bit SACL WORD8L ;-> Low-Byte CALL READ ;Read Program-Data MSB SACL WORD8H ;-> high-Byte LAC CHECK ADD WORD8L ;Accumulate Checksum ADD WORD8H,8 ;Accumulate Checksum SACL CHECK , LAC WORD8H,8 ;Modify Program-Data OR WORD8L ;-> High-Byte+Low-Byte SACL *+,O,AR6 ;Store Block B0\1\3 BANZ LOW8L,*-,AR7 ;Last Word? CHKRID CALL READ ; read checksum LSB AND MASKFF ;mask unused bit SACL WORD8L ; CALL READ ; read checksum MSB SACL WORD8H LAC WORD8H,8 OR WORD8L ;-> High-Byte+Low-Byte CALL CHKSUM ; test checksum * CONFIGURE BO, Bl & B3 AND THEN WAIT FOR * * FOR START SIGNAL (BIO=O) TO JUMP TO PROGRAM * BLOCK BIT INTER,BCB2 ;Block-Config-Bit2=1? conf 3 ;Set all Prog.-Memory bbnz PO INTO BIT INTER,BCBl ;Block-Config-Bitl=l? conf 2 ;Set BO,Bl Prog.-Mem. bbnz PO INTO CONF 1 ;Set BO Prog.-Memory PO INTO LAC INTER ;init Interrupts SACL IMR ;of Interrupt-Word CALL READ ;dummy read for synchro NEED2 SSXM 5-19 Processor Initialization B PROG,*,ARO ;branch to user prog (BO) READ LAC MODE BZ READP ;MODE ? READS: ;MULTIPROCESSOR->RS232 link LARK AR2,0 ;init. byte value WSTBIT BIOZ STOK,*,ARl ;wait for start bit falling edge B WSTBIT Note: The following sequence uses a shift and decriment arangement to scale BITLEN for proper RS232 timing. In this case the time in the loop is 1/2 the length of the start bit ;~~~~~~~~~~~~~~~~~~~~~~~~~~ STOK lac BITLEN,6 ;BITLEN is scaled and half len subk 171 ;decremented by 8/3 for bgz half len ;BITLEN/2 wait LARK AR3,7 ;number of bits - 1 LARK ARO, 1 ;bit number 1 value WTBIT CALL BIT ;wait for a bit BANZ WTBIT,*-,ARl ;last bit ? LARK ARO,O ;stop bit value CALL BIT ;wait for stop bit SAR AR2,MEMORY LAC MEMORY ;ACC == RS232 byte value LARP AR7 RET ;ACC = read value BIT LAR ARl,BITLEN ; BANZ $,*- ;wait for a bit BIOZ ZEROBT,*,AR2 ;test bit value 0 ? MAR *0+ ;add bit value ZERO BT LARP ARO MAR *O+,AR3 ;dble bit val for next bit RET READP: ;COPROCESSOR ->par intface BIOZ READP ;BIO-Input = high? RXF ;Set Ready-Signal HIGHST BIOZ READP2 ;BIO-Input = low? B HIGHST READP2 IN MEMORY,PAO ;Read value SXF ;Reset Ready-Signal LAC MEMORY ;ACC = read value RET CHKSUM: SXF XF 1 ->checksum OK LARK AR6,0FFh ;AR6 >FF ->checksum OK SUB CHECK BZ CHKOK ;checksum OK ? RXF ;XF = 0 ->checksum error LARK AR6,00h ;AR6 = >00 ->checksum error CHKOK SAR AR6,MEMORY OUT MEMORY,PAO ;OUTPUT PORT->checksum flag RET 5-20 Software Applications Processor Initialization *********************************************************** * EPROM BOOTLOAO * *********************************************************** Full Load: lrlk ARl, LE PROM Test Loadl: lark AR2, OS Oh Entry = Global OS sar AR2, GREG Load length = ARl Test Load2: lrlk AR7, EPROM-1 Entry = Norm OS lrlk AR3, AORESS load destination moreEPROM: adrk 2 point to LOW word lac MASKFF only load lower 8 bits and *- get upper 8 bits add *+,8,AR3 store value sacl * reloading clears MSB's lac *+,ARl Mask upper bits banz moreEPROM,*-,AR7 Finished load? sach GREG Set normal OS sblk OFFS Oh Accu = B(ranch)? ret 5-21 Program Control 5.2 Program Control To facilitate the use of the TMS320C2x in general-purpose high-speed proces- sing, a variety of instructions are provided for software stack expansion, sub- routine calls, timer operation, single-instruction loops, and external branch control. Descriptions and examples of how to use these features of the TMS320C2x are given in this section. 5.2.1 Subroutines The TMS320C2x has a 16-bit program counter (PC) and a eight-level hard- ware stack for PC storage. The CALL and GALA subroutine calls store the cur- rent contents of the program counter on the top of the stack. The RET (return from subroutine) instruction then pops the top of the stack to the program counter. Example 5-6 illustrates the use of a subroutine to determine the square root of a 16-bit number. Processing proceeds in the main routine to the point where the square root of a number should be taken. At this point a CALL is made to the subroutine, transferring control to that section of the program memory for execution and then returning to the calling routine via the RET instruction when execution has completed. Example 5-6. Subroutines * AUTOCORRELATION ** THIS ROUTINE PERFORMS A CORRELATION OF TWO VECTORS AND THEN CALLS A SQUARE ROOT * SUBROUTINE THAT WILL DETERMINE THE RMS AMPLITUDE OF THE WAVEFORM. * AUTOC LAC ENERGY CALL SQRT SACL ENERGY * * SQUARE ROOT * * THIS SUBROUTINE DETERMINES THE SQUARE ROOT OF A NUMBER X THAT IS LOCATED IN THE * LOW HALF OF THE ACCUMULATOR WHEN THE ROUTINE IS CALLED. THE FRACTIONAL SQUARE * ROOT OF XS TAKEN, WHERE 0 < X < 1 AND WHERE 1 IS REPRESENTED BY 7FFFh. THE * RESULT IS RETURNED TO THE CALLING ROUTINE IN THE ACCUMULATOR. * STO .set 60h SAVED STATUS REGISTER STO ADDRESS STl .set 61h SAVED STATUS REGISTER STl ADDRESS NUMBER • set 62h NUMBER X WHOSE SQUARE ROOT IS TAKEN TEMPR . set 63h INTERMEDIATE ROOTS 5-22 Software Applications GUESS .set 64h SQUARE ROOT OF X* * .text SQRT SST STO SAVE STATUS REGISTER STO. SSTl STl SAVE STATUS REGISTER STl. LDPK 0 LOAD DATA PAGE POINTER = 0. SSXM SET SIGN-EXTENSION MODE. SPM 1 LEFT-SHIFT PR OUTPUT TO ACCUMULATOR. SACL NUMBER SAVE X. LARP ARl INITIALIZE VARIABLES FOR SQUARE ROOT. LARK ARl, 11 12 ITERATIONS LALK SO Oh ASSUME X IS LESS THAN 200h. SACL GUESS SET INITIAL GUESS TO 800h. SACL TEMPR SET FIRST INTERMEDIATE ROOT TO 800h. SACH ROOT SET SQUARE ROOT VALUE TO 0. LAC NUMBER LOAD X INTO THE ACCUMULATOR. SBLK 200h TEST IF X IS LESS THAN 200h. BLZ SQRTLP IF YES, TAKE THE ROOT; LAC GUESS,3 IF NO, THEN REINITIALIZE. SACL GUESS SET INITIAL GUESS TO 4000h. SACL TEMPR SET FIRST INTERMEDIATE ROOT TO 4000h. LARK ARl,14 15 ITERATIONS * * SQUARE ROOT LOOP * SQRTLP SQRA TEMPR SQUARE TEMPORARY (INTERMEDIATE) ROOT. ZALH NUMBER CHECK IF RESULT IS LESS THAN X. SPAC BLZ NEXTLP IF IT'S NOT, SKIP ROOT UPDATE. ZALH TEMPR IF IT IS, SET ROOT EQUAL TEMPR. SACH ROOT NEXTLP LAC GUESS,15 SCALE DOWN GUESS BY 2 TO CONVERGE. SACH GUESS ADDH ROOT ADD CURRENT ROOT ESTIMATE. SACH TEMPR UPDATE TEMPORARY ROOT VALUE. BANZ SQRTLP REPEAT SPECIFIED NO. OF ITERATIONS. LAC ROOT LOAD THE ROOT OF X. LSTl STl RESTORE STATUS REGISTER STl. LST STO RESTORE STATUS REGISTER STO. RET The hardware stack is allocated for use in interrupts, subroutine calls, pipe- lined instructions, and debugging. The TMS320C2x disables all interrupts when it takes an interrupt trap. If interrupts are enabled more than one instruc- tion before the return of the interrupt service routine, the routine can also be interrupted, thus using another level of the hardware stack. This condition should be considered when managing the use of the stack. When nesting sub- routine calls, each call uses a level of the stack. The number of levels used by the interrupt must be remembered as well as the depth of the nesting of sub- routines. One level of the stack is reserved for debugging, to be used for break- point/single-step operations. If debugging is not used, this extra level is avail- able for internal use. 5-23 Program Control 5.2.2 Software Stack Provisions have been made on the TMS320C2x for extending the hardware stack into data memory. This is useful for deep subroutine nesting or stack overflow protection. Use the PUSH and POP instructions to access the hardware stack via the ac- cumulator. Two additional instructions, PSHD and POPD, are included in the instruction set so that the stack may be directly stored to and recovered from data memory. A software stack can be implemented by using the POPD instruction at the be- ginning of each subroutine in order to save the PC in data memory. Then be- fore returning from a subroutine, a PSHD is used to put the proper value back onto the top of the stack. When the stack has seven values stored on it and two or more values are to be put on the stack before any other values are popped off, a subroutine that expands the stack is needed, such as shown in Example 5-7. In this example, the main program stores the stack starting location in memory in AR2 and indi- cates to the subroutine whether to push data from memory onto the stack or pop data from the stack to memory. If a zero is loaded into the accumulator before calling the subroutine, the subroutine pushes data from memory to the stack. If a one is loaded into the accumulator, the subroutine pops data from the stack to memory. Because the CALL instruction uses the stack to save the program counter, the subroutine pops this value into the accumulator and utilizes the BACC (branch to address specified by accumulator) instruction to return to the main program. This prevents the program counter from being stored into a memory location. The subroutine in Example 5-7 uses the BANZ (branch on auxiliary register not zero) instruction to control all of its loops. Example 5-7. Soffware Stack Expansion * THIS ROUTINE EXPANDS THE STACK WHILE LETTING THE MAIN PROGRAM DETERMINE WHERE * TO STORE THE STACK CONTENTS OR FROM WHERE TO RECOVER THEM. * STACK LARP 2 USE AR2. BNZ PO IF POPD IS NEEDED, GO TO PO. POP ELSE, SAVE PROGRAM COUNTER. RPTK 6 LOAD REPEAT COUNTER. PSHD *+ PUT MEMORY IN STACK. BACC RETURN TO MAIN PROGRAM. PO POP SAVE PROGRAM COUNTER. MAR *- ALIGN STACK POINTER. RPTK 6 LOAD REPEAT COUNTER. POPD *- PUT STACK IN MEMORY. MAR *+ REALIGN STACK POINTER. BACC RETURN TO MAIN PROGRAM. 5-24 Software Applications 5.2.3 Timer Operation The TMS320C2x 16-bit on-chip timer and its associated interrupt perform vari- ous functions at regular time intervals. On the TMS320C25, the timer is a down counter that is continuously clocked by CLKOUT1 and counts (PAD + 1) cycles of CLKOUT1 . By programming the period (PAD) register from 1 to 65,535 (OFFFFh), a timer interrupt (TINT) can be generated every 2 to 65,536 cycles. (A period register value of zero is not allowed.) Two memory-mapped registers operate the timer. The timer (TIM) register, data memory location 2, holds the current count of the timer. At every CLKOUT1 cycle, the TIM register is decremented by one. The PAD register, data memory location 3, holds the starting count for the timer. When the TIM register decrements to zero, a timer interrupt (Tl NT) is generated. In the follow- ing cycle, the contents of the PAD register are loaded into the TIM register. In this way, a TINT is generated every (PAD + 1) cycles of CLKOUT1 on the TMS320C25. You can read from or write to the timer and period registers on any cycle. You can monitor the count by reading the Tl M register and write a new counter peri- od to the PAD register without disturbing the current timer count. The timer will then start the new period after the current count is complete. If both the PAD and Tl M registers are loaded with a new period, the timer begins decrementing the new period without generating an interrupt. Thus, you have complete con- trol of the current and next periods of the timer. For the TMS320C25, the TIM register is set to the maximum value on reset (OFFFFh), and the PAD register is also initialized by reset to OFFFFh. The Tl M register begins decrementing only after RS is deasserted. If the timer is not used, TINT should be masked. The PAD register can then be used as a gener- al-purpose data memory location. If you use TINT, you should program the PAD and TIM registers before unmasking the TINT. Example 5-8 shows the assembly code that implements the timer to divide down the CLKOUT1 signal. To generate a 9600-Hz clock signal, load the PAD register with 520. In the timer interrupt service routine, the XF line is toggled. The XF output is used also as an input for BTO in this example. The output of XF will provide a 50-percent duty cycle clock signal as long as the main routine or other interrupt routines do not disable interrupts. Interrupts may be disabled by direct or implied use of DINT or by executing instructions in the repeat mode. The value for the PAD register is calculated as follows: TMS320C25: CLKOUT1/(PAD + 1) = 2 x frequency of signal 10 MHz/(520 + 1) = 2 x 9600 Hz (= 9597 Hz for divided signal) 5-25 Example 5-8. Clock Divider Using Timer (TMS320C25) * SETUP FOR INTERRUPT SERVICE ROUTINE. * LALK 520 SACL DMA3 LOAD THE PERIOD REGISTER. LACK 8 OR DMA4 SACL DMA4 ENABLE THE TIMER INTERRUPT. EINT ENABLE INTERRUPTS. . * I/O SERVICE ROUTINE. * TIME BIOZ SETl CHECK THE CURRENT XF STATE. RXF XF WAS HIGH; SET IT LOW. EINT ENABLE INTERRUPTS. RET RETURN TO INTERRUPTED CODE. SETl SXF XF WAS LOW; SET IT HIGH. EINT ENABLE INTERRUPTS. RET RETURN TO INTERRUPTED CODE. 5.2.4 Single-Instruction Loops When programming time-critical high-computational tasks, it is often neces- sary to repeat the same operation many times. For these tasks, the TMS320C2x has repeat instructions that allow the execution of the next single instruction N+ 1 times. N is defined by an eight-bit repeat counter (RPTC), which is loaded by the RPT or RPTK instructions. The instruction immediately following is then executed, and the RPTC is decremented until it reaches zero. When you use the repeat feature, the instruction being repeated is fetched only once. As a result, many multicycle instructions become single-cycle when repeated. This is especially useful for 1/0 instructions, such as TBLR/TBLW, IN/OUT, or BLKD/BLKP. Since the instruction is fetched and internally latched, the program bus can be used to fetch or write a second operand in parallel to operations using the data bus. With the instruction latched for repeated execution, the program counter can be loaded with a data address and incremented on succeeding executions to fetch data in successive memory locations. As an example, the MAC instruction fetches the multiplicand from program memory via the program bus. Simultaneously with the program bus fetch, the second multiplicand is fetched from data memory via the data bus. in addition to these data fetches, preparation is made for accesses in the following cycles by incrementing the program counter and by indexing the auxiliary register. TBLR is another exam- ple of an instruction that benefits from simultaneous transfers of data on both the program and data buses. In this case, data values from a table in program memory may be read and transferred to data memory. When repeated, the program overhead of reading the instruction from program memory must be executed only once, thus allowing the rest of the executions to operate in a single cycle. 5-26 Software Applications Programs, such as those implementing digital filters, require loops that execute in a minimum amount of time. Example 5-9 shows the use of the RPT or RPTK instructions. Example 5-9. Instruction Repeating * THIS ROUTINE USES THE RPT INSTRUCTION TO SET UP THE LOOP COUNTER IN ONE CYCLE. * THE FOLLOWING EQUATION IS IMPLEMENTED IN THIS ROUTINE: * 10 * * \ X(I) x Y(I) * I * * I = 1 * * THIS ROUTINE ASSUMES THAT THE X VALUES ARE LOCATED IN ON-CHIP RAM BLOCK BO, AND * THE Y VALUES IN BLOCK Bl. WHEN REPLACING RPT NUM WITH RPTK 9, THE PROGRAM WILL * EXECUTE THE SAME WAY. * SERIES LARP AR4 CNFP CONFIG BLOCK BO AS PROGRAM MEMORY. LACK 9 SET COUNTER TO 9. SACL NUM (NUM) = 9. LRLK AR4,300h POINT AT BEGINNING OF DATA. MPYK Oh CLEAR P REGISTER. ZAC CLEAR ACCUMULATOR. RPT NUM EXECUTE NEXT INSTRUCTION 10 TIMES. MAC OFFOOh, *+ MULTIPLY-ACCUMULATE; INCREMENT AR4. APAC RET RETURN TO MAIN PROGRAM. 5-27 5.2.5 Computed GOTOs Processing may be executed in a time- and process-dependent or selected way. Following a specific time or data processing path may then result in se- lecting one of several processing options. You can program a simple computed GOTO can be programmed in the TMS320C2x by using the GALA instruction. This instruction uses the contents of the accumulator as the direct address of the call. Thus, the call address can be computed in the ALU, as shown in Example 5-10. Example 5-10. Computed GOTO * TASK CONTROLLER * * THIS MAIN TASK ROUTINE CONTROLS THE ORDER OF EXECUTION AND SCHEDULING OF TASKS. * WHEN AN INTERRUPT OCCURS, THE INTERRUPT SERVICE ROUTINE IS EXECUTED TO PROCESS * THE INPUT AND OUTPUT DATA SAMPLES. AFTER THE INTERRUPT SERVICE ROUTINE HAS * COMPLETED, THE PROCESSOR BEGINS EXECUTION WITH THE INSTRUCTION FOLLOWING THE * IDLE INSTRUCTION. THIS ROUTINE SELECTS THE TASK APPROPRIATE FOR THE CURRENT * SAMPLE CYCLE, CALLS THE TASK AS A SUBROUTINE, AND BRANCHES BACK TO THE IDLE TO * WAIT FOR THE NEXT SAMPLE INTERRUPT WHEN THE SCHEDULED TASK HAS COMPLETED * EXECUTION. * WAIT IDLE WAIT FOR SAMPLE INTERRUPT. LAC SAMPLE FETCH SAMPLE COUNT VALUE. SUB ONE DECREMENT THE SAMPLE COUNT. BGEZ OVRSAM TEST FOR END OF BAUD INTERVAL. LACK 15 INIT COUNT FOR NEW BAUD INTERVAL. OVRSAM SACL SAMPLE SAVE NEW COUNT VALUE. ADLK TSKSEQ ADD TASK TABLE BASE ADDRESS. TBLR TEMP READ SUBROUTINE TASK ADDRESS. LAC TEMP LOAD ACCUMULATOR FOR TASK CALL. CALA EXECUTE APPROPRIATE TASK. B WAIT * TSKSEQ .word DUMMY 15 - UNUSED CYCLE .word DUMMY 14 UNUSED CYCLE .word DUMMY 13 UNUSED CYCLE .word DUMMY 12 UNUSED CYCLE • word BDCLK2 11 - COMPUTE ENERGY E(ll) .word DUMMY 10 - UNUSED CYCLE .word OUT 9 - COMMUNICATE WITH U-CONTROLLER . word DECODE 8 DECODE/GET SCRAMBLED DIBIT . word DEMODB 7 DEMODULATE IN MIDDLE OF BAUD .word DUMMY 6 UNUSED CYCLE • word AGCUPT 5 - UPDATE AGC EVERY 3RD BAUD .word DUMMY 4 - UNUSED CYCLE . word BDCLKl 3 COMPUTE ENERGY E(3) .word DUMMY 2 UNUSED CYCLE .word DUMMY 1 UNUSED CYCLE .word DUMMY 0 UNUSED CYCLE 5-28 Software Applications Service Routine 5.3 Interrupt Service Routine Interrupts on the TMS320C2x are prioritized and vectored. When an interrupt occurs, the corresponding flag is set in the interrupt flag register (IFR). If the corresponding bit in the interrupt mask register (IMR) is set and interrupts are enabled (INTM=O), then interrupt processing begins. When the interrupt vector is loaded into the program counter, interrupts are disabled (INTM=1) and a branch is made to the appropriate routine via the branch instruction stored at the associated vector location. Since all interrupts are disabled, interrupt processing will proceed without further interruption un- less the interrupt service routine (ISR) re-enables interrupts. Unless the interrupt service routines are simple 1/0 handlers, the processing in each ISR generally must assure that the processor context is preserved dur- ing execution. The context must be saved before the routine executes and must be restored when the routine is finished. A common routine or routines individualized for each interrupt may be used to secure the context of the pro- cessor during interrupt processing. Context switching is also useful for subrou- tine calls, especially when extensive use is made of the stack or auxiliary regis- ters. Code examples of context switching and an interrupt service routine are provided in this section. 5.3.1 Context Switching Context switching, commonly required when processing a subroutine call or interrupt, may be quite extensive or simple, depending on the system require- ments. On the TMS320C2x, the program counter is stored automatically on the hardware stack. If there is any important information in the other TMS320C2x registers, such as the status or auxiliary registers, these must be saved by software command. A stack in data memory, identified by an auxiliary register, is useful for storing the machine state when processing interrupts. Example 5-11 and Example 5-12 show how to save and restore the state of the TMS320C25. Auxiliary register 7 (AR?} in both examples is the stack point- er. As the stack grows, it expands into lower memory addresses. The status registers (STO and ST1), accumulator (ACCH and ACCL), product register (PR), temporary register (TR}, all eight levels of the hardware stack, and the auxiliary registers (ARO through AR6} are saved. The routines in Example 5-11 and Example 5-12 are protected against inter- rupts, allowing context switches to be nested. This is accomplished by the use of the MAR*- and MAR*+ instructions at the beginning of the context save and context restore routines, respectively. Note that the last instruction of the con- text save decrements AR?, while the context restore is completed with an addi- tional increment of AR?. This prevents the loss of data if a context save or re- store routine is interrupted. 5-29 Interrupt Service Routine Example 5-11. Context Save (TMS320C25) .title 'CONTEXT SAVE' .def SAVE * * CONTEXT SAVE ON SUBROUTINE CALL OR INTERRUPT. * * ASSUME AR7 IS THE STACK POINTER AND AR7 = 128. * SAVE LARP AR7 ; (ARP) -+ ARB, 7 -+ ARP, AR7 128 MAR *- AR7 127 * * SAVE THE STATUS REGISTERS. SSTl *- STl (127), AR7 126 SST *- STO (J.26), AR7 125 * * SAVE THE ACCUMULATOR. SACH *- ACCH (125), AR7 124 SACL *- ACCL (124), AR7 123 * * SAVE THE P REGISTER. SPM 0 NO SHIFT ON PR OUTPUT SPH *- PRH (123), AR7 122 SPL *- PRL -+ ( 12 2) , AR7 121 * * SAVE THE T REGISTER. MPYK 1 PR = TR SPL *- TR -+ ( 121) , AR7 120 * * SAVE ALL EIGHT LEVELS OF THE HARDWARE STACK. RPTK 7 POPD *- TOS ( 8 ) -+ ( 12 0 ) , AR7 119 * STACK(7) (119), AR7 118 * STACK(6) (118), AR7 117 * STACK(5) (117), AR7 116 * STACK(4) (116), AR7 115 * STACK(3) (115), AR7 114 * STACK(2) -+ (114), AR7 113 * BOS ( 1 ) -+ ( 113 ) , AR7 112 * * SAVE AUXILIARY REGISTERS ARO THROUGH AR6. SAR ARO,*- ARO (112), AR7 111 SAR ARl, *- ARl -+ ( 111) , AR7 110 SAR AR2, *- AR2 ( 110), AR7 109 SAR AR3,*- AR3 (109), AR7 108 SAR AR4, *- AR4 (108), AR7 107 SAR AR5, *- AR5 (107), AR7 106 SAR AR6, *- AR6 (106), AR7 105 * * SAVE IS COMPLETE. * 5·30 Software Applications Interrupt Service Routine Example 5-12. Context Restore (TMS320C25) .title 'CONTEXT RESTORE' .def RESTOR * * CONTEXT RESTORE AT THE END OF A SUBROUTINE OR INTERRUPT. * * ASSUME AR7 IS THE STACK POINTER AND AR7 = 105. * RES TOR LARP AR7 ; ( ARP ) , -+ ARB , 7 -+ ARP, AR7 105 MAR *+ AR7 106 * * RESTORE AUXILIARY REGISTERS ARO THROUGH AR6. LAR AR6, *+ (106) -+ AR6, AR7 107 LAR AR5,*+ ( 107) -+ AR5, AR7 108 LAR AR4, *+ (108) -+ AR4, AR7 109 LAR AR3,*+ (109) -+ AR3, AR7 110 LAR AR2, *+ ( 110) -+ AR2, AR7 111 LAR ARl, *+ ( 111) -+ ARl, AR7 112 LAR ARO,*+ (112) -+ ARO, AR7 113 * * RESTORE ALL EIGHT LEVELS OF THE HARDWARE STACK. RPTK 7 PSHD *+ ( 113) -+ BOS ( 1), AR7 114 ( 114) STACK(2), AR7 115 ( 115) -+ STACK( 3), AR7 116 * ( 116) -+ STACK(4), AR7 117 * ( 117) STACK(5), AR7 118 * (118) STACK( 6), AR7 119 * ( 119) STACK( 7), AR7 120 * (120) -+ TOS ( 8), AR7 121 * * THE RETURN PC IS NOW ON TOP OF THE STACK FOR THE RET INSTRUCTION. THE LOWER 16 * BITS OF THE P REGISTER MUST BE LOADED VIA THE T REGISTER AND THE STACK POINTER * BE POINTING AT THE VALUE TO BE LOADED IN THE T REGISTER. * * RESTORE THE LOW P REGISTER. MAR *+ SKIP T REGISTER, AR7 122 LT *- (122) -+TR, AR7 121 MPYK 1 (TR) -+ PRL * * RESTORE THE T REGISTER. LT *+ ( 121) -+ TR, AR7 122 MAR *+ SKIP P REGISTER LOW, AR7 123 * * RESTORE THE HIGH P REGISTER. LPH *+ ( 123) -+ PRH, AR7 124 * * RESTORE THE ACCUMULATOR. ZALS *+ ( 124) -+ ACCL, AR7 125 ADDH *+ (125) -+ ACCH, AR7 126 * * RESTORE THE STATUS REGISTERS. LST *+ (126) STO, AR7 127 LSTl *+ (127) -+ STl, AR7 128 * * RESTORE IS COMPLETE. EINT ENABLE INTERRUPTS. RET RETURN TO INTERRUPTS OR CALLING ROUTINE. 5-31 Interrupt Service Routine 5.3.2 Interrupt Priority Interrupts on the TMS320C2x are prioritized in hardware. This allows inter- rupts that occur simultaneously to be serviced in a prioritized order. Some- times priority may be determined by frequency or rate of occurrence. An infre- quent, but lengthy, ISR might need to be interrupted by a more frequently oc- curring interrupt. In the routine of Example 5-13, the ISR for TNT1 temporarily modifies the IMR to permit interrupt processing when an interrupt on INTO (but no other interrupt) occurs. When the routine has finished processing, the IMR is restored to its original state. Example 5-13. Interrupt Service Routine .title 'INTERRUPT SERVICE ROUTINE' .def ISRl .ref IMR * * INTERRUPT PROCESSING FOR EXTERNAL INTERRUPT INTl-. * * THIS ROUTINE MAY BE INTERRUPTED BY AN INTERRUPT FROM THE EXTERNAL INTERRUPT * INTO-, BUT NO OTHER. * * ISRl LARP AR7 7 _,. ARP MAR *- AR7 = AR7 - 1 SS Tl *- STl _,. *AR7, AR7 = AR7 - 1 SST *- STO _,. *AR7, AR7 = AR7 - 1 SACH *- ACCH _,. *AR7, AR7 = AR7 - 1 SACL *- ACCL ..... *AR7, AR7 = AR7 - 1 LDPK 0 DP = 0 PSHD IMR IMR ..... TOS LACK OOOlh MASK FOR INTO- AND IMR MASK CURRENT IMR CONTENTS. SACL IMR ACC ..... !MR EINT ENABLE INTERRUPTS. * * MAIN PROCESSING SECTION FOR ISRl. * DINT DISABLE INTERRUPTS. LDPK 0 DP = 0 POPD IMR TOS ..... IMR LARP AR7 AR7 ..... ARP MAR *+ AR7 = AR7 + 1 ZALS *+ *AR7 ..... ACCL, AR7 = AR7 + 1 ADDH *+ *AR7 ..... ACCH, AR7 = AR7 + 1 LST *+ *AR7 ..... STO, AR7 = AR7 + 1 LSTl *+ *AR7 ..... STl, AR7 = AR7 + 1 EINT ENABLE INTERRUPTS. RET 5-32 Software Applications Memory Management 5.4 Memory Management The structure of the TMS320C2x memory map is programmable and can vary for each application. Instructions are provided for moving blocks of data or pro- gram memory, configuring a block of on-chip data RAM as program memory, and defining part of external data memory as global. Explanations and exam- ples of moving, configuring, and manipulating memory are provided in this section. 5.4.1 Block Moves Since the TMS320C2x directly addresses a large amount of memory, blocks of data or program code can be stored off-chip in slow memories and then loaded on-chip for faster execution. Data can also be moved from on-chip to off-chip for storage or for multiprocessor data transfers. The BLKD and BLKP instructions facilitate memory-to-memory block moves on the TMS320C2x. The BLKD instruction moves a block within data memory as shown in Example 5-14. Data may also be transferred between data memory and program memory by means of the TBLR and TBLW instructions. The instructions IN and OUT are used to transfer data between the data memory and the 1/0 space. Example 5-14. Moving External Data to Internal Data Memory With BLKD * THIS ROUTINE USES THE BLKD INSTRUCTION TO MOVE A BLOCK OF EXTERNAL DATA MEMORY * (DATA PAGES 8 AND 9) TO INTERNAL BLOCK Bl (DATA PAGES 6 AND 7). * MOVED LARP AR2 LRLK AR2,300h DESTINATION IS BLOCK Bl IN RAM. RPTK 255 REPEAT NEXT INSTRUCTION 256 TIMES. BLKD 400h,*+ MOVE EXTERNAL BLOCK TO BLOCK Bl. RET RETURN TO MAIN PROGRAM. For systems that have external program memory but no external data memory, BLKP can be used to move program memory blocks into data memory. Example 5-15 demonstrates how to use the BLKP instruction. Example 5-15. Moving Program Memory to Data Memory with BLKP * THIS ROUTINE USES THE BLKP INSTRUCTION TO MOVE DATA VALUES FROM PROGRAM MEMORY * INTO DATA MEMORY. SPECIFICALLY, THE VALUES IN LOCATIONS 2, 3, 4, AND 5 IN * PROGRAM MEMORY ARE MOVED TO LOCATIONS 512, 513, 514, AND 515 IN DATA MEMORY. * MOVEP LARP AR2 SET REFERENCE FOR INDIRECT ADDRESSING. LRLK AR2,512 LOAD BEGINNING OF BLOCK BO IN AR2. RPTK 3 SET UP LOOP. BLKP 2h,*+ PUT DATA INTO DATA RAM. RET RETURN TO MAIN PROGRAM. 5-33 Memory Management _._.._,,_,,..,.,.,.....=_.._ _ _ _ _ ;;-;::m.,.$$;..,i.>;..,;:::;;::-""""'""""""""',_""""'""""';m=""-;;::;,w/.aw~~~~~;oo~;;::;;~i.>;~;i.>;;;,:;,:~~m;i.>;;~::i::::: The TBLR instruction is another method for transferring data from program memory into data memory. When the TBLR instruction is used, a calculated, rather than predetermined, location of a block of data in program memory may be specified for transfer. A routine using this approach is shown in Example 5-16. Example 5-16. Moving Program Memory to Data Memory With TBLR * THIS ROUTINE USES THE TBLR INSTRUCTION TO MOVE DATA VALUES FROM PROGRAM MEMORY * INTO DATA MEMORY. BY USING THIS ROUTINE, THE PROGRAM MEMORY LOCATION IN THE * ACCUMULATOR FROM WHICH DATA IS TO BE MOVED TO A SPECIFIC DATA MEMORY LOCATION * CAN BE SPECIFIED. ASSUME THAT THE ACCUMULATOR CONTAINS THE ADDRESS IN PROGRAM * MEMORY FROM WHICH TO TRANSFER THE DATA. * TABLER LARP AR3 LRLK AR3,380 DESTINATION ADDRESS= PAGE 7. RPTK 127 TRANSFER 128 VALUES. TBLR *+ MOVE DATA INTO DATA RAM. RET RETURN TO CALLING PROGRAM. In cases where systems require that temporary storage be allocated in the pro- gram memory, TBLW can be used to transfer data from internal data memory to external program memory. The code in Example 5-17 demonstrates how to do this. Example 5-17. Moving Internal Data Memory to Program Memory With TBLW * THIS ROUTINE USES THE TBLW INSTRUCTION TO MOVE DATA VALUES FROM INTERNAL DATA * MEMORY TO EXTERNAL PROGRAM MEMORY. THE CALLING ROUTINE MUST SPECIFY THE * DESTINATION PROGRAM MEMORY ADDRESS IN THE ACCUMULATOR. ASSUME THAT THE * ACCUMULATOR CONTAINS THE ADDRESS IN PROGRAM MEMORY INTO WHICH THE DATA IS * TRANSFERRED. * * * * * * TABLEW LARP AR4 LRLK AR4,380 SOURCE ADDRESS= PAGE 7. RPTK 127 TRANSFER 128 VALUES. TBLW *+ MOVE DATA TO EXTERNAL PROGRAM RAM. RET RETURN TO CALLING PROGRAM. The IN and OUT instructions are used to transfer data between the data memory and the 1/0 space, as shown in Example 5-18 and Example 5-19. Example 5-18. Moving Data From 1/0 Space Into Data Memory With IN * THIS ROUTINE USES THE IN INSTRUCTION TO MOVE DATA VALUES FROM THE I/0 SPACE * INTO DATA MEMORY. DATA ACCESSED FROM I/O PORT 15 IS TRANSFERRED TO SUCCESSIVE * MEMORY LOCATIONS ON DATA PAGE 5. *INPUT LARP AR2 LRLK AR2,2C0h DESTINATION ADDRESS = PAGE 5. RPTK 63 TRANSFER 64 VALUES. IN *+,PA15 MOVE DATA INTO DATA RAM. RET RETURN TO CALLING PROGRAM. 5-34 Software Applications Memory Management _ _ _.,_,,_,,__,__,_,_,,,,,_,.,,__ _ ®::=%.'~~~<~<<::::::<:::,;,:,:,::~::w.:::x:::<:::,;,;,;,::~::;:;:;x:;,.;.;:::;::.-:::x:::::~:x::-.:::x:::~~.:::::::::«~(«::~..::::x:~::w.:::w.: ::;m.:=w~~ Example 5-19. Moving Data From Data Memory to 1/0 Space With OUT * THIS ROUTINE USES THE OUT INSTRUCTION TO MOVE DATA VALUES FROM THE DATA MEMORY * TO THE I/O SPACE. DATA IS TRANSFERRED TO I/O PORT 8 FROM SUCCESSIVE MEMORY * LOCATIONS ON DATA PAGE 4. * OUTPUT LARP AR4 LRLK AR4,200h SOURCE ADDRESS = PAGE 4. RPTK 63 TRANSFER 64 VALUES. OUT *+,PAS MOVE DATA FROM DATA RAM. RET RETURN TO CALLING PROGRAM. 5.4.2 Configuring On-Chip RAM TMS320C2x The large amount of external memory and the configurability of on-chip RAM simplify the downloading of data or program memory into the TMS320C2x. Also, since data in the RAM is preserved when redefining on-chip RAM, block BO can be configured dynamically as either data or program memory. Figure 5-9 illustrates the changes in on-chip RAM when switching configura- tions. On-chip memory is configured by a reset or by the CNFD and CNFP instruc- tions. Block BO is configured as data memory by executing CNFD or reset. A CNFP instruction configures block BO as program memory. TMS320C26 The reconfigurable memory space of the TMS320C26 is different in both the number of configurable blocks and the size of the blocks. For the TMS320C2x, only 256 words in Block BO are reconfigurable using the CNFD and CNFP instructions. The TMS320C26 has three reconfigurable blocks-BO, B1 and B3-each 512 words in length. Four possible configurations for the three blocks of the TMS320C26 are set with the immediate instruction CONF. The configuration instructions CNFD and CNFP are not defined for the TMS320C26, and CONF is not defined for the TMS320C2x. Because the start and stop addresses of internal memory are not the same, applications using the reconfigurable memory of the TMS320C2x will need to be redefined. The memory maps and block descriptions are given in subsec- tion 3.4.3 and in Appendix B. 5-35 -----=-·'" '" ' Memory Management ,_,.,.J'Al:""'""""'""""'"""'·:::m""'"'.....,""""''"""'_""""..,..,_.,.~mi~~~b~~;,:,.~:..:~»-~>».:0m"""N:».-~w._...:,:::,;-..'*~.!!a-.:w..m::-- Figure 5-9. On-Chip RAM Configurations Program Data Memory Bus Bus Locations .r Memory-Mapped "L Registers ]} Data 0-5 (OOOOh-0005h) J} (0060h-007Fh) .I Data 96-127 Block B2 'L .r ]} Data512-767 Block BO "L (0200h-02FFh) J} .I Data 768-1023 Block B1 'L (0300h-03FFh) Program Data Memory Bus Bus Locations Memory-Mapped Registers } Data 0-5 (0000h-0005h) Block B2 } Data 96-127 (0060h-007Fh) Block BO } Prog 65280-65535 (OFFOOh-OFFFFh) Block B1 } Data 768-1023 (0300h-03FFh) Configuring block BO as program memory is useful for implementing adaptive filters or similar applications at full speed with only on-chip memories. Example 5-20 illustrates the use of the configuration modes to utilize block BO as data and program memory while executing from its on-chip program ROM. Note that a more definitive example of the use of the TMS320C25 for adaptive filtering is provided in subsection 5.7.3. 5-36 Software Applications Memory Management Example 5-20. Configuring and Using On-Chip RAM .title 'ADAPTIVE FILTER' .def ADPFIR .def X, Y * * THIS 128-TAP ADAPTIVE FIR FILTER USES ON-CHIP MEMORY BLOCK BO FOR COEFFICIENTS * AND BLOCK Bl FOR DATA SAMPLES. THE NEWEST INPUT SHOULD BE IN MEMORY LOCATION X * WHEN CALLED. THE OUTPUT WILL BE IN MEMORY LOCATION Y WHEN RETURNED. * COEFFP .set OFFOOh BO PROGRAM MEMORY ADDRESS COEFFD .set 0200h BO DATA MEMORY ADDRESS ONE .set 7Ah CONSTANT ONE (DP = 6) BETA .set 7Bh ADAPTATION CONSTANT (DP 6) ERR .set ?Ch SIGNAL ERROR (DP = 6) ERRF .set 7Dh ERROR FUNCTION (DP= 6) y .set 7Eh FILTER OUTPUT (DP = 6) x .set 7Fh NEWEST DATA SAMPLE (DP = 6) FRSTAP .set 0380h NEXT NEWEST DATA SAMPLE LASTAP .set 03FFh OLDEST DATA SAMPLE * * FINITE IMPULSE RESPONSE (FIR) FILTER. * ADPFIR CNFP CONFIGURE BO AS PROGRAM: MPYK 0 CLEAR THE P REGISTER. LAC ONE,14 LOAD OUTPUT ROUNDING BIT. LARP AR3 LRLK AR3,LASTAP POINT TO THE OLDEST SAMPLE. FIR RPTK 127 MACD COEFFP, *- 128-TAP FIR FILTER. CNFD CONFIGURE BO AS DATA: APAC SACH yI 1 STORE THE FILTER OUTPUT. NEG ADD X,15 ADD THE NEWEST INPUT. SACH ERR, 1 ERR(N) = X(N) - Y(N) * * LMS ADAPTATION OF FILTER COEFFICIENTS. * LT ERR MPY BETA 128-TAP FIR FILTER. PAC ERRF(N) = BETA * ERR(N) ADD ONE, 14 ROUND THE RESULT. SACH ERRF,l LARP AR3 LARK ARl,127 128 COEFFICIENTS TO UPDATE. LRLK AR2,COEFFD POINT TO THE COEFFICIENTS. LRLK AR3,LASTAP POINT TO THE DATA SAMPLES. DMOV x INCLUDE NEWEST SAMPLE. LT ERRF MPY *-,AR2 P = 2*BETA*ERR(N)*X(N - K) * ADAPT ZALH * ,AR3 LOAD ACCH WITH AK(N). ADD ONE, 15 LOAD ROUNDING BIT. APAC AK(N + 1) = AK(N) + P * MPY *-,AR2 P = 2*BETA*ERR(N)*X(N-K) SACH *+,0,ARl STORE AK(N + 1). BANZ ADAPT,*-,AR2 END OF LOOP TEST. RET RETURN TO CALLING ROUTINE. 5-37 Example 5-21. Program Execution from On-Chip Memory .title "ON-CHIP RAM PROGRAM EXECUTION EXAMPLE" .width 96 .option X .text RESET B !NIT * * BRANCHES FOR EXTERNAL OR INTERNAL INTERRUPTS FOLLOW HERE AT THE DESIGNATED * LOCATIONS AS REQUIRED. * * .space (32-($-RESET))*l6 * * A BRANCH INSTRUCTION AT PROGRAM MEMORY LOCATION 0 DIRECTS PROCESSOR EXECUTION * HERE. * * * INITIALIZE THE PROCESSOR. * !NIT ROVM DISABLE OVERFLOW MODE. SSXM SET SIGN EXTENSION. LDPK 0 POINT DP REGISTER TO DATA MEMORY PAGE 0. SPM 0 NO SHIFT ON PRODUCT REGISTER OUTPUT. LARP AR4 USE AUXILIARY REGISTER 4 (SET ARP= 4). LARK AR4,PRD POINT AR4 TO PERIOD REGISTER. LALK OFFFFh SET ACCUMULATOR TO OOOOFFFFh. SACL *+ LOAD PERIOD REGISTER WITH MAXIMUM VALUE. SACL *+ ENABLE ALL INTERRUPTS VIA !MR. ZAC CLEAR ACCUMULATOR. SACH * CLEAR GREG TO MAKE ALL MEMORY LOCAL. * * LOAD TIME-CRITICAL CODE FROM EXTERNAL SLOW MEMORY TO INTERNAL RAM * LARP ARl USE AUXILIARY REGISTER 1 (SET ARP= 1). LRLK ARl,PROGR POINT ARl TO RECONFIGURABLE BLOCK BO. RPTK PROGL-1 LOAD REPEAT COUNTER WITH BLOCK LENGTH. BLKP Pl_START,*+ MOVE CODE FROM PROG MEMORY TO ON-CHIP RAM * * INITIALIZE PARAMETERS FOR EXECUTION. * LDPK 6 POINT DP REGISTER TO DATA MEMORY PAGE 6. LACK 1 SET ACCUMULATOR TO OOOlh. SACL ONE STORE VALUE OF 1. LRLK ARl,COEFF POINT ARl TO INTERNAL MEMORY ADDRESS. RPTK COEFL-1 LOAD REPEAT COUNTER WITH BLOCK LENGTH. BLKP Cl_START,*+ MOVE DATA FROM PROG MEMORY TO ON-CHIP RAM. CNFP CONFIGURE BLOCK BO AS PROGRAM MEMORY. LALK LPTS LOAD ACC WITH PROG ADDR IN INTERNAL RAM. BACC BRANCH TO ON-CHIP EXECUTION ADDRESS. * * SIGNAL PROCESSING CODE TO BE EXECUTED FROM ON-CHIP RAM. * .asect "on-chip",OFFOOh PROG .label Pl START LPTS BIOZ GET WAIT FOR INPUT SIGNAL. B LPTS BRANCH IF NO SIGNAL. 5-39 Memory Management GET OUT FILOUT,PA2 OUTPUT LAST FILTER OUTPUT. IN FILIN,PA2 INPUT NEW SIGNAL SAMPLE. LRLK ARl,SIGNAL POINT ARl TO SIGNAL DATA TO PROCESS. ZAC CLEAR THE ACCUMULATOR. MPYK 0 CLEAR THF. P REGISTER. RPTK 15 REPEAT MACO INSTRUCTION FOR 16 TAPS. MACO COEF, *- MULTIPLY, ACCUMULATE, SAMPLE DELAY. APAC ACCUMULATE THE LAST PRODUCT. SACH FILOUT, 1 SAVE THE RESULT. B PTS LOOP TO WAIT FOR NEXT SAMPLE. PROGE • label Pl END PROGL • equ PROGE-PROG PROGRAM CODE LENGTH. * * COEFFICIENT DATA TO BE LOADED INTO ON-CHIP RAM. * COEF . label Cl START .word 385,-1196,1839,-2009 .word 1390,407,-4403,19958 .word 19958,-4403,407,1390 .word -2009,1839,-1196,385 COEFE • label Cl END COEFL . equ COEFE-COEF COEFFICIENT DATA LENGTH. * DATA PAGE 0 (BLOCK B2) DATA MEMORY LABELS. * .bss DRR,l SERIAL PORT DATA RECEIVE REGISTER • . bss DXR,l SERIAL PORT DATA TRANSMIT .bss TIM, 1 TIMER REGISTER . . bss PRD,l PERIOD REGISTER . . bss IMR, 1 INTERRUPT MASK REGISTER • . bss GREG,l GLOBAL MEMORY ALLOCATION REGISTER. * .bss RSVRD0,05Ah * .bss B2,020h * .bss RSVRD1,0180h ** DATA PAGE 4 (BLOCK BO) DATA MEMORY LABELS. * BO .bss PROGR,PROGL ; LOCATIONS FOR INTERNAL PROGRAM CODE • • bss COEFF, COEFL ; LOCATIONS FOR COEFFICIENT MEMORY • • bss FREEO,OlOOh-(PROGL+COEFL) * * DATA PAGE 6 (BLOCK Bl) - DATA MEMORY LABELS. * Bl .bss ONE,l RESERVED FOR DATA VALUE OF 1 • . bss FILOUT,l FILTER OUTPUT SIGNAL VALUE • • bss FILIN,l FILTER INPUT SIGNAL VALUE • . bss SIG, 13 .bss SIGNAL, 1 LAST SIGNAL DELAY VALUE . • end 5-40 Software Applications Memory Management Example 5-22. Program Execution From On-Chip Memory (TMS320C26) • file onchip26 .title ON-CHIP RAM PROGRAM EXECUTION EXAMPLE FOR THE TMS320C26 .width 96 .option X PGMBO . set OFAOOh BLKSIZ .set 00200h BLOCKSIZE OF TMS320C26 .text RESET B INIT, *, ARl ARP = ARl * * BRANCHES FOR EXTERNAL OR INTERNAL INTERRUPTS FOLLOW HERE AT THE DESIGNATED * LOCATIONS AS REQUIRED. * . space ( 32- ($-RESET))* 16 * * A BRANCH INSTRUCTION AT PROGRAM MEMORY LOCATION 0 DIRECTS PROCESSOR EXECUTION * HERE. * * INIT ROVM DISABLE OVERFLOW MODE LDPK 0 POINT DP REGISTER TO DATA MEMORY PAGE 0 * * LOAD TIME-CRITICAL CODE FROM EXTERNAL SOW MEMORY TO INTERNAL RAM * LRLK ARl,PROGR POINT ARl INTO RECONFIGURABLE BLOCK BO RPTK PROGL-1 LOAD REPEAT COUNTER WITH BLOCK LENGTH BLKP Pl_START,*+ MOVE CODE FROM PROGRAM MEMORY TO ON-CHIP RAM * * INITIALIZE PARAMETERS FOR EXECUTION. * LDPK 8 POINT DP REGISTER TO DATA MEMORY PAGE 8 LACK 1 SET ACCUMULATOR TO OOOlh SACL ONE STORE VALUE OF 1 LRLK ARl,COEFF POINT ARl TO INTERNAL MEMORY ADDRESS RPTK COEFL-1 LOAD REPEAT COUNTER WITH BLOCK LENGTH CONF 1 BLOCKBO = PROGRAMMEMORY /Bl, B3 = DATAMEMORY B LPTS BRANCH TO ON-CHIP EXECUTION ADDRESS * * SIGNAL PROCESSING CODE TO BE EXECUTED FROM ON-CHIP RAM. * • asect "ONCHIP", PGMBO PROG . LABEL P 1 START LPTS BIOZ GET WAIT FOR SIGNAL = LOW B LPTS BRANCH IF SIGNAL = HIGH GET OUT FILOUT,PA2 OUTPUT LAST FILTER OUTPUT IN FILIN,PA2 INPUT NEW SIGNAL SAMPLE LRLK ARl,SIGNAL POINT ARl TO SIGNAL DATA TO PROCESS ZAC CLEAR THE ACCUMULATOR MPYK 0 CLEAR THE P REGISITER RPTK 15 REPEAT MACO INSTRUCTION FOR 16 TAPS MACO COEF,*- MULTIPLY/ACCUMULATE, SAMPLE DELAY APAC Accumulate the last product SACH FILOUT,l Save the result B LPTS Loop to wait for next sample PROGE • label Pl END PROGL .equ PROGE-PROG Program code lenth * * Coefficient data to be loaded into on-chip RAM * 5-41 Memory Management ..... :::~~w.~~~~~::::::::::::::::f.~~~;~~.:::~~~~.,::::::;:::::::.."«.a:::::::::».:::::m~-:::~~~.-::..:i:iw...::w~~~~~ ~:::::::.w.::::::::m:::::i::::::iwM%-.~::::::::::::->.:::m::::w..,::;::~:::::::;:::;,:,;,:::;:-n.:::::~~=~=::@.:r.:::::::.-:::::::::::».::: COEF • label Cl START .word 38S,-1196,1839,-2009 .word 1390,407,-4403,19958 .word 19958,-4403,407,1390 .word -2009,1839,-1196,385 COEFE . label Cl_END COEFL .equ COEFE-COEF Coefficient data length * * Data page 0 (Block B2) Data memory labels. * .bss ORR, 1 Serial port data receive register .bss DXR,l Serial port data transmit register .bss TIM, 1 Timer register .bss PRD,1 Period register .bss IMR, 1 Interrupt mask register .bss GREG, 1 Global memory allocation register * .bss RSVRD0,05Ah * .bss B2,020h * .bss RSVRD1,0180h * * Data page 4 (Block BO) Data memory labels. * BO .bss PROGR,PROGL Location for internal program code .bss COEFF,COEFL Location for coefficent memory .bss FREEO,OlOOh (PROGL + COEFL) * * Data page 6 (block Bl) data memory labels Bl .bss ONE,1 Reserved for data value of 1 .bss FILOUT,l Filter output signal value .bss FILIN,l Filte~ input signal value .bss SIG,13 .bss SIGNAL,l Last signal delay value .end 5-42 Software Applications Fundamental 5.5 Fundamental Logical and Arithmetic Operations Although the TMS320C2x instruction set is oriented toward digital signal pro- cessing, the same fundamental operations of a general-purpose processor are included. This section explains basic operations of the TMS320C2x cen- tral arithmetic logic unit (CALU), particularly accumulator operations, the sta- tus register effect on data processing, and bit manipulation. The TMS320C2x provides a complete set of logical operations, including AND, OR, XOR, and CMPL (complement) instructions. This enables the de- vice to perform any logical function. These instructions can convert sign mag- nitude to 2s complement or the reverse. You can store the contents of the accumulator in data memory with the SACH and SACL instructions or in the stack with the PUSH instruction. You can load the accumulator from data memory with the ZALH and ZALS instructions, which zero the accumulator before loading the data value. The ZAC instruc- tion zeros the accumulator. POP can be used to restore the accumulator con- tents from the stack. The accumulator is also affected by the ABS and NEG instructions. ABS re- places the contents of the accumulator with the absolute value of its contents. NEG generates the arithmetic complement of the accumulator in complement form. 5.5.1 Status Register Effect on Data Processing Three data processing options allow the ALU to automatically suppress sign extension, manage overflow, or scale product accumulations. These options are enabled or disabled through bits in the status registers and function in par- allel with normal execution of the instructions. They cause no additional ma- chine cycles and therefore no performance overhead. The sign-extension mode option is used to determine whether or not the shifted data values fetched for ALU operations should be sign-extended. The SXM status bit controls this operation. The SSXM instruction sets this bit to 1 for enabling sign extension, and the RSXM instruction sets it to Ofor suppres- sing sign extension. This operation affects all the instructions that include a shift of the incoming data value, that is, ADD, ADDT, ADLK, LAC, LACT, LALK, SBLK, SFR, SUB, and SUBT. The overflow mode option minimizes the effects of an arithmetic overflow by forcing the accumulator to saturate at the largest positive value (or in the case of underflow, the largest negative value). The OVM status bit controls this op- eration. The overflow mode is enabled by setting the OVM bit to a 1 with the SOVM instruction, and reset with the ROVM instruction. This feature affects all arithmetic operations in the ALU. 5-43 Fundamental Logical and Arithmetic Operations tws::::i:m;~::i:;:i::::$:;~1~;,>:Jj:MJ: 1 ' The product register shift mode option forces all products to be shifted before they are accumulated. The products can be left-shifted one bit to delete the extra sign bit when two 16-bit signed numbers are multiplied. The products can be left-shifted four bits to delete the extra sign bits in multiplying a 16-bit data value by a 13-bit constant. The product shifter can also be used to shift all prod- ucts six bits to the right to allow up to 128 product accumulations without the threat of an arithmetic overflow, thereby avoiding the overhead of overflow management. The shifter can be disabled to cause no shift in the product when working with integer or 32-bit precision operations. This also maintains com- patibility with TMS320C1 x code. These operations are controlled by the value contained in the PM bits of status register ST1. The SPM instruction sets the PM bits. This feature affects all the instructions that use the product of the mul- tiplier, that is, APAC, LTA, LTD, LTP, LTS, MAC, MACO, MPYA, MPYS, PAC, SPAC, SPH, SPL, SORA, and SQRS. 5.5.2 Bit Manipulation The BIT instruction tests any of the 16 bits of the addressed data word. The specified bit is copied into the TC of the status register. The bit tested is speci- fied by a bit code in the opcode of the instruction. Both the BBZ (branch on TC bit = 0) and BBNZ (branch on TC bit = 1) instructions check the bit and allow branching to a service routine. Bit testing is useful in control applications where a number of states or condi- tions may be latched externally and read into the TMS320C2x via an IN instruction. At this point, individual bits can be tested and branches taken for appropriate processing. Because the BIT instruction requires the bit code to be specified with the instruction, it cannot be placed in a loop to test several different bits of a data word or bits determined by prior processing for efficient use. The TMS320C2x also has a BITI instruction in which the bit code is specified in the T register. Because the T register can easily be modified, BITI may be used to test all bits of a data word if placed within a loop or to test a bit location determined by past processing. 5-44 Software Applications Fundamental Logical and Arithmetic Operations Example 5-23. Using BIT and BBZ * THIS ROUTINE USES THE BIT INSTRUCTION TO TEST THE CONDITION OF AN EXTERNAL MUX. * BIT 4 DETERMINES THE UTILITY OF THE REMAINING DATA. IF ZERO, A COUNTER IS * INCREMENTED. IF ONE, ADDITIONAL PROCESSING OCCURS AND THE COUNTER IS CLEARED. * THE ROUTINE IS INVOKED WHENEVER A TIMER INTERRUPT OCCURS. * TIME SST STO SAVE STATUS REGISTER STO. LDPK 0 LARP AR3 IN DAT,PA8 READ IN VALUE. BIT DAT,OBh TEST BIT 4. BBZ !NCR BRANCH AND INCREMENT IF POSITIVE. LARK AR3,0 CLEAR THE COUNTER. LST STO RELOAD THE STATUS REGISTER. EINT ENABLE INTERRUPTS. RET RETURN TO INTERRUPTED ROUTINE. * !NCR MAR *+ INCREMENT THE COUNTER. LST STO RELOAD THE STATUS REGISTER. EINT ENABLE INTERRUPTS. RET RETURN TO INTERRUPTED ROUTINE. Example 5-24. Using BITT and BBNZ * THIS ROUTINE USES THE BITT INSTRUCTION TO TEST THE CONDITION OF AN EXTERNAL * MUX. A BIT IN THE MUX IS SIGNIFICANT ONLY WHEN PRIOR PROCESSING HAS DESIGNATED * THE BIT TO BE ACTIVE. INDIVIDUAL PROCESSING WILL TAKE PLACE BASED UPON THE * STATE OF THE TESTED BIT. THE BITS ARE TESTED EACH TIME A TIMER INTERRUPT * OCCURS. * TIME SST STO SAVE STATUS REGISTER STO. LDPK 0 LARP AR3 LAR AR3,BCNT LOAD COUNT OF ACTIVE BITS. LRLK AR4,BTBL LOAD THE BIT TABLE ADDRESS. IN DAT,PA8 READ IN VALUE. B LTEST, *-, 4 TMLOOP LT *+,3 LOAD BIT CODE. BITT DAT TEST SPECIFIED BIT. BBNZ LTEST BRANCH IF BIT IS ONE. LTEST BANZ TMLOOP, *-, 4 LST STO RELOAD THE STATUS REGISTER. EINT ENABLE INTERRUPTS. RET RETURN TO INTERRUPTED ROUTINE. 5-45 Advanced Arithmetic Operations 5.6 Advanced Arithmetic Operations The TMS320C2x provides instructions, such as MACO, SORA, SUBC, and NORM, that facilitate efficient execution of arithmetic-intensive DSP algo- rithms. Explanations and examples of how to use these instructions with over- flow management and for data move, multiplication-accumulation, division, floating-point arithmetic, indexed addressing, and extended-precision arith- metic are included in this section. 5.6.1 Overflow Management The TMS320C2x has four features that can be used to handle overflow man- agement: the branch on overflow conditions, accumulator saturation (overflow mode), product register right shift, and accumulator right shift. These features provide several options for overflow protection within an algorithm. A program can branch to an error handler routine on an overflow of the accu- mulator by using the BV (branch on overflow) instruction or bypass an error handler by using the BNV {branch if no overflow) instruction. These instruc- tions can be performed after any ALU operation that may cause an accumula- tor overflow. The overflow mode is a useful feature for DSP applications. This mode simu- lates the saturation effect characteristic of analog systems. When enabled, any overflow in the accumulator results in the accumulator contents being re- placed with the largest positive value (7FFFFFFFh) if the overflowed number is positive, or the largest negative value {80000000h) if negative. The overflow mode is controlled by the OVM bit of status register STO and can be changed by the SOVM (set overflow mode), ROVM (reset overflow mode), or LST {load status register) instructions. Overflows can be detected in software by testing the OV (overflow) bit in status register STO. When a branch is used to test the overflow bit, OV is automatically reset. Note that the OV bit does not function as a carry bit. It is set only when the absolute value of a number is too large to be represented in the accumulator, and it is not reset except by specific instructions. Another method of overflow management, which applies to multiply-accumu- late operations, is the use of the right shifter of the product register. The right shifter, which operates with no cycle overhead, allows up to 128 accumula- tions without the possibility of an overflow. The least significant six bits of the product are lost, and the MSBs are filled with sign bits. This feature is initiated by setting the PM bits of status register ST1 to 11 with the SPM or LST1 instruc- tions. The TMS320C2x also has a right shift of the accumulator (using the SFR instruction) to scale down the accumulator when it nears overflow. 5-46 Software Applications 5.6.2 Scaling Scaling the data coming into the accumulator or already in the accumulator is useful in signal processing algorithms. This is frequently necessary in adapta- tion or other algorithms that must compute and apply correction factors or normalize intermediate results. Scaling and normalizing are implemented on the TMS320C2x via right and left shifts in the accumulator and shifts of data on the incoming path to the accumulator. Right and left shifts of the accumulator can be performed using the SFL and SFR instructions. SFL performs a logical left shift. SFR performs logical or arithmetic right shifts depending on the state of the SXM bit in the status regis- ter. A one in the SXM bit, corresponding to sign-extension enabled, causes an arithmetic shift to be performed. In addition to the shift instructions, data can be left-shifted 0 to 15 bits when the accumulator is loaded by using a LAC instruction, and left-shifted 0 to 7 bits on the TMS320C2x when storing from the accumulator by using SACH or SACL instructions. These shifts can be used for loading numbers into the high 16 bits of the accumulator and renormalizing the result of a multiply. The in- coming left shift of 0 to 15 bits can be supplied in the instruction itself or can be taken from the lowest four bits of the T register. Left shifts of data fetched from data memory are available for loading the accumulator (LAC/LACT), ad- ding to the accumulator (ADD/ADDT), and subtracting from the accumulator (SUB/SU BT). The contents of the P register may also be shifted prior to accu- mulation. 5.6.3 Shifting Data You can perform a logical right or left shift on the TMS320C25 in parallel with another instruction without disturbing the accumulator, multiplier or any other part of the ALU. Two important features of the ARAU - besides its capacity to increment, decriment, and index - make this possible. First, to double the value of a number, you need only to add it to itself. Simply stated, the ARAU can have the current ARP=O such that a *0+ modification will add ARO to itself. The code would look this way: lrlk ARO,Value load a value into ARO larp ARO point the current ARP to ARO mar *0+ add ARO to itself (logical left shift!) 5-47 Advanced Arithmetic Operations Second, for bit-reversed carry addition in the ARAU, the logic of the ARAU pro- pogates the carries from any half adder to the right, instead of left as in a nor- mal addition. In otherwords, bit-reversed carry addition works as if you were looking at the inputs and outputs with a mirror; it reverses the order. Note that this also causes the LSBs to swap places with the MSBs. Two examples are given. Example 5-25 shows ARO bit reverse added to itself (ARP=O). Example 5-26 shows what is normally used in FFT bit reversals and other DSP algorithms (ARP!= 0), with a "mirror" line drawn for reference. Example 5-25. Bit-Reversed Carry Addition LRLK AR0,07191h LARP ARO MAR *BRO+ Note carries propogate right c c c c c 1 0 1 1 1 0 0 0 1 1 0 0 1 0 0 0 1 <- ARO + 0 1 1 1 0 0 0 1 1 0 0 1 0 Q Q 1 <- ARO 0 0 1 1 1 0 0 0 1 1 0 0 1 0 0 0 <- New ARO C> C> C> C> C> C> C> (last carry is lost) Example 5-26. FFT Bit Reversals LRLK ARl, 0800h LRLK AR0,0080h LARP ARl RPTK 7 MAR *BRO+ Mirror Line LSB MSB MSB LSB 0000100000000000 0000000000010000 *BRO+ 0000000010000000 + 0000000100000000 ARl Bits 0000100000000000 0000000000010000 0000100010000000 0000000100010000 0000100001000000 0000001000010000 0000100011000000 0000001100010000 0000100000100000 0000010000010000 0000100010100000 0000010100010000 0000100001100000 0000011000010000 0000100011100000 0000011100010000 0000100000010000 0000100000010000 Bit Reversed carry ->> <<- Normal carry 5-48 Software Applications Bit-reversed carry addition is effective as a logical shifter that does not use the accumulator in any way. Here are some other applications: O Suppose you want to do a decimation in frequency FFT. In this case, the DFT block size decreases by one-half for every stage of the FFT. When finished, the DFT block size will be two, and the address will be offset by one. If you use a SANZ Not_done,*BRO+, excess code is eliminated in a tightly looped and reasonably efficient FFT. Also, the value of ARO can be used at the same time to access a bit-reversed twiddle table lookup. The advantage here is that the same lookup table will work for any size FFT smaller than the overall size of the table permits. O In another application, ARO can be loaded with a single bit. This bit is then shifted during each pass through the main loop and used as a test bit. This test is a successive approximation approach to calculating the square root of a 32-bit integer. Example 5-27 shows what the code will look like. Compare this to the same algorithm in subsection 5.2.1 . 5-49 Example 5-27. Using the ARO Test Bit to Calculate the Square Root of a Long Integer *********************************************************** * LNG_SQRT.ASM Calculates the 16 bit sqrt of a long int * * * * long lng_sqrt(long); /* C prototype */ * * * * s This routine uses a succesive * * t ARO approximation technique that * * a holds both the test bit and * * c AR2 the guess in ARx registers * * k * * entry> guess mem config lpi/dil * * ----1-1 * * input hi cycles (pas) I 243 I * * ( 0/neg) I 7 I * * input lo * * * *********************************************************** .global _lng_sqrt _lng_sqrt: blez ret 0 adrk 2 >ARO sar ARO,*- ;store ARO >AR2 sar AR2,*- ;store AR2 >AR3 lrlk AR0,08000h ;initial test bit lrlk AR2,08000h ;initial guess 0 This section performs successive aproximation more: sar AR2,* ;store guess lt * ;square guess (unsigned) mpyu *- pac subh *- ;ACCU guess - input subs *+ mar *+,ARO ; bgz too_hi,*BRO+,AR2 ;ARO>>l; guessA2 > input? too low mar *O+,ARO ;add test bit if guess too low banz more,*,ARl ;more test bits? b done ; too hi: mar *0-,ARO ;sub test bit if guess too high banz more,*,ARl ;more test bits larp AR2 ;Always +1 LSB error mar *-,ARl ;subtract LSB done: sar AR2,* ;store final guess (result) zals *+ ;load result in ACCU lar AR2,*+ ;restore ARO & AR2 lar ARO,* sbrk 2 ;restore ARl ret , ret 0: zac ;if input <=0 ret ;then return 0 .end 5-50 Software Applications Advanced Arithmetic Operations 5.6.4 Moving Data Many DSP applications must perform convolution operations or other opera- tions similar in form. These operations require data to be shifted or delayed. The DMOV, LTD, and MACO instructions can perform the needed data moves for convolution. The data move function allows a word to be copied from the currently ad- dressed data memory location in on-chip RAM to the next higher location while the data from the addressed location is being operated upon {that is, by the CALU). The data move and the CALU operation are performed in the same cycle. In addition, an ARAU operation may also be performed in the same cycle when using the indirect addressing mode. The data move function is use- ful in implementing algorithms, such as convolutions and digital filtering, where data is being passed through a time window. It models the z- 1 delay operation encountered in those applications. The data move function is continuous across the boundary of the on-chip data memory blocks BO, B1, and B2. How- ever, the data move function cannot be used if off-chip memory is referenced. In Example 5-28, the following equation is implemented: 2 Y(n) = I H(k)X(n - k) k•O where the H values stay the same, and the X values are shifted each time the microprocessor performs one of the following series of multiplications {similar to operations performed in FIR filters): First Series: Y{2) = {HO) {X2) + {H1) {X1) + {H2) {XO) Second Series: Y{3) = {HO) {X3) + {H1 ){X2) + {H2) {X1) Third Series: Y{4) = (HO) (X4) + (H1) (X3) + (H2) (X2) The MACO instruction, which combines accumulate and multiply operations with a data move, is tailored to the type of calculation shown in the summation equation above. In order to use MACO, the H values have been stored in block BO and configured as program RAM; the X values have been read into block B1 of data RAM as shown in Figure 5-10. 5-51 Advanced Arithmetic Operations Figure 5-10. MACO Operation Program Data Block BO Block B1 PC ----1 H2 OFFOOh 300h X2 l H1 HO OFF01h OFF02h 301h 302h X1 XO 1-11---- i AR1 (Coefficients) (Samples) Also, in Example 5-28, the summation in the above equation is performed in the reverse order, that is, from K =2 to 0, because of the operation of the data move function. This results in the oldest X value being used and discarded first. If the MACD instruction is replaced with the following two instructions, then the MAC instruction can be utilized with the same results. MAC* DMOV*- In cases where many more than three MACD instructions are required, the RPT or RPTK instructions may be used with MACD, yielding the same com- putational results but using less assembly code. Example 5-28. Using MACO for Moving Data * THIS ROUTINE IMPLEMENTS A SINGLE PASS OF A THIRD-ORDER FIR FILTER. IT IS * ASSUMED THAT THE H AND X VALUES HAVE ALREADY BEEN LOADED INTO THEIR RESPECTIVE * MEMORY LOCATIONS, THAT THE ACCUMULATOR AND P REGISTER ARE BOTH RESET TO ZERO, * AND THAT ARl IS POINTING AT XO. NOTE THAT THE MACO INSTRUCTION MAY BE USED IN * THE REPEAT MODE, BUT IT IS NOT IMPLEMENTED HERE. * * FIR CNFP CONFIGURE BLOCK BO AS PROGRAM MEMORY. LARP 1 ARl SHOULD POINT AT THE X VALUES. MAC OFFOOh,*- P = (XO) (H2) MACO OFFOlh, *- ACC = (XO)(H2) MACO 0FF02h, * ACC = (XO)(H2) + (Xl)(Hl) APAC ACC = (XO) (H2) + (Xl) (Hl) + (X2) (HO) CNFD CONFIGURE BLOCK BO AS DATA MEMORY. RET RETURN TO MAIN PROGRAM. 5-52 Software Applications Advanced Arithmetic Operations 5.6.5 Multiplication The TMS320C2x hardware multiplier normally performs 2s-complement 16-bit by 16-bit multiplies and produces a 32-bit result in one processor cycle. A single TMS320C2x instruction, MPYU, can be used to multiply two 16-bit un- signed numbers. To multiply two operands, one operand must be loaded into the T register (TR). The second operand is moved by the multiply instruction to the multiplier, which then produces the product in the P register (PR). Before another multiply can be performed, the contents of the PR must be moved to the accumulator. A single-multiply program is shown in Example 5-29. Pipe- lining multiplies and PR moves makes it possible to perfom most multiply op- erations in a single cycle. A common operation in DSP algorithms is the summation of products. The MAC instruction, normally performed in multiple cycles, adds the contents of the PR to the accumulator and then simultaneously reads two values and mul- tiplies them. When you use the MAC instruction, a data memory value is multi- plied by a program memory value. One of the operands can come from block B1 or B2 in on-chip data memory while the other operand may come from block BO. Block BO must be configured as program memory when it supplies these- cond operand. Pipelining of the MAC instruction with a repeat instruction re- sults in an execution time for each succeeding multiply-and-accumulate op- eration of only one cycle. Example 5-29. Multiply * THIS ROUTINE MULTIPLIES TWO VALUES IN DATA MEMORY LOCATIONS 200h AND 201h WITH * THE RESULT STORED IN 202h AND 203h. * MUL LRLK AR1,200h POINT AT BLOCK BO. LARP 1 LT *+ GET FIRST VALUE AT 200h. MPY *+ MULTIPLY BY VALUE AT 20lh. PAC PUT RESULT IN ACCUMULATOR. SACL *+ STORE LOW WORD AT 202h. SACH * STORE HIGH WORD AT 203h. RET RETURN TO MAIN PROGRAM. The pipelining of the MAC and MACO instructions incurs a certain amount of overhead in execution. In those cases where speed is more critical than pro- gram memory, it may be beneficial to use LTA or LTD and MPV instructions rather than MAC or MACO. Example 5-30 and Example 5-31 show an imple- mentation of multiply-accumulates using the MAC instruction. Example 5-31 shows an implementation of multiply-accumulates using the LTA-MPY instruc- tion pair. Figure 5-11 and Figure 5-12 provide graphically the information necessary to determine the efficiency of use for each of the techniques. 5.53 Advanced Arithmetic Operations Example 5-30. Multiply-Accumulate Using the MAC Instruction {TMS320C25) * CLOCK TOTAL CLOCK PROGRAM TOTAL PROGRAM * CYCLES CYCLES MEMORY MEMORY * LARP ARl 1 1 LRLK AR1,300h 2 2 CNFP 1 1 ZAC 1 1 MPYK 0 1 1 RPTK N-1 1 1 MAC OFFOOh,*+ 3 + N 2 APAC 1 11 + N 1 10 Example 5-31. Multiply-Accumulate Using the LTA-MPY Instruction Pair * CLOCK TOTAL CLOCK PROGRAM TOTAL PROGRAM * CYCLES CYCLES MEMORY MEMORY * ZAC 1 1 LT Dl 1 1 MPY Cl 1 1 LTA D2 1 1 MPY C2 1 1 2N 2N LTA DN 1 1 MPY CN 1 1 APAC 1 2+2N 1 2+2N 5-54 Software Applications Advanced Arithmetic Operations Figure 5-11. Execution Time vs. Number of Multiply-Accumulates (TMS320C25) I I 24 I I I I - -0- - 22 - - '- - -1 - - -· - , - ,.. - -, - - - - J - -0 - ... - I - )(- + I I I I 20 I I • I rn Q) 18 -•--o-- . u (S 16 --L--,-- I -C> - -. - - - - • - - L - ~ I 0 .Q 14 I I - 9- - -.... - • - () .!: c: 12 I ~ - q- - ~ - - 0 s0 Q) 10 - -'- - , - - L - -(r - J r - - ,- - , - - L - _ 1_ - i - - x UJ 8 - 0 - 6 - o- - -, I I I 4 - -0- - , •0 '=MAC Implementation = LTA-MPY Implementation ,-- x = Break-Even Point 2 2 3 4 5 6 7 8 9 10 11 Number of Multiply-Accumulates to Be Performed 5-55 Advanced Arithmetic Operations Figure 5-12. Program Memory vs. Number of Multiply-Accumulates 24 - - I I- - -:- - I j - - I I- - I - ,- - ~ - - ~ - -:- - j I - - I I- - <:- - I I I I I 22 - - ._ - -,- - J - - '- - -'- - , - - r - -,- - J - -0 - -,- - I I I I I I 20 - - ~ - -'- - ~ - - ~ - -:- - ~ - - '- - -'- - ~- - ~ - -·- - I I I I I I I I I I I I I I I I I/) 18 - - .- - -:- - i - - ,- - - 1 - - ~ - - ~ - ~ - i - - ,- - -:- - 'E ~ I I I I I 16 - - '- - I -,- ... J ... - '- ... -·- - I I I , - -o- . . -,- . . J - - t.. - -,- - I I .5 I I I I I I ~ ...... ,. . . -:- - ., ...... ,. - . . ,..... ¢- . . :- .. -:- - ., - . . ,. - -:- - 0 14 E I I I I I I I I I I I Q) ::!: 12 "'-:-"' .J"'"' I ~ ... - : - ... q. . "' L I ...... 1 ...... I .J"'"' I ~"' - : - " ' . J " ' " ' I E eCl 10 - -· I - •I - - •I - -1t; - •I - - •I - .... - ·- - •I - -· - •I - - I I I I e c.. I I I I I -b . . . . :. . - ~ - - ~ - -'- - -' - - ~ ...... :. . - -· ...... - ... : ... - JI - 8 I I I I 6 - -,- - '?"' - i - I I I "'1"' - I -. i ... -,- ... - ... ~ ...... ... -:- - ~ ...... I I ~ • • ·= MAC Implementation · 4 - -?- - , - - ~ - - o = LTA-MPY Implementation ~ - - __ 1 _ _ _, _ _ r __ X ,=_B!e_a~-~v_e~ ~~in_t r _ -,- __, __ 2 I I I I I 2 3 4 5 6 7 8 9 10 11 Number of Multiply-Accumulates to Be Performed In numerical analysis, it is often necessary to square numbers as well as add or subtract. The TMS320C2x has two instructions, SORA and SQRS, that ac- complish this in a single machine cycle. The result of the previous operation in the PR is first added to the accumulator if SQRA is used, or subtracted from the accumulator if SQRS is used. Then the data value addressed is squared, and the result is stored in the PR. Example 5-32 uses the SORA instruction to perform the computation. 5-56 Software Applications Advanced Arithmetic Operations Example 5-32. Using SORA * THIS ROUTINE USES THE SQRA INSTRUCTION TO COMPUTE THE SQUARE OF THE DISTANCE * BETWEEN TWO POINTS WHERE D**2 IS DEFINED AS FOLLOWS: * * D**2 = (XA - XB)**2 + (YA - YB)**2 * DIST LAC XA SUB XB SACL XT XT XA - XB * LAC YA SUB YB SACL YT YT = YA - YB * SQRA XT (P) = XT**2 ZAC (ACC) = 0 SQRA YT ( p) = YT**2, (ACC) = XT**2 APAC (ACC) = XT**2 + YT**2 = D**2 * RET RETURN TO MAIN PROGRAM. When performing multiply-and-accumulate operations, you may choose to shift the product before adding it to the accumulator. You can do both simulta- neously with the MAC instruction by using the product shift mode on the TMS320C2x. This mode, controlled by two bits in the PM field of status register ST1, shifts the value from the PR while it is transferred to the accumulator. The contents of the PR are not shifted. 5.6.6 Division Division is implemented on the TMS320C2x by repeated subtractions using SUBC, a special conditional subtract instruction. Given a 16-bit positive nu- merator and denominator, the repetition of the SUBC command 16 times pro- duces a 16-bit quotient in the low accumulator and a 16-bit remainder in the high accumulator. SUBC implements binary division in the same manner as is commonly done in long division. The numerator is shifted until subtracting the denominator no longer produces a negative result. For each subtraction that does not produce a negative answer, a one is put in the LSB of the quotient and then shifted. The shifting of the remainder and quotient after each subtraction produces the sep- aration of the quotient and remainder in the low and high halves of the accumu- lator. There are similarities between long division and the SUBC method of division. Both methods are used to divide 33 by 5 in Example 5--33. The condition of the denominator, less than the shifted numerator, is deter- mined by the sign of the result; both the numerator and denominator must be positive when you use the SUBC command. Thus, you must determine the sign of the quotient and compute the quotient with the absolute value of the numerator and denominator. 5-57 Advanced Arithmetic Operations Integer and fractional division can be implemented with the SUBC instruction as shown in Example 5-34 and Example 5-35, respectively. When you imple- ment a divide algorithm, it is important to know if the quotient can be repre- sented as a fraction and the degree of accuracy to which the quotient is to be computed. For integer division, the absolute value of the numerator must be greater than the absolute value of the denominator. For fractional division, the absolute value of the numerator must be less than the absolute value of the denominator. Example 5-33. Divide 33 by 5 Long Division: 000000000000110 Quotient 0000000000000101 )000000000100001 -101 no -.1.Ql 11 Remainder SUBC Method: 32 HIGHACC LOWACC 0 Comment 0000000000000000 0000000000100001 (1) Numerator is loaded into ACC. The -10 1000000000000000 denominator is left-shifted 15 and -10 0111111111011111 subtracted from ACC. The subtrac- traction is negative, so discard the result and shift the ACC left one bit. I I I I 0000000000000000 0000000001000010 (2) 2nd subtract produces negative an- -10 1000000000000000 swer, so discard result and shift ACC -10 0111111110111110 (numerator) left. I I I I 0000000000000100 0010000000000000 (14) 14th SUBC command. The result is -10 1000000000000000 positive. Shift result left and replace 0000000000000001 1010000000000000 LSB with 1. I I I I 0000000000000011 0100000000000001 (15) Result is again positive. Shift result -10 1000000000000000 left and replace LSB with 1. 0000000000000000 11000000000000001 I I I I 0000000000000001 1000000000000011 (16) Last subtract. Negative answer, so -10 1000000000000000 discard result and shift ACC left. - 1111111111111101 0000000000000011 0000000000000110 Answer reached after 16 SUBC instructions. Remainder Quotient 5-58 Software Applications Example 5-34. Using SUBC for Integer Division * THIS ROUTINE IMPLEMENTS INTEGER DIVISION. * DNl LT NU MERA GET SIGN OF QUOTIENT. MPY DEN OM PAC SACH TEMSGN SAVE SIGN OF QUOTIENT. LAC DEN OM ABS SACL DEN OM MAKE DENOMINATOR POSITIVE. LAC NU MERA ALIGN NUMERATOR. ABS * * IF denominator AND numerator ARE ALIGNED, DIVISION CAN START HERE. * RPTK 15 SUBC DENOM 16-CYCLE DIVIDE LOOP. SACL QUOT LAC TEMSGN BGEZ DONE DONE IF SIGN IS POSITIVE. ZAC SUB QUOT SACL QUOT NEGATE QUOTIENT IF NEGATIVE. DONE LAC QUOT RET RETURN TO MAIN PROGRAM. Example 5-35. Using SUBC for Fractional Division * THIS ROUTINE IMPLEMENTS FRACTIONAL DIVISION. * DNl LT NU MERA GET SIGN OF QUOTIENT. MPY DEN OM PAC SACH TEMSGN SAVE SIGN OF QUOTIENT. LAC DEN OM ABS SACL DEN OM MAKE DENOMINATOR POSITIVE. ZALH NUMERA ALIGN NUMERATOR. ABS * * IF denominator AND numerator ARE ALIGNED, DIVISION CAN START HERE. * RPTK 14 SUBC DEN OM 15-CYCLE DIVIDE LOOP. SACL QUOT LAC TEMSGN BGEZ DONE DONE IF SIGN IS POSITIVE. ZAC SUB QUOT SACL QUOT NEGATE QUOTIENT IF NEGATIVE. DONE LAC QUOT RET RETURN TO MAIN PROGRAM. 5-59 5.6.7 Floating-Point Arithmetic Floating-point numbers are often represented on microprocessors in a two- word format of mantissa and exponent. The mantissa is stored in one word. The exponent, the second word, indicates how many bit positions from the left the decimal point is located. If the mantissa is 16 bits, a 4-bit exponent is suffi- cient to express the location of the decimal point. Because of its 16-bit word size, the 16/4-bit floating-point format functions most efficiently on the TMS320C2x. The theory and implementation of floating-point arithmetic has been presented in an application report in the book, Digital Signal Processing Applications with the TMS320 Family (literature number SPRA012A). Operations in the TMS320C2x central ALU are performed in 2s-complement fixed-point notation. To implement floating-point arithmetic, operands must be converted to fixed point for arithmetic operations, and then converted back to floating point. Conversion to floating-point notation is performed by normalizing the input data, that is, shifting the MSB of the data word into the MSB of the internal memory word. The exponent word then indicates how many shifts are re- quired. To multiply two floating-point numbers, the mantissas are multiplied and the exponents added. The resulting mantissa must be renormalized; since the input operands are normalized, no more than one left shift is required to renormalize the result. Floating-point addition or subtraction requires shifting the mantissa so that the exponents of the two operands match. The difference between the exponents is used to left-shift the lower power operand before adding. Then, the output of the add must be renormalized. TMS320C2x instructions useful in floating-point operations are the NORM, LACT, ADDT, and SUBT instructions. NORM may be used to convert fixed- point numbers to floating-point. LACT may be used to convert back to fixed- point numbers. Addition and subtraction can be computed in floating point by using ADDT and SUBT. Example 5-36 shows a floating-point multiply on the TMS320C25. The man- tissas are assumed to be in Q15 format. Q15, one of the various types of Q format, is a number representation commonly used when performing opera- tions on noninteger numbers. In Q format, the Q number (15 in Q15) denotes how many digits are located to the right of the binary point. A 16-bit number in Q15 format, therefore, has an assumed binary point immediately to the right of the most significant bit. Since the most significant bit constitutes the sign of the number, the numbers in Q15 may take on values from +1 (represented by +0.99997 ...) to -1. 5-60 Software Applications Advanced Arithmetic Operations ~~m~~~~>m~~~~-:w~~~~mmm~~w~~~;~~;:;;~;:;;~~m~~~~~~<:m~::-;:;::Xili::::::::::~:~;~~;*'%~:::::::ch;~~:::::::~m~~w-::.::~%~::Y;:;m:r..:=;:;.-:-;:;; Example 5-36. Using NORM for Floating-Point Multiply * THIS SUBROUTINE PERFORMS A FLOATING-POINT MULTIPLY USING THE NORM INSTRUCTION. * THE INPUTS AND OUTPUTS ARE OF THE FORM: * * C = MC * 2**EC * * SINCE THE MANTISSAS, MA AND MB, ARE NORMALIZED, MC CAN BE NORMALIZED WITH A * LEFT SHIFT OF EITHER 0 OR 1 IN THE ACCUMULATOR. THE EXPONENT OF THE RESULT IS * ADJUSTED APPROPRIATELY. FOR EXAMPLE, MULTIPLICATION OF THE TWO NUMBERS A AND B, * WHERE A= 0.1 * 2**2 AND B = 0.1 * 2**4, PROCEEDS AS FOLLOWS: * * 1) A * B 0.01 * 2**6 * 2) A * B = 0.1 * 2**5 (NORMALIZED RESULT) * MULT LAC EA ADD EB EC = EXPONENT OF RESULT BEFORE SACL EC NORMALIZATION. LT MA MPY MB PAC (ACC) = MA * MB * SFL TAKES CARE OF REDUNDANT SIGN BIT. LARP ARS LAR ARS,EC ARS IS INITIALIZED WITH EC. * NORM *- FINDS MSB AND MODIFIES ARS. * SACH MC MC = MA * MB (NORMALIZED) SAR ARS,EC RET RETURN TO MAIN PROGRAM. Floating-point implementation programs often require denormalization as well as normalization to return results in a 16-bit format. Example 5-37 illustrates the denormalizing of numbers that were normalized with the NORM instruc- tion. This program assumes that the mantissa is in the accumulator and that the exponent is in an auxiliary register, which is the format of the NORM instruction after execution. Example 5-37. Using LACT for Denormalization * THIS ROUTINE DENORMALIZES NUMBERS NORMALIZED BY THE NORM INSTRUCTION (NORM*-). * THE DENORMALIZED NUMBER WILL BE IN THE ACCUMULATOR * DENORM LARP 1 USE ARl TO POINT AT BLOCK BO. LRLK ARl I 200h SAR AR4, *+ STORE EXPONENT AT 200h. SACH *- STORE MANTISSA AT 201h. * LAC * LOAD ACCUMULATOR WITH EXPONENT. BZ OUT CHECK FOR ZERO EXPONENT. LT *+ LACT * DENORMALIZE NUMBER. RET RETURN TO MAIN PROGRAM. OUT MAR *+ POINT TO MANTISSA. ZALH * LOAD ACCUMULATOR WITH RESULT. RET RETURN TO MAIN PROGRAM. 5-61 5.6.8 Indexed Addressing The auxiliary register arithmetic unit (ARAU) makes it possible to calculate the next indirect address by incremenVdecrement or by indexed addressing in parallel to the current arithmetic operation. For example, in the multiplication of two matrices, the operation requires addressing across the rows (incre- menting the address by one) or down the columns (incrementing by n). Example 5-38 gives the code for multiplying a row times a column of two 1Ox10 matrices. The first matrix resides in data RAM block 81, and the second matrix resides in block BO. Example 5-38. Row Times Column LARK O, OAh SET INDEX TO 10. LARP 1 ARl FOR ADDRESSING THE COLUMN. LRLK 1,300h POINT ARl TO THE START OF BLOCK Bl. CNFP SET BO TO PROG ADDRESS FOR PIPELINE. ZAC INITIALIZE THE ACCUMULATOR. MPYK 0 CLEAR THE PRODUCT REGISTER. RPTK 9 REPEAT 10 TIMES AS MATRIX DIMENSION. MAC OFFOOh,*0+ MULTIPLY ROW TIMES COLUMN. APAC EXECUTE FINAL ACCUMULATION. ACCUMULATOR CONTAINS PRODUCT. The algorithm in Example 5-38 executes in 22 machine cycles. The key to this performance is the parallel addressing of both multiplicands simultaneously. The operation is made possible by the use of the data bus to fetch one multipli- cand and the program bus to fetch the other. The auxiliary register indexes down the column of one matrix while the PC generates incremental addres- sing of each row of the other matrix. Each cycle of the repeat loop performs the following operations: 1) Accumulates the previous product, 2) Multiplies the row element times the column element, 3) Increments the row address, and 4) Indexes the column address. 5.6.9 Extended-Precision Arithmetic Numerical analysis, floating-point computations, or other operations may re- quire arithmetic to be executed with more than 32 bits of precision. Since the TMS320C2x processors are 16/32-bit fixed-point devices, software is required for the extended-precision of arithmetic operations. A subroutine that performs the extended-arithmetic function for the TMS320C25 is provided in the exam- ples of this section. The technique consists of performing the arithmetic by parts, similar to the way in which longhand arithmetic is done. 5-62 Software Applications The TMS320C25 has two features that help to make extended-precision cal- culations more efficient. One of the features is the carry status bit. This bit is affected by all arithmetic operations of the accumulator (ABS, ADD, ADDC, ADDH, ADDK, ADDS, ADDT, ADLK, APAC, LTA, LTD, LTS, MAC, MACD, MPYA, MPYS, NEG, SBLK, SPAC, SQRA, SQRS, SUB, SUBS, SUBC, SUBH, SUBK, SUBS, and SUBT). The carry bit is also affected by the rotate and shift accumulator instructions (ROL, ROR, SFL, and SFR) or may be explicitly mo- dified by the load status register ST1 (LST1), reset carry (RC), and set carry (SC) instructions. For proper operation, the overflow mode bit should be reset (OVM = 0) so that the accumulator results will not be loaded with the saturation value. Note that this means that some additional code may be required if over- flow of the most significant portion of the result is expected. The carry bit is set whenever the addition of a value from the input scaling shift- er or the P register to the accumulator contents generates a carry out of bit 31. Otherwise, the carry bit is reset because the carry out of bit 31 is a zero. One exception to this case is the ADDH instruction, which can only set, not reset, the carry bit. This allows the accumulation to generate the proper single carry when the addition to either the lower or upper half of the accumulator actually causes the carry. The following examples help to demonstrate the significance of the carry bit on the TMS320C25 for additions: c MSB LSB c MSB LSB x F F F F F F F F ACC x F F F F F F F F ACC + 1 + F F F F F F F F 0 0 0 0 0 0 0 0 F F F F F F F E x 7 F F F F F F F ACC x 7 F F F F F F F ACC + 1 + F F F F F F F F 0 8 0 0 0 0 0 0 0 7 F F F F F F E x 8 0 0 0 0 0 0 0 ACC x 8 0 0 0 0 0 0 0 ACC + 1 + F F F F F F F F 0 8 0 0 0 0 0 0 1 7 F F F F F F F 0 0 0 0 0 0 0 0 ACC F F F F F F F F ACC + 0 (ADDC) + 0 (ADDC) 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 8 0 0 0 F F F F ACC 8 0 0 0 F F F F ACC + 0 0 0 0 0 0 0 0 (ADDH) + 7 F F F 0 0 0 0 (ADH) 8 0 0 0 F F F F F F F F F F F F 5-63 Example 5-39 shows an implementation of two 64-bit numbers added to each other to obtain a 64-bit result. This example adds 32-bit parts and generates a carry (C) bit in the accumulator. Example 5-39. 64-Bit Addition * TWO 64-BIT NUMBERS ARE ADDED TO EACH OTHER PRODUCING A 64-BIT RESULT. THE * NUMBERS X (X3,X2,Xl,XO) AND Y (Y3,Y2,Yl,YO) ARE ADDED RESULTING IN W * (W3,W2,Wl,WO). * * * * X3 X2 Xl XO * + Y3 Y2 Y1 YO * * W3 W2 Wl WO * ADD64 ZALH Xl ACC Xl 00 ADDS XO ACC Xl XO ADDS YO ACC Xl XO + 00 YO ADDH Y1 ACC Xl XO + Yl YO = Wl WO SACL WO SACH Wl ZALH X3 ACC X3 00 ADDC X2 ACC X3 X2 + c ADDS Y2 ACC X3 X2 + 00 Y2 + c ADDH Y3 ACC X3 X2 + Y3 Y2 + c = W3 W2 SACL W2 SACH W3 RET As in addition, the carry bit on the TMS320C25 is reset whenever the input scaling shifter or the P-register value subtracted from the accumulator con- tents generates a borrow into bit 31. Otherwise, the carry bit is set because no borrow into bit 31 is required. One exception to this case is the SUBH instruc- tion, which can only reset the carry bit. This allows the generation of the proper single carry when the subtraction from either the lower or upper half of the ac- cumulator actually causes the borrow. The following examples help to demon- strate the significance of the carry bit for subtractions: 5-64 Software Applications Advanced Arithmetic c MSB LSB c MSB LSB x 0 0 0 0 0 0 0 0 ACC x 0 0 0 0 0 0 0 0 ACC 1 F F F F F F F F 0 F F F F F F F F 0 0 0 0 0 0 0 0 1 x 7 F F F F F F F ACC x 7 F F F F F F F ACC 1 F F F F F F F F 7 F F F F F F E 0 8 0 0 0 0 0 0 0 x 8 0 0 0 0 0 0 0 ACC x 8 0 0 0 0 0 0 0 ACC 1 F F F F F F F F 7 F F F F F F F 0 8 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 ACC 0 F F F F F F F F ACC 0 (SUBB) (SUBB) 0 0 F F F F F F F F F F F F F F F E 0 8 0 0 0 F F F F ACC 0 8 0 0 0 F F F F ACC (SUBH) (SUBH) 0 0 0 1 0 0 0 0 F F F F 0 0 0 0 0 7 F F F F F F F 0 8 0 0 1 F F F F The coding in Example 5-40 shows the advantage of using the carry (C) sta- tus bit on the TMS320C25. Example 5-40. 64-Bit Subtraction * TWO 64-BIT NUMBERS ARE SUBTRACTED, PRODUCING A 64-BIT RESULT. THE NUMBER Y * (Y3,Y2,Yl,YO) IS SUBTRACTED FROM X (X3,X2,Xl,XO) RESULTING IN W (W3,W2,Wl,WO). * * X3 X2 Xl XO * Y3 Y2 Y1 YO * * W3 W2 Wl WO * SUB64 ZALH Xl ACC Xl 00 ADDS XO ACC Xl XO SUBS YO ACC Xl XO 00 YO SUBH Y1 ACC Xl XO Yl YO Wl WO SACL WO SACH Wl ZALS X2 ACC 00 X2 SUBB Y2 ACC 00 X2 00 Y2 c ADDH X3 ACC X3 X2 00 Y2 c SUBH Y3 ACC X3 X2 Y3 Y2 c W3 W2 SACL W2 SACH W3 RET 5-65 The second feature of the TMS320C25 that assists in extended-precision cal- culations is the MPYU (unsigned multiply) instruction. The MPYU instruction allows two unsigned 16-bit numbers to be multiplied and the 32-bit result to be placed in the product register in a single cycle. Efficiency is gained by generat- ing partial products from the 16-bit portions of a 32-bit or larger value instead of having to split the value into 15-bit or smaller parts. Example 5-41 shows the implementation of multiplying two 32-bit numbers to obtain a 64-bit result. The advantage in using the MPYU instruction can be ob- served when executed on the TMS320C25. Example 5-41. 32 x 32-Bit Multiplication * TWO 32-BIT NUMBERS ARE MULTIPLIED, PRODUCING A 64-BIT RESULT. THE NUMBERS X * (Xl,XO) ANDY (Yl,YO) ARE MULTIPLIED RESULTING IN W (W3,W2,Wl,WO). * * Xl XO * x Yl YO * * XO*YO * Xl*YO * XO*Yl * Xl*Yl * * W3 W2 Wl WO * * DETERMINE THE SIGN OF THE PRODUCT. * MPY32 ZALS Xl ACCL S X X X XX X XX X X XX X X x XOR Yl ACCL S SACH SIGN,1 SAVE THE PRODUCT SIGN 0 = +, 1 = -. * * TAKE THE ABSOLUTE VALUE OF BOTH X ANDY. * ABSX ZALH Xl ACC = Xl 00 ADDS XO ACC = Xl XO ABS SACH Xl SAVE I Xl 1 · SACL XO SAVE XO . ABSY ZALH Yl ACC = Y1 00 ADDS YO ACC = Yl YO ABS SACH Yl SAVE I Yl 1 · SACL YO SAVE YO . * * MULTIPLY !xi AND IYI TO PRODUCE I w I. * MULT LT XO T = XO MPYU YO T = XO, P = XO*YO SPL WO SAVE I WO I· SPH Wl SAVE PARTIAL I Wl I . MPYU Y1 T = XO, P = XO*Yl LTP Xl T = Xl, P = XO*YO, ACC XO*Yl MPYU YO T = Xl, P = Xl*YO, ACC XO*Yl ADDS Wl T = Xl, P = Xl*YO, 5-66 Software Applications * ACC = XO*Yl + XO*Y0*2**-16 MPYA Y1 T = Xl, P = Xl*Yl, * ACC = Xl*YO + XO*Yl + XO*Y0*2**-16 SACL Wl SAVE I Wl j. SACH W2 SAVE PARTIAL I W2 I • ZALS W2 P = Xl*Yl, * ACC = (Xl*YO + XO*Yl)*2**-16 BNC SUM TEST FOR CARRY FROM W2. ADDH ONE SUM APAC ACC = Xl*Yl + (Xl*YO + XO*Yl)*2**-16 SACL SACH W2 W3 SAVE SAVE IW2 I· W3 j. * * TEST THE SIGN OF THE PRODUCT; NEGATE IF NEGATIVE. * LAC SIGN BZ DONE RETURN IF POSITIVE. * ZALH Wl ACC = I Wl oo I ADDS WO ACC = Wl WO CMPL ADD ONE ACC = Wl WO AND CARRY GENERATION SACL WO SAVE WO. SACH Wl SAVE Wl. ZALS ADDH W2 W3 ACC = ACC = I 00 W3 W2 W2 CMPL ADDC ZERO ACC = W3 W2 SACL SACH W2 W3 SAVE SAVE I W2 I· W3 I· DONE RET 5-67 Application-Oriented Operations 5. 7 Application-Oriented Operations The TMS320C2x efficiently implements many common digital signal proces- sing algorithms. The architecture discussed in Chapter 3 supports features that solve numerically intensive problems usually characterized by multiply/ accumulates. Some device-specific features that aid in the implementation of specific algorithms include companding, filtering, Fast Fourier Transforms (FFT), and PID control. These applications require 1/0 performed either in par- allel or serial. Hardware requirements for 1/0 are discussed in Chapters 3 and NO TAG. 5.7.1 Companding In the area of telecommunications, one of the primary concerns is the 1/0 band- width in the communications channel. One way to minimize this bandwidth is by companding (COMpress/exPAND). Companding is defined by two interna- tional standards, A-law and µ-law, both based on the compression of the equivalent of 13 bits of dynamic range into an 8-bit code. The standard employed in the United States and Japan is µ-law; the European standard is A-law. Detailed descriptions and code examples of both types are presented in an application report on companding routines included in the book, Digital Signal Processing Applications with the TMS320 Family (literature number SPRA012A). The technique of companding allows the digital sample information corre- sponding to a 13-bit dynamic range to be transmitted as 8-bit data. For proces- sing in the TMS320C2x, it is necessary to convert the 8-bit (logarithmic) sign- magnitude data to a 16-bit 2s-complement (linear) format. Prior to output, the linear result must be converted to the compressed or companded format. Table lookup or conversion subroutines may be used to implement these func- tions. Software routines for µ-law and A-law companding, flowcharts, companding algorithms, and detailed descriptions are provided in the application report on companding routines mentioned above. The algorithm space and time re- quirements for µ-law and A-law companding on the TMS320C25 are given in Table 5-1. 5-68 Software Applications Application-Oriented Operations 5.7.2 FIR/llR Filtering Digital filters are a common requirement for digital signal processing systems. The filters fall into two basic categories: finite impulse response (Fl R) and Infi- nite impulse response (I IR) filters. For either category of filter, the coefficients of the filter (weighting factors) may be fixed or adapted during the course of the signal processing. Presented in Digital Signal Processing Applications with the TMS320 Family (literature number SPRA012A}, an application report discusses the theory and implementation of digital filters. The 100-ns instruction cycle time of the TMS320C25 reduces the execution time of all filters-especially the llR filters-because fewer multiply/accumu- late routines are required. Correspondingly, the amount of data memory for samples and coefficients is not usually the limiting factor. Because of sensitiv- ity to quantization of the coefficients themselves, llR filters are usually imple- mented in cascaded second-order sections. This translates to instruction code consisting of LTD-MPY instruction pairs rather than MACDs. Example 5-42 illustrates an implementation of a second-order llR filter. Example 5-42. Implementing an /JR Filter * * THE FOLLOWING EQUATIONS ARE USED TO IMPLEMENT AN IIR FILTER: * * d(n) = x(n) + d(n - l)al + d(n - 2)a2 * y(n) = d(n)bO + d(n - l)bl + d(n - 2)b2 * START IN XN,PAO ; INPUT NEW VALUE XN LAC XN, 15 ; LOAD ACCUMULATOR WITH XN * LT DNMl MPY Al * LTD DNM2 MPY A2 * APAC SACH DN,1 d(n) = x(n) + d(n - l)al + d(n - 2)a2 ZAC MPY B2 * LTD DNMl MPY Bl * LTD ON MPY BO * APAC SACH YN, 1 y(n) = d(n)bO + d(n - l)bl + d(n - 2)b2 OUT YN,PAl YN IS THE OUTPUT OF THE FILTER 5-70 Software Applications Application-Oriented Operations FIR filters also benefit from the faster instruction cycle time. An FIR filter re- quires many more multiply/accumulates than does the 11 R filter with equivalent sharpness at the cutoff frequencies and distortion and attenuation in the pass- bands and stopbands. The TMS320C2x can help solve this problem by mak- ing longer filters feasible to implement. This is accomplished by allowing the coefficients to be fetched from program memory at the same time as a sample is being fetched from data memory. The simple implementation of this process uses the MACD instruction with the RPT/RPTK instruction. RPTK 255 MACD COEFFP, *- The coefficients on the TMS320C25 may be stored anywhere in program memory (reconfigurable on-chip RAM, on-chip ROM, or external memories). When the coefficients are stored in on-chip ROM or externally, the entire on- chip data RAM may be used to store the sample sequence. Ultimately, this al- lows filters of up to 512 taps to be implemented on the TMS320C25. The filter executes at full speed or 100 ns per tap as long as the memory supports full- speed execution. 5.7.3 Adaptive Filtering With FIR/llR filtering, the filter coefficients may be fixed or adapted. If the coef- ficients are adapted or updated with time, then another factor impacts the com- putational capacity. This factor is the requirement to adapt each of the coeffi- cients, usually with each sample. The MPYA or MPYS and ZALR instructions on the TMS320C25 aid with this adaptation to reduce the execution time. A means of adapting the coefficients on the TMS320C2x is the least-mean- square (LMS) algorithm given by the following equation: bk (i + 1) = bk(i) + 28 e(i) x(i-k) where e(i) = x(i) - y(i) N-1 and y(i) = I bkx(i - k) K=O Quantization errors in the updated coefficients can be minimized if the result is obtained by rounding rather than truncating. For each coefficient in the filter at a given point in time, the factor 2*B*e(i) is a constant. This factor can then be computed once and stored in the T register for each of the updates. Thus, the computational requirement has become one multiply/accumulate plus rounding. Without the new instructions, the adaptation of each coefficient is five instructions corresponding to five clock cycles. This is shown in the follow- ing instruction sequence: 5-71 Application-Oriented Operations LRLK AR2,COEFFD LOAD ADDRESS OF COEFFICIENTS. LRLK AR3,LASTAP LOAD ADDRESS OF DATA SAMPLES. LARP AR2 LT ERRF errf = 2*B*e(i) ZALH * ,AR3 ACC = bk(i)*2**16 ADD ONE,15 ACC = bk(i)*2**16 + 2**15 MPY *-,AR2 APAC ACC = bk(i)*2**16 + errf*x(i - k) + 2**15 SACH *+ SAVE bk(i + l). When the MPYA and ZALR instructions on the TMS320C25 are used, the adaptation reduces to three instructions corresponding to three clock cycles, as shown in the following instruction sequence. Note that the processing order has been slightly changed to incorporate the use of the MPYA instruction. This is due to the fact that the accumulation performed by the MPYA is the accu- mulation of the previous product. LRLK AR2,COEFF.O LOAD ADDRESS OF COEFFICIENTS. LRLK AR3,LASTAP LOAD ADDRESS OF DATA SAMPLES. LARP AR2 LT ERRF errf = 2*B*e(i) ZALR * ,AR3 ACC = bk(i)*2**16 + 2**15 MPYA *-,AR2 ACC = bk(i)*2**16 + errf*x(i - k) + 2**15 PREG = errf*x(i - k + l) SACH *+ SAVE bk ( i + 1 ) • Example ~3 shows a routine to filter a signal and update the coefficients. Example 5-44 provides the conclusion to the adaptive Fl R filter routine for the TMS320C25. Adaptive filter length is restricted both by execution time and memory. Due to the adaptation, there is more processing to be completed per sample , and the adaptation itself dictates that the coefficients be stored in the reconfigurable block of on-chip RAM. Thus, the practical limit of an adaptive filter with no ex- ternal data memory is 256 taps. 5-72 Software Applications Application-Oriented Operations Example 5-43. 256-Tap Adaptive FIR Filter .title 'ADAPTIVE FILTER' .def ADPFIR .def X,Y * * THIS 256-TAP ADAPTIVE FIR FILTER USES ON-CHIP MEMORY BLOCK BO FOR COEFFICIENTS * AND BLOCK Bl FOR DATA SAMPLES. THE NEWEST INPUT SHOULD BE IN MEMORY LOCATION X * WHEN CALLED. THE OUTPUT WILL BE IN MEMORY LOCATION Y WHEN RETURNED. ASSUME THAT * THE DATA PAGE IS 0 WHEN THE ROUTINE IS CALLED. * COEFFP .set OFFOOh BO PROGRAM MEMORY ADDRESS COEFFD .set 0200h BO DATA MEMORY ADDRESS * ONE .set 7Ah CONSTANT ONE (DP = 0) BETA .set 7Bh ADAPTATION CONSTANT (DP 0) ERR .set 7Ch SIGNAL ERROR (DP = 0) ERRF .set 7Dh ERROR FUNCTION (DP = 0) y .set 7Eh FILTER OUTPUT (DP = 0) x .set 7Fh NEWEST DATA SAMPLE (DP = 0) FRSTAP .set 0300h NEXT NEWEST DATA SAMPLE LAS TAP .set 03FFh OLDEST DATA SAMPLE .text * * FINITE IMPULSE RESPONSE (FIR) FILTER. * CONFIGURE BO AS PROGRAM: ADPFIR CNFP MPYK 0 Clear the P register. LAC ONE,14 Load output rounding bit. LARP AR3 LRLK AR3,LASTAP Point to the oldest sample. FIR RPTK 255 MACO COEFFP,*- 256-tap FIR filter. CNFD CONFIGURE BO AS DATA: APAC SACH yI 1 Store the filter output. NEG ADD X,15 Add the newest input. SACH ERR,l err(i) = x(i) - y(i) * * LMS ADAPTATION OF FILTER COEFFICIENTS. * LT ERR MPY BETA PAC errf(i) = beta * err(i) ADD ONE,14 ROUND THE RESULT. SACH ERRF,l * MAR *+ LAC X INCLUDE NEWEST SAMPLE. SACL * * LRLK AR2 , COEFFD POINT TO THE COEFFICIENTS. LRLK AR3,LASTAP POINT TO THE DATA SAMPLES. LT ERRF MPY *-,AR2 P = 2*beta*err(i)*x(i-255) 5-73 Application-Oriented Operations ~~~~:::=z.::::='"-"-==-==--=--====--m:::=:::::.::i====>-.:::::~~..x-.m.~™~~~<:::::w~~:m~~...:::-.-.w..::::-~::::::::%:~~ Example 5-44. Adaptive Filter Routine Concluded * ADAPT ZALR * ,AR3 LOAD ACCH WITH b255(i) & ROUND. MPYA *-,AR2 b255(i + 1) = b255(i) + p * P = 2*beta*err(i)*x(i-254) SACH *+ STORE b255(i + 1). * ZALR * ,AR3 LOAD ACCH WITH b254(i) & ROUND. MPYA *-,AR2 b254(i + l) = b254(i) + p * P = 2*beta*err(i)*x(i-253) SACH *+ STORE b254(i + l). * ZALR * ,AR3 LOAD ACCH WITH b253(i) & ROUND. MPYA *-,AR2 b253(i + 1) = b253(i) + p * P = 2*beta*err(i)*x(i-252) SACH *+ STORE b253(i + 1). ZALR * ,AR3 LOAD ACCH WITH bl(i) & ROUND. MPYA *-,AR2 bl(i + l) = bl(i) + p * P = 2*beta*err(i)*x(i - 0) SACH *+ STORE bl(i + 1). * ZALR * LOAD ACCH WITH bO(i) & ROUND. APAC bO(i + l) = bO(i) + P SACH *+ STORE bO ( i + 1) . * RET RETURN TO CALLING ROUTINE. Table 5-2 provides data memory, program memory, and CPU cycles for a 256-tap adaptive FIR filter implementation using the TMS320C25. Note that n = 256 in the table. Table 5-2. 256-Tap Adaptive Filtering Memory Space and Time Requirements Device Words In Memory CPU Cycles Data Program TMS320C25 5 + 2n 30 + 3n 33 + 4n 5-74 Software Applications Application-Oriented Operations 5. 7 .4 Fast Fourier Transforms (FFT) Fourier transforms are an important tool used often in digital signal processing systems. The purpose of the transform is to convert information from the time domain to the frequency domain. The inverse Fourier transform converts in- formation back to the time domain from the frequency domain. Implementa- tions of Fourier transforms that are computationally efficient are known as Fast Fourier Transforms (FFTs). The theory and implementation of FFTs has been discussed in an application report in the book, Digital Signal Processing Ap- plications with the TMS320 Family (literature number SPRA012A). The TMS320C25 reduces the execution time of all FFTs by virtue of its 100-ns instruction cycle time. In addition to the shorter cycle time, an addressing fea- ture has been added to the TMS320C25, which provides execution speed and program memory enhancements for radix-2 FFTs. As demonstrated in Figure 5-13 and Figure 5-14, the inputs or outputs of an FFT are not in se- quential order-that is, they are scrambled. The scrambling of the data ad- dressing is a direct result of the radix-2 FFT derivation. Observation of the fig- ures and the relationship of the input and output addressing in each case re- veal that the address indexing is a bit-reversed order, as shown in Table 5-3. As a result, either the data input sequence or the data output sequence must be scrambled in association with the execution of the FFT. 5-75 Application-Oriented Operations Figure 5-13. An In-Place DIT FFT With In-Order Outputs and Bit-Reversed Inputs Stage 1 Stage2 Stage 3 , , - - - x(O) , , - - - x(1) , , - - - x(2) , , - - - x(3) .__ _ x(4) .__ _ x(5) .__ _ x(6) .__ _ x(7) LEGEND FOR TWIDDLE FACTOR: Wo = W ~ W1 = W ~ W2 = W : W3 = W : Figure 5-14. An In-Place DIT FFT With In-Order Inputs but Bit-Reversed Outputs Stage 1 Stage 2 Stage3 x(O) x(O) x(1) x(4) x(2) x(2) x(3) x(6) Wo x(4) x(1) Wo x(5) x(5) Wo x(6) x(3) Wo x(7) x(7) LEGEND FOR TWIDDLE FACTOR: Wo = W ~ W1 = W ~ W2 = W : W3 = W : 5-76 Software Applications Application-Oriented Operations Table 5-3. Bit-Reversal Algorithm for an 8-Point Radix-2 DIT FFT Index Bit Pattern Bit-reversed Pattern Bit-reversed Index 0 000 000 0 1 001 100 4 2 010 010 2 3 011 110 6 4 100 001 1 5 101 101 5 6 110 011 3 7 111 111 7 An addressing feature that uses reverse carry-bit propagation allows the TMS320C25 to scramble the inputs or outputs while it is performing the 1/0. The addressing mode is part of the indirect addressing implemented with the auxiliary registers and the associated arithmetic unit. In this mode (a derivative of indexed addressing), a value (index) contained in ARO is either added to or subtracted from the auxiliary register being pointed to by the ARP. However, the carry bit is propagated in the reverse direction rather than the forward direction. The result is a scrambling in the address access. The procedure for generating the bit-reversal address sequence is to load ARO with a value corresponding to one-half the length of the FFT and to load anoth- er auxiliary register, for example, AR 1, with the base address of the data array. Implementations of FFTs involve complex arithmetic; as a result, there are two data memory locations (one real and one imaginary) associated with every data sample. Generally, the samples are stored in memory in pairs with the real part in the even address locations and the imaginary part in the odd address location. This means that the offset from the base address for any given sam- ple is twice the sample index. Real input data is easily transferred into the data memory and stored in the scrambled order, with every other location in the data memory representing the imaginary part of the data. 5-77 Application-Oriented Operations The following list shows the contents of auxiliary register AR 1 when ARO is ini- tialized with a value of 8 (8-point FFT) and when data is being transferred by the code that follows. MSB LSB ARO: 0000 0000 0000 100 0 8-Point FFT AR1 0000 0010 0000 0000 Base Address RPTK 7 IN *BRO+,PAO AR1: 0000 00 10 0000 0000 XR(O) AR1: 0000 00 10 0000 100 0 XR(4) AR1: 0000 00 10 0000 0 100 XR(2} AR1: 0000 0010 0000 1100 XR(6} AR1: 0000 00 10 0000 0010 XR(1) AR1: 0000 0010 0000 10 10 XR(5) AR1: 0000 0010 0000 0 110 XR(3) AR1: 0000 00 10 0000 1110 XR(7) Example 5--45 consists of lists of macros used in the implementation of FFTs. 5-78 Software Applications Application-Oriented Operations Example 5-45. FFT Macros COMBO $MACRO Rl,Il,R2,I2,R3,I3,R4,I4 * CALCULATE PARTIAL TERMS FOR R3, R4, I3, AND I4. LAC :R3:,14 ACC (1/4) (R3) ADD :R4:,14 ACC (1/4) (R3 + R4) SACH : R3 : , 1 R3 ( 1/2 ) ( R3 + R4 ) SUB :R4:,15 ACC (1/4) (R3 + R4)-(l/2)(R4) SACH : R4 : , 1 R4 ( 1/2 ) ( R3 - R4 ) LAC : I3 : , 14 ACC ( 1I 4 ) (I 3 ) ADD :I4:,14 ACC (1/4) (I3 + I4) SACH :I3:,1 I3 (1/2) (I3 + I4) SUB :I4:,15 ACC (1/4) (I3 + I4)-(l/2)(I4) SACH : I4:, 1 ; I4 ( 1/2) ( I3 I4) * CALCULATE PARTIAL TERMS FOR R2, R4, I2, AND I4. LAC :Rl:,14 ACC (1/4) (Rl) ADD :R2:,14 ACC (1/4) (Rl + R2) SACH :Rl:, 1 Rl ( 1/2) (Rl + R2) SUB :R2:,15 ACC (1/4) (Rl + R2) - (l/2)(R2) ADD :I4:,15 ACC (1/4) [(Rl - R2) + (I3 I4)] SACH :R2: R2 (1/4) [(Rl - R2) + (I3 - I4)] SUBH :I4: ACC (1/4) [ (Rl - R2) - (I3 - I4)] DMOV :R4: I4 R4 = ( 1/2) (R3-R4) SACH :R4: R4 (1/4) (Rl - R2) - (I3 - I4)] LAC : I1 : , 14 ACC ( 1 / 4 ) ( I1 ) ADD :I2:,14 ACC (1/4) (Il + I2) SACH :Il:,l Il (1/2) (Il + I2) SUB :I2:,15 ACC (1/4) (Il + I2) - (1/2) (I2) SUB :I4:,15 ACC (1/4) [(Il I2) (I3 I4)] SACH :I2: I2 (1/4) [(Il I2) (I3 I4)] ADDH :I4: ACC (1/4) [(Il I2) + (I3 I4)] SACH :I4: ; 14 (1/4) [ (Il I2) + (I3 I4)] * CALCULATE PARTIAL TERMS FOR Rl, R3, Il, AND I3. LAC :Rl:,15 ACC (1/4) (Rl+R2) ADD :R3:,15 ACC (1/4) [ (Rl + R2) + (R3 + R4)) SACH :Rl: Rl ( 1/4) [ (Rl + R2) + (R3 + R4)] SUBH : R3: ACC ( 1/ 4) [ (Rl + R2) (R3 + R4)) SACH :R3: R3 (1/4) [ (Rl + R2) (R3 + R4)] LAC : I1 : , 15 ACC ( 1 I 4 ) (Il + I2) ADD : I3 : , 15 ACC ( 1 I 4 ) [(Il + I2) + (I3 + I4)] SACH :Il: Il (1/4) [(Il + I2) + (I3 + I4)] SUBH :I3: ACC (1/4) [ ( I1 + I2) (I3 + I4)] SACH :I3: I3 (1/4) [(Il + I2) (I3 + I4)] $END ZERO $MACRO PR,PI,QR,QI * CALCULATE Re[P+QJ AND Re[P-Q] LAC :PR:, 15 ACC (1/2) (PR) ADD :QR:, 15 ACC (1/2) (PR + QR) SACH :PR: PR (1/2) (PR + QR) SUBH :QR: ACC (1/2) (PR + QR) (QR) SACH :QR: QR (1/2) (PR - QR) SUBH :QI: ACC (1/2) (PI + QI) (QI) SACH :QI: QI (1/2) (PI - QI) $END PIBY4 $MACRO PR,PI,QR,QI,W * CALCULATE Im[P+QJ AND Im[P-QJ LAC :PI:,15 ACC : = (1/2) (PI) ADD :QI:,15 ACC : = (1/2) (PI +QI) SACH :PI: PI : = (1/2) (PI +QI) LT :W: T REGISTER : = W = COS(PI/4) SIN(PI/4) LAC :QI:,14 ACC : (1/4) (QI) SUB :QR:, 14 ACC : = (1/4) (QI - QR) 5-79 Application-Oriented Operations Example 5-45. FFT Macros (Continued) SACH :QI:,l QI (1/2) (QI - QR) ADD :QR:, 15 ACC (1/4) (QI + QR) SACH :QR:, 1 QR (1/2) (QI + QR) LAC :PR:,14 ACC : ( 1/4) (PR) MPY :QR: P REGISTER : = (1/4) (QI - QR) *W APAC ACC (1/4) [PR+ (QI + QR) *W] SACH :PR:, l PR (1/2) [PR+ (QI + QR) *W] SPAC ACC ( 1/4) (PR) SPAC ACC (1/4) [PR - (QI + QR) *W] SACH :QR:, l QR ( 1/2) [PR - (QI + QR) *W] LAC :PI:,14 ACC : (1/4) (PI) MPY :QI: P REGISTER : = (1/4) (QI - QR) *W APAC ACC ( 1/4) [PI + (Ql - QR) *W] SACH :PI:, l PI ( 1/2) [PI + (QI - QR) *W] SPAC ACC (1/4) (PI) SPAC ACC (1/4) [PI - (QI - QR) *W] SACH :QI:, l QI (1/2) [PI - (QI - QR) *W] $END PIBY2 $MACRO PR,PI,QR,QI * CALCULATE Re[P+jQ] AND Re[P-jQ] LAC :PI:,15 ACC (1/2) (PI) SUB :QR:, 15 ; ACC ( 1/2) (PI - QR) SACH :PI: ; PI (1/2) (PI - QR) ADDH :QR: ; ACC (1/2) (PI - QR) + (QR) SACH :QR: ; QR (1/2) (PI + QR) * CALCULATE Im[P+jQ] AND Im[P-jQ] LAC :PR:, 15 ACC (1/2) (PR) ADD :QI:,15 ACC (1/2) (PR + QI) SACH :PR: PR (1/2) (PR + QI) SUBH : QI : ACC (1/2) (PR + QI) - (QI) DMOV :QR: QR -+ QI SACH :QR: QR : = (1/2) (PR - QI) $END PI3BY4 $MACRO PR,PI,QR,QI,W LT :W: T REGISTER : = W = COS (PI/4) SIN (PI/4) LAC :QI:,14 ACC ( 1I4) (QI) SUB :QR:, 14 ACC ( 1/4) (QI - QR) SACH :QI:, l QI (1/2) (QI - QR) ADD :QR:,15 ACC (1/4) (QI + QR) SACH :QR:, l QR (1/2) (QI +QR) LAC :PR:, 14 ACC : ( 1 / 4 ) (PR) MPY :QI: P REGISTER : = (1/4) (QI - QR) *W APAC ACC : ( 1/4) [PR + (QI - QR) *W] SACH :PR:, l PR : = ( 1I2 ) [PR + (QI - QR) *W] SPAC ACC : = ( 1 I 4 ) (PR) SPAC ACC : = ( 1/4) [PR - (QI - QR) *W] MPY :QR: P REGISTER : = (1/4) (QI + QR) *W SACH :QR:,l QR (1/2) [PR - (QI - QR) *W] LAC :PI:,14 ACC (1/4) (PI) SPAC ACC (1/4) [PI - (QI + QR) *W] SACH :PI:,l PI ( 1/2) [PI - (QI + QR) *W] APAC ACC ( 1I4 ) (PI) APAC ACC ( 1/4) [PI + (QI + QR) *W] SACH :QI:,l QI ( 1/2) [PI + (QI + QR) *W] $END 5-80 Software Applications Application-Oriented Operations Example 5-46. An 8-Point DIT FFT XOR .set 00 XOI .set 01 XlR .set 02 XlI .set 03 X2R .set 04 X2I .set 05 X3R .set 06 X3I .set 07 X4R .set 08 X4I .set 09 X5R .set 10 X5I .set 11 X6R .set 12 X6I .set 13 X7R .set 14 X7I .set 15 w .set 16 WVALUE .set 5A82h VALUE FOR SIN(45) OR COS(45) .text* * INITIALIZE FFT PROCESSING. FFT SPM 0 NO SHIFT OF PR OUTPUT SSXM SET SIGN-EXTENSION MODE. ROVM RESET OVERFLOW MODE. LDPK 4 SET DATA PAGE POINTER TO 4. LALK WVALUE GET TWIDDLE FACTOR VALUE. SACL W ; STORE SIN(45) OR COS(45). * INPUT SAMPLES, STORING IN BIT-REVERSED ORDER. * LARK AR0,8 LOAD LENGTH OF FFT IN ARO. LRLK AR1,200h LOAD ARl WITH DATA PAGE 4 ADDRESS. LARP ARl RPTK 7 IN *BRO+,PAO ONLY REAL-VALUED INPUT * * lST & 2ND STAGES COMBINED WITH DIVIDE-BY-4 INTERSTAGE SCALING. COMBO XOR,XOI,XlR,XlI,X2R,X2I,X3R,X3I, COMBO X4R,X4I,X5R,X5I,X6R,X6I,X7R,X7I. * * 3RD STAGE WITH DIVIDE-BY-2 INTERSTAGE SCALING. ZERO XOR,XOI,X4R,X4I PIBY4 XlR,XlI,X5R,X5I,W PIBY2 X2R,X2I,X6R,X6I PI3BY4 X3R,X3I,X7R,X7I,W * OUTPUT SAMPLES, SUPPLYING IN SEQUENTIAL ORDER. LRLK AR1,200h LOAD ARl WITH DATA PAGE 4 ADDRESS. RPTK 15 OUT *+,PAO ; COMPLEX-VALUED OUTPUT RET Table 5-4 shows execution speed, program memory, and data memory for an 8-point DIT FFT implementation using the TMS320C25. Table 5-4. FFT Memory Space and Time Requirements Device Words In Memory CPU Cycles Time (µs) Data Program TMS320C25 17 153 178 17.8 5-81 Application-Oriented Operations ~.X:!.°**'~~~~~~~~:,:,;:::;,;x::,;:..~:=:::;:W.<'O~W-*~.,:,;-».:::.:;:~=~.,;,;-.;,:,:,:::,~;,;:;,;::,;:;,;,w.,:::.::;:;,:::.:;,;,;,;:::-,m:,:~:,;::::,::;::-.:x::,::;::-_w~,::::;~~~*<;.;,;,;,:,'.:::::::::;:; 5.7.5 PIO Control Control systems are concerned with regulating a process and achieving a de- sired behavior or output from the process. A control system consists of three main components: sensors, actuators, and a controller. Sensors measure the behavior of the system. Actuators supply the driving force to ensure the de- sired behavior. The controller generates actuator commands corresponding to the error conditions observed by the sensors and the control algorithms pro- grammed in the controller. The controller typically consists of an analog or digi- tal processor. Analog control systems are usually based on fixed components and are not programmable. They are also limited to using single-purpose characteristics of the error signal, such as P (proportional), I (integral), and D (derivative), or a combination. These limitations, along with other disadvantages of analog systems, such as component aging and temperature drift, are reasons why digital control systems increasingly replace analog systems in most control ap- plications. Digital control systems that use a microprocessor/microcontroller are able to implement more sophisticated algorithms of modern control theory, such as state models, deadbeat control, state estimation, optimal control, and adaptive control. Digital control algorithms deal with the processing of digital signals and are similar to DSP algorithms. The TMS320C2x instruction set can there- fore be used very effectively in digital control systems. The most commonly used algorithm in both analog and digital control systems is the PIO (Proportional, Integral, and Derivative) algorithm. The classical PIO algorithm is given by u( ~ = Kpe( ~ + ~ Jedt + Kd ~~ The PIO algorithm must be converted into a digital form for implementation on a microprocessor. Using a rectangular approximation for the integral, the PIO algorithm can be approximated as u(n) = u(n-1) + K1 e(n) + K2 e(n-1) + K3 e(n-2) This algorithm is implemented in Example 5-47. 5-82 Software Applications Application-Oriented Operations Example 5-47. PIO Control .title 'PIO CONTROL' .def PIO * * THIS ROUTINE IMPLEMENTS A PIO ALGORITHM. * UN .set 0 OUTPUT OF CONTROLLER EO .set 1 LATEST ERROR SAMPLE El .set 2 PREVIOUS ERROR SAMPLE E2 .set 3 OLDEST ERROR SAMPLE Kl .set 4 GAIN CONSTANT K2 .set 5 GAIN CONSTANT K3 .set 6 GAIN CONSTANT .text * * ASSUME DATA PAGE 0 IS SELECTED. * PIO IN EO,PAO READ NEW ERROR SAMPLE LAC UN ACC = u(n-1) LT E2 LOAD T REG WITH OLDEST SAMPLE MPY K2 P = K2*e(n - 2) LTD El ACC = u(n - 1) + K2*e(n - 2) MPY Kl P = Kl*e(n - l) LTD EO ACC = u(n - 1) + Kl*e(n - l) + K2*e(n - 2) MPY KO P = KO*e(n) APAC ACC = u(n - 1) + KO*e(n) + Kl*e(n - 1) * +K2*e(n - 2) SACH UN, 1 STORE OUTPUT OUT UN,PAl SEND IT The PIO loop takes 13 cycles to execute (1.3 µsat a 40-MHz clock rate). The TMS320 can also be used to implement more sophisticated algorithms, such as state modeling, adaptive control, state estimation, Kalman filtering, and op- timal control. Other functions that can be implemented are noise filtering, sta- bility analysis, and additional control loops. 5-83 5-84 Software Applications Chapter 6 Hardware Applications !m:!lllt!lll Ii 1 IW ii imt!lll!lll ii I m!!lllllfl I I t!llllt!lllW!llllU!llf !lll!llllHHHllll l!lllllf- Ir !l The TMS320C2x has the power and flexibility to satisfy a wide range of system requirements. The 128K-word address space for program and data memory can be used to interface external memories or to implement single-chip solu- tions. Peripheral devices can be interfaced to the TMS320C2x to perform ana- log signal acquisition at different levels of signal quality. Information and examples on how to interface the TMS320C2x to external de- vices are presented in this section. The examples given are general enough to be adapted easily for a particular system requirement. For more detailed in- formation, refer to the application reports included in the book, Digital Signal Processing Applications with the TMS320 Family, Volume I (literature number SPRA012A). Refer also to the application report, Hardware Interfacing to the TMS320C25 (literature number SPRA014A), published separately. Appendix G discusses analog interface peripherals and their applications, and Appendix H provides listings and brief information regarding Tl memories and analog conversion devices that are used in many of the applications in this chapter. The TMS320C26 is similar to the TMS320C25 except for its internal memory configuration. This is discussed in Section 3.4 and in Appendix B. Topics in this chapter include: Topic Page 6-1 System Control Circuitry 6.1 System Control Circuitry The system control circuitry performs functions that are critical for proper sys- tem initialization and operation. A powerup reset circuit design and a crystal oscillator circuit design are presented in this chapter. The powerup reset circuit assures that a reset of the part occurs only after the oscillator is running and stabilized. This oscillator circuit allows the use of third-overtone crystals, which are readily available at frequencies above 20 MHz. For a more detailed discus- sion of system control circuitry, refer to the application report, Hardware Inter- facing to the TMS320C25 (literature number SPRA014A). 6.1.1 Powerup Reset Circuit The reset circuit shown in Figure 6-1 performs a powerup reset, that is, the TMS320C2x is reset when power is applied. Note that the switch circuit must include debounce circuitry. Driving the RS signal low initializes the processor. Reset affects several registers and status bits (see subsection 3.6.2 for a de- tailed description of the effect of reset on processor status). Note: Reset does not have internal Schmidt hysterisis. Avoid slow rise and fall times to insure proper reset operation. 6-2 Hardware Applications Figure 6-1. Powerup Reset Circuit TMS320C25 +5V AS DGND For proper system initialization, the reset signal must be applied for at least three CLKOUT cycles, that is, 300 ns for a TMS320C25 operating at 40 MHz. Upon powerup, it can take from several to hundreds of milliseconds before the system oscillator reaches a stable operating state. Therefore, the powerup re- set circuit should generate a low pulse on the reset line until the oscillator is stable (that is, 100 to 200 ms). The voltage on the reset pin RS is controlled by the R 1C 1 network (see Figure 6-1). After a reset, this voltage rises exponentially according to the time constant R1C1, as shown in Figure 6-2. The Schmidt-Trigger inverter in this case could be a 7 4HC14. If a TTL device were used, the low-level input current (1 1L.) would initially cause the voltage on C 1 to rise faster than expected. 6-3 System Control Circuitry Figure 6-2. Voltage on TMS320C25 Reset Pin Voltage f V=Vee (1-e-t/'t) Vee :::.ao------ Time The duration of the low pulse on the reset pin is approximately t 1, which is the time it takes for the capacitor C1 to be charged to 1.5 V. This is approximately the voltage at which the reset input switches from a logic level 0 to a logic level 1. The capacitor voltage is given by where -c = R1C1 is the reset circuit time constant. Solving (1) for -c gives For example, setting the following: R1=1 MO Vee= 5V C1=0.47 µF V = V1=1.5 V gives t = t 1 = 167 ms. In this case, the reset circuit of Figure 6-1 can generate a low pulse of long enough duration (167 ms) to ensure the stabilization of the oscillator upon powerup in most systems. 6-4 Hardware Applications 6.1.2 Crystal Oscillator Circuit The crystal oscillator circuit shown in Figure 6-3 is designed to operate at 40.96 MHz. Since crystals with fundamental oscillation frequencies of 30 MHz and above are not readily available, a parallel-resonant third-overtone oscilla- tor is used. If a packed clock oscillator is used, oscillator design is of no con- cern. The master clock frequency of 40.96 MHz is chosen because it can be conve- niently converted to the timing signals of interface circuits used by the commu- nications industry. A combo-codec example is given in subsection 6.5.1. Figure 6-3. Crystal Oscillator Circuit TMS320C25 +5V fcrystal 10 KQ D 4.7 kQ rJ CLKIN 74AS04 0.1 µF 10 kQ C= OpF L = 1.8 µH .J,. = Digital Ground -- -- The 74AS04 inverter in Figure 6-3 provides the 180-degree phase shift that a parallel oscillator requires. The 4. 7-kQ resistor provides the negative feed- back that keeps the oscillator in a stable state; that is, the poles of the system are constrained in a narrow region about the jw axis of the s-plane (analog do- main). The 10-kQ potentiometer is used to bias the 7 4AS04 in the linear re- gion. In a third-overtone oscillator, the crystal fundamental frequency must be atte- nuated so that oscillation is at the third harmonic. This is achieved with an LC circuit that filters out the fundamental. The impedance of the LC network must be inductive below and capacitive above the second harmonic. The impedance of the LC circuit is given by L z(w) - c 1] - J·[ (1) L - coC (3) Therefore, the LC circuit has a pole at (J) = _1_ (4) p /LC 6-5 At frequencies significantly lower than cop, the 1/(coC) term in (3) becomes the dominating term, while col can be neglected. This gives z(w) = jwL for w < < wp (5) In (5), the LC circuit appears inductive at frequencies lower than wp. On the other hand, at frequencies much higher than cop, the wL term is the dominant term in (3), and 1/(wC) can be neglected. This gives z(w) = -.1- for w > > wp (6) JwC The LC circuit in (6) appears increasingly capacitive as frequency increases above wp. This is shown in Figure 6-4, which is a plot of the magnitude of the impedance of the LC circuit of Figure 6-3 versus frequency. Based on the discussion above, the design of the LC circuit proceeds as fol- lows: choose the pole frequency wp approximately halfway between the crys- tal fundamental and the third harmonic. The circuit now appears inductive at the fundamental frequency and capacitive at the third harmonic. In the oscillator of Figure 6-3, wp = 26.5 MHz, which is approximately halfway between the fundamental and the third harmonic; The values used in this case are determined by using C =20 pF; then, using (4), L = 1.8 µH. Figure 6-4. Magnitude of Impedance of Oscillator LC Network Iz (w) I Inductive Capacitive Region Region (I) (rad/s) 6-6 Hardware Applications System Control Circuitry 6.1.3 User Target Design Considerations for the XDS The architecture for the TMS320C2x emulator (XDS) maximizes speed and performance. No external serial logic levels have been added to any of the ad- dress, data, or control signals other than those added to the setup times of READY, RS, BTO, and ROID, and the propagation delay of HOLDA (hold ac- knowledge). The additional loading on outputs induced by the XDS is compre- hended in the XDS and TMS320C2x device design, thus allowing the user the full drive as specified in the TMS320C2x device data sheet. The DC loading characteristics of inputs is defined in Chapter 9 of the XDS/22 TMS320C2x Emulator User's Guide (literature number SPDU055). The emulator architecture works closely with the user's system design to allow the user's memory to have maximum access times. Areas of close interaction between the emulator and target system are: D Bus control O READY timing and memory substitution O Reset and hold O Miscellaneous considerations Bus Control When the emulator is halted from the keyboard or any of the breakpoint func- tions, the current state of the device being emulated is extracted by the control processor. This processor communicates with the emulated device over the emulated device's data bus. Additional communication is generated by com- mands entered from the keyboard. Before communication between the control processor and the device being emulated begins, the control processor generates an interlock sequence on the emulated device's ROID input in order to define data bus ownership. Once the target ROID is deactivated, this interlock prevents the target system from receiving an active HOLDA until the emulator has completed accessing the processor resources. The emulator will not attempt to .use the data bus until the interlock is successful, thus guaranteeing that it will not try to use the data bus when HOLDA is asserted to the target system. When communication between the control processor and the device being emulated is complete, the hold interlock is released, and the target system can again receive hold acknowledge when ROID is asserted. At this point, the emulator is waiting for another command from the keyboard. Communication between the device being emulated and the control process occurs when OS, PS, TS, and HOLDA are all high. 6-7 System Control Circuitry The target system should drive the data bus only when the following conditions are met: O HOLDA is active, or O OS, PS, orlS is active and R/W is high. The XDS hardware uses the data bus only while the above signals are inactive. When these rules are not followed, the XDS gives a PROCESSOR SYNC LOST 1160 error. This error may also be caused by signal-to-signal shorts in the target system, misalignment of the target connector, poor grounding of the target connector, or wiring errors on the target system. READY and Memory Substitution Because the XDS adds one internal level of 7 ns in series with the READY in- put, your system is left with only 1Ons to generate READY. This can be accom- plished by generating READY with a 10-ns TIBPAL 16R4 device. READY should be generated from OS, PS, orlS and the decode of the address lines. The target system must present a valid READY high on each external access, even when using the XDS substitution memory. Suggested implementation of READY logic on the target system should hold READY high until target memory requiring wait states is addressed. The XDS provides two types of memory substitution: fast static RAM at a fixed address and slower dynamic RAM at mappable addresses. You are is respon- sible for deselecting target memory residing in the same address of the emula- tor's fast static memory if this emulator memory is mapped in. (Note that the target should not drive the data bus on a read.) This fast static emulator sub- stitution memory consists of 8K words of fast static RAM, which can be individ- ually mapped in as 4K words of program memory starting at address 0000 and 4K words of data memory starting at location 0000. In this case, the target sys- tem cannot drive the data bus even though OS or PS is active. Although this emulator static RAM can operate with zero wait states, you can model target wait states by using the target READY signal. However, this requires the target system to eventually respond with a valid READY high. The emulator gener- ates wait states until it does. The slower dynamic RAM controls bus access through the OS or PS control signals. The target system can drive the data bus when PS orlS is asserted. Emulator logic assures that OS, PS, and TS are returned to their inactive state when the dynamic RAM substitution memory uses the data bus on reads. 6-8 Hardware Applications The dynamic RAM substitution memory always uses more than one clock to return data. An access to address space mapped to the dynamic substitution memory is accompanied by the assertion of US or PS, and STRS. When the target logic generates a READY high condition, the device appears to com- plete the memory cycle by driving US, PS,lS, or STRS to their inactive states at their normal switching times. The device under emulation is held not ready for at least one extra clock cycle or until the memory substitution data is avail- able. The memory substitution data is then driven onto the data bus on reads while all bus control signals at the target connector are high. Additional wait states can be added with the use of the target READY line. In this case, the memory control lines model the target access timing. However, the program cycle count is affected by the additional cycles internal to the emu- lator's access of the dynamic RAM. Since the system responds to the READY line, the target must eventually return a valid READY high on each access. Miscellaneous Considerations When the XDS is powered up, the device under emulation is placed in the run mode with all memory substitution turned off. The control processor does not attempt to communicate with the device under emulation until you communi- cate with the emulator. If the target system is asserting RS, ROCD, or not READY continuously to the device under emulation, the control processor cannot gain control of the device under emulation and reports a PROCESSOR SYNC LOST 1160 error. This condition can be caused by a powered-up emu- lator plugged into a powered-down target system. Although the RS, ROCD, and READY are pulled up with resistors on the emulator, the impedance of the powered-down target system can assert a control signal or load the data bus so that the XDS cannot function properly. The conductive foam on the XDS target cable must be removed along with the foam on the logic show pod prior to XDS powerup. Failure to do so can also cause the PROCESSOR SYNC LOST 1160 error. TMS320C25 Designs Using ffO[D' and HOLDA. When the target system as- serts ROrn active low while the emulator is processing user-invoked com- mands requiring access of the device-under-emulation resources, the target will not receive HOLDA until the command is complete. When interfacing to dynamic RAM in the target system, use READY rather than ROrn to insert refresh cycles. A user-invoked command could hold off HOLDA long enough to lose charge in the dynamic cells. Likewise, if the ad- dress lines to the DRAMs are not buffered, the refresh cycle in a RAS ONLY REFRESH system could conflict with the emulator system that controls ad- dressing during command processing. 6-9 Stack Usage. An interrupt is used to halt the device being emulated, thereby using one of the emulated device stack locations. When an XDS is to be used, the applications programmer should reserve one level of the stack for code de- velopment. Transmission Line Phenomena. Because the XDS target cable is approxi- mately 20 inches, use of advanced CMOS or fast/advanced Schottky TTL may cause line reflections (ringing above input thresholds) on input lines to the XDS. Series termination resistors (22 to 68 ohms) can help eliminate this prob- lem. In some cases where significant additional signal length is added to XDS outputs, the series resistors on the XDS may not be sufficient to control reflec- tions. In this case, additional corrective actions may be necessary. Clock Source. The XDS does not support the use of a crystal in the target sys- tem. The emulator's clock source can be selected from three sources: O A clock (with TTL levels) driven up the target cable on pin F11 (PGA) or pin 35 (PLCC), O A socketed changeable crystal on the emulator board (Y1), or O A socketed changeable canned TTL oscillator on the EMU (U9}. 6-10 Hardware Applications 6.2 Interfacing Memories The following buses, port, and control signals provide system interface to the TMS320C2x processor: O 16-bit address bus (A15 - AO) O 16-bit data bus (D15 - DO) D Serial port O PS, OS, TS (program, data, 1/0 space select) O RflJ (read/write) and STAB (strobe) O READY and MSC (microstate complete) O ROIO and HOLDA (hold acknowledge) O TNT (2-0) and JACK (interrupt acknowledge) 0 BTO (branch control) and XF (external flag) O S'YfJC (synchronization) and BR (bus request) The TMS320C2x can be interfaced with PRO Ms, EPROMs, and static RAMs. The speed, cost, and power limitations imposed by a particular application de- termine the selection of a specific memory device. If speed and maximum throughput are desired, the TMS320C2x can run with no wait states. In this case, memory accesses are performed in a single machine cycle. Alternative- ly, slower memories can be accessed by introducing an appropriate number of wait states or slowing down the system clock. The latter approach is more appropriate when interfacing to memories with access times slightly longer than those required by the TMS320C2x at full speed. When wait states are required, the number of wait states depends on the memory access time (see subsection 6.2.3). With no wait states, the READY input to the TMS320C2x can be pulled high. If one or more wait states are re- quired, the READY input must be driven low during the cycles in which the TMS320C2x enters a wait state. The TMS320C2x implements two separate and distinct memory spaces: pro- gram space (64K words) and data space (64K words). Distinction between the two spaces is made through the use of the PS (program space) and OS (data space) pins. A third space, the 1/0 space, is also available for interfacing with peripherals. This space is selected by the1S (1/0 space) pin, and is discussed in Section 6.5. 6-11 Interfacing Memories -~-=-=__,_,_,...,_,__ ____,"""""3~~-00-w-~-~"""'""'----~--~~~-uu=~~-------------;;~=•-,=•=~a=------=== The following brief discussion describes the TMS320C2x read and write cycles. For the memory read and write timing diagrams, refer to the TMS320C2x Data Sheets in Appendix A. For further information about read and write operation, see subsection 3.7.3. Throughout this chapter, Q is used to indicate the duration of a quarter phase of the output clock (CLKOUT1 or CLKOUT2). Memory interfaces discussed in this chapter assume that the TMS320C2x is running at 40 MHz; that is, Q = 25 ns. In a read cycle, the following sequence occurs: 1) Near the beginning of the machine cycle (CLKOUT1 goes low), the ad- dress bus and one of the memory select signals (PS, O'S, or TS) becomes valid. Rfli/ goes high to indicate a read cycle. 2) STRB goes low no less than tsu(A) = Q -12 ns afterthe address bus is valid. 3) Early in the second half of the cycle, the READY input is sampled. READY must be stable (low or high) at the TMS320C25 no later than td(SL-R) = Q-20 ns after STRB goes low. 4) With no wait states (READY is high), data must be available no later than ta(SL) = ta(A) - tsu(A) = 2Q - 23 ns after STRB goes low. The sequence of events that occurs during an external write cycle is the same as the above, with the following differences: 1) Rfli/ goes low to indicate a write cycle. 2) The data bus begins to be driven approximately concurrently with STRB going low. 3) After STRB goes high, the data bus must enter a high-impedance state no later than tdis(D) = Q+ 15 ns. 6.2.1 Interfacing PROMs Program memory in a TMS320C2x system can be implemented through the use of PROMs. Two different approaches for interfacing PROMs to the TMS320C2x can be taken, depending on whether or not any of the memories in the system require wait states. When no wait states are required for any of the memories, READY can be tied high, and the interface to the PROMs be- comes a direct connection. In this first approach, address decoding is not re- quired, because the system contains only a small amount of one type of memory. When some of the system memories require wait states, address de- coding must be performed to distinguish between two or more memory types with different access times. In the second approach, a valid READY signal that 6-12 Hardware Applications meets the TMS320C2x timing requirements must be provided. An efficient method of accomplishing this is to use one section of circuitry to generate the address decode, and a second, independent section to generate the READY signal. These two approaches are discussed in this section. For more detailed information, see Hardware Interfacing to the TMS320C25 (literature number SPRA014A). An example of a no-wait-state memory system is the direct PROM interface design shown in Figure 6--5. In this design, the TMS320C25 is interfaced with the Texas Instruments TBP38L 165-35, a low-power 2K x 8-bit PROM. The in- terface timing for the design of Figure 6--5 is shown in Figure 6--6. The same techniques can be used with all TMS320C2x devices. The TMS320C25 expects data to be valid no later than 20-23 ns after STAB goes low. (This is 27 ns for a TMS320C25 operating at 40 MHz.) The access times of the TBP38L 165-35 are 35 ns maximum from address ta(A)• and 20 ns maximum from chip enable ta(S)· On the TMS320C25, address becomes valid a minimum of tsu(A) =Q-12 ns = 13 ns before STAB goes low. Therefore, the data appears on the data bus within 27 ns after STAB goes low, as required by the TMS320C25. When a read cycle is followed by a write cycle, take care to avoid bus conflict. Bus conflict also may occur when a TMS320C25 write cycle is followed by a memory read cycle. In this case, the TMS320C25 data lines must be in a high- impedance state before the memory starts driving the data bus. 6-13 Figure 6-5. Direct Interface of TBP38L 165-35 to TMS320C25 TBP3BL 165-35 AO 9 DO AO 00 10 D1 A1 A1 01 11 D2 A2 A2 02 D3 13 A3 A3 03 14 D4 A4 A4 04 A5 15 D5 05 16 D6 A6 06 A7 17 D7 07 AB A9 A10 G2 G3 74ALS04 18 19 ~ PS 1-J_1o_ _- f :>o--+---+--+---+ .. ~1-H_1_0_ _ _ _--+------. ~ OIMC ~ R/W ,__H_1_1_ _ _ _--+-----+--- +5 V 20 18 19 1k Q GT G2 G3 9 DB AO 00 10 D9 A1 01 11 010 A2 02 13 D11 A3 03 14 D12 A4 04 15 D13 A5 05 16 014 A6 06 17 015 A7 07t-----.. AB A9 A10 TBP3BL 165-35 6-14 Hardware Applications Figure 6-6. Interface Timing of TBP3BL 165-35 to TMS320C25 CLKOUT1 \ I \__ ~,,,A,f r la(SL) ___.I I I I /iI ~ ~ Valid A15-AO, PS I I : !dis i.- ..1 I ) 1.. la(A) II 015-DO < Data In The most critical timing parameters of the TBP38L 165 -35 direct interface to the TMS320C25 are summarized in Table 6-1. Table 6-1. Timing Parameters of TBP3BL 165-35 Direct Interface to TMS320C25 Description Symbol Used in Value Figure 6-6 TMS320C25 address setup before strobe low lsu(A) 13 ns (min) TMS320C25 data setup time after strobe low la(Sl,l 27 ns (max) TMP38L 165-35 disable time !dis 15 ns (max) TMP38L 165-35 access time from address ta(A} 35 ns (max)t TMP38L 165-35 access time from chip enable ta(S) 20 ns (max) 74ALS04 inverter rise time IPLH 11 ns (max) Total address access time = la(A} - lsu(A) ta(A-SL) 22 ns (max)t Total enable access time = tajfil + lpLw lsl!.l& lfil_E-SIJ_ 18ns(max)t t Because la(E-SL) < la(A-SL)• the specification ta(A) dominates performance. Ali timing compari- sons are made from strobe low. The second design example illustrates the interface of PROMs to the TMS320C25 using address decoding. An approach that can be used to meet the READY timing requirements is shown in Figure 6-7. This design utilizes one address decoding scheme to generate READY, and a second address de- coding scheme to enable the different memory banks. In this design, the me- mories with no wait states are mapped at the upper half (upper 321<) of the pro- gram space. The lower half is used for memories with one or more wait states. This decoding is implemented with the 74AS20 four-input NAND gate. 6-15 Address decoding is implemented by the 74AS138. This decoding separates the program space into eight segments of SK words each. The first four of these segments (lower 32K of address space) are enabled by the YO, Yf, Y2, and ?3 outputs of the 74AS138. These segments are used for memories with one or more wait states. The other four segments select memories with no wait states (the TBP38L 165s are mapped in segment 5, starting at address 8000h). Note that in Figure 6-7, R/W is used to enable the 74AS138. This prevents a bus conflict from occurring if an attempt is made to write to the PROMs. Figure 6-8 shows the timing for the circuit shown in Figure 6-7. READY goes high 1O ns (worst case) after the address has become valid. 6-16 Hardware Applications Figure 6-7. Interface of TBP38L 165-35 to TMS320C25 TMS320C25 TBP38L 165-35 9 DO AO AO 00 10 D1 A1 A1 01 11 D2 A2 A2 02 13 D3 A3 A3 03 14 D4 A4 A4 04 15 D5 A5 A5 05 16 D6 A6 A6 06 17 D7 A7 A7 07 A8 A8 A9 A9 21 A10 74AS138 A10 1 ID G2 G3 A13 A 5 2 G2B" 20 18 19 A14 B L10 3 A15 J10 4 c "::" pg G2A 11 H11 6 Y4 R/W G1 1 kQ +5V +5V K10 1 kQ OS J11 TS B8 READY H10 STAB 74AS04 MEMSTRB 20 18 19 DO D1 ID 8 AO G2 G3 9 D8 00 D2 7 A1 10 D9 01 11 D10 D3 02 A2 D4 13 D11 A3 03 D5 14 D12 A4 04 D6 15 D13 A5 05 D7 16 D14 A6 06 D8 17 D15 A7 07 D9 A8 D10 A9 D11 A10 D12 D13 TBP38L165-35 D14 D15 6-17 Figure 6-8. Interface Timing of TBP38L 165-35 to TMS320C25 (Address Decoding) CLKOUT1 \ I \__ CLKOUT2 '• ta(SL) .., \{ I I A 1 tsu(A) t1 I I I ,.. ~· .. I I MEMSTRB I /[ r--- I I \ ; I ta(S) _..,j I I I I I -+I 11 ~ ~ PS, ITS, TS;" A15--AO :Vslld ~ : --i t2 I I MEMSEL __, I I '{ ta 14- I I I I I I r I I READY I I /iI I I .., I --.! 14- tdis \ . 1.. t4 I 015-DO ( Data In i The most critical timing parameters of the TBP38L 165-35 interface with ad- dress decoding to the TMS320C25 are summarized in Table 6-2. 6-18 Hardware Applications Table 6-2. Timing Parameters of TBP38L 165-35 to TMS320C25 (Address Decoding) Description Symbol Used In Value Figure 6-8 Propagation delay through the 74AS04 t1 5 ns (max) Propagation delay through the 74AS138 t2 10 ns (max) Address valid to READY t3 10 ns (max) TBP38L 165-35 disable time tdis 15 ns (max) TBP38L 165-35 address access time t4 35 ns (max) TBPL 165-35 enable access time la(~ 20 ns (max) Data latch setup time after strobe low t'!i..SIJ. 27 ns (max) 6.2.2 Wait-State Generator The READY input of the TMS320C2x allows it to interface with memory and peripherals that cannot be accessed in a single cycle. The number of cycles in a memory or 1/0 access is determined by the state of the READY input. If READY is high when the TMS320C2x samples the READY input, the memory access ends at the next falling edge of CLKOUT1 . If READY is low, the memory cycle is extended by one machine cycle, and all other signals remain valid. Figure 6-9 shows a one-wait-state memory access. Note that for on- chip program and data memory accesses, the READY input is ignored. Refer to Hardware Interfacing to the TMS320C25for detailed information regarding wait-state generation. You can automatically generate one wait state by using the microstate com- plete "{MSC) signal. The lVfSC output is asserted low during CLKOUT1 low to indicate the beginning of an internal or external memory or 1/0 operation (see Figure 6-9). By gating lVfSC with the address and PS, ITS, and/or TS, you can generate a one-wait state READY signal. Note that lVfSC is a valid signal only when CLKOUT1 is low; see page A-44. A wait-state generator is an alternative approach for generating wait states when interfacing with memories and peripherals. In this design, READY must be valid (low or high) no later than Q-20 ns = 5 ns after STRB goes low. If READY is high, then the memory/peripheral access is completed with the present machine cycle. If READY is low, the access is extended to the next machine cycle; that is, a wait state is introduced. The number of wait states required depends on the access time ta of the particular memory device or pe- ripheral. If ta< 40 ns, no wait states are required. If 40 ns ~..:::i:::..~~~~~=' ::::::'"":::~,~~ Figure 6-13. Interface Timing of WS57C65F-12 to TMS320C25 CLKOUT1 \ ._ _ _ _ _/ \ ___! \_ CLKOUT2 --- / \ ___! \ ____ -+I i+- t2 OTSTR - - - ' i___________f 7i~~ ~ , - :!\ j4- t1 - - - - - Valid - - - - - MEMSEL~-~11 -\i~I------------------.---~ I READY : / : \ ~-~1------- I ~.~~ - - - - - - t3 - - - - - - +-- t4 ~ 01s-oo~~~~~---------~-c(:=======v=al=id=======~ Table 6-4 summarizes the most critical timing parameters of the WS57C64F-12 interface to the TMS320C25. Table 6-4. Timing Parameters of WS57C64F-12 Interface to TMS320C25 Description Symbol Used in Value Figure 6-13 Address valid to MEMSEL low t1 10 ns (max) STRB low to OTSTR low) t2 5.8 ns (max) TMS320C25 address valid to WS57C64F-12 data t3 130 ns (max) valid STRB high to WS57C64F-12 output disable t4 40.8 ns (max) An EPROM interface with two wait states is shown in Figure 6-14, in which the TMS27C64-20 is interfaced to the TMS320C25. The TMS27C64-20 is a CMOS BK x 8-bit EPROM with an access time of 200 ns. The timing diagram is shown in Figure 6-15. 6-24 Hardware Applications Interfacing Memories Figure 6-14. Interface of TMS27C64-20 to TMS320C25 TMS320C25 TMS27CS4-20 74ALS244A .-r AO~ ~ AO a1 11 2 1A1 1Y1 1S DO A1 I~ -1 ~ A1 12 4 1S D1'- a2 1A2 1Y2 D2'1 A2~ ~ A2 a3 13 s 1A3 1Y~ 14 15 s 12 A3~ ~ A3 a4 1A4 1Y D3 A4~ ~ A4 a5 1S 11 2A1 2Y1 9 D4 D5"I 17 13 7 A5~ ~ A5 as 2A2 2Y~ DS"j AS~ ~ AS a1 1S 15 2A3 2v., 5 D7"I 19 17 3 A7~ ~ A8 A7 as 2A4 2v.. "j AS~ A9~ A10~ A11~ ~ ~ A9 ~ A10 ~ ~ A11 27 1 kQ ff m 2G 1 19 A12~ A13 K9 1 A 2 B 74AS138 l'----=1 A12 E 20 G rt A14 L10 14 fVlEfVlSE[ 3 c YO A~J10 -~ R/W H10 H11 4 G2AG2Sh S G1 -=- 74AS32 cf'-DTSTR 'STRB F1 __/ ~ DO D1 tE2\ 20 1 19 D2 tE1'- Wait-State E m 2G 1S D3 tD2' Generator ~ AO a1 11 2 1A1 1Y1 DS D4 ~ ~ A1 a2 12 4 1A2 1Y... 1S D9 "I D5 tc2' (Two Wait ~ A2 a3 13 6 1A3 1v., 14 D10 "j DS tC1' States) f'-f. A3 a4 15 s 1A4 1Y 12 D11 "I ~ ~ A4 a5 16 11 2A1 2Y1 9 D12 'I D7 DS tA2' ~ A5 as 17 13 2A2 2Y2 7 D13"1 D14 "j D9 tB3" ~ AS a7 1S 15 2A3 2Y3 5 ~ D15 "I ~ AB 19 17 3 DH~ A7 as 2A4 2Y ~ 'I ..,_, Ll:Wl. _......_ D1~ D13 D11 ~ i-:-;....;.-... 85 tA5' D1.dii-;....:.::.... 74AS3o-Q ~ A9 ~ A10 PGM 1 kQ ~ A11 ~ 27 ff 74ALS244A D1S~ READ" BS \.. ~ A12 G TMS27CS4-20 rt ./ 6-25 Figure 6-15. Interface Timing of TMS27C64-20 to TMS320C25 CLKOUT1 \_I \ _ I \...._____,/ \__ CLKOUT2 --...JI \ __I \_I \ ___ --.I I+- t2 DTSTR ----'{_I- - - - - - - - - t - - J / PS,R/W,~ ~ A15-AO ~ ~ ------------ ~ t1 Valid MEMSEL ----.:.....~ I I I Table 6-5 summarizes the most critical timing parameters of the TMS27C64-20 interface to the TMS320C25. Table 6-5. Timing Parameters of TMS27C64-20 Interface to TMS320C25 Description Symbol Used In Value Figure 6-15 Address valid to MEMSEL low t1 10 ns (max) 'STRB low to DTSTR low t2 5.8 ns (max) TMS320C25 address valid to TMS27C64-20 data t3 220 ns (max) valid 'STRB high to TMS27C64-20 output disable t4 18.8 ns (max) For detailed information regarding EPROM interfacing, see the application re- port, Hardware Interfacing to the TMS320C25 (literature number SPRA014A). 6.2.4 Interfacing Static RAMs Interfacing external RAM to the TMS320C2x can be useful for expanding inter- nal data memory or implementing additional RAM program memory. Static RAM can be used as data memory to extend the TMS320C2x 544-word inter- nal RAM. When used as program memory, object code can be downloaded into the RAM and executed. In the first case, the static RAM is mapped into the data space, while in the second case it is mapped into the program space. 6-26 Hardware Applications Interfacing Memories In cases where RAMs of different speeds are used, separate schemes for ad- dress decoding and READY generation can be used to meet READY timing requirements in a manner similar to that used for the PROM interface de- scribed in subsection 6.2.1. RAMs with similar access times may then be grouped together in one segment of memory. The static RAM for this interface is the Cypress Semiconductor CY7C169-25 4K x 4-bit static RAM. This RAM has a 25-ns access time from address ta(A) and a 15-ns access time from chip enable ta(CE)· Note that these access times are fast enough so that a wait-state generator is not required for this interface. If, however, RAMs that require wait states are used in the system, the wait- state generator described in subsection 6.2.2 can be used. The design shown in Figure 6-16 utilizes an approach similar to the one de- scribed in subsections 6.2.1 and 6.2.3; that is, one address decoding scheme is used to generate READY, and a second address decoding scheme enables the static RAM. In this design, RAMs with no wait states are mapped atthe low- er half (lower 32K words) of the TMS320C25 data space. The upper half is used for memories with one or more wait states. Figure 6-17 shows the timing for memory read and write cycles. Table 6-6 summarizes the most critical timing parameters of the CY7C169-25 interface to the TMS320C25. Table 6-6. Timing Parameters of CY7C169-25 Interface to TMS320C25 Description Symbol Used In Value Figure 6-17 Address valid to READY valid t1 10.8 ns (max) STRB low to llllEl\llSE[ low t2 8.5 ns (max) STRB high to llllEl\llSEC high ts 7.5 ns (max) CLKOUT1 low to TMS320C25 data bus entering the 4 15 ns (max) high-impedance state l\llEllllSE[ low to CY7C 169-25 driving the data bus ts 5 ns (min) llllEl\llSE[ low to CY7C169-25 data valid ta 15 ns (max) llllEl\llSEC high to CY7C169-25 entering the high-im- t1 15 ns (max) pedance state Data setup time for a write ta 32 ns (min) Data hold time t9 7.5 ns (min) 6-27 Interfacing Memories ~;:::;..zr<:X:::::'®:x:'®'<'-X:W!~.:X:::W.a::.<::-.:X:::::::::::'.xm.."Z!:::::t::'.::X:!.~~~~~-~-K-------:l:!:~~~.(~~.W- ... - •. " " " " " . , . , _ Figure 6-16. Interface of CY7C169-25 to TMS320C25 TMS320C25 CY7C169-25 AO ~ A1 I~ / " A2 ~ A3 ~ A4 ~ A5 A6 ~ ~ A7 ~ AS ~ A9 ~ 15 DO A10 ~ 1/01 A11 ~ ~ 1/02 14 01 READr BS Ji 1/03 13 12 D2'j 03 74A~ 1/04 "I ITS K10 - r74AS~ i'-AO 16 AO 1/01 1/02 I----' 15 14 13 04 05"1 06 L10 3 74AS13S i'-A1 17 A1 1/03 12 D7'j A15 A VT 14 "-A2 1S 1/04 K9 2 B A2 t----' A14 1'.A3 19 A13 L9 1 +5Vc l'--A4 1 A3 15 DS 4 A4 1/01 H10 ~mA l j 1 kQ 1'.A5 2 A5 14 D9'j STRB H11 1/02 G2B G1 6 l'--A6 3 A6 1/03 13 010 R/W A7 4 12 D11'j A7 ~ f',.AS 5 1/04 DO AS 1--- E2 A9 6 01 02 ~ l'--A10 7 A9 15 012 03 ~ MEMS EL A11 s A10 1/01 14 013'i 04 ~ 9 A11 1/02 13 014"1 ~ 11 EIS 1/03 12 015 05 ~ w 1/04 'j 06 07 ~ DS ~ ~ 09 010 ~ 011 ~ ~ 012 013 ~ ~ 014 015 ~ '"" 6-28 Hardware Applications Interfacing Memories Figure 6-17. Interface Timing of CY7C169-25 to TMS320C25 CLKOUT1 ~ I \ I DS, Valid A15-AO I l+t1 ~ READY I I I \__ I STAB I I \I IiI R/W I/Ill I I -+I t2 ...... I I -+I ~ ~ '@§2?8 ' MEMSEL I 1+-4-+j ~ I IiI Read I I Cycle TMS320C25 ) 015-DO -+I !;: te --i .....I ~t7 CY7C169-25 015-DO 15 mI+- I ) R/W ~ ~ MEMSEL \ A t9 =:ij4- Write 1.. ta Cycle ')mw- TMS320C25 015-00 CY7C169-25 1/04-1/01 ::::::> ™ 6.2.5 Interface Timing Analysis When interpreting TMS320C25 timing specifications, particularly in the area of memory interface timing, it is necessary to understand clock input and clock timing relationships shown in timing diagrams as compared with the actual data sheet specifications. If interpreted incorrectly, the specifications may sug- gest that interfacing to the device is more constrained than necessary. Without exception, the TMS320C25 meets every specification given in the data sheet (Appendix A}. Some timings are specified more conservatively than others, due to yield distributions, etc.; but each TMS320C25 is guaranteed by Texas Instruments to conform explicitly with the minimum values as stated in the tables and shown in the timing diagrams of the data sheet. 6-29 Interfacing Memories Clock input and internal clock timing relationships must be considered in the interpretation of output timing characteristics and requirements. At the clock input to the device, only the rising edges of the clock are used to initiate transi- tions on internal clocks and output signals. Thus, with an input clock of a stable frequency (regardless of duty cycle variation within specifications), extremely symmetric timing is exhibited throughout the device. A significant conse- quence of this is that CLKOUT1 , CLKOUT2, and STRB timing skew with re- spect to each other, and high and low pulse widths are integer multiples of Q (the input clock period or one-fourth of the output clock period) to within a few nanoseconds. This occurs because transitions on the output signals are initi- ated directly from the internal clocks (Q1-Q4) and driven through identical out- put buffer circuits. Since the internal clocks are very symmetric, close tracking of these outputs results. The large skews in these timings, as shown in the data sheet, are a factor of temperature and process. Because there is no variation in process and negligible variation in temperature across a single device, the skew of the outputs relative to the inputs is consistent for all outputs. Regard- less of the magnitude of such skews, interfaces to the TMS320C25 can be de- signed independently of these skews in most cases. This section discusses three interface timings: READY, memory read, and MSC. For READY, there are two pairs of related timings; one timing can be met without the other one being met, and the device still guaranteed to function properly. These pairs of timings are td{SL-R) and td{C2H-R)• and th{SL-R) and th{C2H-R)· These front-end and back-end READY timings are specified with re- spect to STRB and CLKOUT2. For zero wait-state accesses, READY is refer- enced to STRB, but for wait-state accesses, STRB remains low and another timing reference is required. Note that the actual timings for each of these pa- rameter pairs are identical, and the timings with respect to CLKOUT2 and STRB'are equivalent. Therefore, if READY timing meets the requirements with respect to one of these references (but not necessarily the other), the timing requirements of the device are satisfied regardless of the actual skews be- tween the two signals. For the purpose of interface timing, td{c2-s) can be as- sumed to be Ons with respect to other signals on the TMS320C25. The same is also true of td{c 1-S) and tw{SL); these timings can be assumed to be Q and 20, respectively. These relationships are accounted for in specifications and device testing. In memory read operations, the two key timings, ta{A) and tsu{D)R• are related by ta{A) =tsu{A) + tw(SL) -tsu(D)R· However, when the worst case tw(SL) specifica- tions are used in this equation to generate an expression for ta(A}• the result differs from the specification for ta(A) in the data sheet. Both the specification for ta(A) and tsu(D)R are tested explicitly on the device and guaranteed. This again justifies the assumption of tw(SL) to be 20 with respect to other signals on the device. This is confirmed by the fact that if tw(SL) =20 is used to calcu- 6-30 Hardware Applications late ta(A)· consistency results in all of these related timings. If an interface is designed where tsu(D)R is met but ta(A) is not met because of actual signal skews, the interface is still guaranteed to function with the TMS320C25. The same is true (but is not as likely) if an interface is designed where ta(A) is met but tsu(D)R is not. Thus, even if tw(SL) is actually less than 20, meeting either ta(A) or tsu(D)R is still sufficent to guarantee a valid memory cycle because both parameters are guaranteed independently. Note that when considered in the absolute sense, timings such as tw(SL) will have some finite tolerance, although considerably less than that specified. For example, if STRS is used to generate a WE pulse for a device that specifies a minimum WE low pulse width, the data sheet specification for STRS low pulse width must be used for a worst-case design. When you design a multiwait-state generator and use the CLKOUT1 and CLKOUT2 signals for sequencing a state machine, specifications td(C2H-R) and th(C2H-R) must be met. Note that these signals are measured from CLKOUT2. If you design a single wait state, you can logically combine MSC with the address and memory strobes to generate READY. In the latter, the pa- rameters td(M-R) and th(M-R) must be met. In either case, both sets of param- eters are tested and guaranteed. Note thattd(MSC) is also a parameter. As such, td(MSC) is given to locate MSC with respect to CLKOUT1 and CLKOUT2 for a multiwait-state design. In this case, it would be inappropriate to relate the READY timing requirements from the CLKOUT1 signal when considering a single wait state generated directly from MSC. 6-31 Direct Memory Access (OMA) 6.3 Direct Memory Access (OMA) Some advanced hardware design concepts supported by the TMS320C2x in- clude direct memory access (OMA) and global memory (see Section 6.4). Di- rect memory access can be used for multiprocessing by temporarily halting the execution of one or more processors to allow another processor to read from or write to the halted processor's local off-chip memory. Direct memory access to external program/data memory is performed by using the HOCO and HOL- DA signals. Multiprocessing is typically a master-slave configuration where the master may initialize a slave by downloading a program into its program memory space and/or by providing the slave with the necessary data to complete a task. In a typical TMS320C2x direct memory access scheme, the master may be a general-purpose CPU, another TMS320C2x, or perhaps even an analog- to-digital converter. A simple TMS320C2x master-slave configuration is shown in Figure 6-18. The master TMS320C2x takes complete control of the slave's external memory by asserting ROID low via its external flag (XF). This causes the slave to place its address, data, and control lines in a high-imped- ance state. By asserting RS in conjunction with ROIO, the master processor can load the slave's local program memory with the necessary initialization code on reset or powerup. The two processors can be synchronized by using the SYf\IC pin to make the transfer over the memory bus faster and more effi- cient. After control of the slave's buses is given up to the master processor, the slave alerts the master to this fact by asserting HOLDA This signal may be tied to the master TMS320C2x's BlO pin. The slave's XF pin may be used to indicate to the master when it has finished performing its task and needs to be repro- grammed or requires additional data to continue processing. In a multiple slave configuration, priority of each slave's task may be determined by tying the slave's XF signals to the appropriate TITT(2-0) pin on the master TMS320C2x. 6-32 Hardware Applications Direct Memory Access (OMA) Figure 6-19. Direct Memory Access in a PC Environment Master CPU Address B Local Address Address u Program/Data F Data Memory F (RAM) E R Address Data Disk Controller Address Decode/ Arbitration FrOm Address Logic Data Ready ROCOA Local Address Program/Data Data Memory (RAM) 6-34 Hardware Applications 6.4 Global Memory For multiprocessing applications, the external memory of the TMS320C2x can be divided into local and global sections. Special registers and pins included on the TMS320C2x allow multiple processors to share up to 32K words of glob- al data memory space. This implementation facilitates efficient shared data multiprocessing in which data is transferred between two or more processors. Unlike a direct memory access (OMA) scheme, reading or writing global memory does not require one of the processors to be halted. Global memory can be used in various digital signal processing tasks such as filters or modems, where the algorithm being implemented may be divided into sections with a distinct processor dedicated to each section. In this multipro- cessor scheme, the first and second processors may share global data memory, as well as the second and third, the third and fourth, etc. Arbitration logic is required to determine which section of the algorithm is executing and which processor has access to the global memory. With multiple processors dedicated to distinct sections of the algorithm, throughput may be increased via pipelined execution. By loading the global register (GREG), you can program the size of the global memory between 256 and 32K locations in data memory. After global memory is defined in the GREG, the TMS320C2x asserts the BR (bus request) signal before each global memory access. The BR signal stays low on back-to-back cycles in the TMS320C25. The processor then inserts wait states until a bus grant is given by asserting the READY line. Figure 6-20 illustrates such a glob- al memory interface. Because the processors can be synchronized by using the SVflC pin, the arbitration logic can be simplified, and the address and data bus transfers can be more efficient (see subsection 3.10.1 for information on synchronization). The SVflC pin on the TMS320C2x may also be used to synchronize several processors to allow for execution of redundant fail-safe systems. SVflC per- mits instruction broadcasting between several processors and lock-step execution after initial synchronization. 6-35 Global Memory Figure ~20. Global Memory Communication TMS320C2x TMS320C2x BR 1--------- Arbitration--------t BR READY Logic READY B B u u A15-AO F Global F A15-AO F Data F E Memory E D15-DO R R D15-DO s s SYNC SYNC Sync Program Generation Clock Program Memory Logic Memory 6-36 Hardware Applications Interfacing Peripherals 6.5 Interfacing Peripherals Most DSP systems implement some amount of 1/0 by using peripherals in addition to any memory included in the system. This usually includes analog input and output, which can be performed through the parallel and serial 1/0 ports on the TMS320C2x. When you access the external parallel 1/0 ports, the access to the data bus is multiplexed over the same pins as for a program/data memory access. The 1/0 space is selected by the TS signal going active low, and the address of the port is placed on address bits A3-AO. Address bits A15-A4 are held low. This section describes hardware interfaces to a TCM29C16 combo-codec, a TLC32040 analog interface circuit (AIC), a digital-to-analog (D/A) converter, and an analog-to-digital (AID). 6.5.1 Combo-Codec Interface Some areas of speech, telecommunications, and many other applications re- quire low-cost analog-to-digital (AID) and digital-to-analog (D/A) converters. Combo-codecs are most effective in serving DSP system data-conversion re- quirements. Combo-codecs are single-chip pulse-code-modulated encoders and decoders (PCM codecs), designed to perform the encoding (AID conver- sion) and decoding (D/A conversion), as well as the antialiasing and smooth- ing filtering functions. Since combo-codecs perform these functions in a single 300-mil DIP package at low cost, they are extremely economical for providing system data-conversion functions. Combo-codecs interface directly to the TMS320C2x by means of the serial port and provide a companded, PCM-coded digital representation of analog input samples. This PCM code is easily translated into linear form by the TMS320C2x for use in processing. The design discussed here and shown in Figure 6-21 uses a Texas Instruments TCM29C16 codec, interfaced through using the serial port of the TMS320C25. The TMS320C2x serial port provides direct synchronous communication with serial devices. The interface signals are compatible with codecs and other se- rial components so that minimal external hardware is required. Externally, the serial port interface is implemented via the following pins on the TMS320C25: O DX (transmitted serial data) O CLKX (transmit clock) O FSX (transmit framing synchronization signal) O DR (received serial data) O CLKR (receive clock) O FSR (receive framing synchronization signal) 6-37 Interfacing Peripherals Data on DX and DR are clocked by CLKX and CLKR, respectively. These clocks are required only during serial transfers on the TMS320C25. Note that the TMS320C25 is double-buffered. Figure 6-21. Interface of TMS320C25 to TCM29C16 Codec +5V 0.05 µF TMS320C25 4 Vee PON l - ' - - - -11 PCMOUT """ GSX t - . . , - - - - - - -6 1 PCMIN PWRD+ 1--2----.---<> DCLKR Analog MCLK 9 CLKR/X Vss Output FSX FSR AGND DGND 10 7 13 8 FP 74HC390 74AS869 3 14 ;1CKA1Q CLK RCO 1 10 2 D 1QD 2 so H 9 4 1CKB 81 G 11 8 +5 V CLKIN 1--F-1-1 ---4~-t> 3 CLKQ 5 EITT F 1CLR 23 7 RS ENP E CCR A B c D R1= AB 1 MQ +5V 3 +5V T'~,,-µF rf ~ = Analog Ground 74HC04 10kQ Tc 10.1 µF 47pFJ l C=20 pF l L=1.8 µH l = Digital Ground 74AS04 - - Serial port transfers are initiated by framing pulses on the FSX and FSA pins for transmit and receive operations, respectively. For transmit operations, the FSX pin can be configured as an input or an output. This option is selected by the transmit mode {TXM) bit of status register ST1. In this design, FSX is as- sumed to be configured as an input; therefore, transmit operations are initiated by a framing pulse on the FSX pin. Upon completion of receive and transmit operations, an RINT (serial port receive interrupt) and an XINT (serial port transmit interrupt) are generated, respectively. Interface timing of the TMS320C25 to the TCM29C16 corresponds to the burst-mode serial port transmit and receive operations shown in Figure 3-37 and Figure 3-38, re- spectively. Continuous-mode operation with or without framing pulses is also possible. 6-38 Hardware Applications Interfacing Peripherals The format (FO} bit of status register ST1 is used to select the format (8-bit byte or 16-bit word} of the data to be received or transmitted. For interfacing the TMS320C25 to a codec, the format bit should be set to 1, formatting the data in 8-bit bytes. The TMS320C25 interfaces directly to the codec, as shown in Figure 6-21 , with no additional logic required. The PCM µ-law data generated by the codec at the PCM OUT pin is read by the TMS320C25 from the data receive (DR} pin, which is internally connected to the receive serial register (RSR}. The data transmitted from the data transmit (DX} pin of the TMS320C25 is received by the PCMIN input of the codec. During the digital-to-analog conversion, this µ-law companded data must be converted back to a linear representation for use in the TMS320C25. The resulting analog waveform is lowpass-filtered by the codec's internal smoothing filter. Therefore, no additional filtering is re- quired at the codec output (PWRO+}. Software companding routines appropri- ate for use on the TMS320C25 are provided in the book, Digital Signal Proces- sing Applications with the TMS320 Family (literature number SPRA012A}. The software required to initialize the TMS320C25-codec interface is provided in the combo-codec interface section of the application report, Hardware Inter- facing to the TMS320C25 (literature number SPRA014A}. This report also presents detailed information regarding codec interfacing. A combo-codec configured in the fixed-data-rate mode requires the following external clock signals: O A 2.048-MHz clock to be used as the master clock, and O 8-kHz framing pulses to initialize the data transfers. Both of these signals can be derived from the 40.96-MHz system clock with appropriate divider circuitry. This is the primary justification for selecting 40.96 MHz as the system clock frequency. The clock divider circuit consists of a 74AS74 D-type flip-flop, a 74HC390 decade counter, and a 74AS869 8-bit up/ down counter. The hardware connections between these devices are shown in Figure 6-21. To generate the 2.048-MHz master clock for the combo-codec, a division by 20 of the 40.96-MHz system clock is required. The 74HC390 contains on-chip two divide-by-2 and two divide-by-5 counters. Because the 74HC390 cannot be clocked with frequencies above approximately 27 MHz, a 74AS74 config- ured as a divide-by-2 of the 40.96-MHz clock is used. The 74AS869 is configured to generate the 8-kHz clock pulse (the ripple carry output is 2.048 MHz/256 =8 kHz}. This pulse is used by the TMS320C25 and codec as a framing pulse to initiate data transfers. 6-39 Interfacing Peripherals The level of the analog input signal is controlled by using the TL072 opamp connected in the inverting configuration (see Figure 6-21). Using the 500-kQ potentiometer, the gain of this circuit can be varied from 0 to 5. The output of the 0.01-µF coupling capacitor drives the TCM29C16's internal opamp. This opamp is connected in the inverting configuration with unity gain (feedback and input impedances having the same value of 100 kQ). 6.5.2 AIC Interface For applications such as modems, speech, control, instrumentation, and ana- log interface for DSPs, a complete analog-to-digital (ND) and digital-to-analog (DIA) input/output system on a single chip may be desired. The TLC32040 analog interface circuit (AIC) integrates on a single monolithic CMOS chip a bandpass, switched-capacitor, antialiasing-input filter, 14-bit resolution ND and D/A converters, and a lowpass, switched-capacitor, output-reconstruction filter. The TLC32040 offers numerous combinations of master clock input fre- quencies and conversion/sampling rates, which can be changed via digital processor control. Four serial port modes on the TLC32040 allow direct interface to TMS320C2x processors. When the transmit and receive sections of the AIC are operating synchronously, it can interface to two SN54299 or SN74299 serial-to-parallel shift registers. These shift registers can then interface in parallel to the TMS320C2x, to other TMS320 digital signal processors, or to external FIFO circuitry. Output data pulses are emitted to inform the processor that data transmission is complete or to allow the DSP to differentiate between two transmitted bytes. A flexible control scheme is provided so that the functions of the AIC can be selected and adjusted coincidentally with signal processing via software control. Refer to the TLC32040 data sheet for detailed information on timing and device functions. The AIC is easily interfaced to the TMS320C2x serial ports, as shown in Figure 6-22. The TMS320C2x can communicate with the AIC either synchro- nously or asynchronously, depending on the information in the control register. The operating sequence for synchronous communication with the TMS320C2x, shown in Figure 6-23, is as follows: 1) The FSX or FSR pin is brought low. 2) One 16-bit word is transmitted, or one 16-bit word is received. 3) The FSX or""""FSR pin is brought high. 4) The EOOX or EOOR pin emits a low-going pulse. 6-40 Hardware Applications Interfacing Peripherals For asynchronous communication, the operating sequence is similar, but FSX and FSR do not occur at the same time (see Figure 6-24). For proper opera- tion, the TXM bit in the TMS320C2x control register should be set to o so that the FSX pin of the TMS320C2x is configured as an input, the format (FO) sta- tus bit is set to 0, and the AIC WORD/B'YTE pin is at logic high. After each re- ceive and transmit operation, the TMS320C2x asserts an internal receive (RINT) and transmit (XINT) interrupt, which may be used to control program execution. Figure 6-22. Interface of TLC32040 to TMS320C2x TMS320C2x TLC32040 CLKOUT ~ MSTRCLK FSX 14- FSX DX ... DX FSR 14- FSR DR .... r DR CLKX ..... Shift CLK r CLKR 14- J Figure 6-23. Synchronous Timing of TLC32040 to TMS320C2x SHIFTCLK DR D15 ~~~~~D_1____Do__________~ 6-41 Interfacing Peripherals Figure 6-24. Asynchronous Timing of TLC32040 to TMS320C2x FSX LJ LJ For further information regarding the AIC interface, see page 11-196 of Linear and Interface Circuits Applications, Volume 3: Peripheral Drivers, Data Ac- quisition Systems, Hall-Effect Devices (literature number SLYA003), pub- lished by Texas Instruments. 6.5.3 Digital-to-Analog (D/A) Interface The high-speed operation of the internal logic circuitry of the TLC7524 8-bit digital-to-analog (DIA) converter allows an interface to the TMS320C2x with a minimum of external circuitry. Figure 6-25 shows the interface circuitry, which consists of one SN74ALS138 3-to-8-line decoder used to decode the address of the peripheral. Figure 6-25. Interface of TLC7524 to TMS320C2x TMS320C2x A15-AO 74ALS138 AO A - V D Vo - - ret255 A1 B Where D = Digital Input A2 c A3 G2B TLC7524 Vref TS G2A +5V G1 YO cs REF AFB WR D0-07 OUT1 OUT2 + Vo ':' 6-42 Hardware Applications Interfacing Peripherals Figure 6-27. Interface of TLCOB20 to TMS320C2x A15-AO 74ALS138 A B TLC0820 c +5 V Mode "G2B TS Y1 "G2A YO +5V G1 To TMS320C2x------1 INT R/W ,------.....--D-+----t--____,r------------1RO" D Q 0 DO CLR D1 D2 D3 CLKOUT1..__-------+-------+----' D4 D5 D6 READY..__--------------------' D7 D15-DO The 74LS138 decodes the addresses assigned to the TLC0820. One of the addresses is used for a write operation; the other is used for a read operation. The two different addresses are necessary to ensure that the correct number of wait states is provided for the write and read operations. The controlling soft- ware for the ND interface is given on page 11-206 of Linear and Interface Cir- cuits Applications, Volume 3: Peripheral Drivers, Data Acquisition Systems, Hall-Effect Devices (literature number SLYA003), published by Texas Instru- ments. 6-44 Hardware Applications Interfacing Peripherals 6.5.5 1/0 Ports 1/0 design on the TMS320C2x is treated the same way as memory. The 1/0 address space is distinguished from the local program/data memory space by the TS signal. TS goes low at the beginning of the memory cycle. All other con- trol signals and timing parameters are the same as those for the program/data external memory interface. The TMS320C2x software instructions can access 16 input and 16 output ports. The four least significant bits of the address bus specify the particular port being accessed. A pair of 74AS138s can be used to fully decode these address bits (see Figure 6-29). Figure 6-29. 1/0 Port Addressing 74AS138 A3 G1 Y7 p 170PORT15 -0 G2A Y6 p 170PORT14 -0 G2B Y5 p 170PORT13 J Y4 h. r-' 170PORT12 k Y3 I" 170PORT11 A2 c Y2 k r-' 170 PORT 1o A1 B h. Y1 r-' 170 PORT 9 AO A YO p 170 PORTS TMS320C2x +5 V 74AS138 Signals t G1 Y7 p 170 PORT? TS -0 G2A Y6 p 170 PORT6 A3 _r- ~ G2B Y5 p 170 PORT 5 Y4 p 170 PORT4 Y3 p 170 PORT3 A2 c Y2 p 170 PORT2 A1 B Y1 p 170PORT1 AO A YO p 170 PORTO A simple interface between two processors can be implemented by using up to 16 bidirectional 1/0 ports connected to the TMS320C2x. An interprocessor communication path can be formed by memory-mapping peripherals to the 1/0 ports of the TMS320C2x. In this manner, the TMS320C2x can connect to par- allel NDs, registers, FIFOs, two-port memories, or other peripheral devices. In a multiprocessing scheme, intelligent peripherals can be memory-mapped into the 1/0 ports. Here the TMS320C2x can communicate with UARTs, gener- al-purpose microprocessors, disk controllers, video controllers, or other pe- ripheral processors. 6-46 Hardware Applications Interfacing Peripherals Using an 8-bit general-purpose microprocessor, such as Tl's TMS70C42, for a keyboard interface is an example of a TMS320C2x 1/0-port multiprocessing scheme, as shown in Figure 6-30. The TMS70C42 may be mapped into the TMS320C2x 1/0 space by using latches to store the transferred data. In a single or multiple 1/0-port multiprocessing configuration, the four LSBs of the address bus are decoded to determine which of the 16 1/0 ports on the TMS320C2x is being accessed. The TMS320C2x selects the 1/0 space (TS) for its external bus and reads/writes data using the IN/OUT instructions. Processor-controlled signals between the TMS320C2x and the peripheral de- vice indicate when data is available to be read. This interprocessor commu- nication is facilitated by using the input and output pins of the TMS70C42 (or other peripheral processor). In an 1/0 multiprocessing configuration, the 1/0 port address space is limited, and data transfers are relatively slow compared to a direct memory access or global memory configuration. Figure 6-30. 1/0 Port Processor-to-Processor Communication TMS320C2x PA3-PAO TS .. ..... Decode Logic .. TMS70C42 _.: Control Pins J .. L A .. T D15-DO 14' c H If- .. Data ... ~ L A ~ -*- T Program Memory .. c H 6-47 System Applications 6.6 System Applications The TMS320C2x is used in a wide variety of systems. Several applications in the areas of telecommunications, graphics and image processing, high-speed control, instrumentation, and numeric processing are described in the follow- ing paragraphs to illustrate basic approaches to system design with the TMS320C2x. 6.6.1 Echo Cancellation Digital signal processing is extensively used in telecommunications applica- tions. In echo cancellation, an adaptive FIR filter performs the modeling rou- tine and signal modifications required to adaptively cancel the echo caused by impedance mismatches in telephone transmission lines. The TMS320C25's large on-chip RAM of 544 words and on-chip ROM of 4K words allow it to execute a 256-tap adaptive filter (32-ms echo cancellation) without external data or program memory. Figure 6--31 shows a common configuration for an echo canceller that uses a TCM29C 16 codec interface. Figure 6-31. Echo Canceler ...._ i.._ I"' .. __., TMS29C16 I"' _.. Line ... Interface CODEC TMS320C25 6.6.2 High-Speed Modem In high-speed modems, a signal processor performs functions such as modu- lation/demodulation, adaptive equalization, and echo cancellation. The TMS320C2x large memory space allows it to support multiple standards such as Bell 103, Bell 212A, V.22 bis, V.29, V.32, and V.33, as well as proprietary algorithms. The modem shown in Figure 6--32 consists of the host interface, controller, DSP, and analog front-end. 6-48 Hardware Applications System Applications ---------,~~~~ Figure 6-32. High-Speed Modem DSP Controller Digital Analog Bus ----... 1/0 DAA/ Host TMS70C42 TLC32040 TMS320C2x Hybrid Interface Controller AIC Phone Lines 6.6.3 Voice Coding Voice coding techniques, such as full-duplex 32-kbps adaptive differential pulse-code modulation (CCITI G.721), 16-kbps sub-band coding, and linear predictive coding, are frequently used in voice transmission and storage. The speed of the TMS320C2x in performing arithmetic computations, normaliza- tion, and bit manipulation enables it to implementthese functions usually inter- nally (that is, with no external devices). Figure 6-33 shows a voice coding sys- tem consisting of a TMS320C2x DSP, TCM29C16 codec or TLC32040 AIC, and optional external memory. Figure 6-33. Voice Coding System TCM29C16 TMS320C2x i.._ _.J Codec i._ ..... Analog .... "'I or .... Interface TLC32040 AIC • -*- External Data Memory (Optional) 6-49 System Applications 6.6.4 Graphics and Image Processing In graphics and image processing applications, a signal processor's ability to interface with a host processor is important. The TMS320C2x multiprocessor interface enables it to be used in a variety of host/coprocessor configurations (see Figure 6-34 for an example of a graphics system configuration). Graph- ics and image processing applications can use the large, directly addressable external data memory space and global memory capability to share graphical images in memory with a host processor, thus minimizing data transfers. In- dexed indirect addressing modes on the TMS320C2x allow matrices to be pro- cessed row by row when matrix multiplication is performed for 3-D image rota- tion, translation, and scaling. Figure 6-34. Graphics System Control Display Interface Display H 0 TMS320C2x Address TMS34010 s DSP GSP t TMS34070 Data Color B Palette u s Memory PROM or SAAM (Optional) 6-50 Hardware Applications Applications 6.6.5 High-Speed Control High-speed control applications, such as robotics, use the TMS320C2x gener- al-purpose features for bit manipulation, logical operations, timing synchro- nization, and fast data transfers (10 million 16-bit words per second). In addi- tion to the numeric-intensive control functions typical of robotic applications, the TMS320C2x provides a host interface whereby a robot can communicate to a central host processor (see Figure 6-35). The TMS320C2x is also used in the closed-loop systems of disk drives for signal conditioning, filtering, high- speed computing, and multichannel multiplexing. Figure 6-35. Robot Axis Controller Subsystem Robot Arm i.._ Position System 1/0 I'" Shaft Encoder Manager TMS320C2x Interface Pressure ~ ~ Controller ~ ~ i.- CPU ND-DIA ~Amp} _w ~ Motor J • t Axis -*- l 1 Memory Wait State/ Address ~ To Peripherals Axis PROM orSRAM Decode n (Optional) 6.6.6 Instrumentation and Numeric Processing Instrumentation, such as spectrum analyzers, requires a large data memory space and a processor, such as the TMS320C2x, that is capable of performing long-length FFTs and generating high-precision functions with minimal exter- nal hardware. Figure 6-36 shows an example of an instrumentation system. Numeric processing applications benefit from the high throughput, multipro- cessing, and data memory expansion capabilities of the TMS320C2x. Figure 6-36. Instrumentation System Host CPU 14- ~ Data Memory ~ ~ TMS320C2x 14- .. 1/0 Interface ND-DIA ...._ ro ... Analog Interface 6-51 6-52 Hardware Applications TMS320C25 and TMS320E25 Digital Signal Processors A-2 TMS320C25 and TMS320E25 Digital Signal Processors TMS320C25, TMS320E25 DIGITAL SIGNAL PROCESSORS SPRS010C-MAY 1987-REVISED DECEMBER 1992 • 80-ns Instruction Cycle Time 68-PIN GB PACKAGE (TOPVIEW) • 544 Words of On-Chip Data RAM 1 2 3 4 5 6 7 8 9 10 11 • 4K Words of On-Chip Secure Program r EPROM (TMS320E25) A • • • • • • • • • • 4K Words of On-Chip Program ROM B• @ • • ••••• @ • (TMS320C25) c • • • • D • • • • • 128K Words of Data/Program Space E • • • • • 32-Bit ALU/Accumulator F • • • • • 16 x 16-Bit Multiplier With a 32-Bit Product G • • • • H • • • • • Block Moves for Data/Program J • • • • Management K • @ • • ••••• @ • • Repeat Instructions for Efficient Use of L • • • • • • • • • Program Space • Serial Port for Direct Codec Interface 68-PIN FN AND FZ PACKAGES • Synchronization Input for Synchronous (TOPVIEW) Multiprocessor Configurations 10 >- • Wait States for Communication to Slow C!) O> :;! :: ~ l2 ;! ~ ~1 2 ~I"' ~ ~ 8 8 I§ cccccccc:l!m:i::a:a:oo>> Off-Chip Memories/Peripherals re a 7 6 5 4 3 2 1 8867886584836261 • On-Chip Timer for Control Operations Vs 07 10 11 60 59 IACK MSC • Single 5-V Supply 06 05 12 13 56 57 CLKOUT1 CLKOUT2 04 14 56 XF • Packaging: 68-Pin PGA, PLCC, and 03 15 55 HOLDA CER·QUAD 02 16 54 DX 01 17 53 FSX • 68-to-28 Pin Conversion Adapter Socket for DO SYNC 16 19 52 51 X2 CLKIN X1 EPROM Programming INTO 20 50 BR INT1 21 49 STRB • Commercial and Military Versions Available INT2 22 48 RfiJ Vee 23 47 PS • CMOS Technology: DR 24 46 iS FSR 25 45 OS TMS320C25 ..... . 100-ns Cycle Time AO 26 44 Vss TMS320E25 ..... . 1oo-ns Cycle Time ~U~~~~~~~M~~~~~~~ TMS320C25·50 80-ns Cycle Time ~<~~~~~<8~~:;!~~l'.?;!~ > > < <<<< TMS320C25·33 120-ns Cycle Time description This data sheet provides complete design documentation for the second-generation devices of the TMS320 family. This facilitates the selection of the devices best suited for user applications by providing all specifications and special features for each TMS320 member. This data sheet is divided into four major sections: architecture, electrical specifications, timing diagrams, and mechanical data. In each of these sections, generic information is presented first, followed by specific device information. An index is provided for quick reference to specific information about a device. Copyright© 1992, Texas Instruments Incorporated ThxAs ~ INSrR.UMENTS POST OFFICE BOX 14~ • HOUSTON, TEXAS 77001 A-3 TMS320C25, TMS320E25 DIGITAL SIGNAL PROCESSORS SPRS01OC-MAY1987-REVISED DECEMBER 1992 PGA AND PLCC/CER-QUAD PIN ASSIGNMENTS FUNCTION PIN FUNCTION PIN FUNCTION PIN FUNCTION PIN FUNCTION PIN FUNCTION PIN AO K1/2B A12 KB/40 D2 E1/1B D14 A5/3 INT2 H1/22 Vee H2/23 A1 K2/2B A13 L9/41 D3 D2/15 D15 BB/2 IS J11/4B Vee LB/35 A2 L3/29 A14 K9/42 D4 D1/14 DR J1/24 MP/MC AB/1 Vss B1/10 A3 K3/30 A15 L 10/43 D5 C2/13 DS K10/45 MSC C10/59 Vss K11/44 A4 L4/31 BIO B7/BB DB C1/12 DX E11/54 PS J10/47 Vss L2/27 A5 K4/32 BR G11/50 D7 B2/11 FSR J2/25 READY BB/BB XF D11/5B AB L5/33 CLKOUT1 C11/5B DB A2/9 FSX F10/53 RS AB/B5 X1 G10/51 A7 K5/34 CLKOUT2 D10/57 D9 B3/B HOLD A7/B7 R/W H11/4B X2/CLKIN F11/52 AB KB/3B CLKR B9/B4 D10 A3/7 HOLDA E10/55 STAB H10/49 AS L7/37 CLKX A9/B3 D11 B4/B IACK B11/BO SYNC F2/19 A10 K7/3B DO F1/1B D12 A4/5 INTO G1/20 Vee A10/B1 A11 LB/39 D1 E2/17 D13 B5/4 INT1 G2/21 Vee B10/B2 SIGNALS l/Otzt DEFINITION Vee I 5-V supply pins Vss I Ground pins X1 0 Output from internal oscillator for crystal X2/CLKIN I Input to internal oscillator from crystal or external clock CLKOUT1 0 Master clock output (crystal or CLKIN frequency/4} CLKOUT2 0 A second clock output signal D15-DO 1/0/Z 1B-bit data bus D15 (MSB) through DO (LSB). Multiplexed between program, data, and 1/0 spaces. A15-AO 0/Z 1B-bit address bus A 15 (MSB) through AO (LSB) PS, DS, iS 0/Z Program, data, and 1/0 space select signals RfW 0/Z Read/write signal STAB 0/Z Strobe signal RS I Reset input INT2-INTO I External user interrupt inputs MP/MC I Microprocessor/microcomputer mode select pin MSC 0 Microstate complete signal IACK 0 Interrupt acknowledge signal READY I Data ready input. Asserted by external logic when using slower devices to indicate that the current bus transaction is complete. BR 0 Bus request signal. Asserted when the TMS320C2x requires access to an external global data memory space. XF 0 External flag output (latched software-programmable signal} HOLD I Hold input. When asserted, TMS320C2x goes into an idle mode and places the data, address, and control lines in the high impedance state. HOLDA 0 Hold acknowledge signal SYNC I Synchronization input BIO I Branch control input. Polled by BIOZ instruction. DR I Serial data receive input CLKR I Clock for receive input for serial port FSR I Frame synchronization pulse for receive input DX 0/Z Serial data transmit output CLKX I Clock for transmit output for serial port FSX 1/0/Z Frame synchronization pulse for transmit. Configuration as either an input or an output. t 1/0/Z denotes input/output/high-impedance state. TEXAS INSTRUMENTS 'I A-4 POST OFFICE BOX 1443 • HOUSTON, TEXAS 77001 TMS320C25, TMS320E25 DIGITAL SIGNAL PROCESSORS SPRS010C-MAY 1987-REVISED DECEMBER 1992 +5V GND Key Features: TMS320C25, TMS320C25·50, TMS320E25 • 80-ns Instruction Cycle Time (TMS320C25-50) t t • 100-ns Instruction Cycle Time (TMS320C25) lnterru ts 256-Word : 288-Word Data (16) • 4K Words of On-Chip Secure Program Dsts/P rog I Data EPROM (TMS320E25) RAM J RAM • 4K Words of On-Chip Program MP/MC 4K-Words Multl- ROM/EPROM Processor ROM (TMS320C25) Interface • 544 Words of On-Chip RAM Multiplier • 128K Words of Total Program/Data Serial 32-Blt ALU/ACC Memory Space Interface • Wait States for Communications to D Shifters Slower Off-Chip Memories Address (16) Timer • Object-Code Compatible With the TMS32020 • Source-Code Compatible With TMS320C1x • On-Chip Clock Generator • 24 Additional Instructions to Support • Single 5-V Supply Adaptive Filtering, FFTs, and Extended-Precision Arithmetic • Internal Security Mechanism (TMS320E25) • Block Moves for Data/Program Management • 68-to-28 Pin Conversion Adapter Socket • Single-Cycle Multiply/Accumulate Instructions • CMOS Technology • Eight Auxiliary Registers With Dedicated • 68-Pin Grid Array (PGA) Package Arithmetic Unit (TMS320C25) • Bit-Reversed Indexed-Addressing Mode for • 68-Lead Plastic Leaded Chip Carrier (PLCC) Radix-2 FFTS Package (TMS320C25, TMS320C25·50) • Double-Buffered Serial Port • 68-Lead CEA-QUAD Package (TMS320E25) Table 1 provides an overview of the second-generation TMS320 processors with comparisons of memory, 1/0, cycle timing, power, package type, technology, and military support. For specific availability, contact the nearest Tl Field Sales Office. Table 1. TMS320 Second-Generation Device Overview MEMORY l/Ot CYCLE TYP PACKAGE DEVICE TYPE TIMER TIME POWER ON-CHIP OFF-CHIP OMA (ns) (mW) PGA PLCC CER-QUAD RAM ROM/EPROM PROG DATA SER PAR TMS320C25:j: (CMOS) 544 4K 64K 64K YES 16X 16 CON YES 100 500 68 68 - TMS320C25·50§ (CMOS) 544 4K 64K 64K YES 16x 16 CON YES 80 500 - 68 - TMS320E25§ (CMOS) 544 4K 64K 64K YES 16X 16 CON YES 100 500 - - 68 TMS320C26 (CMOS) 1568 256 64K 64K YES 16X 16 CON YES 100 500 - 68 - t SER =serial; PAR =parallel; DMA =direct memory access; CON =concurrent DMA. :I: Military version available; contact nearest Tl Field Sales Office for availability. §Military version planned; contact nearest Tl Field Sales Office for details. TEXAS~ INsrRUMENTS POST OFFICE BOX 1443 • HOUSTON. TEXAS 77001 A-5 TMS320C25, TMS320E25 DIGITAL SIGNAL PROCESSORS SPRS01OC-MAY1987-REVISED DECEMBER 1992 architecture The TMS320 family utilizes a modified Harvard architecture for speed and flexibility. In a strict Harvard architecture, program and data memory lie in two separate spaces, permitting a full overlap of instruction fetch and execution. The TMS320 family's modification of the Harvard architecture allows transfers between program and data spaces, thereby increasing the flexibility of the device. This modification permits coefficients stored in program memory to be read into the RAM, eliminating the need for a separate coefficient ROM. It also makes available immediate instructions and subroutines based on computed values. Increased throughput on the TMS320C2x devices for many DSP applications is accomplished by means of single-cycle multiply/accumulate instructions with a data move option, up to eight auxiliary registers with a dedicated arithmetic unit, and faster 1/0 necessary for data-intensive signal processing. The architectural design of the TMS320C2x emphasizes overall speed, communication, and flexibility in processor configuration. Control signals and instructions provide floating-point support, block-memory transfers, communication to slower off-chip devices, and multiprocessing implementations. 32-bit ALU/accumulator The 32-bit Arithmetic Logic Unit (ALU) and accumulator perform a wide range of arithmetic and logical instructions, the majority of which execute in a single clock cycle. The ALU executes a variety of branch instructions dependent on the status of the ALU or a single bit in a word. These instructions provide the following capabilities: • Branch to an address specified by the accumulator • Normalize fixed-point numbers contained in the accumulator • Test a specified bit of a word in data memory One input to the ALU is always provided from the accumulator, and the other input may be provided from the Product Register (PR) of the multiplier or the input scaling shifter which has fetched data from the RAM on the data bus. After the ALU has performed the arithmetic or logical operations, the result is stored in the accumulator. The 32-bit accumulator is split into two 16-bit segments for storage in data memory. Additional shifters at the output of the accumulator perform shifts while the data is being transferred to the data bus for storage. The contents of the accumulator remain unchanged. TEXAS~ INsrRUMENTS A-6 POST OFFICE BOX 1443 •HOUSTON, TEXAS 77001 TMS320C25, TMS320E25 DIGITAL SIGNAL PROCESSORS SPRS010C-MAY 1987-REVISED DECEMBER 1992 functional block diagram (TMS320C2x) SYNC Program Bu• iS os z~g iiS ~§0 16 18 16 ~- IL PFC(18>J 18 + QIR(16) RiW ---+-1 ~ IR(18) STRB ---+-1 16 ST0(16) READY ---+--j iiii ---+-1 .ii 18 ST1(18) XF ---+-1 e t-----' 6 ...---.-1 RPTC(6) HOLD ~ IFR(6) HOLDA u MCS(16) )-++--" [ PC(16)] MSC ---+-1 DR CLKR -~ BIO ---+--j FS R i!S ---+-1 l cFSDXLKX 12 16 IACK ---+-1 Addreao '--1 Stack x 18 16 (8x16) RSR(16) MP/MC Program 16 ROM! 3 XSR(16) EPROM INT(2..0) (4096x16) ~ DRR(16) ~ ~ DXR(18) A15-AO ~ Instruction TIM(16) EPROM -0 16 ~ PRD(18) RBIT 16 _,., 18 ~ IMR(8) ~1t ~ GREG(I) D15-DO i[ 18 " Data Bue 118 Program Bue 16 18 LMl 18 18 3 16 16 9 .---- AR0(18) TR(16) 7LSB 3 AR1(16) From IR x [ ARP(3) AR2(16) L DP(9) J Mulllpller 8 AR3(18) AR4(16) 9 Sh§] ...... (0-16) 3 AR5(16) PR(32) AR6(16) v---' AR7(16) 32 32 16 L ARB(3) J LShllter(-6, 0, 1, 4)J J I 16~' ¥ -4- 16 3 MUX L ARAU(16>J x 16 16 32 ~ ~ MUX 32 6 16 ALU(32)& BlockB2 DATA/PROG 32 (32x16) RAM (256 x 16) ro.1&RAri- Block BO Lcl ACCH(16) l ACCL(16) J ~ BlockB1 J: 32 (256x16) ]_ u [ Shlltero (0-7)1] 16 1 16 116 Data Bua :::s: LEGEND: ACCH Accumulator high IFR Interrupt flag register PC Program counter ACCL Accumulator low /MR Interrupt mask register PFC Prefetch counter ALU Arithmetic logic unit IR Instruction register RPTC Repeat instruction counter ARAU Auxiliary register arithmetic unit MCS "" Microcall stack GREG Global memory allocation register ARB "' Auxiliary register pointer buffer QIR = Queue instruction register RSR Serial port receive shift register ARP Auxiliary register pointer PR Product register XSR Serial port transmit shift register DP Data memory page pointer PRO Period register for timer ARO-AR7 Auxiliary registers ORR Serial port data receive register TIM Timer STO, ST1 Status registers OXR Serial port data transmit register TR Temporary register c Carry bit TEXAS~ INSTRUMENTS POST OFFICE BOX 1443 • HOUSTON, TEXAS 77001 A-7 TMS320C25, TMS320E25 DIGITAL SIGNAL PROCESSORS SPRS010C-MAY 1987-REVISED DECEMBER 1992 scaling shifter The TMS320C2x scaling shifter has 16-bit input connected to the data bus and a 32-bit output connected to the ALU. The scaling shifter produces a left shift of Oto 16 bits on the input data, as programmed in the instruction. The LSBs of the output are filled with zeroes, and the MSBs may be either filled with zeroes or sign-extended, depending upon the status programmed into the SXM (sign-extension mode) bit of status register ST1. 16 x 16-blt parallel multiplier The 16 x 16-bit hardware multiplier is capable of computing a signed or unsigned 32-bit product in a single machine cycle. The multiplier has the following two associated registers. • A 16-bit Temporary Register (TR) that holds one of the operands for the multiplier, and • A 32-bit Product Register (PR) that holds the product. Incorporated into the instruction set are single-cycle multiply/accumulate instructions that allow both operands to be processed simultaneously. The data for these operations may reside anywhere in internal or external memory, and can be transferred to the multiplier each cycle via the program and data buses. Four product shift modes are available at the Product Register (PR) output that are useful when performing multiply/accumulate operations, fractional arithmetic, or justifying fractional products. timer The TMS320C2x provides a memory-mapped 16-bit timer for control operations. The on-chip timer (TIM) register is a down counter that is continuously clocked by CLKOUT1 on the TMS320C25. A timer interrupt (Tl ND is generated every time the timer decrements to zero. The timer is reloaded with the value contained in the period (PRD) register within the next cycle after it reaches zero so that interrupts may be programmed to occur at regular intervals of PRD + 1 cycles of CLKOUT 1 on the TMS320C25. memory control The TMS320C2x provides a total of 544 16-bit words of on-chip data RAM, divided into three separate blocks (BO, B1, and B2). Of the 544 words, 288 words (blocks B1 and B2) are always data memory, and 256 words (block BO) are programmable as either data or program memory. A data memory size of 544 words allows the TMS320C2x to handle a data array of 512 words (256 words if on-chip RAM is used for program memory), while still leaving 32 locations for intermediate storage. When using block BO as program memory, instructions can be downloaded from external program memory into on-chip RAM and then executed. When using on-chip program RAM, ROM, EPROM, or high-speed external program memory, the TMS320C2x runs at full speed without wait states. However, the READY line can be used to interface the TMS320C2x to slower, less-expensive external memory. Downloading programs from slow off-chip memory to on-chip program RAM speeds processing while cutting system costs. The TMS320C2x provides three separate address spaces for program memory, data memory, and 1/0. The on-chip memory is mapped into either the 64K-word data memory or program memory space, depending upon the memory configuration (see Figure 1). The CNFD (configure block BO as data memory) and CNFP (configure block BO as program memory) instructions allow dynamic configuration of the memory maps through software. Regardless of the configuration, the user may still execute from external program memory. The TMS320C2x has six registers that are mapped into the data memory space: a serial port data receive register, serial port data transmit register, timer register, period register, interrupt mask register, and global memory allocation register. TEXAS~ INSIR.UMENTS A-8 POST OFFICE BOX 1443 ° HOUSTON, TEXAS 77001 TMS320C25, TMS320E25 DIGITAL SIGNAL PROCESSORS SPRS010C-MAY 1987-REVISED DECEMBER 1992 Program Program Data O(OOOOh) O(OOOOh) O(OOOOh) lnterrupta Interrupts On-Chip and Re•erved and ReHrved Memory-Mapped (External) (On-Chip 5(0005h) Registers 31(001Fh) 31(001Fh) ROM/EPRO~ 32(0020h) 32(0020h) 8(0006h) Reaerved PageO On-Chip ROM/EPROM 95(005Fh) 4015(0FAFh) 96(0060h) 401 &(0FBOh) On-Chip Block 82 Raaerved 127(007Fh) 128(0060h) 4095(0FFFh) Reserved Pagee 1-3 4096(1 OOOh) 511(01FFh) 512(0200h) External On-Chip Pagee 4-5 767(02FFh) Block BO 768(0300h) On-Chip External Pages 6 ·7 Block B1 1023(03FFh) 1024(0400h) External Pages a -511 65,535(0FFFFh) 65,535(0FFFFh) 65,535(FFFFh) ' - - - - - - - ' If MP/MC= 1 If MP/MC =O (Microprocessor Mode) (Microcomputer Mode on TMS320C25) (a) Memory Maps After a CNFD Instruction Program Program Data O(OOOOh) O(OOOOh) Interrupt. O(OOOOh) Interrupts On-Chip andRaaerved and Reaerved Memory-Mapped (External) (On-Chip Reglatera 31(001Fh) 1 - - - - - - - 1 31(001Fh) ROM/EPROM) 5(0005h) 32(0020h) 32(0020h) On-Chip 6(0006h) Reaarved PagaO ROM/EPROM 401 S(OFAFh) 95(005Fh) 401 &(0FBOh) 96(0060h) Reserved On·Chlp 4095(0FFFh) Block 82 4096(1 OOOh) 127(007Fh) 128(0080h) Reserved Pages 1·3 511(01Ffh) External 512(0200h) Does Not Pagea 4-5 Exist 767(02Ffh) External 768(0300h) On-Chip BlockB1 Pages 6 ·7 1023(03FFh) 1024(0400h) 65,279(0FEFFh) 65,280{0FFOOh) I- - - - - - 65,279(0FEFFh) t------ External Pages 8-511 _____ 65,280(0FFOOh) On-Chip On-Chip ..._ Block BO __, Block BO 65,535(0FFFFh) 65,535(0FFFFh) 65,535(0FFFFh) If MP/MC= 1 If MP/MC =0 (Microprocessor Mode) (Microcomputer Mode on TMS320C25) (b) Memory Maps After a CNFP Instruction Figure 1. Memory Maps TEXAS~ INSTRUMENTS POST OFFICE BOX 1443 ° HOUSTON, TEXAS 77001 A-9 TMS320C25, TMS320E25 DIGITAL SIGNAL PROCESSORS SPRS010C-MAY 1987-REVISED DECEMBER 1992 interrupts and subroutines The TMS320C2x has three external maskable user interrupts INT2-INTO, available for external devices that interruptthe processor. Internal interrupts are generated by the serial port (RI NT and XI@_, by the timer (Tl NT), and by the software interrupt (TRAP) instruction. Interrupts are prioritized with reset (RS) having the highest priority and the serial port transmit interrupt (XINT) having the lowest priority. All interrupt locations are on two-word boundaries so that branch instructions can be accommodated in those locations if desired. A built-in mechanism protects multicycle instructions from interrupts. If an interrupt occurs during a multicycle instruction, the interrupt is not processed until the instruction is completed. This mechanism applies to instructions that are repeated and to instructions that become multicycle due to the READY signal. external Interface The TMS320C2x supports a wide range of system interfacing requirements. Program, data, and 1/0 address spaces provide interface to memory and 1/0, thus maximizing system throughput. 1/0 design is simplified by having 1/0 treated the same way as memory. 1/0 devices are mapped into the 1/0 address space using the processor's external address and data buses in the same manner as memory-mapped devices. Interface to memory and 1/0 devices of varying speeds is accomplished by using the READY line. When transactions are made with slower devices, the TMS320C2x processor waits until the other device completes its function and signals the processor via the READY line. Then, the TMS320C2x continues execution. A full-duplex serial port provides communication with serial devices, such as codecs, serial ND converters, and other serial systems. The interface signals are compatible with codecs and many other serial devices with a minimum of external hardware. The serial port may also be used for intercommunication between processors in multiprocessing applications. The serial port has two memory-mapped registers: the data transmit register (DXR) and the data receive register (DRR). Both registers operate in either the byte mode or 16-bit word mode, and may be accessed in the same manner as any other data memory location. Each register has an external clock, a framing synchronization pulse, and associated shift registers. One method of multiprocessing may be implemented by programming one device to transmit while the others are in the receive mode. The serial port on the TMS320C25 is double-buffered and fully static. multiprocessing The flexibility of the TMS320C2x allows configurations to satisfy a wide range of system requirements and can be used as follows: • A standalone processor • A multiprocessor with devices in parallel • A slave/host multiprocessor with global memory space • A peripheral processor interfaced via processor-controlled signals to another device. For multiprocessing applications, the TMS320C2x has the capability of allocating global data memory space and communicating with that space via the BR (bus request) and READY control signals. Global memory is data memory shared by more than one processor. Global data memory access must be arbitrated. The 8-bit memory-mapped GREG (global memory allocation register) specifies part of the TMS320C2x's data memory as global external memory. The contents of the register determine the size of the global memory space. If the current instruction addresses an operand within that space, BR is asserted to request control of the bus. The length of the memory cycle is controlled by the READY line. The TMS320C2x supports DMA (direct memory access) to its external program/data memory using the HOLD and HOLDA signals. Another processor can take complete control of the TMS320C2x's external memory by asserting HOLD low. This causes the TMS320C2x to place its address data and control lines in a high-impedance state, and assert HOLDA. On the TMS320C2x, program execution from on-chip ROM may proceed concurrently when the device is in the hold mode. 1ExAs ..,, INSTRUMENTS A-10 POST OFFICE BOX 1443 •HOUSTON, TEXAS 77001 TMS320C25, TMS320E25 DIGITAL SIGNAL PROCESSORS SPRS01OC-MAY1987-REVISED DECEMBER 1992 instruction set The TMS320C2x microprocessor implements a comprehensive instruction set that supports both numeric-intensive signal processing operations as well as general-purpose applications, such as multiprocessing and high-speed control. For maximum throughput, the next instruction is prefetched while the current one is being executed. Since the same data lines are used to communicate to external data/program or 1/0 space, the number of cycles may vary depending upon whether the next data operand fetch is from internal or external memory. Highest throughput is achieved by maintaining data memory on-chip and using either internal or fast external program memory. addressing modes The TMS320C2x instruction set provides three memory addressing modes: direct, indirect, and immediate addressing. Both direct and indirect addressing can be used to access data memory. In direct addressing, seven bits of the instruction word are concatenated with the nine bits of the data memory page pointer to form the 16-bit data memory address. Indirect addressing accesses data memory through the auxiliary registers. In immediate addressing, the data is based on a portion of the instruction word{s). In direct memory addressing, the instruction word contains the lower seven bits of the data memory address. This field is concatenated with the nine bits of the data memory page pointer to form the full 16-bit address. Thus, memory is paged in the direct addressing mode with a total of 512 pages, each page containing 128 words. Eight auxiliary registers (ARO-AR?) provide flexible and powerful indirect addressing on the TMS320C25. To select a specific auxiliary register, the Auxiliary Register Pointer (ARP) is loaded with a value from 0 to 7 for ARO through AR7, respectively. There are seven types of indirect addressing: auto-increment or auto-decrement, post-indexing by either adding or subtracting the contents of ARO, single indirect addressing with no increment or decrement, and bit-reversal addressing (used in FFTs on the TMS320C25 only) with increment or decrement. All operations are performed on the current auxiliary register in the same cycle as the original instruction, following which the current auxiliary register and ARP may be modified. repeat feature A repeat feature, used with instructions such as multiply/accumulates, block moves, 1/0 transfers, and tabls read/writes, allows a single instruction to be performed up to 256 times. The repeat counter (RPTC) is loaded with either a data memory value (RPT instruction) or an immediate value (RPTK instruction). The value of this operand is one less than the number of times that the next instruction is executed. Those instructions that are normally multicycle are pipelined when using the repeat feature, and effectively become single-cycle instructions. TEXAS~ INSTRUMENTS POST OFFICE BOX 1443 ° HOUSTON, TEXAS 77001 A-11 TMS320C25, TMS320E25 DIGITAL SIGNAL PROCESSORS SPRS01Oc-MAY1987-REVISED DECEMBER 1992 instruction set summary Table 2 lists the symbols and abbreviations used in Table 3, the TMS320C25 instruction set summary. Table 3 consists primarily of single-cycle, single-word instructions. Infrequently used branch, 1/0, and CALL instructions are multicycle. The instruction set summary is arranged according to function and alphabetized within each functional grouping. The symbol (t) indicates those instructions that are not included in the TMS320C1x instruction set. Table 2. Instruction Symbols SYMBOL DEFINITION B 4-bit field specifying a bit code CM 2-bit field specifying compare mode D Data memory address field FO Format status bit M Addressing mode bit K Immediate operand field PA Port address (PAO-PA 15 are predefined assembler symbols equal to o-15, respectively.) PM 2-bit field specifying P register output shift code AR 3-bit operand field specifying auxiliary register s 4-bit left-shift code x 3-bit accumulator left-shift field TEXAS~ INSTRUMENTS A-12 POST OFFICE BOX 1443 ° HOUSTON, TEXAS 77001 TMS320C25, TMS320E25 DIGITAL SIGNAL PROCESSORS SPRS010C-MAY 1987-REVISED DECEMBER 1992 Table 3. TMS320C25 Instruction Set Summary ACCUMULATOR MEMORY REFERENCE INSTRUCTIONS NO. INSTRUCTION BIT CODE MNEMONIC DESCRIPTION WORDS 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 ABS Absolute value of accumulator 1 1 1 0 0 1 1 1 0 0 0 0 1 1 0 1 1 ADD Add to accumulator with shift 1 0 0 0 0 +--s--1> M 4 D . ADDC Add to accumulator with carry 1 0 1 0 0 0 0 1 1 M 4 D .. ADDH Add to high accumulator 1 0 1 0 0 1 0 0 0 M 4 D .. ADDK Add to accumulator short immediate 1 1 1 0 0 1 1 0 0 ... K ... ADDS Add to low accumulator with sign extension suppressed 1 0 1 0 0 1 0 0 1 M 4 D .. ADDT Add to accumulator with shift specified by T register 1 0 1 0 0 1 0 1 0 M ... D . ADLKt Add to accumulator long immediate with shift 2 1 1 0 1 +--s--i- o 0 0 0 0 0 1 0 AND AND with accumulator 1 0 1 0 0 1 1 1 0 M 4 D . AND Kt AND immediate with accumulator with shift 2 1 1 0 1 +--s--i- o 0 0 0 0 1 0 0 CMPLt Complement accumulator 1 1 1 0 0 1 1 1 0 0 0 1 0 0 1 1 1 LAC Load accumulator with shift 1 0 0 1 0 +--s--1> M 4 D .. LACK Load accumulator immediate short 1 1 1 0 0 1 0 1 0 ... K ... LACTt Load accumulator with shift specified by Tregister 1 0 1 0 0 0 0 1 0 M 4 D . LAL Kt Load accumulator long immediate with shift 2 1 1 0 1 +--s--i- 0 0 0 0 0 0 0 1 NEGt Negate accumulator 1 1 1 0 0 1 1 1 0 0 0 1 0 0 0 1 1 NORMt Normalize contents of accumulator 1 1 1 0 0 1 1 1 0 1 x x x 0 0 1 0 OR OR with accumulator 1 0 1 0 0 1 1 0 1 M 4 D . OR Kt OR immediate with accumulator with shift 2 1 1 0 1 +--s--i- o 0 0 0 0 1 0 1 ROL Rotate accumulator left 1 1 1 0 0 1 1 1 0 0 0 1 1 0 1 0 0 ROR Rotate accumulator right 1 1 1 0 0 1 1 1 0 0 0 1 1 0 1 0 1 SACH Store high accumulator with shift 1 0 1 1 0 1 ,.._x-1> M 4 D . SACL Store low-order accumulator with shift 1 0 1 1 0 0 ,.._X-1> M 4 D .. Subtract from accumulator long immediate SBLKt with shift 2 1 1 0 1 +--s--.. o 0 0 0 0 0 1 1 SFLt Shift accumulator left 1 1 1 0 0 1 1 1 0 0 0 0 1 1 0 0 0 SFRt Shift accumulator right 1 1 1 0 0 1 1 1 0 0 0 0 1 1 0 0 1 SUB Subtract from accumulator with shift 1 0 0 0 1 +--s--1> M 4 D .. SUBB Subtract from accumulator with borrow 1 0 1 0 0 1 1 1 1 M 4 D .. SUBC Conditional subtract 1 0 1 0 0 0 1 1 1 M 4 D . SUBH Subtract from high accumulator 1 0 1 0 0 0 1 0 0 M 4 D . .... SUBK Subtract from accumulator short immediate 1 1 1 0 0 1 1 0 1 4 K r SUBS Subtract from low accumulator with sign extension suppressed 1 0 1 0 0 0 1 0 1 M 4 D . t These instructions are not included in the TMS320C1 x instruction set. TEXAS.,, INSIRUMENTS POST OFFICE BOX 1443 ° HOUSTON, TEXAS 77001 A-13 TMS320C25, TMS320E25 DIGITAL SIGNAL PROCESSORS SPRS01 QC-MAY 1987-REVISED DECEMBER 1992 Table 3. TMS320C25 Instruction Set Summary (continued) ACCUMULATOR MEMORY REFERENCE INSTRUCTIONS NO. INSTRUCTION BIT CODE MNEMONIC DESCRIPTION WORDS 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 SUBTt Subtract from accumulator with shift specified by T register 1 0 1 0 0 0 1 1 0 M . D .. XOR Exclusive-OR with accumulator 1 0 1 0 0 1 1 0 0 M illl D . Exclusive-OR immediate with accumulator with XOR Kt shift 2 1 1 0 1 +-- s - .. 0 0 0 0 0 1 1 0 ZAC Zero accumulator 1 1 1 0 0 1 0 1 0 0 0 0 0 0 0 0 0 ZALH Zero low accumulator and load high accumulator 1 0 1 0 0 0 0 0 0 M .. D .. ZALR Zero low accumulator and load high accumulator with rounding 1 0 1 1 1 1 0 1 1 M illl D . ZALS Zero accumulator and load low accumulator with sign extension suppressed 1 0 1 0 0 0 0 0 1 M illl D . AUXILIARY REGISTERS AND DATA PAGE POINTER INSTRUCTIONS NO. INSTRUCTION BIT CODE MNEMONIC DESCRIPTION WORDS 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 ADRK Add to auxiliary register short immediate 1 0 1 1 1 1 1 1 0 .. K . __.. Compare auxiliary register with auxiliary CMPRt 1 1 1 0 0 1 1 1 0 0 1 0 1 0 o+cM+ register ARO LAR Load auxiliary register 1 0 0 1 1 04--R-IJl-M .. o - - -.. LARK Load auxilliary register short immediate 1 1 1 0 0 04-- R -IJI- + K . LARP Load auxilliary register pointer 1 0 1 0 1 0 1 0 1 1 0 0 0 1 + - R -.. LOP Load data memory page pointer 1 0 1 0 1 0 0 1 0 M . D . LDPK Load data memory page pointer immediate 1 1 1 0 0 1 0 0 + DP .... LRLKt Load auxiliary register long immediate 2 1 1 0 1 o..-R-+0 0 0 0 0 0 0 0 MAR Modify auxiliary register 1 0 1 0 1 0 1 0 1 M . .. SAR Store auxiliary register 1 0 1 1 1 04--R-+M .. D D . SBRK Subtract from auxiliary register short immediate 1 0 1 1 1 1 1 1 1 .. K __.. t These instructions are not included in the TMS320C1 x instruction set. TEXAS.,, INSTRUMENTS A-14 POST OFFICE BOX 1443 • HOUSTON, TEXAS 77001 TMS320C25, TMS320E25 DIGITAL SIGNAL PROCESSORS SPRS01 DC-MAY 1987-REVISED DECEMBER 1992 Table 3. TMS320C25 Instruction Set Summary (continued) T REGISTER, P REGISTER, AND MULTIPLY INSTRUCTIONS NO. INSTRUCTION BIT CODE MNEMONIC DESCRIPTION WORDS 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 APAC Add P register to accumulator 1 1 1 0 0 1 1 1 0 0 0 0 1 0 1 0 1 LPHt Load high P register 1 0 1 0 1 0 0 1 1 M 4 D .. LT Load T register 1 0 0 1 1 1 1 0 0 M 4 D .. LTA Load T register and accumulate previous product 1 0 0 1 1 1 1 0 1 M 4 D .. LTD Load T register, accumulate previous product, and move data 1 0 0 1 1 1 1 1 1 M 4 D . LTPt Load T register and store P register in accumulator 1 0 0 1 1 1 1 1 0 M 4 D . LTSt Load T register and subtract previous product 1 0 1 0 1 1 0 1 1 M 4 D . MACt Multiply and accumulate 2 0 1 0 1 1 1 0 1 M 4 D .. MACDt Multiply and accumulate with data move 2 0 1 0 1 1 1 0 0 M 4 D .. MPY Multiply (with T register, store product in P register) 1 0 0 1 1 1 0 0 0 M . D .. MPYA Multiply and accumulate previous product 1 0 0 1 1 1 0 1 0 M 4 D . MPYK MPYS Multiply immediate Multiply and subtract previous product 1 1 1 0 0 0 1 1 -- .... 1 1 0 1 1 M K ... . 4 D MPYU Multiply unsigned 1 1 1 0 0 1 1 1 1 M 4 D . PAC Load accumulator with P register 1 1 1 0 0 1 1 1 0 0 0 0 1 0 1 0 0 SPAC Subtract P register from accumulator 1 1 1 0 0 1 1 1 0 0 0 0 1 0 1 1 0 SPH Store high P register 1 0 1 1 1 1 1 0 1 M 4 D .... SPL Store low P register 1 0 1 1 1 1 1 0 0 M 4 D . SPMt Set P register output shift mode 1 1 1 0 0 1 1 1 0 0 0 0 0 1 o•P~ SORAt SOR St Square and accumulate Square and subtract previous product 1 1 0 0 0 1 0 1 1 1 1 1 0 0 0 1 1 0 M M . 4 D ... D t These instructions are not included in the TMS320C1x instruction set. TEXAS~ INSTRUMENTS POST OFFICE BOX 1443 ° HOUSTON, TEXAS 77001 A-15 TMS320C25, TMS320E25 DIGITAL SIGNAL PROCESSORS SPRS01OC-MAY1987-REVISED DECEMBER 1992 Table 3. TMS320C25 Instruction Set Summary (continued) BRANCH/CALL INSTRUCTIONS INSTRUCTION BIT CODE NO. MNEMONIC DESCRIPTION WORDS 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 B Branch unconditionally 2 1 1 1 1 1 1 1 1 1 . D . BACCt Branch to address specified by accumulator 1 1 1 0 0 1 1 1 0 0 0 1 0 0 1 0 1 BANZ Branch on auxiliary register not zero 2 1 1 1 1 1 0 1 1 1 .. D . BBNZt Branch if TC bit " o 2 1 1 1 1 1 0 0 1 1 . D .. BBZt Branch if TC bit = O 2 1 1 1 1 1 0 0 0 1 . D . BC Branch on carry 2 0 1 0 1 1 1 1 0 1 .. D .. BGEZ Branch if accumulator:. 0 2 1 1 1 1 0 1 0 0 1 . D . BGZ Branch if accumulator > O 2 1 1 1 1 0 0 0 1 1 . D . BIOZ Branch on 1/0 status = 0 2 1 1 1 1 1 0 1 0 1 . D .. BLEZ Branch if accumulator s O 2 1 1 1 1 0 0 1 0 1 .. D .. BLZ Branch if accumulator < O 2 1 1 1 1 0 0 1 1 1 . D . BNC Branch on no carry 2 0 1 0 1 1 1 1 1 1 . D . BNVt Branch if no overflow 2 1 1 1 1 0 1 1 1 1 .. D .. BNZ Branch if accumulator" O 2 1 1 1 1 0 1 0 1 1 . D . BV Branch on overflow 2 1 1 1 1 0 0 0 0 1 . D . BZ Branch if accumulator= O 2 1 1 1 1 0 1 1 0 1 . D . CALA Call subroutine indirect 1 1 1 0 0 1 1 1 0 0 0 1 0 0 1 0 0 CALL Call subroutine 2 1 1 1 1 1 1 1 0 1 . D . RET Return from subroutine 1 1 1 0 0 1 1 1 0 0 0 1 0 0 1 1 0 1/0 AND DATA MEMORY OPERATIONS NO. INSTRUCTION BIT CODE MNEMONIC DESCRIPTION WORDS 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 BLKOt Block move from data memory to data memory 2 1 1 1 0 1 1 0 1 M . D . BLKPt Block move from program memory to data memory 2 1 1 1 1 1 1 0 0 M .. D . DMOV Data move in data memory 1 0 1 0 1 0 1 1 0 M . D . FORTt Format serial port registers 1 1 1 0 0 1 1 1 0 0 0 0 0 1 1 1 FO IN Input data from port 1 1 0 0 0 ...___PA --.M . D . OUT Output data to port 1 1 1 1 0 ...___PA --.M . D . RFSM Reset serial port frame synchronization mode 1 1 1 0 0 1 1 1 0 0 0 1 1 0 1 1 0 RTXMt Reset serial port transmit mode 1 1 1 0 0 1 1 1 0 0 0 1 0 0 0 0 0 RX Ft Reset external flag 1 1 1 0 0 1 1 1 0 0 0 0 0 1 1 0 0 SFSM Set serial port frame synchronization mode 1 1 1 0 0 1 1 1 0 0 0 1 1 0 1 1 1 STXMt Set serial port transmit mode 1 1 1 0 0 1 1 1 0 0 0 1 0 0 0 0 1 SXFt Set external flag 1 1 1 0 0 1 1 1 0 0 0 0 0 1 1 0 1 TBLR Table read 1 0 1 0 1 1 0 0 0 M . .. .. D TBLW Table write 1 0 1 0 1 1 0 0 1 M .. D t These instructions are not included in the TMS320C1x instruction set. 1ExAs ~ INSTRUMENTS A-16 POST OFFICE BOX 1443 • HOUSTON, TEXAS 77001 TMS320C25, TMS320E25 DIGITAL SIGNAL PROCESSORS SPRS010C-MAY 1987-REVISED DECEMBER 1992 Table 3. TMS320C25 Instruction Set Summary (concluded) CONTROL INSTRUCTIONS NO. INSTRUCTION BIT CODE MNEMONIC DESCRIPTION WORDS 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 BITt Test bit 1 1 0 0 1 ..._ B _.,. M .. D .. BITTt Test bit specified by T register 1 0 1 0 1 0 1 1 1 M . D .. CNFDt Configure block as data memory 1 1 1 0 0 1 1 1 0 0 0 0 0 0 1 0 0 CNFPt Configure block as program memory 1 1 1 0 0 1 1 1 0 0 0 0 0 0 1 0 1 DINT Disable interrupt 1 1 1 0 0 1 1 1 0 0 0 0 0 0 0 0 1 EINT Enable interrupt 1 1 1 0 0 1 1 1 0 0 0 0 0 0 0 0 0 IDLEt Idle until interrupt 1 1 1 0 0 1 1 1 0 0 0 0 1 1 1 1 1 LST Load status register STO 1 0 1 0 1 0 0 0 0 M .. D .. LST1t Load status register ST1 1 0 1 0 1 0 0 0 1 M .. D . NOP No operation 1 0 1 0 1 0 1 0 1 0 0 0 0 0 0 0 0 POP 1 1 1 1 POPDt Pop top of stack to low accumulator Pop top of stack to data memory 1 1 0 1 1 0 1 0 1 1 1 0 1 0 0 0 M .. 0 0 1 1 D 0 .1 PSHDt Push data memory value onto stack 1 0 1 0 1 0 1 0 0 M . D .. PUSH Push low accumulator onto stack 1 1 1 0 0 1 1 1 0 0 0 0 1 1 1 0 0 RC Reset carry bit 1 1 1 0 0 1 1 1 0 0 0 1 1 0 0 0 0 RHM Reset hold mode 1 1 1 0 0 1 1 1 0 0 0 1 1 1 0 0 0 ROVM Reset overflow mode 1 1 1 0 0 1 1 1 0 0 0 0 0 0 0 1 0 RPTt Repeat instruction as specified by data memory value 1 0 1 0 0 1 0 1 1 M . D . RPTKt Repeat instruction as specified by immediate value 1 1 1 0 0 1 0 1 1 . K . RSXMt Reset sign-extension mode 1 1 1 0 0 1 1 1 0 0 0 0 0 0 1 1 0 RTC Reset test/control flag 1 1 1 0 0 1 1 1 0 0 0 1 1 0 0 1 0 SC Set carry bit 1 1 1 0 0 1 1 1 0 0 0 1 1 0 0 0 1 SHM Set hold mode 1 1 1 0 0 1 1 1 0 0 0 1 1 1 0 0 1 SOVM Set overflow mode 1 1 1 0 0 1 1 1 0 0 0 0 0 0 0 1 1 SST Store status register STO 1 0 1 1 1 1 0 0 0 M . D .. SST1t Store status register ST1 1 0 1 1 1 1 0 0 1 M . D .. SSXMt Set sign-extension mode 1 1 1 0 0 1 1 1 0 0 0 0 0 0 1 1 1 STC Set test/control flag 1 1 1 0 0 1 1 1 0 0 0 1 1 0 0 1 1 TRAPt Software interrupt 1 1 1 0 0 1 1 1 0 0 0 0 1 1 1 1 0 t These instructions are not included in the TMS320C1 x instruction set. TEXAS~ INSTRUMENTS POST OFFICE BOX 1443 ° HOUSTON, TEXAS 77001 A-17 TMS320C25, TMS320E25 DIGITAL SIGNAL PROCESSORS SPRS010C-MAY 1987-REVISED DECEMBER 1992 documentation support Extensive documentation supports the second-generation TMS320 devices from product announcement through applications development. The types of documentation include data sheets with design specifications, complete user's guides, and 750 pages of application reports published in the book, Digital Signal Processing Applications with the TMS320 Family (SPRA012A). An application report, Hardware Interfacing to the TMS320C25 (SPRA014A), is available for that device. A series of DSP textbooks is being published by Prentice-Hall and John Wiley & Sons to support digital signal processing research and education. The TMS320 newsletter, Details on Signal Processing, is published quarterly and distributed to update TMS320 customers on product information. The TMS320 DSP bulletin board service provides access to large amounts of information pertaining to the TMS320 family. Refer to the TMS320 Family Development Support Reference Guide (SPRU011 B) for further information about TMS320 documentation. To receive copies of second-generation TMS320 literature, call the Customer Response Center at 1-800-232-3200. specification overview The electrical specifications for the TMS320C25, TMS320E25, and TMS320C25-50 are given in the following pages. Note that the electrical specifications for the TMS320E25 are identical to those for the TMS320C25, with the addition of EPROM-related specifications. TEXAS~ INSTRUMENTS A-18 POST OFFICE BOX 1443 • HOUSTON, TEXAS 77001 TMS320C25, TMS320E25 TMS320C25-33, TMS320C25-50 SPRS01OC-MAY1987-REVISED DECEMBER 1992 absolute maximum ratings over specified temperature range (unless otherwise noted)t Supply voltage range, Vee* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . - 0.3 V to 7 V Input voltage range: TMS320E25 pins 24 and 25 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . - 0.3 V to 15 V All other inputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . - 0.3 V to 7 V Output voltage range . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . - 0.3 V to 7 V Continuous power dissipation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.5 W Operating free-air temperature range . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . o•c to 10°c Storage temperature range . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . - 55°C to 150°C t Stresses beyond those listed under "Absolute Maximum Ratings" may cause permanent damage to the device. This is a stress rating only, and functional operation of the device atthese or any other conditions beyond those indicated in the "Recommended Operating Conditions" section of this specification is not implied. Exposure to absolute-maximum-rated conditions for extended periods may affect device reliability. *All voltage values are with respect to Vss. recommended operating conditions MIN NOM MAX UNIT Vee Supply voltage 4.75 5 5.25 v Vss Supply voltage 0 v All inputs except CLKIN/CLKX/CLKR/INT (0-2) 2.35 Vcc+o.3 v V1H High-level input voltage INT (0-2) 2.5 vcc+o.3 v CLKIN/CLKX/CLKR 3.5 Vcc+0.3 v Low-level input voltage All inputs except MP/MC -0.3 0.8 v V1L MP/MC -0.3 0.8 v IOH High-level output current 300 µA loL Low-level output current 2 mA TMS320C25, TMS320E25 0 70 ·c TA Operating free-air temperature TMS320C25GBA -40 85 ·c electrical characteristics over specified free-air temperature range (unless otherwise noted) TMS320C25 TMS320C25-50 TMS320C25-33 PARAMETER TEST CONDITIONS TMS320E25 UNIT MIN TVP§ MAX MIN TVP§ MAX VoH High-level output voltage Vee= MIN, IOH = MAX 2.4 3 2.4 3 v VoL Low-level output voltage Vee = MIN, loL = MAX 0.3 0.6 0.3 0.6 v lz Three-state current Vcc=MAX -20 20 -20 20 µA lj Input current v1= Vss to Vee -10 10 -10 10 µA . l Normal 110 185 95 185 mA V1L Low-levehnputvoltage j Idle/HOLD TA= o•c, Vee= MAX, fx =MAX 50 100 40 100 C1 Input capacitance 15 15 pF ~ Output capacitance 15 15 pF §All typical values are at Vee= 5 V, TA= 25°. Caution. This device contains circuits to protect its inputs and outputs against damage due to high static voltages or electrostatic fields. These circuits have been qualified to protect this device against electrostatic discharges (ESD) of up to 2 kV according to MIL-STD-883C, Method 3015; however, it is advised that precautions to be taken to avoid application of any voltage higher than maximum rated voltages to these high-impedance circuits. During storage or handling, the device leads should be shorted together or the device should be placed in conductive foam. in a circuit, unused inputs should always be connected to an appropriate logic voltage level, preferably either Vee or ground. Specific guidelines for handling devices of this type are contained in the publication "Guidelines for Handling Electrostatic-Discharge Sensitive (ESDS) Devices and Assemblies" available from Texas Instruments 1ExAs" INSIRUMENTS POST OFFICE BOX 1443 ° HOUSTON, TEXAS 77001 A-19 TMS320C25, TMS320E25 TMS320C25·33 SPRS010C-MAY 1987-REVISED DECEMBER 1992 CLOCK CHARACTERISTICS AND TIMING The TMS32025 can use either its internal oscillator or an external frequency source for a clock. Internal clock option The internal oscillator is enabled by connecting a crystal across X1 and X2/CLKIN (see Figure 2). The frequency of CLKOUT1 is one-fourth the crystal fundamental frequency. The crystal should be either fundamental or overtone mode, and parallel resonant, with an effective series resistance of 30 r.i, a power dissipation of 1 mW, and be specified at a load capacitance of 20 pF. Note that overtone crystals require an additional tuned LC circuit. TMS320C25 TMS320C25-33 PARAMETER TEST CONDITIONS TMS320E25 UNIT MIN TVP MAX MIN TVP MAX fx Input clock frequency TA= o•c to 10°c 6.7 40.96 6.7 33.0 MHz fxs Serial port frequency TA= o•c to 10°c ot 5.12 ot 4.125 MHz C1,C2 !A_= o•c to 10°c 10 10 pf t The serial port was tested at a minimum frequency of 1.25 MHz. However, the serial port was fully static but will properly function down tofsx = O Hz. Figure 2. Internal Clock Option external clock option An external frequency source can be used by injecting the frequency directly into X2/CLKIN with X1 left unconnected. The external frequency injected must conform to the specifications listed in the following table. switching characteristics over recommended operating conditions (see Note 1) TMS320C25 TMS320C25-33 PARAMETER TMS320E25 UNIT MIN TVP MAX MIN TVP MAX lc(C) CLKOUT1 /CLKOUT2 cycle time 97.7 597 121.2 597 ns lc(CIH-C) CLKIN high to CLKOUT1/CLKOUT2/STRB high/low 5 30 5 30 ns lf(C) CLKOUT1/CLKOUT2/STRB fall time 5 5 ns lr(C) CLKOUT1/CLKOUT2/STRB rise time 5 5 ns lw(CL) CLKOUT1/CLKOUT2 low pulse duration 20-8 20 20+8 20-8 20 20+8 ns lw(CH) CLKOUT1/CLKOUT2 high pulse duration 20-8 20 20+8 20-8 20 20+8 ns CLKOUT1 high to CLKOUT2 low; CLKOUT2 high to '----~ 10kQ 74HC04 4.7kQ F11 CLKIN 1---0IC C = 20 pF 0.1 µF 47 pF 74AS04 I 10 kQ I }L - - -- fc stal (MHz) L (µH) TMS320C2S 40.96 1.8 TMS320C2S-33 33.0 2.6 TMS320E2S 40.96 1.8 Figure 3. External Clock Option Shown above is a crystal oscillator circuit suitable for providing the input clock signal to the TMS320C25, TMS320E25, and TMS320C25-33. Please refer to "Hardware Interfacing to the TMS320C2x", in Digital Signal Processing Applications with the TMS320 Family, Volume 2 (document number SPRA016) for details on circuit operation. 2.15V From Output Under Test ~= 825 Test Point Q I CL=100pF Figure 4. Test Load Circuit TEXAS~ INSfRUMENTS POST OFFICE BOX 1443 • HOUSTON, TEXAS 77001 A-21 TMS320C25, TMS320E25 TMS320C25·33 SPRS010C-MAY 1987-REVISED DECEMBER 1992 ~1===~ : :.: +===~:::.::: 2.0V 2.4V 1.88V 2.2V 0.92V O.BV O.BOV 0.6V 0 0 (a) Input (b) Output Figure 5. Voltage Reference Levels MEMORY AND PERIPHERAL INTERFACE TIMING switching characteristics over recommended operating conditions (see Note 1) PARAMETER MIN TYP MAX UNIT td(C1-S) STRB from CLKOUT1 {if STRB is present) 0-6 0 0+6 ns ld(C2-S) CLKOUT2 to STRB {if STRB is present) -6 0 6 ns tsu{A) Address setup time before STRB low (see Note 3) 0-12 ns th{A) Address hold time after STRB high (see Note 3) 0-8 ns tw(SL) STRB low pulse duration (no wait states, see Note 4) 20-5 20 + 5 ns tw(SH) STRB high pulse duration (between consecutive cycles, see Note 4) 20-5 20+5 ns tsu(D)W Data write setup time before STRB high (no wait states) 20-20 ns th{D)W Data write hold time from STRB high 0-10 0 ns ten(D) Data bus starts being driven after STRB low (write cycle) ot ns tdis(D) Data bus three-state after STRB high (write cycle) 0 o +1st ns tcl_{_MSQ)_ MSC valid from CLKOUT1 -12 0 12 ns t Value derived from characterization data and not tested. NOTES: 1. 0 =1/4tc_{9·_ _ _ _ 3. A 15-AO, PS, DS, IS, R/W, and BR timings are all included in timings referenced as "address". 4. Delays between CLKOUT1/CLKOUT2 edges and STRB edges track each other, resulting in tw(SL) and tw(SH) being 20 with no wait states. timing requirements over recommended operating conditions (see Note 1) MIN NOM MAX UNIT ta(A) Read data access time from address time (read cycle, see Notes 3 and 5) 30-35 ns tsu(D)R Data read setup time before STRB high 23 ns th{D)R Data read hold time from STRB high 0 ns td(SL-R) READY valid after STRB low (no wait states) 0-20 ~s td(C2H-R) READY valid after CLKOUT2 high 0-20 ns th{SL-R) READY hold time after STRB low (no wait states) Q+3 ns th{C2H-R) READY hold after CLKOUT2 high 0 +3 ns td{M-R) READY valid after MSC valid 20-25 ns tlJ..{.M-f!t READY hold time after MSC valid 0 ns NOTES: 1. Q =1/4tcJ.9· 3. A 15-AO, PS, DS, fS, RJ'N, and BR timings are all included in timings referenced as "address". 5. Read data access time is defines as ta{A) =tsu{A) + tw(SL) -tsu(D)R· TEXAS~ INsrRUMENTS A-22 POST OFFICE BOX 1443 • HOUSTON, TEXAS 77001 TMS320C25, TMS320E25 TMS320C25-33 SPRS010C-MAY 1987-REVISED DECEMBER 1992 RS, INT, BIO, AND XF TIMING switching characteristics over recommended operating conditions (see Notes 1 and 6) PARAMETER MIN TYP MAX UNIT ld(RS) CLKOUT1 low to reset state entered 22t ns lci(IACK) CLKOUT1 to IACK valid -6 0 12 ns td_tXF} XF valid before falling edge of STRB Q-15 ns NOTES: 1. ~'." 1_/~tc(C)- __ 6. RS, INT, and BIO are asynchronous inputs and can occur at any time during a clock cycle. However, if the specified setup time is met, the exact sequence shown in the timing diagrams will occur. timing requirements over recommended operating conditions (see Notes 1 and 6) MIN NOM MAX UNIT tsu(IN) INT/BIO/RS setup before CLKOUT1 high 32 ns lh(IN} INT/BIO/RS hold after CLKOUT1 high 0 ns tf(IN) INT/BIO fall time st ns tw(IN) INT/BIO low pulse duration tc(C) ns laj_R~ RS low pulse duration 31s_g_ ns t Value derived from characterization data and not tested. NOTES: 1. Q = 1/41c(C)·_ 6. RS, INT, and BIO are asynchronous inputs and can occur at any time during a clock cycle. However, if the specified setup time is met, the exact sequence shown in the timing diagrams will occur. HOLD TIMING switching characteristics over recommended operating conditions (see Note 1) PARAMETER MIN TYP MAX UNIT ld(C1L-AL) HOLDA low after CLKOUT1 low 0 10 ns tdis(AL-A) HOLDA low to address three-state ot ns ldis(C1 L-A) Address three-state after CLKOUT1 low (HOLD mode, see Note 7) 2ot ns ld(HH-AH) HOLD high to HOLDA high 25 ns len(A-C1L) Address driven before CLKOUT1 low (HOLD mode, see Note 7) st ns t Value derived from characterization data and not tested. NOTES: 1. Q = 1/4tc(C)- 7. A 15-AO, PS, DS, TS, STRB, and R/W timings are all included in timings referenced as "address." timing requirements over recommended operating conditions (see Note 1) MIN NOM MAX UNIT Id C2H-H HOLD valid after CLKOUT2 high Q - 24 ns NOTES: 1. Q = 1/4tc(C)· TEXAS~ INSTRUMENTS POST OFFICE BOX 1443 ° HOUSTON, TEXAS 77001 A-23 TMS320C25, TMS320E25 TMS320C25·33 SPRS01QC-MAY1987-REVISED DECEMBER 1992 SERIAL PORT TIMING switching characteristics over recommended operating conditions (see Note 1) PARAMETER MIN TYP MAX UNIT lct(CH-DX) DX valid after CLKX rising edge (see Note 8) 75 ns lct(FL-DX) DX valid after FSX falling edge (TXM =0, see Note 8) 40 ns tq_{_CH-F~ FSX valid after CLKX rising edge (TXM = 1) 40 ns NOTES: 1. Q = 1/4tc(C)· 8. The last occurrence of FSX falling and CLKX rising. timing requirements over recommended operating conditions (see Note 1) TMS320C25 TMS320C25·33 TMS320E25 UNIT MIN NOM MAX MIN NOM MAX tc(SCK) Serial port clock (CLKX/CLKR) cycle time t 200 242 ns tf(SCK) Serial port clock (CLKX/CLKR) fall time 25+ 25+ ns tr(SCK) Serial port clock (CLKX/CLKR) rise time 25+ 25+ ns tw(SCK) Serial port clock (CLKX/CLKR) low pulse duration (see Note 9) 80 97 ns tw(SCK) Serial port clock (CLKX/CLKR) high pulse duration (see Note 9) 80 97 ns tsu(FS) FSX/FSR setup time before CLKX/CLKR falling edge (TXM = 0) 18 18 ns th(FS) FSX/FSR hold time after CLKX/CLKR falling edge (TXM = 0) 20 20 ns tsu(DR) DR setup time before CLKR falling edge 10 10 ns ti!.(!)f32.. DR hold time after CLKR falling edge 20 20 ns t The serial port was tested at a minimum frequency of 1.25 MHz. However, the serial port was fully static but will properly function down to fsx = 0 Hz. +Value derived from characterization data and not tested. NOTES: 1. Q = 1/4tc(C)· 9. The duty cycle of the serial port clock must be within 40-60%. TEXAS~ INSTRUMENTS A-24 POST OFFICE BOX 1443 • HOUSTON, TEXAS 77001 TMS320E25 SPRS010G-MAY 1987-REVISED DECEMBER 1992 EPROM PROGRAMMING absolute maximum ratings over specified temperature range (unless otherwise noted)t Supply voltage range, Vpp:l: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . - 0.6 V to 15 V Input voltage range on pins 24 and 25 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . - 0.3 V to 15 V t Stresses beyond those listed under "absolute maximum ratings" may cause permanent damage to the device. This is a stress rating only, and functional operation of the device at these or any other conditions beyond those indicated in the "recommended operating conditions" section of this specification is not implied. Exposure to absolute-maximum-rated conditions for extended periods may affect device reliability. :I: All voltage values are with respect to G ND. recommended operating conditions MIN NOM MAX UNIT Vee Programming mode supply voltage (see Note 11) 6 v Vee Read mode supply voltage 4.75 5 5.25 v Vpp Programming mode supply voltage 12 12.5 13 v ~ Read mode supply voltage (see Note 10) Vee v NOTES: 10. Vpp can be connected to Vee directly (except in the program mode). Vee supply current in this case would be Ice+ lpp. During programming, Vpp must be maintained at 12.5 V (± 0.25 V). 11. Vee must be applied before or at the same time as Vpp and removed after or at the same time as Vpp. This device must not be inserted into or removed from the board when Vpp or Vee is applied. electrical characteristics over specified temperature range (unless otherwise noted) PARAMETER TEST CONDITIONS MIN TYP§ MAX UNIT lpp1 Vpp supply current Vpp = vcc = 5.25 v 100 µA lpp_a_ V~supply current {during program pulse) Vpp = 13V 30 50 mA §All typical values for Ice are at Vee= 5 v, TA= 25'C. recommended timing requirements for programming, TA= 25°C, Vee= 6 v, Vpp = 12.5 v (see Notes 12 and 13) MIN NOM MAX UNIT tw_{IPGMJ_ Initial program pulse duration 0.95 1 1.05 ms twjFPG~ Final pulse duration 2.85 78.75 ms tsu_(& Address setup time 2 µS tsu_(fil_ Esetuptime 2 µs tsuj_Ql G setup time 2 µs ldi~ Output disable time from G 0 130~ ns lell(fil_ Output enable time from G 150~ ns lsY.{Q)_ Data setup time 2 µs tsu_(yp6_ Vpp setup time 2 µS tsl!f{_CQl. Vee setup time 2 µS tti{& Address hold time 0 µS th(D) Data hold time 2 µS ~ Value derived from characterization data and not tested. NOTES: 12. For all switching characteristics and timing measurements, input pulse levels are 0.4 V to 2.4 V and Vpp = 12.5 V ± 0.5 V during programming. 13. Common test conditions apply for tdis(G) except during programming. TEXAS INSTRUMENTS 'I POST OFFICE BOX 1443 ° HOUSTON, TEXAS 77001 A-25 TMS320C25·50 SPRS010C-MAY 1987-REVISED DECEMBER 1992 absolute maximum ratings over specified temperature range (unless otherwise noted)t Supply voltage range, Vee* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . - 0.3 V to 7 V Input voltage range . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . - 0.3 V to 7 V Output voltage range . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . - 0.3 V to 7 V Continuous power dissipation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.5 W Operating free-air temperature range . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 0°C to 70°C Storage temperature range . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . - 55°C to 150°C t Stresses beyond those listed under "absolute maximum ratings" may cause permanent damage to the device. This is a stress rating only, and functional operation of the device at these or any other conditions beyond those indicated in the "recommended operating conditions" section of this specification is not implied. Exposure to absolute-maximum-rated conditions for extended periods may affect device reliability. :1: All voltage values are with respect to Vss. recommended operating conditions MIN NOM MAX UNIT Vee Supply voltage 4.75 5 5.25 v Vss Supply voltage 0 v INTO-INT2 2.5 v V1H High-level input voltage CLKIN, CLKX, CLKR 3.5 v Other inputs 2.35 v MP/MC 0.8 v V1L Low-level input voltage CLKIN 0.8 v Other inputs 0.8 v IOH High-level output current 300 µA IOL Low-level output current 2 mA TA Operating free-air temperature 0 70 ·c electrical characteristics over specified free-air temperature range (unless otherwise noted) PARAMETER TEST CONDITIONS MIN TYP§ MAX UNIT VoH High-level output voltage Vee = MIN, loH = MAX 2.4 v VOL Low-level output voltage Vee = MIN, loL = MAX 0.6 v lz High-impedance current Vcc=MAX -20 20 µA 11 Input current v1 = Vss to Vee -10 10 µA Ice Supply current 1Normal TA= 0°C, Vee= MAX, Fx =MAX 110 185 mA lldle, HOLD 50 100 C1 Input capacitance 15 pF ~ Output capacitance 15 pF §All typical values are at Vee= 5 V, TA= 25°C. TEXAS~ INSTRUMENTS A-26 POST OFFICE BOX 1443 • HOUSTON, TEXAS 77001 TMS320C25-50 SPRS010C-MAY 1987-REVISED DECEMBER 1992 CLOCK CHARACTERISTICS AND TIMING The TMS320C25-50 can use either its internal oscillator or an external frequency source for a clock. internal clock option The internal oscillator is enabled by connecting a crystal across X1 and X2, CLKI N. The frequency of CLKOUT1 is one-fourth the crystal fundamental frequency. The crystal should be in either fundamental or overtone mode, and parallel resonant, with an effective series resistance of 30 Q, a power dissipation of 1 mW, and be specified at a load capacitance of 20 pF. Note that overtone crystals require an additional tuned LC circuit. PARAMETER TEST CONDITIONS MIN TY Pt MAX UNIT fx Input clock frequency TA= O'C to 70'C 6.7 51.2 MHz fsx Serial port frequency TA= O'C to 70'C 0 6.4 MHz C1, C2 Tu_= O'C to 70'C 10 pF t The serial port was tested at a minimum frequency of 1.25 MHz. However, the serial port was fully static but will properly function down to fsx = 0 Hz. X1 X2/CLKIN Figure 6. Internal Clock Option external clock option An external frequency source can be used by injecting the frequency directly into X2/CLK, with X1 left unconnected. The external frequency injected must conform to specifications listed in the following table. switching characteristics over recommended operating conditions (see Note 1) MIN NOM MAX UNIT tq{g_ CLKOUT1 , CLKOUT2 cycle time 78.13 597 ns tqf_CIH-Gl_ CLKIN high to CLKOUT1, CLKOUT2, STAB high, low 5 27 ns l.!{9_ CLKOUT1 , CLKOUT2, STAB fall time 4 ns t!iGl.. CLKOUT1 , CLKOUT2, STAB rise time 4 ns twJ_Cl..l_ CLKOUT1, CLKOUT2, STAB low pulse duration 20-7 20+3 ns t'A'{_Clj)_ CLKOUT1, CLKOUT2, STAB high pulse duration 20-3 20+7 ns .!2lQ1-C2L CLKOUT1 high to CLKOUT2 low, CLKOUT2 high to CLKOUT1 high, etc. Q-5 0+5 ns NOTE 1: Q = 1/4 tc(C) TEXAS~ INSTRUMENTS POST OFFICE BOX 1443 ° HOUSTON, TEXAS 77001 A-27 TMS320C25-50 SPRS010C-MAY 1987-REVISED DECEMBER 1992 +SV TMS320C25 fcrystal ~~~----<01--~~~ 10kQ 74HC04 4.7k0 F11 CLKIN 1------<0C C =20pF 0.1 µF 47pF 74AS04 I -- 10 kQ I }L - - -- fcrystal (MHz) L (µH) TMS320C25 40.96 1.8 TMS320C25-50 51.20 1.0 TMS320E25 40.96 1.8 Figure 7. External Clock Option timing requirements over recommended operating conditions (see Note 1) MIN NOM MAX UNIT ~C.!l_ CLKIN cycle time 19.S3 1SO ns tfl..C.!l. CLKIN fall time st ns tr_LCU CLKIN rise time st ns twJ_Cll..)_ CLKIN low pulse duration, tqcn_ =50 ns (see Note 2) 20 ns t~Clf-tl_ CLKIN high pulse duration, \qCJ}_ =SO ns (see Note 2) 20 ns Isl!{§}_ SYNC setup time before CLKIN low 4 Q-4 ns 11!..fil SYNC hold time from CLKIN low 4 ns t Value derived from characterization data and not tested. NOTES: 1. Q =1/4 lc(C) 2. CLKIN duty cycle [tr(CI) + tw(CIH)lltc(CI) must be within 40-60%. TEXAS.,, INSTRUMENTS A-28 POST OFFICE BOX 1443 • HOUSTON, TEXAS 77001 TMS320C25-50 SPRS010C-MAY 1987-REVISED DECEMBER 1992 MEMORY AND PERIPHERAL INTERFACE TIMING switching characteristics over recommended operating conditions (see Note 1) PARAMETER MIN TYP MAX UNIT id{C1-S) STRB from CLKOUT (if STAB is present) 0-5 0+3 ns 14 I I i.-.r ld(CIH-C) I -.i I+- tr(C) -+I I+- tf(C) STRB!\. I I ! I 1 l+-----+i- tcl(CIH-C) I I I I I--- lt: tw(CL) ----.i CLKOUT2 ___;f : ~,...!_ ___....!_ __,/i ~ tcl(C1-C2) _,,..i,._ _ _.,I I :.. .,I td(C1-C2) -.j I+- tf(C) tr(C) -.! I+- : tcl(C1-C2) I" .,I I+--- lw(CH) --+I ld(C1-C2) 1.. ..1 Figure 8. Clock Timing TEXAS.,, INSTRUMENTS A-32 POST OFFICE BOX 1443 • HOUSTON, TEXAS 77001 TMS320C25, TMS320E25 DIGITAL SIGNAL PROCESSORS SPRS01 OC-MAY 1987-REVISED DECEMBER 1992 PARAMETER MEASUREMENT INFORMATION I+- ld(C1-S) ---+! I I CLKOUT1 \i_ :I A I i . - ld(C1-S) --.i I I I CLKOUT2 \ , __ _ _ _ _ _ _,/f I \_I_____/ ld(C2-S) -.i I I I ~ ld(C2-S) r1 -.i ~ I ~ I I AI I i.-- lw(SH) ~ 1 I\ tsu(A) -141----11>-.1 I 14 11>1 th(A) I I+-- lw(SL) ---+! I A1S-AO, BR, PS, OS Valid oriS R/W \XXXXW I I /':IX'fY/ _ _ _ _......._ ld(SL-R) -.i I ~ I : I I READY ~~ lh(SL-R) -+1•4--~l.il >I I I I ~ 14- lh(D)R 015-DO -------------<( Data In )>------ Figure 9. Memory Read Timing TEXAS~ INSTRUMENTS POST OFFICE BOX 1443 ° HOUSTON, TEXAS 77001 A-33 TMS320C25, TMS320E25 DIGITAL SIGNAL PROCESSORS SPRS01OC-MAY1987-REVISED DECEMBER 1992 PARAMETER MEASUREMENT INFORMATION CLKOUT1 \ I \ CLKOUT2 \ I \ I STRB \ I /i I •I lh(A) \ I"' tsu(A) I.. •I I I I I A15-AO, BR,PS,DS Valld oriS I I I I R/W ~ ~ READY D15-DO Data Out I II I I ---.I i"'- ten (D) i"'- tdls(D) -----.i Figure 10. Memory Write Timing TEXAS INSTRUMENTS 'I A-34 POST OFFICE BOX 1443 • HOUSTON, TEXAS 77001 TMS320C25, TMS320E25 DIGITAL SIGNAL PROCESSORS __ SPRS010C-MAY 1987-REVISED DECEMBER 1992 PARAMETER MEASUREMENT INFORMATION CLKOUT1 \I AI \ ___! \ CLKOUT2 __:___,/i I I I I I I I \ Ii I \ ____ ~-+---\I I 1 1 II I I 'i I I I A15-AO, BR, PS, DS, R/W or iS ---~: ~ : :"";: '"!~*"I 1 2H-R) ....i" !+- READY I~~ tCl(M:R} I ~ ~ I+- lh(M-R) 015-00 I --+! i4+- lh(M-R) ~(M-R) I.. •I (For Read ---•i-1---~1--il------~1------<( I I I I . ~amln)>------ . Operation) 1 I I I I I ---•!-+I--~ :-om 015-00 (For Write Operation) ~(MSC) 14-- -+I ~ I+- ~(MSC) I I ~ ~-----......,_--~----- Figure 11. One Wait-State Memory Access Timing TEXAS~ INSIRUMENTS POST OFFICE BOX 1443 • HOUSTON, TEXAS 77001 A-35 TMS320C25, TMS320E25 DIGITAL SIGNAL PROCESSORS SPRS010C-MAY 1987-REVISED DECEMBER 1992 PARAMETER MEASUREMENT INFORMATION t Control signals are OS, iS, RfiJ, and XF. *Serial port controls are DX and FSX. Figure 12. Reset Timing TEXAS INSTRUMENTS 'f A-36 POST OFFICE BOX 1443 •HOUSTON, TEXAS 77001 TMS320C25, TMS320E25 DIGITAL SIGNAL PROCESSORS SPRS010C-MAY 1987-REVISED DECEMBER 1992 PARAMETER MEASUREMENT INFORMATION CLKOUT1 I I I 1.. I +j I+- lh(IN) "N. r lw(INj I .,I 1.J;--~~~~~~~~~~~~~~- _J i~ I I A15-AO ......., ==::>< ~ lf(IN) FETCH N x I _...., I+- lct(IACK) FET~H N + 1 x,._F_E-TC_H_N_+_2_X N+3 x FETCHI ><= lct(IACK) -+I i--- I Figure 13. Interrupt Timing !+-- lc(SCK) --+! I -+I 14- tr(SCK) II II i.. I I ..- - 1..~I- lw(SCK) ,,Y-___,oi.. I ---""- CLKR I I I I II lh(DR) -.i 14- lf(SCK) -+II I~ I I 411 14- lh(FS) I II II li. .. - ......+-1- lw(SCK) FSR _A.,.i--+-:-\ I! I.. •I lsu(FS) I I ~ l4t DR Figure 14. Serial Port Receive Timing TEXAS INSIR.UMENTS .JI POST OFFICE BOX 1443 ° HOUSTON, TEXAS 77001 A-37 TMS320C25, TMS320E25 DIGITAL SIGNAL PROCESSORS SPRS01O~AY1987-REVISED DECEMBER 1992 PARAMETER MEASUREMENT INFORMATION I+-- lc(SCK) ~ CLKX tw(SCK) 14 I 111>1 I -+I I I I r- tr(SCK) I I I : td~CH·DX) -+I i.-' I I I I 1--J ~ tf(SC~ I I I I ~ ~ th(FS) I 14 111>1 I lw(SCK) __/i'I I I I I FSX (Input, TXM=O) tsu(FS) I 14 •I I I \ I I I I I I I -+I I I I+- id (CH·DX) 14 I lll>j ld(FL·DX) I DX -+I I I I I I I I ( 14"- ld(CH-FS) -+! 14- td(CH·FS) N = 1 ~ :: x N =8,16 ) FSX I (Output, TXM 1)= I ~ Figure 15. Serial Port Transmit Timing TEXAS.,, INSTRUMENTS A-38 POST OFFICE BOX 1443 ° HOUSTON, TEXAS 77001 TMS320C25 SPRS01 OC-MAY 1987-REVISED DECEMBER 1992 PARAMETER MEASUREMENT INFORMATION CLKOUT1 FETCH Branch Address FETCH Next Instruction FETCH A15-AO BIOZ PCI= N PC= N + 1 PC= N +2 or Branch Address tsu(IN) -.I *- I I ~..., I'- .,,,., I Valid Figure 16. BIO Timing CLKOUT1 FETCH A15-AO SXF/RXF Valid Valid Valid PC=N PC= N + 1 PC= N + 2 PC= N + 3 X F " " I___v_a1_1d_ __ Figure 17. External Flag Timing TEXAS INSfRUMENTS ..fl POST OFFICE BOX 1443 • HOUSTON, TEXAS 77001 A-39 TMS320C25 SPRS010C-MAY 1987-REVISED DECEMBER 1992 PARAMETER MEASUREMENT INFORMATION CLKOUT1 CLKOUT2 --.i j+- tcl(C2H-H) t HOLD ---- I A15-AO N N +1 N+2 PS,D~ or IS =>0< Valid )0(: Valid w ~------­ ~------- -+! I+- lclls(C1 L-A) I I D1!H>O ------<11~>-----<~>---------+:-•:------­ I --.i ~ ldl&{AL-A) HOLDA ~-----------------------+-.. I II I --.i I+- ld(C1 L-AL) t HOLD is an asynchronous input and can occur at anytime during a clock cycle. If the specified timing is met, the exact sequence shown will occur; otherwise, a delay of one CLKOUT2 cycle will occur. Figure 18. HOLD Timing (Part A) TEXAS~ INSIRUMENTS A-40 POST OFFICE BOX 1443. HOUSTON, TEXAS noo1 TMS320C25 SPRS010C-MAY 1987-REVISED DECEMBER 1992 PARAMETER MEASUREMENT INFORMATION CLKOUT1 CLKOUT2 ~ i.- ten(A-C1L) STRB ~~~--+-~~~~~~~~~---'' \__/ I I !+- ld(C2H-H) t I I I I I I I PS,DS, -~~~~~:~~~~~~~~--/j(J)?J' Valld ) oriS I ~ I / Rfii ~~~~~:1--~~~~~~--W' I 015-DO ~-----..i----------+-----------~0-ln I I -.i :.-- ld(HH-AH) I I I A1S-AO - - - - - - - - - - - - - - - ~ N+2 ~ N +2 > FETCH .... . .. N+2 .. EXECUTE .... .. .. N+1 .. t HOLD is an asynchronous input and can occur at anytime during a clock cycle. If the specified timing is met, the exact sequence shown will occur; otherwise, a delay of one CLKOUT2 cycle will occur. Figure 19. HOLD Timing (Part B) TEXAS~ INSTRUMENTS POST OFFICE BOX 1443 • HOUSTON, TEXAS 77001 A-41 TMS320C25, TMS320E25 DIGITAL SIGNAL PROCESSORS SPRS01OC-MAY1987-REVISED DECEMBER 1992 TYPICAL SUPPLY CURRENT CHARACTERISTICS FOR TMS320C25 Ice vs f(CLKIN) and Vee Ice vs f(CLKIN) and Vee Normal Operating Mode Powerdown Mode 80 vcc=5.50V vcc=5.25V 70 vcc = 5.oov Vcc=4.75V 60 Vee= 4.50V ci: E 50 j 40 30 20 10 8 12 16 20 24 28 32 36 40 44 48 52 f(CLKIN)o MHz TMS320C25FNL (PLCC) reflow soldering precautions Recent tests have identified an industry-wide problem experienced by surface mounted devices exposed to reflow soldering temperatures. This problem involves a package cracking phenomenon sometimes experienced by large (e.g., 68-lead) plastic leaded chip carrier (PLCC) packages during surface mount manufacturing. This phenomenon occur if the TMS320C25FNL is exposed to uncontrolled levels of humidity prior to reflow solder. This moisture can flash to steam during solder reflow, causing sufficient stress to crack the package and compromise device integrity. If the TMS320C25FNL is being socketed, no special handling precautions are required. In addition, once the device is soldered into the board, no special handling precautions are required. In order to minimize moisture absorption, Tl ships the TMS320C25FNL in "dry pack" shipping bags with a RH indicator card and moisture-absorbing desiccant. These moisture-barrier shipping bags will adequately block moisture transmission to allow shelf storage for 12 months from date of seal when stored at less than 60% relative humidity (RH) and less than 30°C. Devices may be stored outside the sealed bags indefinitely if stored at less than 25% RH and 30°C. Once the bag seal is broken, the devices should be stored at less than 60% RH and 30°C as well as reflow soldered within two days of removal. In the event that either of the above conditions is not met, Tl recommends these devices be baked in a clean oven at 125°C and 10% maximum RH for 24 hours. This restores the devices to their "dry packed" moisture level. NOTE Shipping tubes will not withstand the 125°C baking process. Devices should be transferred to a metal tray or tube before baking. Standard ESD precautions should be followed. In addition, Tl recommends that the reflow process not exceed two solder cycles and the temperature not exceed 220°c. If you have any additional questions or concerns, please contact your local Tl representative. TEXAS~ INSTRUMENTS A-42 POST OFFICE BOX 1443 • HOUSTON, TEXAS 77001 TMS320C25, TMS320E25 DIGITAL SIGNAL PROCESSORS SPRS010C-MAY 1987-REVISED DECEMBER 1992 MECHANICAL DATA 68-pln GB grid array ceramic package (TMS320C25) 28,448 (1.120) 27,432 (1.080) I Thermal Reelstance Characteristics 17,0~ 6i::.670) , I PARAMETER MAX UNIT Junction-to-free-air ~1 ReJA thermal resistance 36 ·crw 28,448 (1.120) Junction-to-case 27,432 (1.080) ReJC thermal resistance 6 ·crw 17,02 (0.670) NOM 4,953 (0.195) .,.___.._____.....__ __l 1,397 2,032 (0.080) - - - - ...- - - - - - - . MAX (0.055) 3,302 (0.130) 2,794 (0.110) 0,508 (0.020) 0,406 (0.016) JL 2,54 (0.100) T.P. L @@@©@©©© 2,54 (0.100) K @©@ © © ©@@ @©f*tf--~ T.P. J ©© ©--~ H @@ @@ G F @@ @@ E @@ @@ D @@ @@ c ©© ©© B @@ @@ 1,524 (0.060) NOM A © © © © @ © © © © ".~~.-------­ 4 Places © © © © © © © © 1#---1------ 1 2 3 4 5 6 7 8 9 10 11 1,27 (0.050) NOM ALL LINEAR DIMENSIONS ARE IN MILLIMETERS AND PARENTHETICALLY IN INCHES TEXAS INSIR.UMENTS ..If POST OFFICE BOX 1443 • HOUSTON, TEXAS 77001 A-43 TMS320C25, TMS320E25 DIGITAL SIGNAL PROCESSORS SPRS010C-MAY 1987-REVISED DECEMBER 1992 68-lead plastic leaded chip carrier package (TMS320C25, TMS320C25-33, and TMS320C25-50) Seating Plane 1,27 (0.050) T.P. I 0,25 (0.010) R MAX (see Note B) I 3Places I 24,33 (0.956) 24, 13 (0.950) 23,62 (0.930) (see Note A) 23,11 (0.910) (At Seating Plane) 25,27 (0.995) 25,02 (0. 985) ,, , ~-""' .J 0,94 (0.037) 0,69 (0.027) R I 1,07 (0.042) x 45 1,35 (0.053) ~ x45° 1,19 (0.047) 24,33 (0.956) 24,13 (0.950) (see Note A) 25,27 (0.995) 4,50 (0.177) - - - - - 25,02 (0.985) - - - 4,24 (0.167) ReJA ReJC Thermal Resistance Characteristics PARAMETER Junction-to-free-air thermal resistance Junction-to-case MAX 51.3 14.5 UNIT 'C/W 'C/W 0,81 (0.032) ~··~, rnwJ;· . ~~-~, 1 52 (0 060) MIN _J l thermal resistance 0,51 (0.020) 0,36 (0.014) Lead Detail ALL LINEAR DIMENSIONS ARE IN MILLIMETERS AND PARENTHETICALLY IN INCHES NOTES: A. Centerline of center pin, each side, is within 0, 10 (0.004) of package centerline as determined by this dimension. B. Location of each pin is within 0, 127 (0.005) of true position with respect to center pin on each side. WARNING When reflow soldering is required, refer to page 42 for special handling instructions. TEXAS~ INsrRUMENTS A-44 POST OFFICE BOX 1443 • HOUSTON, TEXAS 77001 TMS320E25 SPRS010C-MAY 1987-REVISED DECEMBER 1992 MECHANICAL DATA 68-lead FZ CER-QUAD, ceramic leaded chip carrier package (TMS320E25 only) This hermetically-sealed chip carrier package consists of a ceramic base, ceramic cap, and a 68-lead frame. Hermetic sealing is accomplished with glass. The FZ package is intended tor both socket- or surface-mounting. Having a Sn/Pb ratio of 60/40, the tin/lead-coated leads do not require special cleaning or processing when being surface-mounted. The 28-pin package is shown in the illustration; refer to the table below for 68-pin package dimensions. --------- 4,57 (0.180) 3,94 (0.155) 3,55 (0.140) 3,05 (0. 120) ........ A --r~i 0,81 (0.032) 0,66 (0.026) .,.........................-i. (see Note A) 0,64 (0.025) R MAX 1,016 (0.040) MIN 3 Places Ref Thermal Resistance Characteristics 3,05 (0. 120) PARAMETER Max UNIT i.---r- 2,29 (0.090) I Junction-to-free-air I ReJA thermal resistance 49 ·crw Seating Plane (see lfote D) Junction-to-case ReJC thermal resistance 8 ·crw ALL LINEAR DIMENSIONS ARE IN MILLIMETERS AND PARENTHETICALLY IN INCHES NOTES: A. Glass is optional, and the diameter is dependent on device application. B. Centerline of center pin, each side, is within o, 1o (0.004) of package centerline as determined by dimension B. C. Location of each pin is within 0, 127 (0.005) of true position with respect to center pin on each side. D. The lead contact points are within 0, 15 (0.006) of being planar. TEXAS INSIR.UMENTS ..If POST OFFICE BOX 1443 ° HOUSTON, TEXAS 77001 A-45 TMS320E25 SPRS01OC-MAY1987-REVISED DECEMBER 1992 programming the TMS320E25 EPROM cell The TMS320E25 includes a 4K x 16-bit EPROM, implemented from an industry-standard EPROM cell, to perform prototyping and early field testing and to achieve low-volume production. When used with a 4K-word masked-ROM TMS320C25, the TMS320E25 yields a high-volume, low-cost production as a result of more migration paths for data. An EPROM adapter socket (part# TMDX3270120), shown in Figure 20, is available to provide 68-pin to 28-pin conversion for programming the TMS320E25. Figure 20. EPROM Adapter Socket Key features of the EPROM cell include standard programming and verification. For security against copyright violations, the EPROM cell features an internal protection mechanism to prevent proprietary code from being read. The protection feature can be used to protect reading the EPROM contents. This section describes erasure, fast programming and verification, and EPROM protection and verification. fast programming and verification The TMS320E25 EPROM cell is programmed using the same family and device codes as the TMS27C64 SK x 8-bit EPROM. The TMS27C64 EPROM series are ultraviolet-light erasable, electrically programmable read-only memories, fabricated using HVCMOS technology. The TMS27C64 is pin-compatible with existing 28-pin ROMs and EPROMs. The TMS320E25, like the TMS27C64, operates from a single 5-V supply in the read mode; however, a 12.5-V supply is needed for programming. All programming signals are TTL level. For programming outside the system, existing EPROM programmers can be used. Locations may be programmed singly, in blocks, or at random. When programmed in blocks, the data is loaded into the EPROM cell one byte at a time, the high byte first and the low byte second. TEXAS..,, INSTRUMENTS A-46 POST OFFICE BOX 1443 • HOUSTON, TEXAS 77001 TMS320E25 SPRS010C-MAY 1987-REVISED DECEMBER 1992 Figure 21 shows the wiring conversion to program the TMS320E25 using the 28-pin pinout of the TMS27C64. The pin nomenclature table provides a description of the TMS27C64 pins. The code to be programmed into the device should be serial mode. The TMS320E25 uses 13 address lines to address the 4K-word memory in byte format. 9 8 7 6 5 4 3 2 1 68 67 66 65 64 63 62 61 TMS27e64 10 60 Vee 11 59 12 58 PGM 13 57 EPT 14 56 AB 15 55 A9 16 54 A11 17 53 G TMS320E25 eLKIN 18 68-Pln (FZ) 52 A10 19 51 E 20 50 QB 21 49 Q7 22 48 Q8 Q5 23 47 24 46 Q4 25 45 26 44 27HH~~~~M~-~-H~~GU I Pin Nomenclature (TMS320E25) SIGNALS 1/0 DEFINITION A12 (MSB}-AO (LSB) I On-chip EPROM programming address lines CLIN I Clock oscillator input E I EPRCM chip select EPT I EPROM test mode select G I EPROM read/Verify select GND I Ground PGM I EPROM write/program select as (MSB)-01 (LSB) 1/0 Data lines for byte-wide programming of on-chip SK bytes of EPROM RS I Reset for Initializing the device Vee I 5-V power supply Vpp I 12.5-V power supply_ Figure 21. TMS320E25 EPROM Conversion to TMS27C64 EPROM Plnout TEXAS INSIR.UMENIS 'f POST OFFICE BOX 1443 • HOUSTON. TEXAS 77001 A-47 TMS320E25 SPRS010C-MAY 1987-REVISED DECEMBER 1992 Table 4 shows the programming levels required for programming, verifying and reading the EPROM cell. The paragraphs following the table describe the function of each programming level. Table 4. TMS320E25 Programming Mode Levels SIGNAL TMS320E25 TMS27C64 PROGRAM PROGRAM PROGRAM READ OUTPUT NAMEt PIN PIN VERIFY INHIBIT DISABLE E 22 20 V1L V1L V1H V1L V1L G 42 22 V1H PULSE x PULSE V1H PGM 41 27 PULSE V1H x VJH V1H Vpp 25 1 Vpp Vpp Vpp Vee Vee Vee 61,35 28 Vee+1 Vee+1 Vee+1 Vee Vee Vss 27,44,10 14 Vss Vss Vss Vss Vss eLKIN 52 14 Vss Vss Vss Vss Vss RS 65 14 Vss Vss Vss Vss Vss EPT 24 26 Vss Vss Vss Vss Vss 01-08 18-11 11-13,15-19 D1N OouT Hl-Z oouT Hl-Z A12-A10 40-38 2,23,21, ADDR ADDR x ADDR x A9-A7 37,36,34 24,25,3 ADDA ADDR x ADDR x A6 33 4 ADDR ADDR x ADDR x A5 32 5 ADDR ADDR x ADDR x A4 31 6 ADDR ADDR x ADDR x A3-AO 30-28,26 7-10 ADDR ADDR x ADDR x t In accordance with TMS27e64. LEGEND: V1H =TTL high level; V1L =TTL low level; ADDR = byte address bit Vpp = 12.5 v :1: 0.5 V; Vee = 5 :1: 0.25 V; X =don~ care PULSE = low-going TTL level pulse; D1N = byte to be programmed at ADDR OouT = byte stored at ADDR; RBIT = ROM protect bit. erasure Before programming, the device is erased by exposing the chip through the transparent lid to high-intensity ultraviolet light (wavelength 2537 A). The recommended minimum exposure dose (UV-intensity x exposure-time) is 15 W•s/cm2. A typical 12 mW/cm2, filterless UV lamp will erase the device in 21 minutes. The lamp should be located approximately 2.5 cm above the chip during erasure. After erasure, all bits are in the high state. Note that normal ambient light contains the correct wavelength for erasure. Therefore, when using the TMS320E25, the window should be covered with an opaque label. fast programming After erasure (all memory bits in the cell are logic one), logic zeroes are programmed into the desired locations. The fast programming algorithm, shown in Figure 22, is normally used to program the entire EPROM contents, although individual locations may be programmed separately. A programmed logic zero can be erased only by ultraviolet light. Data is presented in parallel (eight bits) on pins Q8-Q1. Once addresses and data are stable, PGM is pulsed. The programming mode is achieved when Vpp = 12.5 V, PGM =VIL• Vee= 6 V, G = VIH• and E= V1L More than one TMS320E25 can be programmed when the devices are connected in parallel. Locations can be programmed in any order. Programming uses two types of programming pulses: prime and final. The length of the prime pulse is 1 ms. After each prime pulse, the byte being programmed is verified. If correct data is read, the final programming pulse is applied; if correct data is not read, an additional 1-ms prime pulse is applied up to a maximum of 15 times. The final programming pulse is 4 ms times the number of prime programming pulses applied. This sequence of programming and verification is performed at Vee= 6 V, and Vpp = 12.5 V. When the full fast programming routine is complete, all bits are verified with Vee = Vpp = 5 V. 1ExAs ..,, INSIR.UMENTS A-48 POST OFFICE BOX 1443 • HOUSTON, TEXAS noo1 TMS320E25 SPRS010C-MAY 1987-REVISED DECEMBER 1992 program verify Programmed bits may be verified with Vpp = 12.5 V when G =VIL• E =VIL• and PGM = V1H· Figure 22 shows the timing for the program and verify operation. ----Start Vee= s :1:0.25 v Vpp = 12.5 V :1: 0.25 V Yes Program One Device Pulse of Falled 3X·ma Duration Increment Address Vee =Vpp = 5 V:1: 0.25V Fall Device Passed Figure 22. Fast Programming Flowchart TEXAS.,, INSIRUMENTS POST OFFICE BOX 1443 • HOUSTON, TEXAS 77001 A-49 TMS320E25 SPRS01OC-MAY1987-REVISED DECEMBER 1992 I------Program-----,.11111-- Verify ------+j A12-Ao ~===================A=dd=r=es=s=s=ta::•=1e=============::==x Address N+1 I I QS-01 (...___o_a_ta_1_n_s_ta_b1_a___)- Hl·Z:-< Data Out Valid J>-------- 1 I Vpp Vpp _ _ / Vee Vee +1 Vee Vee \_/ Figure 23. Fast Programming Timing program inhibit Programming may be inhibited by maintaining a high level input on the E pin or PGM pin. read The EPROM contents may be read independent of the programming cycle, provided the RBIT (ROM protect bit) has not been programmed. The read is accomplished by setting E to zero and pulsing Glow. The contents of the EPROM location selected by the value on the address inputs appear on 08-01. output disable During the EPROM programming process, the EPROM data outputs may be disabled, if desired, by establishing the output disable state. This state is selected by setting the G and PGM pins high. While output disable is selected, 08-01 are placed in the high-impedance state. ROM protection and verification This section describes the code protection feature included in the EPROM cell, which protects code against copyright violations. Table 6 shows the programming levels required for protecting and verifying the EPROM. The paragraphs following the table describe the protect and verify functions. 1ExAs .,, INSTRUMENTS A-50 POST OFFICE BOX 1443 •HOUSTON, TEXAS 77001 TMS320E25 SPRS010C-MAY 1987-REVISED DECEMBER 1992 Table 5. TMS320E25 Protect and Verify EPROM Mode Levels SIGNALt TMS320E25 PIN TMS27C64 PIN ROM PROTECT PROTECT VERIFY E 22 20 V1H V1L G 42 22 V1H V1L PGM 41 27 V1H V1H Vpp 25 1 Vpp Vee Vee 61,35 26 Vee+1 Vee Vss 10,27,44 14 Vss Vss eLKIN 52 14 Vss vss RS 65 14 Vss Vss EPT 24 26 Vpp Vpp Q8-Q1 18-11 11-13, 15-19 Q8= PULSE as= RBIT A12·A10 40-38 2, 23, 21, x x A9·A7 37,36,34 24,25,3 x x A6 33 4 x V1L A5 32 5 x x A4 31 6 V1H x A3·AO 30-28, 26 7-10 x x t In accordance with TMS27e64. LEGEND: V1H =TTL high level; V1L =TTL low level; Vee= 5 V :t 0.25 V Vpp = 12.5 V :t 0.5 V; X =don't care PULSE = low-going TTL level pulse; RBIT = ROM protect bit. EPROM protect The EPROM protect facility is used to completely disable reading of the EPROM contents to guarantee security of proprietary algorithms. This facility is implemented through a unique EPROM cell called the RBIT (EPROM protect bit) cell. Once the contents to be protected are programmed into the EPROM, the RBIT is programmed, disabling access to the EPROM contents and disabling the microprocessor mode on the device. Once programmed, the RBIT can be cleared only by erasing the entire EPROM array with ultraviolet light, thereby maintaining security of the propietary algoi:!!h~: Programming the RBIT is accomplished using the EPROM protect cycle, which consists of setting the E, G, PGM, and A4 pins high, Vpp and EPT to 2.5 V :1: 0.5 V, and pulsing QB low. The complete sequence of operations involved in programming the RBIT is shown in the flowchart of Figure 24. The required setups in the figure are detailed in Table 5. 1ExAs.,, INSIRUMENTS POST OFFICE BOX 1443 ° HOUSTON, TEXAS 77001 A-51 TMS320E25 SPRS010c-MAY 1987-REVISED DECEMBER 1992 Start Program One Pulae of 3X-ma Duration EPROM Protect Protect Setup Verify Setup Device Device Falled Paand Protect Verify Setup EPROM Protect Setup Figure 24. EPROM Protect Flowchart protect verify Protect verify is used following the EPROM protect to verify correct programming of the RBIT (see Figure 24). When using protect verify, 08 outputs the state of the RBIT. When RBIT = 1, the EPROM is unprotected; when RBIT = 0, the EPROM is protected. The EPROM protect and verify timings are shown in Figure 25. 1ExAs.,, INSIRUMENTS A·52 POST OFFICE BOX 1443 • HOUSTON, TEXAS 77001 TMS320E25 SPRS010C-MAY 1987-REVISED DECEMBER 1992 1 4 - - - - - - Protect -----•I I l.."lil---Verlfy •I A4~ I ~::: I I Vpp _____;fpl~~~~~~~~~~--~ : Vpp I I I Vee I I I Vee j" ~ I Vee+ 1 __/ I· I Vee I I E ---------------..1 I I - - - - - - - - - - - - - - - - - V1L V1H V1L V1H I V1L I I I V1HNOH QS -Hl·Z I Hl-Z I I V1LN0L I Vpp EPT _ _ / I I I \ Vss I V1H A6 V1L Figure 25. EPROM Protect Timing TEXAS.,, INSTRUMENTS POST OFFICE BOX 1443 • HOUSTON, TEXAS 77001 A-53 A-54 TMS320C26 Signal Processor B-2 TMS320C26 Digital Signal Processor APPENDIXB TMS320C26BFNL DIGITAL SIGNAL PROCESSOR SPRS013 - JUNE 1989 - REVISED AUGUST 1992 100-ns Instruction Cycle Time Block Moves for Data/Program Mana· • 1568 Words of Configurable On·Chlp Program/ gement Data RAM • Repeat Instructions for Efficient Use of • TMS320C25 pin for pin Compatible Program Space • TMS320C25 Object Code Compatible Except • Eight Auxiliary Registers and Dedicated for RAM Configuration Instructions Arithmetic Unit for Indirect Addressing 256 Words of On-Chip Program Boot ROM • Serial Port for Direct Codec Interface 128k Words of Data/Program Space Synchronization Input for Synchronous Multiprocessor Configurations Sixteen Input and Sixteen Output Channels Walt States for Communication to Slow Off-Chip Memories/Peripherals • 16·Bit Parallel Interface On-Chip Timer for Control Operations Directly Accessible External Data Memory Space Three External Maskable User Interrupts Global Data Memory Interface Input Pin Polled by Software Branch Ins· truction 16-Bit Instruction and Data Words Programmable Output Pin for Signalling 32-Bit ALU and Accumulator External Devices Single-Cycle Multiply/Accumulate Ins- CMOS Technology tructions Single S·V Supply O to 16-Bit Scaling Shifter On-Chip Clock· Generator Bit Manipulation and Logical Instructions Instruction Set Support for Floating-Point Operations. Adaptive Filtering, and Extended-Precision Arithmetic 68-PIN FN PLASTIC LEADED CHIP CARRIER PACKAGE (TOP VIEW) I~ lo s a: Q.---N(")o;f"l!'lri..IOQ > g a76 :-, 4 3 2 16s6766656I63"6261 ... r _ Vss 10 60L IACK D7 ,, s'jlr 59 MSC D6 12 58.,; CLKOUT 1 DS 13 57 L CLKOUT2 04 14 56 XF DJ 15 55 HOLDA D2 16 54 DX D1 17 53 FSX DO 18 52 X2 CLKIN SYNC 19 51 x1 INTO 20 50 8R INT1 21 49 STRB INT2 22 48 RW vcc 23 47 P5 DR 24 46 IS FSR 25 45 BS 44 v 55 PRODUCTION DATA Information is current as of publication date. TEXAS~ Products conform lo specifications pit the terms of Texas Instruments standard warr1nty. Production processing does not necessarily include testing ol all parameters. B-3 INSTRUMENTS TMS320C26BFNL DIGITAL SIGNAL PROCESSOR SPRS013 - JUNE 1989 - REVISED AUGUST 1992 PIN NOMENCLATURE SIGNALS 1101z• DEFINITION Vee I 5 - V supply pins. Vss I Ground pins. X1 0 Output from internal oscillator tor crystal. X2/ CLKIN I Input to internal oscillator from crystal or external clock. CLKOUT1 0 Master clock output (crystal or CLKIN frequency I 4). CLKOUT2 0 A second clock output signal. 015-DO 1/0/Z 16 - bit data bus D15 (MSB) through DO (LSB). Multiplexed between program, data and I/ 0 spaces. A15 ·AO O/Z 16 - bit address bus A15 (MSB) through AO (LSB). P8.0s.iS OIZ Program, data and I/ O space select signals. R/W OIZ Read I write signal. STRB OIZ Strobe signal. R$ I Reset input. INT2.iNTo I External user interrupt inputs. MP/MC I Microprocessor/microcomputer mode select pin. M5C 0 Microstate complete signal. IACK 0 Interrupt acknowledge signal. READY I Data ready input. Asserted by external logic when using slower devices to indicate that the current bus transaction is complete. BR 0 Bus request signal. Asserted when the TMS320C26 requires access to an external global data memory space. XF 0 External flag output (latched software - programmable signal). HOL:D I Hold input. When asserted. TMS320C26 goes into an idle mode and places the data address and control lines in the high - impedance state. HOLDA 0 Hold acknowledge signal. SYNC I Synchronization input. BIO I Branch control input. Polled by BIOZ instruction. DR I Serial data receive input. CLKR I Clock input for serial port receiver. FSA I Frame synchronization pulse tor receive input. DX OIZ Serial data transmit ouput. CLKX I Clock input for serial port transmitter. FSX I/ 0 IZ Frame synchronization pulse for transmit. May be configured as either an input or an output. • 11 0 I Z denotes input I output I high - impedance state description The TMS320C26 Digital Signal Processor is a member of the TMS320 family of VLSI digital signal processors and peripherals. The TMS320 family supports a wide range of digital signal processing applications, such as telecommunications, modems, image processing, speech processing, spectrum analysis, audio processing, digital filtering, high-speed control, graphics, and other computation in- tensive applications. With a 100-ns instruction cycle time and an innovative memory configuration, the TMS320C26 per- forms operations necessary for many real time digital signal processing algorithms. Since most in- structions require only one cycle, the TMS320C26 is capable of executing ten million instructions per second. On-chip data RAM of 1568 words of 16 bits, on-chip program ROM of 256-words, direct addressing of up to 64K-words of external data memory space and 64K-words of external program memory space, and multiprocessor interface features for sharing global memory minimize unneces- sary data transfers to take full advantage of the capabilities of the processor. TEXAS. B-4 INSTRUMENTS TMS320C26BFNL DIGITAL SIGNAL PROCESSOR SPRS013 - JUNE 1989 - REVISED AUGUST 1992 functional block diagram (TMS320C26) M u ·::::::::::;:::::::·· 16 16 16 R1W QIA1161 ffiii IA1161 REAOV ST01161 iii ST11161 Xf RPTC!IJ iilllll Hm6i IFRt61 MR iiiO iiS 1ACK ... DR CLkA ox ClkX FSX MP1MC iNT12 01-+-"------' OAAl161 A15 AO DJIAl161 TIM1161 PRDl161 IMAl&l GAEGl8l Dt!i DO ::::;:PROGRAM BUS 16 LEGEND ACCH Accumu..1or high IFR lnl•rrupt flag register PC Progr.m counter ACCL Acc:umutetor low IMR , Interrupt .,,... regi1tltf PfC - Prefetch counter ALU Arithmetic Joeic unit IA "'"ln1tn1ctlonregi1ter RPTC AepeM instruction C(K.tnter ARAU - AudiM'y r99ister Withm9hc unit MCS "'" Mtcrocaa stack GREG "" GklbM memory .moc.tion revi•t• ARB ARP Au1ilillry register pointer buff9f Au1dlillry register pointer QIR PR - Queue in1truc'9on register · Pfoduct register ••• XSR ~ S•i.t port recetve 1hih register - sen.r port lrMlsmit shlh regilt•r DP Dela nMmory p919 point., PAD ,_iod register tor tlmer ARO-AR7 - Au11illary r91iat•1 DAR ., Serilll port data receive ,agi•ter TIM Tim11r STO,ST1 · St•lu. rllgi•t.,. DXR .· Serililportd... tr..,llmilres;.t., TR : T.impor.,y regl11er c - c.,,, bit INSTRUMENTS TEXAS 'f 8-5 TMS320C26BFNL DIGITAL SIGNAL PROCESSOR SPRS013 - JUNE 1989 - REVISED AUGUST 1992 architecture The TMS320C26 architecture is based on the TMS320C25 with a different internal RAM and ROM configuration. The TMS320C26 integrates 256 words of on-chip ROM and 1568 words of on-chip RAM compared to 4K words of on-chip ROM and 544 words of on-chip RAM for the TMS320C25. The TMS320C26 is pin for pin compatible with the TMS320C25. Increased throughput on the TMS320C26 for many DSP applications is accomplished by means of single-cycle multiply/accumulate instructions with a data move option, eight auxiliary registers with a dedicated arithmetic unit, and faster 1/0 necessary for data intensive signal processing. The architectural design of the TMS320C26 emphasizes overall speed, communication, and flexibility in processor configuration. Control signals and instructions provide floating point support, block memory transfers, communication to slower off-chip devices, and multiprocessing implementations. Three large on-chip RAM blocks, configurable either as separate program and data spaces or as three contiguous data blocks, provide increased flexibility in system design. Programs of up to 256 words can be masked into the internal program ROM. The remainder of the 64K-word program memory space is located externally. Large programs can execute at full speed from this memory space. Programs can also be downloaded from slow external memory to high speed on-chip RAM. A total data memory address space of 64K words is included to facilitate implementation of DSP algo- rithms. The VLSI implementation of the TMS320C26 incorporates all of these features as well as many others, including a hardware timer, serial port, and block data transfer capabilities. 32-blt ALU/accumulator The TMS320C26 32-bit Arithmetic Logic Unit (ALU) and accumulator perform a wide range of arith- metic and logic instructions, the majority of which execute in a single clock cycle. The ALU exe- cutes a variety of branch instructions dependent on the status of the ALU or a single bit in a word. These instructions provide the following capabilities: • Branch to an address specified by the accumulator. • Normalize fixed point numbers contained in the accumulator. • Test a specified bit of a word in data memory. One input to the ALU is always provided from the accumulator, and the other input may be provided from the Product Register (PR) of the multiplier or the input scaling shifter which has fetched data from the RAM on the data bus. After the ALU has performed the arithmetic or logical operations, the result is stored in the accumulator. The 32-bit accumulator is split into two 16-bit segments for storage in data memory. Additional shifters at the output of the accumulator perform shifts while the data is being transferred to the data bus for storage. The contents of the accumulator remain unchanged. scaling shifter The TMS320C26 scaling shifter has a 16-bit input connected to the data bus and a 32-bit output con- nected to the ALU. The scaling shifter produces a left shift of O to 16-bits on the input data, as spe- cified in the instruction word. The LSBs of the output are filled with zeroes, and the MSBs may be either filled with zeroes or sign extended, depending upon the value of the SXM (sign extension mode) bit of status register STO. B-6 TEXAS~ INSTRUMENTS TMS320C26BFNL DIGITAL SIGNAL PROCESSOR SPRS013 - JUNE 1989 - REVISED AUGUST 1992 16 x 16 bit parallel multiplier The TMS320C26 has a 16 x 16 bit-hardware multiplier, which is capable of computing a signed or unsigned 32-bit product in a single machine cycle. The multiplier has the following two associated registers: • A 16-bit Temporary Registers (TR) that holds one of the operands for the multiplier, and • A 32-bit Product Register (PR) that holds the product. Incorporated into the TMS320C26 instruction set are single-cycle multiply/accumulate instructions that allow both operands to be fetched simultaneously. The data for these operations may reside anywhere in internal or external memory, and can be transferred to the multiplier each cycle via the program and data buses. Four product shift modes are available at the Product Register (PR) output that are useful when per- forming multiply/accumulate operations, fractional arithmetic, or justifying fractional products. timer The TMS320C26 provides a memory mapped 16-bit timer for control operations. The on-chip timer (TIM) register is a down counter that is continuously clocked by CLKOUT 1. A timer interrupt (TINT) is generated every time the timer decrements to zero, provided the timer interrupt is enabled. The timer is reloaded with the value contained in the period (PAD) register within the next cycle after it reaches zero so that interrupts may be programmed to occur at regular intervals of PAD + 1 cycles of CLKOUT 1. memory control The TMS320C26 provides a total of 1568 words of 16 bit on-chip data RAM, divided into four sepa- rate blocks (BO, B1, B2, and B3). Of the 1568 words, 32 words (block B2) are always data memory, and all other words are programmable as either data or program memory. A data memory size of 1568 words allows the TMS320C26 to handle a data array of 1536 words, while still leaving 32 loca- tions for intermediate storage. When using BO, B1, or B3 as program memory, instructions can be downloaded from external program memory into on-chip RAM, and then executed. When using on-chip program RAM, ROM, or high speed external program memory, the TMS320C26 runs at full speed without wait states. However, the READY line can be used to interface the TMS320C26 to slower, less expensive external memory. Downloading programs from slow off-chip memory to on-chip program RAM speeds processing and cuts system costs. The TMS320C26 provides three separate address spaces for program memory, data memory, and 1/0. The on-chip memory is mapped into either the 64K-word data memory or program memory space, depending upon the choice of memory configuration. The CONF O (configure all blocks as data memory), CONF 1 (configure block BO as program memory), CONF 2 (configure block BO and B1 as program memory) and CONF 3 (configure BO, B1, and B3 as program memory) instructions allow dynamic configuration of the memory maps through software. Regardless of the configuration, the user may still execute from external program memory. The TMS320C26 has six registers that are mapped into the data memory space at locations 0-5; a serial port data receive register, serial port data transmit register, timer register, period register, interrupt mask register, and global memory allocation register. TEXAS~ B-7 INSTRUMENTS TMS320C26BFNL DIGITAL SIGNAL PROCESSOR SPRS013- JUNE 1989- REVISED AUGUST 1992 A. MEMORY MAPS AFTER A RESET OR CONF 0 A.1 MP/'1C =1 PROGRAM DATA 110 0 (>0000) 31 (>001F) 32 (>0020) INTERRUPTS !AND RESERVED -(EXTERNAL)- 0 (>0000) 5 (>0005) 6 (>0006) ON-CHIP MM Rs RESERVED PAGEO 1: I EXTERNAL 95 (>005F) 96 (>0060) ON'-CHIP BLOCK B2 127 (>007F) 128 (>0080) EXTERNAL 511 (>01FF) 512 (>0200) RESERVED ON ·CHIP f PAGE 1 ·3 1023 (>03FF) 1024 (>0400) BLOCK BO f PAGE 4 • 7 ON -CHIP 1535 (>05FF) BLOCK B1 f PAGEB-11 1536 ( > 0600) ON ·CHIP 2047 (>07FF) BLOCK B3 f PAGE 12-15 2048 ( > 0800) 65535 (>FFFF) 65535 (> FFFF) EXTERNAL f PAGE 16 • 511 A.2MP~ =0 PROGRAM DATA 1/0 0 (>0000) I INTERRUPlS 0 (>0000) ON-CHIP AND RESERVED MMRs EXTERNAL BOOTLOAD 5 (>0005) 1: ROM 6 (>0006) RESERVED PAGEO 255 (>OOFF) 95 (>005F) 256 (>0100) 96 (>0060) ON -CHIP RESERVED BLOCK B2 127 (>007F) 4096 (>OFFF) 128 (>0080) RESERVED PAGE 1 • 3 4096 (>1000) 511 (>01FF) 512 (>0200) f ON· CHIP 1023 (>03FF) 1024 (>0400) BLOCK BO ON ·CHIP f PAGE 4 • 7 EXTERNAL 1535 (>05FF) BLOCK B1 f PAGE8·11 ~ 1536 ( > 0800) ON -CHIP BLOCK B3 PAGE 12 • 15 2047 ( > 07FF) 2048 ( > 0800) 86535 (>FFFF) 65535 ( > FFFF) EXTERNAL f PAGE 16·511 Figure 1a. Memory maps TEXAS" B-8 INSTRUMENTS TMS320C26BFNL DIGITAL SIGNAL PROCESSOR SPRS013 - JUNE 1989 - REVISED AUGUST 1992 B. MEMORY MAPS AFTER CONF 1 8.1 MP/~= 1 PROGRAM DATA 1/0 0 (>0000) 0 (>0000) ON ·CHIP INTERRUPTS AND RESERVED (EXTERNAL) 5 (>0005) MM Rs 1°5 I EXTERNAL ~----~ 31 (>001F) 6 (>0006) RESERVED PAGE 0 32 (>0020) 95 (>005F) 96 (>0060) ON ·CHIP BLOCK B2 127 (>007F) EXTERNAL 128 (>0080) RESERVED ( PAGE 1 · 3 511 (>01FF) 512 (>0200) DOES NOT 63999 (>F9FF) EXIST ( PAGE 4 · 7 64000 (>FAOO) 1023 (>03FF) ON-CHIP 1024 (>0400) ON· CHIP BLOCK BO BLOCK Bl ( PAGE8·11 64511 (>FBFF) 1535 (>05FF) 64512 (>FCOO) 1536 (>0600) ON· CHIP EXTERNAL BLOCK B3 (PAGE12·15 65023 (>FDFF) 2047 (>07FF) 65024 (>FEOO) 2048 ( > 0800) EXTERNAL EXTERNAL ( PAGE 16 · 511 65535 (>FFFF) 65535 ( > FFFF) B.2 MP/MC= 0 PROGRAM DATA I /O 0 (>0000) INTERRUPTS 0 (>0000) AND RESERVED BOOTLOAD ROM 5 (>0005) ON· CHIP MM Rs 1°5 I EXTERNAL ~----~ 255 (>OOFF) 6 (>0006) RESERVED 256 (>0100) 95 (>005F) RESERVED 96 (>0060) PAGE 0 4095 (>OFFF) 4096 (>1000) ON ·CHIP BLOCK B2 127 (>007F) !~ 128 (>0080) EXTERNAL RESERVED PAGE 1 3 511 (>01FF) 512 (>0200) DOES NOT 63999 (>F9FF) EXIST PAGE 4· 7 1023 (>03FF) 64000 (>FAOO) 1024 (>0400) ON-CHIP ~ ON ·CHIP BLOCK BO BLOCK 81 PAGE B · 11 64511 (>FBFF) 1535 ( >05FF) 64512 (>FCOO) 1536 ( > 0600) 65023 (>FDFF) EXTERNAL 2047 (>07FF) 2048 ( > 0800) ON ·CHIP BLOCK B3 ( PAGE 12 · 15 65024 (>FEOO) 65535 (>FFFF) EXTERNAL 65535 (> FFFF) EXTERNAL ( PAGE 16 . 511 Figure 1b. Memory maps TEXAS INSTRUMENTS -l!J B-9 TMS320C26BFNL DIGITAL SIGNAL PROCESSOR SPRS013 - JUNE 1989 - REVISED AUGUST 1992 C. MEMORY MAPS AFTER CONF 2 C. 1 MP/MU= 1 PROGRAM DATA 1/0 0 (>0000) I INTERRUPTS 0 (>0000) ON-CHIP AND RESERVED MM Rs EXTERNAL 5 (>0005) 1: (EXTERNAL) 31 (>001F) 6 (>0006) RESERVED PAGE 0 32 (>0020) 95 (>005F) 96 (>0060) ON-CHIP BLOCK B2 127 (>007F) 128 (>0080) EXTERNAL 511 (>01FF) RESERVED ( PAGE 1 -3 512 (>0200) 63999 (>F9FF) 64000 (>FAOO) 1023 (>03FF) DOES NOT EXIST ( PAGE 4 - 7 ON-CHIP 1024 (>0400) DOES NOT BLOCK BO 64511 (>FBFF) 64512 (>FCOO) 1535 (>05FF) EXIST f PAGE 8 -11 ON-CHIP 1536 (>0600) ON-CHIP BLOCKB1 BLOCK B3 65023 (>FDFF) 65024 (>FEOO) 2047 (>07FF) f PAGE 12 -15 2048 ( > 0800) EXTERNAL EXTERNAL PAGE 16 - 511 65535 (>FFFF) 65535 ( > FFFF) f C.2 MP/'1C = 0 PROGRAM DATA 1/0 0 (>0000) INTERRUPTS I 0 (>0000) ON -CHIP AND RESERVED MMRs EXTERNAL BOOTLOAO 1: 5 (>0005) 255 (>OOFF) ROM 6 (>0006) RESERVED 256 (>0100) 95 (>005F) RESERVED 96 (>0060) PAGEO 4095 (>OFFF) 4096 (>1000) ON-CHIP BLOCK B2 EXTERNAL 127 (>007F) 128 (>0080) 511 (>01FF) 512 (>0200) RESERVED I. ., ., 63999 (>F9FF) 64000 (>FAOO) 1023 (>03FF) DOES NOT EXIST f PAGE 4 - 7 ON-CHIP 1024 (>0400) 64511 (>FBFF) BLOCK BO 1535 (>05FF) DOES NOT EXIST f PAGE 8-11 64512 (>FCOO) 1536 (>0600) ON-CHIP 65023 (>FDFF) BLOCKB1 2047 (>07FF) ON-CHIP BLOCK B3 t PAGE 12-15 65024 (>FEOO) 2048 ( > 0800) 65535 (>FFFF) EXTERNAL 65535 ( > FFFF) EXTERNAL t PAGE 16-511 Figure 1c. Memory maps TEXAS.,, 8-10 INSTRUMENTS TMS320C26BFNL DIGITAL SIGNAL PROCESSOR SPRS013 - JUNE 1989 - REVISED AUGUST 1992 D. MEMORY MAPS AFTER CONF 3 D 1 MP/l;lC = 1 PROGRAM DATA 110 0 {>0000) O I >0000) ON· CHIP INTERRUPTS AND RESERVED (EXTERNAL) 5(>0005) MM Rs 1°5 I EXTERNAL '--------' 31 (>001F) 6 (>0006) RESERVED PAGE 0 32 (>0020) 95 I >005F) 96 (>0060) ON -CHIP BLOCK B2 i27 ( .·007F) EXTERNAL 128 ( >0080) 511 (>01FF) RESERVED t PAGE 1 - 3 63999 {>F9FF) 64000 (>FAOO) 512 (>0200) 1023 (>03FFi DOES NOT EXIST t PAGE 4 - 7 ON-CHIP 1024 I> 0400) DOES NOT BLOCK BO EXIST ( PAGE8-11 64511 (>FBFF) 1535 (>05FFi 64512 (>FCOO) 65023 (>FDFF) ON-CHIP BLOCKB1 1536 (>0600) 2047 (>07FF) DOES NOT EXIST t PAGE12-15 65024 (>FEOO) 65535 (>FFFF) ON-CHIP BLOCKB3 2048 I> 08001 65535 ( > FFFF) EXTERNAL t PAGE 16 - 511 D.2 MP/MC = 0 PROGRAM DATA 110 0 (>0000) INTERRUPTS AND RESERVED BOOTLOAD 0 (>0000) 5 (>0005) ON -CHIP MM Rs 0 I EXTERNAL 15 ~----~ 255 (>OOFF) ROM 6 (>0006) RESERVED 256 (>0100) 95 (>005F) RESERVED 96 (>0060) PAGE 0 4095 (>OFFF) 4096 (>1000) ON -CHIP BLOCK B2 l 127 (>007F) 128 (>0080) EXTERNAL RESERVED "G" 0 511 (>01FF) 512 (>0200) 63999 (>F9FF) 64000 (>FAOO) 1023 (>03FF) 1024 (>0400) DOES NOT EXIST t PAGE 4 · 7 ON-CHIP DOES NOT BLOCK BO EXIST (PAGE 8· 11 64511 (>FBFF) 1535 ( > 05FF) 64512 (>FCOO) 1536 (>0600) ~PAGE 12-15 ON-CHIP DOES NOT BLOCKB1 EXIST 65023 (>FDFF) 2047 (>07FF) 2048 ( > 0800) 65024 (>FEOO) 65535 (>FFFF) ON-CHIP BLOCKB3 65535 ( > FFFF) EXTERNAL t PAGE 16 · 511 Figure 1d. Memory maps interrupts and subroutine The TMS320C26 has three external maskable user interrupts INT 2 - INT 0, available for external devices that interrupt the processor. Internal interrupts are generated by the serial port (RINT and XINT), by thLtimer (TINT), and by the software interrupt (TRAP) instruction. Interrupts are prioritized with reset (RS) having the highest priority and the serial port transmit interrupt (XINT) having the lowest priority. All interrupt locations are on two-words boundaries so that branch instructions can be accommodated in those locations if desired. TEXAS'!> INSTRUMENTS B-11 TMS320C26BFNL DIGITAL SIGNAL PROCESSOR SPRS013 - JUNE 1989 - REVISED AUGUST 1992 A built in mechanism protects multicycle instructions from interrupts. If an interrupt occurs during a multicycle instruction, the interrupt is not processed until the instruction is completed. This mechanism applies both to instructions that are repeated or become multicycle due to the READY signal. external interface The TMS320C26 supports a wide range of system interfacing requirements. Program, data, and 1/0 address spaces provide interface to memory and 1/0, this maximizing system throughput. 1/0 design is simplified by having 1/0 treated the same way as memory. 110 devices are mapped into the 1/0 ad- dress space using the processor's external address and data busses in the same manner as memory- mapped devices. Interface to memory and 1/0 devices of varying speeds is accomplished by using the READY line. When transactions are made with slower devices, the TMS320C26 processor waits until the other device completes its function and signals the processor via the READY line. Then, the TMS320C26 continues execution. A serial port provides communication with serial devices, such as codecs, serial AID converters, and other serial systems. The interface signals are compatible with codecs and many other serial devices with a minimum of external hardware. The serial port may also be used for intercommunication be- tween processors in multiprocessing applications. The serial port has two memory mapped registers; the data transmit register (DXR) and the data receive register (ORR). Both registers operate in either the byte mode or 16-bit word mode, and may be accessed in the same manner as any other data memory location. Each register has an external clock, a framing signal, and associated shift registers. One method of multiprocessing may be im- plemented by programming one device to transmit while the others are in the receive mode. multiprocessir.g The flexibility of the TMS320C26 allows configurations to satisfy a wide range of system require- ments. The TMS320C26 can be used as follows: • A standalone processor. • A multiprocessor with devices in parallel • A multiprocessor with global memory space. • A peripheral processor interfaced via processor controlled signals to another device. For multiprocessing applications, the TMS320C26 has the C..fil2.ability of allocating global data memory space and communicating with that space via the BR (bus request) and READY control signals. Global memory is data memory shared by more than one processor. Global data memory ac- cess must be arbitrated. The 8-bit memory mapped GREG (global memory allocation register) speci- fies part of the TMS320C26's data memory as global external memory. The contents of the register determines the size of the global memory space. If the current instruction addresses a location within that space, BR is asserted to request control of the data bus. The length of the memory cycle is controlled by the READY line. The TMS320C2~rts OMA (direct memory access) to its external program/data memory using the HOLD and HOLDA signals. Another processor can take complete control of the TMS320C26's external memory by asserting HOLD low. This causes the TMS320C26 to place its address, data, and control lines in a high impedance state, and assert HOLDA. instruction set The TMS320C26 microprocessor implements a comprehensive instruction set that supports both nu- meric intensive signal processing operations as well as general purpose applications, such as mul- tiprocessing and high speed control. For maximum throughput, the next instruction is prefet~hed while the current one is being executed. Since the same data lines are used to communicate to external data/program or 1/0 space, the num- ber of cycles may vary depending upon whether the next data operand fetch is from internal or ex- ternal program memory. Highest throughput is achieved by maintaining data memory on-chip and using either internal or fast external program memory. B-12 TEXAS INSTRUMENTS l/I TMS320C26BFNL DIGITAL SIGNAL PROCESSOR SPRS013 - JUNE 1989 - REVISED AUGUST 1992 addressing modes The TMS320C26 instruction set provides three memory addressing modes: direct, indirect, and im- mediate addressing. Both direct and indirect addressing can be used to access data memory. In direct addressing, seven bits of the instruction word are concatenated with the nine bits of the data memory page pointer to form the 16-bit data memory address. Indirect addressing accesses data memory through the eight auxiliary registers. In immediate addressing, the data is embedded in the instruction word (s). In direct memory addressing, the instruction word contains the lower seven bits of the data memory address. This field is concatenated with the riine bits of the data memory page pointer to form the full 16-bit address. Thus, memory is paged in the direct addressing mode with a total of 512 pages, each page containing 128 wo_rds. Eight auxiliary registers (ARO-AR?) provide flexible and powerful indirect addressing. To select a specific auxiliary register, the Auxiliary Register Pointer (ARP) is loaded with a value from O through 7 for ARO through AR7 respectively. There are seven types of indirect addressing: auto increment, auto decrement, post indexing by either adding or subtracting the contents of ARO, single indirect addressing with no increment or decrement and bit reversal addressing (used in FFTS) with increment or decrement. All operations are performed on the current auxiliary register in the same cycle as the original instruction, followed by an ARP update. repeat feature A repeat feature, used with instructions such as multiply/accumulates, block moves, 1/0 transfers, and table read/writes, allows a single instruction to be executed up to 256 times. The repeat counter (RPTC) is loaded with either a data memory value (APT instruction) or an immediate value (RPTK in- struction). The value of this operand is one less than the number of times that the next instruction is executed. Those instructions that are normally multicycle are pipelined when using the repeat fea- ture, and effectively become single-cycle instructions. instruction set summary Table 1 lists the symbols and abbreviations used in Table 2, the instruction set summary. Table 2 consists primarily of single-cycle, single-word instructions. Infrequently used branch, 1-0, and CALL instructions are multicycle. The instruction set summary is arranged according to function and alphabetized within each functional grouping. The symbol (t) indicates those instructions that are not included in the TMS3201 Oinstruction set. The symbol (#) indicates instructions that are not included in the TMS320C25 instruction set. TABLE 1. INSTRUCTION SYMBOLS SYMBOL MEANING B 4 - bit field specifying a bit code CM 2 - bit field specifying compare mode D Data memory address field FO Format status bit M Addressing mode bit K Immediate operand field PA Port address (PAO through PA 15_are predefined assembler symbols equal to 0 through 15 respectively.) PM 2 - bit field specifying P register output shift code R 3 ·bit operand field specifying auxiliary register s 4 - bit left-shift code x 3 - bit accumulator left-shift field TEXAS~ INSTRUMENTS B-13 TMS320C26BFNL DIGITAL SIGNAL PROCESSOR SPRS013 - JUNE 1989 - REVISED AUGUST 1992 TABLE 2. TMS320C26 INSTRUCTION SET SUMMARY ACCUMULATOR MEMORY REFERENCE INSTRUCTIONS NO. INSTRUCTION BIT CODE MNEMONIC DESCRIPTION WORDS 1 0 -s- 151413121110 9 8 7 6 5 4 3 2 ABS Absolute value of accumulator 1 1 1 0 0 1 1 1 0 0 0 0 1 1 0 1 1 ADD Add to accumulator with shift 1 0 0 0 0 M -D- ADDC Add to accumulator with carry 1 0 1 0 0 0 0 1 1 M -D- ADDH Add to high accumulator 1 0 1 0 0 1 0 0 0 M ~D- ADDK Add to accumulator short immediate 1 1 1 0 0 1 1 0 0 -K -o- ADDS Add to low accumulator with sign 1 0 1 0 0 1 0 0 1 M -D- extension suppressed ADDT 1 -s- Add to accumulator with shift specified by 1 0 1 0 0 1 0 1 0 M T register ADLK t Add to accumulator long 1mmed1ate with shift 2 1 1 0 1 0 0 0 0 0 0 1 0 AND ANDKI CMPL l LAC AND with accumulator AND immediate with accumulator with shift Complement accumulator Load accumulator with shift 1 2 1 1 0 1 1 1 0 1 0 0 0 1 0 0 1 0 0 1 -s- 1 -s- 1 1 1 1 0 1 0 M -D- 0 0 0 0 0 0 0 M -D- 1 0 0 1 0 1 1 0 1 LACK Load accumulator 1mmed1ate short 1 1 1 0 0 1 0 1 0 --K LACT 1 LALK t NEG 1 Load accumulator with shift specified by T register Load accumulator long immediate with shift 1 2 0 1 1 0 1 0 0 0 0 1 -s- -o- 1 0 M -D- 0 0 0 0 0 0 0 1 --s- -o- Negate accumulator 1 1 1 0 0 1 1 1 0 0 0 1 0 0 0 1 1 NORM 1 Normalize contents of accumulator 1 1 1 0 0 1 1 1 0 1 OR OR with accumulator 1 0 1 0 0 1 1 0 1 M ORK! OR 1mmed1ate with accumulator with shift 2 1 1 0 1 0 0 0 0 0 1 0 1 ROL Rotate accumulator left 1 1 1 0 0 1 1 1 0 0 0 1 1 0 1 0 0 ROR SACH SACL SBLK 1 Rotate accumulator r:ght Store high accumulator with shift Store low accumulator with shift Subtract from accumulator long 1mmed1c.ite with shift 1 1 1 2 1 0 0 1 1 0 0 1 1 0 1 -x- -s- -o- M 1 1 0 0 -4-X_. M 1 0 1 1 0 1 1 0 0 0 1 -D- 0 0 0 1 0 1 0 1 0 0 1 1 SFL 1 -s- -o- Shift accumulator left 1 1 1 0 0 1 1 1 0 0 0 0 1 1 0 0 0 SFA' Shift accumulator right 1 1 1 0 0 1 1 1 0 0 0 0 1 1 0 0 1 SUB M -o- Subtract from accumulator with shift 1 0 0 0 1 SUBB Subtract from accumulator with b-Jrrow 1 0 1 0 0 1 1 1 1 M -D- SUBC Conditional subtract 1 I) 1 0 0 0 1 1 1 M SUBH Subtract from high accumulator 1 0 1 0 0 0 1 0 0 M 4---D-___.. SUBK Subtract from accumulator short 1mmed1ate 1 1 1 0 0 1 1 0 1 -K SUBS Subtract from low accumulator with sign 1 0 1 0 0 0 1 0 1 M -D- I extension suppressed SUBT 1 Subtract from accumulator with shift specified by 1 0 1 0 0 0 1 1 0 M ......__o.__. T r eg1ster XOR XORK 1 ZAC Exclusive OR with accumulator Exclus1v(> OR 1mmed1ate with accumulator with shift Zero accumulator I I I 1 2 1 0 1 1 1 0 1 0 1 I 0 0 M 4---0.__. 0 1 -s- 0 0 0 0 0 1 1 0 1 0 0 1 0 1 0 0 0 0 0 0 0 0 0 ~ ZALH Zero low accumulator and load high accumulator 1 0 1 0 0 0 0 0 0 M ZAl.A -o- Zero low accumulator and load high accumulator 1 0 1 1 1 1 0 1 1 M -D- with rounding ZALS Zero accumulator and load low accumulator with 1 0 1 0 0 0 0 0 1 M sign extension suppresse-j trhese 1nstruct1ons are not included 1ri the TMS32010 instruction set B-14 TEXAS~ INSTRUMENTS TMS320C26BFNL DIGITAL SIGNAL PROCESSOR SPRS013 - JUNE 1989 - REVISED AUGUST 1992 TABLE 2. TMS320C26 INSTRUCTION SET SUMMARY (CONTINUED) AUXILIARY REGISTERS AND DATA PAGE POINTER INSTRUCTIONS NO. INSTRUCTION BIT CODE MNEMONIC DESCRIPTION WORDS 151413121110 9 B 7 6 5 4 3 2 1 0 ADAK Add to auxiliary register short immediate 1 0 1 1 1 1 1 1 0 K CMPAI Compare auxiliary register with auxiliary regi.ster ARO 1 1 1 0 0 1 1 1 0 0 1 0 1 0 O"'"CM.,. LAA Load auxiliary register 1 0 0 1 1 0 -R- M - o - LARK Load auxiliary register short immediate 1 1 1 0 0 0 _R_. K LAAP Load auxiliary register pointer 1 0 1 0 1 0 1 1 1 0 0 0 1 -R- 0 LOP load data memory page pointer 1 0 1 0 1 0 0 1 0 M -o- LDPK Load data memory page pointer immediate 1 1 1 0 0 1 0 0 DP LALK t Load auxiliary register long immediate 2 1 1 0 1 0 -R- 0 0 0 0 0 0 0 0 MAR Modify auxiliary register 1 0 1 0 1 0 1 0 1 M -o- SAR Store auxiliary register 1 0 1 1 1 0 -R- M - o - SBRK Subtract from auxiliary register short immediate 1 0 1 1 1 1 1 1 1 K _... T REGISTER, P REGISTER, AND MULTIPLY INSTRUCTIONS NO. INSTRUCTION BIT CODE MNEMONIC DESCRIPTION WORDS 1514131211109 8 7 6 5 4 3_ 2 0 , APAC Add P register to accumulator 1 1 1 0 0 1 1 1 0 0 0 0 1 0 1 0 1 LPHt Load high P register 1 0 1 0 1 0 0 1 1 M -o- LT Load T register 1 0 0 1 1 1 1 0 0 M -o- LTA Load T register and accumulate previous product 1 0 0 1 1 1 1 0 1 M - a - LTD Load T register, accumulate previous product, 1 0 0 1 1 1 1 1 1 M -o- and move data LTPt Load T register and store P register in accumulator 1 0 0 1 1 1 1 1 0 M -o- LTSI Load T register and subtract previous product 1 0 1 0 1 1 0 1 1 M -o- MAC! Multiply and accumulate 2 0 1 0 1 1 1 0 1 M -a- MAcot Multiply and accumulate with data move 2 0 1 0 1 1 1 0 0 M -o- MPY Multiply (with T register, store product in P register) 1 0 0 1 1 1 0 0 0 M -o- MPYA Multiply and accumulate previous product 1 0 0 1 1 1 0 1 0 M -o- MPYK Multiply immediate 1 1 0 1 K MPYS Multiply and subtract previous product 1 0 0 1 1 1 0 1 1 M -o- MPYU Multiply unsigned 1 1 1 0 0 1 1 1 1 M - a - PAC Load accumulator with P register 1 1 1 0 0 1 1 1 0 0 0 0 1 0 1 0 0 SPAC Subtract P register from accumulator 1 1 1 0 0 1 1 1 0 0 0 0 1 0 1 1 0 SPH Store high P register 1 0 1 1 1 1 1 0 1 M -o- SPL Store low P register 1 0 1 1 1 1 1 0 0 M -o- SPMt Set P register output shift mode 1 1 1 0 0 1 1 1 0 0 0 0 0 1 0 "'"PM.,. SORA! Square and accumulate 1 0 0 1 1 1 0 0 1 M -o- SQRS 1 Square and subtract previous product 1 0 1 0 1 1 0 1 0 M -o- trhe~e instructions are not included in the TMS32010 instruction set. TEXAS. INSTRUMENTS B-15 TMS320C26BFNL DIGITAL SIGNAL PROCESSOR SPRS013 - JUNE 1989 - REVISED AUGUST 1992 TABLE 2. TMS320C26 INSTRUCTION SET SUMMARY (CONTINUED) BRANCH/CALL INSTRUCTIONS NO. INSTRUCTION BIT CODE -o- MNEMONIC DESCRIPTION WORDS 151413121110 9 8 7 6 5 4 3 2 1 0 -o- B Branch unconditionally 2 1 1 1 1 1 1 1 1 1 -o- BAcct Branch to address specified by accumulator 1 1 1 0 0 1 1 1 0 0 0 1 0 0 1 0 1 -o- BANZ Branch on auxiliary register not zero 2 1 1 1 1 1 0 1 1 1 -o- BBNzt Branch if TC bit "0 2 1 1 1 1 1 0 0 1 1 -o- ssz 1 Branch if TC bit = 0 2 1 1 1 1 1 0 0 0 1 -o- BC Branch on carry 2 0 1 0 1 1 1 1 0 1 -o- BGEZ Branch if accumulator ~ 0 2 1 1 1 1 0 1 0 0 1 -o- BGZ Branch if accumulator > 0 2 1 1 1 1 0 0 0 1 1 -o--- BIOZ Branch on 110 status = 0 2 1 1 1 1 1 0 1 0 1 -o- BLEZ Branch if accumulator 0 2 1 1 1 1 0 0 1 0 1 " -o- BLZ Branch if accumulator < 0 2 1 1 1 1 0 0 1 1 1 -o- BNC Branch on no carry 2 0 1 0 1 1 1 1 1 1 BNV 1 -o- Branch if no overflow 2 1 1 1 1 0 1 1 1 1 -o- BNZ Branch if accumulator ::t- 0 2 1 1 1 1 0 0 1 1 1 BV Branch on overflow 2 1 1 1 1 0 0 0 0 1 -o- BZ Branch if accumulator = 0 2 1 1 1 1 0 1 1 0 1 CALA Call subroutine indirect 1 1 1 0 0 1 1 1 0 0 0 1 0 0 1 0 0 CALL Call subroutine 2 1 1 1 1 1 1 1 0 1 RET Return from subroutine 1 1 1 0 0 1 1 1 0 0 0 1 0 0 1 1 0 110 AND DATA MEMORY OPERATIONS NO. INSTRUCTION BIT CODE -o- MNEMONIC DESCRIPTION WORDS -o- 1514131211109 8 7 6 5 4 3 2 1 0 -o- BLKDT Block move from data memory to data memory 2 1 1 1 1 1 1 0 1 M BLKPI Block move from program memory to data memory 2 1 1 1 1 1 1 0 0 M -o- DMOV Data move in data memory 1 0 1 0 1 0 1 1 0 M FORTI -o- Format serial port registers 1 1 1 0 0 1 1 1 0 0 0 0 0 1 1 1 FO IN Input data from port 1 1 0 0 0 -PA- M OUT Output data to port 1 1 1 1 0 -PA__. M RFSM Reset serial port frame synchronization mode 1 1 1 0 0 1 1 1 0 0 0 1 1 0 1 1 0 RTXMI Reset serial port transmit mode 1 1 1 0 0 1 1 1 0 0 0 1 0 0 0 0 0 RXFI Reset external flag 1 1 1 0 0 1 1 1 0 0 0 0 0 1 1 0 0 SFSM Set serial port frame synchronization mode 1 1 1 0 0 1 1 1 0 0 0 1 1 0 1 1 1 STXMI -o- Set serial port transmit mode 1 1 1 0 0 1 1 1 0 0 0 1 (l 0 0 0 1 SXFI -o- Set external flag 1 1 1 0 0 1 1 1 0 0 0 0 0 1 1 0 1 TBLR Table read 1 0 1 0 1 1 0 0 0 M TBLW Table write 1 0 1 0 1 1 0 0 1 M t These instructions are not included m the TMS32010 instruction set. B-16 TEXAS~ INSTRUMENTS TMS320C26BFNL DIGITAL SIGNAL PROCESSOR SPRS013 -JUNE 1989 - REVISED AUGUST 1992 TABLE 2. TMS320C26 INSTRUCTION SET SUMMARY (CONCLUDED) CONTROL INSTRUCTIONS NO. INSTRUCTION BIT COOE -s- MNEMONIC DESCRIPTION WORDS 151413 12 1110 9 8 7 6 5 4 3 2 1 0 BIT T Test bit 1 1 0 0 1 M -D- BITT 1 Test bit specified by T register 1 0 1 0 1 0 1 1 1 M -D- CONFO# Configure all blocks as Data 1 1 1 0 0 1 1 1 0 0 0 1 1 1 1 0 0 CONF1# Configure block BO as program 1 1 1 0 0 1 1 1 0 0 0 1 1 1 1 0 1 CONF2# Configure blocks BO-and B1 as program 1 1 1 0 0 1 1 1 0 0 0 1 1 1 1 1 0 CONF3# Configure blocks BO, B1 and B3 as program 1 1 1 0 0 1 1 1 0 0 0 1 1 1 1 1 1 DINT Disable interrupt 1 1 1 0 0 1 1 1 0 0 0 0 0 0 0 0 1 EINT Enable 1nterruot 1 1 1 0 0 1 1 1 0 0 0 0 0 0 0 0 0 IDLE! Idle until interrupt 1 1 1 0 0 1 1 1 0 0 0 0 1 1 1 1 1 LST Load status register STO 1 0 1 0 1 0 0 0 0 M -D- LSTl T Load status register ST 1 1 0 1 0 1 0 0 0 1 M -D- NOP No operation 1 0 1 0 1 0 1 0 1 0 0 0 0 0 0 0 0 POP Pop top of stack to low accumulator 1 1 1 0 0 1 1 1 0 0 0 0 1 1 1 0 1 POPDr Pop top of stack to data memory 1 0 1 1 1 1 0 1 0 M -D- PSHDT Push data memory value onto stack 1 0 1 0 1 0 1 0 0 M -D- PUSH Push low accumulator onto stack 1 1 1 0 0 1 1 1 0 0 0 0 1 1 1 0 0 RC Reset carry bit 1 1 1 0 0 1 1 1 0 0 0 1 1 0 0 0 0 RHM Reset hold mode 1 1 1 0 0 1 1 1 0 0 0 1 1 1 0 0 0 ROVM Reset overflow mode 1 1 1 0 0 1 1 1 0 0 0 0 0 0 0 1 0 RPTT Repeat instruction as specified by data memory value 1 0 1 0 0 1 0 1 1 M -D- RPTK T Repeat instruction as specified by immediate value 1 1 1 0 0 1 0 1 1 K RSXMt Reset sign-extension mode 1 1 1 0 0 1 1 1 0 0 0 0 0 0 1 1 0 RTC Reset test/control flag 1 1 1 0 0 1 1 1 0 0 0 1 1 0 0 1 0 SC Set carry bit 1 1 1 0 0 1 1 1 0 0 0 1 1 0 0 0 1 SHM Set hold mode 1 1 0 1 1 1 1 0 0 0 0 1 1 1 0 0 1 SOVM Set overflow mode 1 1 1 0 0 1 1 1 0 0 0 0 0 0 0 1 1 SST Store status register STO 1 0 1 1 1 1 0 0 0 M -D- SST1 t Store status register ST 1 1 0 1 1 1 1 0 0 1 M -D- 5SXM 1 Set sign-extension mode 1 1 1 0 0 1 1 1 0 0 0 0 0 0 1 1 1 STC Set test/control flag 1 1 1 0 0 1 1 1 0 0 0 1 1 0 0 1 1 TRAP! Software interrupt 1 1 1 0 0 1 1 1 0 0 0 0 1 1 1 1 0 t These instructions are not included 1n the TMS32010 instruction set. # These instructions replace CNFD and CNFP in the TMS320C25 instruction set. TEXAS~ B-17 INSTRUMENTS TMS320C26BFNL DIGITAL SIGNAL PROCESSOR SPRS013 - JUNE 1989 - REVISED AUGUST 1992 • l ~ _~ Caution. This device contains circuits to protect its inputs and outputs against damage due to high static voltages or electrostatic ~ fields. These circuits have been qualified to protect this device against electrostatic discharges IESO) of up to 2 kV according to MIL-STD-883C, Method 301 S; however. it is advised that precautions be taken to avoid application of any voltage higher than maximum rated voltages to these high-impedance circuits. During storage or handling, the device leads should be shorted together or the device should be placed in conductive foam. In a circuit, unused inputs should always be connected to an appropriate logic voltage levei, preferably either Vee or ground. Specific guidelines for handling oevices of this type are Contained in the publication ''Guidelines for Handling Electrostatic- Discharge Sensitive !ESDS) Devices and Assemblies·· available from Texas Instruments. absolute maximum ratings over specified temperature range (unless otherwise noted) t ..., ... ,... ..... , ............ tr ........... ~ .... •\.,.\,, - v . .:> V lO I V Input voltage range -0.3 V to 7 V Output voltage range .. -0.3 V to 7 V Continuous power dissipation ...... . . .... 1:5 w Operating free-air temperature range ....... . . .. 0°C to 70°C Storage temperature range . . . .......... . . ... - 55 °C to 1 50 °C tstresses beyond those listed under "Absolute Maximum Ratings" may cause permanent damage to the device. This is a stress rating only and functional operation of the device at these or any other conditions beyond those indicated in the "Recommended Operating Conditions" section of this specification is not implied. Exposure to absolute-maximum-rated conditions for extended periods may affect device reliability. t All voltage values are with respect to V55. recommended operating conditions MIN NOM MAX UNIT Vee Supply voltage 4.75 5 5.25 v Vss Supply voltage 0 v All inputs except CLKIN/CLKX/CLKR / liii'f (0 - 2) 2.35 vcc+o.3 v V1H High-level input voltage INT (0 · 2) 2.5 vcc+0.3 v CLKIN/CLKX/CLKR 3.5 Vcc+o.J v All inputs except CLKIN -0.3 0.8 v V1L Low-level input voltage CLKIN -0.3 0.8 v IOH High-level output current 300 p.A IQL Low·level output current 2 mA TA Operating free-air temperature 0 70 oc electrical characteristics over specified free-air temperature range (unless otherwise noted) PARAMETER TEST CONOITIONS MIN ;-ypt MAX UNIT VoH High-level output voltage V::;c = MIN. IOH = MAX 2.4 3 v Vol Low-level output voltage Vee = MIN. IOL = MAX 0.3 0.6 v lz Three-state current Vee = MAX -20 20 p.A 11 Input current v1 = Vss to Vee -10 10 p.A .l Normal Supply currenj_ TA = 0°C. Vee = MAX. Ix = MAX 110 220 mA ice Idle/HOLD 70 100 C1 Input capacitance 15 pF Co Output capacitance 15 pF I All typical values are at Vee 5 V. TA 0 25 °C. TEXAS~ B-18 INSTRUMENTS TMS320C26BFNL DIGITAL SIGNAL PROCESSOR SPRS013 -JUNE 1989 - REVISED AUGUST 1992 CLOCK CHARACTERISTICS AND TIMING The TMS320C26 can use either its internal oscillator or an external frequency source for a clock. internal clock option The internal oscillator is enabled by connecting a crystal across X 1 and X2/CLKIN (see Figure 2). The frequency of CLKOUT1 is one-fourth the crystal fundamental frequency. The crystal should be either fundamental or overtone mode, and parallel resonant, with an effective series resistance of 30 ohms, a power dissipation of 1 mW, and be specified at a load capacitance of 20 pF. Note that overtone crystals require an additional tuned LC circuit (see the application report, Hardware Interfacing to the TMS320C25). PARAMETER TEST CONDITIONS MIN TYP MAX UNIT Ix Input clock frequency TA = 0°C to 70°C 6.7 40.96 MHz fsx Serial port frequency TA = O'C to 70°C o* 5.120 kHz Cl, C2 TA = O'C to 70°C 10 pF *The serial port is tested at a minimum frequency of 1.25MHz. However, the serial port is fully static and will properly function down to fsx = OHz X1 CRYSTAL -----lo~- JC2 FIGURE 2. INTERNAL CLOCK OPTION external clock option An external frequency source can be used by injecting the frequency directly into X2/CLKIN with X 1 left unconnected. The external frequency injected must conform to the specifications listed in the following table. switching characteristics over recommended operating conditions (see Note 3) PARAMETER MIN TYP MAX UNIT tclCI CLKOUT1/CLKOUT2 cycle time 97.7 597 ns tdlCIH·Ci CLKIN high to CLKOUT1/CLKOUT2/STRB high/low 5 30 ns lf(Ci CLKOUT1/CLKOUT2/STRB fall time 5 ns trlCI CLKOUT1 /CLKOUT2/STRB rise time 5 ns twlCLi CLKOUT1/CLKOUT2 low pulse duration 20-8 20 20+8 ns twlCHI CLKOUT1 /CLKOUT2 high pulse duration 20-8 20 20+8 ns tct1c1.c21 CLKOUT1 high to CLKOUT2 low, CLKOUT2 high to CLKOUTl high. etc. 0-5 0 O+ 5 ns NOTE 3: 0 = 1 /4tclCI· TEXAS. INSTRUMENTS B-19 TMS320C26BFNL DIGITAL SIGNAL PROCESSOR SPRS013A-JUNE1989 - REVISED AUGUST 1992 timing requirements over recommended operating conditions (see Note 31 MIN NOM MAX UNIT telCll CLKIN eve.le time 24.4 150 ns t11c11 CLKIN fall time 5• ns trlCll CLKIN rise time s· ns twlCILJ CLKIN low pulse duration, teiCll ~ 50 ns lsee Note 41 20 ns twlCIHI CLKIN high pulse duration, telCll : 50 ns lsee Note 41 20 ns tsu(SI SYNC setup time before CKLIN low 5 Q-8 ns thlSI SYNC hold time from CLKIN low 8 ns •value not tested NOTES: 3. Q ~ 1 14telCI· ... \...L""" uuly L:Yl:lti' llr(CI! + tw{CIH)l'tc(CIJ must ae wnnm 'f.V·OU"/o. TMS320C26 +5 v 10 kD 74HC04 CLKIN I r··· C • 20 pF 10 kD fc_m;tal (MHz) L (i=J-~I /f---•w1SH1----'\ fsulAI 1 1----- 'MA) 1 L----1w1su----' I I A15-AO. - - - - . . liR.i'S.iJS. OR iS READY~!~ -lhtSl RI~ _,.J r--'hlOJR 01500 ( o~:A )>------- TEXAS. B-23 INSTRUMENTS TMS320C26BFNL DIGITAL SIGNAL PROCESSOR SPRS013A- JUNE1989 - REVISED AUGUST 1992 memory write timing CLKOUT1 ~, _ _ _ _ _.; CLKOUT2 \ _ _ _ _ _ _ __ , / \----_~/ r---t-:o,U••· ORiS---.; I I I I I RIW ~ 1«M REAOY~~ tsu101w-:--------r---Tth(DIW DATA OUT '---1dislOI- one wait-state memory access timing CLKOUT1 \ "'1_ _ _ _ __ _ , I /; \..___ _ ___,/ \__ I CLKOUT2 _ _ _:_ __ , / : I I I \ "--------' I /i \"---_ I I : I I I I I I I I I r-----t" 'hlC2H-RI ~~O~ PS.DS.R/W = > ® < /I VALID I I ~ ORiS - - - . - - -........----------~--~--~ I f----,-,h;C2H RI I : l,dlC2H RJ.....l - I 'dlC2H RJ--1 - READY~~~ I l--1 i...., I ~'dlM RJ-l I I I I hlM RI I I I I '- 'dlM RI -II D15 DO IFOR READ OPERATIONI ---1I I 'hlM HJ--1 - I I I ( - t l - - - - - + l - - + - 1- - - - - - - - + 1 - - - - - T - - < · I I I I I : DATA IN ) >-·- - - - - - I I I I I I I I I I I I D15-DO IFOR WRITE OPERATION I ii • I I I I :DATAOUT : : I I I I I I MSC~ __j I ~ --1 l--1d(MSCI ~ --. -ldlMSCI TEXAS ~ B-24 INSTRUMENTS TMS320C26BFNL DIGITAL SIGNAL PROCESSOR SPRS013A- JUNE1989 - REVISED AUGUST 1992 reset timing CLKOUT1 SERIAL PORT1 CONTROLS ~~§§1~§!8!§§~1~§§1!~~!----+----+----t------1 ~ t Control signals are BS. iS. RiW. and XF tserial port controls are DX and FSX. interrupt timing CLKOUT1 •su(INJ-1 I \I I I I __J 1--thltNI .I --=:!J INT2-INTO tw(INI i 'I v x I I I _, =:x x 1--ld(IACKI A15-AO FETCH N FETCH N + 1 x,..-F-ET_C_H_N_+_2--.X N·3 FETCH I ><= tdllACKl.....,j j-- i I I TEXAS~ B-25 INSTRUMENTS TMS320C26BFNL DIGITAL SIGNAL PROCESSOR SPRS013A- JUNE1989 - REVISED AUGUST 1992 BIO timing CLKOUT1 I FETCH FETCH I BRANCH ADDRESS NEXT INSTRUCTION ----- A ,,...--!-----, A A15 AO BIOZ PC N PC N · 1 •sullNI _.J 1 '-- I t PC= N + 2 t PC= N + 3 1--J L..- 'hi IN I OR BRANCH ADDRESS I I BIO~VALID external flag timing CLKOUT1 --1 i- ld(XF! FETCH A15-AO VALID VALID VALID SXFIRXF PC N PC N•1 PC N•2 I PC N•3 I I XF VALID B-26 TEXAS~ INSTRUMENTS TMS320C26BFNL DIGITAL SIGNAL PROCESSOR SPRS013A- JUNE1989 - REVISED AUGUST 1992 HOLD timing (part Al --t l--tdlC2H-HI (see note 1) - - - -... I HOLD I A15-AO N N+l N+2 PS.~. OR iS VALID VALID RtW ~------- 0 0 ......1 f- 'dis1c1L-A1 D15-DO ------c IN >-------< IN >----------+;-+-i 1 1- - - - - - 1 I - -----------------------+l""'--ti--tdislAL-AI i\ I "",------ 'dlClL-ALl--l t-- N FETCH N-2 N-1 N EXECUTE Note: HOLD is an asynchronous input and can occur at any time during a clock cycle. If the specified timing is met, lhe exact sequence shown will occur; otherwise a delay of one CLKOUT2 cycle will occur_ TEXAS" INSTRUMENTS B-27 TMS320C26BFNL DIGITAL SIGNAL PROCESSOR SPRS013A- JUNE1989 - REVISED AUGUST 1992 HOLD timing (part Bl CLKOUT1 CLKOUT2 ...., le-tenlA·C1LI ml - - - ; - - - - - - - - - - - ' 'I I \ r--•dCC2H·HI (see note) I. P&.51. _________ ORiS -i---------------. . . 'W" 'lXJJIY VALIO ) I I R/W ------+---------W' 015-DO ------1----------. . .----------0- ........... ld(HH-AHI ___.v', HOLDA - - A15·AO ---------------m N + 2 ~.___N_+2~> N + 2 FETCH N + 1 EXECUTE Note: HOLD is an asynchronous input and can occur at any time during a clock cycle. II the specified timing Is met, the exact sequence shown will occur; otherwise a delay of one CLKOUT2 cycle will occur. TEXAS .,, 8-28 INSTRUMENTS TMS320C26BFNL DIGITAL SIGNAL PROCESSOR SPRS013A- JUNE1989 - REVISED AUGUST 1992 serial port receive timing serial port transmit timing r---tclSCKl------1 I ! ~lr(SCKI w!SCKl-r---! l CLKX I : I 'hlFSI~ 'flSCKl.....I 1--- I I FSX 1 '-----'-1wlSCKJ !INPUT. TXM -- 01 I t--l'd!CH-DXI ] I ~lsulFSJI I l DX .....,ii--~-·-·1_.,_.o_._'~'-:~:~c~'~~N~-.~-'--t--~~ --l ;•01CHFSI i...-.--r-•01CHHI FSX _J----~\L/ lOUTPUT.TXM 11 --~~~~~~~~11-~~~~~~~~~~~~- TEXAS. B-29 INSTRUMENTS TMS320C26BFNL DIGITAL SIGNAL PROCESSOR SPRS013A-JUNE1989- REVISED AUGUST 1992 MECHANICAL DAT A 68-pin plastic leaded chip carrier package ::~~ :~: ~~~: 2,7910.1101 2,41 (0.095) 1,3510.053) x 45 ~0.2510.0101 R MAX Qr=r ~:c~o~o;~~ !; 1.19 (0.0471 l. P IN 3 PLACES ~r....i:n::u:n::u:n::u:n:u:n:u:n..nOJnOJn=a.in=a.in::u:n::u:n::u:n::u:n::u:n:u:n=.,~===rr--T 23,62 10.930) 25.27 10.995) 23.11 10.9101 25,02 (0.985) IAT !'; fJJ ~olu lo I"' ua: a: 1~ ooOOzl-1-1- UOf/J (;;~~~> u. w • 80-Lead Quad Flat Pack Package (PH 0 Suffix) 68-PIN FN AND FZ PACKAGES t z ~ • 68-Lead Plastic Leaded Chip Carrier (PLCC) (TOPVIEW) Packages (FN and FZ Suffixes) 0 ~ "' "' ... "' ccoi~~~~~~o.jOo lu~ 19 b~ :.:a: g uu lcn-' UU c OOOOOOOO~mIC!:~UU>> <( r 9 a 1 6 5 4 3 2 1 68 67 66 65 64 63 6261 Vss 10 60 IACK 07 11 59 MSC 06 12 58 CLKOUT1 05 13 57 CLKOUT2 04 14 56 XF 03 15 55 HOLDA 02 16 54 DX 01 17 53 FSX DO 18 52 X2 CLKIN SYNC 19 51 X1 INTO 20 50 BR INT1 21 49 STRB INT2 22 48 Rfii Vee 23 47 PS DR 24 46 JS FSR 25 45 OS AO 26 44 Vss DUUW~~~M-~"~~~~au ~<~~~~~~8~~~~~~~~ > > t Packages are shown for pin-out reference only. Copyright© 1992, Texas Instruments Incorporated TEXAS~ INsrRUMENTS POST OFFICE BOX 1443 • HOUSTON, TEXAS 77001 C-3 TMS320C28 DIGITAL SIGNAL PROCESSOR WITH POWER-DOWN MODE SPRS019-0ECEMBER 1992 PH PIN ASSIGNMENTS FUNCTION PIN FUNCTION PIN FUNCTION PIN FUNCTION PIN FUNCTION PIN FUNCTION PIN AO 41 A15 62 D8 22 IACK 3 Vee 3 Vss 75 A1 44 BIO 11 D9 21 INTO 4 Vee 4 WAKEUP 64 A2 45 BR 70 D10 20 INT1 17 Vee 17 XF 77 A3 46 CLKOUT1 79 D11 19 INT2 38 Vee 38 X1 71 A4 47 CLKOUT2 78 D12 18 IS 52 Vee 52 X2/CLKIN 72 A5 48 CLKR 7 D13 16 MP/MC 53 Vee 53 AS 50 CLKX 5 D14 15 MSC 6 Vss 6 A7 51 DO 33 D15 13 PDI 14 Vss 14 AS 54 D1 32 DR 39 PDACK 23 Vss 23 A9 55 D2 30 DS 65 PS 24 Vss 24 A10 56 D3 29 DX 74 READY 31 Vss 31 A11 57 D4 28 FSR 40 RS 42 Vss 42 A12 59 D5 27 FSX 73 R/'N 49 Vss 49 A13 60 D6 26 HOLD 10 STAB 58 58 )> Vss c A14 61 D7 25 HOLDA 76 SYNC 63 Vss 63 ~ SIGNALS l/OIZ* DEFINITION z Vee Vss I I 5-V supply pins Ground pins 0 X1 0 Output from internal oscillator for crystal m X2/CLKIN I Input to internal oscillator from crystal or external clock .,,-z CLKOUT1 0 Master clock output (crystal or CLKIN frequency/4) CLKOUT2 0 A second clock output signal D15-DO 1/0/Z 16-bit data bus D15 (MSB) through DO (LSB). Multiplexed between program, data, and 1/0 spaces. A15-AO 0/Z 16-bit address bus A 15 (MSB) through AO (LSB) 0 PS, DS, iS 0/Z Program, data, and 1/0 space select signals :rJ Rfi\I 0/Z Read/write signal s:: STAB RS 0/Z I Strobe signal Reset input ~ INT2-INTO I External user interrupt inputs - 0 z MP/MC MSC IACK READY 0 0 I I Microprocessor/microcomputer mode select pin Microstate complete signal Interrupt acknowledge signal Data ready input. Asserted by external logic when using slower devices to indicate that the current bus transaction is complete. BR 0 Bus request signal. Asserted when the TMS320C28 requires access to an external global data memory space. XF 0 External flag output (latched software-programmable signal) HOLD I Hold input. When asserted, TMS320C28 goes into an idle mode and places the data, address, and control lines in the high-impedance state. HOLDA 0 Hold acknowledge signal SYNC I Synchronization input BIO I Branch control input. Polled by BIOZ instruction. DR I Serial data receive input CLKR I Clock for receive input for serial port FSA I Frame synchronization pulse for receive input DX 0/Z Serial data transmit output CLKX I Clock for transmit output for serial port FSX 1/0/Z Frame synchronization pulse for transmit. Configuration as either an input or an output. PDI I Non-maskable power-down interrupt PDACK 0 Power-down acknowledge WAKEUP I Return to normal power *1/0/Z denotes inpui/output/high-impedance state. TEXAS~ INsrRUMENTS C-4 POST OFFICE BOX 1443 • HOUSTON, TEXAS 77001 TMS320C28 DIGITAL SIGNAL PROCESSOR WITH POWER-DOWN MODE SPRS019-DECEMBER 1992 description The TMS320C28 is similar to the TMS320C25, but has an added power-down feature and increased on-chip ROM of BK words. The power-down mode reduces the Ice to approximately 100 µA. During the power-down mode only the on-chip SAAM (BO, 81, 82) is powered up; therefore, the contents of the accumulator, internal registers, etc., cannot be maintained because they are stored dynamically. Register contents must be saved in the on-chip RAM. The power-down mode is initiated with the power-down interrupt (POI) pin (on the 80-pin PH package only) or through software (on any of the three packages available). An interrupt service routine is then used to save the contents of those registers that are lost during power-down. The power-down mode may be used at any time except when RS is low. The TMS320C28 is characterized for operation from 0° to 70° C. power-down using power-down interrupt (POI) The power-down sequence is initiated when POI is set low. The system then jumps to the interrupt routine at 0014h. The power-down mode is entered when bit 0 of the power-down register (PDC) is set. The PDC register is located at 6h in the internal data memory. z Bit 15 Power Down Control Register PDC Bit o (control bit) 0 ~I------------.R~e-se-~-e~d------------~1----.1 ~ Bit O = 0, Normal Mode ~ Bit O = 1, Power Down Mode a: 0 CAUTION u. The contents of registers, accumulator, etc., must be stored in the on-chip RAM before the PDC control bit is z set high or the contents will be lost, because Vee will be supplied only to the SAAM during power-down. w The power-down acknowledge pin (PDACK), which is driven low during normal operation, will be set high during (.) power-down. z The WAKEUP pin is used to return to normal operation. When WAKEUP is set low the system jumps to location 0016h, the warm reset interrupt routine. ~ c Note that external power-down inputs and power-down acknowledge lines are not available on the 68-pin FN <( and FZ packages; however, power-down can be achieved through software by writing to the PDC register. See the subsection "power-down using software" on page 5. TEXAS" INSTRUMENTS POST OFFICE BOX 1443 • HOUSTON, TEXAS 77001 C-5 TMS320C28 DIGITAL SIGNAL PROCESSOR WITH POWER-DOWN MODE SPRS019-DECEMBER 1992 power-down using power-down interrupt (POI) (continued) INTERNAL Vee PDACK 6 5 CLKOUT1, 4 CLKOUT2 l> c 3 Set PDC Register = 1 6 ~ JumpP DI Vector Table Jump WAKEUP Vector Normal 2 4 5 User Program z Operation Run Mode ~ User Program Context Save Powe rd own Mode Return Mode I+ Context Restore 0 m -z Below is the sequence of steps that occur during power-down: 1. When PDI is set low, execution branches to the PDI vector at 0014h. Before the branch, the contents of the "T1 PC are pushed onto the stack 0 2. During the PDI interrupt routine, the contents of all registers, etc., that must be maintained during lJ power-down mode must be pushed onto the on-chip RAM stack. s: ~ 3. After the PDI interrupt routine is complete, PDC (bit 0) is set to one to enter power-down mode. 4. PDACK high indicates that the device is in the power-down state. During power-down, the current is about 0 100 µA and CLKOUT1 and CLKOUT2 are set low. z 5. When PDI is set high; the internal Vee will be supplied and the clock (CLKOUT1, CLKOUT2) is resumed. After P5i is set high, clock stabilization requires at least 100 ms. 6. When WAKEUP is set low, execution mode has been entered and the execution of the program branches to the WAKEUP vector. 7. When the WAKEUP vector is fetched at 0016h, PDACK is forced low to indicate that the device has returned to normal mode. TEXAS~ INSTRUMENTS C-6 POST OFFICE BOX 1443 • HOUSTON, TEXAS 77001 TMS320C28 DIGITAL SIGNAL PROCESSOR WITH POWER-DOWN MODE SPRS019-0ECEMBER 1992 power-down using software 3 4 4 INTERNAL 2 Vee PDACK 6 5 4 CLKOUT1, 2 CLKOUT2 z 0 ~ 1 5 Set PDC Register =1 Jump WAKEUP Vector Operation Normal Run User Program I+ 2 Powerdown 4 Return + User Program 5 :a: Mode Context Save Mode Mode Context Restore a: 0 Below is the sequence of steps which occurs during power-down: LL 1. In the user's program, save any internal registers, etc., whose contents you want to save during power-down z mode in the on-chip RAM. w 2. Set bit 0 of the PDC register to high to enter the power-down mode. u PDACK will be set to high when the device enters power-down mode. z ~ During power-down mode, the current is about 100 µA and the clock (CLKOUT1 ,2) is set low. 3. The return mode is entered by setting POI low. 4. When POI is set high, the internal Vee will be supplied and the clock (CLKOUT1 ,2) is resumed. After POI c is set high, wait at least 100 ms to let the clock stabilize. A15·AO~ Instruction ~ ~l-~-P~R~D~(1~6~)~--I TIM(16) c 16 16 )( l-+-+----4>---'16::,...._ _ _ _ _ _+-./11111 1,!.,....... 1,,!...+.. IMR(6) ~ GREG(&) 015·00 i L,.....H-_.,........,..1_6~ 16 z Data Bua Program Bue 0 m -z 16~6 16 16 16 16 9 .---- 'Tl AR0(16) AR1(16) AR2(16) 7LSB FromlR t-----TR(16) DP(9) ] 0 AR3(16) Multlpller lJ AR4(16) ~~~ ;::.J ~t--:::::::::~~ .. s:: AR5(16) AR6(16) PR(32) 32 !i- AR7(16) 32 16 0 I 16~ 16 I ARAU(16>J _9 ' z 16 16 MUX 16 Block B2 DATA/PROG 32 (32x16) RAM (256 x 16) t- O.t;;-RAM --; Block BO Block B1 (256 x 16) 16 Data Bua LEGEND: ACCH Accumulator high IFR Interrupt flag register PC Program counter ACCL Accumulator low IMR Interrupt mask register PFC Prefetch counter ALU Arithmetic logic unit IR Instruction register RPTC Repeat instruction counter ARAU Auxiliary register arithmetic unit MCS Mlcrocall stack GREG Global memory allocation register ARB Auxillary register pointer buffer QIR Queue instruction register RSA Serial port receive shift register ARP Auxiliary register pointer PR Product register XSR Serial port transmit shift register DP Data memory page pointer PAD Period register for timer ARO-AR7 Auxiliary registers DAR Serial port data receive register TIM limer STD, ST1 Status registers DXR Serial port data transmit register TR Temporary register c Carry bit TEXAS~ INSTRUMENTS C-8 POST OFFICE BOX 1443 • HOUSTON, TEXAS 77001 TMS320C28 DIGITAL SIGNAL PROCESSOR WITH POWER-DOWN MODE SPRS019-DECEMBER 1992 architecture The TMS320C28 utilizes a modified Harvard architecture for speed and flexibility. In a strict Harvard architecture, program and data memory lie in two separate spaces, permitting a full overlap of instruction fetch and execution. The TMS320C28 modification of the Harvard architecture allows transfers between program and data spaces, thereby increasing the flexibility of the device. This modification permits coefficients stored in program memory to be read into the RAM, eliminating the need for a separate coefficient ROM. It also makes available immediate instructions and subroutines based on computed values. Increased throughput on the TMS320C28 devices for many DSP applications is accomplished by means of single-cycle multiply/accumulate instructions with a data move option, up to eight auxiliary registers with a dedicated arithmetic unit, and faster 1/0 necessary for data-intensive signal processing. The architectural design of the TMS320C28 emphasizes overall speed, communication, and flexibility in processor configuration. Control signals and instructions provide floating-point support, block-memory transfers, communication to slower off-chip devices, and multiprocessing implementations. 32-bit ALU/accumulator The 32-bit Arithmetic Logic Unit (ALU) and accumulator perform a wide range of arithmetic and logical instructions, the majority of which execute in a single clock cycle. The ALU executes a variety of branch z 0 instructions dependent on the status of the ALU or a single bit in a word. These instructions provide the following capabilities: - !;: • Branch to an address specified by the accumulator • Normalize fixed-point numbers contained in the accumulator ~ • Test a specified bit of a word in data memory a: 0 One input to the ALU is always provided from the accumulator, and the other input may be provided from the u. Product Register (PR) of the multiplier or the input scaling shifter which has fetched data from the RAM on the z data bus. After the ALU has performed the arithmetic or logical operations, the result is stored in the accumulator. w The 32-bit accumulator is split into two 16-bit segments for storage in data memory. Additional shifters at the (.) output of the accumulator perform shifts while the data is being transferred to the data bus for storage. The contents of the accumulator remain unchanged. z ~ c <( TEXAS~ INsrRUMENTS POST OFFICE BOX 1443 • HOUSTON, TEXAS 77001 C-9 TMS320C28 DIGITAL SIGNAL PROCESSOR WITH POWER·DOWN MODE SPRS019-0ECEMBER 1992 Program Doto O(OOOOh) O(OOOOh) O(OOOOh) lnterrupto ln1trrupto ondReHrved On-Chip ond RHtrved Memory-Mapped (Extornel) (On-Chip ROM) Reglotero 31(001Fh) 31(001Fh) 5(0005h) 32(0020'1) 1 - - - - - - - 4 6(0006h) 32(0020h) Reaerved PageO On-Chip ROM 95(005Fh) 8111 (1 FAFh) 96(0080h) 8112(1FBOh) On·Chlp 127(007Fh) BlockB2 Aeurved 128(0080h) 8191 (1 FFFh) 8192(2000h) Reeerved Pagea1°3 511(01FFh) 512(0200h) External On·Chlp Pegea 4-5 767(02FFh) Block BO 768(0300h) On-Chip External BlockB1 Pagea6·7 1023(03FFh) 1024(0400h) )> External PagoaB·511 c ;; 85,53S(FFFFh) 85,535(0FFFFh) 85,535(0FFFFh) z llMP/MC • 1 (Mlcroproceuor Mode) llMP/MC •O (Microcomputer Mode) 0 (a) Memory Mapa After a CNFD lnatructlon m -z O(OOOOh) Program lnttrruplt O(OOOOh) Progrom lntarrupto O(OOOOh) Doto -ii and A11erved andAuerved On·Chlp Memory-Mapped 0 31(001Fh) (External) 31(001Fh) (On-Chip ROM) 5(0005h) Reglatara lJ 32(0020h) 32(0020h) On-Chip 6(0006h) Reserved PageO :s:: 8111 (1 FAFh) ROM 95(005Fh) ~ 8112(1FBOh) 96(0080h) Renrved On-Chip - 0 8191 (1 FFFh) 8192(2000h) 127(007Fh) 12B(OOBOh) Block B2 Reserved z External 511(01Ffh) 512(0200h) Pageo 1·3 Does Not Exlot Pages 4-5 External 767(02FFh) 768(0300h) On-Chip Block Bl Pagea6·7 1023(03FFh) 1024(0400h) 85,279(0FEFFh) 85,279(0FEFFh) 85,280(DFFOOh) t- - - - - - 85,280(0FFOOh) t - - - - - - External Pageo 8 ·511 On-Chip On·Chlp Block BO Block BO 85,535(0FFFFh) -------- llMP/MC • 1 (Mlcroproceoecr Mode) 85,535(0FFFFh) II MP/MC• 0 (Microcomputer Mode) 85,535(0FFFFh) (b) Memory Mapa After a CNFP Instruction Figure 1. Memory Maps INSTRUMENTS TEXAS 'f C-10 POST OFFICE BOX 1443 • HOUSTON, TEXAS 77001 TMS320C28 DIGITAL SIGNAL PROCESSOR WITH POWER-DOWN MODE SPRS019-DECEMBER 1992 interrupts and subroutines The TMS320C28 has three external maskable user interrupts INT2-INTO, available for external devices that interrupt the processor. Internal interrupts are generated by the serial port {RINT and XI NT), by the timer {Tl NT), and by the software interrupt (TRAP) instruction. Interrupts are prioritized with reset (RS) having the highest priority and the serial port transmit interrupt (XINT) having the lowest priority. All interrupt locations are on two-word boundaries so that branch instructions can be accommodated in those locations if desired. A built-in mechanism protects multicycle instructions from interrupts. If an interrupt occurs during a multicycle instruction, the interrupt is not processed until the instruction is completed. This mechanism applies to instructions that are repeated and to instructions that become multicycle due to the READY signal. power-down interrupt During power-down Vee is supplied only to the SAAM, and Ice is decreased to approximately 100 µA. Information not stored in the SAAM will be lost unless transferred to the SAAM. Power-down allows an interrupt service routine to save the contents of those registers that are lost during power-down. POWER-DOWN ACKNOWLEDGE (PDACK) is forced high during power-down, indicating that condition. Return from power-down is accomplished with the PDI and WAKEUP pins. A 100-ms clock stabilization period is required after PDI is asserted. z 0 external interface - ~ The TMS320C28 supports a wide range of system interfacing requirements. Program, data, and 1/0 address spaces provide interface to memory and 1/0, thus maximizing system throughput. 1/0 design is simplified by having 1/0 treated the same way as memory. 1/0 devices are mapped into the 1/0 address space using the :E processor's external address and data buses in the same manner as memory-mapped devices. Interface to memory and 1/0 devices of varying speeds is accomplished by using the READY line. When transactions are a: made with slower devices, the TMS320C28 processor waits until the other device completes its function and 0 L1. signals the processor via the READY line. Then, the TMS320C28 continues execution. A full-duplex serial port provides communication with serial devices such as codecs, serial ND converters, and z other serial systems. The interface signals are compatible with codecs and many other serial devices with a w minimum of external hardware. The serial port may also be used for communication between processors in 0 multiprocessing applications. z The serial port has two memory-mapped registers: the data transmit register (DXR) and the data receive register (DAR). Both registers operate in either the byte mode or 16-bit word mode, and may be accessed in the same ~ c manner as any other data memory location. Each register has an external clock, a framing synchronization pulse, and associated shift registers. One method of multiprocessing may be implemented by programming one <( device to transmit while the others are in the receive mode. The serial port on the TMS320C28 is double-buffered and fully static. multiprocessing The flexibility of the TMS320C28 allows configurations to satisfy a wide range of system requirements and can be used as follows: • A standalone processor • A multiprocessor with devices in parallel • A slave/host multiprocessor with global memory space • A peripheral processor interfaced via processor-controlled signals to another device. For multiprocessing applications, the TMS320C28 has the capability of allocating global data memory space and communicating with that space via the BR (bus request) and READY control signals. Global memory is data memory shared by more than one processor. Global data memory access must be arbitrated. The 8-bit memory-mapped GREG {global memory allocation register) specifies part of the TMS320C28's data memory TEXAS~ INsrRUMENTS POST OFFICE BOX 1443 • HOUSTON, TEXAS 77001 C-11 TMS320C28 DIGITAL SIGNAL PROCESSOR WITH POWER-DOWN MODE SPRS019-DECEMBER 1992 as global external memory. The contents of the register determine the size of the global memory space. If the current instruction addresses an operand within that space, BR is asserted to request control of the bus. The length of the memory cycle is controlled by the READY line. The TMS320C28 supports DMA {direct memory access) to its external program/data memory using the HOLD and HOLDA signals. Another processor can take complete control of the TMS320C28's external memory by asserting HOLD low. This causes the TMS320C28 to place its address data and control lines in a high-impedance state and assert HOLDA. On the TMS320C28, program execution from on-chip ROM may proceed concurrently when the device is in the hold mode. instruction set The TMS320C28 microprocessor implements a comprehensive instruction set that supports both numeric-intensive signal processing operations and general-purpose applications, such as multiprocessing and high-speed control. For maximum throughput, the next instruction is prefetched while the current one is being executed. Since the same data lines are used to communicate to external data/program or 1/0 space, the number of cycles may vary depending upon whether the next data operand fetch is from internal or external memory. Highest throughput :t> is achieved by maintaining data memory on-chip and using either internal or fast external program memory. c addressing modes ~ z The TMS320C28 instruction set provides three memory addressing modes: direct, indirect, and immediate addressing. 0 Both direct and indirect addressing can be used to access data memory. In direct addressing, seven bits of the m -z instruction word are concatenated with the nine bits of the data memory page pointer to form the 16-bit data memory address. Indirect addressing accesses data memory through the auxiliary registers. In immediate addressing, the data is based on a portion of the instruction word{s). "T1 0 In direct memory addressing, the instruction word contains the lower seven bits of the data memory address. :c This field is concatenated with the nine bits of the data memory page pointer to form the full 16-bit address. Thus, memory is paged in the direct addressing mode with a total of 512 pages, each page containing 128 words. 3: ~ Eight auxiliary registers {ARO-AR7) provide flexible and powerful indirect addressing. To select a specific - 0 z auxiliary register, the Auxiliary Register Pointer {ARP) is loaded with a value from Oto 7 for ARO through AR7, respectively. There are seven types of indirect addressing: auto-increment or auto-decrement, post-indexing by either adding or subtracting the contents of ARO, single indirect addressing with no increment or decrement, and bit-reversal addressing with increment or decrement. All operations are performed on the current auxiliary register in the same cycle as the original instruction, following which the current auxiliary register and ARP may be modified. repeat feature A repeat feature, used with instructions such as multiply/accumulates, block moves, 1/0 transfers, and table read/writes, allows a single instruction to be performed up to 256 times. The repeat counter {RPTC) is loaded with either a data memory value {RPT instruction) or an immediate value (RPTK instruction). The value of this operand is one less than the number of times that the next instruction is executed. Those instructions that are normally multicycle are pipelined when using the repeat feature, and effectively become single-cycle instructions. TEXAS~ INSTRUMENTS C-12 POST OFFICE BOX 1443 • HOUSTON, TEXAS 77001 TMS320C28 DIGITAL SIGNAL PROCESSOR WITH POWER-DOWN MODE SPRS019-DECEMBER 1992 scaling shifter The TMS320C28 scaling shifter has a 16-bit input connected to the data bus and a 32-bit output connected to the ALU. The scaling shifter produces a left shift of Oto 16 bits on the input data, as programmed in the instruction. The LSBs of the output are filled with zeroes, and the MSBs may be either filled with zeroes or sign-extended, depending upon the status programmed into the SXM (sign-extension mode) bit of status register ST1 . 16 x 16-blt parallel multiplier The 16 x 16-bit hardware multiplier is capable of computing a signed or unsigned 32-bit product in a single machine cycle. The multiplier has the following two associated registers: • A 16-bit Temporary Register (TR) that holds one of the operands for the multiplier, and • A 32-bit Product Register (PR) that holds the product. Incorporated into the instruction set are single-cycle multiply/accumulate instructions that allow both operands to be processed simultaneously. The data for these operations may reside anywhere in internal or external memory, and can be transferred to the multiplier each cycle via the program and data buses. Four product shift modes are available at the Product Register (PR) output that are useful when performing multiply/accumulate operations, fractional arithmetic, or justifying fractional products. z 0 ~ timer The TMS320C28 provides a memory-mapped 16-bit timer for control operations. The on-chip timer (TIM} register is a down counter that is continuously clocked by CLKOUT1. A timer interrupt {Tl NT) is generated every ~ time the timer decrements to zero. The timer is reloaded with the value contained in the period (PRD) register within the next cycle after it reaches zero so that interrupts may be programmed to occur at regular intervals a: of PRD + 1 cycles of CLKOUT1 . 0 L1. memory control z The TMS320C28 provides a total of 544 16-bit words of on-chip data RAM, divided into three separate blocks w (BO, B1, and B2). Of the 544 words, 288 words (blocks B1 and B2} are always data memory, and 256 words {block BO) are programmable as either data or program memory. A data memory size of 544 words allows the u TMS320C28 to handle a data array of 512 words (256 words if on-chip RAM is used for program memory), while z still leaving 32 locations for intermediate storage. When using block BO as program memory, instructions can be downloaded from external program memory into on-chip RAM and then executed. c ~ When using on-chip program RAM, ROM, or high-speed external program memory, the TMS320C28 runs at <( full speed without wait states. However, the READY line can be used to interface the TMS320C28 to slower, less-expensive external memory. Downloading programs from slow off-chip memory to on-chip program RAM speeds processing while cutting system costs. The TMS320C28 provides three separate address spaces for program memory, data memory, and 1/0. The on-chip memory is mapped into either the 64K-word data memory or program memory space, depending upon the memory configuration (see Figure 1). The CNFD (configure block BO as data memory) and CNFP (configure block BO as program memory) instructions allow dynamic configuration of the memory maps through software. Regardless of the configuration, the user may still execute from external program memory. The TMS320C28 has seven registers that are mapped into the data memory space: a serial port data receive register, serial port data transmit register, timer register, period register, interrupt mask register, global memory allocation register, and powerdown control register. TEXAS~ INSTRUMENTS POST OFFICE BOX 1443 • HOUSTON, TEXAS 77001 C-13 TMS320C28 DIGITAL SIGNAL PROCESSOR WITH POWER-DOWN MODE SPRS019-DECEMBER 1992 instruction set summary Table 1 lists the symbols and abbreviations used in Table 2, the TMS320C28 Instruction Set Summary. Table 2 consists primarily of single-cycle, single-word instructions. Infrequently used branch, 1/0, and CALL instructions are multicycle. The instruction set summary is arranged according to function and alphabetized within each functional grouping. Table 1. Instruction Symbols SYMBOL DEFINITION B 4-bit field specifying a bit code CM 2-bit field specifying compare mode D Data memory address field FO Format status bit M Addressing mode bit K Immediate operand field PA Port address (PAO through PA15 are predefined assembler symbols equal to 0 through 15, respectively.) PM 2-bit field specifying P register output shift code AR 3-bit operand field specifying auxiliary register )> s 4-bit left-shift code c x 3-bit accumulator left-shift field ~ z 0 -.,,mz 0 :D s: ~ 0 z ThXAS ~ INSTRUMENTS C-14 POST OFFICE BOX 1443 • HOUSTON, TEXAS 77001 TMS320C28 DIGITAL SIGNAL PROCESSOR WITH POWER-DOWN MODE SPRS019-DECEMBER 1992 Table 2. TMS320C28 Instruction Set Summary ACCUMULATOR MEMORY REFERENCE INSTRUCTIONS NO. INSTRUCTION BIT CODE MNEMONIC DESCRIPTION WORDS 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 ABS Absolute value of accumulator 1 1 1 0 0 1 1 1 0 0 0 0 1 1 0 1 1 ADD Add to accumulator with shift 1 0 0 0 0 +---s--.. M 4 D .. ADDC Add to accumulator with carry 1 0 1 0 0 0 0 1 1 M 4 D . ADDH Add to high accumulator 1 0 1 0 0 1 0 0 0 M 4 D .._. ADDK Add to accumulator short immediate 1 1 1 0 0 1 1 0 0 4 K ADDS Add to low accumulator with sign extension suppressed 1 0 1 0 0 1 0 0 1 M 4 D .. ADDT Add to accumulator with shift specified by T register 1 0 1 0 0 1 0 1 0 M 4 D . ADLK Add to accumulator long immediate with shift 2 1 1 0 1 +---s--"' o 0 0 0 0 0 1 0 AND AND with accumulator 1 0 1 0 0 1 1 1 0 M 4 D .. z ANDK AND immediate with accumulator with shift 2 1 1 0 1 +---s-"' o 0 0 0 0 1 0 0 0 .. ~~ CMPL Complement accumulator 1 1 1 0 0 1 1 1 0 0 0 1 0 0 1 1 1 LAC Load accumulator with shift 1 0 0 1 0 +---s-.. M 4 D LACK Load accumulator immediate short 1 1 1 0 0 1 0 1 0 4 ... . 0a: K Load accumulator with shift specified by LACT 1 0 1 0 0 0 0 1 0 M 4 D T register LALK Load accumulator long immediate with shift 2 1 1 0 1 +---s--"' 0 0 0 0 0 0 0 1 L1. NEG Negate accumulator 1 1 1 0 0 1 1 1 0 0 0 1 0 0 0 1 1 z NORM Normalize contents of accumulator 1 1 1 0 0 1 1 1 0 1 x x x 0 0 1 0 w OR OR with accumulator 1 0 1 0 0 1 1 0 1 M 4 D . (.) ORK OR immediate with accumulator with shift 2 1 1 0 1 +---s--"' o 0 0 0 0 1 0 1 z ROL ROR Rotate accumulator left Rotate accumulator right 1 1 1 1 1 1 0 0 0 0 1 1 1 1 1 1 0 0 0 0 0 0 1 1 1 1 0 0 1 1 0 0 0 1 ~ c SACH Store high accumulator with shift 1 0 1 1 0 1 .-x-.. M 4 D . <( SACL Store low-order accumulator with shift 1 0 1 1 0 0 .-x-.. M 4 D .. SBLK Subtract from accumulator long immediate with shift 2 1 1 0 1 +---s--"' 0 0 0 0 0 0 1 1 SFL Shift accumulator left 1 1 1 0 0 1 1 1 0 0 0 0 1 1 0 0 0 SFR Shift accumulator right 1 1 1 0 0 1 1 1 0 0 0 0 1 1 0 0 1 SUB SUBB Subtract from accumulator with shift Subtract from accumulator with borrow 1 1 0 0 0 1 0 0 0 1 +---s--.. M 1 1 1 1 M 4 4 D D •. SUBC Conditional subtract 1 0 1 0 0 0 1 1 1 M 4 D . SUBH Subtract from high accumulator 1 0 1 0 0 0 1 0 0 M 4 D .. SUBK Subtract from accumulator short immediate 1 1 1 0 0 1 1 0 1 4 K ... SUBS Subtract from low accumulator with sign extension suppressed 1 0 1 0 0 0 1 0 1 M .. D .. TEXAS~ INSTRUMENTS POST OFFICE BOX 1443 • HOUSTON, TEXAS 77001 C-15 TMS320C28 DIGITAL SIGNAL PROCESSOR WITH POWER-DOWN MODE SPRS019-DECEMBER 1992 Table 2. TMS320C28 Instruction Set Summary (continued) ACCUMULATOR MEMORY REFERENCE INSTRUCTIONS NO. INSTRUCTION BIT CODE MNEMONIC DESCRIPTION WORDS 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 SUBT Subtract from accumulator with shift specified by T register 1 0 1 0 0 0 1 1 0 M 4 D . XOR Exclusive-OR with accumulator 1 0 1 0 0 1 1 0 0 M 4 D . Exclusive-OR immediate with accumulator with XORK shift 2 1 1 0 1 ....-s-... 0 0 0 0 0 1 1 0 ZAC Zero accumulator 1 1 1 0 0 1 0 1 0 0 0 0 0 0 0 0 0 ZALH Zero low accumulator and load high accumulator 1 0 1 0 0 0 0 0 0 M 4 D . ZALR Zero low accumulator and load high accumulator with rounding 1 0 1 1 1 1 0 1 1 M 4 D . )> ZALS Zero accumulator and load low accumulator with sign extension suppressed 1 0 1 0 0 0 0 0 1 M 4 D . c AUXILIARY REGISTERS AND DATA PAGE POINTER INSTRUCTIONS ~ z MNEMONIC DESCRIPTION NO. WORDS INSTRUCTION BIT CODE 0 m ADRK Add to auxiliary register short immediate 1 15 0 14 1 13 1 12 1 11 1 10 1 9 1 8 0 7 4 6 5 4 K 3 2 1 . 0 -z 'Tl CMPR LAR Compare auxiliary register with auxiliary register ARO Load auxiliary register 1 1 1 0 1 0 0 1 0 1 1 1 1 O._ R __..,. M 0 0 1 4 0 1 0 o•cM• o - - -... 0 LARK Load auxilliary register short immediate 1 1 1 0 0 o._R__..,. 4 K . :D LARP Load auxilliary register pointer 1 0 0 1 0 1 0 1 1 0 0 0 1._ R-... 1 . s:: ~ LOP Load data memory page pointer 1 0 1 0 1 0 0 1 0 • M 4 DP D .. - LDPK Load data memory page pointer immediate 1 1 1 0 0 1 0 0 LRLK Load auxiliary register long immediate 2 1 1 0 1 o._R_.o 0 0 0 0 0 0 0 0 MAR Modify auxiliary register 1 0 1 0 1 0 1 0 1 M 4 D . z SAR Store auxiliary register 1 0 1 1 1 o._R_.M 4 D . SBRK Subtract from auxiliary register short immediate 1 0 1 1 1 1 1 1 1 4 K . TEXAS~ INsrRUMENTS C-16 POST OFFICE BOX 1443 • HOUSTON, TEXAS 77001 TMS320C28 DIGITAL SIGNAL PROCESSOR WITH POWER-DOWN MODE SPRS01&--DECEMBER1992 Table 2. TMS320C28 Instruction Set Summary (continued) T REGISTER, P REGISTER, AND MULTIPLY INSTRUCTIONS NO. INSTRUCTION BIT CODE MNEMONIC DESCRIPTION WORDS 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 APAC Add P register to accumulator 1 1 1 0 0 1 1 1 0 0 0 0 1 0 1 0 1 LPH Load high P register 1 0 1 0 1 0 0 1 1 M 4 D . LT Load T register 1 0 0 1 1 1 1 0 0 M . D .. LTA Load T register and accumulate previous prod- uct 1 0 0 1 1 1 1 0 1 M . D . LTD Load T register, accumulate previous product, and move data 1 0 0 1 1 1 1 1 1 M . D . LTP Load T register and store P register in accumulator 1 0 0 1 1 1 1 1 0 M . D . LTS Load T register and subtract previous product 1 0 1 0 1 1 0 1 1 M . D .. MAC Multiply and accumulate 2 0 1 0 1 1 1 0 1 M 4 D . z MACO Multiply and accumulate with data move 2 0 1 0 1 1 1 0 0 M . D . 0 ~ MPV Multiply (with T register, store product in P register) 1 0 0 1 1 1 0 0 0 M 4 D ... MPYA Multiply and accumulate previous product 1 0 0 1 1 1 0 1 0 M .. D .. ::!: MPYK Multiply immediate 1 1 0 1 .... ~ K .... cc MPYS 4 MPYU Multiply and subtract previous product 1 0 0 1 1 1 0 1 1 M .. D D 0 .. LL Multiply unsigned 1 1 1 0 0 1 1 1 1 M PAC Load accumulator with P register 1 1 1 0 0 1 1 1 0 0 0 0 1 0 1 0 0 z .. 0w SPAC Subtract P register from accumulator 1 1 1 0 0 1 1 1 0 0 0 0 1 0 1 1 0 SPH Store high P register 1 0 1 1 1 1 1 0 1 M .. D SPL Store low P register 1 0 1 1 1 1 1 0 0 M . D .. z . ~ SPM Set P register output shift mode 1 1 1 0 0 1 1 1 0 0 0 0 0 1 o+P~ 4 D SQRA SQRS Square and accumulate Square and subtract previous product 1 1 0 0 0 1 1 0 1 1 1 1 0 0 0 1 1 0 M M .. D .. c<( TEXAS INSIRUMENTS 'f POST OFFICE BOX 1443 ° HOUSTON, TEXAS 77001 C-17 TMS320C28 DIGITAL SIGNAL PROCESSOR WITH POWER-DOWN MODE SPRS019-DECEMBER 1992 Table 2. TMS320C28 Instruction Set Summary (continued) BRANCH/CALL INSTRUCTIONS NO. INSTRUCTION BIT CODE MNEMONIC DESCRIPTION WORDS 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 B Branch unconditionally Branch to address specified by accumulator 2 1 1 1 0 1 0 1 1 1 1 0 1 0 0 .. 0 0 D 1 0 .. BACC 1 1 1 1 1 1 1 1 BANZ Branch on auxiliary register not zero 2 1 1 1 1 1 0 1 1 1 .. D . BBNZ Branch if TC bit .. 0 2 1 1 1 1 1 0 0 1 1 ... D .. BBZ Branch if TC bit = O 2 1 1 1 1 1 0 0 0 1 D .. BC Branch on carry 2 0 1 0 1 1 1 1 0 1 .. D .. BGEZ Branch if accumulator :. 0 2 1 1 1 1 0 1 0 0 1 . D . BGZ Branch if accumulator > O 2 1 1 1 1 0 0 0 1 1 ... D . BIOZ Branch on 1/0 status = O 2 0 0 1 . BLEZ Branch if accumulator " O 2 1 1 1 1 1 1 1 1 1 0 0 1 1 0 1 .. D D . :t> c BLZ Branch if accumulator < O 2 1 0 0 1 1 . . BNC Branch on no carry 2 1 0 1 1 0 1 1 1 1 1 1 1 1 .. D .. ~ D BNV Branch if no overflow 2 1 1 1 1 0 1 1 1 1 D . . z 0 m BNZ BV BZ Branch if accumulator .. O Branch on overflow Branch if accumulator = o 2 2 2 1 1 1 1 1 1 1 1 1 0 0 0 1 0 0 0 1 1 0 0 1 1 1 ... D D D .. -z 1 1 1 1 CALA Call subroutine indirect 1 1 1 0 0 1 1 1 0 0 0 1 0 0 1 0 0 'Tl CALL Call subroutine 2 1 1 1 1 1 1 1 0 1 . D . 0 RET Return from subroutine 1 1 1 0 0 1 1 1 0 0 0 1 0 0 1 1 0 lJ 1/0 AND DATA MEMORY OPERATIONS s:: NO. INSTRUCTION BIT CODE -0~ MNEMONIC DESCRIPTION WORDS 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 BLKD Block move from data memory to data memory 2 1 1 1 0 1 1 0 1 M .. D . z BLKP Block move from program memory to data memory 2 1 1 1 1 1 1 0 0 M .. D . DMOV Data move in data memory 1 0 1 0 1 0 1 1 0 M .. D . FORT Format serial port registers 1 1 1 0 0 1 1 1 0 0 0 0 0 1 1 1 FO IN Input data from port 1 1 0 0 0 ..___PA _.M . D . OUT Output data to port 1 1 1 1 0 ..___PA -.M . D . RFSM Reset serial port frame synchronization mode 1 1 1 0 0 1 1 1 0 0 0 1 1 0 1 1 0 RTXM Reset serial port 1ransmit mode 1 1 1 0 0 1 1 1 0 0 0 1 0 0 0 0 0 RXF Reset external flag 1 1 1 0 0 1 1 1 0 0 0 0 0 1 1 0 0 SFSM Set serial port frame synchronization mode 1 1 1 0 0 1 1 1 0 0 0 1 1 0 1 1 1 STXM Set serial port transmit mode 1 1 1 0 0 1 1 1 0 0 0 1 0 0 0 0 1 SXF Set external flag 1 1 1 0 0 1 1 1 0 0 0 0 0 1 1 0 1 TBLR Table read 1 0 1 0 1 1 0 0 0 M .. D .. TBLW Table write 1 0 1 0 1 1 0 0 1 M .. D .. TEXAS" INSTRUMENTS C-18 POST OFFICE BOX 1443 • HOUSTON, TEXAS 77001 TMS320C28 DIGITAL SIGNAL PROCESSOR WITH POWER-DOWN MODE SPRS019-DECEMBER 1992 Table 2. TMS320C28 Instruction Set Summary (concluded) CONTROL INSTRUCTIONS NO. INSTRUCTION BIT CODE MNEMONIC DESCRIPTION WORDS 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 BIT Test bit 1 1 0 0 1 4--- B _.,. M . D .. BITT CNFD Test bit specified by T register Configure block as data memory 1 1 0 1 1 1 0 0 1 0 0 1 1 1 1 1 1 0 M 0 .. 0 0 0 D 0 1 0 . 0 CNFP Configure block as program memory 1 1 1 0 0 1 1 1 0 0 0 0 0 0 1 0 1 DINT Disable interrupt 1 1 1 0 0 1 1 1 0 0 0 0 0 0 0 0 1 EINT Enable interrupt 1 1 1 0 0 1 1 1 0 0 0 0 0 0 0 0 0 IDLE Idle until interrupt 1 1 1 0 0 1 1 1 0 0 0 0 1 1 1 1 1 LST Load status register STO 1 0 1 0 1 0 0 0 0 M . D . LST1 Load status register ST1 1 0 1 0 1 0 0 0 1 M . D .. NOP No operation 1 0 1 0 1 0 1 0 1 0 0 0 0 0 0 0 0 z POP Pop top of stack to low accumulator 1 1 1 0 0 1 1 1 0 0 0 0 1 1 1 0 1 0 . . . ~ POPD Pop top of stack to data memory 1 0 1 1 1 1 0 1 0 M D PSHD Push data memory value onto stack 1 0 1 0 1 0 1 0 0 M . D PUSH Push low accumulator onto stack 1 1 1 0 0 1 1 1 0 0 0 0 1 1 1 0 0 ~ RC Reset carry bit 1 1 1 0 0 1 1 1 0 0 0 1 1 0 0 0 0 a: RHM Reset hold mode 1 1 1 0 0 1 1 1 0 0 0 1 1 1 0 0 0 0 u. ROVM Reset overflow mode 1 1 1 0 0 1 1 1 0 0 0 0 0 0 0 1 0 z RPT Repeat instruction as specified by data memory value 1 0 1 0 0 1 0 1 1 M . D . w RPTK Repeat instruction as specified by immediate value 1 1 1 0 0 1 0 1 1 .. K . 0z --"' ~ RSXM Reset sign-extension mode 1 1 1 0 0 1 1 1 0 0 0 0 0 0 1 1 0 RTC Reset tesVcontrol flag 1 1 1 0 0 1 1 1 0 0 0 1 1 0 0 1 0 SC Set carry bit 1 1 1 0 0 1 1 1 0 0 0 1 1 0 0 0 1 c SHM Set hold mode 1 1 1 0 0 1 1 1 0 0 0 1 1 1 0 0 1 <( SOVM Set overflow mode 1 1 1 0 0 1 1 1 0 0 0 0 0 0 0 1 1 SST Store status register STD 1 0 1 1 1 1 0 0 0 M . D .. SST1 Store status register ST1 1 0 1 1 1 1 0 0 1 M .. D .. SSXM Set sign-extension mode 1 1 1 0 0 1 1 1 0 0 0 0 0 0 1 1 1 STC Set tesVcontrol flag 1 1 1 0 0 1 1 1 0 0 0 1 1 0 0 1 1 TRAP Software interrupt 1 1 1 0 0 1 1 1 0 0 0 0 1 1 1 1 0 TEXAS~ INSTRUMENTS POST OFFICE BOX 1443 • HOUSTON, TEXAS 77001 C-19 TMS320C28 DIGITAL SIGNAL PROCESSOR WITH POWER-DOWN MODE SPRS019-0ECEMBER 1992 absolute maximum ratings over specified temperature range (unless otherwise noted)t Supply voltage range, Vee* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . - 0.3 V to 7 V Input voltage range . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . - 0.3 V to 7 V Output voltage range . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . - 0.3 V to 7 V Continuous power dissipation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.5 W Operating free-air temperature range . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 0°C to 70°C Storage temperature range . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . - 55°C to 150°C t Stresses beyond those listed under "absolute maximum ratings" may cause permanent damage to the device. This is a stress rating only, and functional operation of the device at these or any other conditions beyond those indicated in the "recommended operating conditions" section of this specification is not implied. Exposure to absolute-maximum-rated conditions for extended periods may affect device reliability. *All voltage values are with respect to Vss· recommended operating conditions MIN NOM MAX UNIT Vee Supply voltage 4.75 5 5.25 v Vss Supply voltage 0 v All inputs except CLKIN/CLKX/CLKR/INT (0-2) 2.35 Vee+ o.3 v l> v c V1H High-level input voltage INT {0-2) CLKIN/CLKX/CLKR 2.5 3.5 Vee+ o.3 v ~ Vee +0.3 All inputs except MP/MC -0.3 O.B v V1L Low-level input voltage z MP/MC -0.3 0.8 v 0 loH High-level output current 300 µA m IOL Low-level output current 2 mA .,,-z TA Operating free-air temperature electrical characteristics over specified free-air temperature range (unless otherwise noted) 0 70 'C 0 PARAMETER TEST CONDITIONS MIN TYP§ MAX UNIT lJ s:: VoH High-level output voltage Low-level output voltage Vee = MIN, IOH = MAX 2.4 3 0.3 0.6 v v ~ VoL Vee= MIN, IOL = MAX - 0 z lz 11 ice Three-state current Input current Supply current 1 Normal Vee= MAX v1= Vss to Vee TA= O'C, Vee= MAX, fx =MAX -20 -10 110 20 10 185 µA µA mA j Idle/HOLD 50 100 C1 Input capacitance 15 pF Co Output capacitance 15 pF §All typical values are at Vee= 5 V, TA= 25'. Caution. This device contains circuits to protect its inputs and outputs against damage due to high static voltages or electrostatic fields. These circuits have been qualified to protect this device against electrostatic discharges (ESD) of up to 2 kV according to MIL-STD-883C, Method 3015; however, it is advised that precautions to be taken to avoid application of any voltage higher than maximum rated voltages to these high-impedance circuits. During storage or handling, the device leads should be shorted together or the device should be placed in conductive foam. In a circuit, unused inputs should always be connected to an appropriate logic voltage level, preferably either Vee or ground. Specific guidelines for handling devices of this type are contained in the publication "Guidelines for Handling Electrostatic-Discharge Sensitive (ESDS) Devices and Assemblies" available from Texas Instruments. TEXAS.,, INSTRUMENTS C-20 POST OFFICE BOX 1443 • HOUSTON, TEXAS 77001 TMS320C28 DIGITAL SIGNAL PROCESSOR WITH POWER-DOWN MODE SPRS019-DECEMBER 1992 CLOCK CHARACTERISTICS AND TIMING The TMS320C28 can use either its internal oscillator or an external frequency source for a clock. Internal clock option The internal oscillator is enabled by connecting a crystal across X1 and X2/CLKIN (see Figure 2). The frequency of CLKOUT1 is one-fourth the crystal fundamental frequency. The crystal should be in either fundamental or overtone mode, and parallel resonant, with an effective series resistance of 30 Q, a power dissipation of 1 mW, and be specified at a load capacitance of 20 pF. Note that overtone crystals require an additional tuned LC circuit. PARAMETER TEST CONDITIONS MIN TY Pt MAX UNIT fx Input clock frequency TA= O'C to 70'C 6.7 40.96 MHz fsx Serial port frequency TA= O'C to 70'C ot 5.12 MHz C1, C2 TA= O'C to 70'C 10 pF t The serial port was tested at a minimum frequency of 1.25 MHz. However, the serial port was fully static but will properly function down to fsx =0 Hz. z 0 ~ ::! X1 X2/CLKIN a: 0 LL z w (.) Figure 2. Internal Clock Option z external clock option An external frequency source can be used by injecting the frequency directly into X2/CLK, with X1 left c ~ unconnected. The external frequency injected must conform to specifications listed in the following table. 10 kQ c 74HC04 4.7kQ ~ F11 CLKIN 1----0C z 0.1 µF 0 47 pF 74AS04 m ,,- z I -- 10 kQ I }L -- -- 0 lJ 3: fcrystal (MHz) L (µH) ~ 1.8 - ITMS320C28 40.96 0 Figure 3. External Clock Option z Shown above is a crystal oscillator circuit suitable for providing the input clock signal to the TMS320C28. Please refer to "Hardware Interfacing to the TMS320C1x", in Digital Signal Processing Applications with the TMS320 Family, Volume 2 (document number SPRA016) for details on circuit operation. i=I 2.15 v 825 From Output Q Under Test Test Point CL=100pF Figure 4. Test Load Circuit TEXAS~ INSTRUMENTS C-22 POST OFFICE BOX 1443 • HOUSTON, TEXAS 77001 TMS320C28 DIGITAL SIGNAL PROCESSOR WITH POWER-DOWN MODE SPRS019-DECEMBER 1992 ~t===~ : : : ~L==~::::: 2.0V 2.4V 1.88V 2.2V 0.92V O.BV O.BOV 0.6V 0 0 (a) Input (b) Output Figure 5. Voltage Reference Levels MEMORY AND PERIPHERAL INTERFACE TIMING switching characteristics over recommended operating conditions (see Note 1) PARAMETER MIN TYP MAX UNIT td(C1-S) STRB from CLKOUT1 (if STRB is present) 0-6 0 0+6 ns z 0 td(C2-S) CLKOUT2 to STRB (if STRB is present) -6 0 6 ns - tsu(A) Address setup time before STRB low (see Note 2) Address hold time after STRB high (see Note 2) 0-12 ns !:t ~ th(A) 0-8 ns tw(SL) STRB low pulse duration (no wait states, see Note 3) 20-5 20+ 5 ns a: tw(SH) STRB high pulse duration (between consecutive cycles, see Note 3) 20-5 20+ 5 ns 0 1su(D)W Data write setup time before STRB high (no wait states) 20-20 ns LL th(D)W Data write hold time from STRB high 0-10 0 ns z ten(D) Data bus starts being driven after STRB low (write cycle) ot ns w tdis(D) Data bus three-state after STRB high (write cycle) 0 0 + 15t ns 0 tq_(._MSq)_ MSC valid from CLKOUT1 -12 0 12 ns z ~ t Value derived from characterization data and not tested. NOTES: 1. 0 = 1/4lc(Ql· 2. A 15-AO, PS, OS, rs, Rfiii, and BR timings are all included in timings referenced as "address". 3. Delays between CLKOUT1/CLKOUT2 edges and STRB edges track each other, resulting in tw(SL) and tw(SH) being 20 with no wait c states. tf(IN) INT/BIO fall time st ns c tw(IN) INT/BIO low pulse duration tc(C) ns ~ twJ_R~ RS low pulse duration 3ts._g_ ns z t Value derived from characterization data and not tested. NOTES: 1. Q =1/41c(C)·_ 0 5. RS, INT, and BIO are asynchronous inputs and can occur at any time during a clock cycle. However, if the specified setup time is met, m - z i1 the exact sequence shown in the timing diagrams will occur. HOLD TIMING 0 :c switching characteristics over recommended operating conditions (see Note 1) PARAMETER MIN TVP MAX UNIT 3:: ~ lci(C1L-AL) HOLDA low after CLKOUT1 low 0 10 ns - 0 z ldis(AL-A) ldis(C1 L-A) lci(HH-AH) HOLDA low to address three-state Address three-state after CLKOUT1 low (HOLD mode, see Note 6) HOLD high to HOLDA high ot 2ot 25 ns ns ns le~-C1l,)_ Address driven before CLKOUT1 low (HOLD mode, see Note 6) st ns t Value derived from characterization data and not tested. NOTES: 1. Q = 1/41c.(Q): 6. A15-AO, P~. DS, iS, STAB, and RfW timings are all included in timings referenced as "address." timing requirements over recommended operating conditions (see Note 1) MIN NOM MAX UNIT ld C2H-H HOLD valid after CLKOUT2 high 0- 24 ns NOTE 1: Q = 1/4tc(C)' TEXAS~ INSTRUMENTS C-24 POST OFFICE BOX 1443 ° HOUSTON, TEXAS 77001 TMS320C28 DIGITAL SIGNAL PROCESSOR WITH POWER-DOWN MODE SPRS019-DECEMBER 1992 SERIAL PORT TIMING switching characteristics over recommended operating conditions (see Note 1) PARAMETER MIN TYP MAX UNIT lcl(CH-DX) DX valid after CLKX rising edge (see Note 7) 75 ns lcl(FL-DX) DX valid after FSX falling edge (TXM = 0, see Note 7) 40 ns ' I td(CIH-C) ~ I I i - - lw(CL) ---+I c I I I '--r- ld(CIH-C) I I ~ CLKOUT1 : ;; : ~ Yi 'N,.,._1 - - - - z : : : : l~tw(CH)~: 0 I I 14--+j- ld(CIH-C) I -.i I+- tr(C) -.i I+- lf(C) m ,,-z STRB!\. I I I : '4------..t- ld(CIH-C) I I : I I I lc(C) - - - - - - 0 1 I I I I !.-- I tw(CL)~ lJ s: CLKOUT2 __A-'; ---t:--. . .~ l : Ii ~ Yr, ~ ld(C1-C2) 1 14 I l > j l.._,._ _~l>j'-id(C1-C2) I -+j I+- lf(C) I lr(C) _.j l+- - 0 id(C1 -C2) 1 id(C1-C2) /.i l.i 1>I •I 14--- lw(CH)---.! z Figure 6. Clock Timing TEXAS.,, INsrRUMENTS C-26 POST OFFICE BOX 1443 •HOUSTON, TEXAS 77001 TMS320C28 DIGITAL SIGNAL PROCESSOR WITH POWER-DOWN MODE SPRS019-DECEMBER 1992 PARAMETER MEASUREMENT INFORMATION f4-- td(C1-S)-+! I I CLKOUT1 '\~ \. :I /f I \ '----- I 14-- ld(C1-S) -.i I I CLKOUT2 \'--_ ___,/f : I I \: ~ I I td(C2-S) -.i ~ td(C2·S) -.i ~ I STRB ~-I_ _ ;! [\ I I ~tw(SH)~ tsu(A) -1-1111--•\ : 11111 •I th(A) I 11111 tw(SL) ---+! I I z A15-AO, BR,PS,DS Valid 0 ~ oriS \XXXXW I I ~ R/W /':!XX:# _ _ _ _......____ td(SL·R) -.i I I : I I a: ~ 0 u. ~~ READY z w I I th(SL·R) --;o[lllle----,-1.i•I I ~ ~ th(D)R 0 z -------------<~ ~>------ ~ D15-DO Data In c Figure 7. Memory Read Timing <( TEXAS INSTRUMENTS ..fl POST OFFICE BOX 1443 ° HOUSTON, TEXAS 77001 C-27 TMS320C28 DIGITAL SIGNAL PROCESSOR WITH POWER-DOWN MODE SPRS019-DECEMBER 1992 PARAMETER MEASUREMENT INFORMATION CLKOUT1 \ I \ CLKOUT2 \ I \ I STAB \ I /I I IJlol th(A) \ I"' tsu(A) I... ... 1 I I I I A15-AO, BR,PS, OS Vslld or iS )> I I c I I ~ z ~ ~ 0 m .,,-z READY 0 JJ 015-00 Data Out :s:: I II I I -0~ -.i I+- len(O) ~ ldis(O) -.i Figure 8. Memory Write Timing z TEXAS~ INSTRUMENTS C-28 POST OFFICE BOX 1443 ° HOUSTON, TEXAS 77001 TMS320C28 DIGITAL SIGNAL PROCESSOR WITH POWER-DOWN MODE SPRS019-DECEMBER 1992 PARAMETER MEASUREMENT INFORMATION CLKOUT1 \ /i \ I \~- 1 I I CLKOUT2 __:I _/i I I \ Ii \ ____ I I I I -----1 I I ---,1 : ) I I I I I I I · A1S-AO, BR, PS, OS, Rfii or iS -----~ : : ·::·,. :· ·: ~ Id 12H·R -.1 4 J+- ..!~I+- I READY I~~ z tCl(M:R) I ~ I -.i J+- lh(M·R) 0 I I -+I i4-+- 1h(M·R) td(M·R) ,.. ..1 I 01S-DO (For Read I I I lI I 1 ( oata In ) ) . . . - - - - - 1 . ~ Operation) 1I I I . I I I I I I :::? D1S-DO (For Write Operation) --1-i-~ -.l :.-- 14- -l>j :I DataOut : I )®- a: 0 LL ld(MSC) ld(MSC) z ~~ ~ w 0 Figure 9. One Wait-State Memory Access Timing z ~ c <( TEXAS INSTRUMENTS 'I POST OFFICE BOX 1443 • HOUSTON, TEXAS 77001 C-29 TMS320C28 DIGITAL SIGNAL PROCESSOR WITH POWER-DOWN MODE SPRS019-DECEMBER 1992 PARAMETER MEASUREMENT INFORMATION )> c ~ z 0 m -z 'T1 0 l:J 3: ~ t Q Control signals are OS, iS, Rf\N, and XF. Z *Serial port controls are DX and FSX. Figure 1o. Reset Timing TEXAS INSTRUMENTS 'I C-30 POST OFFICE BOX 1443 • HOUSTON, TEXAS 77001 TMS320C28 DIGITAL SIGNAL PROCESSOR WITH POWER-DOWN MODE SPRS019--DECEMBER 1992 PARAMETER MEASUREMENT INFORMATION CLKOUT1 A11>-AO FETCHN N+3 FETCH I Figure 11. Interrupt Timing z 0 ~ !+--- tc(SCK) ---.i :E I -+! I+- tr(SCK) a: I I I I I 1- tw(SCK) 0 I i . -. 1- ..... LL CLKR I ,. ....___,..._ I I I~-..._ z I .,.I____ th(DR) -+I l+- I I I .,..__.,,- I w tf(SCK) -+I i+- I 0 4il I+- th(FS) I I I I I 1•4---•o--I- tw(SCK) z FSR _A~i--+-:-\ I! ~ c 14 •I tau(FS) ~ I I l+t tau(DR) c FSX ;; (Output, 1XM =1) z 0 Figure 13. Serial Port Transmit Timing m -z "T1 0 :D :s:: ~ -0z C-32 1ExAs" INSIRUMENTS POST OFFICE BOX 1443 •HOUSTON, TEXAS 77001 TMS320C28 DIGITAL SIGNAL PROCESSOR WITH POWER-DOWN MODE SPRS019--DECEMBER 1992 PARAMETER MEASUREMENT INFORMATION CLKOUT1 FETCH Branch Address FETCH Next Instruction FETCH A1S-AO BIOZ PC = N PC = N + 1 PC = N + 2 I or Branch Address tsu(IN) -.! i.- ~_.., 1 I ~ .,,., z I Valid 0 Figure 14. BIO Timing ~ ~ a: 0 CLKOUT1 u. z w u z FETCH ~ A1S-AO SXF/RXF Valid Valid Valid c PC=N PC= N + 1 PC= N + 2 PC= N + 3 c ~ z ~-----­ ~------ 0 m .,,-0z R/W ~ 14-- lclls(Ct L·A) I I :D DtS-00 0 0>---------:-:------ :s:: 1--+I ~ ldls(AL·A) ----------------------------------------+--. ~ I II - HOLDA I 0 -+I 14- tcl(Ct L·AL) z t HOLD is an asynchronous input and can occur at anytime during a clock cycle. If the specified timing is met, the exact sequence shown will occur; otherwise, a delay of one CLKOUT2 cycle will occur. Figure 16. HOLD Timing (Part A) 1ExAs.,, INSIRUMENTS C-34 POST OFFICE BOX 1443 • HOUSTON, TEXAS 77001 TMS320C28 DIGITAL SIGNAL PROCESSOR WITH POWER-DOWN MODE SPRS019-DECEMBER 1992 PARAMETER MEASUREMENT INFORMATION CLKOUT1 CLKOUT2 -+j I+- ten(A-C1 L) STRB ~~~1--~~~~~~~~' I I !+- tcl(C2H-H) t I HOLD I I I I PS,DS, or iS ----@V I I Valid ) z I I 0 Rfii ----w I I I I I ~ :!! tt: I D15-DO I I 0 LL _.I 14- td(HH-AH) I z I HOLDA I I w I 0 z A15-AO - - - - - - - - - - - - - - ~ N+2 )0( N+2 > ~ FETCH ..... ..... N+2 .. c <( N+1 EXECUTE t HOLD is an asynchronous input and can occur at anytime during a clock cycle. If the specified timing is met, the exact sequence shown will occur; otherwise, a delay of one CLKOUT2 cycle will occur. Figure 17. HOLD Timing (Part B) \ \ TEXAS INSTRUMENTS 'I POST OFFICE BOX 1443 • HOUSTON, TEXAS 77001 C-35 TMS320C28 DIGITAL SIGNAL PROCESSOR WITH POWER-DOWN MODE SPRS019-0ECEMBER 1992 MECHANICAL DATA 80-pln EIAJ quad flat pack (PH suffix) f 14, 200 (0.559) 13, 800 (0.543) 18, 000 (0. 709) 17' 000 (0.677) 0,100 (0.003) MIN 1, 000 (0.039) o, 600 (0.024) l> c ~ z 0 m .,,-z 0 :CJ s: 0,800 (0.031) TYP !i- ALL LINEAR DIMENSIONS ARE IN MILIMETERS AND PARENTHETICALLY IN INCHES 0 z TEXAS~ INSTRUMENTS C-36 POST OFFICE BOX 1443 •HOUSTON, TEXAS 77001 TMS320C28 DIGITAL SIGNAL PROCESSOR WITH POWER-DOWN MODE SPRS019-DECEMBER 1992 MECHANICAL DATA 68-lead plastic leaded chip carrier package (FN suffix) Seating Plane 1,27 (0.050) T.P. I 0,25 (0.010) R MAX (see Note B) I 3 Places I 24,33 (0.956) 24,13 (0.950) 23,62 (0.930) (see Note A) 23, 11 (0.910) (At Seating Plane) 25,27 (0.995) z 0 25,02 (0.985) - ~ ~ a: "'' . .,.., .J 1,07 (0.042) x 45 I 1,35 (0.053) 0 LL 24,33 (0.956) ~ 1,19 (0.047) x45° z 24, 13 (0.950) (see Note A) 2,79 (0.110) w 2,41 (0.095) u 25,27 (0.995) - - - - - 25,02 (0.985) 4,50 (0.177) z ~ - - - 4,24 (0.167) c 0,81 (0.032) 1 52 (0 060) <( ··~·~· ¥];'·. ~ . ~ Thermal Resistance Characteristics PARAMETER MAX UNIT ReJA ReJC Junction-to-free-air thermal resistance Junction-to-case 51.3 14.5 °C/W °C/W w MIN _J l thermal resistance 0,51 (0.020) 0,36 (0.014) Lead Detall ALL LINEAR DIMENSIONS ARE IN MILLIMETERS AND PARENTHETICALLY IN INCHES NOTES: A. Centerline of center pin, each side, is within 0, 1O (0.004) of package centerline as determined by this dimension. B. Location of each pin is within 0, 127 (0.005} of true position with respect to center pin on each side. TEXAS INSTRUMENTS 'I POST OFFICE BOX 1443 • HOUSTON, TEXAS 77001 C-37 TMS320C28 DIGITAL SIGNAL PROCESSOR WITH POWER-DOWN MODE SPRS019--0ECEMBER 1992 MECHANICAL DATA 68-lead FZ CER-QUAD, ceramic leaded chip carrier package This hermetically-sealed chip carrier package consists of a ceramic base, ceramic cap, and a 68-lead frame. Hermetic sealing is accomplished with glass. The FZ package is intended for both socket- or surface- mounting. Having a Sn/Pb ratio of 60/40, the tin/lead-coated leads do not require special cleaning or processing when being surface-mounted. The 28-lead package is shown for illustration. Refer to the table below for 68-lead package dimensions. i . - - - t - - 4,57 (0.180) 3,94 (0.155) 3,55 (0.140) 3,05 (0.120) )> c ~ (At Seating Plane) 0,81 (0.032) z 0,68 (0.026) 0 m -.,,z (see Note A) 0,64 (0.025) R MAX 1,016 (0.040) MIN 0 3 Places Ref lJ Thermal Resistance Characteristics s:: PARAMETER Max UNIT 3,05 (0.120) _ _,__ 2,29 (0.090) -!:t I Junction-to-free-air I ReJA 51.3 ·ctw Seating Plane 0 thermal resistance (see ffote D) z ReJC Junction-to-case thermal resistance 14.5 ·ctw ALL LINEAR DIMENSIONS ARE IN MILLIMETERS AND PARENTHETICALLY IN INCHES NOTES: A. Glass is optional, and the diameter is dependent on device application. B. Centerline of center pin, each side, is within 0, 10 (0.004) of package centerline as determined by dimension B. C. Location of each pin is within 0, 127 (0.005) of true position with respect to center pin on each side. D. The lead contact points are within 0, 15 (0.006) of being planar. TEXAS INSIR.UMENTS 'f C-38 POST OFFICE BOX 1443 • HOUSTON, TEXAS 77001 Appendix D SMJ320C2x Digital Signal Processors ~~~~~~~~~~~~~~'ff:==:.w:w.«~W:®f«::~@.&w.e.$;fil@.S?.::..~=~mxm.?:w.-.:m:w This appendix contains data sheet information on the SMJ320C2x digital sig- nal processors family. D-1 SMJ320C2x Digital Signal Processors D-2 SMJ320C2x Digital Signal Processors SMJ320C25, SMJ320C25-50 DIGITAL SIGNAL PROCESSORS SGUSOO?C - AUGUST 1988 - REVISED AUGUST 1992 68-PIN FJ AND FD PACKAGESt • Military Temperature Range (TOP VIEW) ... - 55°C to 125°C 1u >- 0 .... C\I (") ~ U'l ~ IQ lg c:o ai .......................... c... o ~ ~ ?i UJIU) ....J u 0 .....1 o o • 100-ns or 80-ns Instruction Cycle Times OOOODODD~mr~~OO>> r"987'65 4 3 2 1 sa 67 ss ss 64 63 s2'61 • 544 Words of Programmable On-Chip Data Vss D7 10 11 60 59 IACK MSC RAM D6 12 58 CLKOUT1 D5 13 57 CLKOUT2 • 4K Words of On-Chip Program ROM D4 D3 14 15 56 55 XF HOLDA • 128K Words of Data/Program Space D2 01 16 17 54 53 DX FSX • 16 Input and 16 Output Channels DD SYNC 18 19 52 51 X2 / CLKIN X1 INTO 20 50 8R • 16-Bit Parallel Interface INT1 21 49 STUB INT2 22 48 R/W • Directly Accessible External Data Memory Vee DR 23 24 47 46 PS IS Space FSA 25 45 os AO 44 Vss • Global Data Memory Interface 26 27 28 29 30 313233 34 35 36 37 38 39 40414243 ~~~~~~~~8~~~~~~~~ • 16-Bit Instruction and Data Words > > ~~~~~~ • 16 x 16-Bit Multiplier With a 32-Bit Product 68-PIN GB • 32-Bit ALU and Accumulator PIN GRID ARRAY CERAMIC PACKAGEt (TOP VIEW) • Single-Cycle Multiply/Accumulate 2 3 4 5 6 7 8 9 10 11 Instructions ,r • • O to 16-Bit Scaling Shifter Bit Manipulation and Logical Instructions A . . • • • • • • • • • • ~ • • (e'J . . c • • • • • Instruction Set Support for Floating-Point • • • • Operations, Adaptive Filtering, and • • • • Extended-Precision Arithmetic • • • • • Block Moves for Data/Program G • • • • Management H • • • • • Repeat Instructions for Efficient Use of • • • • Program Space • ~ • • • • • • • (9) • • • • • • • • • • • Eight Auxiliary Registers and Dedicated Arithmetic Unit for Indirect Addressing t See Pin Assignments Table (Page 2) and Pin Nomenclature • Serial Port for Direct Codec Interface Table (Page 3) for locations and descriptions of all pins . • Synchronization Input for Synchronous Multiprocessor Configurations • Programmable Output Pin for Signaling External Devices • Wait States for Communication to Slow Off-Chip Memories/Peripherals • Single 5-V Supply • On-Chip Timer for Control Operations • On-Chip Clock Generator • Three External Maskable User Interrupts • Packaging: - 68-Pin Leaded Ceramic Chip Carrier • Input Pin Polled by Software Branch (FJ Suffix) Instruction 68-Pin Ceramic Grid Array (GB Suffix) • 1.6-µm CMOS Technology 68-Pin Leadless Ceramic Chip Carrier (FD Suffix) PRODUCTION DATA information is current as of Copyright© 1992, Texas Instruments Incorporated TEXAS~ publication date. Products conform to specifications per the terms of Tex11 Instruments sUindard warranty. Production processing does not necessarily include testing of all parameters. INSTRUMENTS POST OFFICE BOX 1443 • HOUSTON, TEXAS 77001 D-3 SMJ320C25, SMJ320C25·50 DIGITAL SIGNAL PROCESSORS SGUS007C-AUGUST 1988 - REVISED AUGUST 1992 description This data sheet provides thorough design documentation for the SMJ320C25 and the SMJ320C25-50 digital signal processor devices in the SMJ320 family of VLSI digital signal processors and peripherals. The SMJ320 family supports a wide range of digital signal processing applications such as tactical communications, guidance, military modems, speech processing, spectrum analysis, audio processing, digital filtering, high-speed control, graphics, and other computation-intensive applications. Differences between the SMJ320C25 and the SMJ320C25-50 are specifically identified, as in the following paragraph and in the parameter tables on pages 18 through 24 of this data sheet. When not specifically differentiated, the term SMJ320C25 is used to describe both devices. The SMJ320C25 has a 100-ns instruction cycle time. The SMJ320C25-50 has an 80-ns instruction cycle time. With these fast instruction cycle times and their innovative memory configurations, these devices perform operations necessary for many realtime digital signal processing algorithms. Since most instructions require only one cycle, the SMJ320C25 is capable of executing 12.5 million instructions per second. On-chip data RAM of 544 16-bit words, on-chip program ROM of 4K words, direct addressing of up to 64K words of external data memory space and 64K words of external program memory space, and multiprocessor interface features for sharing global memory minimize unnecessary data transfers to take full advantage of the capabilities of the processor. PGA/CLCC/LCCC PIN ASSIGNMENTS FUNCTION PIN FUNCTION PIN FUNCTION PIN FUNCTION PIN FUNCTION PIN FUNCTION PIN AO K1/26 A12 KB/40 02 E1/16 014 A5/3 INT2 H1/22 Vee H2/23 A1 K2/2B A13 L9/41 03 02/15 015 B6/2 iS J11/46 Vee L6/35 A2 L3/29 A14 K9/42 04 01/14 DR J1/24 MP/MC A6/1 Vss B1/10 A3 K3/30 A15 L10/43 05 C2/13 OS K10/45 MSC C10/59 Vss K11/44 A4 L4/31 BIO B7/6B 06 C1/12 DX E11/54 PS J10/47 Vss L2/27 A5 K4/32 BR G11/50 07 B2/11 FSR J2/25 READY BB/66 XF 011/56 AB L5/33 CLKOUT1 C11/5B DB A2/9 FSX F10/53 RS AB/65 X1 G10/51 A7 K5/34 CLKOUT2 010/57 09 B3/B HOLD A7/67 RfW H11/4B X2/CLKIN F11/52 AB K6/36 CLKR B9/64 010 A3/7 HOLDA E10/55 STRB H10/49 A9 L7/37 CLKX A9/63 011 B4/6 IACK B11/60 SYNC F2/19 A10 K7/3B DO F1/1B 012 A4/5 INTO G1/20 Vee A10/61 A11 LB/39 01 E2/17 013 B5/4 INT1 G2/21 Vee B10/62 TEXAS~ INSTRUMENTS 0-4 POST OFFICE BOX 1443 • HOUSTON, TEXAS 77001 SMJ320C25, SMJ320C25-50 DIGITAL SIGNAL PROCESSORS SGUS007C - AUGUST 1988 - REVISED AUGUST 1992 PIN NOMENCLATURE SIGNALS l/OJZt DEFINITION Vee I 5-V supply pins Vss I Ground pins X1 0 Output from internal oscillator for crystal X2/CLKIN I Input to internal oscillator from crystal or external clock CLKOUT1 0 Master clock output (crystal or CLKIN frequency/4) CLKOUT2 0 A second clock output signal D15-DO 1/0/Z 16-bit data bus D15 (MSB) through DO (LSB). Multiplexed between program, data, and 1/0 spaces. A15-AO O/Z 16-bit address bus A 15 (MSB) through AO (LSB) PS,DS,iS O/Z Program, data, and 1/0 space select signals R/W 0/Z Read/write signal STAB O/Z Strobe signal RS I Reset input INT2-INTO I External user interrupt inputs MP/MC I Microprocessor/microcomputer mode select pin MSC 0 Microstate complete signal IACK 0 Interrupt acknowledge signal READY I Data ready input. Asserted by external logic when using slower devices to indicate that the current bus transaction is complete. BR 0 Bus request signal. Asserted when the SMJ320C25 requires access to an external global data memory space. XF 0 External flag output (latched software-programmable signal) HOLD I Hold input. When asserted, SMJ320C25 goes into an idle mode and places the data, address, and control lines in the high-impedance state. HOLDA 0 Hold acknowledge signal SYNC I Synchronization input BIO I Branch control input. Polled by BIOZ instruction. DR I Serial data receive input CLKR I Clock for receive input for serial port FSA I Frame synchronization pulse for receive input DX O/Z Serial data transmit output CLKX I Clock for transmit output for serial port FSX 1/0/Z Frame synchronization pulse for transmit. Configurable as either an input or an output. t 1/0/Z denotes input/output/high-impedance state. TEXAS 'f INSTRUMENTS POST OFFICE BOX 1443 ° HOUSTON, TEXAS 77001 0-5 SMJ320C25, SMJ320C25-50 DIGITAL SIGNAL PROCESSORS SGUS007C-AUGUST 1988- REVISED AUGUST 1992 functional block diagram SYNC - PROGRAM BUS IS z-N :;z~~ Ds Ps RIW-+-i 11 x~dd -'00 Q. ::t'. ~ I[ PFC(16) 16 16 + 16 16 OIR(16) btlJ ~ STAB-+-! IR(16) READY~ a: 16 ST0(16) 8R-+-I llJ ::l 16 ST1(16) XF -+-I HOLD----1 0 a: f- 6 .----------..- RPTC(8) z IFR(6) HOLD1=::=1 MSC 0 MCS(16)~ [ PC(16) u DR ~ Bl__. (ON-CHIP ROM) REGISTERS 31 (001 Fh) 5 (0005h) 32 (0020h) 32 (0020h) 6 (0006h) ON-CHIP PAGEO RESERVED 4015 (OFAFh) ROM 95 (005Fh) 4016 (OFBOh) 96 (0060h) ON-CHIP RESERVED 4095 (OFFFh) 127 (007Fh) BLOCK B2 j/ 4096 (1 OOOh) 128 (0080h) EXTERNAL RESERVED p AGES 1-3 511 (01 FFh) 512 (0200h) EXTERNAL DOES NOT pAGES 4-5 767 (02FFh) EXIST 768 (0300h) ON-CHIP p AGES 6-7 65279 (FEFFh) 65279 (FEFFh) 1023 (03FFh) BLOCK B1 --------j 65280 (FFOOh) ON·CHIP 65280 (FFOOh) 1024 (0400h) ON-CHIP p AGES 8-511 EXTERNAL 65535 (FFFFh) ....__B_L_o_c_K_B_0_ _, BLOCK BO 65535 (FFFFh) 65535 (FFFFh) IF MP/MC= 1 IF MP/MC= 0 (MICROPROCESSOR MODE) (MICROCOMPUTER MODE) Figure 2. Memory Maps After a CNFP Instruction TEXAS~ INSTRUMENTS POST OFFICE BOX 1443 • HOUSTON, TEXAS 77001 D-9 SMJ320C25, SMJ320C25·50 DIGITAL SIGNAL PROCESSORS SGUS007C - AUGUST 1988 - REVISED AUGUST 1992 interrupts and subroutines The SMJ320C25 has three external maskable user interrupts INT2-INTO, available for external devices that interruptthe processor. Internal interrupts are generated by the serial port (RINT and XINT), by the timer (TINT), and by the software interrupt (TRAP) instruction. Interrupts are prioritized with reset (RS) having the highest priority and the serial port transmit interrupt (XINT) having the lowest priority. All interrupt locations are on two-word boundaries so that branch instruction can be accommodated in those locations if desired. A built-in mechanism protects multicycle instructions from interrupts. If an interrupt occurs during a multicycle instruction, the interrupt is not processed until the instruction is completed. This mechanism applies both to instructions that are repeated or become multicycle due to the READY signal. external interface The SMJ320C25 supports a wide range of system interfacing requirements. Program, data, and 1/0 address spaces provide interface to memory and 1/0, thus maximizing system throughout. 1/0 design is simplified by having 1/0 treated the same way as memory. 1/0 devices are mapped into the 1/0 address space using the processor's external address and data buses in the same manner as memory-mapped devices. Interface to memory and 1/0 devices of varying speeds is accomplished by using the READY line. When transitions are made with slower devices, the SMJ320C25 processor waits until the other device completes its function and signals the processor via the READY line. Then, the SMJ320C25 continues execution. A full-duplex serial port provides communication with serial devices, such as codecs, serial ND converters, and other serial systems. The interface signals are compatible with codecs and many other serial devices with a minimum of external hardware. The serial port may also be used for intercommunication between processors in multiprocessing applications. The serial port has two memory-mapped registers: the data transmit register (DXR) and the data receive register (DRR). Both registers operate in either the byte mode or 16-bit word mode, any may be accessed in the same manner as any other data memory location. Each register has an external clock, a framing synchronization pulse, and associated shift registers. One method of multiprocessing may be implemented by programming one device to transmit while the others are in the receive mode. multiprocessing The flexibility of the SMJ320C25 allows configurations to satisfy a wide range of system requirements. The SMJ320C25 can be used as follows: • A standalone processor • A multiprocessor with devices in parallel • A slave/host multiprocessor with global memory space • A peripheral processor interfaced via processor-controlled signals to another device . For multiprocessing applications, the SMJ320C25 has the capability of allocating global data memory space and communicating with that space via the BR (bus request) and READY control signals. Global memory is data memory shared by more than one processor. Global data memory access must be arbitrated. The 8-bit memory-mapped GREG (global memory allocation register) specifies part of the SMJ320C25s data memory as global external memory. The contents of the register determine the size of the global memory space. If the current instruction addresses an operand within that space, BR is asserted to request control of the bus. The length of the memory cycle is controlled by the READY line. TEXAS 'J1 INSTRUMENTS D-10 POST OFFICE BOX 1443 • HOUSTON, TEXAS 77001 SMJ320C25, SMJ320C25-50 DIGITAL SIGNAL PROCESSORS SGUS007C - AUGUST 1966 - REVISED AUGUST 1992 The SMJ320C25 supports DMA (direct memory access) to its external program/data memory using the HOLD and HOLDA signals. Another processor can take complete control of the SMJ320C25s external memory by asserting HOLD low. This causes the SMJ320C25 to place its address, data, and control lines in a high-impedance state, and assert HOLDA. Program execution from on-chip memory may proceed concurrently while the device is in the hold mode. instruction set The SMJ320C25 microprocessor implements a comprehensive instruction set that supports both numeric-intensive signal processing operations as well as general-purpose applications, such as multiprocessing and high-speed control. For maximum throughput, the next instruction is prefetched while the current one is being executed. Since the same data lines are used to communicate to external data/program or 1/0 space, the number of cycles may vary depending upon whether the next data operand fetch is from internal or external program memory. Highest throughput is achieved by maintaining data memory on-chip and using either internal or fast external program memory. addressing modes The SMJ320C25 instruction set provides three memory addressing modes: direct, indirect, and immediate addressing. Both direct and indirect addressing can be used to access data memory. In direct addressing, seven bits of the instruction word are concatenated with the nine bits of the data memory page pointer to form the 16-bit data memory address. Indirect addressing accesses data memory through the eight auxiliary registers. In immediate addressing, the data is based on a portion of the instruction word(s). In direct memory addressing, the instruction word contains the lower seven bits of the data memory address. This field is concatenated with the nine bits of the data memory page pointer to form the full 16-bit address. Thus, memory is paged in the direct addressing mode with a total of 512 pages, each page containing 128 words. Eight auxiliary register (ARO-AR?) provide flexible and powerful indirect addressing. To select a specific auxiliary register, the Auxiliary Register Pointer (ARP) is loaded with a value from 0 through 7 for ARO-AR?, respectively. There are seven types of indirect addressing: auto-increment or auto-decrement, post-indexing by either adding or subtracting the contents of ARO, or single indirect addressing with no increment or decrement and bit-reversal addressing (used in FFTs) with increment or decrement. All operations are performed on the current auxiliary register in the same cycle as the original instruction, followed by a new ARP value being loaded. repeat feature A repeat feature, used with instructions such as multiply/accumulates, block moves, 1/0 transfers, and table read/writes, allows a single instruction to be performed up to 256 times. The repeat counter (RPTC) is loaded with either a data memory value (RPT instruction) or an immediate value (RPTK instruction). The value of this operand is one less than the number of times that the next instruction is executed. Those instructions that are normally multicycle are pipelined when using the repeat feature, and effectively become single-cycle instructions. TEXAS~ INSTRUMENlS POST OFFICE BOX 1443 • HOUSTON, TEXAS 77001 D-11 SMJ320C25, SMJ320C25·50 DIGITAL SIGNAL PROCESSORS SGUS007C-AUGUST 1988 - REVISED AUGUST 1992 instruction set summary Table 1 lists the symbols and abbreviations used in Table 2, the instruction set summary. Table 2 consists primarily of single-cycle, single-word instructions. Infrequently used branch, 1/0, and CALL instructions are multicycle. The instruction set summary is arranged according to function and alphabetized within each functional grouping. Table 1. Instruction Symbols SYMBOL MEANING B 4-bit field specifying a bit code CM 2-bit field specifying compare mode D Data memory address field FO Format status bit M Addressing mode bit K Immediate operand field PA Port address (PAO-PA 15 are predefined assembler symbols equal to 0 through 15, respectively) PM 2-bit field specifying P register output shift code R 3-bit operand field specifying auxiliary register s 4-bit left-shift code x 3-bit accumulator left-shift field TEXAS 'JI INSTRUMENTS D-12 POST OFFICE BOX 1443 • HOUSTON, TEXAS 77001 SMJ320C25, SMJ320C25·50 DIGITAL SIGNAL PROCESSORS SGUS007C - AUGUST 1988 - REVISED AUGUST 1992 Table 2. SMJ320C25 Instruction Set Summary ACCUMULATOR MEMORY REFERENCE INSTRUCTIONS NO. INSTRUCTION BIT CODE MNEMONIC DESCRIPTION WORDS 15 14 13 12 11 10 9 B 7 6 5 4 3 2 1 0 ABS Absolute value of accumulator 1 1 1 0 0 1 1 1 0 0 0 0 1 1 0 1 1 ADD Add to accumulator with shift 1 0 0 0 0 +---S--11> M . D ... ADDC Add to accumulator with carry 1 0 1 0 0 0 0 1 1 M .. D ... ADDH Add to high accumulator 1 0 1 0 0 1 0 0 0 M . D ... ADDK Add to accumulator short immediate 1 1 1 0 0 1 1 0 0 .. K r ADDS Add to low accumulator with sign extension suppressed 1 0 1 0 0 1 0 0 1 M . D ... ADDT Add to accumulator with shift specified by T register 1 0 1 0 0 1 0 1 0 M . D ... ADLKt Add to accumulator long immediate with shift 2 1 1 0 1 +---S--11> O 0 0 0 0 0 1 0 AND AND with accumulator 1 0 1 0 0 1 1 1 0 M .. D ... ANDKt AND immediate with accumulator with shift 2 1 1 0 1 +---S--11> 0 0 0 0 0 1 0 0 CMPLt Complement accumulator 1 1 1 0 0 1 1 1 0 0 0 1 0 0 1 1 1 LAC Load accumulator with shift 1 0 0 1 0 +---S--11> M . D ... LACK Load accumulator immediate short 1 1 1 0 0 1 0 1 0 . K ... LAcrt Load accumulator with shift specified by T register 1 0 1 0 0 0 0 1 0 M . D ... LALKt Load accumulator long immediate with shift 2 1 1 0 1 +---S--IJ> D 0 0 0 0 0 0 1 NEGt Negate accumulator 1 1 1 0 0 1 1 1 0 0 0 1 0 0 0 1 1 NORMt Normalize contents of accumulator 1 1 1 0 0 1 1 1 0 1 .. D ... OR OR with accumulator 1 0 1 0 0 1 1 0 1 M . D ... OR Kt OR immediate with accumulator with shift 2 1 1 0 1 +---S--11> 0 0 0 0 0 1 0 1 ROL Rotate accumulator left 1 1 1 0 0 1 1 1 0 0 0 1 1 0 1 0 0 ROR Rotate accumulator right 1 1 1 0 0 1 1 1 0 0 0 1 1 0 1 0 1 SACH Store high accumulator with shift 1 0 1 1 0 1 ~X-ll>M .. D ... SACL Store low accumulator with shift 1 0 1 1 0 0 ~X-ll>M .. D ... Subtract from accumulator long immediate SBLKt 2 1 1 0 1 +---S--11> 0 0 0 0 0 0 1 1 with shift SFLt Shift accumulator left 1 1 1 0 0 1 1 1 0 0 0 0 1 1 0 0 0 SFRt Shift accumulator right 1 1 1 0 0 1 1 1 0 0 0 0 1 1 0 0 1 SUB Subtract from accumulator with shift 1 0 0 0 1 +---S--11> M . D ... SUBB Subtract from accumulator with borrow 1 0 1 0 0 1 1 1 1 M . D ... SUBC Conditional subtract 1 0 1 0 0 0 1 1 1 M .. D ... SUBH Subtract from high accumulator 1 0 1 0 0 0 1 0 0 M .. D ... SUBK Subtract from accumulator short immediate 1 1 1 0 0 1 1 0 1 .. K .... r SUBS Subtract from low accumulator with sign extension suppressed 1 0 1 0 0 0 1 0 1 M .. D ... t These instructions are not included in the SMJ320C1 x instruction set. TEXAS~ INSTRUMENTS POST OFFICE BOX 1443 ° HOUSTON. TEXAS 77001 D-13 SMJ320C25, SMJ320C25·50 DIGITAL SIGNAL PROCESSORS SGUS007C -AUGUST 1988 - REVISED AUGUST 1992 Table 2. SMJ320C25 Instruction Set Summary (continued) ACCUMULATOR MEMORY REFERENCE INSTRUCTIONS NO. INSTRUCTION BIT CODE MNEMONIC DESCRIPTION WORDS 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 SUBTt Subtract from accumulator with shift specified by T register 1 0 1 0 0 0 1 1 0 M 4 D . XOR Exclusive-OR with accumulator 1 0 1 0 0 1 1 0 0 M 4 D .. Exclusive-OR immediate with accumulator with XOR Kt 2 1 1 0 1 0 0 0 0 0 1 1 0 shift .-.-- s - · ZAG Zero accumulator 1 1 1 0 0 1 0 1 0 0 0 0 0 0 0 0 0 ZALH Zero low accumulator and load high accumulator 1 0 1 0 0 0 0 0 0 M 4 D .. ZALR Zero low accumulator and load high accumulator with rounding 1 0 1 1 1 1 0 1 1 M 4 D .. ZALS Zero accumulator and load low accumulator with sign extension suppressed 1 0 1 0 0 0 0 0 1 M 4 D . AUXILIARY REGISTERS AND DATA PAGE POINTER INSTRUCTIONS NO. INSTRUCTION BIT CODE MNEMONIC DESCRIPTION WORDS 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 ADRK Add to auxiliary register short immediate 1 0 1 1 1 1 1 1 0 4 K . Compare auxiliary register with auxiliary CMPRt 1 1 1 0 0 1 1 1 0 0 1 0 1 0 o+cM+ register ARO LAR Load auxiliary register 1 0 0 1 1 O+---R_.M 4 D .. LARK Load auxiliary register short immediate 1 1 1 0 0 0 +--- R __. K 1 . _ R _.,. . LARP Load auxiliary register pointer 1 0 1 0 1 0 1 0 1 1 0 0 0 LDP Load data memory page pointer 1 0 1 0 1 0 0 1 0 M 4 D . LDPK LRLKt Load data memory page pointer immediate 1 1 1 0 0 1 0 0 • 0 +--- R _.,. 0 DP .. Load auxiliary register long immediate 2 1 1 0 1 0 0 0 0 0 0 0 MAR Modify auxiliary register 1 0 1 0 1 0 1 0 1 M 4 D .. SAR Store auxiliary register 1 0 1 1 1 0 +--- R _.,. M 4 D .. SBRK Subtract from auxiliary register short immediate 1 0 1 1 1 1 1 1 1 4 K .. t These instructions are not included in the SMJ320C1 x instruction set. TEXAS 'f INSTRUMENTS D-14 POST OFFICE BOX 1443 • HOUSTON, TEXAS 77001 SMJ320C25, SMJ320C25-50 DIGITAL SIGNAL PROCESSORS SGUS007C - AUGUST 1988 - REVISED AUGUST 1992 Table 2. SMJ320C25 Instruction Set Summary (continued) T REGISTER, P REGISTER, AND MULTIPLY INSTRUCTIONS NO. INSTRUCTION BIT CODE MNEMONIC DESCRIPTION WORDS 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 APAC Add P register to accumulator 1 1 1 0 0 1 1 1 0 0 0 0 1 0 1 0 1 LP Ht Load high P register 1 0 1 0 1 0 0 1 1 M . D .. LT Load T regis1er 1 0 0 1 1 1 1 0 0 M . D .. LTA Load T register and accumulate previous product 1 0 0 1 1 1 1 0 1 M . D .. LTD Load T register, accumulate previous product, and move data 1 0 0 1 1 1 1 1 1 M .. D .. LTPt Load T register and store P register in accumulator 1 0 0 1 1 1 1 1 0 M .. D .. LTSt Load T register and subtract previous product 1 0 1 0 1 1 0 1 1 M . D . MACt Multiply and accumulate 2 0 1 0 1 1 1 0 1 M .. D .. MACDt Multiply and accumulate with data move 2 0 1 0 1 1 1 0 0 M . D .. MPY Multiply (with T register, store product in P register) 1 0 0 1 1 1 0 0 0 M . D .. MPYA Multiply and accumulate previous product 1 0 0 1 1 1 0 1 0 M .. D . MPYK Multiply immediate 1 1 0 1 , K .. _.. MPYS Multiply and subtract previous product 1 0 0 1 1 1 0 1 1 M . . MPYU Multiply unsigned 1 1 1 0 0 1 1 1 1 M .. D D .. PAC Load accumulator with P register 1 1 1 0 0 1 1 1 0 0 0 0 1 0 1 0 0 SPAC Subtract P register from accumulator 1 1 1 0 0 1 1 1 0 0 0 0 1 0 1 1 0 SPH Store high P register 1 0 1 1 1 1 1 0 1 M .. D . SPL Store low P register 1 0 1 1 1 1 1 0 0 M .. D . SP Mt Set P register output shift mode 1 1 1 0 0 1 1 1 0 0 0 0 0 1 o.-P~ SORAt SQRSt Square and accumulate Square and subtract previous product 1 1 0 0 0 1 1 0 1 1 1 1 0 0 0 1 1 0 M M . . D ... D t These instructions are not included in the SMJ320C1x instruction set. TEXAS~ INSJRUMENTS POST OFFICE BOX 1443 • HOUSTON, TEXAS 77001 0-15 SMJ320C25, SMJ320C25-50 DIGITAL SIGNAL PROCESSORS SGUS007C - AUGUST 1988 - REVISED AUGUST 1992 Table 2. SMJ320C25 Instruction Set Summary (continued) BRANCH/CALL INSTRUCTIONS INSTRUCTION BIT CODE NO. MNEMONIC DESCRIPTION WORDS 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 B Branch unconditionally 2 1 1 1 1 1 1 1 1 1 . D .. BAcct Branch to address specified by accumulator 1 1 1 0 0 1 1 1 0 0 0 1 0 0 1 0 1 BANZ Branch on auxiliary register not zero 2 1 1 1 1 1 0 1 1 1 . D . BBNzt Branch if TC bit,. O 2 1 1 1 1 1 1 1 . D . .. 0 0 Bszt Branch if TC bit = O 2 1 1 1 1 1 0 0 0 1 D . BC Branch on carry 2 0 1 0 1 1 1 1 0 1 . D . BGEZ Branch if accumulator ., O 2 1 1 1 1 0 1 0 0 1 .. D . BGZ Branch if accumulator > 0 2 1 1 1 1 0 0 0 1 1 .. D .. BIOZ Branch on 1/0 status = O 2 1 1 1 1 1 0 1 0 1 . D . BLEZ Branch if accumulator s O 2 1 1 1 1 0 0 1 0 1 ..---o .. BLZ Branch if accumulator < O 2 1 1 1 1 0 0 1 1 1 . D .. BNC Branch on no carry 2 0 1 0 1 1 1 1 1 1 .. D .. BNVt Branch if no overflow 2 1 1 1 1 0 1 1 1 1 .----o . BNZ Branch if accumulator .. O 2 1 1 1 1 0 1 0 1 1 . D . BV Branch on overflow ... . .. 2 1 1 1 1 0 0 0 0 1 D BZ Branch if accumulator = O 2 1 1 1 1 0 1 1 0 1 D GALA Call subroutine indirect 1 1 1 0 1 1 1 0 0 0 1 0 .. 0 0 1 0 0 CALL Call subroutine 2 1 1 1 1 1 1 1 0 1 . D RET Return from subroutine 1 1 1 0 0 1 1 1 0 0 0 1 0 0 1 1 0 1/0 AND DATA MEMORY OPERATIONS NO. INSTRUCTION BIT CODE MNEMONIC DESCRIPTION WORDS 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 BLKOt Block move from data memory to data memory 2 1 1 1 1 1 1 0 1 M .. D . BLKPt Block move from program memory to data memory 2 1 1 1 1 1 1 0 0 M . D .. DMOV Data move in data memory 1 0 1 0 1 0 1 1 0 M . D . FORTt Format serial port registers 1 1 1 0 0 1 1 1 0 0 0 0 0 1 1 1 FO IN Input data from port 1 1 0 0 0 M . D .. 01nt Test bit specified by T register 1 0 1 0 1 0 1 1 1 M .. D .. CNFDt Configure block as data memory 1 1 1 0 0 1 1 1 0 0 0 0 0 0 1 0 0 CNFPt Configure block as program memory 1 1 1 0 0 1 1 1 0 0 0 0 0 0 1 ·o 1 DINT Disable interrupt 1 1 1 0 0 1 1 1 0 0 0 0 0 0 0 0 1 EINT Enable interrupt 1 1 1 0 0 1 1 1 0 0 0 0 0 0 0 0 0 IDLEt Idle until interrupt 1 1 1 0 0 1 1 1 0 0 0 0 1 1 1 1 1 LST Load status register STO 1 0 1 0 1 0 0 0 0 M .. D . LST1t Load status register ST1 1 0 1 0 1 0 0 0 1 M . D . NOP No operation 1 0 1 0 1 0 1 0 1 0 0 0 0 0 0 0 0 POP Pop top of stack to low accumulator 1 1 1 0 0 1 1 1 0 0 0 0 1 1 1 0 1 POPDt Pop top of stack to data memory 1 0 1 1 1 1 0 1 0 M . D . PSHDt Push data memory value onto stack 1 0 1 0 1 0 1 0 0 M .. D .. PUSH Push low accumulator onto stack 1 1 1 0 0 1 1 1 0 0 0 0 1 1 1 0 0 RC Reset carry bit 1 1 1 0 0 1 1 1 0 0 0 1 1 0 0 0 0 RHM Reset hold mode 1 1 1 0 0 1 1 1 0 0 0 1 1 1 0 0 0 ROVM Reset overflow mode 1 1 1 0 0 1 1 1 0 0 0 0 0 0 0 1 0 RPTt Repeat instruciion as specified by data memory value 1 0 1 0 0 1 0 1 1 M . D .. RPTKt Repeat instruciion as specified by immediate value 1 1 1 0 0 1 0 1 1 . K .. RSXMt Reset sign-extension mode 1 1 1 0 0 1 1 1 0 0 0 0 0 0 1 1 0 ATC Reset test/control flag 1 1 1 0 0 1 1 1 0 0 0 1 1 0 0 1 0 SC Set carry bit 1 1 1 0 0 1 1 1 0 0 0 1 1 0 0 0 1 SHM Set hold mode 1 1 1 0 0 1 1 1 0 0 0 1 1 1 0 0 1 SOVM Set overflow mode 1 1 1 0 0 1 1 1 0 0 0 0 0 0 0 1 1 SST Store status register STO 1 0 1 1 1 1 0 0 0 M . D .. SST1t ssxMt Store status register ST1 Set sign-extension mode 1 0 1 1 1 1 0 0 1 M .. D .. 1 1 1 0 0 1 1 1 0 0 0 0 0 0 1 1 1 STC Set test/control flag 1 1 1 0 0 1 1 1 0 0 0 1 1 0 0 1 1 TRAPt Software interrupt 1 1 1 0 0 1 1 1 0 0 0 0 1 1 1 1 0 t These instructions are not includecj in the SMJ320C1 x instruction set. TEXAS~ INSJRUMENTS POST OFFICE BOX 1443 • HOUSTON, TEXAS 77001 D-17 SMJ320C25, SMJ320C25-50 DIGITAL SIGNAL PROCESSORS SGUS007C-AUGUST 1988 - REVISED AUGUST 1992 development systems and software support Texas Instruments offers concentrated development support and complete documentation for designing an SMJ320C25-based microprocessor system. When developing an application, tools are provided to evaluate the performance of the processor, to develop the algorithm implementation, and to fully integrate the design's software and hardware modules. When questions arise, additional support can be obtained by calling the nearest Texas Instruments Regional Technology Center (RTC). Sophisticated development operations are performed with the SMJ320C25 Macro Assembler/Linker, Simulator, and Emulator (XDS). The macro assembler and linker are used to translate program modules into object code and link them together. This puts the program modules into a form which can be loaded into the SMJ320C25 Simulator or Emulator. The simulator provides a quick means for initially debugging SMJ320C25 software while the emulator provides the real-time in-circuit emulation necessary to perform system level debug efficiently. Table 3 gives a complete list of SMJ320C25 software and hardware development tools. Table 3. SMJ/SMJ320C25 Software and Hardware Support MACRO ASSEMBLERS/LINKERS Host Computer Operating System Part Number DECVAX VMS TMDS32421 0-08 Tl/IBM PC MS/PC-DOS TMDS3242810-02 SIMULATORS Host Computer Operating System Part Number DECVAX VMS TMDS3242211-08 Tl/IBM PC MS/PC-DOS TMDS3242811-02 EMULATORS Model Power Supply Part Number XDS/22 Included TMDS3262221 TEXAS INS1RUMEN1S 'f D-18 POST OFFICE BOX 1443 • HOUSTON. TEXAS 77001 SMJ320C25, SMJ320C25-50 DIGITAL SIGNAL PROCESSORS SGUSOO?C - AUGUST 1988 - REVISED AUGUST 1992 absolute maximum ratings over specified temperature range (unless otherwise noted) t Supply voltage range, Vcc:J: ......................................................... - 0.3 V to 7 V Input voltage range ................................................................ - 0.3 V to 7 V Output voltage range . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . - 0.3 V to 7 V Continuous power dissipation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.0 W Storage temperature range . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . - 65°C to 150°C t Stresses beyond those listed under "Absolute Maximum Ratings" may cause permanent damage to the device. This is a stress rating only; functional operation of the device at these or any other conditions beyond those indicated in the "Recommended Operating Conditions" section of this specification is not implied. Exposure to absolute-maximum-rated conditions for extended periods may affect device reliability. t All voltage values are with respect to Vss· recommended operating conditions SMJ320C25-50 SMJ320C25 UNIT MIN NOM MAX MIN NOM MAX Vee Supply voltage 4.75 5 5.25 4.5 5 5.5 v Vss Supply voltage 0 0 v READY 3.00 2.35 015-DO, FSX 2.20 2.20 V1H High-level input voltage CLKR,CLKX 3.50 3.50 v CLKIN 4.00 3.50 All others 3.00 3.00 D15-DO, FSX, CLKIN, CLKR, CLKX 0.80 0.80 V1L Low-level input voltage HOLD 0.70 0.70 v All others 0.80 0.70 IOH High-level output current 300 300 µA IOL Low-level output current 2 2 mA TA Operating free-air temperature -55 -55 'C Tc Operating case temperature 125 125 'C electrical characteristics over specified free-air temperature range (unless otherwise noted) SMJ320C25-50 SMJ320C25 PARAMETER TEST CONDITIONS UNIT MIN TYP§ MAX VoH High-level output voltage Vee= MIN, loH = MAX 2.4 3 v Vol Low-level output voltage Vee= MIN, IOL = MAX 0.3 0.6 v lz Three-state current Vee= MAX -20 20 f'A 11 Input current V1 = Vss to Vee -10 10 ftA ice Supply current TNormal Vee =MAX, Ix= MAX 185 mA _[ Idle/HOLD 100 C; Input capacitance 15 pF Co Output capacitance 15 pF §All typical values are at Vee= 5V, TA= 25°C. This device contains circuits to protect its inputs and outputs against damage due to high static voltages or electrostatic fields. These circuits have been qualified to protect this device against electrostatic discharges (ESD) of up to 2 kV according to MIL-STD-883C, Method 3015; however, it is advised that precautions betaken to avoid application of any voltage higherthan maximum-rated voltages to these high-impedance circuits. During storage or handling, the device leads should be shorted together or the device should be placed in conductive foam. In a circuit, unused inputs should always be connected to an appropriated logic voltage level, preferably either Vee or ground. Specific guidelines for handling devices of this type are contained in the publication Guidelines for Handling Electrostatic-Discharge-Sensitive (ESDS) Devices and Assemblies available from Texas Instruments. TEXAS~ INSTRUMENTS POST OFFICE BOX 1443 • HOUSTON, TEXAS 77001 D-19 SMJ320C25, SMJ320C25-50 DIGITAL SIGNAL PROCESSORS SGUS007C- AUGUST 1988 - REVISED AUGUST 1992 CLOCK CHARACTERISTICS AND TIMING The SMJ320C25 can use either its internal oscillator or an external frequency source for a clock. Internal clock option The internal oscillator is enabled by connecting a crystal across X1 and X2/CLKIN (see Figure 3). The frequency of CLKOUT1 is one-fourth the crystal fundamental frequency. The crystal should be either fundamental or overtone mode and parallel resonant, with an effective series resistance of 30 ohms, a power dissipation of 1 mW, and be specified at a load capacitance of 20 pF. Note that overtone crystals require an additional tuned LC circuit (see the application report, Hardware Interfacing to the TMS320C25). SMJ320C25-50 SMJ320C25 PARAMETER TEST CONDITIONS UNIT MIN TYP MAX MIN TYP MAX fx Input clock frequency TA= ss·c MIN 6.?t so.at 6.?t 4o.ot MHz C1, C2 Tc= 125°C MAX 10 10 pF t This parameter is not production tested. X1 X2/CLKIN CRYSTAL Figure 3. Internal Clock Option +5V SMJ320C25 fcrystal ~---101---~ 10kQ '74HC04 F11 4.7 kQ CLKIN 1----0C: C = 20 pF 0.1 µF 47pF '74AS04 I -:- 10kQ I }L -:- fcrystal (MHz) L (µH) -:- SMJ320C25-50 50.00 1.1 SMJ320C25 40.00 1.8 Figure 4. External Clock Option Shown above is a crystal oscillator circuit suitable for providing the input clock signal to the SMJ320C25. Please refer to Hardware Interfacing to the TMS320C25 (document number SPRA014A) for details on circuit operation. TEXAS.,, INSJRUMENTS D-20 POST OFFICE BOX 1443 • HOUSTON, TEXAS noo1 SMJ320C25, SMJ320C25-50 DIGITAL SIGNAL PROCESSORS SGUS007C- AUGUST 1988 - REVISED AUGUST 1992 external clock option An external frequency source can be used by injecting the frequency directly into X2/CLKIN with X1 left unconnected. The external frequency injected must conform to the specifications listed in the following table. switching characteristics over recommended operating conditions (see Note 1) SMJ320C25-50 SMJ320C25 PARAMETER UNIT MIN NOM MAX MIN NOM MAX l :: oomom : I )®- ~~ ~ Figure 10. One Wait-State Memory Access Timing TEXAS INSTRUMENTS 'f POST OFFICE BOX 1443 • HOUSTON, TEXAS 77001 0-29 SMJ320C25, SMJ320C25·50 DIGITAL SIGNAL PROCESSORS SGUS007C-AUGUST 1988-REVISED AUGUST 1992 I I I I CLKOUT1 ~ ~: £"!~/\!~ I I I I I I1 I I I I ~ I+- tsu(IN) ~ i+-td(RS) I ~t (IN) I I I I I I ' I I su, I I I I I I 14 I "1 th(IN) I I RS ~I I I I I I ,-----'-;----,...I---+-!- - - + I _ I~ I I I I I I I 111 I ~ A15·AO~" I : :~~//\ ~ I I I 1' 1 I I I I 14 ~I Fetch ........_ _ _......__ _ __._ I ~ ~ LocationO 015-DO 1-t'- - . . . - - - - . . . . __ _ _.,.._ _ I : I I I I I I,, I Valid 14""- Begin -"! .. I Program I PS 1" : \ j Execution I I I '---1 I I STRB . . .'/1 I I I I I I I :vi I I I I i I Control . . .'' I Slgna1st I 1 I I I I I I I I ~ :1 I I I~~ IACK~ ~ii~~~ ~ ~ I I I I I I I I SerlalPort~I I I I I Control:!:_ I I t Control signals are DS, TS, RI W, and XF. *Serial port controls are DX and FSX. Figure 11. Reset Timing TEXAS.,, INSTRUMENTS 0-30 POST OFFICE BOX 1443 • HOUSTON, TEXAS 77001 SMJ320C25, SMJ320C25-50 DIGITAL SIGNAL PROCESSORS SGUS007C- AUGUST 1988- REVISED AUGUST 1992 CLKOUT1 I I I : ---.: i.- th(IN) .,.l,.1----lw(IN), ---~ .. I INT2-INTO --:... :~ !I ' \ I 11}, /I -------1....-----1""1 A15-AO =>< -+I 14- tf(IN) Fetch N x: I ---.i Fet~h N + 1 i.-- td(IACK) x,..-F-et-ch_N_+_2___ X Fetch I x:= td(IACK) -.: ~ I fACK Figure 12. Interrupt Timing CLKOUT1 Fetch Branch Address Fetch Next Instruction Fetch A15-AO BIOZ PC,= N PC= N + 1 PC= N + 2 PC= N + 3 or Branch Address I tsu(IN) ---.: ~ I I~ ~ th(IN) ~Valid Figure 13. BIO Timing TEXAS~ INSTRUMENTS POST OFFICE BOX 1443 • HOUSTON, TEXAS 77001 D-31 SMJ320C25, SMJ320C25·50 DIGITAL SIGNAL PROCESSORS SGUS007C - AUGUST 1988 - REVISED AUGUST 1992 CLKOUT1 Fetch A15·AO Valid Valid Valid SXF/RXF PC= N PC= N + 1 PC= N + 2 PC= N + 3 X F " " "_ _v_a_lid_ __ Figure 14. External Flag Timing TEXAS~ INS1RUMENTS D-32 POST OFFICE SOX 1443 • HOUSTON, TEXAS 77001 SMJ320C25, SMJ320C25-50 DIGITAL SIGNAL PROCESSORS SGUS007C -AUGUST 1988 - REVISED AUGUST 1992 CLKOUT1 CLKOUT2 ___---.i_ ~ 1d(C2H·H) t HOLD I A15-AO N N+1 N+2 PS,D~~ or IS Va!ld )0( Valid w ~ R/W ~ ~ I I ~ 1dis(C1 L-A) D15-DO 0 0 I I I I I ~ ~ 1dis(AL-A) I HOLDA I I I -.I .___ 1d(C1 L-AL) FETCH 4 N N-2 •4 N+1 N -1 .. 4 N ... ... EXECUTE t HOLD is an asynchronous input and can occur at anytime during a clock cycle. If the specified timing is met, the exact sequence shown will occur; otherwise, a delay of one CLKOUT2 cycle will occur. Figure 15. HOLD Timing (Part A) TEXAS~ INSTRUMENTS POST OFFICE BOX 1443 • HOUSTON, TEXAS 77001 D-33 SMJ320C25, SMJ320C25·50 DIGITAL SIGNAL PROCESSORS SGUS007C -AUGUST 1988 - REVISED AUGUST 1992 CLKOUTI CLKOUT2 ~ I+- len(A-C1 L) STRB I tI ~ I I -.i I+- lcl(C2H·H) t I HOLD I I I PS,DS, oriS I I W' ~ Valid ) I I I Rfii I I I W' I D15-DO I I 0- ---.I~ ld(HH-AH) HOLDA y A15-AO ~ N+2 )0( N+2 ) FETCH .. .... .... . .. N+2 .. EXECUTE .. .... .... . .. N+1 . t HOLD is an asynchronous input and can occur at any time during a clock cycle. If the specified timing is met, the exact sequence shown will occur; otherwise, a delay of one CLKOUT2 cycle will occur. Figure 16. HOLD Timing (Part B) T~~ INSTRUMENTS D-34 POST OFFICE BOX 1443 • HOUSTON, TEXAS 77001 SMJ320C25, SMJ320C25-50 DIGITAL SIGNAL PROCESSORS SGUS007C - AUGUST 1988 - REVISED AUGUST 1992 14---- lc(SCK) -.I I ~ lw(SCK) I ---.i ~ lr,(SCK) I I 1 CLKR I I I ~ lh(FS) 1 lf(SCK,+i :.- I FSR __;:~,___..,.\~-----~---1~r---l_h(~D\R,_) ~ I I I I I - I I 1 I ' I _________lw_(_S_C_K)------------- ~ ~ lsu(FS) 1 ~ lsu(DR) DR Figure 17. Serial Port Receive Timing 14---- lc(SCK) --+I I I lw(SCK)~ I I 1 ~ lr(SCK) CLKX I 1 1 1 1 1 I 1 i.- lf(SCK) FSX (INPUT, TXM = 0) J1 \ 1 lh(FS),-.1 I 1 1 i.- 1 1 _.! I ~ .lw(SCK) I 1 ~ ld(CH-DX) _______.,,,,___________________ -...1--~1--------1 ~ -41 DX - ' - :------ii.- -1>! i.- lsu(FS) 1 .. ~ ld(CH-FS) 1 :1,,_---c~~(- ~:~:~ 1 >C;---- ~ td(CH-DX) N = 8, 16 I ~ ld(CH-FS) ~s:i J-------~: (OUTPUT, TXM ------------ Figure 18. Serial Port Transmit Timing TEXAS -'J1 INSlRUMENTS POST OFFICE BOX 1443 • HOUSTON, TEXAS 77001 D-35 SMJ320C25, SMJ320C25-50 DIGITAL SIGNAL PROCESSORS SGUS007C - AUGUST 1988 - REVISED AUGUST 1992 MECHANICAL DATA 68-pln GB grid array ceramic package c 28,448 (1.120) THERMAL RESISTANCE CHARACTERISTICS PARAMETER MAX UNIT 27,422 (1.080) I Junction-to-Free-Air RsJA Thermal Resistance Junction-to-Case 36 6 ·crw ·crw I 28,448 (1 .120) 27 ,422 (1.080) ReJC Thermal Resistance (Top View) 4,572 (0.180) 2,794 (0.110) ]+----;:==...c======:i_-... 1,397 (0.055) 1 l___j_I 1, 143 (0.045) I I I :::::::: j+--0-,50-.~.:.~ ~ ~ ~ ~ ~Jl-t-~f-:-:~-:;-:~:.: : 0" 0,406 (0.016) J[ ..----------;--;-, 2,54 (0.100) T.P. L © © © © © © © © ffi I 2,54 (0.100) K @I@@ @ @ @ @ @ @I@$ T.P. J ©@ @~ ' H @@ @@ G @@ @@ F @@ (Bottom View) E @@ D @@ @@ c @@ @@ 1,778 (0.070) NOM 68 Places s @0© ©@ @@@ @ee+----- A @@@@@@@@ ~ (fl-i=.l- 1 2 3 4 5 6 1 8 9 1011 L 1 •21 (0 .050> NOM ALL LINEAR DIMENSIONS ARE IN MILLIMETERS AND PARENTHETICALLY IN INCHES TEXAS~ INSJRUMENTS D-36 POST OFFICE BOX 1443 • HOUSTON, TEXAS 77001 SMJ320C25, SMJ320C25·50 DIGITAL SIGNAL PROCESSORS SGUS007C - AUGUST 1988 - REVISED AUGUST 1992 MECHANICAL DATA FJ ceramic leaded chip carrier package ~1 Indicator THERMAL RESISTANCE CHARACTERISTICS PARAMETER MAX UNIT Junction-to-Free-Air ReJA Thermal Resistance 50 ·crw Junction-to-Case ReJC Thermal Resistance 7 ·crw j 1- 1,98 (0.078) 1,07 (0.042) .l__j ~~ r- 1,27 (0.050) NOM 2,41 (0.095) 1,91 (0.075) 1 ~ t 0,28 (0.011) 0,18 (0.007) LID 0,38 (0.015) 0, 13(0.005) 24, 13 (0.950) 23,11 (0.910) o,e9 (0.035) /'I 0,64 (0.025) -.! ALL DIMENSIONS ARE IN MILLIMETERS AND PARENTHETICALLY IN INCHES. TEXAS.,, INSTRUMENTS POST OFFICE BOX 1443 ° HOUSTON, TEXAS 77001 D-37 SMJ320C25, SMJ320C25·50 DIGITAL SIGNAL PROCESSORS SGUS007A-AUGUST 1988- REVISED MAY 1992 MECHANICAL DATA FD ceramic leadless chip carrier package 24,38 (0.960) r------- 23,88 (0.940) - - - . - - - . - v THERMAL RESISTANCE CHARACTERISTICS PARAMETER MAX UNIT 24,38 (0.960) (Top View) Junction-to-Free-Air 23,88 (0.940) RAJA 39.9 'C/W Thermal Resistance Junction-to-Case RoJC 6.6 'C/W Thermal Resistance Index Corner~ ---- 20,57 (0.810) 20,07 (0.790) ---· 3,05 (0.120) 2,08 (0.082) u 0, 71 (0.028) 0,56 (0.022) 0,20 (0.008) R 1' 27 (0.05 0) x 45' Cham 3 Places TYP 0,77 (0.030) ALL DIMENSIONS ARE IN MILLIMETERS AND PARENTHETICALLY IN INCHES. TEXAS~ INS1RUMEN1S D-38 POST OFFICE BOX 1443 ° HOUSTON, TEXAS 77001 SMJ320C26 DIGITAL SIGNAL PROCESSOR SGUS016-APRIL 1990--REVISED NOVEMBER 1992 • 100-ns Instruction Cycle Time 68·PIN GB PIN GRID ARRAY CERAMIC PACKAGEt • 1568 Words of Configurable On-Chip (TOPVIEW) Data/Program RAM 1 2 3 4 5 8 7 8 9 10 11 • 256 Words of On-Chip Program ROM A • • • • • • • • • B @ e e e e e e e e @ e • 128K Words of Data/Program Space c • • • • • Pin-for-Pin Compatible with the SMJ320C25 D • • • • • 16 Input and 16 Output Channels E e e • • F e e • • • 16-Blt Parallel Interface G e e • • • Directly Accessible External Data Memory H e e • • J • • • • Space K e @ e e e e e e e @ e • Global Data Memory Interface L • • • • • • • • • • 16-Bit Instruction and Data Words tsee Pin Assignments Table (Page 2) and Pin Nomenclature Table (Page 3) for location and description of all pins. • 32-Bit ALU and Accumulator • Single-Cycle Multiply/Accumulate Instructions • 0 to 16-Bit Scaling Shifter • Bit Manipulation and Logical Instructions • Input Pin Polled by Software Branch • Instruction Set Support for Floating-Point Instruction Operations, Adaptive Filtering, and Extended-Precision Arithmetic • Programmable Output Pin for Signalling External Devices • Block Moves for Data/Program Management • 1.6-µm CMOS Technology • Repeat Instructions for Efficient Use of • Single 5-V Supply Program Space • Packaging: • Eight Auxiliary Registers and Dedicated - 68-Pin Leaded Ceramic Chip Carrier Arithmetic Unit for Indirect Addressing (FJ Suffix) • Serial Port for Direct Codec Interface - 68-Pin Leadless Ceramic Chip Carrier (FD Suffix) • Synchronization Input for Multiprocessor - 68-Pin Grid Array Ceramic Package Configurations (GB Suffix) • Wait States for Communications to Slow • Military Operating Temperature Off-Chip Memories/Peripherals Range ... - 55° to 125°C • On-Chip Timer for Control Operations • Three External Maskable User Interrupts PRODUCTION DATA-11cumnt11 of publication dllo. Copyright© 1992, Texas Instruments Incorporated Prvducta conform lo ......,...UDlll per tho tonno of TIXll lnotrumonll otandonl wornnty. Prvductlon proc-lng dDll nol ..._dlylnolado-1 olol poromllon. 1ExAs ..,, INSTRUMENTS POST OFFICE BOX 1443 • HOUSTON, TEXAS 77001 D-39 SMJ320C26 DIGITAL SIGNAL PROCESSOR SGUS016-APRIL 1990-REVISED NOVEMBER 1992 description The SMJ320C26 Digital Signal Processor is a member of the TMS320 family of VLSI digital signal processors and peripherals. The TMS320 family supports a wide range of digital signal processing applications, such as telecommunications, modems, image processing, speech processing, spectrum analysis, audio processing, digital filtering, high-speed control, graphics, and other computation intensive applications. With a 100-ns instruction cycle time and an innovative memory configuration, the SMJ320C26 performs operations necessary for many real time digital signal processing algorithms. Since most instructions require only one cycle, the SMJ320C26 is capable of executing ten million instructions per second. On-chip programmable data/program RAM of 1568 words of 16 bits, on-chip program ROM of 256-words, direct addressing of up to 64K-words of external 68-PIN FJ AND FD program and 64K-words of data memory space, LEADED AND LEADLESS and multiprocessor interface features for sharing CERAMIC CHIP CARRIER PACKAGESt global memory minimize unnecessary data (TOPVIEW) transfers to take full advantage of the capabilities of the processor. 98765432158~58MM~~~ The SMJ320C26 scaling shifter has a 16-bit input Vss 10 60 IACK connected to the data bus and a 32-bit output D7 11 Q 59 MSC D6 12 58 CLKOUT1 connected to the ALU. The scaling shifter D5 13 57 CLKOUT2 produces a left shift of 0to16 bits on the input data, D4 14 56 XF D3 15 55 HOLDA as programmed in the instruction. The LSBs of the D2 16 54 DX output are filled with zeroes, and the MSBs may be D1 17 53 FSX DO 18 52 X2/CLKIN either filled with zeroes or sign-extended, SYNC 19 51 X1 depending upon the status programmed into the 50 iiR 49 STRB SXM {sign-extension mode} bit of status register 48 Bifi ST1. 47 PS 48 IS 45 08 AO 26 44 Vss ~HH~~n~M~~~u~~~~~ t See Pin Assignments Table (Page 2) and Pin Nomenclature Table (Page 3) for location and description of all pins. PGA/LCCC/JLCC PIN ASSIGNMENTS FUNCTION PIN FUNCTION PIN FUNCTION PIN FUNCTION PIN FUNCTION PIN FUNCTION PIN AO K1/26 A12 KB/40 D2 E1/16 D14 A5/3 INT2 H1/22 Vee H2/23 A1 K2/2B A13 L9/41 D3 D2/15 D15 B6/2 iS J11/46 Vee L6/35 A2 L3/29 A14 K9/42 D4 D1/14 DR J1/24 MP/MC A6/1 Vss B1/10 A3 K3/30 A15 L10/43 D5 C2/13 DS K10/45 MSC C10/59 Vss K11/44 A4 L4/31 BIO B7/6B D6 C1/12 DX E11/54 PS J10/47 Vss L2/27 A5 K4/32 BR G11/50 D7 B2/11 FSR J2/25 READY BB/66 XF D11/56 A6 L5/33 CLKOUT1 C11/5B DB A2/9 FSX F10/53 RS AB/65 X1 G10/51 A7 K5/34 CLKOUT2 D10/57 D9 B3/B HOLD A7/67 R/W H11/4B X2/CLKIN F11/52 AB K6/36 CLKR B9/64 D10 A3/7 HOLDA E10/55 STRB H10/49 AS L7/37 CLKX A9/63 D11 B4/6 IACK B11/60 SYNC F2/19 A10 K7/3B DO F1/1B D12 A4/5 INTO G1/20 Vee A10/61 A11 L8/39 D1 E2/17 D13 B5/4 INT1 G2/21 Vee B10/62 TEXAS..,, INsrRUMENTS D-40 POST OFFICE BOX 1443 • HOUSTON. TEXAS 77001 SMJ320C26 DIGITAL SIGNAL PROCESSOR SGUS016-APRIL 1990-REVISED NOVEMBER 1992 PIN NOMENCLATURE NAME 1/0JZt DEFINITION Vee I 5-V supply pins. Vss I Ground pins. X1 0 Output from internal oscillator for crystal. X2/CLKIN I Input to internal oscillator from crystal or external clock. CLKOUT1 0 Master clock output (crystal or CLKIN frequency/4). CLKOUT2 0 A second clock output signal. D15-DO 1/0/Z 16-bit data bus D15 (MSB) through DO (LSB). Multiplexed between program, data and 1/0 spaces. A15-AO 0/Z 16-bit address bus A15 (MSB) through AO (LSB). PS, DS, TS 0/Z Program, data and 1/0 space select signals. R/W O/Z Read/write signal. STRB 0/Z Strobe signal. RS I Reset input. INT2, INT1, INTO I External user interrupt inputs. MP/MC I Microprocessor/microcomputer mode select pin. MSC 0 Microstate complete signal. !ACK 0 Interrupt acknowledge signal. Data ready input. Asserted by external logic when using slower devices to indicatethatthe current bus transaction READY I is complete. BR 0 Bus request signal. Asserted when the SMJ320C26 requires access to an external global data memory space. XF 0 External flag output (latched software - programmable signal). Hold input. When asserted, SMJ320C26 goes into an idle mode and places the data address and control lines HOLD I in the high-impedance state. HOLDA 0 Hold acknowledge signal. SYNC I Synchronization input. BIO I Branch control input. Polled by BIOZ instruction. DR I Serial data receive input. CLKR I Clock input for serial port receiver. FSR I Frame synchronization pulse for receive input. DX 0/Z Serial data transmit output. CLKX I Clock input for serial port transmitter. FSX 1/0/Z Frame synchronization pulse for transmit. May be configured as either an input or an output. t 1/0/Z denotes inpuVoutpuVhigh-impedance state. TEXAS.,, INSTRUMENTS POST OFFICE BOX 1443 • HOUSTON, TEXAS 77001 D-41 SMJ320C26 DIGITAL SIGNAL PROCESSOR SGUS018-APRIL 199~EVISED NOVEMBER 1992 functional block diagram 16 J QIR:I§[ 16 .---16 1ifil! ~ Rfii ----1-"-'-'--'-'-l---l 16 STAB _ _ ___, !-----' PFC(1 READY----i iii----1 1~~ I 1E DR XF----t y 16 CLKR HOLD---- r~ l re=~ HOLDA----1 MSC _ _ __, l MCSJ!!j}--/ ~ 810---- 16 iii----i 16 IACK - - - - - ;_ __ J ADDRESS RSRjj' ----r-----1~ MP/MC INT~~)---3-r-____j--~ PROGRAM ROM t---1 ~56x 16) t---1 ~ INSTRUCTION t---1 16 t---1 ,___ 16 16 )( D15-DO ._._.,.._..... ~ 16 16 16 cr ......---+---+~~~ 11 3 16 16 LSHIFTE!!l.0-1!!1 ~16 TR(16) 6 16 MULTIPLIER PR(32) 16 16 16 LEGEND: ~~c = ~~:f= :~= ACCH • AccumUlalor high IFR • Interrupt flag register ACCL • Accumulator low IMR Interrupt mesk register ~U : =l=~~~:\tt.metlc unit ~cs " ~~=~'!:~ster RPTC • Repeat Instruction counter GREG Global memoiy allocation register ARS Auxiliary register pointer buffer QIR • Queue Instruction register RSA Serial port receive shift register ARP Auxiliary register pointer PR Product register XSR • Serial port to transmit shift register DP • Date memoiy page pointer PRO = Product register for timer AR<>-AR7 • Auxiliary registers ORR Serial port date receive register TIM limer STO, ST1 • Stetus reglatera DXR • Serial port data trademark register TR Temporaiy register C Cariyblt INsrRUMENTS TEXAS 'f 0-42 POST OFFICE BOX 1443 ° HOUSTON, TEXAS 77001 SMJ320C26 DIGITAL SIGNAL PROCESSOR SGUS016-APRIL 199~EVISED NOVEMBER 1992 architecture The SMJ320C26 architecture is based on the SMJ320C25 with a different internal RAM and ROM configuration. The SMJ320C26 integrates 256 words of on-chip ROM and 1568 words of on-chip RAM compared to 4K words of on-chip ROM and 544 words of on-chip RAM for the SMJ320C25. The SMJ320C26 is pin for pin compatible with the SMJ320C25. Increased throughput on the SMJ320C26 for many DSP applications is accomplished by means of single cycle multiply/accumulate instructions with a data move option, eight auxiliary registers with a dedicated arithmetic unit, and faster 1/0 necessary for data intensive signal processing. The architectural design of the SMJ320C26 emphasizes overall speed, communication, and flexibility in the processor configuration. Control signals and instructions provide floating point support, block memory transfers, communication to slower off-chip devices, and multiprocessing implementations. Three large on-chip RAM blocks, configurable either as separate program and data spaces or as three contiguous data blocks, provide increased flexibility in system design. Programs of up to 256 words can be masked into the internal program ROM. The remainder of the 64K-word program memory space is located externally. Large programs can execute at full speed from this memory space. Programs can also be downloaded from slow external memory to high speed on-chip RAM. A data memory address space of 64K words is included to facilitate implementation of DSP algorithms. The VLSI implementation of the SMJ320C26 incorporates all of these features as well as many others, including a hardware timer, serial port, and block data transfer capabilities. 32-bit ALU accumulator The SMJ320C26 32-bit Arithmetic Logic Unit (ALU) and accumulator perform a wide range of arithmetic and logic instructions, the majority of which execute in a single clock cycle. The ALU executes a variety of branch instructions dependent on the status of the ALU or a single bit in a word. These instructions provide the following capabilities: • Branch to an address specified by the accumulator. • Normalize fixed point numbers contained in the accumulator. • Test a specified bit of a word in data memory. One input to the ALU is always provided from the accumulator, and the other input may be provided from the Product Register (PR) of the multiplier or the input scaling shifter which has fetched data from the RAM on the data bus. Afterthe ALU has performed the arithmetic or logical operations, the result is stored in the accumulator. The 32-bit accumulator is split into two 16-bit segments for storage in data memory. Additional shifters at the output of the accumulator perform shifts while the data is being transferred to the data bus for storage. The contents of the accumulator remain unchanged. scaling shifter The SMJ320C26 scaling shifter has a 16-bit input connected to the data bus and a 32-bit output connected to the ALU. The scaling shifter produces a left shift of Oto 16-bits on the input data, as specified in the instruction word. The LSBs of the output are filled with zeroes, and the MSBs may be either filled with zeroes or sign extended, depending upon the value of the SXM (sign extension mode) bit of status register STO. 16 x 16 bit parallel multiplier The SMJ320C26 has a 16 x 16 bit-hardware multiplier, which is capable of computing a signed or unsigned 32-bit product in a single machine cycle. The multiplier has the following two associated registers: • A 16-bit Temporary Register (TR) that holds one of the operands for the multiplier, and • A 32-bit Product Register (PR) that holds the product. TEXAS INSrR.UMENTS 'f POST OFFICE BOX 1443 • HOUSTON, TEXAS 77001 D-43 SMJ320C26 DIGITAL SIGNAL PROCESSOR SGUS016-APRIL 1990-REVISED NOVEMBER 1992 Incorporated into the SMJ320C26 instruction set are single-cycle multiply/accumulate instructions that allow both operands to be fetched simultaneously. The data for these operations may reside anywhere in internal or external memory, and can be transferred to the multiplier each cycle via the program and data buses. Four product shift modes are available at the Product Register (PR) output that are useful when performing multiply/accumulate operations, fractional arithmetic, or justifying fractional products. timer The SMJ320C26 provides a memory mapped 16-bit timer for control operations. The on-chip timer (TIM) register is a down counter that is continuously clocked by CLKOUT1. A timer interrupt (TINT) is generated every time the timer decrements to zero, provided the timer interrupt is enabled. The timer is reloaded with the value contained in the period (PRO) register within the next cycle after it reaches zero so that interrupts may be programmed to occur at regular intervals of PRO + 1 cycles of CLKOUT1. memory control The SMJ320C26 provides a total of 1568 words of 16 bit on-chip RAM, divided into four separate blocks (BO, B1, B2, and B3). Of the 1568 words, 32 words (block B2) are always data memory, and all other blocks are programmable as either data or program memory. A data memory size of 1568 words allows the SMJ320C26 to handle a data array of 1536 words, while still leaving 32 locations for intermediate storage. When using BO, B1, or 83 as program memory, instructions can be downloaded from external memory into on-chip RAM, and then executed. When using on-chip program RAM, ROM, or high speed external program memory, the SMJ320C26 runs at full speed without wait states. However, the READY line can be used to interface the SMJ320C26 to slower, less expensive external memory. Downloading programs from slow off-chip memory to on-chip program RAM speeds processing and cuts overall system costs. The SMJ320C26 provides three separate address spaces for program memory, data memory, and 1/0. The on-chip memory is mapped into either the data memory or program memory space, depending upon the choice of memory configuration. The instruction configuration (parameter) is used as follows to configure the blocks BO, 81, and 83 as program or as data memory. CONFIGURATION BO B1 B3 0 Data Data Data 1 Program Data Data 2 Program Program Data 3 Program Program Program Regardless of the configuration, the user may still execute from external program memory. The SMJ320C26 provides a ROM of 256 words. The ROM is sufficient to allow the programming of a bootstrap program and interrupt handler, or to implement self test routines. The SMJ320C26 has six registers that are mapped into the data memory space at the locations Q-5; a serial port data receive register, serial port data transmit register, timer register, period register, interrupt mask register, and global memory allocation register. 1ExAs .,, INsrR.UMENTS D-44 POST OFFICE BOX 1443. HOUSTON, TEXAS noo1 SMJ320C26 DIGITAL SIGNAL PROCESSOR SGUS016-APRIL 1990-REVISED NOVEMBER 1992 MEMORY MAPS AFTER A RESET OR CONF 0 1MP/MC=1 PROGRAM DATA 1/0 0 (OOOOh) 0 (OOOOh) INTERRUPTS AND RESERVED (EXTERNAL) 5 !ooo5hl ON-CHIP MM Rs I ____ 1°5 .._ EXTERNAL __, 31 !001Fhl 6 0006h 32 0020h RESERVED PAGEO 95 !005Fhl 96 0060h ON-CHIP BLOCKB2 127 !007Fhl 128 0080h RESERVED > PAGE 1-3 EXTERNAL 511 !01 FFhl 512 0200h ON-CHIP BLOCK BO > PAGE4-7 > 1023 !03FFhl 1024 0400h ON-CHIP BLOCKB1 PAGE8-11 1535 !05FFhl 1536 0600h ON-CHIP BLOCKB3 > PAGE 12-15 65535 (FFFFh) 2047 !07FFhl 2048 0800h 65535 (FFFFh) EXTERNAL > PAGE 16-511 2 MP/MC =0 PROGRAM DATA 1/0 0 (OOOOh) 0 (OOOOh) INTERRUPTS AND RESERVED BOOTLOAD ROM 5 !0005hl ON-CHIP MM Rs I ____ 1°5 .._ EXTERNAL __, 6 0006h 255 (OOFFh) RESERVED PAGEO 256 (0100h) 95 !005Fhl 96 0060h ON-CHIP RESERVED BLOCKB2 4095 (OFFFh) 4096 (1000h) 127 !007Fhl 128 0080h RESERVED > PAGE 1-3 511 !01FFhl 512 0200h ON-CHIP BLOCK BO > PAGE4-7 > 1023 !03FFhl 1024 0400h ON-CHIP EXTERNAL BLOCKB1 PAGE8-11 1535 !05FFhl 1536 0600h ON-CHIP BLOCKB3 > PAGE 12-15 65535 (FFFFh) 2047 !07FFhl 2048 0800h 65535 (FFFFh) EXTERNAL > PAGE 16-511 Figure 1A. Memory Maps TEXAS.,, INSTRUMENTS POST OFFICE BOX 1443 • HOUSTON, TEXAS 77001 D-45 SMJ320C26 DIGITAL SIGNAL PROCESSOR SGUS016-APRIL 1990-REVISED NOVEMBER 1992 MEMORY MAPS AFTER CONF 1 1MP/MC=1 PROGRAM DATA 1/0 0 (OOOOh) I ____ 0 (OOOOh) INTERRUPTS ON-CHIP MM Rs EXTERNAL AND RESERVED 5 (0005h) 1°5 .__ _, (EXTERNAL) 31 (001Fh) 6 (0006h) 32 (0020h) RESERVED PAGEO 95 (005Fh) 96 (0060h) ON-CHIP BLOCKB2 > 127 (007Fh) EXTERNAL 128 (0080h) RESERVED PAGE1-3 > 511 (01 FFh) 512 (0200h) DOES NOT 63999 (F9FFh) EXIST PAGE4·7 64000 (FAOOh) 1 023 (03FFh) 64511 (FBFFh) ON-CHIP BLOCK BO 1024 (0400h) 1535 (05FFh) ON-CHIP BLOCKB1 > PAGE8-11 64512 (FCOOh) 65023 (FDFFh) EXTERNAL 1536 (0600h) ON-CHIP BLOCKB3 > PAGE 12·15 > 65024 (FEOOh) 2047 (07FFh) 2048 (0800h) EXTERNAL EXTERNAL PAGE 16-511 65535 (FFFFh) 65535 (FFFFh) 2 MP/MC =0 PROGRAM DATA 1/0 0 (OOOOh) 0 (OOOOh) 255 (OOFFh) INTERRUPTS AND RESERVED BOOTLOAD ROM 5 (0005h) ON-CHIP MM Rs I ____ 1°5 .__ EXTERNAL _, 6 (0006h) 256 (0100h) RESERVED PAGEO RESERVED 95 (005Fh) 4095 (OFFFh) 96 (0060h) 4096 (1 OOOh) ON-CHIP BLOCKB2 > 127 (007Fh) 128 (0080h) RESERVED PAGE 1-3 EXTERNAL > 511 (01 FFh) 512 (0200h) DOES NOT EXIST PAGE4·7 1 023 (03FFh) 63999 (F9FFh) 64000 (FAOOh) ON-CHIP 1024 (0400h) 1535 (05FFh) ON-CHIP BLOCKB1 > PAGE8·11 64511 (FBFFh) 64512 (FCOOh) BLOCK BO EXTERNAL 1536 (0600h) ON-CHIP BLOCKB3 > PAGE 12·15 > 65023 (FDFFh) 2047 (07FFh) 65024 (FEOOh) 2048 (0800h) EXTERNAL EXTERNAL PAGE 16-511 65535 (FFFFh) 65535 (FFFFh) Figure 1B. Memory Maps TEXAS~ INsrRUMENTS 0-46 POST OFFICE BOX 1443 ° HOUSTON, TEXAS 77001 SMJ320C26 DIGITAL SIGNAL PROCESSOR SGUS016-APRIL 1990-REVISED NOVEMBER 1992 MEMQBY MAPS AFTER CONF 2 1MP/MC=1 PROGRAM DATA 1/0 I ____..... D (OOOOh) 0 (DODOh) INTERRUPTS ON-CHIP MM Rs EXTERNAL AND RESERVED 5 (0005h) 1°5 ...._ (EXTERNAL) 31 (001Fh) 6 (OD06h) 32 (002Dh) RESERVED PAGED 95 (OD5Fh) 96 (DD60h) ON-CHIP BLOCKB2 127 (DD7Fh) EXTERNAL 128 (D08Dh) RESERVED } PAGE 1-3 511 (D1FFh) 512 (D20Dh) DOES NOT } PAGE4·7 63999 (F9FFh) EXIST 64000 (FAOOh) 1 023 (03FFh) ON-CHIP 1 024 (0400h) BLOCK BO DOES NOT EXIST } PAGE8-11 64511 (FBFFh) 64512 (FCDDh) 1535 (05FFh) ON-CHIP 1536 (0600h) BLOCKB1 ON-CHIP BLOCKB3 } PAGE 12·15 65D23 (FDFFh) 65024 (FEOOh) 2047 (07FFh) 2048 (080Dh) EXTERNAL EXTERNAL } PAGE 16·511 65535 (FFFFh) 65535 (FFFFh) 2MP/MC =D PROGRAM DATA 1/0 D (OOODh) 0 (OOODh) I.________. INTERRUPTS ON-CHIP AND RESERVED MM Rs EXTERNAL BOOTLOAD ROM 5 (OD05h) 1°5 255 (DDFFh) 6 (D006h) 256 (D100h) RESERVED RESERVED 95 (005Fhl PAGED 4D95 (OFFFh) 96 (OD60h 4096 (1000h) ON-CHIP BLOCKB2 127 (D07Fh) EXTERNAL 128 (OD80h) RESERVED } PAGE 1-3 511 (01 FFhl 512(0200h DOES NOT } PAGE4·7 EXIST 63999 (F9FFh) 1 023 (D3FFh) 64000 (FAOOh) 1 024 (D400h) ON-CHIP DOES NOT EXIST } PAGE8-11 BLOCKBD 64511 (FBFFh) 1535 (D5FFhl 64512 (FCOOh) ON-CHIP 1536 (0600h ON-CHIP BLOCKB1 BLOCKB3 } PAGE 12·15 65023 (FDFFh) 2D47 (D7FFh) 65024 (FEDDh) 2048 (D80Dh) EXTERNAL EXTERNAL } PAGE 16·511 65535 (FFFFh) 65535 (FFFFh) Figure 1C. Memory Maps TEXAS~ INSfRUMENTS POST OFFICE BOX 1443 • HOUSTON, TEXAS 77001 D-47 SMJ320C26 DIGITAL SIGNAL PROCESSOR SGUS016-APRIL 199~EVISED NOVEMBER 1992 MEMORY MAPS AFTER CONF 3 1MP/MC=1 PROGRAM DATA 1/0 O (OOOOh) INTERRUPTS AND RESERVED (EXTERNAL) O (OOOOh) 5 {0005hl ON-CHIP MM Rs ' 0 I EXTERNAL 15 L - - - - - - ' 31 (001Fh) 6 (0006h 32 (0020h) RESERVED PAGEO 95 (005Fhl 96 (0060h ON-CHIP BLOCKB2 127 (007Fh EXTERNAL 128 (0080hl RESERVED } PAGE1-3 511 (01 FFh 512 {0200hl DOES NOT } PAGE4-7 63999(F9FFh) EXIST 64000 (FAOOh) 1023 (03FFh ) ON-CHIP 1024 (0400h) BLOCK BO DOES NOT EXIST } PAGE8-11 64511 (FBFFh) 64512 (FCOOh) 1535{05FFh ON-CHIP 1536 {0600h l BLOCKB1 DOES NOT EXIST } PAGE 12-15 65023 (FDFFh) 65024 (FEOOh) 2047 (07FFh ON-CHIP 2048(0800 hl BLOCKB3 EXTERNAL } PAGE 16-511 65535(FFFFh) 65535 (FFFFh) 2 MP/MC =0 PROGRAM DATA 1/0 O (OOOOh) INTERRUPTS AND RESERVED BOOTLOAD ROM 0 (OOOOh) 5 (0005hl ON-CHIP MM Rs ' 0 I EXTERNAL 15 L - - - - - - ' 255(00FFh) 6 (0006h 256 (0100h) RESERVED RESERVED 95 (005Fhl 96 (0060h PAGED 4095 (OFFFh) 4096 (1000h) ON-CHIP BLOCKB2 EXTERNAL 127 (007Fh 128(0080hl RESERVED } PAGE 1-3 511 (01FFh 512 (0200hl DOES NOT } PAGE4-7 EXIST 63999 (F9FFh ) ~l 1023(03FF 64000(FAOO h) 1024(0400 ON-CHIP DOES NOT BLOCK BO EXIST } PAGE8-11 64511 (FBFFh) ~l 1535(05FF 64512 (FCOOh) ON-CHIP 1536(0600 DOES NOT BLOCKB1 EXIST } PAGE 12·15 65023 (FDFFh) ~l 65024 (FEOO h) 2047(07FF ON-CHIP 2048(0800 BLOCKB3 EXTERNAL } PAGE 16-511 65535(FFFF h) 65535 (FFFF h) Figure 1D. Memory Maps TEXAS..,, INSTRUMENTS D-48 POST OFFICE BOX 1443 • HOUSTON, TEXAS 77001 SMJ320C26 DIGITAL SIGNAL PROCESSOR SGUS016-APRIL 1990-REVISED NOVEMBER 1992 Interrupts and subroutines The SMJ320C26 has three external maskable user interrupts INT2-INTO, available for external devices that interrupt the processor. Internal interrupts are generated by the serial port (RINT and XINT), by the timer (TINT), and by the software interrupt (TRAP) instruction. Interrupts are prioritized with reset (RS) having the highest priority and the serial port transmit interrupt (XINT) having the lowest priority. All interrupt locations are on two-words boundaries so that branch instructions can be accommodated in those locations if desired. A built in mechanism protects multicycle instructions from interrupts. If an interrupt occurs during a multicycle instruction, the interrupt is not processed until the instruction is completed. This mechanism applies both to instructions that are repeated or become multicycle due to the READY signal. external Interface The SMJ320C26 supports a wide range of system interfacing requirements. Program, data, and 1/0 address spaces provide interface to memory and 1/0, thus maximizing system throughput. 1/0 design is simplified by having 1/0 treated the same way as memory. 1/0 devices are mapped into the 1/0 address space using the processor's external address and data busses in the same manner as memory-mapped devices. Interface to memory and 1/0 devices of varying speeds is accomplished by using the READY line. When transactions are made with slower devices, the SMJ320C26 processor waits until the other device completes its function and signals the processor via the READY line, the SMJ320C26 then continues execution. A serial port provides communication with serial devices, such as codecs, serial ND converters, and other serial systems. The interface signals are compatible with codecs and many other serial devices with a minimum of external hardware. The serial port may also be used for intercommunication between processors in multiprocessing applications. The serial port has two memory mapped registers; the data transmit register {DXR) and the data receive register (ORR). Both registers operate in either the byte mode or 16-bit word mode, and may be accessed in the same manner as any other data memory location. Each register has an external clock, a framing signal, and associated shift registers. One method of multiprocessing may be implemented by programming one device to transmit while the others are in the receive mode. TEXAS~ INSTRUMENTS POST OFFICE BOX 1443 ° HOUSTON, TEXAS 77001 D-49 SMJ320C26 DIGITAL SIGNAL PROCESSOR SGUS016-APRIL 199C>-REVISED NOVEMBER 1992 multi processing The flexibility of the SMJ320C26 allows configurations to satisfy a wide range of system requirements. The SMJ320C26 can be used as follows: • A standalone processor. • A multiprocessor with devices in parallel. • A multiprocessor with global memory space. • A peripheral processor interfaced via processor controlled signals to another device. For multiprocessing applications, the SMJ320C26 has the capability of allocating global data memory space and communicating with that space via the BR (bus request) and READY control signals. Global memory is data memory shared by more than one processor. Global data memory access must be arbitrated. The 8-bit memory mapped GREG (global memory allocation register) specifies part of the SMJ320C26's data memory as global external memory. The contents of the register determine the size of the global memory space. If the current instruction addresses a location within that space, BR is asserted to request control of the data bus. The length of the memory cycle is controlled by the READY line. The SMJ320C26 supports DMA (direct memory access) to its external program/data memory using the HOLD and HOLDA signals. Another processor can take complete control of the SMJ320C26's external memory by asserting HOLD low. This causes the SMJ320C26 to place its address, data, and control lines in a high impedance state, and assert HOLDA. addressing modes The SMJ320C26 instruction set provides three memory addressing modes; direct, indirect, and immediate addressing. Both direct and indirect addressing can be used to access data memory. In direct addressing, seven bits of the instruction word are concatenated with the nine bits of the data memory page pointer to form the 16-bit data memory address. Indirect addressing accesses data memory through the eight auxiliary registers. In immediate addressing, the data is embedded in the instruction word(s). In direct addressing, the instruction word contains the lower seven bits of the data memory address. This field is concatenated with the nine bits of the data memory page pointer to form the full 16-bit address. Thus, memory is paged in the direct addressing mode with a total of 512 pages, each page containing 128 words. TEXAS~ INSTRUMENTS D-50 POST OFFICE BOX 1443 • HOUSTON, TEXAS 77001 SMJ320C26 DIGITAL SIGNAL PROCESSOR SGUS016-APRIL 1990-REVISED NOVEMBER 1992 Eight auxiliary registers (ARO-AR7) provide flexible and powerful indirect addressing. To select a specific auxiliary register, the Auxiliary Register Pointer (ARP) is loaded with a value from O through 7 for ARO through AR7 respectively. There are seven types of indirect addressing: auto increment, auto decrement, post indexing by either adding or subtracting the contents of ARO, single indirect addressing with no increment or decrement and bit reversal addressing (used in FFTs) with increment or decrement. All operations are performed on the current auxiliary register in the same cycle as the original instruction, followed by an ARP update. repeat feature A repeat feature, used with instructions such as multiply/accumulates, block moves, 1/0 transfers, and table read/writes, allows a single instruction to be executed up to 256 times. The repeat counter (RPTC) is loaded with either a data memory value (APT instruction) or an immediate value (RPTK instruction). The value of this operand is one less than the number of times that the next instruction is executed. Those instructions that are normally multicycle are pipelined when using the repeat feature, and effectively become single-cycle instructions. instruction set The SMJ320C26 microprocessor implements a comprehensive instruction set that supports both numeric intensive signal processing operations as well as general purpose applications, such as multiprocessing and high speed control. For maximum throughput, the next instruction is prefetched while the current one is being executed. Since the same data lines are used to communicate to external data/program or 1/0 space, the number of cycles may vary depending upon whether the next data operand fetch is from internal or external program memory. Highest throughput is achieved by maintaining data memory on-chip and using either internal or fast program memory. Table 1 lists the symbols and abbreviations used in Table 2, the instruction set summary. Table 2 consists primarily of single-cycle, single-word instructions. Infrequently used branch, 1-0, and CALL instructions are multicycle. The instruction set summary is arranged according to function and alphabetized within each functional grouping. The symbol (:I:) indicates instructions that are not included in the SMJ320C25 instruction set. Table 1. Instruction Symbols SYMBOL MEANING B 4-bit field specifying a bit code CM 2-bit field specifying compare mode D Data memory address field FO Format status bit M Addressing mode bit K Immediate operand field Port address (PAO through PA 15 are predefined assembler PA symbols equal to o through 15 respectively). PM 2-bit field specifying P register output shift code R 3-bit operand field specifying auxiliary register s 4-bit left-shift code CNF Internal RAM configuration bits x 3-bit accumulator left-shift field TEXAS INSTRUMENTS 'I POST OFFICE BOX 1443 • HOUSTON, TEXAS 77001 D-51 SMJ320C26 DIGITAL SIGNAL PROCESSOR SGUS016-APRIL 1990-REVISED NOVEMBER 1992 Table 2. Instruction Set Summary ACCUMULATOR MEMORY REFERENCE INSTRUCTIONS NO. INSTRUCTION BIT CODE MNEMONIC DESCRIPTION WORDS 15 14 13 12 11 10 0 8 7 6 5 4 3 2 1 0 ABS Absolute value of accumulator 1 1 1 0 0 1 1 1 0 0 0 0 1 1 0 1 1 ADD ADDC Add to accumulator with shift Add to accumulator with carry 1 1 0 0 0 1 0 0 0 0 +-- s 1--....1 MM . _ D _ . 0 0 ._D_. ADDH ADDK ADDS Add to high accumulator Add to accumulator short Immediate Add to low accumulator with slgn extension suppressed 1 1 1 0 1 0 1 1 1 0 0 0 0 0 0 1 1 1 0 1 0 0 0 0 0 0 1 . M ._D_. M ._D_. K-. ADDTt Add to accumulator with shift specified by T register 1 0 1 0 0 1 0 1 0 M ._D_. ADLKt AND Add to accumulator long Immediate with shift ANO with accumulator 2 1 1 0 1 +-- s ---. 0 0 0 0 0 0 1 0 1 0 1 0 0 1 1 1 0 M ._D_. ANDKt AND Immediate with accumulator with shift 2 1 1 0 1 .,__ s-+ 0 0 0 0 0 1 0 0 CMPLt Complement accumulator 1 1 1 0 0 1 1 1 0 0 0 1 0 0 1 1 1 LAC LACK LACTt Load accumulator with shift Load accumulator Immediate short Load accumulator with shift specified by T register 1 1 1 0 1 0 0 1 1 1 0 0 0 0 0 1 0 .,__ s -+ 0 0 1 1 0 1 .. M ._D_. M ._D_. K-. LALKt Load accumulator long Immediate with shift 2 1 1 0 1 .,__ s-+ 0 0 0 0 0 0 0 1 NEGt Negate accumulator 1 1 1 0 0 1 1 1 0 0 0 1 0 0 0 1 1 NORMt Normalize contents of accumulator 1 1 1 0 0 1 1 1 0 M x x x 0 0 1 0 OR OR with accumulator 1 0 1 0 0 1 1 0 1 M ._D_. ORKt OR Immediate with accumulator with shift 2 1 1 0 1 .,__ s-+ , 0 0 0 0 0 1 0 1 AOL Rotate accumulator left 1 1 1 0 0 1 1 1 0 0 0 1 0 1 0 0 ROA Rotate accumulator right 1 1 1 0 0 1 1 1 0 0 0 1 1 0 1 0 1 SACH SACL SBLKt Store high accumulator with shift Store low accumulator with shift Subtract from accumulator long Immediate with shift 1 1 2 0 0 1 1 1 1 1 1 0 0 0 1 1 0 +-X+ +-X+ .,__ s-+ M ._D_. M . D-. 0 0 0 0 0 0 1 1 SFLt SFRt Shift accumulator left Shift accumulator right 1 1 1 1 1 1 0 0 0 0 1 1 1 1 1 1 0 0 0 0 0 , , 0 0 0 1 1 0 0 0 0 0 1 .,__ s-+ ,, SUB Subtract from accumulator with shift 1 0 0 0 1 M ._D_. SUBB Subtract from accumulator with borrow 1 0 0 0 1 1 1 1 M ._D_. SUBC Conditional subtract 1 0 0 0 0 1 1 1 M ._D_. SUBH SUBK SUBS Subtract from high accumulator Subtract from accumulator short Immediate Subtract from low accumulator with sign extension suppressed 1 1 t 0 1 0 1 1 1 0 0 0 0 0 0 0 1 0 1 1 1 0 0 0 0 1 1 .. M ._D_. M ._D_. K-. SUBTt Subtract from accumulator with shift specified by T register 1 0 1 0 0 0 1 1 0 M ._D_. XOR Exclusive-OR with accumulator 1 0 1 0 0 1 1 0 0 M ._D_. XOR Kt Exclusive-OR Immediate with accumulator with shift 2 1 1 0 1 .,__ s-+ 0 0 0 0 0 t 1 0 ZAC ZALH Zero accumulator Zero low accumulator and load high accumulator 1 1 1 0 1 1 0 0 0 0 1 0 0 0 1 0 0 0 . 0 0 0 0 0 0 0 0 M D-. ZALR ZALS Zero tow accumulator and load high accumulator with rounding Zero accumulator and load low accumulator with sign extension suppressed 1 1 0 0 1 1 1 0 1 0 1 0 0 0 1 0 1 1 .. M ._D_. M D-. t These instructions are not included in the SMJ3201 O instruction set. TEXAS~ INsrRUMENTS D-52 POST OFFICE BOX 1443 • HOUSTON, TEXAS 77001 SMJ320C26 DIGITAL SIGNAL PROCESSOR SGUS016-APRIL 1990-REVISED NOVEMBER 1992 Table 2. Instruction Set Summary (continued) AUXIUARV REGISTERS AND DATA PAGE POINTER INSTRUCTIONS NO. INSTRUCTION BIT CODE MNEMONIC DESCRIPTION Add to auxiliary register short Immediate WOADS 1 1S 14 1 13 12 1 11 1 10 1 1 0 •• • 7 5 4 3 2 1 0 ADAK 0 1 .--K---+ CMPRt Compare auxiliary register with auxiliary register ARO 1 1 1 0 0 1 1 1 0 0 1 0 1 0 o4cMll> LAR Load auxiliary register 1 0 0 1 1 0 .-~ M4---D---ll> LARK Load auxiliary raglster short lmmadlate 1 1 1 0 0 0 .-~ ... K ---II> LARP Load auxiliary register pointer 1 0 1 0 1 0 1 0 1 M 0 0 0 1 4-R--11> LOP LDPK LRUd Load date memory page pointer Load data memory page pointer Immediate Load auxiliary register long lmmedlata 1 1 2 0 1 1 1 1 1 0 0 0 1 0 1 0 1 0 0 0 1 0 0 .-~ . M +--o--+ DP 0 0 0 0 0 0 0 0 ... MAR Modify auxlllary register 1 0 1 0 1 0 1 0 1 M . _ _ D----11> SAR Store auxiliary register 1 0 1 1 1 0 .-~ M4---D---ll> SBRK Subtract from auxiliary register short Immediate 1 0 1 1 1 1 1 1 1 ... K ---II> T REGISTER, P REGISTER, AND MULTIPLY INSTRUCTIONS NO. INSTRUCTION BIT CODE MNEMONIC DESCRIPTION WOADS 15 14 13 12 11 10 ti a 7 8 5 4 3 2 1 0 APAC Add P register to accumulator 1 1 1 0 0 1 1 1 0 0 0 0 1 0 1 0 1 LPHt Load high P register 1 0 1 0 1 0 0 1 1 M4--- o--+ LT Load Treglster 1 0 0 1 1 1 1 0 0 M4--- D---+ LTA Load T register and accumulator previous product 1 0 0 1 1 1 1 0 1 M4--- D---+ LTD Load T register, accumulate previous product, and move date 1 0 0 1 1 1 1 1 M 4 - - - D ---+ 1 LTPt Load T register and store P register In accumulator 1 0 0 1 1 1 1 1 M 4 - - - D ---+ 0 LTSt Load T reglater and subtract previous product 1 0 1 0 1 1 0 1 M 4 - - - D ---+ 1 MACt Mulllply and accumulate 2 0 1 0 1 1 1 0 M 4 - - - D ---+ 1 MACDt Muttlply and accumulate with date move 2 0 1 0 1 1 1 0 0 M 4 - - - D ---+ MPV Mulllply (wllh T register, store product In P register) 1 0 0 1 1 1 0 0 0 M 4 - - - D ---+ MPYA MPYK Multiply and acoumulate previous product Mulllply lmmedlste 1 1 0 1 0 0 1 1 1.. ..... 1 0 1 0 M4--- D K --t ,.. MPYS Mulllply and subtract previous product 1 0 0 1 1 1 0 1 1 M4--- D ---+ MPYU Muttlply unslgnad 1 1 1 0 0 1 1 1 1 M4--- D ---+ PAC Load acoumul- with P register 1 1 1 0 0 1 1 1 0 0 0 0 1 0 1 0 0 SPAC Subtract P register from accumulator 1 1 1 0 0 1 1 1 0 0 0 0 1 0 1 1 0 SPH Stote high P register 1 0 1 1 1 1 1 0 1 M4--- D ---+ SPL Stora low P register 1 0 1 1 1 1 1 0 0 M4--- D ---+ SP Mt Sat P register oUlput shift mode 1 1 1 0 0 1 1 1 0 0 0 0 0 1 o4PMll> SQRAt Square and accumulate 1 0 0 1 1 1 0 0 1 M+-- D ---+ SQRSt Square and subtract previous product 1 0 1 0 1 1 0 1 0 M+-- D ---+ t These instructions are not included in the SMJ3201 Oinstruction set. TEXAS INSTRUMENTS 'f POST OFFICE BOX 1443 • HOUSTON, TEXAS 77001 D-53 SMJ320C26 DIGITAL SIGNAL PROCESSOR SGUS016-APRIL 1990-REVISED NOVEMBER 1992 Table 2. Instruction Set Summary (continued) BRANCH/CALL INSTRUCTIONS NO. INSTRUCTION BIT CODE MNEMONIC DESCRITPION B Branch unconditionally WOROS 2 15 1 14 1 13 1 12 1 11 1 10 1 • 1 8 1 7 1 • 5 ...,__ 4 3 o------. 2 1 0 BACCt BANZ Branch lo address specified by accumulalor Branch on auxiliary register not zero 1 2 1 1 1 1 0 1 0 1 1 1 1 0 1 1 0 1 0 1 ...,__ 0 1 ...,__ o------. 0 0 o------. 1 0 1 BBNZt Bezt Branch If TC bit• O Branch If TC bit • 0 2 2 1 1 1 1 1 1 1 1 1 1 0 0 0 0 1 0 1 1 ...,__ ...,__ o------. o------. BC BGEZ Branch on carry Branch If accumulator :a: O 2 2 0 1 1 1 0 1 1 1 1 0 1 1 1 0 0 0 1 1 ...,__ ...,__ o------. o------. BGZ BIOZ BLEZ Branch If accumul- > o Branch on l/O status • o 2 2 1 1 1 1 1 1 1 1 0 1 0 0 0 1 1 0 1 1 ...,__ ...,__ o------. o------. BLZ Branch If accumul- s O Branch If accumulelor < O 2 2 1 1 1 1 1 1 1 1 0 0 0 0 1 1 0 1 1 1 ...,__ ...,__ o------. o------. BNC BNvt Branch on no carry Branch If no overflow 2 2 0 1 1 1 0 1 1 1 1 0 1 1 1 1 1 1 1 1 ...,__ ...,__ o------. o------. BNZ BV BZ Branch If accumulator ""' o Branch on overflow Branch If accumulelor = o 2 2 2 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 1 0 1 0 0 1 1 0 0 1 1 1 ...,__ ...,__ o------. o------. CALA CALL RET Call subroutine Indirect Call subroutine Re1urn from subroutine 1 2 1 1 1 1 1 1 1 0 1 0 0 1 0 1 1 1 1 1 1 1 1 1 0 0 0 0 1 0 ...,__ o------. 0 0 1 1 0 0 0 0 1 1 0 1 0 0 l/O AND DATA MEMORY OPERATIONS NO. INSTRUCTION BIT CODE MNEMONIC DESCRITPION WORDS 15 14 13 12 11 10 • 8 7 • 5 4 3 2 o------. 1 0 BLKD BL.KPt DMOV Block move from data memory lo data memory Block move from program memory lo dais memory Dais move In dais memory 2 2 1 1 1 0 1 1 1 1 1 0 1 1 1 1 1 0 1 1 1 0 0 1 1 0 0 M ...,__ M ...,__ M ...,__ o------. o------. FORTt IN OUT Format serial port registers lnpu1 dais from port Ou1pu1 dais lo port 1 1 1 1 1 1 1 0 1 0 0 1 0 0 0 1 +-PA-+ +-PA-+ 1 1 0 0 0 0 0 1 M ...,__ M ...,__ o------. 1 o------. 1 FO RFSM Reset serial port frame synchronization mode 1 1 1 0 0 1 1 1 0 0 0 1 1 0 1 1 0 RTXMt Resat serial port transmit mode 1 1 1 0 0 1 1 1 0 0 0 1 0 0 0 0 0 RXFt Resat eX1ernal ftag 1 1 1 0 0 1 1 1 0 0 0 0 0 1 1 0 0 SFSM Set set1al port frame synchronization mode 1 1 1 0 0 1 1 1 0 0 0 1 1 0 1 1 1 STXMt Sat serial port transmit mode 1 1 1 0 0 1 1 1 0 0 0 1 0 0 0 0 1 SXFt TBLR TBLW Set eX1ernal flag Table read Table wri1e 1 1 1 1 0 0 1 1 1 0 0 0 0 1 1 1 1 1 1 1 0 0 0 0 0 0 1 0 0 0 0 1 M ...,__ M ...,__ o------. 1 o------. 0 1 t These instructions are not included in the SMJ3201 Oinstruction set. 1ExAs .,, INSIR.UMENTS D-54 POST OFFICE BOX 1443 •HOUSTON, TEXAS 77001 SMJ320C26 DIGITAL SIGNAL PROCESSOR SGUS016-APRIL 1990--REVISED NOVEMBER 1992 Table 2. Instruction Set Summary (concluded) CONTROL INSTRUCTIONS NO. INSTRUCTION BIT CODE MNEMONIC DESCRIPTION WORDS 15 14 13 12 11 10 9 8 7 8 5 4 3 2 1 0 +- --+ 4 ..• BITt Test bit 1 1 0 0 1 D M D BITTt Test bit specified by T register 1 0 1 0 1 0 1 1 1 M ~ D CONF* DINT EINT Configure RAM blocks as Data or program Disable Interrupt Enable Interrupt 1 1 1 1 1 1 1 1 t 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 1 0 0 1• 0 0 CN ~ 0 •1 0 IDLEt LST LST1t Idle until Interrupt Load status register STO Load status register ST1 1 1 1 1 0 0 1 1 1 0 0 0 0 1 1 1 0 0 1 0 0 1 0 0 0 0 1 0 M M ! :::; 0 1 1 D D 1 1 .. 1 NOP No operation 1 0 1 0 1 0 1 0 1 0 0 0 0 0 0 0 POP Pop top of stack to low accumulator 1 1 1 0 0 1 1 1 0 0 0 0 1 1 1 0 1 POPDt Pop top of stack to data memory 1 0 1 1 1 1 0 1 0 M __... 4 D PSHDt PUSH RC Push data memory value onto stack Push low accumulator onto stack Reset carry bit 1 1 1 0 1 1 1 1 1 0 0 0 1 0 0 0 1 1 1 1 1 0 1 1 0 0 0 M 0 0 4 0 0 0 1 1 1 D 1 0 1 0 0 0 •0 0 RHM Reset hold mode 1 1 1 0 0 1 1 1 0 0 0 1 1 1 0 0 0 ROVM Reset overflow mode 1 1 1 0 0 1 1 1 0 0 0 0 0 0 0 1 0 RPTt RPTKt RSXMt Repeat Instruction as specified by data memory value Repeat instruction as specified by immediate value Reset sign-extension mode 1 1 1 0 1 1 1 1 1 0 0 0 0 0 0 1 1 1 0 0 1 1 1 1 1 1 0 M • 0 4 0 0 0 K D 0 1 1 • __... 0 ATC Reset test'control flag 1 1 1 0 0 1 1 1 0 0 0 1 1 0 0 1 0 SC Set carry bit 1 1 1 0 0 1 1 1 0 0 0 1 1 0 0 0 1 SHM Set hold mode 1 1 1 0 0 1 1 1 0 0 0 1 1 1 0 0 1 SOVM Set overflow mode 1 1 1 0 0 1 1 1 0 0 0 0 0 0 0 1 1 SST SST1t SSXMt Store status register STO Store status register ST1 Set sign-extension mode 1 1 1 0 0 1 1 1 1 1 1 0 1 1 0 1 1 1 0 0 1 0 0 1 0 1 0 M M 0 4 4 0 0 0 D D 0 1 1 •"'i STC Set test/control flag 1 1 1 0 0 1 1 1 0 0 0 1 1 0 0 1 1 TRAPt Software Interrupt 1 1 1 0 0 1 1 1 0 0 0 0 1 1 1 1 0 t These instructions are not included in the SMJ3201 O instruction set. :t This instruction replaces CNFD and CNFP in the SMJ320C25 instruction set. TEXAS"" INSIRUMENTS POST OFFICE BOX 1443 • HOUSTON, TEXAS 77001 D-55 SMJ320C26 DIGITAL SIGNAL PROCESSOR SGUS016-APRIL 199Cf-REVISED NOVEMBER 1992 development support Together, Texas Instruments and its authorized third-party suppliers offer an extensive line of development support products to assist the user in all aspects of TMS320 sec6nd-generation-based design and development. These products range from development and application software to complete hardware development and evaluation systems. Table 3 lists the development support products for the second-generation TMS320 devices. System development may begin with the use of the simulator, Software Development System (SWDS}, or emulator (XDS) along with an assembler/linker. These tools give the TMS320 user various means of evaluation, from software simulation of the second-generation TMS320s (simulator) to full-speed in-circuit emulation with hardware and software breakpoint trace and timing capabilities (XDS). Software and hardware can be developed simultaneously by using the macro assembler/linker, C compiler, and simulator for software development, the XDS for hardware development, and the Software Development System for both software development and limited hardware development. Many third-party vendors offer additional development support for the second-generation TMS320s, including assembler/linkers, simulators, high-level languages, applications software, algorithm development tools, applications boards, software development boards, and in-circuit emulators. Refer to the TMS320 Family Development Support Reference Guide (SPRU011A) for further information about TMS320 development support products offered by both Texas Instruments and its third-party suppliers. Additional support for the TMS320 products consists of an extensive library of product and applications documentation. Three-day DSP design workshops are offered by the Tl Regional Technology Centers (RTCs). These workshops provide insight into the architecture and the instruction set of the second-generation TMS320s as well as hands-on training with the TMS320 development tools. When technical questions arise regarding the TMS320 family, contact the Texas Instruments TMS320 Hotline at (713) 274-2320. Or, keep informed on the latest Tl and third-party development support tools by accessing the DSP Bulletin Board Service (BBS) at (713) 274-2323. The BBS serves 2400-, 1200-, and 300-bps modems. Also, TMS320 application source code may be downloaded from the BBS. Table 3 gives a complete list of SMJ320C26 software and hardware development tools. TEXAS..,, INSTRUMENTS D-56 POST OFFICE BOX 1443 • HOUSTON, TEXAS 77001 SMJ320C26 DIGITAL SIGNAL PROCESSOR SGUS016-APRIL 1990-REVISED NOVEMBER 1992 Table 3. Software and Hardware Support MACRO ASSEMBLER/LINKER HOST COMPUTER OPERATING SYSTEMS PART NUMBER DECVP\X VMS TMDS3242250-08 IBMPC MS/PS DOS TMDS3242850-02 VP\X ULTRIX TMDS3242260-08 SUN3 UNIX TMDS3242550-08 C COMPILER AND MACRO ASSEMBLER/LINKER HOST COMPUTER OPERATING SYSTEMS PART NUMBER DECVP\X VMS TMDS3242255-08 IBM PC MS/PC DOS TMDS3242855-02 VP\X ULTRIX TMDS3242265-08 SUN3 UNIX TMDS3242555-08 SIMULATOR HOST COMPUTER OPERATING SYSTEMS PART NUMBER DECVP\X VMS TMDS3242251-08 IBMPC MS/PC DOS TMDS3242851-02 EMULATOR MODEL POWER SUPPLY PART NUMBER XDS/22 INCLUDED TMDS3262292 SOFTWARE DEVELOPMENT SYSTEM ON PC HOST COMPUTER OPERATING SYSTEMS PART NUMBER IBM PC MS/PC DOS TMDX3268828 IBMPC MS/PC DOS TMDX3268821t t Includes assembler/linker TEXAS~ INSTRUMENTS POST OFFICE BOX 1443 • HOUSTON, TEXAS 77001 D-57 SMJ320C26 DIGITAL SIGNAL PROCESSOR SGUS01&-APRIL 1~EVISED NOVEMBER 1992 absolute maximum ratings over specified temperature range (unless otherwise noted)t Supply voltage range, Vee* ................ : . .. .. .. .. . . .. . .. . .. .. . . .. . . .. .. .. .. .. .. - 0.3 V to 7 V Input voltage range . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . - 0.3 V to 7 V Output voltage range . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . - 0.3 V to 7 V Continuous power dissipation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.0 W Storage temperature range . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . - 55°C to 150°C t Stresses beyond those listed under "absolute maximum ratings" may cause permanent damage to the device. This Is a stress rating only, and functional operation of the device at these or any other conditions beyond those indicated in the "recommended operating conditions" section of this specification Is not Implied. Exposure to absolute-maximum-rated conditions for extended periods may affect device reliability. *All voltages are with respect to Vss. This device contains circuits to protect Its inputs and outputs against damage due to high static voltages or electrostatic fields. These circuits have been qualified to protect this device against electrostatic discharges (ESD) of up to 2 kV according to MIL-STD-883C, Method 3015; however, it is advised that precautions betaken to avoid application of any voltage higher than maximum-rated voltages to these high-impedance circuits. During storage or handling, the device leads should be shorted together or the device should be placed in conductive foam. In a circuit, unused inputs should always be connected to an appropriated logic voltage level, preferably either Vee or ground. Specific guidelines for handling devices of this type are contained in the publication Guidelines for Handling Electrostatic-Discharge-Sensitive (ESDS) Devices and Assemblies available from Texas Instruments. recommended operating conditions MIN NOM MAX UNIT Vee Supply voltage 4.5 5 5.5 v Vss Supply voltage 0 v 015-00,FSX 2.2 V1H High-level input voltage CLKIN, CLKR, CLKX 3.50 v All others 3.00 015-00, FSX, CLKIN, CLKR, CLKX 0.8 V1L Low-level input voltage µA All others 0.7 loH High-level output current 300 µA IQL Low-level output current 2 mA TA Minimum operating free-air temperature -55 ·c ~ Maximum operating case temperature 125 ·c electrical characteristics over specified free-air temperature range (unless otherwise noted) PARAMETER TEST CONDITIONS MIN yyp§ MAX UNIT VoH High-level output voltage Vee= MIN, IQH = MAX 2.4 3 v VQL Low-level output voltage Vee = MIN, IQL = MAX 0.3 0.6 v loz High-impedance-state output leakage current Vee= MAX :t20 µA 11 Input current V1 = Vss to Vee :t 10 µA Supply current LNormal Vee = MAX, fx = MAX 185 mA ice 1 Idle/HOLD 100 C1 Input capacitance 15 pF <2Q. Output capacitance 15 pF §All typical values are at Vee= 5 v, TA= 25°C. TEXAS INSIRUMENTS 'I D-58 POST OFFICE BOX 1443 • HOUSTON, TEXAS 77001 SMJ320C26 DIGITAL SIGNAL PROCESSOR SGUS016-APRIL 199{}-REVISED NOVEMBER 1992 CLOCK CHARACTERISTICS AND TIMING The SMJ320C26 can use either its internal oscillator or an external frequency source for a clock. internal clock option The internal oscillator is enabled by connecting a crystal across X1 and X2/CLKIN (see Figure 2). The frequency of CLKOUT1 is one-fourth the crystal fundamental frequency. The crystal should be either fundamental or overtone mode, and parallel resonant, with an effective series resistance of 30 ohms, a power dissipation of 1 mW, and be specified at a load capacitance of 20 pF. Note that overtone crystals require an additional tuned LC circuit (see the application report, Hardware Interfacing to the TMS320C2S,. PARAMETER TEST CONDITIONS MIN TYP MAX UNIT fx Input clock frequencyt TA= -55°C MIN 6.7 40.0 MHz C1,C2 1.:Q_ = 12s c MAX 0 10 pF t This parameter is not production tested. X1 X2/CLKIN CRYSTAL ----lot----- Figure 1. Internal Clock Option external clock option An external frequency source can be used by injecting the frequency directly into X2/CLKIN with X1 left unconnected. The external frequency injected must conform to the specifications listed in the table below. switching characteristics over recommended operating conditions (see Note 1) PARAMETER MIN TYPt MAX UNIT lg_Q)_ CLKOUT1/CLKOUT2 cycle time 100 600 ns tq{_CIH-9_ CLKIN high to CLKOUT1/CLKOUT2/STRB high/low 5 32 ns l!{Q}_ CLKOUT1/CLKOUT2/STRB fall time 5 ns tr.(_C.l CLKOUT1/CLKOUT2/STRB rise time 5 ns taj_C\:)_ CLKOUT1/CLKOUT2 low pulse duration 20-8 20 20+8 ns taj_CI:!)_ CLKOUT1/CLKOUT2 high pulse duration 20-8 20 20+8 ns ld(C1-C2) CLKOUT1 high to CLKOUT2 low, CLKOUT2 high to CLKOUT1 high, etc. 0-6 o 0+6 ns t This parameter is not production tested. NOTE 1: 0 = 1/41c(C) TEXAS..,, INSTRUMENTS POST OFFICE BOX 1443 • HOUSTON, TEXAS 77001 D-59 SMJ320C26 DIGITAL SIGNAL PROCESSOR SGUS016-APAIL 1990-AEVISED NOVEMBER 1992 timing requirements over recommended operating conditions (see Note 1) MIN NOM MAX UNIT lciCll_ CLKIN cycle time 25 150 ns l\\l{_Cl!,l CLKIN low pulse duration, lciGl_ = 25 ns (see Note 2) 10 15 ns l\\l{_Cll:fr_ CLKIN high pulse duration, lciCJt = 25 ns (see Note 2) 10 15 ns Is~ SYNC setup time before CLKIN low 5 Q-5 ns lhlSl SYNC hold time from CLKIN low 8 ns NOTES: 1. Q = 1/41c(C) 2. CLKIN duty cycle [tr(CI) + lw(CIH)lltc(CI) must be within 40-60%. CLKIN rise and fall times must be less than 5 ns. From Output Under Test Test Point TCL=80pF Figure 2. Test Load Circuit 90% 10% ---- - V1L(MAX) 0 (a) Input 2.2V 0.8V ---- - VoL(MAX) (b) Outputs Figure 3. Voltage Reference Levels ThxAs ~ INsrRUMENTS D-60 POST OFFICE BOX 1443 • HOUSTON, TEXAS 77001 SMJ320C26 DIGITAL SIGNAL PROCESSOR SGUS016--APRIL 1990-REVISED NOVEMBER 1992 MEMORY AND PERIPHERAL INTERFACE TIMING switching characteristics over recommended operating conditions (see Note 1) PARAMETER MIN TYP MAX UNIT lc!lC1-fil. STAB from CLKOUT1 (if STAB is present) Q-6 a Q+6 ns lcH_C2-~ CLKOUT2 to STAB (if STAB is present) -6 0 6 ns lsu{& Address setup time before STAB low (see Note 3) Q-12 ns II}{& Address hold time after STAB high (see Note 3) Q-8 ns !.&SIJ.. STAB low pulse duration (no wait states, see Note 4) 2Q-5 20 20+5 ns laj_Sl:!l. STAB high pulse duration (between consecutive cycles, see Note 4) 2Q ns lsuJQ}_W Data write setup time before STAB high (no wait states) 20-20 ns lll{Q}_W Data write hold time from STAB high Q-10 a ns lell{Q}_ Data bus starts being driven after STAB low (write cycle) ot ns ldil!!Ql_ Data bus three-state after STAB high (write cycle) a 0+15t ns I !cilMSC\ MSC valid from CLKOUT1 -10t 0 10 ns timing requirements over recommended operating conditions (see Note 1) MIN NOM MAX UNIT ~ Read data access time from address time (read cycle) (see Notes 3 and 5) 30-40 ns ls\!.{Q}_R Data read setup time before STAB high 23 ns tl!.{_DlR Data read hold time from STAB high 0 ns lcH_SL·f!l_ READY valid after STAB low (no wait states) 0-22 ns tg(_C2H·F!}_ READY valid after CLKOUT2 high o-22t ns tl:!LSL·F!}_ READY hold time after STAB low (no wait states) 0+3 ns tl:!LC2H-F!}_ READY hold after CLKOUT2 high Q+3t ns lcH_M-f!l_ READY valid after MSC valid 20-25t ns lh1M..fil READY hold time after MSC valid ot ns RS, INT, BIO, AND XF TIMING switching characteristics over recommended operating conditions (see Note 1) PARAMETER MIN TYP MAX UNIT lc!lRfil. CLKOUT1 low to reset state entered 22t ns lc!{!Ags)_ CLKOUT1 to IACK valid -st 0 8 ns .tcuxa XF valid before falling edge of STAB Q-12 ns timing requirements over recommended operating conditions (see Note 1) MIN NOM MAX UNIT lsu_{INJ_ INT/BIO/RS setup before CLKOUT1 high (see Note 6) 32 ns tll{!l'fi_ INT/BIO/RS hold after CLKOUT1 high (see Note 6) 0 ns lwJ!l'fi_ NT/BIO low pulse duration ll!{_Q}_ ns !wlBSl_ RS low pulse duration ~ ns t This parameter is not production tested. NOTES: 1. Q =1/41c(C) 3. A15-AO, PS, OS, iS, RiW, and BR timings are all included in timings referenced as "address." 4. Delays between CLKOUT1/CLKOUT2 edges and STAB edges track each other, resulting in lw(SL) and lw(SH) being 20 with no wait states. 5. Read data access time is defined as la(A) =lsu(A) + lw(SL) -lsu(D)R· 6. RS, INT, and BIO are asynchronous inputs and can occur at any time during a clock cycle. However, if the specified setup time is met, the exact sequence shown in the timing diagram will occur. INT/BIO fall time must be less than 8 ns. TEXAS INSIRUMENTS 'f POST OFFICE BOX 1443. HOUSTON, TEXAS noo1 0·61 SMJ320C26 DIGITAL SIGNAL PROCESSOR SGUS016-APRIL 1990-REVISED NOVEMBER 1992 HOLD TIMING switching characteristics over recommended operating conditions (see Note 1) PARAMETER MIN TYP MAX UNIT lc!!_C1L-AL..}_ HOLDA low after CLKOUT1 low ot 10 ns ldi~AL-& HOLDA low to address three-state 0 ns ldi~C1L-& Address three-state after CLKOUT1 low (HOLD mode) (see Note 7) 20t ns lc!iHH-AHJ_ HOLD high to HOLDA high 25 ns I!enlA:C.1.L.l.. Address driven before CLKOUT1 low (HOLD mode) (see Note 7) et ns timing requirements over recommended operating conditions (see Note 1) MIN NOM MAX UNIT HOLD valid after CLKOUT2 high Q-24 ns NOTES: 1. Q = 1/41c(C) 7. A15-AO, PS, OS, iS, STRB, and R/Wtimings are all included in timings referenced as "address." SERIAL PORT TIMING switching characteristics over recommended operating conditions (see Note 1) PARAMETER MIN TYP MAX UNIT lc!iCH-D_& DX valid after CLKX rising edge (see Note 8) 80 ns lctiFL-~ DX valid after FSX falling edge (TXM = 0) (see Note 8) 45 ns ltdiCH-FSl. FSX valid after CLKX risi'!2_edJ!.e (TXM = 1) 45 ns timing requirements over recommended operating conditions (see Note 1) MIN NOM MAX UNIT fsx Serial port frequency 1.25 5,000 kHz ~Cjg_ Serial port clock (CLKX/CLKR) cycle time 200 800,000 ns ~S@ Serial port clock (CLKX/CLKR) low pulse duration (see Note 9) 80 ns lw_iSC_ISl Serial port clock (CLKX/CLKR) high pulse duration (see Note 9) 80 ns lsl!{f~ FSX/FSR setup time before CLKX/CLKR falling edge (TXM =0) 18 ns tl!{f~ FSX/FSR hold time after CLKXJCLKR falling edge (TXM =0) 20 ns lsl@Fn_ DR setup time before CLKR falling edge 10 ns ~ DR hold time after CLKR falling edge 20 ns NOTES: 1. Q = 1/41c(C) 8. The last occurrence of FSX falling and CLKX rising. 9. The duty cycle of the serial port clock must be within 40--60%. Serial port clock (CLKX/CLKR) rise and fall times must be less than 25ns. TEXAS..,, INS1R.UMENTS D-62 POST OFFICE BOX 1443 • HOUSTON, TEXAS noo1 SMJ320C26 DIGITAL SIGNAL PROCESSOR SGUS016-APRIL 1990-REVISED NOVEMBER 1992 PARAMETER MEASUREMENT INFORMATION Timing measurements are referenced to and from a low voltage of 0.8 volts and a high voltage of 2.2 volts unless otherwise noted. 1-tc(CI) -I tf(CI) ....J t4- ! 1 I -+! t-- tr/Cl) 1 I I I r X/2CLKIN I I I I I I I I I I I I I I--+ th(S) --i I ,_____J_ t I tw(CIL) -l I..+- I +--i I- ta~(S) 1I I ~ su(S) -I ~ I 1 : \ _____/ i-tw(CIH)1.-------- \__ I I I I tc(C) - - - - - - 1 tcl(CIH-C) ---1---j I td(CIH-C) ~ I I I r--- lw(CL) ----j CLKOUT1 : A i ~ Yi~I~~~~'N- 1 ~~- 1 : 1--t tcl(CIH-C) I t - - lw(CH) ---! I I I I I- -I I-- lf(C) ni.--1 lr(c)--1 I / tci(CIH-C) i - I- - - - - ; - - - tc(C) r - tw(CL) ----j CLKOUT2 ___Jf 1d (C1-C2) I• ~- 1 _ al td(C1-C2) i.1•--- _.__~Ii .. 1 1---lw(CH) _ _ J I N ..vr- II lo al ld(C1-C2) ----·td(C1-C2) -I 1-- lf(C) lr(C) -I 1-- Figure 4. Clock Timing TEXAS~ INSTRUMENTS POST OFFICE BOX 1443 • HOUSTON, TEXAS 77001 0-63 SMJ320C26 DIGITAL SIGNAL PROCESSOR SGUS01&-APRIL1990-REVISED NOVEMBER 1992 PARAMETER MEASUREMENT INFORMATION ~ td(C1-S) -I CLKOUT1 I '\- I I l I: I+- ld(C1-S) -I \ ___ I I CLKOUT2 \ ......___ _ _ ____, I II Ji \ I Ii I -I : - ld(C2-S) -i j4" ld(C2·S) STRB - - - - - - " { A i\ L _ tw(SL) ----J 1-- tw(SH) ---! _,IUHO, - - - - - . ----- th~ BR, PS,D!, VALID ORIS _ ___, ' - - - ta(A) --+j R/W ----~ w I I I I I I '4-- tsu(D)R - l I ~:~ READY xxxxxxxxxxxxxxx ! I~ th(SL·R) I• I •I -I I- lh(D)R D15-DO -----------<~ DATA IN }>------ Figure 5. Memory Read Timing 1ExAs .,, INSIRUMENTS D-64 POST OFFICE BOX 1443 •HOUSTON, TEXAS 77001 SMJ320C26 DIGITAL SIGNAL PROCESSOR SGUS016-APRIL 1990-REVISED NOVEMBER 1992 PARAMETER MEASUREMENT INFORMATION CLKOUT1 CLKOUT2 \ I \ I STAB \ I /iI \ ~ tau(A) I• •ol lh(A) I -~M. BR, PS, DS,. VALID ORIS I I I I ~ ~ I I READY~ "" •I lh(D)W I lsu(D)W I'" •1 I D15-DO I~ DAT~OUT jW------ -1 I- lsn(D) t - - ldls(D) -.j Figure 6. Memory Write Timing TEXAS.,, INSfRUMENTS POST OFFICE BOX 1443 • HOUSTON, TEXAS 77001 D-65 SMJ320C26 DIGITAL SIGNAL PROCESSOR SGUS016-APRIL 1990-REVISED NOVEMBER 1992 PARAMETER MEASUREMENT INFORMATION CLKOUT1 \ . , _ _ _ _ _ _,1 \ I \__ CLKOUT2 _ I .....:_ _ I _,Jf I I I I \_______,1 \ _____ STRB -----..1 I I I A1HO,BR~ PS, OS, RiW, VALID : ~ ORIS .~........---.----------~·---------'~ I lh(C2H·R) ~ I ...j,._.-""""*"I lh(C2H·R) ~~l~I READY~~!~ ~ I I -i I- lh(M·R) 015-DO, I 1- lci(M·R) -I i--1 lh(M·R) t-- lci(M·R) .i I (FOR READ I I I I I ( DATA IN )>------ Ol>ERATION) I I I I I 015-DO, (FOR WRITE II II ~ : >®---- OPERATION) I j ~------.-----___,..-------' ~Ii~ MSC~ ~ I ~ -I 1-- lci(MSC) i..--1- ld(MSC) Figure 7. One Walt-State Memory Access Timing TEXAS.,,, INSTRUMENTS D-66 POST OFFICE BOX 1443 • HOUSTON, TEXAS 77001 SMJ320C26 DIGITAL SIGNAL PROCESSOR SGUS016-APRIL 1990--REVISED NOVEMBER 1992 PARAMETER MEASUREMENT INFORMATION t Control signals are DS, TS, Rfii, and XF. :I: Serial port controls are DX and FSX. Figure 8. Reset Timing CLKOUT1 STRB -I i - tsu(IN) _.J ~ lh(IN) lw(N) 1 .. 1 N I I I I iy I --1 1'4-- lf(IN) I I I A15-AO FETCHN FETCH N + 1 FETCH N + 2 FETCH 1 I tcl(IACK) ~ ~ 1'4-- ld(IACK) Figure 9. Interrupt Timing TEXAS~ INSTRUMENTS POST OFFICE BOX 1443 • HOUSTON, TEXAS 77001 D-67 SMJ320C26 DIGITAL SIGNAL PROCESSOR SGUS016-APRIL 1990-REVISED NOVEMBER 1992 PARAMETER MEASUREMENT INFORMATION CLKOUT1 STRB I FETCH BRANCH ADDRESS A15-AO PC=N PC=N+1 PC=N+2 PC:N+3 --1 I'-- lh(IN) OR BRANCH ADDRESS lsu(IN) -j I+- I BIOmVALI~ Figure 1o. BIO Timing CLKOUT1 STRB A15-AO FETCH VALID VALID VALID SXF/RXF PC=N PC= N + 1 PC= N +2 i PC=N+3 XF ,.___ _"'_'A_L_ID_ __ Figure 11. External Flag Timing TEXAS" INSTRUMENTS D-68 POST OFFICE BOX 1443 •HOUSTON, TEXAS 77001 SMJ320C26 DIGITAL SIGNAL PROCESSOR SGUS016-APRIL 199D-REVISED NOVEMBER 1992 PARAMETER MEASUREMENT INFORMATION CLKOUT1 CLKOUT2 i-- fct(C2H-H) (SH note A) I I A15-AO N N +1 N+2 PS,D~ VALID VALID ORIS I I RfN ~----- --i r-- fctls(C1 L·A) D1!H>O ~~~~--c~~~~~~~~~~~~~~~~:--+:~~~~~- 1-+l 14-- ldls(AL·A) I I HOLDA I I I I 1.. .,I ld(C1L-AL) N N +1 FETCH N- 2 N- 1 N EXECUTE NOTE A: HOLD is an asynchronous inputthat can occur at any time during a clock cycle. If the specified timing is met, the exact sequence shown will occur; otherwise, a delay of one CLKOUT2 cycle will occur. Figure 12. HOLD Timing (Part A) TEXAS.,, INSIRUMENTS POST OFFICE BOX 1443 • HOUSTON, TEXAS noo1 0-69 SMJ320C26 DIGITAL SIGNAL PROCESSOR SGUS016-APRIL 199Q-REVISED NOVEMBER 1992 PARAMETER MEASUREMENT INFORMATION CLKOUT1 CLKOUT2 PS,QS, ORIS ------i----W' I '0(~_vA_L_10_ _,) I R/W --..----§ I I 015-DO ~~~~~~:~~~~~~~--~~~~~~~~~ -.! I-- ld(HH-AH) I I A15-AO ----@§{ N+2 ~ N+2 ) N +2 FETCH N+1 EXECUTE NOTE A: HOLD is an asynchronous input that can occur at any time during a clock cycle. If the specified timing is met, the exact sequence shown will occur; otherwise, a delay of one CLKOUT2 cycle will occur. Figure 13. HOLD Timing (Part B) TEXAS~ INSTRUMENTS D-70 POST OFFICE BOX 1443 • HOUSTON, TEXAS 77001 SMJ320C26 DIGITAL SIGNAL PROCESSOR SGUS016-APRIL 1980-REVISED NOVEMBER 1992 PARAMETER MEASUREMENT INFORMATION t4- lc(SCK) --, I -I 14""" lw(SCK) I -+I 14"'" lr(SCK) I I I I I CLKR I FSR Figure 14. Serial Port Receive Timing t4- lc(SCK) - i CLKX FSX (INPUT, TXM = 0) DX 14- lcl(CH-FS) \l_:~~~--~~~~~- FSX (OUTPUT, TXM = 1) Figure 15. Serlal Port Transmit Timing TEXAS INSIRUMENTS 'f POST OFFICE BOX 1443 • HOUSTON, TEXAS 77001 D-71 SMJ320C28 DIGITAL SIGNAL PROCESSOR SGUS016-APRIL 199o-REVISED NOVEMBER 1992 MECHANICAL DATA FJ package leaded chip carrier package PARAMETER MAX UNIT 20,52 (0.808) TOP VIEW Junction-to-free-air 20,19 (0.795) RaJA thermal resistance 50 ·crw Junction-to-case RaJC thermal resistance 7 ·crw j I 1,98 (0.078) I+- 1,07 (0.042) 0,38 (0.015) MIN. .L_1 ~ ~ r- 1,27 (0.050) NOM. 2,41 (0.095) 1,91 (0.075) 1 ~f 2,18 (0.085) 1,65 (0.065) Lid " 0,38 (0.015) 0, 13(0.005) 0,58 (0.023) ..f 0,33 (0.013) I 24, 13 (0.950) 23, 11 (0.910) o,89 -----+----'--..._ 1 2 3 4 5 6 7 8 9 10 11 ALL LINEAR DIMENSIONS ARE IN MILLIMETERS AND PARENTHETICALLY IN INCHES 1ExAs..,, INSIRUMENTS D-74 POST OFFICE BOX 1443 • HOUSTON, TEXAS noo1 Appendix E Instruction Cycle Timings 1:@H~~g3ffi&t@:~mmmmwJ.:@Wi%MM~:~4::1W.#M&tm@~rnmt&1w.mrnw@~[(~}.~*N!':~&w1r~~~~oo~~m1~H:l:':i~~~-~mf~§M&J.#lH'?:$%~W.:?i@W;~W:M~Wfa"$J.~f:OOSm~u~rnwmwHl:HtM;~M:~~t~!M!fX~=r.~@fa!M;if.$J.;~!~M~ifa% This appendix details the instruction cycle timings for the TMS320C2x proces- sor. Instructions are first listed in a table according to cycle classification. Then each class of instructions is listed in another table, showing the number of cycles required for a TMS320C2x instruction to execute in a given memory configuration singly or in repeat mode. The column headings in the tables indi- cate the program source location (Pl, PE, or PR) and data destination or source (DI or DE), defined as follows: Pl The instruction executes from internal program memory (RAM). PR The instruction executes from internal program memory (ROM). PE The instruction executes from external program memory. DI The instruction executes using internal data memory. DE The instruction executes using external data memory. The number of cycles required for each instruction is given in terms of the pro- gram/data memory and 1/0 access times as defined in the following listing: p Program memory wait states. Represents the number of clock cycles the device waits for external program memory to respond to an access. Tac is the TMS320C2x access time, in nanoseconds (maximum), required for an external memory access with no wait states. T mem is the memory ac- cess time, and Tp is the ciock period (4/crystal frequency). p = O; If T mem s Tac p = 1; If Tac< T mem s (Tp +Tac} p = 2; If (T p +Tac} < T mem s (Tp x 2 +Tac) p = k; If [Tp x (k - 1) + Tacl < T mem s (Tp x k +Tac) d Data memory wait states. Represents the number of cycles the device must wait for external data memory to respond to an access. This num- ber is calculated in the same way as the p number. 1/0 memory wait states. Represents the number of cycles the device must wait for external 1/0 memory to respond to an access. This number is calculated in the same way as the p number. Other abbreviations used in the tables and their meanings are as follows: br Branch from ... int Internal program memory. INT Interrupt. ext External program memory. n The number of times an instruction is executed when using the APT or RPTK instruction. E-1 TMS320C2x Instruction E.1 TMS320C2x Instruction Cycle Timings Table E-1 lists the TMS320C2x instructions according to cycle classification. Table E-2 and Table E-3 show the number of cycles required for a given TMS320C2x instruction to execute in a given memory configuration when executed as a single instruction or in the repeat mode, respectively. Table E-1. TMS320C2x Instructions by Cycle Class CLASS INSTRUCTION I ADD ADDC ADDH ADDS ADDT AND BIT BITT DMOV LAC LACT LPH LT LTA LTD LTP LTS MPY MPYA MPYS MPYU PSHD OR APT SORA SQRS SUB SUBB SUBC SUBH SUBS SUBT XOR ZALH ZALR ZALS (APT not repeatable) II LAA LOP LST LST1 Ill POPD SACH SACL SAR SPH SPL SST SST1 IV ABS ADDK ADAK APAC CMPL CMPR CNFD CNFP DINT EINT FORT LACK LARK LARP LDPK MAR MPYK NEG NOP NORM PAC POP PUSH RC RFSM RHM AOL ROA ROVM RPTK RSXM ATC RTXM RXF SBRK SC SFL SFR SFSM SHM SOVM SPAC SPM SSXM STC STXM SUBK SXF ZAC (ADDK, ADAK, LACK, LARK, LDPK, MPYK, RPTK, SBRK, SPM, SUBK, and ZAC not repeatable) v ADLK ANDK LALK LALK ORK SBLK XORK (all not repeatable) VI MAC MACO VI B BANZ BBNZ BBZ BC BGEZ BGZ BIOZ BLEZ BLZ BNC BNV BNZ BV BZ CALL (all not repeatable) VIII BACC CALA RET TRAP (all not repeatable) IX IN x OUT XI TBLR XII TBLW (table in ROM not applicable) XIII BLKD XIV BLKP xv IDLE (not repeatable) E-2 Instruction Cycle Timings TMS320C2x Instruction Table E-2. Cycle Timings for Cycle Classes When Not in Repeat Mode CLASS Pl/DI Pl/DE PE/DI PE/DE PR/DI PR/DE I 1 2+d 1+p 2+d+p 1 2+d II 1 2+d 1+p 2+d+p 1 2+d Ill 1 1+d 1+p 2+d+p 1 1+d IV 1 1 1+p 1+p 1 1 v 2 2 2+2p 2+2p 2 2 VI Table in on-chip RAM: 3 4+d 4+2p 5+d+2p 4 5+d Table in on-chip ROM: 4 5+d 4+2p 5+d+2p 4 5+d Table in external memory: 4+p 5+d+p 4+3p 5+d+3p 4+p 5+d+p VII True Conditions: Destination on-chip RAM: 2 2 2+2p 2+2p 2 2 Destination on-chip ROM: 3 3 3+2p 3+2p 3 3 Destination external memory: 3+p 3+p 3+3p 3+3p 3+p 3+p False Condition: Destination anywhere: 2 2 2+2p 2+2p 2 2 VIII Destination on-chip RAM: 2 2 2+p 2+p 2 2 Destination on-chip ROM: 3 3 3+p 3+p 3 3 Destination external memory: 3+p 3+p 3+2p 3+2p 3+p 3+p IX 2+i 2+d+i 2+p+i 3+d+p+i 2+i 2+d+i x 1+i 2+d+i 2+p+i 3+d+p+i 1+i 2+d+i XI Table in on-chip RAM: 2 2+ d 3+p 3+d+p 3 3+d Table in on-chip ROM: 3 3+d 4+p 4+d+p 4 4+d Table in external memory: 3+p 3+d+p 4+2p 4+d+2p 4+p 4+d+p XII Table in on-chip RAM: 2 3+d 3+p 4+d+p 3 4+d Table in on-chip ROM: not applicable Table in external memory: 2+p 3+d+p 3+2p 4+d+2p 3+p 4+d+p E-3 TMS320C2x Instruction Cycle Timings :X:.'X:!t!::XWxmt~~~:lfil.~::::X.~,X:~~:::::;~~ • i~~~~™™™"M~W..:::<;:::~~~~ Table E-2. Cycle Timings for Cycle Classes When Not in Repeat Mode (Concluded) CLASS Pl/DI I Pl/DE I PE/DI I PE/DE I PR/DI I PR/DE XIII Source data in on-chip RAM: 3 3+d 3+2p 3+d+2p 3 3+d Source data in external memory: 4+d 4+2d 4+d+2p 4+2d+2p 4+d 4+2d XIV Table in on-chip RAM: 3 3+d 4+2p 4+d+2p 4 4+d Table in on-chip ROM: 4 4+d 4+2p 4+d+2p 4 4+d Table in external memory: 4+p 4+d+p 4+3p 4+d+3p 4+p 4+d+p xv (Interrupt) destination on-chip ROM 3 (minimum waits for INT) (Interrupt) destination external memory 3+2p (minimum waits for INT) E-4 Instruction Cycle Timings TMS320C2x Instruction Table E-3. Cycle Timings for Cycle Classes When in Repeat Mode CLASS Pl/DI Pl/DE PE/DI PE/DE PR/DI PR/DE I n 1+n+nd n+p 1+n+nd+p n 1+n+nd II n 2n+nd n+p 2n+nd+p n 2n+nd Ill n n+nd n+p 1+n+nd+p n n+nd IV n n n+p n+p n n v not repeatable VI Table in on-chip RAM: 2+n 2+2n+n.d 3+n+2p 3+2n+nd+2p 3+n 3+2n+nd Table in on-chip ROM: 3+n 3+2n+nd 3+n+2p 3+2n+nd+2p 3+n 3+2n+nd Table in external memory: 3+n+np 3+2n+nd+np 3+n+np+2p 3+2n+nd+np 3+n+np 3+2n+nd+np +2p VII not repeatable VIII not repeatable IX 1+n+ni 2n+nd+ni 1+n+p+ni 1+2n+nd+p 1+n+ni 2n+nd+ni +ni x n+ni 2n+nd+ni 1+n+p+ni 1+2n+nd+p n+ni 2n+nd+ni +ni XI Table in on-chip RAM: 1+n 1 + n + nd 2+n+p 2+n+nd+p 2+n 2+n+nd Table in on-chip ROM: 2+n 2+n+nd 3+n+p 3+n+nd+p 3+n 3+n+nd Table in external memory: 2+n+np 1+2n+nd+np 3+n+np+p 2+2n+nd+np 3+n+np 2+2n+nd+np +p XII Table in on-chip RAM: 1+n 2+n+nd 2+n+p 3+n+nd+p 2+n 3+n+nd Table in on-chip ROM: not applicable Table in external memory: 1+n+np 1+2n+nd+np 2+n+np+p 2+2n+nd+np+p 2+n+np 2+2n+nd+np XIII Source data in on-chip RAM: 2+n 2+n+nd 2+n+2p 2+n+nd+2p 2+n 2+n+nd Source data in external memory: 3+n+nd 2+2n+2nd 3+n+nd+2p 2+2n+2nd 3+n+nd 2+2n+2nd +2p XIV Table in on-chip RAM: 2+n 2+n+nd 3+n+2p 3+n+nd+2p 3+n 3+n+nd Table in on-chip ROM: 3+n 3+n+nd 3+n+2p 3+n+nd+2p 3+n 3+n+nd Table in external memory: 3+n+np 2+2n+nd+np 3+n+np+2p 2+2n+nd+np 3+n+np 2+2n+nd+np +2p xv not repeatable E-5 E-6 Instruction Cycle Timings Appendix F TMS320E25 EPROM Programming m t · 1 · i · · · .r · OO&WA This appendix describes the TMS320E25 EPROM cell. The TMS320E25 in- corporates a 4K x 16-bit EPROM, which is implemented from a standard TMS27C64 EPROM cell. This expands the capabilities of the TMS320E25 in the areas of prototyping, early field testing, and production. Key features of the EPROM cell include standard programming techniques with verification capability of all bits. The EPROM cell features an internal mechanism for security purposes. This prevents all proprietary data from be- ing read and, thereby, protects privileged information against possible copy- right violations. The mechanism also prevents the EPROM contents from be- ing read. An adapter socket (part number TMDX3270120) provides the 68-pin to 28-pin conversion that is necessary when programming the TMS320E25. Refer to the data sheet in Appendix A. This appendix describes erasure, programming and verification, and EPROM protection and verification. The major topics are as follows: Topic Page F-1 Using the EPROM Programmer Adapter Socket ,_,,_,,_,,_,,_ F.1 Using the EPROM Programmer Adapter Socket Most EPROM programmers have a 28-pin DIP-type socket for use with EPROM devices such as the TMS27C64. In order to use this type of program- mer to program a TMS320 40-pin DIP or PLCC/CLCC, you must use a special adapter that converts the programmer socket into a socket that can accept a TMS320E25 device. Figure F-1 shows an example of a PLCC/CLCC-type adapter socket so that you can see the socket for the device and the portion that plugs into the EPROM programmer. Figure F-1. EPROM Programming Adapter Socket TMS320E25 device plugs into this socket Plugs into an EPROM programmer .____ _ or the A-bit programmer F.1.1 Supplying External Power The adapter socket has two sets of jumpers that indicate whether the power supply is internal (from the EPROM programmer) or external. The adapter socket is shipped from the factory with the jumpers at the internal power set- ting. In some cases,, the EPROM programmer cannot supply the V cc power needs of the TMS320E25 device, so it becomes necessary to supply external Vee. The following conditions will determine whether external power is needed. O The TMS320E25's clock must be disabled during programming. Because the device uses a dynamic logic for much of its internal circuitry, the Ice requirements for Vee are significantly greater than a typical 27C64-type EPROM. As a result, many EPROM programmers sense this condition and erroneously indicate that the chip is plugged in backwards. To prevent this from occurring, a jumper connection and test point are available for an external 5-V logic supply. This effectively bypasses the EPROM pro- grammer's Ice test and allows the device to be programmed. F-2 TMS320E25 EPROM Programming Using the EPROM Programmer Adapter Socket O Additionally, a jumper and test point are available for the Vpp supply. The Vpp signal is a pulsed signal and fully complies with the standards for a 27C64 EPROM device. This option is never needed, and the jumpers should be left in the internal position at all times. To supply external Vee: 1) Find the jumper nearest the V cc pin and move the jumper so that it is over the EXT and center pins. 2) Connect the external Vee to the pin labeled Vee· Figure F-2 shows the jumper setting placement for internal and external pow- er. The Vee and Vpp pins are also shown. Figure F-2. Vee and Vpp Jumper Settings for External Power r---------------- 1 cc V ---------------, Setting I Vpp Setting I I I Vee Vpp I I I i l]EXT EXTI] i I I '--------------- _______________ INT I I INT·••· .... F-3 Programming and Verification F.2 Programming and Verification The TMS320E25 EPROM cell is similar to the TMS27C64 SK x 8-bit EPROM. Their memories can be erased by using an ultraviolet light source and electri- cally programmed by using the same family and device codes. The TMS320E25, like the TMS27C64, requires a 5-V supply for reading and a 12.5-V supply for programming. All programming signals are TTL level. Loca- tions may be systematically or randomly programmed as a singular or blocked address. Unlike some EPROM cells that may require the high byte before the low byte, each byte of data must be loaded into the TMS320E25 EPROM cell with the low byte preceding the high byte (see Figure F-3). To avoid memori- zation of the proper order, an inverter is placed in the circuit of Figure F-4 and performs the necessary byte reversal for the TMS320E25. Figure F-3. EPROM Programming Data Format TMS320C25 On-Chip TMS320C25 On-Chip EPROM Program Memory Program Memory Programmer (Word Format) (Byte Format) Memory Byte Format with Adapter Socket O(OOOOh) 1234h O(OOOOh) 34h O(OOOOh) 12h 1(0001 h) 5678h 1 (0001 h) 12h 1 (0001 h) 34h 2(0002h) 9ABCh 2(0002h) 78 2(0002h) 56h 3(0003h DEFOh 3(0003h) 56 3(0003h) 78h 4(0004h) BCh 4(0004h) 9Ah 5(0005h) 9Ah 5(0005h) BCh 6(0006h) FOh 6(0006h) DEh 7(0007h) DEh 7(0007h) FOh 4095(0FFFh) 8191 (1 FFFh) ,____ __. Figure F-4 shows the wiring diagram when the TMS320E25 is programmed with the TMS27C64 in its 28-pin output form. The illustration furnishes a table for each pin nomenclature on the TMS27C64 with a description of that pin. Pro- gramming the code into the device should be done in the serial mode. F-4 TMS320E25 EPROM Programming Figure F-4. TMS320E25 EPROM Conversion to TMS27C64 EPROM Pinout Ol "' ,... co U'J 'It (") C\I ..- iEl'oallllc:l; &l &l <06 TMS27C64 10 11 07 I~ 5 Vee 28 12 06 5 ~ 27 13 05 EPT 26 14 04 AB 25 15 03 A9 24 TMS320E25 16 02 A11 23 68PIN 17 01 5 (FZ) G 22 18 DO CLKIN 5 A10 21 19 E 20 20 EPT 5 08 19 ::~~· 4 07 18 4 23~V$ 06 17 4 ~ 05 16 24 / A1 4 04 15 (.) 0 NI::; 4 <(<(<(<( ~~~;;:~;;:~1(!) 25 .. "' "',_ 26 I ,..._COO>O..-C\IM Table F-1. Pin Nomenclature (TMS320E25) Signals 1/0 Definition A 12(MSB)-AO (LSB) I On-chip EPROM programming address lines CLKIN I Clock oscillator input E I EPROM chip select EPT I EPROM test mode select IT I EPROM read/verify select GND I Ground PITM I EPROM write/program select Q8(MSB)-Q1 (LSB) 1/0 Data lines for byte-wide programming of on-chip SK bytes of EPROM RS I Reset for initializing the device Vee I 5-V power supply Vpp I 12.5-V power supply F-5 Programming and Verification ;:-,-::::~:::-;;..-.::::~.w.-:::::::::::;:::..~.:::::».~o/~..:..~~$.~M<.:::::::;::-.:X:::.>'~~::t~~~.;;.~~~-:::::-=-=-~~$'~.W'~.:::X~~~&..x:::::::::,:.-,«-:;::-;..;::-;:::;w;;;::r.x:<.::x;-;:;x Table F-2 shows the programming levels that are required when program- ming, verifying, and reading the EPROM cell. Following the table are individual descriptions of each programming level. Table F-2. TMS320E25 Programming Mode Levels Signal TMS320E25 TMS27C64 Program Program Read EPROM Protect Na met Pin Pin Verify Protect Verify E 22 20 V1L V1L V1L V1H V1L 'G 42 22 V1H PUCSE PUCSE V1H V1L Pmiil 41 27 PUCSE V1H V1H V1H V1H Vpp 25 1 Vpp Vpp Vee Vpp Vee+ 1 Vee 61,35 28 Vee+ 1 Vee+ 1 Vee Vee+ 1 Vee+ 1 Vss 27,44,10 14 Vss Vss Vss Vss Vss CLKIN 52 14 Vss Vss Vss Vss Vss RS 65 14 Vss Vss Vss Vss Vss EPT 24 26 Vss Vss Vss Vpp Vpp QB-01 11-18 19-15,13-11 D1N Oour Oour Oa=PITCSE Os= A BIT A12-A7 40--36,34 2,23,21, ADDA ADDA ADDA x x 24,25,3 A6 33 4 ADDA ADDA ADDA x V1L AS 32 5 ADDA ADDA ADDA x x A4 31 6 ADDA ADDA ADDA V1H x A3-AO 30-28,26 7-10 ADDA ADDA ADDA x x LEGEND: t =TMS320E25 EPAOM programming mode produces these TMS27C64 signals. V1H = TIL high level V1L = TIL low level ADDA =byte address bit Vpp = 12.5 ± 0.25 V (FAST) or 13 ± 0.25 V (SNAP!) Vee= s ± 0.25 v Vee+ 1 = 6 ± 0.25 V (FAST) or 6.5 V ± 0.25 V (SNAP!) X =don't care PUCSE = low-going TIL pulse D1N = byte to be programmed at ADDA Oour = byte stored at ADDA F-6 TMS320E25 EPROM Programming Programming and Verification F.2.1 Erasure Before programming, the memory must be erased by exposing high-intensity ultraviolet light (wavelength = 2537 angstroms) into the chip through its trans- parent lid. Note that normal ambient light contains the correct wavelength for erasure. Therefore, the window should be covered with an opaque label after programming the TMS320E25. The recommended minimum exposure dose (UV intensity x exposure time) is 15 watt-seconds per square centimeter. If lo- cated about 2.5 centimeters above the transparent lid, a typical filterless UV lamp with a 12-milliwatt-per-square-centimeter output will erase the memory in 21 minutes. After the memory is erased, all bits are in a high state. F.2.2 FAST Programming After erasure, all memory bits in the cell are a logic one. Logic zeros must now be programmed into their desired location. The FAST programming algorithm, shown in Figure F-5, is normally used to program the entire EPROM contents, although individual locations may be programmed separately. A programmed logic zero can be erased only by ultraviolet light. Data is presented in parallel (eight bits) from pins 07-DO of the TMS320E25 to pins Q8-Q1 of the TMS27C64. Once addresses and data are stable, PGM is pulsed. The pro- gramming mode is achieved when Vpp = 12.5 V, PGM = V1L· Vee= 6.0 V, G = V1H, and E = ViL· More than one TMS320E25 can be programmed if these devices are connected in parallel with each other. Locations can be pro- grammed in any order. FAST programming uses two types of programming pulses: prime and final. The length of the prime pulse is 1 ms. After each prime pulse, the byte being programmed is verified. If correct data is read, the final programming pulse is applied; if correct data is not read, an additional 1-ms prime pulse is applied up to a maximum of 25 times. The final programming pulse is 3x times the num- ber of prime programming pulses applied. This sequence of programming and verifying is performed at Vee= 6.0 V, and Vpp = 12.5 V. When the full FAST programming routine has been completed, all bits are verified with Vee= Vpp =5V. F-7 Programming and Verification F.2.3 SNAP! Pulse Programming The EPROM can be programmed by using the Tl SNAP! pulse programming algorithm; as illustrated in the flowchart of Figure F-6, programming time is greatly reduced t.o a nominal duration of one second. Actual programming time varies as a function of the programmer that is being used. Data is presented in parallel (eight bits) on pins 08 through 01. Once addresses and data are stable, l5GM is pulsed. The SNAP! pulse programming algorithm uses pulses of 100 microseconds, followed by a byte verification to determine if the addressed byte has been suc- cessfully programmed. Up to ten 100-microsecond pulses per byte are verified before a failure is recognized. The programming mode is achieved when Vpp = 13.0 V, Vee= 6.5 V, and G = = V1H. and E V1L· More than one TMS320E25 can be programmed by con- necting the devices in parallel with each other. Locations may be programmed in any order. When the SNAP! pulse programming routine has been com- pleted, all bits are verified with Vee= Vpp =5 V. F.2.4 Program Verify Programmed bits may be verified with Vpp = 12.5 V when G = V 1L, E = V 1L. and l5GM = ViH· Figure F-7 shows the timing of the program and verification opera- tions for both FAST and SNAP! pulse programming. F-8 TMS320E25 EPROM Programming Programming and Verification =-==-===w-~».:-~~~~~#R~~m,m::;:ww.~::-.:x:::: Figure F-5. FAST Programming Flowchart Start Address= First Location Vee= 6 :1: 0.25 v Vpp = 12.5 V :1: 0.25 V X=O Program One 1-ms Pulse lncrementX Program One Device Pulse of 3X-ms Failed Duration Increment Address Vee= Vpp = 5 v :1: 0.25 v Fail Device Passed F-9 Programming and Verification Figure F-6. SNAP! Pulse Programming Flowchart l Program Mode Program One Pulse =tw =100 µs Increment Interactive Address x=x+1 Mode Yes Device Failed Vee= Vpp = s.o v ± 10% Final Verification Fail _l F-10 TMS320E25 EPROM Programming Figure F-7. Programming Timing ~ ~ I Progra111 llJJtlll Verify--• ~---------A-d-dr_es_s_s_ta_b_1e_ _ _ _ _ _XAddress N+1 V1H A12-AO V1L V1HNOH 08-01 ( Data In Stable ) Hl-Z ( Data Out Valid ) V1LNOL Vpp Vpp Vee Vee+ 1 Vee __/ Vee ~ E V1H V1L PGM \_/ V1H V1L V1H V1L F.2.5 Program Inhibit Programming can be inhibited by maintaining a high-level input on the E pin orPGMpin. F.2.6 Read The EPROM contents can be read outside of the programming cycle if the RBIT (ROM protect bit) has not been programmed. The read mode is accom- plished by setting E to zero and pulsing G low. The contents of the EPROM location, selected by the value on the address inputs, appear on D7-DO. F.2. 7 Output Disable During the EPROM programming process, the EPROM data outputs can be disabled, if desired, by setting the output disable mode. Depending upon the application, the output disable mode can be selected by setting either the G or the E pin on the TMS320E25 high. The selection of the pin determines the duration for which the outputs, pins Q8-Q1, of the TMS27C64 are in the high- impedance state. During this mode, pins D7-DO on the TMS320E25 are in the high-impedance state. F-11 EPROM Protection and Verification F.3 EPROM Protection and Verification This section describes the code protection feature of the EPROM cell; an inter- nal mechanism protects the customer's code from being illegally copied by its competitors. Table F-3 shows the programming levels required for protecting the EPROM contents and verifying that protection. Following the table, individ- ual paragraphs describe the function of the protect and verify modes. Table F-3. TMS320E25 EPROM Protect and Protect Verify Mode Levels SIGNALt TMS320E25 PIN TMS27C64 PIN EPROM PROTECT PROTECT VERIFY E 22 20 V1H V1L G 42 22 V1H V1L ~ 41 27 V1H V1H Vpp 25 1 Vpp Vee+ 1 Vee 61,35 28 Vee+ 1 Vee+ 1 Vss 27,44,10 14 Vss Vss CLKIN 52 14 Vss Vss RS 65 14 Vss Vss EPT 24 26 Vpp Vpp 08-01 11-18 9-15,13-11 08=PUCSE 08=RBIT A12-A10 40-38 2,23,21 x x A9-A7 37,36,34 24,25,3 x x A6 33 4 x V1L A5 32 5 x x A4 31 6 V1H x A3-AO 30-28,26 7-10 x x LEGEND: t = Signal names are in accordance with TMS27C64. V1H = TTL high level; V 1L = low-level TIL; Vee = 5 ± 0.25 V; Vpp = 12.5± 0.25 V (FAST); or 13 ± 0.25 V (SNAP!); Vee+ 1 = 6 ± 0.25 V (FAST) or 6.5 ± 0.25 V (SNAP!); X = don't care; PUCSE = low-going TIL level pulse; RBIT = ROM protect bit F.3.1 EPROM Protection The EPROM protection mechanism is used to prevent an intentional or acci- dental reading of the memory contents; this guarantees security of all propri- etary algorithms. This special feature is implemented by a unique EPROM cell called the RBIT (ROM protect bit) cell. Once the contents are programmed into the EPROM, the RBIT can be programmed, this prevents access to the EPROM contents and disables the microprocessor mode. Once programmed, the RBIT can be disabled only by erasing the entire EPROM array with ultravio- F-12 TMS320E25 EPROM Programming EPROM Protection and Verification let light, thereby maintaining security of all proprietary algorithms. Program- ming of the RBIT is accomplished by the EPROM protection cycle, which consists of setting the E, G, ~. and A4 pins to a high level, applying 12.5 ± 0.25 V to both Vpp and EPT, and pulsing the 08 pin to a low level. The complete sequence of operations for programming the RBIT is shown in the flowchart of Figure F-8. The required setups in the figure are detailed in Table F-3. For more detailed information about how the RBIT works, see subsection F.3.2. Figure F-8. EPROM Protection Flowchart Start Program One Pulse of 3X-ms Duration EPROM Protect Protect Setup Verify Setup Program One 1-ms Pulse Device Device Failed Passed X=X+1 Protect Verify Setup EPROM Protect Setup F-13 EPROM Protection and Verification F.3.2 How the RBIT Works When enabled, the RBIT disconnects the internal program memory bus (PBUS) from the MUX that combines the internal data bus (DBUS) to create the external program/data bus. This disconnect takes place at the MUX. For the TMS320E25, the internal nodes are left floating. Figure F-9 shows a portion of the TMS320C2x block diagram and includes the RBIT to show how it disconnects the external and internal program spaces. Figure F-9. How the RBIT Fits Into the TMS320E25 Block Diagrams 4Kx 16 program EPROM External _ __ Program/ Data Bus 16 x 16 Multiplier PREG Programming the RBIT has some side effects that may, at first, give the ap- pearance that the device isn't operating properly. However, because enabling the RBIT protects the EPROM space, this is normal operation. These side ef- fects include: O Instructions. Some instructions that use the external program space for storage will not operate in the same manner when the RBIT is set. For example, on the TMS320E25, TBLW, BLKP, and similar commands may seem to work when used to transfer external program memory to the internal data space connected to DBUS. However, a transfer from the in- ternal program space to the external bus will not work. This happens be- cause the RBIT feature is protecting this memory space. Similarly, the MAC instruction cannot read tables stored in external pro- gram space. In this case, the data and program must be swapped, sacrific- ing one cycle per repeated instruction. F-14 TMS320E25 EPROM Programming EPROM Protection and Verification O Invalid microprocessor mode. Microprocessor mode can't be used after enabling the RBIT, because the PBUS is disconnected from the external program space. F.3.3 Protect Verify Following the EPROM protect mode, the protect verify mode reviews and veri- fies the programming of the RBIT (see Figure F--8) for accuracy. When using this mode, D7 outputs the state of the RBIT. When RBIT = 1, the EPROM is unprotected; when RBIT = 0, the EPROM is protected. The EPROM protection and verification timings are shown in Figure F-10. Figure F-10. EPROM Protection Timing - - - - - Protect ----.i•~-----Verify .,J ~~:: I A4 wt I Vpp - - - - - - - - - - -......! I Vpp ___IT I 7\ I I Vee I Vee _A----------~......ii~ I I Vee+ 1 Vee I I I E ---------------! II ?GM I I I I ~--/ I - Hl-Z . """'\. r- 'z H1- 1 ~...._ __ , / r - - - Hl·Z QB I -·- - - - - - - · I I I I I I EPT I I A6 t 12.5 V = Vpp and 6.0 V =Vee for FAST Programming; for SNAP! Programming, 13.0 V = Vpp and 6.5 V =Vee- F-15 F-16 TMS320E25 EPROM Programming Multimedia App[lications G.1 Multimedia Applications Multimedia integrates different media through a centralized computer. These media can be visual or audio and can be input to or output from the central computer via a number of technologies. The technologies can be digital based or analog based (such as audio or video tape recorders). The integration and interaction of media enhances the transfer of information and can accommo- date both analysis of problems and synthesis of solutions. Figure G-1 shows both the central role of the multimedia computer and the multimedia system's ability to integrate the various media to optimize informa- tion flow and processing. Figure G-1. System Block Diagram CD ROM Operator Input Modem _f Video Input nl~ I-' Video Monitor Image Sensor Multimedia PJ Computer Microphone Us~ ,...,- @1 h Facsimile/Modem Music Input (MIDI) • . Speakers Slides and Printing G.1.1 System Design Considerations Multimedia systems can include various grades of audio and video quality. The most popular video standard currently used (VGA) covers 640 x 480 pixels with 1, 2, 4, and 8-bit memory-mapped color. Also, 24-bit true color is sup- ported, and 1024 x 768 (beyond VGA) resolution has emerged. There are two grades of audio. The lower grade accommodates 11.25-kHz sampling for 8-bit monaural systems, while the higher grade accommodates 44.1-kHz sampling for 16-bit stereo. Audio specifications include a musical instrument digital interface (MIDI) with compression capability, which is based on keystroke encoding, and an input/ output port with a 3-disc voice synthesizer. In the media control area, video disc, CD audio, and CD ROM player interfaces are included. Figure G-2 shows a multimedia subsystem. G-2 Analog Interface Peripherals and Applications Multimedia Applications The TLC32047 wide-band analog interface circuit (AIC) is well suited for multi- media applications because it features wide-band audio and up to 25-kHz sampling rates. The TLC32047 is a complete analog-to-digital and digital-to- analog interface system for the TMS320 DSPs. The nominal bandwidths of the filters accommodate 11.4 kHz, and this bandwidth is programmable. The application circuit shown in Figure G-2 handles both speech encoding and modem communication functions, which are associated with multimedia appli- cations. Figure G-2. Multimedia Speech Encoding and Modem Communication Vocoder (Speech Analysis) 9600-bps Modem (V.32 bis) .----------1 .----------1 Qi : TLC32047 TMS320 : TMS320 : TMS320 TLC32047 : ..---....--..., (i 1 A1c osp DSP Encrypt/ Decrypt DSP AIC DAA HYB Phone Line I1_ _ _ _ _ _ _ I_ -------....J TMS320 DSP/ TLC32047 Interface Controller Memory Figure G-3 shows the interfacing of the TMS320C25 DSP to the TLC32047 AIC that constitutes the building blocks of the 9600-bps V.32 bis modem shown in Figure G-2. Figure G-3. TMS320C25 to TLC32047 Interface TMS320C25 TLC32047 CLKOUT MSTRCLK Vee+ 5V FSX FSX REF DX DX ANLG GND FSA FSR 0.2 µF Cer. DR DR -5V CLKR SHIFTCLK Voo +5V CLKX 0.1 µF DGTLGND G-3 Multimedia Applications G.1.2 Multimedia-Related Devices As shown in Table G-1 , Tl provides a complete array of analog and graphics interface devices. These devices support the TMS320 DSPs for complete mul- timedia solutions. Table G-1. Data Converter /Cs Resolution Conversion Device Description 1/0 Application (Bits) CLK Rate Portable modem and TLC320AC01 Analog interface (5 V only) Serial 14 43.2 kHz speech, multimedia Analog interface Speech, modem, and TLC32047 Serial 14 25 kHz (11.4 kHz BW) (AIC) multimedia TLC32046 Analog interface (AIC) Serial 14 25 kHz Speech and modems TLC32044 Analog interface (AIC) Serial 14 19.2 kHz Speech and modems TLC32040 Analog interface (AIC) Serial 14 19.2 kHz Speech and modems TLC34075/6 Video palette Parallel Triple 8 135 MHz Graphics TLC34058 Video palette Parallel Triple 8 135 MHz Graphics TLC5502/3 Flash ADC Parallel 8 20 MHz Video TLC5602 Video DAC Parallel 8 20MHz Video TLC5501 Flash ADC Parallel 6 20MHz Video TLC5601 Video DAC Parallel 6 20 MHz Video TLC1550/1 ADC Parallel 10 150 kHz Servo ctrl I speech TLC32071 Analog interface (AIC) Parallel 8 1 MHz Servo ctrl I disk drive Dual audio DAC+ digital 32, 37.8, Digital audio TMS57013/4 Serial 16/18 filter 44.1, 48 kHz Table G-2. Switched-Capacitor Filter /Cs Device Function Order Roll-Off Power Out Power Down TLC2470 Differential audio filter amplifier 4 5 kHz 500mW Yes TLC2471 Differential audio filter amplifier 4 3.5 kHz 500mW Yes CLK+ 50 TLC10/20 General-purpose dual filter 2 N/A No CLK+ 100 CLK+ 50 TLC04/14 Low pass, Butterworth filter 4 N/A No CLK+ 100 For application assistance or additional information, please call Tl Linear Applications at (214) 997-3772. G-4 Analog Interface Peripherals and Applications Telecommunications Applications G.2 Telecommunications Applications The Tl linear product line focuses on three primary telecommunications appli- cation areas: subscriber instruments (telephones, modems, etc.), central of- fice line card products, and personal communications. Subscriber instruments include the TCM508x DTMF tone encoder family, the TCM 150x tone ringer family, the TCM1520 ring detector, and the TCM3105 FSK modem. Central of- fice line card products include the TCM29Cxx combo (combined PCM filter plus codec) family, the TCM420x subscriber line control circuit family, and the TCM1030/60 line card transient protector. Personal communication (PCN) and cellular products include the TCM320AC3x family of 5-volt voice-band au- dio processors (VBAP). Tl continues to develop new telecom integrated circuits, such as a high-perfor- mance 3-volt combo family for personal communications applications, and an RF power amplifier family for hand-held and mobile cellular phones. System Design Considerations. The size, network complexity, and com- patibility requirements of telecommunications central office systems create demanding performance requirements. Combo voice-band filter performance is typically± 0.15 dB in the passband. Idle channel noise must be on the order of 15 dBrncO. Gain tracking (S/Q) and distortion must also meet stringent re- quirements. The key parameters for a SLIC device are gain, longitudinal bal- ance, and return loss. G-5 Telecommunications Applications Figure G-4. Typical DSP/Combo Interface TMS320C25 16 -::- GND TCM320AC36 DR J1 13 DOUT 20 kQ 8 18 DX E11 DIN AN LG IN Codec 19 IN MIC_GS CLKX A9 14 DCLKX 20 kQ FSX EAR A 2 Codec 9 - 3 OUT CLKR FSA EAR B 12 FSA FSX 5 11 Voo 5V CLK 1 kQ PON DCLKR 5V 7 7 10 7 10 1 kQ ENP ENT ENP ENT 15 15 3 A RCO 3 A RCO 4 B 4 B 5 c U1 5 c U2 6 D 6 D 2.048 MHz -::- 1 748161 9 -::- 1 748161 9 .------! D,_________, R'S CCR CCR 390 Q Y1 390 Q ~ CLK 1 kQ CK 1 kQ AS 2 +5V 2 +5V 54 3 ·---4t---L-------_-_-_-_-_-__,-+---.J.._-----4Kl SCSI RAM Buffer Control Data and Control --,.i-....____. Interface Buffer Data Sequencer Separator Disk Drive Motor Servo Controller TMS320C14 Demodulator Address Decode Control Disk Head Select Control TLC32071 To/From Disk Heads Spindle Motor Table G-8 lists analog/digital interface devices used for servo control. Table G-8. Control-Related Devices Function Device Bits Speed Channels Interface ADC TLC1550 10 3-5µs 1 Parallel TLC1551 10 3-5 µs 1 Parallel TLC5502/3 8 50 ns {flash) 1 Parallel TLC0820 8 1.5 µs 1 Parallel TLC1225 13 12 µs 1 (Diff.) Parallel TLC1558 10 3-Sµs 8 Parallel TLC1543 10 21 µs 11 Serial TLC1549 10 21 µs 1 Serial DAC TLC7524 8 9MHz 1 Parallel TLC7628 8 9MHz (Dual) Parallel TLC5602 8 30MHz 1 Parallel 1 µs 8 AIC TLC32071 S{ADC) Parallel 9MHz 1 G-13 Servo Control/Disk Drive Applications Figure G-1 Oshows the interfacing of the TMS320C14 and the TLC32071. Figure G-10. TMS320C14-TLC32071 Interface 00-07 t - - - - - - - - - - - 1 CSCNTAL A2. CSAN' A1 Address Decode Logic WE AO DEN' . - - - - - - 1 RESET DEN' _ _ WE----~ _ ____, TMS320C14 TLC32071 For further information on these servo control products, please call Tl Linear Applications at (214) 997-3772. G-14 Analog Interface Peripherals and Applications Modem Applications For further information or application assistance, please call Tl Linear Applica- tions at (214) 997-3772. Figure G-11. High-Speed V.32 Bis and Multistandard Modem With the TLC320AC01 AIC TLC320AC01 ADC and DAC D A Telephone A Line Echo Canceler Transmitter ADC Serial and RS-232 TMS320C25/C5x DAC l/F 1/0 Control Receiver TLC320AC01 Figure G-11 shows a V.32 bis modem implementation using the TMS320C25 and a TLC320AC01. The upper TMS320C25 performs echo cancellation and transmit data functions, while the lower TMS320C25 performs receive data and timing recovery functions. The echo canceler simulates the telephone channel and generates an estimated echo of the transmit data signal. The TLC320AC01 performs the following functions: Upper TLC320AC01 D/A Path: Converts the estimated echo, as com- puted by the upper TMS320C25, into an analog signal, which is subtracted from the receive signal. Upper TLC320AC01 AID Path: Converts the residual echo to a digital sig- nal for purposes of monitoring the residu- al echo and continuously training the echo canceler for optimum performance. The converted signal is sent to the upper TMS320C25. G-16 Analog Interface Peripherals and Applications Modem Applications Lower TLC320AC01 D/A Path: Converts the upper TMS320C25 transmit output to an analog signal, performs a smoothing filter function, and drives the DAG. Lower TLC320AC01 DIA Path: Converts the echo-free receive signal to a digital signal, which is sent to the lower TMS320C25 to be decoded. Note: Modem Implementation in Figure G-11 The example in Figure G-11 is for illustration only. In reality, one single TMS320C5x DSP can implement high-speed modem functions. G-17 Advanced Digital Electronics Applications for Consumers ~ XlWl~~-------:::::.~..X>~~~~ G.6 Advanced Digital Electronics Applications for Consumers With the extensive use of the TMS320 DSPs in consumer electronics, much electromechanical control and signal processing can be done in the digital do- main. Digital systems generally require some form of analog interface, usually in the form of high-performance ADCs and DACs. Figure G-12 shows the general performance requirements for a variety of applications. Figure G-12. Applications Performance Requirements MSPS 300 s Instrumentation a m 100 p I HDTV n g F 30 Broadcasting e ADTV q DVTR u e n 10 c Fax/PC y Bits 4 5 6 7 8 9 10 Performance/Application Advanced Television System Design Considerations. Advanced Digital Television (ADTV) is a technology that uses digital signal processing to enhance video and audio presentations and to reduce noise and ghosting. Be- cause of these DSP techniques, a variety of features can be implemented, in- cluding frame store, picture-in-picture, improved sound quality, and zoom. The bandwidth requirements remain at the existing 6-MHz television allocation. From the IF(intermediate frequency) output, the video signal is converted by an 8-bit video ADC. The digital output can be processed in the digital domain to provide noise reduction, interpolation or averaging for digitally increased sharpness, and higher quality audio. The DSP digital output is converted back to analog by a video DAC, as shown in Figure G-13. G-18 Analog Interface Peripherals and Applications Advanced Digital Electronics Applications for Consumers Figure G-13. Video Signal Processing Basic System TVIF Amplifier H n ADC TMS320 DSP H J- DAC Buffer Video Signal J 1 CRT j Field System Memory 1--i Controller Clock Generator VCRs, compact disc and DAT players, and PCs are a few of the products that have taken a major position in the marketplace in the last ten years. The audio channels for compact disc and DAT require 16-bit AID resolution to meet the distortion and noise standards. See Figure G-14 for a block diagram of a typi- cal digital audio system. Figure G-14. Typical Digital Audio Implementation Third 384f6 128f8 Overtone Oscillator Circuit t-- . ... + ... 1024f6 1fs L L TMS57001 Analog ..... Digital Audio TMS57013/4 Dual 16/18 PWM Analog Sound Data Power Output Bit DAC+ Digital Filter Processor R Amplifier ..... R The motion and motor control systems usually use 8- to 10-bit ADCs for the lower frequency servo loop. Tape or disc systems use motor or motion control for proper positioning of the record or playback heads. With the storage me- dium compressing data into an increasingly smaller physical size, the position- ing systems require more precision. G-19 Advanced Digital Electronics Applications for Consumers ::::..~~.::::.-:::m!l>x:::~~.:::::::::::-w.-<~::.-:::;:..~~~ " \\'«~*'·"«~~~------~~.::x=w~.w..::::w.:s::::x:::~.wMY..x:!'.::::::::--::::x::::::::mx::::>"/.«:::x-;-;:;:;:: The audio processing becomes more demanding as higher fidelity is required. Better fidelity translates into lower noise and distortion in the output signal. The TMS57013DW/57014DW 1-bit digital-to-analog converters (DAC) in- clude an 8 times over sampling digital filter designed for digital audio systems, such as CDPs, DATs, CDls, LDPs, digital amplifiers, car stereos, and BS tun- ers. They are also suitable for all systems that include digital sound processing like TVs, VCRs, musical instruments, NICAM systems, multimedia, etc. The converters have dual channels so that the right and left stereo signals can be transformed into analog signals with only one chip. There are some func- tions that allow the customers to select the conditions according to their appli- cations, such as muting, attenuation, de-emphasis, and zero data detection. These functions are controlled by external 16-bit serial data from a controller like a microcomputer. The TMS5703DW/57014DW adopt 129-tap FIR filter and third-order !J. L mod- ulation to get -75-dB stop band attenuation and 96-dB SNR. The output is PWM wave, which facilitates analog signal through a low-pass filter. Table G-10 lists Tl products for analog interfacing to digital systems. Table G-1 O. AudioNideo Analog/Digital Interface Devices Function Device Bits Speed Channels Interface Dual audio DAC+ digital filter TMS57013/4 16/18 32, 37.8, 2 Serial 44.1, 48 kHz Analog interface TLC32071 ND 8 2 µS 8 Parallel DIA 8 15 µS 1 Parallel ND TLC1225 12 12 µS 1 Parallel ND TLC1550 10 6 µS 1 Parallel Video D/A TLC5602 8 50 ns 1 Parallel Video D/A TL5602 8 50 ns 1 Parallel Triple video D/A TL5632 8 16 ns 3 Parallel Triple flash ND TLC5703 8 70 ns 3 Parallel Flash ND TLC5503 8 100 ns 1 Parallel Flash ND TLC5502 8 50 ns 1 Parallel For further information or application assistance, please call Tl Linear Applica- tions at (214) 997-3772. G-20 Analog Interface Peripherals and Applications Memories Converters H.1 Memories and Analog Converters This section provides product information for EPROM memories, codecs, ana- log interface circuits, and ND and D/A converters. All of these devices can be interfaced with TMS320C2x processors (see Chapter 6 for hardware interface designs). Refer to Digital Signal Processing Applications with the TMS320 Family for additional information on interfaces using memories and analog conversion devices. The following paragraphs give the name of each device and where the data sheet for that device is located in order to obtain further specification informa- tion if desired. Data sheets for EPROM memories are located in the MOS Memory Data Book (literature number SMYD008). TMS27C64 TMS27C128 TMS27C256 TMS27C512 Another EPROM memory, TMS27C291 /292, is described in a data sheet ((lit- erature number SMLS291A). The TCM29C13/14/16/17 codecs and filters are described in the data sheet beginning on page 2-111 of the Telecommunications Circuits Data Book (liter- ature number SCT001). An analog interface for the DSP using a codec and filter is provided by the TCM29C18/19 data sheet (literature number SCT021). The data sheet for the TLC32040 analog interface circuit is provided in the In- terface Circuits Data Book (literature number SLYD002). In the same book are data sheets for ND and D/A converters. The names of the devices are as follows: TLC0820 TLC1205/1225 TLC7524 H-2 Memories, Analog Converters, Sockets, and Crystals Sockets H.2 Sockets The sockets produced by Texas Instruments are designed tor high-density packaging needs. The production sockets and burn-in/test sockets for PGA, PLCC, and CER-QUAD packages are compatible with the TMS320C2x devices. For additional information about Tl sockets, contact the nearest Tl sales office or: Texas Instruments Incorporated Connector Systems Dept, M/S 14--3 Attleboro, MA 02703 (617) 699-5242/5269 Telex: 92-7708 H-3 Crystals H.3 Crystals This section lists the commonly used crystal frequencies, crystal specification requirements, and the names of suitable vendors. Table H-1 lists the commonly used crystal frequencies and the devices with which they can be used. Table H-1. Commonly Used Crystal Frequencies Device Frequency TMS320C25 40.96 MHz When connected across X1 and X2/CLKIN of the TMS320 processor, a crystal enables the internal oscillator; see Figure F-1 . The frequency of CLKOUT is one-fourth the crystal fundamental frequency. Crystal specification require- ments are listed below. Load capacitance = 20 pF Series resistance = 30 ohm Power dissipation = 1 mW Parallel resonant crystals of 20 MHz and below use fundamental mode. 25-MHz operation may require a third-overtone crystal. 40-MHz operation requires a third-overtone crystal. Figure H-1. Crystal Connection X1 X2/CLKIN Crystal -10- The TMS320C25 operating at 40.96 MHz requires a parallel-resonant third- overtone oscillator (see subsection 6.1 .2 for a detailed description of this oscil- lator design). If a packed clock oscillator Is used, oscillator design is of no con- cern. H-4 Memories, Analog Converters, Sockets, and Crystals Crystals Vendors of crystals suitable for use with TMS320 devices are listed below. RXD, Inc. Norfolk, NB (800) 228-8108 N.E.L. Frequency Controls, Inc. Burlington, WI (414) 763-3591 CTS Knight, Inc. Contact the local distributor. H-5 H-6 Memories, Analog Converters, Sockets, and Crystals Appendix I ROM Codes The size of a printed circuit board must be considered in many DSP applica- tions. To fully utilize the board space, Texas Instruments offers two options that reduce the chip count and provide a single-chip solution to its customers. These options incorporate 4K words of on-chip program from either a mask programmable ROM or an EPROM. This allows the customer to use a code- customized processor for a specific application while taking advantage of the following: O Greater memory expansion O Lower system cost O Less hardware and wiring 0 Smaller PCB If used often, the routine or entire algorithm can be programmed into the on- chip ROM of a TMS320 DSP. TMS320 programs can also be expanded by us- ing external memory; this reduces chip count and allows for a more flexible program memory. Multiple functions are easily implemented by a single de- vice, thus enhancing system capabilities. TMS320 Development Tools are used to develop, test, refine, and finalize the algorithms. The microprocessor/microcomputer (MP/MC) mode is available on all ROM-coded TMS320 DSP devices when accessing either on-chip or off- chip memory is required. The microprocessor mode is used to develop, test, and refine a system application. In this mode of operation, the TMS320 acts as a standard microprocessor by using external program memory. When the algorithm has been finalized, the designer may submit the code to Texas Instruments for masking into the on-chip program ROM. At that time, the TMS320 becomes a microcomputer that executes customized programs out of the on-chip ROM. Should the code need changing or upgrading, the TMS320 may once again be used in the microprocessor mode. This shortens the field upgrade time and avoids the possibility of inventory obsolescence. Figure 1-1 illustrates the procedural flow for TMS320 masked parts. When or- dering, there is a one-time/nonrefundable charge for mask-tooling. A minimum production order per year is required for any masked-ROM device. ROM codes will be deleted from the Tl system one year after the last delivery. A digital signal processor with the EPROM option is the solution for low-volume production orders. The EPROM option allows for form-factor emulation .. F.ield upgrades and changes are possible with the EPROM option. 1-1 ROM Codes Figure 1-1. TMS320 ROM Code Flowchart Customer TMS320 Design Customer Submits: - TMS320 New Code Release Form - Print Evaluation and Acceptance Form (PEAF) - Purchase Order for Mask Charge Prototypes - TMS320 Code Texas Instruments Responds: - Customer Code Input into Tl System - Code Sent Back to Customer for Verification No Tl Produces Prototypes No ~MS320 ( --- ---- Production ) 1-2 ROM Codes ROM Codes A TMS320 ROM code may be submitted in one of the following formats (the preferred media is 5 1/4-in floppies): 5 1/4-in Floppy: Tl-tagged or COFF format from cross-assembler EPROM (TMS320): TMS320E14, TMS320E15, TMS320E17, TMS320E25 EPROM (others): TMS27C64 PROM: TBP28S166,TBP28S86 Modem (BBS): Tl-tagged or COFF format from cross-assembler When a code is submitted to Texas Instruments for masking, the code is refor- matted to accommodate the Tl mask generation system. System-level verifi- cation by the customer is therefore necessary. Although the code has been re- formatted, it is important that the changes remain transparent to the user and do not affect the execution of the algorithm. The formatting changes involve the removal of address relocation information (the code address begins at the base address of the ROM in the TMS320 device and progresses without gaps to the last address of the ROM on the TMS320 device) and the addition of data in the reserved locations of the ROM for device ROM test. Note that because these changes have been made, a checksum comparison is not a valid means of verification. With each masked device order, the customer must sign a disclaimer stating: "The units to be shipped against this order were assembled, for expediency purposes, on a prototype (that is, non-production qualified) manufacturing line, the reliability of which is not fully characterized. Therefore, the antici- pated inherent reliability of these prototype units cannot be expressly de- fined." and a release stating: "Any masked ROM device may be resymbolized as Tl standard product and resold as though it were an unprogrammed version of the device at the convenience of Texas Instruments." Contact the nearest Tl Field Sales Office for more information on procedures, leadtimes, and cost. 1-3 1-4 ROM Codes Reliability Stress Tests :x:i:>. .:::x:~.'**:JW::::~~™~~.«----JW',::mw/~...::;w,;t,_,_ _ _,~~~~::::=:::m-~~.Y.«~~&W~~7..:::;-.::::::;..:::::::::::¥.@?..0::: ... J.1 Reliability Stress Tests Accelerated stress tests are performed on new semiconductor products and process changes to ensure product reliability excellence. The typical test envi- ronments used to qualify new products or major changes in processing are: D High-temperature operating life D Storage life D Temperature cycling D Biased humidity D Autoclave D Electrostatic discharge D Package integrity D Electromigration O Channel-hot electrons (performed on geometries less than 2.0µm). Typical events or changes that require internal requalification of product in- clude: O New die design, shrink, or layout O Wafer process (baseline/control systems, flow, mask, chemicals, gases, dopants, passivation, or metal systems) O Packaging assembly (baseline control systems or critical assembly equipment) O Piece parts (such as lead frame, mold compound, mount material, bond wire, or lead finish) O Manufacturing site. Tl reliability control systems extend beyond qualification. Total reliability con- trols and management include a product reliability monitor and final product release controls. MOS memories, utilizing high-density active elements, serve as leading indicators in wafer-process integrity at Tl MOS fabrication sites, en- hancing all MOS logic device yields and reliability. Thousands of logic devices per month are randomly tested to ensure product reliability and excellence. J-2 Quality and Reliability Reliability Stress Tests '::::i:::::::::~~~~m~~:;,,,;*;e1$$i»>x::xm::::m~-::::x~~~~m~~~~X'«=~::::".::x::::::~mx-.::=::::-;:::;x;:V..::::::x-m::::::::::::iw..::::-.:::::-».:~:~w.,:,::;::-;w-;::::t>"..:::::::>"..>."'"..::•~:,:,;,<::::::.-::~:::::: Table J-1 lists the microprocessor and microcontroller reliability tests, the duration of the test, and sample size. The following terms define or describe these tests: AOQ (Average Outgoing Quality) Amount of defective product in a population, usu- ally expressed in terms of parts per million (PPM). FIT (Failure in Time) Estimated field failure rate in number of failures per billion power-on device hours; 1000 FIT = 0.1 % failure per 1000 device hours. Operating lifetest Device dynamically exercised at a high ambient temperature (usually 125°C) to simulate field usage that would expose the device to a much lower ambient temperature (such as 55°C). Using a derived high temperature, a 55° C ambient fail- ure rate can be calculated. High-temperature storage Device exposed to 150°C unbiased condition. Bond integrity is stressed in this environment. Biased humidity Moisture and bias used to accelerate corrosion- type failures in plastic packages. Conditions must include 85°C ambient temperature with an 85% relative humidity (RH). Typical bias voltage is +5V and ground on alternating pins. Autoclave (pressure cooker) Plastic-packaged devices exposed to moisture at 121 ° C using a pressure of one atmosphere above normal pressure. The pressure forces moisture permeation of the package and accelerates corro- sion mechanisms (if present) on the device. Exter- nal package contaminants can also be activated and caused to generate inter-pin current leakage paths. Temperature cycle Device exposed to severe temperature extremes in an alternating fashion (-65°C for 15 minutes and 150°C for 15 minutes per cycle) for at least 1000 cycles. Package strength, bond quality, and consistency of assembly process are stressed in this environment. Thermal shock Test similar to the temperature cycle test, but in- volving a liquid-to-liquid transfer, per MIL- STD-883C, Method 1011. PINO Particle Impact Noise Detection test. A nonde- structive test to detect loose particles inside a de- vice cavity. J-3 Reliability Stress Tests Mechanical Sequence: Fine and gross leak Per MIL-STD-883C, Method 1014.5 Mechanical shock Per MIL-STD-883C, Method 2002.3, 1500g, 0.5 ms, Condition B PINO (optional) Per MIL-STD-883C, Method 2020.4 Vibration, variable frequency Per MIL-STD-883C, Method 2007.1, 20g, Condition A Constant acceleration Per MIL-STD-883C, Method 2001.2, 20 kg, Condition D, Y1 Plane min Fine and gross leak Per MIL-STD-883C, Method 1014.5 Electrical test To data sheet limits Thermal Sequence: Fine and gross leak Per MIL-STD-883C, Method 1014.5 Solder heat (optional) Per MIL-STD-750C, Method 1014.5 Temperature cycle Per MIL-STD-883C, Method 1010.5, (1 O cycles minimum) -65 to +150°C, Condition C Thermal shock Per MIL-STD-883C, Method 1011.4, (1 O cycles minimum) -55 to +125°C, Condition B Moisture resistance Per MIL-STD-883C, Method 1004.4 Fine and gross leak Per MIL-STD-883C, Method 1014.5 Electrical test To data sheet limits Thermal/Mechanical Sequence: Fine and gross leak Per MIL-STD-883C, Method 1014.5 Temperature cycle Per MIL-STD-883C, Method 1010.5, (1 O cycles minimum) -65 to +150°C, Condition C Constant acceleration Per MIL-STD-883C, Method 2001.2, 30 kg, Y1 Plane Fine and gross leak Per MIL-STD-883C, Method 1014.5 Electrical test To data sheet limits Electrostatic discharge Per MIL-STD-883C, Method 3015 Solderability Per MIL-STD-883C, Method 2003.3 Solder heat Per MIL-STD-750C, Method 2031, 10 sec Salt atmosphere Per MIL-STD-883C, Method 1009.4, Condition A, 24 hrs min Lead pull Per MIL-STD-883C, Method 2004.4, Condition A Lead integrity Per MIL-STD-883C, Method 2004.4, Condition 81 J-4 Quality and Reliability Reliability Stress Tests ~~~.:::::::-.;:::::::::,:,::::..~::::::::::r..:::;::::::;::::::::::~:::,;-:y..,:,:,:.-,,:,._,..,:..:,:ww~:%:::::=:::::::::;i:::::::;:::::;-;::f.:::::;::,:f.::::;:,:,,:,:::::~:::::::<-:<-:::'~-:::W..X::::X:::::::'®'=-=----~.::::::X-.<®'.::::X:~.W--M'f.m:!>X::'::::~::::r.~~~.:::::X~«-~~WM~ Electromigration Accelerated stress testing of con- ductor patterns to ensure acceptable lifetime of power-on operation Resistance to solvents Per MIL-STD-883C, Method 2015.4 Table J-1. Microprocessor and Microcontroller Tests Test Duration Sample Size Plastic Ceramic Operating life, 125°C, 5.0 V 1000 hrs 129 129 Operating life, 150°C, 5.0 V 1000 hrs 77t 77 Storage life, 150°C 1000 hrs 77 77 Biased 85°C/85 percent RH, 5.0 V 1000 hrs 129 - Autoclave, 121°C, 1 ATM 240 hrs 77 - Temperature cycle, -65 to 150°C 1000 eye 129 129 Thermal shock, -65 to 150°C 500 eye 77 77 Electrostatic discharge ± 2 kV 15 15 Latch-up (CMOS devices only) 5 5 Mechanical sequence - 38 Thermal sequence - 38 Thermal/mechanical sequence - 38 PINO - 45 Internal water vapor - 3 Solderability 22 22 Solder heat 22 22 Resistance to solvents 15 15 Lead integrity 15 15 Lead pull 22 - Lead finish adhesion 15 15 Salt atmosphere 15 15 Flammability (UL94-VO) 3 - Thermal impedance 5 5 t If junction temperature does not exceed plasticity of package. Table J-2 provides a list of the TMS320C2x devices, the approximate number of transistors, and the equivalent gates. The numbers have been determined from design verification runs. Table J-2. TMS320C2x Transistors Device # Transistors #Gates CMOS: TMS320C25 160K 40K TMS320E25 160K 40K TMS320C26 160K 40K Tl qualification test updates are available upon request at no charge. Tl will consider performing any additional reliability test(s), if requested. For more in- formation on Tl quality and reliability, programs, contact the nearest Tl Field Sales Office. J-5 J-6 Quality and Reliability Appendix K 111111m 1 111 w111 . 111 Development Support mm um1mnu 1 1 1 m im un 1111m1mu ni m mim 1 umuw Texas Instruments offers an extensive line of development tools for the TMS320C2x generation of DSPs, including tools to evaluate the performance of the processors, generate code, develop algorithm implementations, and ful- ly integrate and debug software and hardware modules. The following products support development of TMS320C2x-based applica- tions: Code Generation Tools: Optimizing ANSI C compiler (TMS320C25 only) Macro assembler/linker Digital filter design package System Integration and Debug Tools: Simulator Evaluation module (EVM) In-circuit emulator (XDS/22) Analog interface board (AIB2) Each TMS320C2x support product is described in the TMS320 Family Devel- opment Support Reference Guide (literature number SPRU011 C). In addition, more than 100 TMS320 third-party developers provide support products to complement Tl's offering. For more information on third-party support refer to the TMS320 Third Party Reference Guide (literature number SPRU052A). To request a copy of either document, contact the Tl Literature Response Center at (800) 477-8924. For information on pricing and availability, contact the nearest Tl Field Sales Office or authorized distributor. K-1 Device and Development Support Tool Nomenclature K.1 Device and Development Support Tool Nomenclature To designate the stages in the product development cycle, Texas Instruments assigns prefixes to the part numbers of all TMS320 devices and support tools. Each TMS320 member has one of three prefixes: TMX, TMP, and TMS. Texas Instruments recommends two of three possible prefix designators for its sup- port tools: TMDX and TMDS. These prefixes represent evolutionary stages of product development from engineering prototypes (TMX!TM DX) through fully qualified production devices/tools (TMS/TMDS). This development flow is de- fined below. Device Development Evolutionary Flow: TMX Experimental device that is not necessarily representative of the final device's electrical specifications. TMP Final silicon die that conforms to the device's electrical specifications but has not completed quality and reliability verification. TMS Fully qualified production device. Support Tool Development Evolutionary Flow: TMDX Development support product that has not yet completed Texas Instruments internal qualification testing. TMDS Fully qualified development support product. TMX and TMP devices and TMDX development support tools are shipped against the following disclaimer: "Developmental product is intended for internal evaluation purposes." TMS devices and TMDS development support tools have been fully character- ized, and the quality and reliability of the device has been fully demonstrated. Texas Instruments standard warranty applies. Note: Predictions show that prototype devices (TMX or TMP) will have a greater failure rate than the standard production devices. Texas Instruments recom- mends that these devices not be used in any production system because their expected end-use failure rate is still undefined. Only qualified produc- tion devices are to be used. Tl device nomenclature also includes a suffix with the device family name. This suffix indicates the package type (for example, N, FN, or GB) and temper- ature range (for example, L). Figure K-1 provides a legend for reading the complete device name for any TMS320 family member. K-2 Development Support Device and Development Support Tool Nomenclature Figure K-1. TMS320 Device Nomenclature TMS 320 C 25 GB L PREFIX-------' l___TEMPERATURERANGE TMX = experimental device H = o to 50°c TMP = prototype device L = oto 10°c TMS = qualified device s =-55 to 1oo•c SMJ = MIL-STD-883C M = -55 to 125•c A = -40 to 85°C PACKAGE TYPE DEVICE FAMILY------' N = plastic DIP 320 = TMS320 Family J = ceramic CEA-DIP JD = ceramic DIP side-brazed GB = ceramic PGA TECHNOLOGY.------~ FZ = ceramic CEA-QUAD C=CMOS FN = plastic leaded CC E = CMOS EPAOM FD= ceramic leadless CC QFP = quad flat pack DEVICE C1x DSP: 10 14 15 16 17 C2x DSP: 25 26 28 C3x DSP: 30 31 C4x DSP: 40 C5x DSP: 50 51 53 K-3 Device and Development Support Tool Nomenclature Figure K-2 provides a legend for reading the part number for any TMS320 hardware or software development tool. Figure K-2. TMS320 Development Tool Nomenclature TMDS 32 4 28 1 0 - 0 2 QUALIFICATION STATUSJ LMEDIUMt TMDX =prototype 2 = 5-1/4" floppy disk TMDS = qualified 8 = 1600 BPI magnetic tape DEVICE FAMILY - - - - - ' S/WFORMATt 32 = TMS320 family o = object code 1 = source code PRODUCT T Y P E - - - - - - - ' SEQUENCE NUMBER* 4 =software 6 =hardware 8 =upgrade MODEL*---------~ GENERATION* 11 = XDS/11 1 = C1x 22 =XDS/22 2 = C2x 88 = upgrade kits 3 =C3x 4=C4x 5=C5x OPERATING SYSTEMt - - - - - - ' ....___ _ _ FORMATt 02 = C1x VAXNMS 1 =Tl-tagged 08 = C1x IBM MS/PC-DOS 5 = COFF 22 = C2x VAXNMS 28 = C2x IBM MS/PC-DOS 32 = C3x VAXNMS 38 = C3x IBM MS/PC-DOS 42 = C4x VAXNMS 48 = C4x IBM MS/PC-DOS 52 = C5x VAXNMS 58 = C5x IBM MS/PC-DOS t Software only. :j: Hardware only. K-4 Development Support Index analog interface peripherals advanced digital applications, G-18-G-20 audio/video analog/digital interface devices, AID interface, 6-43-6-45 G-20 A-law, 5-68 digital audio, G-19 video signal processing, G-19 ABS, 4-23 applications, G-1-G-20 ACC, 3-9 disk drive applications, G-12-G-14 modem applications, G-15-G-17 accumulator, 3-9, 3-30 data converters, G-15 carry bit, 3-31 multimedia, G-2-G-4 adapter socket. See EPROM programmer modem communication, G-3 adaptive filtering, 5-71 related devices, G-4 speech encoding, G-3 ADD, 4-25 system design consideration, G-2 ADDC, 4-27 servo control, G-12-G-14 related devices, G-13 ADDH, 4-29 speech synthesis, G-10 addition, 3-31 development tools, G-11 'C25 and 'C26, 5-64 memory, G-10 ADDK, 4-9, 4-31 voice synthesizers, G-10 telecommunications, G-5-G-9 address bus, 3-9 generalapplicailons, G-9 address bus (A15-AO), 2-4 related devices, G-7 telecom devices, G-8 addressing modes, 3-25, 3-26 direct, 3-25 AND, 4-38 indirect, 3-25 ANDK, 4-9, 4-40 ADDS, 4-32 APAC, 4-41 application-oriented operations, 5-68 ADDT, 4-34 adaptive filtering, 5-71-5-76 ADLK, 4-9, 4-36 bit-reversed addressing, 5-77 ADRK, 4-9, 4-37 companding, 5-68 fast Fourier transforms, 5-75-5-81 ADTV, G-18 FFT inputs and outputs, 5-76 AFB, 3-9 FFT macros, 5-79 FIR/llR filters, 5-70 AIB2, K-1 PIO control, 5-82 ALU, 3-9, 3-30 applications, 1-8 analog converters, H-2 AR, 3-9, 3-24 lndex-1 Index ARAU, 3-9 ARB, 3-9 8, 4-42 architectural overview, 3-2 arithmetic logic unit (ALU), 3-3 BACC, 4-43 diagram, 3-3 SANZ, 4-44 direct memory access, 3-5 BBNZ, 4-46, 5-45 memory interface, 3-4 BBZ, 4-47, 5-45 multiplier, 3-3 BC, 4-48 multiprocessing, 3-4 BGEZ, 4-49 on-chip memory, 3-2 BGZ, 4-50 serial port, 3-4 BIO, 2-5, 4-56 architecture, 3-1 BIOZ, 4-51 arithmetic logic unit (ALU), 3-3, 3-9, 3-30 BIT, 4-52, 5-44, 5-45 arithmetic operations, 5-46-5-67 bit manipulation, 5-44 division, 5-57-5-59 bit-reversed (BR) addressing, 5-77 using SUBC, 5-57-5-59 BITT, 4-54, 5-45 extended-precision arithmetic, 5-62-5-67 BLEZ, 4-56 addition, 5-64 BLKD, 3-27, 4-57, 5-33 multiplication, 5-66 BLKP, 4-60, 5-33 subtraction, 5-65 block BO, 5-38 floating-point, 5-60-5-62 denormalization, 5-61 block diagram 'C26, 3-8 using LACT, 5-61 'C2x, 3-7 using NORM, 5-61 indexed addressing, 5-62 block moves, 3-27, 5-33 moving data, 5-51 BLZ, 4-63 using MACO, 5-52 BNC, 4-64 multiplication, 5-53-5-57 BNV, 4-65 measuring efficiency, 5-55 BNZ, 4-66 using LTA-MPY, 5-54 bootloader, 5-6-5-21 using MAC, 5-54 configuration words using SQRA, 5-57 BAUD DETECT, 5-13 overflow management, 5-46 CHECKSUM, 5-10, 5-14 scaling, 5-47 INTERRUPT, 5-9, 5-14 shifting data, 5-47-5-50 PROGRAM LENGTH, 5-9, 5-14 bit-reversed carry addition, 5-48 PROGRAM WORD, 5-10, 5-14 FFT bit reversals, 5-48 STATUS, 5-9, 5-13 other applications, 5-49 SYNCHRONIZATION, 5-10, 5-15 ARP, 3-9 external memory (EPROM) download, 5-15-5-21 byte ordering, 5-16 assembly language instructions, 4-1 parallel download, 5-6-5-10 auxiliary register, arithmetic unit, 3-9 16-bit transfer sequence, 5-8 8-bit transfer sequence, 5-8 auxiliary registers, 3-9, 3-22-3-25 810-XF handshake example, 5-7 bus, 3-9 810-XF transfer protocol, 5-7 pointer, 3-9 configuration words, 5-9, 5-13-5-15 pointer buffer, 3-9 program length, 5-9 lndex-2 Index bootloader (continued), 5-6-5-21 companding, 5-68 serial download, 5-11-5-15 comparison of internal RAM, 3-18 program length, 5-14 computed GOTO, 5-28 RS232 serial link, 5-11 RS232 transfer protocol, 5-12 CONF, 4-77 RS232 transfer sequence, 5-13 configuring on-chip RAM, 5-35-5-37 software listing, 5-17-5-21 diagram, 5-36 types of download, 5-6 example, 5-37, 5-39 BR, 2-5 consumer electronics branches, 3-32 advanced digital applications, G-18 BV, 4-67 advanced digital television, G-18 digital audio, G-19 byte mode, ORR operation, 3-69 video signal processing, G-19 BZ, 4-68 context restore, 'C25, 5-31 context save, 'C25, 5-30 context switching, 5-29 continuous mode operation, 3-69-3-74 CAL, 5-22 control circuitry, 6-2 CALA, 4-69, 5-22 crystal oscillator, 6-5 CALL, 4-71 emulator architecture, 6-7-6-10 CALLI, 3-28 powerup reset, 6-2 components of, 3-28--3-34 crystal oscillator circuit, 6-5 central arithmetic logic unit (CALLI), 3-9, 3-28 crystals, H-4 ALU and accumulator, 3-30 frequencies, H-4 components of, 3-28--3-34 specifications, H-4 diagram, 3-29 vendors, H-4 multiplier, 3-32 scaling shifter, 3-30 shift modes, 3-33 T and P registers, 3-32 CLKOUT1 , 2-6, 3-56 m DIA interface, 6-42 CLKOUT2, 2-6, 3-56 DAB, 3-9 CLKR, 2-7 DAC, G-20 CLKX, 2-7 data bus, 2-4, 3-9 clock divider, 'C25, 5-26 data bus (015-00), 2-4, 3-9 clock phases, 3-56 data memory, 3-17 clock timing, 3-56 data moves, 3-27, 5-51 CMPL,4-73 data pointer, 3-9 CMPR,4-74 data sheets CNFD, 4-75 SMJ320C2x, 4-1 CNFP, 4-76 TMS320C25, A-1 code generation tools, K-1 TMS320C26, B-1 assembler/linker, K-1 TMS320C28, C-1 C compiler, K-1 TMS320E25, A-1 digital filter design package, K-1 debugging tools, K-1 combo-codec interface, 6-37-6-40 development support, K-1-K-4 lndex-3 Index development systems, K-1 EPROM programming, F-1 analog interface board (AIB2), K-1 code protection, F-12-F-15 emulator (XDS/22), K-1 data format, F-4 evaluation module (EVM), K-1 erasure, F-7 simulator, K-1 FAST programming, F-7, F-9 development tool nomenclature, K-4 output disable, F-11 device evolution, K-2 pin nomenclature, F-5 program inhibit, F-11 TMP, K-2 TMS, K-2 program verify, F-8 TMX, K-2 programming modes, F-6 programming the RBIT, F-12-F-15 device nomenclature, K-3 protect verify, F-15 digital audio, G-19 RBIT operation, F-14 DINT, 4-78 RBIT side effects, F-14 direct addressing, 4-2 read mode, F-11 diagram, 4-3 SNAP! pulse programming, F-8, F-10 timing, F-11 direct memory access (OMA), 3-5, 3-75 verification, F-4 See also OMA wiring diagram, F-5 DIT, 5-81 EPROMs, 6-22-6-26 division, 5-57-5-59 EVM, K-1 OMA, 3-75, 6-32 EXAMPLE, 4-19 in a PC environment, 6-34 master-slave configuration, 6-33 extended-precision arithmetic, 5-62-5-67 addition, 5-64 DMOV, 3-27, 4-79 multiplication, 5-66 download/bootstrapping mode ('C26). subtraction, 5-65 See bootloader external memory interface, 3-54-3-58 DP, 3-9 clock timing, 3-56 DR, 2-4, 2-7 1/0 pins, 3-56 ORB, 3-9 memory combinations, 3-54 ORR, 3-10 external program/data access, 3-47 OS, 3-16 DSP hotline, ix DX, 2-7 fast Fourier transforms (FFT), 5-75 DXR, 3-10 FAST programming, F-7 flowchart, F-9 · FFT, 5-81 FFT macros, 5-79 echo cancellation, 6-48 FFT requirements, 5-81 EINT, 4-81 filtering, 5-70 emulator (XDS), 6-7 FIR filters, 5-70 bus control, 6-7 floating-point arithmetic, 5-60 miscellaneous considerations, 6-9 denormalization, 5-61 READY and memory substitution, 6-8 using LACT, 5-61 TMS320C25 designs, 6-9 using NORM, 5-61 EPROM, adapter socket, F-2 floating-point multiply, 'C25, 5-61 EPROM programmer, F-2 FORT, 4-82 lndex-4 Index Fourier transforms, 5-75 immediate addressing, 4-8-4-10 framing control, 3-67 IMR, 3-10, 3-60 FSR, 2-7 IN, 4-84, 5-34 FSX, 2-7 indexed addressing, 5-62 functional block diagram, 3-6-3-8 indirect addressing, 4-4-4-8 m arithmetic operations, 4-6 bit fields, 4-7 diagram, 4-4 format examples, 4-8 gates, J-5 symbols used, 4-5 global memory, 3-76, 6-35 types of, 4-5 access timing, 3-77 initialization, 5-2 communication, 6-36 'C25, 5-3 configurations, 3-77 'C26, 5-4 global memory allocation register (GREG), 3-77 examples, 5-3-5-5 global register, 3-9 processor configuration, 5-2 graphics and image processing, 6-50 TMS320C26, download/bootstrapping mode. GREG, 3-9, 3-77 See bootloader ground pin, 2-6 instruction cycle timings, 'C25, 5-2 m instruction register, 3-10 instruction set, 4-11 example, 4-19-4-22 ABS, 4-23 hardware applications, 6-1 ADD, 4-25 direct memory access (OMA), 6-32-6-34 ADDC, 4-27 global memory, 6-35 ADDH, 4-29 interfacing memories, 6-11-6-30 ADDK, 4-31 interfacing peripherals, 6-37-6-47 ADDS, 4-32 system applications, 6-48-6-52 ADDT, 4-34 Harvard architecture, 3-2 ADLK, 4-36 HOLD, 2-5, 3-46, 3-78, 6-9 ADAK, 4-37 hold function, 3-78 AND, 4-38 hold operation, 3-46 ANDK, 4-40 hold timing, 3-80 APAC, 4-41 8, 4-42 HOLDA, 2-5, 3-46, 3-78, 6-9 BACC, 4-43 hotline, ix SANZ, 4-44 BBNZ, 4-46 D 1/0 BBZ, 4-47 BC, 4-48 BGEZ, 4-49 BGZ, 4-50 addressing, 6-46 BIOZ, 4-51 pins, 3-56 BIT, 4-52 ports, 6-46 SITT, 4-54 processor communication, 6-47 BLEZ, 4-56 IACK, 2-5 BLKD, 4-57 IDLE, 4-83 BLKP, 4-60 llR filters, 5-70 BLZ, 4-63 lndex-5 Index instruction set (continued), 4-11 instruction set (continued), 4-11 BNC, 4-64 OUT, 4-131 BNV, 4-65 PAC, 4-132 BNZ, 4-66 POP, 4-133 BV, 4-67 POPD, 4-134 BZ, 4-68 PSHD, 4-135 CALA, 4-69 PUSH, 4-136 CALL, 4-71 RC, 4-137 CMPL, 4-73 RET, 4-138 CMPR,4-74 RFSM, 4-139 CNFD, 4-75 RHM, 4-140 CNFP, 4-76 ROL, 4-141 CONF,4-77 ROR, 4-142 DINT, 4-78 ROVM, 4-143 DMOV,4-79 RPT, 4-144 EINT, 4-81 RPTK, 4-145 FORT, 4-82 RSXM, 4-146 IDLE, 4-83 RTC, 4-147 IN, 4-84 RTXM, 4-148 LAC, 4-85 RXF, 4-149 LACK, 4-86 SACH, 4-150 LACT, 4-87 SACL, 4-151 LALK, 4-89 SAR, 4-152 LAR, 4-90 SBLK, 4-154 LARK, 4-92 SBRK, 4-155 LARP, 4-93 SC, 4-156 LDP, 4-94 SFL, 4-157 LDPK, 4-95 SFR, 4-158 LPH, 4-96 SFSM, 4-159 LALK, 4-97 SHM, 4-160 LST, 4-98 SOVM, 4-161 LST1, 4-100 SPAC, 4-162 LT, 4-103 SPH, 4-163 LTA, 4-104 SPL, 4-164 LTD, 4-106 SPM, 4-165 LTP, 4-108 SORA, 4-166 LTS, 4-109 SQRS, 4-167 MAC, 4-111 SST, 4-168 MACO, 4-114 SST1, 4-170 MAR, 4-117 SSXM, 4-172 MPY, 4-119 STC, 4-173 MPYA, 4-120 STXM, 4-174 MPYK, 4-121 SUB, 4-175 MPYS, 4-122 SUBS, 4-176 MPYU, 4-123 SUBC, 4-177 NEG, 4-125 SUBH, 4-179 NOP, 4-126 SUBK, 4-180 NORM, 4-127 SUBS, 4-181 OR, 4-129 SUBT, 4-182 ORK, 4-130 SXF, 4-183 lndex-6 Index instruction set (continued), 4-11 interrupts, 2-5, 3-46, 3-59-3-62 TBLR, 4-184 external interface, 3-60 TBLW, 4-186 locations, 3-59 TRAP, 4-188 logic diagram, 3-61 XOR, 4-189 operation, 3-59 XORK, 4-190 priorities, 3-59, 5-32 ZAC, 4-191 timing diagram, 3-62 ZALH, 4-192 IR, 3-10 ZALR, 4-193 IS, 2-4 ZALS, 4-194 instruction set summary, 4-13-4-17 special groups, 4-13 instructions accumulator, 4-14 key features, 1-6 auxiliary register/page pointer, 4-15 branch/call, 4-16 control, 4-17 1/0 and memory, 4-16 individual descriptions, 4-18-4-194 II LAC, 4-85 register and multiply, 4-15 LACK, 4-9, 4-86 instrumentation, 6-51 LACT, 4-87 interface LALK, 4-9, 4-89 AIC, 6-4CH>-42 analog-to-digital (AID), 6-43-6-45 LAR, 4-90 combo-codec, 6-37-6-40 LARK, 4-9, 4-92 digital-to-analog (D/A), 6-42 LARP, 4-93 interface timing analysis, 6-29-6-31 LC circuit, 6-5 interfacing memories, 6-11 LDP, 4-94 EPROMs, 6-22-6-26 port, buses, and control signals, 6-11 LDPK, 4-9, 4-95 PROMs, 6-12-6-19 Literature Response Center, ix read and write cycles, 6-12 logical and arithmetic operations, 5-43 SRAMs, 6-26-6-29 long immediate addressing, 4-1 O timing analysis, 6-29-6-31 LPH, 4-96 wait-state generator, 6-19 LRLK, 4-9, 4-97 interfacing peripherals, 6-37 interfacing PROMs, address decoding, 6-12-6-19 LST, 4-98 internal hardware, 3-9-3-11 LST1, 4-100 interrupt, flag register, 3-1 o LT, 4-103 interrupt acknowledge, 2-5 LTA, 4-104, 5-54 interrupt mask register, 3-1 O LTD, 4-106 interrupt mask register (IMR), 3-60 LTP, 4-108 interrupt service routine (ISR), 5-29-5-32 LTS, 4-109 lndex-7 Index multimedia applications, G-2 multimedia-related devices, G-8 µ-law, 5-68 multiplexed external data bus, 3-42 MAC, 4-111 multiplication, 5-53-5-57 'C25, 5-66 MACO, 4-114 multiplier, 3-3, 3-10, 3-32 MACO operation, 5-52 multiprocessing, 3-75-3-81 MAR, 4-117 global memory, 3-76 masked parts, 1-1 hold function, 3-78-3-81 MCS, 3-10 synchronization, 3-75 m memories, H-2 memory 'C26 maps, 3-16, 3-20 'C2x maps, 3-15, 3-19 NEG, 4-125 addressing modes, 4-2 NOP, 4-126 blocks, 3-12, 3-16, 3-17 NORM, 4-127 combinations, 3-54 data, 3-12 numeric processing, 6-51 OMA, 3-5 global, 3-76 interface, 3-4 management, 5-33 organization, 3-12 m on-chip EPROM, 3-12 on-chip memory, 3-2 program, 3-12 on-chip program access, 3-46 memory organization, 3-12 on-chip program execution, example, 5-41 data memory, 3-12 on-chip RAM, 3-12 memory maps, 3-15 configuration, 5-35-5-37 program memory, 3-12-3-14 'C26 diagram, 3-14 configuration diagram, 5-36 program execution, 5-38 'C2xdiagram, 3-13 on-chip ROM, 3-12, 1-1 memory-mapped registers, 3-22 OR, 4-129 microcall stack, 3-10 ORK, 4-9, 4-130 microcall stack (MCS) register, 3-36 oscillator circuit microcomputer mode, 2-5 diagram, 6-5 microprocessor mode, 2-5 LC circuit, 6-5 military data sheets, 0-1 magnitude of impedance, 6-6 modem, 6-48 OUT, 4-131, 5-35 modem applications, G-15 overflow management, 5-46 data converters, G-15 MP/MC, 2-5 MPY, 4-119, 5-54 MPYA, 4-120 P, 3-10 MPYK, 4-9, 4-121 P register (PR), 3-32 MPYS, 4-122 PAB, 3-10 MPYU, 4-123 PAC, 4-132 MSC, 2-6 PC, 3-10 MULT, 3-10 period register, 3-1 o lndex-8 Index PFC, 3-10 PIC,ix PIO control, 5-82 m QIR, 3-10 pin assignments, 2-2 quality and reliability, J-1-J-5 queue instruction register, 3-1 o pinouts, 2-1 pipeline hardware, 3-45 pipeline operation, 3-37-3-47 ADD followed by SACL, 3-41 m R/W, 2-5 branch to on-chip RAM, 3-44 RAM(BO), 3-10 'C25, 3-39 RAM(B1), 3-10 decode, 3-37 execute, 3-37 random access memory fetch, 3-37 data only, 3-1 O instruction sequence, 3-40 data or program, 3-1 o prefetch, 3-37 RBIT, F-12 RET from on-chip RAM, 3-45 RC, 4-137 three-level, 3-38 read only memory, 3-1 o two-level, 3-38 READY, 2-4 wait states, 3-41 registers with external data bus conflict, 3-43 auxiliary, 3-22 PLCC/CLCC adapter socket, F-2 DAR, 3-64 POP, 4-133 DXR, 3-64 indirect addressing, 3-23 POPD, 4-134 memory-mapped, 3-22 powerdown modes ('C25), 3-53 serial port, 3-63 powerup reset, 6-2-6-4 reliability stress tests, J-2 microcontroller tests, J-5 PR, 3-10 microprocessor tests, J-5 PRO, 3-10 test environments, J-2 prefetch counter, 3-10 types of tests, J-3 processors overview, 1-4 repeat counter, 3-1 0 Product Information Center, ix repeat counter (RPTC), 3-53 reset, 2-6, 3-46, 3-47 product register, 3-1 O reset circuit, 6-2-6-4 program bus, 3-1 o diagram, 6-3 program control, 5-22 RET, 4-138 program counter (PC), 3-10, 3-35, 3-43 RFSM, 4-139 program execution, 5-38 RHM, 4-140 robotics, 6-51 program memory, 3-17 address bus, 3-1 O ROL, 4-141 ROM, 3-10 program verify, F-8 ROM code flowchart, 1-2 PS, 2-4 ROM code media, 1-3 PSHD, 4-135 ROM codes, 1-1-1-3 pulse programming, F-8 ROM protect bit, F-12 PUSH, 4-136 ROR, 4-142 lndex-9 Index ROVM, 4-143 short immediate addressing, 4-9 RPT, 4-144, 5-27 signal descriptions, 2-4-2-7 RPTC, 3-10 single-instruction loops, 5-26 RPTK, 4-9, 4-145 SMJ320C2x, data sheets, D-1 RS, 2-6 SNAP! pulse programming, F-8 RSR, 3-11 flowchart, F-1 0 RSXM, 4-146 sockets, H-3 RTC, 4-147 software stack, 5-24 RTXM, 4-148 software stack expansion, 5-24 RXF, 4-149 SOVM, 4-161 SPAC, 4-162 speech development tools, G-11 memories, G-1 o SACH, 4-150 synthesis applications, G-1 O SACL, 4-151 SPH, 4-163 SAR, 4-152 SPL, 4-164 SBLK, 4-9, 4-154 SPM, 4-165 SBRK, 4-9, 4-155 SQRA, 4-166, 5-57 SC, 4-156 SQRS, 4-167 scaling, 5-47 SST, 4-168 scaling shifter, 3-30 SST1, 4-170 second generation devices, 1-2 SSXM, 4-172 serial port, 3-4, 3-63-3-74 STO, 3-11, 3-49 block diagram, 3-65 ST1I3-11, 3-49 burst mode, 3-68 stack, 3-11, 3-35 continuous mode, 3-69-3-74 data receive register, 3-10 static RAMs, 6-26-6-29 data transmit register, 3-1 0 status registers, 3-49 framing, 3-67 data processing, 5-43 receive timing diagram, 3-67 field definitions, 3-50 registers, 3-63 temporary register, 3-11 shift register, 3-11 STC, 4-173 timing, 3-67 STRB, 2-5 transmit and receive, 3-65-3-67, 3-68, 3-70 STXM, 4-174 transmit shift register, 3-11 SUB, 4-175 transmit timing diagram, 3-66 SUBB, 4-176 servo control/disk drive applications, G-12 SUBC, 4-177 servo control-related devices, G-13 fractional division, 5-59 SFL, 4-157 integer division, 5-59 SFR, 4-158 SUBH, 4-179 SFSM, 4-159 SUBK, 4-9, 4-180 shift modes, 3-33 subroutines, 5-22 shifters, 3-11 example, 5-22 shifting data, 5-47-5-50 SUBS, 4-181 SHM, 4-160 SUBT, 4-182 lndex-10 Index supply voltage pin, 2-6 timing support tool evolution BIO, 3-57 TMDS, K-2 external flag (XF), 3-58 TMDX, K-2 memory, 3-80 support tools nomenclature, K-2 timing control, 3-67 SXF, 4-183 TLC32046, G-3 symbols, 3-1 o TLC32070, G-14 symbols and abbreviations, 4-11-4-13 TMS320C25, 1-4 data sheets, A-1 SYNC, 2-5, 3-75 TMS320C25-33, 1-4 synchronization, 3-75 timing ('C25), 3-76 TMS320C25-50, 1-4 system applications, 6-48 TMS320C26, 1-4 echo cancellation, 6-48 data sheet, B-1 graphics and image processing, 6-50 TMS320C26 block diagram, 3-8 high-speed control, 6-51 TMS320C26 description, instrumentation, 6-51 TMS320C28, 1-1-1-7, 2-3, modem, 6-48 data sheet, C-1 numeric processing, 6-51 TMS320C2x, instruction cycle timings, E-2 voice coding, 6-49 TMS320C2x block diagram, 3-7 system control, 3-35--3-53 See also control circuitry TMS320E25, 1-4 'C25 powerdown modes, 3-53 TR, 3-11 diagram, 3-35 transistors, J-5 hardware stack, 3-35 TRAP, 4-188 pipeline operation, 3-37--3-47 program counter, 3-35 two-word instructions, 3-43 m repeat counter, 3-53 reset, 3-47 status registers, 3-49--3-52 timer, 3-52 user design considerations, 6-7-6-10 II T register (TR), 3-32 vcc, 2-6 TBLR, 4-184, 5-34 video signal processing, G-19 TBLW, 4-186, 5-34 voice coding, 6-49 telecom devices, G-8 voice synthesizers, G-1 O telecommunications applications, G-5 vss, 2-6 DSP/combo, G-6 temporary register, 3-11 TIM, 3-11 TIM register, 3-52 wait-state generator, 6-19 timer, 3-11, 5-25 design, 6-21 timer block diagram, 3-52 memory/peripheral access, 6-20 timer operation, 3-52 timing, 6-22 lndex-11 Index 13 X1, 2-6 "ZAC, 4-191 X2/CLKIN, 2-6 "ZALH 4-192 I XDS/22, K-1 "ZALR, 4-193 XF, 2-6, 3-56 "ZALS, 4-194 XOR, 4-189 XORK, 4-9, 4-190 XSR, 3-11 lndex-12 OREGON: Beaverton: 6700 S.W. 105th Street, JAPAN: Texas Instruments Japan Ltd., Aoyama TI Worldwide Suite 110, Beaverton, OR 97005, (503) 643-6758. PENNSYLVANIA: Blue Bell: 670 Sentry Parkway, Suite 200, Blue Bell, PA 19422, (215) Fuji Building 3-6-12 Kita-Aoyama Minato-Ku, Tokyo, Japan 107, 03-498-2111; MS Sh1baura Bldg. 9F, 4-13-23 Shibaura, Minato-ku, Tokyo, Sales Offices 825-9500. PUERTO RICO: Halo Rey: 615 Mercantil Plaza Bldg., Suite 505, Halo Rey, PR 00919, (809) Japan 108, 03-769-8700; Nissho-lwai Bldg. 5F, 2-5-8 lmabashi, Chuou-ku, Osaka, Japan 541. 06-204-1881; Dai-ni Toyota Bldg. Nishi-kan 7F, ALABAMA: Huntsville: 4960 Corporate Drive, 4-10-27 Meieki, Nakamura-ku, Nagoya, Japan 753-8700. Suite 150, Huntsville, AL 35805, (205) 837-7530. 450, 052-583-8691; Kanazawa Oyama-cho TEXAS: Austin: 12501 Research Boulevard, ARIZONA: Phoenix: 8825 N. 23rd Avenue, Daiichi Seimei Bldg. 6F, 3-10 Oyama-cha, Austin, TX 78759, (512) 250-6769; Dallas: 7839 Kanazawa-shi, Ishikawa, Japan 920, Suite 100, Phoenix, AZ 85021, (602) 995-1007. Churchill Way, Dallas, TX 75251, (214) 0762-23-5471; Matsumoto Showa Bldg. 6F, CALIFORNIA: Irvine: 1920 Main Street, Suite 917-1264; Houston: 9301 Southwest Freeway, 900, Irvine, CA 92714, (714) 660-1200; San 1-2-11 Fukashi, Matsumoto-shi, Nagano, Japan Commerce Park, Suite 360, Houston, TX 77074, Diego: 5625 Ruffin Road, Suite 100, San Diego, 390, 0263-33-1060; Daiichi Olympic Tachikawa (713) 778-6592; Midland: FM 1788 & 1-20, Bldg. 6F, 1-25-12, Akebono-cho, Tachikawa-shi, CA92123, (619) 278-9600; Santa Clara: 5353 Midland, TX 79711-0448, (915) 561-7137. Betsy Ross Drive, Santa Clara, CA 95054, (408) Tokyo, Japan 190, 0425-27-6760; Yokohama UTAH: Salt Lake City: 2180 South 1300 East, Business Park East Tower 10F, 134 Goudo-cho, 980-9000; Woodland Hills: 21550 Oxnard Suite 335, Salt Lake City, UT 54106, (801) Hodogaya-ku, Yokohama-shi, Kanagawa, Japan Street, Suite 700, Woodland Hills, CA 91367, 466-8972. 240, 045-338-1220; Nihon Seimei Kyoto Yasaka (818) 704-8100. WISCONSIN: Waukesha: 20825 Swenson Bldg. 5F, 843-2, Higashi-Shiokohji-cho, COLORADO: Aurora: 1400 S. Potomac Street, Higashi-iru, Nishinotoh-in, Shiokohji-dori, Drive, Suite 900, Waukesha WI 53186, (414) Suite 101, Aurora, CO 80012, (303) 368-8000. 798-1001. Shimogyo-ku, Kyoto, Japan 600, 075-341-7713; CONNECTICUT: Wallingford: 9 Barnes Sumitomo Seimei Kumagaya Bldg. SF, 2-44 CANADA: Nepean: 301 Moodie Drive, Suite Industrial Park So., Wallingford, CT 06492, (203) Yayoi, Kumagaya-shi, Saitama, Japan 360, 102, Mallorn Centre, Nepean, Ontario, Canada 269-0074. 0485-22-2440; 2597-1, Aza Harudai, Oaza K2H 9C4, (613) 726-1970; Richmond Hill: 280 FLORIDA: Altamonte Springs: 370 S. North Centre Street East, Richmond Hill, Ontario, Yasaka, Kitsuki-shi, Oita, Japan 873, Lake Boulevard, Suite 1008, Altamonte Springs, Canada, L4C 1B1, (416) 884-9181; St. Laurent: 09786-3-3211. FL 32701, (407) 260-2116; Fort Lauderdale: 9460 Trans Canada Highway, St. Laurent, KOREA: Texas Instruments Korea Ltd., 28th 2950 N.W. 62nd Street, Suite 100, Fort Quebec, Canada H4S 1 R7, (514) 335-8392. Floor, Trade Tower, 159, Samsung-Dong, Lauderdale, FL 33309, (305) 973-8502; Tampa: Kangnam-ku Seoul, Korea, 2-551-2800. 4803 George Road, Suite 390, Tampa, FL MALAYSIA: Texas Instruments Malaysia, Sdn. 33634-6234, (813) 885-7588. Bhd., Asia Pacific, Lot 36.1 #Box 93, Menara GEORGIA: Norcross: 5515 Spalding Drive, Maybank, 100 Jalan Tun Perak, 50050 Kuala Norcross, GA 30092-2560, (404) 662-7967. AUSTRALIA (& NEW ZEALAND): Texas Lumpur, Malaysia, 2306001. Instruments Australia Ltd., 6-1 O Talavera Road, ILLINOIS: Arlington Heights: 515 West MEXICO: Texas Instruments de Mexico S.A. de North Ryde (Sydney), New South Wales, Algonquin, Arlington Heights, IL 60005, (708) C.V., Alfonso Reyes 115, Col. Hipodromo Australia 2113, 2-878-9000; 14th Floor, 380 St., 640-2925. Condesa, Mexico, D.F., 06170, 5-515-6081. Kilda Road, Melbourne, Victoria, Australia 3004, INDIANA: Carmel: 550 Congressional Drive, 3-696-1211; 171 Philip Highway, Elizabeth, NORWAY: Texas Instruments Norge AIS. B.P. Suite 100, Carmel, IN 46032, (317) 573-6400; South Australia 5112, 8 696-2066. 106, Reistad (S1nsenveien 53), 0513 Oslo 5, Fort Wayne: 103 Airport North Office Park, Fort Norway, (02) 155 090. BELGIUM: Texas Instruments Belgium Wayne, IN 46825, (219) 489-4697. S.A./N.V., Avenue Jules Bordetlaan 11, 1140 PEOPLE'S REPUBLIC OF CHINA: Texas KANSAS: Overland Park: 7300 College Blvd., Brussels, Belgium, (02) 242 30 80. Instruments China Inc., Beijing Representative Lighton Plaza, Suite 150, Overland Park, KS Office, 7-05 CITIC Building, 19 Jianguomenwai 66210, (913) 451-4511. BRAZIL: Texas lnstrumentos Electronicos do Brasil Ltda., Av. Eng. Luiz Carlos Berrini, Dajie, Beijing, China, 500-2255, Ext. 3750. MARYLAND: Columbia: 8815 Centre Park Dr., 1461-110. andar, 04571, Sao Paulo, SP, Brazil, PHILIPPINES: Texas Instruments Asia Ltd., Suite 100, Columbia, MD 21045, (410) 964-2003. 11-535-5133. Philippines Branch, 14th Floor, Ba-Lepanto MASSACHUSETTS: Waltham: Bay Colony DENMARK: Texas Instruments AIS, Borupvang Building, Paseo de Roxas, Makati, Metro Manila, Corporate Center, 950 Winter Street, Suite 2800, 2D, 2750 Ballerup, Denmark, (44) 68 74 00. Philippines, 2-8176031. Waltham, MA02154, (617) 895-9100. PORTUGAL: Texas Instruments Equipamento FINLAND: Texas Instruments OY, Ahertajantie 3, MICHIGAN: Farmington Hills: 33737 w. 12 P.O. Box 86, 02321 Espoo, Finland, (0) 802 6517. Electronico (Portugal) LOA., Ing. Frederico Mile Road, Farmington Hills, Ml 48018, (313) Ulricho, 2650 Moreira Da Maia, 4470 Maia, FRANCE: Texas Instruments France, 8-10 553-1581. Portugal, (2) 948 1003. Avenue Morane-Saulnier, B.P. 67, 78141 Velizy- MINNESOTA: Eden Prairie: 11000 w.78th Villacoublay Cedex, France, (1) 30 70 1003. SINGAPORE (&INDIA, INDONESIA, Street, Suite 100, Eden Prairie, MN 55344, (612) THAILAND): Texas Instruments Singapore 828-9300. GERMANY: Texas Instruments Deutschland (PTE) Ltd., Asia Pacific, 101 Thomson Road, GmbH., Haggertysirasse 1, 8050 Freising, MISSOURI: St. Louis: 12412 Powerscourt #23-01 United Square, Singapore 1130, 3508100. (08161) 80-0; KurfQrstendamm 195-196, 1000 Drive, Suite 125, St. Louis, MO 63131, (314) Berlin 15, (030) 8 82 73 65; Dusseldorter Strasse SPAIN: Texas Instruments Espana S.A., 821-8400. 40, 6236 Eschborn 1, (06196) 80 70; c/Gobelas 43, Urbanizasion La Florida, 28023 NEW JERSEY: lselin: Metropolitan Corporate Kirchhorster Strasse 2, 3000 Hannover 51, Madrid, Spain, (1) 372 8051; c/Diputacion, Plaza, 485 Bldg E. U.S. 1 South, lselin, NJ (0511) 64 68-0; Maybachstrasse II, 7302 279-3-5, 08007 Barcelona, Spain, (3) 317 91 80. 08830, (908) 750-1050. Ostfildern 2 (Nellingen), (0711) 3403257; SWEDEN: Texas Instruments International Trade NEW MEXICO: Albuquerque: 2709 J. Pan Gildehofcenter, Hollestrasse 3, 4300 Essen 1, Corporation (Sverigefilialen), lsafjordsgatan, Box American Freeway NE, Albuquerque, NM 87101, (0201) 24 25-0. 30, 164 93 Kista. Sweden, (08) 752 58 00. (505) 345-2555. HOLLAND: Texas Instruments Holland B.V., SWITZERLAND: Texas Instruments Switzerland NEW YORK: East Syracuse: 6365 Collamer Hogehilweg 19, Postbus 12995, 1100 AZ AG, Riedstr. 6, 8953 Dietikon, Switzerland, (01) Drive, East Syracuse, NY 13057, (315) Amsterdam-Zuidoost, Holland, (020) 5602911. 7442811. 463-9291; Fishkill: 300 Westage Business Ctr., HONG KONG: Texas Instruments Hong Kong TAIWAN: Texas Instruments Taiwan Limited, Suite 140, Fishkill, NY 12524, (914) 897-2900; Ltd., 8th Floor, World Shipping Center, 7 Canton Ta1pe1 Branch, 10th Floor, Bank Tower, 205 Tung Melville: 48 South Service Road, Suite 100, Road, Kowloon, Hong Kong, 737-0338. Hua N. Road, Taipei, Taiwan, 10592, Republic of Melville, NY 11747, (516) 454-6601; Pittsford: HUNGARY: Texas Instruments Representation, China, 2-713 9311. 2851 Clover Street, Pittsford, NY 14534, (716) Budaorsi ut 42, 1112 Budapest, Hungary, TURKEY: Texas Instruments, DSEG M1dEast 385-6770. (1) 1666617. Regional Marketing Office, Karum Center, Suite NORTH CAROLINA: Charlotte: 8 Woodlawn IRELAND: Texas Instruments Ireland Ltd .. 7/8 442, Iran Caddesi 21, 06680 Kavaklidere, Green, Suite 100, Charlotte, NC 28217, (704) Harcourt Street, Dublin 2, Ireland, (01) 755233. Ankara, Turkey, 4-468-0155. 527-0930; Raleigh: 2809 Highwoods Boulevard, UNITED KINGDOM: Texas Instruments Ltd., Suite 100, Raleigh, NC 27625, (919) 876-2725. ITALY: Texas Instruments Italia S.p.A., Centro Direzionale Colleoni, Palazzo Perseo - Via Manton Lane, Bedford, England, MK41 7PA, OHIO: Beachwood: 23775 Commerce Park Paracelso, 12, 20041 Agrate Brianza (Mi), Italy, (234) 270 111. Rd., Beachwood, OH 44122-5875, (216) (039) 63221; Via Castello della Magliana, 38, 765-7258; Beavercreek: 4200 Colonel Glenn 00148 Roma, Italy, (06) 6572651; Via Amendola, Hwy., Suite 600, Beavercreek, OH 45431, (513) 17, 40100 Bologna, Italy, (051) 554004. 427-6200. ~TEXAS INSTRUMENTS A0892 © l 092 T n:1~ ln~trumenrs lncnrpnr<1ti:Ll Printl',l 111 tlw US.A IOWA: Arrow/Schweber (319) 395-7230. TI North TI Authorized KANSAS: Arrow/Schweber (913) 541-9542; Hall-Mark (913) 888-4747; Marshall (913) 492-3121. American Sales North American MARYLAND: Anthem (301) 995-6640; Arrow/Schweber (301) 596-7800; Hall-Mark (301) 988-9800; Marshall (301) 622-1t18; Zeus (301) 997-1118. Offices Distributors MASSACHUSETTS: Anlhem (508) 657-5170; Arrow/Schweber (508) 658-0900; Hall-Mark (508) ALABAMA: Huntsville: (205) 837-7530 Alliance Electronics, Inc. (military product only) 667·0902; Marshall (508) 658-0810; Wyle (617) ARIZONA: Phoenix: (602) 995-1007 Al mac/ Arrow 272-7300; Zeus (617) 246-8200. CALIFORNIA: Irvine: (714) 660-1200 Anthem Electronics MICHIGAN: Detroit: Arrow/Schweber (313) 462-2290; San Diego: (619) 278-9600 Arrow/Schweber Hall-Mark (313) 416-5800; Marshall (313) 525-5850; Santa Clara: (408) 980-9000 Newark (313) 967-0600. Future Electronics (Canada) Woodland Hills: (818) 704-8100 MINNESOTA: Anthem (612) 944-5454; Arrow/Schweber GRS Electronics Co., Inc. (612) 941-5280; Hall-Mark (612) 881-2600; Marshall COLORADO: Aurora: (303) 368-8000 Hall-Mark Electronics (612) 559-2211. CONNECTICUT: Wallingford: (203) 269-0074 Marshall Industries MISSOURI: Arrow/Schweber (314) 567-6888; Hall-Mark FLORIDA: Altamonte Springs: (407) 260-2116 Fort Lauderdale: (305) 973-8502 Newark Electronics (314) 291-5350; Marshall (314) 291-4650. Tampa: (813) 885-7588 Rochester Electronics, Inc. (obsolete product only NEW JERSEY: Anlhem (201) 227-7960; GEORGIA: Norcross: (404) 662-7967 (508) 462-9332) Arrow/Schweber (201) 227-7880, (609) 596-8000; Wyle Laboratories Hall-Mark (201) 515-3000, (609) 235-1900; Marshall ILLINOIS: Arlington Heights: (708) 640-3000 (201) 882-0320. (609) 234-9100. INOIANA: Carmel: (317) 573-6400 Zeus Components NEW MEXICO: Alliance (505) 292-3360. Fort Wayne: (219) 489-4697 NEW YORK: Long Island: Anlhem (516) 864-6600; KANSAS: Overland Park: (913) 451-4511 Arrow/Schweber (516) 231-1000; Hall-Mark (516) MARY LANO: Columbia: (410) 964-2003 MASSACHUSETTS: Waltham: (617) 895-9100 MICHIGAN: Farmington Hills: (313) 553-1581 TI Distributors 737-0600; Marshall (516) 273-2424; Zeus (914) 937-7400; Rochester: Arrow/Schweber (716) 427-0300: Hall-Mark ALABAMA: Arrow/Schweber (205) 837-6955: Hall-Mark (716) 425-3300; Marshall (716) 235-7620; N!!NNESOTA: Eden Prairie: (612) 828-9300 (205) 837-8700, ivia.-sr-1aii (205) 881-9235. MISSOURI: St. Louis: (314) 621-8400 Syracuse: Marshall (607) 785-2345. ARIZONA: Anthem (602) 966-6600; Arrow/Schweber NEW JERSEY: lselin: (908) 750-1050 (602) 437-0750; Hall-Mark (602) 431-0030; Marshall NORTH CAROLINA: Arrow/Schweber (919) 876-3132; (602) 496-0290; Wyle (602) 437-2088. Hall-Mark (919) 872-0712; Marshall (919) 878-9882. NEW MEXICO: Albuquerque: (505) 345-2555 CALIFORNIA: Los Ange1es/Orange County: Anthem OHIO: Cleveland: Arrow/Schweber (216) 248-3990; NEW YORK: East Syracuse: (315) 463-9291 (818) 775-1333. (714) 768-4444; Arrow/Schweber (818) Hall-Mark (216) 349-4632; Marshall (216) 248-1788; Fishkill: (914) 897-2900 Melville: (516) 454-6600 380-9686, (714) 587-0404; Hall-Mark (818) 773-4500. Columbus: Hall-Mark (614) 888-3313; Pittsford: (716) 385-6770 (714) 727-6000; Marshall (818) 878-7000. (714) Dayton: Arrow/Schweber (513) 435-5563; Marshall NORTH CAROLINA: Charlotte: (704) 527-0930 458-5301; Wyle (818) 880-9000. (714) 863-9953; Zeus (513) 898-4480; Zeus (513) 293-6182. Raleigh: (919) 876-2725 (714) 921-9000. (818) 889-3838; OKLAHOMA: Arrow/Schweber (918) 252-7537; OHIO: Beachwood: {216) 765-7258 Sacramento: Anthem (916) 624-9744; Hall-Mark (916) Hall-Mark (918) 254-6110. Beavercreek: (513) 427-6200 624-9781; Marshall (916) 635-9700; Wyle (916) OREGON: Anthem (503) 643-1114; Almac/Arrow (503) 638-5282; 629-8090; Marshall (503) 644-5050; Wyle (503) OREGON: Beaverton: (503) 643-6758 San Diego: Anthem (619) 453-9005; Arrow/Schweber 643-7900. PENNSYLVANIA: Blue Bell: (215) 825-9500 (619) 565-4600; Hall-Mark (619) 268-1201; Marshall PENNSYLVANIA: Anthem (215) 443-5150; PUERTO RICO: Halo Rey: (809) 753-8700 (619) 578--9600; Wyle (619) 565-9171; Zeus (619) Arrow/Schweber (215) 928-1800; GRS (215) 922-7037. TEXAS: Austin: (512) 250-6769 277-9681; (609) 964-8560; Marshall (412) 788-0441. Dallas: (2t4) 917-1264 San Francisco Bay Area: Anthem (408) 453-1200; TEXAS: AUstin: Arrow/Schweber (512) 835-4180; Houston: (713) 778-6592 Arrow/Schweber (408) 441-9700, (510) 490-9477; Hall-Mark (512) 258-8848; Marshall (512) 837-1991; Midland: (915) 561-7137 Hall-Mark (408) 432-4000; Marshall (408) 942-4600; Wyle (512) 345-8853; UTAH: Salt Lake City: (801) 466-8972 Wyle (408) 727-2500; Zeus (408) 629-4789. Dallas: Anthem (214) 238-7100; Arrow/Schweber (214) WISCONSIN: Waukesha: (414) 798-1001 COLORADO: Anthem (303) 790-4500; Arrow/Schweber 380-6464; Hall-Mark (214) 553-4300; Marshall (214) CANADA: Nepean: (613) 726-1970 (303) 799-0258; Hall-Mark (303) 790-1662; Marshall 233-5200; Wyle (214) 235-9953; Zeus (214) 783-7010; Richmond Hill: (416) 884-9181 (303) 451-8383; Wyle (303) 457-9953. Houston: Arrow/Schweber (713) 530-4700: Hatl-Mark St. Laurent: (514) 335-8392 CONNECTICUT: Anlhem (203) 575-1575; (713) 781-6100; Marshall (713) 467-1666; Wyle (713) Arrow/Schweber (203) 265-77 41; Hall-Mark (203) 879-9953. 271-2844; Marshall (203) 265-3822. UTAH: Anlhem (801) 973-8555; Arrow/Schweber(801) FLORIDA: Fort Lauderdale: Arrow/Schweber (305) 973-6913; Marshall (801) 973-2288; Wyle (801) Regional 429-8200; Hall-Mark (305) 971-9280; Marshall (305) 977-4880; 974-9953. WASHINGTON: Anthem (206) 483-1700; Almac/Arrow Technology Orlando: Arrow/Schweber (407) 333-9300; Hall-Mark (407) 830-5855; Marshall (407) 767-8585; Zeus (407) 788-9100; (206) 643-9992; Marshall (206) 486-5747; Wyle (206) 881-1150. Centers Tampa: Hall-Mark (813) 541-7440; Marshall (813) 573-1399. WISCONSIN: Arrow/Schweber (414) 792-0150; Hall-Mark (414) 797-7844; Marshall (414) 797-8400. CANADA: Calgary: Future (403) 235-5325; CALIFORNIA: Irvine: (714) 660-8140 GEORGIA: Arrow/Schweber (404) 497-1300; Hall-Mark Edmonton: Future (403) 438-2858; Santa Clara: (408) 748-2222 (404) 623-4400; Marshall (404) 923-5750. Montreal: Arrow/Schweber (514) 421-7411; Future (514) GEORGIA: Norcross: (404) 662-7945 ILLINOIS: Anthem (708) 884-0200; Arrow/Schweber 694-7710; Marshall (514) 694-8142; ILLINOIS: Arlington Heights: (708) 640-2909 (708) 250-0500; Hall-Mark (312) 860-3800; Marshall (708) 490-0155; Newark (312)784-5100. Ottawa: Arrow/Schweber (613) 226-6903; Future (613) INDIANA: lndlanapolis: (317) 573-6400 820-8313; INDIANA: Arrow/Schweber (317) 299-2071; Hall-Mark MASSACHUSETTS: Waltham: (617) 895-9196 Quebec: Future (418) 897-6666 (317) 872-8875; Marshall (317) 297-0483. MEXICO: Mexico City: 491-70834 Toronto: Arrow/Schweber (416) 670-7769; Future (416) MINNESOTA: Minneapolis: (612) 828-9300 612-9200; Marshall (416) 458-8046; TEXAS: Dallas: (214) 917-3881 Vancouver: Arrow/Schweber (604) 421-2333; Future CANADA: Nepean: (613) 726-1970 (604)294-1166. Customer TI Die Response Center Processors TOLL-FREE: (800) 336-5236 Chip Supply (407) 298-7100 OUTSIDE UNfTED STATES: (214) 995-6611 Elmo Semiconductor (818) 768-7400 (8:00 a.m.-5:00 p.m. Central Time) Minco Technology Labs (512) 834-2022 .TEXAS INSTRUMENTS 00892 © 1992 T l'X•l~ lnsrrunwnts lrn.:urporntt•,I Printl'd in thl' L'.S.A. .,, TEXAS INSIRUMENTS Printed in U.S.A. , January 1993 SPRU014C 1604907-9761 revision C