Iowa State University

CPRE 288 Laboratory


Lab 5: Serial Communications Using UART

Lecture - Lab Connection

In lecture, you have studied the use of the UART. In this lab, you will use the UART to perform simple serial communication with your desktop computer.

Prelab 

  • Read the lab description as well as the data sheet for the TM4C123GH datasheet related to UART. Tiva TM4C123GH6PM datasheet
  • Draft the code. The code need not be complete, and you don't have to compile or execute it before coming to the lab. Attempt to draft some code to show your TA.
  • Print the Lab Evaluation Form, so that your TA can check off work performed during this lab session.

Answer the following questions in preparation for the lab (refer to the Tiva datasheet (datasheet)and/or textbook as needed):

  1. What UART registers are relevant to this lab? [2 points]
  2. What is the value to be loaded into the IBRD and FBRD registers for a baud of 9600? [2 points]
  3. How many UARTs are there on the TM4C123GH6PM? Which one will you use to communicate between the microcontroller and your Desktop computer? (read below) [1 point]

Reference Files

Download the following files to your project folder on your U: drive.

  • timer.c/timer.h: The file that contains utility functions for the cyBOT platform.
  • lcd.c/lcd.h: The program file with a number of LCD functions.
  • uart.c/uart.h: Skeleton code for you to implement.

Lab 5 Description

  • Lab 5 Manual: A detailed description of the objectives to complete for Lab 5

Cautions

Turn the power to the Cerebot board and iRobot off before charging. The Cerebot board consumes power and the battery will not charge if the robot is in full_mode (which it enters after calling oi_init, turing the power LED yellow). The robot is charging when the robot's power LED is pulsing red and both green LEDS on the dock are lit.

Reference Files

Files Description
Tiva TM4C123GH6P datasheet.pdf Information about the TM4C123GH6P
Documentation on printf Documentation for the lprintf and printf function.
Lab Evaluation Form Evaluation form for Lab
Online Feedback Form Tell us what you think of the lab (feedback forms)