sseidman
Joined: 14 Mar 2005 Posts: 159
|
Ex_FFT failing on dsPIC30F4011 |
Posted: Mon Jun 17, 2013 5:40 pm |
|
|
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 |
|