Code Composer Studio (CCS) is an IDE to develop software for microcontroller's from Texas Instruments like MSP430,MSP432,Tiva/Stellaris etc.CCS is based on Eclipse platform and supports a plug and play architecture in which multiple compilers/debuggers can be used for developing and debugging software.
In this tutorial we will learn to develop software for the MSP430 family of microcontroller's using the Launchpad development board.Here we will use both the TI's proprietary compiler as well as the free and opensourcemspgcc compiler for building code.
Downloading Code Composer Studio
Code Composer Studio can be downloaded from Texas Instruments Website.
CCS is available for Windows,Linux and Mac OSX platforms.
CCS is available as both online and offline install.
Creating a MSP430 Launchpad project in Code Composer Studio(CCS)
After installing code Composer Studio on your computer,Click the desktop icon to launch the IDE.
You can use CCS to develop embedded software using both C and Assembly language.Here we will be dealing primarly with C language.
The IDE would then ask you to select a workspace to store your current settings and preferences,Click OK to continue.Your Sourcecodes will also be stored in this location.
From the Menu bar,
Select Project → New CCS Project...
which will bring up the New CCS Project Dialog.
Use the "Target " drop down menu to select the MSP430 family you will be using.
Since we are using Launchpad development board, select MSP430Gxxx Family. (shown below)
After you have selected the Family,use the adjacent dropdown menu to select the device you will be using.Here MSP430G2553.
After that give a name to your project .Here "My-MSP430-Project".
Selecting a Compiler for your MSP430 Project in Code Composer Studio
Code Composer Studio comes with the option to select multiple compilers for building your MSP430 project .The two commonly used compilers are
- Texas Instruments Properietary Compiler (TI v16.9.7 LTS)
- msp430 gcc (GNU v6.2.1.16)
You can select the compilers using the "Compiler version" drop down menu in the New CCS Project Dialog as shown below.
The default compiler in CCS is Texas Instruments Properietary Compiler (TI v16.9.7 LTS) .The TI compiler is code limited but will be sufficient for developing software for MSP430G2553.
The opensource mspgcc compiler have to be seperately installed .
mspgcc is opensource and have no code limit compared to TI's compiler.
Installing MSP430 GCC on Code Composer Studio
MSP430GCC can be easily installed using Code Composer Studio App Center.
You can easily access the App Center from the "Getting Started"page
or by going to Help →CCS App Center
You can then easily install the required software by clicking on the MSP430 GCC option in the App Center.
Now let us go back to the CCS Project Dialog,
After You have selected the compiler you wish to use (TI's or msp430gcc),Click Finish and you will be greated by the following figure.
Building a MSP430 project in Code Composer Studio
We can now write a small program that would light up the LED's connected to pins P1.0 and P1.6 on the MSP430 launchpad.
You can type the below program into the main.c file inside the CCS IDE.
After you have written the program,you can build the c file by going to Project → Build Project
If there is any issues with your code like a missing semi colon ,the compiler will show the errors under the Problems tab at the bottom.
Another nifty feature of the CCS7 IDE is the Advice window which gives you useful suggestions regarding how to optimize your program for performance or low power consumption.
Downloading code into MSP430 Launchpad using Code Composer Studio
Connect your MSP430 Launchpad development board to your computer and make sure that it is detected by the Computer by going to Device Manager .If the launchpad is detected,it can be seen under Ports in Device Manager as shown below.
You can start the debugging session in the Code Composer studio by pressing F11 or by going into Run → Debug.This starts the debugger, which gains control of the target(here MSP430 Launchpad board), erases the target memory, programs the target memory with the application, and then resets the microcontroller.
After you press the debug button,a ULP Advisor Dialog will pop up.Please press Proceed button to continue.
Code Composer Studio will then build your project,generate the hex file and automatically download it into your development board.
The IDE will then enter into Debug mode as shown below.
![]() |
Debugging MSP430 Launchpad using Code Composer Studio
After you have entered the Debug mode ,you can run your program continously or step, instruction by instruction.
You can now run the program loaded into the microcontroller memory by pressing F8 or Run → Resume.
After you have run the program on the microcontroller ,you can reset it by going to Run → Reset.
There are two types of Resets available on Code Composer Studio
- Soft Reset - This would reset the microcontroller and transfer the control to entry point of main().
- Hard Reset - This would reset the microcontroller and transfer the control to C Environment Entry point.
You can also single step through code execution using the step commands.
You can put breakpoints in code composer studio by going to Run → Toggle Breakpoints.
You can see the breakpoints in the below image as light blue dots on the left hand side.
In the Debug mode ,Code Composer Studio allows you to view the internal registers of the MSP430 varient you are using.
Below image shows the change in Registers after executing the P1DIR |= BIT0 +BIT6; instruction.
You can see the bits that are effected by the instruction highlighted in yellow by the CCS IDE.
To get out of the Debug mode you can go to Run → Terminate or Press CTRL + F2.this would return the user to code editor view.