F28335上实现浮点FFT

点击打开链接

硬件:

  1. ICETEK-F28335-A开发板 花了1900米买来,硬件和配套的软件(TI提供的例程加上一点icetek实验)都比较粗糙,文档错误不少,整个东东给人的感觉是匆忙的赶工出来的,不过总算有个可以跑的硬件平台,软件基本可以无视icetek的(除了存储器空间分配,不过icetek在这个问题上和我开了一个玩笑,拿到手的资料讲特别提到外部RAM映射到zone7,测试确怎么都不对,所以奇怪了好一阵,试了换到zone6才恍然大悟,icetek这样的错误也能犯,无语了)资料。
  2. SEEDDSP的USB510仿真器,由于SEEDDSP还未有正式版的驱动发布,所以向seeddsp的zag兄讨了一份测试版的驱动,几个月下来倒也没出什么问题。

软件:

开发环境:

  1. CCS3.3.54
  2. 浮点支持库 文件名:  setup_C28XFPU_CSP_v3[1].3.1207.exe  下载地址: http://www.fs2you.com/files/e86a863a-57e2-11dd-9007-0014221b798a/

    大小:5.7M

  3. C2000代码生成器 文件名:  C2000CodeGenerationTools5[1].0.0Beta2.exe

    下载地址:  http://www.fs2you.com/files/c8217dd4-57e2-11dd-ac64-0014221b798a/

    大小:12.4M

  4. 浮点信号处理库 提供了实时浮点fft算法 C28x Floating-Point Unit Library 1.00 Beta1 http://focus.ti.com.cn/cn/lit/sw/sprc624/sprc624.zip

安装好上述软件后,在ccs的component manager里边选择Code Composer Studio->build tools->tms320c28xx->选中Texas Instrument C2000 Code generation tools<5.0.0B2> 保存设置退出,Rebuild project,就不会出现下面的报错了。

WARNING: invalid compiler option –float_support=fpu32 (ignored)

              C:DOCUME~1ADMINI~1LOCALS~1TempTI2323, line 24:   error:

               can’t find input file ‘rts2800_fpu32.lib’

从外部存储器执行的FFT测试代码:fft输入数据和输出数据定位在外部存储器空间zone6, 包括FFT功能的timer0中断服务程序从zone6执行。

以下是代码:

//###########################################################################

//

// FILE:    Example_2833xFFTExecuteFromXINTF.c

//

// TITLE:   Example FFT Program That Executes From XINTF

//

// ASSUMPTIONS:

//

//    This program requires the DSP2833x header files.

//

//    As supplied, this project is configured for “boot to SARAM”

//    operation.  The 2833x Boot Mode table is shown below.

//    For information on configuring the boot mode of an eZdsp,

//    please refer to the documentation included with the eZdsp,

//

//       $Boot_Table:

//

//         GPIO87   GPIO86     GPIO85   GPIO84

//          XA15     XA14       XA13     XA12

//           PU       PU         PU       PU

//        ==========================================

//            1        1          1        1    Jump to Flash

//            1        1          1        0    SCI-A boot

//            1        1          0        1    SPI-A boot

//            1        1          0        0    I2C-A boot

//            1        0          1        1    eCAN-A boot

//            1        0          1        0    McBSP-A boot

//            1        0          0        1    Jump to XINTF x16

//            1        0          0        0    Jump to XINTF x32

//            0        1          1        1    Jump to OTP

//            0        1          1        0    Parallel GPIO I/O boot

//            0        1          0        1    Parallel XINTF boot

//            0        1          0        0    Jump to SARAM        <- “boot to SARAM”

//            0        0          1        1    Branch to check boot mode

//            0        0          1        0    Boot to flash, bypass ADC cal

//            0        0          0        1    Boot to SARAM, bypass ADC cal

//            0        0          0        0    Boot to SCI-A, bypass ADC cal

//                                              Boot_Table_End$

//

// DESCRIPTION:

//

//          This example configures CPU Timer0 and increments

//          a counter each time the timer asserts an interrupt.

//

//          The ISR code is loaded into SARAM.  The XINTF Zone 6 is

//          configured for x16-bit data bus.  A porition of the code including FFT

//          is copied to XINTF for execution there.

//

//       Watch Variables:

//          CpuTimer0.InterruptCount

//          InBuffer

//          OutBuffer

//          MagBuffer

//###########################################################################

// $TI Release: DSP2833x Header Files V1.10 $

// $Release Date: February 15, 2008 $

//###########################################################################

#include “DSP2833x_Device.h”         // DSP2833x Headerfile

#include “DSP2833x_Examples.h”      // DSP2833x Examples headerfile

#include “math.h”

#define PI 3.1415926

// This function will be loaded into SARAM and copied to

// XINTF zone 6 for execution

#pragma CODE_SECTION(cpu_timer0_isr,”xintffuncs”);

//LED indicating the state of ISR execution

#define LED (*(unsigned short int *)0x180000)

//FFT Parameters

#include “FPU.h”

#define FFT_SIZE   1024        /* 32, 64, 128, 256, etc        */

#define FFT_STAGES   10        /* log2(FFT_SIZE)               */

/* Align the INBUF section to 2*FFT_SIZE in the linker file   */

#pragma DATA_SECTION(InBuffer, “FFTBUF”);

float32 InBuffer[FFT_SIZE];

#pragma DATA_SECTION(OutBuffer, “ZONE6DATA”);

float32 OutBuffer[FFT_SIZE];

#pragma DATA_SECTION(TwiddleBuffer, “ZONE6DATA”);

float32 TwiddleBuffer[FFT_SIZE];

#pragma DATA_SECTION(MagBuffer, “ZONE6DATA”);

float32 MagBuffer[FFT_SIZE/2];

RFFT_F32_STRUCT fft; 

float32 a1=1.0,a2=100.0,a3=10000.0;//amplitudes

float32 f1=5.00,f2=25.00,f3=45.00; //frequencies

来源:zhnn610735528

声明:本站部分文章及图片转载于互联网,内容版权归原作者所有,如本站任何资料有侵权请您尽早请联系jinwei@zod.com.cn进行处理,非常感谢!

上一篇 2015年4月9日
下一篇 2015年4月10日

相关推荐