Lab 6: Interrupting Analog to Digital Conversion

Lab activity

In this lab, you will write a program that measures the voltage applied to pin 0 on PORTA using the analog to digital converter subsystem on the ATmega32.

The following hardware should be connected:

  • LEDs attached to PORTC.
  • LCD attached to PORTB.
  • Keypad attached to PORTD.
  • Power supply in lab attached to ground (black lead) and PORTA pin 0 (red lead).

Your program must do the following:

  • Configures the ADC subsystem to continually convert the analog signal on pin 0 of PORTA into a digital value.
  • Uses the code from lab 2 to produce the ”Knight Rider” effect on the LEDs.
  • Whenever a key (you can decide which key or keys) on the keypad is pressed, displays the two digit hexadecimal value of the result of the ADC on the LCD. The LCD should only be updated when the keypad is pressed.

Design Constraints

Your program should be placed in lab6.asm and must:

  • Make use of the lcdlib.asm and delay.asm files from lab 5 to drive the LCD.
  • Include at least two well chosen subroutines. Think about how you want to design your code before you start coding. A small amount of time spent creating a simple design can prevent a lot of time coding a complicated design.
  • Make sure you restore the incoming value of all registers you modify before exiting your subroutines.
  • Include appropriate documentation.

Demonstration

You are required to demonstrate your program 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 7 column (even if you worked on it in week 6 or 8).

Lab Deliverables

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

Taylor

If you have any questions, consult your instructor.

ce2800labs/lab6.txt · Last modified: 2010/03/09 20:55 (external edit)
 

This website is not owned or managed by the Milwaukee School of Engineering.

© 2003-2010 Dr. Christopher C. Taylor, et. al. • Office: L-343 • Phone: 277-7339 • npǝ˙ǝosɯ@ɹolʎɐʇ • -> RSS <-