The objective of this blog is to generate the coding and output file for required [TMS320F2812] processor from C2000 generation of Texas Instrument.
This blog describes how to use the Embedded Target [TMS320F2812] for TI C2000 to create an application on Texas Instruments DSP development boards.
- MATLAB R2011b 32-bit with Embedded Coder
- Code Composer Studio V4.2.1.00004 and later
Install the MATLAB and Code Composer Studio in the default directories don’t change it during installation.
Note: A minimum system requirement is Windows 7 OS 32-bit with 2GB RAM and 5GB free space in installation driver to run smoothly.
Hardware used in this tutorial is TMS320F2812 DSP Development board from the Pantech Prolabs India Pvt Ltd.
This same tutorial can also support for the below kits,
About Code generation
Matlab R2010a and CCSv3.3 can also use to generate the code for CCS project (.pjt) but the problem is CCSv3.3 can be installed properly only in Windows XP 32 bit machines. If you have Windows XP 32 bit machine then you can go ahead with Matlab R2010a and CCSv3.3 setup. We already have a solution for that setup.
Few examples Video Tutorial Link:
Programming Switch & LED in TMS320F2812 Using MATLAB
Generation of Six Fixed PWM Using MATLAB for TMS320F2812 DSP
This blog example shows how to use the XMakefile functionality to generate and build code from a simple model using a makefile. You will configure your model to generate code for a Texas Instruments (TI) processor and to build with a Texas Instruments Code Composer Studio (CCS) tool chain.
Before precede this makefilegeneration tutorial watch this video tutorial link:
- Open Matlabr2011b
- Type xmakefilesetup in matlab command window and enter.
- XMakefile User Configuration windows appear,
- Template – gmake
- Configuration – ticcs_c2000_ccsv4 and uncheck the Display operational configurations only
In Tool Directives choose the CCS Installation, Code Generation Tools and DSP/BIOS Installation path.
- Click ok
- File – New – Model
- Open the Simulink and go to the Embedded Coder.
- Embedded Target – Right click the Target Preference and to the untitled model file.
- Double Click the Target and set as the following figure
- Click yes.
- Embedded Target – Processor – Texas Instruments C2000 – C281x – add the Digital Input and Digital Output block.
- Double the individual block set as in the following respective figure
- Click ok.
Note: Digital Input choose A11,A12,A13,A14 and Digital Output choose F11,F12,F13,F14 because switches and led’s are connected respectively in TMS320F2812 DSP Development board
- Go to Simulation – Configuration parameter – IDE Link keep the setting as in below figure
- Click ok.
- File – Save – filename.mdl [save it in matlab default path].
- Click Incremental build.
In Matlab command window print the text as status about the make file generation for TMS32OF2812.
- Minimize the MATLAB or we may close it.
Code Composer Studio
- Open Code Composer Studiov4 and any default workspace path.
- View – Target configuration file.
- Right click user defined – NewTargetConfiguration – finish.
- Connection – Texas Instruments XDS100v1 USB Emulator.
- Device – TMS320F2812.
- Click Save.
- Right click NewTargetConfiguration.ccxml – Launch selected Configuration.
- Right click Thread [main] (Disconnected (Suspended)) – Connect Target.
- Target – Load program – Browse the default MATLAB path and you have the folder name of filename_ticcs open it – go to the CustomMW folder [because inside this folder out file is generated] and choose filename.out – open – then click ok.