Chapter 1 Getting Started

62
0 - 0 - 1 © 2010 Texas Instruments Inc Practical Audio Experiments using the TMS320C5505 USB Stick “Getting StartedTexas Instruments University Programme Teaching Materials

Transcript of Chapter 1 Getting Started

Page 1: 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

Page 2: Chapter 1 Getting Started

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

Getting Started

Page 3: Chapter 1 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.

Page 4: Chapter 1 Getting Started

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.

Page 5: Chapter 1 Getting Started

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

Page 6: Chapter 1 Getting Started

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

Page 7: Chapter 1 Getting Started

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

TMS320C5515 USB Stick Setup

USB to PC

Headphones

Microphone

Page 8: Chapter 1 Getting Started

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.

Page 9: Chapter 1 Getting Started

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.

Page 10: Chapter 1 Getting Started

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.

Page 11: Chapter 1 Getting Started

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

Page 12: Chapter 1 Getting Started

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

Naming the New Project

• Name this folder MyFirstProject

Page 13: Chapter 1 Getting Started

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

Page 14: Chapter 1 Getting Started

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

Start Code Composer Studio

• Start Code Composer Studio

Page 15: Chapter 1 Getting Started

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

Creating a New Project

• Select File -> New ->CCS Project

Page 16: Chapter 1 Getting Started

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 >

Page 17: Chapter 1 Getting Started

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.

Page 18: Chapter 1 Getting Started

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

Project Type Selected

• Click on Next >

Page 19: Chapter 1 Getting Started

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 >

Page 20: Chapter 1 Getting Started

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.

Page 21: Chapter 1 Getting Started

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.

Page 22: Chapter 1 Getting Started

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.

Page 23: Chapter 1 Getting Started

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.

Page 24: Chapter 1 Getting Started

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.

Page 25: Chapter 1 Getting Started

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.

Page 26: Chapter 1 Getting Started

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

Select Project Properties

• Select Project -> Properties

Page 27: Chapter 1 Getting Started

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

Properties for MyFirstProject

Page 28: Chapter 1 Getting Started

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

Page 29: Chapter 1 Getting Started

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

Basic Options

• Click on Basic Options.

Page 30: Chapter 1 Getting Started

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)

Page 31: Chapter 1 Getting Started

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

Runtime Model Options

• Double click on Runtime Model Options

Page 32: Chapter 1 Getting Started

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).

Page 33: Chapter 1 Getting Started

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.

Page 34: Chapter 1 Getting Started

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

Runtime Model Options Selected

• Click on OK.

Page 35: Chapter 1 Getting Started

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:

Page 36: Chapter 1 Getting Started

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:

Page 37: Chapter 1 Getting Started

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

Building the Project

• Select:

Project ->

Build Active Project.

Page 38: Chapter 1 Getting Started

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.

Page 39: Chapter 1 Getting Started

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.

Page 40: Chapter 1 Getting Started

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

Page 41: Chapter 1 Getting Started

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

Debugging the Project

Page 42: Chapter 1 Getting Started

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

Launch TI Debugger

• Select Target -> Launch TI Debugger

Page 43: Chapter 1 Getting Started

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.

Page 44: Chapter 1 Getting Started

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.

Page 45: Chapter 1 Getting Started

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.

Page 46: Chapter 1 Getting Started

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

Configure C5505 USB Stick

• Select USBSTK5505. Click on Save.

Page 47: Chapter 1 Getting Started

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.

Page 48: Chapter 1 Getting Started

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.

Page 49: Chapter 1 Getting Started

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

Start Debug of MyFirstProject

• Select Target -> Debug Active Project.

Page 50: Chapter 1 Getting Started

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

Debugging MyFirstProject

• XDS100 USB Emulator is debugging MyFirstProject.

Page 51: Chapter 1 Getting Started

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().

Page 52: Chapter 1 Getting Started

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

Run Program

• Select Target -> Run.

Page 53: Chapter 1 Getting Started

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:

Page 54: Chapter 1 Getting Started

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.

Page 55: Chapter 1 Getting Started

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

Modifying C Code

Page 56: Chapter 1 Getting Started

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

Before Modification

• main.c before modification

Page 57: Chapter 1 Getting Started

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.

Page 58: Chapter 1 Getting Started

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

Rebuild Active Project

Page 59: Chapter 1 Getting Started

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

Viewing Files in Debug

Page 60: Chapter 1 Getting Started

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.

Page 61: Chapter 1 Getting Started

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

Summary

Page 62: Chapter 1 Getting Started

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.