4180T2_S22

docx

School

Georgia Institute Of Technology *

*We aren’t endorsed by this school

Course

4180

Subject

Electrical Engineering

Date

Apr 3, 2024

Type

docx

Pages

3

Uploaded by BailiffMantisMaster1210

Report
Score: _____________ Name:___________________________________________ EE 4180 Test II Test is open book and notes. No electronic devices. Place all answers in the spaces provided. 1. ( 4% ) What protocol is typically used to transfer text data on web pages? ( answer using the acronym ) __________________________ 2. ( 4% ) A local IP address starts with this three-digit number ( just provide the number for any one of the three possibilities )? __________________________ 3. ( 4% ) What protocol is used on the Internet to ensure in order error free delivery of packets? ( answer using the acronym ) __________________________ 4. ( 4% ) Because of this hardware unit in the Pi's processor each process gets its own memory address space, but it also prevents a user program from directly accessing the Pi's I/O hardware registers. ( answer using the acronym ) __________________________ 5. ( 4% ) The CSI camera interface on the Pi Zero W in addition to high-speed parallel pixel data lines contains this type of other interface standard that is used to send the camera commands and read camera status ( acronym ) __________________________ 6. ( 4% ) What is the maximum voltage allowed on the Pi's digital input pins? __________________________ 7. ( 4% ) Node Red’s development was supported for IoT devices by this cloud service company ( companies’ acronym ) __________________________ 8. ( 4% ) Which I/O library was used to write to I/O registers to blink the LED using C/C++ on the Pi in the lab 4 code __________________________ 9. ( 4% ) In Windows using C/C++, what "filename" C style string would be used to open the USB virtual com port to an mbed that was using "COM32" (do not include the things needed to convert the string to UNICODE - just the C string part needed inside the API file name argument) __________________________ 10. ( 4% ) What is Microsoft's name for C#'s equivalent of Java's virtual machine (i.e., machine not byte code language)? __________________________ 11. ( 4% ) What is the term used for the simplest technique used to write a new I/O device drive in Linux and Windows? _____________________________________ 12. ( 4% ) What is Microsoft’s name of the process that supports a C# program calling C++ code? _________________________________ 13. ( 4% ) In Win32 C/C++ APIs, what is the name of the function used to setup and start threads? ( name only don't list arguments or include parenthesis ) __________________________ 14. ( 4% ) A semaphore initialized to this value functions like a mutex lock, but the code in most implementations is slower. __________________________ 15. (4%) How long is the mbed RTOS time slice (just write exact numeric value)? __________________________
16. ( 40% ) Add the remainder of the code needed for the mbed RTOS temperature display described on the last page of the test.
Name:_________________________________________ Additional Details for Problem 16 The mbed, LCD, temperature sensor, speaker with the Class D amp, and a pushbutton from the parts kits used in your lab projects are used to build a high/low temperature display with an 800hz freeze alarm (i.e., alarm sounds when <32 F). A photo of how your LCD display should be setup is on the left. Note that all temperatures are displayed in Fahrenheit. Recall that F = 9/5*C+32 . All temperatures are displayed as three-digit integers. The second line in the display “XXX F” is the temperature reading from the sensor. “Max XXX” is the highest temperature ever read since power, on and “Min XXX” is the lowest temperature ever read since power on. Write the additional mbed C++ API RTOS code on the previous page for problem 16 that is needed after the template I/O starting code provided below. Additional software requirements for your code solution are listed after the template code below. //Template starting code – do not copy this code over to problem 16 space!!! #include "mbed.h" #include "rtos.h" #include "uLCD_4DGL.h" #include "PinDetect.h" uLCD_4DGL uLCD(p28,p27,p29); // uLCD serial tx, serial rx, reset pin; AnalogIn TMP36(p17); //temperature sensor input DigitalOut led(LED1); //blinking LED - changes state every .5 seconds PinDetect pbd1(p8,PullUp); //debounced pushbutton using interrupts PwmOut speaker(p21); //speaker for freeze alarm – use 800hz for tone //add additional code here in the space provided in problem 16………………… Additional Software Requirements: Required names for C++ variables and functions used in your solution are shown below in bold type. First, declare three global variables, alarm_enable a type Boolean flag with the initial value set to false, and three integer variables, temp, max_temp , and min_temp all initialized to zero. All of these variables will be used by more than one thread and/or interrupt callback routine. Add other synchronization objects or global variables, only if needed. Write the code for the pbd1 pushbutton callback, pb_hit . This code just flips the alarm_enable flag whenever the pushbutton is hit. Add the function code for the following four threads: 1. MaxTemp: Prints max_temp on LCD line 4 col 1 text in red no more than once every five seconds. See photo for format. 2. MinTemp: Prints min_temp on LCD line 6 col in blue no more than once every five seconds. See photo for format. 3. Blink: Flips LED1 two times per second. (i.e., Just blinks and shows RTOS threads are running) 4. Alarm: Outputs an 800hz speaker tone when alarm_enable true and temperature is below 32. Runs once every 5 seconds (so alarm sounds for at least 5 seconds even if the pushbutton is hit or temperature changes). In main, setup for double size text on the LCD and print “Temp Disp” on the top of the LCD using white text. Initialize other hardware setups as needed. Set min_temp and max_temp to the current temp ( in F ) . Start the remaining threads. Then in an infinite loop, read current temp , print temp on LCD in 2X green on line 2 (see photo), and check for new min_temp or max_temp value and update these with new values as needed. This loop should run no faster than once per second.
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help