Hello group This how i have been trying to accept data from the simulator(Sim30) to MATLAB unfortunately it is not working. the following matlab code is an example for a sampled swept frequency wave which is fed to a the C30 simulator. The C30 simulator program generates an output file which is then processed by Matlab to display the frequency response. ----------------- clear,clc %get data to matlab produced by C30 simulator fid = fopen('out1.dat','r'); dsim1 = fscanf(fid,'%x'); fclose('all'); %perform conversion from 2s complement % This is required due to incompatibility between the % SIM30 and MATLAB if dsim1~=[] i=find(dsim1>=2^31); dsim1(i)=dsim1(i)-2^32; end %save to MAT file save iir.mat dsim1 -------------- Halle --- manoj cherukat <> wrote: > Hi, > halle i think what u want to do is, generate some > test data in matlab, which should be loaded as a i/p > in simulator, and then the o/p of sim should be able > to use by matlab , isn't it? > well, use the memory save command from simulator , > the data will be saved as obj file, this obj file > contains some header portion and the rest will be > data , better open the obj file in VC++, and scroll > through, u will notice that ur data is indeed there, > now it has to be converted to some txt file so that > it can be read in matlab... > obj files donot have EOF charecter, but the length > is stored somewhere in the header, locate that, & > starting from the first data, write this to a txt > file till the length which u got from header. > and presto! u got the txt file which can be used in > matlab > feel free to contact me in case u have furthur > doubts.. > bye > manoj > ----- Original Message ----- > From: Weiguo.Chen > To: Keith E. Larson ; S H ; > Sent: Thursday, November 01, 2001 9:17 PM > Subject: [c3x] Re: TMS320C30 simulator (sim30) > hi,Halle > I noticed that mathworks and TI have > cooperated on the co-work of > CCS and Matlab. Seems that have a tool kit for > simulation with ccs and > matlab together.you can visit www.mathworks.com > good luck > wgchen > > -----????----- > ???: Keith E. Larson [mailto:] > ????: 2001?11?1? 23:22 > ???: S H; > ??: [c3x] Re: TMS320C30 simulator (sim30) > Hi Halle > > I am not a Matlab user, but I can tell you a > little bit about the TI > simulator. Basicaly I dont use the simulator that > much, but have had to use > it from time to time. > > SIM30 code is generated with the TI C-compiler or > assembler and then loaded > in COFF format. Data can also be embedded into > the executable COFF file, > but is usualy loaded point by point via a data > file that is connected to a > probe point (a breakpoint that is tagged with a > different attribute). > Another option requiring a little bit of COFF > knowledge is to move an entire > data set in a COFF file of data only. Similarily > output is either in the > form of a data or coff file. > > Note that MatLab can be used for the following > making your original question > a bit vague. > > - Create a C source representing your design > - Create coefficients and an input data set > - Create an input output data stream > > The last would require a handshake between the two > tools. If not one or the > other would speed on past and the data would > become unsynchronized. I dont > think MATLAB or SIM30 has handshaking built in so > I imagine this would be a > kludge. Example > > SIM30 stops at probe point and reads a software > gate switch > (a one or zero) from an IO file. SIM30 advances > on switch > transistion... NOT LEVEL > > MATLAB writes data to/from IO file > > MATLAB changes state of switch allowing SIM30 to > continue > > Repeat... > > Then again, MatLab might be able to call SIM30 as > a background task (no > GUI)... I dont know. I think you need to > enlighten me more with what you > are trying to do > > And, BTW, if you have a DSK, the source code can > be modified (hopefully by > you) to do anything required. I dont want to say > 'I' here since this is not > my project and my schedule these days is pretty > full. > > Best regards, > Keith Larson > ================================================ > At 03:44 AM 11/1/01 -0800, you wrote: > >Hi Keith > > > >Sorry to bother you but I need your help/guidance > > > >I am trying to simulate pulse amplitude > modulation > >(PAM) using the TI TMS320C30 DSP simulator > (SIM3X). > > > > > >My plan is to generate a source file from within > >matlab (version 5.3) send the information into > the > >Sim3x (the sim30 will PAM modulate the data) and > >receive it back into matlab workspace and display > it > >using matlab command. > > > >I've been trying to do this but without any > success! > > > >My question is do I need a software driver to > >interface matlab and the sim30 (DSP simulator) or > it > >can be done without any driver software! > > > > > >Thanks for your help. > > > >Halle > > > > > > >__________________________________________________ > > > _____________________________________ > Note: If you do a simple "reply" with your email > client, only the author of this message will receive > your answer. You need to do a "reply all" if you > want your answer to be distributed to the entire > group. > > _____________________________________ > About this discussion group: > > To Join: Send an email to > To Post: Send an email to > > To Leave: Send an email to > Archives: http://groups.yahoo.com/group/c3x > > More Groups: http://www.dsprelated.com > ">http://docs.yahoo.com/info/terms/ > > > _____________________________________ > Note: If you do a simple "reply" with your email > client, only the author of this message will receive > your answer. You need to do a "reply all" if you > want your answer to be distributed to the entire > group. > > _____________________________________ > About this discussion group: > > To Join: Send an email to === message truncated === |