Lab 1 Course Guideline and Review



Similar documents
MSP-EXP430G2 LaunchPad Workshop

SKP16C62P Tutorial 1 Software Development Process using HEW. Renesas Technology America Inc.

DRV8312-C2-KIT How to Run Guide

USBSPYDER08 Discovery Kit for Freescale MC9RS08KA, MC9S08QD and MC9S08QG Microcontrollers User s Manual

Android Application Development and Bluetooth Technology

AVR Butterfly Training. Atmel Norway, AVR Applications Group

CodeWarrior Development Studio for Freescale S12(X) Microcontrollers Quick Start

CB-OLP425 DEVELOPMENT KIT GETTING STARTED

Using DAVE with MDK Version 5

An Introduction to MPLAB Integrated Development Environment

Chapter 13. PIC Family Microcontroller

STEPPER MOTOR SPEED AND POSITION CONTROL

8051 MICROCONTROLLER COURSE

Start A New Project with Keil Microcontroller Development Kit Version 5 and Freescale FRDM-KL25Z

Software development and debugging for NXP ARM7 MCUs

DsPIC HOW-TO GUIDE Creating & Debugging a Project in MPLAB

ENGI E1112 Departmental Project Report: Computer Science/Computer Engineering

Atmel Norway XMEGA Introduction

ET-BASE AVR ATmega64/128

UML - Getting Started EA v4.0

Quick Start Tutorial. Presentation Tutorial for a Quick Start Handson Session: Creating a simple Project using PWM and Count Apps.

Angel Learning Management System Introductory Tutorial for Students

Section 1 Introduction to the AT91SAMD20 and the Development Environment

3. Programming the STM32F4-Discovery

Microcontroller Based Low Cost Portable PC Mouse and Keyboard Tester

2.0 Command and Data Handling Subsystem

Soft processors for microcontroller programming education

Programming PIC Microcontrollers in PicBasic Pro Lesson 1 Cornerstone Electronics Technology and Robotics II

Am186ER/Am188ER AMD Continues 16-bit Innovation

TI ARM Lab 7 Accelerometers

Microtronics technologies Mobile:

USER GUIDE EDBG. Description

E-Blocks Easy RFID Bundle

EMBEDDED C USING CODEWARRIOR Getting Started Manual

USER GUIDE Version 2.0

Freescale Semiconductor, I

UM1727 User manual. Getting started with STM32 Nucleo board software development tools. Introduction

AVR033: Getting Started with the CodeVisionAVR C Compiler. 8-bit Microcontrollers. Application Note. Features. 1 Introduction

Controlling a Dot Matrix LED Display with a Microcontroller

MPLAB C18 C Compiler

Lab Experiment 1: The LPC 2148 Education Board

Dear Reader. The latest tutorial will be available from now on from the website of my consulting company Argenox Technologies:

Quick Start Guide. MRB-KW01 Development Platform Radio Utility Application Demo MODULAR REFERENCE BOARD

REMOTE DESKTOP IN WINDOWS XP

Develop a Dallas 1-Wire Master Using the Z8F1680 Series of MCUs

National CR16C Family On-Chip Emulation. Contents. Technical Notes V

Microcontroller Code Example Explanation and Words of Wisdom For Senior Design

- 35mA Standby, mA Speaking pre-defined phrases with up to 1925 total characters.

CodeWarrior Development Studio for Microcontrollers Version 10.x Profiling and Analysis Tools Users Guide

Fondamenti su strumenti di sviluppo per microcontrollori PIC

UM0834 User manual. Developing and debugging your STM8S-DISCOVERY application code. Introduction. Reference documents

C8051F020 Utilization in an Embedded Digital Design Project Course. Daren R. Wilcox Southern Polytechnic State University Marietta, Georgia

Experiment 2 Introduction to TI C2000 Microcontroller, Code Composer Studio (CCS) and Matlab Graphic User Interface (GUI)

How to design and implement firmware for embedded systems

MX PIC24F Educational Module User Manual

Microsoft Visual Basic Scripting Edition and Microsoft Windows Script Host Essentials

Quick Start Tutorial. Using the TASKING* Software Development Tools with the Intel 8x930 Family Evaluation Board

Lab 2-2: Exploring Threads

Building an Embedded Processor System on a Xilinx Zync FPGA (Profiling): A Tutorial

TWR-KV31F120M Sample Code Guide for IAR Board configuration, software, and development tools Rev.0

How To Program A Microcontroller Board (Eb064) With A Psp Microcontroller (B064-74) With An Ios 2.5V (Power) And A Ppt (Power Control) (Power Supply) (

Embedded Display Module EDM6070

APPLICATION NOTE. AT07175: SAM-BA Bootloader for SAM D21. Atmel SAM D21. Introduction. Features

Install MS SQL Server 2012 Express Edition

M68EVB908QL4 Development Board for Motorola MC68HC908QL4

Getting Started with PIC24F/PIC24H Programming and Interfacing in C

Z8 Encore! XP F64xx Series Flash Microcontrollers. In-Circuit Emulator. User Manual UM

32-bit AVR UC3 Microcontrollers. 32-bit AtmelAVR Application Note. AVR32769: How to Compile the standalone AVR32 Software Framework in AVR32 Studio V2

Glitch Free Frequency Shifting Simplifies Timing Design in Consumer Applications

A 5 Degree Feedback Control Robotic Arm (Haptic Arm)

ETEC Digital Controls PIC Lab 10 Pulse Width Modulation

Application Note: AN00141 xcore-xa - Application Development

Design, implementation and characterization of a radio link in ISM band at 2.4Ghz

C Programming. for Embedded Microcontrollers. Warwick A. Smith. Postbus 11. Elektor International Media BV. 6114ZG Susteren The Netherlands

8-Bit Microcontroller with Flash. Application Note. Using a Personal Computer to Program the AT89C51/C52/LV51/LV52/C1051/C2051

Using HiTOP with the HOT16x Hands-On Training Materials

Using Microsoft Visual Studio API Reference

Using the VEX Cortex with ROBOTC

How to use AVR Studio for Assembler Programming

POCKET SCOPE 2. The idea 2. Design criteria 3

How to setup the UCW232C Serial WiFi adapter

XMC1000 / XMC4000 Motor Control Application Kit

Timer A (0 and 1) and PWM EE3376

PHYS 2P32 Project: MIDI for Arduino/ 8 Note Keyboard

PC Base Adapter Daughter Card UART GPIO. Figure 1. ToolStick Development Platform Block Diagram

Programming with the Dev C++ IDE

TURBO PROGRAMMER USB, MMC, SIM DEVELOPMENT KIT

Implementation of Web-Server Using Altera DE2-70 FPGA Development Kit

Von der Hardware zur Software in FPGAs mit Embedded Prozessoren. Alexander Hahn Senior Field Application Engineer Lattice Semiconductor

Secure My-d TM and Mifare TM RFID reader system by using a security access module Erich Englbrecht (info@eonline.de) V0.1draft

Android: Setup Hello, World: Android Edition. due by noon ET on Wed 2/22. Ingredients.

Capacitive Touch Lab. Renesas Capacitive Touch Lab R8C/36T-A Family

Tutorial for MPLAB Starter Kit for PIC18F

Ride7 for ARM. RAISONANCE Tools for the STRx and STM32 families. Overview and Getting Started

Software based Finite State Machine (FSM) with general purpose processors

AVR030: Getting Started with IAR Embedded Workbench for Atmel AVR. 8-bit Microcontrollers. Application Note. Features.

Description of High Accuracy Digital Pressure Gauge Design

STK User Guide

SPY-BATT Battery Tutor Device Installation Manual Rev /04/2016

PICNet 1. PICNet 1 PIC18 Network & SD/MMC Development Board. Features. Applications. Description

Transcription:

Lab 1 Course Guideline and Review Overview Welcome to ECE 3567 Introduction to Microcontroller Lab. In this lab we are going to experimentally explore various useful peripherals of a modern microcontroller using assembly language in a debugging environment. We expect that after this semester you will have a better understanding of what microcontrollers can do. You will polish up on how to program MCUs (Microcontrollers) in assembly language, understand basic design concerns, programming practices and unleash the power of a debugger to help you with programming in various way. We are going to use the TI (Texas Instruments) MSP430G2553 microcontroller located on the TI experimenter s board known as the LaunchPad. For writing and debugging assembly code we are going to use a software IDE (Integrated Design Environment) named Code Composer Studio version 5 (CCSv5). This software is free for download from Texas Instruments Website (http://processors.wiki.ti.com/index.php/download_ccs). We recommend that you to install CCSv5.1.x on your laptops instead of higher versions of CCS to be best compatible with our lab environment. You are going to be working in groups of three. There will be a group lab report for each lab. Quizzes and projects (if any) will be based on individual and not group effort. Please refer to the course syllabus regarding detailed course composition, HW due dates and grading weights/policies etc. We highly recommend the book, MSP430 Microcontroller Basics by JohnH.Davis, as your reading material if you want to learn more.

Microcontroller and Experimenter s Board As you no doubt already known, microcontrollers play an important role literally in every aspect of our daily life. The picture below gives us just a glimpse of this fact. (source: http://www.ti.com/corp/docs/press/backgrounder/dsp.shtml) There is a vast selection of microcontrollers in the market from various manufacturers like Freescale, TexasInstruments, Atmel etc. The question you need to ask is: What microcontroller should you choose for your products/projects? What specifications should you look for to fulfill your design requirements? In order to help you in prototyping a microcontroller before using it in your final design, manufacturers of microcontrollers often carry products called experimenter s boards or explorer kits (or some other similar name). These kits carry various input and output headers, LEDs, buttons, sensing devices,

communication interfaces etc. already prewired on the kit board to the microcontroller you are interested in. In this course we are going to use the Texas Instruments MSP430G2553microcontroller and the TI Launchpad experimenter s board are shown below. this lab. Note that the Launchpad will be provided to you and you do not need to buy any kit for Learning a Microcontroller You can start using a microcontroller without really having an in depth knowledge about it by using prewritten canned software routines written for you by others or you can develop an in depth knowledge of the workings of a microcontroller by programming it yourself from the grounds up. We are aiming at the latter option in this course. To start, first you need to know the basic features of a microcontroller. You can grab the basic information from the products website with minimal reading required. Here s a summary of MSP430G2553 features collected from TI website. (http://www.ti.com/product/msp430g2553) Microncroller: Family: MSP430G2553 MSP430

Memory: 16 kb Flash 512B SRAM Features: 16 bit RISC CPU 2 Ports, 8 I/O each Watchdog Clock: Internal clock frequency up to 16MHz 32 khz Crystal Internal Low Frequency (LF) Oscillator Two 16 bit Timer On chip comparator 10 bit ADC Low power consumption Please note that the table above is just a brief summary of the features. Based on these specifications, here are our reasons for choosing this microcontroller for the ECE 3567 lab: Typical of a modern day microcontroller, the MSP430G2553 is a versatile RISC based microcontroller featuring multiple clocks, flexible timer modules and a good selection of low power modes, all of which make this microcontroller an excellent tool for beginning in depth education on modern microcontrollers. The maximum RAM of 16kB in theg2xx3 family is sufficient to handle all the programming needs of this lab. The available experimenters board (TI Launchpad) costs less than 10 dollars which all students can afford, if they choose to buy one themselves. Texas Instrument is a multinational cooperation and is also one of the leading and growing companies in embedded systems.

To learn more about microcontrollers in depth, you should study the various data sheets provided by the manufacturer. For TI microcontrollers there are typically one or two sets of data sheets to look through, Family Guide and Device Specific data sheets. Both should be available at the product s website. Studying data sheets is a long but rewarding task. You are not required to read the data sheets from cover to cover but we recommend that you keeping a copy of these with you as a reference. In addition, online forums and videos can also help you to get more information and help, but you should not rely entirely on these resources. Finally, it is imperative to start experimenting by yourself to gain applied experience. You will not really learn until you experiment by yourself and that is the whole aim of this lab! Microcontroller Review **************************************************************************** What Do You Need for This Course As a prerequisite for this course we expect you to know the basics of this microcontroller, Code Composer Studio version 5 and assembly language for the MSP430 series of microcontrollers. If you need to review basics like the assembly code itself, addressing mode, program structure etc. then please go through the MCU_Review I and II screencast videos carefully so that you can keep up with the labs. **************************************************************************** In this section by having you complete the following practice exercises, we will help you: Review using code composer studio with the Launchpad Learn tricks in using the debugger (CCSv5) Debug your workbench

Starting an Assembly Project in Code Composer Studio 1) Create a workspace (Folder where all your projects go into) for your project. Important: Create this workspace on the Z drive. 2) Open Code Composer Studio, You will see a workspace launcher window where you can browse to the directory of your workspace. 3) To create an assembly project, go to Project > New CCS Project 4) A New CCS Project window will pop up. Make sure you set up your program as shown in the following two screenshots.

Especially note legacy COFF in the above screenshot. By accomplishing the steps above, you have successfully created a CCS project in your workspace. You should see a main.asm file sitting in your project (Note that if you see a main.c file then you have chosen the wrong project type, i.e. a C project instead of an assembly project). Also make sure that under the targetconfigs folder, you have MSP430G2553.ccxml sitting in it and its status is [Active].

If you do not see a target configuration file (.ccxml), go to view > target configuration. Then right click in the new work area popped out and select New Target Configuration. Set up your new target configuration as the following: Do not forget to click on the save button under Save Configuration

Complete the following exercises, include your code and screenshots in your lab report. Practice Exercises Exercie 1 Blinky LED Test A blinky LED test is like a hello world program. It is meant for checking basic program and compiler setup, making sure your programs runs. Write an assembly language program that follows the following pseudo code: Loop: Toggle Red LED Delay loop with about 65545 iterations Go to Loop Exercise 2 Push Button, Decision Making and Debug Mode Write an assembly language program that follows the following pseudo code: Loop: If Button S2 is pressed then the Red LED is on and the Green LED is off If Button S2 is not presses then the Red LED is off and the green LED is on Go to Loop Note: Do not forget to set the pull up resistor for the push button. Before you start writing, think about: What pins in port1 or port 2 do you need What configurations do these pins need to be in

Step 1) Does your Code Work? a. Run the program at full speed. Step 2) Observe Values in register window a. Pause the program while push button is not pressed. Observe the bit in the input buffer in the register window that is connected to the push button. Is the observed bit value (0 or 1) what are expecting? Explain. Step 3) Stepping and Breakpoint b. After which line of code should the LED change color? Set break point to observe change of LED color. c. Run the program and let it hit the break points in the debugger to observe LED changes. Perform this step while pressing and not pressing the push button, check your decision making routine. d. Step through your program, are the LEDs lit/dim as expected? e. Is your code working or partially working? Step 4) Debug your code based on the information gathered in step 1 3 Exercise 3 Array Manipulations Write an assembly language program that follows the following pseudo code: Create an array named Array1 with space for five words initialized to zero. Create an array named Array2 with space for five words initialized to zero. Use a loop to fill Array1 with the following values: Array1[0] = 0 Array1[1] = 1

Array1[2] = 2 Array1[3] = 3 Array1[4] = 4 Array2[0] = Array1[0] + 2 Array2[1] = Array1[1] + 2 Array2[2] = Array1[2] + 2 Array2[3] = Array1[3] + 2 Array2[4] = Array1[4] + 2 Step 1) Does your Code Work? a. Run the program at full speed. Step 2) Observe Values in the Memory Browser c. Find Array1 and Array2 in the memory browser d. Step through the program, does the memory locations change as expected? Step 3) Debug your Code Please use this chance to verify that your workspace directory/project settings are bug free; ask questions if you are not comfortable with programming microcontrollers and its peripherals! This will save you valuable time in the coming labs.