Lab 5: LCD Messages

Objectives

  • Become familiar with assembly language program design and instructions
  • Use assembly language branch instructions to implement conditional logic
  • Use assembly language instructions to implement subroutines and subroutine calls
  • Use assembly language instructions to manipulate the Stack
  • Become familiar with reading input from a Digital I/O port
  • Use I/O port instructions to output messages to the LCD display

Lab activity

In this lab, you will complete the development of a set of subroutines that you will then use to display various messages to the LCD. The messages you display will change depending on which keys on the keypad are pressed.

Download the partially-completed LCD utility subroutines from the following file: lcdlib.asm. This file contains the following subroutines1):

  1. lcd_port_config – Initializes the ATmega32 port used by the LCD display
  2. lcd_init – Initializes the LCD display
  3. lcd_cmd_write – Sends a command to the LCD display
    • Parameter: R24 – data to be written to the LCD display
  4. lcd_data_write – Sends a byte of data to the LCD display
    • Parameter: R24 – data to be written to the LCD display
  5. lcd_clear – Clear the LCD display and home cursor
  6. lcd_string_write – Display a message on the LCD screen
    • Parameter: Z – byte address of beginning of message
  7. lcd_test – Display the developer's login on the LCD screen

Of these seven subroutines, lcd_cmd_write and lcd_data_write are already implemented. You must implement the remaining five subroutines.

In addition, you should use the delay.asm library file from lab 4 that contains a subroutine delay2ms that does what it's name implies.

Write a program that makes use of the lcdlib.asm and delay.asm files to implement the functionality described below. Your program should be placed in lab5.asm. Following the usage instructions in lcdlib.asm to gain access to the subroutines in the other files.

Program Functionality

  • The LCD panel should be connected to PORTB.
  • The keypad should be connected to PORTC.
  • One of at least six different messages should be displayed in response to keypad input.
  • Each of the messages should be stored in program memory as null terminated strings.
  • A user guide should be placed as documentation at the beginning of your program indicating what the user must do to make the program display each of the messages.

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 6 column (even if you worked on it in week 5 or 7).

Lab Deliverables

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

Taylor

If you have any questions, consult your instructor.

1) There are two additional subroutines; however, they are not documented here because they are already implemented and it is not intended that they would be called directly
ce2800labs/lab5.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 <-