This section will show you how to activate CCS under the Simulink.
- Create a new Simulink model.
- Open the Simulink library browser and add the "C6416DSK" from the "Target Preferences" group of the "Embedded Target for the TI TMS320C6000 DSP" Blockset (Please refer to Figure 1).
- Set the model to “Generate a CCS Project” in the Simulation->Configuration Parameters -> Build Action, as shown in the following picture:
We now need to create Simulink dedicated blocks to execute CCS commands. The first is the “Build”. We can do this in many ways: clicking Build icon, pressing Ctrl-B or in MATLAB® typing make_rtw. Given this command is available in MATLAB, we will create a custom block with this command.
- Drag in an empty subsystem into the model (Simulink->Ports & Subsystem-> Subsystem):
- Delete its contents :
- Format it:
- Give it a name. In our example we use “Generate Code & Create Project”
- Choose the shadow, colour etc…
- Right click on the Subsystem, choose “ Block Properties”. Go to the Callbacks tab, and under OpenFcn enter: “make_rtw;”, as shown in the following picture:
- Repeat this process for the following commands as follows:
Table 1
| Block Name |
CCS Command |
OpenFcn |
| Build |
Build in CCS: |
CCS_Obj.build; |
| Load |
Load Program in CCS: |
CCS_Obj.load([pwd,'\',bdroot,'_c6000_rtw\', bdroot, '.out']); |
| Run |
Run on target: |
CCS_Obj.run; |
| Halt |
Halt on target: |
CCS_Obj.halt; |
| Reset |
Reset target: |
CCS_Obj.reset; |
| Close Active Project |
Close Active Project |
close(CCS_Obj,[],'project') |
Your model should look as follows: