++++++++++++++++++++++++++++++++++++
MATLAB Link for Code Composer Studio
++++++++++++++++++++++++++++++++++++
help ccsdsp % see list of commands with Matlab - CCS link
help ccshelp\write % find out more about individual command
To use ccs link, do these in matlab:
i) check your board configuration
>> [boardNum,procNum] = boardprocsel
ii) establish link to CCS
>> cc = ccsdsp('boardnum',boardNum,'procnum',procNum) %
create link to DSP board
^^^^^^^^
property of matlab object 'cc' (like field in
struct)
so, you set cc.boardnum = boardNum, ...
ccsdsp return an object (named 'cc' in this example), and you
would need it
for subsequent operation.
>> visible(cc, 1) % show CCS
iii) open ccs project, download program
>> cd(cc, 'C:\MATLAB6p5\toolbox\ccslink\ccsdemos\ccstutorial')
% change ccs working directory
>> open(cc,
'C:\MATLAB6p5\toolbox\ccslink\ccsdemos\ccstutorial\ccstut_6x11.pjt')
% open ccs project
>> load(cc, 'ccstut_6x11.out', 30) % download program to DSP
(note that alternatively you can do these in CCS. But if matlab can do
these, you can
automate the task with script)
iv) execute the code
>> insert(cc,'ccstut.c',64) % insert break point at file
'ccstut.c' line 64
>> delete(cc,'ccstut.c',64) % delete break point
>> run(cc,'run',30) % run your code
>> reload(cc) % reload program
v) read/write data between matlab and ccs
>> address(cc,'idat') % address of vaiable 'idat'
in your DSP program.
% idat has to be global
>> t=read(cc, address(cc, 'idat'), 'int16', 4)
% read DSP program variable 'idat' into
matlab
% type : int16 i.e. short
% count = 4
% place that in matlab variable 't'
then you can do anything you want in matlab to analyse 't'
(i.e. 'h')
>> write(cc, address(cc, 'idat'), int16(t))
% you know what it is :-)
vi) to disconnect
>> clear cc