ECE 3567 Microcontroller Lab

Slides:



Advertisements
Similar presentations
Getting started with MPLAB Launch MPLAB Set Toolbar as in the next slide by clicking the leftmost icon Open a new Source file by choosing [FILE][NEW] Type.
Advertisements

Introduction to HT-IDE3000 Micro-C development System Department.
Using the SmartPLS Software
Code Composer Department of Electrical and Computer Engineering
Lab7: Introduction to Arduino
Getting your Arduino to Work: Microsoft Windows 1.Install Arduino programming environment 2.Install Arduino Uno driver 3.Make sure you can download a program.
Lab6 – Debug Assembly Language Lab
FIR TYPE-I Lowpass Filtering using TMS320C6711 Floating Point Processor DEMO Presentation Prepared by: Bashir SADEGHI Supervised by: Dr. Erhan A. INCE.
Infineon Technologies Corp. June 99 1 HOT167-1 Version 2.0 * C167CS not yet supported by DAvE V1.0 CD ROM. See “Hints regarding DAvE.” Exercise 7ASC_1.
LAUNCHXL2-RM57L – Project 0
Using PDG with e2studio: Example
OllyDbg Debuger.
1 Introduction to Programming Environment Using MetroWerks CodeWarrior and Palm Emulator.
LSU 06/04/2007BASIC Stamp Editor1 The BASIC Stamp Editor Programming Unit, Lecture 3.
Introduction Purpose Objectives Content Learning Time
1 Semester 2 Module 2 Introduction to Routers Yuda college of business James Chen
Part 1 Using the ARM board And start working with C Tutorial 5 and 6
Chapter 2 Software Tools and Assembly Language Syntax.
TrendReader Standard 2 This generation of TrendReader Standard software utilizes the more familiar Windows format (“tree”) views of functions and file.
Silicon Labs ToolStick Development Platform
1 ENG236: ENG236: C++ Programming Environment (2) Rocky K. C. Chang THE HONG KONG POLYTECHNIC UNIVERSITY.
Renesas Technology America Inc. 1 M16C/Tiny SKP Tutorial 2 Creating A New Project Using HEW4.
Lab 1 – Assembly Language and Interfacing Start date: Week 3 Due date: Week 4 1.
Introduction Purpose This training course covers debugging an application on an SH target in the Renesas HEW (High-performance Embedded Workshop) development.
Dr Masri Ayob TK 2633: Microprocessor & Interfacing Lecture 7: Assembly Language.
High Speed Data Converter University
Renesas Technology America Inc. 1 SKP8CMINI Tutorial 2 Creating A New Project Using HEW.
Introduction Purpose This training course covers debugging an application on an SH target in the Renesas HEW (High-performance Embedded Workshop) development.
From Scratch: Open CCS Exit and restart CCS Click Browse to create a new workspace directory.
Using Microsoft Visual Studio 2005 Original by Suma Rao Revised by John G. McMahon ( 9/6/2008 )
Slide 1 Project 1 Task 2 T&N3311 PJ1 Information & Communications Technology HD in Telecommunications and Networking Task 2 Briefing The Design of a Computer.
Bit-DSP-MicrocontrollerTMS320F2812 Texas Instruments Incorporated European Customer Training Center University of Applied Sciences Zwickau (FH)
Renesas Technology America Inc. 1 M16C Seminars Lab 3 Creating Projects Using HEW4 14 March 2005 M16C Seminars Lab 3 Creating Projects Using HEW4 Last.
Debugging Ensemble Productions CAMTA Meeting 11 th November 2010 John Murray.
Touch screen function manual Right & left scroll key Room selecting key, Maximal quantity 50. Controlling Target icon Room background image brightness.
Renesas Technology America Inc. 1 SKP8CMINI Tutorial 2 Creating A New Project Using HEW.
George W. Woodruff School of Mechanical Engineering, Georgia Tech ME4447/6405 ME 4447/6405 Configuring CodeWarrior V5.1 for the HCS12.
1 Getting Started with C++ Part 1 Windows. 2 Objective You will be able to create, compile, and run a very simple C++ program on Windows, using Microsoft.
Open project in Microsoft Visual Studio → build program in “Release” mode.
Editing and Debugging Mumps with VistA and the Eclipse IDE Joel L. Ivey, Ph.D. Dept. of Veteran Affairs OI&T, Veterans Health IT Infrastructure & Security.
Chapter 2: The Visual Studio.NET Development Environment Visual Basic.NET Programming: From Problem Analysis to Program Design.
Programming and Debugging with the Dragon and JTAG Many thanks to Dr. James Hawthorne for evaluating the Dragon system and providing the core content for.
© 2008, Renesas Technology America, Inc., All Rights Reserved 1 Introduction Purpose  This training course demonstrates the use of the High-performance.
Workshop Setup The software/hardware used in this workshop are:
Introduction to Vivado
Chapter 2: The Visual Studio .NET Development Environment
Programming and Debugging with the Dragon and JTAG
Tutorial 2 IDE of Keil for the ARM 7 board(2)
Arduino is an open-source platform for building electronics projects
CS4101 Introduction to Embedded Systems Lab 1: MSP430 LaunchPad IDE
Microcontroller Applications
Computer Programming I
PRU-ICSS Programming with CCS
Programming Boe-Bots (Part 1)
Roller Coaster Design Project
ADC32RF45 with KCU105 Internal Clock GHz.
DEMO Presentation Prepared by: Bashir SADEGHI Supervised by: Dr
Debugging with Eclipse
Tutorial 19 - Microwave Oven Application Building Your Own Classes and Objects Outline Test-Driving the Microwave Oven Application Designing.
ECE 3567 Microcontrollers Dr. Gregg J Chapman
CSC235 - Visual Studio Tutorial
Double click Microsoft Visual Studio 2010 on the Computer Desktop
Software Setup & Validation
Lecture9: Embedded Network Operating System: cisco IOS
Debugging with Eclipse
Embedded Development Tools
Lecture9: Embedded Network Operating System: cisco IOS
ECE 3567 Microcontrollers Lab
ECE 3567 Microcontrollers Lab
ECE 3567 Microcontrollers Lab
Presentation transcript:

ECE 3567 Microcontroller Lab Lecture 2 Project Demo, Embedded C, MSP430FR6989 Architecture Autumn 2018 Dr. Gregg Chapman

ECE 3567 Microcontroller Lab Project Demo

Project Set-up Open Code Composer Studio version 7.2.0 Select a Workspace on your U: drive Select File  New  CCS Project In the CCS Project window set Target to MSP430FRxxx and select MSP430FR6989 Enter the Project Name and click Finish Select File  New  Source File Enter Code Save the File Select Project  Rebuild Project At this point it is essential to connect the hardware Make sure that the Project is selected as [Active – Debug] Select the Debug ICON Once the GREEN ARROW comes up you can run the code Halt execution with the RED SQUARE

Transferring a Project to a New Location You must do two things before your project will function normally Change the Workspace Update the path for the Include Options under the Complier settings

Change Workspace Select  File  Switch Workspace  Other Enter the new workspace. Always select the file ABOVE your Project file that CCS created. When you select OK, Code Composer will restart

Change Include Options Select Project  Properties Go to Include Options under MSP430 Compiler You will need to add the proper path to all three of the following : “U:\<your path>\<your project name.\driverlib“ “U:\<your path>\<your project name.\driverlib\MSP430FR5xx_6xx“ “U:\<your path>\<your project name.\driverlib\MSP430FR5xx_6xx\inc“ Use the ICON to add a path When finished, click OK

Code Composer Studio Common Error Messages ERROR: Unable to Launch. The selection cannot be launched, and there are no recent launches Solution: Switch Workspace : File => Switch Workspace => Other Always select the folder that is ONE LEVEL ABOVE your project folder as the workspace.   ERROR: Cannot open source file “driverlib.h” Solution: Change the paths to the following folders - 1. Right click the project set as [Active-Debug] and open Properties 2. Under MSP430 Compiler options, select Include Options 3. Delete old paths to driverlib Add ALL THREE new paths: …/ driverlib …/ driverlib/MSP430FR5xx_6xx …/ driverlib/MSP430FR5xx_6xx/inc

Code Compilation and Execution Compile Debug Run Stop

Terminal Window View  Terminal Click on the ICON to launch the terminal. The Launch Terminal window should open: Choose the Serial Terminal to switch to the proper settings The pulldown menu for Port should list the available COM ports. If these end up not working you will have to resort to the process on the following slide to discover the COM ports If not already the default settings, select: Baud Rate – 9600, Data Bits – 8, Parity – None, Stop Bits – 1, Flow Control – None, Timeout – 5 secs, Encoding - Default (ISO-8859-1) Select OK

The CCS Com Terminal Each lab computer uses numerous COM ports. Before you activate the Terminal in CCS, you must identify an available COM port. To do this outside of the CCS Terminal: type CMD in the search window to bring up the Command Line prompt type MODE and write down the communication port numbers that are available (e.g. COM12, COM3) Close the Command window

Communication When you run the ECE 3567 Project program, You should receive the following message from the ECE 3567 software after the next RESET: ECE 3567 Microcontroller Lab Please enter a Command Code: You can test the transmit with valid two character commands, which must be capitalized. If they are not, you will receive: UNKNOWN COMMAND Please enter the next Command Code: For now, a valid command code will only respond with: Please enter the next Command Code: The command: TE should work You will add function to these codes throughout the semester

Watch Window Note that there is not a dynamic debugger for the LaunchPad. Expressions and Variables are only updated after a Breakpoint is reached. Select View  Expressions Right click to add registers or variable names.

Breakpoints Double click the line number to set a breakpoint You must re-compile to incorporate the breakpoint Click twice more to clear a breakpoint

Embedded C Programming ECE 3567 Microcontrollers Embedded C Programming

Embedded C It is C, but does NOT conform to common software practice due to all the # compiler directives and header files. It relies extensively on #defines and #typedefs located in included HEADER files (.h) in order to make low level manipulation of the hardware much easier than assembly language. NOTE: this also makes the C program look “funny” to software engineers. It is hardware dependent, particularly constant and variable sizes. If unsure of a constant or variable size use sizeof() to find out!

Embedded C REAL WORLD ADVICE ON EMBEDDED PROGRAMMING: NEVER write from the ground up. COPY and MODIFY working source code. Be careful of COPYWRITES. ALWAYS use the HEADER files from the MCU manufacturer. Use an Evaluation Board for development if possible. If not, these usually come with schematics that give you a good idea of what is required to get your MCU “off the ground”. UNDERSTAND THE HARDWARE! Read the Datasheet, at least for the modules that you are using. Initialization is MORE THAN HALF of the project. Write the initialization for each MCU sub-device (module) as a SEPARATE function.

Embedded C REAL WORLD ADVICE ON EMBEDDED PROGRAMMING: The main.c should consist of the following, in this order: A DETAILED DESCRIPTION in comment format #includes (esp. xxx.h files) and compiler directives Calls to INITIALIZATION FUNCTIONS The MAIN LOOP consisting almost entirely of function calls Interrupt Service Routines if applicable

Embedded C EXAMPLES: P1OUT = 0x01; Sets bit zero on the output of PORT 1, but clears the other 7 bits. the P1OUT and it’s address are defined in a header file. P1OUT |= BIT0; Bitwise ORs PORT 1 with BIT0 (0x01 or 00000001b), setting the LS bit of PORT 1 and preserving the other 7 bits in their original state. P1OUT &= ~BIT0; Bitwise ANDs PORT 1 with NOT BIT0 (0xFE or 11111110), clearing the LS bit of PORT 1 and preserving the other 7 bits in their original state.

The MSP430FR6989 Microcontroller Architecture ECE 3567 Microcontrollers The MSP430FR6989 Microcontroller Architecture

The MSP430FR6989 Microcontroller Architecture

The MSP430FR6989 Microcontroller Architecture Timers: TA0 – ISR, Command, USCI_A0 TA1 – ADC12, USCI_A1 TB0 – PWMs