Home

TMS320C54x DSKPLUS DSP STARTER KIT USER'S GUIDE

image

Contents

1. aNd L IND A 3 0 0 ZHINOL N eu 98 Q313400S z vn 2 VON dIN ANO a 88 LqINy O vie ileso 9 156 82u 8l6lzl 0 gt zealtooeloiz 09 v zit lolo elol ol zvisle Lie 8 lele elele ziz el ve L E 162 418 6 01 MOL Sey veu gt Lk 9 L SSSSSSSSSSSSSSSSSSSSSS8ESESSE NIM19 2xX NIM1D aaan N SSSSSSSSSSSSSSSSSSSSSSSS ix E WWW O ANAAKRAKRANAKRANANAANNAKAAANAAAAAAN 96 SL 68 SL x d 9000902590225 39 Zan 09 AOL oL E yOL 7770 HL m uai dh USHL me 1SyL 999 W H41L XS4L ic XS4l 1al a Id daVU YSsL m HSL oa OaL XyOL noi LQW3 x m JJO LnIN3 uxo MTL onna un onna 1no19 e 100x129 xSsa XSdg INOL an INOL 01198 es 8 1019 T ola HSJg usa 3X 4x yaa S yag yuo A u 18 OSN oS xag xag Va1OH az Vd OH LaH 9 ZH OvI DVI 90H E 90H Q10H qd OH SQH sei SQH AQv3u a AQV38 baH A baH gylSol gu Sol Ei eaH Es eaH VIE LSIN ved gylSW zaH m zaH L L EO sq d lz dSd zy990zESINL 8g Sd deg Sd SVH m SVH SI SI gyH gyH 19H a 9H Sk dr ect eig 011NOH ect O7 LNOH eig IZL 68 za LSQH LSCH eld eH La LIINOH ze L11NOH La 8LL 9r ora LNIH INIH pa eL 6a SOH ES SOH B 3H sa NANHH a
2. 8 KR Reserve 1 word in varl 9 10 0000 ptr usect varl 1 11 12 p dir div dir sib dir dir dir sir vir dir dir oir dir div dir dir dir dir dir dir cir dir dir vir dir dira dir di eir dira die oi dir dir dir vir vir dio dir dir A 13 Reserve 100 words in varl 14 15 0001 array usect varl 100 16 17 0001 F000 A A 037h Still in text 0002 0037 18 19 HT RARE RR RAR TER TE RATE TERR TO TERR TERR DE TRE TE TERRA TE RRE TRES 20 nw Reserve 50 words in varl KK 21 22 0065 dflag USect varl 50 2 24 0003 FOOO A A dflag Still in text 0004 0065 25 26 KKK K KKK KKK KEKE KKK KEKE KKK KR KKK ERK KKK KKK KKK KK KK 27 Reserve 100 words in var2 x 28 KKEKKKRKKK KK KKK KR KKK KKK KR KKK KKK IKK KKK KKK AAA AAA A 29 0000 vec USect var2 100 30 31 0005 F000 A A ve
3. Begin assembling 1nto Vars sections ne p dir dir dir dir dir di di dir dir dir dir dir dis diro dir dir dir dir dir dir dir div dir dir dir dir dis dir div dir dir dir dir di dis dir dir dir dir dir di dir di dir diris SC Mars WORD LEN Set 1 8 DWORD LEN Sec WORD_LEN 2 BYTE_LEN Set WORD_LEN 2 aba Resume assembling nto text section pa dir dir dir dir di di div dir dir dir dir dir dis diro dir div dir dir di di dir div dir dir dir dir di dir div dir dir dir dir di dis dir dir dir dir dir di dir dir dir diris text A A 42h Assembled into text byte 3 4 Assembled into text KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK as Resume assembling into Vars section WR ckckck ckock kkk kk kkk kkk kk kkk kkk kkk kkk kkk kkk kkk kock kok kc Sect Mars field 13 WORD LEN field OAh BYTE LEN field 10g DWORD LEN Syntax Description Define Assembly Time Constant set equ symbol set value symbol equ value The set and equ directives equate a constant value to a symbol The symbol can then be used in place of a value in assembly source This allows you to equate meaningful
4. Still in text section KEK KKK KR RE KK KE KK RE KR TERA A RRR RK KR RRR EK KR RR KK RK KEK RK KR RE KR RR KR KEKE EK SK FOOO A A 56h 0056 FO66 A T 73h 0073 kkk sir dir dir dir iir ir ir dir dir ir io dir oir iir ir re di KKK KR KR KKK KK KR KKK KKK KK ARA KR KK KKK KKK KK KKK KK KKK KX Assemble into the Vectors section KIRK KBE KR RR KERR KK RK KR KEK RRR KR KR REE RE KK RR RR RICK ERR RR KR ERR KR KR KR KIER EK SE sect Vectors F4EB RESET return enable Space 3 16 FAEB NMI FOLturn enable Assemble more Code into text section LOSE 8050 QVar 1 2 A end Reserve Space space bes Syntax space size in bits bes size in bits Description The space and bes directives reserve size number of bits in the current section and fill them with Os When you use a label with the space directive it points to the firstword reserved W
5. Schematic Diagram of DSKplus Circuit Board SZLOHbZ SN L 5 SL ar el nl SNg Ab vr e M bl OL ADV 8 ve 6 a LL 9 lt Jd AZ vz L 9 gl 7 E 1978 AL YL v z en Gre LOVE yla O 9 6L LOH LY 19 ag z 8l 90H s ev eg m 909 SCH A ev eg 5 sag yaH vv vg of vag aH 8 SV sg a egg zaH Y 9v 9g l zag e LOH E IN 9 Si Lag A 00H E 8v 89 oag in G zi 1 8 L2 599 S isy NNNN uasgy gt 13838 FLA 3119 zSaH a guls MNH E MNHH 18N 00H gz lt GH 18H LOH ISIHL L11NO E LTLNOH m 10d O1LNO 7 O1LNOH LAO ON 6L e al ON tz el 3dOW ON Z 9L N34ng ON oz LL T blo j en o z LO 901d 03134908 bvu A i 6 NAOVOLAZZ Wd lL O g L O 9 9 v e O z LO 9df R mola QNO an A A za 01 XOL M01 0L XOL ant zy ze ecu GZH 92H 819 wz ley YOLONGNI AAAS 17 DOA penunuoo pjeog mano snidysqg jo wesbeig onevweyos 2 y ainbi4 i it Board Ifcul Schematic Diagram of DSKplus C
6. Resume assembling into data section p dir dir dir dir dir di dir dir dir dir dir dir dios dir dir dir dir dir dir dir dios dir dir dir dir dir di diro dir dir dir dir dir dis dir dir dir dir dir di dir diri d data byte OCh DUDA Resume assembling into text section text SEring COUTE Assembler Directives Reference C 33 title Define Page Title Syntax title string Description The title directive supplies a title that is printed in the heading on each listing page The source statement itself is not printed but the line counter is incremented The string is a quote enclosed title of up to 65 characters If you supply more than 65 characters the assembler truncates the string and issues a warning The assembler prints the title on the page that follows the directive and on sub sequent pages until another title directive is processed If you want a title on the first page the first source statement must contain a title directive Example In this example one title is printed on the first page and a different title on
7. ou D 1 Lists the error messages that the assembler issues and gives a description of the condition that caused each error A oo Oo HS E 1 Defines acronyms and key terms used in this book Contents xiii Figures dE 1 I dI om deed ise oh ap ab Mo we e a XIV Dokplus Board Diagram uaaacezaaeucesrsxQescucue ire dev buts aa needs paraa mds 1 4 DSKplus Memory Map i 1 5 wonnection DIOE elTe o cosas pes bata PET dea PESE debe nq 2 2 Code Explorer Port Selection Dialog Box i 2 3 Code Explorer Debugger Interface i 2 4 Sel Tes SCPI orador Ton aid qi as 2 6 Debugger Overview i 3 2 DSKplus Assembler in the Software Development Flow 0 5 3 Using the space and bes Directives i 5 25 Using the field Directive iux deem sr mee mh Xe S boe E RR hecho n 5 26 Using Initialization Directives llle IRR 5 28 Using the align Directive cem trees Hh E deeds dace oie 5 29 Dala IACOISIC so a ET TIT IT T T TET TIT TIT LITT TT 6 5 Sealusegisler se mida sort brete bear 6 5 CONMOACOISICN ne en ne ds o ein Ou ene js a mae a ore 6 6 PAL Device s Internal Logic Diagram 0 00 c cece RR RR 6 7 Functional Diagram for a 4 Bit Read Cycle i 6 9 Functional Diagram for a Write or 8 Bit Read Cycle i 6 10 TMS320C54x DSKplus Circuit Board Dimensions i A 2 Schematic Diagram of DSKplus Circuit Board i A 3 The field Direct
8. I TEXAS INSTRUMENTS Printed in U S A October 1996 SPRU191 SDS pens ip TIU TMS320C54x DSKplus S NM M DSP Starter Kit TMS320C54x DSKplus User s Guide DSP Starter Kit Literature Number SPRU191 Januar y 1998 35 TEXAS INSTRUMENTS IMPORTANT NOTICE Texas Instruments T reserves the right to make changes to its products or to discontinue any semiconductor product or service without notice and advises its customers to obtain the latest version of relevant information to verify before placing orders that the information being relied on is current Tl warrants performance of its semiconductor products and related software to the specifications applicable at the time of sale in accordance with Tl s standard warranty Testing and other quality control techniques are utilized to the extent Tl deems necessary to support this warranty Specific testing of all parameters of each device is not necessarily performed except those mandated by government requirements Certain applications using semiconductor products may involve potential risks of death personal injury or severe property or environmental damage Critical Applications TI SEMICONDUCTOR PRODUCTS ARE NOT DESIGNED INTENDED AUTHORIZED OR WARRANTED TO BE SUITABLE FOR USE IN LIFE SUPPORT APPLICATIONS DEVICES OR SYSTEMS OR OTHER CRITICAL APPLICATIONS Inclusion of TI products in such applications is understood to be fully at the risk of the custom
9. 3 One or more blanks must separate each field Tab characters are equiva lent to blanks L Comments are optional Comments that begin in column 1 can begin with an asterisk or a semicolon or but comments that begin in any other column must begin with a semicolon The following are examples of source statements SYM1 set 2 Symbol SYM1 2 Begin AR1 SYM1 Load AR1 with 2 word 016h Initialize word 016n A source statement can contain four ordered fields The general syntax for source statements is as follows label instruction comment Labels are optional for all assembly language instructions and for most assem bler directives except for set and equ which require labels When a label is used it must begin in column 1 of a source statement A label can contain up to 32 alphanumeric characters A Z a z 0 9 _ and Labels are case sensitive unless c is used in invoking the assembler and the first character cannot be a number A label can be followed by a colon the colon is not treated as part of the label name If you don t use a label the first character position must contain a blank a semicolon or an asterisk When you use a label its value is the current value of the section program counter the label points to the statement it is associated with For example DSKplus Assembler Description 5 7 Source Statement Format if you use the word directive to initialize sever
10. width 100 Syntax Description Example Start Stop Source Listing list nolist list nolist Two directives enable you to control the printing of the source listing The list directive allows the printing of the source listing The nolist directive suppresses the source listing output until a list directive is encountered The nolist directive can be used to reduce assembly time and the source listing size The assembler does not print the list or nolist directives or the source statements that appear after a nolist directive However it continues to increment the line counter You can nest the list nolist directives each nolist needs a matching list to restore the listing By default the source listing is printed to the listing file the assembler acts as if the list directive had been specified oo Note If you don t request a listing file when you invoke the assembler the assembler ignores the list directive LI A C X This example shows how the copy directive inserts source statements from another file The first time this directive is encountered the assembler lists the copied source lines in the listing file The second time this directive is encoun tered the assembler does not list the copied source lines because a nolist directive was assembled The nolist the second copy and the list directives do not appear in the listing file
11. Deter te tO DO OO Had DY O rc c cl HBIL 1 oco edo edo cedo cedo cedo edo cedo cedo cedo edo edo tO HOO tel cH A rn e e sc NBL BUFEN Aooocecooeoc O H H AH AH AH H AH dH AH AH AH AHA A DA TATA TH OOOO OOO OC O LI Al bd l bd LILJ O l ll O O O ll Y ll O ll O 4 O O LL O O LJ ll O L4 LJ O ll dl O LJ LIII CL p mm r FAS r ARAS AA or oco AA FRA AAA AAA AA AFA AAA HAS TT AAA FAA r3 o TY TT dd dd dd LLL LLLI LL dd A dd LLLI Ad dd dd ld dd dd dd dd dd dl dd dd dd dd dl dd Ad dl end B 6 Appendix C Assembler Directives Reference Assembler directives supply program data and control the assembly process They allow you to do the following Assemble code and data into specified sections Reserve space in memory for uninitialized variables Control the appearance of listings Initialize memory Assemble conditional blocks O O O O C L Define global variables This appendix is a detailed reference for all of the DSkplus assembler direc tives Each directive is described individually including syntax and examples and the directives are presented in alphabetical order Generally the direc tives are organized one directive per page however related directives such as if else endif are presented to
12. O TMS320C542 1 leet HB C26 O 1 T O L1 HELLE LLL I la a co o R34 L 1 R54 R53 R35 R46R45 S r1 rn Of oQOooooooooooo JP2 Oo OODODODOODOODO 000000000000 0000000 Loooooooooooo D O O O O O O O O O OJ O0 O O O HBO EIllt jOOOOO0000000 O u5 MININ Kis DSP Hbbgbgbbgggbb6b L1 oo R36 eX TTE aal fella o o C24 Oo JP1 L R39 JP3 ox Buffered serial port BSP XDS510 DSP external 8 bit bidirectional and host port interface HPI emulator data bus 4 bit unidirectional control signals port printer port connectivity IEEE1149 1 standard enabling high speed sd cable included The host port interface logic is an on board PAL device that operates as the main interface between the host PC s parallel port and the C542 host port in terface HPI As a result the interface logic gives the host PC direct control of the C542 s HPI and DSP reset signal and it can configure the board to operate with different PC parallel ports that is 4 bit and 8 bit printer ports When you power the board and start the debugger the debugger software ini tializes the host interface logic and configures the board to the correct parallel port mode either 4 bit or 8 bit At this time the communication link between the DSKplus board and host PC is ready for operation For the DSKplus and the host to communicate properly the DSP must follow a common communication protocol defined by the host Therefo
13. Action Check spelling pathname environment variables etc E1300 Copy limit has been reached Description These errors are about general assembler limits that have been exceeded The nesting of copy include files in limited to 10 lev els Action Check the source to determine how limits have been exceeded W0000 No operands expected Operands ignored Trailing operands ignored ARn addressing is for write only Description These are warnings about operands The assembler encoun tered operands that it did not expect Action Check the source to determine what caused the problem and whether you need to correct the source W0001 Field value truncated to value Field width truncated to size in bits Line too long will be truncated Power of 2 required next larger power of 2assumed Section Name is limited to 8 characters String is too long will be truncated Value truncated Value truncated to byte size Value out of range Description These are warnings about truncated values The expression given was too large to fit within the instruction opcode or the required number of bits Action Check the source to make sure the result will be acceptable or change the source if an error has occurred Assembler Error Messages D 7 Assembler Error Messages W0002 W0002 Address expression will wrap around Expression will overflow value truncated Description These are warnings about arithmetic expressions The assem bler has
14. Note Watch windows can be set up to watch variables system stack or any other memory location Files can be connected to probe points within your code 3 2 Code Explorer Debugger The CPU registers window allows you to view the internal registers and impor tant bit fields of the DSP To change a value of a register point and click on the register and type in the new value The peripheral register window is like the CPU register window except that it includes only the registers that are used for the DSP peripherals such as the serial ports The data memory window is a default data memory window The starting ad dress and length can be defined using your select button Multiple data memory windows can be displayed allowing you to view any variable such as the system stack or assembly variables Using the data memory window properties screen you can rename the window to reflect the variable name The tool bar on top of the screen includes buttons for single stepping running and resetting the DSKplus board These buttons allow you to step over or into functions The animation button supports a graphical representation of a variable or buffer The data can be viewed in either the time domain or the fre quency domain Code Explorer probe points are used to connect hard disk drive files to points within your application code Once connected these files can be used as in puts or outputs to your code To set a probe point position
15. This pin is used to set the outputs of the bidirectional buffer to the high impedance state for lower power consumption or to allow an external device control of the DSP HPI data lines Pin 21 Latch select mode output general purpose I O Pin 22 No connection Pin 23 Connected to the DSP HDS2 pin and cannot be disconnected If using an external strobe via the JP4 pin 25 header be sure pin 23 of the PAL device is in the 3 state mode Pin 24 Connected to the DSP reset pin RS and cannot be disconnected If you are using an external reset line via the JP4 pin 2 header be sure pin 24 of the PAL device is in 3 state mode The reset LED D2 is con nected to this pin Pin 25 Connected to the DSP HBIL pin and cannot be disconnected If you are using an external HBIL line via the JP1 pin 31 header be sure pin 25 of the PAL device is in 3 state mode Pin 26 NBL selects which nibble is used by the 74257 multiplexer can be used as a general purpose pin if the host PC has an 8 bit bidirectional port Pin 27 Mode latch can be used as a general purpose pin if the host PC has an 8 bit bidirectional port This pin is also pulled high to disable the 74257 multiplexer When pin 27 is high additional external status data etc lines can be connected to be available in the host PC s status register Pin 28 Vcc isolated through inductor L1 Hardware 6 13 Connecting Boards to Headers Connecting the XDS510 Emulator Port
16. literature number SPRU1 79 describes the TMS320C54x digital signal processor algebraic instructions individually Also includes a summary of instruction set classes and cycles TMS320C54x DSP Reference Set Volume 4 Applications Guide literature number SPRU173 describes software and hardware applications for the TMS320C54x digital signal processor Also includes development support information parts lists and design considerations for using the XDS510 emulator TLC320AC01C Fixed Point Digital Signal Processors literature number SLAS057 data manual contains the electrical and timing specifications as well as parameter measurement information for the TLC320AC01C TMS320C54x TMS320LC54x TMS320VC54x Fixed Point Digital Signal Processors literature number SPRSO039 data sheet contains the electrical and timing specifications for these devices as well as signal descriptions and pinouts for all of the available packages Related Documentation From Texas Instruments TMS320C54x Assembly Language Tools User s Guide literature number SPRU102 describes the assembly language tools assembler linker and other tools used to develop assembly language code assembler directives macros common object file format and symbolic debugging directives for the C54x generation of devices TMS320C5xx C Source Debugger User s Guide literature number SPRUO99 tells you how to invoke the C54x emulator EVM and simulator versions of the C sour
17. 6 5 Connecting Boards to Headers External boards sometimes called daughter boards can be connected to the DSKplus board via the six JP headers The universal power supply included with the kit has two independent 5 V power supplies capable of driving a total of 3 3 A Daughter boards may include a 5 DIN connector to separate these power supplies or you may choose to use the included DIN to 5 5 mm adapt er Connectors can be soldered to the JP header holes Many electronic suppli ers can support 12 x 3 configurations 6 6 Connecting the XDS510 Emulator Port This section explains how to add debugging capabilities to your DSKplus board by using Texas Instruments XDS510 emulator The XDS510 emulator port is the JP2 header on the DSKplus board To con nect the XDS510 pod and cable you must first solder a 7 x 2 header to the header on the board The emulator connector is keyed at pin 6 so you must use wire cutters to cut off pin 6 of the soldered JP2 header Once the XDS510 header has been installed turn off the powertothe DSKplus board connect the XDS510 emulator to the board and turn the power back on You do not need to disconnect the parallel port from the DSKplus board You can use the host printer port to cycle the reset line and to generate HPI interrupts etc Additionally by using the XDS510 emulator debugging is less intrusive and much more powerful The XDS510 emulator debugs the C54x DSP via the JTAG emulator port allowin
18. C esr a user ti simuboard utilities L In syntax descriptions the instruction command or directive is in a bold typeface font and parameters are in an italic typeface Portions of a syntax that are in bold should be entered as shown portions of a syntax that are in italics describe the type of information that should be entered Here is an example of a directive syntax sect section name address sect is the directive This directive has two parameters indicated by section name and address When you use sect the first parameter must be an actual section name enclosed in double quotes the second parameter must be an address Notational Conventions Information About Cautions _j Braces and indicate a list The symbol read as or separates items within the list Here s an example of a list gt p I 43 This provides three choices or Unless the list is enclosed in square brackets you must choose one item from the list 3 Some directives can have a varying number of parameters For example the byte directive can have up to 100 parameters The syntax for this directive is byte value values This syntax shows that byte must have at least one value parameter but you have the option of supplying additional value parameters separated by commas Information About Cautions This book contains cautions This is an example of a caution statement A caution statement describes a s
19. Connection Diagram Printer cable Power supply 5 V Power Power connector PC display for software and debugger 2 2 2 2 Installing the DSKplus Software Installing the DSKplus Software From the File menu item in the Windows program manager click on the RUN command or in Windows 95 click on the Start button and select Run and then type A SETUP EXE By default the installation program installs the software to the C DSKplus di rectory If you like change this directory when you are prompted to confirm the destination directory After running the install program a Windows program group icon appears called Code Explorer It has two program icons Code Explorer and C54x Help The ab solute assembler application loader and self test are not members of this group because they are DOS programs and are accessed through the Windows DOS shell Totestthe setup click on the Code Explorer icon The port dialog box appears as shown in Figure 2 2 Figure 2 2 Code Explorer Port Selection Dialog Box Setup Parallel Port Port a LPT1 C LPT2 Port 170 Address 0x278 Exil Help The debugger lists all available parallel ports in the dialog box You may select one of the ports listed or type in the desired port I O address to override the existing address The correct port will start the debugger interface See Sec tion 3 1 Code Explorer Debugger page 3 2 for more information Installing the DSK
20. No matching endif specified No matching endloop specified No matching loop specified Unmatched endloop directive Unmatched if directive These are errors about unmatched conditional assembly direc tives A directive was encountered that requires a matching direc tive but the assembler could not find the matching directive Correct the source per the error message text Conditional nesting is too deep Loop count out of range These are errors about conditional assembly loops Condi tional block nesting cannot exceed 32 levels Correct the if elseif else endif or loop break endloop source Cannot apply bitwise NOT to floats Unary operator must be applied to a constant These are errors about an illegally used operator The opera tor specified was not legal for the given operands Correct the source per the error message text so that all required operands are declared E0100 Description Action E0101 Description Description E0200 Description Action E0201 Description Action Assembler Error Messages E0100 E0101 E0200 E0201 Label missing setsym requires a label These are errors about required labels The given directive requires a label but none is specified Correct the source by specifying the required label Labels are not allowed with this directive The error is about an invalid label The given directive does not permit a label but one is specified Remo
21. The sect directive defines a named section that can be used like the default text and data sections The sect directive begins assembling source code into the named section The section name identifies a section that the assembler assembles code into The name is significant to eight characters and must be enclosed in double quotes This example defines two special purpose sections Sym_Defs and Vars and assembles code into them P Begin assembling into text section Xm AAAA RRR KRR RKE RRR ckock kock kock RRK RR RKR ckock KKK KKK kock kock kok ek text A 78h Assembled into text A A 36h Assembled into text Begin assembling into Sym Defs section sect Sym Defs Eloat 0 05 Assembled into Sym Defs Xs word OAAh Assembled into Sym Defs A A FX Assembled into Sym Defs
22. dis dir dir dir div di dir dir di dir dir dir dir di di diris y Main Program COPY 4nops inc CSXt nop NOPS function begins here nop nop nop PMST 00a0h Field 2 Field 3 Field 1 DSKplus Assembler Description 5 19 DSKplus Assembler Directives 5 11 DSKplus Assembler Directives Assembler directives supply data to the program and control the assembly process Assembler directives enable you to do the following Assemble code and data into specified sections Reserve space in memory for uninitialized variables Control the appearance of listings Initialize memory Initializing the addresses for specified sections Assemble conditional blocks Examine symbolic debugging information O O C O O L L Appendix C Assembler Directives Reference contains the individual direc tives descriptions in alphabetical order 5 11 1 Directives Summary Table 5 2 summarizes the assembler directives o 1 Note Any source statement that contains a directive may also contain a label and a comment Labels begin in the first column and they are the only item al lowed to appear in the first column and all comments are preceded by a semicolon or an asterisk To improve readab
23. 25M to DB 25F Universal power supply Input 100 250 V 50 60 Hz Output 5 V dc 3 3 A GoDSP s Windows based Code Explorer debugger TMS320C54x C54x algebraic assembler Self test program Various application programs TMS320C54x DSP Reference Set Volume 1 CPU and Peripherals 1MS320C54x DSP Reference Set Volume 3 Algebraic Instruction Set TMS320C54x DSP Data Sheet TLC320AC01C Single Supply Analog Interface Circuit Data Manual Several features of the DSKplus board enable MIP intensive low power applications O O C O O O O O O O O O O C C L One TMS320C542 C542 enhanced fixed point DSP 40 MIPS 25 ns instruction cycle time 10K words of dual access RAM DARAM 2K words boot ROM One time division multiplexed TDM serial port One buffered serial port BSP One host port interface HPI for PC to DSP communications One on chip timer Three power down modes on the C542 Programmable voice quality TLC320AC01 DAC ADC interface circuit Socketed PAL22V10 for board customization Socketed oscillator Phase locked loop PLL clock generator XDS510 emulator header I O expansion bus and control signals for external designs Standard 1 8 inch mono mini jacks for analog I O microphone and multi media speakers What You Need 1 2 What You Need Make sure that you have the appropriate hardware and software 1 2 1 Hardware Requirements In addition to kit contents you need the following equipment to use the
24. 6 7 and 8 data initializes words with the values 9 10 11 12 13 14 15 and 16 var_defs initializes words with the values 17 and 18 bss reserves 21 words xy reserves 20 words The bss and usect directives do not end the current section or begin new sections they reserve the specified amount of space and then the assembler resumes assembling code or data into the current section DSKplus Assembler Description 5 23 DSKplus Assembler Directives Example 5 2 Using Sections Directives 9 24 RP RP w Nae OW O ONAA RA NE H E a OO O NAD OI NP 22 2 3 24 25 26 27 28 29 30 31 32 33 34 30 36 37 38 39 40 41 42 43 44 45 000500 000500 000501 000502 000503 000600 000600 000601 000602 000603 000080 000080 000081 000604 000604 000605 000550 000606 000607 000504 000504 000505 000750 000563 000506 000507 Selsect Setsect text Setsect data 0600h Setsect bss 0550h setsect XY 0750h Var_defs 080h 0500h Start assembling into text section at 0500h CC ckockockockockockockockockockockock ck ck ck ck ck ck ck Ck CK 0 0 0 0000000 KK X Kx Kx Kx Kx AAA e e Sk Sk Sk Sk Sk Sk Sk SK X MX Lext 0001 wo
25. Also the line counter is incremented even when source statements are not listed Assembler Directives Reference C 21 list nolist Start Stop Source Listing Source file QOCODY COpy2 asm Back in original file NOP nolist COPY ocobDy2 asm list Back in original file String Done Listing file 1 COPY GODVZ asm A 1 In copy2 asm copy file A 2 0000 0020 word 32 1 A 0001 0042 2 Back in original file 3 0002 F495 NOP 7 Back in original file 8 0005 0044 string Done 0006 006F 0007 006E 0008 0065 C 22 Syntax Description Example Initialize Long Word long xlong long value value Xlong value value The long and xlong directives place one or more 32 bit values into consecutive words in the current section The most significant word is stored first The long directive aligns the result on the long word boundary while the xlong directive does not You can use up to 100 values but they must fit on a single source statement line If you use a label it points to the first word that is initialized This example shows how the long and xlong directives initialize double words 1 0000 0001 0002 0003 0004 0005 0006 0007 2 0008 0009 000a 000b 3 UUUE 0000 ABCD 0000 0141 0000 0067 0000 006F 0000 0000 AABB CCDD DAT1 long OABCDh A 100h xlong DAT1 OAABBCCDDh DAT2 Assembler Directives Reference I gg
26. Character Strings 5 7 Character Strings A character string is a string of characters enclosed in double quotes A double quote that is part of a character string is represented by two consecutive dou ble quotes The maximum length of a string varies and is defined for each di rective that requires a character string Characters are represented internally as 8 bit ASCII characters These are examples of valid character strings sample program defines the 14 character string sample program PLAN C defines the 8 character string PLAN C Character strings are used for the following Filenames as in copy filename Section names as in sect section name Section address initializers as in setsect section name Data initialization directives as in byte charstring Operands of string directives O O C C L 5 12 5 8 Symbols 9 9 1 Labels Symbols Symbols are used as labels constants and substitution symbols A symbol name is a string of up to 32 alphanumeric characters A Z a z 0 9 and _ The first character in a symbol cannot be a number and symbols cannot contain embedded blanks The symbols you define are case sensitive for example the assembler recognizes ABC Abc and abc as three unique symbols You can override case sensitivity with the c assembler option A symbol is valid only during the assembly in which it is defined Symbols used as labels become symbolic address
27. DSKplus board _ Host A 386 486 or Pentium PC witha 1 44M byte 3 5 floppy disk drive Port DSKplus supports 4 bit parallel ports and 8 bit bidirectional parallel ports DSKplus does not support Enhanced Printer Port and Extended Capabilities Port functionality However DSKplus can operate in standard mode of these ports Memory Minimum of 4M bytes Monitor Color VGA 1 2 2 Software Requirements In addition to the provided software you need the following applications to use the DSKplus board Windows Windows 3 1 or Windows 95 ASCII editor Introduction 1 3 Functional Overview 1 3 Functional Overview The diagram of the DSKplus development board is shown in Figure 1 1 It identifies the analog interface circuit TLC320ACO1 ACO1 IEEE 1149 1 emulation port XDS510 host port interface HPI CPU and peripherals Figure 1 1 DSKplus Board Diagram Standard 1 8 mini jacks for direct microphone and multimedia speaker connection analog interface Voice quality ACO1 Socketed 22V 10 PALO DSP external emana for HPI applications programmable address bus 40 MIP C542 DSP JP6 R37 ON Ooo o LI R48 Oooooocoooooo 0000000000 a O ooooooboooool Hoobooooooooo ueooop o JP4 IDoooooubooooo booooooooo coo U3 o L1 C31 LT O R43 r1 C33 LT LI 0 OO Lo oO Ol R6 9 C35 D2 T LI 0 r1 VY LOU O Universal 5 V power supply included O c34
28. Example 3 O14 WN E Example 4 0000 0000 0080 0008 0009 000a 000b 000c 000d 0000 0001 0002 0003 Initialize 16 bit Integer int word int value valuen Word value value The int and word directives are equivalent they place one or more values into consecutive 16 bit fields in the current section You can use as many values as fit on a single line If you use a label it points to the first word that is initialized In this example the int directive is used to initialize words Space 73h DSS PAGE 128 DSS SYMPTR 3 E856 INST A 56h 000A int 10 SYMPTR 1 35 a INST 0080 FEEF 0084 0008 In this example the word directive is used to initialize words The symbol WordX points to the first word that is reserved 0C80 WORDX word 3200 1 AB OAFh X 4143 EESI 0058 Assembler Directives Reference C 19 length width Set Listing Page Size Syntax Description Example C 20 length page length Width page width The length directive sets the page length of the output listing file It affects the current and following pages You can reset the page length with another length directive 3 Default length 60 lines 3 Minimum length 1 line 3 Maximum length 32 767 lines The width directive sets the page width of the output listing file It affects the next line assembled and the lines following you can reset the page width with another width dire
29. Ft C 23 loop break endloop Assemble Code Block Repeatedly Syntax Description Example C 24 loop well defined expression break well defined expression endloop Three directives enable you to repeatedly assemble a block of code The loop directive begins a repeatable block of code The optional expression evaluates to the loop count the number of loops to be performed If there is no expression the loop count defaults to 1024 unless the assembler first encounters a break directive with an expression that is true nonzero or omitted The break directive is optional along with its expression When the expression is false 0 the loop continues When the expression is true nonzero or omitted the assembler breaks the loop and assembles the code after the endloop directive The endloop directive terminates a repeatable block of code it executes when the break directive is true nonzero or when number of loops performed equals the loop count given by loop This example illustrates how these directives can be used with the eval directive 1 eval Op 2 COEF loop 3 word x 100 4 eval x 1l xX 5 break x 6 6 endloop il 0000 0000 word 0 100 i eval 0 1 xX ah break 1 6 1 0001 0064 word L IDO 1 eval 1 1 x 1 break 2 6 1 0002 00C8 word 2 100 1 eval dl X 1 break 326 d 0003 DIAC word 3 100 1 eval 3 1 X 1 break 426 1 0004 0190 sword 4 100 1 eval 4 1 x 1 break 5 6 d 0
30. MN HH eq SH 2a JOVI 2r WOVI 0 yl 9d SH Lasay 90 eH sq INN 86 IWN aq vo va EINI 9 VELNI T EE ea ZLNI 29 ZLNI ed zoL 99 za LINI MANI za LOL qaaaaaag 99 iq 001 ld Gpezro0 qqqaaaa aaaaaaa 9N v9 O LNI oa 66 od LLL 116879 S8 210 ANNA NAAR aaadadaadg Vvvvvvvvvvvvvvvvv 2922222 ANNAAAA L o 6 8 s 1068149vez t zs 8 z 9z zlo sis 91 sn LL blivieeeeeeee vizi6eo9 S II OND e0 se ONO tp A by ete A st ola slrlelzirio anv nr M0L M0L MOL M0L M0L LEE EIE EL 6 8 Z2 9 S v elz Llo Bis eey zeu Ley osy 6zu viviviviviviviviviviviviviviviv 020 st oly DOA DOA ponunuo pseog nano snidysqg jo weibeig oneusyos z y anbi4 A 5 ions and Schematic Diagram it Board Dimens Ifcul DSKplus C Schematic Diagram of DSKplus Circuit Board aN9 AND Ho dx WNMGHMd A YOL se esu nz 40L ovr LNO p OX Y pa JT ee T veo YS4L ESH aNd aNd A 4nr dni Leo 080 N3OL0OVOZEO 11 8 dN9a 02 B qqAq 9222011 zz anooav sans aiwoay 13838 9 ez 8 qqAoqaV NMGYMd L bz E e dN9ova 193 9 Z 9L azn aiwova 093 Bt aa ova __ SIN al idozz 1no 1no 903 PX E ae 1no 1no ass St 8 0 19H v m INONOW q
31. OO Q O0 000 0 0 00 0 0 OOOO O 0 0 LI 10 050 000 O O O D O LIO O0 0 OO U U Qo 0000000 LI1 IDOOOOOOOOOOD 3 800 0 150 4 445 Dimensions are in inches m dBBBaBaaBBBBB i 55056 2 500 pieog Nonn snidy sq jo weibeig oneusyos Schematic Diagram of DSKplus Circuit Board 1918 ASng yov pleog Una snidysqg jo welbeig oneusyoas UND QNO A Jd0zz Jd0zz Jd0zz Jd0zz dos dos doS doS dos jos dos Jd09L 919 GLO Vio elo eio LLO 019 69 89 9 99 SO 001 Leu 001 02H 001 61H 001 ely ag 042 elu 9ag 0 2 LLY sag 072 OLY 4 seaa vag 0 2 6H el Lo eag E Gc lt 0 2 8H 3i O zag vz v ole ZH m O Lag ez E 042 9H a O oag O wz 4 QNO 042 se 6 5 A lz 8 O oz dozz jdoze dozz jdoze dozz L O AHO c YO gt o coy jo 6l F5 KA 9 O el G KA L11NOH O LL ose OLY E O lt 31A8 al O oe Sly E O 1NIH O Ss 001 18 088 viu O Z O1LNOH O MNUH Whi L 08 ele aed ld 0Zb 0Zv 0Zv 0Zv vy ey eH Lg O DOA gy elnbiy A 3 DSKplus Circuit Board Dimensions and Schematic Diagram
32. WR HL 1 0 1 0 PAL Equations PAL Equations B 3 PAL Equations Example B 1 equations trace B 4 PAL Equation Routine Continued POL TRIST Lo NBL ABLE DLYL STRB RESET MODE clk CLK STRB RESET HBIL oe TRIST POL NBL HBIL TRIST LS RESET MODE ar RST LS RESET TRIST MODE BUF EN NBL HBIL DLY1 STRB POL HDL BYTE amp RNW CNTLO amp CNTL1 LS BYTE amp RNW CNTLO CNTL1 gt HD1 LS CNTLO CNTL1 RESET LS amp CNTLO CNTL1 HDO LS ICNTLO CNTL1 TRIST LS CNTLO CNTL1 HDO LS CNTLO CNTL1 MODE amp LS CNTLO amp CNTL1 MODE amp RNW amp TRIST MODE amp TRIST BYTE amp HBIL NBL BYTE MODE MODE RNW amp TRIST BYTE amp RNW amp TRIST NBL amp BYTE HBIL amp BYTE amp MODE RNW BYTE amp MODE RNW HBIL DLY1 HBIL POL DLY1 S HBIL amp POL STRB HBIL POL RNW amp STRB HBIL CNTLO CNTL1 BYTE RNW gt BUFEN MODE TRIST NBL HBIL DLY1 STRB PAL Equations PAL Equation Routine Continued Example B 1 latch test vectors RST LS BYTE RNW CNTLO CNTL1 HDO HD1 test vectors Clk O 1 T 1 0 HOLD RESET RESET HOLD eT RT ST HOLD MODE MODE HOL
33. aligns SPC to long word even boundary 128 aligns SPC to page boundary The assembler aligns the SPC on an x word boundary within the current sec tion This example shows several types of alignment including align 2 align 4 and a default align 1 0000 0004 byte 4 align 2 3 0002 0045 String Errorent 0003 0072 0004 0072 0005 006F 0006 0072 0007 0063 0008 006E 0009 0074 4 align 5 0080 6000 field 9 6 0080 6A00 field 5 4 7 align 2 8 0082 6000 field So 3 align 8 10 D088 S000 field 5 4 11 align 12 0100 0004 byte 4 Reserve Space in the bss Section bss Syntax bss symbol size in words alignment Description The bss directive reserves space for variables in the bss section This directive is usually used to allocate variables in RAM symbol points to the first location reserved by this invocation of the usect directive The symbol corresponds to the name of the variable for which you re reserving space size in words is an expression that defines the number of words that are reserved in section name alignment is an optional parameter This flag causes the assembler to allocate size on long word boundaries The assembler follows one rule when it allocates space in the bss section Whenever a hole is left in memory the bss directive attempts to fill it When a bss directive is assembled the assembler searches its list of holes left by previous bss directives and tries to allo
34. before strobing the HPI for the second byte Since the PC parallel port always supports 8 bit writes and 4 bit reads as a minimum the nibble state machine is active only during 4 bit reads reads when MODE 0 The state machine can be reset by setting the RNW line low while operating in nibble mode The state machine is turned off when MODE 1 Figure 6 6 is the disabled state machine functional diagram When the state machine is disabled MODE 1 or when it is not selected RNW is low HBIL mimics the BYTE signal Figure 6 6 Functional Diagram for a Write or 8 Bit Read Cycle BYTE 1st byte 2nd byte HBIL NBL y 6 3 3 Latch Select LS Mode The latch mode is used to set the D latches for the RESET MODE and TRIST signals Latches in the PAL device can be accessed only when the LS latch is set LS is actually a latch accessed by writing 0x2 to the HPI while CNTL1 and CNTLO are both low This corresponds to writing 0x0202 to the HPIC regis ter because of the required 16 bit data write to the HPIC Bit 1 of the HPIC reg ister has no effect on the DSP itself instead this bit sets resets the LS latch Writing a 0x0202 to the HPIC sets the LS latch high As a result changes to the CNTL1 and CNTLO signals results in loading another latch with data Ana lyzing the logic diagram in Figure 6 4 shows that changes in the CNTL1 and CNTLO states will have the following effect Using a PAL Device CNTL 1 0 Effect 00 Neutral
35. bits Description The field directive can initialize multiple bit fields within a single word of memory This directive has two operands value is a required parameter it is an expression that is eva luated and placed in the field size is an optional parameter it specifies a number from 1 to 32 which is the number of bits in the field If you do not specify a size the assembler assumes that the size is 16 bits If you specify a size of 16 or more the field will start on a word boundary If you specify a value that cannot fit into size bits the assembler truncates the value and issues an error message For example field 3 1 causes the assembler to truncate the value 3 to 1 the assembler also prints the message warning value truncated Successive field directives pack values into the specified number of bits start ing at the current word Fields are packed starting at the most significant part of the word moving toward the least significant part as more fields are added If the assembler encounters a field size that does not fit into the current word it writes out the word increments the SPC and begins packing fields into the next word You can use the align directive with an operand of 1 to force the next field directive to begin packing into a new word If you use a label it points to the word that contains the specified field Assembler Directives Reference C 13 field Initialize Field Example This exa
36. by removing the series resistor but cannot be disconnected from the HPP s HONTL1 signal Pin 6 Connected to the PC s BYTE line can be disconnected from the host by removing the series resistor but cannot be disconnected from the HPI s HBIL signal Pin 7 Connected to the PC s CNTLO line can be disconnected from the host by removing the series resistor but cannot be disconnected from the HP s HONTLO signal Pin 8 No connection Pin 9 Connected to the host PC s RNW line can be disconnected from the host by removing the series resistor but cannot be disconnected from the HPI s HR W signal Pin 10 Used for an asynchronous PAL device reset forces PAL device into 3 state mode by pulling this pin low the pin is high for normal opera tion Pin 11 General purpose input only Pin 12 General purpose input only L D OU O O O D L PAL Device Modifications Pin 13 General purpose input only Pin 14 Ground Pin 15 No connection Pin 16 General purpose input only Pin 17 3 state controller general purpose I O Pin 18 Strobe polarity general purpose I O Pin 19 Used to create a strobe signal The strobe signal is delayed by one PAL device CLK cycle and has a one PAL device CLK cycle duration required to satisfy the tsy HAD and tw HDsl HPI timings There is sufficient guardband to accomodate an increase in the PAL clock rate Pin 20 Connected to the output enable OE of the bidirectional buffer 74245
37. can set the code section to a particular ad dress and page The text section resides at 500h and the vectors section re sides at 180h as shown in the file s statements Setsect text 003x500 0 Setsect vectors 0x180 0 The page determines which memory space the section will be loaded to The page indicator is either 0 or 1 corresponding to program or data space re spectively DSP Software The copy directive copies the source code from the file name enclosed in double quotes For the following code shown in full on your PC editor screen it copies vectors asm into the vectors section and appends the acO1init asm file to the text section Therefore the assembly source code actually contains code from the three files firstapp asm vectors asm and acO1init asm Sect vectors copy ec dskplus inits vectors asm start text lt initialize DSP gt lt wait gt XINT lt interrupt service routine gt lt return gt copy Ci dskplus inits acUlinit asm The program begins at the label start where it initializes the DSP and contin ues in a wait routine The initialization routine must always set up the ACO 1 if you plan to use it the interrupt table pointer IP TR the stack pointer SP and the interrupt mask register IMR In this code the ar2 register is also initialized to the beginning of the data buffer at 1200h The interrupt mask bit INTM is set to 0 when initialization is complete and
38. directives associate portions of an assembly language program with the appropriate sections and initialize each section s address E E bss reserves space in the bss section for uninitialized variables data identifies portions of code in the data section The data section usually contains initialized data Sect defines initialized named sections and associates subsequent code or data with that section A section defined with sect can contain code or data Setsect initializes the section program counter SPC to a value that cor responds to the absolute address of the section text identifies portions of code in the text section The text section usually contains executable code USect reserves space in an uninitialized named section The usect directive is similar to the bss directive but it allows you to reserve space separately from the bss section Example 5 2 shows how you can use sections directives to associate code and data with the proper sections This is an output listing column 1 shows line numbers and column 2 shows the SPC values Each section has its own pro gram counter or SPC When code is first placed in a section its SPC equals 0 When you resume assembling into a section after other code is assembled the section s SPC resumes counting as if there had been no intervening code The directives in Example 5 2 perform the following tasks text initializes words with the values 1 2 3 4 5
39. initialized section Description These are errors about invalid symbol names A symbol is invalid for the context in which it is used Action Correct the source per the error message text D 1 Assembler Error Messages E0002 E0003 E0002 Description Action E0003 Description Action D 2 Invalid directive specification Invalid mnemonic specification These errors are about invalid mnemonics The instruction or directive specified was not recognized Check the directive or instruction used Cluttered character operand encountered Cluttered string constant operand encountered Cluttered identifier operand encountered Condition must be EQ LT GT or NEQ Condition must be srcLT LEQ GT or GEQ Illegal condition operand or combination Illegal indirect memaddr specification Invalid binary constant specified Incorrect bit symbol for specified status register Invalid constant specification Invalid decimal constant specified Invalid float constant specified Invalid hex constant specified Invalid immediate expression or shift value Invalid octal constant specified Invalid operand Shift value out of range These are errors about invalid operands The instruction parameter or other operand specified was not recognized Correct the source per the error message text E0004 Description Action E0005 Description Action Assembler Error Messages E0004 E0005 Absolute well defined integer
40. lt Less than lt Less than or equal to gt Greater than gt Greater than or equal to Conditional expressions evaluate to 1 if true and 0 if false they can be used only on operands of equivalent types DSKplus Assembler Description 5 17 Source Listings 5 10 Source Listings 5 18 A source listing shows source statements and the object code they produce To obtain a listing file invoke the assembler with the lowercase L option Two banner lines a blank line and a title line are at the top of each source listing page Any title supplied by a title directive is printed on the title line a page number is printed to the right of the title If you don t use the title directive the name of the source file is printed The assembler inserts a blank line below the title line A source statement produces at least one word of object code The assembler lists the SPC value and object code on a separate line for each word of object code produced Each additional line is listed immediately following the source statement line Each line in the source file produces a line in the listing file that shows a source statement number an SPC value the object code assembled and the source statement Field 1 source statement number Line Number The source statement number is a decimal number The assembler numbers source lines as it encounters them in the source file Some statements increment the line counter but are not listed for exa
41. modulo lt lt gt gt Left shift right shift Addition subtraction lt de x x Less than LT or equal greater than GT or equal l Not equal to equal to amp Bitwise AND A Bitwise exclusive OR Bitwise OR Evaluation Right to left Left to right Left to right Left to right Left to right Left to right Left to right Left to right Left to right Note Unary and have higher precedence than the binary forms 5 9 2 Expression Overflow and Underflow The assembler checks for overflow and underflow conditions when arithmetic operations are performed at assembly time It issues a Value Truncated warning whenever an overflow or underflow occurs The assembler does not check for overflow or underflow in multiplication 5 9 3 Well Defined Expressions 9 16 Some assembler directives require well defined expressions as operands Well defined expressions contain only symbols or assembly time constants that are defined before they are encountered in the expression The assembler is absolute therefore all defined expressions are absolute This is an example of a well defined expression LOGO hax where x was previously defined Expressions 5 9 4 Conditional Expressions The assembler supports relational operators that can be used in any expression they are especially useful for conditional assembly Relational operators include the following Equal to Equalto Not equal to
42. names with constants and other values symbol points to the first location reserved by this invocation of the usect directive The symbol corresponds to the name of the variable for which you re reserving space value must be a well defined expression that is all symbols in the expression must be previously defined in the current source module Undefined external symbols and symbols that are defined later in the module cannot be used in the expression If the expression is relocatable the symbol to which it is assigned is also relocatable The value of the expression appears in the object field of the listing This value is not part of the actual object code and is not written to the output file Symbols defined with set can be made externally visible with the def or global directive In this way you can define global absolute constants Assembler Directives Reference C 27 set equ Define Assembly Time Constant Example This example shows how symbols can be assigned with set and equ 1 p dir dir dir dir di di di dir dir dir dir dir dis dir dir div dir dir dir dis dir div dir dir dir dir di dir div dir dir dir dir di dios dir dir dir dir dir di dir AR 2 TN Equate symbol AUX R1 to register ARI T 3 mo and use it instead of the register A 4 pa dir dir dir dir dir di di dir dir dir dir dir dir dios dir dir dir dir dir dios dir dir di dir dir dir dis dio div dir dir dir d
43. ports and modes 6 1 6 2 Power and Cables nn 6 2 DSKplus Communications Protocol i 6 4 6 2 1 The PC s Data Register i 6 5 6 2 2 The PCs Status Register i 6 5 Contents 6 2 3 The PC s Control Register i 6 6 6 3 UsingaPAL Device i 6 7 6 3 1 Strobe Generator i 6 9 6 3 2 Nibble Mode State Machine i 6 10 6 3 3 Latch Select LS Mode i 6 10 6 4 PAL Device Modifications i 6 12 65 Connecting Boards to Headers i 6 14 6 6 Connecting the XDS510 Emulator Port i 6 14 INIIANZATION HOUTITI8S acces rain errar ae 7 1 Describes how to initialize each of the devices on the DSKplus board and the PC s parallel port 7 1 Communication Link CommbLink Initialization o oooooooooooooo 7 2 7 1 1 Parallel Port and PAL Device Initialization ooooooomooo 7 2 7 1 2 Host Port Interface Initialization nonna anan nna ananena aea 7 2 7 2 Serial Port and TLC320AC01 Initialization i 7 3 DSKplus Circuit Board Dimensions and Schematic Diagram A 1 Shows the TMS320C54x DSKplus circuit board dimensions and a schematic diagram PAL JEQUANIONS 3 22 529 8 2 6919 03 3 8 8d xn aria seats Scr SOR Gor Ud ce B 1 Lists PAL equations and associated test vectors for factory default PAL device Assembler Directives Reference enn nn C 1 Describes the directives according to function and presents the directives in alphabetical order Assembler Error Messages
44. statements their line numbers and any unresolved symbols or opcodes LSB east significant bit The binary digit or bit in a binary number that has the least influence on the value of the number LSByte east significant byte The byte in a multibyte word that has the least influence on the value of the word member An element of a structure union or enumeration memory map Amapoftarget system memory space that is partitioned into functional blocks menubar A row of pulldown menu selections at the top of the debugger dis play MP MC bit A bit in the processor mode status register PMST that indicates whether the processor is operating in microprocessor or microcomputer mode See also microcomputer mode microprocessor mode MSB most significant bit The binary digit or bit in a binary number that has the most influence on the value of the number MSByte most significant byte The byte in a multibyte word that has the most influence on the value of the word named section Either an initialized section that is defined with a sect directive or an uninitialized section that is defined with a usect directive Glossary E 5 Glossary E 6 object file Aset of related records treated as a unit that is the output of an assembler or compiler and is input to a linker operand The arguments or parameters of an assembly language instruc tion assembler directive or macro directive options Command parame
45. the sign as a prefix the assembler treats the operand as an immediate value This is true even when the operand is a register or an address the assembler treats the address as a value instead of using the contents ofthe address This is an example of an instruction that uses an oper and with the prefix Label B B 4123 Source Statement Format The operand 123 is an immediate value The assembler adds 123 decimal to the contents of accumulator B B prefix the operand is direct memory addressed When using the prefix the operand is addressed via the direct addressing mode The address is a function of data pointer or stack pointer The instruction below adds 10 to AR2 only if DP 0 Label AR2 10 B prefix the operand is an indirect address If you use the sign as a prefix the assembler treats the operand as an indirect address that is it uses the contents of the operand as an address This is an example of an instruction that uses an operand with the prefix Label A AR4 The instruction directs the assembler to go to the address specified by the contents of register AR4 and move the contents of that location to accumulator A L Immediate value for directives The immediate value mode uses the character in front of the immediate value and is primarily used with instructions In some cases it can also be used with the operands of directives Itis notusually necessary to use the immedia
46. the DSP is ready to receive data start call ACOLINIT pmst 01a0h set up iptr sp 0ffah init stack pointer ar2 1200h pointer to receive buffer ar24 data 0bh store to rcv buffer imr 280h intm 0 ready to rcv int s wait nop goto wait Software Considerations 4 3 DSP Software 4 4 When the DSP receives an interrupt it proceeds to the vectors section and reads the vector location The vector informs the DSP to go to the XINT sub routine also Known as the XINT interrupt service routine As aresult the code in the XINT routine is executed XINT b trcv load acc b with input b OFFFCh amp b ar2 data 0bh store to rcv buffer tdxr b transmit the data TC ar2 01280h if TC goto restrt stop ift rcv butter is at 1280h return enable restrt ar2 1200h return_enable used only when not using debugger end The interrupt service routine gathers data and copies it to the data buffer and transmits it back to the ACO 1 until the buffer is full When the buffer is full the DSP enters the routine restrt and initializes the ar2 buffer pointer to 1200h to begin again You can use the DSKplus algebraic assembler to assemble this code by typing the following at a DOS prompt dskplasm c dskplus firstapp firstapp asm 1 This creates a file firstapp obj which you can load into the debugger and ex amine The data values received via the ACO1 are loaded into
47. this example the copy directive is used to read and assemble source state ments from other files then the assembler resumes assembling into the current file The original file copy asm contains a copy statement copying the file byte asm When copy asm assembles the assembler copies byte asm into its place in the listing note listing below The copy file byte asm contains a copy statement for a second file word asm When it encounters the copy statement for word asm the assembler switches to word asm to continue copying and assembling Then the assembler returns to its place in byte asm to continue copying and assembling After completing assembly of byte asm the assembler returns to copy asm to assemble its remaining statement copy asm byte asm word asm Source file First copy file Second copy file Space 29 xx In byte asm xx In word asm copy byte asm byte 32 1 A word QABCDh 56q COPY word asm Back in original file Back in byte asm pstring done byte 67h 3q Listing file 1 0000 Space 29 2 Copy byte asm A 1 In byte asm A 2 0002 0020 byte 32 14 A 0003 0042 A 3 Copy word asm B 1 Ln word asm B 2 0004 ABC word OABCDh 56q 0005 002 A Back in byte asm A 0006 006 byte 67h 3q xx Back in original file 0007 646F pstring done JUUS GEGS O1 ds W Ol gt Assembler Directives Reference C 7 copy include Copy Source File Example 2 In this example the include directi
48. to keep the following variables external These variables affect functions throughout the C54XHIL _j extern int pport portmode Readdelay _j extern int datareg pport 3 extern int statreg pport L extern int ctrireg pport Thefirstthree of these variables are used to set up the port number pport the parallel port mode portmode and the delay for 8 bit reads Readdelay The port number pport is 1 2 or 3 to select the corresponding port portmode is either O or 1 to identify 4 bit or 8 bit mode respectively The Readdelay vari able is needed in cases where the host PC can read data from the data register before it is validated from the DSKplus board Readdelay is the value of PC CPU cycles required before the information on the DSKplus data lines is valid The next three variables are the data status and control register addresses of the three common parallel ports The datareg is the data register where data is loaded to and from the PC and DSKplus The statreg is the status register and is used by the host PC to read data in 4 bit mode and receive DSP to host in terrupts The ctrlreg is the control register and is used to control the DSKplus board via the host interface logic and send host to DSP interrupts See the C54XHIL DOC file in the C54XHIL subdirectory for a complete refer ence list of the host interface library functions Software Considerations 4 7 4 8 Chapter 5 DSKplus Assembler Descrip
49. value expected Accumulator specified in second half of parallel instruction may not be the same as the first Data size must be equal to pointer size Expecting accumulator A or B Expecting ASM or shift value Expecting dual memory addressing Identifier operand expected Illegal character argument specified Illegal floating point expression Illegal string constant operand specified Invalid identifier sym specified Not expecting direct operand op Not expecting indirect operand op Not expecting immediate value operand op Operand must be auxiliary register or SP Operand must be auxiliary register Offset Addressing modes not legal for MMRs Pointer too big for this data size String constant or substitution symbol expected Substitution symbol operand expected These errors are about illegal operands The instruction parame ter or other operand specified was not legal for this syntax Correct the source per the error message text Missing field value operand Missing operand s These are errors about missing operands a required oper and is not supplied Correct the source so that all required operands are declared Assembler Error Messages D 3 Assembler Error Messages E0006 E0007 E0009 D 4 E0006 Description Action E0007 Description Action E0009 Description Action break must occur within a loop Conditional assembly mismatch Matching endloop missing No matching if specified
50. 000 field 27 3 2 0000 4160 field Ll 8 3 align 2 4 0002 0045 String Errorcnt 0003 0072 0004 0072 0005 006f 0006 0072 0007 0063 0008 006e 0009 0074 3 align 6 0100 0004 byte 4 Figure 5 5 Using the align Directive a Result of align without an argument 80h New SPC 100h after assembling pt 80h a align Current words directive SPC 88h 100h r DSKplus Assembler Description 5 29 DSKplus Assembler Directives 5 11 5 Directives That Format the Output Listing The following directives format the listing file J J J The length directive controls the page length of the listing file You can use this directive to adjust listings for various output devices The list and nolist directives turn the output listing on and off You can use the nolist directive to stop the assembler from printing selected source statements in the listing file Use the list directive to turn the listing on again The page directive causes a page eject in the output listing The title directive supplies a title that the assembler prints at the top of each page The width directive controls the page width of the listing file You can use this directive to adjust listings for various output devices 5 11 6 Directives That Reference Other Files The copy and include directives tell the assembler to begin reading source statements from another file When the assembler finishes reading the sourc
51. 005 O1F4 sword 5 L00 1l eval 5 1 X 1 break 6 6 Eject Page in Listing page Syntax page Description The page directive produces a page eject in the listing file The page directive is not printed in the source listing but the assembler increments the line counter when it encounters it Using the page directive to divide the source listing into logical divisions improves program readability Example This example shows how the page directive causes the assembler to begin a new page of the source listing Source file title U Page Directive Example page Listing file TMS320C54x DSKplus Assembler Version x xx oun Apr 23 13 06 09 1995 Copyright c 1996 Texas Instruments Incorporated Page Directive Example PAGE it 2 3 4 TMS320C54x DSKplus Assembler Version X Xx pun Apr 23 15 06 08 1995 Copyright e 1996 Texas Instruments Incorporated Page Directive Example PAGE Z Assembler Directives Reference C 25 sect Assemble into Named Sections Syntax Description Example NOt WN ES ui H Ow oo LS 14 La 16 17 LB 19 20 21 zd Za 24 23 26 A 20 Z9 30 24 32 3 3 34 C 26 0000 0000 0001 0002 0000 0000 0001 0002 0003 0004 0000 0003 0003 0004 0005 0006 0000 0000 0001 0002 0003 E878 FOOO 0036 3D4C CCD 00AA FO000 0002 0010 0020 0008 FO000 0042 0003 0004 000D DADO 0000 0008 sect section name
52. 12 copy include files 5 5 list file 5 4 object code 5 4 float assembler directive 5 27 C 16 floating point constants C 16 Index 3 Index global symbol definition E 3 hardware connecting the XDS510 emulator port 6 14 DSKplus communications protocol 6 4 PAL device 6 7 PAL device s internal logic diagram 6 7 power and cables 6 2 requirements for installation 1 3 hexadecimal integer constants 5 11 host PC code versus DSP code 4 6 HPIA definition E 4 HPIC definition E 4 i assembler option 5 4 5 5 examples by operating system 5 6 maximum number per invocation 5 5 if assembler directive 5 30 C 17 IMR definition E 4 include assembler directive 5 5 5 30 C 6 include files 5 5 C 6 initialization communications link CommLink 7 2 DSP peripherals 7 3 host port interface 7 2 parallel port and PAL device 7 2 initialized sections data section C 9 sect section C 26 text section C 33 input section definition E 4 installation connecting the DSKplus board 2 2 DSKplus software 2 3 hardware requirements 1 3 running self test program 2 5 software requirements 1 3 int assembler directive 5 27 C 19 interface Code Explorer debugger 2 4 interrupt definition E 4 Index 4 interrupt mask register IMR definition E 4 introduction kit content and features 1 2 overiew 1 4 invoking the assembler 5 4 JP header connecting boards to headers 6 14 kit contents and features 1 2 assembler option 5 4 sou
53. 4 bit mode By doing so the parallel port and bidirectional buffer will never drive into each other The series resistors can tolerate this but will cause data lines to be very noisy in some cases BUFEN is also disabled when TRIST 0 and MODE 1 Selects which four bits of the byte are received into the parallel ports status register Two BYTE cycles must be performed to receive a byte and four BYTE cycles must be performed to receive a 16 bit word NBL is only active during a 4 bit read Writes are always eight bits B 1 PAL Equations HBIL DLY1 STRB POL Tied to the DSP HPI to select which byte is to be transferred to from the HPI HBIL mimics BYTE during all writes and 8 bit reads HBIL changes level every two BYTE cycles during a 4 bit read since two 4 bit reads from the status register must be performed before reading the next byte from the HPI Creates the 1 cycle delay in the synchronous delay line The 1 cycle 100 ns delay is used to conform to the HPI setup timings for the HBIL CNTL 0 1 and HR W signals This latch is the second stage of the synchronous delay line This creates a 1 cycle 100 ns strobe signal During the HPI read the HPI is strobed on the falling edge of STRB connected to HDS2 The data remains on the data lines only while STRB 0 During an HPI write the HPI data is read in on the rising edge of STRB The polarity of this signal is controlled by the POL latch Reverses the polarity of the
54. 5 4 5 14 D DIR environment variable definition E 2 data assembler directive 5 23 section 5 23 C 9 datamemory 1 5 dual access RAM DARAM 1 5 external 1 5 memory mapped registers 1 5 RAM 1 5 data registers 6 5 DB25 pin connections 6 2 debugger Code Explorer 3 2 definition E 2 trouble shooting 2 4 debugger interface Code Explorer 2 4 decimal integer constants 5 10 device PAL 6 7 PAL internal logic diagram 6 7 directives assembly time constants C 27 assembly time symbols equ 5 31 C 27 eval 5 31 C 11 set 5 31 C 27 conditional assembly break 5 31 C 24 else 5 30 C 17 elseif 5 30 C 17 endif 5 30 C 17 endloop 5 31 C 24 Jf 5 30 C 17 loop 5 31 C 24 definition E 2 miscellaneous 5 31 to 5 32 end 5 31 C 10 summary table 5 20 to 5 32 that align the section program counter SPC align 5 29 C 2 that assign assembly time symbols 5 31 to 5 32 directives continued that control conditional assembly 5 30 to 5 32 that define sections 5 23 to 5 32 Setsect 5 23 bss 5 23 C 3 data 5 23 C 9 sect 5 23 C 26 text 5 23 C 33 usect 5 23 C 35 that format the output listing 5 30 to 5 32 length 5 30 C 20 list 5 30 C 21 nolist 5 30 C 21 page 5 30 C 25 title 5 30 C 34 width 5 30 C 20 that initialize constants 5 25 to 5 32 bes 5 25 C 31 byte 5 26 C 5 field 5 26 C 13 float 5 27 C 16 Ant 5 27 C 19 Jong 5 27 C 23 bstring 5 27 C 32 space 5 25 C 31 String 5 27 C 32 word 5 27 C 19
55. 8735 or INTL 813 3769 8735 03 3457 7071 or INTL 813 3457 7071 DSP BBS via Nifty Serve Type Go TIASP Documentation When making suggestions or reporting errors in documentation please include the following information that is on the title page the full title of the book the publication date and the literature number Mail Texas Instruments Incorporated Email comments books sc ti com Technical Documentation Services MS 702 P O Box 1443 Houston Texas 77251 1443 Note When calling a Literature Response Center to order documentation please specify the literature number of the book Read This First ix Contents Introduction Lo 1 1 Provides general information about the DSKplus and lists the hardware and software requirements 11 Kit Contents and Features i 1 2 ql Wiel YOU NOGU To oe au eo sete bota be ee aed Gave Eda ee oes KH GE 1 3 1 2 1 Hardware Requirements i 1 3 1 2 2 Software Requirements i 1 3 1 3 Functional Overview i 1 4 Installing the DSKplus Assembler and Debugger 2 1 Provides assembler and debugger installation instructions for PC systems using Windows 2 1 Connecting the DSKplus Board i 2 2 2 2 Installing the DSKplus Software i 2 3 23 Running the Self Test Program oss zacesembrdeaer eaR ete RERa4sAE Suk su aad os obs we 2 5 DSKplus Debugger and Application Loader Software 3 1 Describes the features of the debugger and how to
56. 9 ZLY 6 Z zaH GL el viv 9 v LGH 9 Q O dS4 O N15 to O OL VAN L 0dH 6 L Lar 9 d O WIN lt LNIH 2 O O VOINI Saf O DOA 6vu 0 qH 00 ponunuo pie0g nano snidysqg jo weibeig oneusyos z y enDiJ x Appendix B PAL Equations Included here are the PAL equations and associated test vectors for the factory default PAL device with a brief functional description for each equa tion LS RESET TRIST MODE BUFEN NBL Loaded only when performing a HPIC write with data line HD1 1 and BYTE 0 This sets the latch select bit and enables loading of the RESET MODE and TRIST latches Controls the DSP reset line This latch is reset and set with HD1 inverted HD1 level It is loaded only when LS 1 and CNTL 0 1 1 0 Controls the 3 state controller If TRIST 0 then RESET STROBE and HBIL have no effect on the DSP It is loadable only when LS 1 and CNTL 0 1 0 1 Determines how the HPI will interface to the PC If MODE 0 the PC parallel port functions in 4 bit mode If MODE 1 the parallel port functions in 8 bit mode When MODE 1 the 74257 mutiplexer is disabled since 8 bit bidirectional data can be read from the data register and the multiplexer is not needed MODE can be loaded only when LS 1 and CNTL 0 1 1 O These 4 bit port data lines cannot be turned off or reversed This logic is used to disable the bidirectional buffer when performing a read in
57. 9L O O O z H oO MOL sq Si Ol ea zt 0L or 6 P oC vola 8 L oa P ca O A gv3y ey 9NId XO 9 9 O v IGL e L3 Ud LSHL I Q 2 L SNL edt Zaf 0L 0L 9rd Gby WLP ML 6 H 8ey O JOA st ola Q 29 penunuo2 pseog nano snidysqg jo weibeig oneusyos z y elnbiy A 7 DSKplus Circuit Board Dimensions and Schematic Diagram Schematic Diagram of DSKplus Circuit Board QNO A 34nr Ane Ane jnr dnb dnb 3nr Anh yz a ae 0Sy 820 Z9 920 Szo vzo ezo 220 IZo yl Nagao KK La QNO A DOA ino d0Zy 1d0 y 620 1 0 99 2 HadNnr 29 1 O O Le A 91d yoer JeNod Ir aNd A aNd A EXzt H3Qv3H Ist olv 1noL SE EXzt H3QV3H JOA ze xag uag 62 Lv Ge 92 ev ze 8Z HSdg9 SV 62 Tum 02 IN ge ve Zk 6Y ez poe vk LLY Z o LnO ELY 4 5 IS 8 SLY bl 9 S N LL 4 O MIOW xal GH ELNI 2 ua 9 pH 9 ee Le LLNI XS3L O L11NOH Ze SAL 9E p O1LNOH y c ve 0v lz Gc ee p Le ev OL vc zz LOH AO O 4X10 O Ec O 32 vY HZ 6 90H O OE 9V 8l 9 SdH NY X ao ai E xnv a 2 A E O NMGYMd x 8c 5
58. C 3 section 5 23 C 3 byte definition E 2 byte assembler directive 5 26 C 5 c assembler option 5 4 cables for the DSKplus 6 2 Index 1 Index character constants 5 11 character strings 5 12 Code Explorer debugger 3 2 debugger interface 2 4 dialog box 2 3 port I O address 2 3 port selection 2 3 code explorer debugger overview 3 2 code display windows definition E 2 command file definition E 2 command line definition E 2 command line cursor definition E 2 comment field 5 9 comments definition E 2 in assembly language source code 5 9 that extend past page width C 20 communications link CommLink host port interface initialization 7 2 parallel port and PAL device initialization 7 2 communications protocol PC s control register 6 6 PC s data register 6 5 PC s status register 6 5 conditional assembly directives 5 30 to 5 32 C 17 blocks C 17 expression 5 17 conditional block definition E 1 connecting the DSKplus board 2 2 constant 5 10 to 5 11 assembly time 5 11 C 27 binary integers 5 10 character 5 11 decimal integers 5 10 definition E 2 floating point C 16 hexadecimal integers 5 11 octal integers 5 10 symbolic 5 14 constants symbolic 5 14 register symbols 5 14 copy assembler directive 5 5 5 30 C 6 copy files 5 5 C 6 cursor definition E 2 Index 2 customized applications connecting boards to headers 6 14 PAL device modifications 6 12 d assembler option
59. D T es AAA 31 F 31 F v1 71 3 T FAA CO CO OO CO OO c c4 c4 c4 c NNNNNN ed cd cd cd cd CO c4 cd c4 c c ced cd ced cd cH SM M M M RM SR M OOOO OO OOOO COC c S M M oM N M N CO CO cd c c c ed cd ced cd cU NBL BUFEN LS RESET TRIST MODE PS Soa a Oo bd Dd C Om 5 m m m m xx XXX c4 c c c O 4 m m p4 C39 C CO Coo ec C O O O SO On A O0 C Oo dA Ced O 4 MMM MK MK TURN OFF LS VIA WRITE CYCLE H O H n e oce e c aS oM S M M M RM OR M X Cd cd cd en cd n c4 cn n n OM M RM RM M M OR X c oed cedo ced cd cd ced ced cd cd ced N N M ROM M RM OR X CI LL LP ECL X XXI O LIO LII dy LLLI dd dl dy dd dl y ed L1 Fs TA FAS FS FS TS FS LIS Al A ll LIBLJ lil y LI p op T FAA EAS FA AAA AAA p 3 dl LII dy dl dl dl dy LI B 5 PAL Equations PAL Equations PAL Equation Routine Continued Example B 1 gt 4 bit READ OPERATION gt 8 bit WRITE S bit WRITE test vectors MAKE W gt R TRANS E LN EFFECT MAKE R gt W TRANS W IN EFFECT PY TT FY TY ET TT TY EN FY TY NT YY T A a aA eel O oO dt OOOOOOOO OO OO OO od el ct OE EY OD OO DY dH d DLY1
60. E 8 in assembly language source 5 9 operand prefix 5 8 symbol for SPC 5 14 in assembly language source 5 9 operand prefix 5 9 A_DIR environment variable 5 6 absolute address definition E 1 absolute lister creating the absolute listing file 5 4 align assembler directive 5 29 C 2 alignment 5 29 to 5 32 allocation C 2 C 3 alternate directories naming with i option 5 5 naming with A DIR 5 6 alternate directories for assembler input 5 5 to 5 6 application code 3 4 arithmetic operators 5 16 assembler character strings 5 12 constants 5 10 to 5 11 definition E 1 DSKplus 5 2 error messages D 1 to D 8 expressions 5 15 5 16 invoking 5 4 options c 5 4 d 5 4 5 14 i 5 4 5 5 5 4 5 18 9 54 output listing 5 30 to 5 32 enable 5 30 C 21 page eject 5 30 C 25 Index page length 5 30 C 20 page width 5 30 C 20 suppress 5 30 C 21 title 5 30 C 34 overview 5 2 source listings 5 18 to 5 19 source statement format 5 7 to 5 9 symbols 5 13 assembler directives 5 20 assembler output 5 19 assembly time constant 5 11 assembly time constants C 27 assigning a value to a symbol C 27 assignment statement definition E 1 batch files definition E 1 BBS definition E 1 bes assembler directive 5 25 C 31 binary integer constants 5 10 block definition E 1 blocking C 3 board dimensions A 2 boot definition E 1 boot loader definition E 1 break assembler directive 5 31 C 24 bss assembler directive 5 23
61. IM BBC DRE 0000 SWWSE EFE PRD FFFF DER 0000 BSCR F800 TLR OOOO SPL 0800 ao C3 I C3 HR HR C3 03 C3 C3 P H 603 03 BP e I 712 feel F4EB FEBD FY BB 2726 LO xi xFFBD a Data Memory Hex E Style Oz0800 xFFBD OxFFBD xFFBD 0524 0526 0528 2700 732 ral mmr i IHF nmr 32h nmr 31h 0x004 O20808 O 080C Ux s1llu xFFBD xFFBD xFFBD xFFBD xFFBD OxFFBD OxFFBD xFFBD xFFBD xFFBD xFFBD xFFBD UxFFBD OxFFBD OxFFED 0xFF BD 0524 EL T732 m T m mmri32h TT Ixl814 00818 xFFBD xFFBD UxFFBD UxFFBD xFFBD 0xFF BD 0xFF BLD UxFFED If an error occurs when you attempt to start the debugger it may be due to the hardware setup To test the hardware setup run the self test program Running the Self Test Program 2 3 Running the Self Test Program The self test program helps you to determine the cause of errors The self test program performs several tests on the parallel port the DSKplus interface logic the C54x HPI the C54x DSP and the ACO1 The tests performed in order are as follows 1 2 10 Port locator Checks all parallel ports to determine which are connected to the DSKplus board Continuity check Checks for open data lines and shorts between data lines PAL state machine test Checks nibble mode functionality and the PAL clock Latch mode test Verifies that th
62. Kplus is a windowed debugger interface developed by GoDSP and is shown in Figure 3 1 It con tains four default windows disassembly CPU registers peripheral registers and data memory windows The disassembly window shows the DSP code and address location The location of the DSP program counter PC is highlighted by a yellow line over laying the code The interface also supports symbolic debugging which makes debugging code much easier You can reference locations in code and code variables by the assembly name or label so you do not need to know the physical address Breakpoints can be added or deleted by pointing and click ing on the instruction for the operation you would like to break Disassembly window properties can be changed using your menu and select buttons Figure 3 1 Debugger Overview Point and click 9 Tine Help Algebraic mnemonic breakpoints Single stepping Graphic animation disassembly ES ds i sl Pil ee ball Fee i CPU registers Ing and bit fields TEL EEL dark Ly II c hib u Lal A dci a u Baii dra Bi LN B5 a ani ch Eii e i TEN DEE bea Febi EF af BEY A TN re P i Uds UNEEI EE oymbolic debugging r Free MEE gs E DSP peripheral I gt registers FEXOREN DXIDCON Pee CuLESE Y CXODEN Ce a MD CODA Cele IFTE ark OxTTP DxTEEL IFE tarf Data memory window Time domain Frequency domain graphic window window
63. LNONOW MoS p xnv NIXnv ATOM QNO Lz bt xnv NIXnV _ Sd i T NI Nid sz 0L NI inoa 92 en 9322911 O aNd z x i MOVE NI A NINO 8 zf ki vin 8 yee OL uid S i dingy zs LSH 09H i 6SH ae SSH JnLY Seo OL 0L O LSH 9SH Aan 90 S N dS4 MOL XION XS4L Xa yal ponuyuo pseog nano snidySq jo weibeig oneusyos z y elnbiy CD lt Schematic Diagram of DSKplus Circuit Board aNd A X2L H3QV3H seg se ce Sd VIE LSIN Se SN e ez oz Lawy i O LL jx 8 eve WOVI U3S38 gHLSOI ac o MIS me oe e SVH NH LSaH 08 82 zsaH lz Se VN3IdH ve o O az exzt H3QV3H iz 6L ZQWM10 8qNyDO 8l 91 oa se SL l SoH dd 2 Q O z8 Zh 0L o WQ10H O AQuH via 62 6 L OvI Q MNUH za 9z A 9 c Db old ez L sa oz bar 9d Jie va vt A ea LL OW dW YOL 0 0L YOL d OH 9 crd 8vH Ord 1nOX19 EE p z O ds xov O O 1978 9 dii HI SNg 88 O HE sla 065 O Z eld 12 O Zy La bz Oe H3avaH OLGSOX 6a IZ 61 O ex lt ima gt 9 Q Hy amp onna 4g 81
64. Oh format Labels are case sensi tive K loads an alternate kernel The kernel must be one contiguous sec tion no multiple section kernels and cannot exceed 7F6h in length The kernel path and filename must directly follow this com mand line option lists the options on the screen After the code has been loaded the system exits LoadApp and restores the DOS prompt The loader returns the PAL device to an uninitialized state so you must make sure you reinitialize the PAL device if you have a PC based application interfacing with the DSKplus board Chapter 4 Software Considerations DSP code is the program you create and eventually load into the resident DSP processor To create DSP code you must have an ASCII text editor and the 1MS320C54x DSP Reference Set Volume 3 Algebraic Instruction Set The assembly source code you create in the editor must be assembled using the C54x DSKplus algebraic assembler The algebraic assembler converts your source code asm file to machine code obj file that only the DSP can use Host PC application code is a program you create with one of the many PC based C or C compilers These compilers generate machine code for the PC CPU PC resident this machine code will not run on the DSP The debug ger and application loader are perfect examples of executable PC code and are used to load DSP code to the DSP CPU Normally a DSP application begins with the creation of the DS
65. P or enhanced parallel port EPP If either is specified change it to a standard port Accesses to the parallel port can vary in speed from machine to machine The self test program ends with information of which you may want to take note if you plan to write custom host PC applications This information includes the port base address the operating mode either 4 bit unidirectional or 8 bit bi directional and additional CPU cycles needed for reading from the port The extra CPU cycles may be needed for reads because the data lines become valid after the RC time constant on the data lines Self test calculates how many host PC CPU cycles are required Installing the DSKplus Assembler and Debugger 2 7 2 8 Chapter 3 DSKplus Debugger and Application Loader Software The DSKplus lets you experiment with and use a DSP for real time signal pro cessing The DSKplus gives you the freedom to create your own software to run on the board asis orto build new boards and expand the system in a num ber of ways The DSKplus debugger works with the assembler and application loader to help you develop test and refine DSKplus assembly language programs This chapter describes the features of the debugger and how to use the ap plication loader software Topic Page 3 1 Code Explorer Debugger 3 2 Using the Application Loader 3 1 Code Explorer Debugger 3 1 Code Explorer Debugger The Windows based debugger included with the DS
66. P code followed by the creation of the host PC application code if needed This chapter de scribes software considerations you must make before creating DSP and or host PC application code for the C54x DSKplus board Topic Page DSP Software DSP Programming Tips Host PC Software Host Programming Tips 4 1 DSP Software 4 1 4 2 DSP Software When creating software applications for the DSP processor you need an ASCII text editor to create source code the DSKplus algebraic assembler to generate DSP object file machine code and the debugger interface to ex amine the results This section illustrates the process of combining the DSP application code with the DSKplus board and assembler The DSKplus software includes a simple application that takes data from the ACO1 and places it in a buffer To view the source code open the file named firstapp asm located in the firstapp subdirectory of the DSKplus software and load it into your ASCII editor The source code contains two sections text and vectors The text section in cludes all of the executable code that gets data from the ACO1 and places it into the buffer The second section called vectors contains the vector location where the DSP should receive data from the ACO1 Each time the ACO1 transfers a data word to the DSP the DSP goes to the vector for the serial port interrupt service routine associated with the ACO1 By using the setsect directive you
67. PERF BUSINESS REPLY MAIL FIRST CLASS MAIL PERMIT NO 6189 HOUSTON TX SSS A E POSTAGE WILL BE PAID BY ADDRESSEE 5 TEXAS INSTRUMENTS MAIL STATION 640 P O BOX 1443 HOUSTON TX 77251 9879 BIND THIS EDGE NO POSTAGE NECESSARY IF MAILED IN THE UNITED STATES PERF PERF BIND THIS EDGE Reader Response Card TMS320C54x DSKplus User s Guide Which topics should be described in greater detail Texas Instruments wants to provide you with the best documentation possible Please helo us meet this goal by answering these questions and returning this card What is your primary use for the information in this manual _ Designing C54x based hardware _ Designing C54x based software How have you used this manual 3 To look up specific information or procedures when needed as a reference J To read chapters about subjects of interest _j To read from front to back before using the information Please describe any mistakes or unclear information in this manual include page numbers Please list topics that were difficult to find and why for example the topic was not in a logical location Please list any other suggestions for improving this book Name Company Address City State Phone number Thank you Title Zip Country October 1996 PERF TEXAS INSTRUMENTS TMS320C54x DSKplus DSP Starter Kit Users Guide 1996 Digital Signal Processing Solutions
68. Peripherals for more information about the HPI Using a PAL Device 6 3 1 Strobe Generator Figure 6 4 illustrates the interaction between the PC parallel port and the PAL device During normal operation the strobe line STRB generates a 1 cycle pulse which is delayed by one clock cycle after the BYTE signal transi tions to a new level The STRB is connected to the C54x HDS2 line The C54x drives or reads the data on the data lines on the falling edge of HDS2 The C54x also latches the levels of the CNTL1 CNTLO HR W and BYTE to deter mine whether the current transaction is a read or a write which HPI mode to use and which of the two bytes is being transferred Figure 6 5 Functional Diagram for a 4 Bit Read Cycle Start 4 bit read cycle End 4 bit read cycle CLK sl BYTE 1 2 3 4 NBL 1st high nibble 1st low nibble 2nd low nibble 2nd high nibble D7 DO 1st data byte 2nd data byte TBYTE cycle time corresponds to the speed at which the host PC can write to the BYTE location in the PC s port control register Hardware 6 9 Using a PAL Device 6 3 2 Nibble Mode State Machine Figure 6 5 is a functional diagram for the nibble mode The nibble mode state machine controls the NBL signal when performing 4 bit reads only The NBL signal controls which nibble of the read appears in the PC status register Therefore each time the PAL device strobes the HPI two 4 bit reads must be performed
69. STRB signal to keep the data on the data lines during the BYTE cycle HPI READS only This allows the relatively slow PC to read the data from the data register and keeps the data on the data lines for the duration of the BYTE cycle Example B 1 PAL Equation Routine BYTE Oc HRNW WRITE READ STRB n er e e __ E __ HDx PC loads data for HPI write XXXXXX XXXXX XXXXX XXX HPI keeps data on data lines so PC has time to read them B 2 Example B 1 PAL Equation Routine Continued module C54xDSKp title TMS320C54x DSKplus HPI PC Interface Logic Texas Instruments 17 Jul 1996 Co4xDSKp device P22V10C 5 Inputs Clk pun 2 y clock input HDO pin 3 HPI data line 0 HD1 pin 4 HPI data line 1 CNTL1 pin 5 HPI HCNTL1 input BYTE pin 6 Byte indicator CNTLO pin 7 HPI HCNTLO input RNW pin 9 y HPI RW indicator RST pan X0 3 par O async reset Outputs POL pin 18 Strobe Polarity controller Bol pin 17 tri state controller DLY1 pin 19 delay state machine bit BUFEN pin 20 Bi directional buffer enabler LS pin 21 Latch select mode STRB pin 23 y Strobe output RESET pin 24 DSP reset pin HBIL pin 25 y Synced BYTE HPI byte indicator NBL pin 26 Nibble selector 4 bit mode MODE pin 27 Mode latch output RD
70. Symbol sym is not defined in this source file These are errors about general symbols An attempt was made to redefine a symbol or to define a symbol illegally Correct the source per the error message text Cannot redefine local substitution symbol Substitution Stack Overflow Substitution symbol not found These are errors about general substitution symbols An attempt was made to redefine a symbol or to define a symbol illegally Correct the source per the error message text Make sure that the operand of a substitution symbol is defined with a asg or eval directive Symbol table entry is not balanced A symbolic debugging directive does not have a complement ing directive i e a block without a endblock Check the source for mismatched conditional assembly direc tives Expecting parallel instruction Incorrect instruction used in parallel Illegal form of LD used in parallel These are errors about illegal used parallel instructions Correct the source per the error message text Can t include a file inside a loop Invalid load time label These are errors about illegally used directives Specific direc tives are not permitted where they were encountered because they will cause a corruption of the object file Correct the source per the error message text Assembler Error Messages E1000 E1300 W0000 W0001 E1000 Include Copy file not found or opened Description The specified filename cannot be found
71. TL1 of the HPI and which latch is selected in latch mode Hardware 6 3 DSKplus Communications Protocol 6 2 DSKplus Communications Protocol 6 4 The DSKplus development board communicates through your PC s parallel port APC manufactured earlier than 1993 probably has a 4 bit unidirectional port which provides an 8 bit write function but only a 4 bit read function and its data lines are not bidirectional return data is read through four status reg ister bits APC manufactured in 1993 or later probably has an 8 bit bidirection al port which allows 8 bit directional data transfers for both reads and writes and the status register bits can be used for other information Today s high end computers often use enhanced parallel ports and extended capabilities ports called EPP and ECP respectively These are much more complex they provide a multiplexed data and address scheme across the eight data lines and they use a completely different protocol for communica tions However these ports support standard compatibility by default which is 8 bit bidirectional The DSKplus support the following parallel port modes 3 4 bit unidirectional called nibble mode D 8 bit bidirectional called byte mode DD EPP standard compatibility also 8 bit bidirectional or byte mode EPC standard compatibility also 8 bit bidirectional or byte mode The DSKplus does not support the EPP and EPC extended capabilities The parallel port s regis
72. The HPIC BOB bit 0 therefore the byte ordering is least signifi cant byte first There are PC based C functions that perform this task automati cally Refer to the host interface library C54XHIL on your DSKplus diskette for more information about using the PAL device This library includes all of the com munication software needed to run application code on your PC Remember that when you are running host PC applications usually you will be unable to use the debugger Hardware 6 11 PAL Device Modifications 6 4 PAL Device Modifications The information contained in this section is for experienced users ONLY applying it improperly may result in board damage Modifications to the DSKplus board are not supported by Texas Instrument and void all warranties The debugger and other included software will not work correctly following board modifications The PAL device can be modified by reprogramming a 28 pin PLCC 22V10 device and placing it into the socket All pins of the PAL device are accessible though the JP headers When modifying the PAL device keep in mind the pin connec tions listed E E E Pin 1 No connection Pin 2 PAL device CLK input Pin 3 Connected to the PC s DO data line cannot be disconnected from the HPI data lines Pin 4 Connected to the PC s D1 data line cannot be disconnected from the HPI data lines Pin 5 Connected to the PC s CNTL1 line can be disconnected from the host
73. Using the field Directive 15 14 13 V 3 bits 15 12 1 010000000000000 000000000000000 0001001000 1 9 26 y a Sp Llo 2 01234h 20 01234h 32 Field Cree Eield 8 6 el 16 9 field 01234h 20 field 01234h 32 J DSKplus Assembler Directives float and xfloat calculate the single precision 32 bit IEEE floating point representation of a single floating point value and store it in two con secutive words in the current section The most significant word is stored first The float directive automatically aligns to the long word boundary and xfloat does not int and word place one or more 16 bit values into consecutive words in the current section long and xlong place 32 bit values into consecutive 2 word blocks in the current section The most significant word is stored first The long directive automatically aligns to a long word boundary and the xlong directive does not string and pstring place 8 bit characters from one or more character strings into the current section The string directive is similar to byte placing an 8 bit character in each consecutive word of the current section The pstring also has a width of eight bits but packs two characters into a word For pstring the last word in a string is padded with null characters 0 if necessary DSKplus Assembler Description 5 27 DSKplus Assembler Directives Figure 5 4 compares the byte int long xlong float xfl
74. Xfloat 5 27 C 16 long 5 27 C 23 that reference other files 5 30 copy 5 30 C 6 include 5 30 C 6 directory search algorithm assembler 5 5 disassembly definition E 3 dskplasm command 5 4 DSKplus board connection 2 2 board diagram 1 4 circuit board dimensions A 2 communications protocol 6 4 features 1 2 memory map 1 5 overview 1 4 pin connections 6 2 power and cables 6 2 software 2 3 schematic diagram A 3 DSKplus assembler 5 3 development flow 5 3 Index DSKplus communication protocol PC s status regis ter 6 5 DSP defined E 3 software 4 2 code versus host PC code 4 2 EGA definition E 3 else assembler directive 5 30 C 17 elseif assembler directive 5 30 C 17 emulator port XDS510 6 14 end assembler directive 5 31 C 10 endif assembler directive 5 30 C 17 endloop assembler directive C 24 environment variables A DIR 5 6 equ assembler directive 5 31 C 27 equations for PAL device B 1 error messages assembler D 1 to D 8 eval assembler directive 5 31 C 11 expression 5 15 definition E 3 expressions 5 16 conditional 5 17 left to right evaluation 5 15 overflow 5 16 parentheses effect on evaluation 5 15 precedence of operators 5 15 that contain arithmetic operators 5 16 that contain conditional operators 5 17 underflow 5 16 well defined 5 16 external symbol definition E 3 field definition E 3 field assembler directive 5 26 C 13 file header definition E 3 filenames as character strings 5
75. a pin description of the typical DB25 connector and its connection to DSKplus Table 6 1 DB25 Connector Pin Connections Pin Name Connection Description 1 STROBE HR W Controls HR W of the host port interface HPI and the direction of the bidirectional buffer and resets the NBL state machine STROBE 0 2 DO HDO Bit 0 LSB data line controls MODE and TRIST in latch mode 3 D1 HD1 Bit 1 data line controls LS mode and RESET in latch mode 4 D2 HD2 Bit 2 data line 9 D3 HD3 Bit 3 data line 6 D4 HD4 Bit 4 data line 7 D5 HD5 Bit 5 data line 8 D6 HD6 Bit 6 data line 9 D7 HD7 Bit 7 MSB data line 6 2 Power and Cables Table 6 1 DB25 Connector Pin Connections Continued Pin Name 10 ACK 11 BUSY 12 PE 13 SLCT 14 AUTOFD 15 ERROR 16 INIT 17 SLCTIN 18 25 GND Connection HD2 or HD6 NBL HD3 or HD7 NBL HD1 or HD5 NBL HDO or HD4 NBL HCNTLO HINT BYTE HCNTL1 ground Description Bits 2 and 6 when reading from status register in nibble mode Bits 3 and 7 when reading from status register in nibble mode Bits 1 and 5 when reading from status register in nibble mode Bits O and 4 when reading from status register in nibble mode Controls HCNTLO of the HPI DSP to host interrupt signal Controls HBIL of the C54x HPI and is low for first transfer high for se cond low for third and high for fourth nibble mode There are only two transfers when operating in byte mode Controls HCN
76. al words a label would point to the first word In the following example the label Start has the value 40h 9 003F Assume some other code was assembled 10 0040 000A Start word 0Ah 3 7 0041 0003 0042 0007 A label on a line by itself is a valid statement The label assigns the current value of the section program counter to the label this is equivalent to the following directive statement label set provides the current value of the SPC When a label appears on a line by itself it points to the instruction on the next line the SPC is not incremented 3 0050 Here 4 0050 0003 sword 3 5 5 2 Instruction Field 5 5 3 Operands 9 8 The instruction field follows the label field The instruction field must not start in column 1 if it does it will be interpreted as a label The instruction field can contain one of the following opcodes L Algebraic instruction such as B B 4123h L Assembler directive such as data list set An operand can be a constant see Section 5 6 page 5 10 a symbol see Section 5 8 page 5 13 or a combination of constants and symbols in an expression see Section 5 9 page 5 15 Dj Operand prefixes for instructions The assembler allows you to specify that a constant symbol or expression is used as an address an immediate value or an indirect value The follow ing rules apply to the operands of instructions B prefix the operand is an immediate value If you use
77. am memory at power up E 1 Glossary E 2 breakpoint A place in a computer program usually specified by an instruction where its execution may be interrupted by external intervention byte A sequence of eight adjacent bits operated upon as a unit code display windows Windows that show code text files or code specific information COFF common object file format A system of object files configured according to a standard developed by AT amp T These files are relocatable in memory space command A character string you provide to a system such as an assembler that represents a request for system action command file A file created by the user which names initialization options and input files for the linker or the debugger command line The portion of the COMMAND window where you can enter instructions to the system command line cursor An on screen marker that identifies the current character position on the command line comment A source statement or portion of a source statement that is used to document or improve readability of a source file Comments are not assembled constant A fixed or invariable value or data item cursor An on screen marker that identifies the current character position D A digital to analog Conversion of discrete or discontinuous electrical sig nals to continuously variable signals DARAM dual access random access memory Memory that can be altered twice during each
78. ample 5 1 Assembler Listing O14 WNF CO oy 0 31 01 0 A N FR H OY N He 7 8 9 0 1 2 3 4 9 6 l N 22 000600 000080 000080 000081 000082 000083 000500 000500 000501 000502 000503 000504 000505 Setsect vecs O80h Setsect text 0500h Setsect bss 0600h pi dir dir dir div dir dir di dir dir di di dir dir div dir dis div dir dis div dir dir di dir dir dir div dir dis dir dir diro div dir dir dir di diro dir div dir dir dir dir diro di dir dir dir di dir dir dir dir di di diri Reserve space for a variable bss reserve 1 KEKEKKKKKKKKKKKKKKKKKKKKKKKK KKK KKK KEKE M Kx Kx KKK AAA AAA RARA AAA AR Reset and Interrupt Vectors SECT Vecs F073 RESET goto main 0104 F073 NMI goto NOPS 0100 pi dir dir dir div dir dir di dir dir di dir dir dir div dir di div dir dis div dir dir di div dir di div dir dis dir dir dis div dir dir di di dir di div dir
79. an object based COFF file with a obj extension As a result code ad dressing is fully resolved at assembly time using in line assembler directives so there is no need for a linker stage The code is ready to be loaded into the DSP Introduction 1 7 1 8 Chapter 2 Installing the DSKplus Assembler and Debugger Before you use the DSKplus board verify that your equipment meets the re quirements described in the previous chapter Next you must install the hard ware and the software on your PC This chapter provides instructions for connecting the DSKplus board installing the DSKplus software and running the self test program Topic Page 2 1 Connecting the DSKplus Board 2 2 Installing the DSKplus Software 2 3 Running the Self Test Program 2 1 Connecting the DSKplus Board 2 1 Connecting the DSKplus Board Follow these steps to ensure a proper connection between the DSKplus board and the PC host See Figure 2 1 1 Turn off the PC s power 2 Connect the DB25 printer cable to the PC s parallel port 3 Connect the DB25 printer cable to the DSKplus board 4 Connect the power cord to the 5 V dc power supply 5 Plug the transformer into the wall outlet 6 Connect the 5 pin DIN to 5 5 mm power supply adapter cable to the pow er supply s 5 pin DIN connector 7 Connect the 5 5 mm power supply adapter cable into the power supply connector on the DSKplus board 8 Turn on the PC s power Figure 2 1
80. are development tools speech recognition image processing noise cancellation modems etc TMS320 DSP Development Support Reference Guide literature number SPRUO11 describes the TMS320 family of digital signal processors and the tools that support these devices Included are code generation tools compilers assemblers linkers etc and system integration and debug tools simulators emulators evaluation modules etc Also covered are available documentation seminars the university program and factory repair and exchange Head This First vii Trademarks Trademarks viii Code Explorer is a trademark of GoDSP Corporation HP UX is a trademark of Hewlett Packard Company MS DOS is a registered trademark of Microsoft Corporation OS 2 is a trademark of International Business Machines Corporation PC is a trademark of International Business Machines Corporation PAL is a registered trademark of Advanced Micro Devices Inc Solaris is a trademark of Sun Microsystems Inc Tl XDS510 and 320 Hotline On line are trademarks of Texas Instruments Incorporated Windows is a trademark of Microsoft Corporation Pentium is a trademark of Intel Corporation If You Need Assistance If You Need Assistance World Wide Web Sites TI Online http www ti com Semiconductor Product Information Center PIC http www ti com sc docs pic home htm DSP Solutions http www ti com dsps 320 Hotline On line http www ti c
81. assembles when the if expression and all elseif expressions are false 0 This directive is optional in the conditional block if an expression is false and there is no else statement the assembler continues with the code that follows the endif The endif directive terminates a conditional block The elseif and else directives can be used in the same conditional assembly block and the elseif directive can be used more than once within a conditional assembly block For information about relational operators see subsection 5 9 4 page 5 17 Assembler Directives Reference C 17 If elseif else endif Assemble Conditional Blocks Example C 18 00 3004 WN E MMNNNNNNNN EFeErR FFP FP FE TF FF wo CO 10 014 CO ho r 2 eO i000 10 01 4S C0 PO ES O 0000 0001 0002 0003 0004 000a 0008 0005 This example shows conditional assembly SYM1 SYM2 SYMS SYM4 If 4 If 53 If 6 ld 7 Set Set Set Set A WN E if byte else byte endif if byte else byte endif if byte else byte endif if byte elseif byte endif SYM4 SYM4 DIMA SYM1 10 SYM1 SYM3 SYM3 SYM4 SYM1 SYM1 SYM2 SYM2 SYM2 SYMZ lt 10 SYM2 BIMA SYM4 SYM3 oMa SYM2 Equal values Unequal values Less than equal Greater than SYM4 SYM2 Unequal value Equal values Syntax Description
82. ata section 19 un RES 1 points to the first word that AW 20 KK contains reserved bits WON Pall ck CKCkockckck ck ck oko ck ok ck ck ck ko oko ok ok ok ok ck ck ok ok ok kk Kk ok ok ok ok k kk ok ok kk Kk rs re 22 0008 ERES 1 Space 100 23 000f OOOF word 15 24 0010 0008 word RES_1 25 26 27 xx Reserve 20 bits in the data section 20 RES 2 points to the last word that 29 contains reserved bits ias 30 ck CKCckockckck ck Kk oko ok AAA ok ok ck k ck ok ok ok ok ok kk ok ok ok ok kk okok ok ok kk IK IK IKK 31 0012 RES 2 bes 20 32 0013 0036 word 36h 33 0014 0012 word RES 2 Assembler Directives Reference C 31 string pstring Initialize Text Syntax String string stringy pstring string stringa Description The string and pstring directives place 8 bit characters from a character string into the current section With the string directive each 8 bit character has its own 16 bit word but with the pstring directive the data is packed so that each word contains two 8 bit bytes Each string is either L An expression that the assembler evaluates and treats as a 16 bit signed number or L A character string enclosed in double quotes Each character in a string represents a separate byte With
83. c Still in text 0006 0000 C 36 Figure C 2 Using the usect Directive section var1 100 words dflag p 50 words Reserve Uninitialized Space USect section var2 100 words 100 words reserved in var2 151 words reserved in var1 Assembler Directives Reference C 37 C 38 Appendix D Assembler Error Messages The assembler issues two types of error messages L Fatal 3 Nonfatal When the assembler completes its second pass it reports any errors that it encountered during the assembly It also prints these errors in the listing file if one is created an error is printed following the source line that incurred it This appendix lists the three types of assembler error messages in alphabetical order according to the error message number Most errors are fatal errors if an error is not fatal this is noted in the assembler listing file Each error message consists of its class number and text showing the specific error that was detected Each class number group has a Description of the problem and an Action that suggests possible remedies E0000 Comma required to separate arguments Left parenthesis expected Matching right parenthesis is missing Missing right quote of string constant Syntax Error Description Theseare errors about general syntax The required syntax is not present Action Correct the source per the error message text E0001 Section sym is not defined Section sym is not an
84. cate the current block into one of the holes Section directives for initialized sections text data and sect end the current section and begin assembling into another section The bss directive however does not affect the current section The assembler assembles the bss directive and then resumes assembling code into the current section Assembler Directives Reference C 3 bss Reserve Space in the bss Section Example C 4 o I 0o oF WN S e rerrrrrerH o 1 OY O14 CQ IN I5 OO Le L9 20 21 AA Zo 24 20 26 AE 25 23 In this example the bss directive is used to allocate space for two variables TEMP and ARRAY The symbol TEMP points to 4 words of uninitialized space at bss SPC 550h The symbol ARRAY points to 100 words of uninitialized space at bss SPC 554h this space must be allocated contiguously within a page Note that symbols declared with the bss directive can be referenced in the same manner as other symbols 000500 000500 E800 000550 000501 F000 000502 0056 000503 F066 000504 0073 000554 000505 8050 Setsect text 0500h Setsect bss 0550h KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK Start Assembling into text section ck ck ck ck ck ko ck ok ck ck ck ck kok ck kk kokokokokkok kkkkkkkkkkkkkkkkkkkkkkkkkkkk k k amp x k text A 0 poi dir di di dir di dir di dir dir dis dir di dir di dir di dir dir dir dir dis dir di dir
85. ce debugger interface This book discusses various aspects of the debugger interface including window management command entry code execution data management and breakpoints It also includes a tutorial that introduces basic debugger functionality TMS320C54x Code Generation Tools Getting Started Guide literature number SPRU147 describes how to install the TMS320C54x assembly language tools and the C compiler for the C54x devices The installation for MS DOS OS 2 SunOS Solaris and HP UX 9 0x systems is covered TMS320C54x Evaluation Module Technical Reference literature number SPRU135 describes the C54x EVM its features design details and external interfaces TMS320C54x Optimizing C Compiler User s Guide literature number SPRU103 describes the C54x C compiler This C compiler accepts ANSI standard C source code and produces TMS320 assembly language source code for the C54x generation of devices TMS320C5x Simulator Getting Started literature number SPRU137 describes how to install the TMS320C5x simulator and the C source debugger for the C5x The installation for MS DOS PC DOS SunOSM Solaris and HP UX systems is covered TMS320 Third Party Support Reference Guide literature number SPRUO52 alphabetically lists over 100 third parties that provide various products that serve the family of 320 digital signal processors A myriad of products and applications are offered software and hardw
86. ce statements from another file Include source statements from another file e Directives that control conditional assembly Mnemonic and Syntax break well defined expression else well defined expression elseif well defined expression end endif endloop Af well defined expression loop well defined expression Description End loop assembly if condition is true The break construct is optional Assemble code block if the if condition is false The else construct is optional Assemble code block if the if condition is false and the elseif condition is true The elseif construct is optional End assembly file End if code block End loop code block Assemble code block if the condition is true Begin repeatable assembly of a code block f Directives that define symbols at assembly time Mnemonic and Syntax set equ eval well defined expression substitution symbol Description Equate a value with a symbol Perform arithmetic on numeric substitution symbols g Directives that align the section program counter SPC Mnemonic and Syntax align size in words D 22 Description Align the SPC on a word boundary specified by the parameter which must be a power of 2 or default to page boundary Page C 6 C 6 Page C 24 C 10 C 17 C 24 C 17 C 24 Page C 27 C 11 Page C 2 DSKplus Assembler Directives 5 11 2 Directives That Define Sections Six
87. ck ck ko ck ck ko ok ck ck ko okok kokokokokokokokkkkk kkkkk kkkkkkkkkkkkkkkkkkkk k amp kk Var 1 A end Syntax Description Example Initialize Bytes byte byte value value The byte directive places one or more bytes into consecutive words of the current section Each byte is placed in a word by itself the eight LSBs are filled with Os A value can be either of the following D An expression that the assembler evaluates and treats as an 8 bit signed number D A character string enclosed in double quotes Each character in a string represents a separate value Values are not packed or sign extended each byte occupies the eight least significant bits of a full 16 bit word The assembler truncates values greater than eight bits You can use up to 100 value parameters but the total line length can not exceed 200 characters If you use a label it points to the location where the assembler places the first byte In this example 8 bit values 10 1 abc and a are placed into consecutive words in memory The label STRX has the value 100h which is the location of the first initialized word L 0000 Space LODI 9 16 2 0100 000a STRX byte 10 1 abc a 0101 00ff 0102 0061 0103 0062 0104 0063 OLOS 0061 Assembler Directives Reference C 5 copy include Copy Source File Syntax Description C 6 copy filename include filename The copy and include directives tell
88. ck kock kokokokokokokokkkkkkkkkkkkkkkkkkkkk k k amp k text A A Table Resume assembling into the data section xx at address OFh ck ck ck ck ck ko ck k ck ck ck ck kk kokokkokokokokkkkkkkkkkkkkkkkkkkkk k k amp k data Assembler Directives Reference C 9 end End Assembly Syntax Description Example C 10 end The end directive is optional and terminates assembly It should be the last source statement of aprogram The assembler ignores any source statements that follow a end directive This directive has the same effect as an end of file character You can use end when you re debugging and would like to stop assembling at a specific point in your code This example shows how the end directive terminates assembly If any source statements follow the end directive the assembler ignores them Source File START space TEMP Set bss A A A A LOC1 end byte WOrd Listing file 0000 000F 0000 0013 0014 0015 0016 OB WN E OY 300 15 LOC1 48h TEMP A 4 CCC START Space 300 TEMP Set L5 bss LOC1 F485 A A F000 A A TEMP 000F 8000 QLOC1 A end 48h Syntax Description Assign Character Strings to Substitution Symbols eval eval well de
89. ctive Default width 80 characters 3 Minimum width 80 characters 3 Maximum width 200 characters The width refers to a full line in a listing file the line counter value SPC value and object code are counted as part of the width of a line Comments and other portions of a source statement that extend beyond the page width are truncated in the listing The assembler does not list the width and length directives In this example the page length and width are changed Sus Page length 5 lines A 6 da Page width 85 characters n length 65 width 85 iie Page length 55 lines oe ER Page width 100 characters EN length 55
90. cycle debugger A software interface that permits the user to identify and eliminate mistakes in a program directive Special purpose commands that control the actions and functions of a software tool as opposed to assembly language instructions which control the actions of a device Glossary disassembly The process of translating the contents of memory from machine language to assembly language Also known as reverse assembly DSK digital signal processor starter kit Tools and documentation provided to new DSP users to enable rapid use of the product DSP digital signal processor DSPs process or manipulate digital signals which are discrete or discontinuous electrical impulses EGA enhanced graphics array An industry standard video card entry point A point in target memory where the program begins execution expression One or more operations in assembler programming repre sented by a combination of symbols constants and paired parentheses separated by arithmetic operators external symbol A symbol that is used in the current program module but defined in another program module field A software configurable data type which can be programmed to be from one to eight bits long file header A portion of the COFF object file that contains general informa tion about the object file such as the number of section headers the type of system the object file can be downloaded to the number of symbols in the
91. d 04321h 32 0004 4321 Initialize Field field Figure C 1 shows how the directives in this example affect memory Figure C 1 The field Directive Word Code O1 a O 0010101011110 0 field OABCh 14 14 bit field b O Qu CORSO 0 OUI 01010 Eleloal 00Ah 5 E 5 bit field c 1 01010 11100 field 000Ch 4 4 bit field d 1 0101 0O1100I0000000 field x 2 0000 00000000000 1 0000000000000000 field 04321 32 CD 4 0100 001100100001 Assembler Directives Reference C 15 float xfloat Initialize Floating Point Value Syntax float value values Xfloat value value Description The float and xfloat directives place the floating point representation of one or more floating point constants into the current section The value must be a floating point constant or a symbol that has been equated to a floating point constant Each constant is converted to a floating point value in IEEE single precision 32 bit format Floating point constants are aligned on the long word boundaries unless the xfloat directive is used The xfloat directive performs the same function as the float directive but does not align the result on the long word boundary The 32 bit value consists of three fields Field Meaning S A 1 bit sign field e An 8 bit biased exponent f A 23 bit fraction The value is stored most significant word first least significant word second in the follow
92. daries Other sections directives text data and sect end the current section and tell the assembler to begin assembling into another section The usect and the bss directives however do not affect the current section The assembler assembles the usect and the bss directives and then resumes assembling into the current section Variables that can be located contiguously in memory can be defined in the same specified section to do so repeat the usect directive with the same section name Assembler Directives Reference C 35 Usect Reserve Uninitialized Space Example This example uses the usect directive to define two uninitialized named sections vari and var2 The symbol ptr points to the first word reserved in the var1 section The symbol array points to the first word in a block of 100 words reserved in var1 and dflag points to the first word in a block of 50 words in var1 The symbol vec points to the first word reserved in the var2 section Figure C 2 page C 37 shows how this example reserves space in two unini tialized sections vari and var2 1 2 Assemble into text section 3 X ck dede TETERA RETRATO RATE RRA RE TAREA TRE TORA RR REA RARE RARE 4 0000 text 5 0000 E803 A A 03h 6 7
93. di diro dir dis dir di dir dir dir dir diro dir dis dir dir dir di dir dir diro dir dir dir di dir di dir di dir dir dir Allocate 4 words in bss for TEMP Var le bss TEMP 4 KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKEK Still n text section ckckckck Wockckokockockckoc ck o wWecko AA AAA AAA EK KKK ko Wo AAA AAA AA AAA AAA AAA AAA A AA A A A 56h A T 73h Allocate 100 words in bss for the symbol named ARRAY bss ARRAY 100 Assemble more code into text section ck ck ck ck ck
94. done a calculation that produces the indicated result which may or may not be acceptable Action Verify the result is acceptable or change the source if an error has occurred D 8 Appendix E Glossary absolute address An address that is permanently assigned to a memory location A D analog to digital Conversion of continuously variable electrical signals to discrete or discontinuous electrical signals AIC analog interface circuit Integrated circuit that performs serial A D and D A conversions assembler A software program that creates a machine language program from a source file that contains assembly language instructions and direc tives The assembler substitutes absolute operation codes for symbolic op eration codes and absolute or relocatable addresses for symbolic address es assignment statement A statement that assigns a value to a variable batch file A file containing an accumulation of data to be processed This data may be either DOS commands for the PC to execute or debugger commands for the debugger to execute BBS bulletin board service Computer program which may be accessed by remote users allowing them to post questions and view responses block Asetofdeclarations and statements grouped together in braces and treated as an entity boot The process of loading a program into program memory bootloader A built in segment of code that transfers code from an external source to progr
95. e statements in the copy include file it resumes reading source statements from the current file The statements read from a copied file are printed in the listing file the statements read from an included file are not printed in the listing file 5 11 7 Directives That Control Conditional Assembly 9 30 Conditional assembly directives enable you to instruct the assembler to assemble certain sections of code according to a true or false evaluation of an expression Two sets of directives allow you to assemble conditional blocks of code J The if elseif else endif directives tell the assembler to conditionally assemble a block of code according to the evaluation of an expression if expression marks the beginning of a conditional block and assembles code if the if condition is true elseif expression marks a block of code to be assembled if the if condition is false and elseif is true else marks a block of code to be assembled if the if condition is false endif marks the end of a conditional block and termi nates the block DSKplus Assembler Directives 3 The loop break endloop directives tell the assembler to assemble a block of code repeatedly according to the evaluation of an expression loop expression marks the beginning a repeatable block of code break expression tells the assembler to continue to assemble re peatedly when the break expression is false and to go to the code immediately after e
96. e latch mode of the PAL is operating correctly and brings the PAL out of 3 state mode HPIC verification Checks the HPI control register configuration HPIA verification Checks the address in the HPI address register and HPIA mode DATA increment verification Checks the data increment mode of the HPI DATA static verification Checks the no increment mode of the HPI Port mode analysis Determines the parallel port s configuration 4 bit unidirectional or 8 bit bidirectional ACO1 test Performs ACO1 register programming Checks the analog fi nal output data via loopback mode To start the self test click on the DOS icon to access a DOS prompt and type SELE TESI EXE The testing script appears on the screen as shown in Figure 2 4 on page 2 6 If any errors occur the execution is halted Installing the DSKplus Assembler and Debugger 2 5 Running the Self Test Program Figure 2 4 Self Test Script Mii HS DOS Prompt Attempting 8 hit Data LO 8 hit Mode is Functional Testing ACHI Loopback data passed ICONFIGURATION Port addr Hx2Z78 x TEST PASSED sxe eee TEST PASSED sx wee TEST PASSED s Mode 8 hit Bidirectional Extra PC Read cycles required 5 iC SDS KPLUS gt 2 6 If an error occurs during the self test read the error script completely and con firm the following 3 DSKplus power is on indicated by illumination of
97. e one or more 16 bit integers C 19 long value values Initialize one or more 32 bit integers C 23 space size in bits Reserve size bits in the current section a label points to C 31 the beginning of the reserved space String string stringa Initialize one or more text strings C 32 pstring string strings Initialize one or more text strings packed C 32 Xfloat value values Initialize one or more 32 bit integers IEEE single precision C 16 floating point constants but does not align the result on the long word boundary Xlong value valuen Initialize one or more 32 bit integers but do not align on C 23 long word boundary word value values Initialize one or more 16 bit integers C 19 c Directives that format the output listing Mnemonic and Syntax Description Page length page length Set the page length of the source listing C 20 list Restart the source listing C 21 nolist Stop the source listing C 21 page Eject a page in the source listing C 25 title string Print a title in the listing page heading C 34 Width page width Set the page width of the source listing C 20 DSKplus Assembler Description 5 21 DSKplus Assembler Directives Table 5 2 DSKplus Assembler Directives Summary Continued d Directives that reference other files Mnemonic and Syntax copy filename include filenamel Description Include sour
98. ed to program space Assembler Directives Reference C 29 Setsect Example C 30 o 10 014 WN EF PRR RP RP PR O0 OY O1 4s 0 I P5 O o Ln 20 Al 22 22 24 25 20 N Zo Zo SU ad og 23 34 Set Section Physical Address 000500 000500 000550 000501 000502 000503 000504 000080 000080 000081 000084 000505 000505 This example shows how symbols can be assigned with setsect Setsect text 0500h Setsect bss 0550h Setsect Vectors 080h Start Assembling into text section text E800 A 0 KEK KKKKK KEK KK AA AAA AAA EKER KE KKK KK KKK KKK KK KKK KKK KKK KK KKK KK KKK KKK KX Allocate 4 words in bss for TEMP Wckck ckck Wok oko cWockockoc oW KKK REA AAA AAA AO AAA KEK ko ck KKK KKK KKK KEK oo We Ao ko AAA X Var 1 bss TEMP 4
99. efault identifies the assembler options that you want to use Options are not case sensitive and can appear anywhere on the com mand line following the command Precede each option with a hyphen You can combine single letter options without pa rameters for example Ic is equivalent to c Options that have parameters such as i must be specified separately c makes case insignificant in the assembly language files For example c will make the symbols ABC and abc equivalent f you do not use this option case is significant default d dname value sets the name symbol This is equiva lent to inserting name set value at the beginning of the assembly file If value is omitted the symbol is set to 1 For more information see subsection 5 8 2 page 5 14 ipathname specifies a directory where the assembler can find files named by the copy or include state ments You can specify up to 10 directories in this man ner each pathname must be preceded by the i option For more information see subsection 5 4 1 page 5 5 lowercase L produces a listing file q quiet suppresses the banner and all progress infor mation Naming Alternate Directories for Assembler Input 5 4 Naming Alternate Directories for Assembler Input The copy and include directives tell the assembler to use code from external files and to read source statements from another file The syntax for these directiv
100. egers i 5 10 5 6 3 Decimal Integers au ned tanec ined tia Re RR od PCR sone dea as 5 10 5 6 4 Hexadecimal Integers i 5 11 5 6 5 Character Constants i 5 11 5 6 6 Assembly Time Constants i 5 11 o Character SUNOS etegeemhedeedesecdses 5 12 A SVMDOS A Un gn A 5 13 5 51 Lapelis oS atan idos couse aaa as 5 13 5 8 2 Defining Symbolic Constants d Option on the Command Line 5 14 5 8 3 Predefined Symbolic Constants i 5 14 Deo T 2 eo R RERE FE E EEEE EEEE G 5 15 EG ico eo oo ooo ponere EA SEGS 5 16 5 9 2 Expression Overflow and Underflow i 5 16 5 9 3 Well Defined Expressions 0 cece eee BI 5 16 5 9 4 Conditional Expressions i 5 17 O10 COMICCLISUINOS ee poca suda a pi ra ada 5 18 5 11 DSKplus Assembler Directives eee eens 5 20 5 11 1 Directives Summary i 5 20 5 11 2 Directives That Define Sections i 5 23 5 11 3 Directives That Initialize Constants 0 0 ccc eens 5 25 5 11 4 Directives That Align the Section Program Counter 5 29 5 11 5 Directives That Format the Output Listing 0 0 00 c eee eae 5 30 5 11 6 Directives That Reference Other Files ii 5 30 5 11 7 Directives That Control Conditional Assembly 5 30 5 11 8 Directives That Assign Assembly Time Symbols 5 31 5 11 9 Directives That Terminate Assembly 200 000 9 31 A 6 1 Describes the DSKplus development hardware including parallel port registers signal definitions
101. ent data CCCo ok ockockockockockockockockockockock ck ck ck ck ck ck CK CK CK 0 0000000 AAA AAA KK KK KE e S Sk Sk Sk Sk Sk Sk Sk SK X MX data 000D word 13 14 000E bss sym 19 Assemble into bss section 000F word 15 16 return to data section 0010 Resume assembling into text section at current text p di di div div div div div div div div div div div div dir dir dir dir dir dir dir dir dir dir dir dir dir dir di div di di div div div div div dio dio dio dir dir dir dir dir dir div dir dir dir dir dir dir dir dir div di dir text 0005 word 2565 0006 usym usect XY 20 rsv Space unitialized name bss more 2 rsv 2 more locations in pb 0007 word PES 0008 DSKplus Assembler Directives 5 11 3 Directives That Initialize Constants Several directives assemble values for the current section 3 The bes and space directives reserve a specified number of bits in the current section The assembler fills these reserved bits with Os You can reserve a specified number of words by multiplying the number of bits by 16 When you use a label with space it points to the first word that contains reserved bits When you use a label with bes i
102. equal to 12049 or 007846 OFH Constant equal to 1549 or 000F16 37ACh Constant equal to 14 25249 or 37AC16 0x37AC Constant equal to 14 25249 or 37AC16 5 6 5 Character Constants A character constant is a string of one or two characters enclosed in single quotes The characters are represented internally as 8 bit ASCII characters Two consecutive single quotes are required to represent each single quote that is part of a character constant A character constant consisting only of two single quotes is valid and is assigned the value 0 If only one character is speci fied the assembler right justifies the bits These are examples of valid character constants a Represented internally as 6146 C Represented internally as 4346 D Represented internally as 274446 Note the difference between character constants and character strings Sec tion 5 7 page 5 12 discusses character strings A character constant repre sents a single integer value a string is a list of characters 5 6 6 Assembly Time Constants If you use the set directive to assign a value to a symbol the symbol becomes a constant To use this constant in expressions the value that is assigned to it must be absolute For example shift3 set 3 A shift3 You can also use the set directive to assign symbolic constants for register names In this case the symbol becomes a synonym for the register AuxR1 Set ARI SP AuxR1 DSKplus Assembler Description 5 11
103. er Use of TI products in such applications requires the written approval of an appropriate TI officer Questions concerning potential risk applications should be directed to TI through a local SC sales office In order to minimize risks associated with the customer s applications adequate design and operating safeguards should be provided by the customer to minimize inherent or procedural hazards Tl assumes no liability for applications assistance customer product design software performance or infringement of patents or services described herein Nor does TI warrant or represent that any license either express or implied is granted under any patent right copyright mask work right or other intellectual property right of TI covering or relating to any combination machine or process in which such semiconductor products or services might be or are used Copyright 1996 Texas Instruments Incorporated About This Manual Preface Read This First This book describes the TMS320C54x digital signal processing DSP enhanced starter kit DSKplus and how to use the DSKplus with these tools J The DSKplus assembler DD The DSKplus debugger 3 The DSKplus application loader How to Use This Manual The following table summarizes the information contained in this book If you are looking for information about Application loader Assembler directives Code Explorer DSKplus assembler DSKplus debugger Hardware a
104. es associated with loca tions in the program Labels used locally within a file must be unique Opcodes and assembler directive names without the prefix are valid label names Labels can also be used as the operands of the bss directive for example DSS labell 1 label2 NOP B B labell goto label2 K set 1024 constant definitions maxbuf set 2 K The assembler also has several predefined symbolic constants these are discussed in the next section DSKplus Assembler Description 5 13 Symbols 5 8 2 Defining Symbolic Constants d Option on the Command Line The d option equates a constant value with a symbol The symbol can then be used in place of a value in assembly source The format of the d option is as follows dskplasm dname value The name is the name of the symbol you want to define The value is the value you want to assign to the symbol If the va ue is omitted the symbol will be set to 1 Within assembler source you may test the symbol with the following directives Type of Test Directive Usage Existence lf Si sdered name Nonexistence if Sisdefed name 0 Equal to value if name value Not equal to value if name value The argument to the isdefed built in function must be enclosed in quotes The quotes cause the argument to be interpreted literally rather than as a substitu tion symbol 5 8 3 Predefined Symbolic Constants The assembler has several predefined symbo
105. es is copy filename include filename The filename names a copy include file that the assembler reads statements from The filename may be a complete pathname a partial pathname or a file name with no path information The assembler searches for the file in the fol lowing location in the order listed 1 The directory that contains the current source file the current source file is the file being assembled when the copy or include directive is encountered 2 Any directories named with the i assembler option 3 Any directories set with the environment variable A DIR You can augment the assembler s directory search algorithm by using the assembler option or the A DIR environment variable 5 4 1 i Assembler Option The i assembler option names an alternate directory that contains copy include files The format of the i option is as follows dskplasm ipathname You can use up to 10 i options per invocation each i option names one path name In assembly source you can use the copy or include directive without specifying path information If the assembler doesn t find the file in the direc tory that contains the current source file it searches the paths designated by the i options DSKplus Assembler Description 5 5 Naming Alternate Directories for Assembler Input For example assume that a file called source asm is in the current directory source asm contains the following directive stateme
106. fined expression substitution symbol The eval directive performs arithmetic on substitution symbols which are stored in the substitution symbol table This directive evaluates the expression and assigns the string value of the result to the substitution symbol The eval directive is especially useful as a counter in loop endloop blocks well defined is an alohanumeric expression consisting of legal values that expression have been previously defined substitution is arequired parameter that must be a valid symbol name symbol The substitution symbol may be 32 characters long and must begin with a letter Remaining characters of the sym bol can be a combination of alphanumeric characters underscores and dollar signs Assembler Directives Reference C 11 eval Assign Character Strings to Substitution Symbols Example This example shows how eval can be used 1 sslist show expanded sub symbols 2 3 eval example 4 S 6 0000 000 A 100 0001 0064 7 0002 6d90 ARO 8 0003 6d90 ARO 9 10 asg 0 x hd LOOP 5 12 eval x 1 x 13 word x 14 endloop 1 eval x 1 x eval O 1 x 1 0004 0001 word X word 1 1 eval x 1 x tf eval 1 1 x 1 0005 0002 word x word 2 1 eval x 1 x tf eval 241 x dl 0006 0003 word x word 3 i eval x 1 x i eval 341 x 1 0007 0004 word x word 4 1 eval x 1 x tf eval 4 1 x 1 0008 0005 word X word 5 Initialize Field field Syntax field value size in
107. flow in expression 5 16 uninitialized sections bss section C 3 usect section C 35 unsigned definition E 7 usect assembler directive 5 23 C 35 VGA definition E 7 well defined expression 5 16 Width assembler directive 5 30 C 20 word definition E 7 word alignment C 2 word assembler directive 5 27 C 19 XDS510 emulator port 6 14 location on DSKplus board 1 4 Xfloat assembler directive 5 27 C 16 xlong assembler directive 5 27 C 23 Index Index 7 Index 8
108. ftware development flow The DSKplus assembler accepts assembly language source files as its input and produces executable code object files as its output Figure 5 1 DSKplus Assembler in the Software Development Flow Assembler source include files DSKplus copy files Assembler Absolute object files Code Explorer on C54x DSKplus DSKplus Assembler Description 5 3 Invoking the DSKplus Assembler 9 3 5 4 Invoking the DSKplus Assembler To invoke the DSKplus assembler enter the following dskplasm input file object file listing file options dskplasm input file object file listing file options is the command that invokes the assembler names the assembly language source file If you do not supply an extension the assembler uses the default extension asm If you do not supply an input filename the assembler prompts you for one names the object file that the assembler creates If you do not supply an extension the assembler uses obj as a default If you do not supply an object file the assembler creates a file that uses the input filename with the obj extension names the optional listing file that the assembler can create If you do not supply a listing filename the assembler does not create one unless you use the lowercase L option In this case the assembler uses the input filename If you do not sup ply an extension the assembler uses st as a d
109. g you to debug applications that in volve the host port interface If you are controlling the reset line externally be sure the PAL device is in 3 state mode TRISTATE is low The PALO device can be placed in the high impedance state mode by loading the TRIST latch with 0 if TRISTATE is low HESET is in the high impedance state Chapter 7 Initialization Routines The chapter describes how to initialize each of the devices on the DSKplus board and the PC s parallel port Initialization of system elements must occur in a specific order 1 Parallel port 2 PAL device 3 HPI 4 DSP serial port 5 ACO1 analog interface device The first three elements form part of the communications link and the remain ing two elements are DSP peripherals Topic Page 7 1 Communication Link CommLink Initialization 7 2 Serial Port and TLC320AC01 Initialization 7 1 Communication Link CommLink Initialization 7 1 Communication Link CommLink Initialization 7 1 1 The CommLink initialization routine performs all initialization functions re quired for the host PC to communicate with the DSP It also implements many of the C functions included in the host interface library C54XHIL The Comm Link initialization resides on the PC host Parallel Port and PAL Device Initialization The first function of a host application is to find the PC parallel port that con nects to the DSKplus board To do this using the ho
110. gether on one page Following is an alphabetical table of contents for the directives reference Directive Page Directive Page Im C 2 length i C 20 DOS ote pin ee teen sees eee C 31 E E E C 21 s VP pP C 24 NO C 23 DOS sepa eroian pen arendati C 3 TOOD A e ERi s RARE C 24 Dyle os doe NT ISUR AES C 5 MOISI o oue one one ve a cet ete NS C 21 CODY PET A C 6 page P C 25 A C 9 PSN rss eee C 32 else i C 17 Sect 2540404055 604 44 445008658 C 26 A C 17 setsect C29 C 30 lo C 10 I M TTA C 27 ZO andsuteeueasnaceve caaees C 17 E ool C 31 endloop C 24 SUNG E C 32 A eas C 27 EL C 33 OV seccare A C 11 US ee C 34 leld C 13 o MR C 35 NOG er 2262502 a5 ESTEER EET C 16 Width S zen ER RIS ERES PA ERA C 20 Al pace RH au RC HC ER RR C 17 WOI serrr dee ee ery eres wee eerie eee C 19 CI C 6 C 16 C 19 NO C 23 align Align SPC on a 128 Word Boundary Syntax Description Example C 2 align size in words The align directive aligns the section program counter SPC on the next boundary depending on the size in words parameter The size may be any power of 2 although only certain values are useful for alignment An operand of 128 aligns the SPC on the next page boundary and this is the default if no size is given The assembler assembles words containing null values 0 up to the next x word boundary Operand of 1 aligns SPC to word boundary 2
111. gram execution in which the program is executed statement by statement The debugger pauses after each statement to update the data display window source file A file that contains C code or assembly language code that will assembled to form a temporary object file SPC section program counter A specific register that holds the address of the section where the following directive is to be obtained static variable A variable that is allocated before execution of a program begins and remains allocated for the duration of the program string table A table that stores symbol names that are longer than eight char acters Symbol names of eight characters or longer cannot be stored in the symbol table instead they are stored in the string table The name portion of the symbol s entry points to the location of the string in the string table structure A collection of one or more variables grouped together under a single name symbol A string of alphanumeric characters that represents an address or a value tag An optional type name that can be assigned to a structure union or enumeration unconfigured memory Memory that is not defined as part of the memory map and cannot be loaded with code or data unsigned value A value that is treated as a positive number regardless of its actual sign VGA video graphics array An industry standard video card word Acharacter or bit string considered as an entity Glossary E 7
112. he on board PAL device ACO1 operation and register defini tions and the XDS510 emulator port Topic Page Power and Cables DSKplus Communications Protocol Using a PAL Device PAL Device Modifications Connecting Boards to Headers Connecting the XDS510 Emulator Port 6 1 Power and Cables 6 1 Power and Cables The DSKplus development hardware is powered by a universal 5 V dc 3 3 A wall mount power supply Depending on what function is being performed the board s total power consumption can vary so it is recommended that the external loading not exceed 1 0 A when using the the power and ground connections on the JP headers If the total board power requirement exceeds 1 0 A unplug the board s power supply immediately and check connections The power supply in cluded with the kit is regulated and filtered and feeds directly into the DSKplus board If for some reason the power supply needs to be replaced you can replace it with a power supply of similar specifications Use only 5 V dc power supplies with a plug of 2 1 mm inner diameter x 5 5 mm outer diameter Be careful The DSKplus board is not regulated therefore power requirements exceeding 1 0 A could result in board damage The cable is a straight DB25M to DB25F connection Please use the cable in cluded in the kit If for some reason the cable needs to be replaced it is recom mended that the cable be high quality and not exceed 6 feet in length Below is
113. hen you use a label with the bes directive it points to the last word reserved Example This example shows how memory Is reserved with the space and bes directives 1 ck CKCckockckck ck ko ck ck ck ck ck ck ko ok ok ok ok k ck ko ok ok ok ck ko ko ok ok ok ok k kk ok ok ok kk IK IK AA 2 Begin assembling into text section 3 pr Be ir rr ck ko ok ok ok ok k ck ck ok ck ok kk Kk ok ok ok ok k ko lr i IK IK IK IKK 4 0000 text 5 6 ckCkCckockckck ck ko oko ok ok ck ck ck ko ok ok ok ck k ck ok ok ok ok ck Kk ok ok ok ko ok Kk ok ok ok AAA AA 7 Reserve OFO bits 15 words in the mm 8 Xk text section Wk 9 10 0000 Space OFOh 11 O00f 0100 word 1005 200h 0010 0200 12 L3 xx Begin assembling into data section Eo 14 ckCkCck ok ckck ck ck oko ck ck ck ok ck ko ok ok ok ok k ck ok ok ok ok k Kk ok ok ok ko ok Kk ko kok ok ok k IKK kk 15 0000 data 16 0000 0049 String In data 0001 006E 0002 0020 0003 002E 0004 0064 0005 0061 0006 0074 0007 0061 17 KEKEKKKKKKKKKKKK ko oko ok ok ck ck ck ck ok ok ok ok kk ock ok ok ok kk ok ok ok ok kk IKK AA 18 Reserve 100 bits in the d
114. ialiasing filter Software programmable sampling rates Software programmable reset gain and loopback Software programmable power down mode 2 channel analog input summing Software selectable auxiliary input Configurable as master slave to allow cascading O O C C C C L L The AC01 interfaces directly to the C542 TDM serial port The ACO1 generates the required shift clock SCLK and frame sync FS pulses used to send data to from the ACO1 These pulses are a function of software programmable registers and the ACO1 master clock The master clock is generated by the on board oscillator See Chapter 4 Software Considerations for instructions on how to program the ACO1 or see the TLC320AC01C Single Supply Analog Interface Circuit Data Manual The DSKplus board provides six headers including an XDS510 emulator header to aid in the design of daughter boards The XDS510 emulator header allows the board to act as an XDS emulator target board with robust nonintrusive de bugging capabilities The XDS is the advanced emulator from TI available through your local sales office The on board 10 MHz oscillator provides a clock to the C542 the ACO1 and the PAL device The C542 PLL option is set to 4 creating a 40 MHz internal clock oscillator The ACO1 runs at 10 MHz The ACO1 data manual includes information for operation at 10 368 MHz the data from the ACO1 tables and graphs must be interpolated to 10 MHz The GoDSP Code Explo
115. ility labels and comments are not shown as part of the directive syntax LLL K Table 5 2 DSKplus Assembler Directives Summary a Directives that define sections Mnemonic and Syntax Description Page bss symbol size in words alignment Reserve size words in the bss uninitialized data sec C 3 tion data Assemble into the data initialized data section C 9 sect section name Assemble into a named initialized section C 26 setsect section name address page Initialize the section s absolute address C 29 text Assemble into the text executable code section C 33 symbol usect section name size in words Reserve size words in a named uninitialized section C 35 alignment 9 20 DSKplus Assembler Directives Table 5 2 DSKplus Assembler Directives Summary Continued b Directives that initialize constants data and memory Mnemonic and Syntax Description Page bes size in bits Reserve size bits in the current section a label points to C 31 the last addressable word in the reserved space byte value value Initialize one or more successive bytes in the current C 5 section field value size in bits Initialize a variable length field C 13 float value valuen Initialize one or more 32 bit IEEE single precision C 16 floating point constants int value valuen Initializ
116. ing format 31 30 23 22 0 e TA Example This example shows the float directive 1 0000 E904 float 1 0e25 0001 5951 2 0002 4040 float 3 0003 0000 3 0004 42F6 float 123 0005 0000 C 16 Syntax Description Assemble Conditional Blocks f elseif else endif if well defined expression elseif well defined expression else endif Four directives provide conditional assembly The if directive marks the beginning of a conditional block The well defined expression is a required parameter L If the expression evaluates to true nonzero the assembler assembles the code that follows the expression up to a elseif else or endif L If the expression evaluates to false 0 the assembler assembles code that follows a elseif if present else if present or endif if no elseif or else is present The elseif directive identifies a block of code to be assembled when the if expression Is false 0 and the elseif expression is true nonzero When the elseif expression is false the assembler continues to the next elseif if pres ent else if present or endif if no elseif or else is present The elseif directive is optional in the conditional blocks and more than one elseif can be used If an expression is false and there is no elseif statement the assembler continues with the code that follows a else if present or a endif The else directive identifies a block of code that the assembler
117. ir di di dir dir dir dir dir di dir dir dir dis 5 0011 AUX R1 set AR1 6 0000 7711 MMR AUX R1 56h 0001 0056 8 p dir dir dir dir dir di di dir dir dir dir dir dis dir dir div dir dir di di dir div dir dir dir dir dis dir div dir di dir dir di dir dir dir dir dir dir di dir di dir dios 9 dis Set symbol index to an integer expr m LO mo and use it as an immediate operand ii 11 pa dir dir dir dir dir di dir dir dir dir dir dir dios dios dir dir dir dir dir dios dir dir dir dir dir dir dios dir div dir dir dir dir dir dir dir dir dir dir di di dir di dir dios 12 0035 INDEX equ 1007 2 13 0002 FOOO A A INDEX 0003 0035 14 LS pa dir dir dir dir dir dir di dir dir dir dir dir dir dir dir di di dir dir dios dir div dir dir dir dir di dir div dir dir dir dir di dir dir div dir dir dir di di dir dir dios l6 we Sel Symbol SYMIAB Lo a relocatable expr LT Sur and use it as a relocatable operand me 18 p dir dir dir dir dir di dir dir dir dir dir dir dis dir dir dir dir dir dir dir dir dir dir dir dir dir di dir div dir di dir dir dir dir dir dir dir dir di di dir di dir dios 19 0004 000A LABEL word 10 20 0005 SYMTAB SEE LABEL 1 zl n pa dir dir dir dir dir di dir dir dir dir dir dir di dir dir dir dir dir dir dios dir dir dir dir dir dir dis dir dir dir di
118. ituation that could potentially damage your software or equipment The information in a caution is provided for your protection Please read each caution carefully Head This First V Related Documentation From Texas Instruments Related Documentation From Texas Instruments yi The following books describe the 54x and related support tools To obtain a copy of any of these TI documents call the Texas Instruments Literature Response Center at 800 477 8924 When ordering please identify the book by its title and literature number The TMS320C54x DSP Reference Set literature number SPRU210 is composed of four volumes of information each with its own literature number for individual ordering TMS320C54x DSP Reference Set Volume 1 CPU and Peripherals literature number SPRU131 describes the TMS320C54x 16 bit fixed point general purpose digital signal processors Covered are its architecture internal register structure data and program addressing the instruction pipeline DMA and on chip peripherals Also includes development support information parts lists and design considerations for using the XDS510 emulator TMS320C54x DSP Reference Set Volume 2 Mnemonic Instruction Set literature number SPRU1 72 describes the TMS320C54x digital signal processor mnemonic instructions individually Also includes a summary of instruction set classes and cycles TMS320C54x DSP Reference Set Volume 3 Algebraic Instruction Set
119. ive ccce re ret rmm Rer nem Rente niu oe C 15 Using the usect Directive i C 37 o a Ql N Cn O1 NO UJ Tables Operators Used in Expressions Precedence i 5 16 DSKplus Assembler Directives Summary nunnana cece teens 5 20 DB25 Connector Pin Connections i 6 2 Assembler Listing i 5 19 Using Sections Directives i 5 24 PAL Equation Routine i B 2 Contents XV XVI Chapter 1 Introduction The TMS320C54x DSKplus is a low cost DSP starter kit with enhanced archi tecture The development kit contains a stand alone application board that you connect to your PC and that enables you to explore the architecture and operation of the C54x CPU and its peripherals The DSKplus board executes your custom C54x code in real time while the Windows based debugger analyzes it line by line displaying internal DSP register information in multiple windows also in real time The board s communication interface lets you create your own C54x DSP code and host PC code The hardware enables the use of expansion boards for adding memory peripherals such as codecs interface logic other DSPs or microcontrollers Topic Page 1 1 Kit Contents and Features 1 2 What You Need 1 3 Functional Overview kit Contents and Features 1 1 Kit Contents and Features The DSKplus development kit contains these parts O O C O O O O O O C L The DSKplus development board PC parallel port cable DB
120. ller and strobe generator Figure 6 4 PAL Device s Internal Logic Diagram BYTE RNW D1 DO CNTL1 CNTLO EN Nibble NBL NBL mode IN state machine SEL HBIL gt HBIL N Strobe generator INV STRB STRB Latch select LS MODE RESET D Q Output enable Hise E TRIST Hardware 6 7 Using a PAL Device 6 8 Upon power up of the DSKplus board the PAL device is reset and all D latches are set to 0 driving TRIST low MODE low and RESET low TRIST is the 3 state controller that places the output pins in the high impedance state when TRIST is low Therefore at power up the PAL device is in the high impedance state and STROBE HBIL and RESET output values have no effect Loading the PAL device TRIST latch with a 1 drives RESET STROBE and HBIL Once out of the high impedance state the DSP is placed in reset and the DSKplus board operates in nibble mode When MODE 1 the board operates in 8 bit bidirectional mode When MODE 0 the board operates in 4 bit unidirectional mode nibble mode The host PC reads its data register twice to complete the 16 bit read when MODE 1 The host must read the status register four times to complete a 16 bit read when MODE 0 During a read or write access to the HPI both bytes high and low must be accessed to complete the HPI read write cycle Always perform a complete 16 bit read write See the TMSS320C54x DSP Reference Set Volume 1 CPU and
121. ls including the following Y the dollar sign character represents the current value of the section program counter SPC D Register symbols including ARO AR7 5 14 5 9 Expressions Expressions An expression is a constant a symbol or a series of constants and symbols sepa rated by arithmetic operators The range of valid expression values is 32 768 to 32 767 Three main factors influence the order of expression evaluation Parentheses Precedence groups Left to right evaluation Expressions that are enclosed in parentheses are always evaluated first 8 4 2 4 but8 4 2 1 You cannot substitute braces or brackets for parentheses The C54x algebraic assembler uses similar prece dence as does the C language When parentheses do not determine the order of expression evalu ation the highest precedence operation is eva luated first Shifts lt lt gt gt have higher precedence than 8 4 2 10 4 2 is evaluated first When parentheses and precedence groups do not determine the order of expression evaluation the expressions are evaluated as happens in the C language 8 4 2 4 but8 4 2 1 DSKplus Assembler Description 5 15 Expressions 9 9 1 Operators Table 5 1 lists the operators that can be used in expressions Table 5 1 Operators Used in Expressions Precedence Symbols Operators Unary plus minus 1s complement 96 Multiplication division
122. mple title statements and statements following a nolist are not listed The difference between two consecutive source line numbers indicates the number of intervening statements in the source file that are not listed Include File Letter The assembler may precede a line number with a letter the letter in dicates that the line is assembled from an included file Nesting Level Number The assembler may precede a line number with a number the number indicates the nesting level of loop blocks Field 2 section program counter value absolute target address This field contains the section program counter SPC value which is hexadecimal All sections text data bss and named sections main tain separate SPCs Some directives do not affect the SPC and leave this field blank Each section s SPC value can be initialized using section address initializers that is setsect section name Source Listings Field 3 object code This field contains the hexadecimal representation of the object code All machine instructions and directives use this field to list object code Field 4 source statement field This field contains the characters of the source statement as they were scanned by the assembler The assembler accepts a maximum line length of 200 characters Spacing in this field is determined by the spacing in the source statement Example 5 1 shows an assembler listing with each of the four fields identified Ex
123. mple shows how fields are packed into a word Notice that the SPC does not change until a word is filled and the next word is begun For more examples of the field directive see page 5 26 1 ck c Woo dec cA KER ERR KR KKK KR KEK RR RRR KR KR KKK AAA 2 Initialize a 14 bit field 3 KKKKKKKKKAKAAAAAAAAAAAARAAAAAAAAARA AAA IKK 4 0000 2AFO0 field OABCh 14 5 6 KKKKRRK Uk RK KR RARA KR KKK RRR KEK KKK KR KK KX 7 Initialize a 5 bit field 8 in a new word 9 X cc KR KKK KKK KER KKK Ko Kok oko k RA AAA RR RRR KR KEK A 10 0001 5000 LF field OAh 5 11 1 ck ck ck ck kock oko ock ck ok Kok ck k kk ok ok ARA kk kk kk kk ok ok RARA kk 13 NUR Initialize a 4 bit field WW 14 in the same word 15 16 0001 5600 x field OCh 4 17 18 ck ck ck ck ck ck ck ok ck ok k ok ck ck k ok ok ok ck ok ck ok ck k kokokokokokokkxkx k amp k 19 16 bit relocatable field 20 Wk in the next word 21 kkkkkkkx x xkx xx xx xx xxx xx x xk xk xx xxkx xkx xx x xk kxkxx xx xxk xx xx xx 22 0002 0001 field X 23 24 ck ck ck ck ckock oko ok ck ok ok ok ok k kok ok ok ck ok kk KKK IKKE IK IKK AAA IKK 25 Initialize a 32 bit field 26 Ck CA Ck Ck Kk ck ok ok ck ok ko ok ck ko kok ok ok ck ok ok ok Kk kk okokokokokkkxkx kAk 27 0003 0000 fiel
124. n 16 digits are specified the assembler right justifies the value and zero fills the unspecified bits These are examples of valid binary constants 00000000B Constant equal to 049 or 046 0100000b Constant equal to 3249 or 2046 01b Constant equal to 149 or 146 11111000B Constant equal to 24849 or OF846 5 6 2 Octal Integers An octal integer constant is a string of up to six octal digits 0 through 7 fol lowed by the suffix Q or q Octals can also be any constant prefixed with a 0 without a suffix These are examples of valid octal constants 10Q Constant equal to 849 or 846 100000Q Constant equal to 32 76849 or 8 00046 226q Constant equal to 15049 or 9646 5 6 3 Decimal Integers A decimal integer constant is a string of decimal digits ranging from 32 768 to 32 767 or 0 to 65 535 These are examples of valid decimal constants 1000 Constant equal to 100049 or 3E816 32 768 Constant equal to 32 76849 or 8 00046 25 Constant equal to 2549 or 1946 Constants 5 6 4 Hexadecimal Integers A hexadecimal integer constant is a string of up to four hexadecimal digits followed by the suffix H or h Hexadecimal digits include the decimal values 0 9 and the letters A F and a f A hexadecimal constant must begin with a decimal value 0 9 it may also be prefixed with Ox If fewer than four hexa decimal digits are specified the assembler right justifies the bits These are examples of valid hexadecimal constants 78h Constant
125. n in Figure 6 2 Figure 6 2 Status Register 2 1 0 7 6 5 4 3 R R R R R Hardware 6 5 DSKplus Communications Protocol 6 2 3 The PC s Control Register The control register has four bit addressable output signals available and a direction bit that controls the direction of the data lines When transferring data to the DSP load the data register first and then the control register The control register is shown in Figure 6 3 Figure 6 3 Control Register 2 6 5 4 3 2 1 0 Direction R W R W R W R W R W R W T Indicates that this bit controls a hardware signal Bit5 This bit controls the direction of the parallel port data lines Writ ing to this bit in 4 bit unidirectional ports has no effect Bit4 This bit enables the PC interrupt when ACK in the status register is set This bit is always loaded with zero Bit3 Controls the hardware to set reset the CNTL1 signal Bit2 Controls the hardware reset inverted BYTE signal Bit1 Controls the hardware to set reset the CNTLO signal BitO Controls the hardware to set reset the RNW signal When you are setting bit O be sure to set bit 5 appropriately 6 6 Using a PAL Device 6 3 Using a PAL Device The DSKplus board includes a socketed 22V10 programmable array logic PAL 9 device The PAL 9 has been factory programmed to interface the PC s parallel port to the C54x HPI with additional capabilities to control the C54x reset line RS a nibble state machine a 3 state contro
126. nd software installation Initialization of devices Overview of the DSKplus Programming the DSP or host PC Turn to these chapters Chapter 3 DSKplus Debugger and Application Loader Software Chapter 5 Assembler Description and Appendix C Assembler Directives Reference Chapter 3 DSKplus Debugger and Application Loader Software Chapter 5 Assembler Description Chapter 3 DSKplus Debugger and Application Loader Software Chapter 2 Installing the DSKplus Assembler and Debugger Chapter 7 Initialization Routines Chapter 1 Introduction Chapter 4 Software Considerations How to Use This Manual Notational Conventions If you are looking for information about Turn to these chapters Using a PAL device Chapter 6 Hardware Using the XDS510 with Chapter 6 Hardware DSKplus Notational Conventions This document uses the following conventions 3 Program listings program examples and interactive displays are shown In a special typeface Examples use a bold version of the special typeface for emphasis interactive displays use a bold version of the special typeface to distinguish commands that you enter from items that the system displays such as prompts command output error messages etc Here is a sample program listing 0011 0005 0001 field Ly 2 0012 0005 0003 field 3 4 0013 0005 0006 field 6 3 0014 0006 even Here is an example of a system prompt and a command that you might enter
127. ndloop when the expression is true endloop marks the end of a repeatable block The assembler supports several relational operators that are useful for condi tional expressions For more information about relational operators see sub section 5 9 4 page 5 17 5 11 8 Directives That Assign Assembly Time Symbols Assembly time symbol directives equate meaningful symbol names to constant values or strings Dj The eval directive evaluates an expression translates the results into a character and assigns the character string to a substitution symbol This directive is most useful for manipulating counters eval 1 X LOOP byte x 10h break x 4 eval x 1 xX endloop Dj The set and equ directives set a constant value to a symbol The symbol is stored in the symbol table and cannot be redefined For example bval set 0100h byte bval bval 2 bval 12 goto bval The set and equ directives produce no object code The two directives are identical and can be used interchangeably 5 11 9 Directives That Terminate Assembly The end directive terminates assembly It should be the last source statement of a program This directive has the same effect as an end of file DSKplus Assembler Description 5 31 9 32 Chapter 6 Hardware This chapter describes the DSKplus development hardware including parallel port registers signal definitions ports and modes The section also covers the functionality of t
128. nt COPY Copy anm Assume that the file is stored in the directory c 320tools files copy asm Your assembly invocation is dskplasm ic 320tools files source asm The assembler first searches for copy asm in the current directory because source asm Is in the current directory Then the assembler searches in the directory named with the i option 5 4 2 A DIR Environment Variable 9 6 An environment variable is a system symbol that you define and assign a string to The assembler uses the environment variable A_DIR to name alternate directories that contain copy or include files The command for assigning the environment variable s set A DIR pathname another pathname The pathnames are directories that contain copy or include files You can separate the pathnames with a semicolon or with blanks In assembly source you can use the copy or include directives without specifying path information in these statements and use the A DIR path list to give the assembler the alter nate paths If the assembler doesn t find the copy include file in the directory that contains the current source file or in directories named by i it searches the paths named by the environment variable For example assume that a file called source asm contains these statements Copy copy asm Gopy copyZ asm Assume that the files are stored in the following directories c 320tools files copy1 asm c dsys copy2 asm You could se
129. o accomplish this task the host application must know how to communicate with the DSP using the communication protocol Transferring data to and from the PC is quite simple using the host interface library functions This library contains all of the required functions to communicate to the DSKplus board via the parallel port and is found in the C54XHIL directory The C source code hostapp cpp is located in the firstapp subdirectory To compile the hostapp cpp code correctly load hostapp cpp into your C or C editor and make sure your project or make file includes the following files Y HI54X H HIL include file Y HI54X CPP HIL linkable function files After compiling the hostapp cpp source file you can write a batch file to run the DSP and host PC code simultaneously First load the DSP code into the DSP memory using the LoadApp program then start the hostapp exe program The batch file would be similar to loadapp a c path firstapp firstapp obj e start hostapp exe Be sure to reassemble firstapp asm with instruction hpic 0ah added into the source file as follows restrt ar2 1200h hpic 0ah return enable By adding this line the DSP generates a DSP to host interrupt when the buffer is full This is the same interrupt the debugger uses to communicate with DSKplus board Therefore it cannot be used with the debugger software Host Programming Tips 4 4 Host Programming Tips When you are using C54XHIL be sure
130. oat word and string directives For this example assume that the following code has been assembled 1 0000 00aa byte OAAh OBBh 0001 00Dbb 2 0002 coo word CCC 3 0003 Oeee xlong OEEEEFFFh 0004 efff 4 0006 eeee long OEEEEFFFFh 0007 ETE 5 0008 dddd y dE ODDDDh 6 0009 3fff Xfloat 1 99999 000a ffac 7 000c 3f ff float 1 99999 000d ffac 8 000e 0068 String help 000f 0065 0010 006c 0011 0070 Figure 5 4 Using Initialization Directives Word Code ak O1 ak O1 O 1 byte OAAh OBBh 2 word OCCCh 3 4 Xlong OEEEEFFFh 6 7 long EEEEFFFFh 8 int DDDDh 9 a xfloat 1 99999 C d float 1 99999 h e 10 11 0 0 6 C 0 0 7 0 9 28 DSKplus Assembler Directives 5 11 4 Directives That Align the Section Program Counter The align directive aligns the SPC at a 1 word to 128 word boundary This ensures that the code following the directive begins on an x word or page boundary If the SPC is already aligned at the selected boundary it is not incremented Operands for the align directive must equal a power of 2 between 20 and 216 although alignments beyond 27 are not meaningful For example Operand of 1 aligns SPC to word boundary 2 aligns SPC to long word even boundary 128 aligns SPC to page boundary The align directive with no operands defaults to 128 that is to a page boundary Figure 5 5 demonstrates the align directive Assume that the following code has been assembled 1 0000 4
131. om sc docs dsps support html North America South America Central America Product Information Center PIC 972 644 5580 Tl Literature Response Center U S A 800 477 8924 Software Registration Upgrades 214 638 0333 Fax 214 638 7742 U S A Factory Repair Hardware Upgrades 281 274 2285 U S Technical Training Organization 972 644 5580 DSP Hotline 281 274 2320 Fax 281 274 2324 Email dsoh ti com DSP Modem BBS 281 274 2323 DSP Internet BBS via anonymous ftp to ftp ftp ti com mirrors tms320bbs Europe Middle East Africa European Product Information Center EPIC Hotlines Multi Language Support 33 1 30 70 11 69 33 130 701032 Email epic ti com Deutsch 49 8161 80 33 11 or 33 1 30 70 11 68 English 33 1 30 70 11 65 Francais 33 1 30 70 11 64 Italiano 33 1 30 70 11 67 EPIC Modem BBS 33 1 30 70 11 99 European Factory Repair 33 4 93 22 25 40 Europe Customer Training Helpline 49 81 61 80 40 10 Asia Pacific Literature Response Center 852 2 956 7288 4852 2 956 2200 Hong Kong DSP Hotline 4852 2 956 7268 852 2 956 1002 Korea DSP Hotline 82 2 551 2804 82 2 551 2828 Korea DSP Modem BBS 82 2 551 2914 Singapore DSP Hotline 65 390 7179 Taiwan DSP Hotline 886 2 377 1450 4886 2 377 2718 Taiwan DSP Modem BBS 886 2 376 2592 Japan Product Information Center 0120 81 0026 in Japan 0120 81 0036 in Japan 03 3457 0972 or INTL 813 3457 0972 03 3457 1259 or INTL 813 3457 1259 DSP Hotline 03 3769
132. ontrol register TSPC and the ACO1 registers Code for performing the initialization of the serial port and the ACO1 is included in the PERIPHS directory of the DSKplus software SN NS BC S S NS NN NB B B Bg g g g g v e Note If you wish to use the DSP s on chip peripherals in your own applications your code must perform the appropriate peripheral initializations Perform the peripheral initialization by loading and running the following DSP code XF 0 Force the ACO1 to reset state n TSPC 0008h Store 8h to the TDM serial port cotrl reg TSPC 00C8h Store C8h to the TDM serial port ctrl reg CALL ACOIINIT Call the ACO1 init routine The first store to the TSPC stops the serial port from operating by resetting the XRST and RRST bits each to 0 The second store to the TSPC configures the serial port to receive the CLKX and CLKR clock signals externally MCM 0 and configures FSR and FSX to receive the frame sync pulses externally TXM 0 As a result of the second store to the TSPC the serial port begins operating dependent upon external clock and frame sync pulses TE Note The AC01 is configured to generate the CLKX CLR FSX and FSR signals Do not program the DSP serial port to generate these signals Always store 00C8h to the TSPC as the second store Lv The CALL statement calls the function ACO1INIT to initialize the ACO1 regis ters By default the ACO1 begins operating
133. plus Assembler and Debugger 2 3 Installing the DSKplus Software Provided you have properly installed the hardware and software the Code Ex plorer debugger interface is displayed on your screen as shown in Figure 2 3 Figure 2 3 Code Explorer Debugger Interface Cds Code Explorer Al ES File Edit View Debug Options Window Help DSP HALTED Options Stepinto StepOver StepOut Run Halt Reset Animate 4 C54 Registers Op ES 4500 SP O16C TC 0000001000 ARO 10F5 T 0000000000 AR 1002 OVA 01153 AR 1007 OVE ARS PEPE OVH k 4 BAE4 SAH ARS PE C16 ARB B3FF FECT AR EC9S8 CMPT BE FEFE CPL ARP ARO XF HH 1 HP ME 0200 OVLY O20C AVIS 0080 DEOM 0500 tart 0500 call ACO1LIHIT 0502 mmriPHST Zlal h 0504 mmr S5PjY 0ffeh 0506 mmr R2 1200h 0508 AR24 data bh 0504 mmr IME 80h 050 INTH 50D 0500 050 0510 0510 0511 0513 0515 0516 0518 0514 0518 0518 51D 051E 0520 0520 0521 0522 i Dis Assembly Of x FO 4 2710 710 fel 092 700 FEBB FFFE 1800 3B00 DA 0000 0000 F495 FO S nop goto wait 4930 B mmr 30h F330 B B amp Z fffch lt lt 0 7092 AR2 data l bh 4931 mmri3lh E 6012 TC 01h F1280h F830 itf TC goto restrt FAEB return enable restrrt mmr A R2 1200h mmr z2ch 0eh return _ enable ACOLINIT HF INTH 1 mmr TCE 0 INTH FFBD IME FFBD IFR FFBD IPTE Peripheral Registers 2 B x T
134. pstring values are packed into words starting with the most significant byte of the word Any unused space is padded with null bytes The assembler truncates any values that are greater than eight bits You may have up to 100 operands but they must fit on a single source statement line If you use a label it points to the location of the first word that is initialized Example This example shows 8 bit values placed into words in the current section 1 0000 0041 Str Ptr String ABCD 0001 0042 0002 0043 0003 0044 2 0004 0041 String 41h 42h 43h 44h 0005 0042 0006 0043 0007 0044 3 0008 4175 pstrang Austin Houston 0009 7374 000a 696E 000b 486F 000c 7573 000d 746F 000e 6E00 4 000f 0030 Cl 6 F 12 C 32 Syntax Description Example text Assemble into text Sections text The text directive tells the assembler to begin assembling into the text section which usually contains executable code The section program counter is set to the address specified by the preceding setsect directive if nothing has yet been assembled into the text section If code has already been assembled into the text section the section program counter is restored to its previous value in the section text is the default section Therefore at the beginning of an assembly the assembler assembles code into the text section unless you specify a different sections directives data or sect This example assembles code into the
135. r dir dir dir di dir dir dir dir dir di dir dir dir dios 2 3 TN Set symbol NSYMS equal to the symbol SUM 24 mu INDEX and use it as you would INDEX mum 25 p dir dir dir dir dir di dir dir dir dir dir dir dis diro dir div dir dir dir dir dir div dir dir dir dir dis dir div dir di dir dir di dir dir dir dir dir di di dir di AR 26 0035 NSYMS Set INDEX aT 0005 0023 word NSYMS C 28 Set Section Physical Address setsect Syntax Setsect section name address page Description The setsect directive initializes the absolute address of the named section The setsect directive must be specified before the declaration of a section bss text etc or the section program counter SPC begins to assemble code into the section s default address 0 section name address page can be either a section directive such as text or bss If section name is an initialized or uninitialized named sec tion such as sect or usect the actual name is used to ref erence the section see the following example specifies the beginning address of the section specified as the section name The assembler maintains each section counter of the assembly program specifies where the section resides in memory Page 0 is pro gram memory and page 1 is data You can force the program memory to be loaded to data space by specifying page 1 in the page field The same applies for data memory being load
136. rce listing format 5 18 label 5 13 definition E 5 symbols used as 5 13 label field 5 7 labels case sensitivity c assembler option 5 4 in assembly language source 5 7 syntax 5 7 using with byte directive C 5 latch select mode LS 6 10 left to right evaluation of expressions 5 15 length assembler directive 5 30 C 20 list assembler directive 5 30 C 21 listing control C 21 C 25 C 34 file 5 30 to 5 32 creating with the l option 5 4 format 5 18 to 5 19 page eject 5 30 page size 5 30 C 20 listing file definition E 5 loading LoadApp 3 4 logical operators 5 16 Jong assembler directive 5 27 C 23 loop assembler directive 5 31 C 24 LS mode 6 10 LSB defined E 5 LSByte defined E 5 member definition E 5 memory map for DSKplus 1 5 memory map for DSKplus definition E 5 menu bar definition E 5 menu selections definition pulldown menu E 6 modifications PAL device 6 12 MP MC bit definition E 5 MSB definition E 5 MSByte definition E 5 named section definition E 5 named sections sect directive C 26 usect directive C 35 naming alternative directories for assembler in put 95 5 nibble mode state machine NBL signal 6 10 nolist assembler directive 5 30 C 21 object code source listing 5 19 object file definition E 6 octal integer constants 5 10 operand definition E 6 operands field in assembler statement 5 8 to 5 9 immediate addressing 5 9 in source statement format 5 8
137. rd Lo 0002 0003 word 3 4 0004 Start assembling into data section at 0600h data 0009 word 25 LO 000A 000B word DL 000C Start assembling into a named initialized section Var defs at O80h Var defs 17 18 sect 0011 word 0012 Resume assembling into data section at curr
138. re the host PC downloads the protocol to the DSP communication software which resides in DSP memory at addresses 80h 17Fh The protocol also uses a mutual com Functional Overview munication buffer in DSP memory at 1000h 1009h The communication buffer is the memory used for communicating between the host and DSP All memory locations from 80h 17Fh and 1000h 1009h are reserved and must never be written over See the DSKplus memory map in Figure 1 2 for information on reserved memory Figure 1 2 DSKplus Memory Map Program Data 0000h Beservad 0080h 0000h OVLY Z 1 Interrupts Memory mapped 007Fh registers 0080h Communications 0100h kernel 005Fh 0180h PORUM Scratch pad RAM On chip Program RAM 007Fh DARAM 0080h 10K words OVLY 1 fF T uz Miss BSP RAM block 0800h or program RAM On chip ES DARAM Kernel buffer 10K words 10 words I 10007 F HPI RAM block 100Ah 27FFh or program RAM 2800h RN Lo Jo 1800h 27FFh Program RAM 2800h External 27FFh Reserved memory EFFFh FOOOh cer External on chip ROM F7FFh F800h Reserved ROM bootloader FF7Fh FF80h Reserved ROM interrupts FFFFh FREE Introduction 1 5 Functional Overview The ACO1 analog interface circuit provides a single channel of voice quality data acquisition The ACO1 has the following features Single chip solution A D and D A conversions with 14 bits of dynamic range Built in programmable ant
139. rer provides a Windows based debugging interface and a manageable development environment The debugger interface can display and modify all of the internal registers of the DSP Some common functions of the debugger are single stepping code setting breakpoints in code setting up watch windows and managing file I O Additional debugger features and information can be found in Chapter 3 DSKplus Debugger and Application Loader Software These tools allow you to fully develop and debug DSP code in a real time environment Functional Overview The DSKplus software includes a Windows based real time debugger DSKplus application loader and an absolute algebraic assembler The DSKplus algebraic assembler enables you to program in assembly language without having extensive knowledge of the mnemonic instruction set Take for example a case in which you want to multiply two numbers x x y and place the result in accumulator B With a mnemonic based assembler you must know the function of each mnemonic instruction STM y AR2 Address of first multiplicand STM X AR3 Address of second multiplicand MPY AR3 AR2 B With an algebraic assembler you use simpler mathematical notation AR2 AR3 Ty FX B AR2 AR3 For more information regarding the algebraic instruction set see 1MS320C54x DSP Reference Set Volume 3 Algebraic Instruction Set The DSKplus algebraic assembler converts the source file with a asm exten sion to
140. sembler directive 5 23 section 5 23 single step definition E 7 software breakpoints definition E 2 software considerations DSP programming tips 4 5 DSP software 4 2 hostPC 4 6 host programming tips 4 7 software requirements for installation 1 3 source file definition E 7 source listings 5 18 to 5 19 source statement field source listing 5 19 format 5 7 to 5 9 algebraic field 5 8 comment field 5 9 instruction field 5 8 label field 5 7 operands 5 8 to 5 9 number source listing 5 18 Space assembler directive 5 25 C 31 Index 6 SPC aligning to word boundaries 5 29 to 5 32 C 2 assembler symbol 5 8 assigning alabelto 5 8 definition E 7 predefined symbol for 5 14 value associated with labels 5 8 shown in source listings 5 18 Starting self test script 2 6 static variable definition E 7 string assembler directive 5 27 C 32 string table definition E 7 strobe generator PAL device 6 9 structure definition E 7 substitution symbols arithmetic operations on 5 31 assigning character strings to 5 31 symbol 5 13 case for 5 4 definition E 7 symbolic constants 5 14 defining 5 14 predefined 5 14 register symbols 5 14 symbols assigning values to C 27 character strings 5 12 defined by the assembler 5 4 predefined 5 14 used as labels 5 13 tag definition E 7 lext assembler directive 5 23 C 33 section 5 23 C 33 title assembler directive 5 30 C 34 unconfigured memory definition E 7 under
141. st interface library call the C function locate port Other functions include v id init port int set_latch 1 0 mode The first C function performed is init_port which initializes the PC port toa known state The set_latch function sets the appropriate latch in the PAL device In this case the PAL device is brought out of the high impedance state 1 and the DSP is placed in reset 0 By default the port operates in nibble mode Call the function mode to set the port to the 8 bit mode if you have an 8 bit port 7 1 2 Host Port Interface Initialization e For the DSP s host port interface to operate correctly call the function hpi_init which performs a write to the HPI control register to configure the byte ordering of the communication and to clear any pending interrupts The second operation hpi init performs is HPI address register initialization The routine initializes the HPIA to point to the beginning of the HP RAM block 1000h After the init port set latch 1 0 mode and hpi init functions execute the DSKplus board is ready to bootload Serial Port and TLC320AC01 Initialization 7 2 Serial Port and TLC320AC01 Initialization The second type of initialization in an application is DSP peripheral initializa tion The on board ACO1 analog interface is an external device that connects to the DSP s TDM serial port To use the analog interface you must initialize the TDM serial port c
142. state 01 Level of DO propagates to the MODE output Level of D1 propagates to the reset output MODE and re set must be loaded simultaneously 10 Level of D1 propagates to TRIST output 11 Unused The levels of the data lines propagate to the respective output pins in real time To load the data into the latch load the host data register first then enter the correct CNTL1 and CNTLO levels and return to the neutral state to latch in the data You must return to the neutral state after loading the data to the latch to allow the loading of the data register before performing another load Also re turning to the neutral state avoids transient states of the CNTL1 and CNTLO lines Transient states occur when attempting to change the two signal levels at the same time For example if the current states of CNTL1 and CNTLO are high and low equivalent to 1 and 0 and a load of the PC control register changes the states to low and high 01 the bits may not change exactly at the same time generating erroneous states 00 or 11 Because both of these states are neutral in the factory programmed PAL device there is no concern How ever if the state 11 is used in a customized PAL device transient states may have adverse effects Always return to the neutral state to be safe To disable the LS mode reset the LS latch to 0 by writing a 0x0000 to the HPIC At this point the data latches are loaded and DSP PC communications oper ate normally
143. succeeding pages Source file title Fast Fourier Transforms 9 title Jw Floating Point Routines page Listing file TMS320C54x DSKplus Assembler Version x xx oun Apr 23 161259149 1995 Copyright e 1996 Texas Instruments Incorporated xxxx Fast Fourier Transforms PAGE 2 3 4 TMS320C54x DSKplus Assembler Version X Xx sun Ape 23 16 25 49 1995 Copyright e 1996 s BIOSLIDO EOINNt C 34 Texas Instruments Incorporated Routines PAGE 2 Syntax Description Reserve Uninitialized Space _ usect symbol usect section name size in words alignment flag The usect directive reserves space for variables in an uninitialized named section This directive is similarto the bss directive both simply reserve space for data and have no contents However usect defines additional sections that can be placed anywhere in memory independently of the bss section symbol points to the first location reserved by this invocation of the usect directive The symbol corresponds to the name of the variable for which you are reserving space section name must be enclosed in double quotes only the first eight characters are significant This parameter names the uni tialized section size in words is an expression that defines the number of words that are reserved in section name alignment flag is an optional parameter This flag causes the assembler to allocate size on long word boun
144. symbol table and the symbol table s starting address global symbol A symbol that is either defined in the current module and accessed in another or accessed in the current module but defined in another Glossary E 3 Glossary E 4 host port interface HPI An 8 bit parallel interface that the CPU uses to communicate with a host processor HPIC host port interface control register 16 bit register that controls the operation of the host port interface HPI HPIA host port interface address register 16 bit pointer to HPI memory IC integrated circuit A tiny wafer of substitute material upon which is etched or imprinted a complex of electronic components and their interconnections IMR interrupt mask register A 16 bit memory mapped register used to enable or disable external and internal interrupts A 1 written to any IMR bit position enables the corresponding interrupt when INTM 0 input section A section from an object file that is linked into an executable module interrupt A condition caused either by an event external to the CPU or by a previously executed instruction that forces the current program to be Suspended and causes the processor to execute an interrupt service routine corresponding to the interrupt Glossary label Asymbol that begins in column 1 of a source statement and corresponds to the address of that statement listing file An output file created by the assembler that lists source
145. t points to the ast word that contains reserved bits Figure 5 2 shows the space and bes directives Assume the following code has been assembled for this example 1 Aa GW N COO O Ol 0000 0001 0002 0004 UDUS 0007 0100 0200 000f 00ba xx space and bes directives word LOON 200 Res 1 Space LZ word 13 Res_2 bes 20 byte OBAh Res 1 points to the first word in the space reserved by space Res 2 points to the last word in the space reserved by bes Figure 5 2 Using the space and bes Directives 17 bits reserved 20 bits reserved Res 1 02h Res_2 06h DSKplus Assembler Description 5 25 DSKplus Assembler Directives L byte places one or more 8 bit values into consecutive words of the current section This directive is similar to word except that the width of each value is restricted to eight bits _j The field directive places a single value into a specified number of bits in the current word With field you can pack multiple fields into a single word the assembler does not increment the SPC until a word is filled Figure 5 3 shows how fields are packed into a word For this example assume the following code has been assembled the SPC doesn t change for the first three fields the fields are packed into the same word 4 0000 6000 field 5 0000 6400 diela 6 0000 6440 field 7 0001 0123 field 0002 4000 8 0003 0000 field 0004 1234 Figure 5 3
146. t up the search path with these commands set A_DIR c dsys DSKPLASM ic 320tools files source asm The assembler first searches for copy1 asm and copy2 asm in the current directory because source asm is in the current directory Then the assembler searches in the directory named with the option and finds copy1 asm Finally the assembler searches the directory named with A_DIR and finds copy2 asm The environment variable remains set until you reboot the system or reset the variable by entering set A DIR Source Statement Format 5 5 Source Statement Format 9 9 1 Label Field TMS320C54x assembly language source programs consist of source state ments that can contain assembler directives assembly language instructions and comments The format of the source file determines how long the source statement can be but the assembler reads a maximum of 200 characters per line so keep your source statements to 200 characters or less If a statement contains more than 200 characters the assembler truncates the line and is sues a warning If you are not concerned with the comments in your source file you can allow them to be truncated but the operational portion of the state ments must be kept to a maximum of 200 characters Follow these guidelines in writing assembly language source statements 3 Allstatements must begin with a label a blank an asterisk ora semicolon 3 Labels are optional if used they must begin in column 1
147. te value mode for directives Compare the following statements A A 10 byte 10 In the first statement the immediate value mode is necessary to tell the assembler to add the value 10 to accumulator A In the second statement however immediate value is not used the assembler expects the operand to be a value and initializes a byte with the value 10 5 5 4 Comment Field A comment can begin in any column and extends to the end of the source line A comment can contain any ASCII character including blanks Comments are printed in the assembly source listing but they do not affect the assembly A source statement that contains only a commentis valid If it begins in column 1 it can start with a semicolon or asterisk Comments that begin any where else on the line must begin with a semicolon The asterisk identifies a comment only if it appears in column 1 DSKplus Assembler Description 5 9 Constants 5 6 Constants The assembler supports six types of constants Binary integer Octal integer Decimal integer Hexadecimal integer Character Assembly time O O C C C L The assembler maintains each constant internally as a 32 bit quantity Constants are not sign extended For example the constant OFFh is equal to OOFF base 16 or 255 base 10 it does not equal 1 5 6 1 Binary Integers A binary integer constant is a string of up to 16 binary digits Os and 1s followed by the suffix B or b lf fewer tha
148. ters are located in the PC s data memory You must use a 100 IBM AT compatible computer to eliminate any parallel port specification discrepancies Compatible PCs use the following port addresses Port Data Register Status Register Control Register 1 Ox3BC Ox3BD Ox3BE 2 0x378 0x379 Ox37A 3 0x278 0x279 Ox27A Don t get confused by the port number and the LPT designator The LPTx can change due to other peripherals connected to your PC When running custom applications always take note of available ports by their addresses DSKplus Communications Protocol 6 2 1 The PC s Data Register The data registers of of the PC s parallel port are connected to the DSP HPI data lines HDO HD7 through a bidirectional buffer The data register is al ways used for writing to the DSP HPI However when data is being read the data register is needed only if the PC s parallel port is bidirectional 8 bit otherwise data is read from the status register The data register of the PC s parallel port is shown in Figure 6 1 Figure 6 1 Data Register 7 6 9 4 3 2 1 0 QATAR TAS ee R W R W R W R W R W R W R W R W 6 2 2 The PC s Status Register The status register has five input lines that directly indicate the levels of four sig nals connected to the PC external hardware used for bits of data information only when in nibble 4 bit mode The fifth line is used as a DSP to host interrupt HINT line The status register s configuration is show
149. ters that allow you to request additional or specific functions when you invoke a software tool PC Personal computer or program counter depending on context and where it s used In this book in installation instructions or in information relating to hardware and boards PC means personal computer as in IBM PC In general debugger and program related information PC means program counter which is the register that identifies the current statement in your program PROM programmable read only memory An integrated circuit on which information can be programmed by the user This circuit can be read from but not written to pulldown menu A command menu that is accessed by name from the menu bar at the top of the debugger display raw data Executable code or initialized data in an output section reverse assembly The process of translating the contents of memory from machine language to assembly language Also known as disassembly SARAM single access random access memory Memory that can be altered only once during each cycle section Arelocatable block of code or data that ultimately occupies a space adjacent to other blocks of code in the memory map serial port An access point that the debugger uses to sequentially transmit and receive data to and from the emulator or the applications board The port address represents the communication port to which the debugger is attached Glossary single step A form of pro
150. text and data sections The data section contains integer constants and the text section contains character strings Oe WN EF e O WO Oo On hp 12 LS 14 15 16 17 18 13 ZO ZA AA 2 3 24 25 26 Ad 0000 0000 0001 0000 0000 0001 0002 0003 0004 0005 0006 0007 0002 0002 0003 0008 0008 0009 000a 000b 000a 000b 0041 0042 0043 0058 0059 005a 0000 0003 000c 000d 0051 0075 0069 0074 Begin assembling into data section p dir dir dir dir dir dir dir di dir dir dir dir dir dir dir dir dir dir dir dir dios dir dir dir dir dir dios dir di di dir dir dir di dir dir dir dir dir dir d data byte OAh OBh Begin assembling into text section text START oot A END tL T ee A A START A A END
151. text sections Reserve space 1n data aki data Space OCCh Assemble into text KXKXKXXKXXKAXKAAAA AAA AAA AAA AAAAAA AAA AAA AAAAAAAAAAAAAARA AA A text constant into data INDEX set 0 A INDEX AR Assemble into data WU ckckckckockckock kock ckock KKK ok ck ok ck ok ok ok ok ok oko ok ok oko o o ko o ko o ko ko Kk Mk Kk Kk X Xx X Table data word e Assemble 16 bit byte OFFh Assemble 8 bit constant into data Assemble into text ck ck ck ck ck ck ck k ck ck ck
152. the DSP buffer at location 1200h DSP Programming Tips 4 2 DSP Programming Tips The following tips can help you develop your application code faster and more efficiently 1 2 The stack pointer SP must be initialized Choose a memory location that allows the SP to grow with your application The interrupt mask register IMR must always have the HPI interrupt en abled so that the debugger can communicate with the DSP s communica tion kernel IMR 200h only if you are using the debugger or the loader Memory from 80h 17Fh is reserved for the kernel Memory from 1000h 1009h is reserved for the communication buffer Always have INT2 masked in the IMR register The HINT pin is tied to INT2 to perform an HPI boot at power up Enable this interrupt only if you want the DSP to interrupt itself when the DSP sets the HINT bit in the HPIC Otherwise keep it 0 in the IMR TRAP 2 Is reserved for the kernel only when using the debugger There are many software interrupts to choose from Software Considerations 4 5 Host PC Software 4 3 Host PC Software 4 6 Creating host PC software requires that you have a PC based C or C com piler capable of generating machine code for your PC This code can be used to create various applications that allow you to see the results of your DSP code In this section you take firstapp obj to the next step you load the data buffer back to the PC and display the data on the PC screen T
153. the assembler to read source statements from a different file The statements that are assembled from a copy file are printed in the assembly listing The statements that are assembled from an included file are not printed in the assembly listing regardless of the number of list nolist directives assembled The assembler 1 Stops assembling statements in the current source file 2 Assembles the statements in the copied included file 3 Resumes assembling statements in the main source file starting with the statement that follows the copy or include directive The filename is a required parameter that names a source file It may be enclosed in double quotes and must follow operating system conventions You can specify a full pathname for example c dsp file1 asm If you do not spec ify a full pathname the assembler searches for the file in 1 The directory that contains the current source file 2 Any directories named with the i assembler option 3 Any directories specified by the environment variable A DIR The copy and include directives can be nested within a file being copied or included The assembler limits nesting to ten levels the host operating system may set additional restrictions The assembler precedes the line numbers of copied files with a letter code to identify the level of copying An A indicates the first copied file B indicates a second copied file etc Copy Source File copy include Example 1 In
154. the cursor over the instruction and click your right mouse button To set reset the probe point se lect toggle probe point After the probe point is set specific attributes must be assigned in the probe point window The debugger s on line help is accessed through a button on the interface It can be helpful in providing answers to common questions you may have while you are using the tool DSKplus Debugger and Application Loader Software 3 3 Using the Application Loader 3 2 Using the Application Loader 3 4 The application loader called LoadApp loads your application code to the DSP memory and starts executing it LoadApp loads the kernel to Ox80h 0x17Fh and then proceeds to load the application code The general form of the command to load an application is loadapp a c path appfile obj e label options This command loads appfile obj to the DSP and begins executing the code at label The label must be a valid label in the assembly source files asm Available command line options a specifies an application file Immediately followed by a space and the path and filename bx Specifies the port MODE x 4 4 bit mode X 8 8 bit mode px Forces the line printer LPT port to a specific number where x Is either 1 2 or 3 e Specifies the starting location for execution in the DSP The option is followed by a space and a valid label or address If you use an address it can be in either 0x0 or
155. the green LED 3 DSKplus is firmly connected to the PC via the printer cable The self test program is somewhat redundant to test for several different causes of errors For example the port locator writes a OXFO to the data regis ter and looks for the bit high nibble in the status register If this case is true it loads the data register with 0x0 and examines the status once again If this case passes it assumes the DSKplus board is attached to the port If it fails it will try the next port However a false reply of NO CONNECT occurs if any of the high four bits are open or shorted to ground When the test passes and a port is located it is still not known if any of the data lines are shorted to one another The continuity check performs adjacent data line continuity testing The system setup can be responsible for problems connecting to the DSKplus board For example in Windows 95 the DSKplus software does not work if the parallel port is being captured by Windows You must go into the system set up and make sure the port is notcaptured A common error is to have a printer set up to print from DOS based programs This captures the port making it in accessible to DSKplus applications Running the Self Test Program Another source of errors is the PC port configuration It is suggested that you reboot your PC and enter the BIOS setup routine Confirm that the BIOS paral lel port setup does not specify extended capabilities port EC
156. tion The DSKplus assembler translates assembly language source asm files into machine language object obj files Source files can contain the following assembly language elements L Assembler directives L Assembly language instructions This chapter explains how to invoke the assembler and discusses source statement format valid constants and expressions and assembler output Topic Page 5 1 DSKplus Assembler Overview 5 2 DSKplus Assembler Development Flow 5 3 Invoking the DSKplus Assembler 5 4 Naming Alternate Directories for Assembler Input 5 5 Source Statement Format 5 6 Constants 5 7 Character Strings 5 8 Symbols 5 9 Expressions 5 10 Source Listings 5 11 DSKplus Assembler Directives 9 1 DSKplus Assembler Overview 9 1 9 2 DSKplus Assembler Overview The DSKplus assembler is a two pass program that performs the following tasks D Processes the source statements in a text file to produce an absolute object file Produces a source listing if requested and provides you with control over this listing The section program counter SPC is the absolute address of that opcode _j Defines and references symbols L Assembles conditional blocks This assembler allows you to segment your code into sections and maintain an SPC for each section of object code DSKplus Assembler Development Flow 5 2 DSKplus Assembler Development Flow Figure 5 1 illustrates the assembler s role in the so
157. to 5 9 using alabelas 5 13 using prefixes 5 8 operator precedence order 5 16 options assembler 5 4 definition E 6 output listing 5 30 to 5 32 overflow in expression 5 16 Index page eject C 25 length C 20 title C 34 width C 20 page assembler directive 5 30 C 25 PAL equations B 1 PAL device 4 bit read cycle 6 9 device s internal logic diagram 6 7 latch select LS mode 6 10 nibble mode state machine 6 10 strobe generator 6 9 write or 8 bit read cycle 6 10 parentheses in expressions 5 15 PC definition E 6 port definition E 6 power supply adapter cable 2 2 power supply connector 2 2 power to the DSKplus 6 2 precedence groups 5 15 prefixes for operands 5 8 printer cable 2 2 program entry point definition E 3 program memory 1 5 dual access RAM DARAM 1 5 external 1 5 HPI RAM interrupts kernel 1 5 reserved 1 5 ROM 1 5 programming tips DSP 4 5 host 4 7 pstring assembler directive 5 27 C 32 1 5 1 5 pulldown menus definition E 6 q assembler option 5 4 quiet run 5 4 Index 5 Index raw data definition E 6 register data PC host 6 5 PC s control 6 6 PC s status 6 5 register symbols 5 14 relational operators in conditional expres sions 5 17 relocation 5 11 requirements hardware 1 3 software 1 3 running self test program 2 5 sect assembler directive 5 23 section 5 23 section definition E 6 self test program 2 5 set assembler directive 5 31 C 27 Setsect C 29 as
158. use the application loader software 31 Gode Explorer Debugger osos sueritren tees beets EROR REM REA ER dais 3 2 3 2 Using the Application Loader i 3 4 Software Considerations 4 1 Describes the software considerations for writing DSP applications and the differences between DSP and host application code 41 DSP e IIA 4 2 42 DSP Programming HOS asturiano diia dear Gane baka 4 5 Ao mostFe SOMWA a 4 6 4 4 Host Programming Tips axe ted cano Rel beaded ee addon A PREX ee 4 7 DSKplus Assembler Description 00 ccc eee eee eee 5 1 Explains how to invoke the assembler and discusses source statement format valid constants and expressions assembler output and how to use assembler directives 5 1 DSKplus Assembler Overview i 5 2 5 2 DSKplus Assembler Development Flow i 5 3 5 3 Invoking the DSKplus Assembler i 5 4 xi Contents xii 5 4 Naming Alternate Directories for Assembler Input ooooooooomomooo 5 5 5 4 1 i Assembler Option i 5 5 5 4 2 A DIR Environment Variable llle 5 6 5 5 Source Statement Format i 5 7 Dod Lapel Fiod Ceo oor cece ee pee eo eee ra 5 7 0 52 Inetruction Field ses acts rra dane d canoe Fasc dab nint e 5 8 S OPES ee TERES 5 8 554 Comment Field ox act socie quce acta ton del d RES eee dod eco ae und doe d 5 9 SO ornare E AEE S 5 10 5 6 1 Binary WCC Scat crete ete Hase ieee teas ane caesar aes 5 10 5 6 2 Octal Int
159. ve is used to read and assemble source statements from other files then the assembler resumes assembling into the current file The mechanism is similar to the copy directive except that state ments are not printed in the listing file include asm byte2 asm word2 asm Source file First include file Second include file Space 29 xx In byte2 asm xx In word2 asm include byte2 asm byte 32 1 A word OABCDh 56q include word2 asm Back in original file Back in byte2 asm string done byte 67h 3q Listing file 1 0000 Space 29 2 include byte2 asm 3 4 ee Back in original file 5 0007 0064 String done 0008 006F 0009 006E 000a 0065 C 8 Syntax Description Example ie dq 03 09 de Gor te 1 2 13 14 15 16 17 18 19 20 Al 22 PAS 24 Zo 26 21 28 29 30 oL e 33 0000 0000 0000 0000 0000 000d 000d 000e 0001 0001 000f e800 TELE OOff 000d Assemble into data Section data data The data directive tells the assembler to begin assembling source code into the data section data becomes the current section The data section is nor mally used to contain tables of data or preinitialized variables The assembler assumes that text is the default section Therefore at the beginning of an assembly the assembler assembles code into the text section unless you use a section control directive In this example code is assembled into the data and
160. ve the invalid label Binary operator can t be applied Division by zero is illegal Expression must be absolute integer value Offset expression must be integer value Operation cannot be performed on given operands Unary operator can t be applied Well defined expression required These are errors about general expressions An illegal oper and combination was used or an arithmetic type is required but not present Correct the source per the error message text Absolute operands required for FP operations Cannot apply bitwise NOT to floats Floating point divide by zero Floating point overflow Floating point underflow Floating point expression required llegal floating point expression Invalid floating point operation These are errors about floating point expressions A float ing point expression was used where an integer expression is required an integer expression was used where a floating point expression is required or a floating point value is invalid Correct the source per the error message text Assembler Error Messages D 5 Assembler Error Messages E0300 E0301 E0400 E0802 E0900 D 6 E0300 Description Action E0301 Description Action E0400 Description Action E0802 Description Action E0900 Description Action Cannot redefine this section name Symbol can t be defined in terms of itself Symbol expected in label field Symbol sym has already been defined
161. with a sampling rate of 15 4 kHz By programming the internal ACO1 registers sampling rates can be changed quickly and easily See the TLCS20ACO1C Single Supply Analog Interface Circuit Data Manual for more information about programming the ACO1 Initialization Routines 7 3 Serial Port and TLC320AC01 Initialization 7 4 The ACO1INIT routine is located inthe PERIPHS directory of the DSKplus soft ware Normally this routine is included as one of the first operation in the DSP s application source code The PERIPHS directory also includes initialization routines for all of the peripherals of the TMS320C542 Your DSP software does not need to initialize peripherals that it does not use Appendix A DSKplus Circuit Board Dimensions and Schematic Diagram This appendix contains the circuit board dimensions shown in Figure A 1 and the schematic diagram shown in Figure A 2 for the TMS320C54x DSKplus A 1 Note Figure A 1 TMS320C54x DSKplus Circuit Board Dimensions 4 920 OO 0 OOO OO Oo 00 00 00 O01 9 0 1 O 290200000 o P1 oooo0oo0oo0oo000000 Hloo 0c 000000000 Ep A 5 DOOOOOOOOOOO LJ 0D O0 O0 O0 00 0 XE CD Tl us MH LLLI L LT c 5 o R36 kig DSP LT LT c en 1 TMS320C542 mi C22 LI C32 LI Ll C26 D o SA 1 IL Tl R34 LI R35 LI a di EB R54 R53 R46 R45 LI Ld C24 Lt Ly D CT JP1 Ees JP3 O O 0 0D 0 00 0 000 JP2 L1 QOO 0 DO OOO

Download Pdf Manuals

image

Related Search

Related Contents

SERIAL # TC54 INSTALLATION AND OPERATING INSTRUCTIONS  取扱説明書を見る - AQUA(アクア)|ハイアールアジア株式会社  - Diagenode  LEDD85001N-LT1  Installation, Operation, And Service Manual High  binvac accidentes de trabajo investigados  NComputing vSpace Management Center User's Manual  La Crosse Technology WS-7076U User's Manual  PDF  

Copyright © All rights reserved.
Failed to retrieve file