
Learn Embedded Systems Lab 2: Timer and Clock Systems at NTHU Taiwan
Dive into the fascinating world of timer and clock systems in lab 2 of the embedded systems course at National Tsing Hua University, Taiwan. Explore basic timer settings, characteristics of clock sources, and more using MSP430 LaunchPad. Engage in hands-on activities like flashing LEDs in sync with button presses and releases, while understanding the nuances of timer registers and event monitoring.
Uploaded on | 0 Views
Download Presentation

Please find below an Image/Link to download the presentation.
The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.
You are allowed to download the files provided on this website for personal or commercial use, subject to the condition that they are used lawfully. All files are the property of their respective owners.
The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.
E N D
Presentation Transcript
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 Clock Timer 1 National Tsing Hua University
Interior of MSP430G2553 Clock system X IO Not available on 20-pin device Timer system 2 National Tsing Hua University
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. 3 National Tsing Hua University
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. 4 National Tsing Hua University