EE 476: Laboratory 1

Reaction Time Tester.

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 use the STK500 development board to build a human reaction time tester. The STK500 pushbuttons, an external LCD, and the mcu will be used to see how fast you can push a button after a light flashes.


Procedure:

  1. 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. In the Codevision file menu choose to make a new file. When the prompt comes up, choose Project. When asked if you wish to use CodeWizard, decline the offer. At this point, you have made a new project, now you need to configure it. The configure dialog should be open but if it is not, under the Project menu, choose Configure...
    3. In this dialog box, in the Files tab, add the source code to the project you just defined.
    4. In the Compiler tab, set the Chip type to Mega32.
      Set clock speed to 16 MHz.
      Set (s)printf features to int,width.
    5. In the After make tab, set the Program the Chip checkbox.
      You may need to uncheck the Check Signature box.
      Then close the configure dialog.
    6. 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.
  2. Connect the LCD (see below) and run the LCD test program. You should see a counter and a moving dot.
  3. You will need to generate a time base for measuring reaction times. Most people have a reaction time in the range of 100 mSec to 200 mSec, but this can be quite variable, up to several hundred mSec.I suggest that you use the multiple task timing scheme from this code.
  4. Remember that a switch which is pushed reads back a logic zero.
  5. Use the CodeVision help files to figure out how to store to eeprom.

    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:


Assignment

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

Your written lab report should include:


Copyright Cornell University Dec 2006