CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Ex_FFT failing on dsPIC30F4011

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
sseidman



Joined: 14 Mar 2005
Posts: 159

View user's profile Send private message

Ex_FFT failing on dsPIC30F4011
PostPosted: Mon Jun 17, 2013 5:40 pm     Reply with quote

I'm trying to run this example. I don't want to post the whole example, as it's a CCS file, but I can get it to compile, even after making the following changes:
I replaced all the headers associated with the audio demo board with headers for the right pic

Code:


#include <testdspic30.h>


// bin/slot size result of FFT is SampeRate/FFT_LENGTH.
// must be power of 2.
#define FFT_LENGTH 32

// sine windowing algorithms


// sine windowing algorithms
#if defined(__DO_WINDOW__)
   #include <dsp_data_util.c>
   #include <sine_window.h>
#endif

// primary FFT algorithms
#include <fftverbose.h>


and everything after that is stock.


testdspic30.h:
Code:
#include <30F4011.h>

#FUSES NOWDT                    //No Watch Dog Timer
#FUSES CKSFSM                   //Clock Switching is enabled, fail Safe clock monitor is enabled
#FUSES NOBROWNOUT               //No brownout reset
#FUSES XT_PLL8
//#device ICSP=1
//#use delay(clock=80MHz, cystal=10MHz)
#use delay(clock=80MHz)
// INVERT set when not using MAX232 or similar driver
// Also, FORCE_SW as hardware does not support invert!
// Remove both if using driver chip.
#use RS232(baud=115200,xmit=PIN_F3,rcv=PIN_F2, FORCE_SW,  ERRORS, INVERT)
#define LED PIN_B0
#define DELAY 1000


and FFTverbose.h is simply the supplied fft.h, with some prints in it so I can find the failure point.

As it turns out, the failure is a restart somewheere during the call to
memcpy_brev(x_data, cplx_input, fft_size); in fft.h


The code compiles fine. I verified that MODCON and XBREV are in the same location on this dspic as on the one used in the example.

I'm using PCD v5.006

Any pointers? This is my first foray into the dsPIC, though I'm long friendly w/ the lesser PICs.

Thanks
sseidman



Joined: 14 Mar 2005
Posts: 159

View user's profile Send private message

SOLVED
PostPosted: Tue Jun 18, 2013 1:32 pm     Reply with quote

Just needed some more memory. I guess there's no error checking for the assembly in the example.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group