Você está na página 1de 2

21/4/2014 Lab 1 - Introduction

http://www.ece.utep.edu/courses/web3376/Lab_1_-_Introduction.html 1/2
EE3376 Notes MSP430 Labs Legends Links
Lab 1 - Introduction to Code Composer Studio and MSP430
This Lab will focus on introducing the Code Composer Studio Integrated Development
Environment. Code Composer Studio is an integrated development environment which
includes a compiler, assembler, programming and debugging tools. The debugging tool
allows you to pin point errors in your assembly language or C code. For instance, you
can view the state of the chip (contents of registers and memory locations) as you
single-step through the program. During this lab, we will also start getting a feel for the
architecture, registers and memory model of the MPS430.
TutoriaI and Background
You will not have to write a program in this first lab - but rather prove that you can
assemble and debug a simple assemble program. The purpose of this lab is to perform
and demonstrate the steps of this Code Composer tutoriaI for the TA.
The tutorial program was developed to explore the debugging capabilities of the CCS
and to illustrate concepts about the MSP430 architecture. Not very interesting as a
program. Run this program for something slightly more entertaining. The rest of the
labs will become increasingly more interesting - so bear with us.
;*************************************************************
*****************
; MSP430G2xx3 - Software Toggle P1.0
;
; Description: Toggle P1.0 by xor'ing P1.0
; ACLK = n/a, MCLK = SMCLK = default DCO ~800kHz
;
; MSP430G2xx3
; -----------------
; /|\| XIN|-
; | | |
; --|RST XOUT|-
; | |
; | P1.0|-->LED
;
; D. Dang
; Texas Instruments Inc.
; December 2010
; Built with Code Composer Essentials Version: 4.2.0
;*************************************************************
*****************
.cdecls C,LIST, "msp430g2553.h"
;-------------------------------------------------------------
; Progam Start
;-------------------------------------------------------------
-
RESET #0280h,SP ; stack
EE3376 Lab 1
21/4/2014 Lab 1 - Introduction
http://www.ece.utep.edu/courses/web3376/Lab_1_-_Introduction.html 2/2
StopWDT mov.w #WDTPW+WDTHOLD,&WDTCTL ; Stop WDT
SetupP1 bis.b #001h,&P1DIR ; P1.0 output
;
Mainloop xor.b #001h,&P1OUT ; Toggle P1.0
Wait mov.w #050000,R15 ; Delay to R15
L1 dec.w R15 ; Decrement R15
jnz L1 ; Delay over?
jmp Mainloop ; Again
;
;-------------------------------------------------------------
-
; Interrupt Vectors
;-------------------------------------------------------------
-
.sect ".reset" ; MSP430 RESET Vector
.short RESET ;
.end
Lab Specification
Assemble and debug the program described in the Code Composer tutorial.
TA Demonstration
Show the TA your functional board and demonstrate basic debugging steps. 20% credit
for a functional board and 80% credit for correct answers about the assembly and
debugging processes. You will be expected to explain every step for full credit.

Você também pode gostar