Introduction
Along with electronic technology unceasing progress, specially 3C (computer, correspondence, expense electron) the swift development, the electronic installation day by day digitization, the miniaturization and the integration, the embedded chip becomes the design development personnel’s first choice gradually. DSP takes the embedded chip the model to represent one, obtained the widespread application in the information industries domain.
Although DSP was the 3C product development provides the very good hardware to support the platform, but the designer still expenditure certain time grasped the DSP interior each kind of register’s correct establishment, the software programming method as well as the control algorithm design, this definitely will increase the product development difficulty, the extension product development cycle, thus influence development efficiency. Matlab Corporation embedded object module Embedded Target for TI C2000 DSP which develops using the control system then solves the above problem newest promoted in view of DSP, the user through uses this module, not only may carry on electric circuit’s system-level simulation, but may also translate the production corresponding C language code, and downloads to the goal board, the direct operating procedure, carries on the algorithm the exploration and the design mentality confirmation, raises the development efficiency.
Application flow
As one kind of special-purpose integrated development environment, Matlab Corporation newest promoted Embedded Target for TI C2000 DSP develops the platform to be able to let the designers carry on (half) the simulation, the algorithm exploration and the research directly in kind, as well as product reliable confirmation, thus reduced in the design performance history consumption effectively, sped up the prototype development speed. This platform has following several merits:
1) On TI C2000 DSP the test automation, carries out the Simulink simulation model;
2) Provides modular the system and the function, for instance PWM, ADC, CAN as well as the goal board carries the memory and so on;
3) The production documents legible may edit the C language code, and produces Code Composer the Studio item file;
4) Appraisal board and F2812 on the eZdsp appraisal board carry on the automated real-time test in F2407 the eZdsp;
5) IQmath Library which promotes to TI provides modular the support, may use in the simulation and the code generation;
6) May carry on fixed point system’s design, the simulation, the self-orienting and the code generation work.
Embedded Target for TI C2000 DSP has provided MATLAB and Simulink and TI the eXpressDSP tool, TI C2000 the DSP controller integrates is carrying on together the system development the method. Transforms through Real-Time Workshop and the TI development kit the Simulink model into the real-time C code, like this may use these products system (for example F2812 eZds appraisal board and F2407 eZdsp appraisal board and so on) realizes the automatic code production, the product prototype and the embedded system in TI C2000 on the DSP realizes, and may real-time carry on the algorithm confirmation, raised the development efficiency enormously. Moreover, this module also has formidable may the expansion capacity, the user be possible to increase own code, the interrupt service, the IO equipment actuates to CCS (Code Composer Studio) in the engineering project, like this may the direct drive develop the development voluntarily the control panel card or the third party hardware equipment board card, completes the product the design. Uses this platform, the development personnel does not need to compile line of codes, may complete nearly all designs, the simulation and the programming downloading work, entire development flow as shown in Figure 1.

Figure 1 Embedded Target for TI C2000 application flow schematic drawing
Embedded Target for TI C2000 DSP application example
Below take one based on DSP TMS320F2812 the chip belt CAN2.0B network interface’s digital inversion controller’s design as an example, introduced that uses Embedded Target for TI C2000 the DSP module, with in the Matlab Simulink product’s other module union, realizes to this contravariant controller carries on the simulation and the programming downloading application.
The digital invertor uses the single-phase half bridge inversion structure, inverts the controller core chip to select TMS320F2812, outputs two group SPWM, EXB841 modules to take the SPWM signal the actuation amplifier, the controlling switch uses all controls component IGBT, input voltage 311V, the output voltage is 100V (effective value), the turn-on frequency is 10kHz, the inversion output voltage frequency is 50Hz. The contravariant controller’s system principle and connection diagram as shown in Figure 2, the contravariant system’s electric current and the voltage examine separately through the voltage Hall sensor and the electric current sampling circuit, sends in the simulated signal processing electric circuit to carry on simulation filter processing and the peak-to-peak value adjustment, after the processing signal sends in the DSP chip, passes through DSP the internal 12 A/D transformation module, becomes the digital signal, DSP carries on the digital filtering after the signal, judgment single-phase half bridge’s output voltage, electric current whether to cross presses or the overflow, and takes the corresponding protective measures; Carries on processing again according to the control algorithm, through DSP internal PWM output module, obtains two group SPWM profile signal which needs, carries on processing after the EXB841 actuation enlargement module, finally inverts half bridge to IGBT to carry on
Control, thus realizes the direct-current - exchange inversion. Simultaneously also using DSP internal CAN2.0B module, retains a foreign CAN network interface, is advantageous for the use network service to carry on the real-time control and the monitor to the digital inversion controller.

Figure 2 DSP inversion controller connection schematic drawing
C language project frame chart
Inputs the c2000lib order under Matlab, may demonstrate Embedded Target for TI C2000 DSP present can support each kind of DSP functional module and related information. When simulation, mainly uses C28X ADC which, C28X PWM as well as the Mailbox submodule Embedded Target for TI C2000 DSP provides.
As shown in Figure 3, the system uses a/D transformation module, will gather the contravariant electric current and the voltage take the SPWM output the control source. And 1 transports through the CAN channel a/D transformation value as well as the PWM output dutyfactor, meanwhile may through the CAN channel 0 receives from the network correspondence order, carry out the corresponding subroutine. C28X the ADC module equates completely in the function in the TMS320F2812 12 A/D transformation module, may choose the appropriate analog input channel. C28X the PWM module equates completely in the function in the TMS320F2812 event supervisor the belt dead area entire comparison unit module, similarly may choose timer, the PWM output unit, the PWM pin polarity as well as the establishment dead time.

Figure 3 under Matlab DSP application module simulation and downloading schematic drawing
Before programming downloading, must module carry on the translation attribute, the goal board and simulator’s choice establishment first to F2812 the eZdsp, as well as the Real-Time Workshop attribute establishment, the concrete step is as follows:
1. Opens CCS2.20, chooses the appropriate hardware simulator, here chooses F2812 XDS510 Emulator, opens the DSP software integrated development environment.
2. inputs the ccsboardinfo order under Matlab to demonstrate that examined Embedded Target for TI C2000 DSP supports board card and actuation, if user promotion simulator or plate change card, then must install the corresponding driver, can support corresponding the physical equipment.
3. The right key clicks on F2812 eZDSP, to appraises the board hardware link module to carry on option and so on translation, link and movement establishments. The attention, when establishes the BuildOptions attribute, if has not connected the goal board or the simulator, then BuildAction only chooses Build, may translate produces the C code; If has the goal board and the simulator, then may choose Build_and_execute, realizes C code translation downloading and the real-time movement.
4. Chooses in the DSPBoard option with the goal board consistent DSP chip type, and changes the DSP board marking, like F2812 PP Emulator and so on, this article changes F2812 XDS510 Emulator.
5. Establishes Real-Time Workshop the related attribute, may act according to individual custom to carry on has custom-made.
After the above establishment step, may choose in the tool menu under Real-Time Workshop Build Model the production simulation model correspondence C language code, the Matlab Command window will demonstrate the background processing the detailed process, the code translation and the link
The process will also have the demonstration in CCS. Finally, CCS will open the software project code which automatically Matlab will produce, in CCS demonstrated the SPWM project’s frame (F2812_SPWM.pjt) as shown in Figure 4, altogether will have F2812_SPWM_ main.c and so on 14 C language subroutine, the SPWM.cmd document and some documents. Produces the contravariant controller C code, retained in the model corresponding variable, has the good readability and the maintainability, produces the CAN correspondence the main source code to be as follows:
/* CAN mailbox transmission subroutine */
{
ECanaMboxes.MBOX1.MDL.word. LOW_WORD=F2812_SPWM_B.R eadMsgADValueDutyCycle;
ECanaMboxes.MBOX1.MSGC TRL.bit.DLC = 2;
ECanaRegs.CANTRS.bit.TRS1 = 1; // set eCAN Transmit Request Set register
while (ECanaRegs.CANTA.bit.TA1! = 1) {} // check eCAN Transmit Acknowledge register
ECanaRegs.CANTA.bit.TA1 = 1; // clear eCAN Transmit Acknowledge register
}

Figure 4 in CCS automatic production
Moreover, the Build/Reload/Run module which provides with Embedded Target for TI C2000 DSP, may reach one’s goal instantly language code transfers Matlab the production C the COFF document to download directly to the DSP inversion controller’s goal board, cannot make two to develop under the platform the procedure transplant. If has the special demand, but may also increase some codes voluntarily. This may avoid the tedious programming step, carries on the online algorithm confirmation directly, gains the most superior control procedure to realize finally.
Conclusion
This article introduced DSP unifies Matlab the application example to be more typical. Embedded Target for TI C2000 which provides using Matlab DSP module, but may also complete to based on the DSP three-phase contravariant controller, the motor control or the robot and so on other more complex control system’s simulation, direct programming downloading and the algorithm design confirmation, realizes DSP system development reaching one’s goal instantly. This method simple effective, the performance-to-price ratio is high, the development cycle short, the applicable scope is broad, has certain reference value and the versatility.