miro
Joined: 15 Jan 2011 Posts: 62
|
dspic33fj - fft.h and adc dma |
Posted: Thu Jun 18, 2015 7:18 am |
|
|
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
PS: FJ is "old", EP is "new" |
|