Pages created and updated by Terry Sturtevant Date Posted: November 13, 2013

CP316: Microprocessor II

Liquid Crystal Displays (LCDs)

Objectives

Liquid Crystal Displays (LCDs) are a common inexpensive display device. The simple alphanumeric versions are typically based on the Hitachi HD44780 controller standard. As display devices are comparatively slow, time delays are required when interacting with the display. Although the time delays can be executed in software or hardware, you will use hardware timing in this lab.

Equipment

Procedure

  1. Use your program that flashes the left LED every 250 milliseconds (timer0 based program) from the previous lab (question 6). Run the program. Note what you see on the display. The garbage on the display is due to the fact that the LCD was not properly initialized.

  2. Modify your program to include a subroutine to initialize the LCD. When you turn the display on in the last step of the initialization, set cursor on and blink off.

    Demonstration - demonstrate and explain your initialization routine

  3. Modify the above program (new project) to alternately display the names of the group members. The names of the group members should be supplied as defined constant strings in program memory. The first names should be on row 1 of the display and the last names should be on row 2 of the display. I suggest that you use subroutines, e.g. to send a command or data to the LCD, to send a null terminated string to the LCD, to clear the LCD.

    For example, my program defines data as

    name1_f db 0x80,"Nora",0x00
    name1_l db 0xC0,"Znotinas",0x00
    name2_f db 0x80,"Terry",0x00
    name2_l db 0xC0,"Sturtevant",0x00


    and my program output alternates between

    screen 1: Nora
           Znotinas


    screen 2: Terry
           Sturteva


    Demonstration - demonstrate and explain the operation of your program

  4. Modify the above program (new project) to write the names of the group members into the LCD buffer (DDRAM). The names of the group members should be supplied as defined constant strings in program memory (as above with a slight modification). Now take the names and continuously scroll them left. For example, my buffer contains:

    Nora      Terry
    Znotinas  Sturtevant

    After scrolling left 4 times, the display shows:

          Te
    inas  St


    Demonstration - demonstrate and explain the operation of your program
Creative Commons License

Information on this site which is produced by Terry Sturtevant is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 2.5 Canada License.

Resources

To view pdf documents, you can download Adobe Acrobat Reader .
get Acrobat Reader
If you need to update a browser, you might try Firefox which is Get Firefox!
Since this page uses cascading style sheets for its layout, it will look best with a browser which supports the specifications as fully as possible.

If you are looking for an office package, with a word processor, spreadsheet, etc., you might try LibreOffice which is Get LibreOffice!

Go to the main page for the Department of Physics and Computer Science.

Valid XHTML 1.1

Valid CSS!

WCAG
2.0
(Level AA)

Wilfrid Laurier University