Embedded Systems Lab 6: Serial Communication and Temperature Measurement

cs4101 introduction to embedded systems n.w
1 / 4
Embed
Share

Explore Lab 6 of the Introduction to Embedded Systems course at National Tsing Hua University, Taiwan, focusing on serial communication, LED flashing, temperature measurement, and interaction with a PC. Learn to flash LEDs, measure temperature, and handle special conditions based on temperature readings and user interactions.

  • Embedded Systems
  • Serial Communication
  • LED Flashing
  • Temperature Measurement
  • Taiwan

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


  1. 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

  2. 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

  3. 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

  4. 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 National Tsing Hua University

More Related Content