Chapter 1 Getting Started

Post on 03-Jan-2016

55 views 0 download

Transcript of Chapter 1 Getting Started

0 - 0 - 11

© 2010 Texas Instruments Inc

Practical Audio Experiments using the TMS320C5505 USB Stick

“Getting Started”

Texas Instruments University Programme

Teaching Materials

Chapter 1 - Slide Chapter 1 - Slide 22© © 2010 Texas Instruments Inc 2010 Texas Instruments Inc

Getting Started

Chapter 1 - Slide Chapter 1 - Slide 33© © 2010 Texas Instruments Inc 2010 Texas Instruments Inc

Objectives

• To build your first project using the TMS320C5505 USB Stick.

• Playback music using the TMS320C5505 USB stick.

• Modify the code.

Chapter 1 - Slide Chapter 1 - Slide 44© © 2010 Texas Instruments Inc 2010 Texas Instruments Inc

Important

• Follow the steps carefully!

• If the wrong memory models are used, the project will not build.

Chapter 1 - Slide Chapter 1 - Slide 55© © 2010 Texas Instruments Inc 2010 Texas Instruments Inc

Compatibility

• All of the applications provided on this teaching CD will also run on the TMS320C5505 and TMS320C5515 USB Stick without modification.

• To run the applications on the older TMS320VC5505 USB stick, it is necessary to make a change to the file csl_general.h

Chapter 1 - Slide Chapter 1 - Slide 66© © 2010 Texas Instruments Inc 2010 Texas Instruments Inc

TMS320C5505 USB Stick Setup

USB to PC

Headphones

CD Player

USB Stick

Chapter 1 - Slide Chapter 1 - Slide 77© © 2010 Texas Instruments Inc 2010 Texas Instruments Inc

TMS320C5515 USB Stick Setup

USB to PC

Headphones

Microphone

Chapter 1 - Slide Chapter 1 - Slide 88© © 2010 Texas Instruments Inc 2010 Texas Instruments Inc

Compatible Microphone

• A 600 Ohm dynamic microphone is recommended. A low-cost karaoke microphone can be used.

Chapter 1 - Slide Chapter 1 - Slide 99© © 2010 Texas Instruments Inc 2010 Texas Instruments Inc

Microphone Adaptor

• The USB stick uses a 3.5mm stereo jack

• For a 6.35mm jack (microphone or guitar), an adaptor is required.

Chapter 1 - Slide Chapter 1 - Slide 1010© © 2010 Texas Instruments Inc 2010 Texas Instruments Inc

Workspace

• Code Composer Studio creates a “workspace”, that is a folder where projects are stored

• The default directory is:

Desktop -> My Documents -> Workspace.

Chapter 1 - Slide Chapter 1 - Slide 1111© © 2010 Texas Instruments Inc 2010 Texas Instruments Inc

Create New Folder in Workspace

• Using Windows Explorer, create a new folder

Chapter 1 - Slide Chapter 1 - Slide 1212© © 2010 Texas Instruments Inc 2010 Texas Instruments Inc

Naming the New Project

• Name this folder MyFirstProject

Chapter 1 - Slide Chapter 1 - Slide 1313© © 2010 Texas Instruments Inc 2010 Texas Instruments Inc

Copy the Files

• Copy the project files to MyFirstProject folder

Chapter 1 - Slide Chapter 1 - Slide 1414© © 2010 Texas Instruments Inc 2010 Texas Instruments Inc

Start Code Composer Studio

• Start Code Composer Studio

Chapter 1 - Slide Chapter 1 - Slide 1515© © 2010 Texas Instruments Inc 2010 Texas Instruments Inc

Creating a New Project

• Select File -> New ->CCS Project

Chapter 1 - Slide Chapter 1 - Slide 1616© © 2010 Texas Instruments Inc 2010 Texas Instruments Inc

Naming the New Project

• For Project Name use MyFirstProject. Click Next >

Chapter 1 - Slide Chapter 1 - Slide 1717© © 2010 Texas Instruments Inc 2010 Texas Instruments Inc

Project Types Available

• Default is ARM. Select Project Type C5500 from list.

Chapter 1 - Slide Chapter 1 - Slide 1818© © 2010 Texas Instruments Inc 2010 Texas Instruments Inc

Project Type Selected

• Click on Next >

Chapter 1 - Slide Chapter 1 - Slide 1919© © 2010 Texas Instruments Inc 2010 Texas Instruments Inc

Additional Project Settings

• No references to other projects. Click Next >

Chapter 1 - Slide Chapter 1 - Slide 2020© © 2010 Texas Instruments Inc 2010 Texas Instruments Inc

Select TMS320C5505

• From the pull-down menu, select TMS320C5505

• Note: This and others windows may look slightly different, depending on the release version of CCS 4.

Chapter 1 - Slide Chapter 1 - Slide 2121© © 2010 Texas Instruments Inc 2010 Texas Instruments Inc

Select Runtime Support Library

• The Runtime Support Library required is rts55h.lib, which is automatically selected.

Chapter 1 - Slide Chapter 1 - Slide 2222© © 2010 Texas Instruments Inc 2010 Texas Instruments Inc

Select Linker Command File

• Do not put anything in Linker Command File.

• Click on Finish.

Chapter 1 - Slide Chapter 1 - Slide 2323© © 2010 Texas Instruments Inc 2010 Texas Instruments Inc

Active Project

• The the C/C++ Projects window, MyFirstProject is the Active Project for Debug.

Chapter 1 - Slide Chapter 1 - Slide 2424© © 2010 Texas Instruments Inc 2010 Texas Instruments Inc

Show Files in MyFirstProject

• Click on + to expand the list of files.

Chapter 1 - Slide Chapter 1 - Slide 2525© © 2010 Texas Instruments Inc 2010 Texas Instruments Inc

View main.c

• Double left click on main.c to open the main.c file.

Chapter 1 - Slide Chapter 1 - Slide 2626© © 2010 Texas Instruments Inc 2010 Texas Instruments Inc

Select Project Properties

• Select Project -> Properties

Chapter 1 - Slide Chapter 1 - Slide 2727© © 2010 Texas Instruments Inc 2010 Texas Instruments Inc

Properties for MyFirstProject

Chapter 1 - Slide Chapter 1 - Slide 2828© © 2010 Texas Instruments Inc 2010 Texas Instruments Inc

C/C++ Build – Basic Settings

• Double Click on

C/C++ Build

Chapter 1 - Slide Chapter 1 - Slide 2929© © 2010 Texas Instruments Inc 2010 Texas Instruments Inc

Basic Options

• Click on Basic Options.

Chapter 1 - Slide Chapter 1 - Slide 3030© © 2010 Texas Instruments Inc 2010 Texas Instruments Inc

Setup Silicon Version

• Type 5505 in for (--silicon_version, -v)

Chapter 1 - Slide Chapter 1 - Slide 3131© © 2010 Texas Instruments Inc 2010 Texas Instruments Inc

Runtime Model Options

• Double click on Runtime Model Options

Chapter 1 - Slide Chapter 1 - Slide 3232© © 2010 Texas Instruments Inc 2010 Texas Instruments Inc

Setting the Pointer Size

• Set (--ptrdiff_size) to 32 (default).

Chapter 1 - Slide Chapter 1 - Slide 3333© © 2010 Texas Instruments Inc 2010 Texas Instruments Inc

Selecting the Memory Model

• It is important to use the “huge” memory model.

Chapter 1 - Slide Chapter 1 - Slide 3434© © 2010 Texas Instruments Inc 2010 Texas Instruments Inc

Runtime Model Options Selected

• Click on OK.

Chapter 1 - Slide Chapter 1 - Slide 3535© © 2010 Texas Instruments Inc 2010 Texas Instruments Inc

Processor Specific Settings

• Two different processors have been used on the C5505 USB Stick:

– TMS320C5505 (newer boards)

– TMS320VC5505 (older boards), as shown in picture below:

Chapter 1 - Slide Chapter 1 - Slide 3636© © 2010 Texas Instruments Inc 2010 Texas Instruments Inc

Modifications for TMS320VC5505

• The following change is required for boards with the TMS320VC5505 only.

• Go to the C/C++ Projects window then open the file csl_general.h:

Chapter 1 - Slide Chapter 1 - Slide 3737© © 2010 Texas Instruments Inc 2010 Texas Instruments Inc

Building the Project

• Select:

Project ->

Build Active Project.

Chapter 1 - Slide Chapter 1 - Slide 3838© © 2010 Texas Instruments Inc 2010 Texas Instruments Inc

Build Complete

• Console windows shows build is complete

• Problems window should contain no errors or warnings.

Chapter 1 - Slide Chapter 1 - Slide 3939© © 2010 Texas Instruments Inc 2010 Texas Instruments Inc

Confirming Memory Model

• Scroll up the Console Window to check that memory_model=huge.

Chapter 1 - Slide Chapter 1 - Slide 4040© © 2010 Texas Instruments Inc 2010 Texas Instruments Inc

Problems with the Build?

• If you are having specific problems with the build, it is most likely that you have missed out a step in the process

• It is important to have:

– Silicon version 5505

– huge memory model

– rts55h.lib

Chapter 1 - Slide Chapter 1 - Slide 4141© © 2010 Texas Instruments Inc 2010 Texas Instruments Inc

Debugging the Project

Chapter 1 - Slide Chapter 1 - Slide 4242© © 2010 Texas Instruments Inc 2010 Texas Instruments Inc

Launch TI Debugger

• Select Target -> Launch TI Debugger

Chapter 1 - Slide Chapter 1 - Slide 4343© © 2010 Texas Instruments Inc 2010 Texas Instruments Inc

First Debug Session Only

• The first time you debug, you will be asked to Open Target Configuration. Click Yes.

Chapter 1 - Slide Chapter 1 - Slide 4444© © 2010 Texas Instruments Inc 2010 Texas Instruments Inc

Naming Target Configuration

• You may wish to change the Target Configuration Name.

Chapter 1 - Slide Chapter 1 - Slide 4545© © 2010 Texas Instruments Inc 2010 Texas Instruments Inc

Setup XDS100 USB Emulator

• Select Texas Instruments XDS100v2 USB Emulator.

Chapter 1 - Slide Chapter 1 - Slide 4646© © 2010 Texas Instruments Inc 2010 Texas Instruments Inc

Configure C5505 USB Stick

• Select USBSTK5505. Click on Save.

Chapter 1 - Slide Chapter 1 - Slide 4747© © 2010 Texas Instruments Inc 2010 Texas Instruments Inc

XDS100 Now Connected

• The XDS100 USB Emulator is now connected.

Chapter 1 - Slide Chapter 1 - Slide 4848© © 2010 Texas Instruments Inc 2010 Texas Instruments Inc

XDS100 Emulator Configured

• The Console window shows that the Phase Lock Loop has been set up for 100MHz operation

• The XDS100 USB Emulator has been successfully set up.

Chapter 1 - Slide Chapter 1 - Slide 4949© © 2010 Texas Instruments Inc 2010 Texas Instruments Inc

Start Debug of MyFirstProject

• Select Target -> Debug Active Project.

Chapter 1 - Slide Chapter 1 - Slide 5050© © 2010 Texas Instruments Inc 2010 Texas Instruments Inc

Debugging MyFirstProject

• XDS100 USB Emulator is debugging MyFirstProject.

Chapter 1 - Slide Chapter 1 - Slide 5151© © 2010 Texas Instruments Inc 2010 Texas Instruments Inc

Go to main()

• Arrow shows that the program is ready to run from the beginning of main().

Chapter 1 - Slide Chapter 1 - Slide 5252© © 2010 Texas Instruments Inc 2010 Texas Instruments Inc

Run Program

• Select Target -> Run.

Chapter 1 - Slide Chapter 1 - Slide 5353© © 2010 Texas Instruments Inc 2010 Texas Instruments Inc

Program Running

• The following text is shown in the Console Window:

Chapter 1 - Slide Chapter 1 - Slide 5454© © 2010 Texas Instruments Inc 2010 Texas Instruments Inc

Halt Program Execution

• To stop the program, select Target -> Halt.

Chapter 1 - Slide Chapter 1 - Slide 5555© © 2010 Texas Instruments Inc 2010 Texas Instruments Inc

Modifying C Code

Chapter 1 - Slide Chapter 1 - Slide 5656© © 2010 Texas Instruments Inc 2010 Texas Instruments Inc

Before Modification

• main.c before modification

Chapter 1 - Slide Chapter 1 - Slide 5757© © 2010 Texas Instruments Inc 2010 Texas Instruments Inc

After Modification

• main.c after modification. Change gain of channels.

Chapter 1 - Slide Chapter 1 - Slide 5858© © 2010 Texas Instruments Inc 2010 Texas Instruments Inc

Rebuild Active Project

Chapter 1 - Slide Chapter 1 - Slide 5959© © 2010 Texas Instruments Inc 2010 Texas Instruments Inc

Viewing Files in Debug

Chapter 1 - Slide Chapter 1 - Slide 6060© © 2010 Texas Instruments Inc 2010 Texas Instruments Inc

Viewing Source Files

• Highlight any file and click on it to edit.

Chapter 1 - Slide Chapter 1 - Slide 6161© © 2010 Texas Instruments Inc 2010 Texas Instruments Inc

Summary

Chapter 1 - Slide Chapter 1 - Slide 6262© © 2010 Texas Instruments Inc 2010 Texas Instruments Inc

Summary

• You have now learnt how to set up the TMS320C5505 USB Stick

• All of the other applications are self-contained, so if you have a specific interest, you can go straight to that application

• It is recommended that the chapters be followed in sequence because some of the later chapters use concepts explained earlier.