Welcome to Lab! Feel free to get started until we start talking! The lab document is located on the course website:

Similar documents
Welcome to Lab! You do not need to keep the same partner from last lab. We will come around checking your prelabs after we introduce the lab

Lab 1: Space Invaders. The Introduction

Lab 1: Simon. The Introduction

Welcome to Lab! Feel free to get started until we start talking! The lab document is located on the course website:

Lab 1 Implementing a Simon Says Game

Lab 1 Implementing a Simon Says Game

ECE2049 E17 Lecture 4 MSP430 Architecture & Intro to Digital I/O

By the end of Class. Outline. Homework 5. C8051F020 Block Diagram (pg 18) Pseudo-code for Lab 1-2 due as part of prelab

Lab 0 Introduction to the MSP430F5529 Launchpad-based Lab Board and Code Composer Studio

These are notes for the third lecture; if statements and loops.

ECE2049 Homework #2 The MSP430 Architecture & Basic Digital IO (DUE Friday 9/8/17 at 4 pm in class)

Programming assignment A

A practicalintroduction to embedded programming. Brian Plancher 10/17/2018

ECE2049 Embedded Computing in Engineering Design. Lab #0 Introduction to the MSP430F5529 Launchpad-based Lab Board and Code Composer Studio

Lab 4: Imperative & Debugging 12:00 PM, Feb 14, 2018

GDB Tutorial. A Walkthrough with Examples. CMSC Spring Last modified March 22, GDB Tutorial

Illuminating the Big Picture

CS354 gdb Tutorial Written by Chris Feilbach

ECE2049: Embedded Systems in Engineering Design Lab Exercise #3 C Term Making a Time and Temperature Display

Sixth lecture; classes, objects, reference operator.

For Volunteers An Elvanto Guide

Lab 4: Interrupts and Realtime

ENGR 40M Project 3c: Switch debouncing

Smoother Graphics Taking Control of Painting the Screen

CSCI-1200 Data Structures Spring 2018 Lecture 14 Associative Containers (Maps), Part 1 (and Problem Solving Too)

ECGR 4101/5101, Fall 2016: Lab 1 First Embedded Systems Project Learning Objectives:

CSCI 1100L: Topics in Computing Lab Lab 11: Programming with Scratch

6L00IA - Introduction to Synergy Software Package Short Version (SSP v1.2.0) Renesas Synergy Family - S7 Series

Laboratory Assignment #4 Debugging in Eclipse CDT 1

Marten van Dijk, Syed Kamran Haider

Week 5, continued. This is CS50. Harvard University. Fall Cheng Gong

Getting Up and Running

Lecture 1: Overview

Outline for Today. Lab Equipment & Procedures. Teaching Assistants. Announcements

EECS150 Lab Lecture 5 Introduction to the Project

Project Compiler. CS031 TA Help Session November 28, 2011

Welcome to the world of .

InfoSphere goes Android Flappy Bird

Debugging in AVR32 Studio

HOUR 4 Understanding Events

Code::Blocks Student Manual

CSC D84 Assignment 2 Game Trees and Mini-Max

1. You re boring your audience

Blocky: A Game of Falling Blocks

COMP 117: Internet-scale Distributed Systems Lessons from the World Wide Web

CSCI341. Lecture 22, MIPS Programming: Directives, Linkers, Loaders, Memory

Introduction to Embedded Systems. Lab Logistics

CS12020 for CGVG. Practical 2. Jim Finnis

Contents. Page 3: Uploading Contacts. Page 5: Sending a Message. Page 7: Analysing your Message. Page 9: Unsubscribe a Contact. Page 11: Add a Forward

Notebook Assignments

Lab 7 Unit testing and debugging

Lecture 3: Recursion; Structural Induction

SECTION 2: HW3 Setup.

Hands-On with STM32 MCU Francesco Conti

Student Success Guide

Lesson 2. Introducing Apps. In this lesson, you ll unlock the true power of your computer by learning to use apps!

Using Code Composer Studio IDE with MSP432

Basic Input and Output

Emprog. Quick Start Guide. Emprog ThunderBench MSP430 FAQ. Version 1.2. Nov Page 1

Magic 8 Ball. Student's name & ID (1): Partner's name & ID (2): Your Section number & TA's name

UNIVERSITY OF CALIFORNIA, SANTA CRUZ BOARD OF STUDIES IN COMPUTER ENGINEERING CMPE13/L: INTRODUCTION TO PROGRAMMING IN C SPRING 2013

Basic Input and Output

CS 103 Lab The Files are *In* the Computer

TWO PLAYER REACTION GAME

CS103 Handout 29 Winter 2018 February 9, 2018 Inductive Proofwriting Checklist

EiffelStudio the Eiffel IDE

Reviewing gcc, make, gdb, and Linux Editors 1

Assignment 4: Flight Simulator

Code::Blocks Student Manual

Problem Score 1 / 27 2 / 19 3 / 16 4 / 14 code check off 5 / 22 /2 Total /100

CIS*1500 Introduction to Programming

Using Virtual EEPROM and Flash API for Renesas MCUs RX600 Series

Lecture 14: more class, C++ streams

Intro to Flex Debugging and Profiling

CS 103 Lab - Party Like A Char Star

University of Hull Department of Computer Science C4DI Interfacing with Arduinos

We made it! Java: Assembly language: OS: Machine code: Computer system:

Installing and getting started with Xcode for Mac OS.

BASICS OF THE RENESAS SYNERGY TM

Reading: Davies , 8.3-4, , MSP430x55xx User's Guide Ch. 5,17

16 Sharing Main Memory Segmentation and Paging

Familiarity with data types, data structures, as well as standard program design, development, and debugging techniques.

Ch. 11: References & the Copy-Constructor. - continued -

Device: PLT This document Version: 3.0. For hardware Version: 4. For firmware Version: Date: April 2014

Final Project: LC-3 Simulator

hw6, BFS, debugging CSE 331 Section 5 10/25/12 Slides by Kellen Donohue

15 Sharing Main Memory Segmentation and Paging

HOW TO TEXT OUT THE VOTE (TOTV)

Introduction to Programming in C Department of Computer Science and Engineering. Lecture No. #29 Arrays in C

Lecture 4: Memory Management & The Programming Interface

Using Panopto in Canvas

Remaining Enhanced Labs

HERO LAB ONLINE FOR STARFINDER

2 How to Create a Killer Onboarding Process

Device: PLT This document Version: 1. For hardware Version: 1. For firmware Version: Date: 9 May 2014

Best Practices for. Membership Renewals

Fishnet Assignment 1: Distance Vector Routing Due: May 13, 2002.

Module 5: Triggers and Hotspots

Digital Design and Computer Architecture

To Update and Maintain Your Team Website

Transcription:

Welcome to Lab! Feel free to get started until we start talking! The lab document is located on the course website: https://users.wpi.edu/~sjarvis/ece2049_smj/ We will come around checking your pre-labs after we introduce the lab Let us know if you have any questions!

Lab 2: MSP430 Hero! Week I: A New Lab The Introduction

MSP430 Hero! Basic requirements: Play a song on the buzzer and flash the 4 LEDs accordingly Press the buttons at the right times to score points This is a two week lab. You will have this lab session and next week s to work! Feel free to add more features than are in the lab document we may award extra credit! Show the song on the display (like actual Guitar Hero) Multiple songs Other ideas?

The Important Parts Functions for reading the Lab board buttons and Launchpad User LEDs See HW#2 and Lecture 8 A data structure to store the song Like with Space Invaders, you can decide how to handle this Must store a pitch and a duration for each note A timer which measures note duration We ll talk about this in class over the next few lectures

How to start: Week 1 Like last week, start by making copy of the template project (see instructions in the lab 1 intro) 1.We recommend you start with the small stuff, like creating the functions for the LEDs and buttons It s easier to build and debug these functions now instead of when you re building the main program! Build and test these functions today You can do this by writing a simple main() (no welcome screen, countdown, etc.) that just uses your functions

Example test for LEDs and Buttons Here s an example of a way to test your 4 buttons and Launchpad User LED functions These are the 2 LEDs on the Launchpad Write a simple main() that does the following: When button S1 is pressed, turn on user LED1 When button S2 is pressed, turn on user LED2 When button S3 is pressed, turn on BOTH When button S4 is pressed, turn on BUZZER or something Otherwise, the LEDs (and Buzzer) should be off

How to start (cont d) 1.After you have your LED and button functions working, try to play some notes using the buzzer. 2.Since we haven t covered interrupts yet, try to create a song using your data structure and play it in main() with software delays between the notes

Remember your training Looking back on your last lab, can you do anything differently to make your life easier? Simplifying your control flow? Not using so many globals? Using the debugger? This kitty has developed strong systems programming skills. Remember that we are here to help you become better embedded programmers. Feel free to ask us conceptual questions and we will be happy to teach you! (Please do this before the last day, though!)

Good luck and have fun! The rest of these slides contain important info about specific parts of the lab Skim them over at the beginning of lab Look at them when you reach each part or if you have trouble Be sure to look at the Frequently Asked Questions, too! These include helpful tips on C programming and using CCS efficiently! Thank you for listening!

Important Stuff: LEDs Are LEDs inputs or outputs? The MSP430F5529 Launchpad User's Guide (class website/useful Links) shows the I/O pin assignments for the user LEDs and buttons If you are curious about how configuserled() from the pre-lab should work, ask us!

Important stuff: Buttons Important questions: Are buttons inputs or outputs? Do you need pull up/pull down resistors? Hint: Yes. Which one? Figure it out using the Launchpad schematic & Lecture 8! Which is at the end of MSP430F5529 Launchpad User Guide Once you can answer these questions, to configure the registers see Table 12-1 on page 408 of the MSP430 User s Guide

Important Stuff: The Buzzer You can modify BuzzerOn() in peripherals.c to take an argument that represents the frequency of the note to play Don t forget to also modify the function prototype in peripherals.h! How can you modify it to play a specific frequency? Take a look at the comments in BuzzerOn() You ll need a bit of math try it on paper first!

Important Stuff: Documentation Everything you need is on the Useful Links page of the course website MSP430 User Guide Detailed Info on Using Chip MSP430 Datasheet Technical Details & Pinout of chip Launchpad User Guide Launchpad details & schematics Lab board Schematics The tricky part is figuring out which one you need

Lab 2: MSP430 Hero! Week II: The Lab Strikes Back An Introduction

How to start Work on the LED, button, and buzzer functions from Week 1 if you haven t already Now that you have seen timers in lecture, focus on configuring your timer today Hint: Start timer once at the beginning of a game then measure duration using global timer count After that, work on the logic to play the song by checking the global time count and keep score Make sure your timer interrupts work before you leave today! Ask us if you need help!

Starting with interrupts Look at the stopwatch example for help with syntax Don t just copy it Make sure you globally enable interrupts! See the lecture notes for instructions. How do you know if your interrupts work? Using the debugger, of course! 1. Put a breakpoint inside your interrupt routine and hit Run 2. If you hit the breakpoint, you know that your timer successfully triggered an interrupt!

A note on interrupts As we said in lecture, interrupt routines (ISRs) should be short. Why? For this reason, do NOT do the following in an ISR: Update the display Wait for a button press Wait in a loop for any reason Send a Snapchat If you can t think of a way to design your lab without keeping your ISR short, ask us for help! This kitty will be sad if your ISRs are too long. If you use an ISR improperly, you will lose points!

Playing the game The key point here is figuring out how to use the timer interrupts to control the song This allows you to scan for button presses while the song is playing How does the timer let you play notes for precise durations? After that, how can you determine if the player pressed the correct button?

Good luck and have fun! Feel free to ask us if you have questions we re here to help! Be sure to look at the FAQs When you are done, make sure you submit your code online like for lab 1 See the Lab 1 intro for instructions Thank you for listening!

Frequently Asked Questions (1/?) What's with all the cat pictures? It was really funny once upon a time, trust us! My buttons don t work! Did you configure the buttons to use pull-up resistors? Look at table 12-1 on page 408 of the MSP430 User s Guide for the register configuration! My interrupts aren t firing! Did you globally enable interrupts? See the lecture notes for help! Check your timer config. Make sure you are using the same components and syntax as the stopwatch example.

FAQ: Initializing arrays and structs How do I set the value of (or initialize ) an array or struct? Here are some examples:

Frequently Asked Questions My program isn t working, and when I pause it says Cannot disassemble address 0xfffe (or similar) This is because your program has jumped to a place in memory that does not contain actual code. This is equivalent to a segfault meaning you are accessing memory you shouldn t. On an MSP430, there s no OS to clean up after a segfault. Instead, your program will experience Undefined Behavior To fix this, check the following: Did you configure the display at the start of your program? Are you accessing beyond the bounds of an array? Are you doing any Bad Things with pointers? If you are having trouble, ask the us for help!

Frequently Asked Questions Help! I lost a window in CCS! Reset all of your windows to defaults, go to : View > Reset Perspective I have the warning Function declared implicitly Make sure you aren t missing any #include statements (rand() is in stdlib.h) If the warning is for one of your own functions, you are missing a function prototype. Google function prototypes for help!

Frequently Asked Questions I have a vague error saying Errors exist in project or Errors encountered during linking Look in the Console for the full output during compilation. If you scroll up a few lines, you may see some more information about the error. See the next slide for more info

Frequently Asked Questions Why does this variable have a value of.? This is because CCS is trying to show it as an ASCII character, but it has a value that isn t a character. You can change the format like this: Right click on the variable here Pick a format to display it here

Frequently Asked Questions Using the graphics library See lab 0 for examples especially the comments You can draw lines and shapes See the Graphics Library User Guide on the course website for examples