LAB 3: PWM and Timer: 2.1 Tool Requirements
LAB 3: PWM and Timer: 2.1 Tool Requirements
In this lab, you will learn how to use Pulse Width Modulator (PWM) unit to control a motor
driver. You will also investigate the applications of timers.
1 Lab Objectives
2 Pre-Lab
Get yourself familiar with the architecture of PWM and general purpose modules.
Read chapter 9 and 18 of Stellaris LM3S9B92 datasheet to learn how to setup PWM and
Timers.
3 Lab Procedure
Create a new project and add all resources you are using in this lab.
In order to change the speed of motors you can use MotorSpeed(). In this function, find the
actual values of register that sets pulse width for both motors.
Toggle LED in the interrupt handler. You can use TIMER_0 in full-width mode to
generate longer delay. Use functions in \StellarisWare\driverlib\timer.c. Some example
codes demonstrating application of timers are available at:
\StellarisWare\examples\peripherals\timer
Note : Ensure timer interrupt flag is cleared after running interrupt handler.
Make LED blink while robot is turning left (section 3.3).
5 Lab Report
Include the following items in your report:
Answers to Questions
Create a zip file for your codes for Sections 3.1, 3.2, 3.3 and 3.4 and email it to the
TAs along with the report.
6 Documents
There are many useful documents you will need as references for this lab including:
o Stellaris Robotic Evaluation Board (EVALBOT) User's Manual This document
contains all the information about the EVALBOT you will be using, some of which will
be reproduced here. Designated spmu166 and available at the following URL
http://www.ti.com/lit/ug/spmu166/spmu166.pdf
o Stellaris LM3S9B92 Microcontroller Data Sheet - This document contains hardware
information about the LM3S9B92 device itself and its specifications. In this document
you can also find all registers, modules and peripherals information.
http://www.ti.com/lit/ds/symlink/lm3s9b92.pdf
o Stellaris Peripheral Driver Library Users Guide This document describes set a set
of drivers for accessing the peripherals found on the Stellaris family of ARM Cortex M
based microcontrollers.
http://www.ti.com/lit/ug/spmu019m/spmu019m.pdf
o DMOS Full-Bridge Motor Driver (DRV8801) Data Sheet This document describes
how to control dc motors by using pulse width modulation with DRV8801.
http://www.ti.com/lit/ds/symlink/drv8801.pdf