Home

DSP56303EVM User`s Manual

image

Contents

1. C 59 C 4 3 3 Operand Comparison Expressions C 60 C 4 3 4 Compound Expressions unid Ie ee aE C 61 C 4 3 5 Statement ECHTEN 50 02 5555 ti id C 61 C 4 3 6 Expression BOEH APUDE s re ace oe ce Va ex Sene dog C 61 C 4 3 7 FOR LOOP Formatting oie ee ev Ur AIR HC p ESTER C 62 C 4 4 Assembly Listing Fonasa CE Eie Qe Res C 62 C 4 5 Effects on the Programmer s Environment C 62 Appendix D Codec Programming Tutorial Ex o eos Me Bh aad cue MP St E RU pA D 1 p Codec Backsro nd i os to eee eoe maleta ce edes obo ed eate D 2 D 2 1 Codec DEVICE vates e PD ERR RE MURUS TRES as gd D 2 D 2 2 Codec Modesto dalt eid led Mat sse M iod ie Maal eed D 2 Io ESSI Ports BacketOUDd 5 exer re OBRAS EH RP OA SNR CO EUR D 3 DA ESSIGPIO DIIS arras D 4 Di ESSEPOr Resisters es ose Ee Et yet Cp a esce he D 4 D 5 1 ESSUGPIO Shared RE SISI s xe exw id ox ver TRE X RU e SS D 4 13 52 ESSLReEISIIS us essem me obs V Eo WR RUSO TRIS RUD AUR Due D 5 D 5 3 GPIOBCbPISIetS Lei S4 ed be eda n oS te Mant ios Mat ie odas f D 5 D 5 4 GPIO Mode Port C and Port D aces REOR ho D 6 D 6 Digital Interface ESSI Codec CNR beo td D 6 D 7 Programming the CS4218 Codec os sk ow nh its Eet OX n non S D 8 D 8 Phase 1 Setting up CONSISTE e etes D 9 D 8 1 Setting Up Buffer Space and Pointers D 9 Motorola Table of Contents Xi D 8 2 Defining Control Parameters
2. Designator Manufacturer Part Number Description C10 Panasonic PCS1475CT 4 7 uF Capacitor 6 3 V de C2 C3 C4 C23 C24 C39 Murata GRM42 6Y5V334Z025BL 0 33 uF Capacitor C21 C22 C25 Murata GRM42 6Y5V474Z025BL 0 47 uF Capacitor C38 Murata GRM42 6Y5V6847025BL 0 68 uF Capacitor C19 C20 Xicon 140 CC501N331J 330 pF Capacitor C26 C27 Murata GRM40 COG222J050BL 2200 pF Capacitor C63 Murata GRM40 X7R821K050BL 820 pF Capacitor C5 C6 C7 C8 AVX TPSV476 025R0300 47 uF Capacitor 10 V dc C32 C33 Panasonic PCE3028CT 470 uF Capacitor 6 3 V de C1 Xicon XAL16V1000 1000 uF Capacitor 16 V dc L1 L2 L3 L4 L5 Murata BLO1RN1 A62 Ferrite Bead L6 Murata LQH4N150K04M00 Inductor R1 R37 NIC NRC12RF1001TR 1 KQ Resistor R3 Xicor 260 5K 5 KQ Resistor R4 R6 R7 R8 R9 R11 R12 NIC NRC12RF1002TR 10 KQ Resistor R13 R14 R15 R18 R19 R20 R21 R22 R31 R32 R33 R34 R35 R36 R38 R39 R25 R26 R27 R28 Xicor 260 20K 20 KQ Resistor R23 R24 NIC NRC12RF3922TR 39 2 KQ Resistor R16 R17 R29 R30 Xicor 260 5 6K 5 6 KQ Resistor R10 NIC NRC12RF6040TR 604 Q Resistor R79 R80 Panasonic ERJ 6GEYJ240 240 Resistor R81 NIC 260 4 7K 4 7 KQ Resistor Motorola DSP56303EVM Parts List B 3 Parts Listing B 4 DSP56303EVM User s Manual Motorola Appendix C Motorola Assembler Notes C 1 Introduction This appendix supplements information in Chapter 3 of this document and provides a detailed description of the following components use
3. C 27 C 3 30 IDENT Object Code Identification Record C 27 C 3 31 IF Conditional Assembly Directive C 28 C 3 32 INCLUDE Include Secondary File C 29 C333 LISE Listo Ass mb o C 29 C 3 34 LOCAL Local Section Symbol Declaration C 30 C 3 35 LOMEM Set Low Memory Bounds C 30 C336 LSTCOL Set Listing Field Widllis ardid C 31 3 97 MACLIB Macro Libtary os aL SA A E C 31 C 3 38 MACRO Macro Definition ss os de da td C 32 C 3 39 MODE Change Relocation Modes its C 33 C 3 40 MSG Programmer Generated Message C 33 C 3 41 NOLIST Stop Assembly Listing C 34 C342 OPT Assembler Opens ss drets AN C Eia eV ta C 34 C 3 42 1 Listing Format Controle et C 35 C 3 42 2 Reporting Options s uei ie ou ns on iro obest atta v beet C 35 C 3 42 3 Message Control es vis eb C 35 C 3 42 4 Symbol ODUORS is ee eb ent e ie C 36 C 3 42 5 Assembler Operation 5C o a racio d RE Se te ee p E RE C 36 C 343 ORG Initialize Memory Space and Location Counters C 42 2344 PAGE Top of Page Size Page cus Livy CER OR CES C 45 C 3 45 PMACRO Purge Macro Definition C 45 C 3 46 PRCTL Send Control String to Printer C 46 C 3 47 RADIX Change Input Radix for Constants C 46 C 3 48
4. sni EY isu L 9 S y e z 1 a EN 99 99 aNd and QNS QNO or qaed yOdd y 1epun dese TA 99 QNS an QNO SerA O M ueqd punozf ayy uo paznoz eq snu IdL T ETS 99 99 QNO QN9 QNO QNO aNd QNS 99 QNS QN9 aNd TH 99 QN9 QNO an D I QNS an 99 99 QNS QNO QNO an 12109 TW 99 99 QNO QNO aNd QN9 QNO QN9 QN9 QNS 99 99 QNS QN9 aNd QNS 99 an QNO QN9 99 99 99 QNO QNO QNO aNd QNO QNO QN9 aNd aNd TIN 99 QN9 QNS QNS T zm AEE QNS QNS QN9 QNS isn Logg E 1SOH 8l gt gt MUH n AE ET si D nn el VH L VH 6 1H L SH tH CH 1 0H er AES E anz po E 0p9lvEOW 019 ano mu Eg y NI o T MIS IH Y 13838 WAX3 ren GHEET IMS AS HOLIMS 13534 dvd wei 3100 A3109 9n eu LINId 919 120019 55 019 m AOVH rm E WMOVH SC oan A E AA en deni deer die ea iv de coger au Li SoH Cr OH XO 9SdSQ VSI NI dVHISIOOH 80IH 0 0 Tt 0 MUH or KEN 1 ove dn HENIL 19S HINOYHI dVHISIOOH 0 I 0 0 LYH TW LYH am R ZYH Ham ZYH D oH oH can AWOWSW SGIM SIAH WOH3 dVHISIOOH T 0 0 0 a Ha LH 1 bd Hi 3 ZH Y a 9 a HI H d d oy
5. D 16 D 13 Data Direction Register C ue tb Ee e ER bte e eat s D 18 D 14 Data Direction Register 9 oko ov eben bes XS Ce Rete eR RUP d D 18 D 15 Codes PINS ooa ede bead db dolebat eg diia D 20 xiv DSP56303EVM User s Manual Motorola List of Figures 1 1 DSP56303EVM Component Layout 1 4 1 2 Connecting the DSP56303EVM Cables 1 5 2 1 Development Process Flow 13 IA E E Es 2 2 2 2 Example Debugger Window Display 2 18 3 1 DSP56303EVM Component Layout 3 2 3 2 DSP56303EVM Functional Block Diagram 3 3 3 3 FSRAM Connections to the DSP56303 3 3 3 4 Example Memory Map with the Unified External Memory 3 5 3 5 Address Attribute Register AARO 3 5 3 6 Flash et TEE 3 6 3 7 Codec Analog Input Output Diagram 3 8 3 8 Codec Digital Interface Connections 3 9 3 9 RS 232 Serial Mac EE 3 11 A 1 DA esi oid Spip aub adt MAN iens A 2 A 2 External Memory a aeo eid So qe abt e d Vi A 3 A 3 RS232 IntetI366 a asc e te o o bsc RECS Re IR t a yn A 4 A 4 Command Conve e A 5 A 5 Pena rcm A 6 A 6 EE SUL s ee ee RIVE SC REA ERI anb eA eC pee aem A 7 A 7 Bypass Capacitors E AAA AS A 8 D 1 Data Format ot Codec oia cone PE S BR ou SE WU ES D 3 D 2 ESSUCOdES Pin SUPL e E EE DC eO D 8 D 3 Block Diagram of
6. PBASE EQU 100 instruct the assembler to replace every occurrence of PBASE with 100 XBASE EQU 0 Used to define the position of the data in X memory YBASE EQU 0 Used to define the position of the data in Y memory Ck Kok Ck CC Ck CC CCS CIC S e A A AAA A X MEMORY D PERITO TRATE KA UN ROK URN OR NON UK OR SUR TOTES RON GNO RG TSG ORGIES ORNA ODOM ANON IAE org X XBASE instructs the assembler that we are referring to X memory starting at location XBASE listl de 475638 738301 92673a 898978 091271 f 25067 de 987153 3A8761 987237 34b852 734623 233763 de Sf 76756 423423 5 324732 140029 SUP IRE E AR ER KREK ERRER EEEE RR KEKEE ARRE AERA RAR RRA CORR Y MEMORY EERE RAE ELAR AAALAC RRR e KEKE BR EE EER ERER RAL ALR EE org y YBASE instructs the assembler that we are referring to Y memory starting at location YBASE list2 dc 98734 800000 fedcba 487327 957572 369856 dc 247978 8a3407 734546 5344787 938482 304 82 de 123456 657784 567123 5675634 LUNOCNOR CUN RON ITS IRE STDS ITS BIDS NON DST SD IGN REBT E A Ry ARE NORIS USC GR TR DS NUR PROGRAM eKKKKKKKK KK KK KK KKK KKK KK KK KKK KKK KKK KKK KKK KK KK AA AA AAA KA AAA AA AR org p 0 put following program in program memory starting at location 0 2 4 DSP56303EVM User s Manual Motorola Assembling the Program Example 2 1 Simple DSP56303EVM Code Example Continued jmp begin p
7. CSTR MACRO STRING DC STRING ENDM and a macro call CSTR ABCD the resulting macro expansion would be DC ABCD C 2 7 2 Quoted String DEFINE Expansion A sequence of characters which matches a symbol created with a DEFINE directive is not 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 are expanded within the string In all other respects usage of double quotes is equivalent to that of single quotes Motorola Motorola Assembler Notes C 5 Assembler Significant Characters Example C 9 Example of a Quoted String DEFINE Expression Consider the source fragment below DEFINE LONG short STR MAC MACRO STRING MSG This is a LONG STRING MSG This is a LONG STRING ENDM If this macro were invoked as follows STR MAC sentence then the resulting expansion would be as follows 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 O symbol Example C 10 Example of a Function Delimiter Character SVAL EQ SOT 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 C 11 Example of a Lo
8. D 15 D 5 Defining GPIO Pin Bin Correspondence D 17 D 6 GPIO Pin COn Uurallohk cse sos sa MR I EUR UE EM D 17 D 7 Code Form Settings in Data Direction Registers D 19 D 8 Code Format Procedures osa A Reie ea as D 19 D 9 Deasserunp Code Reset or we wee RTI Re ue onte dice ato a D 19 D 10 Sending Code Information toc d CA CRESCE AUR D 21 D 11 sending in Control Words amp 5 e tex me ya iae we od eg D 22 D 12 ESSI Port Priority and Functionality Setting D 24 D 13 ESSI Exception Status Interrupt Service D 25 D 14 ESSI Receive Data Interrupt Service 22 2 s e m D 26 D 15 ESSI Receive Last Slot Interrupt Service D 27 D 16 ESSI Transmit Data with Exception Status Interrupt Service D 28 D 17 ESSI Transmit Last Slot Interrupt Service D 29 D 18 ESSI Transmit Data Interrupt Service D 30 D 19 Include Define and Set Up Tasks 45 ito da D 32 D 20 DSP Initialization Procedure Sep a Re WR e D 33 D 21 Initializing CODEC BSS Loved ico adito e DIC CU PR D 33 D 22 Setting Up and Initializing Buffer D 33 D 23 Implementation of Echo Program D 34 D 24 Application of Echo Code sidra RE ee ES D 35 XX DSP56303EVM User s Manual Motorola Chapter 1 Quick Start Guide This section summarizes the evaluation module contents and additional requirements and also provi
9. D p A0 A15 100 1023 CET mm AA1929 Figure 3 3 FSRAM Connections to the DSP56303 Motorola DSP56303EVM Technical Summary 3 3 Memory The data input output pins IO0 IO23 for the FSRAM are connected to the DSP56303 D0 D23 pins The FSRAM write WE and output enable OE lines are connected to the DSP56303 write WR and read RD lines respectively The FSRAM chip enable CE1 is generated by the DSP56303 address attribute 0 AAO The FSRAM activity is controlled by AAO and the corresponding address attribute register 0 AARO The FSRAM address input pins A0 A 15 are connected to the respective port A address pins of the DSP This configuration selects a unified memory map of 64K words The unified memory does not contain partitioned X data Y data and program memory Thus access to P 1000 X 1000 and Y 1000 istreated as access to the same memory cell and 48 bit long memory data moves are not possible to or from the external FSRAM 3 3 1 2 Example Programming AARO As mentioned above the FSRAM 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 FSRAM Figure 3 4 shows the memory map that is attained with the AARO settings described in this example Note In this example the memory switch bit in the operating mode register OMR is cleared and the 16 bit compatib
10. Note See also COBJ Motorola Motorola Assembler Notes C 27 Assembler Directives Example C 51 IDENT Directive If the following line was included in the source file FFILTER IDENT SE FIR FILTER MODULE then the object module identification record includes the module name FFILTER the version number 1 the revision number 2 and the comment field FIR FILTER MODULE 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 are not present then the source statements following the IF directive and up to the next ENDIF directive is included as part of the source file being assembled only if the expression has a nonzero result If the expression has a value of zero the source file is assembled as if those statements between the IF and the ENDIF directives were never encountered If the ELSE directive is present and expression has a nonzero result then the statements between the IF and ELSE directives are assembled and the statements between the ELSE and ENDIF directives are skipped Alternatively if expression has a value of zero then the statements between the IF and ELSE directives are skipped and the statements between the ELSE and ENDIF directives are assembled The expres
11. 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 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 See also MODE ORG GLOBAL LOCAL XDEF XREF C 50 DSP56303EVM User s Manual Motorola Assembler Directives Example C 72 SECTION Directive SECTION TABLES TABLES will be the section name C 3 52 SET Set Symbol to a Value label SET expression SET label expression The SET directive
12. Example C 88 WHILE Statement WHILE x rl GT 40 loop until zero is found ENDW C 4 3 Simple and Compound Expressions Expressions are an integral part of IF REPEAT and WHILE statements Structured control statement expressions should not be confused with the assembler expressions The latter are evaluated at assembly time and are 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 are referred to in the following discussion simply as expressions 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 See 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
13. p y anbi4 3 a e Jo y 1eeus Sioo dsq Jeubisag 8661 OL Jaquianon epsen eieg E g 49quin Aen NSGQ 06989dS0 momen azis 191194409 puewwog vi 30 QWN 092 168 215 xw4 199 168 Z1S 8668 66 8 XL unsny 159M SANG uouue WEIIIIM 1099 UOISIAIG 19q112SQNS SS9 911M DD MOL 130 101 usul SNL oo QQN9 Klatz QQN9 pao aano poo aan pao Nano NONO NOND Ion Let NOND voan Le NOND uooA H 20 9294 tes SAND SOND mu HONS HONS HONS 4294 HONO uoo ET vano boon T OaN9 boon oaNnd boo re oaNnd boon dQN5 do 3 I ADOND 49994 zen Be uadwn f NAYNI HILHANOD ANVNNOD Quvos No 4032111950 ZHIN8099 61 anro So e Ou ano LE l AS O EE 99 AS O z t z 922 99 eed al 99 99 er 7HW8099 61 T 4211950 ZHINSSZ ZT gx EA 3 oke Ast vas yino onoj 68 20A age S J 8 T T gy L I A 1A A E SEE FE va vy el eg ev HE 4 24 av 18 xz lt oal yn s 0v H D 200 QXL o amp 200 Ou DYBEESD sn ong 1004 sa Apr jnoxg Edl ononon Per om ES 238385 SEE Qe S Ee 5292 ex E yor 299223 298 ST ze
14. CODEC_RESET x M_PDRC dissert CODEC_RESET pin 0 on ESSIO Motorola Codec Programming Tutorial D 19 Phase II Initializing and Interfacing the ESSI and CODEC Ports Table D 15 Codec Pins Pin Name Description Values CODEC RESET Resets the CODEC 0 Reset codec 1 Disable Reset FSYNC Used to indicate a start of a frame Rising edge New Frame SCLK Serial clock Rising Edge data is received Falling edge data is transmitted SDOUT Serial data output line N A SDIN Serial data input line N A CCS Enables setting of CODEC control parameters 0 enabled 1 disabled CDIN Serial Control Information input line N A CCLK Clock for Control Parameters Rising edge control parameters sent Finally the codec is ready to receive the control information The codec will ignore the first set of control information sent after a reset Therefore a dummy set of control information is sent prior to sending the correct control information To reduce the amount of code written by the programmer another solution is to send the correct control information to the codec twice The first set of control information will be ignored but the second control information will be recognized Two global variables will be defined to simplify programming e CTRL WD HIE The high word in the control information e CTRL WD LO The low word in the control information To send the control information from the ESSI to the codec p
15. MSB D 10 control parameters D 10 digital interface 3 8 digital interface connections 3 9 initializing and interfacing D 12 Left Input 2 Pin LIN2 3 8 Master Clock Pin CLKIN 3 7 modes of serial operation 3 9 ports initialization D 19 programming D 1 Programming the CS4218 D 8 Reset Pin RESET 3 10 Serial Sync Signal Pin SSYNC 3 10 command converter 3 1 3 10 command format assembler 2 5 Motorola Index Index xxxvii Comment C 14 delimiter C 1 object file C 13 unreported C 2 comment field 2 3 Conditional assembly C 28 C 37 Constant define C 14 C 15 storage C 11 Constants D 9 Control Data Input Pin MF2 CDIN 3 10 Control Register A settings D 13 Control Register B settings D 13 Crystal Semiconductor CS4215 3 7 CS4218 3 7 Cycle count C 37 D D A converter 3 7 Data Pins D 0 23 3 4 3 6 data transfer fields 2 3 Debugger 2 1 2 17 running the 2 19 Debugger software 2 17 Debugger window display 2 18 development process flow 2 1 device D 2 Directive C 10 BREAK C 55 CONTINUE C 56 FOR C 56 JF C 57 LOOP C 58 REPEAT C 58 WHILE C 58 BADDR C 10 BSB C 11 BSC C 11 BSM C 12 BUFFER C 12 COBJ C 13 COMMENT C 14 DC C 14 DCB C 15 DEFINE C 5 C 16 C 37 DS C 17 DSM C 17 DSR C 18 DUP C 18 DUPA C 19 DUPC C 20 DUPF C 21 END C 22 ENDBUF C 23 ENDIF C 23 ENDM C 23 ENDSEC C 24 EQU C24 EXITM C 25 FAIL C 25 FORCE C 26 GLOBAL C 26 GSET C 26 HIMEM C 27 IDENT C 27 IF C
16. Motorola Codec Programming Tutorial D 3 ESSI GPIO pins DA ESSI GPIO pins The ESSI port uses six pins to allow transfer of information Each pin can be configured to function in the ESSI mode or the GPIO mode by modifying the port control registers Please refer to Table D 1 Table D 1 ESSI Pin Definition Pin Name Pin Function Serial Control 0 SCO PCO Has a multitude of functions depending on how control registers are set Serial Control 1 SC1 PC1 Has a multitude of functions depending on how control registers are set Serial Control 2 SC2 PC2 Has a multitude of functions depending on how control registers are set Serial Clock SCK PC3 Serves as a provider or a receiver of the serial bit rate clock Serial Receive Data SRD PC4 Receives serial data Serial Transmit Data STD PC5 Transmit serial data D 5 ESSI Port Registers The ESSI port can be configured to work in the ESSI mode or the GPIO mode However in either the ESSI mode or the GPIO mode there are certain registers that apply specifically to each mode with the exception of two registers The two registers port control register C PCRC and port control register D PCRD determine how the ESSI ports will be used port control register C configures the ESSIO s functionality mode while port control register D configures the ESSI1 s functionality mode Setting the corresponding bit pin on the port control register to 1 configures
17. the output file is named using the basename of the first input file in this case filter The map file is called filter map For the linker the case of symbol names is significant When the N option is given the linker ignores case in symbol names all symbols are mapped to lower case Example dspink N filter cln fft cln fio cln Links the files filter cln fft cln and fio cln to produce the absolute executable file filetr cld Maps all symbol references to lower case 2 14 DSP56303EVM User s Manual Motorola Linker Options Table 2 2 Linker Options Continued Option Description 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 lt mem gt is one of the single character memory space identifiers X Y L P The letter can be upper or lowercase The optional lt ctr gt 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 can be for internal memory E for external memory R for ROM A for Port A and B for Port B If lt map gt is not supplied then no
18. 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 listl r0 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 vo load the value of X memory pointed to by the contents of r0 into x0 and post increment r0 load the value of Y memory pointed to by the contents of r4 into y0 and post increment r4 do 15 endloop do 15 times mac x0 y0 a x r0 x0 y r4 yO multiply and accumulate and load next values endloop jmp K this is equivalent to label jmp label and is therefore a never ending empty loop kCckckckok ck ck ck ck Ck Ck Kok Ck kk CSI CIC CI S I AG MA Ax X M A END OF THE SIMPLE PROGRAM Ckckckok ck ck ck kk Kok Ck CK CK CIS CIC CI I KG A A KG X A 2 2 Assembling the Program The following sections describe the format of the assembler command list the assembler special characters and directives and give instructions to assemble the example program 2 2 4 Assembler Command Format The Motorola DSP assembler is included with the DSP56303EVM on the Motorola Tools CD and can be installed by following the instructions in the Read Me file on the CD The Motorola DSP assembler is a program that translates assembly languag
19. 2 16 options 2 13 linker directives 2 16 Listing file C 38 format C 31 C 38 C 40 C 45 C 52 sub title C 51 title C 52 LM4880 3 8 Location counter C 6 C 42 Long Memory Data Moves 3 4 Macro call C 38 comment C 37 definition C 32 C 38 directive C 32 end C 23 exit C 25 expansion C 39 library C 31 C 39 purge C 45 Macro argument concatenation operator C 2 local label override operator C 4 return hex value operator C 4 return value operator C 3 MAX212 3 11 Memory limit C 27 C 30 utilization C 39 Memory space C 39 C 42 Mode Selection 3 15 Modes D 2 Motorola DSP linker 2 12 N Number of Bits to Compare Bits BCN 3 0 3 6 O Object file comment C 13 identification C 27 symbol C 41 C 51 object files 2 1 OnCE commands 3 10 OnCE JTAG conversion 3 10 operand field 2 3 operand fields 2 3 Operating Mode DSP56307 3 6 operation field 2 3 Option AE C 35 C 37 assembler operation C 36 CC C 36 C 37 CEX C 35 C 37 CK C 36 C 37 CL C 35 C 37 CM C 36 C 37 CONST C 36 C 37 CONTC C 37 CONTCK C 36 C 37 CRE C 35 C 37 DEX C 36 C 37 DLD C 36 C 37 DXL C 35 C 37 FC C 35 C 38 FF C 35 C 38 FM C 35 C 38 GL C 36 C 38 GS C 36 C 38 HDR C 35 C 38 IC C 36 C 38 IL C 35 C 38 INTR C 36 C 38 LB C 36 C 38 LDB C 36 C 38 listing format C 35 LOC C 35 C 38 MC C 35 C 38 MD C 35 C 38 message C 35 MEX C 35 C 39 MI C 36 C 39 MSW C 35 C 39 MU C 35 C 39 NL C 35 C 39 NOAE C 39 Index xl DSP56303EVM Use
20. 3 4 J9 Pins 5 6 Sampling Frequency MF6 MF7 MF8 kHz Jumper Jumper Jumper 48 0 Jumper Jumper Open 32 0 Jumper Open Jumper 24 0 Jumper Open Open 19 2 Open Jumper Jumper 16 0 Open Jumper Open 12 0 Open Open Jumper 9 6 Open Open Open 8 The codec is connected to the DSP56303 ESSIO through the shorting jumpers on J4 and J5 shown in Figure 3 1 on page 3 2 Jumper block J4 connects the ESSII pins of the Motorola DSP56303EVM Technical Summary 3 7 Audio Codec DSP56303 to the control pins of the CS4218 Jumper block JS connects the ESSIO pins of the DSP56303 to the data pins of the CS4218 By removing these jumpers the user has full access to the ESSIO and ESSII pins of the DSP56303 The following sections describe the connections for the analog and digital sections of the codec 3 4 1 Codec Analog Input Output The DSP56303EVM contains 1 8 inch stereo jacks for stereo input output and headphones Figure 3 7 shows the analog circuitry of the codec CS4218 Headphones starog RIN2 P5 Input P4 LIN2 LM4880 Hs lt RIN1 nuse X LINI LOUT SE utput ROUT PS AA1933 Figure 3 7 Codec Analog Input Output Diagram The stereo jack labelled P4 IN on the DSP56303EVM connects to the codec right and left input pins RIN2 and LIN2 Standard line level inputs are 2 Vpp and the codec requires that input levels be limited to 1 Vpp Thus a voltage
21. CRE MU Cross reference memory utilization Motorola Motorola Assembler Notes C 41 Assembler Directives C 3 43 ORG Initialize Memory Space and Location Counters ORG lt rms gt lt rlc gt lt rmp gt lt exp1 gt lt lms gt lt llc gt lt lmp gt lt exp2 gt ORG lt rms gt lt rmp gt lt rce gt lt exp1 gt lt 1ms gt lt 1mp gt lt 1ce 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 mechanism for initiating overlays Note A label is not allowed with this directive The parameters used with the ORG directive are as follows lt rms gt lt rlc gt lt rmp gt lt rce gt expl Ims llc Which memory space X Y L P or E is used as the runtime memory space If the memory space is L any allocated datum with a value greater than the target word size is extended to two words otherwise it is truncated If the memory space is E then depending on the memory space qualifier any generated words are split into bytes one byte per word or a 16 8 bit combination Which runtime counter H L or default if neither H or L is specified that is associated with the rms is used as the runtime location counter Indicates the runtime physical mapping to DSP memory I internal E external R ROM A p
22. Ce n 1O3TES ZION au LE 9H Wed MA a ara US ne vat oe de CS aay ome taie num 1H orn Han a ep E yo L 2011 res ror EMS pales 200 EH e wg agon L t gaon aaon ES aon 4 1 13538 SN EECH ou T 00d OUT yor 100 200 ZMS aaow y 00 Zdi dl 301 vod 500 E 900 900N eu 200 800 H 60d nn AAA old 800W ou ua eia AOL era NN via vaow id sia gid AOL 4a cXenp A ela 13538 e 610 oza zu OL EI 120 H zza 130 ri eza gt gt Jee oan zor 00199 0 954SQ 188 tid in AEE DSP56303EVM User s Manual MOTOROLA A 2 A10uJ9 y BUJ91X3 CH n 3 q LI 104 Jo z 1eeus sio dga eubisag 8661 OL Jaquanoy epsen oe NSQ 0698dSd lequnwN jueuinooq AIO jeusajxz o vi 30 QWN 0922 168 21S Xv3 199 168 Z1S 8698 98482 XL unsny 159M ng uouueg we UOISIAIG 19Q11ISGNS ssajaJIM M 1099 0102 V0L0A1621V QNO 39 YO oa id za a ya sa 9a 1d MO 99 DE en 9g ONS DOA Tr OND 99 T QNS 929 a OND 9A op OND 99m tz OND 92 QNS 99 gr OND 90A sn 01 L0201 89 AX eza Ex Sn 220 3 ia gt 30 120 39 oza A se 130 610 uM IM ela 210 910 sid bia eld zta ua od 60 90 0 sq sa va ed za id og yn A E lt
23. DATAST EQU Yi823 MOVE DO L Y DATAST If this is not desirable then the long absolute addressing mode can be forced as shown below DATAST EQU Y 923 MOVE DO L Y gt DATAST C 8 DSP56303EVM User s Manual Motorola Assembler Significant Characters C 2 15 Immediate Addressing Mode The pound sign is used to indicate to the assembler to use the immediate addressing mode Example C 17 Example of Immediate Addressing Mode CNST EQU 5 MOVE CNST DO 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 picks the long form of immediate addressing by default If this is not desired then the short form of addressing can be forced using the immediate short addressing mode force operator lt Example C 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 MOVE CNST DO L CNST EQU 5 Because the lo
24. E a EMO L sn EG A z 9A t031 or 1 ur vr i AL A A9109 AEE IRI id Qv38 3118834 0v39 31 8834 VAS O 1 el 0 S 10692660N ONO 90A01 de anyo 3n Jp Anen ec I9 89 7T X 90 rs LI 77 NIA o E 2 3 L ven 90491 Zum 4 D A Qv3g 3118833 EB W 28 21 Il LOOP NA 1008 Wa Il NM M 4 A Wutz ZS 3a Ia aque ADV YIMOd 2a 2v z 90A01 9dA01 L06926 0N ML qus SL unn neo 2 v 19 s9 9 z NIA RM ed ee SS ten ava 3118833 At O A n A 7 DSP56303EVM User s Manual MOTOROLA r oo Jp o sioyo9edeo ssed g y amb 2 s c z y e ZL jo 4 1eeus Sioo sa Jeubisag 8661 OL Jaquiaron Aepsen ajeg n 8 ke S n Aequun Aen NSQ 0 95dS Jus ADO 9218 sioyo9edeg ssed g on vi 30 QWN 092 168 21S Xv4 199 168 Z1S JS M 2A11Q uouue WEIIIIM L0S9 UOISIAIG 19q119SqQNS SSI 9 11M o ES O EW 3nio o EW anyo ano anyo Ki a O ae 899 199 599 99 299 199 z ES z Ze d g 39100 1 09 E A SS o R e i jnio o jnio 0 jnio o jnio o 4n40 0 anyo anyo anyo anyo anyo gt gt 099 899 199 999 ss
25. Iez olgaa A 3 DSP56303EVM User s Manual MOTOROLA 998 19 U1 ZEZSH v 91nBbIy 3 q 8668 9 8 XL unsny 159M SANG uouue WEIIIIM 1099 UOISIAIG 19Q119SGNS ssa a8J1M rl Jo 1eeus sjool dSQ ueuBiseg 8664 OL 19QUIAON fepsen eyeq g Aequun Aen NSGQ 06989dS0 momen azis 98 4 U c ZSH oi vi 30 QWN 092 168 215 xw4 Lso L6elzLg TIA 30 0Z utd pepunozo TIN 30 OZ UTA pue Tq Jo p utd bur3oeuuoo Teubts peAoueug TIN SOTASP jo g utd uoaj eubis 3esou peaAouei or3eueuos JO IT UOTSIDA 1uOd viis onaaa 1HOd 1VIH3S asa kit QVPOLOHPLOW GVPOLOHPLOW QVr0LOHTZON oen GVPOLOHPLOW zT de TT aen GVPOLOHPLOW 6 E gen 36n aen QVt010H 0W T T gt gt 120013838 ven p m un 00 oan 9VOZLzX VW i a o S Na onee NN nett Mr 184 gr NISY 1nosy 9Igeu3 ZEZSY o DS de er Ni 1noru e Nisy 1notu E 9 lt ax Tz MER 1noz8 t t 1198 zz Nite inoiu t z axy Dy eer LDOEL NIEL 1noz1 NSL 200 01 1norL NULL anro DS 99 Le mA c pe 189 5 z 629 Anen maan 0808N1 seo 34 Ch a 90 PIER GUEN 91 MOTOROLA x DSP56303EVM User s Manual A 4 19119AU0 pueWWOD
26. Motorola Codec Programming Tutorial D 31 Example Application Example D 19 illustrates the tasks of including initialization and interface files defining transmit and receive buffers and pointers and setting up control word constants Example D 19 Include Define and Set Up Tasks kkxkxkxkxkxkxkxk xkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkkxkxkxkxkxkkxkxkxkxkxkxkxkxkkkxkk kxx k nolist include ioequ asm include intequ asm include ada equ asm include vectors asm list kxkkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkkkxkxkxkxkxkkxkxkxkxkxkxkxkxkkkkxkxxk Buffer for talking to the CS4218 org x 0 RX BUFF BASE equ x RX_data_1_2 ds 1 data time slot 1 2 for RX ISR left audio RX_data_3_4 ds 1 data time slot 3 4 for RX ISR right audio IX BUFF BASE equ TX data 12 ds 1 data time slot 1 2 for TX ISR left audio TX data 34 ds 1 data time slot 3 4 for TX ISR right audio RX PTR ds 1 Pointer for rx buffer TX PTR ds 1 Pointer for tx buffer CTRL WD 12 equ MIN LEFT ATTN MIN RIGHT ATIN LIN2 RIN2 CTRL WD 34 equ MIN LEFT GAIN MIN RIGHT GAIN After setting up the constants needed for the codec the DSP needs to be set up and initialized 1 et ter ES 6 The DSP will need to know what speed the PLL is r
27. No Ne Ne Ne Ne Ne Control Register B movep FS 330C x M_CRBO Enable REIE TEIE RLIE TLIE RIE TIE RE TEO network mode synchronous out on rising in on falling shift MSB first external clock source drives SCK codec is master RX frame sync pulses active for 1 bit clock immediately befor transfer period positive frame sync polarity frame sync length is 1 bit No Ne Ne Ne Ne Ne Ne Ne Ne Ne Ne Ne D 9 2 Configure GPIO Pins In the previous sections of this document it was stated that the ESSIO pins function in the ESSI mode while the ESSI pins operate in the GPIO mode Referring to Figure D 2 notice that some of the pins only affect the control information of the codec while the other pins deal with the transfer of data Because the codec on the DSP5630xEVM boards are configured to operate in SM4 mode the control information runs on a separate serial line than the data lines Additionally SM4 dictates that the control information only needs to be configured once unless a change is needed In order to control the codec control information the full ESSI port mode does not need to be used Instead the GPIO mode is used to transfer the control information Any pins that are used to control the codec control information will be configured as a GPIO mode otherwise the ESSI mode will be used To configure the mode in which the pin operates ESSI or GPIO port control reg
28. Option 3 11 3 5 Debug RS 232 Connector P2 Pinout 3 11 3 6 JTAG OnCE J6 Connector Pinout 3 12 3 7 SCI Header J7 Pinout A ah olei doe d Sooke pak tec de iC LR 3 13 3 8 JI Jumper C OS AAA i aree fate a Sd ened Rea deen 3 13 3 9 DSP Serial Port P1 Connector Pinout 3 13 3 10 ESSIO Header 5 PIROUES Liu mas rl A to Mag Bs 3 14 3 11 ESSIO Header JA Pilas fe sous 3 14 3 12 BIOS Header 13 Pinot ua dust riada aio cade had inked 3 15 3 13 Expansion Bus Control Signal Header J2 Pinout 3 15 3 14 Boot Mode Selection Options 3 16 B 1 DSP56303EVM Parts List duit Ge arto e UR Roe RR as B 1 D 1 ESSI Pin Definition seiras d eom A tes D 4 D 2 ESSI GPIO Shared Registers gu iE he ead m as D 5 D 3 ESSI Registers A een e beg ee actes irs b x ac eade qs D 5 D 4 GPIO Re pisto EE D 6 D 5 Pin Set Up Descriptions ner wc i a taste eto D 7 D 6 JP5 Jumper Block ESSIO oia D 7 D 7 JP4 Jumper Block ESSIT ups y ro ane y obe erf ee D 8 D 8 CS4218 Codec Control Information MSB D 10 D 9 Settings for Control Register A D 13 D 10 Settings Control Register B ad eoe eM bete LEA e ara a D 13 Motorola List of Tables xiii D 11 Port Data Register C Pin bit Correspondence D 16 D 12 Port Data Register D Pin bit Correspondence
29. Pin Number DSP Signal Pin Number DSP Signal Name Name 1 SCKO 2 ES 3 SCO0 4 5 STDO 6 7 SRDO 8 EN 9 SCO01 10 11 SCO2 12 m 3 6 3 Enhanced Synchronous Serial Port 1 ESSI1 Connection to the DSP s ESSII port can be made at J4 Refer to Table 3 11 for the header s pinout Table 3 11 ESSIO Header J4 Pinout Pin Number DSP Signal Name Pin Number DSP Signal Name 1 SCK1 2 3 SC10 4 5 STD1 6 7 SRD1 8 9 SC12 10 11 SC11 12 3 6 4 Host Port HI08 Connection to the DSP s HI08 port can be made at J3 Refer to Table 3 12 for the header s pinout 3 14 DSP56303EVM User s Manual Motorola Table 3 12 HI08 Header J3 Pinout Pin Number DSP Signal Name Pin Number DSP Signal Name 1 HO 2 H1 3 H2 4 H3 5 H4 6 GND 7 H5 8 H6 9 H7 10 RESET 11 HAO 12 HA1 13 HA2 14 HCS 15 HREQ 16 HDS 17 3 3 V 18 HACK 19 HRW 20 GND 3 6 5 Expansion Bus Control Mode Selector Connection to the DSP s expansion BUS control signals can be made at J2 Refer to Table 3 13 for header s pinout 3 7 Mode Selector Table 3 13 Expansion Bus Control Signal Header J2 Pinout Pin Number DSP Signal Name Pin Number DSP Signal Name 1 3 3 V 2 RD 3 WR 4 BG 5 BB 6 BR 7 TA 8 BCLK 9 BCLK 10 CAS 11 CLKOUT 12 AA1 13 AAO 14 AA2 15 AA3 16 GND Boot Up mod
30. RDIRECT Remove Directive or Mnemonic from Table C 47 C 3 49 SCSJMP Set Structured Control Statement Branching Mode C 47 C 3 50 SCSREG Reassign Structured Control Statement Registers C 48 Caral SECTION Lar Seo cio Rd rre fied ore et ated bt et C 48 302 SEF SetSymboLlto 3 Values 1 45 ias id C 51 353 STITLE Initialize Program Sub Title ias C 51 C 3 54 SYMOBJ Write Symbol Information to Object File C 51 355 LABS Set listing Tab Stops eses td ttes sat dus C 52 C 3 56 TITLE Initialize Program Title onda ASA Rees C 52 D DSP56303EVM User s Manual Motorola C357 UNDEF Undefine DEFINE Symbol drid Reto RR C 52 C 3 58 WARN Programmer Generated Warning C 52 C 359 XDEF External Section Symbol Definition C 53 C 3 60 XREF External Section Symbol Reference C 53 C 4 Structured Control Statements C 54 C 4 1 Structured Control ue C 54 C 4 2 o P T EET C 55 C 4 2 1 BREAK Statement i45 id bbs te C 55 C 4 2 2 CONTINUE Statements ricas i taa C 56 C 4 2 3 FOR Statement s x sat DOO Cen vtro AA S eee ees C 56 C 4 2 4 LIE S babe mieribe St 26 5 tace eia n bes epe ea bcp Stier s bed C 57 C 4 2 5 LOOP Staten os ban dado sido ido C 58 C 4 2 6 REPEAT Statement o od e pet tq ed OIN et e e e aes C 58 C 4 2 7 WHILE Statement ld WO Hex S ed te Nee rst eoa C 58 C 4 3 Simple and Compound Expressions
31. RDIRECT Remove Directive or Mnemonic from Table RDIRECT lt direc 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 is 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 with 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 results if the RDIRECT directive is encountered in a section Note A label is not allowed with this directive Example C 69 RDIRECT Directive RDIRECT PAGE MOVE This causes the assembler to remove the PAGE directive from the directive table and the MOVE mnemonic from the mnemonic table C 3 49 SCSJMP Set Structured Control Statement Branching Mode SCSJMP SHORT LONG NONE The SCSJMP directive is analogous to the FORCE directive but it only applies to branches gene
32. The dummy argument list has the following form lt dumarg gt lt dumarg gt lt dumarg gt The required label is the symbol by which the macro is called If the macro is named the same as an existing assembler directive or mnemonic a warning is 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 replaces 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 C 32 DSP56303EVM User s Manual Motorola Assembler Directives Macro definitions may be nested but the nested macro is not defined until the primary macro is expanded Note See also DUP DUPA DUPC DUPF ENDM Example C 59 MACRO Directive SWAP_SYM MACRO REG1 REG2 swap REG1 REG2 using X0 as temp MOVE R REG1 X0 MO
33. 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 are 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 begins in the operand field RP Generate NOP instructions to accommodate pipeline delay 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 C 40 DSP56303EVM User s Manual Motorola SCL SCO SO SVO UR WEX XLL XR Assembler Directives 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 lab
34. assembly program the assembler the linker and the object files For detailed information on these subjects consult 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 Wireless internet URL http www mot com SPS DSP documentation Motorola Example Test Program 2 1 Writing the Program Assembly Program asm Assembler Relocatable Object File 7 Linker C Executable N Object File cld E ADS Command DSP56002 Converter Card Y W DSP56303 DSP56303EVM AA1927 Figure 2 1 Development Process Flow 2 1 Writing the Program The following sections describe the format of assembly language source statements and give an example assembly program 2 1 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 Example 2 1 Example Source Statement trm mac x0 y0 a x r0 x0 y r4 yO Text Label Operation Operand X Data Transfer Y Data Trans
35. case by case basis using double quoted strings 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 default reset Expand DEFINE directive strings in listing Motorola Motorola Assembler Notes C 37 Assembler Directives FE FF FM GL GS HDR IC IL INTR LB LDB LOC MC MD Fold trailing comments Any trailing comments that are included in a source line are folded underneath the source line and aligned with the opcode field Lines that start with the comment character are aligned with the label field in the source listing The FC option is useful for displaying the source listing on 80 column devices Use form feeds for page ejects in the listing file Format assembler messages so that the message text is aligned and broken at word boundaries Make all section symbols global This has the same effect as declaring every section explicitly GLOBAL This option must be given before any sections are defined explicitly in the source file default reset in absolute mode Make all sections global static All section counters and attributes are associated with the GLOBAL section This option must be given before any sections are defined explicitly in the source file default reset Generate listing header along with titles and subtitles Ignore
36. control information EN ON decur abs dcs De assert ESSI reset and enable interrupts D 9 1 Initialize ESSI Ports The first step in initializing the ESSI Port is to reset the ESSI ports By sending a value of zero into the port control register C and port control register D on the ESSIs ESSIO and ESSII undergo a reset Although ESSI1 will be used as a GPIO it is recommended that the programmer also perform the reset on ESSI1 Example D 3 illustrates the reset procedure of the ESSI ports Example D 3 ESSI Port Reset Procedure movep 50000 x M_PCRC reset movep 50000 x M_PCRD reset ESSIO C control register por ESSI1 D control register por The next step in initializing the ESSI port is to set the control parameters for the ESSI port Adjusting the bits on the ESSI Control Register A CRAO and ESSI Control Register B CRBO allow for initializing and modifying control parameters Each bit on the registers has a specific meaning Describing the meaning of each bit on the registers is beyond the scope of this appendix The information on specific definitions of each bit can be found in the respective DSP5630x chip manuals However there are certain typical settings that need to be made in order for the codec to work properly with the ESSI ports Table D 9 displays the settings that need to be made with Control Register A Motorola DSP56303EVM User s Manual D 12 Phase Il Initializing and Interfaci
37. 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 are uninitialized If more data is allocated than the specified size of the buffer an error is issued C 12 DSP56303EVM User s Manual Motorola Assembler Directives 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 2F where 2 gt expression An error is 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 expression 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 expression lt m where m
38. divider forms a 6 dB attenuator between P4 and the CS4218 The codec right and left channel output pins ROUT and LOUT provide their output analog signals through the stereo jack labelled P6 OUT on the DSP56303EVM The outputs of the codec are also connected to the stereo jack labelled PS HDPHNE on the DSP56303EVM through National Semiconductor s LM4880 dual audio power amplifier at U8 The headphone stereo jack permits direct connection of stereo headphones to the DSP56303EVM 3 4 2 Codec Digital Interface Figure 3 8 shows the digital interface to the codec Table 3 2 and Table 3 3 show the jumper selections to Enable Disable the code s digital signals 3 8 DSP56303EVM User s Manual Motorola Audio Codec DSP56303 CS4218 STDO __ SDIN SRDO La SDOUT SCKO la SCLK SCO0 w RESET SCO2 La SSYNC SC10 MF4 CCS SC11 __ MF3 CCLK SC12 ___s MF2 CDIN AA1934 Figure 3 8 Codec Digital Interface Connections Table 3 2 JP5 Jumper Block Options JP5 DSP Signal Name Code Signal Name 1 2 SCKO SCLK 3 4 SC00 RESET 5 6 STDO SDIN 7 8 SRDO SDOUT 9 10 SC01 11 12 SC02 SSYNC Table 3 3 JP4 Jumper Block Options JP4 DSP Signal Name Code Signal Name 1 2 SCK1 3 4 SC10 CCS 5 6 STD1 7 8 SRD1 9 10 SC12 CDIN 11 12 SC11 CCLK The serial interface of the codec
39. e DSP56303 Technical Data Document order number DSP56303 D Provides features list and specifications including signal descriptions DC power requirements AC timing requirements and available packaging e DSP56303 User s Manual Document order number DSP56303UM 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 DSP56300 Family Manual Document order number DSP56300FM AD Provides a detailed description of the core processor including internal status and control registers and a detailed description of the family instruction set Refer to these documents for detailed information about chip functionality and operation These documents will be provided in the kit on either CD or hard copy Motorola DSP56303EVM Technical Summary 3 1 Memory 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 previously The latest version can be obtained on the Motorola DSP worldwide web site at http www mot com SPS DSP chiperrata index html 3 3 Memory The DSP56303EVM includes the following external memory 64K x 24 bit fast static RAM FSRAM for expansion memory e 128K x 8 bit flash memory for stand alo
40. 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 TO Y targ 2 1 BY 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 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 C 4 5 Effects on the Programmer s Environment During assembly global labels beginning with Z_L are generated They are stored in the symbol table a
41. explicit mapping is presumed The lt origin gt is a hexadecimal number signifying the new relocation address for the given memory space The O option can 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 dspink Ope 200 myprog Lmylib 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 it first searches the current directory or the directory given in the library specification 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 can be repeated as many times as desired Example dspink P project testprog Uses IBM PC pathname conventions and causes the linker to prefix any library files not found in the current directory with the project pathname R lt ctlfil gt Indicates that a memory control file is to be read to determine the placement of sections into DSP memory and other linker control functions lt ctlfil gt can be any legal operating system filename including an optional pathname If a pathname is not specified an attempt is made to open the file in the current di
42. expression gt A simple or compound expression Section C 4 3 e lt stmtlist gt Zero or more assembler directives structured control statements or executable instructions Note 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 e 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 1 e it cannot be an immediate value e lt op2 gt The initial value of the FOR loop counter The effective address may be any mode and may represent an arbitrary assembler expression e 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 e lt op4 gt tThe 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 e lt cnt gt The terminating value in a LOOP statement This can be any arbitrary assembler expression All structured control statements may be fo
43. host PC to give status information The set of replies may include acknowledge good acknowledge bad in debug mode out of debug mode or data read When the DSP56303 is in the debug state the red debug LED LED2 is illuminated 3 10 DSP56303EVM User s Manual Motorola Command Converter The DSP56002 connects to the DSP56303 JTAG OnCE port through the shorting jumper on J8 Table 3 4 shows the JTAG enable disable options The jumper must be present in J8 to use the DSP56002 as the command converter Refer to Figure 3 1 on page 3 2 for the location of J8 on the DSP56303EVM and to Figure 3 2 on page 3 3 for a functional diagram Figure 3 9 shows the RS 232 serial interface diagram Table 3 5 shows the RS 232 connectors pinout P2 Table 3 4 On Board JTAG Enable Disable Option J8 Option Selected 1 2 On Board Command Converter Enabled OPEN On Board Command Converter Disabled DSP56002 RS 232 TRANSCEIVER RXD H RAOUT HOST PC RAIN La TD TXD T2lN TOUT RD RESET 4 R5O0UT R5IN DTR AA1935 Figure 3 9 RS 232 Serial Interface Table 3 5 Debug RS 232 Connector P2 Pinout got Qe Pin Number pog 1 6 2 TxD 7 3 RxD 8 4 RESET 9 5 GND Maxim s 3 V Powered RS 232 Transceiver MAX212 at U11 is used to transmit the signals between the host PC a
44. 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 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 are 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 is assigned the value of the runtime location counter at the start of the DUPC directive processing Note See also DUP DUPA DUPF ENDM MACRO C 20 DSP56303EVM User s Manual Motorola Assembler Directives Example C 37 DUPC Directive If input source file contained 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 HE 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 C 3 17 DUPF Duplicate Sequ
45. location counter In this case OVL1 must not itself be an overlay symbol 1 e 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 is used as the load location counter The counter value and mode are whatever they were the last time they were referenced ORG XL E8 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 is not initialized and its last value is used The load memory space is set to E and the qualifier 8 indicates a bytewise RAM configuration Instructions and data are generated eight bits per output word with byte oriented load addresses The default load counter is used and there is no explicit load origin ORG P 5 Y 8000 Indicates code is 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 is 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 is used as the load location counter The default load counter is initialized to 8000 C 44 DSP56303EVM User s Manual Motorola Assembler Directives C 3 44 PAGE Top of Page Size Page PAGE lt exp1 gt lt e
46. move SO3FF m4 make echo buffer 1024 deep clr a Clear a rep SO3FF clear the echo buffer move a l1 r4 In order to receive data from the ESSI port the programmer must ensure that data is received at the beginning of the frame Thus it is necessary to check the status bits to ensure that data receive starts at the beginning of the frame and not in the middle Once a receive frame synchronization is detected data can be manipulate through the receive memory location RX BUFF BASE Afterwards the data can be processed and then moved into the transmit pointer All of these procedures can be implemented in an infinite loop to continuous receive process and transmit the data In the case of the echo program Example D 23 illustrates the implementation Motorola Codec Programming Tutorial D 33 Example Application Example D 23 Implementation of Echo Program echo_loop jset 3 x M_SSISRO wait for rx frame sync eer 3 x M SSISRO wait for rx frame sync clr a clr b move x RX_BUFE_BASE a receive left move x RX BUFF BASE 1 b receive right asr a x r4 x0 divide them by 2 and get oldest asr b y r4 yO samples from buffer add x0 a add the new samples and the old add y0 b asr a reduce magnitude of new data to ensure stability asr b move a x r4 Save the altered samples move b y r4 and bump the pointer move a X TX BUER BASE transmit left move b x TX BUFF B
47. positions on each block are jumpered These jumpers perform the following functions e Jl controls the operating mode of the DSP56303 e J4 and J5 control the interface between the audio codec and the DSP56303 enhanced synchronous serial interface ESSIO e J8controls the interface between the DSP56303 JTAG OnCE port and DSP56002 synchronous serial interface SSI Motorola Quick Start Guide 1 3 Installation Procedure J1 J2 J3 TEST LED MC74HG TOA Q DSP56002 AT29LV010A SW1 GW Flash J4 MC34164 DSP56303 J10 lt z P6 OUT e Ee Debug QS3384 So J6 LED 5 JTAG LM4880 com MC33269 M MOTOROLA CS4218 Power LED J4 J5 12 Figure 1 1 DSP56303EVM Component Layout AA1925 1 2 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 1 4 DSP56303EVM User s Manual Motorola Installation Procedure Cable PC Compatible Computer Lr is Connect cable O P3 to RS 232 port External 9 V Power DSP56303EVM
48. 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 AEC Check form of address expressions ASC Enable absolute section bounds checking CSL Cumulate section length data ESO Do not allocate memory below ordered sections OVLP Warn on section overlap RO Allow region overlap RSC Enable relative section bounds checking SVO Preserve object file on errors WEX Add warning count to exit status means default Example dspink XWEX filter cln fft cin fio cin Allows the linker to add the warning count to the exit status so that a project build aborts on warnings as well as errors Z Allows the linker to strip source file line number and symbol information from the output file Symbol information normally is retained for debugging purposes This option has no effect if incremental linking is being done See the I option Example dspInk Zfilter cln fft cln fio cln Links the files filter cln fft cln and fio cln to produce the absolute object file filter cln The output file contains no symbol or line number information 2 4 1 Linker Directives Similar to the assembler directives the linker includes mnemonic directives which specify auxiliary actions to be performed by the linker Following is a list of the linker directives BALIGN Auto align circular buffers BASE Set region base address
49. rO x RX PTR Ee X1 Update rx buffer pointer LA Restore Context r7 mO Restore m0 r7 r0 Restore r0 D 10 3 ESSI Receive Data Interrupt The interrupt occurs when the following properties are true The receive interrupt is turned on CRB 19 The receive data register 1s full Motorola Codec Programming Tutorial D 25 Phase III Data Transferring Mechanism To service the interrupt the programmer will need to receive the data The following steps can be performed to accomplish such a task Save necessary context Load receive buffer pointer Move received data to receive buffer Update receive buffer pointer Qv geo a ND Restore context Example D 14 illustrates the procedures to service this interrupt Example D 14 ESSI Receive Data Interrupt Service ESSI Receive Data Interrupt Service Routine DH Ssi rx isr Save Context move r0 x r7 Save r0 to the stack move m0 x r7 Save m0 to the stack move 1 m0 Modulus 2 buffer move x RX_PTR r0 Load the pointer to the rx buffer nop Delay movep SM RXO x r0 Move received data to receive buffer move r0 x RX_PTR Update rx buffer pointer Restore Context move x r7 m0 Restore m0 move x r7 r0 Restore r0 rti D 10 4 ESSI Receive Last Slot Interrupt The interrupt occurs when the following properties are true e The receive last slot interrupt is tu
50. 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 Sections may also be split into separate parts That is section name 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 allowed to permit the program source to be arranged in an arbitrary manner e g all statements that reserve X space storage locations grouped together but retain the privacy of the symbols for each section
51. 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 i e they must be preceded either by a label a space or a tab BREAK ENDI LOOP CONTINUE ENDL REPEAT ELSE ENDW UNTIL ENDF POR WHILE AF In addition the following keywords are used in structured control statements AND DOWNTO TO BY OR DO THEN Note AND DO and OR are reserved assembler instruction mnemonics C 54 DSP56303EVM User s Manual Motorola Structured Control Statements C 4 2 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 e lt
52. the source program symbol 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 results 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 are replaced by their substitution strings unless the NODXL option is in effect See C 3 42 OPT Assembler Options on page C 34 Macros represent a special case DEFINE directive translations are applied to the macro definition as it is encountered When the macro is expanded any active DEFINE directive translations are applied again 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 See also UNDEF Example C 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 would be transformed by the assembler to the following DS 10 SAMPLSIZ C 16 DSP56303EVM User s Manual Motorola Assembler Directives C 3 11 DS Define Storage lt label gt DS lt expression gt The DS directive reserves a block of memory the length
53. the DSP36303 exits the reset state The mode pins for the DSP56303EVM are controlled by jumper block J1 shown in Figure 3 1 on page 3 2 and Table 3 14 on page 3 16 The DSP36303 boots from the Flash after reset if there are jumpers connecting pins 3 and 4 and pins 5 and 6 on J1 Mode 1 MODA and MODD are set and MODB and MODC are cleared 3 4 Audio Codec The DSP56303EVM analog section uses the Crystal Semiconductor CS4218 KQ for two channels of 16 bit A D conversion and two channels of 16 bit D A conversion Refer to Figure 3 1 on page 3 2 for the location of the codec on the DSP56303EVM and to Figure 3 2 on page 3 3 for a functional diagram of the codec within the evaluation module The CS4218 uses a 3 3 V digital power supply and a 5 V analog power supply The CS4218 is driven by a 12 288 MHz signal at the codec master clock CLKIN input pin The oscillator at Y1 creates a 5 V 12 288 MHz signal The QS3384 at US then converts the 5 V signal to 3 3 V for input to the codec CLKIN pin and the DSP56303 EXTAL pin Refer to the CS4218 data sheet included with this kit for more information The CS4218 is very flexible offering selectable sampling frequencies between 8 kHz and 48 kHz The sampling frequency is selected using jumpers on jumper block J9 Table 3 1 shows jumper positions that select the possible sampling frequencies for the DSP56303EVM Table 3 1 CS4218 Sampling Frequency Selection J9 Pins 1 2 J9 Pins
54. to define AAO as active low Address multiplexing is not needed with the FSRAM therefore the address multiplexing bit BAM is cleared Packing is not needed with the FSRAM thus the packing enable bit BPAC is cleared to disable this option 23 12 BAC11 BAC10 BAC9 BAC8 BAC7 BAC6 BAC5 BAC4 BAC3 BAC2 BAC1 BACO 0 0 0 0 0 1 0 0 0 0 0 0 Address to Compare 11 0 BNC3 BNC2 BNC1 BNCO BPAC BAM BYEN BXEN BPEN BAAP BAT1 BATO Y E External Access Type AA Pin Polarity Program Space Enable X Data Space Enable Y Data Space Enable Address Multiplexing Packing Enable Number of Address Bits to Compare AA1931 Figure 3 5 Address Attribute Register AARO Motorola DSP56303EVM Technical Summary 3 5 Memory The P X data and Y data space Enable bits BPEN BXEN and BYEN define whether the FSRAM 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 FSRAM 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 FSRAM 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 FSRAM is accessed For this example the FSRAM is assigned to respond to addresses between 040000 and 04FFFF Thus
55. transfers digital audio data and control data into and out of the device The codec communicates with the DSP56303 through the ESSIO for the data information and through the ESSII for the control information The codec has three modes Motorola DSP56303EVM Technical Summary 3 9 Command Converter of serial operation that are selected by the serial mode select SMODE1 SMODE2 and SMODE3 pins The SMODE pins on the DSP56303EVM are set to enable serial mode 4 which separates the audio data from the control data The SMODE pins are also set to enable the master sub mode with 32 bit frames the first 16 bits being the left channel and the second 16 bits being the right channel The DSP56303 ESSIO transfers the data information to and from the codec The DSP56303 serial transmit data STDO pin transmits data to the codec The DSP56303 serial receive data SRDO pin receives data from the codec These two pins are connected to the codec serial port data in SDIN and serial port data out SDOUT pins respectively In master sub mode the codec serial port clock SCLK pin provides the serial bit rate clock for the ESSIO interface It is connected to the DSP56303 bidirectional serial clock SCKO pin The DSP56303 serial control 0 SC00 pin is programmed to control the codec reset signal RESET The serial control 2 SC02 pin is connected to the codec serial port sync signal SSYNC signal A rising edge on SSYNC indicates that a new frame is about t
56. was negligent regarding the design or manufacture of the part Motorola and a are registered trademarks of Motorola Inc Motorola Inc is an Equal Opportunity Affirmative Action Employer OnCE and Mfax are trademarks of Motorola Inc Quick Start Guide Example Test Program DSP56303EVM Technical Summary DSP56303EVM Schematics DSP56303EVM Parts List Motorola Assembler Notes Codec Programming Tutorial Index Quick Start Guide Example Test Program DSP56303EVM Technical Summary DSP56303EVM Schematics DSP56303EVM Parts List Motorola Assembler Notes Codec Programming Tutorial Index Table of Contents Chapter 1 Quick Start Guide KE EQUIP A E ARAS 1 1 1 1 1 What You Get with the DSP56303EVM 1 1 1 1 2 What You Need to Upper emt e Sap xor deae tem o aa t 1 2 1 7 Installation Pr ced r ee In been une beh SU e sue ir AA ES 1 2 1 2 1 Preparing the DSP56303EVM EE EE Ae EUR 1 3 1 2 2 Connecting the DSP56303EVM to the PC and Power 1 4 Chapter 2 Example Test Program Zl Wiitne the Prostat yA OR See ees elati 2 2 2 1 1 Source Statement oral A e ne Na Ken 2 2 2 1 1 1 EE ER EE 2 3 2 1 1 2 Operation Field se i ai ere Ce deb ep RE etes e v pe 2 3 2 1 1 3 Op ra Fieldsa e eec tee alte E albe ee Ae af As 2 3 2 1 1 4 Data Transter Fields os s acie E RO Dt A ay tec tnc 2 3 2 1 1 5 Comment Field teste oye ui ODE NR 2 4 2 1 2 Example Programas ous We
57. 1 Setting Up Transmit and Receive Buffers and Pointers Receive buffer and pointer RX_BUFF_BASE equ RX data 1 2 ds il Left receive channel audio RX data 3 4 ds 1 Right receive channel audio RX PTR ds 1 Receive pointer Transmit buffer and pointer IX BUFF BASE equ TX data 1 2 ds 1 Left transmit channel audio TX data 3 4 ds 1 Right transmit channel audio TX PTR ds 1 Transmit pointer Motorola Codec Programming Tutorial D 9 Phase 1 Setting up Constants D 8 2 Defining Control Parameters of the CODEC To specify specific parameters of the A D and D A conversion and other audio parameters the control information must be declared Parameters such as left and right attenuation left and right gain line input selects and mask interrupts are configured in the control information The control information consists of 32 bits of information Although only 23 bits contain useful information a minimum of 31 bits must be set Table D 8 lists the definitions of each bit Table D 8 CS4218 Codec Control Information MSB Descriptions Bit Values Not Applicable 31 0 Mask Interrupt 30 0 no mask on MF5 INT 1 mask on MF5AINT D01 29 N A Left output D A Attenuation 1 5 28 24 00000 No attenuation dB steps 11111 Max attenuation 46 5 dB Right output D A Attenuation 1 5 23 19 00000 No attenuation dB steps 11111 Max attenuation 46 5 dB Mute D A outpu
58. 1 gt data register and lt op2 gt is moved to the 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 worstcase 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 programmer may circumvent this behavior by use of the SCSJMP directive Any immediate operands must be preceded by a pound sign ff 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 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 are overwritten each time the expression is evaluated at runtime The programmer should take care either to save needed C 60 DSP56303EVM User s Manual Motorola Structured Control Statements 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 Comp
59. 11 CCLK 1 GPIO SC10 CCS 0 GPIO Motorola DSP56303EVM User s Manual D 16 Phase Il Initializing and Interfacing the ESSI and CODEC Ports Using the information in Table D 11 and Table D 12 global constants can be defined to simplify programming Example D 5 illustrates the task of defining the pin bit correspondence for the GPIO pins Example D 5 Defining GPIO Pin Bin Correspondence ESSIO audio data port control register C DSP CODEC CODEC RESET equ 0 bit0 SCO00 gt CODEC RESET ESSI1l control data port control register D DSP CODEC CCS equ 0 bitO SC10 CCS CCLK equ 1 bitl SCI1 gt CCIK CDIN equ 2 bit2 SC12 CDIN After setting up constants to reference the bit pin correspondence for the GPIO pins the Port control registers need to be configured To begin with the CODEC RESET pin pin 0 must be configured to function as a GPIO pin Other pins on ESSIO however should be configured to work in the ESSI mode Therefore a 0 value should be sent into bit 0 in port control register C while a value of 1 should be sent to the other five pertinent bits Additionally the CCS pin the CCLK pin and CDIN pin all must function as GPIO pins on the ESSII port Therefore bit 0 CCS bit 1 CCLK and bit 2 CDIN must all be set to 0 to allow those pins to operate in the GPIO mode on the port control register D Since we are not using the
60. 23 bits are useful The other 8 bits are set to zero For more information on the CS4218 codec please refer to the Crystal CS4218 codec Datasheet D 3 ESSI Ports Background The Motorola DSP5630x evaluation modules referred to in this appendix have two ESSI ports ESSIO and ESSI1 which form one of the major serial interfaces to external peripherals Each port consists of six unique pins that allow performance of a multitude of functions depending on how certain pins are configured Each port can function as either an ESSI or a General Purpose Input Output port GPIO While the ESSI mode has some constraints by using the ESSI port in the ESSI mode the programmer can synchronize his tasks with a master clock In addition certain control actions and direction flow are set automatically On the other hand by using the ESSI port in the GPIO mode the programmer is given the option of specifying exactly how data is transferred and what direction the data will flow The drawback to using the GPIO mode is that the programmer must understand exactly how the GPIO ports are used when programming the GPIO ports In the example given in this appendix both modes of operation are used When working with ESSI ports the programmer needs to know in detail of the registers and pins available on the ESSI port Although it is not the purpose of this appendix to discuss the ESSI port in great detail a brief description of each pin and register is included
61. 28 in loop C 37 INCLUDE C 29 LIST C 29 LOCAL C 30 LOMEM C 30 LSTCOL C 31 MACLIB C 31 MACRO C 32 MODE C 33 MSG C 33 NOLIST C 34 OPT C 34 ORG C 42 PAGE C 45 PMACRO C 45 PRCTL C 46 RADIX C 46 RDIRECT C 47 SCSJMP C 47 SCSREG C 48 SECTION C 48 SET C 51 STITLE C 51 SYMOBJ C 51 TABS C 52 TITLE C 52 UNDEF C 52 WARN C 52 XDEF C 53 XREF C 53 Domain Technologies Debugger 1 1 2 17 DSP development tools 2 1 DSP linker 2 12 DSP56002 3 10 DSP56002 Receive Data Pin RXD 3 11 DSP56002 Transmit Data Pin TXD 3 11 DSP56300 Family Manual 3 1 DSP56303 2 1 Chip Errata 3 2 Product Specification 1 1 Product Specification Revision 1 02 3 1 Index xxxviii DSP56303EVM User s Manual Motorola Technical Data 1 1 3 1 User s Manual 3 1 DSP563093 Features 3 1 DSP56303EVM additional requirements 1 2 Component Layout 3 2 connecting to the PC 1 4 contents 1 1 description 3 1 features 3 1 Flash PEROM 3 2 functional block diagram 3 3 installation procedure 1 2 interconnection diagram 1 4 memory 3 2 power connection 1 4 Product Information 1 1 SRAM 3 2 User s Manual 1 1 E Echo Code D 31 Echo Program D 31 Enhanced Synchronous Serial Port 0 ESSIO 3 13 Enhanced Synchronous Serial Port 1 ESSI1 3 14 ESSI Pin Definition D 4 ESSI Port Registers D 4 ESSI Ports Background D 3 ESSI ports enabling interrupts D 23 ESSI Registers D 5 ESSI initializing and interfacing D 12 ESSI receive data interrupt D 25 ES
62. AA1926 Figure 1 2 Connecting the DSP56303EVM Cables Use the following steps to complete cable connections 1 Connect the DB9P end of the RS 232 interface cable to the RS 232 port connection on the PC 2 Connect the DB9S end of the cable to P2 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 the external 7 9 V power supply is not supplied with power 4 Connect the 2 1 mm output power plug into P3 shown in Figure 1 1 on the DSP56303EVM board 5 Apply power to the power supply The green power LED lights up when power is correctly applied Motorola Quick Start Guide 1 5 Installation Procedure 1 6 DSP56303EVM User s Manual Motorola Chapter 2 Example Test Program This section contains an example that illustrates how to develop a very simple program for the DSP56303 This example is for users with 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 verify the operation of programs Figure 2 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 on the
63. ASE 1 transmit right jmp echo loop echo After receiving the left and right channels the data is quickly divided by two Then the left and right channels are added to the time delayed samples which were stored on the echo buffer The magnitude is reduced by two and the echo buffer is updated with the newest output sample The left and right processed channels are then sent to the transmit buffers where it is sent to the ESSI port and eventually to the CODEC The procedures loop infinitely until manually stopped Example D 24 combines all the separate pieces of the echo code into an application that performs the time delayed echo Motorola DSP56303EVM User s Manual D 34 nolist include include include include list Example Application Example D 24 Application of Echo Code e KKKKKKKKK KK KK KK KK KK KK AAA KK A AAA KA AAA A AAA AAA A AAA KK KK KK KK KKKKKKKKK ioequ asm intequ asm ada equ asm vectors asm Cckckckok ck ck ck ck Ck Ck Kok Ck kk CIC CCS CIS CSI I I M MA M A x M Buffer for talking to the CS4218 006 x M PCTL org x S0 RX_BUFF_BASE equ DN data 12 ds 1 RX data 3 4 ds IX BUFF BASE equ e TX data 12 ds 1 TX data 3 4 ds RX PTR ds TX PTR ds CTRL WD 12 equ CTRL WD 34 equ org p 100 START main movep 040 ori 3 mr movec 0 sp move 0 omr move S40 r7 move 1 m7 jsr ada init move 50400 14 move SO3FF m4 clr a rep SO3FF move a l
64. COMMENT ES This is a multiple line comment Any number of lines can be placed between th two delimiters C 3 8 DC Define Constant lt label gt DC lt arg gt lt arg gt lt arg gt 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 is filled with zeros If the DC directive is used in L memory the arguments are evaluated and stored as long word quantities Otherwise an error occurs if the evaluated argument value is too large to represent in a single DSP word lt label gt if present is 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 e Single character strings are stored in a word whose lower seven bits represent the ASCII value of the character C 14 DSP56303EVM User s Manual Motorola Assembler Directives Example C 27 Single Character String Definition ER 000052 Multiple charac
65. CPU Pe es C 13 CIT COMMENT Start Comment Lines C 14 C 3 8 DE Defin Constat oda aO E eins ERE eS C me ba da bos C 14 C39 DCB Define Constant Byte o ee os esed yp HR o UR eo CCS C 15 C 3 10 DEFINE Define Substitution String C 16 CSL DS Dee Streets e a a do ea do da nie C 17 34 12 DSM Define Modulo Storage xicas Sog C 17 C 3 13 DSR Define Reverse Carry Storage C 18 C 3 14 DUP Duplicate Sequence of Source Lines C 18 C 3 15 DUPA Duplicate Sequence With Arguments C 19 C 3 16 DUPC Duplicate Sequence With Characters C 20 C 3 17 DUPE Duplicate sequence LEE ciao io iia C 21 C 3 18 END End of Source Propramy ad C 22 C3 19 YENDBUP End Butter ie AR C 23 C 3 20 ENDIF End of Conditional Assembly C 23 C321 ENDM End ot Macro Definitlon s is a HE CORR C 23 Motorola Table of Contents ix C322 ENDSEC End Section os rta ia e ted eo ee ae aiii C 24 C323 EQU Equate Symbol to a Values cee EE C 24 C3 24 EE CEC Matro edsa a o ds re C 25 23 25 FAIL Programmer Generated ElTOF odia da aa C 25 C 3 26 FORCE Set Operand Forcing Mode C 26 C 3 27 GLOBAL Global Section Symbol Declaration C 26 C 3 28 GSET Set Global Symbol to a Value s a duy vate set es C 26 C 3 29 HIMEM Set High Memory Bounds
66. 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 causes a warning message to be output by the assembler The total warning count is incremented as with any other warning The WARN directive is C 52 DSP56303EVM User s Manual Motorola Assembler Directives 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 See also FAIL MSG Example C 79 WARN Directive WARN parameter too large 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 appea
67. ER The steps needed to perform these procedures are as follows Clear transmit underrun bit Save necessary context Load Transmit buffer pointer Move Transmit buffer data to transmit register Update Transmit Buffer pointer e aor S O ET Restore context Example D 16 illustrates the procedures to service this interrupt Motorola Codec Programming Tutorial D 27 Phase III Data Transferring Mechanism Example D 16 ESSI Transmit Data with Exception Status Interrupt Service transmit data with exception status interrupt service routine ssi txe isr Clear underrun bit bclr 4 x M_SSISRO M SSISRO pointers to status register Save Context move FO x2 CT Save r0 to the stack move mO x r7 Save m0 to the stack move 1 m0 Modulus 2 buffer Load transmit pointer to transmit buffer move x TX_PTR r0 Load the pointer to the tx buffer nop delay Move Transmit buffer data to transmit register movep x r0 x M TX00 SSI transfer data register Update transmit buffer pointer move rO x TX DIR Update tx buffer pointer Restore Context move x r7 m0 Restore m0 move x r7 r0 Restore r0 PEL D 10 6 ESSI Transmit Last Slot Interrupt The interrupt occurs when the following properties are true e The transmit last slot interrupt is turned on CRB 20 e The last time slot begins The use of the transm
68. Example Programming AARO 3 4 3 3 2 Hass e a alo Lc A e id a LT 3 6 3 3 2 1 Flash Connections AI AA AR CREASES 3 6 Ee Programming for Stand Alone Operation 3 6 E E A A E AN 3 7 3 4 1 Codec Analog Input Output E e Ue tarte ER teas 3 8 3 4 2 Codec Digital Interface sran Grut eit beet deett E ee etd 3 8 2 Command ony erie aus as ies eta a At ef tide om s e nb cs nee ra AES 3 10 3 6 Off Board Interfaces oos co AA NE ERN AAA 3 12 3 6 1 Serial Communication Interface Port SCI 3 12 3 6 2 Enhanced Synchronous Serial Port 0 ESSI0 3 13 3 6 3 Enhanced Synchronous Serial Port 1 ESSI1 3 14 3 6 4 H st Port OS 14a cd ib Sor Cette did num era DER EET 3 14 3 6 5 Expansion Bus Control A seas aS Te E xS ee Maths 3 15 31 Mode Select ye ARANA 3 15 Appendix A DSP56303EVM Schematics Appendix B DSP56303EVM Parts List ByE Parts Listings vote a a o o ps A epa B 1 Appendix C Motorola Assembler Notes Col CInttOduetoH AA C 1 C 2 Assembler Significant Characters 4 ess sas s ence XX Hoa ee e i pint C 1 C 2 1 Comment Delimiter Characters 2 C 1 C22 Unreported Comment Delimiter Characters C 2 C23 V Line Continuation or Macro Argument Concatenation Character C 2 viii DSP56303EVM User s Manual Motorola C 2 3 1 Line OME ALOU AA nta ag do C 2 C232 Macro Argument Concatenati
69. 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 2 16 DSP56303EVM User s Manual Motorola Introduction to the Debugger Software 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 2 5 Introduction to the Debugger Software This section briefly introduces the Domain Technologies debugger giving only the details required to work through this example For full details on the Debugger and an informative tutorial consult 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 CD ROM and can be installed following the on line instructions If you are running Windows95 or WindowsNT the software installer will be launched automatically when you insert the CD into your drive To invoke the Debugger double click on the icon labelled evm30xw in the EVM5630x program group created when the Debugger was installed The Debugger display is similar to that shown in Figure 2 2 the screen is divided into four windows the command window the data window the unassembly window and the registers window The command window is t
70. L WD 34 equ NO LEFT GAIN NO RIGHT GAIN Note The CS4218 codec data sheet reverses the bit order of the control information For instance bit 1 should be the mask interrupt instead of bit 30 However since most of the work done with the ESSI ports and codec is done using MSB first Table D 8 was modified to reverse the bit order from the codec data sheet to simplify control information programming Note The Evaluation modules used in this document are designed to select line 2 of right and left inputs Therefore bits 17 Left Input Select and bits 16 Right Input Select should be configured to select LIN 2 1 when using the DSP5630xEVM evaluation modules Motorola Codec Programming Tutorial D 11 Phase II Initializing and Interfacing the ESSI and CODEC Ports D 9 Phasell Initializing and Interfacing the ESSI and CODEC Ports After defining certain constants for the codec and the ESSI the next step is to initialize the ESSI and codec interface The initialization procedure involves first initializing the ESSI ports which includes resetting the ESSI ports modifying ESSI control registers and configuring ESSI GPIO functionality Second the codec must also be initialized which entails resetting the codec and sending in codec control information In other words the following general steps need to be performed Reset ESSI ports Modify ESSI control registers Configure ESSI or GPIO functionality Reset codec Modify codec
71. Order this document by DSP56303EVMUM D Rev 3 2 11 98 DSP56303EVM User s Manual Motorola Incorporated e 8 Semiconductor Products Sector TN 6501 William Cannon Drive West AA MOTOROLA Austin TX 78735 8598 OMOTOROLA INC 1998 All rights reserved This document contains information on a new product Specifications and information herein are subject to change without notice Motorola reserves the right to make changes without further notice to any products herein to improve reliability function or design Motorola does not assume any liability arising out of the application or use of any product or circuit described herein neither does it 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 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
72. P BLANK BOTTOM lt PAGE LENGTH 10 BLANK LEFT PAGE WIDTH Note See also LSTCOL Example C 65 PAGE Directive PAGE 18278 Set width to 132 3 line top bottom margins PAGE Page eject C 3 45 PMACRO Purge Macro Definition PMACRO symbol symbol symbol The specified macro definition is purged from the macro table allowing the macro table space to be reclaimed Motorola Motorola Assembler Notes C 45 Assembler Directives Note A label is not allowed with this directive See also MACRO Example C 66 PMACRO Directive PMACRO MAC1 MAC2 This statement would cause the macros named MAC1 and MAC to be purged C 3 46 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 exp is a byte expression and string 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 is 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 b
73. PT 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 C 22 DSP56303EVM User s Manual Motorola Assembler Directives program lt expression gt may be absolute or relocatable but must have a memory space attribute of Program or None The END directive cannot be used in a macro expansion Note A label is not allowed with this directive Example C 39 END Directive 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 See also BUFFER Example C 40 ENDBUF Directive ORG X 100 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 d
74. SCSREG Directive eoo yao ES eo 4 CRI EN Meo PESE C 48 C 72 SECTION DIFeCU NE sdeod tor ah sedo ied DE b asd A P Ss C 51 C 73 SET DI CCIVE 2 ate oes no bU vob vel eee UE ic ES C 51 C 74 S TIIDEE Direct yes d sii echt ebur ot edet elem e ao eA I e cde ot AG C 51 C 75 SX IVIOBI s isst equ coe op eae ST tae E p Nob areis C 52 C 76 TABSJDIIGCUYE s cae ES wd O54 esee sre Vb ess C 52 C 77 TETIZEOIDHOGUVE a EEN A b My ew Rens C 52 C 78 UNDER DIICOUVE v Debs ehh mr bee ewe ed SIC Maret rd C 52 C 79 WARN esi cootra cv aet qx I tpe ear qe i Ti eee C 53 C 80 XDEE DITGCU NO oe aces CE HEURE SERO ese aieo pte d C 53 C 81 AREE DIFGCUYe soc ee Ro ED S etes need ad odes C 54 C 82 BREAK Statements osea ood etc ome a Qo wa sate Canty ed had C 56 C 83 CONTINUE Statement soutient ANS uns in bande eles C 56 C 84 FOR Statement 3 y de oem or acta ent o song sa gcc alg ences Ce tie eae C 57 C 85 STE Statement ero e pe S a p e noeh a M Vtt ecu obser C 57 C 86 LOOP Statement 214424 m E ANS A PE Lac wake ed oo Mak ud AL C 58 C 87 REPEAT SOOIEIIEDE seca eo eorom va so da Sepe d C 58 C 88 WHILE Sitemap ub ER Eben CO EDU Ades C 59 C 89 Condition Code Expression EEN file NN C 60 D 1 Setting Up Transmit and Receive Buffers and Pointers D 9 D 2 Setting Codec Control Information D 11 Motorola List of Examples xix D 3 ESSI Port Reset Procedure c cen a A ee as e D 12 D 4 Setting Control Registers for the ESSIO Port
75. SI Codec Pin Setup D 8 ESSI GPIO pins D 4 ESSIO 3 7 ESSI 3 7 example assembling the 2 12 example program 2 3 Expansion Bus Control 3 15 Expression address C 37 compound C 61 condition code C 59 formatting C 61 operand comparison C 60 radix C 46 simple C 59 External Access Type Bits BAT 1 0 3 5 F field comment 2 3 data transfer 2 3 label 2 2 operand 2 3 operation 2 2 X data transfer 2 3 Y data transfer 2 3 File include C 29 listing C 38 Flash 3 2 Flash Address Pins A 0 16 3 6 Flash Chip Enable Pin CE 3 6 Flash Data Pins I O 0 7 3 6 Flash Output Enable Pin OE 3 6 Flash PEROM 3 2 3 6 connections 3 6 stand alone operation 3 6 Flash Write Enable Pin WE 3 6 format assembler command 2 5 source statement 2 2 Function C 6 G GPIO pins configuration D 15 GPIO Registers D 5 GS71024T 10 3 3 H headphones 1 2 Host Address Pin HA2 3 10 host PC 3 10 Host PC Data Terminal Ready Pin DTR 3 11 Host PC Receive Data Pin RD 3 11 host PC requirements 1 2 Host PC Transmit Data Pin TD 3 11 Host Port HI08 3 14 l Include file C 29 J J1 1 3 J4 1 3 3 7 J5 1 3 3 7 J6 3 12 J7 3 7 J8 1 3 3 11 J9 3 3 3 7 JP4 Jumper Block ESSI1 D 8 Motorola Index Index xxxix JP5 Jumper Block ESSIO D 7 JTAG 3 10 K kit contents 1 1 L Label local C 38 C 41 label field 2 3 LED red 3 10 Left Channel Output Pin LOUT 3 8 Line continuation C 2 linker 2 1 2 12 directives
76. 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 Note The DO keyword is optional Example C 84 FOR Statement FOR X CNT 0 TO Y targ 2 114 loop on X CNT ENDF C 4 2 4 IF Statement IF expression THEN stmtlist ELSE stmtlist ENDI If expression is true execute lt stmtlist gt following 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 C 85 IF Statement IF EQ zero bit set ENDI Motorola Motorola Assembler Notes C 57 Structured Control Statements 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 ad
77. User s Manual Motorola Assembling the Program 2 2 3 2 Assembly Control The directives used for assembly control are as follows 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 Programmer generated warning 2 2 3 3 Symbol Definition The directives used to control symbol definition are as follows 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 Motorola Example Test Program 2 9 Assembling the Program 2 2 3 4 Data Definition Storage Allocation The directives to control constant data definition and storage allocation are as follows BADDR Set buffer address BSB Block storage bit reverse BSC Block storage of constant BSM Blo
78. VE R REG2 R REGI MOVE X0 R REG2 ENDM C 3 39 MODE Change Relocation Mode MODE lt ABS OLUTE REL ATIVE gt The MODE directive causes the assembler to change to the designated operational mode This 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 is 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 See also ORG Example C 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 causes a message to be output by the assembler The error and warning counts are not 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 intervening white space can be specified optionally to describe the nature of the message Note A label is not allowed with this directive See also FAIL WARN Example C 61 MSG Directive MSG Generating sin
79. VM Parts List Continued Designator Manufacturer Part Number Description Y1 MMD MC100CA 12 288MHZ 12 288 MHz Oscillator Y2 ECS OECS 196 6 3 C3X1A 19 6608 MHz 153 6 kHz Oscillator SW1 SW2 SW3 Panasonic EVQ QS205K 6 mm Switch P1 P2 Mouser 152 3409 DB 9 Female Connector P3 Switchcraft RAPC 722 2 1 mm DC Power Jack P4 P5 P6 Switchcraft 35RAPC4BHN2 3 5 mm Miniature Stereo Jack J1 Robinson Nugent NSH 8DB S2 TG Header 8 pin double row J2 Robinson Nugent NSH 16DB S2 TG Header 16 pin double row J3 Robinson Nugent NSH 20DB S2 TG Header 20 pin double row J4 J5 Robinson Nugent NSH 12DB S2 TG Header 12 pin double row J6 Robinson Nugent NHS 14DB S2 TG Header 14 pin double row J7 J9 Robinson Nugent NSH 6SB S2 TG Header 6 pin double row J8 Robinson Nugent NSH 2SB S2 TG Header 2 pin single row C99 C120 C121 Panasonic PCS1106CT 10 uF Capacitor 6 3 V dc C28 C29 C30 C31 C34 Murata GRM42 6Y5V105Z025BL 1 0 uF Capacitor 25 V C124 C126 dc C9 C12 C13 C14 C15 C17 Murata GRM40 X7R104K025BL 0 1 uF Capacitor C18 C35 C37 C50 C51 C52 C53 C54 C61 C62 C64 C79 C80 C96 C101 C104 C105 C106 C110 C122 C123 C125 C16 C40 C55 C56 C57 Murata GRM40 X7R103K050BL 0 01 uF Capacitor C58 C60 C65 C67 C68 C102 C103 C107 C108 C109 B 2 DSP56303EVM User s Manual Motorola Parts Listing Table B 1 DSP56303EVM Parts List Continued
80. XITM Exit macro ENDIF ENDM C 3 25 FAIL Programmer Generated Error FAIL lt str gt lt exp gt lt str gt lt exp gt lt str gt lt exp gt The FAIL directive will cause an error message to be output by the assembler The total error count is incremented as with any other error The FAIL directive is normally used in conjunction with conditional assembly 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 See also MSG WARN Motorola Motorola Assembler Notes C 25 Assembler Directives Example C 46 FAIL Directive FAIL Parameter out of range C 3 26 FORCE Set Operand Forcing Mode FORCE SHORT LONG NONE The FORCE directive causes the 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 See also lt gt lt gt Example C 47 FORCE Direc
81. a Delayed Sample echo D 31 Motorola List of Figures XV xvi DSP56303EVM User s Manual Motorola List of Examples 2 1 Example Source EEN 2 2 2 2 Simple DSP56303EVM Code Example 2 4 C 1 Example of Comment Delito C 1 C 2 Example of Unreported Comment Delimiter C 2 C 3 Example of Line Continuation Character C 2 C 4 Example of Macro Concatenation C 3 C 5 Example of Use of Return Value Character C 3 C 6 Example of Return Hex Value Symbol Character C 4 C 7 Example of Local Label Override Character C 4 C 8 Example of a Macro String Delimiter Character C 5 C 9 Example of a Quoted String DEFINE Expression C 6 C 10 Example of a Function Delimiter Character C 6 C 11 Example of a Location Counter Substitution C 6 C 12 Example of a String Concatenation Operator C 6 C 13 Example of a Substring Delimiter C 7 C 14 Example of an I O Short Addressing Mode Force Operator C 7 C 15 Example of a Short Addressing Mode Force Operator C 8 C 16 Example of a Long Addressing Mode Force Operator C 8 C 17 Example of Immediate Addressing Mode C 9 C 18 Example of Imme
82. ace A semicolon on a line following white space makes the rest of the line a comment Example dspink Fopts cmd This example invokes the linker and takes command line options and input filenames from the command file opts cmd Motorola Example Test Program 2 13 Linker Options Table 2 2 Linker Options Continued Option Description 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 dspink B Gmyprog cin 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 the I option is given the linker combines the input files into a single relocatable object file suitable for reprocessing by the linker No absolute addresses are assigned and no errors are issued for unresolved external references Note that the B option must be used when performing incremental linking in order to give an explicit name to the output file If the filename is allowed to default it can overwrite an input file Example dspink I Bfilter cin main cln fft cln fio cln Combines the files main cln fft cln and fio cln to produce the relocatable object file filter cln L lt library gt The linker ordinarily processes a list of input files that each contain a single relocatab
83. al C 30 C 49 nested C 40 static C 38 C 49 Serial Clock Pin SCKO 3 10 Serial Communication Interface Port SCI 3 12 Serial Control Pin 0 SCOO 3 10 Serial Control Pin 0 SC10 3 10 Serial Control Pin 1 SCO1 3 10 Serial Control Pin 1 SC11 3 10 Motorola Index Index xli Serial Control Pin 2 SC02 3 10 Y Serial Control Pin 2 SC12 3 10 serial interface 3 10 Y data transfer field 2 3 Serial Port Clock Pin SCLK 3 10 Y Space Enable Bit BYEN 3 6 Serial Port Data In Pin SDIN 3 10 Serial Port Data Out Pin SDOUT 3 10 Serial Receive Data Pin SRDO 3 10 Serial Transmit Data Pin STDO 3 10 Source file end C 22 source statement format 2 2 SRAM 3 2 3 3 connections 3 3 SRAM Address Pins A 0 14 3 4 SRAM Chip Enable Pin E 3 4 SRAM Doata Pins I0 0 23 3 4 SRAM memory map 3 4 SRAM Output Enable Pin OE 3 4 SRAM Write Enable Pin WE 3 4 stand alone operation 3 6 Stereo Headphones 3 8 Stereo Input 3 8 Stereo Output 3 8 String concatenation C 6 C 7 delimiter C 5 packed C 40 Symbol case C 38 cross reference C 37 equate C 24 C 37 global C 38 listing C 40 set C 26 C 51 undefined C 41 T Tutorial codec programming D 1 U Unified Memory Map 3 4 W Warning C 41 Write Enable Pin WR 3 4 3 6 X X data transfer field 2 3 X Space Enable Bit BXEN 3 6 Index xlii DSP56303EVM User s Manual Motorola Quick Start Guide Example Test Program DSP56303EVM Technical Summary DSP56303EVM Schemat
84. an be used to change the radix of the selected window Other buttons appear when other windows are selected and they function as described in the Debug 56K Manual which is contained in the Domain Technologies CD ROM 2 18 DSP56303EVM User s Manual Motorola Running the Program 2 6 Running the Program To load the example program into the Debugger click in the command window and type load example The instruction at line 33 is highlighted in the unassembly window because this is the first instruction to be executed But before executing the program verify that the values expected in data memory are there To do this type display x 0 and display y 0 The data is displayed in the data window To step through the program type step at the command window prompt For a shortcut click on the step button or 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 press return As you step through the code notice that the registers in the registers window are changed by the instructions After each cycle any register that has been changed is highlighted Once you have stepped through the program ensure that the program has executed correctly by checking that the result in accumulator a is FE 9F2051 6DFCC2 Stepping through the program like this is good for short programs but it is impractical for large complex programs The way to debug large programs i
85. an explicit filename must be given because if the linker follows the default action it can overwrite one of the input files The B option is specified only once If the file named in the B option already exists it is overwritten Example dspink Bfilter cld main cln fft cln fio cln Links the files main cln fft cln and fio cln together to produce the absolute executable file filter cld EA lt errfil gt or Allows the standard error output file to be reassigned on hosts that do not support error EW lt errfil gt output redirection from the command line lt errfil gt must be present as an argument but it 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 is overwritten Example dspink EWerrors myprog cin Redirects the standard error output to the file errors If the file already exists it is overwritten F lt argfil gt Indicates that the linker should read command line input from lt argfil gt which can 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 white sp
86. ation using the example code referenced in this document refer to Table D 6 and Table D 7 for the correct jumper settings for the DSP5630xEVM boards Please refer to Figure D 2 which shows the pin set up between the DSP s ESSI ports and the codec Table D 6 JP5 Jumper Block ESSIO JP5 ESSI Pin Codec Pin 1 2 SCKO SCLK 3 4 SC00 RESET 5 6 STDO SDIN 7 8 SRDO SDOUT 9 10 SC01 11 12 SC02 SSYNC Motorola Codec Programming Tutorial D 7 Programming the CS4218 Codec Table D 7 JP4 Jumper Block ESSI1 JP4 ESSI pin Codec pin 1 2 SCK1 3 4 SC10 CCS 5 6 STD1 7 8 SRD1 9 10 SC11 CDIN 11 12 SC12 CCLK Motorola DSP slave CS4218 CODEC master SDIN SDOUT SCLK RESET FSYNC MF4 CCS MF3 CCLK MF2 CDIN Figure D 2 ESSI Codec Pin Setup For more information concerning the pin layouts and jumper settings between the codec and DSP please consult the DSP user s manual for the respective evaluation modules D 7 Programming the CS4218 Codec In order for the CS4218 codec device to work properly with the Motorola DSPs certain procedures must be followed These procedures can be broken down into three major phases Each of the phases plays an essential role in properly setting up constants Motorola DSP56303EVM User s Manual D 8 Phase 1 Setting up Constants interfacing and initializing and finally using the CS4218 codec with the Mo
87. atus Interrupt The interrupt occurs when the following properties are true e The receive exception interrupt is turned on CRB 23 e The receive data register is full e A receiver overrun error occurred The interrupt is triggered by the receiver overrun bit being set When the interrupt is serviced the programmer will need to first clear the receiver overrun bit SSISRO 5 and Motorola DSP56303EVM User s Manual D 24 Phase III Data Transferring Mechanism then receive the Receive BUFFER The following steps are needed to perform these Load receive buffer pointer Move received data to receive buffer Update receive buffer pointer procedures Clear receive overrun bit 2 Save necessary context B 4 5 6 Restore context Example D 13 illustrates the procedures to service this interrupt ESSI Example D 13 ESSI Exception Status Interrupt Service Receive Data with Exception Interrupt Service Routine ssi rxe isr bclr move move move move nop movep move move move rti Clear receives overrun bit 5 x M_SSISRO M SSISRO refers to status register explicitly clears overrun flag r0 x 17 mO x 1 7 1 m0 Ne Ne Ne Ne Save Context Save r0 to the stack Save m0 to the stack Modulus 2 buffer x RX PTR rO Load the pointer to the rx buffer Delay x M_RX0 x r0 Move received data to receive buffer
88. c x M IPRP set interrupt priority level for ESSIO bo 3 andi FS fc mr enable interrupts movep 003e x M PCRC enable ESSI mode for bit 5 bit 4 bit 3 bit 2 bit 1 enable GPIO mode for bit O movep 0000 x M_PCRD enable GPIO mode for qub 2 Dit l pit g Other bits are don t care D 10 Phase Ill Data Transferring Mechanism There are basically three different methods for transferring data from the codec to and from the ESSI port They are Polling DMA and Interrupts In this document however only the use of interrupts will be demonstrated D 10 1 Interrupts and Interrupt Service Routines The ESSI device has six interrupts available They are the ESSI receive data with exception status interrupt ESSI receive data interrupt ESSI receive last slot interrupt the ESSI transmit data with exception status interrupt the ESSI transmit last slot interrupt and the ESSI transmit data interrupt Each interrupt is triggered based on certain status bits and can be cleared by performing certain actions in an interrupt service routine In the following sections this document will explain what specific status bits trigger the interrupts and what must be done in order to clear the interrupts For more information concerning the properties and functionality of each type of interrupt and for setting up the interrupt service routines please refer to the DSP5630xEVM s user manual D 10 2 ESSI Receive Data with Exception St
89. case in symbol section and macro names This directive must be issued before any symbols sections or macros are defined Inhibit source listing This option will stop the assembler from producing a source listing 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 Increment load counter 1f 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 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 must be specified for this option to take effect 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 default reset Print macro calls default reset Print macro definitions C 38 DSP56303EVM User s Manual Motorola Assembler Directives MEX Print macro expansions MI Scan MACLIB directory paths for include files The assembler ordinarily look
90. cation Counter Substitution ORG X 5100 XBASE EQU 520 XBASE 120 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 C 12 Example of a String Concatenation Operator ABC DEF ABCDEF C 6 DSP56303EVM User s Manual Motorola Assembler Significant Characters 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 C 13 Example of a Substring Delimiter DEFINE ID DSP56000 3 5 ID 56000 C 2 12 lt lt HO 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
91. ck storage modulo BUFFER Start buffer DC Define constant DCB Define constant byte DS Define storage DSM Define modulo storage DSR Define reverse carry storage ENDBUF End buffer 2 2 3 5 Listing Control and Options The directives to control the output listing are as follows 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 2 10 DSP56303EVM User s Manual Motorola Assembling the Program 2 2 3 6 Object File Control The directives for control of the object file are as follows COBJ Comment object code IDENT Object code identification record SYMOBJ Write symbol information to object file 2 2 3 7 Macros and Conditional Assembly The directives for macros and conditional assembly are as follows 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 2 2 3 8 Structured Programming The directives for structured programming are as follows BREAK Exit from structured loop construct CONTINUE Continue next iteration o
92. d with the Motorola Assembler e Special characters significant to the assembler e Assembler directives Structure control statements C 2 Assembler Significant Characters Several one and two character sequences are significant to the assembler The following subsections define these characters and their use C 2 1 Comment Delimiter Character Any number of characters preceded by a semicolon but not part of a literal string is considered a comment Comments are not significant to the assembler but you can use them to document the source program Comments are reproduced in the assembler output listing Comments are normally preserved in macro definitions but this option can be turned off See the OPT directive Comments can occupy an entire line or can be placed after the last assembler significant field in a source statement A comment starting in the first column of the source file is aligned with the label field in the listing file Otherwise the comment is shifted right and aligned with the comment field in the listing file Example C 1 Example of Comment Delimiter THIS COMMENT BEGINS IN COLUMN 1 OF THE SOURCE FILE LOOP JSR COMPUTE THIS IS A TRAILING COMMENT IHESE TWO COMMENTS ARE PRECEDED BY A TAB IN THE SOURCE FILE Motorola Motorola Assembler Notes C 1 Assembler Significant Characters C 2 2 Unreported Comment Delimiter Characters Un
93. dec has many critical components needing to interface with the outside world The codec will perform analog to digital A D and digital to analog D A conversion filtering and level setting A sample program is included with this document to demonstrate the use of the CS4218 codec with a Motorola DSP The program explains the steps necessary to interface the Motorola DSP with the CS4218 codec More specifically the sample program explains in detail the use of the enhanced synchronous serial interface ports ESSI and how the DSP s ESSI ports interface initialize and transport data between the DSP and CS4218 codec The following source code files are provided to the programmer to assist in programming the codec The following source code files can be found on Motorola s DSP website on the Internet at www mot com SPS DSP documentation DSP56300 html e oequ asm Contains important I O equates for the DSP5630xEVM modules e ntequ asm Contains interrupt equates for the DSP5630x EVM modules e Ada equ asm Contains equates used to initialize the codec Ada Init asm Contains initialization code for the ESSI and codec e Vectors asm Contains the vector table for the DSP5630xEVM modules e Echo asm Example of codec programming Motorola Codec Programming Tutorial D 1 Codec Background Throughout this appendix the sample code used to demonstrate the use of the codec references equates found in Ada_equ asm Ioequ asm a
94. des quick installation and test information The remaining sections of this manual give details on the DSP56303EVM design and operation 1 1 Equipment The following subsections list the equipment required to use the DSP56303 evaluation module DSP56303EVM some of which is supplied with the module and some of which must be supplied by the user 1 1 1 What You Get with the DSP56303EVM The following material comes with the DSP56303EVM DSP56303 Evaluation Module board DSP56303EVM Product Brief DSP56303EVM User s Manual this document DSP56303 Product Specifications Revision 1 03 DSP56303 Chip Errata Crystal Semiconductor CS4218 16 bit Multimedia Audio Codec Data Sheet Technical Documentation CD ROM including the following documents DSP56300 Family Manual DSP56303 User s Manual DSP56303 Technical Data Sheet The required software GUI Debugger from Domain Technologies 1 CD Assembler linker software from Motorola 1 CD Motorola Quick Start Guide 1 1 Installation Procedure 1 1 2 What You Need to Supply The user must provide the following 1 2 PC Pentium 90MHz or higher with Windows95 or NT4 Minimum of 16Mbytes of memory with Windows95 Minimum of 32Mbytes of memory with Windows NT 3 inch high density diskette drive CD ROM drive Hard drive with 20 Mbytes of free disk space Mouse RS 232 serial port supporting 9 600 115 200 bit per second
95. diate Short Addressing Mode Force Operator C 9 C 19 Example of an Immediate Long Addressing Mode Operator C 10 C 20 Example BADDR DEENEN t C 10 C 21 Butter Kee gt inh ada COE ide SR os eb be doces C 11 C 22 Block Storage of Constant Directive C 12 C 23 Block Storage Modulo Directive C 12 C 24 Butter DIT CONE wire de ee eO te pn c em cu el DU AC e tet C 13 C 25 COBM Directive tii ARE EC eC eu wp ate Red C 13 C 26 COMMENT Directive Eege o DO e Au C 14 C 27 Single Character String Definition C 15 Motorola List of Examples xvii C 28 Multiple Character String Definition C 15 C 29 DEDICA A arat tots pis C 15 C 30 DEB Directive sea Lena Mrd esa dicio Mie ee kb eet Las O Ee ee ke C 16 C 31 DEEFTINE DITE CUE eto aO ERAT Ee e ina C 16 C 32 DS Directivos estet ea Mae sa da e en da tec C 17 C 33 DSM Directive cut oo hice 558 Rae aS E e ha Se s RN C 17 C 34 RH CUE eno Io pee a ii pactis C 18 C 35 DUP DITeCUVe ti EEN C 19 C 36 DURA Directive SS ot ca ty eas ek E IHESU ed OR ee unie Tee C 20 C 37 POW WEE C 21 C 38 DURE DIE CUE a pea NS ES A INS PORE C 22 C 39 END Directive viviste edo LS eh CHO Rd C 23 C 40 ENDBUF Directive ssl Cosa bene veed Xa Eo taf Ee e C 23 C 41 ENDIF Directives LR Mount dd ee atus oe du C MS ate d C 23 C 42 ENDM Directive ue eto brote eee en aote e ic ted Se C 24 C 43 ENDSEC DIICCUVOS exc
96. divisible 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 GLOB AL 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 If the GLOBAL qualifier follows the section name 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 section name in the SECTION directive then all code and data defined in the section until the next ENDSEC directive are relocated in terms of the immediately enclosing section T
97. dressing 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 restrictions etc One or more CONTINUE directives inside a LOOP construct generate a NOP instruction just before the loop address Example C 86 LOOP Statement LOOP LPCNT hardware loop LPCNT times ENDL C 4 2 6 REPEAT Statement REPEAT lt stmtlist gt UNTIL lt expression gt lt stmtlist gt is executed repeatedly until lt expression gt is true When expression becomes true advance to the next instruction following UNTIL The lt stmtlist gt is executed at least once even if lt expression gt is true upon entry to the REPEAT loop Example C 87 REPEAT Statement REPEAT UNTIL x r1 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 stmtlist is executed repeatedly When expression evaluates false advance to the C 58 DSP56303EVM User s Manual Motorola Structured Control Statements instruction following the ENDW statement If lt expression gt is false upon entry to the WHILE loop lt stmtlist gt is not executed execution continues after the ENDW directive Note The DO keyword is optional
98. e 0 dictates the codec to function in the master mode and sets the frame size to be 32 bits In essence by setting the codec to operate in the master mode the codec is responsible for sending the serial bit clock and sending frame synchronization pulses to indicate the start and stop of a data frame In addition sub mode zero specifies that each frame consist of two 16 bit words a left channel 16 bit word and a right channel 16 bit word The left and right channels are sent to and from the codec with the most significant bits MSBs first This information will be important in the sections to follow in this appendix These properties apply to both the input data going into the codec SDIN and the output data coming from the codec SDOUT Please refer to Figure D 1 Motorola DSP56303EVM User s Manual D 2 ESSI Ports Background A Frame 32 bits gt SSYNC m m SDOUT TefiChammel Word RightChammel Word SDIN Left Channel Word Right Channel Word 4 16 bits 3 94 16 bits E Figure D 1 Data Format of Codec In the SM4 mode the control information is separated from the data information The control information is thus sent to codec on a different serial interface than the data information The control information consists of a list of attributes that need to be specified in order to dictate certain properties such as level settings Although 31 bits must be set in the control information only
99. e ev be ou rad o led EE 2 4 2 2 Assembling the Prosram ss 2o vov ASA 2 5 2 2 1 Assembler Command Format Memento net 2 5 2 202 Assembler Options au dd aas T A T EN ee das 2 6 2 2 3 Assembler Directives 1s os sec dr Re ee a D Ree X t Geb RR 2 8 2 2 3 1 Assembler Significant Characters ii n 2 8 2 2 3 2 Assembly Control red ech os eyes oe tak p yo Me te EA Ne 2 9 2 2 3 3 Symbol Definiton s 2 verd erene eR Me NEN ENERO EE 2 9 2 2 3 4 Data Definition Storage Allocation 2 10 2 2 3 5 Listing Control and Options 2 10 2 2 3 6 Object Pile Control crear lis Rs 2 11 2 2 9 T Macros and Conditional Assembly 2 11 2 2 3 8 Structured Propano li P e 2 11 2 2 4 Assembling the Example Program 2 12 2 3 Motorola DSP Linkers EEN 2 12 2 4 Linker Opiate la da e ls Need Me 2 13 2 4 1 Linker Directives MEM I P E tas 2 16 Motorola Table of Contents vii 2 5 Introduction to the Debugger Software 2 17 2 6 Running the Program tt p ne ace EE A EROR ERE 2 19 Chapter 3 DSP56303EVM Technical Summary 3 1 DSP56303EVM Description and Features 3 1 3 JSP30305 DESCHDU OD scu xs ar tan Aer Sex eA EX ES AD duds 3 1 Bed MEMO ones vie eret dee eee n qe ex beet set atte en teg d 3 2 3 3 1 AN O O LA Ae aui t AM vA 3 3 3 3 1 1 Se RETTEN 3 3 3 3 1 2
100. e mode Do 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 NOMI default reset Do not scan MACLIB directory paths for include files NOMSW Do not issue warning on memory space incompatibilities NONL default reset Do not display nesting levels on listing Motorola Motorola Assembler Notes C 39 Assembler Directives 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 physical line for printing NOPS Do not pack strings in DC directive Individual bytes in strings are stored one byte per word NORC default reset Do not space comments relatively 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 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
101. e selection for the DSP56303 is made by jumper selections on header J1 Refer to Table 3 14 for header J1 jumper options Motorola DSP56303EVM Technical Summary 3 15 Mode Selector Table 3 14 Boot Mode Selection Options J1 Mode Boot Mode Selected Number D 1 2 C 3 4 B 5 6 A 7 8 8 OPEN JUMP JUMP JUMP Jump to program at 008000 1 OPEN JUMP JUMP OPEN Bootstrap from byte wide memory 2 OPEN JUMP OPEN JUMP Bootstrap from SCI 4 OPEN OPEN JUMP JUMP HIO8 bootstrap in ISA DSP5630X mode 5 OPEN OPEN JUMP OPEN HI08 Bootstrap in HC11 non multiplexed bus mode 6 OPEN OPEN OPEN JUMP H108 Bootstrap in 8051 multiplexed bus mode 7 OPEN OPEN OPEN OPEN HIO8 Bootstrap in MC68302 bus mode 3 16 DSP56303EVM User s Manual Motorola Appendix A DSP56303EVM Schematics Motorola DSP56303EVM Schematics A 1 0 9S4Sa Ly anp a UL Aen LZ jo 4 jeeus euBiseg Sjoo1 sa 8661 OL Jaquianon epsen eieq H NSG 0 95dSa lequin w i ens E0E9SdSA om Y1 30 0N 0922 168 Z1S xv3 E1S9 168 21S 8688 6684 XL unsny JS8M AAG uouue uleiliM 1099 UOISIAIG 19q119SQNS SS8 911M VIOLOLOW yy DI 73 99 99 QNO QNO QN9 an QNO QNS QNS QNS QNS aNd usul SWL 32uo Svi f ZS PTS d tp em A 8 il bk bo Ag E ot 6 lt lt 4834 D
102. e 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 Motorola Example Test Program 2 5 Assembling the Program 2 2 2 Assembler Options Table 2 1 describes the assembler options To avoid ambiguity the option arguments should immediately follow the option letter with no blanks between them Table 2 1 Assembler Options Option Description Puts the assembler into absolute mode and generates 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 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 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 the assembler operates in relative mode and creates a relocatable object cln file If the B option is not specified the assembler does not generate an object file If no lt objfil
103. e tables Motorola Motorola Assembler Notes C 33 Assembler Directives 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 is not disabled until another NOLIST directive is issued Note A label is not allowed with this directive See also LIST OPT Example C 62 NOLIST Directive IF LISTOFF NOLIST Turn the listing off ENDIF C 3 42 OPT Assembler Options OPT option option option comment 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 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 forma
104. ee ES CENE NEP SOM EAS C 24 C 44 EOU Ditech ve is ns ere nn S eue edu V RE wasted eus C 25 C 45 EXITM Dine Clive S iru torres eee tures ese e eee ges C 25 C 46 EAU DITCCDVE S aw esce cl utei voe He clip d RCM are ie C 26 C 47 EORCEDIIGEUVE Suse mon cx pele sory Me nase sp sanz ae es ei C 26 C 48 GLOBAL DITECUVE usd e recette AS C 26 C 49 SET Dieu ees Sot a dt so ule cti dcs cou al eodd C 27 C 50 HIMEM DIEGCUNVO Ld odes ted A e tont tu dte ees C 27 C 51 IDENT Directive 23 ur CR As SE e C 28 C 52 EDITE VES ee EA AA wh en Sonal ne Tear C 29 C 53 INCLUDE Directivas qa wel RETI qm Nes eas C 29 C 54 E KREE o ete oe ex a en LES C 30 C 55 LOCAL DIHCOU YES oes Ded e eS C 30 C 56 LOMEM Directives v stes Cb m Ober Eod dcs C 31 C 57 ESTCOL Directives ek aco ii Ri elc sco Rides y ni I B RU C 31 C 58 NIAC GIB Directives ars Se oh cok vg Gee Xa qve ean oe vt eb tend C 32 C 59 MACRO Directive 6 corns atate o so en n C 33 xviii DSP56303EVM User s Manual Motorola C 60 MODE Directive rata RA fi dete RI C 33 C 61 kr Ee a ay ve en C 33 C 62 KLEES KREE ET C 34 C 63 OPTEN OA C 41 C 64 ORG Directivo m tata bau E REPLIES E EIS C 43 C 65 PAGE Directive e atu Ra se Ries plc is C 45 C 66 PNIACRO Direc Veic or Ree ALS EVI Ee de ed lt C 46 C 67 PRC Vis Dive to Cos ee Cer o A de C 46 C 68 RADIX Directive 5o teet A questi ede b E ai Zee C 47 C 69 BRDIREC TE DIIGOU Ve iy ico ot Eo ARS RE ER LE Ld C 47 C 70 SCSIME DIFCCUVE C oc xcd da NOH COPAS UNE a C 48 C 71
105. een printed before sending out the control string This is so a PRCTL directive can be used 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 is 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 C 67 PRCTL Directive PRCTL S1B E Reset HP LaserJet printer C 3 47 RADIX Change Input Radix for Constants RADIX expression Changes the input base of constants to the result of expression 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 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 Note A label is not allowed with this directive C 46 DSP56303EVM User s Manual Motorola Assembler Directives Example C 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
106. el scope when a structured control statement label is encountered 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 Write symbol information to object file This option is recognized but performs no operation in COFF assemblers 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 Print the unassembled lines skipped due to failure to satisfy the condition of a conditional assembly directive Generate a warning at assembly time for each unresolved external reference This option works only in relocatable mode default reset Print all warning messages 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 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 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 C 63 OPT Directive OPT CEX MEX Turn on DC and macro expansions OPT
107. en in the runtime location counter expression This expression if relative may not refer to another overlay block Note See also MODE Example C 64 ORG Directive ORG P 1000 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 space is implied to be P and the load location counter is assumed to be the same as the runtime location counter Motorola Motorola Assembler Notes C 43 Assembler Directives Example C 64 ORG Directive Continued 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 is used Code generated hereafter is 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 OVLI Y Indicates code is generated for an overlay The runtime memory space is P and the default counter is used as the runtime location counter It is reset to the value of OVL I If the assembler is in absolute mode via the A command line option then OVL1 must be an absolute expression If OVLI is an absolute expression the assembler uses the absolute runtime location counter If OVLI is a relocatable value the assembler uses the relative runtime
108. ence in Loop lt label gt DUPF lt dummy gt lt start gt lt end gt lt increment gt ENDM The block of source statements defined by the DUPF and ENDM directives are 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 is assigned the value of the runtime location counter at the start of the DUPF directive processing Note See also DUP DUPA DUPC ENDM MACRO Motorola Motorola Assembler Notes C 21 Assembler Directives Example C 38 DUPF Directive If input source file contained the following statements DUPF NUM 0 7 MOVE 0 R NUM ENDM then the assembled source listing shows DUPF NUM 0 7 MOVE FO RO MOVE 0 R1 MOVE 0 R2 MOVE 0 R3 MOVE 0 R4 MOVE 0 R5 MOVE 0 R6 MOVE 0 R7 ENDM Note that the lines DUPF NUM 0 7 ENDM are only shown on the source listing if the MD option is enabled The lines MOVE 0 RO MOVE 0 R1 MOVE 0 R2 MOVE 0 R3 MOVE 0 R4 MOVE 0 R5 MOVE 0 R6 MOVE 0 R7 are only shown on the source listing if the MEX option is enabled Note See the O
109. er of two label if present is assigned the value of the runtime location counter after a valid base address has been established Note See also DS DSM Example C 34 DSR Directive ORG X 100 R BUF DSR 8 REVERSE CARRY BUFFER FOR 16 POINT FFT C 3 14 DUP Duplicate Sequence of Source Lines lt label gt DUP lt expression gt ENDM The sequence of source lines between the DUP and ENDM directives is duplicated by the number specified by the integer expression expression can have any memory space attribute If the expression evaluates to a number less than or equal to zero 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 label if present is assigned the value of the runtime location counter at the start of the DUP directive processing Note See also DUPA DUPC DUPF ENDM MACRO C 18 DSP56303EVM User s Manual Motorola Assembler Directives Example C 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
110. erform the following steps 1 Set up registers to send dummy control information 2 Send control words 3 Set up registers to send correct control information 4 Send control words Example D 10 illustrates the procedures Motorola DSP56303EVM User s Manual D 20 Phase Il Initializing and Interfacing the ESSI and CODEC Ports Example D 10 Sending Code Information CTRL WD HI ds CTRL WD LO ds dummy control move 0 xO move X0 x CTRL WD HI move X0 x CTRL WD LO jsr codec control set control move FCTRL_WD_12 x0 move X0 x CTRL WD HI move CTRL WD 34 x0 move x0 x CTRL_WD_LO jsr codec control No Ne Ne Ne Ne Ne Upper Control word Lower Control word send dummy control data recall constant set previously for upper control info set hi control word to constant recall constant set previously for upper control info 16 bit data aligned to bit 23 The control words are sent serially to the CDIN pin of the codec The codec_control subroutine in the previous code performs this action The following is one method of sending in the control words Send MSB value to CDIN Shift left control word Sb SON AU aes Bs en Repeat 16 times pin Clear CCS bit to allow the codec to accept control information Set CCLK bit on codec high Recall Control bits are sent on rising edge of clock Determine whether MSB is 1 or 0
111. es symbols that have not yet been defined The expression also must fall within the range 2 expression lt m where m is the maximum address of the target DSP label if present is assigned the value of the runtime location counter after a valid base address has been established Note See also DS DSR Example C 33 DSM Directive ORG X 5100 M BUF DSM 24 CIRCULAR BUFFER MOD 24 Motorola Motorola Assembler Notes C 17 Assembler Directives C 3 13 DSR Define Reverse Carry Storage lt label 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 directive first advances the runtime location counter to a base address that is a multiple of 2 where ok expression An error is 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 expression can have any memory space attribute The block of memory reserved is not initialized to any given value The result of expression must be an absolute integer greater than zero and cannot contain any forward references symbols that have not yet been defined Because the DSR directive is useful mainly for generating FFT buffers a warning is generated if expression is not a pow
112. f 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 JF Begin IF condition Motorola Example Test Program 2 11 Motorola DSP Linker LOOP Begin hardware loop REPEAT Begin REPEAT loop UNTIL End of REPEAT loop WHILE Begin WHILE loop 2 2 4 Assembling the Example Program The assembler is an MS DOS based program thus to use the assembler you must exit Windows or open an MS DOS Prompt Window To assemble the example program type asm56300 a b l g example asm into the evm30xw directory created by the installation process from Section 2 2 1 Assembler Command Format on page 2 5 This creates two additional files example cld and example lst The example cld file is the absolute object file of the program it is downloaded into the DSP56303 The example lst file is the listing file 1t gives full details of where the program and data are placed in the DSP56303 memory 2 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 assembler generating an absolute executable file which can be downloaded to the DSP56303 The Motorola DSP linker is included on the Motorola Tools CD and can be installed by following the
113. fer Comment 2 2 DSP56303EVM User s Manual Motorola Writing the Program 2 1 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 file is empty and that the line has no label e An alphabetic character as the first character indicates that the line contains a symbol called a label e An underscore as the first character indicates that the label is local 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 only a label is a valid line and assigns the value of the location counter to the label 2 1 1 2 Operation Field The operation field appears after the label field and must be preceded by at least one space or tab Entries in the operation field may be one of three types e Opcode mnemonics that correspond directly to DSP machine instructions Directive special operation codes known to the assembler that control the assembly process Macro call invocation of a previously defined macro that is to be inserted in place of the macro call 2 1 1 3 Operand Field The interpretation of the operand field depends 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
114. 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 any where else in the program or section if SECTION directives are being used The expression may be relative or absolute but cannot include a symbol that is not yet defined no forward references are allowed Note See also SET C 24 DSP56303EVM User s Manual Motorola Assembler Directives Example C 44 EQU Directive A D PORT EQU X 4000 This assigns the value 4000 with a memory space attribute of X to the symbol A_D_PORT COMPUTE EQU QLCV L LCV L is used to refer to the value and memory space attribute of the load location counter This value and memory space attribute is assigned to the symbol COMPUTE C 3 24 EXITM 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 See also DUP DUPA DUPC MACRO Example C 45 EXITM Directive CALC MACRO XVAL YVAL IF XVAL lt 0 FAIL Macro parameter value out of range E
115. g the control information for the codec Note that the control information only needs to be sent when a change is needed to be made to the control parameters In order to reset the codec a 0 value must be sent into the CODEC RESET pin Recall that a global variable was defined called CODEC RESET in this document Thus to reset the codec the CODEC RESET bit located on the Port Data Register C on the ESSI port must be cleared In addition the codec must be notified that control information will be modified Setting the CSS pin to 0 allows for this Furthermore the codec requires a minimum of 50 ms to reset Thus often a delay is programmed into the DSP to allow for the codec to reset Example D 8 summarizes the procedures in code format Example D 8 Code Format Procedures porr CODEC_RESET x M_PDRC assert CODEC_RESET bit 0 on ESSIO PETE CCS x M_PDRD assert CCS bit 0 on ESSII reset delay for codec do 11000 delay loop rep 1000 A delay greater than 50 ms nop _delay_loop Once the codec has been reset the codec control information needs to be sent from the DSP to the codec ports But before the control information can be sent the CODEC_RESET pin must to be turned off set to 1 Please refer to Table D 15 for information concerning the options of each bit pin Example D 9 demonstrates the task of deasserting the codec reset Example D 9 Deasserting Code Reset bset
116. gt is specified the assembler uses the basename filename without extension of the first flename encountered in the source input file list and appends 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 Replaces all occurrences of lt symbol gt with lt string gt in the source files to be assembled Example asm56300 DPOINTS 16 prog asm 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 Allows 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 is overwritten Example asm56300 EWerrors prog asm Redirects the standard output to the file errors If the file already exists it is overwritten F lt argfil gt Indicates that t
117. h the project pathname L lt lstfil gt 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 uses the basename filename without extension of the first filename encountered in the source input file list and appends Ist to the basename The L option is specified only once Example asm56300 L filter asm gauss asm Assembles the files filter asm and gauss asm together to produce a listing file Because no filename is given the output file is named using the basename of the first source file in this case filter and the listing file is called filter Ist M pathname Causes the assembler to look in the directory defined by pathname 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 Uses IBM PC pathname conventions and causes the assembler to look in the fftlib subdirectory of the current directory for a file with the name of the currently invoked macro found in the source file trans asm Causes the assembler to report assembly progress to the standard error output stream 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
118. he assembler should read command line input from lt argfil gt which can be any legal operation system filename including an optional pathname lt argfil gt 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 white space A semicolon on a line following white space makes the rest of the line a comment Example asm56300 Fopts cmd Invokes the assembler and takes the command line options and source filenames from the command file opts cmd 2 6 DSP56303EVM User s Manual Motorola Assembling the Program Table 2 1 Assembler Options Continued Option Description Sends the source file line number information to the object file This option is valid only in conjunction with the B command line option Debuggers can use the generated line number information to provide source level debugging Example asm56300 B Gmyprog asm Assembles the file myprog asm and sends the source file line number information to the resulting object file myprog cln I pathname 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 l project testprog Uses IBM PC pathname conventions and causes the assembler to prefix any include files not found in the current directory wit
119. he 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 section name 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 Motorola Motorola Assembler Notes C 49 Assembler Directives symbols and therefore macros and DEFINE symbols defined in a section can never be accessed globally If global accessibility is desired the macros and DEFINE symbols
120. he window selected which means that key strokes are placed into the command window The data window displays DSP56303 data The unassembly window displays the DSP56303 programs highlighting the next instruction to be executed The registers window shows the contents of the DSP56303 internal registers Motorola Example Test Program 2 17 Introduction to the Debugger Software EVM 563xx COM2 E D A the reset FEDCBA 487327 the DZP looks far 351512 36595856 after a reset SUTATE BASHET start the main pr 134546 344787 3 LE JOFFE begin B 537184 675634 Mr F3ECCD G be abba TIT ZE3 Gale le TE 555818 FFF FF AJA FFFFFF paa Dap FFFFFF AA1791 Figure 2 2 Example Debugger Window Display When the command window is selected as in Figure 2 2 the tool bar at the top of the screen will change and show buttons for the commands used most often in the command window From left to right the commands are eo stop step jump automatic 66 update reset and radix Go runs the DSP56303 from the program counter e Stop stops the DSP56303 e Step executes a single instruction e Jump is similar to the step except that subroutines are treated as one instruction Automatic update turns the automatic screen update mode on so that the DSP56303 is periodically interrupted to update the data and registers windows Reset resets the DSP56303 e Radix c
121. ics DSP56303EVM Parts List Motorola Assembler Notes Codec Programming Tutorial Index Quick Start Guide Example Test Program DSP56303EVM Technical Summary DSP56303EVM Schematics DSP56303EVM Parts List Motorola Assembler Notes Codec Programming Tutorial Index
122. ility bit in the status register is cleared In Figure 3 4 the FSRAM responds to the 64K of X and Y data memory addresses between 040000 and 04FFFF However with the unified memory map accesses to the same external memory location are treated as accesses to the same memory cell A priority mechanism exists among the four AAR control registers AAR3 has the highest priority and AARO had the lowest Bit 14 of the OMR the address priority disable APD bit controls which AA pins are asserted when a selection conflict occurs i e the external address matches the address and the space that is specified in more than one AAR If the APD bit is cleared when a selection conflict occurs only the highest priority AA pin is asserted If the APD bit is set when a selection conflict occurs the lower priority AA pins are asserted in addition to the higher priority AA pin For this example only one AA pin must be asserted AAO Thus the APD bit can be cleared 3 4 DSP56303EVM User s Manual Motorola Memory Memory Map MS 0 SC 0 Program X Data Y Data FFFFFF 77 Internal Memory FF0000 050000 Unified FSRAM 040000 006000 004000 000000 AA1930 Figure 3 4 Example Memory Map with the Unified External Memory Figure 3 5 shows the settings of AARO for this example The external access type bits BATI and BATO are set to O and 1 respectively to denote FSRAM access The address attribute polarity bit BA AP is cleared
123. ing bits must be set Table D 6 and Table D 7 show the bit settings for the Data Direction Registers Table D 13 Data Direction Register C Bit Name Bit position Value binary Other bits 6 23 X don t care STDO 5 X don t care SRDO 4 X don t care SCKO 3 X don t care SCo2 2 X don t care SCO01 1 X don t care SC00 0 1 CODEC RESET is output Table D 14 Data Direction Register D Bit Name Bit position Value binary Other bits 6 23 X don t care STD1 5 X don t care SRD1 4 X don t care SCK1 3 X don t care SC12 2 1 CDIN is output SC11 1 1 CCLK is output SC10 0 1 CCS is output Motorola DSP56303EVM User s Manual D 18 Phase Il Initializing and Interfacing the ESSI and CODEC Ports Example D 7 illustrates the setting of the bits in the Data Direction registers in code form Example D 7 Code Form Settings in Data Direction Registers Data Direction Register C movep 0001 x M PRRC set SCOO CODEC RESET as output Data Direction Register D movep 0007 x M PRRD set SC10 CCS as output Set SCII CCLK as output set SC12 CDIN as output D 9 3 Initialization of the CODEC ports The next step that needs to occur is the process of initializing the codec This initialization process begins with first resetting the codec second waiting for the codec to reset and finally sendin
124. instructions in Section 2 2 1 Assembler Command Format on page 2 5 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 2 12 DSP56303EVM User s Manual Motorola Linker Options 2 4 Linker Options Table 2 2 describes the linker options To avoid ambiguity the option arguments should immediately follow the option letter with no blanks between them Table 2 2 Linker Options Option Description A 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 dspink A myprog cin Links the file myprog cln and optimally aligns any buffers encountered in the input B objfil 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 uses the basename filename without extension of the first filename encountered in the input file list and appends cld to the basename If the I option is present see below
125. irective Note A label is not allowed with this directive See C 3 31 IF Conditional Assembly Directive on page C 28 Example C 41 ENDIF Directive IF REL SAVEPC SET ES Save current program counter ENDIF C 3 21 ENDM End 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 See also DUP DUPA DUPC MACRO Motorola Motorola Assembler Notes C 23 Assembler Directives Example C 42 ENDM Directive SWAP SYM MACRO REG1 REG Swap REG1 REG2 using D4 L as temp MOVE R REG1 D4 L MOVE R REG2 R REG1 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 See also SECTION Example C 43 ENDSEC Directive SECTION COEFF ORG Y 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
126. is the maximum address of the target DSP If a Reverse carry buffer is designated and expression is not a power of two a warning is issued Note A label is not allowed with this directive See also BADDR BSM BSB DSM DSR ENDBUF Example C 24 Buffer Directive ORG X 100 BUFFER M 24 CIRCULAR BUFFER MOD 24 M_BUF DC 05 09 0009 DS 20 REMAINDER UNINITIALIZED ENDBUF C 3 6 COBJ Comment Object File COBJ string The COBJ directive is used to place a comment in the object code file The string is put in the object file as a comment Note A label is not allowed with this directive See also IDENT Example C 25 COBM Directive COBJ Start of filter coefficients Motorola Motorola Assembler Notes C 13 Assembler Directives 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 is considered the last line of the comment The comment text can include any printable characters and the comment text is reproduced in the source listing as it appears in the source file Note A label is not allowed with this directive Example C 26 COMMENT Directive COMMENT t This is a one line comment
127. 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 C 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 is 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 causes the current subtitle to be blank Note A label is not allowed with this directive See also TITLE Example C 74 STITLE Directive STITLE COLLECT SAMPLES C 3 54 SYMOBJ Write Symbol Information to Object File SYMOBJ symbol symbol symbol The SYMOBJ directive causes information for each symbol to be written to the object file This directive is recognized but current
128. isters C and D need to be modified As mentioned in Section D 5 1 ESSI GPIO Shared Registers port control C register controls the ESSIO mode settings and Port Control D controls the ESSI1 mode settings Motorola Codec Programming Tutorial D 15 Phase II Initializing and Interfacing the ESSI and CODEC Ports The following pins are used as GPIO pins Again these pins control the transfer of codec control information s SC00 CODEC RESET pin SCIO CCS pin e SCII CCLK pin e SCI2 CDIN pin The pins listed above correspond to specific bits on the port data registers For instance the CODEC RESET pin on the codec is connected to the SC00 pin on ESSIO This pin corresponds to bit O on port data register C Please refer to Table D 11 and Table D 12 for details concerning the correspondence between physical pins and port data registers Table D 11 Port Data Register C Pin bit Correspondence Bit Name ESSIO Bit Name Codec Bit Position Register C Functionality Mode Reserve for future use N A 6 23 N A STD SDIN 5 ESSI SRD SDOUT 4 ESSI SCK SCLK 3 ESSI SC02 FSYNC 2 ESSI Scot N A 1 N A SCO0 CODEC_RESET 0 GPIO Table D 12 Port Data Register D Pin bit Correspondence Bit Name ESSI1 Bit Name Codec Bit Position Register D Functionality Mode Reserve for future use N A 6 23 N A STD N A 5 N A SRD N A 4 N A SCK N A 3 N A SC12 CDIN 2 GPIO SC
129. it last slot interrupt guarantees that the previous frame has been serviced and the next frame is ready to be serviced The interrupt allows the programmer to redefine pointers to the buffer to be reset so that a new frame can be serviced To perform the procedure of preparing for the next frame the following steps can be used 1 Save Context 2 Reset Transmit buffer 3 Restore Context Example D 17 depicts the servicing of this interrupt Motorola DSP56303EVM User s Manual D 28 transmit last slot interrupt service routine Phase III Data Transferring Mechanism Example D 17 ESSI Transmit Last Slot Interrupt Service ssi txls isr move move move move rti Save Contex rO x r7 Save r0 to Reset Reset TX BUFF BASE ro rO x TX PTR No Ne Ne Ne case it was the stack Transmit buffer pointer pointer Reset tx buffer pointer just in corrupted Restore Context x r7 r0 Restore r0 D 10 7 ESSI Transmit Data Interrupt The interrupt occurs when the following properties are true The receive interrupt is turned on CRB 18 The transmit data register is empty To service the interrupt the programmer will need to transmit the data The following steps can be performed to accomplish such a task usce visa S E Save necessary context Load Transmit buffer pointer Move Transmit buffer data to transmit register Update Transmit Buffer poin
130. just three more steps to complete the interface between the ESSI and the CODEC To begin with the priority level of the interrupts must be set This parameter is determined by the application The second step is to enable interrupts on the DSP Finally the ESSI ports must be enabled Recall that in order to set the functionality of ESSI pin the port control registers must be configured Again setting the corresponding pin bit to 1 enables the ESSI mode while setting the pin bit to 0 disables the ESSI mode and enables the GPIO mode From Section D 9 2 Configure GPIO Pins the following pins bits must be configured as GPIO pins e CODEC RESET pin bit 0 on ESSIO e CCS pin bit 0 on ESSII e CCLK pin bit 1 on ESSII e CDIN pin bit 2 on ESSII Therefore on port control register C bit O is set to O Other pertinent pins should be set to 1 in order to configure the other pins as ESSI pins On Port Control Register D bits 0 1 and 2 should all be set to the value of 0 to allow GPIO functionality on those pins Because the other pins are not connected to the codec the other bits will not have an effect Example D 12 demonstrates setting the interrupt priority level enabling the priority and finally setting the ESSI GPIO functionality of the ESSI ports Motorola Codec Programming Tutorial D 23 Phase III Data Transferring Mechanism Example D 12 ESSI Port Priority and Functionality Setting movep 000
131. le code module Upon encountering the L option the linker treats the following argument as a library file and searches the file for any outstanding unresolved references If it finds a module in the library that resolves an outstanding external reference it reads the module from the library and includes it 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 so the position of the L option on the command line is significant Example dspink B filter main fir Lio 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 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 specified the linker uses 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 does not generate a map file The M option is specified only once If the file named in the M option already exists it is overwritten Example dspink M filter cln gauss cln Links the files filter cln and gauss cln to produce a map file Because no filename is given with the M option
132. le effort on the part of the programmer to quickly generate an application using the CS4218 codec If a desired property in the control information is needed simple modifications can be made to these files Motorola DSP56303EVM User s Manual D 30 Example Application D 11 1 Echo Program This example shows a simulation of an echo of an input signal using a number of time delayed sample To implement a time delayed echo on the DSP a sample is fed into the DSP from the codec The new sample is then divided by two to maintain stability and is then added to a time delayed sample The sum of the signals is again divided by two and then sent out to the codec Figure D 3 displays the block diagram describing this process New Sample Output Figure D 3 Block Diagram of a Delayed Sample echo D 11 2 Echo Code To begin the echo program the following files are included to simplify the initialization the interface and the transferring mechanism of the codec e joequ asm e jintequ asm ada equ asm vectors asm e ada init asm The next step is to define the transmit and receive buffers and pointers After performing the task of defining the receive and transmit buffers and pointers the control information constants for the codec will also need to be defined The following steps need to be performed 1 Include codec and I O files 2 Define transmit and receive buffer and pointers 3 Define codec control constants
133. llowed by normal assembler comments on the same logical line C 4 2 1 BREAK Statement BREAK The BREAK 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 Motorola Motorola Assembler Notes C 55 Structured Control Statements Example C 82 BREAK Statement WHILE x rl GT 0 loop until zero is found IF lt cs gt BREAK causes exit from WHILE loop ENDI any instructions here are 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 One or more CONTINUE directives inside a LOOP construct will generate a NOP inst
134. lso HIMEM Example C 56 LOMEM Directive LOMEM XR 100 YR 100 SET X Y RUN LOW MEM BOUNDS C 3 36 LSTCOL Set Listing Field Widths LSTCOL lt labw gt lt opcw 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 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 See also PAGE Example C 57 LSTCOL Directive LSTCOL 40 20 20 Reset label X and Y data field widths C 3 37 MACLIB Macro Library MACLTB lt pathname gt This directive is used to specify the lt pathname gt as defined by the operating system of a directory that contains macro definitions Each macro definition must be in a sepa
135. ly performs no operation in COFF assemblers Note A label is not allowed with this directive Motorola Motorola Assembler Notes C 51 Assembler Directives Example C 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 See also LSTCOL Example C 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 is printed on the top of all succeeding pages until another TITLE directive is encountered The title is initially blank The TITLE directive is not printed in the source listing A TITLE directive with no string argument causes the current title to be blank Note A label is not allowed with this directive See also STITLE Example C 77 TITLE Directive TITLE FIR FILTER C 3 57 UNDEF Undefine DEFINE Symbol UNDEF lt symbol gt The UNDEF directive causes the substitution string associated with lt symbol gt to be released and lt symbol gt will no longer represent a valid DEFINE substitution See the DEFINE directive for more information Note A label is not allowed with this directive See also DEFINE Example C 78 UNDEF Directive UNDEF
136. mbler Directives C 3 2 BSB Block Storage Bit Reverse lt label gt BSB lt expression gt lt expression gt The BSB directive causes the assembler to allocate and initialize a block of words for a reverse carry 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 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 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 is generated Both expressions can have any memory space attribute label if present is assigned the value of the runtime location counter after a valid base address has been established Only one word of object code is shown on the listing regardless of how large the first expression is However the runtime location counter is advanced by the number of words generated Note See also BSC BSM DC Example C 21 Buffer Directive BUFFER BSB BUFSIZ INITIALIZE BUFFER TO ZEROS C 3 3 BSC Block Storage of Con
137. mbol gt lt symbol gt The LOCAL directive is used to specify that the list of symbols is defined within the current section 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 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 is generated Note A label is not allowed with this directive See also SECTION XDEF XREF Example C 55 LOCAL Directives SECTION IO LOCAL LOOPA LOOPA local to this section ENDSEC C 3 35 LOMEM Set Low Memory Bounds LOMEM mem rl expression The LOMEM directive establishes an absolute low memory bound for code and data generation mem 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 C 30 DSP56303EVM User s Manual Motorola Assembler Directives 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 See a
138. munication Interface Port SCI Connection to the DSP s SCI port can be made at J7 Refer to Table 3 7 for pinout The signals at J7 are 43 3 V signals straight from the DSP If RS 232 level signals are required jumpers should be installed at J7 Refer to Table 3 8 to route the DSP s SCI signals through an RS 232 level converter to P1 The pinout of P1 is shown in Table 3 9 By installing a jumper at J10 the SCI port will be clocked by the on board 153 6 kHz oscillator instead of being clocked externally via the serial port connector P1 or internally by an SCI timer If J10 is installed jumper 3 4 on J7 must be removed 3 12 DSP56303EVM User s Manual Motorola Table 3 7 SCI Header J7 Pinout Pin Number DSP Signal Pin Number DSP Signal Name Name 1 RxD 2 3 SCLK 4 5 TxD 6 Table 3 8 J7 Jumper Options J7 DSP Signal Name 1 2 RxD 3 4 SCLK 5 6 TxD Table 3 9 DSP Serial Port P1 Connector Pinout Pin Number DSP Signal Name Pin Number DSP Signal Name 1 6 2 TxD 7 SCLK 3 RxD 8 4 9 5 GND Off Board Interfaces 3 6 2 Enhanced Synchronous Serial Port 0 ESSIO Connection to the DSP s ESSIO port can be made at J5 Refer to Table 3 10 for the header s pinout Motorola DSP56303EVM Technical Summary 3 13 Off Board Interfaces Table 3 10 ESSIO Header J5 Pinout
139. nd Motorola DSP56303EVM User s Manual D 36 Symbols C 5 C 9 lt C 9 gt C 9 CA C 6 C 6 C 7 C 1 5 C 2 lt C 7 lt lt C 7 gt C 8 C 3 C 6 C 2 A C 4 A A D converter 3 7 AARO programming 3 4 Address Attribute Pin Polarity Bit BAAP 3 5 Address Attribute Pin AAO 3 4 Address Attribute Pin AA1 3 6 Address Attribute Register AARO 3 4 Address Muxing Bit BAM 3 5 Address Pins A 0 17 3 4 3 6 Address Priority Disable Bit APD 3 4 Address to Compare Bits BAC 11 0 3 6 Addressing I O short C 7 immediate C 9 long C 8 long immediate C 9 short C 7 short immediate C 9 Analog Input Output 3 8 Assembler 2 12 mode C 33 option C 34 warning C 41 assembler 2 1 control 2 9 data definition storage allocation 2 9 directives 2 8 INDEX listing control and options 2 10 macros and conditional assembly 2 11 object file control 2 10 options 2 6 significant characters 2 8 structured programming 2 11 symbol definition 2 9 assembler control 2 9 assembler directives 2 8 assembler options 2 6 assembling the example program 2 12 assembling the program 2 5 assembly programming 2 1 AT29LV010A 3 6 audio 3 7 audio codec 3 1 3 7 audio interface cable 1 2 audio source 1 2 B Buffer address C 10 end C 23 buffer space and pointers D 9 C Checksum C 37 Codec 3 7 3 8 3 10 D 2 D 20 Control Data Chip Select Pin MF4 CCS 3 10 Control Data Clock Pin MF3 CCLK 3 10 Control Information
140. nd Intequ asm D 2 Codec Background D 2 1 Codec Device The CS4218 stereo audio codec is comprised of many devices designed to perform A D and D A conversion built into a single chip The chip consists of two delta sigma A D converters two delta sigma D A converters input anti aliasing filters output smoothing filters programmable input gain and programmable output attenuators These separate components built into the codec allow the DSP to receive data from the codec to process the data and to eventually transmit processed data back to the codec The data travels through special serial ports using the DSP s ESSI ports and the codec s specialized pins D 2 2 Codec Modes The codec has many modes of operation These modes are configured by setting certain pins on the codec high or low specifically SMODE1 SMODE2 and SMODE3 pins The mode in which the DSP5630x evaluation modules are physically set to is Serial Mode 4 SM4 SM4 allows the control information for the codec to be separated from the data information In effect this reduces the bandwidth needed by the data serial ports and simplifies the programming procedures Within the SM4 mode exist four sub modes These secondary modes specify two things whether the codec functions in the master mode or the slave mode and the number of bits per frame With the DSP evaluation boards that are discussed in this appendix the secondary modes are physically configured to sub mode 0 Sub mod
141. nd 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 C 62 DSP56303EVM User s Manual Motorola Structured Control Statements 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 the 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 o
142. nd 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 Motorola DSP56303EVM Technical Summary 3 11 Off Board Interfaces As an option the DSP56303EVM 14 pin JTAG OnCE connector at J6 allows the user to connect an ADS command converter card directly to the DSP56303EVM if the DSP56002 command converter software is not used J8 jumper removed Pin 8 has been removed from J6 so that the cable cannot be connected to the DSP56303EVM incorrectly Table 3 6 shows the JTAG OnCE J6 connector pinout The JTAG cable from the ADS command converter is similarly keyed so that the cable cannot be connected to the DSP56303EVM incorrectly Table 3 6 JTAG OnCE J6 Connector Pinout Pin Number DSP Signal Name Pin Number DSP Signal Name 1 TDI 2 GND 3 TDO 4 GND 5 TCK 6 GND 7 8 KEY PIN 9 PRESET 10 TMS 11 3 3 V 12 13 DEZ 14 TRST 3 6 Off Board Interfaces The DSP56303EVM provides interfaces with off board devices via its on chip peripheral ports Most of the DSP ports are connected to headers on the EVM to facilitate direct access to these pins by using connectors or jumpers 3 6 1 Serial Com
143. nd the codec In general ESSIO controls data transfers between the DSP and the codec while ESSI1 controls codec control information transfers between the DSP and the codec ESSIO performs three functions with reference to the codec First ESSIO transfers data to and from the codec Secondly ESSIO receives synchronization pulses And finally ESSIO Motorola DSP56303EVM User s Manual D 6 Digital Interface ESSI Codec performs the reset function on the codec Each ESSIO pin that is connected to the codeccodec serves a specific purpose Please refer to Table D 5 as to the individual definition of each pin ESSII serves a different purpose ESSII controls and transfers codec control information Again please refer to Table D 5 as to the definition of each corresponding pin Table D 5 Pin Set Up Descriptions ESSIO ESSI1 Pin CS4218 Codec Pin Description STDO ESSIO SDIN Data transfer from ESSIO to codec SRDO ESSIO SDOUT Data transfer from codec to ESSIO SCKO ESSIO SCLK Clock sent by codec Master SCO00 ESSIO RESET Reset codec from ESSIO SC02 ESSIO SSYNC Frame Synchronization pulse from codec SC10 ESSI CCS Control Information gate SC11 ESSI1 CCLK Clock sent by ESSI1 to set control information SC12 ESSI1 CDIN Control data transfer from ESSI1 Physically the ESSI port pins are connected to the serial pins on the codec though jumper connections In order to ensure correct oper
144. ne operation Refer to Figure 3 1 for the location of the FSRAM and Flash on the DSP56303EVM Figure 3 2 shows a functional block diagram of the DSP56303EVM including the memory devices MC74HCT04 P1 DSP56002 SW2 SW3 AT29LV010A Flash J10 MAX212 O JTAG OnCE MC33269 P2 3 3v 5v 2 5v Debug LED QS3384 Power LED GS71024T FSRAM DSP56303 M MOTOROLA LM4880 CS4218 J4 Test LED O Swi MC34164 P5 HDPHNE J9 P6 OUT Figure 3 1 DSP56303EVM Component Layout AA1928 3 2 DSP56303EVM User s Manual Motorola DSP56002 SCLK EXTAL Oscillator 19 6608 MHz Figure 3 2 DSP56303EVM Functional Block Diagram 3 3 1 FSRAM Data CS4218 Control Memory 4 AA1924 The DSP56303EVM uses one bank of 64K x 24 bit fast static RAM GS71024T 10 labelled U4 for memory expansion The GS71024T 10 uses a single 3 3 V power supply and has an access time of 10 ns The following sections detail the operation of the FSRAM 3 3 1 1 FSRAM Connections The basic connection for the FSRAM is shown in Figure 3 3 DSP56303 FSRAM A0 A15 DO D23 AAO RD W U
145. ng 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 MOVE lt CNST DO L CNST EQU 5 C 2 17 gt 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 Motorola Motorola Assembler Notes C 9 Assembler Directives Example C 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 MOVE CNST DO L If this is not desirable then the long immediate form of addressing can be forced as shown below CNST EQU 5 MOVE gt CNST DO L C 3 Assembler Directives The following subsections define each directive and its use C 3 1 BADDR Set Buffer Address BADDR lt M R gt lt expression gt The BADDR directive sets the
146. ng the ESSI and CODEC Ports Table D 9 Settings for Control Register A Bit Name Description Bit Position Value Binary Reserved Reserved 23 0 SSC1 SC1 pin serial I O flag 22 0 SC1 flag set WL 2 0 Word Length control 21 19 010 16 bit control word ALC Alignment Control 18 0 Align to bit 23 Reserved Reserved 17 0 DC 4 0 Frame Rate Divider 16 12 00001 2 time slots per Control frame PSR Prescaler Range 11 1 ESSI clock is divided by one Reserved Reserved 10 8 000 PM 7 0 Prescale Modulus Select 7 0 00000111 ESSI clock divided by 8 Besides setting the CRAO register the CRBO register must also be set to allow certain parameters to be met Table D 10 lists the typical settings that are required for Control Register B in order to ensure functionality between the ESSI ports and the codec Table D 10 Settings Control Register B Bit Name Description Bit Position Value Binary REIE Receive exception 23 1 enabled interrupt TEIE Transmit exception 22 1 enabled interrupt RLIE Receive last slot 21 1 enabled interrupt TLIE Transmit last slot 20 1 enabled interrupt RIE Receive interrupt 19 1 enabled TIE Transmit interrupt 18 1 enabled RE Receive register 17 1 enabled TEO Transmit register O 16 1 enabled TE1 Transmit register 1 15 0 disabled Motorola Codec Programming Tutorial D 13 Phase Il Ini
147. nly a single condition code expression registers are used to set up the required counters and comparandis 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 registers 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 Motorola Motorola Assembler Notes C 63 Structured Control Statements C 64 DSP56303EVM User s Manual Motorola Appendix D Codec Programming Tutorial D 1 Introduction The DSP56300 family is capable of many different types of activities Through mathematical algorithms implemented on the DSP various of tasks and different kinds of digital signal processing can be accomplished However in order to obtain useful information it is often necessary to interact with external events in the outside world To satisfy this requirement Motorola engineers integrated the CS4218 16 bit Audio codec CMOS device with the current DSP5630x evaluation modules Their design opened the DSP to numerous applications as the CS4218 co
148. ns for appropriate arithmetic operations For example this will check that only valid add or subtract operations are performed on address terms Enable cycle counts and clear total cycle count Cycle counts are shown on the output listing for each instruction Cycle counts assume a full instruction fetch pipeline and no wait states Print DC expansions Enable checksumming of instruction and data values and clear cumulative checksum The checksum value can be obtained using the 9 CHK function default reset Print the conditional assembly directives 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 5 is never preserved in the macro definition 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 first symbol in the source program is defined Reenable cycle counts Does not clear total cycle counts The cycle count for each instruction is shown on the output listing CONTCKReenable checksumming of instructions and data Does not clear cumulative CRE DEX DLD DXL checksum value 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 Expand DEFINE symbols within quoted strings Can also be done on a
149. nts 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 examine structured control statement expansion for relevant constructs to determine default register usage and applicable reassignment strategies Note See also OPT MEX SCSJMP A label is not allowed with this directive Example C 71 SCSREG Directive SCSREG YO B reassign SCS source and dest registers C 3 51 SECTION Start Section SECTION symbol GLOBAL STATIC LOCAL lt section 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 C 48 DSP56303EVM User s Manual Motorola Assembler Directives 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 code or data inside a section is considered an in
150. o LEE Eso 299 159 059 wi LLI T j LO anyo ane L i n dni d 210 210 T i D vast C E 93000 3ION dno anyo anyo BR A NS E AL a gt C 1019 819 119 i d A9109 roe i 1 jnio o 3nio o jnio o jnio 0 3nio o anyo anyo anyo anyo anyo g 6010 8019 1019 019 2010 s19 Ln 19 D t09 i E E E d H SION k 3 y 3 a Y Motorola Appendix B DSP56303EVM Parts List B 1 Parts Listing The following table contains information on the parts and devices on the DSP56303EVM Table B 1 DSP56303EVM Parts List Designator Manufacturer Part Number Description U1 Motorola DSP56303GC100 DSP U2 Motorola DSP56002PV80 DSP JTAG OnCE U4 GSI GS71024T 10 FSRAM U3 Atmel AT29LV010A 20TC Flash U5 Quality QS3384Q Bus Switch Semiconductor U6 Motorola MC34164D 3 Power On Reset U7 Crystal CS4218 KQ Audio Codec Semiconductor U8 Pioneer LM4880M Audio Amplifier U9 Motorola MC74HCTO4AD Hex Inverter U11 Maxim MAX212CAG RS 232 Transceiver U23 Motorola MC33269DT 3 3 3 3 V Regulator U24 Motorola MC33269DT 5 0 5 V Regulator U25 Motorola MC33269DT Adj Regulator D1 D2 D3 D4 D5 Rectron FM4001 IN4001 Diode D6 D7 Motorola MMBD6050LT1 IN6050 Diode LED1 Quality HLMP1790 Green LED Technologies LED2 LED3 Quality HLMP1700 Red LED Technologies Motorola DSP56303EVM Parts List B 1 Parts Listing Table B 1 DSP56303E
151. o start The DSP56303 ESSII pins are used as general purpose i o GPIO signals to transfer the control data to the codec The control data needs to be transferred only when it changes The DSP56303 serial control 0 SC10 pin is programmed to control the codec multi function pin 4 or the control data chip select pin MF4 CCS This pin must be low for entering control data The serial control 1 SC11 pin connects to the codec multi function pin 3 or the control data clock pin MF3 CCLK The control data is inputted on the rising edge of CCLK The serial control 2 SC12 pin is connected to the codec multi function pin 2 or the control data input pin MF2 CDIN This pin contains the control data for the codec 3 5 Command Converter The DSP56303EVM uses Motorola s DSP56002 to perform JTAG OnCE 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 module reset DSP56303 the HA2 pin of the DSP56002 is then used to reset the DSP56303 request OnCE module or release OnCE module The DSP56002 command converter software interprets the commands received from the PC and sends a sequence of instructions to the DSP56303 s JTAG OnCE 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
152. of control information Set CCLK to low on codec to start next cycle This procedure must be performed once for the upper 16 bit control word and then once for the lower 16 bit control word Example D 11 illustrates these procedures Motorola Codec Programming Tutorial D 21 Phase II Initializing and Interfacing the ESSI and CODEC Ports Example D 11 Sending in Control Words LA codec control routine Input CTRL WD LO and CTRL WD HI Output CDIN A Description Used to send control information to CODEC NOTE does not preserve the a register y codec control elr a bclr FCCS x M_PDRD assert CCS move X CTRL WD HI a upper 16 bits of control data jsr send codec shift out upper control word move X CTRL WD LO al lower 16 bits of control data jsr send codec shift out lower control word bset CCS xX M_PDRD dissert CCS rts LA Send codec routine Input al containing control information Ouput sends bits to CDIN Description Determines bits to send to CDIN LA send_codec do 16 end_send codec 16 bits per word bset CCLK x M PDRD toggle CCLK clock high jclr 123 al bit low test msb bset FCDIN x M_PDRD send high into CDIN jmp continue bit low bclr FCDIN x M_PDRD send low into CDIN continue rep 12 delay nop bclr FCCLK x M PDRD
153. of the CODEC D 10 D 9 Phase II Initializing and Interfacing the ESSI and CODEC Ports D 12 D 9 1 Initialize GN ee ENEE DD D 12 D 9 2 Congre CIPICEPIDS o id a een A A ASA D 15 D 9 3 Initialization of the CODEC ports D 19 D 9 4 Enabling Interrupts ESSI ports au 245 23454 RISE ASA AD bags D 23 D 10 Phase III Data Transferring Mechanism D 24 D 10 1 Interrupts and Interrupt Service Routines D 24 D 10 2 ESSI Receive Data with Exception Status Interrupt D 24 D 10 3 ESSI Receive Data Interrupt it AAA ERROR D 25 D 10 4 ESSI Receive Last Slot Interrupt D 26 D 10 5 ESSI Transmit Data with Exception Status Interrupt D 27 D 10 6 ESSI Transmit Last Slot Interrupt io e e yr tes eve D 28 D 10 7 ESSI Transmit Data Interrupt 0 Ux Ra RARE EROR ER D 29 DIT Example Applicaton sedo de D 30 o E A Sede se itae D 31 DIL2 EchoCode iee tace taa bd deron fae d dcdit oe ace qusc D 31 Xii DSP56303EVM User s Manual Motorola List of Tables 2 1 Assembler ODIOS 1 235401 ne eee den Rete ee ee HER eie red 2 6 2 2 EME Options da AAN 2 13 3 1 CS4218 Sampling Frequency Selection 3 7 3 2 JPS Jumper Block Options lt i 64s ova Keng dE di 3 9 3 3 JP4 Jumper Block Options A Ae teu een eee Sed OE eue e eee 3 9 3 4 On Board JTAG Enable Disable
154. of which in words is equal to the value of lt expression gt This directive causes the runtime location counter to be advanced by the value of the absolute 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 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 1f present is assigned the value of the runtime location counter at the start of the directive processing Note See also DSM DSR Example C 32 DS Directive S_BUF DS 12 SAMPLE BUFFER C 3 12 DSM Define Modulo Storage lt label 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 directive first advances the runtime location counter to a base address that is a multiple of 2 where 2 gt expression An error is 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 expression can have any memory space attribute The block of memory reserved is not initialized to any given value The result of expression must be an absolute integer greater than zero and cannot contain any forward referenc
155. on C 2 C 2 4 Return Value of Symbol Character ans aos sita C 3 C 2 5 Return Hex Value of Symbol Character C 4 C 2 6 Macro Local Label Oyerride 10d id C 4 Ez Macro String Delimiter or Quoted String DEFINE Expansion Character C 5 C 2 7 1 ACTO STE AS RA AAA AA C 5 6272 Quoted String DEFINE Expansion C 5 C 2 8 o bunedon Delimitar e e dl nr a dee die C 6 C29 Location Counter Substitution vii ta e ee e be eO Sei C 6 C 2 10 String Concatenation Operator C 6 C 2 11 Substring Delimiter lt string gt lt offset gt lt length gt C 7 C 2 12 lt lt TO Short Addressing Mode Force Operator C 7 C 2 13 lt Short Addressing Mode Force Operator C 7 C 2 14 gt Long Addressing Mode Force Operator C 8 C 2 15 de Immediate Addressing Modes is E AA D ARRA C 9 C 2 16 lt Immediate Short Addressing Mode Force Operator C 9 C 2 17 gt Immediate Long Addressing Mode Force Operator C 9 GA Assembler DIE CUNA aa ee C 10 C 3 1 BADDR Set Buffer Address c ed Ce Ng CRUCE C 10 C 3 2 BSB Block Storage Bit Reverse S oi sisse darlas C 11 C 3 3 BSC Block Storage of Oe ii C 11 C 3 4 BSM Block Storage Modulo 5 64 4 ehr e db C 12 C 3 5 BUFFER Start Buller i a dd Me C 12 C 3 6 CODI Comment Object Elle eoe caen req Reo
156. 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 lt arg gt lt lt arg gt lt arg gt ENDM The block of source statements defined by the DUPA and ENDM directives are 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 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 is assigned the value of the runtime location counter at the start of the DUPA directive processing Note See also DUP DUPC DUPF ENDM MACRO Motorola Motorola Assembler Notes C 19 Assembler Directives Example C 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
157. or tab 2 1 1 4 Data Transfer Fields Most opcodes 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 Motorola Example Test Program 2 3 Writing the Program 2 1 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 2 1 2 Example Program The example program discussed in this section takes two lists of data one in X memory and one in Y memory and calculates the sum of the products of the two lists Calculating the sum of products is the basis for many DSP functions Therefore the DSP56303 has a special instruction multiplier accumulate MAC s which multiplies two values and adds the result to the contents of an accumulator Example 2 2 Simple DSP56303EVM Code Example E ER E E RER RER TR CRE eg A SIMPLE PROGRAM CALCULATING THE SUM OF PRODUCTS kxkxkxkxkxkxkxkxk xkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkkkxkxkkxkkkxk kxx
158. ort A B port B If not present no explicit mapping is done 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 Initial value to assign to the runtime counter used as the lt rlc gt If expl is a relative expression the assembler uses the relative location counter If expl is an absolute expression the assembler uses the absolute location counter If expl is not specified then the last value and mode that the counter had is used Which memory space X Y L P or E is used as the load memory space If the memory space is L any allocated datum with a value greater than the target word size is extended to two words otherwise it is truncated If the memory space is E then depending on the memory space qualifier any generated words are split into bytes one byte per word or a 16 8 bit combination Which load counter H L or default if neither H or L is specified that is associated with the Ims is used as the load location counter C 42 DSP56303EVM User s Manual Motorola Assembler Directives lt Imp 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 lt lce gt Non negative absolute integer expression representing the counter number to be used as the load loca
159. oted strings IC Ignore case in symbol names NS Support symbol scoping in nested sections SCL Scope structured control statement labels 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 The following are miscellaneous options having to do with internal assembler operation 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 Check reserve data memory locations SI Interpret short immediate as long or sign extended SVO Preserve object file on errors C 36 DSP56303EVM User s Manual Motorola Assembler Directives 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 AE CC CEX CK CL CM CONST CONTC default reset Check address expressio
160. other pins in Port control Register D the other pins can be set to anything that is to don t care values 0 or 1 At this point the ESSI functionality should be disabled prior to initializing the codec Therefore the pins on ESSIO will not be configured to function in the ESSI mode until the codec has been initialized However the GPIO pins is configured as seen in Example D 6 Example D 6 GPIO Pin Configuration Port Control Register C movep 0000 x M PCRC Setting pin 0 for GPIO other pins ESSI Se Se Port Control Register D movep 0000 x M_PCRD Setting pin 0 pin 1 and pin 2 to GPIO mode Se Since ESSIO pin 0 and ESSII will be used in the GPIO mode the direction of data flow must be declared In other words the direction of flow determines which device is transmitting and which device is receiving Recall that in order to set the direction of data Motorola Codec Programming Tutorial D 17 Phase Il Initializing and Interfacing the ESSI and CODEC Ports flow Port Direction Registers C and D must be set register C refers to ESSIO and register D refers to ESSII Setting the pin bit on the Port Direction Register to 1 configures the pin bit as an output and setting the pin bit on the Port Direction Register to 0 configures the pin bit as an input Therefore in order to configure the pins using the Data Direction Registers to mimic the direction flow information in Figure D 2 the follow
161. ound Expressions A compound expression consists of two or more simple expressions See 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 IF X1 lt GT gt B AND lt LS gt AND R1 NE R2 this is OK LE Xl LE B AND LC OR R5 GT R undefined The simple expressions are evaluated left to right Note that this means the result 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
162. r in the operand field are not defined in the section an error is generated Note A label is not allowed with this directive See also SECTION XREF Example C 80 XDEF Directive SECTION IO XDEF LOOPA LOOPA will be accessible by sections with XREF ENDSEC C 3 60 XREF External Section Symbol Reference XREF symbol symbol symbol 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 is generated and all references within the current section to such a symbol are flagged as undefined The XREF directive must appear before any reference to symbol in the section Note A label is not allowed with this directive See also SECTION XDEF Motorola Motorola Assembler Notes C 53 Structured Control Statements Example C 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
163. r4 Motorola data time slot 1 2 for RX ISR left audio data time slot 3 4 for RX ISR right audio data time slot 1 2 for TX ISR left audio data time slot 3 4 for TX ISR right audio Pointer for rx buffer Pointer for tx buffer MIN LEFT ATTN MIN RIGHT ATIN LIN2 RIN2 MIN LEFT GAIN MIN RIGHT GAIN No C Ne Ne Ne Ne e PLL 7 X 12 288 86 016MHz mask interrupts clear hardware stack pointer operat initia linear initia ing mode 0 lize stack pointer for isr addressing lize codec start echo buffer at 400 make e clear cho buffer 1024 deep a clear the echo buffer Codec Programming Tutorial D 35 Example Application echo_loop jset 3 x M SSISRO wait for rx frame sync jclr 3 x M SSISRO wait for rx frame sync clr a clr b move X RX BUFF BASE a receive left move X RX BUFF BASE 1 b receive right asr a x r4 x0 divide them by 2 and get oldest asr b y r4 yo samples from buffer add x0 a add the new samples and the old add y0 b asr a reduce magnitude of new data to ensure stability asr b move a x r4 Save the altered samples move b y 14 and bump the pointer move a x TX BUFF BASE transmit left move b x TX_BUFF_BASE 1 transmit right jmp echo loop include ada init asm used to include codec initialization routines echo e
164. rate 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 is searched for a file of the unknown name with the ASM extension added If such a file is found the current source line is saved and the file is 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 Motorola Motorola Assembler Notes C 31 Assembler Directives 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 See also INCLUDE Example C 58 MACLIB Directive MACLIB macros mymacs IBM PC example MACLIB fftlib UNIX example C 3 38 MACRO Macro Definition label MACRO lt dummy argument list gt lt macro definition statements gt ENDM
165. rated automatically by structured control statements See Section C 4 Structured Control Statements on page C 54 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 causes all branches resulting from subsequent structured control statements to be forced to the specified mode Motorola Motorola Assembler Notes C 47 Assembler Directives 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 A label is not allowed with this directive Example C 70 SCSJMP Directive SCSJMP SHORT force all subsequent SCS jumps short C 3 50 SCSREG Reassign Structured Control Statement Registers SCSREG lt srcreg gt lt dstreg gt lt tmpreg gt lt extreg gt The SCSREG directive reassigns the 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 default assignme
166. rectory If no filename is specified the linker uses 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 does not use a memory control file The R option is specified only once Example dspink Rproj filter cln gauss cin Links the files filter cln and gauss cln using the memory file proj ctl U lt symbol gt 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 dspink Ustart Lproj lib Declares the symbol start undefined so that it is resolved by code within the library proj lib V 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 ensure that link editing is proceeding normally Example dsplnk V myprog cln Links the file myprog cln and sends progress lines to the standard error output Motorola Example Test Program 2 15 Linker Options Table 2 2 Linker Options Continued Option Description X lt opt gt lt opt gt lt Provides for link time options that alter the standard operation of the linker The options opt gt are described below All options can be
167. reported 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 C 2 Example of Unreported Comment Delimiter THESE LINES WILL NOT BE REPRODUCED IN THE SOURCE LISTING C 2 3 Line Continuation or Macro Argument Concatenation Character The following subsections define how the character can be used in two different instances C 2 3 1 Line Continuation The backslash character V if used as the last character on a line indicates to the assembler that the source statement continues on the following line The continuation line is concatenated to the previous line of the source statement and the result is 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 C 3 Example of Line Continuation Character THIS COMMENT EXTENDS OVER THREE LINES C 2 3 2 Macro Argument Concatenation The backslash V is also used to cause the concatenation of a macro dummy argument with other adjacent alphanumeric character
168. restart cycle lsl a shift control word to 1 bit to left end send codec rts The codec control subroutine performs most of the work for sending the information to the codec ports First the CSS bit is cleared to permit the modification of the control registers on the codec Afterwards the control words are loaded into registers where they are then sent out to another subroutine that sends the data serial out to the codec ports After sending both the upper and lower control words the CCS bit is reset to 1 to disallow changing of the control information on the codec The send codec subroutine in essence serves as the workhorse for the codec control routine This routine pushes the individual bits of the control words into the codec Motorola DSP56303EVM User s Manual D 22 Phase Il Initializing and Interfacing the ESSI and CODEC Ports First it sets the clock CCLK high to allow the bit to be sent Afterwards it determines what the most significant bit MSB is and either sends in a 0 or 1 to the CDIN pin depending on the MSB A delay is incorporated into the routine to allow the information to get sent Afterwards the clock CCLK is set low to allow the cycle to begin again The control word is shifted to serve the next MSB bit These procedures are performed 16 times to serve all the bits in the control word D 9 4 Enabling Interrupts ESSI ports Now that the ESSI port and CODEC ports are configured and initialized there are
169. rned on CRB 21 e The last time slot ends The use of the receive last slot interrupt guarantees that the previous frame has been serviced and the next frame is ready to be serviced The interrupt allows the programmer to redefine pointers to the buffer to be reset so that a new frame can be serviced Motorola DSP56303EVM User s Manual D 26 Phase III Data Transferring Mechanism To perform the procedure of preparing for the next frame the following steps can be used 1 Save Context 2 Reset receive buffer 3 Restore context Example D 15 demonstrates the steps required servicing this interrupt Example D 15 ESSI Receive Last Slot Interrupt Service receive last slot interrupt service routine ssi rxls isr Save context move r0 x r7 Save r0 to the stack move RX BUFF BASE r0 Reset rx buffer pointer just in case it was corrupted move rO x RX DIR Update rx buffer pointer move x r7 r0 Restore r0 Tied D 10 5 ESSI Transmit Data with Exception Status Interrupt The interrupt occurs when the following properties are true e The transmit exception interrupt is turned on CRB 22 The transmit data register is empty e A transmit underrun error occurred The interrupt is triggered by the transmit underrun bit being set When the interrupt is serviced the programmer will need to first clear the transmit underrun bit SSISRO 4 and then transmit the transmit BUFF
170. rs Manual Motorola P NOCC C 39 NOCEX C 39 NOCK C 39 NOCL C 39 NOCM C 39 NODEX C 39 NODLD C 39 NODXL C 39 NOFC C 39 NOFF C 39 NOFM C 39 NOGS C 39 NOHDR C 39 NOINTR C 39 NOMC C 39 NOMD C 39 NOMEX C 39 NOMI C 39 NOMSW C 39 NONL C 39 NONS C 40 NOPP C 40 NOPS C 40 NORC C 40 NORP C 40 NOSCL C 40 NOU C 40 NOUR C 40 NOW C 40 NS C 36 C 40 PP C 35 C 40 PS C 36 C 40 PSM C 36 RC C 35 C 40 reporting C 35 RP C 36 C 40 RSV C 36 S C 35 C 40 SCL C 36 C 41 SCO C 36 C 41 SI C 36 SO C 36 C 41 SVO C 36 symbol C 36 U C35 C 41 UR C 35 C 41 W C 35 C 41 WEX C 41 XLL C 36 C 41 XR C 36 C 41 P Space Enable Bit BPEN 3 6 Packing Enable Bit BPAC 3 5 PC 3 10 PC requirements 1 2 PEROM 3 6 stand alone operation 3 6 Pin Setup Descriptions D 7 Pins D 20 power supply external 1 2 1 4 program assembling the 2 5 example 2 3 writing the 2 2 Program counter C 6 C 42 programming AARO 3 4 assembly 2 1 development 2 1 example 2 1 Q Quick Start Guide 1 1 R Read Enable Pin RD 3 4 3 6 Register C data direction D 18 Register D data direction D 18 Reset DSP56002 3 11 Reset DSP56303 3 7 Right Channel Output Pin ROUT 3 8 Right Input 2 Pin RIN2 3 8 RS 232 cable connection 1 4 RS 232 interface 3 10 RS 232 interface cable 1 2 RS 232 serial interface 3 10 running the Debugger program 2 19 S Sampling frequency 3 7 SCI DSP56002 3 10 Section C 48 end C 24 global C 26 C 38 C 49 loc
171. ruction just before the loop address Example C 83 CONTINUE Statement REPEAT LE lt cs gt CONTINUE causes immediate jump to UNTIL ENDI any instructions here are skipped UNTIL x r1 EQ 0 evaluation here after CONTINUE C 4 2 3 FOR Statement FOR lt op1 gt lt op2 gt TO DOWNTO lt op3 gt BY lt op4 gt DO lt stmtlist gt ENDFE 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 op1 gt to serve as a loop counter FOR TO allows counting upward while FOR DOWNTO allows counting C 56 DSP56303EVM User s Manual Motorola Structured Control Statements downward The 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 A 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 lt op1 gt 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
172. 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 2k where 2 gt lt expression gt An error is 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 expression lt m where m is the maximum address of the target DSP If a reverse carry buffer is designated and expression is not a power of two a warning is issued A label is not allowed with this directive Note See also BSM BSB BUFFER DSM DSR Example C 20 Example BADDR Directive ORG X 5100 M_BUF BADDR M 24 CIRCULAR BUFFER MOD 24 C 10 DSP56303EVM User s Manual Motorola Asse
173. s 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 2 DSP56303EVM User s Manual Motorola Assembler Significant Characters Example C 4 Example of Macro Concatenation Suppose the source input file contained the following macro definition SWAP_REG MACRO REG1 REG2 swap REG1 REG2 using D4 L as temp MOVE R REG1 D4 L MOVE R REG2 R REG1 MOVE D4 L R REG2 ENDM The concatenation operator V 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 statement SWAP REG 0 1 the resulting expansion would be as follows MOVE RO D4 L MOVE R1 RO MOVE D4 L R1 C 2 4 Return Value of Symbol Character The lt symbol gt sequence when used in macro definitions is 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 C 5 Example of Use of Return Value Character Consider
174. s Jr BEBE MO auoudpeaH 4S At ous 335 2e qul noz i PERD oog T NHd dil 280 e mmm y cm e AE E O OA TRE VA O VAS NH oun Jr I Nias _NMas_93009 4 2 E ES 1noas 1noas 03d02 S 1198 ge 3108703000 ONASS Hp ONASS 03009 Nad 7 o ne e ES 13838 Hy 1383493009 T Kl ai 2 NDITO y ZHN882 ct 10 02 002 Dh 824 aen S un SEN 2199 an 38338 3199 We Be 129 Dy Ra Ae AS S3N EN ot INIT DEI y y Leo 069 220 INIH Fst aro wuer aerer ner 42200 0 42200 0 129 5i pe ons veu E 129 920 MEH Aer eds A no aun A ani ENIT Paz eral wuer 620 20 pe f oaas i er 1107 Jio Ind dil 022 ujaun ASZ Ino ONE E Fin gz E un Ces 9d 820 D m NI dil 2 3 NI NIE Daer m in 44008 vd ita 619 T Jl ELU 91d ezo DSP56303EVM User s Manual MOTOROLA A 6 Ajddns lamog 9 y aJnDiJ 3 a Y L JO 9 1eeus soot sa Jeubisag 8661 0 jequieAoN epsen ajeq un 8 i JequnN nay NSQ 0 95dS jusuhooy ezis Ajddng 198mog oui vi 30 QWN 092 168 215 xw4 lso L6elzLg erus i TOEFL CAF 1S8M BAG uouue WRIIIIM 1059 UOISIAIG 19q119SqQNS SSI 9 11M eL Bre 90A 9 T 08H anot MIO eL epz 6 8 EA 90AE 9 1d6926 0N anot 0219 S qvas 3114434 el 1no d ASZ O z1no QNO Fr a
175. s 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 also looks 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 ENDIE 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 NOCK default reset Disable checksumming of instruction and data values NOCL Do not print the 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 relativ
176. s to set breakpoints which are user defined points where execution of the code stops allowing the user to step through the section of interest In the example set a breakpoint to verify that the values in rO and r4 are correct before the do loop type break p 106 in the command window The line before the loop brightens 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 so that it points to the reset vector To run the program type go or click on the go button The DSP56303 stops when it reaches the breakpoint and you can step through the remainder of the code To exit the Debugger type quit at the command prompt Motorola Example Test Program 2 19 Running the Program 2 20 DSP56303EVM User s Manual Motorola Chapter 3 DSP56303EVM Technical Summary 3 1 DSP56303EVM Description and Features An overview description of the DSP56303EVM is provided in the DSP56303EVM Product Brief DSP56303EVMP D included with this kit The main features of the DSP36303EVM include the following e DSP56303 24 bit digital signal processor e FSRAM for expansion memory and Flash PEROM for stand alone operation e 16 bit CD quality audio codec Command converter circuitry 3 2 DSP56303 Description A full description of the DSP56303 including functionality and user information is provided in the following documents
177. 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 Note The circumflex is also used as the binary exclusive OR operator Example C 7 Example of Local Label Override Character Consider the following macro definition LOAD MACRO ADDR MOVE P ADDR RO ENDM 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 C 4 DSP56303EVM User s Manual Motorola Assembler Significant Characters C 2 7 Macro String Delimiter or Quoted String DEFINE Expansion Character The following subsections define how the character can be used in two different instances 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 C 8 Example of a Macro String Delimiter Character Using the following macro definition
178. sing Motorola Motorola Assembler Notes C 7 Assembler Significant Characters can be forced by preceding the absolute address by the short addressing mode force operator lt Example C 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 form of addressing by default MOVE DO L Y DATAST DATAST EQU Y 923 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 MOVE DO L 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 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 C 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
179. sion 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 zero Because of the nature of the directive expression 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 See also ENDIF C 28 DSP56303EVM User s Manual Motorola Assembler Directives Example C 52 IF Directive IF LST gt 0 DUP LST Unwind LIST directive stack NOLIST ENDM ENDIF 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 string 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 string and
180. stant lt label 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 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 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 is generated Both expressions can have any memory space attribute lt label gt if present is assigned the value of the runtime location counter at the start of the directive processing Only one word of object code is shown on the listing regardless of how large the first expression is However the runtime location counter is advanced by the number of words generated Motorola Motorola Assembler Notes C 11 Assembler Directives Note See also BSM BSB DC Example C 22 Block Storage of Constant Directive UNUSED BSC S2FFF LCV R SFFFFFFFF 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
181. structured operand comparison expression Each test is expressed in the structured control statement by a mnemonic enclosed in angle brackets When processed by the assembler the expression generates an inverse conditional jump to beyond the matching ENDx UNTIL directive Motorola Motorola Assembler Notes C 59 Structured Control Statements Example C 89 Condition Code Expression IF EO zero bit set bne Z L00002 code generated by assembler CLR D1 user code ENDI Z4 100002 assembler generated label REPEAT subtract until DO D7 Z4 100034 assembler generated label SUB D7 DO user code UNTIL LT bge Z L00034 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 lt cc gt 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 J B cc lt label gt where the jump conditional is the inverse of lt cc gt Ordinarily lt op1 gt is moved to the lt reg
182. t 18 0 output not muted 1 output muted Left Input Select 17 0 LIN1 1 LIN2 Right Input Select 16 0 RIN1 1 RIN2 Left input D A Gain 1 5 dB steps 15 12 00000 no gain 11111 max gain 22 5 dB Right input D A Gain 1 5 dB 11 8 00000 no gain steps 11111 max gain 22 5 dB Not Applicable 0000000 Motorola DSP56303EVM User s Manual D 10 Phase 1 Setting up Constants Referring to Table D 8 a programmer can configure the control information for the codec Suppose for instance that the following requirements are needed for this application 1 No mask for the interrupt pin 2 No left or right D A attenuation 3 Muting turned off 4 LIN2 and RIN2 Selected On the EVM boards input 2 is used for both left and right channels 5 No left and right D A gains Example D 2 illustrates the procedure of setting the codec control information using the previous specified control parameters Example D 2 Setting Codec Control Information NO_MASK_INT equ 000000 NO LEFT ATTN equ 000000 0 dB NO_RIGHT_ATTN equ 000000 0 dB LIN2 equ 000200 use LIN2 on EVM RIN2 equ 000100 use RIN2 on EVM NO LEFT GAIN equ 000000 0 dB NO_RIGHT_GAIN equ 000000 O dB NO_MUTING equ 000000 CTRL WD 12 equ NO_MASK_INT NO_LEFT_ATTN NO_RIGHT_ATTN LIN2 RIN2 NO MUTING CTR
183. t control Reporting options Message control Symbol options e Assembler operation C 34 DSP56303EVM User s Manual Motorola Assembler Directives C 3 42 1 Listing Format Control The following options control the format of the listing file FC FF FM PP RC Fold trailing comments Form feeds for page ejects Format messages Pretty print listing Relative comment spacing C 3 42 2 Reporting Options The following options control what is reported in the listing file CEX CL CRE DXL HDR IL LOC MC MD MEX MU NL S U Print DC expansions Print conditional assembly directives Print symbol cross reference Expand DEFINE directive strings in listing Generate listing headers Inhibit source listing Print local labels in cross reference Print macro calls Print macro definitions Print macro expansions Print memory utilization report Print conditional assembly and section nesting levels Print symbol table Print skipped conditional assembly lines C 3 42 3 Message Control The following options control the types of assembler messages that are generated AE MSW UR W Check address expressions Warn on memory space incompatibilities Flag unresolved references Display warning messages Motorola Motorola Assembler Notes C 35 Assembler Directives C 3 42 4 Symbol Options The following options deal with the handling of symbols by the assembler DEX Expand DEFINE symbols within qu
184. ta These specifications are determined by setting the Port Direction Register C PRRC and Port Direction Register D PRRD By setting the pin bit to O on the port direction register the GPIO pin is configured as an input Furthermore by setting the pin bit on the port direction register to 1 the GPIO pin is configured as an output Finally to retrieve or transmit data in the GPIO mode the port data registers PDRs are used If the pin bit is used as an input the value in that pin bit reflects the value present on that pin Additionally if the pin bit is used as an output the value seen on the pin bit is the value being transmitted For more information concerning ESSI ports please refer to the DSP5630xEVM User s Manual and the Application Note DSP56300 Enhanced Synchronous Serial Interface ESSI Programming order number AN1764 D located at web address www mot com SPS DSP documentation appnotes html D 6 Digital Interface ESSI Codec As mentioned previously the DSP s ESSI ports form the major interface between the DSP and the codec device Recall that on the DSP5630x evaluation modules discussed in this appendix the codec is configured to function in the SM4 mode SM4 mode separates the data information from the codec control information Therefore two serial ports are required to transfer data and codec control information Specifically both ESSIO and ESSII ports are used to control and transfer data between the DSP a
185. ter Restore context Example D 18 illustrates the procedures to service this interrupt Motorola Codec Programming Tutorial D 29 Example Application Example D 18 ESSI Transmit Data Interrupt Service transmit data interrupt service routine ssi tx isr Save Context move r0 x r7 Save r0 to the stack move mO x r7 Save m0 to the stack move 1 m0 Modulus 2 buffer move x TX_PTR r0 Load the pointer to the tx buffer nop delay movep x r0 x M TXOO SSI transfer data register move rO x TX DIR Update tx buffer pointer Restore Context move x r7 m0 Restore m0 move x r7 r0 Restore r0 rti D 11 Example Application An example program has been provided to illustrate the use of the codec The following files are included in a package to be distributed with this document e oequ asm Contains important I O equates e ntequ asm Contains interrupt equates for the DSP EVM modules e Ada equ asm Contains equates used to initialize the CODEC e Ada Init asm Contains initialization code for the ESSI and CODEC e Vectors asm Contains the vector table for the DSP EVM modules e Echo asm Sample code that illustrates DSP processing All the procedures that were discussed in Section D 6 Digital Interface ESSI Codec and Section D 7 Programming the CS4218 Codec have been included in these files Therefore it will take litt
186. ter 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 is 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 C 28 Multiple Character String Definition ABCD B 414243 440000 Note See also BSC DCB Example C 29 DC Directive TABLE DC 1426 253 2662 ABCD CHARS DC Cat t Br rer rpr C 3 9 DCB Define Constant Byte lt label gt DCB 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 of them can be null two adjacent commas in which case the corresponding byte location is filled with zeros lt label gt if present is assigned the value of the runtime location counter at the start of the direc
187. 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 Note A label is not allowed with this directive See also MACLIB Example C 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 is not printed but the subsequent source lines are 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 Motorola Assembler Notes C 29 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 See also NOLIST OPT Example C 54 LIST Directive IF LISTON LIST Turn the listing back on C 3 34 LOCAL Local Section Symbol Declaration LOCAL lt symbol gt lt sy
188. that is not yet defined No forward references are allowed Note See also EQU SET Example C 49 GSET Directive COUNT GSET 0 INITIALIZE COUNT C 3 29 HIMEM Set High Memory Bounds HIMEM mem rl expression The HIMEM directive establishes an absolute high memory bound for code and data generation mem 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 See also LOMEM Example C 50 HIMEM Directive HIMEM XR S7FFF YR S7FFF SET X Y RUN HIGH MEM BOUNDS C 3 30 IDENT Object Code Identification Record lt label gt IDENT lt expressionl gt lt expression2 gt The IDENT directive is used to create an identification record for the object module If lt label gt is specified it is used as the module name If lt label gt is not specified then the filename of the source input file is used as the module name lt expression1 gt is the version number lt expression2 gt is the revision number The two expressions must each evaluate to an integer result The comment field of the IDENT directive is also passed on to the object module
189. the BNC bits are set to 8 and the BAC bits are set to 040 If the eight most significant bits of the external address are 00000100 the FSRAM is accessed 3 3 2 Flash The DSP56303EVM uses an Atmel AT29LV010A 20TC chip U3 to provide a 128Kx 8 bit CMOS Flash for stand alone operation 1 e startup boot operation without accessing the DSP56303 through the JTAG OnCE port The AT29LV010 uses a 3 3 V power supply and has a read access time of 200 ns 3 3 2 1 Flash Connections The basic connection for the Flash is shown in Figure 3 6 DSP56303 Flash A0 A16 A0 A16 DO D7 lt 00 1 07 AA1 CE RD OE R HB WE m AA1932 Figure 3 6 Flash Connections The flash address pins A0 A16 connect 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 connect the DSP56303 write WR and read RD enable lines respectively Address attribute 1 AAT generates the flash chip enable CE 3 3 2 2 Programming for 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 by 3 6 DSP56303EVM User s Manual Motorola Audio Codec asserting and then clearing the RESET pin of the DSP56303 The mode pins MODA MODB MODC and MODD are sampled as
190. the following macro definition SWAP_SYM MACRO REG1 REG2 swap REG1 REG2 using D4 L as temp MOVE RA REG1 D4 L MOVE R REG2 R PREGL MOVE D4 L R REG2 ENDM If the source file contained the following SET statements and macro call AREG SET 0 BREG SET 1 SWAP SYM AREG BREG the resulting expansion would appear as follows on the source listing MOVE RO D4 L MOVE R1 RO MOVE D4 L R1 Motorola Motorola Assembler Notes C 3 Assembler Significant Characters C 2 5 Return Hex Value of Symbol Character The lt symbol gt sequence when used in macro definitions is replaced by an ASCII string representing the hexadecimal value of symbol This operator may be used in association with the backslash Y operator The value of symbol must be an integer not floating point Example C 6 Example of Return Hex Value Symbol Character Consider the following macro definition GEN LAB MACRO LAB VAL STMT LAB SVAL STMT ENDM If this macro were called as follows NUM SET 10 GEN_LAB HEX NUM NOP the resulting expansion would appear as follows in the listing file HEXA NOP C 2 6 Macro Local Label Override The circumflex when used as a unary expression operator in a macro expansion causes 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
191. the pin to operate in the ESSI mode On the other hand setting the corresponding bit pin to 0 configures the pin to function in the GPIO mode Notice that each pin is individually configured to be in the ESSI mode or the GPIO mode D 5 1 ESSI GPIO Shared Registers Table D 2 lists and describes the functions of the ESSI GPIO shared registers Motorola DSP56303EVM User s Manual D 4 ESSI Port Registers Table D 2 ESSI GPIO Shared Registers Register Name Function Port Control Register C PCRC Controls whether to use the ESSIO port in ESSI mode or GPIO mode Port Control Register D PCRD Controls whether to use the ESSI1 port in ESSI mode or GPIO mode D 5 2 ESSI Registers The ESSI consists of 12 registers specific to the ESSI mode Recall that the DSP5630x has two ESSI ports Therefore there are two sets of ESSI registers one for ESSIO and the other for ESSI1 Table D 3 displays a list of the ESSI registers Table D 3 ESSI Registers Register Name Function Control Register A CRA Controls ESSI Mode operations Control Register B CRB Controls ESSI Mode operations Status Register SSISR Describes status and serial flags Transmit Slot Mask Register A TSMA Determines when to transmit during a given time slot Transmit Slot Mask Register B TSMB Determines when to transmit during a given time slot Receive Slot Mask Register A RSMA Determines when
192. tializing and Interfacing the ESSI and CODEC Ports TE2 Transmit register 2 14 0 disabled MOD Mode 13 1 Network Mode SYN Synchronization mode 12 1 Synchronous mode CKP Clock polarity 11 0 Data and frame sync clocked on rising edge FSP Frame Sync Polarity 10 0 positive polarity FSR Frame Synch Relative 9 1 Frame synch begins Timing one bit before first bit of data word FSL Frame Sync Length 8 7 10 Rx bit length TX bit length SHFD Shift direction 6 0 shift MSB first SCKD Clock source direction 5 0 SCK is input clock SCD2 SC2 pin direction 4 0 SC2 is input SCD1 SC1 pin direction 3 1 SC1 is output SCDO SCO pin direction 2 1 SCO is output OF 1 0 Output flags 1 0 N A Notice that only the ESSIO control parameters are configured Since ESSII functions in the GPIO mode the control parameters do not need to be set Example D 4 illustrates the task of setting the control registers for the ESSIO port according to the specifications given in Table D 9 and Table D 10 Motorola DSP56303EVM User s Manual Phase Il Initializing and Interfacing the ESSI and CODEC Ports Example D 4 Setting Control Registers for the ESSIO Port Setting ESSIO Control Parameters Control Register A movep FS101807 x M_CRAO 12 288MHz 16 768KHz SCLK prescale modulus 8 frame rate divider 2 16 bits per word 32 bits per frame 16 bit data aligned to bit 23
193. tion 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 lt llc gt 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 lt exp2 gt is not specified then the last value and mode that the counter had is used If the last half of the operand field in an ORG directive dealing with the load memory space and counter is not specified then the assembler assumes 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 loaded into the address and memory space where it is when the program is run it 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 giv
194. tive FORCE SHORT force operands short 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 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 is generated Note A label is not allowed with this directive See also SECTION XDEF XREF Example C 48 GLOBAL Directive SECTION IO GLOBAL LOOPA LOOPA will be globally accessible by other sections ENDSEC C 3 28 GSET Set Global Symbol to a Value label GSET expression GSET label expression 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 C 26 DSP56303EVM User s Manual Motorola Assembler Directives 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
195. tive processing Integer arguments are stored as is but must be byte values i e within the range 0 255 floating point numbers are not allowed Single and multiple character strings are handled in the following manner e Single character strings are stored in a word whose lower seven bits represent the ASCII value of the character See Example C 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 Motorola Motorola Assembler Notes C 15 Assembler Directives characters left aligned and the rest of the word is 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 C 28 Note See also BSC DC Example C 30 DCB Directive TABLE DCB two 0 strings O0 CHARS DCB PART LOT ADA C 3 10 DEFINE Define Substitution String DEFINE symbol string The DEFINE directive is used to define substitution strings that are used on all following source lines All succeeding lines are searched for an occurrence of symbol which is replaced by string This directive is useful for providing better documentation in
196. to receive during a given time slot Receive Slot Mask Register B RSMB Determines when to receive during a given time slot Time Slot Register TSR Prevents data transmission during a time slot Receive Data Register RX Read only register that receives data Transmit Data Register 0 TXO Transfer data for transmitter 1 Transmit Data Register 1 TX1 Transfer data for transmitter 2 Transmit Data Register 2 TX2 Transfer data for transmitter 3 D 5 3 GPIO Registers While functioning in the GPIO mode the ESSI port accesses four registers specific to the GPIO mode Refer to Table D 4 for details on the registers Motorola Codec Programming Tutorial Digital Interface ESSI Codec Table D 4 GPIO Registers Register Name Function Port Direction Register C PRRC Controls the direction of data flow for ESSIO port in GPIO mode Port Direction Register D PRRD Controls the direction of data flow for ESSI1 port in GPIO Mode Port Data Register C PDRC Stores data received or transmitted for ESSIO port in GPIO mode Port Data Register D PDRD Stores data received or transmitted for ESSI1 port in GPIO mode D 5 4 GPIO Mode Port C and Port D After a specific pin has been set to function in the GPIO mode the direction of data flow must be configured In other words the ESSI port must know whether the pin is receiving data or transmitting da
197. to the assembler on pass one that is the address is a forward or external reference then the assembler picks the long form of addressing by default If this is not desired then the I O short form of addressing can be forced by preceding the absolute address by the I O short addressing mode force operator Example C 14 Example of an I O Short Addressing Mode Force Operator Since the symbol IOPORT is a forward reference in the following sequence of source lines the assembler would pick the long absolute form of addressing by default BTST 14 Y IOPORT IOPORT EQU Y SFFF3 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 BIST 4 Y lt lt IOPORT IOPORT EQU Y SFFF3 C 2 13 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 picks the long form of addressing by default If this is not desired then the short absolute form of addres
198. torola DSPs correctly in accordance with the following descriptions e Phase 1 Setting up global constants This phase includes such activities as setting up buffer spaces and pointers setting codec control information constants and defining interface constants and pins e Phase 2 Interfacing and Initializing the ESSI and the codec The bulk of the work needed to obtain a working interface between the DSP5630x and the codec lies in this phase The procedures include such activities as setting up and initializing the codec ports setting up and initializing the ESSI ports and finally interfacing the codec and ESSI ports e Phase 3 Data transferring mechanisms This phase includes information concerning the types of data transfer mechanism Polling DMA and interrupts are the three types available to the programmer However the interrupt method of transferring data will be discussed in detail in this document D 8 Phase 1 Setting up Constants D 8 1 Setting Up Buffer Space and Pointers Phase 1 begins with setting up buffer spaces and pointers The buffer spaces and pointers offer a temporary storage for the incoming and outgoing data These variables come in the form of receive and transmit buffer and pointers In addition to offering a temporary storage the pointers offer a method to access the memory location of the stored data Example D 1 demonstrates the task of setting up transmit and receive buffers and pointers Example D
199. transfer rates RS 232 interface cable DB9 plug to DB9 female Power supply 7 9 V AC or DC input into a 2 1 mm power connector Audio source tape player radio CD player etc Audio interface cable with 1 8 inch stereo plugs Headphones Installation Procedure Installation requires the following four basic steps 1 Preparing the DSP56303EVM board 2 Connecting the board to the PC and power 3 4 Testing the installation Installing the software DSP56303EVM User s Manual Motorola Installation Procedure 1 2 1 Preparing the DSP56303EVM Warning 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 antistatic flooring and bench surfaces Always use grounded wrist straps when handling sensitive components Do not remove components from antistatic packaging until required for installation Always transport sensitive components in antistatic packaging Locate jumper blocks J1 J4 J5 and J8 as shown in Figure 1 1 For block J1 make sure that there are jumpers connecting pins 3 and 4 and pins 5 and 6 For blocks J4 JS and J8 make sure that all
200. u DNIA e HH 13838 ber amp 200 13538 qu WEH ro A paan DI En HOME seu d t i teu oveaiev L gt gt 113538 218d N3H pp osa ie 37 osonsa TL tsosa E mrd 80 gg Ol voul vaOW bh EOYl 800W IWN DGOW 88 Py H 01 01 iM seu IEUQ eeu Na I 08AdZ0095dSd zn A Ni A 5 DSP56303EVM User s Manual MOTOROLA 28p09 oipny G y ainbi4 3 a L Jo S AS soo 4Sa ueufiseg 8661 OL jequieAoN epsen eieq UL 8 r 1 lequnwN 8H NSQ 0 968dS wudumooN US Boe e i E 1108 99P09 OIPNY oui 09 6 0 1 rp o Nigo Se 00721 I 0 f 1018 vie30 0W O92 168 215 XVA eis9 L69 zis f i 1590 den RAD i 00 9T 0 0 En 8698 SE 82 XL Uunsny 1S8M SAG uouue ueillM L0S9 Y E i UOJSIAIG 19Q119SGNS ssa 8J1M i Q0 te 9 Set Dor ce 1 0 0 i 00 gp 0 0 0 ZHM S4 San Lan 94N Pal a ROE CEs oe SR CS o EI ONAS4 93009 2098 1098 an A E FETI t 1fn00S 030007 oaus y san NIOS 23009 0015 z i S 13538793009 0098 Aa 1198793009 0398 er ani veo are Leu E xo Aor pi 128 024 DO e w 2 2 AES 5 z MEt at ACER Anne E 869 bos 8 1n0 NH ype oar
201. unning at For this application the PLL will be set to 86 016MHz The interrupts are masked with the correct values The hardware stack pointer is initialized Operate DSP on Mode 0 The data interrupt stack pointer is initialized which is the stack used in the ISR for the codec Assert linear addressing for the stack pointer used for by the data interrupts Example D 20 illustrates the initialization procedures of the DSP Motorola DSP56303EVM User s Manual D 32 Example Application Example D 20 DSP Initialization Procedure org p 100 START main movep 445040006 x M PCTL PLL 7 X 12 288 86 016MHz ori 3 mr mask interrupts movec 0 sp Clear hardware stack pointer move 0 omr operating mode 0 move 940 r7 initialize stack pointer for ISR move 1 m7 linear addressing Following the initialization procedures of the DSP the codec also needs to be initialized Again using the supplied code a jump statement can be made to start the CODEC ESSI initialization routine Example D 21 demonstrates this procedure Example D 21 Initializing CODEC ESSI jsr ada init initialize CODEC ESSI The DSP and codec are ready to receive instructions to receive process and transmit data The echo implementation requires that a buffer is setup and initialized The code in Example D 22 can be used to perform these steps Example D 22 Setting Up and Initializing Buffer move 50400 r4 start echo buffer at 400
202. valid only with the A and B options Note Multiple options can be used A typical string might be as follows Example asm56300 A B L G filename asm Motorola Example Test Program 2 7 Assembling the Program 2 2 3 Assembler Directives In addition to the DSP56303 instruction set the assembly programs can contain mnemonic directives that 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 2 2 3 1 Assembler Significant Characters The following one and two character sequences are significant to the assembler Comment delimiter Unreported comment delimiter V Line continuation character or macro dummy argument concatenation operator Macro value substitution operator Macro hex value substitution operator Macro local label override operator Macro string delimiter or quoted string DEFINE expansion character Function delimiter Location counter substitution String concatenation operator Substring delimiter lt lt I O short addressing mode force operator lt Short addressing mode force operator gt Long addressing mode force operator Immediate addressing mode operator lt Immediate short addressing mode force operator gt Immediate long addressing mode force operator 2 8 DSP56303EVM
203. 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 opl gt LT lt op2 gt OR lt op3 gt GE lt op4 gt 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 Motorola Motorola Assembler Notes C 61 Structured Control Statements 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 IF CVI SQT 4 0 GT 2 no white space in first operand C 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
204. 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 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 may have any memory space attribute lt label gt if present is assigned the value of the runtime location counter after a valid base address has been established Only one word of object code is shown on the listing regardless of how large the first expression is However the runtime location counter is advanced by the number of words generated Note See also BSC BSB DC Example C 23 Block Storage Modulo Directive BUFFER BSM BUESIZ SFFFFFFFF INITIALIZE BUFFER TO ALL ONES C 3 5 BUFFER Start Buffer BUFFER lt 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 pair although BUFFER
205. xp2 gt lt exp5 gt The PAGE directive has two forms 1 Ifno arguments are supplied then the assembler advances the listing to the top of the next page In this case the PAGE directive is not output 2 The PAGE directive with arguments can be used to specify the printed format of the output listing Arguments may be 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 is printed in the source listing Note A label is not allowed with this directive The arguments in order are as follows 1 PAGE WIDTH lt exp1 gt Page width in terms of number of output columns per line default 80 min 1 max 255 2 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 zero turns off all headers titles subtitles and page breaks 3 BLANK TOP exp3 Blank lines at top of page default 0 min 0 max see below 4 BLANK BOTTOM exp4 Blank lines at bottom of page default 0 min 0 max see below 5 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 TO

Download Pdf Manuals

image

Related Search

Related Contents

Mode d`emploi www.juwel-aquarium.com  DMC2000 - user manual without Portuguese V1,0  NSW VIS Classification Web 2.1: Public User Manual    Philips VR6390 User's Manual  www.philips.com/welcome FR Manuel d`utilisation 1 Assistance  Melissa 631-047 User's Manual  BHS 6014  Rename - Code Inventors  LED Commander Pro V2  

Copyright © All rights reserved.
Failed to retrieve file