Freescale Semiconductor, Inc. Freescale Semiconductor, Inc... DSP56302EVM User's Manual Rev. 1 Motorola, Incorporated Semiconductor Products Sector DSP Division 6501 William Cannon Drive West Austin, TX 78735-8598 For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. Order this document by: DSP56302EVMUM/AD Freescale Semiconductor, Inc... Introduction This document supports the DSP56302 Evaluation Module (DSP56302EVM) including a description of its basic structure and operation, the equipment required to use it, the specifications of the key components, the provided software (such as the demonstration code, the self-test code, and the software required to develop and debug sophisticated applications), schematic diagrams, and a parts list. Section 1 is a Quick Start Guide. Section 2 provides instructions for running the demonstration software. Section 3 provides a simple programming example. Section 4 provides detailed information about key components in the evaluation module. Appendix A has detailed schematics. Appendix B is the parts list. Appendix C includes additional notes for using the Assembler. Appendix D is a tutorial for programming the codec. This document has been designed for users experienced with DSP development tools. For users with little or no DSP experience, detailed information is provided in the additional documents supplied with this kit. OnCE and Mfax are trademarks of Motorola, Inc. Motorola reserves the right to make changes without further notice to any products herein. Motorola makes no warranty, representation or guarantee regarding the suitability of its products for any particular purpose, nor does Motorola assume any liability arising out of the application or use of any product or circuit, and specifically disclaims any and all liability, including without limitation consequential or incidental damages. "Typical" parameters which may be provided in Motorola data sheets and/or specifications can and do vary in different applications and actual performance may vary over time. All operating parameters, including "Typicals" must be validated for each customer application by customer's technical experts. Motorola does not convey any license under its patent rights nor the rights of others. Motorola products are not designed, intended, or authorized for use as components in systems intended for surgical implant into the body, or other applications intended to support life, or for any other application in which the failure of the Motorola product could create a situation where personal injury or death may occur. Should Buyer purchase or use Motorola products for any such unintended or unauthorized application, Buyer shall indemnify and hold Motorola and its officers, employees, subsidiaries, affiliates, and distributors harmless against all claims, costs, damages, and expenses, and reasonable attorney fees arising out of, directly or indirectly, any claim of personal injury or death associated with such unintended or unauthorized use, even if such claim alleges that Motorola was negligent regarding the design or manufacture of the part. Motorola and are registered trademarks of Motorola, Inc. Motorola, Inc. is an Equal Opportunity/Affirmative Action Employer. How to reach us: USA/Europe/Locations Not Listed: Motorola Literature Distribution P.O. Box 5405 Denver, Colorado 80217 303-675-2140 1 (800) 441-2447 MfaxTM: RMFAX0@email.sps.mot.com TOUCHTONE (602) 244-6609 US & Canada ONLY (800) 774-1848 Asia/Pacific: Motorola Semiconductors H.K. Ltd. 8B Tai Ping Industrial Park 51 Ting Kok Road Tai Po, N.T., Hong Kong 852-26629298 Japan: Nippon Motorola Ltd. SPD, Strategic Planning Office 4-32-1, Nishi-Gotanda Sinagawa-ku, Tokyo 141, Japan 81-3-5487-8488 Technical Resource Center: 1 (800) 521-6274 DSP Helpline dsphelp@dsp.sps.mot.com Internet: http://www.motorola-dsp.com For More Information On This Product, Go to: www.freescale.com Freescale Semiconductor, Inc. Freescale Semiconductor, Inc... CONTENTS SECTION 1 QUICK START GUIDE. . . . . . . . . . . . . . . . . . . . . . . 1-1 1.1 OVERVIEW . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-3 1.2 EQUIPMENT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-3 1.2.1 What You Get with the DSP56302EVM. . . . . . . . . . . . . . . 1-3 1.2.2 What You Need to Supply . . . . . . . . . . . . . . . . . . . . . . . . . 1-4 1.3 INSTALLATION PROCEDURE . . . . . . . . . . . . . . . . . . . . . . . 1-4 1.3.1 Preparing the DSP56302EVM . . . . . . . . . . . . . . . . . . . . . . 1-5 1.3.2 Connecting the DSP56302EVM to the PC and Power . . . 1-7 1.3.3 Installing the Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-8 1.3.4 Testing the DSP56302EVM. . . . . . . . . . . . . . . . . . . . . . . . 1-9 1.3.4.1 DSP56302EVM Self-test. . . . . . . . . . . . . . . . . . . . . . . . 1-9 1.3.4.2 DSP56302EVM Analysis Program . . . . . . . . . . . . . . . 1-10 SECTION 2 RUNNING THE DEMONSTRATION FILE . . . . . . . . 2-1 2.1 OVERVIEW . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-3 2.2 SETTING UP THE DEMONSTRATION . . . . . . . . . . . . . . . . . 2-3 2.3 RUNNING THE DEMONSTRATION . . . . . . . . . . . . . . . . . . . 2-4 SECTION 3 EXAMPLE TEST PROGRAM . . . . . . . . . . . . . . . . . 3-1 3.1 OVERVIEW . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-3 3.2 WRITING THE PROGRAM . . . . . . . . . . . . . . . . . . . . . . . . . . 3-4 3.2.1 Source Statement Format . . . . . . . . . . . . . . . . . . . . . . . . . 3-4 3.2.1.1 Label Field. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-4 3.2.1.2 Operation Field . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-4 3.2.1.3 Operand Field . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-5 3.2.1.4 Data Transfer Fields . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-5 3.2.1.5 Comment Field . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-5 3.2.2 Example Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-5 3.3 ASSEMBLING THE PROGRAM . . . . . . . . . . . . . . . . . . . . . . 3-7 3.3.1 Assembler Command Format . . . . . . . . . . . . . . . . . . . . . . 3-7 3.3.2 Assembler Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-8 3.3.3 Assembler Directives . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-11 MOTOROLA DSP56302EMUM/AD, Preliminary For More Information On This Product, Go to: www.freescale.com iii Freescale Semiconductor, Inc... Freescale Semiconductor, Inc. 3.3.3.1 Assembler Significant Characters . . . . . . . . . . . . . . . 3.3.3.2 Assembly Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.3.3.3 Symbol Definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.3.3.4 Data Definition/Storage Allocation . . . . . . . . . . . . . . . 3.3.3.5 Listing Control and Options . . . . . . . . . . . . . . . . . . . . 3.3.3.6 Object File Control . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.3.3.7 Macros and Conditional Assembly . . . . . . . . . . . . . . . 3.3.3.8 Structured Programming . . . . . . . . . . . . . . . . . . . . . . 3.3.4 Assembling the Example Program . . . . . . . . . . . . . . . . . 3.4 MOTOROLA DSP LINKER . . . . . . . . . . . . . . . . . . . . . . . . . 3.4.1 Linker Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.4.2 Linker Directives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.5 INTRODUCTION TO THE DEBUGGER SOFTWARE . . . . 3.6 RUNNING THE PROGRAM . . . . . . . . . . . . . . . . . . . . . . . . 3-11 3-12 3-13 3-13 3-14 3-14 3-15 3-15 3-16 3-16 3-17 3-23 3-24 3-26 SECTION 4 DSP56302EVM TECHNICAL SUMMARY . . . . . . . 4-1 4.1 DSP56302EVM DESCRIPTION AND FEATURES . . . . . . . . 4-3 4.2 DSP56302 DESCRIPTION . . . . . . . . . . . . . . . . . . . . . . . . . . 4-3 4.3 MEMORY. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-4 4.3.1 SRAM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-5 4.3.1.1 SRAM Connections . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-6 4.3.1.2 Example: Programming AAR0 . . . . . . . . . . . . . . . . . . . 4-7 4.3.2 Flash PEROM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-9 4.3.2.1 Flash PEROM Connections . . . . . . . . . . . . . . . . . . . . . 4-9 4.3.2.2 Programming for Stand-Alone Operation . . . . . . . . . . . 4-9 4.4 AUDIO CODEC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-10 4.4.1 Codec Analog Input/Output. . . . . . . . . . . . . . . . . . . . . . . 4-11 4.4.2 Codec Digital Interface . . . . . . . . . . . . . . . . . . . . . . . . . . 4-12 4.4.3 Codec Clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-13 4.5 COMMAND CONVERTER . . . . . . . . . . . . . . . . . . . . . . . . . 4-14 iv DSP56302EMUM/AD, Preliminary For More Information On This Product, Go to: www.freescale.com MOTOROLA Freescale Semiconductor, Inc. DSP56302EVM SCHEMATICS . . . . . . . . . . . . . . . .A-1 APPENDIX B DSP56302EVM PARTS LIST . . . . . . . . . . . . . . . . .B-1 APPENDIX C MOTOROLA ASSEMBLER NOTES . . . . . . . . . . . .C-1 APPENDIX D CODEC PROGRAMMING TUTORIAL . . . . . . . . . .D-1 Freescale Semiconductor, Inc... APPENDIX A MOTOROLA DSP56302EMUM/AD, Preliminary For More Information On This Product, Go to: www.freescale.com v Freescale Semiconductor, Inc. Freescale Semiconductor, Inc... LIST OF FIGURES Figure 1-1 DSP56302EVM Component Layout. . . . . . . . . . . . . . . . . . . . . . . 1-6 Figure 1-2 Connecting the DSP56302EVM Cables. . . . . . . . . . . . . . . . . . . . 1-7 Figure 1-3 DSP56302EVM Test Sample Output--Fail . . . . . . . . . . . . . . . . 1-11 Figure 1-4 DSP56302EVM Test Sample Output--Pass . . . . . . . . . . . . . . . 1-12 Figure 2-1 DSP56302EVM Component Layout. . . . . . . . . . . . . . . . . . . . . . . 2-4 Figure 3-1 Development Process Flow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-3 Figure 3-2 Example Debugger Window Display . . . . . . . . . . . . . . . . . . . . . 3-25 Figure 4-1 DSP56302EVM Component Layout. . . . . . . . . . . . . . . . . . . . . . . 4-4 Figure 4-2 DSP56302EVM Functional Block Diagram . . . . . . . . . . . . . . . . . 4-5 Figure 4-3 SRAM Connections to the DSP56302 . . . . . . . . . . . . . . . . . . . . . 4-6 Figure 4-4 Alternate Configurations for J9. . . . . . . . . . . . . . . . . . . . . . . . . . . 4-6 Figure 4-5 Example Memory Map with the Unified External Memory . . . . . . 4-7 Figure 4-6 Address Attribute Register AAR0 . . . . . . . . . . . . . . . . . . . . . . . . . 4-8 Figure 4-7 Flash PEROM Connections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-9 Figure 4-8 Codec Analog Input/Output Diagram . . . . . . . . . . . . . . . . . . . . . 4-11 Figure 4-9 Codec Digital Interface Connections . . . . . . . . . . . . . . . . . . . . . 4-12 Figure 4-10 Codec Clock Generation Diagram . . . . . . . . . . . . . . . . . . . . . . . 4-13 Figure 4-11 RS-232 Serial Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-14 vi DSP56302EMUM/AD, Preliminary For More Information On This Product, Go to: www.freescale.com MOTOROLA Freescale Semiconductor, Inc. LIST OF TABLES DSP56302EVM Parts List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . B-3 Freescale Semiconductor, Inc... Table B-1 MOTOROLA DSP56302EMUM/AD, Preliminary For More Information On This Product, Go to: www.freescale.com vii Freescale Semiconductor, Inc... Freescale Semiconductor, Inc. viii DSP56302EMUM/AD, Preliminary For More Information On This Product, Go to: www.freescale.com MOTOROLA Freescale Semiconductor, Inc. SECTION 1 Freescale Semiconductor, Inc... QUICK START GUIDE MOTOROLA DSP56302EMUM/AD, Preliminary For More Information On This Product, Go to: www.freescale.com 1-1 Freescale Semiconductor, Inc. Quick Start Guide OVERVIEW . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . EQUIPMENT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . What You Get with the DSP56302EVM . . . . . . . . . . . . . . What You Need to Supply. . . . . . . . . . . . . . . . . . . . . . . . . INSTALLATION PROCEDURE . . . . . . . . . . . . . . . . . . . . . . . Preparing the DSP56302EVM . . . . . . . . . . . . . . . . . . . . . Connecting the DSP56302EVM to the PC and Power . . . Installing the Software. . . . . . . . . . . . . . . . . . . . . . . . . . . . Testing the DSP56302EVM . . . . . . . . . . . . . . . . . . . . . . . 1-3 1-3 1-3 1-4 1-4 1-5 1-7 1-8 1-9 Freescale Semiconductor, Inc... 1.1 1.2 1.2.1 1.2.2 1.3 1.3.1 1.3.2 1.3.3 1.3.4 1-2 DSP56302EMUM/AD, Preliminary For More Information On This Product, Go to: www.freescale.com MOTOROLA Freescale Semiconductor, Inc. Quick Start Guide Overview 1.1 OVERVIEW This section provides a summary description of the evaluation module contents, additional requirements, and quick installation and test information. Detailed information about the DSP56302EVM design and operation is provided in the remaining sections of this manual. Freescale Semiconductor, Inc... 1.2 EQUIPMENT The following section gives a brief summary of the equipment required to use the DSP56302 Evaluation Module (DSP56302EVM), some of which will be supplied with the module, and some of which must be supplied by the user. 1.2.1 What You Get with the DSP56302EVM The following material is provided with the DSP56302EVM: * DSP56302 Evaluation Module board * DSP56302EVM Product Information * DSP56302 Technical Data (preliminary) * DSP56302 Chip Errata * DSP56300 Family Manual * DSP56302 Product Specifications Revision 1.03 * DSP56302EVM User's Manual (this document) * Crystal Semiconductor CS4215 16-Bit Multimedia Audio Codec Data Sheet * Domain Technologies Debug-56K Debugger manual for Motorola 16- and 24-bit DSPs * Set of diskettes (3-1/2 inch) containing required software: - GUI Debugger from Domain Technologies (1 diskette) - Assembler/linker/example software from Motorola (1 diskette) MOTOROLA DSP56302EMUM/AD, Preliminary For More Information On This Product, Go to: www.freescale.com 1-3 Freescale Semiconductor, Inc. Quick Start Guide Installation Procedure 1.2.2 What You Need to Supply Freescale Semiconductor, Inc... * PC (386 class or higher) with: - Windows 3.1 or higher (including Windows 95) - 4 Mbytes of memory minimum - 3-1/2-inch, high density, diskette drive - Hard drive with 4 Mbytes of free disk space - Mouse - RS-232 serial port supporting 9,600-57,600 bit-per-second transfer rates * RS-232 interface cable (DB9 male to DB9 female) * Power supply, 7-9 V ac or dc input into a 2.1 mm power connector * Audio source (tape player, radio, CD player, etc.) * Headphones * Audio interface cable with 1/8-inch stereo plugs 1.3 INSTALLATION PROCEDURE Installation requires four basic steps: 1. Preparing the DSP56302EVM board 2. Connecting the board to the PC and power 3. Installing the software 4. Testing the installation 1-4 DSP56302EMUM/AD, Preliminary For More Information On This Product, Go to: www.freescale.com MOTOROLA Freescale Semiconductor, Inc. Quick Start Guide Installation Procedure 1.3.1 Preparing the DSP56302EVM Freescale Semiconductor, Inc... CAUTION Because all electronic components are sensitive to the effects of electrostatic discharge (ESD) damage, correct procedures should be used when handling all components in this kit and inside the supporting personal computer. Use the following procedures to minimize the likelihood of damage due to ESD: - Always handle all static-sensitive components only in a protected area, preferably a lab with conductive (anti-static) flooring and bench surfaces. - Always use grounded wrist straps when handling sensitive components. - Never remove components from anti-static packaging until required for installation. - Always transport sensitive components in anti-static packaging. Locate jumper blocks J4, J7, and J9, as shown in Figure 1-1. Make sure that, for blocks J4 and J7, all six positions on each block are jumpered, and for J9, there is a jumper connecting pins 2 and 3. These jumpers perform the following functions: * J4 controls the interface between the DSP56302 JTAG/OnCE port and DSP56002 Synchronous Serial Interface (SSI). * J7 controls the interface between the audio codec and the DSP56302 Enhanced Synchronous Serial Interface (ESSI0). * J9 defines the external memory map. MOTOROLA DSP56302EMUM/AD, Preliminary For More Information On This Product, Go to: www.freescale.com 1-5 Freescale Semiconductor, Inc. Quick Start Guide Installation Procedure J9 1 J3 MC145407 J8 ISA CONNECTOR J9 LED MCM6306 MCM6306 Freescale Semiconductor, Inc... DSP56002 AT29LV512 J6 ESSI1/SCI MCM6306 JTAG/ OnCE SW1 DSP56302 MC34164 J1 P1 J2 J7 ESSI0 POWER P2 Debug LED J4 SW2 J5 JTAG SW3 COMMAND CONVERTER SELECT MC74HCT241 LT1085 P4 HDPHNE CS4215 MC74HCT04 Power LED LT1085 P5 OUT P3 IN MC33078 Serial # J7 J4 12 12 1 1 Figure 1-1 DSP56302EVM Component Layout 1-6 DSP56302EMUM/AD, Preliminary For More Information On This Product, Go to: www.freescale.com MOTOROLA Freescale Semiconductor, Inc. Quick Start Guide Installation Procedure 1.3.2 Connecting the DSP56302EVM to the PC and Power Figure 1-2 shows the interconnection diagram for connecting the PC and the external power supply to the DSP56302EVM board. Use the following steps to complete cable connections: Freescale Semiconductor, Inc... DB9 Interface Cable PC-compatible Computer P1 P2 Connect cable to RS-232 port External 7-9 V Power DSP56302EVM Figure 1-2 Connecting the DSP56302EVM Cables 1. Connect the DB9P end of the RS-232 interface cable to the RS-232 port connection on the PC. 2. Connect the DB9S end of the cable to P1, shown in Figure 1-1, on the DSP56302EVM board. This provides the connection to allow the PC to control the board function. 3. Make sure that the external 7-9 V power supply does not have power supplied to it. 4. Connect the 2.1 mm output power plug into P2, shown in Figure 1-1, on the DSP56302EVM board. 5. Apply power to the power supply. The green Power LED will light when power is correctly applied. MOTOROLA DSP56302EMUM/AD, Preliminary For More Information On This Product, Go to: www.freescale.com 1-7 Freescale Semiconductor, Inc. Quick Start Guide Installation Procedure 1.3.3 Installing the Software The DSP56302EVM software includes the following: Freescale Semiconductor, Inc... * Motorola diskette containing: - Assembler - Linker - Test code - Demonstration code * Domain Technologies diskette containing the windowed user interface debug software Use the following steps to install the software: 1. Insert the Motorola software diskette into the PC diskette drive. 2. If the system is not already running in Windows, start Windows. 3. From Windows, select a DOS window and run the install program. The general format for the command line of the install program is install2 . For example, if your diskette drive is a, type in a:install2 a:. The program installs the software in the default destination c:\evm30xw. 4. Close the DOS window and remove the Motorola software diskette from the diskette drive. Insert the Domain Technologies diskette labeled Debug-56K into the drive. 5. From Windows, run the Debugger installation program install.exe on the diskette. This can be done from the Microsoft Windows Program Manager by pulling down the File menu, choosing Run, entering a:install on the command line, and clicking OK. 6. Read the README.TXT if you are installing the Debugger program for the first time. This provides information in addition to that provided by the Domain Technologies manual included with this kit. 7. The install program creates a program group called EVM5630x and a program icon called EVM30xW within Windows. This step completes the software installation. 1-8 DSP56302EMUM/AD, Preliminary For More Information On This Product, Go to: www.freescale.com MOTOROLA Freescale Semiconductor, Inc. Quick Start Guide Installation Procedure 1.3.4 Testing the DSP56302EVM Freescale Semiconductor, Inc... The following sections describe the DSP56302EVM self-test and analysis programs. The self-test allows the user to determine if the DSP56302EVM is properly connected and ready for operation. The analysis program allows the user to examine the DSP56302EVM operation in more detail to diagnose problems that may occur. 1.3.4.1 DSP56302EVM Self-test This section describes how to run the DSP56302EVM self-test. The self-test comes pre-loaded into the Flash PEROM of the DSP56302EVM, and is therefore very easy to use. There are two parts to the self-test, as follows: * The first part of the self-test examines the external memory of the DSP56302EVM by writing to, and reading from, the external SRAM. It also examines the analog circuitry of the DSP56302EVM by analyzing the response of the analog circuitry to a sequence of tones. This part of the self-test begins running immediately when the DSP56302 boots from the Flash PEROM and, after startup, by invoking external Interrupt Request A (IRQA). IRQA can be activated by pressing the switch labelled SW2. * The second part of the self-test analyzes the audio circuitry of the DSP56302EVM by moving an audio signal through the codec. The second part of the self-test begins following a receipt of external Interrupt Request D (IRQD). IRQD is activated by pressing the switch labelled SW3. The following steps describe how to run the self-test code for the DSP56302EVM. CAUTION Do not wear the headphones during the first part of the self-test. 1. Install the cable with the 1/8-inch stereo plugs between the line input jack labelled P3/IN on the DSP56302EVM and the line output jack labelled P5/OUT on the DSP56302EVM. Refer to Figure 1-1 on page 1-6 for the location of the line input and output jacks. 2. Press the switch labelled SW1 on the DSP56302EVM. Refer to Figure 1-1 on page 1-6 for the location of SW1. This switch resets the DSP56302 and allows the DSP56302 to boot from the Flash PEROM, which is preloaded with the self-test code, and begins the first part of the self-test. The red LED at D12 MOTOROLA DSP56302EMUM/AD, Preliminary For More Information On This Product, Go to: www.freescale.com 1-9 Freescale Semiconductor, Inc. Quick Start Guide Installation Procedure lights when the test begins running. When this test is complete, the LED turns off if the DSP56302EVM passed the test. If the DSP56302EVM fails the test, the LED flashes. To repeat the test, press SW2 to invoke IRQA. Freescale Semiconductor, Inc... 3. Now run the second part of the self-test code to test the analog circuitry of the DSP56302EVM. Using the cable with the 1/8-inch stereo plugs, connect the phone output of the audio source to the line input jack labelled P3/IN on the DSP56302EVM. Also connect a pair of headphones to the headphone jack labelled P4/HDPHNE on the DSP56302EVM. Refer to Figure 1-1 on page 1-6 for the locations of the line input and headphone jacks. Start the audio source and put on the headphones. 4. Press the switch labelled SW3 on the DSP56302EVM. Refer to Figure 1-1 on page 1-6 for the location of SW3. You should hear the audio through the headphones with a slight echo added. To rerun the first part of the self-test, perform steps 1 and 2 above. To repeat the second part of the test, perform steps 3 and 4 above. You can switch between the parts at any time. CAUTION Do not wear the headphones during the first part of the self-test. If both parts of the self-test complete correctly, the DSP56302EVM is correctly installed, operational, and ready for use. If either part of the self-test fails, double-check the jumper settings and cable connections (power, RS-232, and audio) and repeat the test. If the DSP56302EVM continues to fail either test, run the DSP56302EVM analysis program described in Section 1.3.4.2 to try to determine the cause of the problem. 1.3.4.2 DSP56302EVM Analysis Program This section describes how to run the DSP56302EVM analysis program. The analysis program functions in the same way as the first part of the self-test, but provides a list of output results. This allows the user to determine exactly how the DSP56302EVM is failing the tests. 1-10 DSP56302EMUM/AD, Preliminary For More Information On This Product, Go to: www.freescale.com MOTOROLA Freescale Semiconductor, Inc. Quick Start Guide Installation Procedure The following steps describe how to run the analysis program for the DSP56302EVM. CAUTION Freescale Semiconductor, Inc... Do not wear the headphones during this test. 1. Run the program evmtst2.exe. This can be done from the Microsoft Windows Program Manager by pulling down the File menu, choosing Run, entering c:\evm30xw\evmtst2.exe on the command line, and clicking OK. 2. When prompted, install the cable with the 1/8" stereo plugs between the line input jack labelled P3/IN on the DSP56302EVM and the line output jack labelled P5/OUT on the DSP56302EVM. Refer to Figure 1-1 on page 1-6 for the location of the line input and output jacks. Press any key to continue the test. 3. Wait for the test to run. Note: When the test is complete, the test program window will go to the background. Click on the test window to bring it to the foreground. 4. After the test is complete, the test asks for the DSP56302EVM serial number. The serial number can be found at the bottom of the DSP56302EVM board as shown in Figure 1-1 on page 1-6. Type in the serial number from the board and press the return key. The test program will output a set of diagnostics to the screen, similar to those shown in Figures 1-3 and 1-4, showing the results of the analog circuitry and memory tests. The analog circuitry results show the DC offset, the noise level, and the response of the analog circuitry to the sequence of tones listed in the first column. The second two columns contain the raw data received by the DSP56302 from the left and right channels of the analog circuitry. The raw data is evaluated in decibels relative to the maximum value and placed in the next two columns, labelled dB below MAX. MOTOROLA DSP56302EMUM/AD, Preliminary For More Information On This Product, Go to: www.freescale.com 1-11 Freescale Semiconductor, Inc. Quick Start Guide Installation Procedure -- DSP56302EVM Performance Analysis EVM Serial No.: 1234 DSP56302 Chip Revision No. 000303 Freescale Semiconductor, Inc... LEFT RIGHT Ver.2.00-Tue Jun 04 17:45:47 1996 ------------dB below MAX-------------- ______________________________________________________________________ DC Offset: 65535 65535 6.02 6.02 10.00 NOISE: 0 0 0.00 0.00 10.00 24 kHz: 3086 2773 -20.52 -21.45 -20.00 6 kHz: 20 24014 -64.29 -2.70 -6.00 * 1.5 kHz: 24422 22 -2.55 -63.46 -6.00 * 375 Hz: 20 19 -64.29 -64.73 -6.00 * * 94 Hz: 22772 22553 -3.16 -3.24 -6.00 23 Hz: 15563 15218 -6.47 -6.66 0.00 12 Hz: 8627 8401 -11.59 -11.82 0.00 6 Hz: 2701 2567 -21.68 -22.12 -20.00 Pass: 6 Address: X:8200 Y:8200 Expected: 000000 000000 Received: 000000 FF0000 MEMORY ERRORS FOUND! (check J9 is in correct position) AUDIO FAIL *** FAIL *** FAIL *** FAIL *** FAIL *** Figure 1-3 DSP56302EVM Test Sample Output--Fail Figure 1-4 DSP56302EVM Test Sample Output--Pass The last column shows the acceptable responses, in dB, of the analog circuitry for the various tones. The dB levels for each channel are compared to the acceptable 1-12 DSP56302EMUM/AD, Preliminary For More Information On This Product, Go to: www.freescale.com MOTOROLA Freescale Semiconductor, Inc. Quick Start Guide Installation Procedure _______________________________________________________________________ -- DSP56302EVM Performance Analysis Ver.2.00-EVM Serial No.: 1234 Tue Jun 04 17:45:47 1996 DSP56302 Chip Revision No. 000303 Freescale Semiconductor, Inc... LEFT RIGHT --------dB below MAX---------- _____________________________________________________________________ DC Offset: 65535 65535 6.02 6.02 10.00 NOISE: 0 0 0.00 0.00 10.00 24 kHz: 3086 2773 -20.52 -21.45 -20.00 6 kHz: 24481 24014 -2.53 -2.70 -6.00 1.5 kHz: 24422 24140 -2.55 -2.65 -6.00 375 Hz: 24040 23868 -2.69 -2.75 -6.00 94 Hz: 22772 22553 -3.16 -3.24 -6.00 23 Hz: 15563 15218 -6.47 -6.66 0.00 12 Hz: 8627 8401 -11.59 -11.82 0.00 6 Hz: 2701 2567 -21.68 -22.12 -20.00 Pass: 6 Address: X:0000 Y:0000 Expected: 000000 000000 Received: 000000 000000 -------- PASS -------responses to determine if the DSP56302EVM passed the analog circuitry test. The dB levels must be below the acceptable responses for DC offset, noise, 24 kHz, 23 Hz, 12 Hz, and 6 Hz and above the acceptable responses for 6 kHz, 1.5 kHz, 375 Hz, and 94 Hz for the DSP56302EVM to pass the analog circuitry test. If either channel's dB levels do not satisfy the acceptable responses, an asterisk will be located at the end of the row that did not pass the analog circuitry test. For example, in Figure 1-3, the left channel did not satisfy the acceptable response for 6 kHz, the right channel did not satisfy the acceptable response for 1.5 kHz, and both channels did not satisfy the acceptable response for 375 Hz. If the DSP56302EVM passed the analog circuitry test, no asterisks will be seen at the end of the rows, as in Figure 1-4. The results of the memory test are shown below the results of the analog circuitry test. These results tell how many passes of the external memory test were run and if the DSP56302EVM passed the test. If all the values in the Address, Expected, and Received fields are zero, as in Figure 1-4, the DSP56302EVM passed the external memory test. If the DSP56302EVM failed the external memory test, these fields will tell which memory location caused the failure, the value that was expected to be MOTOROLA DSP56302EMUM/AD, Preliminary For More Information On This Product, Go to: www.freescale.com 1-13 Freescale Semiconductor, Inc. Quick Start Guide Installation Procedure read, and the value that was actually read from that memory location, as in Figure 1-3. The last line of the diagnostics tells if the DSP56302EVM passed or failed the test. If the last line says PASS, as in Figure 1-4, then the DSP56302EVM passed the test and is ready for use. If the last line says FAIL, as in Figure 1-3, double check the jumpers and the power, RS-232, and stereo connections and repeat the test. If the DSP56302EVM continues to fail the test, email the DSP help line at dsphelp@dsp.sps.mot.com. Freescale Semiconductor, Inc... Now the test is complete and the DSP56302EVM is ready for operation. 1-14 DSP56302EMUM/AD, Preliminary For More Information On This Product, Go to: www.freescale.com MOTOROLA Freescale Semiconductor, Inc. SECTION 2 Freescale Semiconductor, Inc... RUNNING THE DEMONSTRATION FILE MOTOROLA DSP56302EMUM/AD, Preliminary For More Information On This Product, Go to: www.freescale.com 2-1 Freescale Semiconductor, Inc. Running the Demonstration File OVERVIEW . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-3 SETTING UP THE DEMONSTRATION . . . . . . . . . . . . . . . . 2-3 RUNNING THE DEMONSTRATION . . . . . . . . . . . . . . . . . . . 2-4 Freescale Semiconductor, Inc... 2.1 2.2 2.3 2-2 DSP56302EMUM/AD, Preliminary For More Information On This Product, Go to: www.freescale.com MOTOROLA Freescale Semiconductor, Inc. Running the Demonstration File Overview 2.1 OVERVIEW This section describes the demonstration that is included with the DSP56302EVM. The demonstration is designed to show the advantage of 24-bit DSPs over 16-bit DSPs. Even if the system input data is limited by a 16-bit data converter, the system can still benefit greatly from using the 24-bit DSP architecture. Freescale Semiconductor, Inc... This demonstration takes an input signal, digitizes it, and adds a 60 Hz tone to simulate the noise that can be generated by a 60 Hz AC power line. The signal is then filtered using one of three sets of coefficients. The first set of coefficients performs no filtering, simply allowing the corrupted signal to pass through. The second set of coefficients use 24-bit coefficients to correspond to a 60 Hz notch filter that removes the 60 Hz portion of the corrupted signal. The final set of coefficients are the same as those used for the 24-bit filtering, only rounded to 16 bits. The following sections give step-by-step instructions on how to run this demo. 2.2 SETTING UP THE DEMONSTRATION Perform the following steps to set up the demonstration: 1. Set up the audio source, preferably a music source with a headphone output, such as a portable radio, tape player, or CD player. 2. Make sure the DSP56302EVM has been installed and tested, as described in Section 1. 3. Using the cable with the 1/8-inch stereo plugs, connect the output of the audio source to the stereo input jack labelled P3/IN on the DSP56302EVM. 4. Connect a pair of headphones to the stereo headphone jack labelled P4/HDPHNE on the DSP56302EVM. Refer to Figure 2-1 for the locations of the line input and headphone jacks. 5. Start the audio source and put on the headphones. MOTOROLA DSP56302EMUM/AD, Preliminary For More Information On This Product, Go to: www.freescale.com 2-3 Freescale Semiconductor, Inc. Running the Demonstration File Running the Demonstration MCM6306 MCM6306 J6 ESSI1/SCI SW1 Command Converter MC34164 IRQA PEROM J2 J7 ESSI0 Freescale Semiconductor, Inc... POWER P2 Debug LED SW2 J5 JTAG J4 SW3 P4 HDPHNE CS4215 Codec MC74HCT04 Power LED LT1085 P5 OUT IRQD COMMAND CONVERTER SELECT MC74HCT241 LT1085 Reset DSP56302 SRAM AT29LV512 J1 DSP56002 P1 J8 ISA CONNECTOR Timer LED J9 MCM6306 J3 MC145407 JTAG/ OnCE P3 IN MC33078 Serial # Figure 2-1 DSP56302EVM Component Layout 2.3 RUNNING THE DEMONSTRATION To run the demonstration: 1. Start Windows. 2. Invoke the Debugger by double-clicking on the icon labelled evm30xw in the evm5630x program group. 3. Click on the command window and type force r to reset the DSP56302 and enter the debug mode. 4. Type in load 60hzdemo to load the demonstration file into the DSP56302. 2-4 DSP56302EMUM/AD, Preliminary For More Information On This Product, Go to: www.freescale.com MOTOROLA Freescale Semiconductor, Inc. Running the Demonstration File Running the Demonstration 5. Finally, type go to begin the demonstration. The first set of coefficients (no filtering) is used when the demonstration begins. The first set of coefficients performs no filtering, simply allowing the corrupted signal to pass. Thus, the output contains the input signal with the added 60 Hz tone when the demo begins. Freescale Semiconductor, Inc... 6. Briefly press SW2 to invoke external internal request A (IRQA). Invoking IRQA causes the DSP to use the 24-bit filter coefficients. Refer to Figure 2-1 for the location of SW2. 7. To hear the results of using the 16-bit coefficients, briefly press the switch labeled SW3. This invokes the external interrupt request D (IRQD), which causes the DSP to use the 16-bit filter coefficients. Refer to Figure 2-1 for the location of SW3. Note: You will hear a significant difference between filtering with the 24-bit and 16-bit coefficients. The reason for this contrast is that it is impossible to place the notch of the filter exactly on 60 Hz with 16-bit coefficients. The 16-bit filter notch is slightly offset and, therefore, misses the frequency of the noise. With the 24-bit coefficients, it is possible to place the filter notch exactly on 60 Hz. 8. To stop the execution of the demo, type force r in the command window in the bottom left corner of the screen. 9. To exit the Debugger, type quit. MOTOROLA DSP56302EMUM/AD, Preliminary For More Information On This Product, Go to: www.freescale.com 2-5 Freescale Semiconductor, Inc. Running the Demonstration File Freescale Semiconductor, Inc... Running the Demonstration 2-6 DSP56302EMUM/AD, Preliminary For More Information On This Product, Go to: www.freescale.com MOTOROLA Freescale Semiconductor, Inc. SECTION 3 Freescale Semiconductor, Inc... EXAMPLE TEST PROGRAM MOTOROLA DSP56302EMUM/AD, Preliminary For More Information On This Product, Go to: www.freescale.com 3-1 Freescale Semiconductor, Inc. Freescale Semiconductor, Inc... Example Test Program 3.1 3.2 3.2.1 3.2.2 3.3 3.3.1 3.3.2 3.3.3 3.3.4 3.4 3.4.1 3.4.2 3.5 3.6 3-2 OVERVIEW . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-3 WRITING THE PROGRAM . . . . . . . . . . . . . . . . . . . . . . . . . . 3-4 Source Statement Format . . . . . . . . . . . . . . . . . . . . . . . . . 3-4 Example Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-5 ASSEMBLING THE PROGRAM . . . . . . . . . . . . . . . . . . . . . . 3-7 Assembler Command Format . . . . . . . . . . . . . . . . . . . . . . 3-7 Assembler Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-8 Assembler Directives . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-11 Assembling the Example Program . . . . . . . . . . . . . . . . . 3-16 MOTOROLA DSP LINKER . . . . . . . . . . . . . . . . . . . . . . . . . 3-16 Linker Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-17 Linker Directives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-23 INTRODUCTION TO THE DEBUGGER SOFTWARE . . . . 3-24 RUNNING THE PROGRAM . . . . . . . . . . . . . . . . . . . . . . . . 3-26 DSP56302EMUM/AD, Preliminary For More Information On This Product, Go to: www.freescale.com MOTOROLA Freescale Semiconductor, Inc. Example Test Program Overview 3.1 OVERVIEW Freescale Semiconductor, Inc... This section contains an example that illustrates how to develop a very simple program for the DSP56302. This example has been designed for users who have little or no experience with the DSP development tools. The example demonstrates the form of assembly programs, gives instructions on how to assemble programs, and shows how the Debugger can be used to verify the operation of programs. rounded blocks represent the assembly and object files. The white blocks represent software programs to assemble and link the assemble programs. The gray blocks represent hardware products. The following sections give basic information regarding the assembly program, the Assembler, the Linker and the object files. Detailed information about these subjects can be found in the Assembler and Linker manuals provided with the Motorola DSP CLAS software package available through your Motorola sales office or distributor. The documentation is also available through the Motorola DSP internet URL http://www.motorola-dsp.com. Assembly Program *.asm Assembler Relocatable Object File *.cln Linker Executable Object File *.cld ADS Command DSP56002 Converter Card DSP56302 DSP56302EVM Figure 3-1 Development Process Flow MOTOROLA DSP56302EMUM/AD, Preliminary For More Information On This Product, Go to: www.freescale.com 3-3 Freescale Semiconductor, Inc. Example Test Program Writing the Program 3.2 WRITING THE PROGRAM The following sections describe the format of assembly language source statements and give an example assembly program. Freescale Semiconductor, Inc... 3.2.1 Source Statement Format Programs written in assembly language consist of a sequence of source statements. Each source statement may include up to six fields separated by one or more spaces or tabs: a label field, an operation field, an operand field, up to two data transfer fields, and a comment field. For example, the following source statement shows all six possible fields: trm Label mac x0,y0,a Operation Operand x:(r0)+,x0 y:(r4)+,y0 X Data Transfer Y Data Transfer ;Text Comment 3.2.1.1 Label Field The label field is the first field of a source statement and can take one of the following forms: * A space or tab as the first character on a line ordinarily indicates that the label files is empty and that the line has no label. * An alphabetic character as the first character indicates that the line contains a symbol called a label. * An underscore as the first character indicated that the label is a local label. With the exception of some directives, a label is assigned the value of the location counter of the first word of the instruction or data being assembled. A line consisting of a label only is a valid line and has the effect of assigning the value of the location counter to the label. 3.2.1.2 Operation Field The operation field appears after the label field and must be preceded by at least one space or tab. Entries in the operation field may be one of three types: * Opcode--mnemonics that correspond directly to DSP machine instructions * Directive--special operation codes known to the Assembler which control the assembly process 3-4 DSP56302EMUM/AD, Preliminary For More Information On This Product, Go to: www.freescale.com MOTOROLA Freescale Semiconductor, Inc. Example Test Program Writing the Program * Macro call--invocation of a previously defined macro which is to be inserted in place of the macro call Freescale Semiconductor, Inc... 3.2.1.3 Operand Field The interpretation of the operand field is dependent on the contents of the operation field. The operand field, if present, must follow the operation field and must be preceded by at least one space or tab. 3.2.1.4 Data Transfer Fields Most opcodes can specify one or more data transfers to occur during the execution of the instruction. These data transfers are indicated by two addressing mode operands separated by a comma, with no embedded blanks. If two data transfers are specified, they must be separated by one or more blanks or tabs. Refer to the DSP56300 Family Manual for a complete discussion of addressing modes that are applicable to data transfer specifications. 3.2.1.5 Comment Field Comments are not considered significant to the Assembler, but can be included in the source file for documentation purposes. A comment field is composed of any characters that are preceded by a semicolon. 3.2.2 Example Program This program takes two lists of data, one in X memory, and one in Y memory, and calculates the sum of the products of the two lists. Calculating the sum of products is the basis for many DSP functions. Therefore, the DSP56302 has a special instruction (MAC) which multiplies two values and adds the result to the contents of an accumulator. This program is provided as example.asm on the DSP56302EVM diskette and is placed in the evm30xw directory by the installation procedure. MOTOROLA DSP56302EMUM/AD, Preliminary For More Information On This Product, Go to: www.freescale.com 3-5 Freescale Semiconductor, Inc. Example Test Program Writing the Program Freescale Semiconductor, Inc... Example 3-1 Simple DSP56302 Code Example ;************************************************************* ;A SIMPLE PROGRAM: CALCULATING THE SUM OF PRODUCTS ;************************************************************* PBASE EQU $100 ;instruct the assembler to replace ;every occurrence of PBASE with $200 XBASE EQU $0 ;used to define the position of the ;data in X memory YBASE EQU $0 ;used to define the position of the ;data in Y memory ;************************************************************* ;X MEMORY ;************************************************************* org x:XBASE ;instructs the assembler that we ;are referring to X memory starting ;at location XBASE list1 dc $475638,$738301,$92673a,$898978,$091271,$f25067 dc $987153,$3A8761,$987237,$34b852,$734623,$233763 dc $f76756,$423423,$324732,$f40029 ;************************************************************* ;Y MEMORY ;************************************************************* org y:YBASE ;instructs the assembler that we ;are referring to Y memory starting ;at location YBASE list2 dc $f98734,$800000,$fedcba,$487327,$957572,$369856 dc $247978,$8a3407,$734546,$344787,$938482,$304f82 dc $123456,$657784,$567123,$675634 ;************************************************************* ;PROGRAM ;************************************************************* org p:0 ;put following program in program ;memory starting at location 0 jmp begin ;p:0 is the reset vector i.e. where ;the DSP looks for instructions ;after a reset org p:PBASE ;start the main program at p:PBASE begin move move clr move 3-6 #list1,r0 ;set up pointer to start of list1 #list2,r4 ;set up pointer to start of list2 a ;clear accumulator a x:(r0)+,x0 y:(r4)+,y0 ;load the value of X memory pointed ;to by the contents of r0 into x0 and ;post-increment r0 ;load the value of Y memory pointed ;to by the contents of r4 into y0 and ;post-increment r4 DSP56302EMUM/AD, Preliminary For More Information On This Product, Go to: www.freescale.com MOTOROLA Freescale Semiconductor, Inc. Example Test Program Assembling the Program Example 3-1 Simple DSP56302 Code Example (Continued) #15,endloop;do 15 times x0,y0,a x:(r0)+,x0 y:(r4)+,y0 ;multiply and accumulate, and load ;next values endloop jmp * ;this is equivalent to ;label jmp label ;and is therefore a never-ending, ;empty loop ;************************************************************* ;END OF THE SIMPLE PROGRAM ;************************************************************* Freescale Semiconductor, Inc... do mac 3.3 ASSEMBLING THE PROGRAM The following sections describe the format of the Assembler command, give a list of Assembler special characters and directives, and give instructions to assemble the example program. 3.3.1 Assembler Command Format The Motorola DSP Assembler is included with the DSP56302EVM on the Motorola 3-1/2 inch diskette and can be installed by following the instructions in Section 1.3.3. The Motorola DSP Assembler is a program that translates assembly language source statements into object programs compatible with the DSP56302. The general format of the command line to invoke the Assembler is: asm56300 [options] where asm56300 is the name of the Motorola DSP Assembler program, and is a list of the assembly language programs to be assembled. The following section describes the Assembler options. To avoid ambiguity, the option arguments should immediately follow the option letter with no blanks between them. MOTOROLA DSP56302EMUM/AD, Preliminary For More Information On This Product, Go to: www.freescale.com 3-7 Freescale Semiconductor, Inc. Example Test Program Assembling the Program 3.3.2 Assembler Options -A This option indicates that the Assembler should run in absolute mode, generating an absolute object file when the -B command line option is given. By default, the Assembler produces a relocatable object file that is subsequently processed by the Motorola DSP Linker. Freescale Semiconductor, Inc... -B This option specifies that an object file is to be created for Assembler output. can be any legal operating system filename, including an optional pathname. The type of object file produced depends on the Assembler operation mode. If the -A option is supplied on the command line, the Assembler operates in absolute mode and generates an absolute object (.cld) file. If there is no -A option on the command line, the Assembler operates in relative mode and creates a relocatable object (.cln) file. If the -B option is not specified, the Assembler will not generate an object file. If no is specified, the Assembler will use the basename (filename without extension) of the first filename encountered in the source input file list and append the appropriate file type (.cln or.cld) to the basename. The -B option should be specified only once. Example: asm56300 -Bfilter main.asm fft.asm fio.asm This example assembles the files main.asm, fft.asm, and fio.asm together to produce the relocatable object file filter.cln. -D This option replaces all occurrences of with in the source files to be assembled. Example: asm56300 -DPOINTS 16 prog.asm This example replaces all occurrences of the symbol POINTS in the program prog.asm by the string `16'. -EA or -EW These options allow the standard error output file to be reassigned on hosts that do not support error output redirection from the command line. must be present as an argument, but can be any legal operating system filename, including an 3-8 DSP56302EMUM/AD, Preliminary For More Information On This Product, Go to: www.freescale.com MOTOROLA Freescale Semiconductor, Inc. Example Test Program Assembling the Program optional pathname. The -EA option causes the standard error stream to be written to ; if exists, the output stream is appended to the end of the file. The -EW option also writes the standard error stream to ; if exists, it will be overwritten. Example: asm56300 -EWerrors prog.asm This example redirects the standard output to the file errors. If the file already exists, it will be overwritten. Freescale Semiconductor, Inc... -F This option indicates that the Assembler should read command line input from . can be any legal operation system filename, including an optional pathname. is a text file containing further options, arguments, and filenames to be passed to the Assembler. The arguments in the file need to be separated only by some form of white space. A semicolon on a line following white space makes the rest of the line a comment. Example: asm56300 -Fopts.cmd This example invokes the Assembler and takes the command line options and source filenames from the command file opts.cmd. -G This option sends the source file line number information to the object file. This option is valid only in conjunction with the -B command line option. The generated line number information can be used by debuggers to provide source-level debugging. Example: asm56300 -B -Gmyprog.asm This example assembles the file myprog.asm and sends the source file line number information to the resulting object file myprog.cln. -I This option causes the Assembler to look in the directory defined by for any include file not found in the current directory. can be any legal operating system pathname. Example: asm56300 -I\project\ testprog MOTOROLA DSP56302EMUM/AD, Preliminary For More Information On This Product, Go to: www.freescale.com 3-9 Freescale Semiconductor, Inc. Example Test Program Assembling the Program This example uses IBM PC pathname conventions, and would cause the Assembler to prefix any include files not found in the current directory with the \project\ pathname. -L Freescale Semiconductor, Inc... This option specifies that a listing file is to be created for Assembler output. can be any legal operating system filename, including an optional pathname. If no is specified, the Assembler will use the basename (filename without extension) of the first filename encountered in the source input file list and append .lst to the basename. The -L option should be specified only once. Example: asm56300 -L filter.asm gauss.asm This example assembles the files filter.asm and gauss.ams together to produce a listing file. Because no filename was given, the output file will be named using the basename of the first source file, in this case filter, and the listing file will be called filter.lst. -M This option causes the Assembler to look in the directory defined by for any macro file not found in the current directory. can be any legal operating system pathname. Example: asm56300 -Mfftlib\ trans.asm This example uses IBM PC pathname conventions, and would cause the Assembler to look in the fftlib subdirectory of the current directory for a file with the name of the currently invoked marco found in the source file, trans.asm. -V This option causes the Assembler to report assembly progress to the standard error output stream. -Z This option causes the Assembler to strip symbol information from the absolute load file. Normally symbol information is retained in the object file for symbolic references purposes. This option is only valid with the -A and -B options. Note: Multiple options can be used. A typical string might be: Example: asm56300 -A -B -L -G filename.asm 3-10 DSP56302EMUM/AD, Preliminary For More Information On This Product, Go to: www.freescale.com MOTOROLA Freescale Semiconductor, Inc. Example Test Program Assembling the Program 3.3.3 Assembler Directives Freescale Semiconductor, Inc... In addition to the DSP56302 instruction set, the assembly programs can contain mnemonic directives which specify auxiliary actions to be performed by the Assembler. These are the Assembler directives. These directives are not always translated into machine language. The following sections briefly describe the various types of Assembler directives. 3.3.3.1 Assembler Significant Characters There are several one and two character sequences that are significant to the Assembler. The Assembler significant characters are: ; - Comment delimiter ;; - Unreported comment delimiter \ - Line continuation character or macro dummy argument concatenation operator ? - Macro value substitution operator % - Macro hex value substitution operator ^ - Macro local label override operator " - Macro string delimiter or quoted string DEFINE expansion character @ - Function delimiter * - Location counter substitution ++ - String concatenation operator [] - Substring delimiter << - I/O short addressing mode force operator < - Short addressing mode force operator > - Long addressing mode force operator # - Immediate addressing mode operator #< - Immediate short addressing mode force operator #> - Immediate long addressing mode force operator MOTOROLA DSP56302EMUM/AD, Preliminary For More Information On This Product, Go to: www.freescale.com 3-11 Freescale Semiconductor, Inc. Example Test Program Assembling the Program 3.3.3.2 Assembly Control The directives used for assembly control are: Freescale Semiconductor, Inc... COMMENT - Start comment lines DEFINE - Define substitution string END - End of source program FAIL - Programmer generated error message FORCE - Set operand forcing mode HIMEM - Set high memory bounds INCLUDE - Include secondary file LOMEM - Set low memory bounds MODE - Change relocation mode MSG - Programmer generated message ORG - Initialize memory space and location counters RADIX - Change input radix for constants RDIRECT - Remove directive or mnemonic from table SCSJMP - Set structured control branching mode SCSREG - Reassign structured control statement registers UNDEF - Undefine DEFINE symbol WARN - Programmer generated warning 3-12 DSP56302EMUM/AD, Preliminary For More Information On This Product, Go to: www.freescale.com MOTOROLA Freescale Semiconductor, Inc. Example Test Program Assembling the Program Freescale Semiconductor, Inc... 3.3.3.3 Symbol Definition The directives used to control symbol definition are: ENDSEC - End section EQU - Equate symbol to a value GLOBAL - Global section symbol declaration GSET - Set global symbol to a value LOCAL - Local section symbol declaration SECTION - Start section SET - Set symbol to a value XDEF - External section symbol definition XREF - External section symbol reference 3.3.3.4 Data Definition/Storage Allocation The directives used to control constant data definition and storage allocation are: BADDR - Set buffer address BSB - Block storage bit-reverse BSC - Block storage of constant BSM - Block storage modulo BUFFER - Start buffer DC - Define constant DCB - Define constant byte DS - Define storage DSM - Define modulo storage DSR - Define reverse carry storage ENDBUF - End buffer MOTOROLA DSP56302EMUM/AD, Preliminary For More Information On This Product, Go to: www.freescale.com 3-13 Freescale Semiconductor, Inc. Example Test Program Assembling the Program Freescale Semiconductor, Inc... 3.3.3.5 Listing Control and Options The directives used to control the output listing are: LIST - List the assembly LSTCOL - Set listing field widths NOLIST - Stop assembly listing OPT - Assembler options PAGE - Top of page/size page PRCTL - Send control string to printer STITLE - Initialize program subtitle TABS - Set listing tab stops TITLE - Initialize program title 3.3.3.6 Object File Control The directives used for control of the object file are: COBJ - Comment object code IDENT - Object code identification record SYMOBJ - Write symbol information to object file 3-14 DSP56302EMUM/AD, Preliminary For More Information On This Product, Go to: www.freescale.com MOTOROLA Freescale Semiconductor, Inc. Example Test Program Assembling the Program Freescale Semiconductor, Inc... 3.3.3.7 Macros and Conditional Assembly The directives used for macros and conditional assembly are: DUP - Duplicate sequence of source lines DUPA - Duplicate sequence with arguments DUPC - Duplicate sequence with characters DUPF - Duplicate sequence in loop ENDIF - End of conditional assembly ENDM - End of macro definition EXITM - Exit macro IF - Conditional assembly directive MACLIB - Macro library MACRO - Macro definition PMACRO - Purge macro definition 3.3.3.8 Structured Programming The directives used for structured programming are: .BREAK - Exit from structured loop construct .CONTINUE - Continue next iteration of structured loop .ELSE - Perform following statements when .IF false .ENDF - End of .FOR loop .ENDI - End of .IF condition .ENDL - End of hardware loop .ENDW - End of .WHILE loop .FOR - Begin .FOR loop .IF - Begin .IF condition .LOOP - Begin hardware loop .REPEAT - Begin .REPEAT loop .UNTIL - End of .REPEAT loop .WHILE - Begin .WHILE loop MOTOROLA DSP56302EMUM/AD, Preliminary For More Information On This Product, Go to: www.freescale.com 3-15 Freescale Semiconductor, Inc. Example Test Program Motorola DSP Linker 3.3.4 Assembling the Example Program Freescale Semiconductor, Inc... The Assembler is a MS-DOS based program, thus to use the Assembler you will need to exit Windows or open a MS-DOS Prompt Window. To assemble the example program, type asm56300 -a -b -l -g example.asm in the evm30xw directory created by the installation process from Section 1.3.3. This will create two additional files: example.cld and example.lst. The example.cld file is the absolute object file of the program, and this is what will be downloaded into the DSP56302. The example.lst file is the listing file and gives full details of where the program and data will be placed in the DSP56302 memory. 3.4 MOTOROLA DSP LINKER Though not needed for our simple example, the Motorola DSP Linker is also included with the DSP56302EVM. The Motorola DSP Linker is a program that processes relocatable object files produced by the Motorola DSP Assembler, generating an absolute executable file which can be downloaded to the DSP56302. The Motorola DSP Linker is included on the Motorola 3-1/2 inch diskette and can be installed by following the instructions in Section 1.3.3. The general format of the command line to invoke the Linker is: dsplnk [options] where dsplnk is the name of the Motorola DSP Linker program, and is a list of the relocatable object files to be linked. The following section describes the Linker options. To avoid ambiguity, the option arguments should immediately follow the option letter with no blanks between them. 3-16 DSP56302EMUM/AD, Preliminary For More Information On This Product, Go to: www.freescale.com MOTOROLA Freescale Semiconductor, Inc. Example Test Program Motorola DSP Linker 3.4.1 Linker Options -A This option auto-aligns circular buffers. Any modulo or reverse-carry buffers defined in the object file input sections are relocated independently in order to optimize placement in memory. Code and data surrounding the buffer are packed to fill the space formerly occupied by the buffer and any corresponding alignment gaps. Freescale Semiconductor, Inc... Example: dsplnk -A myprog.cln This example links the file myprog.cln and optimally aligns any buffers encountered in the input. -B This option specifies that an object file is to be created for Linker output. can be any legal operating system filename, including an optional pathname. If no filename is specified, or if the -B option is not present, the Linker will use the basename (filename without extension) of the first filename encountered in the input file list and append .cld to the basename. If the -I option is present (see below), an explicit filename must be given. This is because if the Linker followed the default action, it possibly could overwrite one of the existing input files. The -B option should be specified only once. If the file named in the -B option already exists, it will be overwritten. Example: dsplnk -Bfilter.cld main.cln fft.cln fio.cln In this example, the files main.cln, fft.cln, and fio.cln are linked together to produce the absolute executable file filter.cld. -EA or -EW These options allow the standard error output file to be reassigned on hosts that do not support error output redirection from the command line. must be present as an argument, but can be any legal operating system filename, including an optional pathname. The -EA option causes the standard error stream to be written to ; if exists, the output stream is appended to the end of the file. The -EW option also writes the standard error stream to ; if exists it will be overwritten. Example: dsplnk -EWerrors myprog.cln MOTOROLA DSP56302EMUM/AD, Preliminary For More Information On This Product, Go to: www.freescale.com 3-17 Freescale Semiconductor, Inc. Example Test Program Motorola DSP Linker This example redirects the standard error output to the file errors. If the file already exists, it will be overwritten. -F Freescale Semiconductor, Inc... This option indicates that the Linker should read command line input from . can be any legal operating system filename, including an optional pathname. is a text file containing further options, arguments, and filenames to be passed to the Linker. The arguments in the file need be separated only by some form of white space. A semicolon on a line following white space makes the rest of the line a comment. Example: dsplnk -Fopts.cmd This example invokes the Linker and takes command line options and input filenames from the command file opts.cmd. -G This option sends source file line number information to the object file. The generated line number information can be used by debuggers to provide source-level debugging. Example: dsplnk -B -Gmyprog.cln This example links the file myprog.cln and sends source file line number information to the resulting object file myprog.cld. -I The Linker ordinarily produces an absolute executable file as output. When the -I option is given, the Linker combines the input files into a single relocatable object file suitable for reprocessing by the Linker. No absolute addresses are assigned and no errors are issued for unresolved external references. Note that the -B option must be used when performing incremental linking in order to give an explicit name to the output file. If the filename were allowed to default, it could overwrite an existing input file. Example: dsplnk -I -Bfilter.cln main.cln fft.cln fio.cln In this example, the files main.cln, fft.cln, and fio.cln are combined to produce the relocatable object file filter.cln. 3-18 DSP56302EMUM/AD, Preliminary For More Information On This Product, Go to: www.freescale.com MOTOROLA Freescale Semiconductor, Inc. Example Test Program Motorola DSP Linker Freescale Semiconductor, Inc... -L The Linker ordinarily processes a list of input files which each contain a single relocatable code module. If the -L option is encountered, the Linker treats the following argument as a library file and searches the file for any outstanding unresolved references. If a module is found in the library that resolves an outstanding external reference, the module is read from the library and included in the object file output. The Linker continues to search a library until all external references are resolved or no more references can be satisfied within the current library. The Linker searches a library only once, when it is encountered on the command line. Therefore, the position of the -L option on the command line is significant. Example: dsplnk -B filter main fir -Lio This example illustrates linking with a library. The files main.cln and fir.cln are combined with any needed modules in the library io.lib to create the file filter.cld. -M This option indicates that a map file is to be created. can be any legal operating system filename, including an optional pathname. If no filename is specified, the Linker will use the basename (filename without extension) of the first filename encountered in the input file list and append .map to the basename. If the -M option is not specified, then the Linker will not generate a map file. The -M option should be specified only once. If the file named in the -M option already exists, it will be overwritten. Example: dsplnk -M filter.cln gauss.cln In this example, the files filter.cln and gauss.cln are linked together to produce a map file. Because no filename was given with the -M option, the output file will be named using the basename of the first input file, in this case filter. The map file will be called filter.map. -N The Linker considers case significant in symbol names. When the -N option is given the Linker ignores case in symbol names; all symbols are mapped to lower case. Example: dsplnk -N filter.cln fft.cln fio.cln MOTOROLA DSP56302EMUM/AD, Preliminary For More Information On This Product, Go to: www.freescale.com 3-19 Freescale Semiconductor, Inc. Example Test Program Motorola DSP Linker In this example, the files filter.cln, fft.cln, and fio.cln are linked to produce the absolute executable file filetr.cld. All symbol references are mapped to lower case. Freescale Semiconductor, Inc... -O[][]: By default the Linker generates instructions and data for the output file beginning at absolute location zero for all DSP memory spaces. This option allows the programmer to redefine the start address for any memory space and associated location counter. is one of the single-character memory space identifiers (X, Y, L, P). The letter may be upper or lower case. The optional is a letter indicating the High (H) or Low (L) location counters. If no counter is specified the default counter is used. is also optional and signifies the desired physical mapping for all relocatable code in the given memory space. It may be I for Internal memory, E for External memory, R for ROM, A for Port A, and B for Port B. If is not supplied, then no explicit mapping is presumed. The is a hexadecimal number signifying the new relocation address for the given memory space. The -O option may be specified as many times as needed on the command line. This option has no effect if incremental linking is being done (see the -I option). Example: dsplnk -Ope:200 myprog -Lmylib This example initializes the default P memory counter to hex 200 and maps the program space to external memory. -P When the Linker encounters input files, the current directory (or the directory given in the library specification) is first searched for the file. If it is not found and the -P option is specified, the Linker prefixes the filename (and optional pathname) of the file specification with and searches the newly formed directory pathname for the file.The pathname must be a legal operating system pathname. The -P option may be repeated as many times as desired. Example: dsplnk -P\project\ testprog This example uses IBM PC pathname conventions, and would cause the Linker to prefix any library files not found in the current directory with the \project\ pathname. -R This option indicates that a memory control file is to be read to determine the placement of sections in DSP memory and other Linker control functions. can 3-20 DSP56302EMUM/AD, Preliminary For More Information On This Product, Go to: www.freescale.com MOTOROLA Freescale Semiconductor, Inc. Example Test Program Motorola DSP Linker be any legal operating system filename, including an optional pathname. If a pathname is not specified, an attempt will be made to open the file in the current directory. If no filename is specified, the Linker will use the basename (filename without extension) of the first filename encountered in the link input file list and append .ctl to the basename. If the -R option is not specified, then the Linker will not use a memory control file. The -R option should be specified only once. Example: dsplnk -Rproj filter.cln gauss.cln Freescale Semiconductor, Inc... In this example, the files filter.cln and gauss.cln are linked together using the memory file proj.ctl. -U This option allows the declaration of an unresolved reference from the command line. must be specified. This option is useful for creating an undefined external reference in order to force linking entirely from a library. Example: dsplnk -Ustart -Lproj.lib This example declares the symbol start undefined so that it will be resolved by code within the library proj.lib. -V This option causes the Linker to report linking progress (beginning of passes, opening and closing of input files) to the standard error output stream. This is useful to insure that link editing is proceeding normally. Example: dsplnk -V myprog.cln This example links the file myprog.cln and sends progress lines to the standard error output. MOTOROLA DSP56302EMUM/AD, Preliminary For More Information On This Product, Go to: www.freescale.com 3-21 Freescale Semiconductor, Inc. Example Test Program Motorola DSP Linker -X[,,...,] Freescale Semiconductor, Inc... The -X option provides for link time options that alter the standard operation of the Linker. The options are described below (* means default). All options may be preceded by NO to reverse their meaning. The -X sequence can be repeated for as many options as desired. Option Meaning ABC* Perform address bounds checking AEC* Check form of address expressions ASC Enable absolute section bounds checking CSL Cumulate section length data ESO Do not allocate memory below ordered sections OVLP Warn on section overlap RO Allow region overlap RSC* Enable relative section bounds checking SVO Preserve object file on errors WEX Add warning count to exit status Example: dsplnk -XWEX filter.cln fft.cln fio.cln This example allows the Linker to add the warning count to the exit status so that a project build will abort on warnings as well as errors. -Z This option allows the Linker to strip source file line number and symbol information from the output file. Symbol information normally is retained for debugging purposes. This option has no effect if incremental linking is being done (see the -I option). Example: dsplnk -Zfilter.cln fft.cln fio.cln In this example, the files filter.cln, fft.cln, and fio.cln are linked to produce the absolute object file filter.cln. The output file will contain no symbol or line number information. 3-22 DSP56302EMUM/AD, Preliminary For More Information On This Product, Go to: www.freescale.com MOTOROLA Freescale Semiconductor, Inc. Example Test Program Motorola DSP Linker 3.4.2 Linker Directives Freescale Semiconductor, Inc... Similar to the Assembler directives, the Linker includes mnemonic directives which specify auxiliary actions to be performed by the Linker. The following sections briefly describe the Linker directives. BALIGN -Auto-align circular buffers BASE - Set region base address IDENT - Object module identification INCLUDE - Include directive file MAP - Map file format control MEMORY - Set region high memory address REGION - Establish memory region RESERVE - Reserve memory block SBALIGN - Auto-align section buffers SECSIZE - Pad section length SECTION - Set section base address SET - Set symbol value SIZSYM - Set size symbol START - Establish start address SYMBOL - Set symbol value MOTOROLA DSP56302EMUM/AD, Preliminary For More Information On This Product, Go to: www.freescale.com 3-23 Freescale Semiconductor, Inc. Example Test Program Introduction to the Debugger Software Freescale Semiconductor, Inc... 3.5 INTRODUCTION TO THE DEBUGGER SOFTWARE This section will give a brief introduction of the Domain Technologies Debugger, detailing only that which is required to work through this example. Full details of the Debugger and an informative tutorial can be found in the Debug-56K Manual. The Domain Technologies Debugger is a software development system for the DSP56302. The Domain Technologies Debugger is included with the DSP56302EVM on the Domain Technologies 3-1/2 inch diskette and can be installed by following the instructions in Section 1.3.3. To invoke the Debugger, double-click on the icon labelled evm30xw in the EVM5630x program group that was created when the Debugger was installed. The Debugger display will be similar to Figure 3-2 with the screen divided into four windows: the command window, the data window, the unassembly window, and the registers window. The command window is the window selected, which means that key strokes will be placed in the command window. As shown in the demonstration from Section 2, the command window is where commands are entered. The data window is used to display DSP56302 data. The unassembly window is used to display the DSP56302 programs. The next instruction to be executed will be highlighted. The registers window shows the contents of the DSP56302 internal registers. 3-24 DSP56302EMUM/AD, Preliminary For More Information On This Product, Go to: www.freescale.com MOTOROLA Freescale Semiconductor, Inc. Example Test Program Freescale Semiconductor, Inc... Introduction to the Debugger Software Figure 3-2 Example Debugger Window Display When the command window is selected as in Figure 3-2, the tool-bar at the top of the screen contains buttons for the most often used commands. From right to left the commands are: go, stop, step, jump, automatic update, reset and radix. The go button runs the DSP56302 from the program counter. The stop button stops the DSP56302. The step button executes a single instruction. The jump button is similar to the step button, except that subroutines are treated as one instruction. The automatic update button turns the automatic screen update mode on, so that the DSP56302 is interrupted periodically to update the data and registers windows. The reset button resets the DSP56302. The radix button can be used to change the radix of the selected window. Other buttons will appear when other windows are selected, and the function of these buttons can be found in the Debug-56K Manual. MOTOROLA DSP56302EMUM/AD, Preliminary For More Information On This Product, Go to: www.freescale.com 3-25 Freescale Semiconductor, Inc. Example Test Program Running the Program 3.6 RUNNING THE PROGRAM Freescale Semiconductor, Inc... To load the example program developed above into the Debugger, click in the command window and type load example. The instruction at line 33 will be highlighted in the unassembly window as this will be the first instruction to be executed. However, before we start to execute the program, we should check that the values we expect to be in data memory are there. To do this, type display x:0 and display y:0. The data will be displayed in the data window. To step through the program, type step at the command window prompt. As a shortcut, you can click on the step button or you can type the start of the command and press the space bar, and the debugger will complete the remainder of the command. To repeat the last command, simply press return. As you step through the code, you will see the registers in the registers window being changed by the instructions. After each cycle, any register that has been changed will be brightened. Once you have stepped through the program, ensure that the program has executed correctly by checking that the result in accumulator a is: $FE 9F2051 6DFCC2. Stepping through the program like this is good for short programs, but it is impractical for large complex programs. The way to debug large programs is to set breakpoints. These are user-defined points at which execution of the code will stop, allowing the user to step through the section of interest. To set a breakpoint in the example to check that the values in r0 and r4 are correct before the do loop, type break p:$106 in the command window. You will see the line before the loop brighten in the unassembly window, indicating the breakpoint has been set. To point the DSP56302 back to the start point of the program, type change pc 0. This changes the program counter such that it is pointing to the reset vector. To start the program running type go or click on the go button. The DSP56302 will stop when it reaches the breakpoint, and you will be able to step through the remainder of the code. To exit the Debugger, type quit at the command prompt. 3-26 DSP56302EMUM/AD, Preliminary For More Information On This Product, Go to: www.freescale.com MOTOROLA Freescale Semiconductor, Inc. SECTION 4 Freescale Semiconductor, Inc... DSP56302EVM TECHNICAL SUMMARY MOTOROLA DSP56302EMUM/AD, Preliminary For More Information On This Product, Go to: www.freescale.com 4-1 Freescale Semiconductor, Inc. Freescale Semiconductor, Inc... DSP56302EVM Technical Summary 4.1 4.2 4.3 4.3.1 4.3.2 4.4 4.4.1 4.4.2 4.4.3 4.5 4-2 DSP56302EVM DESCRIPTION AND FEATURES . . . . . . . . 4-3 DSP56302 DESCRIPTION . . . . . . . . . . . . . . . . . . . . . . . . . . 4-3 MEMORY. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-4 SRAM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-5 Flash PEROM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-9 AUDIO CODEC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-10 Codec Analog Input/Output. . . . . . . . . . . . . . . . . . . . . . . 4-11 Codec Digital Interface . . . . . . . . . . . . . . . . . . . . . . . . . . 4-12 Codec Clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-13 COMMAND CONVERTER . . . . . . . . . . . . . . . . . . . . . . . . . 4-14 DSP56302EMUM/AD, Preliminary For More Information On This Product, Go to: www.freescale.com MOTOROLA Freescale Semiconductor, Inc. DSP56302EVM Technical Summary DSP56302EVM Description and Features 4.1 DSP56302EVM DESCRIPTION AND FEATURES An overview description of the DSP56302EVM is provided in the DSP56302EVM Product Information document (order number DSP56302EVMP/D) included with this kit. The main features of the DSP56302EVM include the following: * DSP56302 24-Bit Digital Signal Processor * Memory Freescale Semiconductor, Inc... * 16-bit CD-quality audio codec * Command Converter 4.2 DSP56302 DESCRIPTION A full description of the DSP56302, including functionality and user information is provided in the following documents included as a part of this kit: * DSP56302 Technical Data (order number DSP56302/D): Provides features list and specifications including signal descriptions, DC power requirements, AC timing requirements, and available packaging * DSP56302 User's Manual (order number DSP56302UM/AD): Provides an overview description of the DSP and detailed information about the on-chip components including the memory and I/O maps, peripheral functionality, and control and status register descriptions for each subsystem Note: The DSP56302 User's Manual is currently not available. The DSP56302 Product Specification, Revision 1.03 is being supplied with this kit as a replacement document. * DSP56300 Family Manual (order number DSP56300FM/AD): Provides a detailed description of the core processor including internal status and control registers and a detailed description of the family instruction set. Refer to these documents for detailed information about chip functionality and operation. Note: A detailed list of known chip errata is also provided with this kit. Refer to the DSP56302 Chip Errata document for information that has changed since the publication of the reference documentation listed above. The latest version can be obtained on the Motorola DSP worldwide web site at http://www.motorola-dsp.com. MOTOROLA DSP56302EMUM/AD, Preliminary For More Information On This Product, Go to: www.freescale.com 4-3 Freescale Semiconductor, Inc. DSP56302EVM Technical Summary Memory 4.3 MEMORY The DSP56302EVM uses the following memory: * 32 K x 24-bit Fast Static RAM (SRAM) for expansion memory Refer to Figure 4-1 for the location of the SRAM and PEROM on the DSP56302EVM. Figure 4-2 shows a functional block diagram of the DSP56302EVM including the memory devices. J3 MC145407 J8 ISA CONNECTOR J9 LED DSP56002 MCM6306 AT29LV512 J6 ESSI1/SCI MCM6306 JTAG/ OnCE MCM6306 Freescale Semiconductor, Inc... * 64 K x 8-bit Flash Programmable Erasable Read-Only Memory (PEROM) for stand-alone operation SW1 DSP56302 MC34164 J1 P1 J2 J7 ESSI0 POWER P2 Debug LED LT1085 J4 SW2 J5 JTAG SW3 COMMAND CONVERTER SELECT MC74HCT241 P4 HDPHNE CS4215 MC74HCT04 LT1085 P5 OUT Power LED P3 IN MC33078 Serial # Figure 4-1 DSP56302EVM Component Layout 4-4 DSP56302EMUM/AD, Preliminary For More Information On This Product, Go to: www.freescale.com MOTOROLA Freescale Semiconductor, Inc. DSP56302EVM Technical Summary Memory SRAM Three 32 K x 8 Flash SRAM PEROM 64 K x 8 SRAM Freescale Semiconductor, Inc... Data Bus RS-232 SSI SCI H O S T J4 Address Bus JTAG/ OnCETM Port HI08 J8 DSP56302 DSP56002 EXTAL I S A SCLK EXTAL ESSI0 P C 19.6608 MHz (optional) J7 Oscillator I n t e r f a c e 16.9344 MHz 153.6 KHz In Headphone 24.576 MHz CS4125 Out Figure 4-2 DSP56302EVM Functional Block Diagram 4.3.1 SRAM The DSP56302EVM uses three banks of 32 K x 8-bit fast Static RAM (Motorola MCM6306, labelled U4, U5, and U6) for memory expansion.The MCM6306 uses a single 3.3 volt power supply and has an access time of 15 ns. The following sections give more details on the operation of the SRAM. MOTOROLA DSP56302EMUM/AD, Preliminary For More Information On This Product, Go to: www.freescale.com 4-5 Freescale Semiconductor, Inc. DSP56302EVM Technical Summary Memory 4.3.1.1 SRAM Connections The basic connection for the SRAM is shown in Figure 4-3. Freescale Semiconductor, Inc... DSP56302 A0-A13 A14 AA3 D0-D7 AA0 RD WR SRAM A0-A13 A14 DQ0-DQ7 E G W Figure 4-3 SRAM Connections to the DSP56302 The data input/output pins DQ0-DQ7 for the first bank of SRAM are connected to the DSP56302 D0-D7 pins. Similarly, pins D8-D15 and D16-D23 of the DSP56302 are connected to the second and third bank of SRAM. The SRAM Write (W) and output (G) enable lines are connected to the DSP56302 Write (WR) and Read (RD) lines, respectively. The SRAM chip Enable (E) is generated by the DSP56302 Address Attribute 0 (AA0). The SRAM activity is controlled by AA0 and the corresponding Address Attribute Register 0 (AAR0). The SRAM Address input pins A0-A13 are connected to the respective Port A address pins of the DSP. The SRAM address line A14 may be connected to the DSP56302 Address Attribute 3 (AA3) or to the DSP56302 address pin A14. If the jumper on J9 connects pin 1 and 2 as in Figure 4-4a, then the SRAM address line A14 is connected to AA3 on the DSP56302. If the jumper on J9 connects pin 2 and 3 as in Figure 4-4b, then the SRAM address line A14 is connected to A14 on the DSP56302. J9 1 2 DSP AA3 J9 3 SRAM A14 a 1 2 DSP A14 3 SRAM A14 b Figure 4-4 Alternate Configurations for J9 Currently, the jumper on J9 MUST connect pins 2 and 3 so that the SRAM address line A14 is connected to the DSP56302 address line A14. This configuration selects a unified memory map of 32 K words. The unified memory does not contain partitioned X data, Y data, and program memory. Thus, access to P:$1000, X:$1000, 4-6 DSP56302EMUM/AD, Preliminary For More Information On This Product, Go to: www.freescale.com MOTOROLA Freescale Semiconductor, Inc. DSP56302EVM Technical Summary Memory Freescale Semiconductor, Inc... and Y:$1000 are treated as accesses to the same memory cell and 48-bit long memory data moves are not possible to or from the external SRAM. 4.3.1.2 Example: Programming AAR0 As mentioned above, the SRAM activity is controlled by the DSP56302 pin AA0 and the corresponding AAR0. AAR0 controls the external access type, the memory type, and which external memory addresses access the SRAM. Figure 4-5 shows the memory map that is attained with the AAR0 settings described in this example. (In this example, the Memory Switch bit in the Operating Mode Register (OMR) is set and the sixteen-bit compatibility bit in the status register is cleared.) In Figure 4-5, the SRAM responds to the 32 K of X and Y data memory addresses between $010000 and $017FFF. However, with the unified memory map, accesses to the same external memory location are treated as accesses to the same memory cell. Memory Map (MS = 1, SC = 0) Program X Data Y Data $FFFFFF = Internal Memory $FF0000 $018000 Unified SRAM $010000 $006000 $001400 $000000 Figure 4-5 Example Memory Map with the Unified External Memory The settings of AAR0 for this example are shown in Figure 4-6. The external Access Type bits (BAT1 and BAT0) are set to 0 and 1, respectively, to denote SRAM access. The Address Attribute Polarity bit (BAAP) is cleared to define AA0 as active low. Address multiplexing is not supported in the DSP56302; therefore, the address multiplexing bit BAM is cleared. Packing is not needed with the SRAM; thus, the packing enable bit BPAC is cleared to disable this option. MOTOROLA DSP56302EMUM/AD, Preliminary For More Information On This Product, Go to: www.freescale.com 4-7 Freescale Semiconductor, Inc. DSP56302EVM Technical Summary Memory 11 0 BNC3 BNC2 BNC1 BNC0 BPAC Freescale Semiconductor, Inc... 1 0 0 1 BAM BYEN BXEN BPEN BAAP BAT1 BAT0 0 0 1 1 0 0 0 23 1 12 X:$FFFFF9 External Access Type AA pin polarity Program space Enable X data space enable Y data space Enable Address Multiplexing Packing Enable Number of Address bits to compare BAC11 BAC10 BAC9 BAC8 BAC7 BAC6 BAC5 BAC4 BAC3 BAC2 BAC1 BAC0 0 0 0 0 0 0 0 1 0 0 0 0 Address to Compare Figure 4-6 Address Attribute Register AAR0 The P, X data, and Y data space Enable bits (BPEN, BXEN, and BYEN) define whether the SRAM is activated during external P, X data, or Y data space accesses respectively. For this example, the BXEN and BYEN bits are set, and BPEN is cleared to allow the SRAM to respond to X and Y data memory accesses only. The number of address bits to compare BNC(3:0) and the address to compare bits BAC(11:0) determine which external memory addresses access the SRAM. The BNC bits define the number of upper address bits that are compared between the BAC bits and the external address to determine if the SRAM is accessed. For this example, the SRAM is assigned to respond to addresses between $010000 and $017FFF. Thus, the BNC bits are set to $9 and the BAC bits are set to $010. If the nine Most Significant Bits of the external address are 000000010, the SRAM is accessed. 4-8 DSP56302EMUM/AD, Preliminary For More Information On This Product, Go to: www.freescale.com MOTOROLA Freescale Semiconductor, Inc. DSP56302EVM Technical Summary Memory 4.3.2 Flash PEROM The DSP56302EVM uses an Atmel AT29LV512 chip (U7) to provide a 64 K x 8 bit CMOS Flash PEROM for stand-alone operation (i.e., operation without accessing the DSP56302 through the OnCE port). The AT29LV512 uses a 3.3 V power supply and has a read access time of 200 ns. Freescale Semiconductor, Inc... 4.3.2.1 Flash PEROM Connections The basic connection for the Flash PEROM is shown in Figure 4-7. DSP56302 A0-A15 D0-D7 AA1 RD WR FLASH A0-A15 I/O0-I/O7 CE OE WE Figure 4-7 Flash PEROM Connections The Flash PEROM Address input pins (A0-A15) are connected to the respective Port A address pins on the DSP. The Flash PEROM data Input/Output pins I/O0-I/O7 are connected to the DSP56302 D0-D7 pins. The Flash Write Enable (WE) and Output Enable (OE) lines are connected to the DSP56302 Write (WR) and Read (RD) enable lines, respectively. Address Attribute 1 (AA1) generates the Flash chip enable CE. 4.3.2.2 Programming for Stand-Alone Operation The Flash PEROM allows the DSP56302EVM to work in stand-alone operation. The DSP56302 mode pins determine the chip operating mode and start-up procedure when the DSP56302 exits the Reset state. The switch at SW1 resets the DSP56302 by asserting and then clearing the RESET pin of the DSP56302. The mode pins MODA, MODB, MODC, and MODD are sampled as the DSP56302 exits the Reset state.The mode pins for the DSP56302EVM are set so that the DSP56302 will boot from the Flash PEROM after reset (Mode 1: MODA is set, MODB and MODC are cleared, and MODD is at either state). The flash.asm file, included on the DSP56302EVM diskette, allows the user to program the Flash PEROM with the code to be run by the DSP56302 in stand-alone operation. To prepare to program, the Flash PEROM stand-alone code should be written to program memory. After the stand-alone code is written into program memory, the size of the stand-alone code in words should be loaded into the register R1, and the address of the first word of stand-alone code should be loaded into the register R0. When invoked, flash.asm reads the stand-alone code from program MOTOROLA DSP56302EMUM/AD, Preliminary For More Information On This Product, Go to: www.freescale.com 4-9 Freescale Semiconductor, Inc. DSP56302EVM Technical Summary Audio Codec memory starting at the address pointed to by R0 and ending at the location defined by the value in R1, and writes the stand-alone code into the Flash PEROM. When the DSP56302 is reset, the internal bootstrap program will run. The bootstrap program reads the stand-alone code from the Flash PEROM and writes it to program memory. The bootstrap program then begins execution of the stand-alone code. Freescale Semiconductor, Inc... 4.4 AUDIO CODEC The DSP56302EVM analog section uses Crystal Semiconductor's CS4215 for two channels of 16 bit A/D conversion and two channels of 16-bit D/A conversion. Refer to Figure 4-1 on page 4-4 for the location of the codec on the DSP56302EVM and to Figure 4-2 on page 4-5 for a functional diagram of the codec within the evaluation module. The codec is very flexible, offering software selectable sampling frequencies of 8, 9.6, 16, 32, and 48 kHz. Other frequencies are achievable by changing the crystal or by adding a second crystal to the codec XTAL2I and XTAL2O pins. The CS4215 uses a 5 volt power supply. Thus, Motorola's MC74HCT241A is used to convert the voltage levels to and from the 3.3 volt DSP56302. Refer to the CS4215 data sheet included with this kit for more information. The ada_init.asm and echo.asm files included on the Motorola diskette give examples on how to program the codec. The ada_init.asm file contains the initialization code for the codec and the basic interrupt service routines for the ESSI transmit and receive interrupts. The echo.asm file is an example program that moves audio through the codec and adds a noticeable echo to the audio. The echo.asm file uses the ada_init.asm file. The ada_init.asm and echo.asm files have been set up such that the parameters can be changed by the user easily by changing one of a few control words. The codec is connected to the DSP56302 ESSI0 through the shorting jumpers on J7 shown in Figure 4-1 on page 4-4. By removing these jumpers, the user has full access to the ESSI0 pins of the DSP56302. The following sections describe the connections for the analog and digital sections of the codec. 4-10 DSP56302EMUM/AD, Preliminary For More Information On This Product, Go to: www.freescale.com MOTOROLA Freescale Semiconductor, Inc. DSP56302EVM Technical Summary Audio Codec 4.4.1 Codec Analog Input/Output The DSP56302EVM contains 1/8-inch stereo jacks for stereo input, output, and headphones. Figure 4-8 shows the analog circuitry of the codec. Freescale Semiconductor, Inc... CS4215 Stereo Input MINR MOUT1 (P3) MINL MOUT2 LINR HEADL HEADR HEADC LINL LOUTR Unused LOUTL Unused Headphones (P4) Stereo Output (P5) Figure 4-8 Codec Analog Input/Output Diagram The stereo jack labelled P3/IN on the DSP56302EVM connects to the codec left and right microphone inputs MINL and MINR through an attenuating buffer stage provided by Motorola's MC33078 dual op-amp at U10. Standard line level inputs are 2 VP and the codec requires that input levels be limited to 1 VP. Thus, the buffer stage forms a 6 dB attenuator. Additional internal amplifiers with a programmable 20 dB gain block are provided for the microphone inputs. The 20 dB gain block may be disabled using the control mode of the codec. The analog outputs of the codec are routed via an attenuator to a pair of line outputs, to a pair of headphone outputs, and to a pair of mono monitor speaker outputs. The Mono speaker Outputs (MOUT1 and MOUT2) are not used. The Headphone outputs (HEADL and HEADR) are connected to the stereo jack labelled P4/HDPHNE on the DSP56302EVM, which permits direct connection of stereo headphones to the DSP56302EVM. The Headphone Common return (HEADC) is the return path for large currents when driving headphones from HEADL and HEADR. The Line Outputs (LOUTR and LOUTL) provide the output analog signal through the stereo jack labelled P5/OUT on the DSP56302EVM. This jack can be selected in software to provide output swings of 2 VP or 2-8 VP. Refer to the CS4215 data sheet for technical details of the programming steps required to choose the output voltage swing. MOTOROLA DSP56302EMUM/AD, Preliminary For More Information On This Product, Go to: www.freescale.com 4-11 Freescale Semiconductor, Inc. DSP56302EVM Technical Summary Audio Codec 4.4.2 Codec Digital Interface Figure 4-9 shows the digital interface to the codec. Freescale Semiconductor, Inc... DSP56302 CS4215 STD0 SDIN SRD0 SDOUT SCK0 SCLK SC00 RESET SC01 D/C SC02 FSYNC Figure 4-9 Codec Digital Interface Connections The serial interface of the codec transfers digital audio data and control data into and out of the device. The codec communicates with the DSP56302 through the ESSI0, which consists of independent transmitter and receiver sections. On the DSP56302 side, the Serial Transmit Data (STD0) pin transmits data to the codec. The Serial Receive Data 0 (SRD0) pin receives data from the codec. These two pins are connected to the codec Serial Data Input (SDIN) and Serial Data Output (SDOUT) pins, respectively. The DSP56302 bidirectional Serial Clock (SCK0) pin provides the serial bit rate clock for the ESSI0 interface. It is connected to the codec Serial Clock (SCLK) pin. Data is transmitted on the rising edge of SCLK and is received on the falling edge of SCLK. The DSP56302 Serial Control 0 (SC00) pin is programmed to control the codec Reset signal RESET. Serial Control 1 (SC01) pin is programmed to control the codec Data/Control (D/C) select input pin . When D/C is low, SDIN and SDOUT contain control information. When D/C is high, SDIN and SDOUT contain data information. The Serial Control 2 (SC02) pin is connected to the codec Frame Sync (FSYNC) signal. A rising edge on FSYNC indicates that a new frame is about to start. FSYNC may be an input to the codec, or it may be an output from the codec. 4-12 DSP56302EMUM/AD, Preliminary For More Information On This Product, Go to: www.freescale.com MOTOROLA Freescale Semiconductor, Inc. DSP56302EVM Technical Summary Audio Codec 4.4.3 Codec Clock Figure 4-10 shows the clock generation diagram. CS4215 27 pF XTL1IN Freescale Semiconductor, Inc... 24.576 MHz XTL1OUT 27 pF 27 pF CLKOUT XTL2IN 16.9344 MHz (optional) XTL2OUT 27 pF CLKIN Figure 4-10 Codec Clock Generation Diagram Two external crystals may be attached to the XTL1IN, XTL1OUT, XTL2IN, and XTL2OUT pins. The XTAL1IN oscillator is intended for use at 24.576 MHz and the XTAL2IN oscillator is intended for use at 16.9344 MHz, although other frequencies may be used. Refer to the CS4215 data sheet for information regarding selection of the correct clock source and divide ratios. The codec on the DSP56302EVM is driven by a 24.576 MHz crystal between XTL1IN and XTL1OUT. The 24.576 MHz oscillator provides the master clock to run the codec. FSYNC and SCLK must be synchronous to this master clock. The external Clock Input (CLKIN), which is provided for potential use with an external AES/EBU receiver or an already existing system clock, is not used. The master Clock Output (CLKOUT) is also not used. MOTOROLA DSP56302EMUM/AD, Preliminary For More Information On This Product, Go to: www.freescale.com 4-13 Freescale Semiconductor, Inc. DSP56302EVM Technical Summary Command Converter Freescale Semiconductor, Inc... 4.5 COMMAND CONVERTER The DSP56302EVM uses Motorola's DSP56002 to perform OnCE/JTAG command conversion. The DSP56002 Serial Communications Interface (SCI) communicates with the host PC through an RS-232 connector. The DSP56002 SCI receives commands from the host PC. The set of commands may include read data, write data, reset OnCE, reset DSP56302 (the HA2 pin of the DSP56002 is then used to reset the DSP56302), request OnCE, or release OnCE. The DSP56002 command converter software interprets the commands received from the PC and sends a sequence of instructions to the DSP56302 OnCE/JTAG port. The DSP56302 may then continue to receive data or it may transmit data back to the DSP56002. The DSP56002 sends a reply to the host PC to give status information. The set of replies may include acknowledge good, acknowledge bad, in Debug mode, out of Debug mode, or data read. When the DP56302 is in the Debug state, the red Debug LED (D6) is lluminated. The DSP56002 is connected to the DSP56302 OnCE port through the shorting jumpers on J4. By removing the jumpers, the user has full access to the OnCE/JTAG pins of the DSP56302. Refer to Figure 4-1 on page 4-4 for the location of J4 on the DSP56302EVM and to Figure 4-2 on page 4-5 for a functional diagram. Figure 4-11 shows the RS-232 serial interface diagram. DSP56002 RS-232 TRANSCEIVER HOST PC RXD D01 Rx1 TD TXD DI1 Tx1 RD RESET D02 Rx2 DTR Figure 4-11 RS-232 Serial Interface Motorola's 5 Volt-Only Driver/Receiver MC145407 is used to transmit the signals between the host PC and the DSP56002. Serial data is transmitted from the host PC Transmitted Data (TD) signal and received on the DSP56002 Receive Data (RXD) pin. Serial data is similarly transmitted from the DSP56002 Transmit Data (TXD) signal and received on the host PC Received Data (RD) signal. The Data Terminal Ready (DTR) pin asserts the RESET pin of the DSP56002. As an option, the DSP56302EVM 14-pin JTAG connector at J5 allows the user to connect an ADS command converter card directly to the DSP56302EVM if the DSP56002 command converter software is not used (J4 jumpers removed). Pin 8 has been removed from J5. The JTAG cable from the ADS command converter is similarly keyed so that the cable cannot be connected to the DSP56302EVM incorrectly. 4-14 DSP56302EMUM/AD, Preliminary For More Information On This Product, Go to: www.freescale.com MOTOROLA Freescale Semiconductor, Inc. APPENDIX A Freescale Semiconductor, Inc... DSP56302EVM SCHEMATICS MOTOROLA DSP56302EMUM/AD For More Information On This Product, Go to: www.freescale.com A-1 Freescale Semiconductor, Inc. Freescale Semiconductor, Inc... DSP56302EVM Schematics A-2 DSP56302EMUM/AD For More Information On This Product, Go to: www.freescale.com MOTOROLA Freescale Semiconductor, Inc... + + Freescale Semiconductor, Inc. A-3 DSP56302EMUM/AD For More Information On This Product, Go to: www.freescale.com MOTOROLA Freescale Semiconductor, Inc... Freescale Semiconductor, Inc. MOTOROLA DSP56302EMUM/AD For More Information On This Product, Go to: www.freescale.com A-4 Freescale Semiconductor, Inc. + + Freescale Semiconductor, Inc... + + A-5 DSP56302EMUM/AD For More Information On This Product, Go to: www.freescale.com MOTOROLA + + Freescale Semiconductor, Inc... Freescale Semiconductor, Inc. + + + + MOTOROLA DSP56302EMUM/AD For More Information On This Product, Go to: www.freescale.com A-6 + + + + + + + + + A-7 + + + + + + + + + + + + + + + + + + + + + + + + + + + Freescale Semiconductor, Inc... + + + + + + + + Freescale Semiconductor, Inc. DSP56302EMUM/AD For More Information On This Product, Go to: www.freescale.com MOTOROLA Freescale Semiconductor, Inc... Freescale Semiconductor, Inc. MOTOROLA DSP56302EMUM/AD For More Information On This Product, Go to: www.freescale.com A-8 Freescale Semiconductor, Inc. APPENDIX B Freescale Semiconductor, Inc... DSP56302EVM PARTS LIST MOTOROLA DSP56302EMUM/AD, Preliminary For More Information On This Product, Go to: www.freescale.com B-1 Freescale Semiconductor, Inc. Freescale Semiconductor, Inc... DSP56302EVM Parts List B-2 DSP56302EMUM/AD, Preliminary For More Information On This Product, Go to: www.freescale.com MOTOROLA Freescale Semiconductor, Inc. DSP56302EVM Parts List B.1 PARTS LISTING The following table contains information on the parts and devices on the DSP56302EVM. Table B-1 DSP56302EVM Parts List Freescale Semiconductor, Inc... Designator Manufacturer Part Number Description U1 Motorola DSP56302 DSP U2 Motorola DSP56002 DSP (OnCE) U3 Crystal Semiconductor CS4215KL Audio Codec U4 U5 U6 Motorola MCM6306DJ15 SRAM U7 Atmel AT29LV512-20JC Flash PEROM U8 Linear Technologies LT1085CT-5 5V Regulator U9 Linear Technologies LT1085CT-3.3 3.3V Regulator U10 Motorola MC33078D Dual Op-Amp U11 Motorola MC145407DW RS-232 Transceiver U12 Motorola MC34164D-3 Undervolt Sensor U13 Motorola MC74HCT241ADW Octal Noninverting Buffer U14 Motorola MC74HCT04AD Hex Inverter D1 D2 D3 D4 D9 D10 D11 Rectron FM4001 Diode D5 Rectron FM5817 Schottky Diode D6 D12 Quality Technologies HLMP1700 Red LED D8 Quality Technologies HLMP1790 Green LED MOTOROLA DSP56302EMUM/AD, Preliminary For More Information On This Product, Go to: www.freescale.com B-3 Freescale Semiconductor, Inc. DSP56302EVM Parts List Table B-1 DSP56302EVM Parts List (Continued) Freescale Semiconductor, Inc... Designator Manufacturer Part Number Description Y1 Ecliptek EC2-169-16.9344MHZ 16.9344 MHz Crystal Y2 ECS OECS-196.6-3-C3X1A 19.6608 MHz Crystal Y3 Ecliptek EC2-246-24.576MHZ 24.576 MHz Crystal SW1 SW2 SW3 Panasonic EVQ-QS205K 6 mm Switch P1 Mouser 152-3409 DB-9 Female Connector P2 Switchcraft RAPC-722 2.1 mm DC Power Jack P3 P4 P5 Switchcraft 35RAPC4BHN2 3.5 mm Miniature Jack J1 Robinson Nugent NSH-8DB-S2-TG Header 8 pin double row J2 J3 Robinson Nugent NSH-16DB-S2-TG Header 16 pin double row J4 J6 J7 Robinson Nugent NSH-12DB-S2-TG Header 12 pin double row J5 Robinson Nugent NSH-14DB-S2-TG Header 14 pin double row J8 Robinson Nugent P2DN-40A-S1-TR Header 40 pin double row J9 Robinson Nugent NSH-3SB-S2-TG Header 3 pin single row C51 Xicon MR16V10 10 F Capacitor C33 C34 C47 C56 C57 C58 C59 C82 C83 Murata GRM42-6Y5V105Z025BL 1.0 F Capacitor B-4 DSP56302EMUM/AD, Preliminary For More Information On This Product, Go to: www.freescale.com MOTOROLA Freescale Semiconductor, Inc. DSP56302EVM Parts List Table B-1 DSP56302EVM Parts List (Continued) Freescale Semiconductor, Inc... Designator Manufacturer Part Number Description C7 C8 C10 C12 C14 C15 C17 C20 C22 C24 C26 C27 C29 C30 C31 C50 C52 C54 C55 C64 C68 C70 C71 C72 C77 C79 C84 C87 C88 Murata GRM40-X7R104K025BL 0.1 F Capacitor C9 C11 C13 C16 C18 C19 C21 C23 C25 C28 C37 C39 C40 C65 C69 C73 C74 C75 C76 C78 C80 C81 Murata GRM40-X7R103K050BL 0.01 F Capacitor C53 Kemet T491B475K016AS 4.7 F Capacitor C41 C42 Murata GRM40-COG220J050BL 22 pF Capacitor C48 C49 C66 C67 Murata GRM40-COG270J050BL 27 pF Capacitor C2 C3 C4 C44 C46 C85 C86 Murata GRM42-6Y5V334Z025BL 0.33 F Capacitor C38 Murata GRM42-6Y5V474Z025BL 0.47 F Capacitor C43 C45 Murata GRM40-COG470J050BL 47 pF Capacitor C35 C36 Murata GRM40-COG222J050BL 2200 pF Capacitor C62 Murata GRM40-X7R821K050BL 820 pF Capacitor C63 Murata GRM40-X7R182K050BL 1800 pF Capacitor C5 C6 C60 C61 Xicon MLRL10V47 47 F Capacitor C1 Xicon XAL16V1000 1000 F Capacitor L1 L2 L3 L4 Murata BL01RN1-A62 Ferrite Bead R1 R43 NIC NRC12RF1001TR 1 K Resistor R30 NIC NRC12RF5001TR 5 K Resistor MOTOROLA DSP56302EMUM/AD, Preliminary For More Information On This Product, Go to: www.freescale.com B-5 Freescale Semiconductor, Inc. DSP56302EVM Parts List Table B-1 DSP56302EVM Parts List (Continued) Freescale Semiconductor, Inc... Designator Manufacturer Part Number Description R4 R5 R6 R7 R20 R21 R22 R23 R24 R25 R29 R31 R32 R34 R35 R36 R37 R38 R39 R40 R41 R42 R44 NIC NRC12RF1002TR 10 K Resistor R8 R9 NIC NRC25RF15R8TR 15.8 K Resistor R14 R15 NIC NRC12RF1500TR 150 Resistor R16 R18 NIC NRC12RF2212TR 22.1 K Resistor R12 R13 NIC NRC12RF3922TR 39.2 K Resistor R17 R19 NIC NRC12RF4752TR 47.5 K Resistor R45 NIC NRC12RF5600TR 2.7 K Resistor R10 R11 R46 NIC NRC12RF6040TR 604 Resistor R28 NIC NRC12RF6803TR 680 K Resistor B-6 DSP56302EMUM/AD, Preliminary For More Information On This Product, Go to: www.freescale.com MOTOROLA Freescale Semiconductor, Inc. APPENDIX C Freescale Semiconductor, Inc... MOTOROLA ASSEMBLER NOTES MOTOROLA DSP56302EMUM/AD, Preliminary For More Information On This Product, Go to: www.freescale.com C-1 Freescale Semiconductor, Inc. Motorola Assembler Notes INTRODUCTION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . C-3 ASSEMBLER SIGNIFICANT CHARACTERS . . . . . . . . . . . . C-3 ASSEMBLER DIRECTIVES . . . . . . . . . . . . . . . . . . . . . . . . C-13 STRUCTURED CONTROL STATEMENTS . . . . . . . . . . . . C-64 Freescale Semiconductor, Inc... C.1 C.2 C.3 C.4 C-2 DSP56302EMUM/AD, Preliminary For More Information On This Product, Go to: www.freescale.com MOTOROLA Freescale Semiconductor, Inc. Motorola Assembler Notes C.1 INTRODUCTION This appendix supplements information in Section 3 of this document and provides a detailed description of the following components used with the Motorola Assembler: * Special characters significant to the assembler * Assembler directives Freescale Semiconductor, Inc... * Structure control statements C.2 ASSEMBLER SIGNIFICANT CHARACTERS There are several one and two character sequences that are significant to the assembler. The following subsections define these characters and their use. C.2.1 ; Comment Delimiter Character Any number of characters preceded by a semicolon (;), but not part of a literal string, is considered a comment. Comments are not significant to the assembler, but they can be used to document the source program. Comments will be reproduced in the assembler output listing. Comments are normally preserved in macro definitions, but this option can be turned off (see the OPT directive). Comments can occupy an entire line, or can be placed after the last assembler-significant field in a source statement. A comment starting in the first column of the source file will be aligned with the label field in the listing file. Otherwise, the comment will be shifted right and aligned with the comment field in the listing file. Example B-1 Example of Comment Delimiter ; THIS COMMENT BEGINS IN COLUMN 1 OF THE SOURCE FILE LOOP JSR COMPUTE ; THIS IS A TRAILING COMMENT ; THESE TWO COMMENTS ARE PRECEDED ; BY A TAB IN THE SOURCE FILE MOTOROLA DSP56302EMUM/AD, Preliminary For More Information On This Product, Go to: www.freescale.com C-3 Freescale Semiconductor, Inc. Motorola Assembler Notes C.2.2 ;; Unreported Comment Delimiter Characters Unreported comments are any number of characters preceded by two consecutive semicolons (;;) that are not part of a literal string. Unreported comments are not considered significant by the assembler, and can be included in the source statement, following the same rules as normal comments. However, unreported comments are never reproduced on the assembler output listing, and are never saved as part of macro definitions. Freescale Semiconductor, Inc... Example B-2 Example of Unreported Comment Delimiter ;; THESE LINES WILL NOT BE REPRODUCED ;; IN THE SOURCE LISTING C.2.3 \ Line Continuation Character or Macro Argument Concatenation Character Line Continuation C.2.3.1 Line Continuation The backslash character (\), if used as the last character on a line, indicates to the assembler that the source statement is continued on the following line. The continuation line will be concatenated to the previous line of the source statement, and the result will be processed by the assembler as if it were a single line source statement. The maximum source statement length (the first line and any continuation lines) is 512 characters. Example B-3 Example of Line Continuation Character ; THIS COMMENT \ EXTENDS OVER \ THREE LINES C.2.3.2 Macro Argument Concatenation The backslash (\) is also used to cause the concatenation of a macro dummy argument with other adjacent alphanumeric characters. For the macro processor to recognize dummy arguments, they must normally be separated from other alphanumeric characters by a non-symbol character. However, sometimes it is desirable to concatenate the argument characters with other characters. If an argument is to be concatenated in front of or behind some other symbol characters, then it must be followed by or preceded by the backslash, respectively. C-4 DSP56302EMUM/AD, Preliminary For More Information On This Product, Go to: www.freescale.com MOTOROLA Freescale Semiconductor, Inc. Motorola Assembler Notes Example B-4 Example of Macro Concatenation Suppose the source input file contained the following macro definition: Freescale Semiconductor, Inc... SWAP_REG MACRO MOVE MOVE MOVE ENDM REG1,REG2 ;swap REG1,REG2 using D4.L as temp R\REG1,D4.L R\REG2,R\REG1 D4.L,R\REG2 The concatenation operator (\) indicates to the macro processor that the substitution characters for the dummy arguments are to be concatenated in both cases with the character R. If this macro were called with the following statement, SWAP_REG 0,1 the resulting expansion would be: MOVE MOVE MOVE C.2.4 R0,D4.L R1,R0 D4.L,R1 ? Return Value of Symbol Character The ? sequence, when used in macro definitions, will be replaced by an ASCII string representing the value of . This operator may be used in association with the backslash (\) operator. The value of must be an integer (not floating point). Example B-5 Example of Use of Return Value Character Consider the following macro definition: SWAP_SYMMACRO MOVE MOVE MOVE ENDM REG1,REG2;swap REG1,REG2 using D4.L as temp R\?REG1,D4.L R\?REG2,R\?REG1 D4.L,R\?REG2 If the source file contained the following SET statements and macro call, AREG BREG SET SET SWAP_SYM 0 1 AREG,BREG the resulting expansion as it would appear on the source listing would be: MOTOROLA DSP56302EMUM/AD, Preliminary For More Information On This Product, Go to: www.freescale.com C-5 Freescale Semiconductor, Inc. Motorola Assembler Notes Example B-5 Example of Use of Return Value Character MOVE MOVE MOVE Freescale Semiconductor, Inc... C.2.5 R0,D4.L R1,R0 D4.L,R1 % Return Hex Value of Symbol Character The % sequence, when used in macro definitions, will be replaced by an ASCII string representing the hexadecimal value of . This operator may be used in association with the backslash (\) operator. The value of must be an integer (not floating point). Example B-6 Example of Return Hex Value Symbol Character Consider the following macro definition: GEN_LAB LAB\%VAL MACRO STMT ENDM LAB,VAL,STMT If this macro were called as follows, NUM SET GEN_LAB 10 HEX,NUM,'NOP' The resulting expansion as it would appear in the listing file would be: HEXA C.2.6 NOP ^ Macro Local Label Override The circumflex (^), when used as a unary expression operator in a macro expansion, will cause any local labels in its associated term to be evaluated at normal scope rather than macro scope. This means that any underscore labels in the expression term following the circumflex will not be searched for in the macro local label list. The operator has no effect on normal labels or outside of a macro expansion. The circumflex operator is useful for passing local labels as macro arguments to be used as referents in the macro. C-6 DSP56302EMUM/AD, Preliminary For More Information On This Product, Go to: www.freescale.com MOTOROLA Freescale Semiconductor, Inc. Motorola Assembler Notes Note: The circumflex is also used as the binary exclusive OR operator. Example B-7 Example of Local Label Override Character Consider the following macro definition: LOAD MACRO MOVE ENDM ADDR P:^ADDR,R0 If this macro were called as follows, Freescale Semiconductor, Inc... _LOCAL LOAD _LOCAL the assembler would ordinarily issue an error since _LOCAL is not defined within the body of the macro. With the override operator the assembler recognizes the _LOCAL symbol outside the macro expansion and uses that value in the MOVE instruction. C.2.7 " Macro String Delimiter or Quoted String DEFINE Expansion Character C.2.7.1 Macro String The double quote ("), when used in macro definitions, is transformed by the macro processor into the string delimiter, the single quote ('). The macro processor examines the characters between the double quotes for any macro arguments. This mechanism allows the use of macro arguments as literal strings. Example B-8 Example of a Macro String Delimiter Character Using the following macro definition, CSTR MACRO DC ENDM STRING "STRING" and a macro call, CSTR ABCD the resulting macro expansion would be: DC MOTOROLA 'ABCD' DSP56302EMUM/AD, Preliminary For More Information On This Product, Go to: www.freescale.com C-7 Freescale Semiconductor, Inc. Motorola Assembler Notes C.2.7.2 Quoted String DEFINE Expansion A sequence of characters which matches a symbol created with a DEFINE directive will not be expanded if the character sequence is contained within a quoted string. Assembler strings generally are enclosed in single quotes ('). If the string is enclosed in double quotes (") then DEFINE symbols will be expanded within the string. In all other respects usage of double quotes is equivalent to that of single quotes. Example B-9 Example of a Quoted String DEFINE Expression Freescale Semiconductor, Inc... Consider the source fragment below: STR_MAC DEFINE MACRO MSG MSG ENDM LONG 'short' STRING 'This is a LONG STRING' "This is a LONG STRING" If this macro were invoked as follows, STR_MAC sentence then the resulting expansion would be: MSG MSG C.2.8 'This is a LONG STRING' 'This is a short sentence' @ Function Delimiter All assembler built-in functions start with the @ symbol. Example B-10 Example of a Function Delimiter Character SVAL C.2.9 EQ @SQT(FVAL) ; OBTAIN SQUARE ROOT * Location Counter Substitution When used as an operand in an expression, the asterisk represents the current integer value of the runtime location counter. Example B-11 Example of a Location Counter Substitution XBASE C-8 ORG EQU X:$100 *+$20 ; XBASE = $120 DSP56302EMUM/AD, Preliminary For More Information On This Product, Go to: www.freescale.com MOTOROLA Freescale Semiconductor, Inc. Motorola Assembler Notes C.2.10 ++ String Concatenation Operator Any two strings can be concatenated with the string concatenation operator (++). The two strings must each be enclosed by single or double quotes, and there must be no intervening blanks between the string concatenation operator and the two strings. Example B-12 Example of a String Concatenation Operator Freescale Semiconductor, Inc... 'ABC'++'DEF' = 'ABCDEF' C.2.11 [ ] Substring Delimiter [,] Square brackets delimit a substring operation. The argument is the source string. is the substring starting position within . is the length of the desired substring. may be any legal string combination, including another substring. An error is issued if either or exceed the length of . Example B-13 Example of a Substring Delimiter DEFINE C.2.12 ID ['DSP56000',3,5] ; ID = '56000' << I/O Short Addressing Mode Force Operator Many DSP instructions allow an I/O short form of addressing. If the value of an absolute address is known to the assembler on pass one, then the assembler will always pick the shortest form of addressing consistent with the instruction format. If the absolute address is not known to the assembler on pass one (that is, the address is a forward or external reference), then the assembler will pick the long form of addressing by default. If this is not desired, then the I/O short form of addressing can be forced by preceding the absolute address by the I/O short addressing mode force operator (<<). Example B-14 Example of an I/O Short Addressing Mode Force Operator Since the symbol IOPORT is a forward reference in the following sequence of source lines, the assembler would pick the long absolute form of addressing by default: IOPORT BTST EQU MOTOROLA #4,Y:IOPORT Y:$FFF3 DSP56302EMUM/AD, Preliminary For More Information On This Product, Go to: www.freescale.com C-9 Freescale Semiconductor, Inc. Motorola Assembler Notes Example B-14 Example of an I/O Short Addressing Mode Force Operator Because the long absolute addressing mode would cause the instruction to be two words long instead of one word for the I/O short absolute addressing mode, it would be desirable to force the I/O short absolute addressing mode as shown below: Freescale Semiconductor, Inc... IOPORT C.2.13 BTST EQU #4,Y:< Long Addressing Mode Force Operator Many DSP instructions allow a long form of addressing. If the value of an absolute address is known to the assembler on pass one, then the assembler will always pick the shortest form of addressing consistent with the instruction format, unless the C-10 DSP56302EMUM/AD, Preliminary For More Information On This Product, Go to: www.freescale.com MOTOROLA Freescale Semiconductor, Inc. Motorola Assembler Notes FORCE LONG directive is active. If this is not desired, then the long absolute form of addressing can be forced by preceding the absolute address by the long addressing mode force operator (>). Example B-16 Example of a Long Addressing Mode Force Operator Since the symbol DATAST is a not a forward reference in the following sequence of source lines, the assembler would pick the short absolute form of addressing: Freescale Semiconductor, Inc... DATAST EQU MOVE Y:$23 D0.L,Y:DATAST If this is not desirable, then the long absolute addressing mode can be forced as shown below: DATAST C.2.15 EQU MOVE Y:$23 D0.L,Y:>DATAST # Immediate Addressing Mode The pound sign (# ) is used to indicate to the assembler to use the immediate addressing mode. Example B-17 Example of Immediate Addressing Mode CNST C.2.16 EQU MOVE $5 #CNST,D0.L #< Immediate Short Addressing Mode Force Operator Many DSP instructions allow a short immediate form of addressing. If the immediate data is known to the assembler on pass one (not a forward or external reference), or the FORCE SHORT directive is active, then the assembler will always pick the shortest form of immediate addressing consistent with the instruction. If the immediate data is a forward or external reference, then the assembler will pick the long form of immediate addressing by default. If this is not desired, then the short MOTOROLA DSP56302EMUM/AD, Preliminary For More Information On This Product, Go to: www.freescale.com C-11 Freescale Semiconductor, Inc. Motorola Assembler Notes form of addressing can be forced using the immediate short addressing mode force operator (#< ). Example B-18 Example of Immediate Short Addressing Mode Force Operator In the following sequence of source lines, the symbol CNST is not known to the assembler on pass one, and therefore, the assembler would use the long immediate addressing form for the MOVE instruction. Freescale Semiconductor, Inc... CNST MOVE EQU #CNST,D0.L $5 Because the long immediate addressing mode makes the instruction two words long instead of one word for the immediate short addressing mode, it may be desirable to force the immediate short addressing mode as shown below: CNST C.2.17 MOVE EQU # Immediate Long Addressing Mode Force Operator Many DSP instructions allow a long immediate form of addressing. If the immediate data is known to the assembler on pass one (not a forward or external reference), then the assembler will always pick the shortest form of immediate addressing consistent with the instruction, unless the FORCE LONG directive is active. If this is not desired, then the long form of addressing can be forced using the immediate long addressing mode force operator (#> ). Example B-19 Example of an Immediate Long Addressing Mode Operator In the following sequence of source lines, the symbol CNST is known to the assembler on pass one, and therefore, the assembler would use the short immediate addressing form for the MOVE instruction. CNST EQU MOVE $5 #CNST,D0.L If this is not desirable, then the long immediate form of addressing can be forced as shown below: CNST C-12 EQU MOVE $5 #>CNST,D0.L DSP56302EMUM/AD, Preliminary For More Information On This Product, Go to: www.freescale.com MOTOROLA Freescale Semiconductor, Inc. Motorola Assembler Notes C.3 C.3.1 ASSEMBLER DIRECTIVES BADDR Set Buffer Address Freescale Semiconductor, Inc... BADDR , The BADDR directive sets the runtime location counter to the address of a buffer of the given type, the length of which in words is equal to the value of . The buffer type may be either Modulo or Reverse-carry. If the runtime location counter is not zero, this directive first advances the runtime location counter to a base address that is a multiple of 2k, where 2k >= . An error will be issued if there is insufficient memory remaining to establish a valid base address. Unlike other buffer allocation directives, the runtime location counter is not advanced by the value of the integer expression in the operand field; the location counter remains at the buffer base address. The block of memory intended for the buffer is not initialized to any value. The result of may have any memory space attribute but must be an absolute integer greater than zero and cannot contain any forward references (symbols that have not yet been defined). If a Modulo buffer is specified, the expression must fall within the range 2 m, where m is the maximum address of the target DSP. If a Reverse-carry buffer is designated and is not a power of two a warning will be issued. A label is not allowed with this directive. Note: See also BSM, BSB, BUFFER, DSM, DSR Example B-20 Example BADDR Directive M_BUF C.3.2 ORG BADDR X:$100 M,24 ; CIRCULAR BUFFER MOD 24 BSB Block Storage Bit-Reverse [