You are currently viewing DFT 8 Point Using TMS320F2812 DSP

DFT 8 Point Using TMS320F2812 DSP

Spread the love


To perform the 8 point DFT process from a given discrete sequence in TMS320F2812 KIT.



The sequence of N complex numbers x0, …, xNāˆ’1 is transformed into another sequence of N complex numbers according to the DFT formulaDFT formula

It transforms one function into another, which is called the frequency domain representation, or simply the DFT, of the original function (which is often a function in the time domain).

The DFT requires an input function that is discrete. Such inputs are often created by sampling a continuous function, such as a person’s voice. The discrete input function must also have a limited (finite) duration, such as one period of a periodic sequence or a windowed segment of a longer sequence. Unlike the discrete time Fourier transform (DTFT), the DFT only evaluates enough frequency components to reconstruct the finite segment that was analyzed. The inverse DFT cannot reproduce the entire time domain, unless the input happens to be periodic. Therefore it is often said that the DFT is a transform for Fourier analysis of finite-domain discrete-time functions.

Procedure for build a project on DFT 8 Point Using TMS320F2812 DSP

Note: Once you install the Code Composer Studio v 3.3 software, the two icons will display in desktop

  • Setup Code Composer Studio v3.3
  • Code Composer Studio

1. Open Setup Code Composer Studio v3.3.

2. In System Configuration, select the board then ā†’ Remove all ā†’ yes.

  • In family, select C28xx.
  • In platform, select xds100 usb emulator.
  • In Endianness, select little.
  • Select F2812 XDS100 USB Emulator ā†’ add ā†’ save & quit ā†’ no.

Note: The above two steps only for first time to setup the processor in CCS.

3. Open Code Composer Studio v3.3.

4. Project ā†’ New.

  • Project name: type the project name.
  • Location: Browse, select the project location .
  • Project Type: Executable(.out)
  • Target: TMS320C28XX. ā†’ Finish.

5. File ā†’ New ā†’ Source file.

  • Type the program in untitled window.

6. File ā†’ Save.

  • Browse our project location then type our project name.c ( .c extension is must) ā†’ save.

7. Paste the following two cmd files in our project folder.

  • F2812_EzDSP_RAM_lnk.cmd
  • DSP281x_Headers_nonBIOS.cmd
  • DSP281x_GlobalVariableDefs.c

Project ā†’ Add files to project.

  • In file of type : All files
  • Ctrl + Select the following files     –  projectname.c     –  DSP281x_GlobalVariableDefs.c     –  F2812_EzDSP_RAM_lnk.cmd     –  DSP281x_Headers_nonBIOS.cmd ļƒ  open.

9. Project ā†’ Build Option.

In compiler tab, select Preprocessor

  • Include search path(-i) : C:\tidcs\c28\DSP281x\v120\DSP281x_headers\include

In linker tab, select libraries

  • Search path(-i) : C:\CCStudio_v3.3\C2000\cgtools\lib
  • Incl libraries(-l) : rts2800_ml.lib.

In linker tab, select Basic

  • Stack Size(-stack): 0x400 ā†’ ok.

10. Project ā†’ Build (or) Rebuild all.

11. Connections for TMS320F2812 KIT

12. Debug ā†’ connect.

13. File ā†’ Load Program ā†’ Browse and select the projectname.out file ā†’ open

14. Debug ā†’ Go main.

15. View ā†’ memory

Enter An Address : 0x3F9100 ā†’ Enter.

Type the input.

For example:

0x3F9100 ā€“ 0x0001
0x3F9101 ā€“ 0x0001
0x3F9102 ā€“ 0x0001
0x3F9103 ā€“ 0x0000
0x3F9104 ā€“ 0x0000
0x3F9105 ā€“ 0x0000
0x3F9106 ā€“ 0x0000
0x3F9107 ā€“ 0x0000

16. Debug ā†’ Run.

17. Debug ā†’ Halt.

18. See the output at following location, View ā†’ memory

Enter An Address:0x3F9110 ā†’ Enter.(REAL PART)

For example

0x3F9110 ā€“ 0x0003
0x3F9111 ā€“ 0x0001
0x3F9112 ā€“ 0x0000
0x3F9113 ā€“ 0x0000
0x3F9114 ā€“ 0x0001
0x3F9115 ā€“ 0x0000
0x3F9116 ā€“ 0xFFFF
0x3F9117 ā€“ 0x0000

19. View ā†’ memory

Enter An Address : 0x3F9120 ā†’ Enter.(IMAGINARY PART)

For example

0x3F9120 ā€“ 0x0000
0x3F9121 ā€“ 0xFFFF
0x3F9122 ā€“ 0xFFFF
0x3F9123 ā€“ 0x0001
0x3F9124 ā€“ 0x0000
0x3F9125 ā€“ 0xFFFF
0x3F9126 ā€“ 0x0000
0x3F9127 ā€“ 0x0001

Program for DFT 8 Point Using TMS320F2812 DSP

#include "DSP281x_Device.h"
#define   PI     3.14159
#define N       8
void InitSystem();
void main()
        int *Input,*Real_out,*Imag_out;
        int i=0,j=0,k=0,real_temp=0,imag_temp=0;
        double teta=0,Real_coeff[64],Imag_coeff[64];
        int n=0,b=0,c=0;
        Input = (int *)0x003F9100;
        Real_out = (int *)0x003F9110;
        Imag_out = (int *)0x003F9120;
                        teta = ((2 * PI * n * c) / N);         //  c = k in formulae
                        Real_coeff[b] = cos(teta);
                        Imag_coeff[b] = -sin(teta);

                        real_temp += (Input[j] * Real_coeff[k]);
                        imag_temp += (Input[j] * Imag_coeff[k]);
                *(Real_out + i) = real_temp;
                *(Imag_out + i) = imag_temp;


void InitSystem()
                SysCtrlRegs.WDCR= 0x0068;            // Setup the watchdog
                                             // 0x0068  to disable the Watchdog , Prescaler = 1                                                                        // 0x00AF  to NOT disable the Watchdog, Prescaler = 64
                SysCtrlRegs.SCSR = 0;                  // Watchdog generates a RESET      
                SysCtrlRegs.PLLCR.bit.DIV = 10;        // Setup the Clock PLL to multiply by 5
                SysCtrlRegs.HISPCP.all = 0x1; // Setup Highspeed Clock Prescaler to divide by 2
                SysCtrlRegs.LOSPCP.all = 0x2; // Setup Lowspeed CLock Prescaler to divide by 4
                // Peripheral clock enables set for the selected peripherals.  


Thus, the 8 point DFT process from a given discrete sequence has performed and the result is stored at memory location(0x3F9110 & 0x3F9120)..

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.