Home

DSP56303EVM Users Manual

image

Contents

1. ADS Command DSP56002 Converter Card Y P DSP56303 DSP56303bEVM AA1927 Figure 2 1 Development Process Flow 2 1 Writing the Program The following sections describe the format of assembly language source statements and give an example assembly program 2 1 4 Source Statement Format Programs written in assembly language consist of a sequence of source statements Each source statement may include up to six fields separated by one or more spaces or tabs a label field an operation field an operand field up to two data transfer fields and a comment field For example the following source statement shows all six possible fields Example 2 1 Example Source Statement trm mac x0 y0 a x r0 x0 y r4 y0 Text Label Operation Operand X Data Transfer Y Data Transfer Comment DSP56303EVM User s Manual For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Writing the Program 2 1 1 1 Label Field The label field is the first field of a source statement and can take one of the following forms e A space or tab as the first character on a line ordinarily indicates that the label file is empty and that the line has no label e An alphabetic character as the first character indicates that the line contains a symbol called a label s An underscore as the first character indicates that the label is loc
2. J4 J5 12 Figure 1 1 DSP56303EVM Component Layout AA1925 1 2 2 Connecting the DSP56303EVM to the PC and Power Figure 1 2 shows the interconnection diagram for connecting the PC and the external power supply to the DSP56303EVM board DSP56303EVM User s Manual For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Installation Procedure Cable PC Compatible Computer Lr Ge Connect cable O P3 to RS 232 port External 9 V Power DSP56303EVM AA1926 Figure 1 2 Connecting the DSP56303EVM Cables Use the following steps to complete cable connections 1 Connect the DB9P end of the RS 232 interface cable to the RS 232 port connection on the PC 2 Connect the DB9S end of the cable to P2 shown in Figure 1 1 on the DSP56303EVM board This provides the connection to allow the PC to control the board function 3 Make sure the external 7 9 V power supply is not supplied with power 4 Connect the 2 1 mm output power plug into P3 shown in Figure 1 1 on the DSP56303EVM board 5 Apply power to the power supply The green power LED lights up when power is correctly applied Quick Start Guide 1 5 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Installation Procedure DSP56303EVM User s Manual For More Informatio
3. Pin Number DSP Signal Name Pin Number DSP Signal Name 1 SCK1 2 3 SC10 4 5 STD1 6 7 SRD1 8 9 SC12 10 11 SC11 12 3 6 4 Host Port HI08 Connection to the DSP s HIO8 port can be made at J3 Refer to Table 3 12 for the header s pinout DSP56303EVM User s Manual For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Table 3 12 HI08 Header J3 Pinout Pin Number DSP Signal Name Pin Number DSP Signal Name 1 HO 2 H1 3 H2 4 H3 5 H4 6 GND 7 H5 8 H6 9 H7 10 RESET 11 HAO 12 HA1 13 HA2 14 HCS 15 HREQ 16 HDS 17 3 3 V 18 HACK 19 HRW 20 GND Control 3 6 5 Expansion Bus Pin Number DSP Signal Name Pin Number DSP Signal Name 1 3 3 V 2 RD 3 WR 4 BG 5 BB 6 BR 7 TA 8 BCLK 9 BCLK 10 CAS 11 CLKOUT 12 AA1 13 AAO 14 AA2 15 AA3 16 GND 3 7 Mode Selector Boot Up mode selection for the DSP56303 is made by jumper selections on header J1 Refer to Table 3 14 for header J1 jumper options Mode Selector Connection to the DSP s expansion BUS control signals can be made at J2 Refer to Table 3 13 for header s pinout Table 3 13 Expansion Bus Control Signal Header J2 Pinout DSP56303EVM Technical Summary For More Information On This Product Go to www freescale com 3 15 Mode Selector Freescale Semicond
4. D 12 D 9 1 Initialize Se H ee 4e ro beehive EE ae debis D 12 D 9 2 Congre CIPICEPIDS o id abus een d ORCI SON A ASA D 15 D 9 3 Initialization of the CODEC porte D 19 D 9 4 Enabling Interrupts ESSI ports css idad D 23 D 10 Phase III Data Transferring Mechaniam nan D 24 D 10 1 Interrupts and Interrupt Service Routines 0 000005 D 24 D 10 2 ESSI Receive Data with Exception Status Interrupt D 24 D 10 3 ESSI Receive Data Interrupt ove Mad oco en OR ERROR D 25 D 10 4 ESSI Receive Last Slot Interrupt 0 0 0 0 cee eee eee D 26 D 10 5 ESSI Transmit Data with Exception Status Interrupt D 27 D 10 6 ESSI Transmit Last Slot Interrupt 4 034 e yr tes eve D 28 D 10 7 ESSI Transmit Data Interrupt 0 Ux Ra RARE EROR ER D 29 DIT Example Applicaton EE CE SPESE D 30 DILI Echo DOS EE D 31 DIL2 Behe Code e vvAIpvbe tace taa bd deron fae d dcdit oe ace qusc D 31 DSP56303EVM User s Manual For More Information On This Product Go to www freescale com Freescale Semiconductor Inc List of Tables 2 1 Assembler ODIOS ek etico RT a ce ate pees i elo a ere 2 6 2 2 Linker Options 5 Gu utes Egbert Cena es Les 2 13 3 1 CS4218 Sampling Frequency Selection 000008 3 7 3 2 JP5 Jumper Block Options cc ACER A EC CR A 3 9 3 3 JP4 Jumper Block Options Imper ted Oi IR URS 3 9 3 4 On Board JTAG Enable Disable Option 3 11 3 5 Debug RS 232 Connector P
5. V Causes the linker to report linking progress beginning of passes opening and closing of input files to the standard error output stream This is useful to ensure that link editing is proceeding normally Example dspink V myprog cin Links the file myprog cln and sends progress lines to the standard error output Example Test Program 2 15 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Linker Options Table 2 2 Linker Options Continued Option Description X lt opt gt lt opt gt lt Provides for link time options that alter the standard operation of the linker The options opt are described below All options can be preceded by NO to reverse their meaning The X lt opt gt sequence can be repeated for as many options as desired Option Meaning ABC Perform address bounds checking AEC Check form of address expressions ASC Enable absolute section bounds checking CSL Cumulate section length data ESO Do not allocate memory below ordered sections OVLP Warn on section overlap RO Allow region overlap RSC Enable relative section bounds checking SVO Preserve object file on errors WEX Add warning count to exit status means default Example dsplnk XWEX filter cin fft cin fio cln Allows the linker to add the warning count to the exit status so that a project build aborts on warnings as well as errors Z Allows
6. 0 0 0 cece eee ee eee ee 2 10 2 2 3 6 Object File Conttol 4 2a an ee Ma No WAR eee ty tack RS 2 11 2 2 9 7 Macros and Conditional Assembly 000 cee eee eee 2 11 2 2 3 8 Structured Programming ORE di SUP e 2 11 2 2 4 Assembling the Example Program 0 00 e ee eee eee eee 2 12 2 3 Motorola DSP Linker A es ese rper CC a hate RENE dE eek 2 12 2 25 Linker ODUOBS aw oh OR a ol be tl ee ted et f Med rt Res ed Ms 2 13 2 4 1 Linker Directives soi pare aE STR d ac RI esca hc de Ta RN wane td acie pairs 2 16 Table of Contents vii For More Information On This Product Go to www freescale com Freescale Semiconductor Inc 2 5 Introduction to the Debugger Software 2 17 2 6 Running the Program dk occa Cp e ce E OU ad e ERE 2 19 Chapter 3 DSP56303EVM Technical Summary 3 1 DSP56303EVM Description and Features eee 3 1 3 JSP30305 DESTAPE EX EAD duds 3 1 De VMIGEIOE ciis pra ee Ge oec oe ero sce ce aeu dee rd G 3 2 3 3 1 FS a 4 215 ie falces era pate atthe lel WRN ce aret Ade pA us 3 3 3 3 1 1 ESENCIAS VO AE SES 3 3 3 3 1 2 Example Programming AARO 0 0 0 0 cee eee eee eee 3 4 3 3 2 Plas ite Uoc etai cC ates DIE na n ER Sao Va ae 3 6 3 3 2 1 Flash Connections R C Za EK ERAN CES AI EATUR E ES 3 6 3 3 2 2 Programming for Stand Alone Operation 3 6 3Ub AO COGS ath po els e eb e rM Sh sto au asd 3 7 3 4 1 Codec Analog Input Output E dere e ER teas 3 8 3 4 2 Codec Digital Interface ssa sacs e a eit bee
7. C 8 C 17 Example of Immediate Addressing Mode C 9 C 18 Example of Immediate Short Addressing Mode Force Operator C 9 C 19 Example of an Immediate Long Addressing Mode Operator C 10 C 20 Example BADDR Directive sca Grea x deem EXC C 10 C 21 Butter Kee gt inh ada COE ide SR os eb be doces C 11 C 22 Block Storage of Constant Directive 0 0 0 2 ee ee eee C 12 C 23 Block Storage Modulo Directive C 12 C 24 Butter Direc NE wire ats ees ew tain ai woe pn c em cu el DU AC e tet C 13 C 25 COBM Directive tii pO INTO ok OSG EC eC eu wp ate Red C 13 C 26 COMMENT Directive Eege o DO e aN C 14 C 27 Single Character String Definition annene C 15 List of Examples xvii For More Information On This Product Go to www freescale com C 28 C 29 C 30 C 31 C 32 C 33 C 34 C 35 C 36 C 37 C 38 C 39 C 40 C 41 C 42 C 43 C 44 C 45 C 46 C 47 C 48 C 49 C 50 C 51 C 52 C 53 C 54 C 55 C 56 C 57 C 58 C 59 Freescale Semiconductor Inc Multiple Character String Definition anena DC DINE CU VG asso ete LES ely VL a d Ue mp arat tots pis DEB Directive sea Cen a ee kb eet Las O ee ee ke DEFINE BI cose eto aO ERAT Ee e eas DS Directivos estet ea Mae sa da e en da tec DSM Directive censa taen aa E EE Se AS RH e EE DUP ER ti EEN DURA Directive EE er unie Tee POW ERT eat aeri au Caio cob LESS te Ltd DUPEODIEFGCUVG EE OPENS UNUS n PORE END Directive coste PED S een edo LS eh CHO Rd ENDHBUE D
8. DSP56303EVM User s Manual For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Assembler Directives Example C 52 IF Directive IF LST gt 0 DUP LST Unwind LIST directive stack NOLIST ENDM ENDIF C 3 32 INCLUDE Include Secondary File INCLUDE lt string gt lt lt string gt gt This directive is inserted into the source program at any point where a secondary file is to be included in the source input stream The string specifies the filename of the secondary file The filename must be compatible with the operating system and can include a directory specification If no extension is given for the filename a default extension of ASM is supplied The file is searched for first in the current directory unless the lt lt string gt gt syntax is used or in the directory specified in string If the file is not found and the I option was used on the command line that invoked the assembler then the string specified with the I option is prefixed to lt string gt and that directory is searched If the lt lt string gt gt syntax is given the file is searched for only in the directories specified with the I option Note A label is not allowed with this directive See also MACLIB Example C 53 INCLUDE Directive INCLUDE headers io asm Unix example INCLUDE storage mem asm MS DOS example INCLUDE lt data asm gt Do not look in current directory C 3 33
9. DSP56303EVM User s Manual For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Chapter 1 Quick Start Guide This section summarizes the evaluation module contents and additional requirements and also provides quick installation and test information The remaining sections of this manual give details on the DSP56303EVM design and operation 1 1 Equipment The following subsections list the equipment required to use the DSP56303 evaluation module DSP56303EVM some of which is supplied with the module and some of which must be supplied by the user 1 1 1 What You Get with the DSP56303EVM The following material comes with the DSP56303EVM e DSP56303 Evaluation Module board e DSP56303EVM Product Brief e DSP56303EVM User s Manual this document e DSP56303 Product Specifications Revision 1 03 e DSP56303 Chip Errata e Crystal Semiconductor CS4218 16 bit Multimedia Audio Codec Data Sheet Technical Documentation CD ROM including the following documents DSP56300 Family Manual DSP56303 User s Manual DSP56303 Technical Data Sheet Therequired software GUI Debugger from Domain Technologies 1 CD Assembler linker software from Motorola 1 CD Quick Start Guide 1 1 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Installation Procedure 1 1 2 What You Need to Supply The user must provide the following 1
10. DSP56303EVM User s Manual For More Information On This Product Go to www freescale com SCL SCO SO SVO UR WEX XLL XR Freescale Semiconductor Inc Assembler Directives default reset Structured control statements generate non local labels that ordinarily are not visible to the programmer This can create problems when local labels are interspersed among structured control statements This option causes the assembler to maintain the current local label scope when a structured control statement label is encountered Send structured control statement labels to object and listing files Normally the assembler does not externalize these labels This option must appear before any symbol definition Write symbol information to object file This option is recognized but performs no operation in COFF assemblers Preserve object file on errors Normally any object file produced by the assembler is deleted if errors occur during assembly This option must be given before any code or data is generated Print the unassembled lines skipped due to failure to satisfy the condition of a conditional assembly directive Generate a warning at assembly time for each unresolved external reference This option works only in relocatable mode default reset Print all warning messages Add warning count to exit status Ordinarily the assembler exits with a count of errors This option causes the count of warnings to be added
11. asm56300 options lt filenames gt where asm56300 is the name of the Motorola DSP assembler program and lt filenames gt is a list of the assembly language programs to be assembled Example Test Program 2 5 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Assembling the Program 2 2 2 Assembler Options Table 2 1 describes the assembler options To avoid ambiguity the option arguments should immediately follow the option letter with no blanks between them Table 2 1 Assembler Options Option Description Puts the assembler into absolute mode and generates an absolute object file when the B command line option is given By default the assembler produces a relocatable object file that is subsequently processed by the Motorola DSP linker B lt objfil gt Specifies that an object file is to be created for assembler output lt objfil gt can be any legal operating system filename including an optional pathname The type of object file depends on the assembler operation mode If the A option is supplied on the command line the assembler operates in absolute mode and generates an absolute object cld file If there is no A option the assembler operates in relative mode and creates a relocatable object cln file If the B option is not specified the assembler does not generate an object file If no lt objfil gt is specified the assembler uses the basenam
12. x M_TX00 SSI transfer data register Update transmit buffer pointer move r0 x TX PTR Update tx buffer pointer Restore Context move x r7 mO Restore m0 move x r7 r0 Restore r0 rti D 10 6 ESSI Transmit Last Slot Interrupt The interrupt occurs when the following properties are true e The transmit last slot interrupt is turned on CRB 20 e The last time slot begins The use of the transmit last slot interrupt guarantees that the previous frame has been serviced and the next frame is ready to be serviced The interrupt allows the programmer to redefine pointers to the buffer to be reset so that a new frame can be serviced To perform the procedure of preparing for the next frame the following steps can be used 1 Save Context 2 Reset Transmit buffer 3 Restore Context Example D 17 depicts the servicing of this interrupt DSP56303EVM User s Manual For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Phase III Data Transferring Mechanism Example D 17 ESSI Transmit Last Slot Interrupt Service transmit last slot interrupt service routine ssi txls isr move move move move rti Save Context rO x r7 Save YU to the stack Reset Transmit buffer pointer Reset pointer Reset tx buffer pointer just in case it was corrupted 4TX BUFF BASE rO r0 x TX PTR Se So an 9e Restore Context x r7 r0 Restore r0 D 10 7 ESSI Transmit D
13. 11111 2 max gain 22 5 dB Right input D A Gain 1 5 dB 11 8 00000 no gain steps 11111 2 max gain 22 5 dB Not Applicable 7 0 0000000 DSP56303EVM User s Manual For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Phase 1 Setting up Constants Referring to Table D 8 a programmer can configure the control information for the codec Suppose for instance that the following requirements are needed for this application 1 2 3 4 5 No mask for the interrupt pin No left or right D A attenuation Muting turned off LIN2 and RIN2 Selected On the EVM boards input 2 is used for both left and right channels No left and right D A gains Example D 2 illustrates the procedure of setting the codec control information using the previous specified control parameters Example D 2 Setting Codec Control Information NO MASK INT equ NO LEFT ATTN equ NO RIGHT ATTN equ LIN2 equ RINZ equ NO LEFT GAIN equ NO RIGHT GAIN equ NO MUTING equ CTRL WD 12 equ CTRL WD 34 equ Note Note 000000 000000 000000 000200 000100 000000 000000 000000 NO MUTING NO LEFT GAIN NO RIGHT GAIN U 4 Se So Seo ae 0 dB 0 dB use LIN2 on EVM use RIN2 on EVM 0 dB 0 dB NO MASK INT NO_ LEFT ATTN NO RIGHT ATIN LIN2 RIN2 The CS4218 codec data sheet reverses the bit order of the control information For instance bit 1 should be the mask interr
14. Audio Codec DSP56303 CS4218 SRDO Le SCKO Let SDIN SDOUT SCLK SCO0 __ RESET SC02 La SSYNC MF4 CCS MF3 CCLK MF2 CDIN AA1934 Figure 3 8 Codec Digital Interface Connections gt Table 3 2 JP5 Jumper Block Options JP5 DSP Signal Name Code Signal Name 1 2 SCKO SCLK 3 4 SCO0 RESET 5 6 STDO SDIN 7 8 SRDO SDOUT 9 10 scot 11 12 SC02 SSYNC Table 3 3 JP4 Jumper Block Options JP4 DSP Signal Name Code Signal Name 1 2 SCK1 3 4 SC10 CCS 5 6 STD1 7 8 SRD1 9 10 SC12 CDIN 11 12 SC11 CCLK The serial interface of the codec transfers digital audio data and control data into and out of the device The codec communicates with the DSP56303 through the ESSIO for the data information and through the ESSII for the control information The codec has three modes DSP56303EVM Technical Summary For More Information On This Product Go to www freescale com 3 9 Freescale Semiconductor Inc Command Converter of serial operation that are selected by the serial mode select SMODE1 SMODE2 and SMODE3 pins The SMODE pins on the DSP56303EVM are set to enable serial mode 4 which separates the audio data from the control data The SMODE pins are also set to enable the master sub mode with 32 bit frames the first 16 bits being the left channel and the second 16 bits being th
15. Contains interrupt equates for the DSP EVM modules Ada equ asm Contains equates used to initialize the CODEC Ada Init asm Contains initialization code for the ESSI and CODEC Vectors asm Contains the vector table for the DSP EVM modules Echo asm Sample code that illustrates DSP processing All the procedures that were discussed in Section D 6 Digital Interface ESSI Codec and Section D 7 Programming the CS4218 Codec have been included in these files Therefore it will take little effort on the part of the programmer to quickly generate an application using the CS4218 codec If a desired property in the control information is needed simple modifications can be made to these files DSP56303EVM User s Manual For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Example Application D 11 1 Echo Program This example shows a simulation of an echo of an input signal using a number of time delayed sample To implement a time delayed echo on the DSP a sample is fed into the DSP from the codec The new sample is then divided by two to maintain stability and is then added to a time delayed sample The sum of the signals is again divided by two and then sent out to the codec Figure D 3 displays the block diagram describing this process ew Sample Output Figure D 3 Block Diagram of a Delayed Sample echo D 11 2 Echo Code To begin the echo program the following files are
16. Expand DEFINE symbols within quoted strings Ignore case in symbol names Support symbol scoping in nested sections Scope structured control statement labels Structured control statement labels to listing object file Write symbols to object file Write local labels to object file Recognize XDEFed symbols without XREF C 3 42 5 Assembler Operation The following are miscellaneous options having to do with internal assembler operation CC CK CM CONST CONTCK DLD GL GS INTR LB LDB MI PS PSM RP RSV SI SVO Enable cycle counts Enable checksumming Preserve comment lines within macros Make EQU symbols assembly time constants Continue checksumming Do not restrict directives in loops Make all section symbols global Make all sections global static Perform interrupt location checks Byte increment load counter Listing file debug Scan MACLIB directories for include files Pack strings Programmable short addressing mode Generate NOP to accommodate pipeline delay Check reserve data memory locations Interpret short immediate as long or sign extended Preserve object file on errors DSP56303EVM User s Manual For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Assembler Directives Following are descriptions of the individual options The parenthetical inserts specify default if the option is the default condition and reset if the option is reset to its default s
17. SAMPLSIZ then the source line below DS ARRAYSIZ would be transformed by the assembler to the following DS 10 SAMPLSIZ DSP56303EVM User s Manual For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Assembler Directives C 3 11 DS Define Storage lt label gt DS lt expression gt The DS directive reserves a block of memory the length of which in words is equal to the value of lt expression gt This directive causes the runtime location counter to be advanced by the value of the absolute integer expression in the operand field lt expression gt can have any memory space attribute The block of memory reserved is not initialized to any value The expression must be an integer greater than zero and cannot contain any forward references symbols that have not yet been defined lt label gt if present is assigned the value of the runtime location counter at the start of the directive processing Note See also DSM DSR Example C 32 DS Directive S BUF DS 12 SAMPLE BUFFER C 3 12 DSM Define Modulo Storage lt label gt DSM lt expression gt The DSM directive reserves a block of memory the length of which in words is equal to the value of lt expression gt If the runtime location counter is not zero this directive first advances the runtime location counter to a base address that is a multiple of 2 where 2 gt lt expression gt An error is issued if there is i
18. but the second control information will be recognized Two global variables will be defined to simplify programming e CTRL WD HI The high word in the control information s CTRL WD LO The low word in the control information To send the control information from the ESSI to the codec perform the following steps 1 Set up registers to send dummy control information 2 Send control words 3 Set up registers to send correct control information 4 Send control words Example D 10 illustrates the procedures DSP56303EVM User s Manual For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Phase II Initializing and Interfacing the ESSI and CODEC Ports Example D 10 Sending Code Information CTRL WD HI ds 1 Upper Control word CTRL WD LO ds 1 Lower Control word dummy control move 0 x0 move x0 x CTRL WD HI send dummy control data move x0 x CTRL_WD_ LO jsr codec control set control move CTRL WD 12 x0 recall constant set previously for upper control info set hi control word to constant recall constant set previously for upper control info 16 bit data aligned to bit 23 move XO x CTRL WD HI move CTRL WD 34 x0 Seo So So ax So ae move x0 x CTRL WD LO jsr codec control The control words are sent serially to the CDIN pin of the codec The codec control subroutine in the previous code performs this action The following is one method of sending in the contr
19. nwe E ES OF 9Igeu3 ZEZSY 9 19S dsQ E x 9 9b lt ax n rk ATS G z o axa 9 E T ze E E00 ax i 3 anvo E i ad ps nego ll T i OSOON Seo 9a NEE MOT DSP56303EVM User s Manual A 4 For More Information On This Product Go to www freescale com 19119AU0 pueuluo p y e4nBiJ4 pp E B E deus SiooldsQ Jeu eq 866 Ol JequiemoN Versen ea y x Jequun mei NSA 0 989dSGd Pret azis J U AUOJ PUBUILIOD any vLESO QW 09Z4 L68 ZLS XY4 LS9 168 Z19 9960 9619 XL unsnv ann SAL uouueo WEIMA 1059 VIOHOLOM UOISIAIq 19QHISNS SSAIM Freescale Semiconductor Inc Yad WAT 3 18vN3 W3183ANOO QNVINIWOO t ES CY VO8 NO JojejosQ ZHIN8099 6 anro L oo yol S Y QN9 ONS S x TRT GET 99 DA 9 AS c IJA IA ZH 9 ESL c E EES ER onge ST 99 DONG P Ise UNE et 83g Nr vag S no ONS F 68 ov A ameug 7 sa 34 TD Eat 9 T sekca An ZHINGZ ZK 598 9v AS tA n xH se sv x E L MOL ora Ww IER leo ev 101 y ca CN LSHL G ig Ww oal SNL r4 09 S ov coo AXL kl 8 4 200 aXe OV8EEsO sn adoze S Lan 90 aano L
20. 1 DSP56303EVM User s Manual For More Information On This Product Go to www freescale com Freescale Semiconductor Inc ESSI Ports Background A Frame 32 bits gt SSYNC R R SDOUT Left Channel Word Right Channel Word SDIN Left Channel Word Right Channel Word 4 16 bits gt lt _ gt Figure D 1 Data Format of Codec In the SM4 mode the control information is separated from the data information The control information is thus sent to codec on a different serial interface than the data information The control information consists of a list of attributes that need to be specified in order to dictate certain properties such as level settings Although 31 bits must be set in the control information only 23 bits are useful The other 8 bits are set to zero For more information on the CS4218 codec please refer to the Crystal CS4218 codec Datasheet D 3 ESSI Ports Background The Motorola DSP5630x evaluation modules referred to in this appendix have two ESSI ports ESSIO and ESSI1 which form one of the major serial interfaces to external peripherals Each port consists of six unique pins that allow performance of a multitude of functions depending on how certain pins are configured Each port can function as either an ESSI or a General Purpose Input Output port GPIO While the ESSI mode has some constraints by using the ESSI port in the ESSI mode the programmer can synchronize his tasks w
21. 1 Initialize ESSI Ports The first step in initializing the ESSI Port is to reset the ESSI ports By sending a value of zero into the port control register C and port control register D on the ESSIs ESSIO and ESSII undergo a reset Although ESSI1 will be used as a GPIO it is recommended that the programmer also perform the reset on ESSI1 Example D 3 illustrates the reset procedure of the ESSI ports Example D 3 ESSI Port Reset Procedure movep 4 0000 x M PCRC reset ESSIO C control register port movep 4 0000 x M PCRD reset ESSI1 D control register port The next step in initializing the ESSI port is to set the control parameters for the ESSI port Adjusting the bits on the ESSI Control Register A CRAO and ESSI Control Register B CRBO allow for initializing and modifying control parameters Each bit on the registers has a specific meaning Describing the meaning of each bit on the registers is beyond the scope of this appendix The information on specific definitions of each bit can be found in the respective DSP5630x chip manuals However there are certain typical settings that need to be made in order for the codec to work properly with the ESSI ports Table D 9 displays the settings that need to be made with Control Register A DSP56303EVM User s Manual For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Phase II Initializing and Interfacing the ESSI and CODEC Ports Table D 9 Settings
22. 2 PC Pentium 90MHz or higher with Windows95 or NT4 Minimum of 16Mbytes of memory with Windows95 Minimum of 32Mbytes of memory with Windows NT 3 inch high density diskette drive CD ROM drive Hard drive with 20 Mbytes of free disk space Mouse RS 232 serial port supporting 9 600 115 200 bit per second transfer rates RS 232 interface cable DB9 plug to DB9 female Power supply 7 9 V AC or DC input into a 2 1 mm power connector Audio source tape player radio CD player etc Audio interface cable with 1 8 inch stereo plugs Headphones Installation Procedure Installation requires the following four basic steps 1 Preparing the DSP56303EVM board 2 Connecting the board to the PC and power 3 4 Testing the installation Installing the software DSP56303EVM User s Manual For More Information On This Product Go to www freescale com Freescale Semiconductor Inc 1 2 1 Preparing the DSP56303EVM Installation Procedure Warning Because all electronic components are sensitive to the effects of electrostatic discharge ESD damage correct procedures should be used when handling all components in this kit and inside the supporting personal computer Use the following procedures to minimize the likelihood of damage due to ESD Always handle all static sensitive components only in a protected area preferably a lab with conductive antistatic flooring and ben
23. Appendix D Codec Programming Tutorial D 1 Introduction The DSP56300 family is capable of many different types of activities Through mathematical algorithms implemented on the DSP various of tasks and different kinds of digital signal processing can be accomplished However in order to obtain useful information it is often necessary to interact with external events in the outside world To satisfy this requirement Motorola engineers integrated the CS4218 16 bit Audio codec CMOS device with the current DSP5630x evaluation modules Their design opened the DSP to numerous applications as the CS4218 codec has many critical components needing to interface with the outside world The codec will perform analog to digital A D and digital to analog D A conversion filtering and level setting A sample program is included with this document to demonstrate the use of the CS4218 codec with a Motorola DSP The program explains the steps necessary to interface the Motorola DSP with the CS4218 codec More specifically the sample program explains in detail the use of the enhanced synchronous serial interface ports ESSI and how the DSP s ESSI ports interface initialize and transport data between the DSP and CS4218 codec The following source code files are provided to the programmer to assist in programming the codec The following source code files can be found on Motorola s DSP website on the Internet at www mot com SPS DSP documentation DS
24. ELSE the ELSE directive is optional ENDIF Part of a program that is to be conditionally assembled must be bounded by an IF ENDIF directive pair If the optional ELSE directive are not present then the source statements following the IF directive and up to the next ENDIF directive is included as part of the source file being assembled only if the lt expression gt has a nonzero result If the lt expression gt has a value of zero the source file is assembled as if those statements between the IF and the ENDIF directives were never encountered If the ELSE directive is present and lt expression gt has a nonzero result then the statements between the IF and ELSE directives are assembled and the statements between the ELSE and ENDIF directives are skipped Alternatively if lt expression gt has a value of zero then the statements between the IF and ELSE directives are skipped and the statements between the ELSE and ENDIF directives are assembled The lt expression gt must have an absolute integer result and is considered true if it has a nonzero result The lt expression gt is false only if it has a result of zero Because of the nature of the directive lt expression gt must be known on pass one no forward references allowed IF directives can be nested to any level The ELSE directive will always refer to the nearest previous IF directive as will the ENDIF directive Note A label is not allowed with this directive See also ENDIF
25. FFFFFF PE Internal Memory FFO0000 050000 Unified FSRAM 040000 006000 004000 000000 AA1930 Figure 3 4 Example Memory Map with the Unified External Memory Figure 3 5 shows the settings of AARO for this example The external access type bits BATI and BATO are set to O and 1 respectively to denote FSRAM access The address attribute polarity bit BA AP is cleared to define AAO as active low Address multiplexing is not needed with the FSRAM therefore the address multiplexing bit BAM is cleared Packing is not needed with the FSRAM thus the packing enable bit BPAC is cleared to disable this option 23 12 BAC11 BAC10 BAC9 BAC8 BAC7 BAC6 BAC5 BAC4 BAC3 BAC2 BAC1 BACO 0 0 0 0 0 1 0 0 0 0 0 0 Address to Compare 11 0 BNC3 BNC2 BNC1 BNCO BPAC BAM BYEN BXEN BPEN BAAP BAT1 BATO E EN External Access Type AA Pin Polarity Program Space Enable X Data Space Enable Y Data Space Enable Address Multiplexing Packing Enable Number of Address Bits to Compare AA1931 Figure 3 5 Address Attribute Register AARO DSP56303EVM Technical Summary 3 5 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Memory The P X data and Y data space Enable bits BPEN BXEN and BYEN define whether the FSRAM is activated during external P X data or Y data space accesses respectively For this example the BXEN and BYEN bits are set and BPEN is clea
26. For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Serial Control Pin 2 SC02 3 10 Y Serial Control Pin 2 SC12 3 10 serial interface 3 10 Y data transfer field 2 3 Serial Port Clock Pin SCLK 3 10 Y Space Enable Bit BYEN 3 6 Serial Port Data In Pin SDIN 3 10 Serial Port Data Out Pin SDOUT 3 10 Serial Receive Data Pin SRDO 3 10 Serial Transmit Data Pin STDO 3 10 Source file end C 22 source statement format 2 2 SRAM 3 2 3 3 connections 3 3 SRAM Address Pins A 0 14 3 4 SRAM Chip Enable Pin E 3 4 SRAM Data Pins I0 0 23 3 4 SRAM memory map 3 4 SRAM Output Enable Pin OE 3 4 SRAM Write Enable Pin WE 3 4 stand alone operation 3 6 Stereo Headphones 3 8 Stereo Input 3 8 Stereo Output 3 8 String concatenation C 6 C 7 delimiter C 5 packed C 40 Symbol case C 38 cross reference C 37 equate C 24 C 37 global C 38 listing C 40 set C 26 C 51 undefined C 41 T Tutorial codec programming D 1 U Unified Memory Map 3 4 W Warning C 41 Write Enable Pin WR 3 4 3 6 X X data transfer field 2 3 X Space Enable Bit BXEN 3 6 DSP56303EVM User s Manual For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Quick Start Guide Example Test Program DSP56303EVM Technical Summary DSP56303EVM Schematics DSP56303EVM Parts List Motorola Assembler Notes Codec Programming Tutorial Index For More Informati
27. Inhibit folded comments default reset Use multiple line feeds for page ejects in the listing file default reset Do not format assembler messages default reset in relative mode Do not make all sections global static Do not generate listing header This also turns off titles and subtitles NOINTR default reset in relative mode Do not perform interrupt location checks Do not print macro calls Do not print macro definitions NOMEX default reset Do not print macro expansions default reset Do not scan MACLIB directory paths for include files NOMSW Do not issue warning on memory space incompatibilities default reset Do not display nesting levels on listing Motorola Assembler Notes C 39 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Assembler Directives NONS NOPP NOPS NORC NORP NOSCL RC RP Do not allow scoping of symbols within nested sections Do not pretty print listing file Source lines are sent to the listing file as they are encountered in the source with the exception that tabs are expanded to spaces and continuation lines are concatenated into a single physical line for printing Do not pack strings in DC directive Individual bytes in strings are stored one byte per word default reset Do not space comments relatively default reset Do not generate instructions to accommodate pipeline delay Do not mainta
28. XREF Example C 48 GLOBAL Directive SECTION IO GLOBAL LOOPA LOOPA will be globally accessible by other sections ENDSEC C 3 28 GSET Set Global Symbol to a Value lt label gt GSET lt expression gt GSET lt label gt lt expression gt The GSET directive is used to assign the value of the expression in the operand field to the label The GSET directive functions somewhat like the EQU directive However labels defined via the GSET directive can have their values redefined in another part of the program but only through the use of another GSET or SET directive The GSET DSP56303EVM User s Manual For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Assembler Directives directive is useful for resetting a global SET symbol within a section where the SET symbol would otherwise be considered local The expression in the operand field of a GSET must be absolute and cannot include a symbol that is not yet defined No forward references are allowed Note See also EQU SET Example C 49 GSET Directive COUNT GSET 0 INITIALIZE COUNT C 3 29 HIMEM Set High Memory Bounds HIMEM mem rl expression The HIMEM directive establishes an absolute high memory bound for code and data generation mem corresponds to one of the DSP memory spaces X Y L P E rl is one of the letters R for runtime counter or L for load counter The expression is an ab
29. Y DATAST If this is not desirable then the long absolute addressing mode can be forced as shown below DATAST EQU Y 523 MOVE DO L Y 2DATAST DSP56303EVM User s Manual For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Assembler Significant Characters C 2 15 Immediate Addressing Mode The pound sign is used to indicate to the assembler to use the immediate addressing mode Example C 17 Example of Immediate Addressing Mode CNST EQU 5 MOVE CNST DO L C 2 16 lt Immediate Short Addressing Mode Force Operator Many DSP instructions allow a short immediate form of addressing If the immediate data is known to the assembler on pass one not a forward or external reference or the FORCE SHORT directive is active then the assembler will always pick the shortest form of immediate addressing consistent with the instruction If the immediate data is a forward or external reference then the assembler picks the long form of immediate addressing by default If this is not desired then the short form of addressing can be forced using the immediate short addressing mode force operator lt Example C 18 Example of Immediate Short Addressing Mode Force Operator In the following sequence of source lines the symbol CNST is not known to the assembler on pass one and therefore the assembler would use the long immediate addressing form for the MOVE instruction MOVE CNST DO L
30. and the condition codes reflect the result of the last simple expression evaluated C 4 3 5 Statement Formatting The format of structured control statements differs somewhat from normal assembler usage Whereas a standard assembler line is split into fields separated by blanks or tabs with no white space inside the fields structured control statement formats vary depending on the statement being analyzed In general all structured control directives are placed in the opcode field with an optional label in the label field and white space separates all distinct fields in the statement Any structured control statement may be followed by a comment on the same logical line C 4 3 6 Expression Formatting Given an expression of the form lt opl gt LT op2 OR op3 GE lt op4 gt there must be white space blank tab between all operands and their associated operators including boolean operators in compound expressions Moreover there must be white space between the structured control directive and the expression and between the expression and any optional directive modifier THEN DO An assembler expression Motorola Assembler Notes C 61 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Structured Control Statements used as an operand in a structured control statement expression must not have white space in it since it is parsed by the standard assembler evaluation routin
31. bit 1 CCLK and bit 2 CDIN must all be set to 0 to allow those pins to operate in the GPIO mode on the port control register D Since we are not using the other pins in Port control Register D the other pins can be set to anything that is to don t care values 0 or 1 At this point the ESSI functionality should be disabled prior to initializing the codec Therefore the pins on ESSIO will not be configured to function in the ESSI mode until the codec has been initialized However the GPIO pins is configured as seen in Example D 6 Example D 6 GPIO Pin Configuration Port Control Register C movep 4 0000 x M PCRC Setting pin 0 for GPIO other pins ESSI Port Control Register D movep 4 0000 x M PCRD Setting pin 0 pin 1 and pin 2 to GPIO mode Since ESSIO pin 0 and ESSII will be used in the GPIO mode the direction of data flow must be declared In other words the direction of flow determines which device is transmitting and which device is receiving Recall that in order to set the direction of data Codec Programming Tutorial D 17 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Phase II Initializing and Interfacing the ESSI and CODEC Ports flow Port Direction Registers C and D must be set register C refers to ESSIO and register D refers to ESSII Setting the pin bit on the Port Direction Register to 1 configures the pin bit as an output and setting the pin b
32. but only through the use of another SET directive The SET directive is useful in establishing temporary or reusable counters within macros The expression in the operand field of a SET must be absolute and cannot include a symbol that is not yet defined No forward references are allowed Note See also EQU GSET Example C 73 SET Directive COUNT SET 0 INITIALIZE COUNT C 3 53 STITLE Initialize Program Sub Title STITLE lt string gt The STITLE directive initializes the program subtitle to the string in the operand field The subtitle is printed on the top of all succeeding pages until another STITLE directive is encountered The subtitle is initially blank The STITLE directive will not be printed in the source listing An STITLE directive with no string argument causes the current subtitle to be blank Note A label is not allowed with this directive See also TITLE Example C 74 STITLE Directive STITLE COLLECT SAMPLES C 3 54 SYMOBJ Write Symbol Information to Object File SYMOBJ lt symbol gt lt symbol gt lt symbol gt The SYMOBJ directive causes information for each symbol to be written to the object file This directive is recognized but currently performs no operation in COFF assemblers Note A label is not allowed with this directive Motorola Assembler Notes C 51 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Assembler Directives Example C
33. character strings are stored in a word whose lower seven bits represent the ASCII value of the character DSP56303EVM User s Manual For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Assembler Directives Example C 27 Single Character String Definition R 000052 e Multiple character strings represent words whose bytes are composed of concatenated sequences of the ASCII representation of the characters in the string unless the NOPS option is specified see the OPT directive If the number of characters is not an even multiple of the number of bytes per DSP word then the last word will have the remaining characters left aligned and the rest of the word is zero filled If the NOPS option is given each character in the string is stored in a word whose lower seven bits represent the ASCII value of the character Example C 28 Multiple Character String Definition ABCD 414243 440000 Note See also BSC DCB Example C 29 DC Directive TABLE DC 1426 253 2662 ABCD CHARS DC MA BED C 3 9 DCB Define Constant Byte lt label gt DCB arg arg arg The DCB directive allocates and initializes a byte of memory for each arg argument arg may be a byte integer constant a single or multiple character string constant a symbol or a byte expression The DCB directive may have one or more arguments separated by commas Multiple arguments are stored in succe
34. cln and optimally aligns any buffers encountered in the input B lt objfil gt Specifies that an object file is to be created for linker output lt objfil gt can be any legal operating system filename including an optional pathname f no filename is specified or if the B option is not present the linker uses the basename filename without extension of the first filename encountered in the input file list and appends cld to the basename If the I option is present see below an explicit filename must be given because if the linker follows the default action it can overwrite one of the input files The B option is specified only once If the file named in the B option already exists it is overwritten Example dsplnk Bfilter cld main cln fft cin fio cln Links the files main cln fft cln and fio cln together to produce the absolute executable file filter cld EA lt errfil gt or EW lt errfil gt Allows the standard error output file to be reassigned on hosts that do not support error output redirection from the command line lt errfil gt must be present as an argument but it can be any legal operating system filename including an optional pathname The EA option causes the standard error stream to be written to lt errfil gt if lt errfil gt exists the output stream is appended to the end of the file The EW option also writes the standard error stream to lt errfil gt if lt errfil gt exists it is overwritte
35. included to simplify the initialization the interface and the transferring mechanism of the codec e joequ asm e intequ asm ada equ asm e vectors asm ada init asm The next step is to define the transmit and receive buffers and pointers After performing the task of defining the receive and transmit buffers and pointers the control information constants for the codec will also need to be defined The following steps need to be performed 1 Include codec and I O files 2 Define transmit and receive buffer and pointers 3 Define codec control constants Codec Programming Tutorial D 31 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Example Application Example D 19 illustrates the tasks of including initialization and interface files defining transmit and receive buffers and pointers and setting up control word constants Example D 19 Include Define and Set Up Tasks gk ee ee ee ee ee e e e e e e e e KK KK KK KK KK e ehe ehe ehe e he ehe ehe ke he e he e he he he e he ehe ke he e ke e ke e ke ke nolist include ioequ asm include intequ asm include ada equ asm include vectors asm list AEREA ERRE khe koe ke ke khe hcec ke kc ke ke ke kc ke he ke ke e se ke khe ke ese ke e ke RARA hec ke ke kc e ke ke e ke ke e ke ke e kk ke Buffer for talking to the CS4218 org x S0 RX BUFF BASE equ RX data 12 ds 1 data time slot 1 2 for RX ISR left audi
36. input base of constants to the result of expression The absolute integer expression must evaluate to one of the legal constant bases 2 10 or 16 The default radix is 10 The RADIX directive allows the programmer to specify constants in a preferred radix without a leading radix indicator The radix prefix for base 10 numbers is the grave accent Note that if a constant is used to alter the radix it must be in the appropriate input base at the time the RADIX directive is encountered Note A label is not allowed with this directive DSP56303EVM User s Manual For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Assembler Directives Example C 68 RADIX Directive RAD10 DC 10 Evaluates to hex A RADIX 2 _RAD2 DC 10 Evaluates to hex 2 RADIX 16 _RADI16 DC 10 Evaluates to hex 10 RADIX 3 Bad radix expression C 3 48 RDIRECT Remove Directive or Mnemonic from Table RDIRECT lt direc gt lt direc gt lt direc gt The RDIRECT directive is used to remove directives from the assembler directive and mnemonic tables If the directive or mnemonic that has been removed is later encountered in the source file it is assumed to be a macro Macro definitions that have the same name as assembler directives or mnemonics will cause a warning message to be output unless the RDIRECT directive has been used to remove the directive or mnemonic name from the assembler s tables Addit
37. is as if every symbol in the section were defined within the parent section This is useful when a section needs to be independently relocatable but data hiding within an enclosing section is not required The division of a program into sections controls not only labels and symbols but also macros and DEFINE directive symbols Macros defined within a section are private to that section and are distinct from macros defined in other sections even if they have the same macro name Macros defined outside of sections are considered global and may be used within any section Similarly DEFINE directive symbols defined within a section are private to that section and DEFINE directive symbols defined outside of any section are globally applied There are no directives that correspond to XDEF for macros or DEFINE Motorola Assembler Notes C 49 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Assembler Directives symbols and therefore macros and DEFINE symbols defined in a section can never be accessed globally If global accessibility is desired the macros and DEFINE symbols should be defined outside of any section Sections can be nested to any level When the assembler encounters a nested section the current section is stacked and the new section is used When the ENDSEC directive of the nested section is encountered the assembler restores the old section and uses it The ENDSEC directive always ap
38. k k k k k k k k k k k k k k k k k k k k k k k k k k k k k k k kkk kkk kkk kkk kkk kkk org X XBASE instructs the assembler that we are referring to X memory starting at location XBASE listl de 475638 738301 92673a 898978 091271 25067 dc 987153 3A8761 987237 34b852 734623 233763 dc S 76756 423423 324732 40029 gc ee kk kk kk e e k k kk kk kk kk kk kk kk kk kkk e he e he che e he ehe ehe ehe ke he e he e ke e ke e ke e Y MEMORY gcc ke ee ee ee ke e e e e e ee e e e e ee ee ee eee e he e he ehe che e he ehe che e he e he e he e ke e he e ke e org y YBASE instructs the assembler that we are referring to Y memory starting at location YBASE list2 dc 98734 800000 fedcba 487327 957572 369856 de 247978 8a3407 734546 344787 938482 304 82 dc 123456 657784 567123 675634 gcc k k k k k k ee e k e k e k e e k k e k e k e k k k k k he k he k k k k e he kk kk kk e he ehe e ke e ke e ke e PROGRAM gcc ee ee ee ee ee ee e e e e ee ee e e e e e e ee ee he e he ehe ehe e he che ehe e he ehe e he e he e ke e ke e org pio put following program in program memory starting at location 0 DSP56303EVM User s Manual For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Assembling the Program Example 2 1 Simple DSP56303EVM Code Example Continued jmp begin p 0 is the reset vector i e where the DSP looks for instructions after a reset org p PBASE start the mai
39. nop movep x M RX0 x r0 move rO x RX PTR move x r7 mO move x r7 r0 rti So So eo aa Se So Seo ae Clear receives overrun bit M_SSISRO refers to status register explicitly clears overrun flag Save Context Save r0 to the stack Save m0 to the stack Modulus 2 buffer Load the pointer to the rx buffer Delay Move received data to receive buffer Update rx buffer pointer Restore Context Restore m0 Restore r0 D 10 3 ESSI Receive Data Interrupt The interrupt occurs when the following properties are true e The receive interrupt is turned on CRB 19 e The receive data register is full Codec Programming Tutorial D 25 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Phase III Data Transferring Mechanism To service the interrupt the programmer will need to receive the data The following steps can be performed to accomplish such a task Save necessary context Load receive buffer pointer Move received data to receive buffer Update receive buffer pointer Qv geo a ND EE Restore context Example D 14 illustrates the procedures to service this interrupt Example D 14 ESSI Receive Data Interrupt Service ESSI Receive Data Interrupt Service Routine ssi rx isr Save Context move rO x r7 4 Save r0 to the stack move mO x r7 Save m0 to the stack move 1 m0 Modulus 2 buffer move x RX PIR r0 Load the pointer to the rx buf
40. per word or a 16 8 bit combination Which load counter H L or default if neither H or L is specified that is associated with the Ims is used as the load location counter DSP56303EVM User s Manual For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Assembler Directives Imp Indicates the load physical mapping to DSP memory I internal E external R ROM A port A B port B If not present no explicit mapping is done lt lce gt Non negative absolute integer expression representing the counter number to be used as the load location counter Must be enclosed in parentheses Should not exceed the value 65535 exp2 Initial value to assign to the load counter used as the llc If lt exp2 gt is a relative expression the assembler uses the relative location counter If exp2 is an absolute expression the assembler uses the absolute location counter If exp2 is not specified then the last value and mode that the counter had is used If the last half of the operand field in an ORG directive dealing with the load memory space and counter is not specified then the assembler assumes that the load memory space and load location counter are the same as the runtime memory space and runtime location counter In this case object code is being assembled to be loaded into the address and memory space where it is when the program is run it is not an overlay If
41. pins on the codec high or low specifically SMODE1 SMODE2 and SMODE3 pins The mode in which the DSP5630x evaluation modules are physically set to is Serial Mode 4 SM4 SM4 allows the control information for the codec to be separated from the data information In effect this reduces the bandwidth needed by the data serial ports and simplifies the programming procedures Within the SM4 mode exist four sub modes These secondary modes specify two things whether the codec functions in the master mode or the slave mode and the number of bits per frame With the DSP evaluation boards that are discussed in this appendix the secondary modes are physically configured to sub mode 0 Sub mode 0 dictates the codec to function in the master mode and sets the frame size to be 32 bits In essence by setting the codec to operate in the master mode the codec is responsible for sending the serial bit clock and sending frame synchronization pulses to indicate the start and stop of a data frame In addition sub mode zero specifies that each frame consist of two 16 bit words a left channel 16 bit word and a right channel 16 bit word The left and right channels are sent to and from the codec with the most significant bits MSBs first This information will be important in the sections to follow in this appendix These properties apply to both the input data going into the codec SDIN and the output data coming from the codec SDOUT Please refer to Figure D
42. reproduced on the assembler output listing and are never saved as part of macro definitions Example C 2 Example of Unreported Comment Delimiter HESE LINES WILL NOT BE REPRODUCED N THE SOURCE LISTING HH C 2 3 Line Continuation or Macro Argument Concatenation Character The following subsections define how the character can be used in two different instances C 2 3 1 Line Continuation The backslash character if used as the last character on a line indicates to the assembler that the source statement continues on the following line The continuation line is concatenated to the previous line of the source statement and the result is processed by the assembler as if it were a single line source statement The maximum source statement length the first line and any continuation lines is 512 characters Example C 3 Example of Line Continuation Character THIS COMMENT EXTENDS OVER THREE LINES C 2 3 2 Macro Argument Concatenation The backslash is also used to cause the concatenation of a macro dummy argument with other adjacent alphanumeric characters For the macro processor to recognize dummy arguments they must normally be separated from other alphanumeric characters by a non symbol character However sometimes it is desirable to concatenate the argument characters with other characters If an argument is to be concatenated in front of or behind some other symbol characters then it must be followed by or pre
43. s Manual For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Structured Control Statements contents of the registers reassign data registers using the SCSREG directive or not use them at all in the body of the particular structured construct being executed C 4 3 4 Compound Expressions A compound expression consists of two or more simple expressions See Section C 4 3 1 joined by a logical operator AND or OR The boolean value of the compound expression is determined by the boolean values of the simple expressions and the nature of the logical operator Note that the result of mixing logical operators in a compound expression is undefined IF X1 GT B AND LS AND R1 NE R2 this is OK IF Xl LE B AND LC OR R5 GT R6 undefined The simple expressions are evaluated left to right Note that this means the result of one simple expression could have an impact on the result of subsequent simple expressions because of the condition code settings stemming from the assembler generated compare If the compound expression is an AND expression and one of the simple expressions is found to be false any further simple expressions are not evaluated Likewise if the compound expression is an OR expression and one of the simple expressions is found to be true any further simple expressions are not evaluated In these cases the compound expression is either false or true respectively
44. simple or compound expression Section C 4 3 s lt stmtlist gt Zero or more assembler directives structured control statements or executable instructions Note An assembler directive occurring within a structured control statement is examined exactly once at assembly time Thus the presence of a directive within a FOR LOOP REPEAT or WHILE statement does not imply repeated occurrence of an assembler directive nor does the presence of a directive within an IF THEN ELSE structured control statement imply conditional assembly e lt op1 gt A user defined operand whose register memory location holds the FOR loop counter The effective address must use a memory alterable addressing mode 1 e it cannot be an immediate value e lt op2 gt The initial value of the FOR loop counter The effective address may be any mode and may represent an arbitrary assembler expression e lt op3 gt The terminating value of the FOR loop counter The effective address may be any mode and may represent an arbitrary assembler expression e lt op4 gt tThe step increment decrement of the FOR loop counter each time through the loop If not specified it defaults to a value of 1 The effective address may be any mode and may represent an arbitrary assembler expression e lt cnt gt The terminating value in a LOOP statement This can be any arbitrary assembler expression All structured control statements may be followed by normal ass
45. the first symbol in the source program is defined Expand DEFINE symbols within quoted strings Can also be done on a case by case basis using double quoted strings Do not restrict directives in DO loops The presence of some directives in DO loops does not make sense including some OPT directive variations This option suppresses errors on particular directives in loops default reset Expand DEFINE directive strings in listing Motorola Assembler Notes C 37 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Assembler Directives FC FF FM GL GS HDR IC IL INTR LB LDB LOC MC MD Fold trailing comments Any trailing comments that are included in a source line are folded underneath the source line and aligned with the opcode field Lines that start with the comment character are aligned with the label field in the source listing The FC option is useful for displaying the source listing on 80 column devices Use form feeds for page ejects in the listing file Format assembler messages so that the message text is aligned and broken at word boundaries Make all section symbols global This has the same effect as declaring every section explicitly GLOBAL This option must be given before any sections are defined explicitly in the source file default reset in absolute mode Make all sections global static All section counters and attributes are ass
46. the linker to strip source file line number and symbol information from the output file Symbol information normally is retained for debugging purposes This option has no effect if incremental linking is being done See the I option Example dspink Zfilter cln fft cln fio cln Links the files filter cln fft cln and fio cln to produce the absolute object file filter cln The output file contains no symbol or line number information 2 4 1 Linker Directives Similar to the assembler directives the linker includes mnemonic directives which specify auxiliary actions to be performed by the linker Following is a list of the linker directives BALIGN Auto align circular buffers BASE Set region base address IDENT Object module identification INCLUDE Include directive file MAP Map file format control MEMORY Set region high memory address REGION Establish memory region RESERVE Reserve memory block SBALIGN Auto align section buffers DSP56303EVM User s Manual For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Introduction to the Debugger Software SECSIZE Pad section length SECTION Set section base address SET Set symbol value SIZSYM Set size symbol START Establish start address SYMBOL Set symbol value 2 5 Introduction to the Debugger Software This section briefly introduces the Domain Technologies debugger giving only the details required to work through this exampl
47. the reset FEDCBA 487327 the DSP looks for 957572 369856 after a reset 247978 843407 p PBASE start the main pr 734546 344787 E 938482 304F82 123456 657784 list1 r0 567123 675634 list2 r4 2FE9FS 177E4D clear accumulator B3B1C F36CCD _Qe G Command HEX 404020 240100 D LOAD example 00000200000000 DISPLAY x 0 FF7112E3000000 DISPLAY y 0 00 000200 000000 FF ab ras 600000 000810 FFFFFF 600001 600000 FFFFFF 600001 000080 FFFFFF Figure 2 2 Example Debugger Window Display When the command window is selected as in Figure 2 2 the tool bar at the top of the screen will change and show buttons for the commands used most often in the command window From left to right the commands are go stop step j Pon stop step jump automatic update reset and radix Go runs the DSP56303 from the program counter e Stop stops the DSP56303 e Step executes a single instruction e Jump is similar to the step except that subroutines are treated as one instruction Automatic update turns the automatic screen update mode on so that the DSP56303 is periodically interrupted to update the data and registers windows e Reset resets the DSP56303 e Radix can be used to change the radix of the selected window Other buttons appear when other windows are selected and they function as described in the Debug 56K Manual which is contained in the Domain Technologies
48. to the error count Write underscore local labels to object file This is primarily used to aid debugging This option if used must be specified before the first symbol in the source program is defined Causes XDEFed symbols to be recognized within other sections without being XREFed This option if used must be specified before the first symbol in the source program is encountered Example C 63 OPT Directive OPT CEX MEX Turn on DC and macro expansions OPT CRE MU Cross reference memory utilization Motorola Assembler Notes C 41 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Assembler Directives C 3 43 ORG Initialize Memory Space and Location Counters ORG rms rlc lt rmp gt lt exp1 gt lt lms gt lt llc gt lt 1mp gt lt exp2 gt ORG rms rmp rce exp15 lt 1ms gt 1mp lt 1ce gt lt exp2 gt The ORG directive is used to specify addresses and to indicate memory space and mapping changes It also can designate an implicit counter mode switch in the assembler and serves as a mechanism for initiating overlays Note A label is not allowed with this directive The parameters used with the ORG directive are as follows rms lt rlc gt lt rmp gt lt rce gt expl lt lms gt lt llc gt Which memory space X Y L P or E is used as the runtime memory space If the memory s
49. used within a program block bounded by the SECTION and ENDSEC directives The LOCAL directive must appear before symbol is defined in the section If the symbols that appear in the operand field are not defined in the section an error is generated Note A label is not allowed with this directive See also SECTION XDEF XREF Example C 55 LOCAL Directives SECTION IO LOCAL LOOPA LOOPA local to this section ENDSEC C 3 35 LOMEM Set Low Memory Bounds LOMEM mem rl expression The LOMEM directive establishes an absolute low memory bound for code and data generation mem corresponds to one of the DSP memory spaces X Y L P E rl is one of the letters R for runtime counter or L for load counter The expression is an absolute integer value within the address range of the machine If during assembly the DSP56303EVM User s Manual For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Assembler Directives specified location counter falls below the value given by expression a warning is issued Note A label is not allowed with this directive See also HIMEM Example C 56 LOMEM Directive LOMEM XR 100 YR 100 SET X Y RUN LOW MEM BOUNDS C 3 36 LSTCOL Set Listing Field Widths LSTCOL labw opcw oprw opc2w opr2w xw yw 111111 Sets the width of the output fields in the source listing Widths are specified in te
50. www freescale com Example Application echo loop jset jelr clr a clr b move move asr asr add add asr asr move move move move jmp echo Freescale Semiconductor Inc 43 x M SSISRO 43 x M SSISRO x RX BUFF BASE a x RX BUFF BASE 1 b a x r4 x0 b y r4 yO x0 a y0 b a b a x r4 b y r4 a x TX BUFF BASE b x TX BUFF BASE 1 echo loop So an So So 9e L Li U U Example D 23 Implementation of Echo Program wait for rx frame sync wait for rx frame sync receive left receive right divide them by 2 and get oldest samples from buffer add the new samples and the old reduce magnitude of new data to ensure stability save the altered samples and bump the pointer transmit left transmit right After receiving the left and right channels the data is quickly divided by two Then the left and right channels are added to the time delayed samples which were stored on the echo buffer The magnitude is reduced by two and the echo buffer is updated with the newest output sample The left and right processed channels are then sent to the transmit buffers where it is sent to the ESSI port and eventually to the CODEC The procedures loop infinitely until manually stopped Example D 24 combines all the separate pieces of the echo code into an application that performs the time delayed echo DSP56303EVM User s Manual For More Information On This Product Go to www freescale c
51. 0 XDEF Directive SECTION IO XDEF LOOPA LOOPA will be accessible by sections with XREF ENDSEC C 3 60 XREF External Section Symbol Reference XREF lt symbol gt lt symbol gt lt symbol gt The XREF directive is used to specify that the list of symbols is referenced in the current section but is not defined within the current section These symbols must either have been defined outside of any section or declared as globally accessible within another section using the XDEF directive If the XREF directive is not used to specify that a symbol is defined globally and the symbol is not defined within the current section an error is generated and all references within the current section to such a symbol are flagged as undefined The XREF directive must appear before any reference to lt symbol gt in the section Note A label is not allowed with this directive See also SECTION XDEF Motorola Assembler Notes C 53 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Structured Control Statements Example C 81 XREF Directive SECTION FILTER XREF AA CC DD XDEFed symbols within section ENDSEC C 4 Structured Control Statements An assembly language provides an instruction set for performing certain rudimentary operations These operations in turn may be combined into control structures such as loops FOR REPEAT WHILE or conditional branches IF THEN IF THEN ELSE The assem
52. 03 write WR and read RD enable lines respectively Address attribute 1 AA1 generates the flash chip enable CE 3 3 2 2 Programming for Stand Alone Operation The DSP56303 mode pins determine the chip operating mode and start up procedure when the DSP56303 exits the reset state The switch at SW1 resets the DSP56303 by DSP56303EVM User s Manual For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Audio Codec asserting and then clearing the RESET pin of the DSP56303 The mode pins MODA MODB MODC and MODD are sampled as the DSP56303 exits the reset state The mode pins for the DSP56303EVM are controlled by jumper block J1 shown in Figure 3 1 on page 3 2 and Table 3 14 on page 3 16 The DSP56303 boots from the Flash after reset if there are jumpers connecting pins 3 and 4 and pins 5 and 6 on J1 Mode 1 MODA and MODD are set and MODB and MODC are cleared 3 4 Audio Codec The DSP56303EVM analog section uses the Crystal Semiconductor CS4218 KQ for two channels of 16 bit A D conversion and two channels of 16 bit D A conversion Refer to Figure 3 1 on page 3 2 for the location of the codec on the DSP56303EVM and to Figure 3 2 on page 3 3 for a functional diagram of the codec within the evaluation module The CS4218 uses a 3 3 V digital power supply and a 5 V analog power supply The CS4218 is driven by a 12 288 MHz signal at the codec master clock CLKIN input pin The oscillator at Y1 cr
53. 1 2epo omnww ow 0976 0 T bs Y 00721 I o Si vLCdO QW Ogz ieg zis xv4 eiso Lea zLc m i 00791 0 H Toa 86S8 SELBL XL unsnv aw BAU UOUUE O WEIMA 1099 i EM 0 T o UOISIAIq 19QUISNS sse ao JIM f 0072 I 0 H 0078p 0 0 0 P ZHM S4 84K Lan 94N Peps ee Et Te ae A Ne MEY ei Ge S Ae ONASS 030005 i 9 s EEN e b Z3 t 93 Aer En er veo EI re ae Ob Ol Ob a ieu oza sia en TRA Mid BLIHZE S u JHIOHINE Y ECON TY i 3 E 3 o NE9 g gt AE web AEE H Det z 3 Si MGE sino S NI 4 wer age JI H 9 BE nO euoudpesH sss 222 A NE9 Det e M90 88 888 ay L NHd di ZEO Ager oH GA SES YA bg vase y e Y ino VM er Rn er Z Nag ONA Ji E e Nias MS 032009 Ez 9 s anodas 1nods 93009 5 5 age L BEES ONASS L ONASd 79002 Nad E onee S E yo 1383 LRE soo n AY Si E EES ZHINGEC Cl UWE EES 00c sza Za Sc Bi WER cin E SEO r SA dnddas er eg Nr SCH ac g SH PL ani E v INT reen ei Dei SCH Wl 70 wuse IE az anzzooo Jnzco00 Lei OR Oo ved ECH 120 9co AC Er En ae eun no an A an z NEO ES veo j or 1007 p Ino d I d s ozo Ag A Ie ZS 4 s now NM Le 9d ei m 3 E OX 8IZVSO ado 619 eco ezo EI wuer xoer cereis a uj eur NI dil NI ONIS vd MOT DSP56303EVM User s Manual A 6 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc jddns 19Mog 9 9 31N6
54. 12 CDIN as output D 9 3 Initialization of the CODEC ports The next step that needs to occur is the process of initializing the codec This initialization process begins with first resetting the codec second waiting for the codec to reset and finally sending the control information for the codec Note that the control information only needs to be sent when a change is needed to be made to the control parameters In order to reset the codec a 0 value must be sent into the CODEC_RESET pin Recall that a global variable was defined called CODEC_RESET in this document Thus to reset the codec the CODEC_RESET bit located on the Port Data Register C on the ESSI port must be cleared In addition the codec must be notified that control information will be modified Setting the CSS pin to 0 allows for this Furthermore the codec requires a minimum of 50 ms to reset Thus often a delay is programmed into the DSP to allow for the codec to reset Example D 8 summarizes the procedures in code format Example D 8 Code Format Procedures bclr HCODEC RESET x M PDRC assert CODEC RESET bit 0 on ESSIO belr HCCS x M PDRD assert CCS bit 0 on ESSI1 reset delay for codec do 1000 delay loop rep 1000 A delay greater than 50 ms nop _delay loop Once the codec has been reset the codec control information needs to be sent from the DSP to the codec ports But before the control information can be sent the CODEC_RESET pin must to be tur
55. 14 Addn 19mog anu vLESO QW 09Z4 L68 ZLS XY4 erso Log zio 9668 6 9 XL ugsny ISAM AUC uouueo WEIIIIM 1099 UOISIAIG Jequ2sqns sse oJIM WIOHOLOM yy AS O MO KING ely S Qv38 1194834 yino a QNO Owes ano KE S ip 4 P 9 rus SlPOLdSA Jeu ieq 866 OL JequiemoN Versen eed 6 Jequun nou NSQ 0E98dSG EEN ens 1 NE uta 193489 uz WOW H3MOd OG OV e sek x l E A uuMOd b sen A ERC A 29 qat Mo EI HH Qv38 299397 Qv38 31434 Mir O L FI 1 BES GAOL 200 oo no EU dandy neso amp E CLUB 8 P BD vom Za F9 NIA o t 2 5 ven Sg LOOP OOPWA s 4 d ya ed a Qv38 3Lldiei34 3 4 _ Ahh el LOOP bOOPWA aneco ka za ia 30M0 30M0 ge Lasgzeeon L nr x an anero o ak Dal so o Z S NIA oo E 2e SS en 0999 aia NE E O n Ed A 7 DSP56303EVM User s Manual MOTOROLA For More Information On This Product Go to www freescale com siopoedey ssed g jg amb 3 a 3 a Y L yo 4 yeus So0 L dSd ueubisegd 8661 OL Jequie oN Aepsen ejed g A Jequuni NSA 0E9SdSd de azie sioy2ede ssed g om vLESO QW 09Z4 L68 ZLS
56. 16 bits per word toggle CCLK clock high test msb send high into CDIN So So eo ee jmp continue bit low bclr HCDIN x M PDRD send low into CDIN continue rep 2 delay nop belr HCCLK x M PDRD restart cycle lsl a shift control word to 1 bit to left end send codec rts The codec control subroutine performs most of the work for sending the information to the codec ports First the CSS bit is cleared to permit the modification of the control registers on the codec Afterwards the control words are loaded into registers where they are then sent out to another subroutine that sends the data serial out to the codec ports After sending both the upper and lower control words the CCS bit is reset to 1 to disallow changing of the control information on the codec The send codec subroutine in essence serves as the workhorse for the codec control routine This routine pushes the individual bits of the control words into the codec DSP56303EVM User s Manual For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Phase II Initializing and Interfacing the ESSI and CODEC Ports First it sets the clock CCLK high to allow the bit to be sent Afterwards it determines what the most significant bit MSB is and either sends in a 0 or 1 to the CDIN pin depending on the MSB A delay is incorporated into the routine to allow the information to get sent Afterwards the clock CCLK is set low to a
57. 2 Pinot 3 11 3 6 JTAG OnCE J6 Connector Pinout 0 00000 eee eee 3 12 3 7 SCI Header J7 Pinout ded ae olei doe d SC ret dea iC ea tes 3 13 3 8 JI Jumper ODDONS uc tex on I i aree e Sd TS 3 13 3 9 DSP Serial Port P1 Connector Pinout 3 13 3 10 ESSIO Header J5 Pino t Zu bet A xa e A amis 3 14 3 11 ESSIO Header JA PInolt imn rh tang kesl oe bs dane Ege 3 14 3 12 BIOS Header 13 EE 3 15 3 13 Expansion Bus Control Signal Header J2 Pinout 3 15 3 14 Boot Mode Selection Options 0 c eee eee ee eee 3 16 B 1 DSP56303EVM Parts List vet nd B 1 D 1 ESSI Pin Definition AAA et pte Y aee ene tes D 4 D 2 ESSI GPIO Shared Registers gu iE he ead m as D 5 D 3 ESSI Registers A een e beg ee actes irs b x ac eade qs D 5 D 4 GPIO ResisterS e ex EE D 6 D 5 Pin Set Up Descriptions udo octo sb wc i a taste eto D 7 D 6 JP5 Jumper Block ESSIO oia D 7 D 7 JP4 Jumper Block ESSIT ups y ro ane y obe erf ee D 8 D 8 CS4218 Codec Control Information OMSbB D 10 D 9 Settings for Control Register A D 13 D 10 Settings Control Register B ad ete eM bete LEA e ara hs D 13 List of Tables xiii For More Information On This Product Go to www freescale com D 11 D 12 D 13 D 14 D 15 Freescale Semiconductor Inc Port Data Register C Pin bit Correspondence D 16 Port Data Register D Pin bit Correspondence D 16 Data Direction Register SA tb ib Mit ke D 18 Data Direction Register 9 eus ov ebe
58. 75 SYMOBJ SYMOBJ XSTART HIRTN ERRPROC C 3 55 TABS Set Listing Tab Stops TABS lt tabstops gt The TABS directive allows resetting the listing file tab stops from the default value of 8 Note A label is not allowed with this directive See also LSTCOL Example C 76 TABS Directive TABS 4 Set listing file tab stops to 4 C 3 56 TITLE Initialize Program Title TITLE lt string gt The TITLE directive initializes the program title to the string in the operand field The program title is printed on the top of all succeeding pages until another TITLE directive is encountered The title is initially blank The TITLE directive is not printed in the source listing A TITLE directive with no string argument causes the current title to be blank Note A label is not allowed with this directive See also STITLE Example C 77 TITLE Directive TITLE FIR FILTER C 3 57 UNDEF Undefine DEFINE Symbol UNDEF lt symbol gt The UNDEF directive causes the substitution string associated with lt symbol gt to be released and lt symbol gt will no longer represent a valid DEFINE substitution See the DEFINE directive for more information Note A label is not allowed with this directive See also DEFINE Example C 78 UNDEF Directive UNDEF DEBUG UNDEFINES THE DEBUG SUBSTITUTION STRING C 3 58 WARN Programmer Generated Warning WARN lt str gt lt exp gt lt str gt lt exp gt lt str gt lt exp gt The WARN directiv
59. BADDR Set Buffer Address BADDR M R gt lt expression gt The BADDR directive sets the runtime location counter to the address of a buffer of the given type the length of which in words is equal to the value of expression The buffer type may be either modulo or reverse carry If the runtime location counter is not zero this directive first advances the runtime location counter to a base address that is a multiple of 2k where 2 gt expression An error is issued if there is insufficient memory remaining to establish a valid base address Unlike other buffer allocation directives the runtime location counter is not advanced by the value of the integer expression in the operand field the location counter remains at the buffer base address The block of memory intended for the buffer is not initialized to any value The result of expression may have any memory space attribute but must be an absolute integer greater than zero and cannot contain any forward references symbols that have not yet been defined If a modulo buffer is specified the expression must fall within the range 2 expression lt m where m is the maximum address of the target DSP If a reverse carry buffer is designated and expression is not a power of two a warning is issued A label is not allowed with this directive Note See also BSM BSB BUFFER DSM DSR Example C 20 Example BADDR Directive ORG X 100 M BUF BADDR M 24 CIRCULAR BUFF
60. CD ROM DSP56303EVM User s Manual For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Running the Program 2 6 Running the Program To load the example program into the Debugger click in the command window and type load example The instruction at line 33 is highlighted in the unassembly window because this is the first instruction to be executed But before executing the program verify that the values expected in data memory are there To do this type display x 0 and display y 0 The data is displayed in the data window To step through the program type step at the command window prompt For a shortcut click on the step button or type the start of the command and press the space bar and the debugger will complete the remainder of the command To repeat the last command press return As you step through the code notice that the registers in the registers window are changed by the instructions After each cycle any register that has been changed is highlighted Once you have stepped through the program ensure that the program has executed correctly by checking that the result in accumulator a is FE 9F2051 6DFCC2 Stepping through the program like this is good for short programs but it is impractical for large complex programs The way to debug large programs is to set breakpoints which are user defined points where execution of the code stops allowing the user to step through the sect
61. CNST EQU 5 Because the long immediate addressing mode makes the instruction two words long instead of one word for the immediate short addressing mode it may be desirable to force the immediate short addressing mode as shown below MOVE H lt CNST DO L CNST EQU 5 C 2 17 gt Immediate Long Addressing Mode Force Operator Many DSP instructions allow a long immediate form of addressing If the immediate data 1s known to the assembler on pass one not a forward or external reference then the assembler will always pick the shortest form of immediate addressing consistent with the instruction unless the FORCE LONG directive is active If this is not desired then the long form of addressing can be forced using the immediate long addressing mode force operator gt Motorola Assembler Notes C 9 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Assembler Directives Example C 19 Example of an Immediate Long Addressing Mode Operator In the following sequence of source lines the symbol CNST is known to the assembler on pass one and therefore the assembler would use the short immediate addressing form for the MOVE instruction CNST EQU 5 MOVE CNST DO L If this is not desirable then the long immediate form of addressing can be forced as shown below CNST EQU 5 MOVE gt CNST DO L C 3 Assembler Directives The following subsections define each directive and its use C 3 1
62. Character Any number of characters preceded by a semicolon but not part of a literal string is considered a comment Comments are not significant to the assembler but you can use them to document the source program Comments are reproduced in the assembler output listing Comments are normally preserved in macro definitions but this option can be turned off See the OPT directive Comments can occupy an entire line or can be placed after the last assembler significant field in a source statement A comment starting in the first column of the source file is aligned with the label field in the listing file Otherwise the comment is shifted right and aligned with the comment field in the listing file Example C 1 Example of Comment Delimiter THIS COMMENT BEGINS IN COLUMN 1 OF THE SOURCE FILE LOOP JSR COMPUTE THIS IS A TRAILING COMMENT THESE TWO COMMENTS ARE PRECEDED BY A TAB IN THE SOURCE FILE Motorola Assembler Notes C 1 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Assembler Significant Characters C 2 2 Unreported Comment Delimiter Characters Unreported comments are any number of characters preceded by two consecutive semicolons that are not part of a literal string Unreported comments are not considered significant by the assembler and can be included in the source statement following the same rules as normal comments However unreported comments are never
63. D Functionality Mode Reserve for future use N A 6 23 N A STD N A 5 N A SRD N A 4 N A SCK N A 3 N A SC12 CDIN 2 GPIO SC11 CCLK 1 GPIO SC10 CCS 0 GPIO DSP56303EVM User s Manual For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Phase II Initializing and Interfacing the ESSI and CODEC Ports Using the information in Table D 11 and Table D 12 global constants can be defined to simplify programming Example D 5 illustrates the task of defining the pin bit correspondence for the GPIO pins Example D 5 Defining GPIO Pin Bin Correspondence ESSIO audio data port control register C DSP CODEC CODEC RESET equ 0 bitO SCO0 CODEC RESET ESSI1 control data port control register D DSP CODEC CCS equ 0 bit0 SCLO gt COS CCLK equ 1 bitl SC11 gt CCLK CDIN equ 2 bit2 SC12 gt CDIN After setting up constants to reference the bit pin correspondence for the GPIO pins the Port control registers need to be configured To begin with the CODEC_RESET pin pin 0 must be configured to function as a GPIO pin Other pins on ESSIO however should be configured to work in the ESSI mode Therefore a 0 value should be sent into bit 0 in port control register C while a value of 1 should be sent to the other five pertinent bits Additionally the CCS pin the CCLK pin and CDIN pin all must function as GPIO pins on the ESSII port Therefore bit 0 CCS
64. DC Example C 21 Buffer Directive BUFFER BSB BUFSIZ INITIALIZE BUFFER TO ZEROS C 3 3 BSC Block Storage of Constant lt label gt BSC expression expression The BSC directive causes the assembler to allocate and initialize a block of words The number of words in the block is given by the first expression which must evaluate to an absolute integer Each word is assigned the initial value of the second expression If there is no second expression an initial value of zero is assumed If the first expression contains symbols that are not yet defined forward references or if the expression has a value of less than or equal to zero an error is generated Both expressions can have any memory space attribute label if present is assigned the value of the runtime location counter at the start of the directive processing Only one word of object code is shown on the listing regardless of how large the first expression is However the runtime location counter is advanced by the number of words generated Motorola Assembler Notes C 11 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Assembler Directives Note See also BSM BSB DC Example C 22 Block Storage of Constant Directive UNUSED BSC S2FFF LCV R SFFFFFFFF FILL UNUSED EPROM C 3 4 BSM Block Storage Modulo lt label gt BSM expression expression The BSM directive causes the assembler to allo
65. ER MOD 24 DSP56303EVM User s Manual For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Assembler Directives C 3 2 BSB Block Storage Bit Reverse lt label gt BSB expression expression The BSB directive causes the assembler to allocate and initialize a block of words for a reverse carry buffer The number of words in the block is given by the first expression which must evaluate to an absolute integer Each word is assigned the initial value of the second expression If there is no second expression an initial value of zero is assumed If the runtime location counter is not zero this directive first advances the runtime location counter to a base address that is a multiple of 2 where 2 is greater than or equal to the value of the first expression An error will occur if the first expression contains symbols that are not yet defined forward references or if the expression has a value of less than or equal to zero Also if the first expression is not a power of two a warning is generated Both expressions can have any memory space attribute label if present is assigned the value of the runtime location counter after a valid base address has been established Only one word of object code is shown on the listing regardless of how large the first expression is However the runtime location counter is advanced by the number of words generated Note See also BSC BSM
66. F directive is encountered Instructions and most data definition directives may appear between the BUFFER and ENDBUF pair although BUFFER directives may not be nested and certain types of directives such as MODE ORG SECTION and other buffer allocation directives may not be used The lt expression gt represents the buffer size If less data is allocated than the size of the buffer the remaining buffer locations are uninitialized If more data is allocated than the specified size of the buffer an error is issued DSP56303EVM User s Manual For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Assembler Directives The BUFFER directive sets the runtime location counter to the address of a buffer of the given type the length of which in words is equal to the value of expression The buffer type may be either modulo or reverse carry If the runtime location counter is not zero this directive first advances the runtime location counter to a base address that is a multiple of 2F where 2 gt expression An error is issued if there is insufficient memory remaining to establish a valid base address Unlike other buffer allocation directives the runtime location counter is not advanced by the value of the integer expression in the operand field the location counter remains at the buffer base address The result of expression may have any memory space attribute but must be an absolute int
67. GO p eic Ge toe e e he a adc e dp a deem C 5 C22 Quoted String DEFINE Exvpanston eese C 5 C 2 8 o bunedon Delimitar e de de as de dd e C 6 C29 Location Counter Substitution id ee e ee C 6 C 2 10 String Concatenation Operator senere eere C 6 C 2 11 Substring Delimiter lt string gt lt offset gt lt length gt C 7 C 2 12 lt lt TO Short Addressing Mode Force Operator C 7 C 2 13 lt Short Addressing Mode Force Operator 00s C 7 C 2 14 gt Long Addressing Mode Force Operator 000s C 8 C 2 15 T Immediate Addressing MOE ii UE D A Mak C 9 C 2 16 f Immediate Short Addressing Mode Force Operator C 9 C 2 17 Immediate Long Addressing Mode Force Operator C 9 GA S XASSODIDIEIDHGCUVOS eege e xa Rape uicti tp aed wim aca deer C 10 C 3 1 BADDR Set Buffer Address 3 ui NR EXER NU CRUCE C 10 EZ BSB Block Storage Bit Reverse cues dio delata C 11 C 3 3 BSC Block Storage of Constant cu d CES SR VEU M CES C 11 C 3 4 BSM Block Storage Modulo 3 NIE ER eer d C 12 COS BUFFER Start Bud a a di bl C 12 C 3 6 COBY Comment Object File a R os icit eb n oic OPE P ees C 13 7 COMMENT Start Comment Lines oo ce eee eee ee eee C 14 C 3 8 DE Define Constant la eec dme oa eb C 14 C39 DEB Define C nstant Byte ee ee os ix deoa CEA AA A C 15 C 3 10 DEFINE Define Substitution String llle C 16 Coal DS Denne Storages cod dee ado ai eos C 17 3 12 DSM Define M
68. Go to www freescale com D 3 D 4 D 5 D 6 D 7 D 8 D 9 D 10 D 11 D 12 D 13 D 14 D 15 D 16 D 17 D 18 D 19 D 20 D 21 D 22 D 23 D 24 Freescale Semiconductor Inc ESSI Port Reset Procedure c cen qoe repa e eant pe ee as e D 12 Setting Control Registers for the ESSIO Port D 15 Defining GPIO Pin Bin Correspondence L D 17 GPIO Pin COn Uurallohk cse sos sa MR I EUR UE EM D 17 Code Form Settings in Data Direction Registers D 19 Code Format Procedures osa A Reie ea as D 19 Deasserunp Code Reset res we wee RTI Re ue onte dice ato a D 19 Sending Code Information eg ee toc d CA CRESCE AUR D 21 sending in Control Words amp 5 e tex me ya iae we od eg D 22 ESSI Port Priority and Functionality Setting D 24 ESSI Exception Status Interrupt Service D 25 ESSI Receive Data Interrupt Service 22 2 s e m D 26 ESSI Receive Last Slot Interrupt Service n n nnnaennnn annn D 27 ESSI Transmit Data with Exception Status Interrupt Service D 28 ESSI Transmit Last Slot Interrupt Service D 29 ESSI Transmit Data Interrupt Service o ooooo o o D 30 Include Define and Set Up Tags o ito da D 32 DSP Initialization Procedure a deer Eh REESE VS D 33 Initializing CODEC BSS Loved ico adito e DIC CU PR D 33 Setting Up and Initializing BOTS raspa e teen D 33 Implementation of Echo Program 0 0 0 e eee eee eee D 34 Application of Echo Code so ra aR S aa ERI DEUS ELEM D 35
69. Id Freescale Semiconductor nd r thie EE DSP56303EVMUM D Rev 3 4 12 1999 DSP56303EVM User s Manual Freescale Semiconductor Inc Ww z freescale semiconductor Freescale Semiconductor Inc 2004 All rights reserved Freescale Semiconductor Inc How to Reach Us Home Page www freescale com E mail support freescale com USA Europe or Locations Not Listed Freescale Semiconductor Technical Information Center CH370 1300 N Alma School Road Chandler Arizona 85224 1 800 521 6274 or 1 480 768 2130 support freescale com Europe Middle East and Africa Freescale Halbleiter Deutschland GmbH Technical Information Center Schatzbogen 7 81829 Muenchen Germany 44 1296 380 456 English 46 8 52200080 English 49 89 92103 559 German 33 1 69 35 48 48 French support freescale com Japan Freescale Semiconductor Japan Ltd Headquarters ARCO Tower 15F 1 8 1 Shimo Meguro Meguro ku Tokyo 153 0064 Japan 0120 191014 or 81 3 5437 9125 support japan freescale com Asia Pacific Freescale Semiconductor Hong Kong Ltd Technical Information Center 2 Dai King Street Tai Po Industrial Estate Tai Po N T Hong Kong 800 2666 8080 support asia freescale com For Literature Requests Only Freescale Semiconductor Literature Distribution Center P O Box 5405 Denver Colorado 80217 1 800 441 2447 or 303 675 2140 Fax 303 675 2150 LDCForFreescaleSemiconductor hibbertgroup com I
70. Information On This Product Go to www freescale com Freescale Semiconductor Inc Assembler Directives C 3 42 1 Listing Format Control The following options control the format of the listing file FC Fold trailing comments FF Form feeds for page ejects FM Format messages PP Pretty print listing RC Relative comment spacing C 3 42 2 Reporting Options The following options control what is reported in the listing file CEX Print DC expansions CL Print conditional assembly directives CRE Print symbol cross reference DXL Expand DEFINE directive strings in listing HDR Generate listing headers IL Inhibit source listing LOC Print local labels in cross reference MC Print macro calls MD Print macro definitions MEX Print macro expansions MU Print memory utilization report NL Print conditional assembly and section nesting levels S Print symbol table U Print skipped conditional assembly lines C 3 42 3 Message Control The following options control the types of assembler messages that are generated AE Check address expressions MSW Warn on memory space incompatibilities UR Flag unresolved references W Display warning messages Motorola Assembler Notes C 35 For More Information On This Product Go to www freescale com Assembler Directives Freescale Semiconductor Inc C 3 42 4 Symbol Options The following options deal with the handling of symbols by the assembler DEX IC NS SCL SCO SO XLL XR
71. LIST List the Assembly LIST Print the listing from this point on The LIST directive is not printed but the subsequent source lines are output to the source listing The default is to print the source listing If the IL option has been specified the LIST directive has no effect when encountered within the source program The LIST directive actually increments a counter that is checked for a positive value and is symmetrical with respect to the NOLIST directive Motorola Assembler Notes C 29 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Assembler Directives Note the following sequence Counter value currently 1 LIST Counter value 2 LIST Counter value 3 NOLIST Counter value 2 NOLIST Counter value 1 The listing still would not be disabled until another NOLIST directive was issued Note A label is not allowed with this directive See also NOLIST OPT Example C 54 LIST Directive IF LISTON LIST Turn the listing back on ENDIF C 3 34 LOCAL Local Section Symbol Declaration LOCAL symbol symbol symbol The LOCAL directive is used to specify that the list of symbols is defined within the current section and that those definitions are explicitly local to that section It is useful in cases where a symbol is used as a forward reference in a nested section where the enclosing section contains a like named symbol This directive is only valid if
72. OOP IND sa DONS dano PA L AND pon LS Nt DONS PA Edl L SLL la Ln Ln Ln pa Ln la la la H H BERBBBB BBB is p SOL NONS NANO 2008 oda om vo v S NONO usA S88926 208 83 53 3 DI ge NONS uA Hegt i a 055555 33 EI x zeu E NINO uon 8 35829 828 y ano 990 Las h DEEN 4 3 19595 Or 00 13838 K nd DE Eg A Iy SONO SPA o zon sol HAND Seu pe HONS n gt gt uasai HAND E HAND uoa PG osa ES 7e SZ osonsa EH rer DONO Sen Leer ke 15 somosa SKJ DINO boon L d Ya DINO ban ion YOY VION E oana boon L gOu aCOW IWN OGOW __ dono doon LA ug PL CL IM voda ADA OL OL OL IM o gt E eu eey EE KEEN EN D r T D Le Le 3 3 3 E Y A 5 DSP56303EVM User s Manual Go to www freescale com For More Information On This Product MOTOROLA Freescale Semiconductor Inc 9epo2 oipny 9 9 e4nBiJ a E 1nods 79007 gt NOS 03009 1353893009 e 93009 7 L oS n cios Lays LaLS KIER Lag zoos 1095 odas odis 009S De A anyo an Sr 960 oane 9 mol pu 4 Pos rus soolaga Jeu ieeq 866 OL JequiemoN Versen ea NO NSG 0E9SdSd JeqUnN oa 9 jueunoo S i 0078 1
73. P56300 html e oequ asm Contains important I O equates for the DSP5630xEVM modules e ntequ asm Contains interrupt equates for the DSP5630x EVM modules e Ada equ asm Contains equates used to initialize the codec e Ada Init asm Contains initialization code for the ESSI and codec e Vectors asm Contains the vector table for the DSP5630xEVM modules e Echo asm Example of codec programming Codec Programming Tutorial D 1 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Codec Background Throughout this appendix the sample code used to demonstrate the use of the codec references equates found in Ada equ asm Ioequ asm and Intequ asm D 2 Codec Background D 2 1 Codec Device The CS4218 stereo audio codec is comprised of many devices designed to perform A D and D A conversion built into a single chip The chip consists of two delta sigma A D converters two delta sigma D A converters input anti aliasing filters output smoothing filters programmable input gain and programmable output attenuators These separate components built into the codec allow the DSP to receive data from the codec to process the data and to eventually transmit processed data back to the codec The data travels through special serial ports using the DSP s ESSI ports and the codec s specialized pins D 2 2 Codec Modes The codec has many modes of operation These modes are configured by setting certain
74. QNO QNO QNO cH 99 QNO QNO QNO EIS 99 QNO QNO QNO zo 99 QNO QNO QNO ZW 99 QNO QNO QNO TH 99 QNO QNO QNO eid 99 QNO QNO QNO E 99 QNO QNO QNO e109 vn 99 QNO QNO QNO vid 99 QNO QNO QNO Ho QNO QNO 60 99 QNO QNO QNO p 99 QNO QNO QNO 6d 99 QNO QNO QNO ZIN 99 99 QNO QNO QNO QNO cH 99 QNO QNO QNO TA 99 QNO QNO QNO ZH QNO QNO QNO QNO on qaed ygd eui zepun ydeoxe SeTA o m suerd punozb ey uo pejnoz eq snu tq Jg SNL asai Eet od Eu XOS ax axe als bays Las cios m 0L0S odis oaas Dis O0LO9 0t98dSQ in 1SOH TOYLNOO S08 1X3 oe 6L 5 MH a ou evy DIOVH eL 4 pone avy EL eb ovy 1200 a s MES Wy at noxo SOH EL El bv svo o 6 W08 WH SL k O OH x98 e Lo Wei uasaa D 6 BS 4H eg 9 s po 5 e 9H 8 2 Y SH WI Y E amp WM 9 S p PH Ie D L BD MEET H amp d LS tH 9 LS 0H zr er AER S S anzy v9weow 010 ano hex ia N Ez o Lassus CSS SW lt ZHINE8zzZ IMS fi aoa m gt HOUMS 13538 Sd an100 es 919 ra lt now E ER D I SS D n EB Cin O TEN
75. R n C 26 HIMEM Set High Memory Bounds lesse C 27 IDENT Object Code Identification Record n nnnaua na C 27 IF Conditional Assembly Directive 0 cece eee eee eee C 28 INCLUDE Include Secondary Pie C 29 LIST ist the Assemb yanakera os Ge baa eb olan os C 29 LOCAL Local Section Symbol Declaration o C 30 LOMEM Set Low Memory Bounds 0000s ee eee C 30 LSTCOL Set Listing Field Widths cerdos ex mne Abee C 31 MACLIB Macro Library EE C 31 MACRO Macro Definition wi ib fo cae EC RR ee a C 32 MODE Change Relocation Modes ci ci454 esee bs C 33 MSG Programmer Generated Message 000 eee ee eee C 33 NOLIST Stop Assembly Listing llle C 34 OPT Assembler Options tsisa daras rta oie bens C 34 Listing Format Control dete SA ote ley og C 35 Reporting Options s oa edet dpt ea Ree a Binns beck C 35 Message Controls e Cede C 35 Symbol Options iicet io c oem ba inet Re ow CO Rp e m ges C 36 Assembler Operation is e eR Rr da ede ee p RE C 36 ORG Initialize Memory Space and Location Counters C 42 PAGE Top of Page Size Page c us dt IHE Oe EUR UR C 45 PMACRO Purge Macro Defnpon 0 0 0 eee eee eee C 45 PRETE Send Control String to Printer sida C 46 RADIX Change Input Radix for Constans neue naaueu aaea C 46 RDIRECT Remove Directive or Mnemonic from Table C 47 SCSJMP Set Structured Control Statement Branching Mode C 47 SCSREG Reassign Structured Control Statement Register
76. RIA ed Oi eO D 8 D 3 Block Diagram of a Delayed Sample echo Less D 31 List of Figures XV For More Information On This Product Go to www freescale com Freescale Semiconductor Inc DSP56303EVM User s Manual For More Information On This Product Go to www freescale com Freescale Semiconductor Inc List of Examples 2 1 Example Source EEN 2 2 2 2 Simple DSP56303EVM Code Example nanan 2 4 C 1 Example of Comment Delimiter AR seat awe we o SERO C 1 C 2 Example of Unreported Comment Delimiter C 2 C 3 Example of Line Continuation Character naunau e eeraa C 2 CA Example of Macro Concatenation 0 0020 cece ee oo C 3 C 5 Example of Use of Return Value Character C 3 C 6 Example of Return Hex Value Symbol Character C 4 C 7 Example of Local Label Override Character C 4 C 8 Example of a Macro String Delimiter Character C 5 C 9 Example of a Quoted String DEFINE Expression C 6 C 10 Example of a Function Delimiter Character C 6 C 11 Example of a Location Counter Substtunon eseese C 6 C 12 Example of a String Concatenation Operator s s s essees esas C 6 C 13 Example of a Substring Delimiter 0 000005 C 7 C 14 Example of an I O Short Addressing Mode Force Operator C 7 C 15 Example of a Short Addressing Mode Force Operator C 8 C 16 Example of a Long Addressing Mode Force Operator
77. RS DCB UC P Be EE C 3 10 DEFINE Define Substitution String DEFINE symbol lt string gt The DEFINE directive is used to define substitution strings that are used on all following source lines All succeeding lines are searched for an occurrence of symbol which is replaced by string This directive is useful for providing better documentation in the source program symbol must adhere to the restrictions for non local labels That is it cannot exceed 512 characters the first of which must be alphabetic and the remainder of which must be either alphanumeric or the underscore _ A warning results if a new definition of a previously defined symbol is attempted The assembler output listing will show lines after the DEFINE directive has been applied and therefore redefined symbols are replaced by their substitution strings unless the NODXL option is in effect See C 3 42 OPT Assembler Options on page C 34 Macros represent a special case DEFINE directive translations are applied to the macro definition as it is encountered When the macro is expanded any active DEFINE directive translations are applied again DEFINE directive symbols that are defined within a section will only apply to that section See the SECTION directive Note A label is not allowed with this directive See also UNDEF Example C 31 DEFINE Directive If the following DEFINE directive occurred in the first part of the source program DEFINE ARRAYSIZ 10
78. SSYNC Codec Programming Tutorial For More Information On This Product Go to www freescale com D 7 Freescale Semiconductor Inc Programming the CS4218 Codec Table D 7 JP4 Jumper Block ESSI1 JP4 ESSI pin Codec pin 1 2 SCK1 3 4 SC10 CCS 5 6 STD1 7 8 SRD1 9 10 SC11 CDIN 11 12 SC12 CCLK Motorola DSP slave CS4218 CODEC master SDIN SDOUT SCLK RESET FSYNC MF4 CCS MF3 CCLK MF2 CDIN Figure D 2 ESSI Codec Pin Setup For more information concerning the pin layouts and jumper settings between the codec and DSP please consult the DSP user s manual for the respective evaluation modules D 7 Programming the CS4218 Codec In order for the CS4218 codec device to work properly with the Motorola DSPs certain procedures must be followed These procedures can be broken down into three major phases Each of the phases plays an essential role in properly setting up constants DSP56303EVM User s Manual For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Phase 1 Setting up Constants interfacing and initializing and finally using the CS4218 codec with the Motorola DSPs correctly in accordance with the following descriptions Phase 1 Setting up global constants This phase includes such activities as setting up buffer spaces and pointers setting codec control information constants and defining inte
79. Statement Foridt EE C 61 C 4 3 6 Expression BOEtmat lg titi CICER ee e doe C 61 C 4 3 7 POR LOOP EE eR UE NA SORS AIC ESTER C 62 C 4 4 Assembly Listing Format sssr soros sa led aa C 62 C 4 5 Effects on the Programmer e Environment eese C 62 Appendix D Codec Programming Tutorial ET oc eto os e acc a A Ud eo e x he RU A D 1 p CodeoBaekBrolltids osi tote e at ae uc e SON Se S SES ed eaten D 2 D 2 1 Codec DEVICE eet eg ROGAN ASA ds A E A D 2 D 2 2 Codec Modes cc Hse cate ee nce Meal Bk Neat al D 2 3 JESSI Ports Background 5 oos rure dp ttt ye t wih Cae EEN D 3 DAY BSSUGPIO DIIS c scm dep nd o m deed eee te e ee ee heed D 4 Di oESSLPOrCReGBIStCISS eg oy e se ek re et COR e PN etude e he D 4 D 5 1 ESSI GPIO Shared Registers s aces EE P SS D 4 1 52 ESSLReEISIIS s esc Rise Ros Serna s M ted RORIS SCC UD AUS Ie s aa D 5 D 5 3 GPIOBCbPISIetS Lex m avi uke ll hosted ese ee Mani SS D 5 D 5 4 GPIO Mode Port Cand Port D oce YEA o D 6 D 6 Digital Interface ESSI Codec s sss e e CERO Cn D 6 D 7 Programming the CS4218 Codec 2 434 Sex a one c ek i D 8 Dua Phase 1 Setting up Constans tete e s RUE Y edu a ess D 9 D 8 1 Setting Up Buffer Space and Pointers 0 0 0 c ce eee eee ee D 9 Table of Contents xi For More Information On This Product Go to www freescale com Freescale Semiconductor Inc D 8 2 Defining Control Parameters of the CODEC D 10 D 9 Phase II Initializing and Interfacing the ESSI and CODEC Ports
80. The default load counter is used and there is no explicit load origin ORG P 5 Y 8000 Indicates code is generated for an absolute overlay The runtime memory space is P and the counter used as the runtime location counter is counter 5 It will not be initialized and the last previous value of counter 5 is used The load memory space is Y Since neither H L nor any counter expression was specified as the load counter the default load counter counter 0 is used as the load location counter The default load counter is initialized to 8000 DSP56303EVM User s Manual For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Assembler Directives C 3 44 PAGE Top of Page Size Page PAGE lt exp1 gt lt exp2 gt lt exp5 gt The PAGE directive has two forms 1 If no arguments are supplied then the assembler advances the listing to the top of the next page In this case the PAGE directive is not output 2 The PAGE directive with arguments can be used to specify the printed format of the output listing Arguments may be any positive absolute integer expression The arguments in the operand field as explained below are separated by commas Any argument can be left as the default or last set value by omitting the argument and using two adjacent commas The PAGE directive with arguments will not cause a page eject and is printed in the source listing Note A label is not allowed w
81. UPA directive processing Note See also DUP DUPC DUPF ENDM MACRO Motorola Assembler Notes C 19 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Assembler Directives Example C 36 DUPA Directive If the input source file contained the following statements DUPA VALUE 12 32 34 DC VALUE ENDM then the assembled source listing would show DUPA VALUE 12 32 34 DC 12 DC 32 DC 34 ENDM Note that the lines DUPA VALUE 12 32 34 ENDM will only be shown on the source listing if the MD option is enabled The lines DC 12 DC 32 DC 34 will only be shown on the source listing if the MEX option is enabled Note See the OPT directive in this appendix for more information on the MD and MEX options C 3 16 DUPC Duplicate Sequence With Characters lt label gt DUPC lt dummy gt lt string gt ENDM The block of source statements defined by the DUPC and ENDM directives are repeated for each character of lt string gt For each repetition every occurrence of the dummy parameter within the block is replaced with each succeeding character in the string If the string is null then the block is skipped lt label gt if present is assigned the value of the runtime location counter at the start of the DUPC directive processing Note See also DUP DUPA DUPF ENDM MACRO DSP56303EVM User s Manual For More Information On This Product Go to www freescale co
82. X data transfer 2 3 Y data transfer 2 3 File include C 29 listing C 38 Flash 3 2 Flash Address Pins A 0 16 3 6 Flash Chip Enable Pin CE 3 6 Flash Data Pins I O 0 7 3 6 Flash Output Enable Pin OE 3 6 Flash PEROM 3 2 3 6 connections 3 6 stand alone operation 3 6 Flash Write Enable Pin WE 3 6 format assembler command 2 5 source statement 2 2 Function C 6 G GPIO pins configuration D 15 GPIO Registers D 5 GS71024T 10 3 3 H headphones 1 2 Host Address Pin HA2 3 10 host PC 3 10 Host PC Data Terminal Ready Pin DTR 3 11 Host PC Receive Data Pin RD 3 11 host PC requirements 1 2 Host PC Transmit Data Pin TD 3 11 Host Port HIOS 3 14 l Include file C 29 J J1 1 3 J4 1 3 3 7 J5 1 3 3 7 J6 3 12 J7 3 7 J8 1 3 3 11 J9 3 3 3 7 JP4 Jumper Block ESSI1 D 8 Index Index xxxix For More Information On This Product Go to www freescale com Freescale Semiconductor Inc JP5 Jumper Block ESSIO D 7 JTAG 3 10 K kit contents 1 1 L Label local C 38 C 41 label field 2 3 LED red 3 10 Left Channel Output Pin LOUT 3 8 Line continuation C 2 linker 2 1 2 12 directives 2 16 options 2 13 linker directives 2 16 Listing file C 38 format C 31 C 38 C 40 C 45 C 52 sub title C 51 title C 52 LM4880 3 8 Location counter C 6 C 42 Long Memory Data Moves 3 4 M Macro call C 38 comment C 37 definition C 32 C 38 directive C 32 end C 23 exit C 25 expansion C 39 librar
83. XY4 erso Log zLc a SAUQ uouue ulli 1059 UOISIAIq 19QUISNS ssoe ao JIM Freescale Semiconductor Inc gt anoo anoo anoo anyo anyo anyo i 899 199 99 ra z90 199 4 anoo b ovo Age er 1 Geo SiN LO an00 an00 an0 0 nio anyo anyo anyo anyo anyo 099 890 797 959 950 so so eso igo oso 4 A Age ZEN ech Zelt anyo N de Scio I seo T CLO A AA A a Emcor ea Bee eee Oe otk ee ce EE ee a AE VASE J009 310N T T 34009 910 f anvo anyo anyo KT eet EST 109 819 119 4 12109 i t t t t 3100 dnioo dnioo dnioo 3ni0O anvo anyo anyo anyo aro i nro anyo mo nro 6019 8019 2019 e010 zoo Sio vio elo ao POL 9019 Ed 089 6 0 4 i NEEr NE Er gera THON weus FHION LOEQGAST FHION E 3 E E Y MOT Go to www freescale com DSP56303EVM User s Manual For More Information On This Product A 8 Freescale Semiconductor Inc Appendix B DSP56303EVM Parts List B 1 Parts Listing The following table contains information on the parts and devices on the DSP56303EVM Table B 1 DSP56303EVM Parts List Designator Manufacturer Part Number Desc
84. a Le oza eid sid 210 91a sia via Dis cia X lec olaaa A 3 DSP56303EVM User s Manual MOTOROLA For More Information On This Product Go to www freescale com Freescale Semiconductor Inc CV e1nDiJ a 998J191U t VL oH L p meus a So0 L dsa ueubiseg 8661 OL JequieAoN Aepsen ejed 9 NSQ 0698dSG jueunoo JeqUnN azig eosepeju TETSU anu 09Z4 L68 ZLS XY4 LG9 L68 ZL9 8668 5684 XL UNSNY a SAUQ uouue ulli 1059 UOISIAIG Jequ2sqns sso o IlA vLe3O OIN VTOHOLOHNI TIN FO OZ utd pepunoao Ita 30 og utd pue tq go p utd Dur312euuoo TRUBTS peaouey TIN eolaep JO g UTA mont TeubTs JOSOY peaouer oT eUEYyoS jo I I UOTSISA 180d 1143 9N830 TE 180d TWwidas dsg td elelelels E b Di un SVOCIZXVIN CVPOLOHPZOW QVVOLOHFZOWN CVPOLOHPZOW VOLOHVZOIN S 9 oen CVPOLOHPZOW Si 23 NISY NIES HEN HEN HI LNOEL 1nozL LAO LL di ano Leh N3 1noss nova 1nOE M 1noza 1no ve NI NIEL NIZL NULL 99 A TF gt asn avi a 5 gt OSO9NI a Hng 91 8 2 aen aen gen QVPOLOHPZOW S E gt gt 1200 13538 ven 3x00 axe Hone
85. al With the exception of some directives a label is assigned the value of the location counter of the first word of the instruction or data being assembled A line consisting of only a label is a valid line and assigns the value of the location counter to the label 2 1 1 2 Operation Field The operation field appears after the label field and must be preceded by at least one space or tab Entries in the operation field may be one of three types e Opcode mnemonics that correspond directly to DSP machine instructions Directive special operation codes known to the assembler that control the assembly process Macro call invocation of a previously defined macro that is to be inserted in place of the macro call 2 1 1 3 Operand Field The interpretation of the operand field depends on the contents of the operation field The operand field if present must follow the operation field and must be preceded by at least one space or tab 2 1 1 4 Data Transfer Fields Most opcodes specify one or more data transfers to occur during the execution of the instruction These data transfers are indicated by two addressing mode operands separated by a comma with no embedded blanks If two data transfers are specified they must be separated by one or more blanks or tabs Refer to the DSP56300 Family Manual for a complete discussion of addressing modes that are applicable to data transfer specifications Example Test Program 2 3 For M
86. an result if a value is too large to be forced short For relocatable code the error may not occur until the linking phase Note See also FORCE SCSREG A label is not allowed with this directive Example C 70 SCSJMP Directive SCSJMP SHORT force all subsequent SCS jumps short C 3 50 SCSREG Reassign Structured Control Statement Registers SCSREG lt srcreg gt lt dstreg gt lt tmpreg gt lt extreg gt The SCSREG directive reassigns the registers used by structured control statement SCS directives It is convenient for reclaiming default SCS registers when they are needed as application operands within a structured control construct lt srcreg gt is ordinarily the source register for SCS data moves lt dstreg gt is the destination register lt tmpreg gt is a temporary register for swapping SCS operands lt extreg gt is an extra register for complex SCS operations With no arguments SCSREG resets the SCS registers to their default assignments The SCSREG directive should be used judiciously to avoid register context errors during SCS expansion Source and destination registers may not necessarily be used strictly as source and destination operands The assembler does no checking of reassigned registers beyond validity for the target processor Errors can result when a structured control statement is expanded and an improper register reassignment has occurred It is recommended that the MEX option see the OPT directive be u
87. are arranged such that a compare jump sequence of the following form always results CMP lt regl gt lt reg2 gt J B cc lt label gt where the jump conditional is the inverse of cc Ordinarily lt op1 gt is moved to the lt reg1 gt data register and lt op2 gt is moved to the lt reg2 gt data register prior to the compare This is not always the case however If lt op1 gt happens to be lt reg2 gt and lt op2 gt is lt reg1 gt an intermediate register is used as a scratch register In any event worstcase code generation for a given operand comparison expression is generally two moves a compare and a conditional jump Jumps or branches generated by structured control statements are forced long because the number and address of intervening instructions between a control statement and its termination are not known by the assembler The programmer may circumvent this behavior by use of the SCSJMP directive Any immediate operands must be preceded by a pound sign ff Memory references must be preceded by a memory space qualifier X Y or P L memory references are not allowed Operands must be or refer to single word values Note that values in the lt reg1 gt and lt reg2 gt data registers are not saved before expression evaluation This means that any user data in those registers are overwritten each time the expression is evaluated at runtime The programmer should take care either to save needed DSP56303EVM User
88. are implied to be 1 It is actually a shorthand method for setting up a hardware DO loop on the DSP without having to worry about addressing modes or label placement Since the LOOP statement generates instructions for a hardware DO loop the same restrictions apply as to the use of certain instructions near the end of the loop nesting restrictions etc One or more CONTINUFE directives inside a LOOP construct generate a NOP instruction just before the loop address Example C 86 LOOP Statement LOOP LPCNT hardware loop LPCNT times ENDL C 4 2 6 REPEAT Statement REPEAT lt stmtlist gt UNTIL lt expression gt lt stmtlist gt is executed repeatedly until lt expression gt is true When expression becomes true advance to the next instruction following UNTIL The lt stmtlist gt is executed at least once even if lt expression gt is true upon entry to the REPEAT loop Example C 87 REPEAT Statement REPEAT UNTIL x 11 EQ 0 loop until zero is found C 4 2 7 WHILE Statement WHILE expression DO lt stmtlist gt ENDW The lt expression gt is tested before execution of lt stmtlist gt While lt expression gt remains true lt stmtlist gt is executed repeatedly When lt expression gt evaluates false advance to the DSP56303EVM User s Manual For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Structured Control Statements instruction f
89. are not allowed Operands must be or refer to single word values The logic generated by the FOR directive makes use of several DSP data registers In fact two data registers are used to hold the step and target values respectively throughout the loop they are never reloaded by the generated code It is recommended that these registers not be used within the body of the loop or that they be saved and restored prior to loop evaluation Note The DO keyword is optional Example C 84 FOR Statement FOR X CNT 0 TO Y targ 2 114 loop on X CNT ENDF C 4 2 4 IF Statement IF expression THEN lt stmtlist gt ELSE lt stmtlist gt ENDI If lt expression gt is true execute lt stmtlist gt following THEN the keyword THEN is optional if lt expression gt is false execute lt stmtlist gt following ELSE if present otherwise advance to the instruction following ENDI Note In the case of nested IF THEN ELSE statements each ELSE refers to the most recent IF THEN sequence Example C 85 IF Statement IF EQ zero bit set ENDI Motorola Assembler Notes C 57 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Structured Control Statements C 4 2 5 LOOP Statement LOOP ent lt stmtlist gt ENDL Execute lt stmtlist gt cnt times This is similar to the FOR loop construct except that the initial counter and step value
90. ata Interrupt The interrupt occurs when the following properties are true The receive interrupt is turned on CRB 18 The transmit data register is empty To service the interrupt the programmer will need to transmit the data The following steps can be performed to accomplish such a task usce visa S E Save necessary context Load Transmit buffer pointer Move Transmit buffer data to transmit register Update Transmit Buffer pointer Restore context Example D 18 illustrates the procedures to service this interrupt Codec Programming Tutorial D 29 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Example Application Example D 18 ESSI Transmit Data Interrupt Service transmit data interrupt service routine ssi tx isr Save Context move move move move nop movep move move move TEL D 11 r0 X x7 mO x r7 1 m0 x TX PTR r0 x r0 x M TXO0O r0 x TX PTR Example Application U Save rO to the stack Save mU to the stack Modulus 2 buffer Load the pointer to the tx buffer delay SSI transfer data register Update tx buffer pointer Restore Context U Restore m0 Restore r0 An example program has been provided to illustrate the use of the codec The following files are included in a package to be distributed with this document Ioequ asm Contains important I O equates Intequ asm
91. athname for the file The pathname must be a legal operating system pathname The P option can be repeated as many times as desired Example dspink Plprojectl testprog Uses IBM PC pathname conventions and causes the linker to prefix any library files not found in the current directory with the project pathname R lt ctlfil gt Indicates that a memory control file is to be read to determine the placement of sections into DSP memory and other linker control functions ctlfil can be any legal operating system filename including an optional pathname If a pathname is not specified an attempt is made to open the file in the current directory If no filename is specified the linker uses the basename filename without extension of the first filename encountered in the link input file list and append ctl to the basename If the R option is not specified then the linker does not use a memory control file The R option is specified only once Example dspink Rproj filter cln gauss cin Links the files filter cln and gauss cln using the memory file proj ctl U lt symbol gt Allows the declaration of an unresolved reference from the command line lt symbol gt must be specified This option is useful for creating an undefined external reference in order to force linking entirely from a library Example dspink Ustart Lproj lib Declares the symbol start undefined so that it is resolved by code within the library proj lib
92. be any legal operating system filename including an optional pathname If no filename is specified the linker uses the basename filename without extension of the first filename encountered in the input file list and append map to the basename If the M option is not specified then the linker does not generate a map file The M option is specified only once If the file named in the M option already exists it is overwritten Example dspink M filter cln gauss cln Links the files filter cln and gauss cln to produce a map file Because no filename is given with the M option the output file is named using the basename of the first input file in this case filter The map file is called filter map For the linker the case of symbol names is significant When the N option is given the linker ignores case in symbol names all symbols are mapped to lower case Example dspink N filter cln fft cIn fio cln Links the files filter cln fft cln and fio cln to produce the absolute executable file filetr cld Maps all symbol references to lower case DSP56303EVM User s Manual For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Linker Options Table 2 2 Linker Options Continued Option Description O lt mem gt lt ctr gt lt map gt lt origin gt By default the linker generates instructions and data for the output file beginning at absolute location
93. bject file C 13 unreported C 2 comment field 2 3 Conditional assembly C 28 C 37 Constant define C 14 C 15 storage C 11 Constants D 9 Control Data Input Pin MF2 CDIN 3 10 Control Register A settings D 13 Control Register B settings D 13 Crystal Semiconductor CS4215 3 7 CS4218 3 7 Cycle count C 37 D D A converter 3 7 Data Pins D 0 23 3 4 3 6 data transfer fields 2 3 Debugger 2 1 2 17 running the 2 19 Debugger software 2 17 Debugger window display 2 18 development process flow 2 1 device D 2 Directive C 10 BREAK C 55 CONTINUE C 56 FOR C 56 JF C 57 LOOP C 58 REPEAT C 58 WHILE C 58 BADDR C 10 BSB C 11 BSC C 11 BSM C 12 BUFFER C 12 COBJ C 13 COMMENT C 14 DC C 14 DCB C 15 DEFINE C 5 C 16 C 37 DS C 17 DSM C 17 DSR C 18 DUP C 18 DUPA C 19 DUPC C 20 DUPF C 21 END C 22 ENDBUF C 23 ENDIF C 23 ENDM C 23 ENDSEC C 24 EQU C 24 EXITM C 25 FAIL C 25 FORCE C 26 GLOBAL C 26 GSET C 26 HIMEM C 27 IDENT C 27 IF C 28 in loop C 37 INCLUDE C 29 LIST C 29 LOCAL C 30 LOMEM C 30 LSTCOL C 31 MACLIB C 31 MACRO C 32 MODE C 33 MSG C 33 NOLIST C 34 OPT C 34 ORG C 42 PAGE C 45 PMACRO C 45 PRCTL C 46 RADIX C 46 RDIRECT C 47 SCSJMP C 47 SCSREG C 48 SECTION C 48 SET C 51 STITLE C 51 SYMOBJ C 51 TABS C 52 TITLE C 52 UNDEF C 52 WARN C 52 XDEF C 53 XREF C 53 Domain Technologies Debugger 1 1 2 17 DSP development tools 2 1 DSP linker 2 12 DSP56002 3 10 DSP56002 Rec
94. bler however accepts formal high level directives that specify these control structures generating the appropriate assembly language instructions for their efficient implementation This use of structured control statement directives improves the readability of assembly language programs without compromising the desirable aspects of programming in an assembly language C 4 1 Structured Control Directives The following directives are used for structured control Note the leading period which distinguishes these keywords from other directives and mnemonics Structured control directives may be specified in either upper or lower case but they must appear in the opcode field of the instruction line 1 e they must be preceded either by a label a space or a tab BREAK ENDI LOOP CONTINUE ENDL REPEAT ELSE ENDW UNTIL ENDF POR WHILE AF In addition the following keywords are used in structured control statements AND DOWNTO TO BY OR DO THEN Note AND DO and OR are reserved assembler instruction mnemonics DSP56303EVM Users Manual For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Structured Control Statements C 4 2 Syntax The formats for the BREAK CONTINUE FOR IF LOOP REPEAT and WHILE statements are given in sections C 4 2 1 through C 4 2 7 Syntactic variables used in the formats are defined as follows e lt expression gt A
95. cate and initialize a block of words for a modulo buffer The number of words in the block is given by the first expression which must evaluate to an absolute integer Each word is assigned the initial value of the second expression If there is no second expression an initial value of zero is assumed If the runtime location counter is not zero this directive first advances the runtime location counter to a base address that is a multiple of 2 where 2 is greater than or equal to the value of the first expression An error will occur if the first expression contains symbols that are not yet defined forward references has a value of less than or equal to zero or falls outside the range 2 expression lt m where m is the maximum address of the target DSP Both expressions may have any memory space attribute label if present is assigned the value of the runtime location counter after a valid base address has been established Only one word of object code is shown on the listing regardless of how large the first expression is However the runtime location counter is advanced by the number of words generated Note See also BSC BSB DC Example C 23 Block Storage Modulo Directive BUFFER BSM BUFSIZ FFFFFFFF INITIALIZE BUFFER TO ALL ONES C 3 5 BUFFER Start Buffer BUFFER lt M R gt lt expression gt The BUFFER directive indicates the start of a buffer of the given type Data is allocated for the buffer until an ENDBU
96. ceded by the backslash respectively DSP56303EVM User s Manual For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Assembler Significant Characters Example C 4 Example of Macro Concatenation Suppose the source input file contained the following macro definition SWAP REG MACRO REG1 REG2 swap REG1 REG2 using D4 L as temp MOVE R REG1 D4 L MOVE R REG2 R REG1 MOVE D4 L R REG2 ENDM The concatenation operator indicates to the macro processor that the substitution characters for the dummy arguments are to be concatenated in both cases with the character R If this macro were called with the statement SWAP REG 0 1 the resulting expansion would be as follows MOVE RO D4 L MOVE RI RO MOVE D4 L R1 C 2 4 Return Value of Symbol Character The lt symbol gt sequence when used in macro definitions is replaced by an ASCII string representing the value of lt symbol gt This operator may be used in association with the backslash operator The value of lt symbol gt must be an integer not floating point Example C 5 Example of Use of Return Value Character Consider the following macro definition SWAP SYM MACRO REG1 REG2 swap REG1 REG2 using D4 L as temp MOVE R REG1 D4 L MOVE R REG2 R REGL MOVE D4 L R REG2 ENDM If the source file contained the following SET statements and macro call AREG SET 0 BREG SET 1 SWAP SYM AREG BREG the resulting expansi
97. ch matches a symbol created with a DEFINE directive is not expanded if the character sequence is contained within a quoted string Assembler strings generally are enclosed in single quotes If the string is enclosed in double quotes then DEFINE symbols are expanded within the string In all other respects usage of double quotes is equivalent to that of single quotes Motorola Assembler Notes C 5 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Assembler Significant Characters Example C 9 Example of a Quoted String DEFINE Expression Consider the source fragment below DEFINE LONG short STR MAC MACRO STRING MSG This is a LONG STRING MSG This is a LONG STRING ENDM If this macro were invoked as follows STR_MAC sentence then the resulting expansion would be as follows MSG This is a LONG STRING MSG This is a short sentence C 2 8 Function Delimiter All assembler built in functions start with the symbol Example C 10 Example of a Function Delimiter Character SVAL EQ SQT FVAL OBTAIN SQUARE ROOT C 2 9 Location Counter Substitution When used as an operand in an expression the asterisk represents the current integer value of the runtime location counter Example C 11 Example of a Location Counter Substitution ORG X 100 XBASE EQU 20 XBASE 120 C 2 10 String Concatenation Operator Any two strings can be concatenate
98. ch surfaces Always use grounded wrist straps when handling sensitive components Do not remove components from antistatic packaging until required for installation Always transport sensitive components in antistatic packaging Locate jumper blocks J1 J4 J5 and J8 as shown in Figure 1 1 For block J1 make sure that there are jumpers connecting pins 3 and 4 and pins 5 and 6 For blocks J4 J5 and J8 make sure that all positions on each block are jumpered These jumpers perform the following functions J1 controls the operating mode of the DSP56303 J4 and J5 control the interface between the audio codec and the DSP56303 enhanced synchronous serial interface ESSIO J8 controls the interface between the DSP56303 JTAG OnCE port and DSP56002 synchronous serial interface SSI Quick Start Guide For More Information On This Product Go to www freescale com 1 3 Freescale Semiconductor Inc Installation Procedure J1 J2 J3 TEST LED MC74HQT04 DSP56002 AT29LVO10A SW1 Sw3 Flash J4 MC34164 DSP56303 310 lt z P6 OUT CH T fr Debug QS3384 So J6 LED Ze LM4880 OnCE MC33269 E M MOTOROLA CS4218
99. comment text can include any printable characters and the comment text is reproduced in the source listing as it appears in the source file Note A label is not allowed with this directive Example C 26 COMMENT Directive COMMENT This is a one line comment COMMENT This is a multiple line comment Any number of lines can be placed between the two delimiters C 3 8 DC Define Constant lt label gt DC lt arg gt lt arg gt lt arg gt The DC directive allocates and initializes a word of memory for each lt arg gt argument lt arg gt may be a numeric constant a single or multiple character string constant a symbol or an expression The DC directive may have one or more arguments separated by commas Multiple arguments are stored in successive address locations If multiple arguments are present one or more of them can be null two adjacent commas in which case the corresponding address location is filled with zeros If the DC directive is used in L memory the arguments are evaluated and stored as long word quantities Otherwise an error occurs if the evaluated argument value is too large to represent in a single DSP word lt label gt if present is assigned the value of the runtime location counter at the start of the directive processing Integer arguments are stored as is floating point numbers are converted to binary values Single and multiple character strings are handled in the following manner e Single
100. conductor Inc Assembler Directives Example C 38 DUPF Directive If input source file contained the following statements DUPF NUM 0 7 MOVE 0 R NUM ENDM then the assembled source listing shows DUPF NUM 0 7 MOVE HO RO MOVE HO R1 MOVE 0 R2 MOVE 0 R3 MOVE 0 R4 MOVE 0 R5 MOVE 0 R6 MOVE 0 R7 ENDM Note that the lines DUPF NUM 0 7 ENDM are only shown on the source listing if the MD option is enabled The lines MOVE HO RO MOVE HO R1 MOVE 0 R2 MOVE 0 R3 MOVE 0 R4 MOVE 0 R5 MOVE 0 R6 MOVE 0 R7 are only shown on the source listing if the MEX option is enabled Note See the OPT directive in this appendix for more information on the MD and MEX options C 3 18 END End of Source Program END lt expression gt The optional END directive indicates that the logical end of the source program has been encountered Any statements following the END directive are ignored The optional expression in the operand field can be used to specify the starting execution address of the DSP56303EVM Users Manual For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Assembler Directives program expression may be absolute or relocatable but must have a memory space attribute of Program or None The END directive cannot be used in a macro expansion Note A label is not allowed with this directive Example C 39 END Directive END BEGIN BEGIN is the starting e
101. d with the string concatenation operator The two strings must each be enclosed by single or double quotes and there must be no intervening blanks between the string concatenation operator and the two strings Example C 12 Example of a String Concatenation Operator ABC DEF ABCDEF DSP56303EVM User s Manual For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Assembler Significant Characters C 2 41 Substring Delimiter lt string gt lt offset gt lt length gt Square brackets delimit a substring operation The lt string gt argument is the source string lt offset gt is the substring starting position within lt string gt lt length gt is the length of the desired substring lt string gt may be any legal string combination including another substring An error is issued if either lt offset gt or lt length gt exceed the length of lt string gt Example C 13 Example of a Substring Delimiter DEFINE ID DSP56000 3 5 ID 56000 C 2 12 lt lt HO Short Addressing Mode Force Operator Many DSP instructions allow an I O short form of addressing If the value of an absolute address is known to the assembler on pass one then the assembler will always pick the shortest form of addressing consistent with the instruction format If the absolute address is not known to the assembler on pass one that is the address is a forward or external reference th
102. e For full details on the Debugger and an informative tutorial consult the Debug 56K Manual The Domain Technologies Debugger is a software development system for the DSP56303 The Domain Technologies Debugger is included with the DSP56303EVM on the Domain Technologies CD ROM and can be installed following the on line instructions If you are running Windows95 or WindowsNT the software installer will be launched automatically when you insert the CD into your drive To invoke the Debugger double click on the icon labelled evm30xw in the EVM5630x program group created when the Debugger was installed The Debugger display is similar to that shown in Figure 2 2 the screen is divided into four windows the command window the data window the unassembly window and the registers window The command window is the window selected which means that key strokes are placed into the command window The data window displays DSP56303 data The unassembly window displays the DSP56303 programs highlighting the next instruction to be executed The registers window shows the contents of the DSP56303 internal registers Example Test Program 2 17 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Introduction to the Debugger Software EVM 563xx COM2 DD File View Run Symbol Breakpoint Config Window Help Unassembly exampleasm ramena T2 memory starting a F98734 800000 jmp begin p 0 is
103. e filename without extension of the first filename encountered in the source input file list and appends the appropriate file type cln or cld to the basename The B option should be specified only once Example asm56300 Bfilter main asm fft asm fio asm This example assembles the files main asm fft asm and fio asm together to produce the relocatable object file filter cln D symbol string Replaces all occurrences of symbol with string in the source files to be assembled Example asm56300 DPOINTS 16 prog asm Replaces all occurrences of the symbol POINTS in the program prog asm by the string 16 EA lt errfil gt or EW lt errfil gt Allows the standard error output file to be reassigned on hosts that do not support error output redirection from the command line lt errfil gt must be present as an argument but can be any legal operating system filename including an optional pathname The EA option causes the standard error stream to be written to lt errfil gt if lt errfil gt exists the output stream is appended to the end of the file The EW option also writes the standard error stream to lt errfil gt if lt errfil gt exists it is overwritten Example asm56300 EWerrors prog asm Redirects the standard output to the file errors If the file already exists it is overwritten F lt argfil gt Indicates that the assembler should read command line input from lt argfil gt whic
104. e Expressions A variety of tests identical to those in the Jcc instruction may be performed based on the CCR condition codes The condition codes in this case are preset by either a user generated instruction or a structured operand comparison expression Each test is expressed in the structured control statement by a mnemonic enclosed in angle brackets When processed by the assembler the expression generates an inverse conditional jump to beyond the matching ENDx UNTIL directive Motorola Assembler Notes C 59 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Structured Control Statements Example C 89 Condition Code Expression IF EQ zero bit set bne Z L00002 code generated by assembler CLR D1 user code ENDI Z L00002 assembler generated label REPEAT subtract until DO D7 Z L00034 assembler generated label SUB D7 DO user code UNTIL lt LT gt bge Z L00034 code generated by assembler C 4 3 3 Operand Comparison Expressions Two operands may be compared in a simple expression with subsequent transfer of control based on that comparison Such a comparison takes the form Opi cc lt op2 gt where cc is a condition mnemonic enclosed in angle brackets as described in section C 4 3 2 and lt op1 gt and lt op2 gt are register or memory references symbols or assembler expressions When processed by the assembler the operands
105. e Program 2 2 3 4 Data Definition Storage Allocation The directives to control constant data definition and storage allocation are as follows BADDR Set buffer address BSB Block storage bit reverse BSC Block storage of constant BSM Block storage modulo BUFFER Start buffer DC Define constant DCB Define constant byte DS Define storage DSM Define modulo storage DSR Define reverse carry storage ENDBUF End buffer 2 2 3 5 Listing Control and Options The directives to control the output listing are as follows LIST List the assembly LSTCOL Set listing field widths NOLIST Stop assembly listing OPT Assembler options PAGE Top of page size page PRCTL Send control string to printer STITLE Initialize program subtitle TABS Set listing tab stops TITLE Initialize program title DSP56303EVM User s Manual For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Assembling the Program 2 2 3 6 Object File Control The directives for control of the object file are as follows COBJ Comment object code IDENT Object code identification record SYMOBJ Write symbol information to object file 2 2 3 7 Macros and Conditional Assembly The directives for macros and conditional assembly are as follows DUP Duplicate sequence of source lines DUPA Duplicate sequence with arguments DUPC Duplicate sequence with characters DUPF Duplicate sequence in loop ENDIF End of conditional assembly ENDM E
106. e causes a warning message to be output by the assembler The total warning count is incremented as with any other warning The WARN directive is DSP56303EVM Users Manual For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Assembler Directives normally used in conjunction with conditional assembly directives for exceptional condition checking The assembly proceeds normally after the warning has been printed An arbitrary number of strings and expressions in any order but separated by commas with no intervening white space can be specified optionally to describe the nature of the generated warning Note A label is not allowed with this directive See also FAIL MSG Example C 79 WARN Directive WARN parameter too large C 3 59 XDEF External Section Symbol Definition XDEF lt symbol gt lt symbol gt lt symbol gt The XDEF directive is used to specify that the list of symbols is defined within the current section and that those definitions should be accessible by sections with a corresponding XREF directive This directive is only valid if used within a program section bounded by the SECTION and ENDSEC directives The XDEF directive must appear before lt symbol gt is defined in the section If the symbols that appear in the operand field are not defined in the section an error is generated Note A label is not allowed with this directive See also SECTION XREF Example C 8
107. e of the Freescale Semiconductor product could create a situation where personal injury or death may occur Should Buyer purchase or use Freescale Semiconductor products for any such unintended or unauthorized application Buyer shall indemnify and hold Freescale Semiconductor and its officers employees subsidiaries affiliates and distributors harmless against all claims costs damages and expenses and reasonable attorney fees arising out of directly or indirectly any claim of personal injury or death associated with such unintended or unauthorized use even if such claim alleges that Freescale Semiconductor was negligent regarding the design or manufacture of the part freescale semiconductor For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Quick Start Guide Example Test Program DSP56303EVM Technical Summary DSP56303EVM Schematics DSP56303EVM Parts List Motorola Assembler Notes Codec Programming Tutorial Index For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Quick Start Guide Example Test Program DSP56303EVM Technical Summary DSP56303EVM Schematics DSP56303EVM Parts List Motorola Assembler Notes Codec Programming Tutorial Index For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Table of Contents Chapter 1 Quick Start Guide bl E
108. e right channel The DSP56303 ESSIO transfers the data information to and from the codec The DSP56303 serial transmit data STDO pin transmits data to the codec The DSP56303 serial receive data SRDO pin receives data from the codec These two pins are connected to the codec serial port data in SDIN and serial port data out SDOUT pins respectively In master sub mode the codec serial port clock SCLK pin provides the serial bit rate clock for the ESSIO interface It is connected to the DSP56303 bidirectional serial clock SCKO pin The DSP56303 serial control 0 SC00 pin is programmed to control the codec reset signal RESET The serial control 2 SC02 pin is connected to the codec serial port sync signal SSYNC signal A rising edge on SSYNC indicates that a new frame is about to start The DSP56303 ESSII pins are used as general purpose i o GPIO signals to transfer the control data to the codec The control data needs to be transferred only when it changes The DSP56303 serial control 0 SC10 pin is programmed to control the codec multi function pin 4 or the control data chip select pin MF4 CCS This pin must be low for entering control data The serial control 1 SC11 pin connects to the codec multi function pin 3 or the control data clock pin MF3 CCLK The control data is inputted on the rising edge of CCLK The serial control 2 SC12 pin is connected to the codec multi function pin 2 or the control data input pin MF2 CDIN T
109. eader 20 pin double row J4 J5 Robinson Nugent NSH 12DB S2 TG Header 12 pin double row J6 Robinson Nugent NHS 14DB S2 TG Header 14 pin double row J7 J9 Robinson Nugent NSH 6SB S2 TG Header 6 pin double row J8 Robinson Nugent NSH 2SB S2 TG Header 2 pin single row C99 C120 C121 Panasonic PCS1106CT 10 uF Capacitor 6 3 V dc C28 C29 C30 C31 C34 Murata GRM42 6Y5V105Z025BL 1 0 uF Capacitor 25 V C124 C126 dc C9 C12 C13 C14 C15 C17 Murata GRM40 X7R104K025BL 0 1 uF Capacitor C18 C35 C37 C50 C51 C52 C53 C54 C61 C62 C64 C79 C80 C96 C101 C104 C105 C106 C110 C122 C123 C125 C16 C40 C55 C56 C57 Murata GRM40 X7R103KO050BL 0 01 uF Capacitor C58 C60 C65 C67 C68 C102 C103 C107 C108 C109 DSP56303EVM User s Manual For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Parts Listing Table B 1 DSP56303EVM Parts List Continued Designator Manufacturer Part Number Description C10 Panasonic PCS1475CT 4 7 uF Capacitor 6 3 V dc C2 C3 C4 C23 C24 C39 Murata GRM42 6Y5V334Z025BL 0 33 uF Capacitor C21 C22 C25 Murata GRM42 6Y5V474Z025BL 0 47 uF Capacitor C38 Murata GRM42 6Y5V684Z025BL 0 68 uF Capacitor C19 C20 Xicon 140 CC501N331J 330 pF Capacitor C26 C27 Murata GRM40 COG222J050BL 2200 pF Capacitor C63 Murata GRM40 X7R821KO50BL 820 pF Capacitor C5 C6 C7 C8 AVX TPSV476 025R0300 47 uF Capacitor 10 V dc C32 C33 Panas
110. eates a 5 V 12 288 MHz signal The QS3384 at U5 then converts the 5 V signal to 3 3 V for input to the codec CLKIN pin and the DSP56303 EXTAL pin Refer to the CS4218 data sheet included with this kit for more information The CS4218 is very flexible offering selectable sampling frequencies between 8 kHz and 48 kHz The sampling frequency is selected using jumpers on jumper block J9 Table 3 1 shows jumper positions that select the possible sampling frequencies for the DSP56303EVM Table 3 1 CS4218 Sampling Frequency Selection J9 Pins 1 2 J9 Pins 3 4 J9 Pins 5 6 Sampling Frequency MF6 MF7 MF8 kHz Jumper Jumper Jumper 48 0 Jumper Jumper Open 32 0 Jumper Open Jumper 24 0 Jumper Open Open 19 2 Open Jumper Jumper 16 0 Open Jumper Open 12 0 Open Open Jumper 9 6 Open Open Open 8 The codec is connected to the DSP56303 ESSIO through the shorting jumpers on J4 and J5 shown in Figure 3 1 on page 3 2 Jumper block J4 connects the ESSII pins of the DSP56303EVM Technical Summary 3 7 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Audio Codec DSP56303 to the control pins of the CS4218 Jumper block J5 connects the ESSIO pins of the DSP56303 to the data pins of the CS4218 By removing these jumpers the user has full access to the ESSIO and ESSII pins of the DSP56303 The following sections describe the connections for the analog and digital s
111. ections of the codec 3 4 1 Codec Analog Input Output The DSP56303EVM contains 1 8 inch stereo jacks for stereo input output and headphones Figure 3 7 shows the analog circuitry of the codec CS4218 Headphones Sie RIN2 P5 Input P4 LIN2 LM4880 T X 1RIN1 nuse X LINI LOUT S utput ROUT PS AA1933 Figure 3 7 Codec Analog Input Output Diagram The stereo jack labelled P4 IN on the DSP56303EVM connects to the codec right and left input pins RIN2 and LIN2 Standard line level inputs are 2 Vpp and the codec requires that input levels be limited to 1 Vpp Thus a voltage divider forms a 6 dB attenuator between P4 and the CS4218 The codec right and left channel output pins ROUT and LOUT provide their output analog signals through the stereo jack labelled P6 OUT on the DSP56303EVM The outputs of the codec are also connected to the stereo jack labelled P5 HDPHNE on the DSP56303EVM through National Semiconductor s LM4880 dual audio power amplifier at U8 The headphone stereo jack permits direct connection of stereo headphones to the DSP56303EVM 3 4 2 Codec Digital Interface Figure 3 8 shows the digital interface to the codec Table 3 2 and Table 3 3 show the jumper selections to Enable Disable the code s digital signals DSP56303EVM User s Manual For More Information On This Product Go to www freescale com Freescale Semiconductor Inc
112. ed This warning can be avoided with the RDIRECT directive The definition of a macro consists of three parts the header which assigns a name to the macro and defines the dummy arguments the body which consists of prototype or skeleton source statements and the terminator The header is the MACRO directive its label and the dummy argument list The body contains the pattern of standard source statements The terminator is the ENDM directive The dummy arguments are symbolic names that the macro processor replaces with arguments when the macro is expanded called Each dummy argument must obey the same rules as symbol names Dummy argument names that are preceded by an underscore are not allowed Within each of the three dummy argument fields the dummy arguments are separated by commas The dummy argument fields are separated by one or more blanks DSP56303EVM User s Manual For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Assembler Directives Macro definitions may be nested but the nested macro is not defined until the primary macro is expanded Note See also DUP DUPA DUPC DUPF ENDM Example C 59 MACRO Directive SWAP SYM MACRO REG1 REG2 swap REG1 REG2 using XO as temp MOVE R REG1 X0 MOVE RM REG2 RM REGI MOVE X0 RV REG2 ENDM C 3 39 MODE Change Relocation Mode MODE ABS OLUTE REL ATIVE gt The MODE directive causes the assembler to change to the designated
113. edet oe oos e IO eebe C 46 C 68 RADIX Directive LIE T Aa ois d b ba uad d uet C 47 C 69 RDIREC E DIIGOU VO ri us S Dips CES A CE e costo dde a LASS C 47 C 70 SCSIMI EE C 48 C 71 SCSREG Directive ccn o vod Seo e T A S tn d ERR ANS C 48 C 72 SECTION Direc lt ar Z pri reed Y ios do OO PS C 51 C 73 SET DITCCBVE 24 eie ee ooo Re utut ic el Tar dns C 51 C 74 STEDEE Directives v a eee So Marat and Mend Meare bo Meh hie eM BU ire e ot AG C 51 C 75 SXIVIOBI SN EA IA E UD oA ag dores C 52 C 76 TABSJDIIGOHVE is EE dta C 52 C 77 TITLE Directv s oaeo a ADDED eae s C 52 C 78 UNDER Directive hv ein ort chro Y Cw ack writ ee eie are tede C 52 C 79 WARN Directives ees acto entr oc aiios e em e I dde A RETE Semel nce AE C 53 C 80 XDEE DITGCUNGO odo v eI ese RE ees Re rie xd C 53 C 81 AREE Te oae See etos E S etos need ad odas C 54 C 82 BREAR E EE C 56 C 83 CONTINUE Statement isos e SR EE C 56 C 84 FOR Statement S y de oem or pei tt ent ep b naL penc ties dns C 57 C 85 Statement pe S a p e noeh a i Vets ecu dope C 57 C 86 LOOP Statement AAA Oak ake eid Kare Mak Gite C 58 C 87 REPEAT SOIEIEDE Seca sik Seok ae sa iso d sate Canty aa ere Seed C 58 C 88 WHILE Statements Yacht ch ak edhe oh ach sh COE E DU Bhs C 59 C 89 Condition Code Expression esr RENE NEE EEN wA NR NN C 60 D 1 Setting Up Transmit and Receive Buffers and Pointers D 9 D 2 Setting Codec Control Information D 11 List of Examples xix For More Information On This Product
114. ediate C 9 long C 8 long immediate C 9 short C 7 short immediate C 9 Analog Input Output 3 8 Assembler 2 12 mode C 33 option C 34 warning C 41 assembler 2 1 control 2 9 data definition storage allocation 2 9 directives 2 8 INDEX listing control and options 2 10 macros and conditional assembly 2 11 object file control 2 10 options 2 6 significant characters 2 8 structured programming 2 11 symbol definition 2 9 assembler control 2 9 assembler directives 2 8 assembler options 2 6 assembling the example program 2 12 assembling the program 2 5 assembly programming 2 1 AT29LV010A 3 6 audio 3 7 audio codec 3 1 3 7 audio interface cable 1 2 audio source 1 2 Buffer address C 10 end C 23 buffer space and pointers D 9 C Checksum C 37 Codec 3 7 3 8 3 10 D 2 D 20 Control Data Chip Select Pin MF4 CCS 3 10 Control Data Clock Pin MF3 CCLK 3 10 Control Information MSB D 10 control parameters D 10 digital interface 3 8 digital interface connections 3 9 initializing and interfacing D 12 Left Input 2 Pin LIN2 3 8 Master Clock Pin CLKIN 3 7 modes of serial operation 3 9 ports initialization D 19 programming D 1 Programming the CS4218 D 8 Reset Pin RESET 3 10 Serial Sync Signal Pin SSYNC 3 10 command converter 3 1 3 10 command format assembler 2 5 Index Index xxxvii For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Comment C 14 delimiter C 1 o
115. eescale Semiconductor Inc Phase II Initializing and Interfacing the ESSI and CODEC Ports TE2 Transmit register 2 14 0 disabled MOD Mode 13 1 Network Mode SYN Synchronization mode 12 1 Synchronous mode CKP Clock polarity 11 O Data and frame sync clocked on rising edge FSP Frame Sync Polarity 10 O positive polarity FSR Frame Synch Relative 9 1 Frame synch begins Timing one bit before first bit of data word FSL Frame Sync Length 8 7 10 Rx bit length TX bit length SHFD Shift direction 6 O shift MSB first SCKD Clock source direction 5 0 SCK is input clock SCD2 SC2 pin direction 4 0 SC2 is input SCD1 SC1 pin direction 3 1 SC1 is output SCDO SCO pin direction 2 1 SCO is output OF 1 0 Output flags 1 0 N A Notice that only the ESSIO control parameters are configured Since ESSI functions in the GPIO mode the control parameters do not need to be set Example D 4 illustrates the task of setting the control registers for the ESSIO port according to the specifications given in Table D 9 and Table D 10 DSP56303EVM User s Manual For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Phase II Initializing and Interfacing the ESSI and CODEC Ports Example D 4 Setting Control Registers for the ESSIO Port Setting ESSIO Control Parameters Control Register A movep 4 101807 x M CRAO 12 288MHz 16 768KHz SCLK
116. eger greater than zero and cannot contain any forward references symbols that have not yet been defined If a modulo buffer is specified the expression must fall within the range 2 expression lt m where m is the maximum address of the target DSP If a Reverse carry buffer is designated and expression is not a power of two a warning is issued Note A label is not allowed with this directive See also BADDR BSM BSB DSM DSR ENDBUF Example C 24 Buffer Directive ORG X 100 BUFFER M 24 CIRCULAR BUFFER MOD 24 M BUF DC D 5 02050 B O DS 20 REMAINDER UNINITIALIZED ENDBUF C 3 6 COBJ Comment Object File COBJ lt string gt The COBJ directive is used to place a comment in the object code file The lt string gt is put in the object file as a comment Note A label is not allowed with this directive See also IDENT Example C 25 COBM Directive COBJ Start of filter coefficients Motorola Assembler Notes C 13 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Assembler Directives C 3 7 COMMENT Start Comment Lines COMMENT lt delimiter gt lt delimiter gt The COMMENT directive is used to define one or more lines as comments The first non blank character after the COMMENT directive is the comment delimiter The two delimiters are used to define the comment text The line containing the second comment delimiter is considered the last line of the comment The
117. eginning of the section At link time sections can be relocated to an absolute address loaded in a particular order or linked contiguously as specified by the programmer Sections which are split into parts or among files are logically recombined so that each section can be relocated as a unit Sections may be relocatable or absolute In the assembler absolute mode command line A option all sections are considered absolute A full set of locations counters is reserved for each absolute section unless the GS option is given See the OPT directive In relative mode all sections are initially relocatable However a section or a part of a section may be made absolute either implicitly by using the ORG directive or explicitly through use of the MODE directive Note A label is not allowed with this directive See also MODE ORG GLOBAL LOCAL XDEF XREF DSP56303EVM User s Manual For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Assembler Directives Example C 72 SECTION Directive SECTION TABLES TABLES will be the section name C 3 52 SET Set Symbol to a Value labels SET expression SET labels expression The SET directive is used to assign the value of the expression in the operand field to the label The SET directive functions somewhat like the EQU directive However labels defined via the SET directive can have their values redefined in another part of the program
118. eive Data Pin RXD 3 11 DSP56002 Transmit Data Pin TXD 3 11 DSP56300 Family Manual 3 1 DSP56303 2 1 Chip Errata 3 2 Product Specification 1 1 Product Specification Revision 1 02 3 1 DSP56303EVM Users Manual For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Technical Data 1 1 3 1 User s Manual 3 1 DSP563093 Features 3 1 DSP56303EVM additional requirements 1 2 Component Layout 3 2 connecting to the PC 1 4 contents 1 1 description 3 1 features 3 1 Flash PEROM 3 2 functional block diagram 3 3 installation procedure 1 2 interconnection diagram 1 4 memory 3 2 power connection 1 4 Product Information 1 1 SRAM 3 2 User s Manual 1 1 E Echo Code D 31 Echo Program D 31 Enhanced Synchronous Serial Port 0 ESSIO 3 13 Enhanced Synchronous Serial Port 1 ESSI1 3 14 ESSI Pin Definition D 4 ESSI Port Registers D 4 ESSI Ports Background D 3 ESSI ports enabling interrupts D 23 ESSI Registers D 5 ESSI initializing and interfacing D 12 ESSI receive data interrupt D 25 ESSI Codec Pin Setup D 8 ESSI GPIO pins D 4 ESSIO 3 7 ESSII 3 7 example assembling the 2 12 example program 2 3 Expansion Bus Control 3 15 Expression address C 37 compound C 61 condition code C 59 formatting C 61 operand comparison C 60 radix C 46 simple C 59 External Access Type Bits BAT 1 0 3 5 F field comment 2 3 data transfer 2 3 label 2 2 operand 2 3 operation 2 2
119. embler comments on the same logical line C 4 2 1 BREAK Statement BREAK The BREAK statement causes an immediate exit from the innermost enclosing loop construct WHILE REPEAT FOR LOOP A BREAK statement does not exit an IF THEN ELSE construct If a BREAK is encountered with no loop statement active a warning is issued Note BREAK should be used with care near ENDL directives or near the end of DO loops It generates a jump instruction which is illegal in those contexts Motorola Assembler Notes C 55 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Structured Control Statements Example C 82 BREAK Statement WHILE x rl GT 0 loop until zero is found IF cg BREAK causes exit from WHILE loop ENDI any instructions here are skipped ENDW execution resumes here after BREAK C 4 2 2 CONTINUE Statement CONTINUE The CONTINUE statement causes the next iteration of a looping construct WHILE REPEAT FORT LOOP to begin This means that the loop expression or operand comparison is performed immediately bypassing any subsequent instructions If a CONTINUE is encountered with no loop statement active a warning is issued Note CONTINUE should be used with care near ENDL directives or near the end of DO loops It generates a jump instruction which is illegal in those contexts One or more CONTINUE directives inside a LOOP c
120. en the assembler picks the long form of addressing by default If this is not desired then the I O short form of addressing can be forced by preceding the absolute address by the I O short addressing mode force operator lt lt Example C 14 Example of an I O Short Addressing Mode Force Operator Since the symbol IOPORT is a forward reference in the following sequence of source lines the assembler would pick the long absolute form of addressing by default BTST 4 Y IOPORT IOPORT EQU Y SFFF3 Because the long absolute addressing mode would cause the instruction to be two words long instead of one word for the I O short absolute addressing mode it would be desirable to force the I O short absolute addressing mode as shown below BTST H4 Y lt lt IOPORT IOPORT EQU Y SFFF3 C 2 13 lt Short Addressing Mode Force Operator Many DSP instructions allow a short form of addressing If the value of an absolute address is known to the assembler on pass one or the FORCE SHORT directive is active then the assembler will always pick the shortest form of addressing consistent with the instruction format If the absolute address is not known to the assembler on pass one that is the address is a forward or external reference then the assembler picks the long form of addressing by default If this is not desired then the short absolute form of addressing Motorola Assembler Notes C 7 For More Information On This Product Go to www f
121. ery SECTION directive must be terminated by an ENDSEC directive Note A label is not allowed with this directive See also SECTION Example C 43 ENDSEC Directive SECTION COEFF ORG Ke VALUES BSC 100 Initialize to zero ENDSEC C 3 23 EQU Equate Symbol to a Value label EQU X Y 1 P E lt expression gt The EQU directive assigns the value and memory space attribute of expression to the symbol label If expression has a memory space attribute of None then it can optionally be preceded by any of the indicated memory space qualifiers to force a memory space attribute An error will occur if the expression has a memory space attribute other than None and it is different than the forcing memory space attribute The optional forcing memory space attribute is useful to assign a memory space attribute to an expression that consists only of constants but is intended to refer to a fixed address in a memory space The EQU directive is one of the directives that assigns a value other than the program counter to the label The label cannot be redefined any where else in the program or section if SECTION directives are being used The expression may be relative or absolute but cannot include a symbol that is not yet defined no forward references are allowed Note See also SET DSP56303EVM User s Manual For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Assemb
122. es IF CVI SQT 4 0 GT 2 no white space in first operand C 4 3 7 FOR LOOP Formatting The FOR and LOOP directives represent special cases The FOR structured control statement consists of several fields POR lt opl gt lt op2 gt TO op3 BY lt op4 gt DO TELE There must be white space between all operands and other syntactic entities such as TO BY and DO As with expression formatting an assembler expression used as an operand must not have white space in it FOR X CNT 0 TO Y targ 2 1 BY CVI POW 2 0 CVF R In the example above the FOR loop operands represented as assembler expressions symbol function do not have embedded white space whereas the loop operands are always separated from structured control statement keywords by white space The count field of a LOOP statement must be separated from the LOOP directive by white space The count itself may be any arbitrary assembler expression and therefore must not contain embedded blanks C 4 4 Assembly Listing Format Structured control statements begin with the directive in the opcode field any optional label is output in the label field The rest of the statement is left as is in the operand field except for any trailing comment the X and Y data movement fields are ignored Comments following the statement are output in the comment field unless the unreported comment delimiter is used Statements are expa
123. essing by the linker No absolute addresses are assigned and no errors are issued for unresolved external references Note that the B option must be used when performing incremental linking in order to give an explicit name to the output file If the filename is allowed to default it can overwrite an input file Example dspink I Bfilter cin main cin fft cln fio cln Combines the files main cln fft cln and fio cln to produce the relocatable object file filter cln L lt library gt The linker ordinarily processes a list of input files that each contain a single relocatable code module Upon encountering the L option the linker treats the following argument as a library file and searches the file for any outstanding unresolved references If it finds a module in the library that resolves an outstanding external reference it reads the module from the library and includes it in the object file output The linker continues to search a library until all external references are resolved or no more references can be satisfied within the current library The linker searches a library only once so the position of the L option on the command line is significant Example dspink B filter main fir Lio Illustrates linking with a library The files main cln and fir cln are combined with any needed modules in the library io lib to create the file filter cld M lt mapfil gt Indicates that a map file is to be created lt mapfil gt can
124. external access type the memory type and which external memory addresses access the FSRAM Figure 3 4 shows the memory map that is attained with the AARO settings described in this example Note In this example the memory switch bit in the operating mode register OMR is cleared and the 16 bit compatibility bit in the status register is cleared In Figure 3 4 the FSRAM responds to the 64K of X and Y data memory addresses between 040000 and 04FFFF However with the unified memory map accesses to the same external memory location are treated as accesses to the same memory cell A priority mechanism exists among the four AAR control registers AAR3 has the highest priority and AARO had the lowest Bit 14 of the OMR the address priority disable APD bit controls which AA pins are asserted when a selection conflict occurs i e the external address matches the address and the space that is specified in more than one AAR If the APD bit is cleared when a selection conflict occurs only the highest priority AA pin is asserted If the APD bit is set when a selection conflict occurs the lower priority AA pins are asserted in addition to the higher priority AA pin For this example only one AA pin must be asserted AAO Thus the APD bit can be cleared DSP56303EVM User s Manual For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Memory Memory Map MS 0 SC 0 Program X Data Y Data
125. fer nop Delay movep x M_RX0O x r0 Move received data to receive buffer move r0 x RX_ PTR Update rx buffer pointer Restore Context move x r7 mO Restore m0 move x r7 r0 Restore ro FET D 10 4 ESSI Receive Last Slot Interrupt The interrupt occurs when the following properties are true e The receive last slot interrupt is turned on CRB 21 s The last time slot ends The use of the receive last slot interrupt guarantees that the previous frame has been serviced and the next frame is ready to be serviced The interrupt allows the programmer to redefine pointers to the buffer to be reset so that a new frame can be serviced DSP56303EVM User s Manual For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Phase III Data Transferring Mechanism To perform the procedure of preparing for the next frame the following steps can be used 1 Save Context 2 Reset receive buffer 3 Restore context Example D 15 demonstrates the steps required servicing this interrupt Example D 15 ESSI Receive Last Slot Interrupt Service receive last slot interrupt service routine ssi rxls isr Save context move rO x r7 Save r0 to the stack move H4RX BUFF BASE ro Reset rx buffer pointer just in case it was corrupted move rO x RX PTR Update rx buffer pointer move x r7 r0 Restore r0 rti D 10 5 ESSI Transmit Data with Exception Status Interrupt The in
126. for Control Register A Bit Name Description Bit Position Value Binary Reserved Reserved 23 0 SSC1 SC1 pin serial I O flag 22 O SC1 flag set WL 2 0 Word Length control 21 19 010 16 bit control word ALC Alignment Control 18 0 Align to bit 23 Reserved Reserved 17 0 DC 4 0 Frame Rate Divider 16 12 00001 2 time slots per Control frame PSR Prescaler Range 11 1 ESSI clock is divided by one Reserved Reserved 10 8 000 PM 7 0 Prescale Modulus Select 7 0 00000111 ESSI clock divided by 8 Besides setting the CRAO register the CRBO register must also be set to allow certain parameters to be met Table D 10 lists the typical settings that are required for Control Register B in order to ensure functionality between the ESSI ports and the codec Table D 10 Settings Control Register B Bit Name Description Bit Position Value Binary REIE Receive exception 23 1 enabled interrupt TEIE Transmit exception 22 1 enabled interrupt RLIE Receive last slot 21 1 enabled interrupt TLIE Transmit last slot 20 1 enabled interrupt RIE Receive interrupt 19 1 enabled TIE Transmit interrupt 18 1 enabled RE Receive register 17 1 enabled TEO Transmit register O 16 1 enabled TE1 Transmit register 1 15 O disabled Codec Programming Tutorial For More Information On This Product Go to www freescale com D 13 Fr
127. h can be any legal operation system filename including an optional pathname lt argfil gt is a text file containing further options arguments and filenames to be passed to the assembler The arguments in the file need to be separated only by white space A semicolon on a line following white space makes the rest of the line a comment Example asm56300 Fopts cmd Invokes the assembler and takes the command line options and source filenames from the command file opts cmd DSP56303EVM User s Manual For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Assembling the Program Table 2 1 Assembler Options Continued Option Description Sends the source file line number information to the object file This option is valid only in conjunction with the B command line option Debuggers can use the generated line number information to provide source level debugging Example asm56300 B Gmyprog asm Assembles the file myprog asm and sends the source file line number information to the resulting object file myprog cln I lt pathname gt Causes the assembler to look in the directory defined by pathname for any include file not found in the current directory lt pathname gt can be any legal operating system pathname Example asm56300 Mprojectl testprog Uses IBM PC pathname conventions and causes the assembler to prefix any include files not found in the cu
128. hich the pin operates ESSI or GPIO port control registers C and D need to be modified As mentioned in Section D 5 1 ESSI GPIO Shared Registers port control C register controls the ESSIO mode settings and Port Control D controls the ESSI1 mode settings Codec Programming Tutorial D 15 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Phase II Initializing and Interfacing the ESSI and CODEC Ports The following pins are used as GPIO pins Again these pins control the transfer of codec control information e SCO0 CODEC RESET pin SCIO CCS pin s SCII CCLK pin e SCI2 CDIN pin The pins listed above correspond to specific bits on the port data registers For instance the CODEC RESET pin on the codec is connected to the SC00 pin on ESSIO This pin corresponds to bit O on port data register C Please refer to Table D 11 and Table D 12 for details concerning the correspondence between physical pins and port data registers Table D 11 Port Data Register C Pin bit Correspondence Bit Name ESSIO Bit Name Codec Bit Position Register C Functionality Mode Reserve for future use N A 6 23 N A STD SDIN 5 ESSI SRD SDOUT 4 ESSI SCK SCLK 3 ESSI SC02 FSYNC 2 ESSI SCO N A 1 N A SCO0 CODEC RESET 0 GPIO Table D 12 Port Data Register D Pin bit Correspondence Bit Name ESSI1 Bit Name Codec Bit Position Register
129. his option is valid only with the A and B options Note Multiple options can be used A typical string might be as follows Example asm56300 A B L G filename asm Example Test Program 2 7 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Assembling the Program 2 2 3 Assembler Directives In addition to the DSP56303 instruction set the assembly programs can contain mnemonic directives that specify auxiliary actions to be performed by the assembler These are the assembler directives These directives are not always translated into machine language The following sections briefly describe the various types of assembler directives 2 2 8 1 Assembler Significant Characters The following one and two character sequences are significant to the assembler Comment delimiter Unreported comment delimiter V Line continuation character or macro dummy argument concatenation operator Macro value substitution operator Macro hex value substitution operator Macro local label override operator Macro string delimiter or quoted string DEFINE expansion character Function delimiter Location counter substitution String concatenation operator Substring delimiter lt lt I O short addressing mode force operator lt Short addressing mode force operator gt Long addressing mode force operator Immediate addressing mode operator lt Immediate short address
130. his pin contains the control data for the codec 3 5 Command Converter The DSP56303EVM uses Motorola s DSP56002 to perform JTAG OnCE command conversion The DSP56002 serial communications interface SCI communicates with the host PC through an RS 232 connector The DSP56002 SCI receives commands from the host PC The set of commands may include read data write data reset OnCE module reset DSP56303 the HA2 pin of the DSP56002 is then used to reset the DSP56303 request OnCE module or release OnCE module The DSP56002 command converter software interprets the commands received from the PC and sends a sequence of instructions to the DSP56303 s JTAG OnCE port The DSP56303 may then continue to receive data or it may transmit data back to the DSP56002 The DSP56002 sends a reply to the host PC to give status information The set of replies may include acknowledge good acknowledge bad in debug mode out of debug mode or data read When the DSP56303 is in the debug state the red debug LED LED2 is illuminated DSP56303EVM User s Manual For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Command Converter The DSP56002 connects to the DSP56303 JTAG OnCE port through the shorting jumper on J8 Table 3 4 shows the JTAG enable disable options The jumper must be present in J8 to use the DSP56002 as the command converter Refer to Figure 3 1 on page 3 2 for the location of J8 on
131. ial D 35 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Example Application echo loop jset 43 x M SSISRO jclr 43 x M SSISRO clr a clr b move X RX BUFF BASE a move x RX_ BUFF BASE 1 b asr a x r4 x0 asr b y r4 y0 add x0 a add y0 b asr a asr b move a x r4 move b y r4 move a x TX_ BUFF BASE move b x TX BUFF BASE 1 jmp echo loop include ada init asm echo end M So So an So So eo ee wait for rx frame sync wait for rx frame sync receive left receive right divide them by 2 and get oldest samples from buffer add the new samples and the old reduce magnitude of new data to ensure stability save the altered samples and bump the pointer transmit left transmit right used to include codec initialization routines DSP56303EVM User s Manual For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Symbols C 5 C 9 lt C 9 gt C 9 C 4 C 6 C 6 C 7 C 1 y C 2 C 7 lt lt C 7 gt C 8 C 3 C 6 C 2 A C 4 A A D converter 3 7 AARO programming 3 4 Address Attribute Pin Polarity Bit BAAP 3 5 Address Attribute Pin AAO 3 4 Address Attribute Pin AA1 3 6 Address Attribute Register AARO 3 4 Address Muxing Bit BAM 3 5 Address Pins A 0 17 3 4 3 6 Address Priority Disable Bit APD 3 4 Address to Compare Bits BAC 11 0 3 6 Addressing I O short C 7 imm
132. in the current local label scope when a structured control statement label is encountered default reset Do not print the lines excluded from the assembly due to a conditional assembly directive default reset Do not flag unresolved external references Do not print warning messages default reset Allow scoping of symbols within nested sections default reset Pretty print listing file The assembler attempts to align fields at a consistent column position without regard to source file formatting default reset Pack strings in DC directive Individual bytes in strings are packed into consecutive target words for the length of the string Space comments relatively in listing fields By default the assembler always places comments at a consistent column position in the listing file This option allows the comment field to float on a line containing only a label and opcode the comment begins in the operand field Generate NOP instructions to accommodate pipeline delay If an address register is loaded in one instruction then the contents of the register is not available for use as a pointer until after the next instruction Ordinarily when the assembler detects this condition it issues an error message The RP option will cause the assembler to output a NOP instruction into the output stream instead of issuing an error Print symbol table at the end of the source listing This option has no effect if the CRE option is used
133. ing Note See also DUPA DUPC DUPF ENDM MACRO DSP56303EVM User s Manual For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Assembler Directives Example C 35 DUP Directive The sequence of source input statements COUNT SET 3 DUP COUNT ASR BY COUNT ASR DO ENDM would generate the following in the source listing COUNT SET 3 DUP COUNT ASR BY COUNT ASR DO ASR DO ASR DO ENDM Note that the lines DUP COUNT ASR BY COUNT ENDM will only be shown on the source listing if the MD option is enabled The lines ASR DO ASR DO ASR DO will only be shown on the source listing if the MEX option is enabled Note See the OPT directive in this appendix for more information on the MD and MEX options C 3 15 DUPA Duplicate Sequence With Arguments lt label gt DUPA dummy arg arg arg ENDM The block of source statements defined by the DUPA and ENDM directives are repeated for each argument For each repetition every occurrence of the dummy parameter within the block is replaced with each succeeding argument string If the argument string is a null then the block is repeated with each occurrence of the dummy parameter removed If an argument includes an embedded blank or other assembler significant character it must be enclosed with single quotes label if present is assigned the value of the runtime location counter at the start of the D
134. ing external memory 64K x 24 bit fast static RAM FSRAM for expansion memory e 128K x 8 bit flash memory for stand alone operation Refer to Figure 3 1 for the location of the FSRAM and Flash on the DSP56303EVM Figure 3 2 shows a functional block diagram of the DSP56303EVM including the memory devices MC74HCTO4 P1 DSP56002 SW2 J1 SW3 AT29LV010A Flas J10 MAX212 Debug LED O JTAG OnCE MC33269 P2 3 3v 5v 2 5v QS3384 Power LED GS71024T FSRAM M MOTOROLA DSP56303 LM4880 CS4218 J4 Test LED O SWT MC34164 J9 P5 HDPHNE P6 OUT Figure 3 1 DSP56303EVM Component Layout AA1928 For More Information On This Product DSP56303EVM User s Manual Go to www freescale com Freescale Semiconductor Inc DSP56002 SCLK EXTAL Figure 3 2 DSP56303EVM Functional Block Diagram 3 3 1 FSRAM Data CS4218 Control Memory AA1924 The DSP56303EVM uses one bank of 64K x 24 bit fast static RAM GS71024T 10 labelled U4 for memory expansion The GS71024T 10 uses a single 3 3 V power supply and has an access time of 10 ns The following sections detail the operation
135. ing mode force operator gt Immediate long addressing mode force operator DSP56303EVM User s Manual For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Assembling the Program 2 2 3 2 Assembly Control The directives used for assembly control are as follows COMMENT Start comment lines DEFINE Define substitution string END End of source program FAIL Programmer generated error message FORCE Set operand forcing mode HIMEM Set high memory bounds INCLUDE Include secondary file LOMEM Set low memory bounds MODE Change relocation mode MSG Programmer generated message ORG Initialize memory space and location counters RADIX Change input radix for constants RDIRECT Remove directive or mnemonic from table SCSJMP Set structured control branching mode SCSREG Reassign structured control statement registers UNDEF Undefine DEFINE symbol WARN Programmer generated warning 2 2 8 8 Symbol Definition The directives used to control symbol definition are as follows ENDSEC End section EQU Equate symbol to a value GLOBAL Global section symbol declaration GSET Set global symbol to a value LOCAL Local section symbol declaration SECTION Start section SET Set symbol to a value XDEF External section symbol definition XREF External section symbol reference Example Test Program 2 9 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Assembling th
136. ins D 20 NODXL C 39 power supply external 1 2 1 4 NOFC C 39 program NOFF C 39 assembling the 2 5 NOFM C 39 example 2 3 NOGS C 39 writing the 2 2 NOHDR C 39 Program counter C 6 C 42 NOINTR C 39 programming NOMC C 39 AARO 3 4 NOMD C 39 assembly 2 1 NOMEX C 39 development 2 1 NOMI C 39 example 2 1 NOMSW C 39 NONL C 39 Q NONS C 40 NOPP C 40 Quick Start Guide 1 1 NOPS C 40 R NORC C 40 IEEE Read Enable Pin RD 3 4 3 6 NOSCL C 40 E SE Register C data direction D 18 NOU C 40 See Register D data direction D 18 NOUR C 40 Reset DSP56002 3 11 NOW C 40 NS C 36 C40 Reset DSP56303 3 7 3 x Right Channel Output Pin ROUT 3 8 PP C 35 C 40 Right Input 2 Pin RIN2 3 8 PS C 36 C 40 RS 232 cable connection 1 4 PSM C 36 RC C 35 C 40 RS 232 interface 3 10 dE C 35 RS 232 interface cable 1 2 UT RS 232 serial interface 3 10 RECO C0 running the Debugger program 2 19 RSV C 36 S ee S C 35 C 40 S SCL C 36 C 41 SCO C 36 C 41 Sampling frequency 3 7 SI C 36 SCI DSP56002 3 10 SO C 36 C 41 Section C 48 SVO C 36 end C 24 symbol C 36 global C 26 C 38 C 49 U C35 C41 local C 30 C 49 UR C 35 C41 nested C 40 W C 35 C 41 static C 38 C 49 WEX C41 Serial Clock Pin SCKO 3 10 XLL C 36 C 41 Serial Communication Interface Port SCI 3 12 XR C 36 C 41 Serial Control Pin 0 SCOO 3 10 Serial Control Pin 0 SC10 3 10 Serial Control Pin 1 SCO1 3 10 P Space Enable Bit BPEN 3 6 Serial Control Pin 1 SC11 3 10 Index Index xli
137. ion of interest In the example set a breakpoint to verify that the values in rO and r4 are correct before the do loop type break p 106 in the command window The line before the loop brightens in the unassembly window indicating the breakpoint has been set To point the DSP56303 back to the start point of the program type change pc 0 This changes the program counter so that it points to the reset vector To run the program type go or click on the go button The DSP56303 stops when it reaches the breakpoint and you can step through the remainder of the code To exit the Debugger type quit at the command prompt Example Test Program 2 19 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Running the Program DSP56303EVM User s Manual For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Chapter 3 DSP56303EVM Technical Summary 3 1 DSP56303EVM Description and Features An overview description of the DSP56303EVM is provided in the DSP56303EVM Product Brief DSP56303EVMP D included with this kit The main features of the DSP56303EVM include the following 3 2 DSP56303 24 bit digital signal processor FSRAM for expansion memory and Flash PEROM for stand alone operation 16 bit CD quality audio codec Command converter circuitry DSP56303 Description A full description of the DSP56303 including functionality and user information i
138. ionally if a macro is defined through the MACLIB directive with the same name as an existing directive or opcode it will not automatically replace that directive or opcode as previously described In this case the RDIRECT directive must be used to force the replacement Since the effect of this directive is global it cannot be used in an explicitly defined section See SECTION directive An error results if the RDIRECT directive is encountered in a section Note A label is not allowed with this directive Example C 69 RDIRECT Directive RDIRECT PAGE MOVE This causes the assembler to remove the PAGE directive from the directive table and the MOVE mnemonic from the mnemonic table C 3 49 SCSJMP Set Structured Control Statement Branching Mode SCSJMP SHORT LONG NONE The SCSJMP directive is analogous to the FORCE directive but it only applies to branches generated automatically by structured control statements See Section C 4 Structured Control Statements on page C 54 There is no explicit way as with a forcing operator to force a branch short or long when it is produced by a structured control statement This directive causes all branches resulting from subsequent structured control statements to be forced to the specified mode Motorola Assembler Notes C 47 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Assembler Directives Just like the FORCE pseudo op errors c
139. ircumflex is also used as the binary exclusive OR operator Example C 7 Example of Local Label Override Character Consider the following macro definition LOAD MACRO ADDR MOVE P ADDR RO ENDM If this macro were called as follows _ LOCAL LOAD _ LOCAL the assembler would ordinarily issue an error since _LOCAL is not defined within the body of the macro With the override operator the assembler recognizes the LLOCAL symbol outside the macro expansion and uses that value in the MOVE instruction DSP56303EVM Users Manual For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Assembler Significant Characters C 2 7 Macro String Delimiter or Quoted String DEFINE Expansion Character The following subsections define how the character can be used in two different instances C 2 7 1 Macro String The double quote when used in macro definitions is transformed by the macro processor into the string delimiter the single quote The macro processor examines the characters between the double quotes for any macro arguments This mechanism allows the use of macro arguments as literal strings Example C 8 Example of a Macro String Delimiter Character Using the following macro definition CSTR MACRO STRING DC STRING ENDM and a macro call CSTR ABCD the resulting macro expansion would be DC ABCD C 2 7 2 Quoted String DEFINE Expansion A sequence of characters whi
140. irective visa Log oed oed e SR C ES PRU ENDIF Directives i sol acetuett oed dd ee atus oe du C MS ate d ENDM Directive ue eto brote eee en aote e ic ted Se ENDSEC DIICCUVOS exc ee ES CENE NEP SOM EAS LEI KEE RE wasted eus EXITM Dine Clive S iru torres eee tures ese e eee ges EAU DITCCDVE S aw esce cl utei voe He clip d RCM are ie EORCEDIIGEUVE gege ee Sage ae es A tet Geral ee Taser GLOBAL DITECUVE usd e veces e BETES GSET Direc etes Sot a dt o tul ti dcs tou al dedii HIMEM Direc a a ea e ost ttre Sei ete us IDENT Directive EE EDITE Ve ds OEA Sf A ET ia INCLUDE Directives eS qo wel RETI qm ss ecu e ak eai DIS T DITeGllVe o Z EE o ete oe ex mb e Ls LOCAL DIHCOU YES oes Ded e bt cd a eR S Ad ees LOMEM Directives to tik Cb m Oeste Ee EURO bain DSTGOIZDIIeGUVe ek d aco ipi i ec sco Rite y ni d E NIAC GIB Directives tar Se oh cok vg Gee Xa qve ans oet he ess MACRO DIT 6 6er oc aito teo so alee en n DSP56303EVM User s Manual For More Information On This Product Go to www freescale com Freescale Semiconductor Inc C 60 MODE Directive rd aser lt m e retra et dei fcn sped att ee C 33 C 61 Kr Ee ne e toe pi e EO oU PX a e we Ce de p ape en C 33 C 62 NOLEIST Directives usto ee Cb MERO ht eet a C 34 C 63 OPT Directives or a due CENE US C 41 C 64 ORG Directive Ix adas a tt E DNI SMELL C 43 C 65 PAGE Directives e surast p at Rabe c ure Ri ans usps Ries C 45 C 66 PNMLACROJDIOCHIVO is Cete pP uite C 46 C 67 PRC Vis Directive s
141. irectly conditional jump transfer should be attentive to the effect of these instructions Jumps or branches generated by structured control statements are forced long because the number and address of intervening instructions between a control statement and its termination are not known by the assembler The programmer may circumvent this behavior by use of the SCSJMP directive In all structured control statements except those using only a single condition code expression registers are used to set up the required counters and comparandis In some cases these registers are effectively reserved the FOR loop uses two data registers to hold the step and target values respectively and performs no save restore operations on these registers The assembler in fact does no save restore processing in any structured control operation it simply moves the operands into appropriate registers to execute the compare The SCSREG directive may be used to reassign structured control statement registers The MEX assembler option see the OPT directive may be used to send the assembler generated code to the listing file for examination of possible register use conflicts Motorola Assembler Notes C 63 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Structured Control Statements DSP56303EVM User s Manual For More Information On This Product Go to www freescale com Freescale Semiconductor Inc
142. is connected to the codeccodec serves a specific purpose Please refer to Table D 5 as to the individual definition of each pin Freescale Semiconductor Inc Digital Interface ESSI Codec ESSII serves a different purpose ESSII controls and transfers codec control information Again please refer to Table D 5 as to the definition of each corresponding pin Table D 5 Pin Set Up Descriptions ESSIO ESSI1 Pin CS4218 Codec Pin Description STDO ESSIO SDIN Data transfer from ESSIO to codec SRDO ESSIO SDOUT Data transfer from codec to ESSIO SCKO ESSIO SCLK Clock sent by codec Master SCO00 ESSIO RESET Reset codec from ESSIO SC02 ESSIO SSYNC Frame Synchronization pulse from codec SC10 ESSI1 CCS Control Information gate SC11 ESSI1 CCLK Clock sent by ESSI1 to set control information SC12 ESSI1 CDIN Control data transfer from ESSI1 Physically the ESSI port pins are connected to the serial pins on the codec though jumper connections In order to ensure correct operation using the example code referenced in this document refer to Table D 6 and Table D 7 for the correct jumper settings for the DSP5630xEVM boards Please refer to Figure D 2 which shows the pin set up between the DSP s ESSI ports and the codec Table D 6 JP5 Jumper Block ESSIO JP5 ESSI Pin Codec Pin 1 2 SCKO SCLK 3 4 SCO00 RESET 5 6 STDO SDIN 7 8 SRDO SDOUT 9 10 SCO1 11 12 SC02
143. it on the Port Direction Register to 0 configures the pin bit as an input Therefore in order to configure the pins using the Data Direction Registers to mimic the direction flow information in Figure D 2 the following bits must be set Table D 6 and Table D 7 show the bit settings for the Data Direction Registers Table D 13 Data Direction Register C Bit Name Bit position Value binary Other bits 6 23 X don t care STDO 5 X don t care SRDO 4 X don t care SCKO 3 X don t care SC02 2 X don t care scot 1 X don t care SCO00 0 1 CODEC_RESET is output Table D 14 Data Direction Register D Bit Name Bit position Value binary Other bits 6 23 X don t care STD1 5 X don t care SRD1 4 X don t care SCK1 3 X don t care SC12 2 1 CDIN is output SC11 1 1 CCLK is output SC10 0 1 CCS is output DSP56303EVM User s Manual For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Phase II Initializing and Interfacing the ESSI and CODEC Ports Example D 7 illustrates the setting of the bits in the Data Direction registers in code form Example D 7 Code Form Settings in Data Direction Registers Data Direction Register C movep 4 0001 x M PRRC Set SCOO CODEC RESET as output Data Direction Register D movep 4 0007 x M PRRD Set SC10 CCS as output Set SC11 CCLK as output Set SC
144. ith a master clock In addition certain control actions and direction flow are set automatically On the other hand by using the ESSI port in the GPIO mode the programmer is given the option of specifying exactly how data is transferred and what direction the data will flow The drawback to using the GPIO mode is that the programmer must understand exactly how the GPIO ports are used when programming the GPIO ports In the example given in this appendix both modes of operation are used When working with ESSI ports the programmer needs to know in detail of the registers and pins available on the ESSI port Although it is not the purpose of this appendix to discuss the ESSI port in great detail a brief description of each pin and register is included Codec Programming Tutorial D 3 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc ESSI GPIO pins D 4 ESSI GPIO pins The ESSI port uses six pins to allow transfer of information Each pin can be configured to function in the ESSI mode or the GPIO mode by modifying the port control registers Please refer to Table D 1 Table D 1 ESSI Pin Definition Pin Name Pin Function Serial Control 0 SCO PCO Has a multitude of functions depending on how control registers are set Serial Control 1 SC1 PC1 Has a multitude of functions depending on how control registers are set Serial Control 2 SC2 PC2 Has a multitude of functions de
145. ith this directive The arguments in order are as follows 1 PAGE WIDTH lt exp1 gt Page width in terms of number of output columns per line default 80 min 1 max 255 2 PAGE LENGTH lt exp2 gt Page length in terms of total number of lines per page default 66 min 10 max 255 As a special case a page length of zero turns off all headers titles subtitles and page breaks 3 BLANK TOP exp3 Blank lines at top of page default 0 min 0 max see below 4 BLANK BOTTOM exp4 Blank lines at bottom of page default 0 min 0 max see below 5 BLANK LEFT lt exp5 gt Blank left margin Number of blank columns at the left of the page default 0 min 0 max see below The following relationships must be maintained BLANK TOP BLANK BOTTOM lt PAGE LENGTH 10 BLANK LEFT PAGE WIDTH Note See also LSTCOL Example C 65 PAGE Directive PAGE 132 3 3 Set width to 132 3 line top bottom margins PAGE Page eject C 3 45 PMACRO Purge Macro Definition PMACRO lt symbol gt lt symbol gt lt symbol gt The specified macro definition is purged from the macro table allowing the macro table space to be reclaimed Motorola Assembler Notes C 45 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Assembler Directives Note A label is not allowed with this directive See also MACRO Example C 66 PMACRO Directive PMACRO MAC1 MAC2 This stateme
146. ization procedures of the DSP the codec also needs to be initialized Again using the supplied code a jump statement can be made to start the CODEC ESSI initialization routine Example D 21 demonstrates this procedure Example D 21 Initializing CODEC ESSI jsr ada init initialize CODEC ESSI The DSP and codec are ready to receive instructions to receive process and transmit data The echo implementation requires that a buffer is setup and initialized The code in Example D 22 can be used to perform these steps Example D 22 Setting Up and Initializing Buffer move 0400 r4 start echo buffer at 400 move SO3FF m4 make echo buffer 1024 deep clr a clear a rep S03FF clear the echo buffer move a 1 r4 In order to receive data from the ESSI port the programmer must ensure that data is received at the beginning of the frame Thus it is necessary to check the status bits to ensure that data receive starts at the beginning of the frame and not in the middle Once a receive frame synchronization is detected data can be manipulate through the receive memory location RX_BUFF_BASE Afterwards the data can be processed and then moved into the transmit pointer All of these procedures can be implemented in an infinite loop to continuous receive process and transmit the data In the case of the echo program Example D 23 illustrates the implementation Codec Programming Tutorial D 33 For More Information On This Product Go to
147. ker Though not needed for our simple example the Motorola DSP linker is also included with the DSP56303EVM The Motorola DSP linker is a program that processes relocatable object files produced by the Motorola DSP assembler generating an absolute executable file which can be downloaded to the DSP56303 The Motorola DSP linker is included on the Motorola Tools CD and can be installed by following the instructions in Section 2 2 1 Assembler Command Format on page 2 5 The general format of the command line to invoke the linker is dsplnk options lt filenames gt where dsplnk is the name of the Motorola DSP linker program and lt filenames gt is a list of the relocatable object files to be linked DSP56303EVM User s Manual For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Linker Options 2 4 Linker Options Table 2 2 describes the linker options To avoid ambiguity the option arguments should immediately follow the option letter with no blanks between them Table 2 2 Linker Options Option Description Auto aligns circular buffers Any modulo or reverse carry buffers defined in the object file input sections are relocated independently in order to optimize placement in memory Code and data surrounding the buffer are packed to fill the space formerly occupied by the buffer and any corresponding alignment gaps Example deplnk A myprog cin Links the file myprog
148. ler Directives Example C 44 EQU Directive A D PORT EQU X 4000 This assigns the value 4000 with a memory space attribute of X to the symbol A D PORT COMPUTE EQU LCV L LCV L is used to refer to the value and memory space attribute of the load location counter This value and memory space attribute is assigned to the symbol COMPUTE C 3 24 EXITM Exit Macro EXITM The EXITM directive will cause immediate termination of a macro expansion It is useful when used with the conditional assembly directive IF to terminate macro expansion when error conditions are detected Note A label is not allowed with this directive See also DUP DUPA DUPC MACRO Example C 45 EXITM Directive CALC MACRO XVAL YVAL IF XVAL lt 0 FAIL Macro parameter value out of range EXITM Exit macro ENDIF ENDM C 3 25 FAIL Programmer Generated Error FAIL lt str gt lt exp gt lt str gt lt exp gt lt str gt lt exp gt The FAIL directive will cause an error message to be output by the assembler The total error count is incremented as with any other error The FAIL directive is normally used in conjunction with conditional assembly directives for exceptional condition checking The assembly proceeds normally after the error has been printed An arbitrary number of strings and expressions in any order but separated by commas with no intervening white space can be specified optionally to describe the nature of the generated e
149. llow the cycle to begin again The control word is shifted to serve the next MSB bit These procedures are performed 16 times to serve all the bits in the control word D 9 4 Enabling Interrupts ESSI ports Now that the ESSI port and CODEC ports are configured and initialized there are just three more steps to complete the interface between the ESSI and the CODEC To begin with the priority level of the interrupts must be set This parameter is determined by the application The second step is to enable interrupts on the DSP Finally the ESSI ports must be enabled Recall that in order to set the functionality of ESSI pin the port control registers must be configured Again setting the corresponding pin bit to 1 enables the ESSI mode while setting the pin bit to O disables the ESSI mode and enables the GPIO mode From Section D 9 2 Configure GPIO Pins the following pins bits must be configured as GPIO pins e CODEC RESET pin bit 0 on ESSIO e CCS pin bit 0 on ESSII e CCLK pin bit 1 on ESSI1 e CDIN pin bit 2 on ESSII Therefore on port control register C bit 0 is set to 0 Other pertinent pins should be set to 1 in order to configure the other pins as ESSI pins On Port Control Register D bits 0 1 and 2 should all be set to the value of 0 to allow GPIO functionality on those pins Because the other pins are not connected to the codec the other bits will not have an effect Example D 12 demonstrates setting the interrupt
150. m Freescale Semiconductor Inc Assembler Directives Example C 37 DUPC Directive If input source file contained the following statements DUPC VALUE 123 DC VALUE ENDM then the assembled source listing would show DUPC VALUE 123 DC 1 DC 2 DC 3 ENDM Note that the lines DUPC VALUE 123 ENDM will only be shown on the source listing if the MD option is enabled The lines DC 1 DC 2 DC 3 will only be shown on the source listing if the MEX option is enabled Note See the OPT directive in this appendix for more information on the MD and MEX options C 3 17 DUPF Duplicate Sequence in Loop lt label gt DUPF dummy lt start gt lt end gt lt increment gt ENDM The block of source statements defined by the DUPF and ENDM directives are repeated in general end lt start gt 1 times when increment is 1 start is the starting value for the loop index end represents the final value increment is the increment for the loop index it defaults to 1 if omitted as does the start value The dummy parameter holds the loop index value and may be used within the body of instructions label if present is assigned the value of the runtime location counter at the start of the DUPF directive processing Note See also DUP DUPA DUPC ENDM MACRO Motorola Assembler Notes C 21 For More Information On This Product Go to www freescale com Freescale Semi
151. me associated with each symbol is unique the symbol is not declared public XDEF GLOB AL and the GLOBAL or LOCAL qualifier is not used in the section declaration Symbols that are defined outside of a section are considered global symbols and have no explicit section name associated with them Global symbols may be referenced freely from inside or outside of any section as long as the global symbol name does not conflict with another symbol by the same name in a given section If the GLOBAL qualifier follows the section name in the SECTION directive then all symbols defined in the section until the next ENDSEC directive are considered global The effect is as if every symbol in the section were declared with GLOBAL This is useful when a section needs to be independently relocatable but data hiding is not desired If the STATIC qualifier follows the section name in the SECTION directive then all code and data defined in the section until the next ENDSEC directive are relocated in terms of the immediately enclosing section The effect with respect to relocation is as if all code and data in the section were defined within the parent section This is useful when a section needs data hiding but independent relocation is not required If the LOCAL qualifier follows the section name in the SECTION directive then all symbols defined in the section until the next ENDSEC directive are visible to the immediately enclosing section The effect
152. n Example dspink EWerrors myprog cin Redirects the standard error output to the file errors If the file already exists it is overwritten F lt argfil gt Indicates that the linker should read command line input from lt argfil gt which can be any legal operating system filename including an optional pathname lt argfil gt is a text file containing further options arguments and filenames to be passed to the linker The arguments in the file need be separated only by white space A semicolon on a line following white space makes the rest of the line a comment Example dspink Fopts cmd This example invokes the linker and takes command line options and input filenames from the command file opts cmd Example Test Program 2 13 For More Information On This Product Go to www freescale com Linker Options Freescale Semiconductor Inc Table 2 2 Linker Options Continued Option Description Sends source file line number information to the object file The generated line number information can be used by debuggers to provide source level debugging Example dspink B Gmyprog cin Links the file myprog cln and sends source file line number information to the resulting object file myprog cld The linker ordinarily produces an absolute executable file as output When the I option is given the linker combines the input files into a single relocatable object file suitable for reproc
153. n On This Product Go to www freescale com Freescale Semiconductor Inc Chapter 2 Example Test Program This section contains an example that illustrates how to develop a very simple program for the DSP56303 This example is for users with little or no experience with the DSP development tools The example demonstrates the form of assembly programs gives instructions on how to assemble programs and shows how the Debugger can verify the operation of programs Figure 2 1 shows the development process flow for assembly programs The rounded blocks represent the assembly and object files The white blocks represent software programs to assemble and link the assemble programs The gray blocks represent hardware products The following sections give basic information on the assembly program the assembler the linker and the object files For detailed information on these subjects consult the assembler and linker manuals provided with the Motorola DSP CLAS software package available through your Motorola sales office or distributor The documentation is also available through the Motorola Wireless internet URL http www mot com SPS DSP documentation Example Test Program 2 1 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Assembly Program asm Assembler Relocatable Object File C Linker C Executable N Object File cld y Writing the Program
154. n bes XS Ce Rete eR RUP d D 18 Codes PINS ooa ede bead db dolebat eg diia D 20 DSP56303EVM User s Manual For More Information On This Product Go to www freescale com Freescale Semiconductor Inc List of Figures 1 1 DSP56303EVM Component Layout ees 1 4 1 2 Connecting the DSP56303EVM Cables 020 020 oo 1 5 2 1 Development Process Flow 244 a IA A E Es 2 2 2 2 Example Debugger Window Display ee eee 2 18 3 1 DSP56303EVM Component Layout 0 0 eee ee eee 3 2 3 2 DSP56303EVM Functional Block Diagram 3 3 3 3 FSRAM Connections to the DSP56303 o oooooooomoom o o 3 3 3 4 Example Memory Map with the Unified External Memory 3 5 3 5 Address Attribute Register AARO 20 00 c eee eee eee 3 5 3 6 Flash Connections uere pe aet DOR etre aii 3 6 3 7 Codec Analog Input Output Diagram 022 0000 ee 3 8 3 8 Codec Digital Interface Connections 00 eee eee 3 9 3 9 RS 232 Serial et eem be coi pane OL ERIS stems 3 11 A 1 DA esi oid Spip aub adt a buit iens A 2 A 2 External Memory a aeo eid So qe abt e d TN A 3 A 3 RS IntetI366 a asc e te o o bsc RECS Re IR t a yn A 4 A 4 Command Converter ees Sero ee ooh P Sana ewe ee eae A 5 A 5 Audio COGS rcm A 6 A 6 BOWEL SUP BLY E E ee widens cooking ERI anb eA eC pee ee A 7 A 7 Bypass Capacitors vea nee Cue lee ed bas eni Tee ess A 8 D 1 Data Format ot Codec oia SA PE S BR ou RW owe Van WU ES D 3 D 2 ESSl Codec Pin SUPL use e Ses
155. n nS usa E AA EN ET SOH Er nd X0 9SdSQ VSI NI dVHLSlOOH 801H 0 0 1 0 zr EN H KEE IDS HONOYHL dvuLsLood D SE pre TW G 099 R EN K oH eann AHONSW XGOIM 3LAH HOYA dVHLSLOOH T 0 0 0 HL IH IN E v dem cq Ed EN es LOWTaS HION cd poo IN nt Ola ME A A SEO DS DE ee ZN ET GZ EE oup ral TOIL om OT ems 19S IQON Yo SOON E S Sv SON E Es SOON g z SH BEEN SN WEE ir AGO E NOL vada e E ZMS an Tal x0L Eech odoN Ge E x0L aon YY acon a OL aon Nt vaow Ga x0L ua YY VELEN Ra sia SC a OY YY wo Y lez olaaa Sc OY wa na H CH MOT DSP56303EVM User s Manual A 2 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Aowa 8U19 X3 CV ant Zoe JeU49 X3 au vLESO QW 09Z4 L68 ZLS XY4 erso Log zio 9668 668 XL unsnv ISAM SAL uouueo ueilllM 1059 VIOHOLOM UOISIAIq 19QHISNS SSAIM OLOZ VOLONTEZLY ve AEEY 0O 3 am LE 3M 7 99 en wv RM QNO 99 ppp E BUE eus SiooldSQ Jeu eq 866 Or JequiemoN Aepseny ea Jequun noy NSQ 0E98dSG EEN zis QNO 99 QNO 99 QNO 99 QNO 99 QNO 99 QNO QNO 99 99 OL LrCOLLSO ER m S ISI SR IM DIEN o X 22223222 22 eza zz
156. n program at p PBASE begin move Hlistl rO set up pointer to start of listl move list2 r4 set up pointer to start of list2 clr a clear accumulator a move x r0 x0 y v4 y0 load the value of X memory pointed to by the contents of r0 into x0 and post increment r0 load the value of Y memory pointed to by the contents of r4 into yO and post increment r4 do 15 endloop do 15 times mac x0 y0 a x r0 x0 y r4 y0 multiply and accumulate and load next values endloop jmp this is equivalent to label jmp label and is therefore a never ending empty loop gk RE RR RRE kc ce ke che he ke ke e he ke ke he ke e ke ke khe ke ee ke ke ke kk kk c ke hec ke ke ke ke kk e ke e ke END OF THE SIMPLE PROGRAM ge hee e ke he e he e e e he e he e kk kk kk k k k kk KK KK kk k k kk kk kk kk kk kk kk kk kk kk kk kk k 2 2 Assembling the Program The following sections describe the format of the assembler command list the assembler special characters and directives and give instructions to assemble the example program 2 2 1 Assembler Command Format The Motorola DSP assembler is included with the DSP56303EVM on the Motorola Tools CD and can be installed by following the instructions in the Read Me file on the CD The Motorola DSP assembler is a program that translates assembly language source statements into object programs compatible with the DSP56303 The general format of the command line to invoke the assembler is
157. nd of macro definition EXITM Exit macro IF Conditional assembly directive MACLIB Macro library MACRO Macro definition PMACRO Purge macro definition 2 2 3 8 Structured Programming The directives for structured programming are as follows BREAK Exit from structured loop construct CONTINUE Continue next iteration of structured loop ELSE Perform following statements when IF false ENDF End of FOR loop ENDI End of IF condition ENDL End of hardware loop ENDW End of WHILE loop POR Begin POR loop JF Begin IF condition Example Test Program 2 11 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Motorola DSP Linker LOOP Begin hardware loop REPEAT Begin REPEAT loop UNTIL End of REPEAT loop WHILE Begin WHILE loop 2 2 4 Assembling the Example Program The assembler is an MS DOS based program thus to use the assembler you must exit Windows or open an MS DOS Prompt Window To assemble the example program type asm56300 a b l g example asm into the evm30xw directory created by the installation process from Section 2 2 1 Assembler Command Format on page 2 5 This creates two additional files example cld and example Ist The example cld file is the absolute object file of the program it is downloaded into the DSP56303 The example Ist file is the listing file it gives full details of where the program and data are placed in the DSP56303 memory 2 3 Motorola DSP Lin
158. nded using the macro facilities of the assembler Thus the generated code can be sent to the listing by specifying the MEX assembler option either via the OPT directive or the O command line option C 4 5 Effects on the Programmer s Environment During assembly global labels beginning with Z_L are generated They are stored in the symbol table and should not be duplicated in user defined labels Because these non local labels ordinarily are not visible to the programmer there can be problems when local underscore labels are interspersed among structured control statements The SCL option DSP56303EVM User s Manual For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Structured Control Statements see the OPT directive causes the assembler to maintain the current local label scope when a structured control statement label is encountered In the FOR loop lt op1 gt is a user defined symbol When exiting the loop the memory register assigned to this symbol contains the value which caused the exit from the loop A compare instruction is produced by the assembler whenever two operands are tested in a structured statement At runtime these assembler generated instructions set the condition codes of the CCR in the case of a loop the condition codes are set repeatedly Any user written code either within or following a structured statement that references CCR directly move or ind
159. ned off set to 1 Please refer to Table D 15 for information concerning the options of each bit pin Example D 9 demonstrates the task of deasserting the codec reset Example D 9 Deasserting Code Reset bset CODEC RESET x M PDRC dissert CODEC RESET pin 0 on ESSIO Codec Programming Tutorial D 19 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Phase II Initializing and Interfacing the ESSI and CODEC Ports Table D 15 Codec Pins Pin Name Description Values CODEC RESET Resets the CODEC 0 Reset codec 1 Disable Reset FSYNC Used to indicate a start of a frame Rising edge New Frame SCLK Serial clock Rising Edge data is received Falling edge data is transmitted SDOUT Serial data output line N A SDIN Serial data input line N A CCS Enables setting of CODEC control parameters 0 enabled 1 disabled CDIN Serial Control Information input line N A CCLK Clock for Control Parameters Rising edge control parameters sent Finally the codec is ready to receive the control information The codec will ignore the first set of control information sent after a reset Therefore a dummy set of control information is sent prior to sending the correct control information To reduce the amount of code written by the programmer another solution is to send the correct control information to the codec twice The first set of control information will be ignored
160. nformation in this document is provided solely to enable system and software implementers to use Freescale Semiconductor products There are no express or implied copyright licenses granted hereunder to design or fabricate any integrated circuits or integrated circuits based on the information in this document Freescale Semiconductor reserves the right to make changes without further notice to any products herein Freescale Semiconductor makes no warranty representation or guarantee regarding the suitability of its products for any particular purpose nor does Freescale Semiconductor assume any liability arising out of the application or use of any product or circuit and specifically disclaims any and all liability including without limitation consequential or incidental damages Typical parameters which may be provided in Freescale Semiconductor data sheets and or specifications can and do vary in different applications and actual performance may vary over time All operating parameters including Typicals must be validated for each customer application by customer s technical experts Freescale Semiconductor does not convey any license under its patent rights nor the rights of others Freescale Semiconductor products are not designed intended or authorized for use as components in systems intended for surgical implant into the body or other applications intended to support or sustain life or for any other application in which the failur
161. nsufficient memory remaining to establish a valid base address Next the runtime location counter is advanced by the value of the integer expression in the operand field lt expression gt can have any memory space attribute The block of memory reserved is not initialized to any given value The result of lt expression gt must be an absolute integer greater than zero and cannot contain any forward references symbols that have not yet been defined The expression also must fall within the range 2 expression lt m where m is the maximum address of the target DSP label if present is assigned the value of the runtime location counter after a valid base address has been established Note See also DS DSR Example C 33 DSM Directive ORG X 100 M BUF DSM 24 CIRCULAR BUFFER MOD 24 Motorola Assembler Notes C 17 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Assembler Directives C 3 13 DSR Define Reverse Carry Storage lt label gt DSR lt expression gt The DSR directive reserves a block of memory the length of which in words is equal to the value of expression If the runtime location counter is not zero this directive first advances the runtime location counter to a base address that is a multiple of 2F where ok expression An error is issued if there is insufficient memory remaining to establish a valid base address Next the runtime location coun
162. nt would cause the macros named MACI and MACH to be purged C 3 46 PRCTL Send Control String to Printer PRCTL lt exp gt I lt string gt lt exp gt I lt string gt PRCTL simply concatenates its arguments and ships them to the listing file The directive line itself is not printed unless there is an error lt exp gt is a byte expression and lt string gt is an assembler string A byte expression would be used to encode non printing control characters such as ESC The string may be of arbitrary length up to the maximum assembler defined limits PRCTL may appear anywhere in the source file and the control string is output at the corresponding place in the listing file However if a PRCTL directive is the last line in the last input file to be processed the assembler insures that all error summaries symbol tables and cross references have been printed before sending out the control string This is so a PRCTL directive can be used to restore a printer to a previous mode after printing is done Similarly if the PRCTL directive appears as the first line in the first input file the control string is output before page headings or titles The PRCTL directive only works if the L command line option is given otherwise it is ignored Note A label is not allowed with this directive Example C 67 PRCTL Directive PRCTL S 1B E Reset HP LaserJet printer C 3 47 RADIX Change Input Radix for Constants RADIX expression Changes the
163. o RX data 34 ds 1 data time slot 3 4 for RX ISR right audio TX BUFF BASE equ IX data 1 2 ds 1 data time slot 1 2 for TX ISR left audio TX data 34 ds 1 data time slot 3 4 for TX ISR right audio RX PTR ds 1 Pointer for rx buffer TX PTR ds li Pointer for tx butter CTRL WD 12 equ MIN LEFT ATTN MIN RIGHT ATTN LIN2 RIN2 CTRL WD 34 equ MIN LEFT GAIN MIN RIGHT GAIN After setting up the constants needed for the codec the DSP needs to be set up and initialized 1 et ter O 6 The DSP will need to know what speed the PLL is running at For this application the PLL will be set to 86 016MHz The interrupts are masked with the correct values The hardware stack pointer is initialized Operate DSP on Mode 0 The data interrupt stack pointer is initialized which is the stack used in the ISR for the codec Assert linear addressing for the stack pointer used for by the data interrupts Example D 20 illustrates the initialization procedures of the DSP DSP56303EVM User s Manual For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Example Application Example D 20 DSP Initialization Procedure org p 100 START main movep 4 040006 x M PCTL PLL 7 X 12 288 86 016MHz ori 3 mr mask interrupts movec 0 Sp clear hardware stack pointer move 0 omr Operating mode 0 move 40 r7 initialize stack pointer for ISR move 1 m7 linear addressing Following the initial
164. o use the ESSIO port in ESSI mode or GPIO mode Port Control Register D PCRD Controls whether to use the ESSI1 port in ESSI mode or GPIO mode D 5 2 ESSI Registers The ESSI consists of 12 registers specific to the ESSI mode Recall that the DSP5630x has two ESSI ports Therefore there are two sets of ESSI registers one for ESSIO and the other for ESSI1 Table D 3 displays a list of the ESSI registers Table D 3 ESSI Registers Register Name Function Control Register A CRA Controls ESSI Mode operations Control Register B CRB Controls ESSI Mode operations Status Register SSISR Describes status and serial flags Transmit Slot Mask Register A TSMA Determines when to transmit during a given time slot Transmit Slot Mask Register B TSMB Determines when to transmit during a given time slot Receive Slot Mask Register A RSMA Determines when to receive during a given time slot Receive Slot Mask Register B RSMB Determines when to receive during a given time slot Time Slot Register TSR Prevents data transmission during a time slot Receive Data Register RX Read only register that receives data Transmit Data Register O TXO Transfer data for transmitter 1 Transmit Data Register 1 TX1 Transfer data for transmitter 2 Transmit Data Register 2 TX2 Transfer data for transmitter 3 D 5 3 GPIO Registers While functioning in the GPIO mode the ESSI port accesses fou
165. ociated with the GLOBAL section This option must be given before any sections are defined explicitly in the source file default reset Generate listing header along with titles and subtitles Ignore case in symbol section and macro names This directive must be issued before any symbols sections or macros are defined Inhibit source listing This option will stop the assembler from producing a source listing default reset in absolute mode Perform interrupt location checks Certain DSP instructions may not appear in the interrupt vector locations in program memory This option enables the assembler to check for these instructions when the program counter is within the interrupt vector bounds Increment load counter if different from runtime by number of bytes in DSP word to provide byte wide support for overlays in bootstrap mode This option must appear before any code or data generation Use the listing file as the debug source file rather than the assembly language file The L command line option to generate a listing file must be specified for this option to take effect Include local labels in the symbol table and cross reference listing Local labels are not normally included in these listings If neither the S or CRE options are specified then this option has no effect The LOC option must be specified before the first symbol is encountered in the source file default reset Print macro calls default reset P
166. odulo Storage a ne a crue eee e Re doe C 17 C 3 13 DSR Define Reverse Carry Storage eod e RR e ve E E CER C 18 C 3 14 DUP Duplicate Sequence of Source Lines nunun nana nunna C 18 C 3 15 DUPA Duplicate Sequence With Argument C 19 C 3 16 DUPC Duplicate Sequence With CharacterS oooooooooo o C 20 C347 DUPF Duplicate sequence in Loop RERBA bes A C 21 318 END End of Source Program aa Aer C 22 3 19 BENDBUP End Butlers ce E Z Ce o ORE EHE EORR n eod C 23 C 3 20 ENDIF End of Conditional Assembivy aeaa C 23 C 3 21 ENDM End of Macro Definition 0 00 cee eee eee C 23 Table of Contents ix For More Information On This Product Go to www freescale com C3 22 C 3 23 C 3 24 C 3 25 C 3 26 C 3 27 C 3 28 C 3 29 3 30 C 3 31 53 32 3 33 C 3 34 C 3 35 C 3 36 C337 C 3 38 C 3 39 C 3 40 C 3 41 C 3 42 C 3 42 1 Ka C3423 C 3 42 4 C3425 C 3 43 C 3 44 C 3 45 C 3 46 C 3 47 C 3 48 5 3 49 C 3 50 C 3 51 C 3 52 C 3 53 C 3 54 3 55 C 3 56 Freescale Semiconductor Inc ENDSEC End Section ss rolas e tes ten eq ex CI aee ag qos C 24 EQU Equate Symbol to a Value d Xr Re ER ERES C 24 EXITM SEW DATO sa a cotes RO Ecco e eed eb C 25 FAIL Programmer Generated Erro i o cto Ie e eR C 25 FORCE Set Operand Forcing Mode 0 000 e eee eee eee C 26 GLOBAL Global Section Symbol Declaration C 26 GSET Set Global Symbol to a Valle das Vae e
167. of the FSRAM 3 3 1 1 FSRAM Connections The basic connection for the FSRAM is shown in Figure 3 3 DSP56303 FSRAM A0 A15 M DO0 D23 H 3 gt AAO RD gt gt WR gt A0 A15 100 1023 CE1 OE WE AA1929 Figure 3 3 FSRAM Connections to the DSP56303 DSP56303EVM Technical Summary For More Information On This Product Go to www freescale com 3 3 Freescale Semiconductor Inc Memory The data input output pins IO0 IO23 for the FSRAM are connected to the DSP56303 D0 D23 pins The FSRAM write WE and output enable OE lines are connected to the DSP56303 write WR and read RD lines respectively The FSRAM chip enable CE1 is generated by the DSP56303 address attribute 0 AAO The FSRAM activity is controlled by AAO and the corresponding address attribute register 0 AARO The FSRAM address input pins AO A15 are connected to the respective port A address pins of the DSP This configuration selects a unified memory map of 64K words The unified memory does not contain partitioned X data Y data and program memory Thus access to P 1000 X 1000 and Y 1000 istreated as access to the same memory cell and 48 bit long memory data moves are not possible to or from the external FSRAM 3 3 1 2 Example Programming AARO As mentioned above the FSRAM activity is controlled by the DSP56303 pin AAO and the corresponding AARO AARO controls the
168. ointer TX BUFF BASE equ TX data 1 2 ds 1 Left transmit channel audio TX data 3 4 ds 1 Right transmit channel audio TX PTR ds 1 Transmit pointer Codec Programming Tutorial D 9 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Phase 1 Setting up Constants D 8 2 Defining Control Parameters of the CODEC To specify specific parameters of the A D and D A conversion and other audio parameters the control information must be declared Parameters such as left and right attenuation left and right gain line input selects and mask interrupts are configured in the control information The control information consists of 32 bits of information Although only 23 bits contain useful information a minimum of 31 bits must be set Table D 8 lists the definitions of each bit Table D 8 CS4218 Codec Control Information MSB Descriptions Bit Values Not Applicable 31 0 Mask Interrupt 30 0 no mask on MF5 INT 1 mask on MF5NNT D01 29 N A Left output D A Attenuation 1 5 28 24 00000 No attenuation dB steps 11111 Max attenuation 46 5 dB Right output D A Attenuation 1 5 23 19 00000 No attenuation dB steps 11111 Max attenuation 46 5 dB Mute D A output 18 O output not muted 1 output muted Left Input Select 17 O LIN1 1 LIN2 Right Input Select 16 0 RIN1 1 RIN2 Left input D A Gain 1 5 dB steps 15 12 00000 no gain
169. ol words Clear CCS bit to allow the codec to accept control information Set CCLK bit on codec high Recall Control bits are sent on rising edge of clock Determine whether MSB is 1 or 0 of control information Send MSB value to CDIN pin Set CCLK to low on codec to start next cycle Shift left control word Sb ipgx cnp umo eg Repeat 16 times This procedure must be performed once for the upper 16 bit control word and then once for the lower 16 bit control word Example D 11 illustrates these procedures Codec Programming Tutorial D 21 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Phase II Initializing and Interfacing the ESSI and CODEC Ports Example D 11 Sending in Control Words codec control routine Input CTRL WD LO and CTRL WD HI Output CDIN j Description Used to send control information to CODEC NOTE does not preserve the a register e odec control clr a bclr HCCS x M PDRD assert CCS move X CTRL WD HI al upper 16 bits of control data jsr send codec shift out upper control word move X CTRL WD LO al lower 16 bits of control data jsr send codec shift out lower control word bset HCCS x M_PDRD dissert CCS rts send codec routine Input al containing control information Ouput sends bits to CDIN Description Determines bits to send to CDIN end codec do 416 end send codec bset HCCLK x M PDRD jclr 23 al bit_low bset CDIN x M_PDRD
170. ollowing the ENDW statement If expression is false upon entry to the WHILE loop lt stmtlist gt is not executed execution continues after the ENDW directive Note The DO keyword is optional Example C 88 WHILE Statement WHILE x rl GT 0 loop until zero is found D D D ENDW C 4 3 Simple and Compound Expressions Expressions are an integral part of IF REPEAT and WHILE statements Structured control statement expressions should not be confused with the assembler expressions The latter are evaluated at assembly time and are referred to here as assembler expressions they can serve as operands in structured control statement expressions The structured control statement expressions described below are evaluated at run time and are referred to in the following discussion simply as expressions A structured control statement expression may be simple or compound A compound expression consists of two or more simple expressions joined by either AND or OR but not both in a single compound expression C 4 3 1 Simple Expressions Simple expressions are concerned with the bits of the condition code register CCR These expressions are of two types The first type merely tests conditions currently specified by the contents of the CCR See Section C 4 3 2 The second type sets up a comparison of two operands to set the condition codes and afterwards tests the codes C 4 3 2 Condition Cod
171. om nolist include include include include list Freescale Semiconductor Inc Example Application Example D 24 Application of Echo Code ghe hee ee e e he e he e e e he e he e ee HK hee k k k KK KK KK KK KK e k k k k k k k k k k k k k kk e ee e e e e e k e ke RARA ioequ asm intequ asm ada equ asm vectors asm p RRR ke kc kc koc ke ce hec ke ke kc ke heck e ke KKK kc ke hec ke e ke kc ke heck e ke kc se he ke ec he kc e ke ke kk ke e ec ke ke ke ke ee ke e ke ke e ke ke ke Buffer for talking to the CS4218 org x 0 RX BUFF BASE equ RX data 12 ds 1 data time slot 1 2 for RX ISR left audio RX data 3 4 ds 1 data time slot 3 4 for RX ISR right audio TX BUFF BASE equ TX data 12 ds 1 data time slot 1 2 for TX ISR left audio TX data34 ds 1 data time slot 3 4 for TX ISR right audio RX PTR ds 1 Pointer for rx buffer TX PTR ds 1 Pointer for tx buffer CTRL WD 12 equ MIN LEFT ATTN MIN RIGHT ATTN LIN2 RIN2 CTRL WD 34 equ MIN LEFT GAIN MIN RIGHT GAIN org p 100 START main movep 4 040006 x M PCTL PLL 7 X 12 288 86 016MHz ori 3 mr mask interrupts movec 0 Sp clear hardware stack pointer move 0 omr operating mode 0 move HS40 17 initialize stack pointer for isr move H 1 m7 linear addressing jsr ada init initialize codec move S0400 r4 start echo buffer at 400 move SO3FF m4 make echo buffer 1024 deep clr a clear a rep SO3FF clear the echo buffer move a l r4 Codec Programming Tutor
172. on On This Product Go to www freescale com Freescale Semiconductor Inc Quick Start Guide Example Test Program DSP56303EVM Technical Summary DSP56303EVM Schematics DSP56303EVM Parts List Motorola Assembler Notes Codec Programming Tutorial Index For More Information On This Product Go to www freescale com
173. on would appear as follows on the source listing MOVE RO D4 L MOVE R1 RO MOVE D4 L R1 Motorola Assembler Notes C 3 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Assembler Significant Characters C 2 5 Return Hex Value of Symbol Character The lt symbol gt sequence when used in macro definitions is replaced by an ASCII string representing the hexadecimal value of symbol This operator may be used in association with the backslash V operator The value of symbol must be an integer not floating point Example C 6 Example of Return Hex Value Symbol Character Consider the following macro definition GEN LAB MACRO LAB VAL STMT LABASVAL STMT ENDM If this macro were called as follows NUM SET 10 GEN LAB HEX NUM NOP the resulting expansion would appear as follows in the listing file HEXA NOP C 2 6 Macro Local Label Override The circumflex when used as a unary expression operator in a macro expansion causes any local labels in its associated term to be evaluated at normal scope rather than macro scope This means that any underscore labels in the expression term following the circumflex will not be searched for in the macro local label list The operator has no effect on normal labels or outside of a macro expansion The circumflex operator is useful for passing local labels as macro arguments to be used as referents in the macro Note The c
174. onic PCE3028CT 470 uF Capacitor 6 3 V dc C1 Xicon XAL16V1000 1000 uF Capacitor 16 V dc L1 L2 L3 L4 L5 Murata BLO1RN1 A62 Ferrite Bead L6 Murata LQHAN150K04MOO Inductor R1 R37 NIC NRC12RF1001TR 1 KQ Resistor R3 Xicor 260 5K 5 KQ Resistor R4 R6 R7 R8 R9 R11 R12 NIC NRC12RF1002TR 10 KQ Resistor R13 R14 R15 R18 R19 R20 R21 R22 R31 R32 R33 R34 R35 R36 R38 R39 R25 R26 R27 R28 Xicor 260 20K 20 KQ Resistor R23 R24 NIC NRC12RF3922TR 39 2 KQ Resistor R16 R17 R29 R30 Xicor 260 5 6K 5 6 KQ Resistor R10 NIC NRC12RF6040TR 604 Q Resistor R79 R80 Panasonic ERJ 6GEYJ240 240 Q Resistor R81 NIC 260 4 7K 4 7 KQ Resistor DSP56303EVM Parts List For More Information On This Product Go to www freescale com B 3 Freescale Semiconductor Inc Parts Listing DSP56303EVM User s Manual For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Appendix C Motorola Assembler Notes C 1 Introduction This appendix supplements information in Chapter 3 of this document and provides a detailed description of the following components used with the Motorola Assembler e Special characters significant to the assembler e Assembler directives Structure control statements C 2 Assembler Significant Characters Several one and two character sequences are significant to the assembler The following subsections define these characters and their use C 2 1 Comment Delimiter
175. onstruct will generate a NOP instruction just before the loop address Example C 83 CONTINUE Statement REPEAT IF cg CONTINUE causes immediate jump to UNTIL ENDI any instructions here are skipped UNTIL x 11 EQ 0 evaluation here after CONTINUE C 4 2 3 FOR Statement POR opl op2 TO DOWNTO lt op3 gt BY lt op4 gt DO lt stmtlist gt ENDF Initialize lt op1 gt to lt op2 gt and perform lt stmtlist gt until lt op1 gt is greater TO or less than DOWNTO lt op3 gt Makes use of a user defined operand lt op1 gt to serve as a loop counter FOR TO allows counting upward while FOR DOWNTO allows counting DSP56303EVM User s Manual For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Structured Control Statements downward The programmer may specify an increment decrement step size in op4 or elect the default step size of 1 by omitting the BY clause A FOR TO loop is not executed if op2 is greater than op3 upon entry to the loop Similarly a FOR DOWNTO loop is not executed if lt op2 gt is less than lt op3 gt lt op1 gt must be a writable register or memory location It is initialized at the beginning of the loop and updated at each pass through the loop Any immediate operands must be preceded by a pound sign Memory references must be preceded by a memory space qualifier X Y or P L memory references
176. operational mode This directive may be given at any time in the assembly source to alter the set of location counters used for section addressing Code generated while in absolute mode is placed in memory at the location determined during assembly Relocatable code and data are based from the enclosing section start address The MODE directive has no effect when the command line A option is issued Note A label is not allowed with this directive See also ORG Example C 60 MODE Directive MODE ABS Change to absolute mode C 3 40 MSG Programmer Generated Message MSG lt str gt lt exp gt lt str gt lt exp gt lt str gt lt exp gt The MSG directive causes a message to be output by the assembler The error and warning counts are not affected The MSG directive is normally used in conjunction with conditional assembly directives for informational purposes The assembly proceeds normally after the message has been printed An arbitrary number of strings and expressions in any order but separated by commas with no intervening white space can be specified optionally to describe the nature of the message Note A label is not allowed with this directive See also FAIL WARN Example C 61 MSG Directive MSG Generating sine tables Motorola Assembler Notes C 33 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Assembler Directives C 3 41 NOLIST Stop Assembly Li
177. ore Information On This Product Go to www freescale com Freescale Semiconductor Inc Writing the Program 2 1 1 5 Comment Field Comments are not considered significant to the assembler but can be included in the source file for documentation purposes A comment field is composed of any characters that are preceded by a semicolon 2 1 2 Example Program The example program discussed in this section takes two lists of data one in X memory and one in Y memory and calculates the sum of the products of the two lists Calculating the sum of products is the basis for many DSP functions Therefore the DSP56303 has a special instruction multiplier accumulate MAC s which multiplies two values and adds the result to the contents of an accumulator Example 2 2 Simple DSP56303EVM Code Example gcc eee kk kk kk kk kk kk kk kk kk kk kk eee e he ehe e he ehe ehe ehe ehe ehe e he e he e ke e ke e ke e A SIMPLE PROGRAM CALCULATING THE SUM OF PRODUCTS gcc ke ee ee ee ee e e e e e e ee ee ee ee ee e e ee he ehe ehe ehe e he e he che e he e he e he ehe e ke e ke e PBASE EQU 100 instruct the assembler to replace every occurrence of PBASE with 100 XBASE EQU 0 used to define the position of the data in X memory YBASE EQU 0 used to define the position of the data in Y memory gk cec ee k k k k k k k k k k k k e e e k e k k k k k k k e k k k k k k e he kk kk ehe e he ehe ehe ehe e ke e ke e ke e X MEMORY y EEE K K k k k k k k k
178. pace is L any allocated datum with a value greater than the target word size is extended to two words otherwise it is truncated If the memory space is E then depending on the memory space qualifier any generated words are split into bytes one byte per word or a 16 8 bit combination Which runtime counter H L or default 1f neither H or L is specified that 1s associated with the lt rms gt is used as the runtime location counter Indicates the runtime physical mapping to DSP memory I internal E external R ROM A port A B port B If not present no explicit mapping is done Non negative absolute integer expression representing the counter number to be used as the runtime location counter Must be enclosed in parentheses Should not exceed the value 65535 Initial value to assign to the runtime counter used as the lt rlc gt If expl is a relative expression the assembler uses the relative location counter If expl is an absolute expression the assembler uses the absolute location counter If expl is not specified then the last value and mode that the counter had is used Which memory space X Y L P or E is used as the load memory space If the memory space is L any allocated datum with a value greater than the target word size is extended to two words otherwise it is truncated If the memory space is E then depending on the memory space qualifier any generated words are split into bytes one byte
179. pending on how control registers are set Serial Clock SCK PC3 Serves as a provider or a receiver of the serial bit rate clock Serial Receive Data SRD PC4 Receives serial data Serial Transmit Data STD PC5 Transmit serial data D 5 ESSI Port Registers The ESSI port can be configured to work in the ESSI mode or the GPIO mode However in either the ESSI mode or the GPIO mode there are certain registers that apply specifically to each mode with the exception of two registers The two registers port control register C PCRC and port control register D PCRD determine how the ESSI ports will be used port control register C configures the ESSIO s functionality mode while port control register D configures the ESSI1 s functionality mode Setting the corresponding bit pin on the port control register to 1 configures the pin to operate in the ESSI mode On the other hand setting the corresponding bit pin to 0 configures the pin to function in the GPIO mode Notice that each pin is individually configured to be in the ESSI mode or the GPIO mode D 5 1 ESSI GPIO Shared Registers Table D 2 lists and describes the functions of the ESSI GPIO shared registers DSP56303EVM User s Manual For More Information On This Product Go to www freescale com Freescale Semiconductor Inc ESSI Port Registers Table D 2 ESSI GPIO Shared Registers Register Name Function Port Control Register C PORC Controls whether t
180. plies to the most previous SECTION directive Nesting sections provides a measure of scoping for symbol names in that symbols defined within a given section are visible to other sections nested within it For example if section B is nested inside section A then a symbol defined in section A can be used in section B without XDEFing in section A or XREFing in section B This scoping behavior can be turned off and on with the NONS and NS options respectively See the OPT directive Sections may also be split into separate parts That is lt section name gt can be used multiple times with SECTION and ENDSEC directive pairs If this occurs then these separate but identically named sections can access each others symbols freely without the use of the XREF and XDEF directives If the XDEF and XREF directives are used within one section they apply to all sections with the same section name The reuse of the section name is allowed to permit the program source to be arranged in an arbitrary manner e g all statements that reserve X space storage locations grouped together but retain the privacy of the symbols for each section When the assembler operates in relative mode the default sections act as the basic grouping for relocation of code and data blocks For every section defined in the source a set of location counters is allocated for each DSP memory space These counters are used to maintain offsets of data and instructions relative to the b
181. prescale modulus 8 frame rate divider 2 16 bits per word 32 bits per frame 16 bit data aligned to bit 23 Me So So ax So ae Control Register B movep S 330c x M_CRBO Enable REIE TEIE RLIE TLIE RIE TIE RE TEO network mode synchronous out on rising in on falling shift MSB first external clock source drives SCK codec is master RX frame sync pulses active for 1 bit clock immediately before transfer period positive frame sync polarity frame sync length is 1 bit Ne So Ne Ne So an So So o So an e D 9 2 Configure GPIO Pins In the previous sections of this document it was stated that the ESSIO pins function in the ESSI mode while the ESSI pins operate in the GPIO mode Referring to Figure D 2 notice that some of the pins only affect the control information of the codec while the other pins deal with the transfer of data Because the codec on the DSP5630xEVM boards are configured to operate in SM4 mode the control information runs on a separate serial line than the data lines Additionally SM4 dictates that the control information only needs to be configured once unless a change is needed In order to control the codec control information the full ESSI port mode does not need to be used Instead the GPIO mode is used to transfer the control information Any pins that are used to control the codec control information will be configured as a GPIO mode otherwise the ESSI mode will be used To configure the mode in w
182. priority level enabling the priority and finally setting the ESSI GPIO functionality of the ESSI ports Codec Programming Tutorial D 23 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Phase III Data Transferring Mechanism Example D 12 ESSI Port Priority and Functionality Setting movep 4 000c x M IPRP set interrupt priority level for ESSIO to 3 andi Sfc mr enable interrupts movep 003e x M PCRC enable ESSI mode for bit 5 bit 4 bit 3 bit 2 bit 1 enable GPIO mode for bit 0 movep 0000 x M PCRD enable GPIO mode for bit 2 bit 1 bit O Other bits are don t care D 10 Phase Ill Data Transferring Mechanism There are basically three different methods for transferring data from the codec to and from the ESSI port They are Polling DMA and Interrupts In this document however only the use of interrupts will be demonstrated D 10 1 Interrupts and Interrupt Service Routines The ESSI device has six interrupts available They are the ESSI receive data with exception status interrupt ESSI receive data interrupt ESSI receive last slot interrupt the ESSI transmit data with exception status interrupt the ESSI transmit last slot interrupt and the ESSI transmit data interrupt Each interrupt is triggered based on certain status bits and can be cleared by performing certain actions in an interrupt service routine In the following sections this document will explain
183. quipment 2e C E Cat ee ee ates ed ARAS 1 1 1 1 1 What You Get with the DSP56303EVM o 1 1 1 1 2 What You Need to Supply cime xasedee mte Sap one ae Coen o e Ne t 1 2 1 2 Installati n Procedure Seo Cere n beso une beh SU e sue See 1 2 1 2 1 Preparing the DSP36303EVM ee Ee OH AGER EUR 1 3 1 2 2 Connecting the DSP56303EVM to the PC and Power 1 4 Chapter 2 Example Test Program Zl Winne the Prorat d escas Sy cred cO DOR oe ea RUE Cee See 2 2 2 1 1 Source Statement Eo cot el riso teer have Maa RA eR New 2 2 2 1 1 1 EE ER EE 2 3 2 1 1 2 Operation Field se i ai ere Gg deb ep RE etes e v pe 2 3 2 1 1 3 Operatd Fieldsa e eec tee alte E albe ee Ae AN 2 3 2 1 1 4 Data Transter Fields os sas asad Mosk sas ae A ay tec Mears 2 3 2 1 1 5 Comment Field teste oye ui ODE NR 2 4 2 1 2 Example Programas ous Wee ev be ou rad o led eto L MM S py i let 2 4 2 2 Assembling the Prosram ss 2o vov a Ces PROOF a RE ERES RNC eye 2 5 2 2 1 Assembler Command Format Geh oe ee daw Ghee dave Ree E ae seg 2 5 2 2 2 Assembler Options 4 ud bed es a afe e Los a leg EN e e fae 2 6 2 2 3 Assembler Directives Lisa d oo de e ye a we dex t tac p 2 8 2 2 3 1 Assembler Significant Characters dq e Ve t 2 8 223 2 Assembly Control eben ases hcec ere RENE A Nod 2 9 2 2 3 3 Symbol DefinJTUOlL s savy sory de exte AE ER SOURCE RES at 2 9 2 2 3 4 Data Definition Storage Allocation 0 00 00 eee ooo 2 10 2 2 3 5 Listing Control and Options
184. r registers specific to the GPIO mode Refer to Table D 4 for details on the registers Codec Programming Tutorial D 5 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Digital Interface ESSI Codec Table DA GPIO Registers Register Name Function Port Direction Register C PRRC Controls the direction of data flow for ESSIO port in GPIO mode Port Direction Register D PRRD Controls the direction of data flow for ESSI1 port in GPIO Mode Port Data Register C PDRC Stores data received or transmitted for ESSIO port in GPIO mode Port Data Register D PDRD Stores data received or transmitted for ESSI1 port in GPIO mode D 5 4 GPIO Mode Port C and Port D After a specific pin has been set to function in the GPIO mode the direction of data flow must be configured In other words the ESSI port must know whether the pin is receiving data or transmitting data These specifications are determined by setting the Port Direction Register C PRRC and Port Direction Register D PRRD By setting the pin bit to 0 on the port direction register the GPIO pin is configured as an input Furthermore by setting the pin bit on the port direction register to 1 the GPIO pin is configured as an output Finally to retrieve or transmit data in the GPIO mode the port data registers PDRs are used If the pin bit is used as an input the value in that pin bit reflects the
185. red to allow the FSRAM to respond to X and Y data memory accesses only The number of address bits to compare BNC 3 0 and the address to compare bits BAC 11 0 determine which external memory addresses access the FSRAM The BNC bits define the number of upper address bits that are compared between the BAC bits and the external address to determine if the FSRAM is accessed For this example the FSRAM is assigned to respond to addresses between 040000 and 04FFFF Thus the BNC bits are set to 8 and the BAC bits are set to 040 If the eight most significant bits of the external address are 00000100 the FSRAM is accessed 3 3 2 Flash The DSP56303EVM uses an Atmel AT29LV010A 20TC chip U3 to provide a 128Kx 8 bit CMOS Flash for stand alone operation i e startup boot operation without accessing the DSP56303 through the JTAG OnCE port The AT29LV010 uses a 3 3 V power supply and has a read access time of 200 ns 3 3 2 1 Flash Connections The basic connection for the Flash is shown in Figure 3 6 DSP56303 Flash A0 A16 3 gt gt A0 A16 D0 D7 a 00 1 07 AA1 CE RD OE WR WE AA1932 Figure 3 6 Flash Connections The flash address pins A0 A106 connect the respective port A address pins on the DSP The flash data input output pins I O0 1 O7 are connected to the DSP56303 D0 D7 pins The flash write enable WE and output enable OE lines connect the DSP563
186. reescale com Freescale Semiconductor Inc Assembler Significant Characters can be forced by preceding the absolute address by the short addressing mode force operator Example C 15 Example of a Short Addressing Mode Force Operator Since the symbol DATAST is a forward reference in the following sequence of source lines the assembler would pick the long absolute form of addressing by default MOVE DO L Y DATAST DATAST EQU Y 523 Because the long absolute addressing mode would cause the instruction to be two words long instead of one word for the short absolute addressing mode it would be desirable to force the short absolute addressing mode as shown below MOVE DO L DATAST DATAST EQU Y 9523 C 2 14 gt Long Addressing Mode Force Operator Many DSP instructions allow a long form of addressing If the value of an absolute address is known to the assembler on pass one then the assembler will always pick the shortest form of addressing consistent with the instruction format unless the FORCE LONG directive is active If this is not desired then the long absolute form of addressing can be forced by preceding the absolute address by the long addressing mode force operator Example C 16 Example of a Long Addressing Mode Force Operator Since the symbol DATAST is a not a forward reference in the following sequence of source lines the assembler would pick the short absolute form of addressing DATAST EQU Y 923 MOVE DO L
187. rface constants and pins Phase 2 Interfacing and Initializing the ESSI and the codec The bulk of the work needed to obtain a working interface between the DSP5630x and the codec lies in this phase The procedures include such activities as setting up and initializing the codec ports setting up and initializing the ESSI ports and finally interfacing the codec and ESSI ports Phase 3 Data transferring mechanisms This phase includes information concerning the types of data transfer mechanism Polling DMA and interrupts are the three types available to the programmer However the interrupt method of transferring data will be discussed in detail in this document D 8 Phase 1 Setting up Constants D 8 1 Setting Up Buffer Space and Pointers Phase 1 begins with setting up buffer spaces and pointers The buffer spaces and pointers offer a temporary storage for the incoming and outgoing data These variables come in the form of receive and transmit buffer and pointers In addition to offering a temporary storage the pointers offer a method to access the memory location of the stored data Example D 1 demonstrates the task of setting up transmit and receive buffers and pointers Example D 1 Setting Up Transmit and Receive Buffers and Pointers Receive buffer and pointer RX BUFF BASE equ RX data 1 2 ds 1 Left receive channel audio RX data 3 4 ds 1 Right receive channel audio RX PTR ds 1 Receive pointer Transmit buffer and p
188. rint macro definitions DSP56303EVM Users Manual For More Information On This Product Go to www freescale com MEX MI NOAE NOCC NOCEX NOCK NOCL NOCM NODEX NODLD NODXL NOFC NOFF NOFM NOGS NOHDR NOMC NOMD NOMI NONL Freescale Semiconductor Inc Assembler Directives Print macro expansions Scan MACLIB directory paths for include files The assembler ordinarily looks for included files only in the directory specified in the INCLUDE directory or in the paths given by the I command line option If the MI option is used the assembler also looks for included files in any designated MACLIB directories default reset Issue warning on memory space incompatibilities Include a memory utilization report in the source listing This option must appear before any code or data generation Display conditional assembly IF ELSE ENDIF and section nesting levels on listing Do not check address expressions default reset Disable cycle counts Does not clear total cycle count default reset Do not print DC expansions default reset Disable checksumming of instruction and data values Do not print the conditional assembly directives Do not preserve comment lines of macros when they are defined default reset Do not expand DEFINE symbols within quoted strings default reset Restrict use of certain directives in DO loop Do not expand DEFINE directive strings in listing default reset
189. ription U1 Motorola DSP56303GC100 DSP U2 Motorola DSP56002PV80 DSP JTAG OnCE U4 GSI GS71024T 10 FSRAM U3 Atmel AT29LV010A 20TC Flash U5 Quality QS3384Q Bus Switch Semiconductor U6 Motorola MC34164D 3 Power On Reset U7 Crystal CS4218 KQ Audio Codec Semiconductor U8 Pioneer LM4880M Audio Amplifier U9 Motorola MC74HCTO4AD Hex Inverter U11 Maxim MAX212CAG RS 232 Transceiver U23 Motorola MC33269DT 3 3 3 3 V Regulator U24 Motorola MC33269DT 5 0 5 V Regulator U25 Motorola MC33269DT Adj Regulator D1 D2 D3 D4 D5 Rectron FM4001 IN4001 Diode D6 D7 Motorola MMBD6050LT1 IN6050 Diode LED1 Quality HLMP1790 Green LED Technologies LED2 LED3 Quality HLMP1700 Red LED Technologies DSP56303EVM Parts List For More Information On This Product Go to www freescale com B 1 Freescale Semiconductor Inc Parts Listing Table B 1 DSP56303EVM Parts List Continued Designator Manufacturer Part Number Description Y1 MMD MC100CA 12 288MHZ 12 288 MHz Oscillator Y2 ECS OECS 196 6 3 C3X1A 19 6608 MHz 153 6 kHz Oscillator SW1 SW2 SW3 Panasonic EVQ QS205K 6 mm Switch P1 P2 Mouser 152 3409 DB 9 Female Connector P3 Switchcraft RAPC 722 2 1 mm DC Power Jack P4 P5 P6 Switchcraft 35RAPC4BHN2 3 5 mm Miniature Stereo Jack J1 Robinson Nugent NSH 8DB S2 TG Header 8 pin double row J2 Robinson Nugent NSH 16DB S2 TG Header 16 pin double row J3 Robinson Nugent NSH 20DB S2 TG H
190. rms of column positions The starting position of any field is relative to its predecessor except for the label field which always starts at the same position relative to page left margin program counter value and cycle count display The widths may be expressed as any positive absolute integer expression However if the width is not adequate to accommodate the contents of a field the text is separated from the next field by at least one space Any field for which the default is desired may be null A null field can be indicated by two adjacent commas with no intervening space or by omitting any trailing fields altogether If the LSTCOL directive is given with no arguments all field widths are reset to their default values Note A label is not allowed with this directive See also PAGE Example C 57 LSTCOL Directive LSTCOL 40 20 20 Reset label X and Y data field widths C 3 37 MACLIB Macro Library MACLIB lt pathname gt This directive is used to specify the lt pathname gt as defined by the operating system of a directory that contains macro definitions Each macro definition must be in a separate file and the file must be named the same as the macro with the extension ASM added For example BLOCKMV ASM would be a file that contained the definition of the macro called BLOCKMV If the assembler encounters a directive in the operation field that is not contained in the directive or mnemonic tables the directory specified b
191. rrent directory with the project pathname L lt lstfil gt Specifies that a listing file is to be created for assembler output lt Istfil gt can be any legal operating system filename including an optional pathname If no lt Istfil gt is specified the assembler uses the basename filename without extension of the first filename encountered in the source input file list and appends Ist to the basename The L option is specified only once Example asm56300 L filter asm gauss asm Assembles the files filter asm and gauss asm together to produce a listing file Because no filename is given the output file is named using the basename of the first source file in this case filter and the listing file is called filter Ist M pathname Causes the assembler to look in the directory defined by pathname for any macro file not found in the current directory pathname can be any legal operating system pathname Example asm56300 Mfftlib trans asm Uses IBM PC pathname conventions and causes the assembler to look in the fftlib subdirectory of the current directory for a file with the name of the currently invoked macro found in the source file trans asm Causes the assembler to report assembly progress to the standard error output stream Causes the assembler to strip symbol information from the absolute load file Normally symbol information is retained in the object file for symbolic references purposes T
192. rror Note A label is not allowed with this directive See also MSG WARN Motorola Assembler Notes C 25 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Assembler Directives Example C 46 FAIL Directive FAIL Parameter out of range C 3 26 FORCE Set Operand Forcing Mode FORCE SHORT LONG NONE The FORCE directive causes the assembler to force all immediate memory and address operands to the specified mode as if an explicit forcing operator were used Note that if a relocatable operand value forced short is determined to be too large for the instruction word an error will occur at link time not during assembly Explicit forcing operators override the effect of this directive Note A label is not allowed with this directive See also gt lt gt Example C 47 FORCE Directive FORCE SHORT torce operands short C 3 27 GLOBAL Global Section Symbol Declaration GLOBAL lt symbol gt lt symbol gt lt symbol gt The GLOBAL directive is used to specify that the list of symbols is defined within the current section and that those definitions should be accessible by all sections This directive is only valid if used within a program block bounded by the SECTION and ENDSEC directives If the symbols that appear in the operand field are not defined in the section an error is generated Note A label is not allowed with this directive See also SECTION XDEF
193. s C 48 SECTION Start Sections nos E dte trece Cer pb etek nue mbes C 48 SET Ser Symbolio d Values io Geb dig Sua aed elon iS bed eb oye C 51 S TITLE Initialize Program Sub Title ocu vex x ye C 51 SYMOBJ Write Symbol Information to Object File C 51 LABS Set Listing Lab SIODS v r geseet bg ch ERE bays C 52 TITLE Initialize Program Tie C 52 DSP56303EVM User s Manual For More Information On This Product Go to www freescale com Freescale Semiconductor Inc C357 UNDEF Undefine DEFINE Symbol 1er oia C 52 C 3 58 WARN Programmer Generated Warning eee C 52 C 3 59 XDEF External Section Symbol Definition aasa C 53 C 3 60 XREF External Section Symbol Reterence C 53 C 4 Structured Control Statement C 54 C 4 1 Structured Control Directives sah eee S PAR whee be C 54 C 4 2 MN o NOE C 55 C 4 2 1 BREAK Statements oA 2 uCeeode a E C 55 C 4 2 2 CONTINUE Statements tratada rata da C 56 C 4 2 3 POR Statement As AAA OR e DESCR ICs C 56 C 4 2 4 LE EME 543 S aer ev iva iet episc wa hee Y teer T etd C 57 C 4 2 5 COOP Statemeht ee hoe e cis be bate eee baies C 58 C 4 2 6 REPEAT SUITED ae ode tee eod INC tp ev ages C 58 C 4 2 7 WHILE Statement 32 clk Ee UO RATS IC eate Hee ari ead C 58 C 4 3 Simple and Compound Expressions 002 e ee eee eee eee C 59 C 4 3 3 Operand Comparison Expressions l l esee C 60 C 4 3 4 Compound Expressions vu eed ELSA SAR ERES C 61 C 4 3 5
194. s provided in the following documents DSP56303 Technical Data Document order number DSP56303 D Provides features list and specifications including signal descriptions DC power requirements AC timing requirements and available packaging DSP56303 User s Manual Document order number DSP56303UM AD Provides an overview description of the DSP and detailed information about the on chip components including the memory and I O maps peripheral functionality and control and status register descriptions for each subsystem DSP56300 Family Manual Document order number DSP56300FM AD Provides a detailed description of the core processor including internal status and control registers and a detailed description of the family instruction set Refer to these documents for detailed information about chip functionality and operation These documents will be provided in the kit on either CD or hard copy DSP56303EVM Technical Summary 3 1 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Memory Note A detailed list of known chip errata is also provided with this kit Refer to the DSP56303 Chip Errata document for information that has changed since the publication of the reference documentation listed previously The latest version can be obtained on the Motorola DSP worldwide web site at http www mot com SPS DSP chiperrata index html 3 3 Memory The DSP56303EVM includes the follow
195. sed to examine structured control statement expansion for relevant constructs to determine default register usage and applicable reassignment strategies Note See also OPT MEX SCSJMP A label is not allowed with this directive Example C 71 SCSREG Directive SCSREG YO B reassign SCS source and dest registers C 3 51 SECTION Start Section SECTION symbol GLOBAL STATIC LOCAL lt section source statements gt ENDSEC The SECTION directive defines the start of a section All symbols that are defined within a section have the lt symbol gt associated with them as their section name This serves to DSP56303EVM User s Manual For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Assembler Directives protect them from like named symbols elsewhere in the program By default a symbol defined inside any given section is private to that section unless the GLOBAL or LOCAL qualifier accompanies the SECTION directive Any code or data inside a section is considered an indivisible block with respect to relocation Code or data associated with a section is independently relocatable within the memory space to which it is bound unless the STATIC qualifier follows the SECTION directive on the instruction line Symbols within a section are generally distinct from other symbols used elsewhere in the source program even if the symbol name is the same This is true as long as the section na
196. serial port connector P1 or internally by an SCI timer If J10 is installed jumper 3 4 on J7 must be removed DSP56303EVM User s Manual For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Off Board Interfaces Table 3 7 SCI Header J7 Pinout Pin Number DSP Signal Pin Number DSP Signal Name Name 1 RxD 2 3 SCLK 4 5 TxD 6 Table 3 8 J7 Jumper Options J7 DSP Signal Name 1 2 RxD 3 4 SCLK 5 6 TxD Table 3 9 DSP Serial Port P1 Connector Pinout Pin Number DSP Signal Name Pin Number DSP Signal Name 1 6 2 TxD 7 SCLK 3 RxD 8 4 9 5 GND 3 6 2 Enhanced Synchronous Serial Port 0 ESSIO Connection to the DSP s ESSIO port can be made at J5 Refer to Table 3 10 for the header s pinout DSP56303EVM Technical Summary For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Off Board Interfaces Table 3 10 ESSIO Header J5 Pinout Pin Number DSP Signal Pin Number DSP Signal Name Name 1 SCKO 2 3 SCO00 4 a 5 STDO 6 7 SRDO 8 gt 9 scot 10 11 SCO2 12 3 6 3 Enhanced Synchronous Serial Port 1 ESSI1 Connection to the DSP s ESSII port can be made at J4 Refer to Table 3 11 for the header s pinout Table 3 11 ESSIO Header J4 Pinout
197. solute integer value within the address range of the machine If during assembly the specified location counter exceeds the value given by expression a warning is issued Note A label is not allowed with this directive See also LOMEM Example C 50 HIMEM Directive HIMEM XR 7FFF YR 7FFF SET X Y RUN HIGH MEM BOUNDS C 3 30 IDENT Object Code Identification Record lt label gt IDENT lt expressionl gt lt expression2 gt The IDENT directive is used to create an identification record for the object module If lt label gt is specified it is used as the module name If label is not specified then the filename of the source input file is used as the module name lt expression1 gt is the version number expression2 is the revision number The two expressions must each evaluate to an integer result The comment field of the IDENT directive is also passed on to the object module Note See also COBJ Motorola Assembler Notes C 27 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Assembler Directives Example C 51 IDENT Directive If the following line was included in the source file FFILTER IDENT 1 2 FIR FILTER MODULE then the object module identification record includes the module name FFILTER the version number 1 the revision number 2 and the comment field FIR FILTER MODULE C 3 31 IF Conditional Assembly Directive IF lt expression gt
198. ssive byte locations If multiple arguments are present one or more of them can be null two adjacent commas in which case the corresponding byte location is filled with zeros label if present is assigned the value of the runtime location counter at the start of the directive processing Integer arguments are stored as is but must be byte values i e within the range 0 255 floating point numbers are not allowed Single and multiple character strings are handled in the following manner e Single character strings are stored in a word whose lower seven bits represent the ASCII value of the character See Example C 27 Multiple character strings represent words whose bytes are composed of concatenated sequences of the ASCII representation of the characters in the string unless the NOPS option is specified see the OPT directive If the number of characters is not an even multiple of the number of bytes per DSP word then the last word will have the remaining Motorola Assembler Notes C 15 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Assembler Directives characters left aligned and the rest of the word is zero filled If the NOPS option is given each character in the string is stored in a word whose lower seven bits represent the ASCII value of the character See Example C 28 Note See also BSC DC Example C 30 DCB Directive TABLE DCB two 0 strings 0 CHA
199. sting NOLIST Do not print the listing from this point on including the NOLIST directive Subsequent source lines will not be printed The NOLIST directive actually decrements a counter that is checked for a positive value and is symmetrical with respect to the LIST directive Note the following sequence Counter value currently 1 LIST Counter value LIST Counter value NOLIST Counter value NOLIST Counter value KA KD Ob The listing still is not disabled until another NOLIST directive is issued Note A label is not allowed with this directive See also LIST OPT Example C 62 NOLIST Directive IF LISTOFF NOLIST Turn the listing off ENDIF C 3 42 OPT Assembler Options OPT option option option lt comment gt The OPT directive is used to designate the assembler options Assembler options are given in the operand field of the source input file and are separated by commas Options also may be specified using the command line O option All options have a default condition Some options are reset to their default condition at the end of pass one Some are allowed to have the prefix NO attached to them which then reverses their meaning Note A label is not allowed with this directive Options can be grouped by function into five different types Listing format control Reporting options Message control e Symbol options e Assembler operation DSP56303EVM User s Manual For More
200. t an ADS command converter card directly to the DSP56303EVM if the DSP56002 command converter software is not used J8 jumper removed Pin 8 has been removed from J6 so that the cable cannot be connected to the DSP56303EVM incorrectly Table 3 6 shows the JTAG OnCE J6 connector pinout The JTAG cable from the ADS command converter is similarly keyed so that the cable cannot be connected to the DSP56303EVM incorrectly Table 3 6 JTAG OnCE J6 Connector Pinout Pin Number DSP Signal Name Pin Number DSP Signal Name 1 TDI 2 GND 3 TDO 4 GND 5 TCK 6 GND 7 8 KEY PIN 9 PRESET 10 TMS 11 3 3 V 12 18 DEZ 14 TRST 3 6 Off Board Interfaces The DSP56303EVM provides interfaces with off board devices via its on chip peripheral ports Most of the DSP ports are connected to headers on the EVM to facilitate direct access to these pins by using connectors or jumpers 3 6 1 Serial Communication Interface Port SCI Connection to the DSP s SCI port can be made at J7 Refer to Table 3 7 for pinout The signals at J7 are 43 3 V signals straight from the DSP If RS 232 level signals are required jumpers should be installed at J7 Refer to Table 3 8 to route the DSP s SCI signals through an RS 232 level converter to P1 The pinout of P1 is shown in Table 3 9 By installing a jumper at J10 the SCI port will be clocked by the on board 153 6 kHz oscillator instead of being clocked externally via the
201. t deett E ee etd 3 8 35 Command Converter sd ema E oe So uem e Ma 3 10 3 6 e E e Bt 3 12 3 6 1 Serial Communication Interface Port SC 3 12 3 6 2 Enhanced Synchronous Serial Port 0 ESSI01 3 13 3 6 3 Enhanced Synchronous Serial Port 1 PSSI 3 14 3 6 4 H st Port HOS 14a cd ib Sor Cette rd hae aote era DER EET 3 14 3 6 5 Expansion Bus Control A Ma aS Te E xS ee Maths 3 15 Sa Mode Selector yn nad oe m Su ovde EODD SEA M CDS 3 15 Appendix A DSP56303EVM Schematics Appendix B DSP56303EVM Parts List ByE Parts Liste oos occ tie hex ab action De gst ydo e Be p M A eA es B 1 Appendix C Motorola Assembler Notes COLO E EE C 1 C2 Assembler Significant Characters ista REX Pam eei s C 1 C 2 1 Comment Delimiter Character wed equ RE ee Ha C 1 C22 Unreported Comment Delimiter Characters C 2 C23 V Line Continuation or Macro Argument Concatenation Character C 2 DSP56303EVM Users Manual For More Information On This Product Go to www freescale com Freescale Semiconductor Inc C 2 3 1 Line Continuation cua ARA qe e RA AA vag doe C 2 2 32 Macro Argument Concatenation 0 00 00 eee ee eee eee C 2 C 2 4 Return Value of Symbol Character 353 ket rese ERROR ed en C 3 C 2 5 Return Hex Value of Symbol Character C 4 C 2 6 Macro Local Label Overrde 5 1e Xu a od C 4 C 2 7 Macro String Delimiter or Quoted String DEFINE Expansion Character C 5 C 2 7 1 WIACTO SUNG amp ad
202. tate at the end of pass one AE CC CEX CK CL CM CONST CONTC default reset Check address expressions for appropriate arithmetic operations For example this will check that only valid add or subtract operations are performed on address terms Enable cycle counts and clear total cycle count Cycle counts are shown on the output listing for each instruction Cycle counts assume a full instruction fetch pipeline and no wait states Print DC expansions Enable checksumming of instruction and data values and clear cumulative checksum The checksum value can be obtained using the 9 CHK function default reset Print the conditional assembly directives default reset Preserve comment lines of macros when they are defined Note that any comment line within a macro definition that starts with two consecutive semicolons 5 is never preserved in the macro definition EQU symbols are maintained as assembly time constants and will not be sent to the object file This option if used must be specified before the first symbol in the source program is defined Reenable cycle counts Does not clear total cycle counts The cycle count for each instruction is shown on the output listing CONTCKReenable checksumming of instructions and data Does not clear cumulative CRE DEX DLD DXL checksum value Print a cross reference table at the end of the source listing This option if used must be specified before
203. ter is advanced by the value of the integer expression in the operand field expression can have any memory space attribute The block of memory reserved is not initialized to any given value The result of expression must be an absolute integer greater than zero and cannot contain any forward references symbols that have not yet been defined Because the DSR directive is useful mainly for generating FFT buffers a warning is generated if expression is not a power of two label if present is assigned the value of the runtime location counter after a valid base address has been established Note See also DS DSM Example C 34 DSR Directive ORG X 100 R BUF DSR 8 REVERSE CARRY BUFFER FOR 16 POINT FFT C 3 14 DUP Duplicate Sequence of Source Lines lt label gt DUP lt expression gt ENDM The sequence of source lines between the DUP and ENDM directives is duplicated by the number specified by the integer lt expression gt lt expression gt can have any memory space attribute If the expression evaluates to a number less than or equal to zero the sequence of lines will not be included in the assembler output The expression result must be an absolute integer and cannot contain any forward references symbols that have not already been defined The DUP directive may be nested to any level lt label gt if present is assigned the value of the runtime location counter at the start of the DUP directive process
204. terrupt occurs when the following properties are true e The transmit exception interrupt is turned on CRB 22 The transmit data register is empty s A transmit underrun error occurred The interrupt is triggered by the transmit underrun bit being set When the interrupt is serviced the programmer will need to first clear the transmit underrun bit SSISRO 4 and then transmit the transmit BUFFER The steps needed to perform these procedures are as follows Clear transmit underrun bit Save necessary context Load Transmit buffer pointer Move Transmit buffer data to transmit register Update Transmit Buffer pointer SR L aor S tro ET Restore context Example D 16 illustrates the procedures to service this interrupt Codec Programming Tutorial D 27 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Phase III Data Transferring Mechanism Example D 16 ESSI Transmit Data with Exception Status Interrupt Service transmit data with exception status interrupt service routine ssi txe isr Clear underrun bit belr 4 x M_SSISRO M SSISRO pointers to status register Save Context move rO x r7 Save r0 to the stack move mO x r7 Save m0 to the stack move 1 m0 Modulus 2 buffer Load transmit pointer to transmit buffer move x TX PTR rO Load the pointer to the tx buffer nop delay Move Transmit buffer data to transmit register movep x r0
205. the DSP56303EVM and to Figure 3 2 on page 3 3 for a functional diagram Figure 3 9 shows the RS 232 serial interface diagram Table 3 5 shows the RS 232 connectors pinout P2 Table 3 4 On Board JTAG Enable Disable Option J8 Option Selected 1 2 On Board Command Converter Enabled OPEN On Board Command Converter Disabled DSP56002 RS 232 TRANSCEIVER HOST PC RXD ra R4OUT RAIN ra TD TXD JM T2lN T20UT RD RESET La R50UT R5IN 4 DTR AA1935 Figure 3 9 RS 232 Serial Interface Table 3 5 Debug RS 232 Connector P2 Pinout Use i is Ein Number NIME 1 6 E 2 TxD 7 3 RxD 8 4 RESET 9 5 GND Maxim s 3 V Powered RS 232 Transceiver MAX212 at U11 is used to transmit the signals between the host PC and the DSP56002 Serial data is transmitted from the host PC transmitted data TD signal and received on the DSP56002 receive data RXD pin Serial data is similarly transmitted from the DSP56002 transmit data TXD signal and received on the host PC received data RD signal The data terminal ready DTR pin asserts the RESET pin of the DSP56002 DSP56303EVM Technical Summary 3 11 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Off Board Interfaces As an option the DSP56303EVM 14 pin JTAG OnCE connector at J6 allows the user to connec
206. the load memory space and counter are given in the operand field then the assembler always generates code for an overlay Whether the overlay is absolute or relocatable depends upon the current operating mode of the assembler and whether the load counter value is an absolute or relative expression If the assembler is running in absolute mode or if the load counter expression is absolute then the overlay is absolute If the assembler is in relative mode and the load counter expression is relative the overlay is relocatable Runtime relocatable overlay code is addressed relative to the location given in the runtime location counter expression This expression if relative may not refer to another overlay block Note See also MODE Example C 64 ORG Directive ORG P 1000 Sets the runtime memory space to P Selects the default runtime counter counter 0 associated with P space to use as the runtime location counter and initializes it to 1000 The load memory space is implied to be P and the load location counter is assumed to be the same as the runtime location counter Motorola Assembler Notes C 43 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Assembler Directives Example C 64 ORG Directive Continued ORG PHE Sets the runtime memory space to P Selects the H load counter counter 2 associated with P space to use as the runtime location counter The H counter will not be initiali
207. uctor Inc Table 3 14 Boot Mode Selection Options Bane E Boot Mode Selected D 1 2 C 3 4 B 5 6 A 7 8 8 OPEN JUMP JUMP JUMP Jump to program at 008000 1 OPEN JUMP JUMP OPEN Bootstrap from byte wide memory 2 OPEN JUMP OPEN JUMP Bootstrap from SCI 4 OPEN OPEN JUMP JUMP HIO8 bootstrap in ISA DSP5630X mode 5 OPEN OPEN JUMP OPEN HIO8 Bootstrap in HC11 non multiplexed bus mode 6 OPEN OPEN OPEN JUMP HIO8 Bootstrap in 8051 multiplexed bus mode 7 OPEN OPEN OPEN OPEN HIO8 Bootstrap in MC68302 bus mode DSP56303EVM User s Manual For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Appendix A DSP56303EVM Schematics DSP56303EVM Schematics For More Information On This Product o to www freescale com A 1 Freescale Semiconductor Inc 0 9SdSQ L y 91N614 E 2 LL wen L p L jeus sjool dsd ueuDiseg 8661 0L JequieAoN Aepsen ajeg JequunN jueunoo NSQ 0 98dSG azis 0 9SdSa al vLe3O OIN S9AA 9 u UOUUE O Wwe UOISIAIq 19QUISNS sse ao JIM 0921 L68 z s xv3 8668 5684 XL UNSNY 159 168 Z1S IM 1059 V7OHOLO yy QNO QNO QNO QNO D 99 QNO QNO QNO ERT 391 oar 34 USM SWL qouoovr E za 99 QNO QNO QNO 6N 99 99 QNO
208. upt instead of bit 30 However since most of the work done with the ESSI ports and codec is done using MSB first Table D 8 was modified to reverse the bit order from the codec data sheet to simplify control information programming The Evaluation modules used in this document are designed to select line 2 of right and left inputs Therefore bits 17 Left Input Select and bits 16 Right Input Select should be configured to select LIN 2 1 when using the DSP5630xEVM evaluation modules Codec Programming Tutorial For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Phase II Initializing and Interfacing the ESSI and CODEC Ports D 9 Phase ll Initializing and Interfacing the ESSI and CODEC Ports After defining certain constants for the codec and the ESSI the next step is to initialize the ESSI and codec interface The initialization procedure involves first initializing the ESSI ports which includes resetting the ESSI ports modifying ESSI control registers and configuring ESSI GPIO functionality Second the codec must also be initialized which entails resetting the codec and sending in codec control information In other words the following general steps need to be performed Reset ESSI ports Modify ESSI control registers Configure ESSI or GPIO functionality Reset codec Modify codec control information Qv UU decur abs dcs De assert ESSI reset and enable interrupts D 9
209. value present on that pin Additionally if the pin bit is used as an output the value seen on the pin bit is the value being transmitted For more information concerning ESSI ports please refer to the DSP5630xEVM User s Manual and the Application Note DSP56300 Enhanced Synchronous Serial Interface ESSI Programming order number AN1764 D located at web address www mot com SPS DSP documentation appnotes html D 6 Digital Interface ESSI Codec As mentioned previously the DSP s ESSI ports form the major interface between the DSP and the codec device Recall that on the DSP5630x evaluation modules discussed in this appendix the codec is configured to function in the SM4 mode SM4 mode separates the data information from the codec control information Therefore two serial ports are required to transfer data and codec control information Specifically both ESSIO and ESSII ports are used to control and transfer data between the DSP and the codec In general ESSIO controls data transfers between the DSP and the codec while ESSI1 controls codec control information transfers between the DSP and the codec ESSIO performs three functions with reference to the codec First ESSIO transfers data to and from the codec Secondly ESSIO receives synchronization pulses And finally ESSIO DSP56303EVM User s Manual For More Information On This Product Go to www freescale com performs the reset function on the codec Each ESSIO pin that
210. what specific status bits trigger the interrupts and what must be done in order to clear the interrupts For more information concerning the properties and functionality of each type of interrupt and for setting up the interrupt service routines please refer to the DSP5630xEVM s user manual D 10 2 ESSI Receive Data with Exception Status Interrupt The interrupt occurs when the following properties are true e The receive exception interrupt is turned on CRB 23 e The receive data register is full e A receiver overrun error occurred The interrupt is triggered by the receiver overrun bit being set When the interrupt is serviced the programmer will need to first clear the receiver overrun bit SSISRO 5 and DSP56303EVM User s Manual For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Phase III Data Transferring Mechanism then receive the Receive BUFFER The following steps are needed to perform these procedures Clear receive overrun bit 2 Save necessary context 3 Load receive buffer pointer 4 Move received data to receive buffer 5 Update receive buffer pointer 6 Restore context Example D 13 illustrates the procedures to service this interrupt Example D 13 ESSI Exception Status Interrupt Service ESSI Receive Data with Exception Interrupt Service Routine ssi rxe isr bclr 45 x M SSISRO move rO x 47 move mO x r7 move 1 m0 move X RX DIR r0
211. xecution address C 3 19 ENDBUF End Buffer ENDBUF The ENDBUF directive is used to signify the end of a buffer block The runtime location counter will remain just beyond the end of the buffer when the ENDBUF directive is encountered Note A label is not allowed with this directive See also BUFFER Example C 40 ENDBUF Directive ORG X 100 BUF BUFFER R 64 uninitialized reverse carry buffer ENDBUF C 3 20 ENDIF End of Conditional Assembly ENDIF The ENDIF directive is used to signify the end of the current level of conditional assembly Conditional assembly directives can be nested to any level but the ENDIF directive always refers to the most previous IF directive Note A label is not allowed with this directive See C 3 31 IF Conditional Assembly Directive on page C 28 Example C 41 ENDIF Directive IF GREL SAVEPC SET Save current program counter ENDIF C 3 24 ENDM End of Macro Definition ENDM Every MACRO DUP DUPA and DUPC directive must be terminated by an ENDM directive Note A label is not allowed with this directive See also DUP DUPA DUPC MACRO Motorola Assembler Notes C 23 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Assembler Directives Example C 42 ENDM Directive SWAP SYM MACRO REG1 REG Swap REG1 REG2 using D4 L as temp MOVE R REG1 D4 L MOVE R REG2 R REGL MOVE D4 L R REG2 ENDM C 3 22 ENDSEC End Section ENDSEC Ev
212. y lt pathname gt is searched for a file of the unknown name with the ASM extension added If such a file is found the current source line is saved and the file is opened for input as an INCLUDE file When the end of the file is encountered the source line is restored and processing is resumed Because the Motorola Assembler Notes C 31 For More Information On This Product Go to www freescale com Freescale Semiconductor Inc Assembler Directives source line is restored the processed file must have a macro definition of the unknown directive name or else an error will result when the source line is restored and processed However the processed file is not limited to macro definitions and can include any legal source code statements Multiple MACLIB directives may be given in which case the assembler will search each directory in the order in which it is encountered Note A label is not allowed with this directive See also INCLUDE Example C 58 MACLIB Directive MACLIB macros mymacs IBM PC example MACLIB fftlib UNIX example C 3 38 MACRO Macro Definition lt label gt MACRO lt dummy argument list gt lt macro definition statements gt ENDM The dummy argument list has the following form lt dumarg gt lt dumarg gt lt dumarg gt The required label is the symbol by which the macro is called If the macro is named the same as an existing assembler directive or mnemonic a warning is issu
213. y C 31 C 39 purge C 45 Macro argument concatenation operator C 2 local label override operator C 4 return hex value operator C 4 return value operator C 3 MAX212 3 11 Memory limit C 27 C 30 utilization C 39 Memory space C 39 C 42 Mode Selection 3 15 Modes D 2 Motorola DSP linker 2 12 N Number of Bits to Compare Bits BCN 3 0 3 6 O Object file comment C 13 identification C 27 symbol C 41 C 51 object files 2 1 OnCE commands 3 10 OnCE JTAG conversion 3 10 operand field 2 3 operand fields 2 3 Operating Mode DSP56307 3 6 operation field 2 3 Option AE C 35 C 37 assembler operation C 36 CC C 36 C 37 CEX C 35 C 37 CK C 36 C 37 CL C 35 C 37 CM C 36 C 37 CONST C 36 C 37 CONTC C 37 CONTCK C 36 C 37 CRE C 35 C 37 DEX C 36 C 37 DLD C 36 C 37 DXL C 35 C 37 FC C 35 C 38 FF C 35 C 38 FM C 35 C 38 GL C 36 C 38 GS C 36 C 38 HDR C 35 C 38 IC C 36 C 38 IL C 35 C 38 INTR C 36 C 38 LB C 36 C 38 LDB C 36 C 38 listing format C 35 LOC C 35 C 38 MC C 35 C 38 MD C 35 C 38 message C 35 MEX C 35 C 39 MI C 36 C 39 MSW C 35 C 39 MU C 35 C 39 NL C 35 C 39 NOAE C 39 DSP56303EVM User s Manual For More Information On This Product Go to www freescale com P Freescale Semiconductor Inc NOCC C 39 Packing Enable Bit BPAC 3 5 NOCEX C 39 PC 3 10 NOCK C 39 PC requirements 1 2 NOCL C 39 PEROM 3 6 NOCM C 39 stand alone operation 3 6 NODEX C 39 Pin Setup Descriptions D 7 NODLD C 39 P
214. zed and its last value is used Code generated hereafter is mapped to external E memory The load memory space is implied to be P and the load location counter is assumed to be the same as the runtime location counter ORG PI OVL1 Y Indicates code is generated for an overlay The runtime memory space is P and the default counter is used as the runtime location counter It is reset to the value of OVL I If the assembler is in absolute mode via the A command line option then OVL1 must be an absolute expression If OVL1 is an absolute expression the assembler uses the absolute runtime location counter If OVL1 is a relocatable value the assembler uses the relative runtime location counter In this case OVL1 must not itself be an overlay symbol i e defined within an overlay block The load memory space is Y Since neither H L nor any counter expression was specified as the load counter the default load counter counter 0 is used as the load location counter The counter value and mode are whatever they were the last time they were referenced ORG XL E8 Sets the runtime memory space to X Selects the L counter counter 1 associated with X space to use as the runtime location counter The L counter is not initialized and its last value is used The load memory space is set to E and the qualifier 8 indicates a bytewise RAM configuration Instructions and data are generated eight bits per output word with byte oriented load addresses
215. zero for all DSP memory spaces This option allows the programmer to redefine the start address for any memory space and associated location counter lt mem gt is one of the single character memory space identifiers X Y L P The letter can be upper or lowercase The optional lt ctr gt is a letter indicating the high H or low L location counters If no counter is specified the default counter is used map is also optional and signifies the desired physical mapping for all relocatable code in the given memory space It can be for internal memory E for external memory R for ROM A for Port A and B for Port B If map is not supplied then no explicit mapping is presumed The origin is a hexadecimal number signifying the new relocation address for the given memory space The O option can be specified as many times as needed on the command line This option has no effect if incremental linking is being done See the I option Example dspInk Ope 200 myprog Lmylib Initializes the default P memory counter to hex 200 and maps the program space to external memory P lt pathname gt When the linker encounters input files it first searches the current directory or the directory given in the library specification for the file If it is not found and the P option is specified the linker prefixes the filename and optional pathname of the file specification with lt pathname gt and searches the newly formed directory p

Download Pdf Manuals

image

Related Search

Related Contents

Dicota Z17438Z equipment case  parcours de vie. UNAFAM    Télécharger PDF  User Manual  Intro to Joint Communication Simu  Uso e manutenzione Ape 50 ZAPC80000  Appel à projets national 2015 Expé  Polar CS400 Getting Started Guide  Nettoyant EB + Pyrevol + Pyregale  

Copyright © All rights reserved.
Failed to retrieve file