lab 0 - introduction

13
LAB 0: Introduction to Code Composer Studio Code Composer Studio (CCS) is the integrated development environment for TI's DSPs, microcontrollers and application processors. It includes compilers for both of MSP430 and ARM Cortex-M3 microcontroller device families, source code editor, project build environment, debugger, profiler, simulators and many other features. This lab describes how to make a project and set the target configurations for MSP430 and ARM Cortex-M3 experimenter boards. The MSP-EXP430F5438 Experimenter Board is an evaluation board meant to assess the capabilities of the MSP430F5438 family of microcontrollers. Built to complement the MSP430's high degree of mixed-signal integration, the Experimenter Board showcases external peripherals such a dot-matrix LCD, two-axis accelerometer, microphone, audio output, a serial USB connection and RF add-ons. It features a 100-pin socket which supports the MSP430F5438A and other devices with similar pinout. The EVALBOT is a robotic evaluation kit with a Stellaris ARM CORTEX M3-based LM3S9B92 microcontroller. It features integrated 10/100 Ethernet MAC/PHY, USB Host and

Upload: prakashshr

Post on 11-Nov-2015

227 views

Category:

Documents


1 download

DESCRIPTION

blah blah blah

TRANSCRIPT

  • LAB 0: Introduction to Code Composer Studio

    Code Composer Studio (CCS) is the integrated development environment for TI's

    DSPs, microcontrollers and application processors. It includes compilers for both of MSP430

    and ARM Cortex-M3 microcontroller device families, source code editor, project build

    environment, debugger, profiler, simulators and many other features.

    This lab describes how to make a project and set the target configurations for MSP430 and ARM

    Cortex-M3 experimenter boards.

    The MSP-EXP430F5438 Experimenter Board is an evaluation board meant to assess the

    capabilities of the MSP430F5438 family of microcontrollers. Built to complement the MSP430's

    high degree of mixed-signal integration, the Experimenter Board showcases external peripherals

    such a dot-matrix LCD, two-axis accelerometer, microphone, audio output, a serial USB

    connection and RF add-ons. It features a 100-pin socket which supports the MSP430F5438A and

    other devices with similar pinout.

    The EVALBOT is a robotic evaluation kit with a Stellaris ARM CORTEX M3-based

    LM3S9B92 microcontroller. It features integrated 10/100 Ethernet MAC/PHY, USB Host and

  • Device connectors, CAN, MicroSD card connector and OLED display. The board also includes

    motor drivers, opto-sensors to detect wheel rotation, power supply and wireless communication

    expansion connectors.

    1 Lab Objectives Create a project in Code Composer v5

    Create a target configuration file for MSP-EXP430F5438 and EVALBOT

    Add external resources to the project and compile it

    Use the debugger to insert Breakpoints, watch registers and variables and control the flow of execution of the microcontroller.

    This lab is a one week lab.

    2 Pre-Lab Read EVALBOT and MSP-EXP430F5438 Quick users guide manuals and learn how to assemble and setup the boards for debugging.

    2.1 Tools Requirements Software: Code Composer Studio v5

    Hardware:

    A MSP430 Flash Emulation Tool (MSP-FET430UIF) and MSP-EXP430F5438 Experimenter Board

    The Stellaris Robotic Evaluation Board (EVALBOT)

  • 3 Lab Procedure

    3.1 Compiler Installation - Perform if Compiler not Installed Code Composer Studio v5 can be downloaded directly from TI website:

    http://processors.wiki.ti.com/index.php/Download_CCS

    and then follow the instructions to install and activate it.

    http://processors.wiki.ti.com/index.php/GSG:CCSv5_Running_for_the_first_time

    Note: CCS can be used in software simulator mode without any external hardware and it is

    very useful for practicing and debugging your codes

    3.2 Create New Project for MSP430

    Create a new project and make a target configuration file for MSP430

    o Open CCSv5

    o Click on File --> New --> CCS Project

    o In the Project name field choose a name and a location for the project

    o In the Device section select Family as MSP430

    o Select MSP430x5xx Family and MSP430F5438A as Variant

    o Since we use MSP-FET430UIF select JTAG connection type TI MSP430

    USB1[Default]

    o Select Empty Project and click Finish.

  • An empty C file, , is created. You can create more source or header files and add

    them to the project by selecting Project Explorer on the left side of main view and then right-

    click and select New.

  • In order to add existing file to the project go to Project --> Add Files

    Select which is available on the course website. You can either copy

    the file into project folder or link to it in the import method dialog box.

    Since you have two main in your project remove using Project Explorer.

    Now you will compile and debug the project with F11 or click on green bug icon. Make

    sure the FET debugger is connected to the board and PC and the board is on.

  • If the hardware setup is correct and no error exists in the code, debugger will start and the

    screen changes to the debug perspective. Press F8 to resume the code execution and LED blinks.

    3.3 Debugger Perspective Launch the debugger again. The screen below will be shown

    In the source code view, the first line to be executed is highlighted. Here, it is the first line

    after main. To control the debugger, use debugging toolbar on the top-left side of the screen.

    Debugging functionalities are Run, Halt, Terminate, Step into/over/return. Become familiar with

    their functionalities.

    You can watch Registers and Expressions in the watch list. It is also possible to see the

    values by placing the mouse curser over variables in the source code view.

    3.4 Create New Project for ARM Cortex M3

    StellarisWare firmware development package is an extensive suite of software designed to

    simplify and speed development of applications for Stellaris microcontroller. You can have

    access to both object library and source code. You can download and install a full version of this

    software from.

    http://www.ti.com/tool/sw-lm3s

    Smaller size version just for EVALBOT is available at:

    http://www.ti.com/product/sw-ek-evalbot

  • Either full or custom version should already been installed on your system.

    3.4.1 Import Libraries

    Make new empty workspace. Create a new project. Follow same instructions as MSP430

    except

    o In the Device section select Family as ARM

    o Select ARM and Stellaris LM3S9B92 as Variant

    o The connection is Stellaris In-Circuit Debug Interface

  • Note : Debugger is embedded in the EVALBOT boards and external JTAG is not required.

    Connect the board directly to the PC using ICDI connector and a mini-USB cable.

    Before adding the code and compiling the project, the location of included library needs to

    be specified.

    Open Project-->Properties

    Select Build-->TMS470 Compiler-->Include Options

  • Add the StellarisWare directory to the #include search path with the icon shown

    You also need to introduce driverlib to the linker.

    Under the Build select TMS470 Linker-->File Search Path.

    In the Include library file or command file as input (--library, -l) add the

    to the linkers search paths

  • Now set the target type for the compiler as bellow:

    Select Project-->Properties-->Build-->TMS470 Compiler-->Predefined Symbols and add this

    symbol : TARGET_IS_TEMPEST_RB1

  • 3.4.2 Import Sources

    In addition to microcontrollers drivers, StellarisWare provides board specific divers too.

    The drivers for EVALBOT are un-compiled source codes and in order to use them in the project,

    we need to either copy or link the sources to the project. Here, we are using IO driver for LEDs.

    Select Project-->Add Files . The diver can be found in . Add and to the project.You can also add in

    this way.

    Run the and verify the functionality.

    4 Lab Questions (to be answered in your report)

    o What problems did you encounter in this Lab?

    o What is the difference between Step Over and Step Into?

  • o How can you place breakpoints? What are they used for?

    o In the MSP430 example code, how many lines accept breakpoint? Why it is not

    possible to add breakpoint to others?

    o In the watch list, right-click in the value of counter and select number format as

    Hex. What is the difference between format of this variable in MSP430 project and

    Cortex M3 project? Why?

    5 Lab Report Include the following in your report:

    Answers to Questions

    6 Documents There are many useful documents you will need as reference for this lab, these include:

    o MSP-EXP430F5438 Experimenter Board User's Guide This document contains all the information about the Experimenter board you will be using, some of which will be

    reproduced here. Designated slau263g and available at the following URL:

    http://www.ti.com/lit/ug/slau263g/slau263g.pdf

    o MSP430F5438A Datasheet This documents contains much on the information about the MSP430 device itself and its specifications. Although you will not have to deal with

    the details since you are using a prebuilt board, it is useful to familiarize yourself with it.

    http://www.ti.com/lit/ds/symlink/msp430f5438a.pdf

    o MSP430x5xx/MSP430x6xx Family User's Guide A must have description of the MSP430 individual modules. This document describes them in detail including the

    registers and the module operation. It will answer many of your questions of how to use

    the modules of the MSP430F5438.

    http://www.ti.com/lit/ug/slau208j/slau208j.pdf

    o LM3S9B92 EVALBOT Board Readme First This document briefly describes how to start using EVALBOT for the first time.

    http://www.ti.com/lit/ml/spmu168/spmu168.pdf

    o Stellaris Robotic Evaluation Board (EVALBOT) User's Manual This document contains all the information about the EVALBOT you will be using, some of which will

    be reproduced here. Designated spmu166 and available at the following URL

    http://www.ti.com/lit/ug/spmu166/spmu166.pdf

  • o Stellaris LM3S9B92 Microcontroller Data Sheet - This document contains hardware information about the LM3S9B92 device itself and its specifications. In this document

    you can also find all registers, modules and peripherals information.

    http://www.ti.com/lit/ds/symlink/lm3s9b92.pdf

    o CCSv5 Getting Started Guide

    http://processors.wiki.ti.com/index.php/CCSv5_Getting_Started_Guide

    o Stellaris Peripheral Driver Library Users Guide This document describes set a set of drivers for accessing the peripherals found on the Stellaris family of ARM Cortex M

    based microcontrollers.

    http://www.ti.com/lit/ug/spmu019m/spmu019m.pdf