Lab 3: LCD Device Driver

Lab activity

Create a GCC project in AVR Studio and add all of the files in lab3.zip to it. The .zip file contains the following files:

  • lcd.h – Header file containing function prototypes for the LCD device driver library you will implement.
  • lcdprivate.h – Header file containing function prototypes for helper functions to be used by the LCD device driver you will implement.
  • globaldef.h – #defines that allow use of delay functions in util/delay.h.
  • lab3.c – Test program to demonstrate successful implementation of the LCD device driver library.

Project Configuration

Be sure to configure your GCC project correctly. For example, make sure that you adjust the stack pointer location, specify that the C99 standard should be used, etc…

Implementation Details

In addition to the source files provided, you will need to create lcd.c. This file should include lcd.h and lcdprivate.h. Within the file you should implement the functions prototyped in the two header files. The header files provide documentation regarding how each function should operate. In particular, you must implement the following helper functions defined in lcdprivate.h:

  • void lcd_data_write(uint8_t data);
  • void lcd_cmd_write(uint8_t cmd);
  • void lcd_write(uint8_t value, _Bool is_data);
  • void lcd_write_nibble(uint8_t data, _Bool is_data);
  • void write_lcd_port(uint8_t data);
  • void write_lcd_ddr(uint8_t data);
  • void lcd_sbi(uint8_t bit);
  • void lcd_cbi(uint8_t bit);

You must also implement the following functions defined in lcd.h:

  • void lcd_init(char port);
  • void lcd_home(void);
  • void lcd_clear(void);
  • void lcd_goto_xy(uint8_t x,uint8_t y);
  • void lcd_print_char(char symbol);
  • void lcd_print_string(char string[]);
  • void lcd_print_hex(uint8_t hex);
  • void lcd_print_uint8(uint8_t no);

Correct implementation of all of the above may lead to a grade of no higher than 95% on this assignment. In order to be eligible for full credit, you must also implement:

  • void lcd_print_int8(int8_t no);

Students interested in doing more may implement the following optional functions:

  • void lcd_print_uint16(uint16_t no);
  • void lcd_print_int16(int16_t no);
  • void lcd_print_float(float no);

The Hitachi LCD Documentation, CE2800 LCD display and CE2800 Hexidecimal to ASCII notes may be helpful references for this assignment.

Demonstration

Each student must demonstrate the successful implementation of their LCD device driver library by running the test program on their SunRom hardware. This demonstration is due by the end of the laboratory session.

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

Lab Deliverables

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

Rothe Taylor

If you have any questions, consult your instructor.

ce2810labs/lab3.txt · Last modified: 2009/06/03 11:22 (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 <-