Pages created and updated by Terry Sturtevant Date Posted: May 12, 2017


CP/PC364 Data Communications and Networks Laboratory

Universal Asynchronous Receiver Transmitter (UART)

Overview

This week's laboratory investigates RS-232 (or EIA 232) communication.

Background

The RS-232 protocol has been around since 1962. Originally designed to basically connect a single "smart" device to a single "dumb" device, it is now still very commonly used to connect sensors to microprocessors or microcontrollers, and so will remain relevant for the forseable future. It's also one of the simplest serial protocols, and so it's easy to study. The Arduino board has a UART built-in, so it can be used to study RS-232 communications. Note: The UART pins on the Arduino will be at TTL levels, not at acceptable RS-232 levels.

Objectives

  1. Become familiar with the hardware layer of UART.

Equipment

Exercise

  1. Look at a very simple Arduino serial communication example.
  2. Connect the Arduino to the oscilloscope, using one channel for each of the TxD and RxD signals.
  3. Modify the simple example to repeatedly send a character out from the UART.
  4. Watch the signals on the scope and identify the transmission of a single character. Sketch the signal or print it.
  5. On the sketch, identify the start bit(s), stop bit(s), and the character bits to show how the character can be decoded from the signal. If you're not sure which end of the pattern is the beginning and which is the end, change the character being sent to clarify.
  6. On the sketch, show the time scale and explain how it relates to the baud rate. (i.e. Identify how the time for one bit is determined from the baud rate.)
  7. Note: The Arduino uses the serial port internally, so while you are programming you can't have the pins tied to each other or some other device. Only make those connections after you have finished uploading. (The next lab will show you how to solve this problem.)
    Connect the Tx and Rx pins of your Arduino so it communicates with itself. Write a sketch to send a character every second and display received characters on the LCD.
  8. Show your pin assignments on the diagram.
Demonstrate and explain your results to the lab instructor

Resources

To view pdf documents, you can download Adobe Acrobat Reader .
get Acrobat Reader
If you need to update a browser, you might try Firefox which is Get Firefox!
Since this page uses cascading style sheets for its layout, it will look best with a browser which supports the specifications as fully as possible.

If you are looking for an office package, with a word processor, spreadsheet, etc., you might try LibreOffice which is Get LibreOffice!

Go to the main page for the Department of Physics and Computer Science.

Valid XHTML 1.1

Valid CSS!

WCAG
2.0
(Level AA)

Wilfrid Laurier University