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 support@ccsinfo.com

dspic33fj - fft.h and adc dma

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



Joined: 15 Jan 2011
Posts: 62

View user's profile Send private message

dspic33fj - fft.h and adc dma
PostPosted: Thu Jun 18, 2015 7:18 am     Reply with quote

Hi, after a long evening elaborating a piece of code which worked fine in past I share my lesson learned:
1. the code does fft with adc->dma_buffers-ping-pong
2. I had to place the stack at a free place manually, otherwise it blocked the dma buffers creation (not enough memory)
#build(stack=0x3e00:0x3fff)
3. and here is a nice "fix" ccs kindly did for us and which I discovered only after several hours of messing with my code in fft.h, line208:

Code:
/* x_data: fft data array used for the in-place, radix-2, DIT FFT.  A pointer
 * to this memory array is returned by all FFT and IFFT functions.  This
 * array must be as long as the largest data sample to be transformed (nominally
 * 64 complex values).  This array must be located at 0x1000 for bit reversing
 * up to 2048 points, or at 0x0800 for bit reversing up to 1024 points.
 */
Complex x_data[2*FFT_LENGTH];
//#locate x_data = 0x0800  //old
#locate x_data = 0x1000 //fix for EP

I doubt this is the way how the various chip versions should be handled in the source code, however Smile
PS: FJ is "old", EP is "new" Smile
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