EE 476: Laboratory 1

Introduction to the lab hardware/software.

Introduction.

This assignment introduces you to the software and hardware development tools you will use this semester to work with the Atmel AT90-series microcontroller (MCU) chips. You will interface an LCD display to the MCU and program a small state machine to count up/down.

Hardware

The hardware you will be using to support the AT90-series is the Flash MCU evaluation board, a small board providing:

A small power supply provides power to the development board. The two demo codes given in this lab are written for the Mega163, but many of the examples throughout the 476 web site are written for the 8515 mcu. This year we are using the Mega163 which has more memory and A/D converters. To run the 8515 example programs you will need to:

The Liquid Crystal Display (LCD):

A 16 character, two line (16x2), LCD display be used as a numerical display. The display we are using has an industry-standard interface. A more detailed data sheet for a similar display shows the command set. There are several aspects of the display you should note:

Software

Software you will use consists of:


Procedure:

  1. 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.

  2. 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 up daily!.

  3. There should be a shortcut to Codevision C on the desktop.

  4. After you define a new project, you can add a C source file and edit it.
    1. Save this code (from the Program Organization page) into your directory. This program blinks LEDs and responds to buttons. It is organized as three task subroutines. You will modify this code in the assignment below.
    2. Under the Project menu, choose Configure... , then in the Files tab, add the source code to the project you just defined.
    3. In the Compiler tab, set the Chip type to Mega163. Also set (s)printf features to int,width.
    4. In the After make tab, set the Program the Chip checkbox, then set CKSEL0 and CKSEL2. Then close the configure dialog.
    5. 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 and see some blinking LEDs.
  5. Connect the LCD and run the LCD test program.


Assignment

  Be prepared to demo the program you wrote to your TA in lab.

Your written lab report should include:


Copyright Cornell University Jan 2003