EE 281 Lab 1: Getting Started
The Lab 1 handout gives the basic outline for completing the assignment, but
here is additional information to accompany the handout.
- Using AVR Studio:
If you want to start working from a computer other than
the lab, you must install the AVR Studio software for writing/debugging your
code. AVR Studio lets you assemble your code for downloading to a
development board, but it will also allow you to simulate the code on your
PC. AVR Studio can be downloaded from here: AVR Studio 3.52 IDE
- Creating a new
project: Select New
from the Project menu in AVR
Studio (Project->New).
After specifying a project name and an appropriate location (the directory
containing the .asm and .inc files) , select AVR
Assembler from the Project Type
box.
- Adding source file
to project: Select Add File
from the Project menu in AVR
Studio (Project->Add File...)
and specify the location of the .asm file. (You might also want to
add the .inc file if you want to take a peek at its
contents).
- Assembling your
code for Simulation: If you want to assemble your code
for simulation in AVR Studio (without using the actual development
board), you need to make sure that the proper output file format is
specfied. Select Project Settings
from the Project menu and
specify Object format for AVR Studio
in the Output file format drop-down
list. To run a simulation, select Build
and Run from the Project menu.
A Simulator Options dialog box should appear, from which
you should chose AT90S8515 to match
the processor used on the development board. You will then be able
to step through your code for testing.
- Assembling your
code for Downloading to the development board: If you
want to assemble your code for downloading to the development board,
specify Intel Intellec 8/MDS (Intel Hex)
in the Output file format
drop-down list. To perform the assembly, select Assemble from the Project menu (or use the shortcut key F7).
This generates a .hex file that can be downloaded to the
development board using the STK500 programmer built into AVR Studio (as
described below):
- Programming the STK500
Using AVR Studio:
In order to program the processor on the STK500, you must
first connect the serial cable from the development kit to the serial port of
your PC. The programming tool for
the STK500 can then be accessed by selecting STK500/AVRISP/JTAG
from the Tools menu in AVR
Studio (Tools->STK500/AVRISP/JTAG ICE). This will pop up an STK500 dialog box. If the serial cable is connected properly, the bottom of the
dialog box should indicate that the STK500 was found by the software (example:
“Detecting.. STK500 found on COM2:”).
You will then need to make sure that the proper options are selected, as
described below:
- Selecting the
proper device: Under the Program tab
of the STK dialog box, select AT90S8515 from the Device
drop-down list.
- Setting the proper
programming options: Also under the Program
tab, check the Programming mode options. Select the following options: ISP, Erase
device before programming, and Verify
device after programming.
- Selecting the
proper input file for programming: Under the Flash
heading, browse to the location of the .hex file that AVR Studio has generated
upon assembly of your code.
- Programming the
development board: To program the board, click on Program under the Flash
heading. This should program
the board and let you know if the operation was performed properly.
- Troubleshooting Tips:
Some tips that may be of some help:
- Can’t find .hex
file for downloading: Read the “Assembling your code for Downloading
to the development board” section above.
- Problems writing to
the device: Make sure that no other application on your system
is using the COM1 (or COM2) port. Check that the proper options have been
selected (as described above).
Advanced: If that doesn’t help, check under the Board tab
of the STK dialog box for the Oscillator setting. It should be set at something
like 3.69 MHz. Also, make
sure that the OSCSEL jumper connects pins 1 & 2 (moved to the right,
toward the power connector).
- Device writes OK,
but code doesn’t work: Make sure that the proper cables are connected
for Lab1: A 10-pin cable
should connect the Switches connector to the Port D connector and another
cable should connect the Port B connector to the LEDS connector on the
STK500. This is to match the
blink.asm code and this is how the board should have been configured when
you received it.
- E-mail the TA if you have further
questions: This information was intended to help you get started with
the basic tools needed to perform Lab 1. If you have further
questions or if you find errors in this write-up, please notify the TA.
Last modified: Mon Oct 01 22:12:03 PDT
2001