DSPRelated.com
Forums

spectrum analyser project.

Started by mill...@btinternet.com April 3, 2011
Hello all once again.

from my previous post a few months ago, i have progressed my audio spectrum analyser ( this is for my Degree project). I am at the stage where i have got an audio signal sampled, buffered and started on my FFT routine. I have decided to use the Raddix 2 DIT routine. I have got the stage where i have calculated twiddle factors, bit reversal index and sampled the audio signal. Now trying to implement the TI c routine for radix 2 FFT. Due to version of CCS i am unable to use the libraries so have used just the C version of the code from the comments section. When i come to add this c code, it will compile and download, when switched to run on CCS, the program freezes and will not run. Most of the time CCS will crash aswell and ask to rest the board. If i remove the FFT routine then the rest of the code will run ok. Sometimes with the FFT routine it will run once through, but then will not. ( i am monitoring the output signal to a set of speakers as well.)

In the comments it mentions using seperate memory banks to store the data and factors, i have also read this on a post on this site, but am usure how to do this, please can you advise. I am using C6711GFN on the DSP starter kit and PCM3003 audio daughter card.

I have also attached below a copy of my code, to assist with my issue.

So to recap my questions are :
1.how do i specify different memory banks to store the data.
2. Is my code crashing due to the memory banks issue or the loction of the call, if not any other ideas?
3. Any comment that can assit me in my code development.

I thank you in advance for your assistance and is much appreciated.

duncan

/*************************************************************************
* Includes *
*************************************************************************/

#include
#include
#include
#include
#include
#include
#include
#include
#include

#define N 128 //number of FFT points
#define ARGU (2*PI)/N //argument for sine/cosine
#define PI 3.14159265358979 //definition of value of Pi.
short i = 0;
typedef struct Complex_tag {float re,im;}Complex;
Complex W[N/2]; //array for twiddle constants
#define RADIX 2
short iTwid[N/2]; //index for twiddle constants W
short iData[N]; //index for bitrev X
float Xmag[N]; //magnitude spectrum of x
Complex x[N]; //N complex data values

#pragma DATA_ALIGN(W,sizeof(Complex)) //align W on boundary
#pragma DATA_ALIGN(x,sizeof(Complex)) //align input x on boundary

static short index =0;
int Sample_Data;
short *output;
short *input;
short *interm;
short *Ptr; //this pointer is the one used for the processing

MCBSP_Handle hMcbsp; // Handle for McBSP
TIMER_Handle hTimer; // Handle for Timer

void hookint(void);
void wait_buffer(void);
interrupt void serialPortRcvISR(void);

int main()
{

/*************************************************************************
* McBSP configureation - 32bit read and writewords *
*************************************************************************/

MCBSP_Config PCM3003Cfg = {
0x00010001, // (SPCR) Serial port control register
0x000000A0, // (RCR) Receive control register
0x000000A0, // (XCR) Transmit control registe
0x00000000, // (SRGR)
0x00000000, // (MCR)
0x00000000, // (RCER)
0x00000000, // (XCER)
0x00000000 // (PCR)
};

/*************************************************************************
* Timer configureation - *
*************************************************************************/

TIMER_Config timerCfg = {
0x000003C1, // (CTL)Internal clk. Clk mode
0x00000000, // (PRD)fs = 73.242Khz
0x00000000 // (CNT)
};

/*************************************************************************
* Board and chip support libraries initilized *
*************************************************************************/
CSL_init(); // Initialize the chip support library
BSL_init(); // Initialize the board support library

input = (short *) calloc(N, sizeof(short));
output = (short *) calloc(N, sizeof(short));
interm = (short *) calloc(N, sizeof(short));

hMcbsp = MCBSP_open(MCBSP_DEV1, MCBSP_OPEN_RESET); // Opens + reset
if (hMcbsp ==INV){ // If hMcbsp in fault, LED 1 is on
LED_on(LED_1);
}

MCBSP_config(hMcbsp, &PCM3003Cfg); // Configures McBSP

hTimer = TIMER_open(TIMER_DEV0, TIMER_OPEN_RESET);
if (hTimer ==INV){
LED_on(LED_2);
}
TIMER_config(hTimer, &timerCfg);

IRQ_globalDisable(); // Globally disables interrupts
IRQ_nmiEnable(); // Enables the NMI interrupt
IRQ_map(IRQ_EVT_RINT1,15); // Maps an event
IRQ_enable(IRQ_EVT_RINT1); // Enables the event
IRQ_globalEnable(); // Globally enables interrupts

/*************************************************************************
* Twiddle factor generation, Reverse Index and Bit reverse blocks *
*************************************************************************/
for( i = 0 ; i < N/2 ; i++ )
{
W[i].re = cos(ARGU*i); //real component of W
W[i].im = sin(ARGU*i); //neg imag component
}

digitrev_index(iTwid, N/RADIX, RADIX); //produces index for bitrev() W
bit_rev(W, iTwid, N/RADIX); //bit reverse W
digitrev_index(iData, N, RADIX); //produces index for bitrev() X

for(i=0; i Xmag[i] = 0; //clear magnitude array
/*************************************************************************
* Main loop, wait for buffer of data the preform FFt and Bit rev *
*************************************************************************/
for(;;) //infite loop
{
wait_buffer(); /* WAIT FOR A NEW BUFFER OF DATA*/
cfftr2_dit(x, W, 128); // This is where i have the problem
bit_rev(x, iData, N);
for (i =0; i Xmag[i] = sqrt(x[i].re*x[i].re+x[i].im*x[i].im)/32;
}
}

/************************************************************************
* Data Buffering - 3 stage buffering of audio signal *
*************************************************************************/

// Data from the audio card is passed to the input buffer. After it is full-index =0,
// the contents of the input buffer is pass the the process buffer
// the contents of the three buffers is rotated, continually as the code is called. the !while
//statment allows only one run through of this code.

void wait_buffer()
{
while(index);

Ptr=input;
input = output;
output = interm;

for( i = 0 ; i < N ; i++ )
{
x[i].re = Ptr[i];
x[i].im = 0.0 ;
}
interm = Ptr;

while(!index);
}

interrupt void serialPortRcvISR()
{
Sample_Data =MCBSP_read(hMcbsp); // Read data from Serial port
MCBSP_write(hMcbsp,Sample_Data); // Write data from to Serial port

input[index] = Sample_Data; // Write the sample to array input.
index++; // Increment "index" by 1

if (index==N) index =0; // If index = buffersize then rest index to 0
}

_____________________________________
Duncan-

I suggest a lot more debug. Try these things:

1) Call the FFT function with minimum size (2, 4?).

2) Comment out most of the FFT function source code -- first just get in there and return.

3) Then start uncommenting... for example, let it initialize some stuff, then return, then let it do the outer loop
only, then return.

The idea is to find the exact line of code that crashes. Then you'll have a) a substantial clue as to what's going
on, and b) something specific to report to group for feedback and advice.

-Jeff

> from my previous post a few months ago, i have progressed my audio spectrum analyser ( this is for my Degree project).
> I am at the stage where i have got an audio signal sampled, buffered and started on my FFT routine. I have decided to
> use the Raddix 2 DIT routine. I have got the stage where i have calculated twiddle factors, bit reversal index and
> sampled the audio signal. Now trying to implement the TI c routine for radix 2 FFT. Due to version of CCS i am unable
> to use the libraries so have used just the C version of the code from the comments section. When i come to add this c
> code, it will compile and download, when switched to run on CCS, the program freezes and will not run. Most of the
> time CCS will crash aswell and ask to rest the board. If i remove the FFT routine then the rest of the code will run
> ok. Sometimes with the FFT routine it will run once through, but then will not. ( i am monitoring the output signal
> to a set of speakers as well.)
>
> In the comments it mentions using seperate memory banks to store the data and factors, i have also read this on a post
> on this site, but am usure how to do this, please can you advise. I am using C6711GFN on the DSP starter kit and
> PCM3003 audio daughter card.
>
> I have also attached below a copy of my code, to assist with my issue.
>
> So to recap my questions are :
> 1.how do i specify different memory banks to store the data.
> 2. Is my code crashing due to the memory banks issue or the loction of the call, if not any other ideas?
> 3. Any comment that can assit me in my code development.
>
> I thank you in advance for your assistance and is much appreciated.
>
> duncan
>
> /*************************************************************************
> * Includes *
> *************************************************************************/
>
> #include
> #include
> #include
> #include
> #include
> #include
> #include
> #include
> #include #define N 128 //number of FFT points
> #define ARGU (2*PI)/N //argument for sine/cosine
> #define PI 3.14159265358979 //definition of value of Pi.
> short i = 0;
> typedef struct Complex_tag {float re,im;}Complex;
> Complex W[N/2]; //array for twiddle constants
> #define RADIX 2
> short iTwid[N/2]; //index for twiddle constants W
> short iData[N]; //index for bitrev X
> float Xmag[N]; //magnitude spectrum of x
> Complex x[N]; //N complex data values
>
> #pragma DATA_ALIGN(W,sizeof(Complex)) //align W on boundary
> #pragma DATA_ALIGN(x,sizeof(Complex)) //align input x on boundary
>
> static short index =0;
> int Sample_Data;
> short *output;
> short *input;
> short *interm;
> short *Ptr; //this pointer is the one used for the processing
>
> MCBSP_Handle hMcbsp; // Handle for McBSP
> TIMER_Handle hTimer; // Handle for Timer
>
> void hookint(void);
> void wait_buffer(void);
> interrupt void serialPortRcvISR(void);
>
> int main()
> {
>
> /*************************************************************************
> * McBSP configureation - 32bit read and writewords *
> *************************************************************************/
>
> MCBSP_Config PCM3003Cfg = {
> 0x00010001, // (SPCR) Serial port control register
> 0x000000A0, // (RCR) Receive control register
> 0x000000A0, // (XCR) Transmit control registe
> 0x00000000, // (SRGR)
> 0x00000000, // (MCR)
> 0x00000000, // (RCER)
> 0x00000000, // (XCER)
> 0x00000000 // (PCR)
> };
> /*************************************************************************
> * Timer configureation - *
> *************************************************************************/
>
> TIMER_Config timerCfg = {
> 0x000003C1, // (CTL)Internal clk. Clk mode
> 0x00000000, // (PRD)fs = 73.242Khz
> 0x00000000 // (CNT)
> };
>
> /*************************************************************************
> * Board and chip support libraries initilized *
> *************************************************************************/
> CSL_init(); // Initialize the chip support library
> BSL_init(); // Initialize the board support library
>
> input = (short *) calloc(N, sizeof(short));
> output = (short *) calloc(N, sizeof(short));
> interm = (short *) calloc(N, sizeof(short));
> hMcbsp = MCBSP_open(MCBSP_DEV1, MCBSP_OPEN_RESET); // Opens + reset
> if (hMcbsp ==INV){ // If hMcbsp in fault, LED 1 is on
> LED_on(LED_1);
> }
>
> MCBSP_config(hMcbsp, &PCM3003Cfg); // Configures McBSP
>
> hTimer = TIMER_open(TIMER_DEV0, TIMER_OPEN_RESET);
> if (hTimer ==INV){
> LED_on(LED_2);
> }
> TIMER_config(hTimer, &timerCfg);
>
> IRQ_globalDisable(); // Globally disables interrupts
> IRQ_nmiEnable(); // Enables the NMI interrupt
> IRQ_map(IRQ_EVT_RINT1,15); // Maps an event
> IRQ_enable(IRQ_EVT_RINT1); // Enables the event
> IRQ_globalEnable(); // Globally enables interrupts
>
> /*************************************************************************
> * Twiddle factor generation, Reverse Index and Bit reverse blocks *
> *************************************************************************/
> for( i = 0 ; i < N/2 ; i++ )
> {
> W[i].re = cos(ARGU*i); //real component of W
> W[i].im = sin(ARGU*i); //neg imag component
> }
>
> digitrev_index(iTwid, N/RADIX, RADIX); //produces index for bitrev() W
> bit_rev(W, iTwid, N/RADIX); //bit reverse W
> digitrev_index(iData, N, RADIX); //produces index for bitrev() X
>
> for(i=0; i > Xmag[i] = 0; //clear magnitude array
> /*************************************************************************
> * Main loop, wait for buffer of data the preform FFt and Bit rev *
> *************************************************************************/
> for(;;) //infite loop
> {
> wait_buffer(); /* WAIT FOR A NEW BUFFER OF DATA*/
> cfftr2_dit(x, W, 128); // This is where i have the problem
> bit_rev(x, iData, N);
> for (i =0; i > Xmag[i] = sqrt(x[i].re*x[i].re+x[i].im*x[i].im)/32;
> }
> }
>
> /************************************************************************
> * Data Buffering - 3 stage buffering of audio signal *
> *************************************************************************/
>
> // Data from the audio card is passed to the input buffer. After it is full-index =0,
> // the contents of the input buffer is pass the the process buffer
> // the contents of the three buffers is rotated, continually as the code is called. the !while
> //statment allows only one run through of this code.
>
> void wait_buffer()
> {
> while(index);
>
> Ptr=input;
> input = output;
> output = interm;
>
> for( i = 0 ; i < N ; i++ )
> {
> x[i].re = Ptr[i];
> x[i].im = 0.0 ;
> }
> interm = Ptr;
>
> while(!index);
> }
>
> interrupt void serialPortRcvISR()
> {
> Sample_Data =MCBSP_read(hMcbsp); // Read data from Serial port
> MCBSP_write(hMcbsp,Sample_Data); // Write data from to Serial port
>
> input[index] = Sample_Data; // Write the sample to array input.
> index++; // Increment "index" by 1
>
> if (index==N) index =0; // If index = buffersize then rest index to 0
> }

_____________________________________
mills,

as a first step, you might want to read

and the referenced T.I. document found in that discussion.

My first impression of the code and your description of the problem is some
pointer is not being handled correctly.

Usually, when I look at code to read/write samples from/to the McBSP, there are
a few other items setup that I do not see in your code.

A search of the /examples directory in your CCS installation and/or online at
T.I. will find example code on how to setup the McBSP and associated interrupt.
I think the example application is named DSPAPP.

Again, from your description of the problem, some pointer is not correct.

BTW:
the #pragma statements should be immediately before the data declaration being
aligned.

Placing the data into different memory sections is for speed. Having all the
data in the same memory section will have no effect other than causing the code
to run slower.
Placement of data and code in memory is done in the .cmd file as part of the
linker step.

usually, polling for data, as your program is doing, will take up a major
portion of the available CPU cycles. Leaving not enough time for the FFT
processing. This results in lost/missed data. That is why double buffering and
use of the EDMA capabilities are used for the I/O.

R. Williams

---------- Original Message -----------
From: m...@btinternet.com
To: c...
Sent: Sun, 03 Apr 2011 17:55:42 -0400
Subject: [c6x] spectrum analyser project.

> Hello all once again.
>
> from my previous post a few months ago, i have progressed my audio
> spectrum analyser ( this is for my Degree project). I am at the stage
> where i have got an audio signal sampled, buffered and started on my
> FFT routine. I have decided to use the Raddix 2 DIT routine. I have
> got the stage where i have calculated twiddle factors, bit reversal
> index and sampled the audio signal. Now trying to implement the TI c
> routine for radix 2 FFT. Due to version of CCS i am unable to use the
> libraries so have used just the C version of the code from the
> comments section. When i come to add this c code, it will compile and
> download, when switched to run on CCS, the program freezes and will
> not run. Most of the time CCS will crash aswell and ask to rest the
> board. If i remove the FFT routine then the rest of the code will run
> ok. Sometimes with the FFT routine it will run once through, but then
> will not. ( i am monitoring the output signal to a set of speakers as
> well.)
>
> In the comments it mentions using seperate memory banks to store the
> data and factors, i have also read this on a post on this site, but am
> usure how to do this, please can you advise. I am using C6711GFN on
> the DSP starter kit and PCM3003 audio daughter card.
>
> I have also attached below a copy of my code, to assist with my issue.
>
> So to recap my questions are :
> 1.how do i specify different memory banks to store the data.
>
> 2. Is my code crashing due to the memory banks issue or the loction of
> the call, if not any other ideas?
> 3. Any comment that can assit me in my code development.
>
> I thank you in advance for your assistance and is much appreciated.
>
> duncan
>
> /*************************************************************************
> * Includes *
> *************************************************************************/
>
> #include
> #include
> #include
> #include
> #include
> #include
> #include
> #include
> #include #define N 128 //number of FFT points
> #define ARGU (2*PI)/N //argument for sine/cosine
> #define PI 3.14159265358979 //definition of value of Pi.
> short i = 0;
> typedef struct Complex_tag {float re,im;}Complex;
> Complex W[N/2]; //array for twiddle constants
> #define RADIX 2
> short iTwid[N/2]; //index for twiddle constants W
> short iData[N]; //index for bitrev X
> float Xmag[N]; //magnitude spectrum of x
> Complex x[N]; //N complex data values
>
> #pragma DATA_ALIGN(W,sizeof(Complex)) //align W on boundary
> #pragma DATA_ALIGN(x,sizeof(Complex)) //align input x on boundary
>
> static short index =0;
> int Sample_Data;
> short *output;
> short *input;
> short *interm;
> short *Ptr; //this pointer is the one used for the processing
>
> MCBSP_Handle hMcbsp; // Handle for McBSP
> TIMER_Handle hTimer; // Handle for Timer
>
> void hookint(void);
> void wait_buffer(void);
> interrupt void serialPortRcvISR(void);
>
> int main()
> {
>
> /*************************************************************************
> * McBSP configureation - 32bit read and writewords *
> *************************************************************************/
>
> MCBSP_Config PCM3003Cfg = {
> 0x00010001, // (SPCR) Serial port control register
> 0x000000A0, // (RCR) Receive control register
> 0x000000A0, // (XCR) Transmit control registe
> 0x00000000, // (SRGR)
> 0x00000000, // (MCR)
> 0x00000000, // (RCER)
> 0x00000000, // (XCER)
> 0x00000000 // (PCR)
> };
>
>
> /*************************************************************************
> * Timer configureation - *
> *************************************************************************/
>
> TIMER_Config timerCfg = {
> 0x000003C1, // (CTL)Internal clk. Clk mode
> 0x00000000, // (PRD)fs = 73.242Khz
> 0x00000000 // (CNT)
> };
>
> /*************************************************************************
> * Board and chip support libraries initilized *
> *************************************************************************/
> CSL_init(); // Initialize the chip support library
> BSL_init(); // Initialize the board support library
>
> input = (short *) calloc(N, sizeof(short));
> output = (short *) calloc(N, sizeof(short));
> interm = (short *) calloc(N, sizeof(short));
>
> hMcbsp = MCBSP_open(MCBSP_DEV1, MCBSP_OPEN_RESET); // Opens + reset
> if (hMcbsp ==INV){ // If hMcbsp in fault, LED 1 is on
> LED_on(LED_1);
> }
>
> MCBSP_config(hMcbsp, &PCM3003Cfg); // Configures McBSP
>
> hTimer = TIMER_open(TIMER_DEV0, TIMER_OPEN_RESET);
> if (hTimer ==INV){
> LED_on(LED_2);
> }
> TIMER_config(hTimer, &timerCfg);
>
> IRQ_globalDisable(); // Globally disables interrupts
> IRQ_nmiEnable(); // Enables the NMI interrupt
> IRQ_map(IRQ_EVT_RINT1,15); // Maps an event
> IRQ_enable(IRQ_EVT_RINT1); // Enables the event
> IRQ_globalEnable(); // Globally enables interrupts
>
> /*************************************************************************
> * Twiddle factor generation, Reverse Index and Bit reverse blocks *
> *************************************************************************/
> for( i = 0 ; i < N/2 ; i++ )
> {
> W[i].re = cos(ARGU*i); //real component of W
> W[i].im = sin(ARGU*i); //neg imag component
> }
>
> digitrev_index(iTwid, N/RADIX, RADIX); //produces index for bitrev()
> W bit_rev(W, iTwid, N/RADIX); //bit reverse W digitrev_index(iData,
> N, RADIX); //produces index for bitrev() X
>
> for(i=0; i > Xmag[i] = 0; //clear magnitude array
>
> /*************************************************************************
> * Main loop, wait for buffer of data the preform FFt and Bit rev *
> *************************************************************************/
> for(;;) //infite loop
> {
> wait_buffer(); /* WAIT FOR A NEW BUFFER OF DATA*/
> cfftr2_dit(x, W, 128); // This is where i have the problem
> bit_rev(x, iData, N);
> for (i =0; i > Xmag[i] = sqrt(x[i].re*x[i].re+x[i].im*x[i].im)/32;
> }
> }
>
> /************************************************************************
> * Data Buffering - 3 stage buffering of audio signal *
> *************************************************************************/
>
> // Data from the audio card is passed to the input buffer. After it is
> full-index =0, // the contents of the input buffer is pass the the
> process buffer // the contents of the three buffers is rotated,
> continually as the code is called. the !while //statment allows only
> one run through of this code.
>
> void wait_buffer()
> {
> while(index);
>
> Ptr=input;
> input = output;
> output = interm;
>
> for( i = 0 ; i < N ; i++ )
> {
> x[i].re = Ptr[i];
> x[i].im = 0.0 ;
> }
> interm = Ptr;
>
> while(!index);
> }
>
> interrupt void serialPortRcvISR()
> {
> Sample_Data =MCBSP_read(hMcbsp); // Read data from Serial port
> MCBSP_write(hMcbsp,Sample_Data); // Write data from to Serial port
>
> input[index] = Sample_Data; // Write the sample to array
> input. index++; // Increment "index" by 1
>
> if (index==N) index =0; // If index = buffersize then rest index
> to 0 }
------- End of Original Message -------

_____________________________________
Hello and thank you for your replies.

I have tried what you have recomended, and found the following.

Tried removing the code from the FFT and checked to ensure it called the function ok. This was found to be ok, then i added more and more code in. What i found was that it would ranadomly cause issues. So then after more debugging, decided to remove the output to McBSP, this the partly solved the issue, the problem was the write to the McBSP was casuing the loading. Also from your advise i have re-structured the program which has also much improved the code. The FFT code is allfunctioning satisfactroty now. Thank you for you advise once again.

From my original post about LCD's i would like to pick your brains again if that is ok?
I am using Ralf chasings book on the C6713, although i am using the C6711. and am trying to interface the LCD. In his book he mentions being able to enable output voltages on the EMIF connection, however i dont think this is possible on the C6711? as the connections are different ( pin 75 on J3 to ground to enable voltage)- not same connections on C6711. i have compared the two schematics and are different. I have made connections to the LCD which is a KS0108 based graphic LCD.

First stage is to insitialise and set write command and chip select. Orgingally was going to follow ralf Chassing book (mapping the instructions to the EMIF pins), until i found this problem above. So next throught was to set up and EMIF connection and configuration as per TI, and this is where i am at and getting a little worried. What i am asking for is a point in the right direction and also if the first option is still viable or not ( C6713 EMIF).

Thanks for your help once again, and before you reply, i thought i would remind you that this is to assist with my degree project.
duncan.
Hello all once again.
>
>from my previous post a few months ago, i have progressed my audio spectrum analyser ( this is for my Degree project). I am at the stage where i have got an audio signal sampled, buffered and started on my FFT routine. I have decided to use the Raddix 2 DIT routine. I have got the stage where i have calculated twiddle factors, bit reversal index and sampled the audio signal. Now trying to implement the TI c routine for radix 2 FFT. Due to version of CCS i am unable to use the libraries so have used just the C version of the code from the comments section. When i come to add this c code, it will compile and download, when switched to run on CCS, the program freezes and will not run. Most of the time CCS will crash aswell and ask to rest the board. If i remove the FFT routine then the rest of the code will run ok. Sometimes with the FFT routine it will run once through, but then will not. ( i am monitoring the output signal to a set of speakers as well.)
>
>In the comments it mentions using seperate memory banks to store the data and factors, i have also read this on a post on this site, but am usure how to do this, please can you advise. I am using C6711GFN on the DSP starter kit and PCM3003 audio daughter card.
>
>I have also attached below a copy of my code, to assist with my issue.
>
>So to recap my questions are :
>1.how do i specify different memory banks to store the data.
>2. Is my code crashing due to the memory banks issue or the loction of the call, if not any other ideas?
>3. Any comment that can assit me in my code development.
>
>I thank you in advance for your assistance and is much appreciated.
>
>duncan
>
>/*************************************************************************
> * Includes *
> *************************************************************************/
>
>#include
>#include
>#include
>#include
>#include
>#include
>#include
>#include
>#include
>
>#define N 128 //number of FFT points
>#define ARGU (2*PI)/N //argument for sine/cosine
>#define PI 3.14159265358979 //definition of value of Pi.
>short i = 0;
>typedef struct Complex_tag {float re,im;}Complex;
>Complex W[N/2]; //array for twiddle constants
>#define RADIX 2
>short iTwid[N/2]; //index for twiddle constants W
>short iData[N]; //index for bitrev X
>float Xmag[N]; //magnitude spectrum of x
>Complex x[N]; //N complex data values
>
>#pragma DATA_ALIGN(W,sizeof(Complex)) //align W on boundary
>#pragma DATA_ALIGN(x,sizeof(Complex)) //align input x on boundary
>
>static short index =0;
>int Sample_Data;
>short *output;
>short *input;
>short *interm;
>short *Ptr; //this pointer is the one used for the processing
>
>MCBSP_Handle hMcbsp; // Handle for McBSP
>TIMER_Handle hTimer; // Handle for Timer
>
>void hookint(void);
>void wait_buffer(void);
>interrupt void serialPortRcvISR(void);
>
>int main()
>{
>
>/*************************************************************************
> * McBSP configureation - 32bit read and writewords *
> *************************************************************************/
>
> MCBSP_Config PCM3003Cfg = {
> 0x00010001, // (SPCR) Serial port control register
> 0x000000A0, // (RCR) Receive control register
> 0x000000A0, // (XCR) Transmit control registe
> 0x00000000, // (SRGR)
> 0x00000000, // (MCR)
> 0x00000000, // (RCER)
> 0x00000000, // (XCER)
> 0x00000000 // (PCR)
> };
>
>/*************************************************************************
> * Timer configureation - *
> *************************************************************************/
>
> TIMER_Config timerCfg = {
> 0x000003C1, // (CTL)Internal clk. Clk mode
> 0x00000000, // (PRD)fs = 73.242Khz
> 0x00000000 // (CNT)
> };
>
>/*************************************************************************
> * Board and chip support libraries initilized *
> *************************************************************************/
> CSL_init(); // Initialize the chip support library
> BSL_init(); // Initialize the board support library
>
> input = (short *) calloc(N, sizeof(short));
> output = (short *) calloc(N, sizeof(short));
> interm = (short *) calloc(N, sizeof(short));
>
> hMcbsp = MCBSP_open(MCBSP_DEV1, MCBSP_OPEN_RESET); // Opens + reset
> if (hMcbsp ==INV){ // If hMcbsp in fault, LED 1 is on
> LED_on(LED_1);
> }
>
> MCBSP_config(hMcbsp, &PCM3003Cfg); // Configures McBSP
>
> hTimer = TIMER_open(TIMER_DEV0, TIMER_OPEN_RESET);
> if (hTimer ==INV){
> LED_on(LED_2);
> }
> TIMER_config(hTimer, &timerCfg);
>
> IRQ_globalDisable(); // Globally disables interrupts
> IRQ_nmiEnable(); // Enables the NMI interrupt
> IRQ_map(IRQ_EVT_RINT1,15); // Maps an event
> IRQ_enable(IRQ_EVT_RINT1); // Enables the event
> IRQ_globalEnable(); // Globally enables interrupts
>
>/*************************************************************************
> * Twiddle factor generation, Reverse Index and Bit reverse blocks *
> *************************************************************************/
> for( i = 0 ; i < N/2 ; i++ )
> {
> W[i].re = cos(ARGU*i); //real component of W
> W[i].im = sin(ARGU*i); //neg imag component
> }
>
>digitrev_index(iTwid, N/RADIX, RADIX); //produces index for bitrev() W
>bit_rev(W, iTwid, N/RADIX); //bit reverse W
>digitrev_index(iData, N, RADIX); //produces index for bitrev() X
>
>for(i=0; i

_____________________________________
Duncan-

> Hello and thank you for your replies.
>
> I have tried what you have recomended, and found the following.
>
> Tried removing the code from the FFT and checked to ensure it called the function ok. This was found to be ok, then i added more and more code in. What i found was that it would ranadomly cause issues. So then after more debugging, decided to remove the output to McBSP, this the partly solved the issue, the problem was the write to the McBSP was casuing the loading. Also from your advise i have re-structured the program which has also much improved the code. The FFT code is allfunctioning satisfactroty now. Thank you for you advise once again.
>
> From my original post about LCD's i would like to pick your brains again if that is ok?
> I am using Ralf chasings book on the C6713, although i am using the C6711. and am trying to interface the LCD. In his book he mentions being able to enable output voltages on the EMIF connection, however i dont think this is possible on the C6711? as the connections are different ( pin 75 on J3 to ground to enable voltage)- not same connections on C6711. i have compared the two schematics and are different. I have made connections to the LCD which is a KS0108 based graphic LCD.
>
> First stage is to insitialise and set write command and chip select. Orgingally was going to follow ralf Chassing book (mapping the instructions to the EMIF pins), until i found this problem above. So next throught was to set up and EMIF connection and configuration as per TI, and this is where i am at and getting a little worried. What i am asking for is a point in the right direction and also if the first option is still viable or not ( C6713 EMIF).

A few comments / questions:

1) Dr. Chassaing's Volume 1 covered the DSK C6711:

http://books.google.com/books?id=S77Z_2BdzgkC&pg=PA4&lpg=PA4&dq=DSK+C6711+expansion+connector&source=bl&ots=MLWKpzME3c&sig=x09AePEbd7iM6FlE_yNbbRkRwgk&hl=en&ei=tLaoTZeSBdO1twf6x5jdBw&sa=X&oi=book_result&ct=result&resnum=1&vedBMQ6AEwAA

2) As far as I know, the expansion connectors on the C6711 DSK are similar to the
C6713, and a daughtercard working on one should work on the other, maybe with a few
signals interpreted differently.

3) What are some of the connector pin differences you are seeing? Please give
specific signal names. Thanks.

-Jeff

> Hello all once again.
> >
> >from my previous post a few months ago, i have progressed my audio spectrum analyser ( this is for my Degree project). I am at the stage where i have got an audio signal sampled, buffered and started on my FFT routine. I have decided to use the Raddix 2 DIT routine. I have got the stage where i have calculated twiddle factors, bit reversal index and sampled the audio signal. Now trying to implement the TI c routine for radix 2 FFT. Due to version of CCS i am unable to use the libraries so have used just the C version of the code from the comments section. When i come to add this c code, it will compile and download, when switched to run on CCS, the program freezes and will not run. Most of the time CCS will crash aswell and ask to rest the board. If i remove the FFT routine then the rest of the code will run ok. Sometimes with the FFT routine it will run once through, but then will not. ( i am monitoring the output signal to a set of speakers as well.)
> >
> >In the comments it mentions using seperate memory banks to store the data and factors, i have also read this on a post on this site, but am usure how to do this, please can you advise. I am using C6711GFN on the DSP starter kit and PCM3003 audio daughter card.
> >
> >I have also attached below a copy of my code, to assist with my issue.
> >
> >So to recap my questions are :
> >1.how do i specify different memory banks to store the data.
> >2. Is my code crashing due to the memory banks issue or the loction of the call, if not any other ideas?
> >3. Any comment that can assit me in my code development.
> >
> >I thank you in advance for your assistance and is much appreciated.
> >
> >duncan
> >
> >/*************************************************************************
> > * Includes *
> > *************************************************************************/
> >
> >#include
> >#include
> >#include
> >#include
> >#include
> >#include
> >#include
> >#include
> >#include
> >
> >#define N 128 //number of FFT points
> >#define ARGU (2*PI)/N //argument for sine/cosine
> >#define PI 3.14159265358979 //definition of value of Pi.
> >short i = 0;
> >typedef struct Complex_tag {float re,im;}Complex;
> >Complex W[N/2]; //array for twiddle constants
> >#define RADIX 2
> >short iTwid[N/2]; //index for twiddle constants W
> >short iData[N]; //index for bitrev X
> >float Xmag[N]; //magnitude spectrum of x
> >Complex x[N]; //N complex data values
> >
> >#pragma DATA_ALIGN(W,sizeof(Complex)) //align W on boundary
> >#pragma DATA_ALIGN(x,sizeof(Complex)) //align input x on boundary
> >
> >static short index =0;
> >int Sample_Data;
> >short *output;
> >short *input;
> >short *interm;
> >short *Ptr; //this pointer is the one used for the processing
> >
> >MCBSP_Handle hMcbsp; // Handle for McBSP
> >TIMER_Handle hTimer; // Handle for Timer
> >
> >void hookint(void);
> >void wait_buffer(void);
> >interrupt void serialPortRcvISR(void);
> >
> >int main()
> >{
> >
> >/*************************************************************************
> > * McBSP configureation - 32bit read and writewords *
> > *************************************************************************/
> >
> > MCBSP_Config PCM3003Cfg = {
> > 0x00010001, // (SPCR) Serial port control register
> > 0x000000A0, // (RCR) Receive control register
> > 0x000000A0, // (XCR) Transmit control registe
> > 0x00000000, // (SRGR)
> > 0x00000000, // (MCR)
> > 0x00000000, // (RCER)
> > 0x00000000, // (XCER)
> > 0x00000000 // (PCR)
> > };
> >
> >/*************************************************************************
> > * Timer configureation - *
> > *************************************************************************/
> >
> > TIMER_Config timerCfg = {
> > 0x000003C1, // (CTL)Internal clk. Clk mode
> > 0x00000000, // (PRD)fs = 73.242Khz
> > 0x00000000 // (CNT)
> > };
> >
> >/*************************************************************************
> > * Board and chip support libraries initilized *
> > *************************************************************************/
> > CSL_init(); // Initialize the chip support library
> > BSL_init(); // Initialize the board support library
> >
> > input = (short *) calloc(N, sizeof(short));
> > output = (short *) calloc(N, sizeof(short));
> > interm = (short *) calloc(N, sizeof(short));
> >
> > hMcbsp = MCBSP_open(MCBSP_DEV1, MCBSP_OPEN_RESET); // Opens + reset
> > if (hMcbsp ==INV){ // If hMcbsp in fault, LED 1 is on
> > LED_on(LED_1);
> > }
> >
> > MCBSP_config(hMcbsp, &PCM3003Cfg); // Configures McBSP
> >
> > hTimer = TIMER_open(TIMER_DEV0, TIMER_OPEN_RESET);
> > if (hTimer ==INV){
> > LED_on(LED_2);
> > }
> > TIMER_config(hTimer, &timerCfg);
> >
> > IRQ_globalDisable(); // Globally disables interrupts
> > IRQ_nmiEnable(); // Enables the NMI interrupt
> > IRQ_map(IRQ_EVT_RINT1,15); // Maps an event
> > IRQ_enable(IRQ_EVT_RINT1); // Enables the event
> > IRQ_globalEnable(); // Globally enables interrupts
> >
> >/*************************************************************************
> > * Twiddle factor generation, Reverse Index and Bit reverse blocks *
> > *************************************************************************/
> > for( i = 0 ; i < N/2 ; i++ )
> > {
> > W[i].re = cos(ARGU*i); //real component of W
> > W[i].im = sin(ARGU*i); //neg imag component
> > }
> >
> >digitrev_index(iTwid, N/RADIX, RADIX); //produces index for bitrev() W
> >bit_rev(W, iTwid, N/RADIX); //bit reverse W
> >digitrev_index(iData, N, RADIX); //produces index for bitrev() X
> >
> >for(i=0; i
>
>
>
> _____________________________________

_____________________________________
i want to sample a signal from signal generator and save it to a
buffer.send procedure to create project with support files
(vector_intr.asm,vector_poll.asm). i have rulph chassaing book but his
programs are not working. kindly help me

On 4/16/11, Jeff Brower wrote:
> Duncan-
>
>> Hello and thank you for your replies.
>>
>> I have tried what you have recomended, and found the following.
>>
>> Tried removing the code from the FFT and checked to ensure it called the
>> function ok. This was found to be ok, then i added more and more code in.
>> What i found was that it would ranadomly cause issues. So then after more
>> debugging, decided to remove the output to McBSP, this the partly solved
>> the issue, the problem was the write to the McBSP was casuing the loading.
>> Also from your advise i have re-structured the program which has also much
>> improved the code. The FFT code is allfunctioning satisfactroty now. Thank
>> you for you advise once again.
>>
>> From my original post about LCD's i would like to pick your brains again
>> if that is ok?
>> I am using Ralf chasings book on the C6713, although i am using the C6711.
>> and am trying to interface the LCD. In his book he mentions being able to
>> enable output voltages on the EMIF connection, however i dont think this
>> is possible on the C6711? as the connections are different ( pin 75 on J3
>> to ground to enable voltage)- not same connections on C6711. i have
>> compared the two schematics and are different. I have made connections to
>> the LCD which is a KS0108 based graphic LCD.
>>
>> First stage is to insitialise and set write command and chip select.
>> Orgingally was going to follow ralf Chassing book (mapping the
>> instructions to the EMIF pins), until i found this problem above. So next
>> throught was to set up and EMIF connection and configuration as per TI,
>> and this is where i am at and getting a little worried. What i am asking
>> for is a point in the right direction and also if the first option is
>> still viable or not ( C6713 EMIF).
>
> A few comments / questions:
>
> 1) Dr. Chassaing's Volume 1 covered the DSK C6711:
>
> http://books.google.com/books?id=S77Z_2BdzgkC&pg=PA4&lpg=PA4&dq=DSK+C6711+expansion+connector&source=bl&ots=MLWKpzME3c&sig=x09AePEbd7iM6FlE_yNbbRkRwgk&hl=en&ei=tLaoTZeSBdO1twf6x5jdBw&sa=X&oi=book_result&ct=result&resnum=1&vedBMQ6AEwAA
>
> 2) As far as I know, the expansion connectors on the C6711 DSK are similar
> to the
> C6713, and a daughtercard working on one should work on the other, maybe
> with a few
> signals interpreted differently.
>
> 3) What are some of the connector pin differences you are seeing? Please
> give
> specific signal names. Thanks.
>
> -Jeff
>
>> Hello all once again.
>> >
>> >from my previous post a few months ago, i have progressed my audio
>> > spectrum analyser ( this is for my Degree project). I am at the stage
>> > where i have got an audio signal sampled, buffered and started on my FFT
>> > routine. I have decided to use the Raddix 2 DIT routine. I have got the
>> > stage where i have calculated twiddle factors, bit reversal index and
>> > sampled the audio signal. Now trying to implement the TI c routine for
>> > radix 2 FFT. Due to version of CCS i am unable to use the libraries so
>> > have used just the C version of the code from the comments section. When
>> > i come to add this c code, it will compile and download, when switched
>> > to run on CCS, the program freezes and will not run. Most of the time
>> > CCS will crash aswell and ask to rest the board. If i remove the FFT
>> > routine then the rest of the code will run ok. Sometimes with the FFT
>> > routine it will run once through, but then will not. ( i am monitoring
>> > the output signal to a set of speakers as well.)
>> >
>> >In the comments it mentions using seperate memory banks to store the data
>> > and factors, i have also read this on a post on this site, but am usure
>> > how to do this, please can you advise. I am using C6711GFN on the DSP
>> > starter kit and PCM3003 audio daughter card.
>> >
>> >I have also attached below a copy of my code, to assist with my issue.
>> >
>> >So to recap my questions are :
>> >1.how do i specify different memory banks to store the data.
>> >2. Is my code crashing due to the memory banks issue or the loction of
>> > the call, if not any other ideas?
>> >3. Any comment that can assit me in my code development.
>> >
>> >I thank you in advance for your assistance and is much appreciated.
>> >
>> >duncan
>> >
>> >/*************************************************************************
>> > * Includes *
>> > *************************************************************************/
>> >
>> >#include
>> >#include
>> >#include
>> >#include
>> >#include
>> >#include
>> >#include
>> >#include
>> >#include
>> >
>> >#define N 128 //number of FFT points
>> >#define ARGU (2*PI)/N //argument for sine/cosine
>> >#define PI 3.14159265358979 //definition of value of Pi.
>> >short i = 0;
>> >typedef struct Complex_tag {float re,im;}Complex;
>> >Complex W[N/2]; //array for twiddle
>> > constants
>> >#define RADIX 2
>> >short iTwid[N/2]; //index for twiddle constants W
>> >short iData[N]; //index for bitrev X
>> >float Xmag[N]; //magnitude spectrum of x
>> >Complex x[N]; //N complex data values
>> >
>> >#pragma DATA_ALIGN(W,sizeof(Complex)) //align W on boundary
>> >#pragma DATA_ALIGN(x,sizeof(Complex)) //align input x on boundary
>> >
>> >static short index =0;
>> >int Sample_Data;
>> >short *output;
>> >short *input;
>> >short *interm;
>> >short *Ptr; //this pointer is the one used for the processing
>> >
>> >MCBSP_Handle hMcbsp; // Handle for McBSP
>> >TIMER_Handle hTimer; // Handle for Timer
>> >
>> >void hookint(void);
>> >void wait_buffer(void);
>> >interrupt void serialPortRcvISR(void);
>> >
>> >int main()
>> >{
>> >
>> >/*************************************************************************
>> > * McBSP configureation - 32bit read and writewords *
>> > *************************************************************************/
>> >
>> > MCBSP_Config PCM3003Cfg = {
>> > 0x00010001, // (SPCR) Serial port control register
>> > 0x000000A0, // (RCR) Receive control register
>> > 0x000000A0, // (XCR) Transmit control registe
>> > 0x00000000, // (SRGR)
>> > 0x00000000, // (MCR)
>> > 0x00000000, // (RCER)
>> > 0x00000000, // (XCER)
>> > 0x00000000 // (PCR)
>> > };
>> >
>> >/*************************************************************************
>> > * Timer configureation - *
>> > *************************************************************************/
>> >
>> > TIMER_Config timerCfg = {
>> > 0x000003C1, // (CTL)Internal clk. Clk mode
>> > 0x00000000, // (PRD)fs = 73.242Khz
>> > 0x00000000 // (CNT)
>> > };
>> >
>> >/*************************************************************************
>> > * Board and chip support libraries initilized *
>> > *************************************************************************/
>> > CSL_init(); // Initialize the chip support library
>> > BSL_init(); // Initialize the board support library
>> >
>> > input = (short *) calloc(N, sizeof(short));
>> > output = (short *) calloc(N, sizeof(short));
>> > interm = (short *) calloc(N, sizeof(short));
>> >
>> > hMcbsp = MCBSP_open(MCBSP_DEV1, MCBSP_OPEN_RESET); // Opens +
>> > reset
>> > if (hMcbsp ==INV){ // If hMcbsp in fault, LED 1 is on
>> > LED_on(LED_1);
>> > }
>> >
>> > MCBSP_config(hMcbsp, &PCM3003Cfg); // Configures McBSP
>> >
>> > hTimer = TIMER_open(TIMER_DEV0, TIMER_OPEN_RESET);
>> > if (hTimer ==INV){
>> > LED_on(LED_2);
>> > }
>> > TIMER_config(hTimer, &timerCfg);
>> >
>> > IRQ_globalDisable(); // Globally disables interrupts
>> > IRQ_nmiEnable(); // Enables the NMI interrupt
>> > IRQ_map(IRQ_EVT_RINT1,15); // Maps an event
>> > IRQ_enable(IRQ_EVT_RINT1); // Enables the event
>> > IRQ_globalEnable(); // Globally enables interrupts
>> >
>> >/*************************************************************************
>> > * Twiddle factor generation, Reverse Index and Bit reverse blocks *
>> > *************************************************************************/
>> > for( i = 0 ; i < N/2 ; i++ )
>> > {
>> > W[i].re = cos(ARGU*i); //real component of W
>> > W[i].im = sin(ARGU*i); //neg imag component
>> > }
>> >
>> >digitrev_index(iTwid, N/RADIX, RADIX); //produces index for bitrev() W
>> >bit_rev(W, iTwid, N/RADIX); //bit reverse W
>> >digitrev_index(iData, N, RADIX); //produces index for bitrev() X
>> >
>> >for(i=0; i
>>
>>
>>
>> _____________________________________
>>
>

_____________________________________
rupesh,

well, first, have you stepped through the program to see where it is actually
crashing?
The currently attached program is missing the two interrupt functions.
Hopefully, those functions are not missing in the actual program.

I noticed the interrupts are being enabled before all the initialization is
complete. very bad idea.

The rulph book contains programs that are built upon prior programs,
Therefore, a copy of any one program from his book will NOT work.

The rulph book comes with a CD that contains all the code examples from his book.
More code examples can be obtained by going to the related web site and
downloading the examples.

I think your program is missing a couple of items, such as the variable that
determines the McBSP/ADC sample rate.

The TI or Spectrum Digital web sites contain complete, working programs for
sampling inputs and outputing data via the McBSPs.
I would advise downloading one of those programs and simply put your FFT code in
the 'software interrupt' function.

R. Williams

---------- Original Message -----------
From: rupesh mhatre
To: Jeff Brower
Cc: Duncan Mills , c...
Sent: Sat, 16 Apr 2011 10:44:24 +0530
Subject: Re: [c6x] Re: spectrum analyser project.

> i want to sample a signal from signal generator and save it to a
> buffer.send procedure to create project with support files
> (vector_intr.asm,vector_poll.asm). i have rulph chassaing book but his
> programs are not working. kindly help me
>
> On 4/16/11, Jeff Brower wrote:
> > Duncan-
> >
> >> Hello and thank you for your replies.
> >>
> >> I have tried what you have recomended, and found the following.
> >>
> >> Tried removing the code from the FFT and checked to ensure it called the
> >> function ok. This was found to be ok, then i added more and more code in.
> >> What i found was that it would ranadomly cause issues. So then after more
> >> debugging, decided to remove the output to McBSP, this the partly solved
> >> the issue, the problem was the write to the McBSP was casuing the loading.
> >> Also from your advise i have re-structured the program which has also much
> >> improved the code. The FFT code is allfunctioning satisfactroty now. Thank
> >> you for you advise once again.
> >>
> >> From my original post about LCD's i would like to pick your brains again
> >> if that is ok?
> >> I am using Ralf chasings book on the C6713, although i am using the C6711.
> >> and am trying to interface the LCD. In his book he mentions being able to
> >> enable output voltages on the EMIF connection, however i dont think this
> >> is possible on the C6711? as the connections are different ( pin 75 on J3
> >> to ground to enable voltage)- not same connections on C6711. i have
> >> compared the two schematics and are different. I have made connections to
> >> the LCD which is a KS0108 based graphic LCD.
> >>
> >> First stage is to insitialise and set write command and chip select.
> >> Orgingally was going to follow ralf Chassing book (mapping the
> >> instructions to the EMIF pins), until i found this problem above. So next
> >> throught was to set up and EMIF connection and configuration as per TI,
> >> and this is where i am at and getting a little worried. What i am asking
> >> for is a point in the right direction and also if the first option is
> >> still viable or not ( C6713 EMIF).
> >
> > A few comments / questions:
> >
> > 1) Dr. Chassaing's Volume 1 covered the DSK C6711:
> >
> >
http://books.google.com/books?id=S77Z_2BdzgkC&pg=PA4&lpg=PA4&dq=DSK+C6711+expansion+connector&source=bl&ots=MLWKpzME3c&sig=x09AePEbd7iM6FlE_yNbbRkRwgk&hl=en&ei=tLaoTZeSBdO1twf6x5jdBw&sa=X&oi=book_result&ct=result&resnum=1&vedBMQ6AEwAA
> >
> > 2) As far as I know, the expansion connectors on the C6711 DSK are similar
> > to the
> > C6713, and a daughtercard working on one should work on the other, maybe
> > with a few
> > signals interpreted differently.
> >
> > 3) What are some of the connector pin differences you are seeing? Please
> > give
> > specific signal names. Thanks.
> >
> > -Jeff
> >
> >> Hello all once again.
> >> >
> >> >from my previous post a few months ago, i have progressed my audio
> >> > spectrum analyser ( this is for my Degree project). I am at the stage
> >> > where i have got an audio signal sampled, buffered and started on my FFT
> >> > routine. I have decided to use the Raddix 2 DIT routine. I have got the
> >> > stage where i have calculated twiddle factors, bit reversal index and
> >> > sampled the audio signal. Now trying to implement the TI c routine for
> >> > radix 2 FFT. Due to version of CCS i am unable to use the libraries so
> >> > have used just the C version of the code from the comments section. When
> >> > i come to add this c code, it will compile and download, when switched
> >> > to run on CCS, the program freezes and will not run. Most of the time
> >> > CCS will crash aswell and ask to rest the board. If i remove the FFT
> >> > routine then the rest of the code will run ok. Sometimes with the FFT
> >> > routine it will run once through, but then will not. ( i am monitoring
> >> > the output signal to a set of speakers as well.)
> >> >
> >> >In the comments it mentions using seperate memory banks to store the data
> >> > and factors, i have also read this on a post on this site, but am usure
> >> > how to do this, please can you advise. I am using C6711GFN on the DSP
> >> > starter kit and PCM3003 audio daughter card.
> >> >
> >> >I have also attached below a copy of my code, to assist with my issue.
> >> >
> >> >So to recap my questions are :
> >> >1.how do i specify different memory banks to store the data.
> >> >2. Is my code crashing due to the memory banks issue or the loction of
> >> > the call, if not any other ideas?
> >> >3. Any comment that can assit me in my code development.
> >> >
> >> >I thank you in advance for your assistance and is much appreciated.
> >> >
> >> >duncan
> >> >
> >> >/*************************************************************************
> >> > * Includes *
> >> > *************************************************************************/
> >> >
> >> >#include
> >> >#include
> >> >#include
> >> >#include
> >> >#include
> >> >#include
> >> >#include
> >> >#include
> >> >#include
> >> >
> >> >#define N 128 //number of FFT points
> >> >#define ARGU (2*PI)/N //argument for sine/cosine
> >> >#define PI 3.14159265358979 //definition of value of Pi.
> >> >short i = 0;
> >> >typedef struct Complex_tag {float re,im;}Complex;
> >> >Complex W[N/2]; //array for twiddle
> >> > constants
> >> >#define RADIX 2
> >> >short iTwid[N/2]; //index for twiddle constants W
> >> >short iData[N]; //index for bitrev X
> >> >float Xmag[N]; //magnitude spectrum of x
> >> >Complex x[N]; //N complex data values
> >> >
> >> >#pragma DATA_ALIGN(W,sizeof(Complex)) //align W on boundary
> >> >#pragma DATA_ALIGN(x,sizeof(Complex)) //align input x on boundary
> >> >
> >> >static short index =0;
> >> >int Sample_Data;
> >> >short *output;
> >> >short *input;
> >> >short *interm;
> >> >short *Ptr; //this pointer is the one used for the processing
> >> >
> >> >MCBSP_Handle hMcbsp; // Handle for McBSP
> >> >TIMER_Handle hTimer; // Handle for Timer
> >> >
> >> >void hookint(void);
> >> >void wait_buffer(void);
> >> >interrupt void serialPortRcvISR(void);
> >> >
> >> >int main()
> >> >{
> >> >
> >> >/*************************************************************************
> >> > * McBSP configureation - 32bit read and writewords *
> >> > *************************************************************************/
> >> >
> >> > MCBSP_Config PCM3003Cfg = {
> >> > 0x00010001, // (SPCR) Serial port control register
> >> > 0x000000A0, // (RCR) Receive control register
> >> > 0x000000A0, // (XCR) Transmit control registe
> >> > 0x00000000, // (SRGR)
> >> > 0x00000000, // (MCR)
> >> > 0x00000000, // (RCER)
> >> > 0x00000000, // (XCER)
> >> > 0x00000000 // (PCR)
> >> > };
> >> >
> >> >/*************************************************************************
> >> > * Timer configureation - *
> >> > *************************************************************************/
> >> >
> >> > TIMER_Config timerCfg = {
> >> > 0x000003C1, // (CTL)Internal clk. Clk mode
> >> > 0x00000000, // (PRD)fs = 73.242Khz
> >> > 0x00000000 // (CNT)
> >> > };
> >> >
> >> >/*************************************************************************
> >> > * Board and chip support libraries initilized *
> >> > *************************************************************************/
> >> > CSL_init(); // Initialize the chip support library
> >> > BSL_init(); // Initialize the board support library
> >> >
> >> > input = (short *) calloc(N, sizeof(short));
> >> > output = (short *) calloc(N, sizeof(short));
> >> > interm = (short *) calloc(N, sizeof(short));
> >> >
> >> > hMcbsp = MCBSP_open(MCBSP_DEV1, MCBSP_OPEN_RESET); // Opens +
> >> > reset
> >> > if (hMcbsp ==INV){ // If hMcbsp in fault, LED 1 is on
> >> > LED_on(LED_1);
> >> > }
> >> >
> >> > MCBSP_config(hMcbsp, &PCM3003Cfg); // Configures McBSP
> >> >
> >> > hTimer = TIMER_open(TIMER_DEV0, TIMER_OPEN_RESET);
> >> > if (hTimer ==INV){
> >> > LED_on(LED_2);
> >> > }
> >> > TIMER_config(hTimer, &timerCfg);
> >> >
> >> > IRQ_globalDisable(); // Globally disables interrupts
> >> > IRQ_nmiEnable(); // Enables the NMI interrupt
> >> > IRQ_map(IRQ_EVT_RINT1,15); // Maps an event
> >> > IRQ_enable(IRQ_EVT_RINT1); // Enables the event
> >> > IRQ_globalEnable(); // Globally enables interrupts
> >> >
> >> >/*************************************************************************
> >> > * Twiddle factor generation, Reverse Index and Bit reverse blocks *
> >> > *************************************************************************/
> >> > for( i = 0 ; i < N/2 ; i++ )
> >> > {
> >> > W[i].re = cos(ARGU*i); //real component of W
> >> > W[i].im = sin(ARGU*i); //neg imag component
> >> > }
> >> >
> >> >digitrev_index(iTwid, N/RADIX, RADIX); //produces index for bitrev() W
> >> >bit_rev(W, iTwid, N/RADIX); //bit reverse W
> >> >digitrev_index(iData, N, RADIX); //produces index for bitrev() X
> >> >
> >> >for(i=0; i
> >>
> >>
> >>
> >>
> >>
> >> _____________________________________
> >>
> >>
> >>
> >>
> >
------- End of Original Message -------

_____________________________________
Hello all.

with reference to Jeff's reply.

the difference in connectors seems substantial. Since this post i have continued with my development with the EMIf. i am trying to set up as async sram. so i am just setting this up. i have checked over the schematics and the two board seem different in the follwouing ways.The 6713 has the pin 75 on j3 which is the DC_det which is not on the c6711. from what i can see, if i set this up as a 16 bit async memory, use the first 8 bits as data and the rest as the control then this will work? In the Ralf chassing book, he talks about needing to ground this terminal 75, so the correct voltage is avaialble at the data pins, but dont understand why i would need to.

i have both ralf's books and first one does not have as much about interfacing with EMIF.
Whilst setting up the emif, it mentions on the TI documentation to set clock out2 to ecklin, by just bridging the connection, but again unless the the names are different on the schematics, the clock out 2 does not seem available, the docuemt was also specific to the c6711.

i plan to test the connection using a digital storage scope, and should be able to get some data bits configured, should i see a voltage on each pin, if set up as memory, 3.3v?

Richard - the sample rate, in my understanding is set by the timer PRD value, is that correct, the program does function, and since the listed code i have restructed and does function. unformtunately due to version issues, i used c code opposed to libraries,

thanks for all the assistance once again.

duncan

thanks
duncan

Hello all once again.
>
>from my previous post a few months ago, i have progressed my audio spectrum analyser ( this is for my Degree project). I am at the stage where i have got an audio signal sampled, buffered and started on my FFT routine. I have decided to use the Raddix 2 DIT routine. I have got the stage where i have calculated twiddle factors, bit reversal index and sampled the audio signal. Now trying to implement the TI c routine for radix 2 FFT. Due to version of CCS i am unable to use the libraries so have used just the C version of the code from the comments section. When i come to add this c code, it will compile and download, when switched to run on CCS, the program freezes and will not run. Most of the time CCS will crash aswell and ask to rest the board. If i remove the FFT routine then the rest of the code will run ok. Sometimes with the FFT routine it will run once through, but then will not. ( i am monitoring the output signal to a set of speakers as well.)
>
>In the comments it mentions using seperate memory banks to store the data and factors, i have also read this on a post on this site, but am usure how to do this, please can you advise. I am using C6711GFN on the DSP starter kit and PCM3003 audio daughter card.
>
>I have also attached below a copy of my code, to assist with my issue.
>
>So to recap my questions are :
>1.how do i specify different memory banks to store the data.
>2. Is my code crashing due to the memory banks issue or the loction of the call, if not any other ideas?
>3. Any comment that can assit me in my code development.
>
>I thank you in advance for your assistance and is much appreciated.
>
>duncan
>
>/*************************************************************************
> * Includes *
> *************************************************************************/
>
>#include
>#include
>#include
>#include
>#include
>#include
>#include
>#include
>#include
>
>#define N 128 //number of FFT points
>#define ARGU (2*PI)/N //argument for sine/cosine
>#define PI 3.14159265358979 //definition of value of Pi.
>short i = 0;
>typedef struct Complex_tag {float re,im;}Complex;
>Complex W[N/2]; //array for twiddle constants
>#define RADIX 2
>short iTwid[N/2]; //index for twiddle constants W
>short iData[N]; //index for bitrev X
>float Xmag[N]; //magnitude spectrum of x
>Complex x[N]; //N complex data values
>
>#pragma DATA_ALIGN(W,sizeof(Complex)) //align W on boundary
>#pragma DATA_ALIGN(x,sizeof(Complex)) //align input x on boundary
>
>static short index =0;
>int Sample_Data;
>short *output;
>short *input;
>short *interm;
>short *Ptr; //this pointer is the one used for the processing
>
>MCBSP_Handle hMcbsp; // Handle for McBSP
>TIMER_Handle hTimer; // Handle for Timer
>
>void hookint(void);
>void wait_buffer(void);
>interrupt void serialPortRcvISR(void);
>
>int main()
>{
>
>/*************************************************************************
> * McBSP configureation - 32bit read and writewords *
> *************************************************************************/
>
> MCBSP_Config PCM3003Cfg = {
> 0x00010001, // (SPCR) Serial port control register
> 0x000000A0, // (RCR) Receive control register
> 0x000000A0, // (XCR) Transmit control registe
> 0x00000000, // (SRGR)
> 0x00000000, // (MCR)
> 0x00000000, // (RCER)
> 0x00000000, // (XCER)
> 0x00000000 // (PCR)
> };
>
>/*************************************************************************
> * Timer configureation - *
> *************************************************************************/
>
> TIMER_Config timerCfg = {
> 0x000003C1, // (CTL)Internal clk. Clk mode
> 0x00000000, // (PRD)fs = 73.242Khz
> 0x00000000 // (CNT)
> };
>
>/*************************************************************************
> * Board and chip support libraries initilized *
> *************************************************************************/
> CSL_init(); // Initialize the chip support library
> BSL_init(); // Initialize the board support library
>
> input = (short *) calloc(N, sizeof(short));
> output = (short *) calloc(N, sizeof(short));
> interm = (short *) calloc(N, sizeof(short));
>
> hMcbsp = MCBSP_open(MCBSP_DEV1, MCBSP_OPEN_RESET); // Opens + reset
> if (hMcbsp ==INV){ // If hMcbsp in fault, LED 1 is on
> LED_on(LED_1);
> }
>
> MCBSP_config(hMcbsp, &PCM3003Cfg); // Configures McBSP
>
> hTimer = TIMER_open(TIMER_DEV0, TIMER_OPEN_RESET);
> if (hTimer ==INV){
> LED_on(LED_2);
> }
> TIMER_config(hTimer, &timerCfg);
>
> IRQ_globalDisable(); // Globally disables interrupts
> IRQ_nmiEnable(); // Enables the NMI interrupt
> IRQ_map(IRQ_EVT_RINT1,15); // Maps an event
> IRQ_enable(IRQ_EVT_RINT1); // Enables the event
> IRQ_globalEnable(); // Globally enables interrupts
>
>/*************************************************************************
> * Twiddle factor generation, Reverse Index and Bit reverse blocks *
> *************************************************************************/
> for( i = 0 ; i < N/2 ; i++ )
> {
> W[i].re = cos(ARGU*i); //real component of W
> W[i].im = sin(ARGU*i); //neg imag component
> }
>
>digitrev_index(iTwid, N/RADIX, RADIX); //produces index for bitrev() W
>bit_rev(W, iTwid, N/RADIX); //bit reverse W
>digitrev_index(iData, N, RADIX); //produces index for bitrev() X
>
>for(i=0; i

_____________________________________
Mills,

pin 75 (of the 6713 DSP) is the EMIF interface enable pin.
That is why that pin on the DSP has to be grounded.
Both devices have a pin named 'AOE/SDRAS/SSOE' (which might not be connected to
the same pin on a Jx connector on some evaluation board.)

That is the signal that has to be set to ground (it is DSP pin 75 on the 6713).

This fact is made very clear on the second version of the Chassing book.
(I have not read the first version of the book)
Therefore, look at the signal pins on the DSP and where they are brought out
onto the connectors.
This does NOT necessarily mean to look at pin 75 on some connector.

R. Williams
---------- Original Message -----------
From: m...@btinternet.com
To: c...
Sent: Sat, 16 Apr 2011 14:33:59 -0400
Subject: [c6x] Re: spectrum analyser project.

> Hello all.
>
> with reference to Jeff's reply.
>
> the difference in connectors seems substantial. Since this post i have
> continued with my development with the EMIf. i am trying to set up as
> async sram. so i am just setting this up. i have checked over the
> schematics and the two board seem different in the follwouing ways.The
> 6713 has the pin 75 on j3 which is the DC_det which is not on the
> c6711. from what i can see, if i set this up as a 16 bit async memory,
> use the first 8 bits as data and the rest as the control then this
> will work? In the Ralf chassing book, he talks about needing to ground
> this terminal 75, so the correct voltage is avaialble at the data pins,
> but dont understand why i would need to.
>
> i have both ralf's books and first one does not have as much about
> interfacing with EMIF. Whilst setting up the emif, it mentions on the
> TI documentation to set clock out2 to ecklin, by just bridging the
> connection, but again unless the the names are different on the
> schematics, the clock out 2 does not seem available, the docuemt was
> also specific to the c6711.
>
> i plan to test the connection using a digital storage scope, and
> should be able to get some data bits configured, should i see a
> voltage on each pin, if set up as memory, 3.3v?
>
> Richard - the sample rate, in my understanding is set by the timer PRD
> value, is that correct, the program does function, and since the
> listed code i have restructed and does function. unformtunately due to
> version issues, i used c code opposed to libraries,
>
> thanks for all the assistance once again.
>
> duncan
>
> thanks
> duncan
>
> Hello all once again.
> >
> >from my previous post a few months ago, i have progressed my audio spectrum
analyser ( this is for my Degree project). I am at the stage where i have got an
audio signal sampled, buffered and started on my FFT routine. I have decided to
use the Raddix 2 DIT routine. I have got the stage where i have calculated
twiddle factors, bit reversal index and sampled the audio signal. Now trying to
implement the TI c routine for radix 2 FFT. Due to version of CCS i am unable to
use the libraries so have used just the C version of the code from the comments
section. When i come to add this c code, it will compile and download, when
switched to run on CCS, the program freezes and will not run. Most of the time
CCS will crash aswell and ask to rest the board. If i remove the FFT routine
then the rest of the code will run ok. Sometimes with the FFT routine it will
run once through, but then will not. ( i am monitoring the output signal to a
set of speakers as well.)
> >
> >In the comments it mentions using seperate memory banks to store the data and
factors, i have also read this on a post on this site, but am usure how to do
this, please can you advise. I am using C6711GFN on the DSP starter kit and
PCM3003 audio daughter card.
> >
> >I have also attached below a copy of my code, to assist with my issue.
> >
> >So to recap my questions are :
> >1.how do i specify different memory banks to store the data.
> >2. Is my code crashing due to the memory banks issue or the loction of the
call, if not any other ideas?
> >3. Any comment that can assit me in my code development.
> >
> >I thank you in advance for your assistance and is much appreciated.
> >
> >duncan
> >
> >/*************************************************************************
> > * Includes *
> > *************************************************************************/
> >
> >#include
> >#include
> >#include
> >#include
> >#include
> >#include
> >#include
> >#include
> >#include
> >
> >#define N 128 //number of FFT points
> >#define ARGU (2*PI)/N //argument for sine/cosine
> >#define PI 3.14159265358979 //definition of value of Pi.
> >short i = 0;
> >typedef struct Complex_tag {float re,im;}Complex;
> >Complex W[N/2]; //array for twiddle constants
> >#define RADIX 2
> >short iTwid[N/2]; //index for twiddle constants W
> >short iData[N]; //index for bitrev X
> >float Xmag[N]; //magnitude spectrum of x
> >Complex x[N]; //N complex data values
> >
> >#pragma DATA_ALIGN(W,sizeof(Complex)) //align W on boundary
> >#pragma DATA_ALIGN(x,sizeof(Complex)) //align input x on boundary
> >
> >static short index =0;
> >int Sample_Data;
> >short *output;
> >short *input;
> >short *interm;
> >short *Ptr; //this pointer is the one used for the processing
> >
> >MCBSP_Handle hMcbsp; // Handle for McBSP
> >TIMER_Handle hTimer; // Handle for Timer
> >
> >void hookint(void);
> >void wait_buffer(void);
> >interrupt void serialPortRcvISR(void);
> >
> >int main()
> >{
> >
> >/*************************************************************************
> > * McBSP configureation - 32bit read and writewords *
> > *************************************************************************/
> >
> > MCBSP_Config PCM3003Cfg = {
> > 0x00010001, // (SPCR) Serial port control register
> > 0x000000A0, // (RCR) Receive control register
> > 0x000000A0, // (XCR) Transmit control registe
> > 0x00000000, // (SRGR)
> > 0x00000000, // (MCR)
> > 0x00000000, // (RCER)
> > 0x00000000, // (XCER)
> > 0x00000000 // (PCR)
> > };
> >
> >/*************************************************************************
> > * Timer configureation - *
> > *************************************************************************/
> >
> > TIMER_Config timerCfg = {
> > 0x000003C1, // (CTL)Internal clk. Clk mode
> > 0x00000000, // (PRD)fs = 73.242Khz
> > 0x00000000 // (CNT)
> > };
> >
> >/*************************************************************************
> > * Board and chip support libraries initilized *
> > *************************************************************************/
> > CSL_init(); // Initialize the chip support library
> > BSL_init(); // Initialize the board support library
> >
> > input = (short *) calloc(N, sizeof(short));
> > output = (short *) calloc(N, sizeof(short));
> > interm = (short *) calloc(N, sizeof(short));
> >
> > hMcbsp = MCBSP_open(MCBSP_DEV1, MCBSP_OPEN_RESET); // Opens + reset
> > if (hMcbsp ==INV){ // If hMcbsp in fault, LED 1 is on
> > LED_on(LED_1);
> > }
> >
> > MCBSP_config(hMcbsp, &PCM3003Cfg); // Configures McBSP
> >
> > hTimer = TIMER_open(TIMER_DEV0, TIMER_OPEN_RESET);
> > if (hTimer ==INV){
> > LED_on(LED_2);
> > }
> > TIMER_config(hTimer, &timerCfg);
> >
> > IRQ_globalDisable(); // Globally disables interrupts
> > IRQ_nmiEnable(); // Enables the NMI interrupt
> > IRQ_map(IRQ_EVT_RINT1,15); // Maps an event
> > IRQ_enable(IRQ_EVT_RINT1); // Enables the event
> > IRQ_globalEnable(); // Globally enables interrupts
> >
> >/*************************************************************************
> > * Twiddle factor generation, Reverse Index and Bit reverse blocks *
> > *************************************************************************/
> > for( i = 0 ; i < N/2 ; i++ )
> > {
> > W[i].re = cos(ARGU*i); //real component of W
> > W[i].im = sin(ARGU*i); //neg imag component
> > }
> >
> >digitrev_index(iTwid, N/RADIX, RADIX); //produces index for bitrev() W
> >bit_rev(W, iTwid, N/RADIX); //bit reverse W
> >digitrev_index(iData, N, RADIX); //produces index for bitrev() X
> >
> >for(i=0; i
------- End of Original Message -------

_____________________________________
Duncan-

> i have both ralf's books and first one does not have as much about interfacing with EMIF.
> Whilst setting up the emif, it mentions on the TI documentation to set clock out2 to ecklin, by just bridging the
> connection, but again unless the the names are different on the schematics, the clock out 2 does not seem available,
> the docuemt was also specific to the c6711.

I suggest to stop worrying about C6711 vs. C6713 board comparisons and focus on what you need to get the job done. On
the C6711 DSK board, ECLKIN is 100 MHz and CLKIN is 150 MHz. Is that not what you want? If not, what rate do you
want for ECLKIN?

Also, C6711 output ECLKOUT is run to a buffer and produces DB_ECLKOUT (J3-78). If you want to use CLKOUT2 instead (as
Chassaing appears to suggest), it looks like U13 has a couple of unused gates, so you could run a jumper wire from TP2
to J3-78 (lift the pin first) or leave 78 alone and use a different J3 pin.

Again, what actual EMIF clock rate do you need to end up with on the daughtercard?

-Jeff
> with reference to Jeff's reply.
>
> the difference in connectors seems substantial. Since this post i have continued with my development with the EMIf. i
> am trying to set up as async sram. so i am just setting this up. i have checked over the schematics and the two board
> seem different in the follwouing ways.The 6713 has the pin 75 on j3 which is the DC_det which is not on the c6711.
> from what i can see, if i set this up as a 16 bit async memory, use the first 8 bits as data and the rest as the
> control then this will work? In the Ralf chassing book, he talks about needing to ground this terminal 75, so the
> correct voltage is avaialble at the data pins, but dont understand why i would need to.
>
> i have both ralf's books and first one does not have as much about interfacing with EMIF.
> Whilst setting up the emif, it mentions on the TI documentation to set clock out2 to ecklin, by just bridging the
> connection, but again unless the the names are different on the schematics, the clock out 2 does not seem available,
> the docuemt was also specific to the c6711.
>
> i plan to test the connection using a digital storage scope, and should be able to get some data bits configured,
> should i see a voltage on each pin, if set up as memory, 3.3v?
>
> Richard - the sample rate, in my understanding is set by the timer PRD value, is that correct, the program does
> function, and since the listed code i have restructed and does function. unformtunately due to version issues, i used
> c code opposed to libraries,
>
> thanks for all the assistance once again.
>
> duncan
>
> thanks
> duncan
>
> Hello all once again.
>>
>>from my previous post a few months ago, i have progressed my audio spectrum analyser ( this is for my Degree
>> project). I am at the stage where i have got an audio signal sampled, buffered and started on my FFT routine. I have
>> decided to use the Raddix 2 DIT routine. I have got the stage where i have calculated twiddle factors, bit reversal
>> index and sampled the audio signal. Now trying to implement the TI c routine for radix 2 FFT. Due to version of CCS i
>> am unable to use the libraries so have used just the C version of the code from the comments section. When i come to
>> add this c code, it will compile and download, when switched to run on CCS, the program freezes and will not run.
>> Most of the time CCS will crash aswell and ask to rest the board. If i remove the FFT routine then the rest of the
>> code will run ok. Sometimes with the FFT routine it will run once through, but then will not. ( i am monitoring the
>> output signal to a set of speakers as well.)
>>
>>In the comments it mentions using seperate memory banks to store the data and factors, i have also read this on a
>> post on this site, but am usure how to do this, please can you advise. I am using C6711GFN on the DSP starter kit
>> and PCM3003 audio daughter card.
>>
>>I have also attached below a copy of my code, to assist with my issue.
>>
>>So to recap my questions are :
>>1.how do i specify different memory banks to store the data.
>>2. Is my code crashing due to the memory banks issue or the loction of the call, if not any other ideas?
>>3. Any comment that can assit me in my code development.
>>
>>I thank you in advance for your assistance and is much appreciated.
>>
>>duncan
>>
>>/*************************************************************************
>> * Includes *
>> *************************************************************************/
>>
>>#include
>>#include
>>#include
>>#include
>>#include
>>#include
>>#include
>>#include
>>#include
>>
>>#define N 128 //number of FFT points
>>#define ARGU (2*PI)/N //argument for sine/cosine
>>#define PI 3.14159265358979 //definition of value of Pi.
>>short i = 0;
>>typedef struct Complex_tag {float re,im;}Complex;
>>Complex W[N/2]; //array for twiddle constants
>>#define RADIX 2
>>short iTwid[N/2]; //index for twiddle constants W
>>short iData[N]; //index for bitrev X
>>float Xmag[N]; //magnitude spectrum of x
>>Complex x[N]; //N complex data values
>>
>>#pragma DATA_ALIGN(W,sizeof(Complex)) //align W on boundary
>>#pragma DATA_ALIGN(x,sizeof(Complex)) //align input x on boundary
>>
>>static short index =0;
>>int Sample_Data;
>>short *output;
>>short *input;
>>short *interm;
>>short *Ptr; //this pointer is the one used for the processing
>>
>>MCBSP_Handle hMcbsp; // Handle for McBSP
>>TIMER_Handle hTimer; // Handle for Timer
>>
>>void hookint(void);
>>void wait_buffer(void);
>>interrupt void serialPortRcvISR(void);
>>
>>int main()
>>{
>>
>>/*************************************************************************
>> * McBSP configureation - 32bit read and writewords *
>> *************************************************************************/
>>
>> MCBSP_Config PCM3003Cfg = {
>> 0x00010001, // (SPCR) Serial port control register
>> 0x000000A0, // (RCR) Receive control register
>> 0x000000A0, // (XCR) Transmit control registe
>> 0x00000000, // (SRGR)
>> 0x00000000, // (MCR)
>> 0x00000000, // (RCER)
>> 0x00000000, // (XCER)
>> 0x00000000 // (PCR)
>> };
>>
>>/*************************************************************************
>> * Timer configureation - *
>> *************************************************************************/
>>
>> TIMER_Config timerCfg = {
>> 0x000003C1, // (CTL)Internal clk. Clk mode
>> 0x00000000, // (PRD)fs = 73.242Khz
>> 0x00000000 // (CNT)
>> };
>>
>>/*************************************************************************
>> * Board and chip support libraries initilized *
>> *************************************************************************/
>> CSL_init(); // Initialize the chip support library
>> BSL_init(); // Initialize the board support library
>>
>> input = (short *) calloc(N, sizeof(short));
>> output = (short *) calloc(N, sizeof(short));
>> interm = (short *) calloc(N, sizeof(short));
>>
>> hMcbsp = MCBSP_open(MCBSP_DEV1, MCBSP_OPEN_RESET); // Opens + reset
>> if (hMcbsp ==INV){ // If hMcbsp in fault, LED 1 is on
>> LED_on(LED_1);
>> }
>>
>> MCBSP_config(hMcbsp, &PCM3003Cfg); // Configures McBSP
>>
>> hTimer = TIMER_open(TIMER_DEV0, TIMER_OPEN_RESET);
>> if (hTimer ==INV){
>> LED_on(LED_2);
>> }
>> TIMER_config(hTimer, &timerCfg);
>>
>> IRQ_globalDisable(); // Globally disables interrupts
>> IRQ_nmiEnable(); // Enables the NMI interrupt
>> IRQ_map(IRQ_EVT_RINT1,15); // Maps an event
>> IRQ_enable(IRQ_EVT_RINT1); // Enables the event
>> IRQ_globalEnable(); // Globally enables interrupts
>>
>>/*************************************************************************
>> * Twiddle factor generation, Reverse Index and Bit reverse blocks *
>> *************************************************************************/
>> for( i = 0 ; i < N/2 ; i++ )
>> {
>> W[i].re = cos(ARGU*i); //real component of W
>> W[i].im = sin(ARGU*i); //neg imag component
>> }
>>
>>digitrev_index(iTwid, N/RADIX, RADIX); //produces index for bitrev() W
>>bit_rev(W, iTwid, N/RADIX); //bit reverse W
>>digitrev_index(iData, N, RADIX); //produces index for bitrev() X
>>
>>for(i=0; i
>
_____________________________________