DSPRelated.com
Forums

urgently needing the solution:about file IO in ccs

Started by sandipbiranwar May 15, 2005
hi,
I'm working on the simulator c54x(ccs v2). In my c code i'm inputing
two *.dat files through probe points and also taking the output in
two *.dat files . I'v converted the wav file to dat file through c
code and store them in teh project folder and included the ccs header
into the dat files. when i'm
running code, i get this message

open error: Invalid file ID (32768)in CIO message!

The code for the programm is #include <stdio.h>
#include <stdlib.h>

#define NO_OF_TAPS 700
#define STEP_SIZE 0.09
#define BUFFSIZE 300

int input1[BUFFSIZE];
int input2[BUFFSIZE];
int output1[BUFFSIZE];
int output2[BUFFSIZE];
float mue=STEP_SIZE;
int M=NO_OF_TAPS;

static void dataIO();
static void lms_algorithm();

void main()
{
FILE *fp;
fp=fopen("base.dat","rb");

while(!feof(fp))
{
dataIO(); /* here i'm putting probe point */

lms_algorithm();
}
}

static void dataIO()
{
/* do data IO */
return;
}

static void lms_algorithm()
{
int size=BUFFSIZE;
int i,j;
float W[300]={0.0};

while(size--)
{
for(i=0;i<M;i++)
output1[size] = output1[size] + W[size]*input1
[size-i];

output2[size]=input2[size]-output2[size];

for(j=0;j<M;j++)
W[size]=mue*input1[size]*output2[size];
}
return;
}
How anyody help me in this regurd.


just give us the dat file.
There may be something wrong in that file.

Chao Xiang

>From: "sandipbiranwar" <sandipbiranwar@sand...>
>To: code-comp@code...
>Subject: [code-comp] urgently needing the solution:about file IO in ccs
>Date: Sun, 15 May 2005 11:20:00 -0000
>
>hi,
>I'm working on the simulator c54x(ccs v2). In my c code i'm inputing
>two *.dat files through probe points and also taking the output in
>two *.dat files . I'v converted the wav file to dat file through c
>code and store them in teh project folder and included the ccs header
>into the dat files. when i'm
>running code, i get this message
>
>open error: Invalid file ID (32768)in CIO message!
>
>The code for the programm is >#include <stdio.h>
>#include <stdlib.h>
>
>#define NO_OF_TAPS 700
>#define STEP_SIZE 0.09
>#define BUFFSIZE 300
>
>int input1[BUFFSIZE];
>int input2[BUFFSIZE];
>int output1[BUFFSIZE];
>int output2[BUFFSIZE];
>float mue=STEP_SIZE;
>int M=NO_OF_TAPS;
>
>static void dataIO();
>static void lms_algorithm();
>
>void main()
>{
> FILE *fp;
> fp=fopen("base.dat","rb");
>
> while(!feof(fp))
> {
> dataIO(); /* here i'm putting probe point */
>
> lms_algorithm();
> }
>}
>
>static void dataIO()
>{
> /* do data IO */
> return;
>}
>
>static void lms_algorithm()
>{
> int size=BUFFSIZE;
> int i,j;
> float W[300]={0.0};
>
> while(size--)
> {
> for(i=0;i<M;i++)
> output1[size] = output1[size] + W[size]*input1
>[size-i];
>
> output2[size]=input2[size]-output2[size];
>
> for(j=0;j<M;j++)
> W[size]=mue*input1[size]*output2[size];
> }
> return;
>} >
>How anyody help me in this regurd. >
>