Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

AT89c52 lcd.h file does not open

Status
Not open for further replies.

Aunas Manzoor

Newbie level 6
Joined
Apr 3, 2011
Messages
11
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,349
Hi all

I have a problem in Keil software while programming LCD interfacing.

#include "lcd.h"
#include "utils.h"

the above header files does not open. The error displayed is
Voicerec.c(6): warning C318: can't open file 'lcd.h'
Voicerec.c(7): warning C318: can't open file 'utils.h'

Will anyone help me.
 

Have you checked in the include directory to see if the stated files are there?
 

oh yes it is not there. Can it be downloaded?? Will you please send me link??
 

Yes but what is utils.h
I dont understand its meaning and purpose
 

lcd interfacing is really easy. you can find lot of programs, already present on the web. just use google
hope it helps
 

ask the person from where you got the code for those header files. or dearch in the forum for readymade program....

---------- Post added at 15:11 ---------- Previous post was at 15:07 ----------

Code:
#include <reg52.h>
#include <math.h>
void lcdcmd (unsigned char);
void lcddata (unsigned char);
void msdelay (unsigned int);
void LCD_sendstring(unsigned char * );

////////////////////////////////////// 
sfr ldata =0x90;
sbit rs=P3^7;
sbit rw=P3^6;
sbit en=P3^5;
sbit g=P2^7;
/////////////////////////////


void main(void)
{
lcdcmd (0x3;
msdelay (100);
lcdcmd (0x0C);
msdelay (100);
LCD_sendstring("16x2 LCD");
msdelay(1000)



lcdcmd (0x01);
msdelay(5);

}

void lcdcmd (unsigned char value)
{ 
ldata=value;
rs=0;
rw=0;
en=1;
msdelay (10);
en=0;
}

void lcddata (unsigned char value)
{
ldata=value;
rs=1;
rw=0;
en=1;
msdelay (10);
en=0; 
}


void msdelay (unsigned int itime)
{
unsigned int i,j;
for (i=0;i<itime;i++)
for (j=0;j<1275;j++);
}


void LCD_sendstring(unsigned char *value)
{
while(*value) 
lcddata(*value++); 
}
 

This is the coding for 2x16 LCD.. [For 89C51{8051 series}]

#include <REG51.H>
#include <STDIO.H>

#define LCD_DTA P0
sbit RS = P2^7;
sbit RW = P3^6;
sbit EN = P3^7;
sbit LED = P3^5;

unsigned char name[] = "DIGANT TECH", name1[] = "WELCOMES U";

void Delay(unsigned int time)
{
while(time--);
}

void Enable_LCD (unsigned char dta, bit RegSel)
{
RW = 0;
RS = RegSel;
EN = 1;
LCD_DTA = dta;
Delay(10);
EN = 0;
}

void Init_LCD(void)
{
Enable_LCD(0x38,0); // 8bit, multiple line, 5x7 display
Delay(10000);
Enable_LCD(0x38,0); // 8bit, multiple line, 5x7 display
Delay(1000);
Enable_LCD(0x38,0); // 8bit, multiple line, 5x7 display
Delay(100);
Enable_LCD(0x1C,0); // Shift entire display to right
Delay(100);
Enable_LCD(0x0E,0); // Cursor on & blink off
Delay(100);
Enable_LCD(0x06,0); // Increment with no shift
Delay(100);
Enable_LCD(0x02,0); // Home cursor
Delay(100);
Enable_LCD(0x01,0); // Clear display
Delay(100);
}

void Display_Char(bit Line_no)
{
unsigned int i;
if(Line_no == 0)
{
Enable_LCD(0x02, 0);
Delay(100);
for(i=0; name != '\0'; i++)
{
Enable_LCD(name, 1);
Delay(100);
}
}
if(Line_no == 1)
{
Enable_LCD(0xC0, 0);
Delay(100);
for(i=0; name1 != '\0'; i++)
{
Enable_LCD(name1, 1);
Delay(100);
}
}
}

void main(void)
{
Init_LCD();
LED = 0;
while(1)
{
Display_Char(0);
Delay(30000);
Display_Char(1);
Delay(30000);
}
}
 
Thanks buddy at last I made it possible. Thanks to all.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top