Pages

Introduction to CrossStudio MSP430 IDE

Summary: A quickstart tutorial to the CrossStudio MSP430 IDE. Learn how to create a project, edit files, build solutions, and use the debugger.

Figure 1
CrossStudio MSP430 IDE
 CrossStudio MSP430 IDE  (screenshot.jpg)

Motivations

To develop applications to run on the MSP430 chip, we use the CrossWorks MSP430 IDE (integrated development environment). Not only does this application provide a powerful code editor, but it also allows a simple one-click deployment of the source code onto the MSP chip using USB as well as hardware debugging capabilities that allow you to trace through actual stack calls. This module is intended to get your started using CrossWorks quickly so that you may begin building your own MSP430 applications!

Create a Project

The very first thing you must do before you can start downloading any code onto the MSP, is to create a project in CrossStudio that will contain all of the relevant files for your application. Select File->New->New Project and the New Project dialog will appear. By default, the Standard Projects project type will be selected in the left window pane and you will see templates such as Project Wizard, Executable, Library, etc. Select the Project Wizard template within the Standard Projects project type. Enter in a name in the text field and make sure the location field is set to the correct directory for this project.
Figure 2: In the Standard Projects project type folder, select the Project Wizard template to create the workspace for your application.
Project Creation Wizard
 Project Creation Wizard (wizard.jpg)
If you have an existing solution loaded, then you can put the project into that solution or create a new solution. Don't worry if you do not know what a solution is, as it will be covered later in this tutorial. Click OK to create the project.
The project wizard will now guide you through creating your project. You will see a dialog box in which you need to customize the project based on the processor and project type.
Figure 3: Make sure you choose the right processor for your application! Here, I've selected the MSP430F169 since that is the chip I plan to use.
Adding Your Project
 Adding Your Project  (addproj169.jpg)
Click next and finish creating the project. The project explorer will now show the solution and the project you have just created. You'll notice that the project name is highlighted -- this is now the active project and subsequent build and debug operations will use this project. If you have more than one project then you can set the active project using the combo box on the build toolbar or the context menu of the project explorer.

Adding Files to the Project

If your project consists of more than one file, you will need to add it to the current project. To create a new file, go to Project->Add New File... If the file already exists, then choose Project->Add Existing File...

Building the Solution

The CrossStudio compiler allows you to have multiple projects in different configurations all residing in a given solution. Usually, the projects differentiate themselves as a debug build or as a release build. Debug builds will have different compiler options. Configurations can also be used to produce variants of software. For example, a library could be built for several different hardware variants. Note that configurationsn inherit properties from other configurations, enabling a single point of change for definitions that are common to configurations. A particular proplerty can be overriden in a particular configuration to enable configuration specific settings.
Upon creation of a solution, the Debug and Release configurations are generated automatically.

Setting Heap Size

The next important step that you must take is to make sure that there is heap available for the project to use. By default, there is no heap allocated. If your program will be mallocing and freeing memory dynamically, then you will need to change the heap size to a more appropriate value. To do this, choose menu item Project->Properties... You will then see a dialog box with various project options. In the left pane, click on your solution and then the linker tab on the right pane. There will be a Heap Size category that you can click on to change. The MSP430 has up to 2000 bytes of RAM that can be allocated for the heap.
Figure 4: By default, the heap size is set to zero. Here, I have increased it to 600 bytes.
Changing the Heap Size
 Changing the Heap Size (solutionheap.jpg)
The heap size is an option that is set for a given solution and thus applies to all projects that are contained within a solution. Keep this in mind if your solution contains multiple projects.

Connect to the Target

Before any of the code can be executed, you need to first connect to a target. Make sure the board is connected via USB to the computer.. Then, go to Target->Connect MSP430 USB CrossConnect. CrossStudio should be able to connect rather quickly to the MSP. If the application hangs, then check that the USB connection is secure, that the programming cables are plugged in correctly, and that power is being supplied to the device. If problems continue, try resetting the device, unplugging everything for awhile, and starting over again.

Run Your Program!

This is the part you've been waiting for: actually testing your program! Use the Debug -> Start Debugging menu item to load the currently active project and set your program running. You can also set any breakpoints beforehand; by default, there are no breakpoints set by the debugger.
You can pause the debugger when the target is running if you would like to look at the value of certain variables. Select Debug -> Break and open a watch window to examine the value of certain variables. It is suggested that you copy the variables you are interested in to temporary global variables. Because local variables go out of scope, it is uncertain if their correct value is maintained when the debugger is paused.
Debugging can be stopped using Debug -> Stop. At this point, the watch window will not display your variable values. At this point, I would suggest that you make any modifications to your program as necessary and restart the debugger from the beginning. It is possible to resume debugging by using Debug -> Go, but it is not recommended.

Good luck!

You're all set to start using the CrossStudio compiler to write embedded microcontroller code.

0 comments:

Post a Comment

Share your knowledge

Related Posts Plugin for WordPress, Blogger...

Popular Projects

program for Dual DAC 8051 Microcontroller Based DC Motor Control A Microcontroller Based Turbidity Meter A m -Controller Based Thermostat ASCII to BCD conversion in 8051 AT90LS8515 Digital Message Machine Audio Frequency Response Analyzer Audio Homing Robot Automated Juice Mixer Automated Pet Feeder Autonomous Car Autonomous Parallel Parking RC Car Autonomous Search Robot Autonomous Tank Autonomous Vehicle Contrast Following Rover Autonomous navigating robot BCD number to ASCII in 8051 Balance Bot Blind Bot Blood Pressure Monitor Bloodshed Dev-C++ 5 Compiler/IDE Breath Alcohol Tester Converters on TI MSP430 CrossStudio MSP430 IDE Design of a Real-Time Digital Guitar Tuner Digital Oscilloscope Digital Stethoscope Digital clock project using PIC16C54A microcontroller Digital thermometer ECG monitoring system GPS Data Logger with Wireless Trigger Handwriting Recognition Systm Home Security System Home energy managment IAR Embedded Workbench IDE INFRARED TRACKING SYSTEM IntelliBOT Laser Communications System Line following van MSP-EXP430FG4618 Development Tool and the eZ430 kits MSP430FG4618 device implement a Buzzer tone generator MSP430FG4618 device implement a Real Time Clock MSP430FG4618 device implement a voltage ramp generator MSP430FG4618 device present a message on the LCD Basic Microcontroller(8051) Lab Mivo- RFID based mobile payment system Multi-Zone Fire Alarm System PC based temperature control PIC 16f877 RPM Meter PIC16C54 dual dice electronic project circuit PIC16F84A digital thermometer microcontroller project PIC16F886 horn driver PWM motor contoller with MSP430 Program Block data transfer in 8051 Program to add two BCD numbers in 8051 Program to check whether a 4th bit of a byte is 1 Program to convert ASCII to hex in 8051 Program to count from 0-9 in 8051 Program to count number of 1's in a given data byte in 8051 Program to divide an 8 bit no by another 8 bit number in 8051 Program to find largest of n numbers in 8051 Program to find the LCM of two numbers in 8051 Program to find the square of an 8 bit number in 8051 Program to generate 50msec delay in 8051 Program to implement BCD counter to count from 0-99 in 8051 Program to implement BCD counter to count from 99-0 in 8051 Program to interchange two blocks of data in 8051 Program to multiply 16 bit number by 8 bit number in 8051 Program to search an element in an array in 8051 Program to sort an array of 10 elements in 8051 Programming the ez430 Proximity Security System RAMP wave in 8051 RC Car Controller RObo Dog Radio-controlled Truck Retina color tracker Robotic Arm Controller with GUI Robotic Car Traction Control Safety-sensor vehicle Security Entrance System Self-Powered Solar Data Logger Snake Arm Ultrasonic Positioning Control System Store FFh if 1 Super Train Controller TI MSP430 Microcontrollers Timers on the MSP430 TouchPad Drawing Board Ultra-Sonic Parking Assistant Ultrasonic Parking Controller Ultrasonic Range finder Voice Activated Alarm Clock Voice Recognition Robotic Car Voting Machine Weather Station Web-Monitored Thermostat Wireless Drawing Device Wireless Telemetry Wireless message Communicator Write a C program to display the code of the key pressed in 8051 Zigbee Wireless Relay Control and Power Monitoring System add two multibyte numbers in 8051 convert a decimal number to hex number in 8051 convert an 8bit Hex number to decimal number in 8051 convert hex number to ASCII number in 8051 eZ430-F2013 Development Tool use SD16_A ADC eZ430-RF2500 Development Tool use ADC10 else store 00 in the same location in 8051 find the GCF of two numbers in 8051 find the average of 10 numbers in 8051 generate Fibonacci series in 8051 metal detector project microcontroller using IAR Embedded Workbench program for Elevator Interface in 8051 program for Stepper motor interface in 8051 spectrum analyser square wave in 8051 triangle wave in 8051 voice recognition security system

Sites U missed

Hint

Open Pictures in new page by right click on it, if it is not shown full image.