This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

How do I convert Simulink code to a CCS project?

Part Number: TMS320F280049C

Hello, 

I have a question that you can help me with it. 

I want to write the basic software code for peripherals in code composer (like enabling PWMs, I/Os, ADC,CAN, ....) but I want to write my control strategy algorithms in MATLAB Simulink. I want to define some inputs/outputs in my model in Simulink and have the same ones with the same names in the basic software that I developed in Code Composer. 

My question is that if I convert the Simulink file to C code, then how can I make these two codes as one project and program it to the DSP? What is your best suggestion for me? 

thanks, 

Parisa

  • Parisa,

    When Simulink creates a code for the C2000 it will create a full CCS project that can be opened natively in CCS IDE.  The diagnostic view will give all the relevant path info, but in my case it created the example at C:\Users\your_username\project_name\  

    All the source, C, H, pjt, cmd files should be here.  Once you open this in CCS it should be fairly straightforward to find the functions for the math functions you have created in Simulink.  You could then extract these into functions and put them in your native CCS started project to be called by you C code.

    Best,

    Matthew