EE 476: Laboratory 1
Introduction to the lab hardware/software.
This assignment introduces you to the software and hardware development tools
you will use this semester to work with the Atmel AT90-series microcontroller
The hardware you will be using to
support the AT90-series is the Flash MCU evaluation board, a small board providing:
- A target AT90-series microcontroller (mcu) with onboard flash program memory.
- A programmer for the target flash memory, including a serial connection
to a PC.
- Eight general pushbuttons, eight LEDs and a RESET button.
- A serial connection for applications.
- Connectors for bringing out the microcontroller signals to user-designed
peripheral equipment. Note that there is no protection on these lines. You
are connecting directly to the mcu. Prudent design suggests you might want
to use buffers when you are uncertain of voltage levels or other conditions.
The pin definitions for the connectors are shown below. The inner squares
represent pins. The outer border is a white line surrounding the plug.
A small power supply provides power to the development board.
Software you will use consists of:
- Make sure the evaluation board is connected to power and to the PC as specified
in the evaluation board description. Turn on the power supply with the switch
on the board. An LED in the middle of the board should cycle from red to yellow
to green. For this first lab, there should be jumpers on the PortB to the
LED header and on PortD to the switch header. Ask your instructor for help
if these are not installed.
- Make a subdirectory for your group in the
My Documents folder.
Name it with your netid. Be sure to put all your files there and to back
- There should be a shortcut to Codevision C on the desktop.
- After you define a new project, you can add a C source file and edit it.
For now, save this code (from the Program
Organization page) into your directory and add it to the project you just
- Click on the compile icon. A message window will open to tell you if there
are errors in the code. If there are errors, The open the listing file to
see where they are. If the compile is successful, you should be able to download
the program to the STK500 board.
All timing must be done with interrupt-driven hardware timers and not with
software wait-loops. Each of the following modifications should be saved separately
for demonstration. All programs must be in C.
Be prepared to demo the programs you wrote to your TA in lab.
Modify the program you were given to count up at one count per second
only when switch0 is pressed and held. The LED displayed count (0 to 255)
should stop counting and hold its value when the switch is not pressed.
Modify the program to cause the LEDs 0-6 to count up in binary from 0x00
to 0x07F and back down to 0x00 again, and repeat indefinitely. The count
rate should be 10 per second. Also, LED 7 should blink at a rate of one
Your written lab report should include:
- How accurate was the interrupt time base in the program
you were given? How could you make it
- Why did we make you use interrupts rather than wait-loops?
- The listings of your programs.
Copyright Cornell University Jan 2002