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 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" , c...
> 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: c...
> 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 -------
_____________________________________