DSPRelated.com
Forums

Fw: Re: 6713DSK EMIF

Started by Wave Waves March 13, 2010
Dear Williams ;
Thanks a lot man ;
I knew that i reduced the FFTr2.c code on the main(),because i doesn't work and i wanted to just make drive the EMIF interface and see some getting high and lowon my logic analyzer on DSK output ;
But the point is why even the EMIF.out on EMF folder is not even working !!!(Whish is for chassing's cd) !!!!!![why should chassing put an uncomplete code for graphic_FFT. c program to make trouble for us :(  !!!]
 
There's no problem wit my pcb for 32 LED for sure ;
 
So i will test all of your suggested codes and let you all know about it ;
 
Best Wishes.
wAVe
 
 

--- On Fri, 3/12/10, Richard Williams wrote:
From: Richard Williams
Subject: Re: [c6x] 6713DSK EMIF
To: "Wave Waves"
Cc: c...
Date: Friday, March 12, 2010, 7:33 PM
 

Wave,

I took an initial look at your source listing and read the book about the graphic_FFT. c program.

Your source listing is missing most (nearly all) of the code from the main() function of FFTr2.c

That will have to be added as that is what is inputing the signal, performing the FFT radix2, unscrambling, and saving the information that will be used in driving the outputs to the EMIF interface.

Begin of missing code:------- -

for( i = 0 ; i < const(N/RADIX) ; i++ ) 
{
W[i].re = cos(DELTA*i) ;            //real component of W
W[i].im = sin(DELTA*i) ;            //neg imag component
} // end for(i)                    //see cfftr2_dit

digitrev_index( iTwid, N/RADIX, RADIX);//produces index for bitrev() W 
bitrev(W, iTwid, N/RADIX);          //bit reverse W 
 
comm_poll();                        //init DSK,codec,McBSP

for(i=0; i
while (1)                           // begin infinite loop
{
                                 
for( i=0; icollect 256 samples
{
x[i].re = (float)((short) input_left_ sample()) ; //external input
x[i].im = 0.0 ;   //zero imaginary part

/*---------- --------- --------- --------- --------- --------- -*\
** following deleted: was used in FFTr2.c
** for outputting the magnitude values.
** note: this may corrupt sample rate,
** if removal corrupts the sample rate
** then will have to be put back into code
\*---------- --------- --------- --------- --------- --------- -*/            
//if(i==0)  
//output_sample( 32000);   //negative spike for reference
//else
//output_left_ sample((short) Xmag[i]);    //output magnitude
//} // end if(==0)
/*---------- --------- --------- --------- --------- --------- -\*
** end deleted
\*---------- --------- --------- --------- --------- --------- -*/
                    
} // end for(i
cfftr2_dit(x, W, N ) ;                //TI floating-pt complex FFT 
digitrev_index( iData, N, RADIX);      //produces index for bitrev() X 
bitrev(x, iData, N);                  //freq scrambled->bit- reverse x

for (i=0; i256 entries
Xmag[i] = -sqrt(x[i].re* x[i].re+x[ i].im*x[i] .im)/32; //magnitude of X

End of missing code:------- -

The above would be followed by :
Begin new code for graphic_FFT: ------

out = 0;                 //init frequency spectrum signal
for(i=0; ifor each data point
{

// accumulate frequency spectrum signal bits
if (Xmag[i] > 20000.0)   //if data point greater than threshold
{
out += (1<then, set appropriate bit
} // end if(>20000)

} // end for(i)

*output = out;           //send frequency spectrum signal to EMIF bus

 
} // end while(forever)

End new code for graphic_FFT: -------

Note:
1) my mods (comments or code) prefixed with
2) I suggest that N/RADIX be defined as a constant
....then the compiler will perform the calculation
....rather than repeating the calculation over and over
....during run time
3) the line "for(i=0; i ....iterates 64 times but the variable 'out' only has 32 bits.
....this WILL cause a runtime problem for higher input frequencies,
....so I suggest reducing the iteration count to 32.
4) *I* would rewrite this code to use an interrupt to input the data
....and double buffer the data
....rather than that free-wheeling loop that is currently in the code.

R. Williams

---------- Original Message -----------
From: Wave Waves
To: Richard Williams
Sent: Thu, 11 Mar 2010 23:54:01 -0800 (PST)
Subject: Re: [c6x] 6713DSK EMIF

>

> Dear Williams ;
> I loaded the EMIF.out of this book directly on the exact circuit of 32 LED which is described on Chassing book (only four 74ls244 buffer and some mics).This EMIF.out is not even work ,which is for testing EMIF peripheral ;
> The graphic_FFT. pjt is not complete in this book and i made a it complete and just attachedd that for you ;
> The question is what is simlest program for 6713DSK to make the EMIF 80 pins interface high and low voltages ?!How can we drive the EMIF ?!
> Anyway,I think the code is not complete enough.something is missing ;
> There is no problem in hadware.
>  
> Best Regards.
> wAVe
>
> --- On Fri, 3/12/10, Richard Williams wrote:
>
> From: Richard Williams
> Subject: Re: [c6x] 6713DSK EMIF
> To: "Wave" , c6x@yahoogroups. com
> Date: Friday, March 12, 2010, 2:45 AM
>
> Wave,
>
> Since the projects in the book are well known to work...
> Since your usage of the same projects is not working...
>
> What is different about your setup?
> Did you type the code into CCS or copy it from the CD?
> What have you done to debug the problem?
>
> We cannot be of much help without specifics.
> For instance exactly what is the problem?
> What have you done to debug the problem?
> Are you using exactly the same hardware as specified in the book or just something close?
>
> R. Williams
>
> ---------- Original Message -----------
> From: "Wave"
> To: c6x@yahoogroups. com
> Sent: Thu, 11 Mar 2010 22:22:24 -0000
> Subject: [c6x] 6713DSK EMIF
>
> >  
> >
> > Hi everyone ;
> > Is there anyone who knows that why the test file (EMIF.out) and Spectrum analyzer via32 LED (graphic_FFT. pjt) out file is not really working on 32 led on output of 74ls244 buffer on EMIF interface of 6713DSK ;
> > These codes are belong to rulph chassing 6713 & 6416 DSK book ;
> > Please Help ...
> > Best Regards.

------- End of Original Message -------
Wave,

Before trying to run the complete program, you might want to perform some debug to assure that the EMIF interface is properly setup.

I do suspect your code problem is that all the xmax values were zero because the code never input anything.

R. Williams

---------- Original Message -----------
From: Wave Waves
To: c...
Sent: Fri, 12 Mar 2010 22:17:25 -0800 (PST)
Subject: Fw: Re: [c6x] 6713DSK EMIF

>

>
> Dear Williams ;
> Thanks a lot man ;
> I knew that i reduced the FFTr2.c code on the main(),because i doesn't workand i wanted tojust makedrive the EMIF interface and see some getting high and lowon my logic analyzer on DSK output ;
> But the point is why even the EMIF.out on EMF folder is not even working !!!(Whish is for chassing's cd)!!!!!![why should chassing put an uncomplete code for graphic_FFT. c program to make trouble for us :( !!!]
>
> There's no problem wit my pcb for 32 LED for sure ;
>
> So i will test all of your suggested codes and let you all know about it ;
>
> Best Wishes.
> wAVe
>
>
>
> --- On Fri, 3/12/10, Richard Williams wrote:
>
> From: Richard Williams
> Subject: Re: [c6x] 6713DSK EMIF
> To: "Wave Waves"
> Cc: c...
> Date: Friday, March 12, 2010, 7:33 PM
>
>
>
> Wave,
>
> I took an initial look at your source listing and read the book about the graphic_FFT. c program.
>
> Your source listing is missing most (nearly all) of the code from the main() function of FFTr2.c
>
> That will have to be added as that is what is inputing the signal, performing the FFT radix2, unscrambling, and saving the information that will be used in driving the outputs to the EMIF interface.
>
> Begin of missing code:------- -
>
> for( i = 0 ; i < const(N/RADIX) ; i++ )
> {
> W[i].re = cos(DELTA*i) ; //real component of W
> W[i].im = sin(DELTA*i) ; //neg imag component
> } // end for(i) //see cfftr2_dit
>
> digitrev_index( iTwid, N/RADIX, RADIX);//produces index for bitrev() W
> bitrev(W, iTwid,N/RADIX); //bit reverse W
>
> comm_poll(); //init DSK,codec,McBSP
>
> for(i=0; i >
> while (1) // begin infinite loop
> {
>
> for( i=0; icollect 256 samples
> {
> x[i].re = (float)((short) input_left_ sample()) ; //external input
> x[i].im = 0.0 ; //zero imaginary part
>
> /*---------- --------- --------- --------- --------- --------- -*\
> ** followingdeleted: was used in FFTr2.c
> ** for outputting the magnitude values.
> ** note: this may corrupt sample rate,
> ** if removal corrupts the sample rate
> ** then will have to be put back into code
> \*---------- --------- --------- --------- --------- --------- -*/
> //if(i==0)
> //output_sample( 32000); //negative spike for reference
> //else
> //output_left_ sample((short) Xmag[i]); //output magnitude
> //}// end if(==0)
> /*---------- --------- --------- --------- --------- --------- -\*
> ** end deleted
> \*---------- --------- --------- --------- --------- --------- -*/
>
> } // end for(i >
> cfftr2_dit(x, W, N ) ; //TI floating-pt complexFFT
> digitrev_index( iData, N, RADIX); //produces index for bitrev() X
> bitrev(x, iData, N); //freq scrambled->bit- reverse x
>
> for (i=0; i256 entries
> Xmag[i] = -sqrt(x[i].re* x[i].re+x[ i].im*x[i] .im)/32; //magnitude of X
>
> End of missing code:------- -
>
> The above would be followed by :
> Begin new code for graphic_FFT: ------
>
> out = 0; //init frequency spectrum signal
> for(i=0; ifor each data point
> {
>
> // accumulate frequency spectrum signal bits
> if (Xmag[i] > 20000.0) //if data point greater than threshold
> {
> out += (1<then,set appropriate bit
> }// end if(>20000)
>
> }// end for(i)
>
> *output = out; //send frequency spectrum signal to EMIF bus
>
>
> } // end while(forever)
>
> End new code for graphic_FFT: -------
>
> Note:
> 1) my mods (comments or code) prefixed with
> 2) I suggest that N/RADIX be defined as a constant
> ....then the compiler will perform the calculation
> ....rather than repeating the calculation over and over
> ....during run time
> 3) the line "for(i=0; i > ....iterates 64 times but the variable 'out' only has 32 bits.
> ....this WILL cause a runtime problem for higher input frequencies,
> ....so I suggest reducing the iteration count to 32.
> 4) *I* would rewrite this code to use an interrupt to input the data
> ....and double buffer the data
> ....rather than that free-wheeling loop that is currently inthe code.
>
> R. Williams
>
> ---------- Original Message -----------
> From: Wave Waves
> To: Richard Williams
> Sent: Thu, 11 Mar 2010 23:54:01 -0800 (PST)
> Subject: Re: [c6x] 6713DSK EMIF
>
> > > Dear Williams ;
> > I loaded the EMIF.out of this book directly on the exact circuit of 32 LED which is described on Chassing book (only four 74ls244 buffer and some mics).This EMIF.out is not even work ,which is for testing EMIF peripheral ;
> > The graphic_FFT. pjt is not complete in this book and i made a it complete and just attachedd that for you ;
> >The question is what is simlest program for 6713DSK tomake the EMIF 80 pins interface high and low voltages ?!How can we drive the EMIF ?!
> > Anyway,I think the code is not complete enough.something is missing ;
> > There is no problem in hadware.
> >
> > Best Regards.
> > wAVe
> >
> > --- On Fri, 3/12/10, Richard Williams wrote:
> >
> > From: Richard Williams
> > Subject: Re: [c6x] 6713DSK EMIF
> > To: "Wave" , c6x@yahoogroups. com
> > Date: Friday, March 12, 2010, 2:45 AM
> >
> > Wave,
> >
> > Since the projects in the book are well known to work...
> > Since your usage of the same projects is not working...
> >
> > What is different about your setup?
> > Did you type the code into CCS or copy it from the CD?
> > What have you done to debug the problem?
> >
> > We cannot be of much help without specifics.
> > For instance exactly what is the problem?
> > What have you done to debug the problem?
> > Are you using exactly the same hardware as specified in the book or just something close?
> >
> > R. Williams
> >
> >
> >
> > ---------- OriginalMessage -----------
> > From: "Wave"
> > To: c6x@yahoogroups. com
> > Sent: Thu, 11 Mar 2010 22:22:24 -0000
> > Subject: [c6x] 6713DSK EMIF
> >
> > >
> > >
> > > Hi everyone ;
> > > Is there anyone who knows that why the test file (EMIF.out) and Spectrum analyzer via32 LED (graphic_FFT. pjt) out file is not really working on 32 led on output of 74ls244 buffer on EMIF interface of 6713DSK ;
> > > These codes are belong to rulph chassing 6713 & 6416 DSK book ;
> > > Please Help ...
> > > Best Regards.
> >
> > ------- End ofOriginal Message -------

------- End of Original Message -------