CprE 288 Fall 2017 Homework 5 (Solutions) �Due: Not turned in or Graded Notes: . Homework must be typed and submitted as a PDF or Word Document (i.e. .doc or .docx) only. . If collaborating with others, you must document who you collaborate with, and specify in what way you collaborated (see last page of homework assignment), review the homeworkpolicy section of the syllabus: http://class.ece.iastate.edu/cpre288/syllabus.asp for further details. . Review University policy relating to the integrity of scholarship. See (Academic Dishonesty): ��http://catalog.iastate.edu/academic_conduct/#academicdishonestytext . Late homework is accepted within two days from the due date. Late penalty is 10% per day. Except on Exam weeks, homework only accepted 1 day late. . Note: Code that will not compile is a typo. Answering a question as will not �compilewill be �marked incorrect. Contact the Professor if you think you have found a typo. Note: Unless otherwise specified, all problems assume the TM4C123 is being used Question 1: Volatile keyword (5 pts) When developing software for an embedded system, the keyword volatile is often used. Read through the articles below and answer the following: Jones, Nigel. "Introduction to the Volatile Keyword" Embedded Systems Programming, July 2001: http://www.embedded.com/electronics-blogs/beginner-s-corner/4023801/Introduction-to-the-Volatile-Keyword Wikipedia Article: https://en.wikipedia.org/wiki/Volatile_(computer_programming)a) Give a summary of the conditions under which the volatile keyword should be used within a C based embedded system, and why. In general the keyword volatile is used for a variable when its value can changein a manner for which the compiler cannot track. Specific examples:
Initials: ________ 1 CprE 288 Introduction to Embedded Systems Fall 2015 Exam 2 Last Name (printed) _________________________ First Name (printed) _________________________ Lab Section _________________________ Instructions: Do not open this exam booklet until told to do so. Do not disclose the content of this exam or get any knowledge about it outside the exam. Report to the professors/TAs if you know about any such activity. Open book, open notes. Calculator allowed. Do all work in the space provided. You must show your work to receive credit. Clearly indicate the answer you want counted. Make assumptions if necessary to work problems. Unless a question asks if a line of C code is valid, then any question for which code will not compile is due to a typo, bring this to the instructor’s attention. Answering a question based on the reasoning that code will not compile will not receive credit. Be sure to complete the three lines above. Cheating will not be tolerated by the instructor or your classmates and will result in a severe penalty. This is a 75-minute exam. Score: Q1 Q2 Q3 Q4 Q5 Total 12 12 12 12 12 60 NOTEs: All questions are regarding the ATmega128 microcontroller and the AVR Studio platform unless stated otherwise. You may assume <avr/io.h> is included. You must use a good programming style, e.g. meaningful variable names, appropriate comment and consistent indentation. Additionally, your code should be as efficient as possible. You must use standard C. C code with poor programming style or bad run-time efficiency may receive partial credit.