EMBEDDED SYSTEM EC5464
Practical No.8: Execute embedded c program for LCD
Practical Significance
LCD is an inevitable part in almost all embedded applications. Applications in
embedded/microcontroller like digital voltmeter / ammeter, digital clock, home automation
displays, status indicator display, digital code locks, digital speedometer/ odometer, display
for music players etc requires displays. etc. This practical willmake the student to understand
and develop the skills of interfacing LCD with 8051 and executing the program in real time
application.
II Practical Outcome/s
Execute the C program to perform Serial transfer of message "WELCOME". On LCD display
with 8051...
III Relevant Affective domain related Outcome(s)
Handle ICand equipment carefully.
Follow safe practices.
IV Minimum Theoretical Background
Students should refer microcontroller manual for more theory.
R2
L:
R3
ATSSSSI
TAL?
LCD DISPLAY
Sample Program
//P1 USED FOR DATA PINS
#include<reg51.h>
sfr ldata-0x90;
sbit rs-P3^5:
sbit rw=P3^4:
sbit en=P3^3;
void lcdcmd(unsigncd int valuc):
void lcddata(unsigned int valuc):
(RAP)
Govt Polytcchnic Amravati Eleetroics Dept
EMBEDDED SYSTEM EC5464
void msdelay(unsigned int itime);
void main(void)
lcdcmd(0x38);
msdelay(20):
lcdcmd(0x0e);
msdelay(20);
lcdcmd(0x01);
msdelay(20);
lcdcmd(0x06);
msdelay(20);
lcdcmd(Ox81);
msdelay(20);
lcddata('E);
msdelay(20);
lcddata("T);
msdelay(20);
lcddata('X);
msdelay(20);
lcddata("W);
msdelay(20);
lcddata(E')};
msdelay(20);
lcddata(L);
msdelay(20);
lcddata(0x14);
msdelay(20);
lcddata(C);
msdelay(20);
lcddata(0);
msdelay(20);
lcddata('M);
msdelay(20);
lcddata('E);
msdelay(20);
for(;:)
void lcdcmd (unsigned int value)
{
ldata=value;
rs=0;
rw-0;
en=1:
msdelay( 1);
en=0;
return;
Govt Polytechnic Amravati Electronics Dept (RAP)
EMBEDDED SYSTEM ECS464
void lcddata (unsigned int value)
ldata=value;
rs=1;
rw-0;
en=1;
msdelay(1);
en-0;
return;
voidmsdelay (unsigmed int itime)
{
int ij;
for(i-0;i<itime;it+)
for(j-0:j<1275;j++);
DIAGRAM / flowchart/algorithm :
V Resources Required: keil compler
VI Precautions to be Followed: Create the separate directory with specific name.
VII Actual procedure followed:
the trainer board in lab
Write the program that you have written and executed for
Use separate page
VIII Interpretation of results
IX Conchusions (compare with assembly)
X
Practical Related Questions
to display ETX on second row.
1. Write a simple given program in embedded c
2. Write the steps for the above program.
3. Write flowchart procedure for the above program
[Space for answerl