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.
- using Timer0 as a timer
- using the LCD
Equipment
Procedure
- 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.
- 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
- 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
- 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
Wilfrid Laurier University
© 2019 Wilfrid Laurier University