Home

DSP56303EVM User's Manual

image

Contents

1. 3 14 3 3 3 7 Macros Conditional Assembly 3 15 3 3 3 8 Structured Programming 3 15 3 3 4 Assembling the Example Program 3 16 3 4 MOTOROLA DSP LINKER 3 16 3 4 1 Linker Options uu ex m een dd 3 17 3 4 2 Linker 3 23 3 5 INTRODUCTION TO THE DEBUGGER SOFTWARE 3 24 3 6 RUNNING THE PROGRAM 3 26 SECTION 4 DSP56303EVM TECHNICAL SUMMARY 4 1 4 1 DSP56303EVM DESCRIPTION AND FEATURES 4 3 4 2 DSP56303 DESCRIPTION e uro ERIGI eee 4 3 4 3 MEMORY iouis E Rata meten hec 4 4 4 3 1 SRAM te AA a Slee M SM at 4 5 4 3 1 1 SRAM Connections 4 6 4 3 1 2 Example Programming AARO 4 7 4 3 2 Flash PEROM dun etus dc dur 463 149125 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 a omen 4 10 4 4 1 Codec Analog 4 11 4 4 2 Codec Digital Interface 4 12 4 4 3 Codec canes wea 4 13 4 5 COMMAND CONVERTER 4 14 iv DSP56303EVMUM AD Preliminary MOTOROLA APPENDIX DSP56303EVM 5 5 1 A
2. qui 282 9 SNOlLVOllddVv 450 VIOYOLON 2 11050 ZHN8099 6l i5 AS AG AG gt 00 le lo 10313S W3183ANOO QNVAMWOO 1 x S 4589 001 n zi 1581 5 oi 101 7 5 lt 5 34008 338393 799 45 yr 01 T gt lt m H 869 2 toa ano 12 39A 3n oS amp 205 29 2 B88 488 ERE 3922 m 21 SANTIS oir 2705 un A car 169 900000 ar ooooQo oo x o Qe XOL Po A 135340 158 9 M J 57 050 az 050 154 18d IH 652 chy 17 150 m toaa gd H YE Y AS 09 011 98d 9H L8d LH EAM 68d lVH 0184 2 628 veu zou 440120096 1 18 zn 184 yOu a Andy Gry 62 T IMS gt 08 154 lt 4 gt 158 iminary DSP56303EVMUM AD Prel MOTOROLA 6 eu va 96 02 8
3. a a a a a 2 a amp a on mdi 2oocoooonh 68 65 60 6 6205 lt lt lt lt lt lt lt lt 45444444 Ost 5 TA 14 Ost _ gt 15 Ost BR Ost gt cikout_303 Ost Ost 5 AM TP2 Ost AA2 TP1 MOTOROLA DSP56303EVMUM AD Preliminary yeeus va 96 02 8 910q 93009 ent SNOILVOllddV 459 VIOYOLON A E 1 ZZ Ol 4m y 400 OdN 189 170 Jnio 0 1 LL 7 09 1 gorn 1 1 4 5 I adaz deed 5 MN E n l BLOSEN 5 199 990 i 150 099 1 I ZHW9ZG vZ aly i anay 1 OdN NI 29 1 024 OdN LL LE amoo 879 etes hoc 1 pP 6 2 x gt gt 5 gt
4. Definition label MACRO lt dummy argument list gt lt macro definition statements gt ENDM The dummy argument list has the form lt dumarg gt lt dumarg gt lt dumarg gt The required label is the symbol by which the macro will be called If the macro is named the same as an existing assembler directive or mnemonic a warning will be issued This warning can be avoided with the RDIRECT directive The definition of a macro consists of three parts the header which assigns a name to the macro and defines the dummy arguments the body which consists of prototype or skeleton source statements and the terminator The header is the MACRO directive its label and the dummy argument list The body contains the pattern of standard source statements The terminator is the ENDM directive The dummy arguments are symbolic names that the macro processor will replace with arguments when the macro is expanded called Each dummy argument must obey the same rules as symbol names Dummy argument names that are preceded by an underscore are not allowed Within each of the three dummy argument fields the dummy arguments are separated by commas The dummy argument fields are separated by one or more blanks Macro definitions may be nested but the nested macro will not be defined until the primary macro is expanded MOTOROLA DSP56303EVMUM AD Preliminary C 39 Motorola Assembler Notes Assembler Directives Note See also
5. 4 4 34 id 23 1009W4 10094 4 4 anero ney miy e 099 F 92 311334 2 4 71009 580111 n 6n 101D nba Y AS VAG 100 3 20 27 iminary DSP56303EVMUM AD Prel MOTOROLA APPENDIX DSP56303EVM PARTS LIST MOTOROLA DSP56303EVMUM AD Preliminary B 1 DSP56303EVM Parts List B 2 DSP56303EVMUM AD Preliminary MOTOROLA DSP56303EVM Parts List B 1 PARTS LISTING The following table contains information on the parts and devices on the DSP56303EVM Table 1 DSP56303EVM Parts List Designator Manufacturer Part Number Description U1 Motorola DSP56303 DSP U2 Motorola DSP56002 DSP OnCE U3 Crystal CS4215KL Audio Codec Semiconductor U4 U5 U6 Motorola MCM6306DJ15 SRAM U7 Atmel AT29LV512 20JC Flash PEROM U8 Linear LT1085CT 5 5V Regulator Technologies 09 Linear LT1085CT 3 3 3 3V Regulator Technologies U10 Motorola MC33078D Dual Op Amp 011 Motorola MC145407DW RS 232 Transceiver 012 Motorola MC34164D 3 Undervolt Sensor U13 Motorola MC74HCT241ADW Octal Noninverting Buffer U14 Motorola MC74HCT04AD Hex Inverter D1 D2 D3 04 09 D10 Rectron FM4001 Diode 011 05 Rectron FM5817 Schottky Diode D6 012 Quality HLMP1700 Red LED Technologies D8 Quality HLMP1790 Green LED Technologies MO
6. api ZOBVO oz 3 00670 any n 808vVq L Tava ley 9 EENIA 9216805 08 0 90170 Toava 44 009 cary saer 30900 Soava e 70800 708 gey Nr oadd 608 0 0800 Orava 70800 718 0 Oy 90800 Tava n 50804 9 5 vd T IEW ZO8VO 52 Re NER gc ov 9 Tava ley 8 EEKAN 92168 5 08 0 sel s TORE 5 4 8r TORT 9v 9a 2 2800 5 RT nS Wd Orava oy 27 ru z 718 6 71 1800 Tava or 10v 9 igvd T TEV 708 0 Iz 80870 rm Tava 309 972157 2 youd Fra p TOBVO f 5 4 TORT sagr 71800 3 54 1 SR 14 5 07800 09 0 51900 zrewa 611 77800 01 n INO J9 AAO WR AAI Cyst se TP13 TP4 2 i ee o DN 2 e 8588 zo AA E lt lt lt lt lt lt lt lt 8 8888 555555425 8 lt 1 bi emm 8 i A 5 TE x 5 x x 5 99666060 5 9 5 90900 0900090000 0900090000
7. jsr ada init move 50400 4 move 03FF m4 6 x 16 9344Mhz 101 602 clear stack pointer clear stack counter disable interrupts PLL 16 9344 x 6 101 6Mhz turn LED off initialize stack pointer linear addressing Initialize the rx pointer Initialize the tx pointer Jump to initialize the codec echo buffer starts at 400 is 1024 deep DSP56303EVMUM AD Preliminary D 7 Codec Programming Tutorial ECHO ASM Program Description Example B 94 Sample Program Listing Continued this is where the work gets done 1 jset 2 5881580 Wait for frame sync to pass jclr 2 x M_SSISRO Wait for frame sync move x RX_BUFF_BASE a get new samples move x RX_BUFF_BASE 1 b asr x r4 x0 divide them by 2 and get oldest asr b r4 y0 samples from buffer add x0 a add the new samples and the old add y0 b asr a reduce magnitude of new data asr b move a x r4 Save the altered samples move b y 4 and bump the pointer move a x TX BUFF BASE Put value in left channel tx move b x TX 1 Put value in right channel tx move OUTPUT y0 headphones line out mute spkr no attn move 0 BUFF 2 move TONE_INPUT yO no input gain monitor mute move yO x TX BASE 3 jmp loop 1 Loop back I
8. oz SYOLINVdVD 55 4 0696469 ano SNOILVOIIdd 450 VIOYOLON ee a PET RE nn s Ne ee A EAS a REIS al 1 l 1 1 1 1 1 1 1 anro 1 anro anro 1 anro i anro 1 89 1 089 882 1 550 1 750 1 ML 1 27 1 1 1 1 1 1 Y 1 I I 1 1 1 1 1 1 1 goin 1 1 t T dNv dO 23002 10 YALAANI N344n8 1 120 i 3108 1 612259 23108 i VOLOHvL 23108 i IWLyZLOHYL 310N PS E 1 EPUM a Md wee VAS aNd fe Se ee JE pa ee c Ph er Rr o 75 S TTA ER S9 ur ae ba PT leant ae se PCa ee ee 1 I 1 r 1 anvo 1 3100 Anto o 301070 dno 3 0 0 Ano 30100 dno 30100 Ano ANLo o 301070 dno 1 482 eo 1 513 242 YL 49 9 9 692 3203 822 922 622 22 44 129 022 J el NES i SI 1 1 gen 93009 i ocn 6 zn 6 ocn Sgen 1870 orezn 99270 9970 en 0c zn LUTA 4 20096450 310N i SICvSO 310N Sa A aaa T Eaa Bg
9. 8s z 88 aneco 75 S t AAA on B i WN 081 if na am 1g Azee Az u OdN OdN 372200 0 322000 110 962 seo a NNN ze 1007 an Y 09 anoo 4nLy 0 ed 8 AAA 11001 169 80 09 Ol izes m INT gy oi og INIT mgr 3NHdOH oz 7 ig 10Y3H 1n0N2 mm 21 8 A A sz pli 2 1 02 non xz 25 6 52 25 5 WN i 05 01553 27 5 AS 230027 15 4 51 01553 1701553 01553 iminary DSP56303EVMUWM AD Prel A 5 AST coooooog 9599 99 9999 5 55255555 lt y yeeus v8 96 02 8 1100 31 43 02 QNVAWOO rer
10. SECTION TABLES TABLES will be the section name MOTOROLA DSP56303EVMUM AD Preliminary C 59 Motorola Assembler Notes Assembler Directives C 3 52 SET Set Symbol to a Value lt label gt SET lt expression gt SET lt label gt lt expression gt The SET directive is used to assign the value of the expression in the operand field to the label The SET directive functions somewhat like the EQU directive However labels defined via the SET directive can have their values redefined in another part of the program but only through the use of another SET directive The SET directive is useful in establishing temporary or reusable counters within macros The expression in the operand field of a SET must be absolute and cannot include a symbol that is not yet defined no forward references are allowed Note See also EQU GSET Example B 73 SET Directive COUNT SET 0 INITIALIZE COUNT C 3 53 STITLE Initialize Program Sub Title STITLE lt string gt The STITLE directive initializes the program subtitle to the string in the operand field The subtitle will be printed on the top of all succeeding pages until another STITLE directive is encountered The subtitle is initially blank The STITLE directive will not be printed in the source listing An STITLE directive with no string argument will cause the current subtitle to be blank Note A label is not allowed with this directive Note See also TITLE E
11. The DSP56303 Serial Control 0 C00 pin is programmed to control the codec Reset signal RESET Serial Control 1 5 01 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 5 02 pin is connected to the codec Frame Sync FSYNC signal A rising edge on FSYNC indicates that a new frame is about to start FFEYNC may be an input to the codec or it may be an output from the codec 4 12 DSP56303bEVMUM AD Preliminary MOTOROLA DSP56303EVM Technical Summary Audio Codec 4 4 3 Codec Clock Figure 4 10 shows the clock generation diagram CS4215 27 pF XTL1IN 24 576 MHz 0 gt XTL1OUT 27 pF 16 9344 MHz 5 XTL2IN optional L XTL20UT 27 pF 4 CLKIN Figure 4 10 Codec Clock Generation Diagram Two external crystals may be attached to the XTL1IN XTL1OUT XTL2IN and XTL2OUT pins The XTALIIN oscillator is intended for use at 24 576 MHz and the XTALZIN 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 DSP56303EVM is driven by a 24 576 MHz crystal between XTLIIN and XTL1OUT The 24 576 MHz oscillator provides the master clock to run the codec FSYNC and SCLK must be syn
12. 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 25510 1 5 Quick Start Guide Installation Procedure 9 o HE 1 145407 J3 J9 Jg ISA CONNECTOR JTAG LED OnCE je m ESSI1 SCI o e 2 8 swt 2 DSP56303 P1 J2 Sw POWER JZ ESSIO JTAG Ps LED SW3 COMMAND CONVERTER SELEC Bi MC74HCT241 HDPHNE LT1085 7 MC74HCT04 54215 Power LT1085 MC33078 J4 12 J7 Figure 1 1 DSP56303EVM Component Layout 1 6 DSP56303EVMUM AD Preliminary MOTOROLA Quick Start Guide Installation Procedure 1 3 2 Connecting the DSP56303EVM to the PC and Power Figure 1 2 shows the interconnection diagram for connecting the PC and the external power supply to the DSP56303EVM board Use the following steps to complete cable connections DB9 Interface Cable PC compatible Computer 77 P Connect cable H P2 to RS 232 port External V DSP56303EVM Power Figure 1 2 Connecting the DSP56303EVM Cables 1 Connect the DB9P end of the
13. The directives used for assembly control are COMMENT DEFINE END FAIL FORCE HIMEM INCLUDE LOMEM MODE MSG ORG RADIX RDIRECT SCSJMP SCSREG UNDEF WARN Start comment lines Define substitution string End of source program Programmer generated error message Set operand forcing mode Set high memory bounds Include secondary file Set low memory bounds Change relocation mode Programmer generated message Initialize memory space and location counters Change input radix for constants Remove directive or mnemonic from table Set structured control branching mode Reassign structured control statement registers Undefine DEFINE symbol x Programmer generated warning DSP56303EVMUM AD Preliminary MOTOROLA Example Test Program Assembling the Program 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
14. VL ZLOHYL gein ro o 5 8 pu 5 20 lt lt 0 lt 95454 4 a 9 in T Aue ysi iy 508 2004 4 QN9 gaya VOWI VOW Fe 4 evy vv HOS Yy vi 127 Wy N 98 4 ovv 88 ovy EMS TMS T aa 8 85 55 555252 0258255595 86 9 ESSO SS RII SR 1 3922 dzz Agt 72 192 ZHWr e6 9L ay 4 ASH lA vy rN 7089 gt 806 1 1 3 Ag MOTOROLA iminary DSP56303bEVMUM AD Prel A 3 J1 2 0 REV 2 Sheet BA MOTOROLA DSP APPLICATIONS DSP56303 302EVM MEMORY 8 20 96 TITLE Date GIN 30 Hi are crave 82 gv 39 Hiv g Tava GC o COE ra Y z 92 EM 1 808 0 amp 5 5 90 208 0 02 70900 EVERIO Saer 90907 TERLI 21 2 50804 lt oai ZOava di 20 En 70800 108 7 10804 008Vd 2 00800 9
15. 4 4 DSP56303bEVMUM AD Preliminary MOTOROLA DSP56303EVM Technical Summary Memory NS eee OG M Phu Xr No EN Eus EA Data Address A RS 232 SSI ja dd OnCE Port bl H DSP56002 5 T a il optional 16 9344 MHz EA 19 6608 2 153 6 2 24 576 MHZ 54125 L j Out LEV uL a mma E Figure 4 2 DSP56303EVM Functional Block Diagram 4 3 1 SRAM The DSP56303EVM uses three banks of 32 K x 8 bit fast Static RAM Motorola MCM6306 labelled U4 U5 and 06 for memory expansion The MCM6306 uses 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 DSP56303EVMUM AD Preliminary 4 5 DSP56303EVM Technical Summary Memory 4 3 1 1 SRAM Connections The basic connection for the SRAM is shown in Figure 4 3 DSP56303 SRAM A0 A13 0 13 A14 o AA3 gt A14 00 07 4 000 007 0 RD WR S 0 m Figure 4 3 SRAM Connections to the DSP56303 The data input output pins DQ0 DQ7 for the first bank of SRAM are connected to the DSP56303 D0 D7 pins Similarly pins D8 D15 D16 D
16. 44 44 CL 42 45 44 C 45 CONST C 44 C 45 CONTC C 45 CONTCK C 44 C 45 CRE 42 C 45 DEX C 43 C 45 DLD C 44 C 45 DXL C 42 C 45 FC C 42 C 45 FF C 42 C 45 FM C 42 C 45 GL C 44 C 45 GS C 44 C 45 HDR C 43 C 45 IC C 43 C 46 IL C 43 C 46 INTR C 44 C 46 LB C 44 C 46 LDB C 44 C 46 listing format C 42 LOC C 43 C 46 43 C 46 43 46 message 43 43 46 MI 44 46 MSW 43 46 MU 43 46 NL 43 46 46 46 NOCEX 46 47 47 NOCM 47 NODEX 47 NODLD 47 NODXL 47 NOFC 47 NOFF 47 NOFM 47 NOGS 47 47 NOINTR 47 47 47 NOMEX 47 DSP56303 Preliminary Index 5 NOMI C 47 NOMSW C 47 NONL C 47 NONS C 47 NOPP 47 NOPS C 47 NORC C 47 NORP C 48 NOSCL C 48 NOU 48 NOUR 48 NOW 48 NS C 43 C 48 PP C 42 C 48 PS 44 48 PSM 44 42 48 reporting C 42 RP C 44 C 48 RSV C 44 S C 43 48 SCL 43 48 SCO 43 C 48 SI C 44 SO C 43 C 48 C 49 SVO C 44 symbol C 43 U 43 C 49 UR C 43 49 W C 43 C 49 WEX 49 XLL C 43 C 49 XR C 43 C 49 P Space Enable 4 8 Packing Enable Bit BPAC 4 7 PC 4 14 PC requirements 1 4 PEROM 4 9 bootstrap 4 10 standalone operation 4 9 power supply external 1 4 1 7 program assembling the 3 7
17. 987237 34b852 5734623 5233763 5176756 423423 5324732 40029 TERRE A RAAT CK OC GNO KREE ERARA Y MEMORY AAR KAA RAR A ERE GE o e RA CORR A IAEA org y YBASE instructs the assembler that we are referring to Y memory starting jat location YBASE list2 dc 98734 5800000 Sfedcba 5487327 5957572 369856 dc 247978 8a3407 5734546 344787 938482 304 82 dc 123456 5657784 567123 5675634 OK KK ORE KK OK EK KATE PROGRAM ERA AK 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 11521 0 set up pointer to start of listl move list2 r4 set up pointer to start of list2 clr a clear accumulator a move x r0 x0 y r4 yO load the value of X memory pointed to by the contents of r0 into 0 and post increment load the value of Y memory pointed to by the contents of r4 into 0 and post increment r4 3 6 DSP56303bEVMUM AD Preliminary MOTOROLA Example Test Program Assembling the Program Example 3 1 Simple DSP56303 Code Example Continued do 15 end
18. If an address register is loaded in one instruction then the contents of the register is not available for use as a pointer until after the next instruction Ordinarily when the assembler detects this condition it issues an error message The RP option will cause the assembler to output a NOP instruction into the output stream instead of issuing an error S Print symbol table at the end of the source listing This option has no effect if the CRE option is used SCL default reset Structured control statements generate non local labels that ordinarily are not visible to the programmer This can create problems when local labels are interspersed among structured control statements This option causes the assembler to maintain the current local label scope when a structured control statement label is encountered SCO Send structured control statement labels to object and listing files Normally the assembler does not externalize these labels This option must appear before any symbol definition SO Write symbol information to object file This option is recognized but performs no operation in COFF assemblers DSP56303bEVMUM AD Preliminary MOTOROLA Motorola Assembler Notes Assembler Directives SVO Preserve object file on errors Normally any object file produced by the assembler is deleted if errors occur during assembly This option must be given before any code or data is generated e U Print the unassembled line
19. RL_WD_78 equ 5000000 ONE OUTPUT EQU HEADPHONE EN LINEOUT EN O LEFT ATTN O RIGHT ONE INPUT EQU MIC IN SELECT 15 MONITOR_ATTN 8 LEFT_GAIN 8 RIGHT_GAIN Among the features initialized at this time are sample rate data format clock selection and interface mechanism These are features which generally require re initialization when altered By referring to the EQU ASM file the user can view the constants available for specifying the different feature options The two lines that follow construct tone output and tone input are the constants that define those feature selections available when the analog subsystem is running This includes such features as gain mixer and attenuator settings D 3 1 3 Interrupt Buffers The 54215 interrupt routines used by this software are based on 2 four word buffers one each for transmit data and receive data The lines shown in allocate eight words of data memory starting at address x 000000 These are the buffers used by the interrupt handler Example B 93 Interrupt Buffers for talking to the CS4215 org x 0 RX_BUFF_BASE equ RX data 1 2 ds 1 data time slot 1 2 for RX ISR RX data 34 ds 1 data time slot 3 4 for RX ISR data 5 6 ds 1 data time slot 5 6 for RX ISR
20. 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 Begin condition LOOP Begin hardware loop REPEAT Begin REPEAT loop UNTIL End of REPEAT loop WHILE Begin WHILE loop MOTOROLA DSP56303EVMUM AD Preliminary 3 15 Example Test Program Motorola DSP Linker 3 3 4 Assembling the Example Program 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 evm303w directory created by the installation process from Section 1 3 3 This will create two additional files example cld and example st example cld file is the absolute object file of the program and this is what will be downloaded into DSP56303 The example st file is the listing file and gives full details of where the program and data will be placed in the DSP56303 memory 3 MOTOROLA DSP LINKER Though not needed for our simple example the Motorola DSP Linker is also included with the DSP56303EVM The Motorola DSP Linker is a program that processes relocatable object files produced by the Motorola DSP Assembl
21. YR 100 SET X Y RUN LOW MEM BOUNDS C 3 36 LSTCOL Set Listing Field Widths LSTCOL labw lt gt lt oprw gt lt opc2w gt lt opr2w gt lt xw gt lt yw gt Sets the width of the output fields in the source listing Widths are specified in terms of column positions The starting position of any field is relative to its predecessor except for the label field which always starts at the same position relative to page left margin program counter value and cycle count display The widths may be expressed as any positive absolute integer expression However if the width is not adequate to accommodate the contents of a field the text is separated from the next field by at least one space MOTOROLA DSP56303EVMUM AD Preliminary C 37 Motorola Assembler Notes Assembler Directives Any field for which the default is desired may be null A null field can be indicated by two adjacent commas with no intervening space or by omitting any trailing fields altogether If the LSTCOL directive is given with no arguments all field widths are reset to their default values Note A label is not allowed with this directive Note See also PAGE Example 57 LSTCOL Directive LSTCOL 40 20 20 Reset label X and Y data field widths C 3 37 MACLIB Macro Library MACLIB lt pathname gt This directive is used to specify pathname as defined by the operating system of a directory that c
22. etc e Headphones e Audio interface cable with 1 8 inch stereo plugs 1 3 INSTALLATION PROCEDURE Installation requires four basic steps Preparing the DSP56303EVM board Connecting the board to the PC and power Installing the software eS dem Testing the installation 1 4 DSP56303EVMUM AD Preliminary MOTOROLA 1 3 1 Quick Start Guide Installation Procedure Preparing the DSP56303EVM 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 MOTOROLA J9 defines the external memory map DSP56303EVMUM AD Preliminary
23. example 3 5 writing the 3 4 Program counter C 8 C 49 programming AARO 4 7 assembly 3 3 development 3 3 example 3 3 Q Quick Start Guide ii 1 1 R Read Enable Pin RD 4 6 4 9 Reset DSP56002 4 14 Reset DSP56303 4 9 RS 232 cable connection 1 7 RS 232 interface 4 14 RS 232 interface cable 1 4 RS 232 serial interface 4 14 running the Debugger program 3 26 running the demonstration 2 1 2 4 5 SCI DSP56002 4 14 Section C 57 end C 29 global C 32 C 45 C 58 local C 36 C 58 nested C 48 static C 45 C 58 self test 1 9 Serial Clock Pin SCKO 4 12 Serial Control Pin 0 SC00 4 12 Serial Control Pin 1 SC01 4 12 Serial Control Pin 2 SC02 4 12 serial interface 4 14 Serial Receive Data Pin SRDO 4 12 Serial Transmit Data Pin 5700 4 12 software Domain Technologies 1 8 Motorola 1 8 software installation 1 8 Source file end C 27 source statement format 3 4 SRAM 4 4 4 5 connections 4 6 SRAM Address Pins A 0 14 4 6 SRAM Chip Enable Pin E 4 6 SRAM Doata Pins DQ 0 7 4 6 SRAM memory map 4 7 SRAM Output Enable Pin G 4 6 SRAM Wirite Enable Pin W 4 6 Stand Alone Operation 4 9 standalone operation 4 9 Stereo Headphones 4 11 Stereo Input 4 11 Stereo Output 4 11 String concatenation C 9 delimiter C 7 packed C 48 SW2 2 4 SW3 2 5 Symbol case C 46 cross reference C 45 equate C 29 C 45 global C 45 listing C 48 set C 32 C 60 undefined C 49 T test analysis 1 9 1 10 self 1 9 test results fail
24. first symbol in the source program is defined CONTC Re enable cycle counts Does not clear total cycle counts The cycle count for each instruction will be shown on the output listing e CONTCK Re enable checksumming of instructions and data Does not clear cumulative checksum value CRE Print a cross reference table at the end of the source listing This option if used must be specified before the first symbol in the source program is defined DEX Expand DEFINE symbols within quoted strings Can also be done ona case by case basis using double quoted strings e DLD Do not restrict directives in DO loops The presence of some directives in DO loops does not make sense including some OPT directive variations This option suppresses errors on particular directives in loops DXL default reset Expand DEFINE directive strings in listing FC Fold trailing comments Any trailing comments that are included in a source line will be folded underneath the source line and aligned with the opcode field Lines that start with the comment character will be aligned with the label field in the source listing The FC option is useful for displaying the source listing on 80 column devices FF Use form feeds for page ejects in the listing file FM Format assembler messages so that the message text is aligned and broken at word boundaries GL Make all section symbols global This has the same eff
25. would be transformed by the assembler to the following DS 10 SAMPLSIZ C 3 11 DS Define Storage lt 1 1 gt DS expression The DS directive reserves a block of memory the length of which in words is equal to the value of expression This directive causes the runtime location counter to be advanced by the value of the absolute integer expression in the operand field expression can have any memory space attribute The block of memory reserved is C 20 DSP56303bEVMUM AD Preliminary MOTOROLA Motorola Assembler Notes Assembler Directives not initialized to any value The expression must be an integer greater than zero and cannot contain any forward references symbols that have not yet been defined lt label gt if present will be assigned the value of the runtime location counter at the start of the directive processing Note See also DSM DSR Example B 32 DS Directive S BUF DS 12 SAMPLE BUFFER C 3 12 DSM Define Modulo Storage lt 1 1 gt DSM lt expression gt The DSM directive reserves a block of memory the length of which in words is equal to the value of lt expression gt If the runtime location counter is not zero this first ances the runtime location counter to a base address that is a multiple of 2 where 2K gt lt expression gt An error will be issued if there is insufficient memory remaining to establish a valid base address
26. 2 4 demonstration file 2 1 development process flow 3 3 Directive C 13 66 CONTINUE 66 FOR 67 68 LOOP 68 REPEAT 69 WHILE 69 BADDR C 13 BSB C 13 BSC C 14 BSM C 15 BUFFER C 16 COBJ C 17 COMMENT C 17 DC C 17 DCB C 19 DEFINE 7 C 19 45 DS C 20 DSM C21 DSR C 22 DUP C 22 DUPA C 23 DUPC C 25 DUPF C 26 END C 27 ENDBUF C 27 ENDIF C 28 ENDM C 28 ENDSEC C 29 EQU C 29 EXITM C 30 FAIL C 31 FORCE C 31 GLOBAL C 32 GSET C 32 HIMEM C 33 IDENT C 33 IF 34 in loop C 45 INCLUDE C 35 LIST C 35 LOCAL C 36 LOMEM C 37 LSTCOL C 37 MACLIB C 38 MACRO C 39 MODE C 40 MSG C 40 NOLIST C 41 OPT C 42 ORG C 49 PAGE C 52 PMACRO C 53 PRCTL C 54 Index 2 DSP56303EVMUM AD Preliminary MOTOROLA RADIX 54 RDIRECT 55 SCSJMP 56 SCSREG 56 SECTION C 57 SET C 60 STITLE C 60 SYMOBJ 61 5 61 TITLE 61 UNDEF 62 WARN 62 63 XREF C 63 Diskette 3 5 4 9 4 10 document description ii Domain Technologies Debugger 1 3 1 8 2 4 2 5 3 24 DSP development tools 3 3 DSP Help Line 1 13 DSP Helpline ii DSP linker 3 16 DSP56002 4 14 DSP56002 Receive Data Pin RXD 4 14 DSP56002 Transmit Data Pin TXD 4 14 DSP56300 Family Manual 4 3 DSP56303 3 3 Chip Errata 4 3 Product Specification 1 3 Product Specification Revision 1 02 4 3 Technical Data 1 3 4 3 User s Manual 4 3 DSP56303 code example 3 6 DSP56303 Features 4 3 DSP56303EVM additional re
27. CNST EQU 5 C 2 17 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 gt 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 5 OVE CNST DO L If this is not desirable then the long immediate form of addressing can be forced as shown below CNST EQU 5 OVE gt CNST DO L C 12 DSP56303bEVMUM AD Preliminary MOTOROLA Motorola Assembler Notes Assembler Directives ASSEMBLER DIRECTIVES C 3 1 BADDR Set Buffer Address BADDR lt M R gt lt expression gt 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 lt expression gt The buffer type may be either Modulo or Reverse carry If the runtime location counter is not zero this direct
28. DUP DUPA DUPC DUPF ENDM Example B 59 MACRO Directive SWAP_SYM MACRO REG1 REG2 swap REG1 REG2 using as temp OVE R REG1 OVE R REG2 R REG1 OVE 2 C 3 39 MODE Change Relocation Mode MODE lt ABS OLUTE REL ATIVE gt Causes the assembler to change to the designated operational mode The MODE directive may be given at any time in the assembly source to alter the set of location counters used for section addressing Code generated while in absolute mode will be placed in memory at the location determined during assembly Relocatable code and data are based from the enclosing section start address The MODE directive has no effect when the command line A option is issued Note A label is not allowed with this directive Note See also ORG Example B 60 MODE Directive MODE ABS Change to absolute mode C 3 40 MSG Programmer Generated Message MSG lt str gt lt exp gt lt str gt lt exp gt lt str gt lt exp gt The MSG directive will cause a message to be output by the assembler The error and warning counts will not be affected The MSG directive is normally used in conjunction with conditional assembly directives for informational purposes The assembly proceeds normally after the message has been printed An arbitrary number of strings and expressions in any order but separated by commas with no in
29. HHE DEF ABCDEF C 2 11 Substring Delimiter lt string gt lt offset gt lt length gt Square brackets delimit a substring operation The lt string gt argument is the source string lt offset gt is the substring starting position within lt string gt lt length gt is the length of the desired substring lt string gt may be any legal string combination including another substring An error is issued if either lt offset gt or lt length gt exceed the length of lt string gt Example B 13 Example of a Substring Delimiter DEFINE ID DSP56000 3 5 ID 56000 C 2 12 lt lt 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 lt lt 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 wo
30. Next the runtime location counter is advanced by the value of the integer expression in the operand field lt expression gt can have any memory space attribute The block of memory reserved is not initialized to any given value The result of lt expression gt must be an absolute integer greater than zero and cannot contain any forward references symbols that have not yet been defined The expression also must fall within the range 2 expression amp where is the maximum address of the target DSP label if present will be assigned the value of the runtime location counter after a valid base address has been established Note See also DS DSR Example B 33 DSM Directive ORG X 100 M BUF DSM 24 CIRCULAR BUFFER MOD 24 MOTOROLA DSP56303EVMUM AD Preliminary C 21 Motorola Assembler Notes Assembler Directives C 3 13 DSR Define Reverse Carry Storage lt 1 1 gt DSR lt expression gt The DSR directive reserves a block of memory the length of which in words is equal to the value of lt expression gt If the runtime location counter is not zero this dece first advances the runtime location counter to a base address that is a multiple of 20 where 25 gt lt expression gt An error will be issued if there is insufficient memory remaining to establish a valid base address Next the runtime location counter is advanced by the value of the integer expression in the operand field lt e
31. PC Receive Data Pin RD 4 14 host PC requirements 1 4 Host PC Transmit Data Pin TD 4 14 Include file C 35 installing software 1 8 internet address ii 2 4 2 5 J 14 4 14 J5 4 14 J7 4 10 J9 4 6 JTAG 4 14 jumper settings 1 6 K kit contents 1 3 L Label local C 46 C 49 label field 3 4 LED red 4 14 Line continuation C 4 linker 3 3 3 16 options 3 17 linker directives 3 23 Listing file C 46 format C 37 C 45 C 48 C 52 C 61 sub title C 60 title C 61 llinker directives 3 23 Location counter C 8 C 49 Index 4 DSP56303EVMUM AD Preliminary Long Memory Data Moves 4 6 M Macro call C 46 comment C 45 definition C 39 C 46 directive C 39 end C 28 exit C 30 expansion C 46 library C 38 C 46 purge C 53 Macro argument concatenation operator C 4 local label override operator C 6 return hex value operator C 6 return value operator C 5 MC145407 4 14 MC33078 4 11 MC74HCT241A 4 10 Memory limit C 33 C 37 utilization C 46 Memory space C 46 C 49 Motorola DSP linker 3 16 Motorola software 1 8 N Noise Level 1 11 Number of Bits to Compare Bits BCN 3 0 4 8 Object file comment C 17 identification C 33 symbol C 48 C 49 C 61 object files 3 3 OnCE commands 4 14 OnCE JTAG conversion 4 14 operand field 3 5 operand fields 3 5 Operating Mode DSP56303 4 9 operation field 3 4 Option AE 43 C 44 assembler operation C 43 MOTOROLA 44 42
32. R REG1 OVE D4 L R REG2 ENDI 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 RO D4 L MOVE R1 RO MOVE D4 L R1 C 2 4 2 Return Value of Symbol Character The lt symbol gt sequence when used in macro definitions will be replaced by an ASCII string representing the value of lt symbol gt This operator may be used in association with the backslash operator The value of lt symbol gt must be an integer not floating point Example B 5 Example of Use of Return Value Character Consider the following macro definition SWAP SYMMACRO REG1 REG2 swap REG1 REG2 using D4 L as temp OVE R REG1 D4 L OVE R REG2 R REG1 OVE D4 L R REG2 END If the source file contained the following SET statements and macro call AREG SE 0 BREG SE 1 SWAP SYM AREG BREG the resulting expansion as it would appear on the source listing would be MOTOROLA DSP56303EVMUM AD Preliminary C 5 Motorola Assembler Notes Assembler Significant Characters Example B 5 Example of Use of Return Value Character MOVE RO D4 L MOVE _ 81 80 MOVE D4 L RL 2 5 Return Hex Value of Symbol Character The lt
33. 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 DSP56303EVM board This provides the connection to allow the PC to control the board function 3 Make sure that the external 7 9 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 DSP56303EVM board 5 Apply power to the power supply The green Power LED will light when power is correctly applied MOTOROLA DSP56303EVMUM AD Preliminary 1 7 Quick Start Guide Installation Procedure 1 3 3 Installing the Software The DSP56303EVM software includes the following 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 Insert the Motorola software diskette into the PC diskette drive If the system is not already running in Windows start Windows From Windows select a DOS window and run the install program The general format for the command line of the install program is install source For example if your diskette drive is a type in a install a The program installs the software in the default destination c evm30xw Close the DOS window and remove the Motorola software diskette from the diskette drive Insert the Domain Technologi
34. RX data 7 8 ds 1 data time slot 7 8 for RX ISR TX BUFF BASE equ TX data 1 2 ds data time slot 1 2 for TX ISR TX data 3 4 ds data time slot 3 4 for TX ISR TX data 5 6 ds data time slot 5 6 for TX ISR TX data 7 8 ds data time slot 7 8 for TX ISR RX PTR ds 1 Pointer for rx buffer TX PTR ds 1 Pointer for tx buffer D 6 DSP56303bEVMUM AD Preliminary MOTOROLA D 3 1 4 This portion of the code starts at P 000000 This code initializes the DSP and codec and performs the example operations It begins by setting the on chip PLL multiplier to run the DSP at a higher frequency The number of external bus wait states is set up 1 one Wait State in all external spaces is selected here The program runs initializes all the internal registers and buffers Then a separate program initializes the codec Finally the last part of the program processes the analog data as specified This last part ends the conditional assembly code ENDIF Sample Program Codec Programming Tutorial ECHO ASM Program Description Example B 94 Sample Program Listing org P 100 START main movep 040005 x M_PCTL movep 012421 ENDIF echo MOTOROLA jo ee org p movec 0 5 move 0 SC ori 3 mr movep 5040005 PCTL movep 4 11 x M TCSRO move 540 move 1 6 move RX_BUFF_BASE x0 move x0 x RX move BUFF BASE x0 move 0 PTR IHE CODEC
35. THEN the keyword THEN is optional if expression is false execute lt stmtlist gt following ELSE if present otherwise advance to the instruction following ENDI Note In the case of nested IF THEN ELSE statements each ELSE refers to the most recent IF THEN sequence Example B 85 IF Statement IF EQ zero bit set ENDI C 4 2 5 LOOP Statement LOOP cnt stmtlist ENDL Execute lt stmtlist gt cnt times This is similar to the FOR loop construct except that the initial counter and step value are implied to be 1 It is actually a shorthand method for setting up a hardware DO loop on the DSP without having to worry about addressing modes or label placement Since the LOOP statement generates instructions for a hardware DO loop the same restrictions apply as to the use of certain instructions near the end of the loop nesting C 68 DSP56303bEVMUM AD Preliminary MOTOROLA Motorola Assembler Notes Structured Control Statements restrictions etc One or more CONTINUE directives inside a LOOP construct will generate a NOP instruction just before the loop address Example 86 Statement LOOP LPCNT hardware loop LPCNT times ENDL C 4 2 6 REPEAT Statement REPEAT stmtlist UNTIL expression lt stmtlist gt is executed repeatedly until expression is true When expression becomes true advance to the next instruction following UNTIL The lt
36. The DEFINE directive is used to define substitution strings that will be used on all following source lines All succeeding lines will be searched for an occurrence of lt symbol gt which will be replaced by lt string gt This directive is useful for providing better documentation in the source program lt symbol gt must adhere to the restrictions for non local labels That is it cannot exceed 512 characters the first of which must be alphabetic and the remainder of which must be either alphanumeric or the underscore _ A warning will result if a new definition of a previously defined symbol is attempted The assembler output listing will show lines after the DEFINE directive has been applied and therefore redefined symbols will be replaced by their substitution strings unless the NODXL option in effect see the OPT directive Macros represent a special case DEFINE directive translations will be applied to the macro definition as it is encountered When the macro is expanded any active DEFINE directive translations will again be applied DEFINE directive symbols that are defined within a section will only apply to that section See the SECTION directive Note A label is not allowed with this directive Note See also UNDEF Example B 31 DEFINE Directive If the following DEFINE directive occurred in the first part of the source program DEFINE ARRAYSIZ 10 SAMPLSIZ then the source line below DS ARRAYSIZ
37. allowed to permit the program source to be arranged in an arbitrary manner for example all statements that reserve X space storage locations grouped together but retain the privacy of the symbols for each section When the assembler operates in relative mode the default sections act as the basic grouping for relocation of code and data blocks For every section defined in the source a set of location counters is allocated for each DSP memory space These counters are used to maintain offsets of data and instructions relative to the beginning of the section At link time sections can be relocated to an absolute address loaded in a particular order or linked contiguously as specified by the programmer Sections which are split into parts or among files are logically recombined so that each section can be relocated as a unit Sections may be relocatable or absolute In the assembler absolute mode command line A option all sections are considered absolute A full set of locations counters is reserved for each absolute section unless the GS option is given see the OPT directive this chapter In relative mode all sections are initially relocatable However a section or a part of a section may be made absolute either implicitly by using the ORG directive or explicitly through use of the MODE directive Note A label is not allowed with this directive Note See also MODE ORG GLOBAL LOCAL XDEF XREF Example B 72 SECTION Directive
38. and that those definitions are explicitly local to that section It is useful in cases where a symbol is used as a forward reference in a nested section where the enclosing section contains a like named symbol This directive is only valid if used within a program block bounded by the SECTION and ENDSEC directives The LOCAL directive must appear before symbol is defined in the section If the symbols that appear in the operand field are not defined in the section an error will be generated Note A label is not allowed with this directive Note See also SECTION XDEF XREF C 36 DSP56303bEVMUM AD Preliminary MOTOROLA Motorola Assembler Notes Assembler Directives Example B 55 LOCAL Directive SECTION LOCAL LOOPA LOOPA local to this section ENDSEC C 3 35 Set Low Memory Bounds LOMEM mem lt 1 gt lt expression gt The LOMEM directive establishes an absolute low memory bound for code and data generation lt mem gt corresponds to one of the DSP memory spaces X Y L P E lt rl gt is one of the letters R for runtime counter or L for load counter The lt expression gt is an absolute integer value within the address range of the machine If during assembly the specified location counter falls below the value given by lt expression gt a warning is issued Note A label is not allowed with this directive Note See also HIMEM Example B 56 LOMEM Directive LOMEM XR 100
39. any arbitrary assembler expression and therefore must not contain embedded blanks C 4 4 Assembly Listing Format Structured control statements begin with the directive in the opcode field any optional label is output in the label field The rest of the statement is left as is in the operand field except for any trailing comment the X and Y data movement fields are ignored Comments following the statement are output in the comment field unless the unreported comment delimiter is used Statements are expanded using the macro facilities of the assembler Thus the generated code can be sent to the listing by specifying the MEX assembler option either via the OPT directive or the O command line option MOTOROLA DSP56303EVMUM AD Preliminary C 73 Motorola Assembler Notes Structured Control Statements 4 5 Effects 5 Environment During assembly global labels beginning with Z_L are generated They are stored in the symbol table and should not be duplicated in user defined labels Because these non local labels ordinarily are not visible to the programmer there can be problems when local underscore labels are interspersed among structured control statements The SCL option see the OPT directive causes the assembler to maintain the current local label scope when a structured control statement label is encountered In the FOR loop lt op1 gt is a user defined symbol When exiting the loop t
40. code or data inside a section is considered an indivisible block with respect to relocation Code or data associated with a section is independently relocatable within the memory space to which it is bound unless the STATIC qualifier follows the SECTION directive on the instruction line Symbols within a section are generally distinct from other symbols used elsewhere in the source program even if the symbol name is the same This is true as long as the section name associated with each symbol is unique the symbol is not declared public XDEF GLOBAL and the GLOBAL or LOCAL qualifier is not used in the section declaration Symbols that are defined outside of a section are considered global symbols and have no explicit section name associated with them Global symbols may be referenced freely from inside or outside of any section as long as the global symbol name does not conflict with another symbol by the same name in a given section MOTOROLA DSP56303EVMUM AD Preliminary C 57 Motorola Assembler Notes Assembler Directives If the GLOBAL qualifier follows the lt section name gt in the SECTION directive then all symbols defined in the section until the next ENDSEC directive are considered global The effect is as if every symbol in the section were declared with GLOBAL This is useful when a section needs to be independently relocatable but data hiding is not desired If the STATIC qualifier follows the lt section name gt in the SEC
41. contained the following statements DUPF 0 7 MOVE 0 RNNUM ENDM then the assembled source listing would show DUPF NUM 0 7 OVE 0 RO OVE 0 81 0 82 0 R3 OVE 0 R4 OVE 0 85 0 86 0 87 ENDM Note that the lines DUPF NUM 0 7 ENDM will only be shown on the source listing if the MD option is enabled The lines C 26 DSP56303bEVMUM AD Preliminary MOTOROLA Motorola Assembler Notes Assembler Directives Example B 38 DUPF Directive Continued OVI OVI OVI OVI OVI OVI OVI OVI RO R1 R2 R3 R4 R5 R6 R7 C CO c cO O o uj Ee will only be shown on source listing if MEX option is enabled Note See the OPT directive in this appendix for more information on the MD and MEX options C 3 18 END End of Source Program END lt expression gt The optional END directive indicates that the logical end of the source program has been encountered Any statements following the END directive are ignored The optional expression in the operand field can be used to specify the starting execution address of the program lt expression gt may be absolute or relocatable but must have memory space attribute of Program or None The END directive cannot be used a macro expansion Note A label is not allowed with this directive Example B 39 END Direc
42. 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 DSP56303 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 DSP56303EVM diskette and is placed in the evm30xw directory by the installation procedure MOTOROLA DSP56303EVMUM AD Preliminary 3 5 Example Test Program Writing the Program Example 3 1 Simple DSP56303 Code Example SAALEARARAAARE REAR REOR R ORA E GEN AS RARER IA o o Oe eoe A SIMPLE PROGRAM CALCULATING THE SUM OF PRODUCTS EGO RC AGKOR OK UC KOK OCIO EAE AR EQU 100 instruct the assembler to replac every occurrence of PBASE with 200 XBASE EQU 0 used to define the position of the data in X memory YBASE EQU 50 used to define the position of the data in Y memory KO RC ER RRR AK AGE ADAE ACRIOR X MEMORY KORR RON AL RERO CE CK EUR KOREA org instructs the assembler that we are referring to X memory starting at location XBASE 11561 5475638 5738301 92673a 898978 5091271 25067 987153 3A8761
43. must be known on pass one no forward references allowed IF directives can be nested to any level The ELSE directive will always refer to the nearest previous IF directive as will the ENDIF directive Note A label is not allowed with this directive Note See also ENDIF Example B 52 IF Directive LST gt 0 DUP LST Unwind LIST directive stack NOLIST ENDM ENDIF C 34 DSP56303EVMUM AD Preliminary MOTOROLA Motorola Assembler Notes Assembler Directives C 3 32 INCLUDE Include Secondary File INCLUDE lt string gt lt lt string gt gt This directive is inserted into the source program at any point where a secondary file is to be included in the source input stream The string specifies the filename of the secondary file The filename must be compatible with the operating system and can include a directory specification If no extension is given for the filename a default extension of ASM is supplied The file is searched for first in the current directory unless the lt lt string gt gt syntax is used or in the directory specified in lt string gt If the file is not found and the I option was used on the command line that invoked the assembler then the string specified with the I option is prefixed to lt string gt and that directory is searched If the lt lt string gt gt syntax is given the file is searched for only in the directories specified with the I option Not
44. occurrences of lt symbol gt with lt string gt 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 lt errfil gt or EW lt errfil gt These options allow the standard error output file to be reassigned on hosts that do not support error output redirection from the command line lt errfil gt must be present as an argument but can be any legal operating system filename including an 3 8 DSP56303bEVMUM AD Preliminary MOTOROLA Example Test Program Assembling the Program optional pathname The EA option causes the standard error stream to be written to lt errfil gt if lt errfil gt exists the output stream is appended to the end of the file The EW option also writes the standard error stream to lt errfil gt if lt errfil gt 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 F lt argfil gt This option indicates that the Assembler should read command line input from lt arefil gt lt argfil gt can be any legal operation system filename including an optional pathname argfil 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
45. of the equipment required to use the DSP56303 Evaluation Module DSP56303EVM 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 DSP56303EVM The following material is provided with the DSP56303EVM DSP56303 Evaluation Module board DSP56303EVM Product Information DSP56303 Technical Data preliminary DSP56303 Chip Errata DSP56300 Family Manual DSP56303 Product Specifications Revision 1 02 DSP56303EVM 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 DSP56303EVMUM AD Preliminary 1 3 Quick Start Guide Installation Procedure 1 2 2 What You Need to Supply PC 386 class or higher with Windows 3 1 or higher including Windows 95 4Mbytes of memory minimum 3 1 2 inch high density diskette drive Hard drive with 4 Mbytes of free disk space Mouse RS 222serial 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 acor dc input into a 2 1 mm power connector Audio source tape player radio CD player
46. stmtlist gt is executed at least once even if expression is true upon entry to the REPEAT loop Example B 87 REPEAT Statement REPEAT UNTIL 1 EQ 0 loop until zero is found C 4 2 7 WHILE Statement WHILE expression DO stmtlist ENDW The expression is tested before execution of lt stmtlist gt While expression remains true lt stmtlist gt is executed repeatedly When expression evaluates false advance to the instruction following the ENDW statement If expression is false upon entry to the WHILE loop lt stmtlist gt is not executed execution continues after the ENDW directive MOTOROLA DSP56303EVMUM AD Preliminary C 69 Motorola Assembler Notes Structured Control Statements Note The DO keyword is optional Example 88 WHILE Statement WHILE 1 lt GT gt 0 loop until zero is found 4 3 Simple and Compound Expressions Expressions an integral part of and statements Structured control statement expressions should not be confused with the assembler expressions The latter are evaluated at assembly time and will be referred to here as assembler expressions they can serve as operands in structured control statement expressions The structured control statement expressions described below are evaluated at run time and will be referred to in the following discussion simply as expressions
47. the Program 3 2 WRITING THE PROGRAM The following sections describe the format of assembly language source statements and give an example assembly program 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 mac 0 0 x r0 x0 y r4 y0 Text Label Operation Operand X Data Transfer Y Data Transfer 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 e 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 e Anunderscore 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 f
48. value of zero is assumed 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 2 where 2 is greater than or equal to the value of the first expression An error will occur if the first expression contains symbols that are not yet defined forward references has a value of less than or equal to zero or falls outside the range 2 lt lt expression gt lt m where m is the maximum address of the target DSP Both expressions can have any memory space attribute lt label gt if present will be assigned the value of the runtime location counter after a valid base address has been established Only one word of object code will be shown on the listing regardless of how large the first expression is However the runtime location counter will be advanced by the number of words generated Note See also BSC BSB DC Example B 23 Block Storage Modulo Directive BUFFER BSM BUFSIZ SFFFFFFEF INITIALIZE BUFFER ALL ONES MOTOROLA DSP56303EVMUM AD Preliminary C 15 Motorola Assembler Notes Assembler Directives 3 5 BUFFER Start Buffer BUFFER M R gt lt expression gt The BUFFER directive indicates the start of a buffer of the given type Data is allocated for the buffer until an ENDBUF directive is encountered Instructions and most data definition directives may appear between the BUFFER and ENDBUF pa
49. 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 lt errfil gt or EW lt errfil gt These options allow the standard error output file to be reassigned on hosts that do not support error output redirection from the command line lt errfil gt 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 lt errfil gt if lt errfil gt exists the output stream is appended to the end of the file The EW option also writes the standard error stream to lt errfil gt if lt errfil gt exists it will be overwritten Example dsplnk EWerrors myprog cln MOTOROLA DSP56303EVMUM AD Preliminary 3 17 Example Test Program Motorola DSP Linker This example redirects the standard error output to the file errors If the file already exists it wil
50. 1 11 pass 1 12 trademark notices ii tutorial codec programming D 1 U Unified Memory Map 4 6 W Warning C 49 Windows 1 8 world wide web address ii Write Enable Pin WR 4 6 4 9 X X data transfer field 3 4 X Space Enable Bit BXEN 4 8 Y Y data transfer field 3 4 Y Space Enable Bit BYEN 4 8 Index 6 DSP56303EVMUM AD Preliminary MOTOROLA
51. 16 C18 Murata GRMAO X7R103K050BL 0 01 uF Capacitor C19 C21 C23 C25 C28 C37 C39 C40 C65 C69 C73 C74 C75 C76 C78 C80 C81 C53 Kemet T491B475K016AS 4 7 WF Capacitor C41 C42 Murata GRM40 COG220J050BL 22 pF Capacitor C48 C49 C66 C67 Murata GRM40 COG270J050BL 27 pF Capacitor C2 C3 C4 C44 C46 Murata GRM42 6Y5V334Z025BL 0 33 uF Capacitor C85 C86 C38 Murata GRM42 6Y5V474Z025BL 0 47 Capacitor C43 C45 Murata GRMA0 COG470 050BL 47 pF Capacitor C35 C36 Murata GRMA0 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 uF Capacitor Cl Xicon XAL16V1000 1000 Capacitor L1 L2 13 L4 Murata BLO1RN1 A62 Ferrite Bead R1 R43 NIC NRC12RF1001TR 1 K Resistor R30 NIC NRC12RF5001TR 5 K Resistor MOTOROLA DSP56303EVMUM AD Preliminary B 5 DSP56303EVM Parts List Table B 1 DSP56303EVM Parts List Continued Designator Manufacturer Part Number Description R4 R5 R6 R7 R20 R21 NIC NRCI2RF1002TR 10 K Resistor R22 R23 R24 R25 R29 R31 R32 R34 R35 R36 R37 R38 R39 R40 R41 R42 R44 R8 R9 NIC NRC25RFI5R8TR 15 8 KO Resistor R14 R15 NIC NRCI2RF1500TR 150 Resistor R16 R18 NIC NRC12RF2212TR 22 1 KQ Resistor R12 R13 NIC NRC12RF3922TR 39 2 Resistor R17 R19 NIC NRC12RF4752TR 47 5 KQ Resistor R45 NIC NRC12RF5600TR 2 7 KQ Resistor R10 R11 R46 NIC NRC12RF6040TR 604 Q Resistor R28 NIC NRC12RF6803TR 680 KQ
52. 23 of the DSP56303 are connected to the second and third bank of SRAM The SRAM Write W and output G enable lines are connected to the DSP56303 Write WR and Read RD lines respectively The SRAM chip Enable E is generated by the DSP56303 Address Attribute 0 AAO The SRAM activity is controlled by AAO and the corresponding Address Attribute Register 0 AARO 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 DSP56303 Address Attribute 3 AA3 or to DSP56303 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 DSP56303 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 DSP56303 J9 J9 1 2 3 1 2 3 DSP SRAM DSP SRAM 14 14 14 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 14 is connected to the DSP56303 address line A14 This configuration selects a unified memory map of 32 K words The unified memory does not contain partitioned X data data and program memory Thus access to P 1000 1000 4 6 DSP56303bEVMUM AD Preliminary MOTOROLA DSP56303EVM Technical Summary Memory and Y 1000 are treated as accesses to the same memory cell and 48 bit long memory data moves are not poss
53. 4 17 45 47 1996 DSP56303 Chip Revision No 000303 LEFT RIGHT 4B below 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 24040 23868 2 69 2 75 6 00 94 Hz 22112 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 Figure 1 4 DSP56303EVM 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 responses to determine if the DSP56303EVM 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 DSP56303EVM 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 acc
54. 5 4 12 Codec Clock Generation 4 13 RS 232 Serial 4 14 DSP56303EVMUM AD Preliminary vi Table 1 LIST OF TABLES DSP56303EVM Parts 6 DSP56303EVMUM AD Preliminary vii viii DSP56303EVMUM AD Preliminary MOTOROLA SECTION 1 QUICK START GUIDE DSP56303EVMUM AD Preliminary Quick Start Guide 1 2 2 1 3 1 3 1 1 3 2 1 3 3 1 3 4 1 2 OVER VIEW ug ach oe Hed al NE ud 1 3 EQUIPMENT taki de eacus ar DU MTS eden we 1 3 What You Get with the DSP56303EVM 1 3 What You Need to 1 4 INSTALLATION 1 4 Preparing the DSP56303EVM 1 5 Connecting the DSP56303EVM to the PC and Power 1 7 Installing the 1 8 Testing the DSP56303EVM 1 9 DSP56303EVMUM AD Preliminary MOTOROLA Quick Start Guide Overview 11 OVERVIEW This section provides a summary description of the evaluation module contents additional requirements and quick installation and test information Detailed information about the DSP56303EVM design and operation is provided in the remaining sections of this manual 12 EQUIPMENT The following section gives a brief summary
55. A structured control statement expression may be simple or compound A compound expression consists of two or more simple expressions joined by either AND or OR but not both in a single compound expression C 4 3 1 Simple Expressions Simple expressions are concerned with the bits of the Condition Code Register CCR These expressions are of two types The first type merely tests conditions currently specified by the contents of the CCR section C 4 3 2 The second type sets up a comparison of two operands to set the condition codes and afterwards tests the codes C 4 3 2 Condition Code Expressions A variety of tests identical to those in the Jcc instruction may be performed based on the CCR condition codes The condition codes in this case are preset by either a user generated instruction or a structured operand comparison expression Each test is expressed in the structured control statement by a mnemonic enclosed in angle brackets C 70 DSP56303bEVMUM AD Preliminary MOTOROLA Motorola Assembler Notes Structured Control Statements When processed by the assembler the expression generates an inverse conditional jump to beyond the matching ENDx UNTIL directive Example B 89 Condition Code Expression lt gt zero bit set bne 2 100002 code generated by assembler CLR D1 code ENDI 4 Z L00002 assembler generated label REPEAT subtract until 00 D7 t Z L00034 a
56. AD Preliminary MOTOROLA Motorola Assembler Notes Assembler Directives Note See also DUPA DUPC DUPF ENDM MACRO Example B 35 DUP Directive The sequence of source input statements COUNT SET 3 DUP COUNT ASR BY COUNT ASR DO ENDM would generate the following in the source listing COUNT SET 3 DUP COUNT ASR BY COUNT ASR DO ASR DO ASR DO ENDM Note that the lines DUP COUNT ASR BY COUNT ENDM will only be shown on the source listing if the MD option is enabled The lines ASR DO ASR DO ASR DO will only be shown on the source listing if the MEX option is enabled Note See the OPT directive in this appendix for more information on the MD and MEX options C 3 15 DUPA Duplicate Sequence With Arguments lt label gt DUPA dummy arg lt arg lt arg gt ENDM The block of source statements defined by the DUPA and ENDM directives will be repeated for each argument For each repetition every occurrence of the dummy parameter within the block is replaced with each succeeding argument string If the MOTOROLA DSP56303EVMUM AD Preliminary 23 Motorola Assembler Notes Assembler Directives argument string is a null then the block is repeated with each occurrence of the dummy parameter removed If an argument includes an embedded blank or other assembler significant character it must be enclosed with single quotes lt label gt if present will be assigned the value of t
57. Assembler Directives C 3 59 XDEF External Section Symbol Definition XDEF lt symbol gt lt symbol gt lt symbol gt The XDEF directive is used to specify that the list of symbols is defined within the current section and that those definitions should be accessible by sections with a corresponding XREF directive This directive is only valid if used within a program section bounded by the SECTION and ENDSEC directives The XDEF directive must appear before lt symbol gt is defined in the section If the symbols that appear in the operand field are not defined in the section an error will be generated Note A label is not allowed with this directive Note See also SECTION XREF Example B 80 XDEF Directive SECTION XDEF LOOPA LOOPA will be accessible by sections with XREF ENDSEC C 3 60 XREF External Section Symbol Reference XREF lt symbol gt lt symbol gt lt symbol gt The XREF directive is used to specify that the list of symbols is referenced in the current section but is not defined within the current section These symbols must either have been defined outside of any section or declared as globally accessible within another section using the XDEF directive If the XREF directive is not used to specify that a symbol is defined globally and the symbol is not defined within the current section an error will be generated and all references within the current section to such a symbol will b
58. 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 DSP56303EVMUM AD Preliminary 3 13 Example Test Program Assembling the Program 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 DSP56303EVMUM AD Preliminary MOTOROLA Example Test Program Assembling the Program 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
59. Codec Common Headphone Return Pin HEADC 4 11 Audio Codec Crystals 4 13 Audio Codec Data Control Select Pin D C 4 12 Audio Codec Digital Interface 4 12 Audio Codec Frame Sync Pin 4 12 Audio Codec Left Headphone Output Pin HEADL 4 11 Audio Codec Left Line Output Pin LOUTL 4 11 Audio Codec Left Microphone Input Pin MINL 4 11 Audio Codec Reset Pin RESET 4 12 Audio Codec Right Headphone Output Pin HEADR 4 11 Audio Codec Right Line Output Pin LOUTR 4 11 Audio Codec Right Microphone Input Pin MINR 4 11 Audio Codec Serial Data Input Pin SDIN 4 12 Audio Codec Serial Data Output Pin SDOUT 4 12 Audio Codec Serial Port Clock Pin SCLK 4 12 audio interface cable 1 4 1 9 audio source 1 4 Index 1 bootstrap 4 10 Bootstrap DSP56303 4 10 Buffer address C 13 end C 27 Checksum 44 45 code example 3 6 codec 4 10 digital interface 4 12 digital interface connections 4 12 codec programming D 1 Command Converter 4 3 command converter 4 14 command format assembler 3 7 Comment C 17 delimiter C 3 object file C 17 unreported C 4 comment field 3 4 Conditional assembly C 34 C 45 Constant define C 17 C 19 storage C 14 Crystal Semiconductor 54215 4 10 CS4215 4 10 Cycle count C 44 C 45 D D A converter 4 10 Data Pins D 0 23 4 6 4 9 data transfer fields 3 5 DC Offset 1 11 Debugger 3 3 3 24 running the 3 26 Debugger software 3 24 Debugger window display 3 25 demonstration running the
60. D Preliminary 3 25 Example Test Program Running the Program 3 6 RUNNING THE PROGRAM 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 Asa 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 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 sect
61. DSP56303EVM User s Manual Motorola Incorporated Semiconductor Products Sector DSP Division 6501 William Cannon Drive West Austin TX 78735 8598 Order this document by DSP56303EVMUM AD Introduction This document supports the DSP56303 Evaluation Module DSP56303EVM 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 Mfax and OnCE are trademarks of Motorola Inc gsm 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
62. EG1 REG2 using D4 L as temp R REG1 D4 L MOVE R REG2 RN PREG MOVE D4 L R REG2 ENDM C 3 22 ENDSEC End Section ENDSEC Every SECTION directive must be terminated by an ENDSEC directive Note A label is not allowed with this directive Note See also SECTION Example 43 ENDSEC Directive SECTION COEFF ORG X VALUES BSC 100 Initialize to zero ENDSEC C 3 23 EQU Equate Symbol to a Value label EQU X Y L P E lt expression gt The EQU directive assigns the value and memory space attribute of expression to the symbol label If expression has a memory space attribute of None then it can optionally be preceded by any of the indicated memory space qualifiers to force a memory space attribute An error will occur if the expression has a memory space attribute other than None and it is different than the forcing memory space attribute The optional forcing memory space attribute is useful to assign a memory space attribute to an expression that consists only of constants but is intended to refer to a fixed address in a memory space The EQU directive is one of the directives that assigns a value other than the program counter to the label The label cannot be redefined anywhere else in the program or MOTOROLA DSP56303EVMUM AD Preliminary C 29 Motorola Assembler Notes Assembler Directives section if SECTION directives are being used
63. F STANDALONE 1 nolist include init asm load the code init routines list ENDIF D 8 DSP56303EVMUM AD Preliminary MOTOROLA INDEX Symbols C 7 11 lt 11 gt 12 6 C 8 9 3 4 lt 10 lt lt 9 gt 10 2 5 8 4 C 6 A A D converter 4 10 AARO 4 8 programming 4 7 Address Attribute Pin Polarity Bit BAAP 4 7 Address Attribute Pin 4 6 Address Attribute Pin AA1 4 9 Address Attribute Pin AA3 4 6 Address Attribute Register AARO 4 8 Address Attribute Register 4 7 Address Muxing Bit BAM 4 7 Address Pins A 0 17 4 6 4 9 Address to Compare Bits BAC 11 0 4 8 Addressing I O short C 9 immediate C 11 long C 10 long immediate C 12 short C 10 short immediate C 11 Analog Circuitry Test 1 9 Analog Input Output 4 11 Assembler 3 16 mode C 40 option C 42 MOTOROLA DSP56303EVMUM AD Preliminary warning C 49 assembler 3 3 control 3 12 data definition storage allocation 3 12 3 13 directives 3 11 listing control and options 3 14 macros and conditional assembly 3 15 object file control 3 14 options 3 8 significant characters 3 11 structured programming 3 15 symbol definition 3 12 3 13 assembler control 3 12 assembler directives 3 11 assembler options 3 8 assembling the example program 3 16 assembling the program 3 7 assembly programming 3 3 Audio Codec 4 3 audio codec 4 10 Audio Codec Clock 4 13 Audio
64. M Analysis Program 1 10 SECTION 2 RUNNING THE DEMONSTRATION FILE 2 1 2 1 OVERVIEW Dr abbas seek eee 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 x ow xu ee BYERS 3 3 3 2 WRITING THE PROGRAM 3 4 3 2 1 Source Statement 3 4 3 2 1 1 Label Field roc hs na od Out 3 4 3 2 1 2 Operation Field ser uy rr 3 4 3 2 1 3 Operand PET 3 5 3 2 1 4 Data Transfer 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 3 11 MOTOROLA DSP56303EVMUM AD Preliminary iii 3 3 3 1 Assembler Significant Characters 3 11 3 3 3 2 Assembly 3 12 33 33 Symbol Definition seb 4444 3 13 3 3 3 4 Data Definition Storage Allocation 3 13 3 3 3 5 Listing Control and Options 3 14 3 3 3 6 Object File
65. NG THE DEMONSTRATION FILE MOTOROLA DSP56303EVMUM AD Preliminary 2 1 Running the Demonstration File 2 1 OVERVIEW tou vee oe Oe eee ee ees 2 3 2 2 SETTING UP THE DEMONSTRATION 2 3 2 3 RUNNING THE 5 2 4 2 2 DSP56303EVMUM AD Preliminary MOTOROLA Running the Demonstration File Overview 21 OVERVIEW This section describes the demonstration that is included with the DSP56303EVM 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 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 Se
66. OROLA 4 1 DSP56303EVM Technical Summary DSP56303EVM Description and Features DSP56303EVM DESCRIPTION AND FEATURES An overview description of the DSP56303EVM is provided in the DSP56303EVM Product Information document order number DSP56303EVMP D included with this kit The main features of the DSP56303EVM include the following 4 2 DSP56303 24 Bit Digital Signal Processor Memory 16 bit CD quality audio codec Command Converter DSP56303 DESCRIPTION A full description of the DSP56303 including functionality and user information is provided in the following documents included as a part of this kit Note DSP56303 Technical Data order number DSP56303 D Provides features list and specifications including signal descriptions DC power requirements AC timing requirements and available packaging DSP56303 User s Manual order number DSP56308UM 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 The DSP56303 User s Manual is currently not available The DSP56303 Product Specification Revision 1 02 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 in
67. Output The DSP56303EVM contains 1 8 inch stereo jacks for stereo input output and headphones Figure 4 8 shows the analog circuitry of the codec CS4215 Stereo MINR Input MOUTI Unused P3 MINL MOUT2 Headphones LINR HEADC P4 Unused LINL LOUTR Stereo Output Figure 4 8 Codec Analog Input Output Diagram The stereo jack labelled P3 IN on the DSP56303EVM 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 HEADR are connected to the stereo jack labelled P4 HDPHNE the DSP56303EVM which permits direct connection of stereo headphones to the DSP56303EVM The Headphone Common return is the return path for large currents when driving headphones from HEADL and HEADR The Line Outputs LO
68. PPENDIX DSP56303EVM PARTS 57 B 1 APPENDIX C MOTOROLA ASSEMBLER NOTES C 1 APPENDIX D CODEC PROGRAMMING TUTORIAL D 1 et fee weenie bine hat an INDEX 1 M MOTOROLA DSP56303EVMUM AD Preliminary V Figure 1 1 Figure 1 2 Figure 1 3 Figure 1 4 Figure 2 1 Figure 3 1 Figure 3 2 Figure 4 1 Figure 4 2 Figure 4 3 Figure 4 4 Figure 4 5 Figure 4 6 Figure 4 7 Figure 4 8 Figure 4 9 Figure 4 10 Figure 4 11 MOTOROLA LIST OF FIGURES DSP56303EVM Component Layout 1 6 Connecting the DSP56303EVM Cables 1 7 DSP56303EVM Test Sample Output Fail 1 11 DSP56303EVM Test Sample Output Pass 1 12 DSP56303EVM Component Layout 2 4 Development Process 3 3 Example Debugger Window Display 3 25 DSP56303EVM Component Layout 4 4 DSP56303EVM Functional Block Diagram 4 5 SRAM Connections to the 05 56303 4 6 Alternate Configurations for J9 4 6 Example Memory with the Unified External Memory 4 7 Address Attribute Register AARO 4 8 Flash PEROM Connections 4 9 Codec Analog Input Output Diagram 4 11 Codec Digital Interface
69. ROM 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 DSP56303EVM diskette allows the user to program the Flash PEROM with the code to be run by the DSP56303 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 RO When invoked flash asm reads the stand alone code from program MOTOROLA DSP56303EVMUM AD Preliminary 4 9 DSP56303EVM Technical Summary Audio Codec memory starting at the address pointed to by RO and ending at the location defined by the value in R1 and writes the stand alone code into the Flash PEROM When the DSP56303 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 4 4 AUDIO CODEC The DSP56303EVM analog section uses Crystal Semiconductor s 54215 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 DSP56303EVM and to Figure 4 2 on page 4 5 for a functional diagram of the codec within th
70. Resistor ESP B 6 DSP56303EVMUM AD Preliminary MOTOROLA APPENDIX MOTOROLA ASSEMBLER NOTES MOTOROLA DSP56303EVMUM AD Preliminary C 1 Motorola Assembler Notes C 1 INTRODUCTION ere C 2 ASSEMBLER SIGNIFICANT CHARACTERS C 3 ASSEMBLER DIRECTIVES C 4 STRUCTURED CONTROL STATEMENTS MOTOROLA 2 DSP56303EVMUM AD Preliminary Motorola Assembler Notes Introduction 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 e Assembler directives e 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 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
71. T29LV512 chip U7 to provide a 64 K x 8 bit CMOS Flash PEROM for stand alone operation i e operation without accessing the DSP56303 through the OnCE port The AT29LV512 uses a 3 3 V power supply and has a read access time of 200 ns 4 3 2 1 Flash PEROM Connections The basic connection for the Flash PEROM is shown in Figure 4 7 DSP56303 FLASH 0 15 0 15 D0 D7 4 00 1 07 AA1 RD Jo WR L WE oo m m Figure 4 7 Flash PEROM Connections The Flash Address input pins 0 15 are connected to the respective Port A address pins on the DSP The Flash data Input Output pins I O0 I O7 are connected to the DSP56303 D0 D7 pins The Flash Write Enable WE and Output Enable OE lines are connected to the DSP56303 Write WR and Read RD enable lines respectively Address Attribute 1 generates the Flash chip enable CE 4 3 2 2 Programming for Stand Alone Operation The Flash PEROM allows the DSP56303EVM to work in stand alone operation The DSP56303 mode pins determine the chip operating mode and start up procedure when the DSP56303 exits the Reset state The switch at SW1 resets the DSP56303 asserting and then clearing the RESET pin of the DSP56303 The mode pins MODA MODB MODC and MODD are sampled as the DSP56308 exits the Reset state The mode pins for the DSP56303EVM are set so that the DSP56303 will boot from Flash PE
72. TION directive then all code and data defined in the section until the next ENDSEC directive are relocated in terms of the immediately enclosing section The effect with respect to relocation is as if all code and data in the section were defined within the parent section This is useful when a section needs data hiding but independent relocation is not required If the LOCAL qualifier follows the lt section name gt in the SECTION directive then all symbols defined in the section until the next ENDSEC directive are visible to the immediately enclosing section The effect is as if every symbol in the section were defined within the parent section This is useful when a section needs to be independently relocatable but data hiding within an enclosing section is not required The division of a program into sections controls not only labels and symbols but also macros and DEFINE directive symbols Macros defined within a section are private to that section and are distinct from macros defined in other sections even if they have the same macro name Macros defined outside of sections are considered global and may be used within any section Similarly DEFINE directive symbols defined within a section are private to that section and DEFINE directive symbols defined outside of any section are globally applied There are no directives that correspond to XDEF for macros or DEFINE symbols and therefore macros and DEFINE symbols defined in a section can
73. TOROLA DSP56303EVMUM AD Preliminary B 3 DSP56303EVM Parts List Table B 1 DSP56303EVM Parts List Continued Designator Manufacturer Part Number Description 1 Ecliptek EC2 169 16 9344MHZ 16 9344 MHz Crystal 2 5 OECS 196 6 3 C3X1A 19 6608 MHz Crystal Ecliptek EC2 24624 576MHZ 24 576 MHz Crystal SW1 SW2 SW3 Panasonic 5205 6 mm Switch P1 Mouser 152 3409 DB 9 Female Connector P2 Switchcraft 722 21 mm DC Power Jack P3 P5 Switchcraft 35RAPCABHN2 3 5 mm Miniature Jack A Robinson NSH 8DB S2 TG Header 8 pin Nugent double row J2 3 Robinson NSH 16DB S2 TG Header 16 pin Nugent double row 4 6 7 Robinson NSH 12DB S2 TG Header 12 pin Nugent double row J5 Robinson NSH 14DB S2 TG Header 14 pin Nugent double row J8 Robinson P2DN 40A S1 TR Header 40 pin Nugent double row J9 Robinson NSH 3SB S2 TG Header 3 pin Nugent single row C51 Xicon MR16V10 10 uF Capacitor C33 C34 C47 C56 C57 Murata GRM42 6Y5V105Z025BL 1 0 uF Capacitor C58 C59 C82 C83 B 4 DSP56303EVMUM AD Preliminary MOTOROLA DSP56303EVM Parts List Table B 1 DSP56303EVM Parts List Continued Designator Manufacturer Part Number Description C7 C8 C10 C12 C14 Murata GRM40 X7R104K025BL 0 1 uF Capacitor C15 C17 C20 C22 C24 C26 C27 C29 C30 C31 C50 C52 C54 C55 C64 C68 C70 C71 C72 C77 C79 C84 C87 C88 C9C11C13C
74. The lt expression gt may be relative or absolute but cannot include a symbol that is not yet defined no forward references are allowed Note See also SET Example B 44 EQU Directive D PORT EQU 54000 This would assign value 4000 with a memory space attribute of to symbol A_D_PORT COMPUTE EQU LCV 1 LCV L is used to refer to the value and memory space attribute of the load location counter This value and memory space attribute would be assigned to the symbol COMPUTE C 3 24 Exit Macro EXITM The EXITM directive will cause immediate termination of a macro expansion It is useful when used with the conditional assembly directive IF to terminate macro expansion when error conditions are detected Note A label is not allowed with this directive Note See also DUP DUPA DUPC MACRO Example B 45 EXITM Directive CALC MACRO XVAL YVAL IF XVAL O FAIL Macro parameter value out of range EXITM Exit macro ENDIF ENDM C 30 DSP56303EVMUM AD Preliminary MOTOROLA Motorola Assembler Notes Assembler Directives 3 25 Programmer Generated Error FAIL lt str gt lt exp gt lt str gt lt exp gt lt stxr gt lt exp gt The FAIL directive will cause an error message to be output by the assembler The total error count will be incremented as with any other error The FAIL directive is normally used in conjunction with conditional ass
75. This directive is only valid if used within a program block bounded by the SECTION and ENDSEC directives If the symbols that appear in the operand field are not defined in the section an error will be generated Note A label is not allowed with this directive Note See also SECTION XDEF XREF Example B 48 GLOBAL Directive SECTION IO GLOBAL will globally accessible by other sections ENDSEC 3 28 GSET Set Global Symbol to a Value lt label gt GSET lt expression gt GSET lt label gt lt expression gt The GSET directive is used to assign the value of the expression in the operand field to the label The GSET directive functions somewhat like the EQU directive However labels defined via the GSET directive can have their values redefined in another part of the program but only through the use of another GSET or SET directive The GSET directive is useful for resetting a global SET symbol within a section where the SET symbol would otherwise be considered local The expression in the operand field of a GSET must be absolute and cannot include a symbol that is not yet defined no forward references are allowed Note See also EQU SET Example B 49 GSET Directive COUNT GSET 0 INITIALIZE COUNT C 32 DSP56303bEVMUM AD Preliminary MOTOROLA Motorola Assembler Notes Assembler Directives 3 29 HIMEM Set High Memory Bounds HIMEM mem rl expression T
76. UTR and LOUTL provide the output analog signal through the stereo jack labelled P5 OUT on the DSP56303EVM This jack can be selected in software to provide output swings of 2 Vp or 2 8 Vp Refer to the 54215 data sheet for technical details of the programming steps required to choose the output voltage swing MOTOROLA DSP56303EVMUM AD Preliminary 4 11 DSP56303EVM Technical Summary Audio Codec 4 4 2 Codec Digital Interface Figure 4 9 shows the digital interface to the codec DSP56303 CS4215 _____ SDIN 5800 4 _____ SDOUT SCKO 4 SCLK 5 00 _______ RESET 5 011 5 021 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 DSP56303 through the ESSIO which consists of independent transmitter and receiver sections On the DSP56303 side the Serial Transmit Data 5700 pin transmits data to the codec The Serial Receive Data 0 SRDO 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 DSP56303 bidirectional Serial Clock 5 pin provides the serial bit rate clock for the ESSIO 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
77. al SRAM It also examines the analog circuitry of the DSP56303EVM by analyzing the response of the analog circuitry to a sequence of tones This part of the self test begins running immediately when the DSP56303 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 DSP56303EVM by moving an audio signal through the codec The second part of the self test begins following a receipt of external Interrupt Request D IROD is activated by pressing the switch labelled SW3 The following steps describe how to run self test code for the DSP56303EVM 1 Install the cable with the 1 8 inch stereo plugs between the line input jack labelled P3 IN on the DSP56303EVM and the line output jack labelled P5 OUT on the DSP56303EVM 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 DSP56303EVM Refer to Figure 1 1 on page 1 6 for the location of SW1 This switch resets the DSP56303 and allows the DSP56303 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 lights when the test begins running When this test is complete the LED turns off if the DSP56303EVM passed the test If the DSP56303EVM fails the test the LED fl
78. al line for printing NOPS Do not pack strings in DC directive Individual bytes in strings will be stored one byte per word NORC default reset Do not space comments relatively MOTOROLA DSP56303EVMUM AD Preliminary C 47 Motorola Assembler Notes Assembler Directives C 48 NORP default reset Do not generate instructions to accommodate pipeline delay NOSCL Do not maintain the current local label scope when a structured control statement label is encountered NOU lt default reset Do not print the lines excluded from the assembly due to a conditional assembly directive NOUR default reset Do not flag unresolved external references NOW Do not print warning messages NS default reset Allow scoping of symbols within nested sections PP default reset Pretty print listing file The assembler attempts to align fields at a consistent column position without regard to source file formatting PS default reset Pack strings in DC directive Individual bytes in strings will be packed into consecutive target words for the length of the string RC Space comments relatively in listing fields By default the assembler always places comments at a consistent column position in the listing file This option allows the comment field to float on a line containing only a label and opcode the comment would begin in the operand field RP Generate NOP instructions to accommodate pipeline delay
79. ample Test Program Assembling the Program 3 3 3 Assembler Directives In addition to the DSP56303 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 2 Macro value substitution operator Macro hex value substitution operator Macro local label override operator 44 Macro string delimiter or quoted string DEFINE expansion character Function delimiter Location counter substitution String concatenation operator Substring delimiter lt lt I O short addressing mode force operator lt Short addressing mode force operator Long addressing mode force operator Immediate addressing mode operator lt Immediate short addressing mode force operator gt Immediate long addressing mode force operator MOTOROLA DSP56303EVMUM AD Preliminary 3 11 Example Test Program Assembling the Program 3 3 3 2 Assembly Control
80. ample that illustrates how to develop a very simple program for the DSP56303 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 Figure 3 1 shows the development process flow for assembly programs The 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 Awww motorola dsp com Assembly Program asm Assembler Relocatable Object File cin Linker Executable Object File cld Y ADS Command DSP56002 Converter Card Y P DSP56303 DSP56303EVM Figure 3 1 Development Process Flow MOTOROLA DSP56303EVMUM AD Preliminary 3 3 Example Test Program Writing
81. anded 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 Consider the source fragment below DEFINE LONG short STR MAC STRING SG This is a LONG STRING SG This is a LONG STRING ENDM If this macro were invoked as follows STR_MAC sentence then the resulting expansion would be MSG This is a LONG STRING MSG This is a short sentence C 2 8 Function Delimiter All assembler built in functions start with the symbol Example B 10 Example of a Function Delimiter Character SVAL EQ QSOT FVAL OBTAIN SQUARE ROOT C 2 9 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 ORG X 100 BASE EQU 20 XBASE 120 8 DSP56303bEVMUM AD Preliminary MOTOROLA Motorola Assembler Notes Assembler Significant Characters 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 ABC
82. arget DSP If a Reverse carry buffer is designated and lt expression gt is not a power of two a warning will be issued Note A label is not allowed with this directive Note See also BADDR BSM BSB DSM DSR ENDBUF Example B 24 Buffer Directive ORG X 100 BUFFER M 24 CIRCULAR BUFFER MOD 24 M_BUF DC 0 5 0 5 0 5 0 5 DS 20 REMAINDER UNINITIALIZED ENDBUF C 16 DSP56303bEVMUM AD Preliminary MOTOROLA Motorola Assembler Notes Assembler Directives 3 6 Comment Object File COBJ string The COBJ directive is used to place a comment in the object code file The string will be put in the object file as a comment Note A label is not allowed with this directive Note See also IDENT Example 25 Directive COBJ Start of filter coefficients C 3 7 COMMENT Start Comment Lines COMMENT lt delimiter gt lt delimiter gt The COMMENT directive is used to define one or more lines as comments The first non blank character after the COMMENT directive is the comment delimiter The two delimiters are used to define the comment text The line containing the second comment delimiter will be considered the last line of the comment The comment text can include any printable characters and the comment text will be reproduced in the source listing as it appears in the source file Note A label is not allowed with this directive Example B 26 COMMENT Direc
83. ashes To repeat the test press SW2 to invoke IROA 3 Now run the second part of the self test code to test the analog circuitry of the DSP56303EVM 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 DSP56303EVM Also connect a pair of headphones to the headphone jack labelled P4 HDPHNE on the DSP56303EVM Refer to Figure 1 1 on page 1 6 MOTOROLA DSP56303EVMUM AD Preliminary 1 9 Quick Start Guide Installation Procedure 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 DSP56303EVM 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 If both parts of the self test complete correctly the DSP56303EVM 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 DSP56303EVM continues to fail either test run the DSP56303EVM analysis program described in Section 1 3 4 2 to try to determine the cause of the problem 1 3 4 2 DSP56303EVM Analysis Program Thi
84. at Syren tea ee 1 AG QNS ly Fi XE EU CT YI TUR ANN ERE C QNI DS QAI TT RP De iios a e E S etae s peu iS DT ENLACES 1 1 1 1 1 1 1 1 1 1 31 0 1 4 10 0 31 0 4n10 0 4n10 0 1 30100 Ano 3 0 0 30100 Ano 3000 Ano 10100 3 0 0 Ano 1 1 622 1 1 892 692 792 89 9 9 2 1 089 649 8 2 119 913 49 612 219 012 69 82 1 i ae Poy x4 x7 xb XL xL DE aot a el Oe lon Cur ciis 1 TF 1 1 i 1 it l I 1 1 I 1 1 1 1 T 7 een uvis 8279 82 90 uin 6210 tein 6610 pL in 9s in 6910 98 in ein Sein 215621 310 90 9WON 310N 310N Ag MOTOROLA iminary DSP56303EVMUWM AD Prel A 7 5 9 yeeus va 96 02 8 a 00 AlddNS mE t SNOILVOllddV 459 VIOYOLON 7 ii an 3184834 3118834 580111 DAS 4 z Log n M ney 19 199 92 vo aNnov 200001 12 1009W4 10094 E 31534
85. chanism for initiating overlays Note A label is not allowed with this directive The parameters used with the ORG directive are e rms Which memory space X L P or E will be used as runtime memory space If the memory space is L any allocated datum with a value greater than the target word size will be extended to two words otherwise it is truncated If the memory space is E then depending on the memory space MOTOROLA DSP56303EVMUM AD Preliminary C 49 Motorola Assembler Notes Assembler Directives qualifier any generated words will be split into bytes one byte per word or a 16 8 bit combination rlc Which runtime counter L or default if neither L is specified that is associated with the lt rms gt will be used as the runtime location counter lt rmp gt Indicates the runtime physical mapping to DSP memory I internal E external R ROM A port A port B If not present no explicit mapping is done lt rce gt Non negative absolute integer expression representing the counter number to be used as the runtime location counter Must be enclosed in parentheses Should not exceed the value 65535 lt exp1 gt Initial value to assign to the runtime counter used as the lt rlc gt If lt 1 gt is a relative expression the assembler uses the relative location counter If lt exp1 gt is an absolute expression the assembler uses the absolute location cou
86. chronous 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 DSP56303EVMUM AD Preliminary 4 13 DSP56303EVM Technical Summary Command Converter 45 COMMAND CONVERTER The DSP56303EVM 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 DSP56303 the HA2 pin of the DSP56002 is then used to reset the DSP56303 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 DSP56303 OnCE JTAG port The DSP56303 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 DP56303 is in the Debug state the red Debug LED D6 is Illuminated The DSP56002 is connected to the DSP56303 OnCE port through the shorting jumpers on J4 By removing the jumpers the user has full access to the OnCE JTAG pins of the DSP56303 Ref
87. ck reserve data memory locations SI Interpret short immediate as long or sign extended SVO Preserve object file on errors Following are descriptions of the individual options The parenthetical inserts specify default if the option is the default condition and reset if the option is reset to its default state at the end of pass one C 44 AE default reset Check address expressions for appropriate arithmetic operations For example this will check that only valid add or subtract operations are performed on address terms CC Enable cycle counts and clear total cycle count Cycle counts will be shown on the output listing for each instruction Cycle counts assume a full instruction fetch pipeline and no wait states CEX Print DC expansions CK Enable checksumming of instruction and data values and clear cumulative checksum The checksum value can be obtained using the CHK function DSP56303bEVMUM AD Preliminary MOTOROLA Motorola Assembler Notes Assembler Directives e CL default reset Print the conditional assembly directives CM default reset Preserve comment lines of macros when they are defined Note that any comment line within a macro definition that starts with two consecutive semicolons is never preserved in the macro definition CONST EQU symbols are maintained as assembly time constants and will not be sent to the object file This option if used must be specified before the
88. 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 DSP56303EVMUM AD Preliminary C 3 Motorola Assembler Notes Assembler Significant Characters 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 Example B 2 Example of Unreported Comment Delimiter THESE LINES WILL NOT BE REPRODUCED IN THE SOURCE LISTING 2 3 Line Continuation Character Macro Argument Concatenation Character Line Continuation 2 3 1 Line Continuation The backslash character if used as the last c
89. ctive dealing with the load memory space and counter is not specified then the assembler will assume that the load memory space and load location counter are the same as the runtime memory space and runtime location counter In this case object code is being assembled to be C 50 DSP56303bEVMUM AD Preliminary MOTOROLA Motorola Assembler Notes Assembler Directives loaded into the address and memory space where it will be when the program is run and is not an overlay If the load memory space and counter are given in the operand field then the assembler always generates code for an overlay Whether the overlay is absolute or relocatable depends upon the current operating mode of the assembler and whether the load counter value is an absolute or relative expression If the assembler is running in absolute mode or if the load counter expression is absolute then the overlay is absolute If the assembler is in relative mode and the load counter expression is relative the overlay is relocatable Runtime relocatable overlay code is addressed relative to the location given in the runtime location counter expression This expression if relative may not refer to another overlay block Note See also MODE Example B 64 ORG Directive ORG 51000 Sets the runtime memory space to P Selects the default runtime counter counter 0 associated with P space to use as the runtime location counter and initializes it to 1000 The load memory s
90. d 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 DSP56303EVMUM AD Preliminary 3 19 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 O lt mem gt lt ctr gt lt map gt lt origin gt 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 mem
91. default assignments The SCSREG directive should be used judiciously to avoid register context errors during SCS expansion Source and destination registers may not necessarily be used strictly as source and destination operands The assembler does no checking of reassigned registers beyond validity for the target processor Errors can result when a structured control statement is expanded and an improper register reassignment has occurred It is recommended that the MEX option see the OPT directive be used to C 56 DSP56303bEVMUM AD Preliminary MOTOROLA Motorola Assembler Notes Assembler Directives examine structured control statement expansion for relevant constructs to determine default register usage and applicable reassignment strategies Note See also OPT MEX SCSJMP Note A label is not allowed with this directive Example 71 SCSREG Directive SCSREG YO B reassign SCS source and dest registers C 3 51 SECTION Start Section SECTION _ symbol GLOBAL STATIC LOCAL source statements gt ENDSEC The SECTION directive defines the start of a section All symbols that are defined within a section have the lt symbol gt associated with them as their section name This serves to protect them from like named symbols elsewhere in the program By default a symbol defined inside any given section is private to that section unless the GLOBAL or LOCAL qualifier accompanies the SECTION directive Any
92. e A label is not allowed with this directive Note See also MACLIB Example B 53 INCLUDE Directive INCLUDE headers io asm Unix example INCLUDE storage mem asm MS DOS example INCLUDE lt data asm gt Do not look in current directory C 3 33 LIST List the Assembly LIST Print the listing from this point on The LIST directive will not be printed but the subsequent source lines will be output to the source listing The default is to print the source listing If the IL option has been specified the LIST directive has no effect when encountered within the source program The LIST directive actually increments a counter that is checked for a positive value and is symmetrical with respect to the NOLIST directive MOTOROLA DSP56303EVMUM AD Preliminary C 35 Motorola Assembler Notes Assembler Directives Note the following sequence Counter value currently 1 LIST Counter value 2 LIST Counter value 3 NOLIST Counter value 2 NOLIST Counter value 1 The listing still would not be disabled until another NOLIST directive was issued Note A label is not allowed with this directive Note See also NOLIST OPT Example B 54 LIST Directive LISTON LIST Turn the listing back on ENDIF 3 34 LOCAL Local Section Symbol Declaration LOCAL symbol symbol symbol The LOCAL directive is used to specify that the list of symbols is defined within the current section
93. e 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 B lt objfil gt This option specifies that an object file is to be created for Assembler output lt objfil gt 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 lt objfil gt 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 lt symbol gt lt string gt This option replaces all
94. e any positive absolute integer expression The arguments in the operand field as explained below are separated by commas Any argument can be left as the default or last set value by omitting the argument and using two adjacent commas The PAGE directive with arguments will not cause a page eject and will be printed in the source listing Note A label is not allowed with this directive The arguments in order are PAGE WIDTH lt exp1 gt Page width in terms of number of output columns per line default 80 min 1 max 255 C 52 DSP56303bEVMUM AD Preliminary MOTOROLA Motorola Assembler Notes Assembler Directives PAGE LENGTH lt exp2 gt Page length in terms of total number of lines per page default 66 min 10 max 255 As a special case a page length of 0 zero turns off all headers titles subtitles and page breaks BLANK_TOP lt exp3 gt Blank lines at top of page default 0 min 0 max see below BLANK_BOTTOM lt exp4 gt Blank lines at bottom of page default 0 min 0 max see below BLANK_LEFT lt exp5 gt Blank left margin Number of blank columns at the left of the page default 0 min 0 max see below The following relationships must be maintained BLANK TOP BLANK BOTTOM lt PAGE LENGTH 10 BLANK LEFT PAGE WIDTH Note See also LSTCOL Example B 65 PAGE Directive PAGE 132 3 3 Set width 0132 3 line top bottom
95. e block is given by the first expression which must evaluate to an absolute integer Each word is assigned the initial value of the second expression If there is no second expression an initial value of zero is assumed If the first expression contains symbols that are not yet defined forward references or if the expression has a value of less than or equal to zero an error will be generated Both expressions can have any memory space attribute lt label gt if present will be assigned the value of the runtime location counter at the start of the directive processing C 14 DSP56303bEVMUM AD Preliminary MOTOROLA Motorola Assembler Notes Assembler Directives Only one word of object code will be shown on the listing regardless of how large the first expression is However the runtime location counter will be advanced by the number of words generated Note See also BSM BSB DC Example B 22 Block Storage of Constant Directive UNUSED BSC 2FFF LCV FILL UNUSED EPROM C 3 4 BSM Block Storage Modulo lt label gt BSM lt expression gt lt expression gt The BSM directive causes the assembler to allocate and initialize a block of words for a modulo buffer The number of words in the block is given by the first expression which must evaluate to an absolute integer Each word is assigned the initial value of the second expression If there is no second expression an initial
96. e 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 54215 uses 5 volt power supply Thus Motorola s MC74HCT241A is used to convert the voltage levels to and from the 3 3 volt DSP56303 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 DSP56303 ESSIO 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 ESSIO pins of the DSP56303 The following sections describe the connections for the analog and digital sections of the codec 4 10 DSP56303bEVMUM AD Preliminary MOTOROLA DSP56303EVM Technical Summary Audio Codec 4 4 1 Codec Analog Input
97. e flagged as undefined The XREF directive must appear before any reference to lt symbol gt in the section Note A label is not allowed with this directive MOTOROLA DSP56303EVMUM AD Preliminary C 63 Motorola Assembler Notes Structured Control Statements Note See also SECTION XDEF Example B 81 XREF Directive SECTION FILTER XREF AA CC DD XDEFed symbols within section ENDSEC C 4 STRUCTURED CONTROL STATEMENTS An assembly language provides an instruction set for performing certain rudimentary operations These operations in turn may be combined into control structures such as loops FOR REPEAT WHILE or conditional branches IF THEN IF THEN ELSE The assembler however accepts formal high level directives that specify these control structures generating the appropriate assembly language instructions for their efficient implementation This use of structured control statement directives improves the readability of assembly language programs without compromising the desirable aspects of programming in an assembly language C 4 1 Structured Control Directives The following directives are used for structured control Note the leading period which distinguishes these keywords from other directives and mnemonics Structured control directives may be specified in either upper or lower case but they must appear in the opcode field of the instruction line e g they must be preceded either by a label a
98. e is analogous to the FORCE directive but it only applies to branches generated automatically by structured control statements See Section C 4 on page C 64 There is no explicit way as with a forcing operator to force a branch short or long when it is produced by a structured control statement This directive will cause all branches resulting from subsequent structured control statements to be forced to the specified mode Just like the FORCE pseudo op errors can result if a value is too large to be forced short For relocatable code the error may not occur until the linking phase Note See also FORCE SCSREG Note A label is not allowed with this directive Example B 70 SCSJMP Directive SCSJMP SHORT force all subsequent SCS jumps short C 3 50 SCSREG Reassign Structured Control Statement Registers SCSREG lt gt lt gt tmpreg gt The SCSREG directive reassigns registers used by structured control statement SCS directives It is convenient for reclaiming default SCS registers when they are needed as application operands within a structured control construct lt srcreg gt is ordinarily the source register for SCS data moves lt dstreg gt is the destination register lt tmpreg gt is a temporary register for swapping SCS operands lt extreg gt is an extra register for complex SCS operations With no arguments SCSREG resets the SCS registers to their
99. e operational parameters Please refer to the ADA EQU ASM source file for a description of the parameters selections available The variables defi the transmit buffer ned by the EQUates are sent to the codec via Since the parameters are defined EQU ASM these lines must follow the include statement PERERA RET RIAA IGN REEE TOR ON LOM RR Tess REE GNU A These files perform the f ollowing functions IOEQU ASM defines a standard set of symbolic names for the addresses of the on chip peripheral registers INTEQU ASM sets up the interrupt definitions e ADA_EQU ASM defines the registers parameters and bit mapping of the CS4215 This is the key to facilitating the selection of the codec s functions VECTORS ASM defines the interrupt vectors required by the interrupt handlers MOTOROLA D SP56303EVMUM AD Preliminary D 5 Codec Programming Tutorial ECHO ASM Program Description D 3 1 2 Constant Definitions The next 4 lines of the program construct the constants that define the feature selections which are made during initialization of the codec Example B 92 Constant Definitions WD 12 equ NO PASS FILT SAMP_RATE_48 STEREO DATA_16 CLB 0 URL WD 34 equ IMMED 3STATE XTALl 5 5 644CODEC MASTER WD 56 equ 5000000
100. e programmer may specify an increment decrement step size in lt op4 gt or elect the default step size of 1 by omitting the BY clause FOR TO loop is not executed if op2 is greater than op3 upon entry to the loop Similarly a FOR DOWNTO loop is not executed if lt op2 gt is less than lt op3 gt op1 must be a writable register or memory location It is initialized at the beginning of the loop and updated at each pass through the loop Any immediate operands must be preceded by a pound sign Memory references must be preceded by a memory space qualifier X Y or P L memory references are not allowed Operands must be or refer to single word values The logic generated by the FOR directive makes use of several DSP data registers In fact two data registers are used to hold the step and target values respectively throughout the loop they are never reloaded by the generated code It is recommended that these registers not be used within the body of the loop or that they be saved and restored prior to loop evaluation MOTOROLA DSP56303EVMUM AD Preliminary C 67 Motorola Assembler Notes Structured Control Statements Note The DO keyword is optional Example 84 FOR Statement FOR X CNT 0 targ 2 114 loop on X CNT ENDF C 4 2 4 Statement IF expression THEN stmtlist ELSE stmtlist ENDI If expression is true execute lt stmtlist gt following
101. e 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 DSP56303 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 DSP56303EVM Performance Analysis 2 00 EVM Serial No 1234 Tue Jun 04 17 45 47 1996 DSP56303 Chip Revision No 000303 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 20 24014 64 29 2 70 6 00 1 5 kHz 24422 22 2 55 63 46 6 00 4 375 Hz 20 19 64 29 64 73 6 00 94 22712 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 8200 Y 8200 Expected 000000 000000 Received 000000 FF0000 MEMORY ERRORS FOUND check J9 is in correct position AUDIO FAIL RAIL Figure 1 3 DSP56303EVM Test Sample Output Fail MOTOROLA DSP56303EVMUM AD Preliminary Quick Start Guide Installation Procedure DSP56303EVM Performance Analysis Ver 2 00 EVM Serial No 1234 Tue Jun 0
102. e skipped ENDW execution resumes here after BREAK C 4 2 2 CONTINUE Statement CONTINUE The CONTINUE statement causes the next iteration of a looping construct WHILE REPEAT FOR LOOP to begin This means that the loop expression or operand comparison is performed immediately bypassing any subsequent instructions If a CONTINUE is encountered with no loop statement active a warning is issued Note CONTINUE should be used with care near ENDL directives or near the end of DO loops It generates a jump instruction which is illegal in those contexts C 66 DSP56303bEVMUM AD Preliminary MOTOROLA Motorola Assembler Notes Structured Control Statements Note One or more CONTINUE directives inside a LOOP construct will generate a NOP instruction just before the loop address Example B 83 CONTINUE Statement REPEAT SLE lt 5 gt CONTINUE causes immediate jump to UNTIL ENDI any instructions here are skipped UNTIL x rl EQ 0 evaluation here after CONTINUE C 4 2 3 FOR Statement FOR 1 gt lt 2 gt TO DOWNTO op3 BY lt 4 gt DO stmtlist ENDF Initialize lt op1 gt to lt op2 gt and perform lt stmtlist gt until lt op1 gt is greater TO or less than DOWNTO lt op3 gt Makes use of a user defined operand lt 1 gt to serve as a loop counter FOR TO allows counting upward while FOR DOWNTO allows counting downward Th
103. e this option MOTOROLA DSP56303EVMUM AD Preliminary 4 7 DSP56303EVM Technical Summary Memory 0 BAM BYEN BXEN BAAP BATO 1 0 0 1 1 0 0 0 1 X FFFFF9 External Access AA pin polarity Program space Enable X data space enable Y data space Enable Address Multiplexing Packing Enable Number of Address bits to compare Address to Compare Figure 4 6 Address Attribute Register AARO 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 DSP56303bEVMUM AD Preliminary MOTOROLA DSP56303EVM Technical Summary Memory 4 3 2 Flash PEROM The DSP56303EVM uses an Atmel A
104. ect as declaring every section explicitly GLOBAL This option must be given before any sections are defined explicitly in the source file GS default reset in absolute mode Make all sections global static All section counters and attributes will be associated with the GLOBAL section This option must be given before any sections are defined explicitly in the source file HDR default reset Generate listing header along with titles and subtitles MOTOROLA DSP56303EVMUM AD Preliminary C 45 Motorola Assembler Notes Assembler Directives C 46 IC Ignore case in symbol section and macro names This directive must be issued before any symbols sections or macros are defined IL Inhibit source listing This option will stop the assembler from producing a source listing INTR default reset in absolute mode Perform interrupt location checks Certain DSP instructions may not appear in the interrupt vector locations in program memory This option enables the assembler to check for these instructions when the program counter is within the interrupt vector bounds LB Increment load counter if different from runtime by number of bytes in DSP word to provide byte wide support for overlays in bootstrap mode This option must appear before any code or data generation LDB Use the listing file as the debug source file rather than the assembly language file The L command line option to generate a listing file mus
105. ective address may be any mode and may represent an arbitrary assembler expression lt op3 gt The terminating value of the FOR loop counter The effective address may be any mode and may represent an arbitrary assembler expression lt op4 gt The step increment decrement of the FOR loop counter each time through the loop If not specified it defaults to a value of 1 The effective address may be any mode and may represent an arbitrary assembler expression lt cnt gt The terminating value in a LOOP statement This be any arbitrary assembler expression structured control statements may be followed by normal assembler comments on the same logical line MOTOROLA DSP56303EVMUM AD Preliminary C 65 Motorola Assembler Notes Structured Control Statements 4 2 1 BREAK Statement BREAK The statement causes an immediate exit from the innermost enclosing loop construct WHILE REPEAT FOR LOOP A BREAK statement does not exit an IF THEN ELSE construct If a BREAK is encountered with no loop statement active a warning is issued Note BREAK should be used with care near ENDL directives or near the end of DO loops It generates a jump instruction which is illegal in those contexts Example 82 BREAK Statement WHILE 1 lt GT gt 0 loop until zero is found lt 5 gt BREAK causes exit from WHILE loop any instructions here ar
106. egisters The MEX assembler option see the OPT directive may be used to send the assembler generated code to the listing file for examination of possible register use conflicts C 74 DSP56303bEVMUM AD Preliminary MOTOROLA APPENDIX D CODEC PROGRAMMING TUTORIAL MOTOROLA DSP56303EVMUM AD Preliminary D 1 Codec Programming Tutorial D 1 D 2 D 3 D 2 INTRODUCTION 32 vse veer tex EE ES D 3 PROGRAMMING THE CODEC D 3 ECHO ASM PROGRAM DESCRIPTION DSP56303EVMUM AD Preliminary MOTOROLA Codec Programming Tutorial Introduction D 1 INTRODUCTION OK you ve got a new toy and you can t wait to start developing application But first you ve got the task of reading and understanding all the seemingly endless pages of specifications manuals and related documentation How are you going to get that killer application ready quickly and sold in time to make this month s mortgage Well we can t promise help with your banker but we can save you some time by easing that initial foray into the codec documentation D 2 PROGRAMMING THE CODEC The good news is that the Crystal Semiconductor 54215 codec COder DECoder used on the DSP56303EVM offers a myriad of options that are all user programmable via software The bad news is that you have to learn how to program it A first scan of the CS4215 codec literature might lead you to conclude that the greatest obstacle between you and your goals is in lear
107. embly directives for exceptional condition checking The assembly proceeds normally after the error has been printed An arbitrary number of strings and expressions in any order but separated by commas with no intervening white space can be specified optionally to describe the nature of the generated error Note A label is not allowed with this directive Note See also MSG WARN Example B 46 FAIL Directive FAIL Parameter out of range C 3 26 FORCE Set Operand Forcing Mode FORCE SHORT LONG NONE lt gt The FORCE directive causes assembler to force all immediate memory and address operands to the specified mode as if an explicit forcing operator were used Note that if a relocatable operand value forced short is determined to be too large for the instruction word an error will occur at link time not during assembly Explicit forcing operators override the effect of this directive Note A label is not allowed with this directive Note See also lt gt lt gt Example B 47 FORCE Directive FORCE SHORT force operands short MOTOROLA DSP56303EVMUM AD Preliminary C 31 Motorola Assembler Notes Assembler Directives C 3 27 GLOBAL Global Section Symbol Declaration GLOBAL symbol symbol symbol The GLOBAL directive is used to specify that the list of symbols is defined within the current section and that those definitions should be accessible by all sections
108. eptable response for 375 Hz If the DSP56303EVM passed the analog circuitry test no asterisks will be seen at the end of the rows as in Figure 1 4 DSP56303bEVMUM AD Preliminary MOTOROLA Quick Start Guide Installation Procedure 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 DSP56303EVM passed the test If all the values in the Address Expected and Received fields are zero as in Figure 1 4 the DSP56303EVM passed the external memory test If the DSP56303EVM failed the external memory test these fields will tell which memory location caused the failure the value that was expected to be 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 DSP56303EVM passed or failed the test If the last line says PASS as in Figure 1 4 then the DSP56303EVM 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 DSP56303EVM continues to fail the test email the DSP help line at dsphelp dsp sps mot com Now the test is complete and the DSP56303EVM is ready for operation MOTOROLA DSP56303EVMUM AD Preliminary 1 13 Quick Start Guide Installation Procedure 1 14 DSP56303EVMUM AD Preliminary MOTOROLA SECTION 2 RUNNI
109. er generating an absolute executable file which can be downloaded to the DSP56303 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 lt filenames gt where dsplnk is the name of the Motorola DSP Linker program and lt filenames gt 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 DSP56303EVMUM AD Preliminary MOTOROLA 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 Example dsplnk A myprog cln This example links the file myprog cln and optimally aligns any buffers encountered in the input B lt objfil gt This option specifies that an object file is to be created for Linker output lt objfil gt 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
110. er to Figure 4 1 on page 4 4 for the location of J4 on the DSP56303EVM 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 lt TD TXD RD RESET 502 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 DSP56303EVM 14 pin JTAG connector at J5 allows the user to connect an ADS command converter card directly to the DSP56303EVM 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 DSP56303EVM incorrectly 4 14 DSP56303bEVMUM AD Preliminary MOTOROLA APPENDIX DSP56303EVM SCHEMATICS MOTOROLA DSP56303EVMUM AD Preliminary A 1 DSP56303EVM Schematics A 2 DSP56303EVMUM AD Prelimi
111. es diskette labeled Debug 56K into the drive 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 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 The install program creates a program group called evm5630x and a program icon called evm30xw within Windows This step completes the software installation DSP56303bEVMUM AD Preliminary MOTOROLA Quick Start Guide Installation Procedure 1 3 4 Testing the DSP56303EVM The following sections describe the DSP56303EVM self test and analysis programs The self test allows the user to determine if the DSP56303EVM is properly connected and ready for operation The analysis program allows the user to examine the DSP56303EVM operation in more detail to diagnose problems that may occur 1 3 4 1 DSP56303EVM Self test This section describes how to run the DSP56303EVM self test The self test comes pre loaded into the Flash PEROM of the DSP56303EVM and is therefore very easy to use There are two parts to the self test as follows e The first part of the self test examines the external memory of the DSP56303EVM by writing to and reading from the extern
112. f the ECHO ASM file Set up the listing format as 132 columns and 60 line per page and display the file or print it out on a printer D 3 1 Source Code Description The ECHO ASM file starts with a banner followed by a general description of the program and copyright notice Example B 90 Program Description page 132 60 KKK KKK KKK KKK KKK KK KKK KKK KKK KK KKK KKK KKK KKK KKK KKK KKK KKK KKK K KKK KKKKKKK ECHO ASM Ver 2 0 Example program to move audio through CS4215 This program uses 2k samples of delay to add a noticeable echo to the audio Copyright c MOTOROLA 1995 1996 Semiconductor Products Sector Digital Signal Processing Division OR KK RE AK KAR REAR E OR ko el eee This is followed by the following sections of code Included files Constant definitions e Interrupt buffers e Sample program listing D 4 DSP56303EVMUM AD Preliminary MOTOROLA D 3 1 1 Included Codec Programming Tutorial ECHO ASM Program Description Files The file includes references to four included files Example B 91 Included Files IF STANDALONE 1 nolist include ioequ asm include intequ asm include equ asm include vectors asm list SORE ARN e Ko ARK OR RON NUR KA OCA ORO RRA ROAR RR Kok Ke Koc BR KAA the following of the codec EQUates will define th
113. f them can be null two adjacent commas in which case the corresponding byte location will be filled with Zeros lt label gt if present will be assigned the value of the runtime location counter at the start of the directive processing Integer arguments are stored as is but must be byte values e g within the range 0 255 floating point numbers are not allowed Single and multiple character strings are handled in the following manner Single character strings are stored in word whose lower seven bits represent the ASCII value of the character See Example B 27 Multiple character strings represent words whose bytes are composed of concatenated sequences of the ASCII representation of the characters in the string unless the NOPS option is specified see the OPT directive If the number of characters is not an even multiple of the number of bytes per DSP word then the last word will have the remaining characters left aligned and the rest of the word will be zero filled If the NOPS option is given each character in the string is stored in a word whose lower seven bits represent the ASCII value of the character See Example B 28 Note See also BSC DC Example 30 DCB Directive TABLE DCB two 0 strings 0 CHARS DCB Mp C 3 10 DEFINE Define Substitution String DEFINE symbol string MOTOROLA DSP56303EVMUM AD Preliminary C 19 Motorola Assembler Notes Assembler Directives
114. facture of the part Motorola and are registered trademarks of Motorola Inc Motorola Inc is Equal Opportunity Affirmative Action Employer How to reach us USA Europe Locations Not Asia Pacific Japan Listed Motorola Semiconductors Ltd Nippon Motorola Ltd Motorola Literature Distribution 8B Tai Ping Industrial Park Tatsumi SPD JLDC P O Box 20912 51 Ting Kok Road 6F Seibu Butsuryu Center Phoenix Arizona 85036 Tai Po N T Hong Kong 3 14 2 Tatsumi Koto Ku 1 800 441 2447 or 852 2662928 Tokyo 135 Japan 1 602 303 5454 03 3521 8315 Technical Resource Center Mfax 1 800 521 6274 RMFAX0 email sps mot com Internet TOUCHTONE 602 244 6609 DSP Helpline http www motorola dsp com dsphelp dsp sps mot com 5 SECTION 1 QUICK START GUIDE 1 1 1 1 OVERVIEW nacia haear aat eraa n a a 1 3 1 2 EQUIPMENT micr 1 3 1 2 1 What You Get with the DSP56303EVM 1 3 1 2 2 What You Need to 1 4 1 3 INSTALLATION PROCEDURE 1 4 1 3 1 Preparing the 5 5630 1 5 1 3 2 Connecting the DSP56303EVM to the PC and Power 1 7 1 3 3 Installing the Software 1 8 1 3 4 Testing the 5 56 1 9 1 3 4 1 DSP56303EVM 1 9 1 3 4 2 DSP56303EV
115. gt lt direc gt lt direc gt The RDIRECT directive is used to remove directives from the assembler directive and mnemonic tables If the directive or mnemonic that has been removed is later encountered in the source file it will be assumed to be a macro Macro definitions that have the same name as assembler directives or mnemonics will cause a warning message to be output unless the RDIRECT directive has been used to remove the directive or mnemonic name from the assembler s tables Additionally if a macro is defined through the MACLIB directive which has the same name as an existing directive or opcode it will not automatically replace that directive or opcode as previously described In this case the RDIRECT directive must be used to force the replacement Since the effect of this directive is global it cannot be used in an explicitly defined section see SECTION directive An error will result if the RDIRECT directive is encountered in a section Note A label is not allowed with this directive Example B 69 RDIRECT Directive RDIRECT PAGE MOVE This would cause the assembler to remove the PAGE directive from the directive table and the MOVE mnemonic from the mnemonic table MOTOROLA DSP56303EVMUM AD Preliminary C 55 Motorola Assembler Notes Assembler Directives C 3 49 SCSJMP Set Structured Control Statement Branching Mode SCSJMP SHORT LONG NONE lt gt SCSJMP directiv
116. haracter 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 3 Example of Line Continuation Character THIS COMMENT EXTENDS OVER THREE LINES 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 DSP56303bEVMUM AD Preliminary MOTOROLA Motorola Assembler Notes Assembler Significant Characters Example B 4 Example of Macro Concatenation Suppose the source input file contained the following macro definition SWAP_REG REG1 REG2 swap REG1 REG2 using D4 L as temp OVE R REG1 D4 L OVE R REG2
117. he memory register assigned to this symbol contains the value which caused the exit from the loop A compare instruction is produced by the assembler whenever two operands are tested in a structured statement At runtime these assembler generated instructions set the condition codes of the CCR in the case of a loop the condition codes are set repeatedly Any user written code either within or following a structured statement that references CCR directly move or indirectly conditional jump transfer should be attentive to the effect of these instructions Jumps or branches generated by structured control statements are forced long because the number and address of intervening instructions between a control statement and its termination are not known by the assembler The programmer may circumvent this behavior by use of the SCSJMP directive In all structured control statements except those using only a single condition code expression registers are used to set up the required counters and comparands In some cases these registers are effectively reserved the FOR loop uses two data registers to hold the step and target values respectively and performs no save restore operations on these registers The assembler in fact does no save restore processing in any structured control operation it simply moves the operands into appropriate registers to execute the compare The SCSREG directive may be used to reassign structured control statement r
118. he HIMEM directive establishes an absolute high memory bound for code and data generation memo corresponds to one of the DSP memory spaces X Y L P E rl is one of the letters R for runtime counter or L for load counter The expression is an absolute integer value within the address range of the machine If during assembly the specified location counter exceeds the value given by expression a warning is issued Note A label is not allowed with this directive Note See also LOMEM Example 50 HIMEM Directive HIMEM XR S7FFF YR S7FEF SET X Y RUN HIGH MEM BOUNDS C 3 30 IDENT Object Code Identification Record lt label gt IDENT expressionl expression2 The IDENT directive is used to create an identification record for the object module If label is specified it will be used as the module name If label is not specified then the filename of the source input file is used as the module name lt expression1 gt is the version number expression2 is the revision number The two expressions must each evaluate to an integer result The comment field of the IDENT directive will also be passed on to the object module Note See also COBJ Example B 51 IDENT Directive If the following line was included in the source file FFILTER IDENT 1 2 FIR FILTER MODULE then the object module identification record would include the module name FFILTER the version
119. he conditional assembly directives NOCM Do not preserve comment lines of macros when they are defined NODEX default reset Do not expand DEFINE symbols within quoted strings NODLD default reset Restrict use of certain directives in DO loop NODXL Do not expand DEFINE directive strings in listing NOFC default reset Inhibit folded comments NOFF default reset Use multiple line feeds for page ejects in the listing file NOFM default reset Do not format assembler messages NOGS default reset in relative mode Do not make all sections global static NOHDR Do not generate listing header This also turns off titles and subtitles NOINTR default reset in relative mode not perform interrupt location checks NOMC Do not print macro calls NOMD Do not print macro definitions NOMEX default reset Do not print macro expansions e NOMI default reset Do not scan MACLIB directory paths for include files e NOMSW Do not issue warning on memory space incompatibilities NONL default reset Do not display nesting levels on listing e NONS Do not allow scoping of symbols within nested sections NOPP Do not pretty print listing file Source lines are sent to the listing file as they are encountered in the source with the exception that tabs are expanded to spaces and continuation lines are concatenated into a single physic
120. he runtime location counter at the start of the DUPA directive processing Note See also DUP DUPF ENDM MACRO Example B 36 DUPA Directive If the input source file contained the following statements DUPA VALUE 12 32 34 DC VALUE ENDM then the assembled source listing would show DUPA VALUE 12 32 34 DC 12 DC 32 DC 34 ENDM Note that the lines DUPA VALUE 12 32 34 ENDM will only be shown on the source listing if the MD option is enabled The lines DC 12 DC 32 DC 34 will only be shown on the source listing if the MEX option is enabled Note See the OPT directive in this appendix for more information on the MD and MEX options C 24 DSP56303bEVMUM AD Preliminary MOTOROLA Motorola Assembler Notes Assembler Directives C 3 16 DUPC Duplicate Sequence With Characters lt label gt DUPC lt dummy gt lt string gt ENDM The block of source statements defined by the DUPC and ENDM directives will be repeated for each character of lt string gt For each repetition every occurrence of the dummy parameter within the block is replaced with each succeeding character in the string If the string is null then the block is skipped lt label gt if present will be assigned the value of the runtime location counter at the start of the DUPC directive processing Note See also DUP DUPA DUPF ENDM MACRO Example B 37 DUPC Directive If input source file c
121. ible to or from the external SRAM 4 3 1 2 Example Programming AARO As mentioned above the SRAM activity is controlled by the DSP56303 pin AAO and the corresponding AARO AARO 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 AARO 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 001000 000800 EC 000000 Figure 4 5 Example Memory Map with the Unified External Memory The settings of AARO for this example are shown in Figure 4 6 The external Access Type bits and BATO are set to 0 and 1 respectively to denote SRAM access The Address Attribute Polarity bit BAAP is cleared to define AAO as active low Address multiplexing is not supported in the DSP56303 therefore the address multiplexing bit BAM is cleared Packing is not needed with the SRAM thus the packing enable bit BPAC is cleared to disabl
122. ible to place the filter notch exactly on 60 Hz 8 Tostop 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 DSP56303EVMUM AD Preliminary 2 5 Running the Demonstration File Running the Demonstration 2 6 DSP56303EVMUM AD Preliminary MOTOROLA 3 DSP56303EVMUM AD Preliminary 3 1 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 3 4 Source Statement 3 4 Example Program eux t eR A TERT RSS 3 5 ASSEMBLING THE PROGRAM 3 7 Assembler Command 3 7 Assembler 3 8 Assembler Directives 3 11 Assembling the Example Program 3 16 MOTOROLA DSP LINKER 2 42 ids 3 16 Linker Options uu ex m een dd 3 17 Linker Directives pe 3 23 INTRODUCTION TO THE DEBUGGER SOFTWARE 3 24 RUNNING THE PROGRAM 3 26 DSP56303EVMUM AD Preliminary MOTOROLA Example Test Program Overview 3 1 OVERVIEW This section contains an ex
123. ield 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 e Directive special operation codes known to the Assembler which control the assembly process 3 4 DSP56303bEVMUM AD Preliminary MOTOROLA 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 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
124. ies 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 DSP56303 The Domain Technologies Debugger is included with the DSP56303EVM 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 EVM303W in the EVM56303 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 DSP56303 data The unassembly window is used to display the DSP56303 programs The next instruction to be executed will be highlighted The registers window shows the contents of the DSP56303 internal registers 3 24 DSP56303EVMUM AD Preliminary MOTOROLA Example Test Program Introduction to the Debugger Software EVM 303 COM2 File View Run Symbol Breakpoint Config Window Help Unassemby exampeasm ______ data HEX 59 rn memory sta
125. ine 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 DSP56303bEVMUM AD Preliminary MOTOROLA Example Test Program Motorola DSP Linker 3 4 2 Linker Directives 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 DSP56303EVMUM AD Preliminary 3 23 Example Test Program Introduction to the Debugger Software 3 5 INTRODUCTION TO THE DEBUGGER SOFTWARE This section will give a brief introduction of the Domain Technolog
126. inition LOAD ADDR OVE P ADDR RO END If this macro were called as follows _ 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 2 7 Macro String Delimiter 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 STRING DC STRING ENDM and a macro call CSTR ABCD the resulting macro expansion would be DC ABCD MOTOROLA DSP56303EVMUM AD Preliminary C 7 Motorola Assembler Notes Assembler Significant Characters 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 exp
127. ion of interest To set a breakpoint in the example to check that the values in r0 and r4 are correct before 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 DSP56303 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 or click on the go button The DSP56303 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 DSP56303EVMUM AD Preliminary MOTOROLA 4 DSP56303EVM TECHNICAL SUMMARY MOTOROLA DSP56303EVMUM AD Preliminary 4 1 DSP56303EVM 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 DSP56303EVM DESCRIPTION AND FEATURES 4 3 DSP56303 DESCRIPTION 4 3 eee 4 4 SRAM San An d oe Tancredi enun 4 5 Flash 4 9 RUBIO CODEC Sud erie th nte A DEUS ES 4 10 Codec Analog Input Output 4 11 Codec Digital Interface 4 12 Codec Clock s c edet irr redes ee ye 4 13 COMMAND CONVERTER 4 14 DSP56303EVMUM AD Preliminary MOT
128. ir although BUFFER directives may not be nested and certain types of directives such as MODE ORG SECTION and other buffer allocation directives may not be used The lt expression gt represents the buffer size If less data is allocated than the size of the buffer the remaining buffer locations will be uninitialized If more data is allocated than the specified size of the buffer an error is issued The BUFFER 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 lt expression gt 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 2 where 27 gt expression 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 result of lt expression gt 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 lt lt expression gt lt m where m is the maximum address of the t
129. ive first advances the runtime location counter to a base address that is a multiple of 2 where 27 gt expression 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 lt expression gt 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 lt lt expression gt lt m where m is the maximum address of the target DSP If a Reverse carry buffer is designated and lt expression gt 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 ORG X 100 M_BUF BADDR M 24 CIRCULAR BUFFER MOD 24 C 3 2 BSB Block Storage Bit Reverse lt 1 1 gt BSB lt expression gt lt expression gt The BSB directive causes the assembler to allocate and initialize a block of words for reverse carry buffer The number of words in the block is given by the first expression which must e
130. l be overwritten F lt argfil gt This option indicates that the Linker should read command line input from lt argfil gt gt be any legal operating system filename including an optional pathname lt argfil gt 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 The Linker ordinarily produces an absolute executable file as output When 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
131. loop do 15 times mac 0 0 x r0 x0 y r4 yO multiply and accumulate and load next values endloop jmp this is equivalent to label jmp label and is therefore a never ending empty loop SAAR RARE RE RAINS CR OI KONG KR ERREKA END OF THE SIMPLE PROGRAM ERE AR OR KORR GN Kk Ke ok o OK OK KE RK GE GE SK ON RK A KERR RRRA 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 DSP56303EVM 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 DSP56303 The general format of the command line to invoke the Assembler is asm56300 options lt filenames gt where asm56300 is the name of the Motorola DSP Assembler program and lt filenames gt 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 DSP56303EVMUM AD Preliminary 3 7 Exampl
132. margins PAGE Page eject C 3 45 Purge Macro Definition PMACRO lt symbol gt lt symbol gt lt symbol gt The specified macro definition will be purged from the macro table allowing the macro table space to be reclaimed Note A label is not allowed with this directive Note See also MACRO Example B 66 PMACRO Directive PMACRO 1 2 This statement would cause macros named and to be purged MOTOROLA DSP56303EVMUM AD Preliminary C 53 Motorola Assembler Notes Assembler Directives 346 PRCTL Send Control String to Printer PRCTL lt exp gt I lt string gt lt exp gt I lt string gt PRCTL simply concatenates its arguments and ships them to the listing file the directive line itself is not printed unless there is an error lt exp gt is a byte expression and lt string gt is an assembler string A byte expression would be used to encode non printing control characters such as ESC The string may be of arbitrary length up to the maximum assembler defined limits PRCTL may appear anywhere in the source file and the control string will be output at the corresponding place in the listing file However if a PRCTL directive is the last line in the last input file to be processed the assembler insures that all error summaries symbol tables and cross references have been printed before sending out the control string This is so PRCTL directive can be u
133. mer may circumvent this behavior by use of the SCSJMP directive Any immediate operands must be preceded by a pound sign Memory references must be preceded by a memory space qualifier X Y or P L memory references are not allowed Operands must be or refer to single word values MOTOROLA DSP56303EVMUM AD Preliminary C 71 Motorola Assembler Notes Structured Control Statements Note that values in the lt reg1 gt and lt reg2 gt data registers are not saved before expression evaluation This means that any user data in those registers will be overwritten each time the expression is evaluated at runtime The programmer should take care either to save needed contents of the registers reassign data registers using the SCSREG directive or not use them at all in the body of the particular structured construct being executed C 4 3 4 Compound Expressions A compound expression consists of two or more simple expressions section C 4 3 1 joined by a logical operator AND or OR The boolean value of the compound expression is determined by the boolean values of the simple expressions and the nature of the logical operator Note that the result of mixing logical operators in a compound expression is undefined lt gt B AND LS AND NE R2 this is IF LE B AND lt LC gt OR R5 GI R6 undefined The simple expressions are evaluated left to right Note that this means the resul
134. nary MOTOROLA c qx 19945 3 00 96 02 8 1541 SWL 0 140 0 Odi du sil a SNOILVOllddV 450 VIOYOLON aS YOLOANNOD N M 23002 158 lt 5 ar i 0095 Act 6y avin 01 3 01 7 T 1095 vin avin Beet acy 105 1553 _ gt a 1 emere 1701563 zy 0415 uu dee 15420553 Iv 1014 5701553 ov Ls 2 ooi 55 d FERES 158 ano 8838 88848 59582 go 7 T en 01553 ROSS Neer 4 58 M0123NNOO VSI 2025 to 0553 1025 lo of OF 01553 5 lo ol 0015 t 0598 ie ol xas olss3 4 96 61701553 4 025 zlo ol 0015 o O1 6L
135. never be accessed globally If global accessibility is desired the macros and DEFINE symbols should be defined outside of any section Sections can be nested to any level When the assembler encounters a nested section the current section is stacked and the new section is used When the ENDSEC directive of the nested section is encountered the assembler restores the old section and uses it The ENDSEC directive always applies to the most previous SECTION directive Nesting sections provides a measure of scoping for symbol names in that symbols defined within a given section are visible to other sections nested within it For example if section B is nested inside section A then a symbol defined in section A can be used in section B without XDEFing in section A or XREFing in section B This scoping behavior can be turned off and on with the NONS and NS options respectively see the OPT directive this chapter C 58 DSP56303bEVMUM AD Preliminary MOTOROLA Motorola Assembler Notes Assembler Directives Sections may also be split into separate parts That is lt section name gt can be used multiple times with SECTION and ENDSEC directive pairs If this occurs then these separate but identically named sections can access each others symbols freely without the use of the XREF and XDEF directives If the XDEF and XREF directives are used within one section they apply to all sections with the same section name The reuse of the section name is
136. ng on the icon labelled evm30xw in the evm5630x program group Click on the command window and type force r to reset the DSP56303 and enter the debug mode Type in load 60hzdemo to load the demonstration file into the DSP56303 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 DSP56303bEVMUM AD Preliminary MOTOROLA Running the Demonstration File Running the Demonstration 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 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 poss
137. ning to program the myriad of user programmable features To help you begin there is an example program named ECHO ASM that is included in the software shipped with the DSP56303EVM kit This program is our effort to isolate the user from the details of programming the various 54215 codec options This appendix is provided to lead a new user through ECHO ASM and help to explain how to use the tools developed to let you communicate most expediently with the analog world So let s get started 03 ECHO ASM PROGRAM DESCRIPTION The ECHO ASM program actually creates one of two versions from the same source code file One version is the stand alone program that is examined in this appendix The other a version is loaded into the FLASH EPROM as a part of the code shipped with the self test program A batch file MAKEECHO BAT included with the software allows the user to create the stand alone demonstration A command line entry uses parameters that invoke the DSP56300 assembler program selects the stand alone version of the routine and generates an executable module The command line which can either be typed in or executed from a batch file is asm56300 d STANDALONE 1 a b 1 g echo asm MOTOROLA DSP56303EVMUM AD Preliminary D 3 Codec Programming Tutorial ECHO ASM Program Description The command line entry generates the ECHO ASM file The following sections described the contents and format of this file Begin by viewing the contents o
138. nter If lt exp1 gt is not specified then the last value and mode that the counter had will be used e lt lms gt Which memory space X L P or E will be used as the load memory space If the memory space is L any allocated datum with a value greater than the target word size will be extended to two words otherwise it is truncated If the memory space is E then depending on the memory space qualifier any generated words will be split into bytes one byte per word or a 16 8 bit combination lt llc gt Which load counter L or default if neither or is specified that is associated with the Ims will be used as the load location counter lt lmp gt Indicates the load physical mapping to DSP memory I internal E external R ROM A port A B port B If not present no explicit mapping is done e lt lce gt Non negative absolute integer expression representing the counter number to be used as the load location counter Must be enclosed in parentheses Should not exceed the value 65535 lt exp2 gt Initial value to assign to the load counter used as the llc If lt exp2 gt is a relative expression the assembler uses the relative location counter If lt exp2 gt is an absolute expression the assembler uses the absolute location counter If exp2 is not specified then the last value and mode that the counter had will be used If the last half of the operand field in an ORG dire
139. ntrol These options control the types of assembler messages that are generated e AE Check address expressions e MSW Warn on memory space incompatibilities UR Flag unresolved references e W Display warning messages C 3 42 4 Symbol Options These options deal with the handling of symbols by the assembler DEX Expand DEFINE symbols within quoted strings e IC Ignore case in symbol names e NS Support symbol scoping in nested sections SCL Scope structured control statement labels e SCO Structured control statement labels to listing object file SO Write symbols to object file XLL Write local labels to object file XR Recognize XDEFed symbols without XREF C 3 42 5 Assembler Operation Miscellaneous options having to do with internal assembler operation MOTOROLA DSP56303EVMUM AD Preliminary C 43 Motorola Assembler Notes Assembler Directives CC Enable cycle counts CK Enable checksumming CM Preserve comment lines within macros CONST Make EQU symbols assembly time constants CONTCK Continue checksumming DLD Do not restrict directives in loops GL Make all section symbols global GS Make all sections global static INTR Perform interrupt location checks LB Byte increment load counter LDB Listing file debug MI Scan MACLIB directories for include files PS Pack strings PSM Programmable short addressing mode RP Generate NOP to accommodate pipeline delay RSV Che
140. number 1 the revision number 2 and the comment field FIR FILTER MODULE MOTOROLA DSP56303EVMUM AD Preliminary C 33 Motorola Assembler Notes Assembler Directives C 3 31 IF Conditional Assembly Directive IF lt expression gt ELSE the ELSE directive is optional ENDIF Part of a program that is to be conditionally assembled must be bounded by an IF ENDIF directive pair If the optional ELSE directive is not present then the source statements following the IF directive and up to the next ENDIF directive will be included as part of the source file being assembled only if the lt expression gt has a nonzero result If the lt expression gt has a value of zero the source file will be assembled as if those statements between the IF and the ENDIF directives were never encountered If the ELSE directive is present and lt expression gt has a nonzero result then the statements between the IF and ELSE directives will be assembled and the statements between the ELSE and ENDIF directives will be skipped Alternatively if lt expression gt has a value of zero then the statements between the IF and ELSE directives will be skipped and the statements between the ELSE and ENDIF directives will be assembled The lt expression gt must have an absolute integer result and is considered true if it has a nonzero result The expression is false only if it has a result of 0 Because of the nature of the directive lt expression gt
141. o is one of the single character memory space identifiers X Y L P The letter may be upper or lower case The optional ctr is a letter indicating the High H or Low L location counters If no counter is specified the default counter is used map is also optional and signifies the desired physical mapping for all relocatable code in the given memory space It may be for Internal memory E for External memory R for ROM A for Port A and B for Port B If map is not supplied then no explicit mapping is presumed The origin 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 lt pathname gt 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 lt pathname gt 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
142. olved 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 DSP56303EVMUM AD Preliminary 3 21 Example Test Program Motorola DSP Linker X lt opt gt lt opt gt lt opt gt 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 lt opt gt sequence can be repeated for as many options as desired Option Meaning ABC Perform address bounds checking 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 7 This option allows Linker to strip source file l
143. ontained the following statements DUPC VALUE 123 DC VALUE ENDM then the assembled source listing would show DUPC VALUE 123 DC 1 DC 2 DC 3 ENDM Note that the lines DUPC VALUE 123 ENDM will only be shown on the source listing if the MD option is enabled The lines DC DC 2 DC 3 will only be shown on the source listing if the MEX option is enabled Note See the OPT directive in this appendix for more information on the MD and MEX options MOTOROLA DSP56303EVMUM AD Preliminary C 25 Motorola Assembler Notes Assembler Directives C 3 17 DUPF Duplicate Sequence In Loop lt 1 1 gt dummy lt start gt lt end gt lt increment gt ENM The block of source statements defined by the DUPF and ENDM directives will be repeated in general lt end gt lt start gt 1 times when lt increment gt is 1 lt start gt is the starting value for the loop index lt end gt represents the final value lt increment gt is the increment for the loop index it defaults to 1 if omitted as does the lt start gt value The lt dummy gt parameter holds the loop index value and may be used within the body of instructions lt label gt if present will be assigned the value of the runtime location counter at the start of the DUPF directive processing Note See also DUP DUPA DUPC ENDM MACRO Example B 38 DUPF Directive If input source file
144. ontains macro definitions Each macro definition must be in a separate file and the file must be named the same as the macro with the extension ASM added For example BLOCKMV ASM would be a file that contained the definition of the macro called BLOCKMV If the assembler encounters a directive in the operation field that is not contained in the directive or mnemonic tables the directory specified by lt pathname gt will be searched for a file of the unknown name with the ASM extension added If such a file is found the current source line will be saved and the file will be opened for input as an INCLUDE file When the end of the file is encountered the source line is restored and processing is resumed Because the source line is restored the processed file must have a macro definition of the unknown directive name or else an error will result when the source line is restored and processed However the processed file is not limited to macro definitions and can include any legal source code statements Multiple MACLIB directives may be given in which case the assembler will search each directory in the order in which it is encountered Note A label is not allowed with this directive C 38 DSP56303bEVMUM AD Preliminary MOTOROLA Motorola Assembler Notes Assembler Directives Note See also INCLUDE Example B 58 MACLIB Directive MACLIB macros mymacs IBM PC example MACLIB fftlib UNIX example C 3 38 MACRO
145. 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 DSP56303bEVMUM AD Preliminary MOTOROLA Example Test Program Motorola DSP Linker L lt library gt 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 lt mapfil gt This option indicates that a map file is to be created lt mapfil gt can be any legal operating system filename including an optional pathname If no filename is specifie
146. pace is implied to be P and the load location counter is assumed to be the same as the runtime location counter ORG PHE Sets the runtime memory space to P Selects the H load counter counter 2 associated with P space to use as the runtime location counter The H counter will not be initialized and its last value will be used Code generated hereafter will be mapped to external E memory The load memory space is implied to be P and the load location counter is assumed to be the same as the runtime location counter ORG PI OVL1 Y Indicates code will be generated for an overlay The runtime memory space is P and the default counter is used as the runtime location counter It will be reset to the value of OVL1 If the assembler is in absolute mode via the A command line option then OVL1 must be an absolute expression If OVL1 is an absolute expression the assembler uses the absolute runtime location counter If OVL1 is a relocatable value the assembler uses the relative runtime location counter In this case OVL1 must not itself be an overlay symbol e g defined within an overlay block The load memory space is Y Since neither H L nor any counter expression was specified as the load counter the default load counter counter 0 will be used as the load location counter The counter value and mode will be whatever it was the last time it was referenced MOTOROLA DSP56303EVMUM AD Preliminary C 51 Motorola Assembler Notes A
147. 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 manu
148. 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 lt ctlfil gt 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 lt ctlfil gt can 3 20 DSP56303bEVMUM AD Preliminary MOTOROLA 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 In this example the files filter cln and gauss cln are linked together using the memory file proj ctl U lt symbol gt This option allows the declaration of an unresolved reference from the command line lt symbol gt 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 res
149. quirements 1 4 Component Layout 4 4 component layout 1 6 2 4 connecting to the PC 1 7 contents 1 3 description 4 3 features 4 3 Flash PEROM 4 4 functional block diagram 4 5 installation procedure 1 4 interconnection diagram 1 7 jumper settings 1 6 memory 4 4 power connection 1 7 preparation for installation 1 5 Product Information 1 3 MOTOROLA DSP56303 Preliminary Index 3 software installation 1 8 SRAM 4 4 testing the installation 1 9 User s Manual 1 3 E ECHO ASM file D 3 ESD warning 1 5 ESSIO 4 10 example assembling the 3 16 example program 3 5 Expression address C 44 compound C 72 condition code C 70 formatting C 72 operand comparison C 71 radix C 54 simple C 70 External Access Type Bits BAT 1 0 4 7 External Memory Test 1 9 F field comment 3 5 data transfer 3 5 label 3 4 operand 3 5 operation 3 4 X data transfer 3 4 Y data transfer 3 4 File include C 35 listing C 46 filtering 16 bit coefficients 2 5 24 bit coefficients 2 5 Flash PEROM 4 4 4 9 bootstrap 4 10 connections 4 9 standalone operation 4 9 Flash PEROM Address Pins A 0 15 4 9 Flash PEROM Chip Enable Pin CE 4 9 Flash PEROM Data Pins I O 0 7 4 9 Flash PEROM Output Enable Pin OE 4 9 Flash PEROM Write Enable Pin WE 4 9 Flash asm 4 9 format assembler command 3 7 source statement 3 4 Function C 8 H headphones 1 4 1 9 Host Address Pin HA2 4 14 host PC 4 14 Host PC Data Terminal Ready Pin DTR 4 14 Host
150. rm of addressing by default OVE DO L Y DATAST DATAST EQU Y 23 Because the long absolute addressing mode would cause the instruction to be two words long instead of one word for the short absolute addressing mode it would be desirable to force the short absolute addressing mode as shown below OVE DO L Y lt DATAST DATAST EQU Y 23 C 2 14 gt 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 DSP56303bEVMUM AD Preliminary MOTOROLA Motorola Assembler Notes Assembler Significant Characters 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 gt 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 DATAST EQU Y 23 DO L Y DATAST If this is not desirable then the long absolute addressing mode can be forced as shown below DATAST EQU Y 23 DO L Y gt DATAST C 2 15 Immediate Addressing Mode The pound sign is used to indica
151. rting a F98734 800000 jmp begin p 0 is the reset FEDCBA 487327 957572 369856 247978 8A3407 734546 344787 938482 304F82 123456 657784 list1 r0 567123 675634 list2 r4 D p 2 9 5 177E4D 109012 F36CCD o Command HEX 404020 240100 LOAD example 00000200000000 DISPLAY x 0 FF7112E3000000 DISPLAY y 0 00 000200 000000 the DSP looks for after reset p PBASE start the main pr FF 7112E3 000000 000810 FFFFFF 000001 000000 FFFFFF 000001 000080 FFFFFF B 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 DSP56303 from the program counter The stop button stops the DSP56303 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 DSP56303 is interrupted periodically to update the data and registers windows The reset button resets the DSP56303 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 DSP56303EVMUM A
152. s Assembler Directives Note See also STITLE Example B 77 TITLE Directive TITLE FIR FILTER C 3 57 UNDEF Undefine DEFINE Symbol UNDEF symbol The UNDEF directive causes the substitution string associated with symbol to be released and symbol will no longer represent a valid DEFINE substitution See the DEFINE directive for more information Note A label is not allowed with this directive Note See also DEFINE Example B 78 UNDEF Directive UNDEF DEBUG UNDEFINES THE DEBUG SUBSTITUTION STRING C 3 58 WARN Programmer Generated Warning WARN lt str gt lt exp gt lt str gt lt exp gt lt str gt lt exp gt The WARN directive will cause a warning message to be output by the assembler The total warning count will be incremented as with any other warning The WARN directive is normally used in conjunction with conditional assembly directives for exceptional condition checking The assembly proceeds normally after the warning has been printed An arbitrary number of strings and expressions in any order but separated by commas with no intervening white space can be specified optionally to describe the nature of the generated warning Note A label is not allowed with this directive Note See also FAIL MSG Example B 79 WARN Directive WARN parameter too large C 62 DSP56303bEVMUM AD Preliminary MOTOROLA Motorola Assembler Notes
153. s Structured Control Statements there must be white space blank tab between all operands and their associated operators including boolean operators in compound expressions Moreover there must be white space between the structured control directive and the expression and between the expression and any optional directive modifier THEN DO An assembler expression used as an operand in a structured control statement expression must not have white space in it since it is parsed by the standard assembler evaluation routines 50 4 0 GT 2 no white space in first operand 4 3 7 FOR LOOP Formatting The FOR and LOOP directives represent special cases The FOR structured control statement consists of several fields FOR lt opl gt lt op2 gt TO lt op3 gt BY lt op4 gt DO There must be white space between all operands and other syntactic entities such as TO BY and DO As with expression formatting an assembler expression used as an operand must not have white space in it FOR X CNT 0 Y targ 2 1 CVI POW 2 0 CVF R In the example above the FOR loop operands represented as assembler expressions symbol function do not have embedded white space whereas the loop operands are always separated from structured control statement keywords by white space The count field of a LOOP statement must be separated from the LOOP directive by white space The count itself may be
154. s section describes how to run the DSP56303EVM 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 DSP56303EVM is failing the tests The following steps describe how to run the analysis program for the DSP56303EVM 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 Neom3 0xwNeomtst2 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 DSP56303EVM and the line output jack labelled P5 OUT on the DSP56303EVM 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 DSP56303EVM serial number The serial number can be found at the bottom of the DSP56303EVM board as shown in Figure 1 1 on page 1 6 Type in the serial number from the board and press the return key 1 10 DSP56303bEVMUM AD Preliminary MOTOROLA Quick Start Guide Installation Procedure The test program will output a set of diagnostics to the screen similar to thos
155. s skipped due to failure to satisfy the condition of a conditional assembly directive UR Generate a warning at assembly time for each unresolved external reference This option works only in relocatable mode W default reset Print all warning messages WEX Add warning count to exit status Ordinarily the assembler exits with a count of errors This option causes the count of warnings to be added to the error count e XLL Write underscore local labels to object file This is primarily used to aid debugging This option if used must be specified before the first symbol in the source program is defined XR Causes XDEFed symbols to be recognized within other sections without being XREFed This option if used must be specified before the first symbol in the source program is encountered Example B 63 OPT Directive OPT CEX MEX Turn on DC and macro expansions OPT CRE MU Cross reference memory utilization C 3 43 ORG Initialize Memory Space and Location Counters ORG rms lt rlc gt lt rmp gt lt exp1 gt lt lms gt lt llc gt lt lmp gt lt exp2 gt ORG rms lt rmp gt lt rce gt 1 lt exp1 gt Ims lt 1 gt lt 1 gt lt exp2 gt The ORG directive is used to specify addresses and to indicate memory space and mapping changes It also can designate an implicit counter mode switch in the assembler and serves as a me
156. sed to restore a printer to a previous mode after printing is done Similarly if the PRCTL directive appears as the first line in the first input file the control string will be output before page headings or titles The PRCTL directive only works if the L command line option is given otherwise it is ignored Note A label is not allowed with this directive Example B 67 PRCTL Directive PRCTL 1B E Reset HP LaserJet printer C 3 47 RADIX Change Input Radix for Constants RADIX lt expression gt Changes the input base of constants to the result of lt expression gt The absolute integer expression must evaluate to one of the legal constant bases 2 10 or 16 The default radix is 10 The RADIX directive allows the programmer to specify constants in a preferred radix without a leading radix indicator The radix prefix for base 10 numbers is the grave accent 7 Note that if a constant is used to alter the radix it must be in the appropriate input base at the time the RADIX directive is encountered C 54 DSP56303bEVMUM AD Preliminary MOTOROLA Motorola Assembler Notes Assembler Directives Note A label is not allowed with this directive Example B 68 RADIX Directive _RAD10 DC 10 Evaluates to hex A RADIX 2 RAD2 DC 10 Evaluates to hex 2 RADIX 16 _RAD16 DC 10 Evaluates to hex 10 RADIX 3 Bad radix expression C 3 48 RDIRECT Remove Directive or Mnemonic from Table RDIRECT lt direc
157. 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 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 pathname This option causes the Assembler to look in the directory defined by pathname for any include file not found in the current directory lt pathname gt can be any legal operating system pathname Example asm56300 I project testprog MOTOROLA DSP56303EVMUM AD Preliminary 3 9 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 lt lstfil gt This option specifies that a listing file is to be created for Assembler output lt Istfil gt can be any legal operating system filename including an optional pathname If no lt Istfil gt is specified the Assembler will use the basename filename wi
158. space or a tab BREAK ENDI LOOP CONTINUE ENDL REPEAT ELSE ENDW UNTIL ENDF WHILE In addition the following keywords used in structured control statements C 64 DSP56303bEVMUM AD Preliminary MOTOROLA Note 4 2 Motorola Assembler Notes Structured Control Statements AND DOWNTO TO BY OR DO THEN AND DO and OR are reserved assembler instruction mnemonics Syntax The formats for the BREAK CONTINUE FOR IF LOOP REPEAT and WHILE statements are given in sections C 4 2 1 through C 4 2 7 Syntactic variables used in the formats are defined as follows Note lt expression gt A simple or compound expression section C 4 3 lt stmtlist gt Zero or more assembler directives structured control statements or executable instructions An assembler directive occurring within a structured control statement is examined exactly once at assembly time Thus the presence of a directive within a FOR LOOP REPEAT or WHILE statement does not imply repeated occurrence of an assembler directive nor does the presence of a directive within an IF THEN ELSE structured control statement imply conditional assembly lt op1 gt A user defined operand whose register memory location holds the FOR loop counter The effective address must use a memory alterable addressing mode e g it cannot be an immediate value lt op2 gt The initial value of the FOR loop counter The eff
159. ssembler Directives Example B 64 ORG Directive Continued ORG 8 Sets the runtime memory space to X Selects the L counter counter 1 associated with X space to use as the runtime location counter The L counter will not be initialized and its last value will be used The load memory space is set to E and the qualifier 8 indicates a bytewise RAM configuration Instructions and data will be generated eight bits per output word with byte oriented load addresses The default load counter will be used and there is no explicit load origin ORG 5 58000 Indicates code will be generated for an absolute overlay The runtime memory space is P and the counter used as the runtime location counter is counter 5 It will not be initialized and the last previous value of counter 5 will be used The load memory space is Y Since neither H L nor any counter expression was specified as the load counter the default load counter counter 0 will be used as the load location counter The default load counter will be initialized to 8000 C 3 44 PAGE Top of Page Size Page PAGE lt exp1 gt lt exp2 gt lt exp5 gt The PAGE directive has two forms 1 Ifno arguments are supplied then the assembler will advance the listing to the top of the next page In this case the PAGE directive will not be output 2 The PAGE directive with arguments can be used to specify the printed format of the output listing Arguments may b
160. ssembler generated label SUB D7 DO user code UNTIL LT 2 100034 code generated by assembler C 4 3 3 Operand Comparison Expressions Two operands may be compared in a simple expression with subsequent transfer of control based on that comparison Such a comparison takes the form lt opl gt cc lt op2 gt where lt cc gt is a condition mnemonic enclosed in angle brackets as described in section C 4 3 2 and lt op1 gt and lt op2 gt are register or memory references symbols or assembler expressions When processed by the assembler the operands are arranged such that a compare jump sequence of the following form always results CMP lt regl gt lt reg2 gt 018 lt label gt where the jump conditional is the inverse of lt cc gt Ordinarily lt op1 gt is moved to the lt reg1 gt data register and lt 2 gt is moved to lt reg2 gt data register prior to the compare This is not always the case however if lt op1 gt happens to be lt reg2 gt and lt op2 gt is lt reg1 gt an intermediate register is used as a scratch register In any event worst case code generation for a given operand comparison expression is generally two moves a compare and a conditional jump Jumps or branches generated by structured control statements are forced long because the number and address of intervening instructions between a control statement and its termination are not known by the assembler The program
161. struction 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 DSP56303 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 uww motorola dsp com MOTOROLA DSP56303EVMUM AD Preliminary 4 3 DSP56303EVM Technical Summary Memory 43 MEMORY The DSP56303EVM uses the following memory e 32K x 24 bit Fast Static RAM SRAM for expansion memory 64K x 8 bit Flash Programmable Erasable Read Only Memory for stand alone operation Refer to Figure 4 1 for the location of the SRAM and PEROM on the DSP56303EVM Figure 4 2 shows a functional block diagram of the DSP56303EVM including the memory devices J9 Jg ISA CONNECTOR MC145407 J3 JTAG ERES LED SCI 9 SW1 DSP56303 DSP56002 AT29LV512 n MC34164 P1 J2 SW2 POWER iu J7 ESSIO nies LED SW3 qe COMMAND CONVERTER SELECT P MC74HCT241 HDPHNE LT1085 MC74HCT04 54215 K Power LT1085 LED MC33078 Figure 4 1 DSP56303EVM Component Layout
162. symbol gt sequence when used in macro definitions will be replaced by an ASCII string representing the hexadecimal value of lt symbol gt This operator may be used in association with the backslash operator The value of lt symbol gt 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 STMT LAB SVAL STMT ENDM If this macro were called as follows NUM SET 10 GEN_LAB HEX NUM The resulting expansion as it would appear in the listing file would be HEXA NOP C 2 6 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 DSP56303bEVMUM AD Preliminary MOTOROLA Motorola Assembler Notes Assembler Significant Characters 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 def
163. t be specified for this option to take effect LOC Include local labels in the symbol table and cross reference listing Local labels are not normally included in these listings If neither the S or CRE options are specified then this option has no effect The LOC option must be specified before the first symbol is encountered in the source file MC default reset Print macro calls MD default reset Print macro definitions MEX Print macro expansions MI Scan directory paths for include files The assembler ordinarily looks for included files only in the directory specified in the INCLUDE directory or in the paths given by the I command line option If the MI option is used the assembler will also look for included files in any designated MACLIB directories MSW default reset Issue warning on memory space incompatibilities MU Include a memory utilization report in the source listing This option must appear before any code or data generation NL Display conditional assembly IF ELSE ENDIF and section nesting levels on listing NOAE Do not check address expressions NOCC default reset Disable cycle counts Does not clear total cycle count NOCEX default reset Do not print DC expansions DSP56303bEVMUM AD Preliminary MOTOROLA Motorola Assembler Notes Assembler Directives NOCK default reset Disable checksumming of instruction and data values NOCL Do not print t
164. t of one simple expression could have an impact on the result of subsequent simple expressions because of the condition code settings stemming from the assembler generated compare If the compound expression is an AND expression and one of the simple expressions is found to be false any further simple expressions are not evaluated Likewise if the compound expression is an OR expression and one of the simple expressions is found to be true any further simple expressions are not evaluated In these cases the compound expression is either false or true respectively and the condition codes reflect the result of the last simple expression evaluated C 4 3 5 Statement Formatting The format of structured control statements differs somewhat from normal assembler usage Whereas a standard assembler line is split into fields separated by blanks or tabs with no white space inside the fields structured control statement formats vary depending on the statement being analyzed In general all structured control directives are placed in the opcode field with an optional label in the label field and white space separates all distinct fields in the statement Any structured control statement may be followed by a comment on the same logical line C 4 3 6 Expression Formatting Given an expression of the form lt 1 gt LI lt op2 gt OR lt op3 gt GE lt 4 gt 72 DSP56303bEVMUM AD Preliminary MOTOROLA Motorola Assembler Note
165. t 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 DSP56303EVM 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 DSP56303EVM 4 Connect a pair of headphones to the stereo headphone jack labelled P4 HDPHNE on the DSP56303EVM Refer to Figure 2 1 for the locations of the line input and headphone jacks Start the audio source and put on the headphones MOTOROLA DSP56303EVMUM AD Preliminary 2 3 Running the Demonstration File Running the Demonstration MC145407 J3 9 CONNECTOR mi LED OnCE m 5 Q ESSI SCI 8 swt DSP56303 Reset LL SRAM DSP56002 29 512 i MC34164 1 is Converter PEROM TROA J2 rame SW2 POWER J7 ESSIO P5 P Debug 5 OUT LED SW3 COMMAND CONVERTER SELECT Rap P4 HDPHNE LT1085 MC74HCT241 CS4215 P3 MC74HCT04 Cm N Power LT1085 LED MC33078 2 3 Figure 2 1 DSP56303EVM Component Layout RUNNING THE DEMONSTRATION To run the demonstration 1 2 Start Windows Invoke the Debugger by double clicki
166. te to the assembler to use the immediate addressing mode Example B 17 Example of Immediate Addressing Mode CNST EQU 5 OVE CNST D0 L C 2 16 lt 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 DSP56303EVMUM AD Preliminary 11 Motorola Assembler Notes Assembler Significant Characters form of addressing can be forced using the immediate short addressing mode force operator lt 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 OVE CNST DO L CNST EQU 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 OVE lt CNST DO L
167. tervening white space can be specified optionally to describe the nature of the message C 40 DSP56303EVMUM AD Preliminary MOTOROLA Motorola Assembler Notes Assembler Directives Note A label is not allowed with this directive Note See also FAIL WARN Example B 61 MSG Directive MSG Generating sine tables C 3 41 NOLIST Stop Assembly Listing NOLIST Do not print the listing from this point on including the NOLIST directive Subsequent source lines will not be printed The NOLIST directive actually decrements a counter that is checked for a positive value and is symmetrical with respect to the LIST directive Note the following sequence Counter value currently 1 LIST Counter value 2 LIST Counter value 3 NOLIST Counter value 2 NOLIST Counter value 1 The listing still would not be disabled until another NOLIST directive was issued Note A label is not allowed with this directive Note See also LIST OPT Example 62 NOLIST Directive DE LISTOFF NOLIST Turn the listing off ENDIF MOTOROLA DSP56303EVMUM AD Preliminary C 41 Motorola Assembler Notes Assembler Directives C 3 42 OPT Assembler Options OPT lt option gt lt option gt lt option gt lt comment gt The OPT directive is used to designate the assembler options Assembler options are given in the operand field of the source input file and are separated by commas Options also may be specified
168. the character Example B 27 Single Character String Definition 5000052 Multiple character strings represent words whose bytes composed of concatenated sequences of the ASCII representation of the characters in the string unless the NOPS option is specified see the OPT directive If the number of characters is not an even multiple of the number of bytes per DSP word then the last word will have the remaining characters left aligned and the rest of the word will be zero filled If the NOPS option is given each character in the string is stored in a word whose lower seven bits represent the ASCII value of the character Example B 28 Multiple Character String Definition ABCD 414243 440000 Note See also BSC DCB Example B 29 DC Directive TABLE CHARS 1426 253 2662 ABCD UNT B 88 18 DSP56303bEVMUM AD Preliminary MOTOROLA Motorola Assembler Notes Assembler Directives C 3 9 DCB Define Constant Byte lt 1 1 gt lt arg gt lt arg gt lt arg gt The DCB directive allocates and initializes a byte of memory for each lt arg gt argument lt arg gt may be a byte integer constant a single or multiple character string constant a symbol or a byte expression The DCB directive may have one or more arguments separated by commas Multiple arguments are stored in successive byte locations If multiple arguments are present one or more o
169. thout extension of the first filename encountered in the source input file list and append Ist 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 Ist M lt pathname gt This option causes the Assembler to look in the directory defined by lt pathname gt for any macro file not found in the current directory lt pathname gt 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 DSP56303EVMUM AD Preliminary MOTOROLA Ex
170. tive COMMENT This is a one line comment COMMENT This is a multiple line comment Any number of lines can be placed between the two delimiters C 3 8 DC Define Constant lt label gt DC lt arg gt lt arg gt lt arg gt MOTOROLA DSP56303EVMUM AD Preliminary C 17 Motorola Assembler Notes Assembler Directives The DC directive allocates and initializes a word of memory for each lt arg gt argument lt arg gt may be a numeric constant a single or multiple character string constant a symbol or an expression The DC directive may have one or more arguments separated by commas Multiple arguments are stored in successive address locations If multiple arguments are present one or more of them can be null two adjacent commas in which case the corresponding address location will be filled with zeros If the DC directive is used in L memory the arguments will be evaluated and stored as long word quantities Otherwise an error will occur if the evaluated argument value is too large to represent in a single DSP word lt label gt if present will be assigned the value of the runtime location counter at the start of the directive processing Integer arguments are stored as is floating point numbers are converted to binary values Single and multiple character strings are handled in the following manner Single character strings are stored in word whose lower seven bits represent the ASCII value of
171. tive END BEGIN BEGIN is the starting execution address C 3 19 ENDBUF End Buffer ENDBUF The ENDBUF directive is used to signify the end of a buffer block The runtime location counter will remain just beyond the end of the buffer when the ENDBUF directive is encountered Note A label is not allowed with this directive MOTOROLA DSP56303EVMUM AD Preliminary C 27 Motorola Assembler Notes Assembler Directives Note See also BUFFER Example B 40 ENDBUF Directive ORG 5100 BUF BUFFER R 64 uninitialized reverse carry buffer ENDBUF C 3 20 ENDIF End of Conditional Assembly ENDIF The ENDIF directive is used to signify the end of the current level of conditional assembly Conditional assembly directives can be nested to any level but the ENDIF directive always refers to the most previous IF directive Note A label is not allowed with this directive Note See also IF Example B 41 ENDIF Directive IF REL SAVEPC SET Save current program counter ENDIF 3 21 ENDM of Macro Definition ENDM Every MACRO DUP DUPA and DUPC directive must be terminated by an ENDM directive Note A label is not allowed with this directive C 28 DSP56303EVMUM AD Preliminary MOTOROLA Motorola Assembler Notes Assembler Directives Note See also DUP DUPA DUPC MACRO Example B 42 ENDM Directive SWAP SYM MACRO REG1 REG swap R
172. uld pick the long absolute form of addressing by default BIST 4 Y IOPORT IOPORT EQU Y FFF3 MOTOROLA DSP56303EVMUM AD Preliminary C 9 Motorola Assembler Notes Assembler Significant Characters 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 BTST 4 Y lt lt IOPORT EQU Y SFFF3 213 lt Short Addressing Mode Force Operator Many DSP instructions allow a short form of addressing If the value of an absolute address is known to the assembler on pass one or the FORCE SHORT directive is active 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 short absolute form of addressing can be forced by preceding the absolute address by the short addressing mode force operator lt Example B 15 Example of a Short Addressing Mode Force Operator Since the symbol DATAST is a forward reference in the following sequence of source lines the assembler would pick the long absolute fo
173. using the command line O option All options have a default condition Some options are reset to their default condition at the end of pass one Some are allowed to have the prefix NO attached to them which then reverses their meaning Note A label is not allowed with this directive Options can be grouped by function into five different types Listing format control Reporting options Message control Symbol options Qr ie det de Assembler operation C 3 42 1 Listing Format Control These options control the format of the listing file FC Fold trailing comments e FF Form feeds for page ejects e FM Format messages PP Pretty print listing RC Relative comment spacing C 3 42 2 Reporting Options These options control what is reported in the listing file e CEX Print DC expansions CL Print conditional assembly directives e CRE Print symbol cross reference e DXL Expand DEFINE directive strings in listing C 42 DSP56303bEVMUM AD Preliminary MOTOROLA Motorola Assembler Notes Assembler Directives HDR Generate listing headers e IL Inhibit source listing e LOC Print local labels in cross reference e MC Print macro calls e MD Print macro definitions MEX Print macro expansions MU Print memory utilization report e NL Print conditional assembly and section nesting levels S Print symbol table e U Print skipped conditional assembly lines 3 42 3 Message Co
174. valuate to an absolute integer Each word is assigned the initial value of the second expression If there is no second expression an initial value MOTOROLA DSP56303EVMUM AD Preliminary C 13 Motorola Assembler Notes Assembler Directives of zero is assumed 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 2 where 25 is greater than or equal to the value of the first expression An error will occur if the first expression contains symbols that are not yet defined forward references or if the expression has a value of less than or equal to zero Also if the first expression is not a power of two a warning will be generated Both expressions can have any memory space attribute label if present will be assigned the value of the runtime location counter after a valid base address has been established Only one word of object code will be shown on the listing regardless of how large the first expression is However the runtime location counter will be advanced by the number of words generated Note See also BSC BSM DC Example B 21 Buffer Directive BUFFER BSB BUFSIZ INITIALIZE BUFFER TO ZEROS C 3 3 BSC Block Storage of Constant lt 1 1 gt BSC lt expression gt lt expression gt The BSC directive causes the assembler to allocate and initialize a block of words The number of words in th
175. xample B 74 STITLE Directive STITLE COLLECT SAMPLES C 60 DSP56303bEVMUM AD Preliminary MOTOROLA Motorola Assembler Notes Assembler Directives C 3 54 SYMOBJ Write Symbol Information to Object File 5 lt symbol gt lt symbol gt lt symbol gt The SYMOBJ directive causes information for each lt symbol gt to be written to the object file This directive is recognized but currently performs no operation in COFF assemblers Note A label is not allowed with this directive Example 75 SYMOBJ SYMOBJ XSTART HIRTN ERRPROC C 3 55 TABS Set Listing Tab Stops TABS lt tabstops gt The TABS directive allows resetting the listing file tab stops from the default value of 8 Note A label is not allowed with this directive Note See also LSTCOL Example B 76 TABS Directive TABS 4 Set listing file tab stops to 4 C 3 56 TITLE Initialize Program Title TITLE lt string gt The TITLE directive initializes the program title to the string in the operand field The program title will be printed on the top of all succeeding pages until another TITLE directive is encountered The title is initially blank The TITLE directive will not be printed in the source listing A TITLE directive with no string argument will cause the current title to be blank Note A label is not allowed with this directive MOTOROLA DSP56303EVMUM AD Preliminary C 61 Motorola Assembler Note
176. xpression gt can have any memory space attribute The block of memory reserved is not initialized to any given value The result of lt expression gt must be an absolute integer greater than zero and cannot contain any forward references symbols that have not yet been defined Since the DSR directive is useful mainly for generating FFT buffers if lt expression gt is not a power of two a warning will be generated lt label gt if present will be assigned the value of the runtime location counter after a valid base address has been established Note See also DS DSM Example B 34 DSR Directive ORG X 100 R_BUF DSR 8 REVERSE CARRY BUFFER FOR 16 POINT FET C 3 14 DUP Duplicate Sequence of Source Lines lt 1 1 gt DUP lt expression gt ENM The sequence of source lines between the DUP and ENDM directives will be duplicated by the number specified by the integer lt expression gt lt expression gt can have any memory space attribute If the expression evaluates to a number less than or equal to 0 the sequence of lines will not be included in the assembler output The expression result must be an absolute integer and cannot contain any forward references symbols that have not already been defined The DUP directive may be nested to any level lt label gt if present will be assigned the value of the runtime location counter at the start of the DUP directive processing 22 DSP56303bEVMUM

Download Pdf Manuals

image

Related Search

Related Contents

Gebruiks- aanwijzing Koelkast User manual Refrigerator Notice d  User guide for the Survey of Household Spending  Samsung YP-S1QL Керівництво користувача  Types 95L, 95BL, et 95LD - Welcome to Emerson Process  RUTINAS EN LISP - Universidad Politécnica de Valencia  Benutzerhandbuch Acer Liquid Gallant E350  User Manual - Magnum Dimensions  Vivanco TV/radio indoor aerial, active, 36 dB max  VGN-FE890 CTO Series  Eigenschaften  

Copyright © All rights reserved.
Failed to retrieve file