National Tsing Hua University CS4101 Introduction to Embedded Systems Lab 6: Serial Communication Prof. Chung-Ta King Department of Computer Science National.

Slides:



Advertisements
Similar presentations
Autumn 2012C.-S. Shieh, EC, KUAS, Taiwan1 The 8051 Family Microcontroller Chin-Shiuh Shieh Department of Electronic Engineering.
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
Digital Thermostat and Data Logger Brandon Wagner and David Southwick.
1 10/9/06CS150 Introduction to Computer Science 1 for Loops.
Timers and Interrupts Shivendu Bhushan Summer Camp ‘13.
CS4101 嵌入式系統概論 Software UART Revisited Prof. Chung-Ta King Department of Computer Science National Tsing Hua University, Taiwan ( Materials from MSP430.
Chung-Ta King National Tsing Hua University
LAB 7: WDT+ and Low-Power Optimization
Lecture Set 9 MCS-51 Serial Port.
ENTC-489 Embedded Real Time Software Development Embedded Real Time Software Development Week 10 Real Time System Design.
Lab 5 System Design Thomas Watteyne EE290Q – Spring 2010
Lecture 11: TI MSP430 Timers Compare Modes
LAB 8: Program Design Pattern and Software Architecture
Ultra-low Power Motion Detection using the MSP430F2013.
ENTC-489 Embedded Real Time Software Development Embedded Real Time Software Development Week 11 Design Examples.
智慧電子應用設計導論(1/3) Arduino MEGA 2560
© 2008, Renesas Technology America, Inc., All Rights Reserved 1 Course Introduction Purpose  This course provides an introduction to the peripheral functions.
Interrupts Microprocessor and Interfacing
1 4-Integrating Peripherals in Embedded Systems. 2 Introduction Single-purpose processors  Performs specific computation task  Custom single-purpose.
Introduction In this lab , we will learn
MQX GPIO.
Chip Config & Drivers – Required Drivers:
Outline Introduction to NuMaker TRIO Programming environment setup
Lab 7 Basic 1: Game of Memory
Introduction In this lab , we will learn
Outline Introduction to digital-to-analog converter (DAC)
Introduction Why low power?
CS4101 嵌入式系統概論 General Purpose IO
Application Case Study Security Camera Controller
Outline Analog to digital conversion (ADC) of NuMaker TRIO
CS4101 Introduction to Embedded Systems Lab 10: Tasks and Scheduling
CS4101 Introduction to Embedded Systems Lab 8: Tower System
CS4101 Introduction to Embedded Systems Lab 11: Task Synchronization
CS4101 Introduction to Embedded Systems Lab 6: Low-Power Optimization
Chapter 1 Introduction to Java
CS4101 Introduction to Embedded Systems Lab 1: MSP430 LaunchPad IDE
CS4101 Introduction to Embedded Systems Lab 12: Task Synchronization
Store Multiple Results?
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
Instructor : Ahmed Alalawi Slides from Chung –Ta King
Prof. Chung-Ta King Department of Computer Science
CS4101 Introduction to Embedded Systems Lab 9: NuMaker ADC and LCD
CS4101 嵌入式系統概論 General Purpose IO
CS4101 Introduction to Embedded Systems Design and Implementation
Introduction to Micro Controllers & Embedded System Design Interrupt
National Tsing Hua University CS4101 Introduction to Embedded Systems Lab 2: Timer and Clock Prof. Chung-Ta King Department of Computer Science National.
National Tsing Hua University CS4101 Introduction to Embedded Systems Lab 3: Interrupt Prof. Chung-Ta King Department of Computer Science National Tsing.
C++ Arrays.
CS4101 Introduction to Embedded Systems Lab 7: Serial Communication
CS4101 Introduction to Embedded Systems Lab 4: Interrupt
8255.
CS4101 Introduction to Embedded Systems Lab 7: Serial Communication
CS4101 Introduction to Embedded Systems Lab 8: Arduino DAC and PWM
Lecture 9: TI MSP430 Interrupts & Low Power Modes
Thermal arm-wrestling
Microcontroller Labs Lab 1 – The LED Test Mode Dr. Gregg Chapman
Lab 1. Introduction to the DE2 Board
Thermal arm-wrestling
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
NOR ZALINA ISMAIL FACULTY OF COMPUTER AND MATHEMATICAL SCIENCES1
CS 1111 Introduction to Programming Spring 2019
ECE 3567 Microcontroller Lab
Presentation transcript:

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

National Tsing Hua University Lab 6 Write a function flash(char id, int on, int off) to flash the LEDs by interrupts using Timer1_A3 driven by ACLK sourced from VLO, where  id = 0 for red LED; 1 for green LED  on/off = time (in ms) for the LED to be on/off  CPU enters LPM3 between interrupts Write a function temp(int interval, int times) to measure the temperature using repeat-single- conversion mode triggered by Timer0_A3  interval: the interval (in ms) between measurements  times: the number of times to measure  Results are stored in a global integer array Temp[64] 1

National Tsing Hua University Lab 6 Normal:  Use flash() to flash the green LED at 0.5 Hz (0.5 sec on and 1.5 sec off) by interrupts (ACLK sourced from VLO  Use temp() to measure the temperature at 1 Hz continuously (Hint: must reuse Temp[]) Special:  If the average temperature of the last 2 seconds is higher than 737 (voltage), then flash the red LED at 2 Hz (0.2 sec on and 0.3 sec off) and send a string “Hot!” to PC every second using 7-E-1 (7-bit data, even parity, 1 stop bit). You must use 7-E-1 to get the full credit! 2

National Tsing Hua University Lab 6 Special: (cont.)  Whenever PC receives the string “Hot!”, it displays the string and waits for user’s input.  When user enters a string, PC transmits the string to the LaunchPad using 7-E-1  If the string is “Ack!”, then the LaunchPad goes back to the normal state (i.e. flash the green LED at 0.5 Hz with 0.5 sec on and 1.5 sec off). Otherwise, the LaunchPad ignores the string and keeps flashing the red LED at 2 Hz. 3