MATLAB provides several examples, such as:
F281x based board: c281x_adcpwmasynctestc281x_adcpwmasynctest
F280x/F2823x/F2833x based board: c280x_2833x_adcpwmasynctest
Piccolo F2802x/F2803x/F2806x based board: c280xx_adcpwmasynctes
If you are not familiar with the use of DSP generated code, you can use it directly or modify it on this basis. This article uses the F281x based board: c281x_adcpwmasynctestc281x_adcpwmasynctest.
This example is almost entirely applicable to Code Composer Studio 3.3 ( CCSv3.3) , and you can directly press Ctrl+B to generate code. However, for Code Composer Studio 4 or 5 (CCSv4/5) , appropriate modifications need to be made.
The chip configuration module ( Target Preferences ) in the example has been removed in the later version of MATLAB . Instead, the method of selecting the chip model has been added to the Simulation > Model Configuration Parameters > Code Generation > Coder Target > Target Hardware Resources tab.
Press Ctrl+E to open the Model Configuration Parameters window, select Coder Target > Target Hardware Resources tab, and select the parameters appropriate for the chip.
However, it is not enough to just select the Target Hardware Resources parameter. MATLAB will report an error during the generation process and the code generation will fail. That means you also need to configure the MakeFile. Enter the xmakefilesetup command in the MATLAB command window. After a short wait, the XMake User Configuration window will appear.
After configuring the XMake User Configuration window accordingly, click the Build button ( Ctrl+B ) this time to generate code in the current folder of MATLAB . The file name is the model plus " _ticcs ". For example, the file name generated in this example is c281x_adcpwmasynctest_ticcs .
Please note that Code Composer Studio 4 or 5 (CCSv4/5) cannot generate Project files, only the MakeFile option.
|