EXPERIMENT 5 : Input to appear in LCD Display

At the end of the practical session, student should be able to:
1. To learn on how to interface the 2x16 character LCD to the PIC18F4550
2. Write c18 program for PIC Microcontroller’s to receive an input to display character
on LCD display
1. PC installed software:
a. MPLAB IDE integrates with C18 compiler.
b. PICkit 2 v2.61
c. PTK40A Trainer Kit.

Practical 5a – Displaying a different character for 2 digital input on LCD display.
1. Create a new project file for PIC18F4550 with following setting:

Set a project name as PRACTICAL5.
Add a new file to project, set a source file name as practical5a-lcd display digital input.c

Show your created project file to your lecturer.


Write a program in your source file based on the condition below then build the program until successful.
If any error occurs, fix it.

Hint: Refer to Experiment 3 and 4 in this experiment.

Input: SW1 at RB0, SW2 at RB1.
Output: LCD Display where Data port in PORT D (RD0-RD7). RS at RA2 and EN at RA3.
Condition: LCD shows PLEASE PRESS SWITCH at first line of LCD for initial condition
If SW1 pressed, LCD will clear screen and show SW1 PRESSED at second line first column.
If SW2 pressed, LCD will clear screen and show SW2 PRESSED at second line first column.
If SW1 and SW2 pressed, LCD will clear screen and show BOTH SW PRESSED at second line
first column.


Show your successful program to your lecturer.

Approved by:_______________ Date:______________


Download your HEX file to PTK40A trainer via PICkit2 software.
Approved by:_______________ Date:______________

After a while. _____________________________________________________________________________ _____________________________________________________________________________ Press SW1 and SW2 together. release SW1 and SW2 keep pressing. RS at RA2. Don’t release it yet. _____________________________________________________________________________ _____________________________________________________________________________ DISCUSSION _____________________________________________________________________________ _____________________________________________________________________________ _____________________________________________________________________________ _____________________________________________________________________________ Assignment: Draw a schematic design using Proteus 7 besed on this activity where oscillator used is 20MHz.5. Hold for a while. _____________________________________________________________________________ _____________________________________________________________________________ _____________________________________________________________________________ . _____________________________________________________________________________ _____________________________________________________________________________ Press SW2. Explain your observation. Test your circuit. Don’t release it yet. Download your hex file to the circuit. CONCLUSION • Write the conclusion from this experiment activity. VDD is 5V. Input (Switches) are RB0 and RB1. _____________________________________________________________________________ _____________________________________________________________________________ Press SW1 and SW2 together. Submit this assignment with successful program via email to your lecturer. Explain your observation. Explain your observation. Hold for a while. Hold for a while. Show your result to your lecturer. Press SW1. . VEE and VSS grounded. Don’t release it yet. Explain your observation. data port on LCD (D0-D7) at PORT D. EN at RA3.