FinalExam_Sample_2022

pdf

School

Pennsylvania State University *

*We aren’t endorsed by this school

Course

200

Subject

Electrical Engineering

Date

Feb 20, 2024

Type

pdf

Pages

7

Uploaded by ElderRabbitPerson19

Report
1 EE200 Final Exam Sample Spring 2022 Instructions and Policies: 1. You must bring your PSU ID card with you to the exam. Show your PSU ID card to the proctors when you submit your exam. 2. You have 110 minutes to complete this exam. 3. Warning: DO N OT put any answers in the code packet! Use the space provide in the exam itself. However, feel free to write in the code packet in the process of analyzing the code. 4. You are allowed one 8½” x 11” note sheet; you can use both sides of the page. The note sheet must be handwritten by you. Your name, PSU user ID, and lab section number must be in the upper left corner of one side of your note sheet. You must hand in all the exam booklet, code packet, datasheet, and your handwritten notes by the end of the exam. 5. This exam is closed book and closed note. You are only allowed to have one 8.5” x 11” handwritten note sheet, writing implements, and a purpose-built calculator. During the exam, you may not communicate with anyone other than the instructor and TAs. 6. Use of books, laptops, tablets, pads, cell phones, smartwatches, etc., is strictly prohibited during the exam. You must turn off all phones, smartwatches, and other mobile devices. 7. There may be partial credit for incomplete answers; write as much of the solution as you can. 8. You must show all of your work for a problem. Answers without derivations may receive no credit. 9. You must complete the exam within the time limit. You must stop writing when the time is up. 10. Any cheating will be reported to the university and result in failing the course. Problem Weight Score 1 25 2 25 3 25 4 25 Extra Credit 10 Total 100
2 Problem 1 (25 points) 1.1 (10 points) Refer to the CUPL code shown in Figure 1.1 in the code packet . Draw a state transition diagram that represents the behavior of the Moore finite state machine (FSM) implemented in the CUPL code. 1.2 (7 points) Figure 1.2 shows uncompleted Test vectors. Using the code from Figure 1.1 and the input signals, draw the output signals. Figure 1.2.Test vectors for Problem 1.2. - ABC ABC - > B c So -- St ABC - B ~ ! * BC S3 S2 & -- Des - AB * B PINA PINS PIN2 PIN3 PIN4 PIN 23 PIN2Z PIN2) L = locked = 0 LI uncuch =
3 1.3 (8 points) In Lab 24, we used pulse width modulation to control the intensity of a LED. The part 2 circuit diagram is shown in Figure 1.3 below . Assume that the PWM voltage is 3.3 V when the output from the dsPIC is high and 0 V when the output from the dsPIC is low. Also, assume that the LED is ideal and has a forward voltage drop of 1.6 V when it is illuminated and that no current flows through the diode when it is not illuminated. Determine the average power dissipated in the 330 Ω resistor when the PWM duty cycle is 40 %. Figure 1.3. The connection for the LED that was used to demonstrate PWM in Lab 24. PWM1H 1 2 3 4 5 6 7 8 9 10 11 12 13 14 28 27 26 25 24 23 22 21 20 19 18 17 16 15 dsPIC33EP64MC502-I/SP 330 ss v to myDAQ AI 1+ to myDAQ AGND AND AI 1- LED Fractional Duty Cycle = D = 0 DE PMW = 3 . 32 output = high PMW = O outlet = low L ED E ! GV Circuit for 'ont Okt Of 3302 330c2 - - LVR 1 + Ov Tr T T VPin25E . Ved E16 - - IRI0A VRIOV AVL - > - Vpingt VR + VIED = 0 - 3 . 3 + VR + 16 V = 0 401100D D = 0 . 4 VR = 1 . ZV (P) = + So PH) Ot o . 45 H - St Craft = So = out + I to ot = 0 . 4 x 87 -
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
4 Problem 2 (25 points) 2.1 (12 Points) The PWM module on the dsPIC33EP64MC502 micro-controller provides a convenient tool for realizing a square-wave generator whose frequency can be set by the user. Rotating the encoder shaft clockwise increases the frequency while a counterclockwise rotation decreases the frequency. The frequency must be a linear function of the counter increment. Assume that the count is stored in the register POS1CNTL. Three complete clockwise rotations of the encoder shaft must map the square-wave frequency from 5 kHz to 12 kHz. Specify an equation for PTPER. To receive credit, show appropriate calculations . PTPER = ________________________________________________________; Maximum Count = 24 43X4- = 287 7 . 37 MH7 PT PER = g(HF) Moscovir Fred / PTPER
5 2.2 (13 Points) Refer to Peripheral Pin Select feature in the datasheet. An interrupt is a signal that commands the microcontroller to immediately execute a sequence of code known as the interrupt service routine (ISR). The C code can utilize a hardware triggered interrupt. The inputs of the peripheral pin select options are mapped on the basis of the peripheral. That is, a control register associated with a peripheral dictates the pin it will be mapped to. 2.2.1 (6 Points) Write a single line of code to Assign INT2 to pin 24. To receive credit, show the analysis leading to your result. ________________________________________________________ 2.2.2 (7 Points) Describe what the Peripheral Pin Select feature is, and why it is needed for the dsPIC33EP64MC502ISP microcontroller. 45 - > binary /2 42/2 22 2212110e -00110 11/2 S & 1/2 0 O - RPINR) 60CS . INTERI OXID ,
6 Problem 3 (25 points) 3.1 (12 points) In C code the variable A is defined as int A = 0b00101100; 3.1.1 (4 points) Write the value of the variable B, in hexadecimal form, after the following code executes B = A | 0xF0C0; 3.1.2 (4 points) Write the value of the variable C, in hexadecimal form, after the following code executes C = A << 2; 3.1.3 (4 points) Write the value of the variable D, in hexadecimal form, after the following code executes D = A ˆ 1 . 3.2 (6 points) Write the comments directly below and NOT in the code packet , for Lines 40 and 44 in Figure 3 in the code packet. Line 40: Line 44: 3.3 (7 points) Line 41 in Figure 3 in the code packet has blank spaces indicating incomplete portions of that line of code. Complete Line 41 to place an e in LCD cell 0*00. To receive credit, show the analysis leading to your result. _____________________________________________________________ Place Cursor in LCD Cell 0x00 wart for 100mS
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
7 Problem 4 (25 points) 4.1 (10 points) For this question, you are using the ADC module on your microcontroller. Assume that the sensor’s output voltage is connected to AN0 on the dsPIC microcontroller. Line 47 in Figure 4.1 in the code packet has blank spaces indicating incomplete portions of that line of code. In the space directly below and N OT in the code packet, complete line 47 with an equation that will convert the ADC 12-bit integer into a voltage. Assume that V refL = 0V and V refH = 3.3V. To receive credit, your answer must be in syntactically correct c code . Vmeas = ________________________________________________________; 4.2 (15 points) LabVIEW code in Figure 4.2 in the code packet is designed to receive an input value from the user and display that value and its square on the LCD screen. Match one of the block diagrams shown in the code packet in Figures 4.3 4.6 to the subVI names found in the code given in Figure 4.2 of the code packet. Indicate in a sentence whether the code will correctly implement the functionality indicated by its name. 4.1.1 Figure 4.3 block diagram A _______________________________ 4.1.2 Figure 4.4 block diagram B _______________________________ 4.1.3 Figure 4.5 block diagram C _______________________________ 4.1.4 Figure 4.6 block diagram D _______________________________