Exam1 sample - Name:_ Exam #: <- RECORD YOUR EXAM...

Info iconThis preview shows pages 1–5. Sign up to view the full content.

View Full Document Right Arrow Icon
Name:______________________________ SHOW ALL WORK page 1 of 9 Exam #: <--- RECORD YOUR EXAM NUMBER! Embedded Control Laboratory Sample First Exam - Fall 2006 SHOW ALL WORK! OPEN BOOKS / OPEN NOTES Section: _____ Lab Time: ______________________ Your Grading TA: ______________________ Question # Point value Mark Grader 1a 3 1b 6 1c 8 2a, 2b, 2c 10 2d, 2e 14 2f 9 TOTAL 50
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Name:______________________________ SHOW ALL WORK page 2 of 9 1) (17 points) Use the following schematic to complete this problem. Answer the following questions based on the schematic shown above. a) (3 points) Write a function called “Port_Init” which correctly configures the ports for input and output. You must not use any global variables in this function. Code Comments/Pseudocode void Port_Init(void) { } (P2.1) 74F365 Buffer (P2.3) 2 4 10 3 5 9 +5V 1 k Ω (P2.5) Push Button 1 (P2.0) C8051 EVB Connector (P2.4) 67 (P2.2) +5V 1 k Ω Push Button 2 Bi-Color LED (BLED1) 510 Ω Bi-Color LED (BLED2) 510 Ω (PB1) (PB2)
Background image of page 2
Name:______________________________ SHOW ALL WORK page 3 of 9 b) (6 points) Write a function called “pushButton” which returns 0 if none of pushbuttons is pressed, 1 if only “Push Button 1” is pressed, 2 if only “Push Button 2” is pressed, and 3 if both push buttons are pressed. Specify global variables outside of the function, if needed. Code Comments/Pseudocode /* write global variables if used */ unsigned char pushButton(void){ }
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Name:______________________________ SHOW ALL WORK page 4 of 9 c) (8 points)
Background image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 9

Exam1 sample - Name:_ Exam #: &lt;- RECORD YOUR EXAM...

This preview shows document pages 1 - 5. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online