Table of Contents

Lab 2: Bouncing Lights

Overview

The purpose of this lab is to gain some experience with branching, loops, and the bit instruction set.

Lab activity

In this lab, you will design, code, assemble, simulate, download and run a program. The program must produce the ”Knight Rider” effect. Specifically:

  1. Begin with all but the left most LED off.
  2. Continue moving the lit LED to the right. (Turn on the neighbor to the right and turn off the current LED.)
  3. Once the right most LED has been reached, repeat the process in the opposite direction until it reaches the left most position.
  4. Repeat forever

Notes:

Simulation and Debugging in AVR Studio

Build the project in AVR Studio. Once built successfully, set a breakpoint on the first instruction in your program. Next, select the “Start Debugging” command from the Debug menu; the program will start to execute, but will stop on the breakpoint you just set. While simulating, you may wish to comment out the delay loop code. Verify that exactly one LED is on at all times the program is running.

Test-run your program in AVR Studio debugger in order to verify that it runs as expected.

Execution and Debugging using ATmon

Download your program to the microcontroller using ATmon with the commands introduced in Lab 0.

Demonstrate the program and to your instructor.

FAST Data

You should indicate how much time (in minutes) you spend on this assignment in the FAST database. You are encouraged to log your activity as you work on the project. At a minimum, you should log all of the time spent on this assignment before the due date given above. All time spent on this assignment should be entered into the week 3 column (even if you worked on it in week 2 or 4).

Lab Deliverables

You should follow your instructor's instructions for your lab submission.

Taylor

If you have any questions, consult your instructor.