Docsity

Serial Data Frames - Introduction to Microprocessor Systems - Home Work, Exercises of Computer Science

Toggle sidebar
bg1
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.
2. (10 points) Asynchronous Serial Communications: Suppose that you connected a signal
generator producing a 24VPP rectangular wave at a frequency f = T-1 = 800Hz to the serial data
input of an RS-232 port on a PC. The waveform has a duty cycle of 33.3% and repeats without
end.
T
-12V
+12V
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 I2C. (In fact, the ADuC7026
has two I2C peripherals.) You can find numerous online references about I2C. In one or two
paragraphs, describe the basic characteristics of the I2C interface. Also, answer the following
questions;
Is I2C 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 I2C 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
Docsity.com
pf3
pf4

Partial preview of the text

Download Serial Data Frames - Introduction to Microprocessor Systems - Home Work and more Exercises Computer Science in PDF only on Docsity!

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.

  1. (10 points) Asynchronous Serial Communications:** Suppose that you connected a signal generator producing a 24VPP rectangular wave at a frequency f = T-1^ = 800Hz to the serial data input of an RS-232 port on a PC. The waveform has a duty cycle of 33.3% and repeats without end.

T

-12V

+12V

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 lowercaseuppercase and uppercaselowercase 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 ViewSerial WindowUART #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;

  1. Explain how you determined the values in your look-up table. Provide the equation that you used to determine the LUT values, i.e. the function f in LUT[i] = f (i).
  2. There are essentially two ways to get the two amplitudes needed; either put the 2.2V amplitude in the table and divide by 2 to get the 1.1V amplitude, or put the 1.1V amplitude in the table and multiply by 2 to get the 2.2V amplitude. Which way did you choose to do it, and why?
  3. Estimate what percentage of available CPU time is being used to generate the output signal. Explain how you arrived at your answer. Show calculations to support your answers where appropriate.

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.