National Tsing Hua University CS4101 Introduction to Embedded Systems Lab 2: Timer and Clock Prof. Chung-Ta King Department of Computer Science National.

Slides:



Advertisements
Similar presentations
UBI >> Contents Chapter 7 Timers Laboratories MSP430 Teaching Materials Texas Instruments Incorporated University of Beira Interior (PT) Pedro Dinis Gaspar,
Advertisements

1 ELE271 Mon. April 7, Review LPM -Morse Code Lab -.ref and.def -Multiplication, shift.
Chung-Ta King National Tsing Hua University
Chung-Ta King National Tsing Hua University
Chung-Ta King National Tsing Hua University
Timers and Interrupts Shivendu Bhushan Summer Camp ‘13.
Decoding Barcodes Various approaches. Decoding barcodes There are a number of ways of decoding the barcodes –The data can be polled –The data can be read.
CS4101 嵌入式系統概論 Timers and Clocks 金仲達教授 國立清華大學資訊工程學系 Materials from MSP430 Microcontroller Basics, John H. Davies, Newnes, 2008.
Chung-Ta King National Tsing Hua University
Timers. Range of timers Watchdog timer: Included in all devices (watchdog timer+). Its main function is to protect the system against malfunctions but.
LAB 7: WDT+ and Low-Power Optimization
T IMERS - 2. O UTPUT U NIT Each capture/compare block contains an output unit. The output unit is used to generate output signals such as PWM signals.
MSP430 Mixed Signal Microcontroller – Parte 2 Afonso Ferreira Miguel Source: slau056d – Texas instruments.
ECE 447 Fall 2009 Lecture 10: TI MSP430 Timers and Capture Modes.
Lecture 11: TI MSP430 Timers Compare Modes
LAB 8: Program Design Pattern and Software Architecture
ELE22MIC Lecture 18 The AVR Sleep Modes The ATMEGA128’s Timer System
ECS642U Embedded Systems Cyclic Execution and Polling William Marsh.
LAB 12: Timer and Interrupt Chung-Ta King National Tsing Hua University CS 4101 Introduction to Embedded Systems.
Making the most of the Value Line MSP430 with the LaunchPad Explorer
Network and Systems Laboratory nslab.ee.ntu.edu.tw.
11/16/2006 WSN Mote- MCU & Sensor Hardware 1 ECET 581 Wireless Sensor Networks Mote – MCU & Sensor Hardware 1 of 3 Fall 2006
Introduction to the DE0 Board Prof. Taeweon Suh Computer Science & Engineering Korea University COSE221, COMP211 Computer Logic Design.
Introduction In this lab , we will learn
MQX GPIO.
Recall the Container Thermometer
Recall the Container Thermometer
Outline Introduction to NuMaker TRIO Programming environment setup
Lab 7 Basic 1: Game of Memory
Introduction In this lab , we will learn
Introduction In this lab, we will learn
Lecture 10: TI MSP430 Timers and Capture Modes
Outline Introduction to digital-to-analog converter (DAC)
Introduction Why low power?
Introduction Why low power?
Outline Introduction Centralized shared-memory architectures (Sec. 5.2) Distributed shared-memory and directory-based coherence (Sec. 5.4) Synchronization:
CS4101 嵌入式系統概論 General Purpose IO
Outline Analog to digital conversion (ADC) of NuMaker TRIO
ECE 3430 – Intro to Microcomputer Systems
CS4101 Introduction to Embedded Systems Lab 10: Tasks and Scheduling
CS4101 Introduction to Embedded Systems Lab 8: Tower System
CS4101 嵌入式系統概論 Interrupts Prof. Chung-Ta King
Code review: GPIO, timer, and ISR
CS4101 Introduction to Embedded Systems Lab 6: Low-Power Optimization
CS4101 Introduction to Embedded Systems Lab 1: MSP430 LaunchPad IDE
CS4101 Introduction to Embedded Systems Lab 12: Task Synchronization
CS4101 嵌入式系統概論 Interrupts Prof. Chung-Ta King
CS4101 Introduction to Embedded Systems Lab 11: Sensors
CS4101 Introduction to Embedded Systems Lab 1: General Purpose IO
CS4101 Introduction to Embedded Systems Lab 13: Task Synchronization
Prof. Chung-Ta King Department of Computer Science
ECE 3430 – Intro to Microcomputer Systems
COMP211 Computer Logic Design Introduction to the DE2 Board
CS4101 Introduction to Embedded Systems Lab 9: NuMaker ADC and LCD
CS4101 嵌入式系統概論 General Purpose IO
MSP432 ARM Timer Programming
CS4101 Introduction to Embedded Systems Design and Implementation
National Tsing Hua University CS4101 Introduction to Embedded Systems Lab 3: Interrupt Prof. Chung-Ta King Department of Computer Science National Tsing.
National Tsing Hua University CS4101 Introduction to Embedded Systems Lab 6: Serial Communication Prof. Chung-Ta King Department of Computer Science National.
Subject Name: Microcontroller Subject Code: 10ES42
CS4101 Introduction to Embedded Systems Lab 4: Interrupt
ECE 3430 – Intro to Microcomputer Systems
CS4101 Introduction to Embedded Systems Lab 8: Arduino DAC and PWM
ECE 3430 – Intro to Microcomputer Systems
Wireless Embedded Systems
Lab 1. Introduction to the DE2 Board
CS4101 Introduction to Embedded Systems Lab 2: Basic IO and Timer
Lecture 4. Introduction to the DE2 Board
Prof. Chung-Ta King Department of Computer Science
MSP430 Clock System and Timer
Presentation transcript:

National Tsing Hua University CS4101 Introduction to Embedded Systems Lab 2: Timer and Clock Prof. Chung-Ta King Department of Computer Science National Tsing Hua University, Taiwan

National Tsing Hua University Introduction In this lab, we will learn the timer and clock systems of MSP430 LanuchPad  Basic setting of the timer  Capture/compare block of the timer  Characteristics of different clock sources and their settings 1 Timer Clock

National Tsing Hua University Interior of MSP430G X Not available on 20-pin device IO Timer system Clock system

National Tsing Hua University 3 Lab 2 Basic 1:  Flash the red and green LED alternatively whenever the button is pressed and released once. The LEDs change right after the button is released. The LEDs flash at 1 Hz (0.3 sec on and 0.7 sec off) by polling Timer0_A3m which is driven by ACLK sourced from VLO (running at 12 KHz).  Note: There are two events to monitor: timer up and button up and down.  Note: Since TAR register is 16-bit (0~65535) long, you should be careful of its overflow.

National Tsing Hua University 4 Lab 2 Basic 2:  When the button is up, neither of the LEDs is on.  When the button is down, only flash the green LED according to the settings in Basic 1. But if the button is pressed for more than 3 seconds, flash only the red LED instead (on for 0.2 sec and off for 0.8 sec), which is controlled by polling Timer1_A driven by SMCLK sourced by DCO.  Note: You have to use the Capture/Compare Block to detect how long the button is pressed.