DSP LAB - Introduction

29
DSP LAB - Introduction

Transcript of DSP LAB - Introduction

Page 1: DSP LAB - Introduction

DSP LAB - Introduction

Page 2: DSP LAB - Introduction

6713 DSK

Page 3: DSP LAB - Introduction

DSK 6713 Features

Key features include:

A Texas Instruments TMS320C6713 DSP

operating at 225 MHz.

An AIC23 stereo codec

8 Mbytes of synchronous DRAM

512 Kbytes of non-volatile Flash memory

4 user accessible LEDs and DIP switches

Page 4: DSP LAB - Introduction

DSK 6713 Features

Software board configuration through registersimplemented in CPLD

Configurable boot options

Standard expansion connectors for daughtercard use

JTAG emulation through on-board JTAGemulator with USB host interface or externalemulator

Single voltage power supply (+5V)

Page 5: DSP LAB - Introduction

CPLD

A programmable logic device called a CPLD is used toimplement glue logic that ties the board componentstogether.

The CPLD has a register based user interface that lets theuser configure the board by reading and writing to itsregisters.

The DSK includes 4 LEDs and a 4 position DIP switch as asimple way to provide the user with interactive feedback.Both are accessed by reading and writing to the CPLDregisters.

Page 6: DSP LAB - Introduction

CPLD Registers

The 4 CPLD memory-mapped registers allowsusers to control CPLD functions in software.

On the 6713 DSK the registers are primarily usedto access the LEDs and DIP switches and controlthe daughter card interface.

The registers are mapped into EMIF CE1 dataspace at address 0x90080000. They appear as 8-bitregisters with a simple asynchronous memoryinterface.

Page 7: DSP LAB - Introduction

USER_REG Register

USER_REG is used to read the state of the

4 DIP switches and turn the 4 LEDs on or

off to allow the user to interact with the

DSK. The DIP switches are read by reading

the top 4 bits of the register and the LEDs

are set by writing to the low 4 bits.

Page 8: DSP LAB - Introduction
Page 9: DSP LAB - Introduction

Memory Map

The memory map shows the address space of a generic6713 processor on the left with specific details of how eachregion is used on the right. By default, the internal memorysits at the beginning of the address space.

Portions of the internal memory can be reconfigured insoftware as L2 cache rather than fixed RAM.

The EMIF has 4 separate addressable regions called chipenable spaces (CE0-CE3).

The SDRAM occupies CE0 while the Flash and CPLDshare CE1. CE2 and CE3 are generally reserved fordaughtercards.

Page 10: DSP LAB - Introduction
Page 11: DSP LAB - Introduction

List of Experiments (Lab 2)

Page 12: DSP LAB - Introduction

Experiment 1:

1. Generate the following waveforms and observe theoutput using the graphical display utility of the CodeCompose Studio (CCS).

a.Sine b. Triangular c. Square.

2. Modify your program, to vary the amplitude andfrequency of the generated waveforms, using „GEL‟function. Observe the variables through watch windowfacility of CCS.

3. Generate a 1 KHz sine function sampled at 8 KHz.Observe the spectrum using CCS. Observe the effect ofwindowing.

Page 13: DSP LAB - Introduction

Experiment 2:

1. Write a program to implement the following Linear Convolution

Difference Equation

2. Use the above algorithms to verify the operation of FIR filter (Obtain the coefficients using MATLAB).

IIR filter (Obtain the polynomial coefficients from MATLAB)respectively.

3. Verify your algorithms by inputting a signal from thesignal generator (Configure the Codec in the 6713DSKBoard).

Page 14: DSP LAB - Introduction

Steps to Create and run a Project

Turn on the DSK6713 kit and open the code ComposerStudio (CCS).

Creating a New Project:

Create a folder in C:\CCStudio_v3.1\myprojects folder inyour batch name, where you can save all your projects.

From the Project menu, choose New. In the Project Name field, type the project name.

In the Location field, type or browse to the folder you created instep 1.

By default, Project Type is set as Executable (.out)

In the Target field select TMS320C67XX.

Click Finish. Code Composer Studio creates a project file calledprojectname.pjt. This file stores your project settings and referencesthe various files used by your project.

Page 15: DSP LAB - Introduction

Project Creation Wizard

Page 16: DSP LAB - Introduction

Steps to Create and run a Project

After creating a new project file, add the files for your source code, object libraries, and linker command file to the project list.

Create a source file from the file menu. File -- New -- Source File.Type your program and save it in your project file as filename.c.

Add files to the project by choosing „Add Files to Project‟ from theProject menu. You can also right-click the project in the Project Viewwindow on the left and then select Add Files to Project.

Add the C source file from the appropriate path (project file).

Add rts6700.lib from c:\CCStudio_v3.1\c6000\cgtools\lib. (SelectObject & library (*.o, *.l) in the Type of fields)

Add volume.cmd (this is a linker command file that maps sections tomemory) from c:\CCStudio_v3.1\tutorial\dsk6713\volume1. (SelectLinker Command File (*.cmd) in the Type of fields)

Copy the header files (of type *.h if included in the source file) to yourproject folder.

Page 17: DSP LAB - Introduction
Page 18: DSP LAB - Introduction

Add Files to Project

Page 19: DSP LAB - Introduction

Steps to Create and run a Project

Building Your Program:

Use the „Build All‟ function the first time you build the

project. An output window will show the build process and

status. When the build is finished, the output window will

display Build complete 0 errors, 0 warnings.

The Rebuild All command is mainly used to rebuild the

project when the project options or any files in the project

have changed.

Page 20: DSP LAB - Introduction

Steps to Create and run a Project

Loading Your Program:

After the program has been built successfully, from the Debugmenu, select “connect” and then load the program by going toFile -- Load Program. By default, Code Composer Studio IDE willcreate a subdirectory called Debug within your project directory andstore the .out file in it. Select projectname.out and click Open to loadthe program.

Remember to reload the program by choosing File -- ReloadProgram if you rebuild the project after making changes.

To Execute the Project:

From the Debug menu select „Run‟.

Page 21: DSP LAB - Introduction

Viewing Variables

Variables can be viewed in the watch window when

the CPU has been halted. The watch window can be

opened by selecting View - - Watch Window. The

Watch Locals tab shows all the relevant variables in

the current execution.

To view the output graphically Selcet View - - graph

- - time and frequency

Page 22: DSP LAB - Introduction

Viewing Variables

Setting the probe point.

Build your project.

Choose FileLoad Program. Select filename.out, andclick Open.

Double-click on the filename.c file in the Project View.Or From the „Debug‟ menu, choose „Go main‟ (Thecursor stops at the beginning of your C source file).

Put your cursor in a line of the main function to whichyou want to add a probe point. Put the probe point at theappropriate line by Clicking the Toggle Software ProbePoint toolbar button.

Page 23: DSP LAB - Introduction

Setting the probe point Cont..

Create the output window where you want to se theoutput variations. (Select Graphical Display or watchwindow).

From the „File‟ menu choose file I/O. The File I/O dialogappears so that you can select input and output files. Inthe File I/O dialog, change the Address and the Lengthvalues.

Click Add Probe Point to show Probe Points tab of theBreak/Probe Points dialog.

In the Probe Point list, select the Probe Point you createdpreviously.

In the Connect To field, click the down arrow and select a.dat file from the list.

Page 24: DSP LAB - Introduction

Setting the probe point Cont..

Click Replace. The Probe Point list changes to showthat this point is connected to the sine.dat file.

Click OK. The File I/O dialog shows that the file isnow connected to a Probe Point.

Click OK to close the File I/O dialog.

Run the project

You can set probe point to view the input variation alsousing the same procedure. So you can set two graphicaldisplays (one for input and one for output) accordingly andit serves the purpose of a dual channel CRO.

Page 25: DSP LAB - Introduction

File I/O Dialog

Page 26: DSP LAB - Introduction

Probe Point Tab

Page 27: DSP LAB - Introduction

GEL Function

Controlling DSP Variables With GEL:

First, you create a GEL file defining a „slider control‟.

From the File menu, choose New -- Source File.

In the source file, type the following text:

slider Vary_Counter(0, 10, 1, 1, counterParam)

{

counterValue = counterParam;

} (Replace the „counter Value‟ by your variable name)

From the File menu, choose Save As. And browse your project file.

In the Save As box, choose General Extension Language Files (*.gel).

Type „gelname.gel‟ as the file name and click Save.

Page 28: DSP LAB - Introduction

GEL Function

Build your project.

From the File menu, choose Load GEL.

Browse to the location where you saved *.gel.

Select *.gel and click Open.

Load your program.

Choose GEL – default -- vary_Counter.

Vary your parameter in the slider.

Run the project.

To view the variation set a graphical display with probepoint connected at the appropriate line to view thevariation.

Page 29: DSP LAB - Introduction

To perform Single Step Debugging

Keep the cursor on the line from where you want to startsingle step debugging. You can set the breakpoint byselecting the „Toggle Breakpoint‟ toolbar button. When abreakpoint has been set, a red icon will appear in theselection margin.

Load the *.out file onto the target.

Go to View and select Watch Window.

Debug -- Run.

Execution should halt at the break point.

Press F10 to see the changes happening in the watch window.

Similarly go to view & select CPU registers to view thechanges happening in CPU registers.