UNIVERSITY OF CONNECTICUT. ECE 3411 Microprocessor Application Lab: Fall Quiz II

Similar documents
UNIVERSITY OF CONNECTICUT. ECE 3411 Microprocessor Application Lab: Fall Lab Test III

UNIVERSITY OF CONNECTICUT. ECE 3411 Microprocessor Application Lab: Fall Lab Test III

UNIVERSITY OF CONNECTICUT. ECE 3411 Microprocessor Application Lab: Fall Quiz IV

UNIVERSITY OF CONNECTICUT. ECE 3411 Microprocessor Application Lab: Fall Quiz V

UNIVERSITY OF CONNECTICUT. ECE 3411 Microprocessor Application Lab: Fall Quiz III

Magic 8 Ball. Student's name & ID (1): Partner's name & ID (2): Your Section number & TA's name

AVR Board Setup General Purpose Digital Output

STUDENT NAME(s):. STUDENT NUMBER(s): B00.

Marten van Dijk Department of Electrical & Computer Engineering University of Connecticut

CprE 288 Introduction to Embedded Systems Exam 1 Review. 1

Interrupts & Interrupt Service Routines (ISRs)

Robosoft Systems in association with JNCE presents. Swarm Robotics

ECGR 4101/5101, Fall 2015: Lab 7 Digital Oscilloscope

University of Florida EEL 4744 Spring 2014 Dr. Eric M. Schwartz Department of Electrical & Computer Engineering 1 April Apr-14 9:03 AM

FINAL EXAM. last name first name

LABORATORY MANUAL Interfacing LCD 16x2, Keypad 4x4 and 7Segment Display to PIC18F4580

2. (2 pts) If an external clock is used, which pin of the 8051 should it be connected to?

University of Florida EEL 4744 Fall 1998 Dr. Eric M. Schwartz

University of Texas at El Paso Electrical and Computer Engineering Department. EE 3176 Laboratory for Microprocessors I.

UART: Universal Asynchronous Receiver & Transmitter

Department of Electrical Engineering and Computer Science MASSACHUSETTS INSTITUTE OF TECHNOLOGY Fall Quiz I

// sets the position of cursor in row and column

Embedded Systems and Software

YOU WILL NOT BE ALLOWED INTO YOUR LAB SECTION WITHOUT THE REQUIRED PRE-LAB.

NCSU - ECE 306- Exam 2 March 27, 2003

University of Florida EEL 4744 Spring 2011 Dr. Eric M. Schwartz Department of Electrical & Computer Engineering 31 March Apr-11 1:29 PM

Software debouncing of buttons

Short introduction to C for AVR

An FTDI connection: The ATtiny microcontrollers don t have a hardware UART External Crystal header pins for an optional crystal

Signature: 1. (10 points) Basic Microcontroller Concepts

Lab Overview. Lab Details. ECEN 4613/5613 Embedded System Design Week #7 Spring 2005 Lab #4 2/23/2005

University of Florida EEL 3744 Spring 2018 Dr. Eric M. Schwartz. Good luck!


AVR Timers TIMER0. Based on:

G Distributed Systems: Fall Quiz II

Context Switching & Task Scheduling

Final Exam. Date: May 12, 2017

Introduction USART & AVR EVK1100

If the display shift operation is used on a 20 x 4 display, the addressing is shifted as follows:

Embedded Systems and Software. Serial Communication

AVR Helper Library 1.3. Dean Ferreyra

Serial Communications

Interrupts & Interrupt Service Routines (ISRs)

NCSU ECE 209 Sections 602 Exam 1 Fall September, I have neither given not received unauthorized assistance on this test.

ADC: Analog to Digital Conversion

ADC: Analog to Digital Conversion

Page 1 of 7. Samtron/Samsung 20S204DA2

By the end of Class. Outline. Homework 5. C8051F020 Block Diagram (pg 18) Pseudo-code for Lab 1-2 due as part of prelab

University of Texas at El Paso Electrical and Computer Engineering Department. EE 3176 Laboratory for Microprocessors I.

WEATHER STATION WITH SERIAL COMMUNICATION

ECE 353 Lab 4. General MIDI Explorer. Professor Daniel Holcomb Fall 2015

The modules in this lab room are 4 line by 16 character display modules. The data sheet/users manual for the module is posted on My.Seneca.

The University of Calgary. ENCM 339 Programming Fundamentals Fall 2016

Question 2. [5 points] Given the following symbolic constant definition

ECE2049 Homework #2 The MSP430 Architecture & Basic Digital IO (DUE Friday 9/8/17 at 4 pm in class)

Embedded Systems and Software. LCD Displays

8051 I/O and 8051 Interrupts

Lab 8 RS232 October 22, 2015

Objectives : 1) To study the typical design of a LCD module 2) To interface the digital display unit through parallel printer port using C# program.

Laboratory 3 Working with the LCD shield and the interrupt system

6.033 Computer Systems Engineering: Spring Quiz I THIS IS AN OPEN BOOK, OPEN NOTES QUIZ. NO PHONES, NO COMPUTERS, NO LAPTOPS, NO PDAS, ETC.

Serial:UART/I2C/SPI Text LCD Display Control Module. LCDSP_TG V1.60 user manual

EC4205 Microprocessor and Microcontroller

Introduction to Internet of Things Prof. Sudip Misra Department of Computer Science & Engineering Indian Institute of Technology, Kharagpur

CN310 Microprocessor Systems Design

EE251: Thursday November 30

UNIVERSITY OF WINDSOR Fall 2007 QUIZ # 2 Solution. Examiner : Ritu Chaturvedi Dated :November 27th, Student Name: Student Number:

EE445L Fall 2014 Final Version A Page 1 of 7

Dragon12 LCD Displays Hantronix_CLD.PDF data sheet (Dragon12 CD-ROM) Dragon12 LCD Display. The Dragon12 board has a 16 character x 2 line display

Faculty of Electrical Engineering, Mathematics, and Computer Science Delft University of Technology

Rochester Institute of Technology CMPE 663/EEEE 663 Graduate Student Project

LCD. Configuration and Programming


Dragon12 LCD Displays Huang Sections 7.8 Hantronix_CLD.PDF data sheet (Dragon12 CD-ROM) ATD_10B8C Block User Guide. Dragon12 LCD Display

8051 Timers and Serial Port

Dallas Semiconductor DS1307 Real Time Clock. The DS 1307 is a real-time clock with 56 bytes of NV (nonvolatile)

Department of Electrical Engineering and Computer Science MASSACHUSETTS INSTITUTE OF TECHNOLOGY Fall Quiz II

EE 354 September 16, 2016 C Sample Programs

6.097 Operating System Engineering: Fall Quiz II THIS IS AN OPEN BOOK, OPEN NOTES QUIZ.

Using printf with an AVR

Lab 3 LCD Mar

Marten van Dijk, Syed Kamran Haider

LCDs. Embedded Systems Interfacing. 20 September 2011

Largest Online Community of VU Students

Embedded Systems and Software

Laboratory 2: Programming Basics and Variables. Lecture notes: 1. A quick review of hello_comment.c 2. Some useful information

MASSACHUSETTS INSTITUTE OF TECHNOLOGY Fall Test I

MASSACHUSETTS INSTITUTE OF TECHNOLOGY Computer Systems Engineering: Spring Quiz 2

Lab 5: LCD and A/D: Digital Voltmeter

EE445L Fall 2018 Final EID: Page 1 of 7

EE251: Tuesday December 4

Lab 3e LCD Alarm Clock

Lab-3: LCDs Serial Communication Analog Inputs Temperature Measurement System

University of Florida EEL 4744 Summer 2014 Dr. Eric M. Schwartz Department of Electrical & Computer Engineering 1 July Oct-14 6:41 PM

Laboratory 10. Programming a PIC Microcontroller - Part II

Chapter 4. Address. data. Input / Output Programming. Simplified Z80 System Architecture. Memory. program. data. Z80 I/O Programming

Parallel-to-Serial and Serial-to-Parallel Converters

Department of Electrical Engineering and Computer Science MASSACHUSETTS INSTITUTE OF TECHNOLOGY Fall Quiz II

Menu. Introduction to C for Atmel XMega

Lab Course Microcontroller Programming

Transcription:

Department of Electrical and Computing Engineering UNIVERSITY OF CONNECTICUT ECE 3411 Microprocessor Application Lab: Fall 2015 Quiz II There are 5 questions in this quiz. There are 9 pages in this quiz booklet. Answer each question according to the instructions given. You have 45 minutes to answer the questions. Some questions are harder than others and some questions earn more points than others you may want to skim all questions before starting. If you find a question ambiguous, be sure to write down any assumptions you make. Be neat and legible. If we can t understand your answer, we can t give you credit! Write your name in the space below. Write your initials at the bottom of each page. THIS IS A CLOSED BOOK, CLOSED NOTES QUIZ. PLEASE TURN YOUR NETWORK DEVICES OFF. Any form of communication with other students is considered cheating and will merit an F as final grade in the course. Do not write in the boxes below 1 (x/12) 2 (x/16) 3 (x/24) 4 (x/24) 5 (x/24) Total (xx/100) Name: Student ID:

ECE 3411 Fall 2015, Quiz Page 2 of 9 1. [12 points]: Answer the following questions: a. The compiler will generate an error while compiling the following line of C code. Write the correct version of this line in the space below. const uint8_t my_string PROGMEM = "Hello!"; b. Once an interrupt occurs, how does an AVR knows where to find the code for the corresponding Interrupt Service Routine (ISR)? c. Is the following statement True or False? Upon an interrupt, the instruction which is currently being executed in the main code is finished first before executing the Interrupt Service Routine (ISR). d. Consider the following push-switch circuit. When this switch is pushed, the logic value passed to AVR (i.e. voltage at node To AVR ) is: (a) Logic HIGH (b) Logic LOW (c) None of the above Figure 1: A push switch circuit.

ECE 3411 Fall 2015, Quiz Page 3 of 9 2. [16 points]: Using Table 1, calculate the required value of UART Baud Rate Register UBRR0 for a baud rate of 1000 in Asynchronous Normal mode, where the System Oscillator clock frequency of 16MHz. Also, write C code inside Initialize UBRR0(uint16 t Value) function to store the value of argument Value into UBRR0 register. Table 1: Equations for calculating UART Baud Rate Register setting Calculated UBRR0 value = /* Write the code for initializing UBRR0 here */ void Initialize_UBRR0(uint16_t Value) { }

ECE 3411 Fall 2015, Quiz Page 4 of 9 3. [24 points]: Use LCD Instruction Set table (Table 3) provided on page 5 to fill LCD Commands Table (Table 2) below with the correct bit values of RS, R/W and DB7-DB0 signals to configure/control the LCD according the specified desired functionality. Table 2: LCD Commands Table No. Desired Functionality 1 Set interface data length to 8-bit mode, number of display lines to 1, and character font to 5 10 dots. 2 Turn the display OFF, cursor OFF, and no blinking. 3 Set the direction of cursor movement towards right and turn the display shift mode ON. 4 Turn the display ON, cursor ON, and no blinking. 5 Move the cursor to position (0, 5), i.e. first row and sixth column. Hint: The first row starts from DD RAM address 0x00. 6 Write the character A to the LCD. The ASCII value of A is 0x41. RS R/W DB7 DB6 DB5 DB4 DB3 DB2 DB1 DB0

ECE 3411 Fall 2015, Quiz Page 5 of 9 Table 3: LCD Instruction Set

ECE 3411 Fall 2015, Quiz Page 6 of 9 4. [24 points]: Let Task1() and Task2() be two functions from standard C library (stdlib.h). Write a C program for your AVR such that it calls Task1() every 10ms and Task2() every 100ms. You are allowed to use delay ms() function. Assume that the execution of Task1() and Task2() virtually takes no time. #define F_CPU 16000000UL #include <avr/io.h> #include <stdio.h> #include <stdlib.h> #include <util/delay.h> /* Declare any variables here */ int main(void) { /* Write your code below */ } /* End of main() */

ECE 3411 Fall 2015, Quiz Page 7 of 9 5. [24 points]: Let Task1() and Task2() be two functions from standard C library. We want to call Task1() once and only once every time a push button is pushed from released state, and we want to call Task2() once and only once every time the button is released from pushed state. The function button pushed() returns TRUE as long as the push button is pressed, and False otherwise. Implement the above mentioned functionality by extending Task PollingButton Debounce(void) function given below. /* Debouncing State Machine */ void Task_PollingButton_Debounce(void) { switch (PushState) { case NoPush: if ( _button_pushed() ) PushState=Maybe; else PushState=NoPush; break; case Maybe: if ( _button_pushed() ){ PushState=Pushed; PushFlag_Debounce=1; } else { PushState=NoPush; PushFlag_Debounce=0; } break; } } case Pushed: if ( _button_pushed() ) PushState=Pushed; else PushState=Maybe; break; /* Write your code below */

ECE 3411 Fall 2015, Quiz Page 8 of 9 /* Your code continues here */

ECE 3411 Fall 2015, Quiz Page 9 of 9 End of Quiz Please double check that you wrote your name on the front of the quiz.