


Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!



Spring 2012 (Morrow) 1
1. (10 points) Serial Data Frames Draw the 11-bit (8 data, odd parity, 1 stop) frames for the asynchronous transmission of the ASCII character ‘ Z ’ and the ASCII BEL character. **Note: Clearly indicate bit intervals in the waveform.
Assume that the serial port UART is set up for 1 start bit, 7 data bits, a parity bit, and one stop bit at 4.8k baud. (You may assume that the signal generator output initially starts at -12V as shown.) Include a diagram clearly indicating how the waveform is interpreted. Do any framing errors occur? What type of parity (odd or even) must be expected in order to receive the waveform without a parity error? How many characters will the UART receive per second? [A framing error is caused by an invalid stop bit value. Assume (correctly) that a UART will not normally interpret an invalid stop bit as a start bit; it will still wait for the stop bit period before sampling for a start bit.]
3. (15 points) Synchronous Serial Communications One synchronous serial interface that you will likely encounter is I^2 C. (In fact, the ADuC has two I^2 C peripherals.) You can find numerous online references about I^2 C. In one or two paragraphs, describe the basic characteristics of the I^2 C interface. Also, answer the following questions; Is I^2 C a standard? If so, whose standard is it? What constitutes a device being a master or a slave? If two devices try to write on the I^2 C bus at the same time, can damage occur? How would a device recognize that a collision occurred? What is clock stretching? 4. (15 points) UART Operation Write a program that will configure the ADuC7026 UART for operation at 115200 baud, 8 data bits, no parity, 1 stop bit, using pins P1.0 and P1.1. Map the UART interrupt to FIQ mode. The UART should only generate an interrupt when data is received.
The basic function of the FIQ exception handler is to simply echo any received characters by sending them out the transmitter. However, certain character strings (escape sequences) will be
Spring 2012 (Morrow) 2
used to modify how the ISR treats specific characters. The escape sequence strings themselves should not be echoed. Your ISR code must support the following requirements: “\U” – always convert lowercase (a-z) to uppercase (A-Z) “\u” – stop converting lowercase (a-z) to uppercase (A-Z) “\L” – always convert uppercase (A-Z) to lowercase (a-z) “\l” – stop converting uppercase (A-Z) to lowercase (a-z) “\n” – stop echoing numbers (0-9) “\N” – start echoing numbers (0-9) A “\” followed by any other character must be ignored, and neither character should be echoed. Any other characters are simply echoed without modification.
Note that the lowercaseuppercase and uppercaselowercase conversion requirements are independent of one another. Your ISR must keep track of which conversions are in effect. Your program should start with conversions turned off and numbers being echoed. An example input stream and corresponding output stream are shown below.
Input: Aa0\UBb1\LCc2\uDd3\l\nEe4\Ff5\Gg6\NHh Output: Aa0BB1cC2dd3EefGgHh
Note that once the UART is configured and operating, the main program should stall in a spin loop and all activity will take place in the FIQ interrupt. Your FIQ exception handler must be written with no knowledge of what the target string is or how long it is, but it can (and must) assume that the target string will always have a null terminator.
Use the sample Keil uVision project posted on the web site as a starting point. To send data to your serial port, select View Serial Window UART #1 from the Keil menu, and type the data into the terminal window.
Important: Submit ONLY your program source code files teamXp4_main.s and teamXp4_exceptions.s using the homework #7 dropbox in Learn@UW. Also, submit a paper copy of teamXp4_main.s and teamXp4_exceptions.s with the rest of the assignment.
5. (10 points) DAC Errors The output of a 3-bit DAC is tested for all input codes, with the results as shown below. Code 0 1 2 3 4 5 6 7 Output 0.20V 1.10V 2.85V 4.00V 5.00V 6.25V 7.70V 8.90V
Assuming that the nominal full scale voltage output is 10.0V, find the following; a) offset error b) gain error c) DNL error at each step d) INL (worst case) Show your work, and express all answers in terms of lsb’s (least significant bits), not voltages. Is this DAC monotonic? How do you know?
Spring 2012 (Morrow) 4
You can use the Keil debugger’s Logic Analyzer function to view both the DAC0DAT contents and the DAC0 pin voltage over time – if your code is working correctly, you will see the sinusoid displayed there.
Answer the following;
Important: Submit ONLY your program source code file teamXp7_main.s and teamXp7_exception.s using your homework dropbox in Learn@UW. Also, submit a paper copy of teamXp7_main.s and teamXp7_exception.s with the rest of the assignment.
8. (10 points) Exam Question Design an original final exam question operating at Bloom’s Taxonomy level 3 for material covered in any of the course modules. You must test one of the module objectives in a specific problem, with a level of difficulty appropriate for a cumulative final exam. Specifically identify the objective that you are testing for, and provide a complete solution to your question.