Name: Lab Section:CprE 288 Fall 2016 – Homework 8 (Solutions) Due Monday October 31 (on BlackBoard-midnight: No late submissions) Notes: Homework is individual work. Adhere to the University’s policy relating to the integrity of scholarship. See http://catalog.iastate.edu/academic_conduct/#academicdishonestytext(“Academic Dishonesty”).Homework must be typed and uploaded to BlackBoard as a PDF or Word Document (i.e. .doc or .docx) only.Late homework is accepted within two days from the due date. Late penalty is 10% per day. Except on Exam weeks, homework not accepted late.Note:Code that will not compile is a type-O. Answering a question as “will not compile” will be marked incorrect. Contact the Professor if you think you have found a type-O. Note: Unless otherwise specified, all problems assume the TM4C123 is being used Question 1: General Timer questions (10 pts) a) Briefly describe each of the Timer modes given in Table 9.1 of the textbook. (6pts) i) One shot mode: If in count down mode the counter starts from the loaded value and stops once it reaches 0. In count up mode the counter starts from 0 and stops when it reaches the loaded value. In count down mode the prescaler is used as a proper perscaler, in count up mode it extends a 16-bit counter to 24-bits ii) Periodic mode: The same behavior as One shot mode, with the major difference being the timer does not stop. If in count up mode, then when it reaches its max value (i.e. loaded value) it goes back to 0 and continues counting. If in count down mode, then when it reaches 0 it goes back to its max value (i.e. loaded value) and continues counting iii) RTC mode: The coutner is configured with a specific clock rate, that makes each tick of the Timer 1 second. iv) Edge Count mode: Allow counter each time an edge of an input signal occurs (i.e. count positive, negative, or both edges) v) Edge Time mode: Allows the counter to capture the time at which the edge of an input signal occurs (i.e. capture the time of positive and/or negative edges of the input signal). Also called Input Capture. vi) PWM mode: Also one to generate a PWM wave efficiently.
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.