Chapter 5 Code Composer Studio
Chapter 5 Code Composer Studio
Chapter 5 Code Composer Studio
Programmable Microcontrollers with Applications: MSP430 LaunchPad with CCS and Grace
LAYOUT
Introduction
Setup
Creating a C Project
Creating an Assembly Project
Program Execution
Observing Hardware under CCS
Terminating the Debug Session and Closing the Project
Graphical Peripheral Configuration Tool (Grace)
The Terminal Window
Programmable Microcontrollers with Applications: MSP430 LaunchPad with CCS and Grace
Introduction
Code Composer Studio (CCS) is the environment for TI
based DSPs and microcontrollers.
Programmable Microcontrollers with Applications: MSP430 LaunchPad with CCS and Grace
SETUP
Downloading and installing CCS
Download the most recent version of CCS from the TI web site.
Programmable Microcontrollers with Applications: MSP430 LaunchPad with CCS and Grace
Creating a C Project
Programmable Microcontrollers with Applications: MSP430 LaunchPad with CCS and Grace
Creating a C Project
You can turn off optimization from the options menu.
This will help us in initial coding.
Programmable Microcontrollers with Applications: MSP430 LaunchPad with CCS and Grace
Creating a C Project
A sample C code
#include <msp430.h>
int d = 0;
void main(void)
{
WDTCTL = WDTPW|WDTHOLD;
int a = 1;
float b = -255.25;
char c = 'c';
d = d+1;
while(1);
}
Programmable Microcontrollers with Applications: MSP430 LaunchPad with CCS and Grace
Creating an Assembly Project
A sample assembly code
jmp $
.cdecls C,LIST,"msp430.h"
;------------------------
.text ;Stack Pointer definition
.retain ;------------------------
.retainrefs .global __STACK_END
.sect .stack
RESET
mov.w #WDTPW|WDTHOLD,WDTCTL ;-------------------
mov.w #__STACK_END,SP ;Interrupt Vectors
;-------------------
mov.b #11h,R4 .sect RESET_VECTOR
mov.w #00AAh,R5 .short RESET
and.w R4,R5 .end
Programmable Microcontrollers with Applications: MSP430 LaunchPad with CCS and Grace
Program Execution
Debug your program before execution.
Programmable Microcontrollers with Applications: MSP430 LaunchPad with CCS and Grace
Program Execution
Programmable Microcontrollers with Applications: MSP430 LaunchPad with CCS and Grace
Observing Hardware under CCS
Memory entries of the MSP430 can also be observed from the memory
browser window.
Programmable Microcontrollers with Applications: MSP430 LaunchPad with CCS and Grace
Observing Hardware under CCS
Memory entries of the MSP430 can also be observed from the memory
browser window.
Programmable Microcontrollers with Applications: MSP430 LaunchPad with CCS and Grace
Grace
Programmable Microcontrollers with Applications: MSP430 LaunchPad with CCS and Grace
Grace
The user can add his or her code under Grace .
/*
* ======== Standard MSP430 includes ========
*/
#include <msp430.h>
/*
* ======== Grace related includes ========
*/
#include <ti/mcu/msp430/Grace.h>
/*
* ======== main ========
*/
int main(void)
{
Grace_init();
// Activate Grace-generated configuration
// >>>>> Fill-in user code here <<<<<
return (0);
}
Programmable Microcontrollers with Applications: MSP430 LaunchPad with CCS and Grace
The Terminal Window
Programmable Microcontrollers with Applications: MSP430 LaunchPad with CCS and Grace