Embedded Target for the TI TMS320C2000™ DSP Platform ® For Use with Simulink User’s Guide Version 1
How to Contact The MathWorks: www.mathworks.com comp.soft-sys.matlab Web Newsgroup info@mathworks.com Technical support Product enhancement suggestions Bug reports Documentation error reports Order status, license renewals, passcodes Sales, pricing, and general information 508-647-7000 Phone 508-647-7001 Fax The MathWorks, Inc. 3 Apple Hill Drive Natick, MA 01760-2098 Mail support@mathworks.com suggest@mathworks.com bugs@mathworks.com doc@mathworks.com service@mathworks.
Contents Getting Started 1 What Is the Embedded Target for the TI TMS320C2000 DSP Platform? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-2 Suitable Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-2 Setting Up and Configuring . . . . . . . . . . . . . . . . . . . . . . . . . . . . Platform Requirements — Hardware and Operating System . Supported Hardware for Targets . . . . . . . . . . . . . . . . . . . . . . . . Software Requirements . .
Using the IQmath Library 2 About the IQmath Library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-2 Common Characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-2 Fixed-Point Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-3 Signed Fixed-Point Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-3 Q Format Notation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-4 Building Models . . . . . . . . . . .
1 Getting Started This chapter describes how to use the Embedded Target for TI C2000 DSP to create and execute applications on Texas Instruments C2000 development boards. To use the targeting software, you should be familiar with using Simulink to create models and with the basic concepts of Real-Time Workshop automatic code generation. To read more about Real-Time Workshop, refer to your Real-Time Workshop documentation. What Is the Embedded Target for the TI TMS320C2000 DSP Platform? (p.
1 Getting Started What Is the Embedded Target for the TI TMS320C2000 DSP Platform? The Embedded Target for the TI TMS320C2000™ DSP Platform integrates Simulink® and MATLAB® with Texas Instruments eXpressDSP™ tools. You can use this product to develop and validate digital signal processing and control designs from concept through code.
Setting Up and Configuring Setting Up and Configuring Platform Requirements — Hardware and Operating System To run the Embedded Target for the TI TMS320C2000 DSP Platform, your host PC must meet the following hardware configuration: • Intel Pentium or Intel Pentium processor-compatible PC • 64 MB RAM (128 MB recommended) • 20 MB hard disk space available after installing MATLAB • Color monitor • One parallel printer port or one USB port to connect your target board to your PC • CD-ROM drive • Windows NT 4.
1 Getting Started Refer to the documentation provided with your hardware for information on setting up and testing your target board. Note You do not need to change any jumpers from their factory defaults on either the LF2407 or F2812 target board. Software Requirements MathWorks Software For up-to-date information about other MathWorks software you need to use the Embedded Target for the TI TMS320C2000 DSP Platform, refer to the MathWorks Web site — http://www.mathworks.com.
Setting Up and Configuring Required TI Software for Targeting Your TI C2000 Hardware (Continued) Installed Product Additional Information Linker Combines various input files, such as object files and libraries Code Composer Studio Texas Instruments integrated development environment (IDE) that provides code debugging and development tools TI C2000 miscellaneous utilities Various tools for developing applications for the C2000 digital signal processor family Code Composer Setup Utility Program you
1 Getting Started Note For up-to-date information about system requirements, refer to the system requirements page, available in the products area at the MathWorks Web site (http://www.mathworks.com). To verify that CCS is installed on your machine, enter ccsboardinfo at the MATLAB command line. With CCS installed and configured, MATLAB returns information about the boards that CCS recognizes on your machine, in a form similar to the following listing.
Embedded Target for TI C2000 and Code Composer Studio Embedded Target for TI C2000 and Code Composer Studio Texas Instruments (TI) facilitates development of software for TI DSPs by offering Code Composer Studio (CCS) Integrated Development Environment (IDE) . Used in combination with your Embedded Target for TI C2000 DSP and Real-Time Workshop, CCS provide an integrated environment that, once installed, requires no coding.
1 Getting Started Scheduling and Timing A timer interrupt is used to run generated code in real time on the C2000 DSP. Each iteration of the model solver is run after an interrupt has been posted and serviced by an interrupt service routine (ISR). The code generated for the C28x uses CPU_timer0. The code generated for the C24x uses an Event Manager (EV) timer, which you can select. The timer is configured so that the model’s base rate sample time corresponds to the interrupt rate.
Scheduling and Timing Maximum Sample Times (Continued) TimerClockPrescaler Setting C24x Maximum Sample Time (seconds) C28x Maximum Sample Time (seconds) 64 0.1048 N/A 128 0.
1 Getting Started Overview of Creating Models for Targeting After you have installed the supported development board, start MATLAB. At the MATLAB command prompt, type c2000lib This opens the c2000lib Simulink blockset that includes libraries containing blocks predefined for C2000 input and output devices. As needed, add the blocks to your model. See “Using the c2000lib Blockset” on page 1-14 for an example of how to use this library.
Overview of Creating Models for Targeting Notes About Selecting Blocks for Your Models Many blocks in the blocksets communicate with your MATLAB workspace. These blocks also generate code, but they do not work on the target as they do on your desktop — in general, they slow your signal processing application without adding instrumentation value.
1 Getting Started Setting Simulation Parameters To set the simulation parameters manually, with your model open, select Simulation Parameters from the Simulink option. From this dialog, click Real-Time Workshop. You must specify the appropriate version of the system target file and template makefile. For the Embedded Target for the TI TMS320C2000™ DSP Platform, in the Real-Time Workshop pane of the dialog, specify ti_C2000_grt.tlc or, optionally, select ti_C2000_ert.
Overview of Creating Models for Targeting language compiler documentation. For a complete discussion of S-functions, refer to your documentation about writing S-functions. Note To build, load, and run code successfully on your target board, MATLAB must be able to locate that board in your system configuration. Make sure that the Board Name in your Code Composer Studio setup and the DSPBoardLabel in the Target Preference Block in your model match exactly.
1 Getting Started Using the c2000lib Blockset This section uses an example to demonstrate how to create a Simulink model that uses the Embedded Target for TI C2000 DSP blocks to target your board. The example creates a model that performs PWM duty cycle control via pulse width change. It uses the C2812 ADC block to sample an analog voltage and the C2812 PWM block to generate a pulse waveform.
Using the c2000lib Blockset The libraries are • C2800 DSP Core Support (c2800dsplib) — Blocks to configure the codec on the F2812 eZdsp DSK or on the F2812 DSP • C2400 DSP Core Support (c2400dsplib) — Blocks to configure the codec on the LF2407 eZdsp DSK or on the LF2407 DSP • Target Preferences (c2000tgtpreflib) — Blocks to specify target preferences and options. You do not connect this block to any other block in your model.
1 Getting Started For more information on each block, refer to its reference page. Setting Up the Model Preliminary tasks for setting up a new model include adding a Target Preferences block, setting or verifying Target Preferences, and setting the simulation parameters. 1 Select New from the File menu to create a new Simulink model. 2 Double-click the Target Preferences library in c2000lib to open it. 3 Drag the F2812 eZdsp block into your new model.
Using the c2000lib Blockset Click Yes to allow automatic setup.
1 Getting Started Select Simulation Parameters from the Simulation menu to verify and set the simulation parameters for this model. Parameters you set in this dialog belong to the model you are building. They are saved with the model and stored in the model file. Refer to your Simulink documentation for information on the Simulation Parameters dialog. Use the Real-Time Workshop pane of the Simulation Parameters dialog to set options for the real-time model.
Using the c2000lib Blockset The ERT options apply to the embedded targets and appear when you select an ERT TI C2000 target, such as ti_c2000_ert.tlc, as the System target file. The ERT file requires Real-Time Workshop Embedded Coder. Target configuration — Use the selections in this category to specify your target. - System target file. Clicking Browse opens the Target File Browser where you select ti_c2000_grt.tlc or ti_c2000_ert.tlc.
1 Getting Started General code generation options — Real-Time Workshop uses the general code generation options during the build process to tailor the generated code to your needs. For more information about using these General code generation options, refer to your Real-Time Workshop documentation. For this example, use the default settings of the General code generation options.
Using the c2000lib Blockset Build Options (Continued) Subfield Field Setting Linker Options CreateMAPFile True KeepOBJFiles True LinkerCMDFile Full_memory_map BuildAction Build_and_execute OverrunAction Continue RunTime Options CCSLink Options Field Setting CCSHandleName CCS_Obj ExportCCSHandle True CodeGeneration Options Subfield Field Setting Scheduler Timer CPU_timer0 TimerClockPrescaler 1 DSPBoard Options Subfield Field Setting DSP Board Label DSPBoardLabel F2812 PP Em
1 Getting Started DSPBoard Options (Continued) 1-22 Subfield Field Setting eCAN BitRatePrescaler 10 EnhancedCANMode True SAM Sample_one_time SBJ Only_falling_edges SJW 2 SelfTestMode False TSEG1 8 TSEG2 6
Using the c2000lib Blockset 1-23
1 Getting Started Adding Blocks to the Model 1 Double-click the C2800 DSP Chip Support Library to open it. 2 Drag the C28x ADC block into your model. Double-click the ADC block in the model and set the Module to A, select only ADCINA0, and enter a Sample time of 64/80000. Refer to the C28x ADC reference page for information on these fields.
Using the c2000lib Blockset 3 Drag the C28x PWM block into your model. Double-click the PWM block in the model and set the following parameters. Refer to the C28x PWM reference page for information on these fields.
1 Getting Started 1-26 Field Parameter PWM1 control logic Active high PWM2 control logic Active low Use deadband for PWM1/PWM2 selected Deadband prescaler 16 Deadband period 12
Using the c2000lib Blockset 4 Type Simulink at the MATLAB command line to start the Simulink Library browser. Drag a Gain block from the Math Operations library into your model. Double-click on the Gain block in the model and set the following parameters. Field Parameter Gain 30 Multiplication Element-wise(K.
1 Getting Started 5 Connect the ADC block to the Gain block and the Gain block to the PWM block as shown. Generating Code from the Model This section summarizes how to generate code from your real-time model. For details about generating code from models in Real-Time Workshop, refer to your Real-Time Workshop documentation.
Using the c2000lib Blockset You start the automatic code generation process from the Simulink model window by clicking Build in the Real-Time Workshop pane of the Simulation Parameters dialog. Other ways of starting the code generation process are by using the Build all button on the toolbar of your model, or by using the keyboard shortcut, Ctrl-B, while your model is open and in focus.
1 Getting Started 1-30
2 Using the IQmath Library About the IQmath Library (p. 2-2) Introduces the IQmath Library Fixed-Point Numbers (p. 2-3) Representation of fixed-point numbers in the IQmath Library Building Models (p.
2 Using the IQmath Library About the IQmath Library The blocks in the C28x IQmath Library correspond to functions in the Texas Instruments C28x IQmath Library assembly-code library, which target the TI C2800 family of digital signal processors. You can use these blocks to run simulations by building models in Simulink before generating code. Once you develop your model, you can invoke Real-Time Workshop to generate equivalent code that is optimized to run on a C2000 DSP.
Fixed-Point Numbers Fixed-Point Numbers In digital hardware, numbers are stored in binary words. A binary word is a fixed-length sequence of binary digits (1’s and 0’s). How hardware components or software functions interpret this sequence of 1’s and 0’s is defined by the data type. Binary numbers are used to represent either fixed-point or floating-point data types. A fixed-point data type is characterized by the word size in bits, the binary point, and whether it is signed or unsigned.
2 Using the IQmath Library Two’s complement is the most common representation of signed fixed-point numbers and is used by TI digital signal processors. Negation using signed two’s complement representation consists of a bit inversion (translation into one’s complement) followed by the binary addition of a 1.
Fixed-Point Numbers in this notation. This is (1 sign bit) + (m = 0 integer bits) + (n = 15 fractional bits) = 16 bits total in the data type. In Q format notation the m = 0 is often implied, as in Q.15 In the Fixed-Point Blockset, this data type is expressed as sfrac16 or sfix16_En15 In the Filter Design Toolbox, this data type is expressed as [16 15] Example — Q1.30 Multiplying two Q.15 numbers yields a product that is a signed 32-bit data type with n = 30 bits to the right of the binary point.
2 Using the IQmath Library to 7 bits with sign extension, the number becomes 1111101 and the value of the number remains the same. One bit is the designated sign bit, forcing m to be -2: m+n+1 = -2+17+1 = 16 bits total Therefore this number is expressed as Q-2.17 In the Fixed-Point Blockset, this data type is expressed as sfix16_En17 In the Filter Design Toolbox, this data type is expressed as [16 17] Example — Q17.-2 Consider a signed 16-bit number with a scaling of 2^(2) or 4.
Building Models Building Models You can use IQmath Library blocks in models along with certain core Simulink, Fixed-Point Blockset, and other blockset blocks. This section discusses issues you should consider when building a model with blocks from these different libraries. Converting Data Types As always, it is vital to make sure that any blocks you connect in a model have compatible input and output data types. In most cases, IQmath Library blocks handle only a limited number of specific data types.
2 Using the IQmath Library functionality that the IQmath Library block does not support, but you will generate code that is less optimized.
3 Block Reference Blocks — By Library (p. 3-2) Provides tables that list each block in the Embedded Target for C2000 DSP by library Blocks — Alphabetical List (p.
3 Block Reference Blocks — By Library C2400 DSP Chip Support Library (c2400dspchiplib) Block Description C24x ADC Configure analog to digital converters (ADC) C24x CAN Receive Configure enhanced Control Area Network receive mailbox C24x CAN Transmit Configure enhanced Control Area Network transmit mailbox C24x PWM Configure one or more pairs of pulse wave modulators (PWMs) C24x From Memory Retrieve data from specific memory location on the target C24x To Memory Write data to the specific memo
Blocks — By Library Block Description C28x From Memory Retrieve data from specific memory location on the target C28x To Memory Write data to the specific memory location on the target Target Preferences Library (c2000tgtpreflib) Block Description F2812 eZdsp Preferences for F2812 eZdsp™ DSK targets LF2407 eZdsp Preferences for LF2407 eZdsp™ DSK targets C28x IQmath Library (tiiqmathlib) Block Description Absolute IQN Calculate absolute value Arctangent IQN Calculate four-quadrant arc tange
3 Block Reference 3-4 Block Description IQN to Float Convert an IQ number to a floating-point number IQN x int32 Multiply an IQ number and a long integer IQN x IQN Multiply two IQ numbers with the same Q format IQN1 to IQN2 Convert an IQ number to a different Q format IQN1 x IQN2 Multiply two IQ numbers with different Q formats Magnitude IQN Calculate the magnitude of two orthogonal IQ numbers Saturate IQN Saturate an IQ number Square Root IQN Calculate the square root or inverse square
Blocks — Alphabetical List Blocks — Alphabetical List 3 Absolute IQN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-7 Arctangent IQN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-8 C24x ADC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-9 C24x CAN Receive . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3 3-6
Absolute IQN Purpose 3Absolute IQN Library tiiqmathlib in Embedded Target for TI C2000 DSP Description This block computes the absolute value of an IQ number input. The output is also an IQ number.
Arctangent IQN Purpose 3Arctangent IQN Library tiiqmathlib in Embedded Target for TI C2000 DSP Description This block computes the four-quadrant arc tangent of the IQ number inputs and produces IQ number output. Calculate the four-quadrant arc tangent IQmath A Y B IQNatan2 Arctangent IQN Function option — Type of arc tangent to calculate, either • atan2 — Compute the four-quadrant arc tangent with output in radians with values between -pi and +pi.
C24x ADC Purpose 3C24x ADC Generate code to configure the C24x analog-to-digital converter c2400dspchiplib in Embedded Target for TI C2000 DSP Description C24x ADC C24x ADC The C24x ADC block configures the C24x ADC to perform analog-to-digital conversion of signals connected to the selected ADC input pins. It outputs digital values representing the analog input signal and stores the converted values in the result register of your digital signal processor.
C24x ADC Dialog Box See Also 3-10 C24x PWM
C24x CAN Receive Purpose 3C24x CAN Receive Library c2400dspchiplib in Embedded Target for TI C2000 DSP Description The C24x Control Area Network (CAN) Receive block generates source code for receiving CAN messages through a CAN mailbox. The CAN module on the DSP chip provides serial communication capability and has six mailboxes — two for receive, two for transmit, and two configurable for receive or transmit. The C24x supports CAN data frames in standard or extended format.
C24x CAN Receive Sample time — Frequency with which the mailbox is polled to determine if a new message has been received. A new message causes a function call to be emitted from the mailbox. Data type — Type of the data in the 8-byte data vector. Valid values are uint16 or unit32. Output message length — Select to output the message length in bytes to the third output port. If not selected, the block has only two output ports.
C24x CAN Transmit Purpose 3C24x CAN Transmit Library c2400dspchiplib in Embedded Target for TI C2000 DSP Description The C24x Control Area Network (CAN) Transmit block generates source code for transmitting CAN messages through a CAN mailbox. The CAN module on the DSP chip provides serial communication capability and has six mailboxes — two for receive, two for transmit, and two configurable for receive or transmit.The C24x supports CAN data frames in standard or extended format.
C24x CAN Transmit Dialog Box See Also 3-14 C24x CAN Receive
C24x From Memory Purpose 3C24x From Memory Library c2400dspchiplib in Embedded Target for TI C2000 DSP Description This block retrieves data of the specified data type from a particular memory address on the target. Generate code that retrieves data from any valid memory address on the board, internal or external C24x From Memory Memory address — Address of the target memory location, in hexadecimal, C24x From Memory Data type — Data type of the data to obtain from the above memory address.
C24x PWM Purpose 3C24x PWM Library c2400dspchiplib in Embedded Target for TI C2000 DSP Description LF2407 DSPs include a suite of pulse width modulators (PWM) used to generate various signals. This block provides options to set the A or B module event managers to generate the waveforms you require. The twelve PWMs are configured in six pairs, with three pairs in each module.
C24x PWM Symmetric. The following illustration shows the difference between the two types of waveforms. Asymmetric waveform Pulse width value Resulting pulse waveform Symmetric waveform Pulse width value Resulting pulse waveform Enable PWM#/PWM# — Check to select the PWM pairs to activate Pulse width source — Source from which the pulse width is obtained. Select Specify via dialog to enter the value in Pulse width or select Input port to use a value from the input port.
C24x PWM Show additional parameters — Check to display the dialog box with additional PWM parameters PWM# control logic — Control logic trigger for the PWM. Active high causes the pulse value to go from low to high and Active low causes the pulse value to go from high to low.
C24x PWM Dialog Box See Also C24x ADC 3-19
C24x To Memory Purpose 3C24x To Memory Library c2400dspchiplib in Embedded Target for TI C2000 DSP Description This block sends data of the specified data type to a particular memory address on the target. C24x To Memory Memory address — Address of the target memory location, in hexadecimal, C24x To Memory Data type — Type of data to be written to the above memory address. Valid data types are double, single, int8, uint8, int16, uint16, int32, and uint32.
C24x To Memory Dialog Box See Also C24x From Memory 3-21
C28x ADC Purpose 3C28x ADC Library c2800dspchiplib in Embedded Target for TI C2000 DSP Description The C28x ADC block configures the C28x ADC to perform analog-to-digital conversion of signals connected to the selected ADC input pins. It outputs digital values reprensenting the analog input signal and stores the converted values in the result register of your digital signal processor.
C28x ADC Dialog Box See Also C28x PWM 3-23
C28x eCAN Receive Purpose 3C28x eCAN Receive Library c2800dspchiplib in Embedded Target for TI C2000 DSP Description The C28x enhanced Control Area Network (eCAN) Receive block generates source code for receiving eCAN messages through an eCAN mailbox. The eCAN module on the DSP chip provides serial communication capability and has 32 mailboxes configurable for receive or transmit.The C28x supports eCAN data frames in standard or extended format.
C28x eCAN Receive Sample time — Frequency with which the mailbox is polled to determine if a new message has been received. A new message causes a function call to be emitted from the mailbox. Data type — Type of the data in the 8-byte data vector. Valid values are uint16 or unit32. Output message length — Select to output the message length in bytes to the third output port. If not selected, the block has only two output ports.
C28x eCAN Transmit Purpose 3C28x eCAN Transmit Library c2800dspchiplib in Embedded Target for TI C2000 DSP Description The C84x enhanced Control Area Network (eCAN) Transmit block generates source code for transmitting eCAN messages through an eCAN mailbox. The eCAN module on the DSP chip provides serial communication capability and has 32 mailboxes configurable for receive or transmit. The C28x supports eCAN data frames in standard or extended format.
C28x eCAN Transmit See Also C28x eCAN Receive 3-27
C28x From Memory Purpose 3C28x From Memory Library c2800dspchiplib in Embedded Target for TI C2000 DSP Description This block retrieves data of the specified data type from a particular memory address on the target.
C28x PWM Purpose 3C28x PWM Library c2800dspchiplib in Embedded Target for TI C2000 DSP Description F2812 DSPs include a suite of pulse width modulators (PWM) used to generate various signals. This block provides options to set the A or B module event managers to generate the waveforms you require. The twelve PWMs are configured in six pairs, with three pairs in each module.
C28x PWM Symmetric. The following illustration shows the difference between the two types of waveforms. Asymmetric waveform Pulse width value Resulting pulse waveform Symmetric waveform Pulse width value Resulting pulse waveform Use PWM#/PWM# — Check to select the PWM pairs to activate Pulse width source — Source from which the pulse width is obtained. Select Specify via dialog to enter the value in Pulse width or select Input port to use a value from the input port.
C28x PWM Show additional parameters — Check to display the dialog box with additional PWM parameters PWM# control logic — Control logic trigger for the PWM. Active high causes the pulse value to go from low to high and Active low causes the pulse value to go from high to low.
C28x PWM Dialog Box See Also 3-32 C28x ADC
C28x To Memory Purpose 3C28x To Memory Library c2800dspchiplib in Embedded Target for TI C2000 DSP Description This block sends data of the specified data type to a particular memory address on the target. C28x To Memory Memory address — Address of the target memory location, in hexadecimal, to C28x To Memory Generate code that writes data to any valid memory address on the board, internal or external which to write data Data type — Type of data to be written to the above memory address.
C28x To Memory Dialog Box See Also 3-34 C28x From Memory
Division IQN Purpose 3Division IQN Library tiiqmathlib in Embedded Target for TI C2000 DSP Description This block divides two numbers that use the same Q format, using the Newton-Raphson technique. The resulting quotient uses the same Q format at the inputs.
F2812 eZdsp Purpose 3F2812 eZdsp Library c2000tgtpreflib in Embedded Target for TI C2000 DSP Description Options on the block mask let you set features of code generation for your Spectrum Digital F2812 eZdsp™ target. Adding this block to your Simulink model provides access to building, linking, compiling, and targeting settings you need to configure the code that Real-Time Workshop generates.
F2812 eZdsp BuildOptions — LinkerOptions • Create MAP File — Whether the linker produces a map of the input and output sections, including null areas, and places the listing in a file in your current directory with the name modelname.map. The default is True — the listing is produced. • Keep OBJ Files — Whether Real-Time Workshop and the Embedded Target for TI C2000 DSP save your object (.obj) files after creation. The linker uses object (.
F2812 eZdsp Full_memory_map. Note that your program might run more slowly than if you use the internal map option. BuildOptions — RunTimeOptions • Build Action — Action taken by Real-Time Workshop when you click Build or press Ctrl+B in the Simulation Parameters dialog box. The actions are cumulative — each listed action adds features to the previous action on the list and includes all the previous features: - Generate_code_only — Directs Real-Time Workshop to generate C code only from the model.
F2812 eZdsp - Continue — Ignore overruns encountered while running the model. This is the default. - Halt — Stop program execution. CCSLink • CCS Handle Name — Name of the CCS handle. Click in the edit box to change the name. When you use Real-Time Workshop to build a model for a C2000 target, Embedded Target for TI C2000 DSP makes a link between MATLAB and CCS.
F2812 eZdsp • DSP Chip - DSP Chip Label — DSP chip model. Select the DSP chip installed on your target. The chip model is fixed for the F2812 eZdsp. If you change the chip model, an error will be generated in code generation. - eCAN — Parameters that affect the extended control area network (eCAN) module. Most of these parameters affect the eCAN bit timing. The CAN protocol divides the nominal bit time into four segments, which are reflected in the settable parameters below.
F2812 eZdsp SAM — Number of samples used by the CAN module to determine the CAN bus level. Selecting Sample_one_time samples once at the sampling point. Selecting Sample_three_times samples once at the sampling point and twice before at a distance of TQ/2. A majority decision is made from the three points. SBG — Sets the message resynchronization triggering. Options are Only_falling_edges and Both_falling_and_rising_edges.
F2812 eZdsp CAN Bit Timing Nominal bit time SYNCSEG SJW SJW TSEG1 TSEG2 1 TQ Transmit point 3-42 Sample point
F2812 eZdsp Dialog Box See Also C28x ADC, C28x eCAN Receive, C28x eCAN Transmit, C28x PWM 3-43
Float to IQN Purpose 3Float to IQN Library tiiqmathlib in Embedded Target for TI C2000 DSP Description This block converts a floating-point number to an IQ number.
Fractional part IQN Purpose 3Fractional part IQN Library tiiqmathlib in Embedded Target for TI C2000 DSP Description This block returns the fractional portion of an IQ number. The returned value is an IQ number in the same IQ format.
Fractional part IQN x int32 Purpose 3Fractional part IQN x int32 Library tiiqmathlib in Embedded Target for TI C2000 DSP Description This block multiplies an IQ input and a long integer input and returns the fractional portion of the resulting IQ number.
Integer part IQN Purpose 3Integer part IQN Library tiiqmathlib in Embedded Target for TI C2000 DSP Description This block returns the integer portion of an IQ number. The returned value is a long integer.
Integer part IQN x int32 Purpose 3Integer part IQN x int32 Library tiiqmathlib in Embedded Target for TI C2000 DSP Description This block multiplies an IQ input and a long integer input and returns the integer portion of the resulting IQ number as a long integer.
IQN to Float Purpose 3IQN to Float Library tiiqmathlib in Embedded Target for TI C2000 DSP Description This block converts an IQ input to an equivalent floating-point number. The output is a single floating-point number.
IQN x int32 Purpose 3IQN x int32 Library tiiqmathlib in Embedded Target for TI C2000 DSP Description This block multiplies an IQ input and a long integer input and produces an IQ output of the same Q value as the IQ input.
IQN x IQN Purpose 3IQN x IQN Library tiiqmathlib in Embedded Target for TI C2000 DSP Description This block multiplies two IQ numbers. Optionally, it can also round and saturate the result. Multiply two IQ numbers IQmath A Y B IQNmpy IQN x IQN Multiply option — Type of multiplication to perform • Multiply — Multiply the numbers. • Multiply with Rounding — Multiply the numbers and round the result.
IQN1 to IQN2 Purpose 3IQN1 to IQN2 Library tiiqmathlib in Embedded Target for TI C2000 DSP Description This block converts an IQ number in a particular Q format to a different Q format.
IQN1 x IQN2 Purpose 3IQN1 x IQN2 Library tiiqmathlib in Embedded Target for TI C2000 DSP Description This block multiples two IQ numbers when the numbers are represented in different Q formats.
LF2407 eZdsp Purpose 3LF2407 eZdsp Library c2000tgtpreflib in Embedded Target for TI C2000 DSP Description Options on the block mask let you set features of code generation for your Spectrum Digital LF2407 eZdsp™ target. Adding this block to your Simulink model provides access to building, linking, compiling, and targeting settings you need to configure the code that Real-Time Workshop generates. LF2407 eZdsp Note This block must be in your model at the top level and not in a subsystem.
LF2407 eZdsp BuildOptions — LinkerOptions • Create MAP File — Whether the linker produces a map of the input and output sections, including null areas, and places the listing in a file in your current directory with the name modelname.map. The default is True — the listing is produced. • Keep OBJ Files — Whether Real-Time Workshop and the Embedded Target for TI C2000 DSP save your object (.obj) files after creation. The linker uses object (.
LF2407 eZdsp Full_memory_map. Note that your program might run more slowly than if you use the internal map option. BuildOptions — RunTimeOptions • Build Action — Action taken by Real-Time Workshop when you click Build or press Ctrl+B in the Simulation Parameters dialog box. The actions are cumulative — each listed action adds features to the previous action on the list and includes all the previous features: - Generate_code_only — Directs Real-Time Workshop to generate C code only from the model.
LF2407 eZdsp - Continue — Ignore overruns encountered while running the model. This is the default. - Halt — Stop program execution. CCSLink • CCS Handle Name — Name of the CCS handle. Click in the edit box to change the name. When you use Real-Time Workshop to build a model for a C2000 target, Embedded Target for TI C2000 DSP makes a link between MATLAB and CCS.
LF2407 eZdsp • DSPChip - CAN — Parameters that affect the control area network (CAN) module. Most of these parameters affect the CAN bit timing. The CAN protocol divides the nominal bit time into four segments, which are reflected in the settable parameters below. The four segments are SYNCSEG — Time used to synchronize the nodes on the bus.
LF2407 eZdsp and twice before at a distance of TQ/2. A majority decision is made from the three points. SBG — Sets the message resynchronization triggering. Options are Only_falling_edges and Both_falling_and_rising_edges. SJW — Sets the synchronization jump width, which determines how many units of TQ a bit is allowed to be shortened or lengthened when resynchronizing.
LF2407 eZdsp CAN Bit Timing Nominal bit time SYNCSEG SJW SJW TSEG1 TSEG2 1 TQ Transmit point 3-60 Sample point
LF2407 eZdsp Dialog Box See Also C24x ADC, C24x CAN Receive, C24x CAN Transmit, C24x PWM 3-61
Magnitude IQN Purpose 3Magnitude IQN Library tiiqmathlib in Embedded Target for TI C2000 DSP Description This block calculates the magnitude of two IQ numbers using Calculate the magnitude of two IQ numbers IQmath A Y B IQNmag 2 a +b 2 The output is an IQ number in the same Q format as the input.
Saturate IQN Purpose 3Saturate IQN Library tiiqmathlib in Embedded Target for TI C2000 DSP Description This block saturates an input IQ number to the specified positive and negative limits. The returned value is an IQ number of the same Q value as the input.
Square Root IQN Purpose 3Square Root IQN Library tiiqmathlib in Embedded Target for TI C2000 DSP Description This block calculates the square root or inverse square root of an IQ number and returns an IQ number of the same Q format. The block uses table lookup and a Newton-Raphson approximation.
Trig Fcn IQN Purpose 3Trig Fcn IQN Library tiiqmathlib in Embedded Target for TI C2000 DSP Description This block calculates basic trigonometric functions and returns the result as an IQ number. Valid Q values for IQsin and IQcos are 1 to 29. For all others, valid Q values are 1 to 30. Calculate the sine, cosine, or arc tangent IQmath A Y IQNtrig Trig Fcn IQN Function option — Type of trigonometric function to calculate. • _IQsin — Compute the sine (sin(A)), where A is in radians.
Trig Fcn IQN 3-66
Index A Absolute IQN block 3-7 ADC blocks C24x 3-9 C28x 3-22 analog-to-digital converter See ADC blocks applications TI C2000 1-2 Arctangent IQN block 3-8 asymmetric vs.
Index E ERT code generation 1-20 event manager timer 3-16 F F2812 eZdsp block 3-36 fixed-point numbers 2-3 Float to IQN block 3-44 floating-point numbers convert to IQ number 3-44 four-quadrant arctangent 3-8 Fractional part IQN block 3-45 Fractional part IQN x int32 block 3-46 From Memory block C24x 3-15 C28x 3-28 G general code generation 1-20 GRT code generation 1-20 H hardware 1-3 I Integer part IQN block 3-47 Integer part IQN x int32 block 3-48 IQ Math library 2-2 Absolute IQN block 3-7 Arctangent
Index L LF2407 eZdsp block 3-54 linker options 3-37 M Magnitude IQN block 3-62 mailbox 3-11 math blocks See also IQ Math library MathWorks software 1-4 memory reading C24x 3-15 C28x 3-28 messages F2812 eZdsp 3-24 LF2401 eZdsp 3-11 model add blocks 1-24 building overview 1-12 creation overview 1-10 IQmath library 2-7 multiplication IQN x int32 3-50 IQN x int32 fractional part 3-46 IQN x int32 integer part 3-48 IQN x IQN 3-51 IQN1 x IQN2 3-53 O operating system requirements 1-3 optimization code 2-7 P pre
Index software requirements 1-4 Square Root IQN block 3-64 startup c2000lib 1-14 T target configuration example 3-36 F2812 eZdsp 1-19 LF2407 eZdsp 3-54 target model creation 1-10 target preferences compiler options 3-36 DSP board options 3-39 linker options 3-37 Target preferences blocks F2812 eZdsp 3-36 LF2407 eZdsp 3-54 TI software 1-4 timing 1-8 CAN/eCAN 3-40 TLC debugging 1-19 To Memory blocks See C24x To Memory, C28x To Memory transmit 3-13 Trig Fcn IQN block 3-65 W waveforms 3-29 Index-4