CS-424, Lab 3
2-13-08, Report due 2-20-09

In this lab you will explore outputting characters to the Liquid Crstal Display (LCD) on the QuikFlash board
using the built-in Hitachi HD44780 LCD controller and the PIC18F452 microcontroller.

Part 1.

Using MPLAB create a PIC18F452 microcontroller assembly language program that will display your name
on the top row of the LCD.

Part 2.

Create a PIC18F452 microcontroller assembly language program that will display the state of switch SW3 at
the bottom left of the LCD. The words "DOWN" or "UP" should appear, depending on what the user is doing
with switch SW3.

Part 3.

Create a PIC18F452 microcontroller assembly language program that will display a "smiley face" at the middle
of the top row of the LCD. You will need to define a new character that programs the pixels that need to be
turned on and off in the LCD controller's Character Generator RAM to make the shape of a "smiley face". Once
the new character is defined your program should output it to the LCD.

Part 4.

Create a PIC18F452 microcontroller assembly language program that will count in hex from 0 to 0xFF and show
the current count (expressed as a two-digit hexadecimal number) in the bottom right two positions of the LCD.
Each count should last about one second. The display should show something like the following (... means that
some counts have been skipped in this handout):

00
01
02
...
09
0A
0B
...
0E
0F
10
11
...
1F
20
21
...
99
9A
...
9F
A0
...
FE
FF

You will need to have a variable that keeps track of the current count and subroutines that compute the ASCII
codes of each of the two hex digits of the count. Then the ASCII codes of the digits of the current value of the
count can be sent to the LCD controller.

In this lab you can use the P2 program given at the end of Chapter 7 in your book as a starting point. However,
this program is written in "structured assembler" and you are to write your programs in PIC18F452 assembly
language. In addition, the P2 program uses timers to achieve the various delays required for initialization and
sending control codes and characters to the LCD display. You are NOT to use timers, rather delay loops, as in
the previous lab.

You should show the lab instructor each of the working programs and submit the .LST and .HEX files as your
report.