0% found this document useful (0 votes)
96 views17 pages

Practical Work 3 (F2029, F2030, F2031)

This document outlines a practical work assignment on hardware interfacing with an LCD. The objectives are to understand LCD configuration, interfacing an LCD to a microcontroller, and writing a program for the LCD. Students are instructed to write C programs to display text on an LCD connected to a PIC microcontroller. They simulate the circuit in Proteus and write observations. Procedures include displaying text using strings and characters, performing calculations, and controlling motor direction with switches. Students discuss their results and conclude they have learned LCD interfacing and configuration.

Uploaded by

TJ Here
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
96 views17 pages

Practical Work 3 (F2029, F2030, F2031)

This document outlines a practical work assignment on hardware interfacing with an LCD. The objectives are to understand LCD configuration, interfacing an LCD to a microcontroller, and writing a program for the LCD. Students are instructed to write C programs to display text on an LCD connected to a PIC microcontroller. They simulate the circuit in Proteus and write observations. Procedures include displaying text using strings and characters, performing calculations, and controlling motor direction with switches. Students discuss their results and conclude they have learned LCD interfacing and configuration.

Uploaded by

TJ Here
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 17

ELECTRICAL ENGINEERING DEPARTMENT

PRACTICAL WORK 3

DEC40053: EMBEDDED SYSTEM APPLICATION

PROGRAMME: DEP / DTK

CLO 03: Construct and simulate real-time embedded system application


based on PIC16/PIC18F microcontroller effectively. (P4, PLO5)

(CLS 1): Knowledge & Understanding

(CLS3a): Practical skill


__________________________________________________________________________________

Prepared by: Checked by: Verified by:

Date: 5.4.2021 Date: 05.04.2021 Date: 5/4/2021

1
ELECTRICAL ENGINEERING DEPARTMENT
ACADEMIC SESSION: _____________

DEC40053 EMBEDDED SYSTEM APPLICATION

PRACTICAL WORK : HARDWARE INTERFACING - LCD

PRACTICAL WORK
DATE :
LECTURER’S NAME:

GROUP NO. :
TOTAL
STUDENT ID & NAME : MARKS
(100%)

(A) SULAIMAN TANJUNG BIN SYAHRIL (17DEP20F2029)

MOHAMAD YUSUF BADAWI (17DEP20F2030)


(B)
MOHAMAD ELHAM DANNY BIN MOHAMAD FAIZAL (17DEP20F2031)

DATE SUBMIT : DATE RETURN :

2
DEC40053
PRACTICAL WORK 3
Embedded System
Hardware Interfacing - LCD
Application

1.0 PRACTICAL : 3

2.0 TITLE : HARDWARE INTERFACING - LCD

3.0 COURSE LEARNING OUTCOME (CLO):

CLO3 : Construct and simulate real-time embedded system application


based on PIC16/PIC18F microcontroller effectively. (P4, PLO5)

4.0 OBJECTIVES :

After practical, the student should be able;


1. to understand the configuration of Liquid Crystal Display (LCD)
2. to understand how to interface the LCD to the Microcontroller.
3. to write a program for LCD.

5.0 EQUIPMENTS :

SK40C Pic Start Up Kit, MPLAB IDE software, Proteus software

6.0 THEORY :

LCDs (liquid crystal display) are widely used devices that come in different forms that differ in
size and shapes and many other features. However almost all LCDs conform to a standard
interface specification. In our lab we will consider LM016L LCD with size 2*16 (32 characters)
that has a simple interface as shown in the figure.

3
Function Description

lcd_init ( ) Initialize and clear the LCD display.

lcd_clr ( ) Clear the LCD display and return the cursor to the home position.

lcd_goto( ) Jump to the defined position of the LCD display


Example: lcd_goto(0x07)

send_char ( ) Display a character on the LCD.

send_string ( ) Display a string on the LCD


Example: lcd_pustr (“Hello World”)

lcd_bcd ( ) convert the value in ui_number to BCD (Binary Code Decimal) and
display the digit according to uc_digit needed
Example: lcd_bcd(2,subtraction_value)

4
7.0 PROCEDURE : (2A)

1. Write a c program based on the flowchart 3A1

START

LCD display
LINE 1: DEC40053
LINE 2: EMBEDDED SYSTEM

END
By using string:

5
By using char:

6
2. Include 2 files LCD_BONE.c & Header.h

3. Draw the circuit using Proteus software and simulate the pic microcontroller (Refer
Appendix 1).
4. Burn the hex file to the PIC and write your observation.
5. Snap the output of PIC microcontroller.

7
PRACTICE : (3B – 3D)

Repeat the procedure and adjust the c program for others situation below:

3B. Write down your own name & matrix number on LCD display by using string

3C. Write the following c program and monitor the output

8
3D. Switch 1 (push button) is connected to pin RA0 and switch 2 (push button) is
connected to pin RA1.

Switch 2 Switch 1 LCD


0 0 MOTOR MOVE REVERSE
0 1 NONE
1 0 NONE
1 1 MOTOR MOVE FORWARD

**Hint use: logical operation AND ( && ) and OR ( || ) for switch 1 and switch 2

8.0 RESULT :

For each practical, the students must show all the codes with comment in every single
lines, flow chart, circuit, picture of hardware assemble in proper sequence and also write
a simple observation.

9.0 DISCUSSION : Discuss on your obtained result

10.0 CONCLUSION : Your conclusion based on your objectives

9
APPENDIX 1

10
FLOWCHART
FLOWCHART
FLOWCHART
FLOWCHART
DISCUSSION

- Based on this practical work, we making the process of configuration of Liquid Crystal Display (LCD)
and interface the LCD to the Microcontroller. It is known that we can use either string or char function
to program the LCD to display. In procedure 3A, we have used the char function to programme the
LCD to display a sentence in two lines. The lcd_Goto function is used to move the LCD cursor.
Procedure 3B is like procedure 3A with just displaying different sentences but in Procedure 3B, the
string function is used to display the message. In Procedure C, we implemented using sum and division
in the coding to display the sum of two numbers and the division of the first number by the second
number. In procedure 3D, we implemented if else ladder statement for the coding. The LCD displays
different messages when both switches are Off (Move Motor Reverse), On (Move Motor Forward) or
either one is Off (None) or On (None). For this coding, logical operation (&&) and (||) are used for the
different scenarios. Lastly, we found that there was no error occur in the coding and circuit.

CONCLUSION

- Based on the work performed, we also learned how to understand the configuration of Liquid Crystal
Display (LCD) and understand how to interface the LCD to the Microcontroller. We alsu inferfacing
LCD with PIC18F microcontroller with C programming in Matlab is done. The appropriate way to
build a proper circuit for different cases of LCD interface on Proteus for simulation is also learnt. LCD
has been the favourite in replacing LED's due to declining prices of the LCDs and the ability to display
numbers, characters, and graphics. Hence, there is an ease of programming for characters and
graphics. LCD can be easily interfaced with a microcontroller to display a message or status of advice.
The commands instructions given to LCD is to do a predefined task like initializing, clearing the
screen, setting the cursor position, controlling display and so on. In conclusion, knowledge on external
devices that can be interfaced with PIC microcontroller while understanding the internal features of
the PIC microcontroller is learnt. This enabled for the application of the internal features of PIC
microcontroller to interface with external devices and designing real time embedded system
application.
PW3: HARDWARE INTERFACING - LCD
MATRIX NUMBER NAME

A
17DEP20F2029 SULAIMAN TANJUNG BIN SYAHRIL A B
17DEP20F2030 MOHAMAD YUSUF BADAWI
B 17DEP20F2031 MOHAMAD ELHAM DANNY BIN MOHAMAD FAIZAL
Course Learning
Outcomes(CLO)/ Skills / Very Poor Satisfactory Very Good
Learning Domain
Circuit Marks
Aspects
Cluster (CLS) 1 2 3
Coding: student Able to write and
Able to write and
able to write Faces difficulty to compile the codes
compile the codes /3 /3
and compile the write the codes without any error and
with assistance.
codes assistance
Good to draw the
Draw circuit: Has difficulty to
circuit input and Excellent to draw the
student able to draw the circuit
Circuit output pin circuit input and /3 /3
draw the PIC input and output
moderately with output pin
A circuit pin
minimum assistance.
Interfacing:
Able to interface the Able to interface the
student able to Has difficulty to
MPLAB & simulation MPLAB & simulation
Interface interface the
circuit and show the circuit and show the /3 /3
MPLAB & MPLAB &
output with output without any
simulation simulation circuit
assistance. error and assistance
circuit

/9 /9

CLO 03:
Coding: student Able to write and
Construct and Able to write and
able to write Faces difficulty to compile the codes
simulate real- compile the codes /3 /3
and compile the write the codes without any error and
time embedded with assistance.
codes assistance
system Good to draw the
application Draw circuit: Has difficulty to
circuit input and Excellent to draw the
based on student able to draw the circuit
output pin circuit input and /3 /3
PIC16/PIC18F Circuit draw the PIC input and output
moderately with output pin
B circuit pin
microcontroller minimum assistance.
effectively. (P4, Interfacing:
PLO5. Able to interface the Able to interface the
student able to Has difficulty to
MPLAB & simulation MPLAB & simulation
Interface interface the
circuit and show the circuit and show the /3 /3
CLS 1: MPLAB & MPLAB &
output with output without any
Knowledge & simulation simulation circuit
assistance. error and assistance
Understanding circuit

CLS3a: Practical /9 /9
skill
Coding: student Able to write and
Able to write and
able to write Faces difficulty to compile the codes
compile the codes /3 /3
and compile the write the codes without any error and
with assistance.
codes assistance
Good to draw the
Draw circuit: Has difficulty to
circuit input and Excellent to draw the
student able to draw the circuit
output pin circuit input and /3 /3
draw the PIC input and output
moderately with output pin
circuit pin
minimum assistance.
Circuit
Interfacing:
C Able to interface the Able to interface the
student able to Has difficulty to
MPLAB & simulation MPLAB & simulation
Interface interface the
circuit and show the circuit and show the /3 /3
MPLAB & MPLAB &
output with output without any
simulation simulation circuit
assistance. error and assistance
circuit

/9 /9

11
PW3: HARDWARE INTERFACING - LCD
MATRIX NUMBER NAME

A
17DEP20F2029 SULAIMAN TANJUNG BIN SYAHRIL A B
17DEP20F2030 MOHAMAD YUSUF BADAWI
B 17DEP20F2031 MOHAMAD ELHAM DANNY BIN MOHAMAD FAIZAL
Course Learning
Outcomes(CLO)/ Skills / Very Poor Satisfactory Very Good
Learning Domain
Circuit Marks
Aspects
Cluster (CLS) 1 2 3
Coding: student Able to write and
Able to write and
able to write Faces difficulty to compile the codes
compile the codes /3 /3
and compile the write the codes without any error and
with assistance.
CLO 03: codes assistance
Construct and Good to draw the
Draw circuit: Has difficulty to
simulate real- circuit input and Excellent to draw the
student able to draw the circuit
time embedded Circuit output pin circuit input and /3 /3
draw the PIC input and output
moderately with output pin
system D circuit pin
minimum assistance.
application Interfacing:
based on Able to interface the Able to interface the
student able to Has difficulty to
PIC16/PIC18F MPLAB & simulation MPLAB & simulation
Interface interface the
circuit and show the circuit and show the /3 /3
microcontroller MPLAB & MPLAB &
output with output without any
effectively. (P4, simulation simulation circuit
assistance. error and assistance
PLO5. circuit

/9 /9

1. PRACTICAL SKILLS PSYCHOMOTOR ASSESMENT - (80%)

Circuit Circuit Circuit Circuit


NO. STUDENT’S NAME Total: 70%
A B C D

A /9 /9 /9 /9 /36 /70

B /9 /9 /9 /9 /36 /70

2. PRACTICAL WORK COGNITIVE ASSESSMENT - (REPORT 20%)

RESULT DISCUSSION
Arithmetic Logical CONCLUSION
Coding Flowchart Circuit char string 30%
operation operation
5 5 5 2.5 2.5 2.5 2.5 5

12

You might also like