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

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

ECE PRACTICE EXAM #2 Clocks, Timers, and Digital I/O

ECE2049: Embedded Computing in Engineering Design C Term Spring Lecture #11: More Clocks and Timers

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

Timer Module Timer A. ReadMeFirst

ECE2049 HW #1-- C programming and Binary Number Representations (DUE 1/19/2018 At the BEGINNING of class)

ECE2049 HW #1-- C programming and Binary Number Representations (DUE Friday 8/31/2018 At the BEGINNING of class)

ECE2049 HW #1-- C programming and Binary Number Representations (DUE 9/1/2017 At the BEGINNING of class)

ECE2049: Embedded Computing in Engineering Design A Term Fall 2017 Lecture #16: Interrupts and Event Driven Code

Timers and Clocks CS4101 嵌入式系統概論. Prof. Chung-Ta King. Department of Computer Science National Tsing Hua University, Taiwan

ECE2049: Embedded Computing in Engineering Design C Term Spring 2019 Lecture #22: MSP430F5529 Operating Mode & the WDT

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

Copyright 2015 by Stephen A. Zajac & Gregory M. Wierzba. All rights reserved..spring 2015.

Lab 1: I/O, timers, interrupts on the ez430-rf2500

University of Texas at El Paso Electrical and Computer Engineering Department. EE 3176 Laboratory for Microprocessors I.

ECE2049 Homework #4 Analog-to-Digital Conversion and the ADC12 (Due Thursday 2/15/2018 to box outside AK-011 by 9 am)

University of Texas at El Paso Electrical and Computer Engineering Department. EE 3176 Laboratory for Microprocessors I.

Lab 4 Interrupts ReadMeFirst

Lab 4: Interrupt. CS4101 Introduction to Embedded Systems. Prof. Chung-Ta King. Department of Computer Science National Tsing Hua University, Taiwan

CPE 325: Embedded Systems Laboratory Laboratory #7 Tutorial MSP430 Timers, Watchdog Timer, Timers A and B

CPE 323: MSP430 Timers

2.996/6.971 Biomedical Devices Design Laboratory Lecture 6: Microprocessors II

ECE2049: Embedded Computing in Engineering Design C Term Spring Lecture #3: Of Integers and Endians (pt. 2)

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

ECE2049: Embedded Computing in Engineering Design C Term Spring 2018 Lecture #20: Using SPI The DAC

Texas Instruments Mixed Signal Processor Tutorial Abstract

CPE 325: Embedded Systems Laboratory Laboratory #11 Tutorial Analog-to-Digital Converter and Digital-to-Analog Converter

5xx Active & Low Power Mode Operation

ECE2049: Embedded Computing in Engineering Design A Term Fall Lecture #9: Exam Review w/ Solutions

ECE2049: Embedded Computing in Engineering Design C Term Spring Lecture #7: More Digital IO

Hacettepe University

ECE2049-E18 Lecture 6 Notes 1. ECE2049: Embedded Computing in Engineering Design E Term Lecture #6: Exam Review

Time. Computer Science and Engineering College of Engineering The Ohio State University. Lecture 37

The 16-bit timer/counter register, TAR, increments or decrements (depending on mode of operation) with each rising edge of the clock signal.

What is an Interrupt?

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

Moses Jones Application Note ECE 480 Design Team 7 Programming Altimeters. Using MSP 430 Launch Pad 11/8/2013

Interrupts CS4101 嵌入式系統概論. Prof. Chung-Ta King. Department of Computer Science National Tsing Hua University, Taiwan

MSP430. More on MSP430

Hacettepe University

15.1 Timer_A Introduction

IAR PowerPac RTOS for Texas Instruments MSP430 Microcontroller Family

MSP430 Interrupts. Change value of internal variable (count) Read a data value (sensor, receive) Write a data value (actuator, send)

Timer0..Timer3. Interrupt Description Input Conditions Enable Flag

ECE2049: Embedded Computing in Engineering Design A Term Fall Lecture #8: Making it work: LEDs, Buttons & Keypad

18-642: Time and Date

// Conditions for 9600/4=2400 Baud SW UART, SMCLK = 1MHz #define Bitime_5 0x05*4 // ~ 0.5 bit length + small adjustment #define Bitime 13*4//0x0D

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

ECE2049-E17 Lecture 6 1. ECE2049: Embedded Computing in Engineering Design E Term Lecture #6: Exam Review

MSP430 Teaching Materials

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

CPE 323 Introduction to Embedded Computer Systems: MSP430 System Architecture An Overview

ECE Homework #10

Towards Hard Real-time Performance in a Highly Asynchronous Multitasking MSP430 Application Andrew E. Kalman, Ph.D.

ECE2049: Homework 1. Consider the following code to compute the average of your exam grades: #define NUM_EXAMS (3)

Unit 13 Timers and Counters

IV B.Tech. I Sem (R13) ECE : Embedded Systems : UNIT -2 1 UNIT 2

MSP430F20xx Device Erratasheet

Network Embedded Systems Sensor Networks Fall Hardware. Marcus Chang,

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

Getting Started with the Texas Instruments ez430

CS16 Midterm Exam 2 E02, 10W, Phill Conrad, UC Santa Barbara Tuesday, 03/02/2010

Interrupt vectors for the 68HC912B32. The interrupt vectors for the MC9S12DP256 are located in memory from 0xFF80 to 0xFFFF.

CPE/EE 323 Introduction to Embedded Computer Systems Homework V

ECE2049: Embedded Computing in Engineering Design C Term Spring 2018

Embedded Systems. 3. Hardware Software Interface. Lothar Thiele. Computer Engineering and Networks Laboratory

University of Florida EEL 4744 Spring 2014 Dr. Eric M. Schwartz Department of Electrical & Computer Engineering 1 April Apr-14 9:03 AM

2. (2 pts) If an external clock is used, which pin of the 8051 should it be connected to?

Fall. Accelerometer RGB LED control Vishal Shah Rebel Sequeira Pratiksha Patil Pranali Dhuru Chris Blackden. George Mason University

ECE2049: Homework 1. Due: Thursday, 25 May 2017 by 7pm

CPE/EE 421 Microcomputers

CPE 323 Introduction to Embedded Computer Systems: ADC12 and DAC12. Instructor: Dr Aleksandar Milenkovic Lecture Notes

ECE251: Thursday November 8


8051 Peripherals. On-Chip Memory Timers Serial Port Interrupts. Computer Engineering Timers

UNIVERSITY OF CONNECTICUT. ECE 3411 Microprocessor Application Lab: Fall Quiz II

Alex Milenkovich 1. CPE/EE 421 Microcomputers. Course Administration. Review: Outline. Getting Started with EasyWeb2. Review: MSP bit RISC

UNIVERSITY OF CONNECTICUT. ECE 3411 Microprocessor Application Lab: Fall Lab Test III

CSCD 255 HW 2. No string (char arrays) or any other kinds of array variables are allowed

Timer2 Interrupts. NDSU Timer2 Interrupts September 20, Background:

ECE2049 E17 Lecture 2: Data Representations & C Programming Basics

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

UNIVERSITY OF CONNECTICUT. ECE 3411 Microprocessor Application Lab: Fall Lab Test III

Embedded Technosolutions

Introduction to Lab. 3

***PRACTICE EXAM 02 for*** CS16 Midterm Exam 2 E02, 09F, Phill Conrad, UC Santa Barbara Actual exam scheduled for: 11/18/2009

A USER'S GUIDE TO THE NPL TELEPHONE TIME SERVICE

Block diagram of processor (Harvard)

University of Texas at El Paso Electrical and Computer Engineering Department. EE 3176 Laboratory for Microprocessors I.

Using programmed I/O on the M16C; and Writing an Interrupt Service Routine (ISR)

TCG 01-G & TCG 02-G Firmware Release Notes

ECEN 5613 Embedded System Design Week #9 Fall 2016 Lab #4 10/22/2016

University of Texas at El Paso Electrical and Computer Engineering Department. EE 3176 Laboratory for Microprocessors I.

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

Timer 32. Last updated 8/7/18

µtasker Document µtasker SNTP (Simple Network Time Protocol)

CPE/EE 421 Microcomputers

A USER S GUIDE TO THE NPL TELEPHONE TIME SERVICE

Team 3. By: Miriel Garcia. Microcontrollers/ TI MSP430F5438A. ECE 480 senior Design. Application Note 4/3/15

CprE 288 Spring 2014 Homework 5 Due Fri. Feb. 21

Transcription:

ECE2049 Homework #3 Clocks & Timers (Due Thursday 2/8/18 At the BEGINNING of class) Your homework should be neat and professional looking. You will loose points if your HW is not properly submitted (by properly I mean stapled with a cover sheet including your ECE box number. Any code should be typed)! Reading: Davies 2.6. 5.8, 8.3-4, 8.9-10, MSP430x55xx User's Guide Ch. 5,17, MSP430F5529 Launchpad User's Guide Problem 1 (20 pts) a) What are the exact frequencies of XT1 and XT2 on oue lab board, the MSP430F5529 Launchpad? What are the default frequencies for ACLK, MCLK and SMCLK? What are the range of possible clock frequencies for MCLK and SMCK? What is each clock (ACLK, MCLK and SMCLK) used for? b) The following line is executed at the beginning of configdisplay() during system initialization by our demo project code. We are working with the clock system not digital IO. Why is it necessary? What does it do? P5SEL = (BIT5 BIT4 BIT3 BIT2); c) Below are the values of the Unified Clock System registers for two different MSP430 applications. Use the MSP430x55xx User's Guide Chapter 5 and class notes to decode the bit fields for each register. What are the resulting values of ACLK, MCLK, and SMCLK in each case. (Hint: see Users Guide page 164 for DCO eqs.) UCSCTL0 = 0x13E0 UCSCTL1 = 0x0020 UCSCTL2 = 0x103F UCSCTL3 = 0x0000 UCSCTL4 = 0x0044 UCSCTL5 = 0x0000 UCSCTL6 = 0x01CC UCSCTL7 = 0x0F03 UCSCTL8 = 0x0707 d) Write a C function that expressly turns on both XT1 and XT2 (see UCSCTL6) and sets the frequency of MCLK and SMCLK to as close to 21.5 MHz as you can. Explain whether you used XT1 or XT2 as source for DCO REFCLK and why. Assume all other clock settings are to be left in their default state. You may still assume that P5.5-2 are set as shown in (b) at the top of configdisplay() and do not have to be configured by your function. Your code must be typed to be graded.

Problem 2 Time standards are very important to the scientific, engineering and computing communities. However, precisely keeping track of time all over the world is a deceptively tricky business. Watch this video and do a bit of Googling and tell me the following. (30 pts) a) What is Coordinated Universal Time (UTC)? What time zone is Fiji in?. What is that in terms of UTC, (e.g. Minsk, Belarus is UTC + 2:00). Scientific times are often written something like 19:00Z, read as 19 hundred Zulu. What is Zulu time? In computing, UTC based time scales usually store the current time as the number of seconds that have elapsed since the beginning of some epoch. For the Network Time Protocol (NTP) this is defined as midnight January 1 st (GMT) 1900. The elapsed seconds are stored in a 32-bit unsigned integer. However, in many systems it is more practical to just consider the current year. The time format is often modified such that 0 corresponds to midnight January 1 of the current year. One benefit of using a UTC-style timescale is that a year's time record, to within one second, can readily be represented in a single unsigned 32-bit integer. (Actually, much longer than 1 year of seconds can be contained in a 32-bit unsigned integer.). The year can then be stored in a separate (16-bit) integer. b) If a UTC-style clock counting whole seconds was initialized to 0 at midnight 1 Jan 2018 currently has a count of 9,400,000 seconds what day (i.e. date) and time is it? Like Feb 3, 8:43:02 am. Hint: Remember that days are counted from 1. c) A data recording package is to be placed on the ocean floor for 3 months during which it will automatically listen and record acoustic data. It will also take various oceanographic measurements and must be able to measure time to within 1 millisecond throughout its operational life. The engineers have designed the device to record for a maximum of 100 days in case there was a delay in device retrieval. Can the engineers use a 32-bit unsigned integer to store time to within 1 ms inside this data recorder? Or, must they use a 64-bit variable? Explain your answer. d) How would you configure TimerA2 to implement a clock with 1 ms resolution assuming SMCLK has already been configured to equal 4 MHz? Write a C code segment (including the TimerA2 setup and TimerA2 ISR) implementing a clock that saves its time (count) to a variable of the appropriate size (as determined in part d). You do not have to configure the UCS registers to set the value of SMCLK. Your timer should generate interrupts only once per millisecond. Do you need leap counting? Explain. e) Create a C function that converts the timer count from parts c & d to recorder mission day, hours, minutes and sec.sss. The count of days starts at 1 not 0 (e.g. Day 1 00:00:00.000 is midnight on the first deployed day). Your code must be typed to be graded. You do not have to convert your results to ascii for display.

Problem 3 For a certain application TimerA2 has been configured as shown below. a) What is the exact time between interrupts. Assume that ACLK, SMCLK and MCLK are running at their default settings. (20 pts) void runtimera2(void) { TA2CTL = TASSEL_2 MC_3 ID_1; TA2CCR0 = 2622; TA2CCTL0 = CCIE; // enable Timer A2 interrupt } b) If the system clock and TimerA2 settings from part (a) are used implement a timing system, how long until the time displayed by that system is off by 0.005 seconds? By 0.01 seconds? Will the system be fast or slow? How do you know? c) Write the interrupt service routine for TimerA2 for this application. Include a single level of leap counting to keep the display accurate to within 0.01 sec. How long until you leap counting clock is off by 0.01 sec. Your code must be typed to be graded. d) Assume the MSP430 clocks have been configured to the following frequencies. ACLK = 32,768 Hz MCLK = XT2 = 4.0 MHz SMCLK = XT2 = 4.0 MHz What is the smallest time interval you could theoretically measure using TimerA2 assuming these settings for MCLK, SMCLK and ACLK? Could your MSP430 system actually function with the Timer set to that interval? Explain why or why not. Problem 4 An automated measurement process is controlled using an MSP4305529. The execution of the critical step in the measurement must be timed to within 0.20 millisecond. Variances greater than 0.20 ms will make the measurement results useless. Design a timing program suitable for timing this critical operation. (30 pts) a. Write a function to configure the UCS registers to turn on XT2 and set SMCLK to use XT2 as it's clock source (i.e. set SMCLK = 4 MHz). Don't forget to set P5.5-2 as shown in 1b. b. Write a function in C to setup TimerA2 using SMCLK divided by 2 as its clock to measure the interval. Also show your interrupt service routine. c. A complete measurement cycle takes 42 seconds. Will you need to use any leap counting to maintain the 0.20 ms accuracy of your timer over the whole measurement? Explain your answer.

d. In Lab 3 you will need to display numeric readings to the LCD screen but the LCD functions take arrays of char as input. Show how you'd convert your timer count to display seconds and milliseconds to 4 decimal places like ss.mmmm to the LCD. Do not have to include code to display the results just how you would fill the char array that would be displayed. Document you code well. Code should be typed to be graded. e. Now assume that the XT2 crystal used with your MSP430F5529 is on the low end of its tolerance and actually oscillates at 3,999,980 Hz (i.e. it is 0.0005% off.) What would the error associated with your timer at the end of the 42 second long measurement be given that you designed your timer assuming SMCLK = 4 MHz exactly. Will you actual timer be fast of slow? Explain. Will this make your measurement system out of tolerance?

ECE2049 Homework #3 Submitted by: ECE Box #: Date: Question Grade 1-20 2-30 3-20 4-30 Total (100):