EasyManuals Logo

Texas Instruments MSP430 Student Guide

Texas Instruments MSP430
398 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #73 background imageLoading...
Page #73 background image
Lab 2 – CCSv5 Projects
MSP430 Workshop - Programming C with CCS 2 - 35
11. Explore source code in hello.c.
Open the file, if it’s not already open.
Double-click on hello.c in the Project Explorer window
We hope most of this code is self-explanatory. Except for one line, it’s all standard C code:
#include <stdio.h>
#include <msp430.h>
/*
* hello.c
*/
int main(void) {
WDTCTL = WDTPW | WDTHOLD; // Stop watchdog timer
printf("Hello World!\n");
return 0;
}
The only MSP430-specific line is the same one we examined in the chapter discussion:
WDTCTL = WDTPW | WDTHOLD; // Stop watchdog timer
As the comment indicates, this turns off the watchdog timer (WDT peripheral). As we’ll learn
in Chapter 4, the WDT peripheral is always turned on (by default) in MSP430 devices. If we
don’t turn it off, it will reset the system – which is not what we usually want during
development (especiall during ‘hello world’).

Table of Contents

Other manuals for Texas Instruments MSP430

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Texas Instruments MSP430 and is the answer not in the manual?

Texas Instruments MSP430 Specifications

General IconGeneral
BrandTexas Instruments
ModelMSP430
CategoryMicrocontrollers
LanguageEnglish

Related product manuals