Iowa State University

CPRE 288 Laboratory


Lab 5: Interupts

Lecture - Lab Connection

In lecture, you have studied the use of GPIO and interrupts. In this lab, you will use these hardware features to interface with push buttons using interupts. In this lab you will also configure the GPIO portion of the UART device

Prelab

  • Read through the lab description
  • Skim the reference documents below. Browse the table of contents of the Tiva TM4C123GH6PM Datasheet chapters 1, 10, 22 and 23. Chapter 10 covers the GPIO module. Similar information is covered in the textbook (e.g., chapter 2, sections 2.6.1, 2.6.2.3, 2.6.3; chapter 4, sections 4.5.7.1-4.5.7.2.4; chapter 7, sections 7.1-7.3). Note: Your goal is to be aware of information so that you can find and read it in more detail if and when needed.
  • Scan Sections 5.1 – 5.3 of the textbook to get a sense for were to find details about interrupts.
  • Read through the source code for botton.c & lab5_template.c.

Reference Documents

All reference documents are also available on the Resources page of the course website.

Reference Files

Download the following files to a single folder your U: drive. (Right-click and select 'Save Target As')

You'll need to put a copy or your button.h and button.c from last lab into this project.

  • lab5_template.c: The skeleton code to implement lab 5.
  • lcd.c: A program file with a number of LCD functions
  • lcd.h: The header file for lcd.c
  • Timer.c: A program file with wait functions
  • Timer.h: The header file for timer.c
  • button.c: This file contains functions which you must implement if you want to read buttons.
  • button.h: The header file for button.c
  • cyBot_uart.h: Header for pre-compiled CyBot/Human UART communication
  • libcybotUART.lib: Pre-compiled Library for CyBot/Human UART communication (Note: Must change extension from .txt to .lib after copying, Do not try to open file as it will corrupt the file causing a Linker error)
  • cyBot_Scan.h: Header for pre-compiled sensor scanning
  • libcybotScan.lib: Pre-compiled Library for sensor scanning (Note: Must change extension from .txt to .lib after copying, Do not try to open file as it will corrupt the file causing a Linker error)
  • Servo Calibration Reference Sheet: Directions for how to calibrate the sensor servo for your specific CyBot

Notes

None.


Lab 5 Description

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

Cautions

Turn the power to the cyBOT platform off before charging. The Launchpad board consumes power and the battery will not charge if the robot is in full_mode (which it enters after calling oi_init, turning the power LED yellow). You will have to turn off open interface. 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 TM4C1236GH6PM Datasheet Information about the Tiva TM4C1236GH6PM Processor
Documentation on printf Documentation for the lcd_printf and printf function.
Online Feedback Form Tell us what you think of the lab (feedback forms)