Code Composer Studio MSP Project Setup
Complete the installation of the Code Composer Studio software using the Code Composer Studio setup slides Start Code Composer Studio desktop shortcut start menu install_dir/code Composer Studio x.x.x 2 tj
Select a workspace This is where your CCStudio information is stored I suggest you choose and create a personal folder do not put the workspace in the install directory NO SPACES ALLOWED ANYWHERE IN THE PATH 3 tj
Close the getting started window 4 tj
5 tj
Select file -> new -> CCS Project 6 tj
Select MSP432 Family in the Target window Expand the pulldown to select MSP432P401R 7 tj
Type in a project name (NO SPACES ALLOWED) Select Empty Project in the Project Templates Finish 8 tj
Project explorer now has your project listed The view should default to CCS Edit CCS uses different views to support various development environments CCS views will be used for the MSP432 C/C++ views will be used for console programs The same button e.g debug will do different things in different views 9 tj
In order to debug ISRs we need to enable them in each project Project -> Properties -> Debug-> Program Memory Load Options Uncheck the 3 boxes under Disable Interrupts 10 tj
Create a new C source file Make sure your project is highlighted in the explorer window File -> New -> C Source File 11 tj
Provide a file name You must include the xxxxx.c extension NO spaces It is common to use an underscore _ instead of spaces Select Default C source template in the Template pulldown 12 tj
The new file will be opened with a short comment section included at the top 13 tj
Type the following into the new file Do not try to copy and paste Microsoft adds hidden characters Save /* * blink.c * * Created on: Jun 28, 2017 * Author: Tim */ ////////////////////////////////////////////////// // // Our version of blink.c // ////////////////////////////////////////////////// // Includes #include "msp.h" #include <stdio.h> // Global Variables // Function Prototypes int main(void) { // Local Variables volatile uint32_t i; // 32 bit required due to counter > 65,535 // Board Setup WDT_A->CTL = 0x5A00 0x80; // Stop watchdog timer // Note: Port 1, bit 0 (P1.0) is one of the on board LEDs P1->DIR = 0x01; // Configure P1.0 as output // Greeting code printf("!! Hello EE2920!!\n"); // Blink and Print Code while(1) { // Blink LED P1->OUT ^= 0x01; // Toggle P1.0 // Print to console if(p1->out & 0x01) printf("on\n"); else printf("off\n"); // Delay so we can see blinking for(i=100000; i>0; i--) // Delay ; } // end while return 0; } // end main 14 tj
Select Project -> Build Project This compiles, assembles, and links the program Check the console for errors Due to the while(1): return is not reachable 15 tj
Plug your MSP432 board into your computer via the USB port It may still have the original factory blink program running 16 tj
Select the debug icon The windows will change to CCS Debug mode This downloads the program onto the board and establishes an active communications link between the board and Code Composer 17 tj
CCS Debug the program is paused at the beginning (main) 18 tj
Select run (green arrow) This causes the program to continue 19 tj
Check the on-board LED The on board LED will be blinking Check the console window of CCStudio The console will display our greeting message followed by on off on off 20 tj
Stop the program (red square) The window returns to CCS Edit mode The LED continues to blink The program continues to run on the board The console quits updating The communications link is broken 21 tj
The next time you power up the board the last program you downloaded will be running Unplug the USB Quit Code Composer Plugin the USB the LED will start blinking 22 tj