90 likes | 245 Vues
Warm-up Lab. Lab 0 – Warm-up Lab. Acquire a Texas Instruments MSP430 LaunchPad Development Tool. Setup a CS user account. Install (if necessary) and "run" blink.txt on the Digital State Machine Simulator. Install (if necessary) and execute TI's Code Composer Studio (CCSv5.2).
E N D
Warm-up Lab Lab 0 – Warm-up Lab • Acquire a Texas Instruments MSP430 LaunchPad Development Tool. • Setup a CS user account. • Install (if necessary) and "run" blink.txt on the Digital State Machine Simulator. • Install (if necessary) and execute TI's Code Composer Studio (CCSv5.2). • Create a new assembly project. Load, assemble, and execute blinky.asm on your LaunchPaddevelopment tool. • Modify blinky.asm to double the toggle speed of the LED. • Use Code Composer to create a new C language project. Load, compile and execute blinky.c on your LaunchPaddevelopment tool as well. • Modify blinky.c to double the toggle speed of the LED. Lab 0 - Warm-up Lab
Warm-up Lab Lab 0 – Warm-up Lab No lab source material should ever be emailed to another student! Please avoid even the appearance of cheating by looking on another's monitor. • Read again the Academic Honesty declaration. Students are encouraged work together in as far as discussing, clarifying, and helping each other understand material. Lab 0 - Warm-up Lab
Warm-up Lab Lab 0 – Warm-up Lab • Acquire a Texas Instruments MSP430 LaunchPad Development Tool directly from Texas Instruments (or BYU Book Exchange, Amazon, Digikey,…). Lab 0 - Warm-up Lab
Warm-up Lab Lab 0 – Warm-up Lab • Setup a CS user account. • If you are using your own computer, you can still set up your account. • If you are using a computer science department computer, then you should already have an account setup for you. (If you are setting up an account for the first time you may need to use your RouteY ID as your username and your student number as your password.) • Note: you may be required to change your password at this time. Lab 0 - Warm-up Lab
Warm-up Lab Lab 0 – Warm-up Lab • Install (if necessary) and "run" blink.txt on the Digital State Machine Simulator. Toggles on and off Load Blinky.txt Lab 0 - Warm-up Lab
Warm-up Lab Lab 0 – Warm-up Lab • Install (if necessary) and "clock" control.txt on the MSP430 micro-architecture simulator. Lab 0 - Warm-up Lab
Warm-up Lab Lab 0 – Warm-up Lab • Install (if necessary) and execute TI's Code Composer Studio CCSv5.xx. Lab 0 - Warm-up Lab
Warm-up Lab Lab 0 – Warm-up Lab • Create a new assembly-only project. Load, assemble, and execute blinky.asm on your LaunchPaddevelopment tool. Modify blinky.asm to double the toggle speed of the LED. ;******************************************************************************* ; CS 124 Lab 1 - blinky.asm: Software Toggle P1.0 ; ; Description: Toggle P1.0 by xor'ing P1.0 inside of a software loop. ; ;******************************************************************************* .cdecls C,LIST, "msp430.h" ; MSP430 ;------------------------------------------------------------------------------ .text ; beginning of executable code RESET: mov.w #0x0280,SP ; init stack pointer mov.w #WDTPW+WDTHOLD,&WDTCTL ; stop WDT bis.b #0x01,&P1DIR ; set P1.0 as output mainloop: xor.b #0x01,&P1OUT ; toggle P1.0 mov.w #0,r15 ; use R15 as delay counter delayloop: sub.w #1,r15 ; delay over? jnzdelayloop ; n jmpmainloop ; y, toggle led ;------------------------------------------------------------------------------ ; Interrupt Vectors .sect ".reset" ; MSP430 RESET Vector .short RESET ; start address .end Lab 0 - Warm-up Lab
Warm-up Lab Lab 0 – Warm-up Lab • Use Code Composer to create a new C language project. Load, compile and execute blinky.c on your LaunchPaddevelopment tool as well. Modify blinky.c to double the toggle speed of the LED. //****************************************************************************** // CS 124 Lab 1 - blinky.c: Software Toggle P1.0 // // Description; Toggle P1.0 by xor'ing P1.0 inside of a software loop. // //****************************************************************************** #include "msp430.h" volatile unsigned inti; // volatile to prevent optimization void main(void) { WDTCTL = WDTPW + WDTHOLD; // Stop watchdog timer P1DIR |= 0x01; // Set P1.0 to output direction for (;;) { P1OUT ^= 0x01; // Toggle P1.0 using exclusive-OR i = 0; // Delay while (--i); } } Lab 0 - Warm-up Lab