
There are 2 messages in this thread.
You are currently looking at messages 0 to 2.
I have designed a FIR filter by Matlab, and saved the filer coefficients as a data file. I want to utilize these coefficients on 6711DSK board to do some calculation. But when I load the coefficient data file to CCS,CCS showed the data file can not be open. I don't know why I am always expecting your answer. 3x______________________________
p...@mir.knu.ac.kr (p...@mir.knu.ac.kr) wrote in message news:<9...@posting.google.com>... > I have designed a FIR filter by Matlab, and saved the filer > coefficients as a data file. > I want to utilize these coefficients on 6711DSK board to do some > calculation. > But when I load the coefficient data file to CCS,CCS showed the > data file can not be open. > I don't know why > I am always expecting your answer. > > > 3x CCS for the '54X has a specific text format that it expects the data to be arranged in. The first line must contain a magic number and a length, if I remember correctly. The format is the same as what you get in saving memory to a file. It should be documented in the online help. Alternatively, you can write a simple m-file to write out a .c file that declares an intialized array, and add that file to your project. I always use this method. Here is some sample matlab code: function stat = csave(c,vname,hdr1,hdr2,fname) format long; fid = fopen(fname,'wt'); fprintf(fid,hdr1); fprintf(fid,'\n\n'); fprintf(fid,hdr2); fprintf(fid,sprintf('\n\n#define\tN%s\t%d\n',upper(vname),length(c))); fprintf(fid,sprintf('\nconst WORD %s[N%s] = {\n',vname,upper(vname))); for m=1:(length(c)-1) fprintf(fid,'\t%d,\n',c(m)); end fprintf(fid,'\t%d\n',c(end)); % no comma fprintf(fid,'};\n'); stat=fclose(fid); return Hope this is helpful. John______________________________