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.

programming AT89C51 atmel family microcontroller

Status
Not open for further replies.

nserudin musa

Newbie level 6
Joined
Mar 17, 2011
Messages
14
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,291
Activity points
1,385
hi im doing my final project on security system of ATM machine and im using keil microvision4 to develop c code but it gives the fallawing warning messages
fm.c(2): warning C318: can't open file 'lcd.h'
FM.C(77): warning C206: 'init_lcd': missing function-prototype
FM.C(78): warning C206: 'display_lcd': missing function-prototype
FM.C(78): error C267: 'display_lcd': requires ANSI-style prototype
Target not created
i dont know how to solve it, and i'm confused. would you please help me.. thank you!:
 

post your complete program, as it seems that keil can't find your LCD definitions or subroutines especified in the 'Lcd.h' file

do you have the LCD.H file????
 

I think you don't have the LCD.h file. which is used to configure the lcd display.
 

post your complete program, as it seems that keil can't find your LCD definitions or subroutines especified in the 'Lcd.h' file

do you have the LCD.H file????
here is my complete programm

Code C++ - [expand]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
#include<reg52.h>
#include<lcd.h>
#include<intrins.h>
sbit motor=P0^0;
sbit sw=P0^1;
 
void SEND_CHR(unsigned char);
void RECEIVE_CHR();
void SEND_SMS(unsigned char *nm);
void GSM_INIT(void);
unsigned char rch; 
unsigned char buff[40]; 
 
void print(char *str)
{
while(*str)
{
SBUF = *str++;
while(TI == 0);
TI = 0;
}
}
void RECEIVE_MEM()
{
unsigned int i=0;
while(1)
{
do
{
RECEIVE_CHR();
}while(rch != '$');
RECEIVE_CHR();
if(rch == '3')
    {
    RECEIVE_CHR();
    if(rch == 'A')
        {
        RECEIVE_CHR();
        if(rch == '0')
            {
            RECEIVE_CHR();
            if(rch == 'M')
                {
                RECEIVE_CHR();
                if(rch == 'D')
                    {
                    RECEIVE_CHR();
                    if(rch == 'S')
                    {
                    i = 0;
                    do
                    {
                    RECEIVE_CHR();
                    buff[i] = rch;
                    }while(buff[i++]!='$');
                    goto nex;
                    }
                    }               
                }
            }
        }
    }
}
nex:;
} 
 
 
void main()
{
unsigned char i=0;
motor=0;
sw=1;
TMOD = 0x20;
SCON = 0x50;
TH1 = 0xFA;  
TR1 = 1;
init_lcd();
display_lcd("MAES BASED");
cmd_lcd(0xC0);
display_lcd("SECURITY SYSTEM");
delay_ms(300);
init_lcd();
//GSM_INIT();
print("AT+CMGF=1\r\n");
delay_ms(300);
TH1 = 0xFD;  
init_lcd();
while(1)
{
TH1=0xFD;
delay_ms(75);
init_lcd();
display_lcd("MEMS BASED");
cmd_lcd(0xC0);
display_lcd("SECURITY SYSTEM");
for(i=0;i<32;i++)
{
RECEIVE_CHR();
buff[i]=rch;
}
//init_lcd();
if(buff[29]=='L' || buff[29]=='R' || buff[29]=='S' || buff[29]=='I')
{
TH1=0xFA;
delay_ms(75);
motor=1;
SEND_SMS("9032323048");
//SEND_SMS("9701515557");
motor=0;
delay_ms(200);
init_lcd();
display_lcd("WAIT FOR DOOR");
cmd_lcd(0xC0);
display_lcd("OPEN");
while(sw==1);
motor=1;
init_lcd();
display_lcd("DOOR OPENED");
delay_ms(300);
motor=0; 
TH1=0xFD;
}
}
}
void RECEIVE_CHR()
{
while(RI==0);
rch = SBUF;
RI=0;
}
void SEND_CHR(unsigned char c)
{
SBUF = c;
while(TI==0);
TI=0;
}
void SEND_SMS(unsigned char *nm)
{
unsigned int i=0,j=0;
TH1=0xFA;
cmd_lcd(0x01);
display_lcd("SENDING SMS...");
print("AT+CMGS=");
SEND_CHR('"');
print(nm);
SEND_CHR('"');
print("\r\n");
delay_ms(500);
print("SOMEBODY IS TRYING TO ROBERY");
print("\r\n");
print("\r\n");
i=0;
SEND_CHR(0x1A);
SEND_CHR(0x1A); //END OF MESSAGE INDICATION. (ctrl + z)
delay_ms(500);
}
 
 
void GSM_INIT(void)
{
    cmd_lcd(0x01);
    display_lcd("GSM INITIALIZING");
    cmd_lcd(100);
    print("AT\r\n");
    delay_ms(300);
    print("AT\r\n");
    delay_ms(300);
    print("AT\r\n");
    delay_ms(300);
    print("AT+IPR=4800\r\n");
    delay_ms(300);
    print("AT+CMGF=1\r\n");
    delay_ms(300);
    print("AT+CNMI=0,1,0,0,0\r\n");
    delay_ms(300);
    print("ATE0\r\n");
    delay_ms(300);
    print("AT&W\r\n");
    delay_ms(300);
    print("AT+CREG?\r\n");
    delay_ms(300);
    print("AT+CREG?\r\n");
    delay_ms(300);
}


 

#include<reg52.h>
#include<lcd.h>
#include<intrins.h>

this lines means that you need this three files at least: reg52.h is a common Keil file of a microcontroller definition, but lcd.h should be a file with some lcd function definitions. mmm i'm not sure about intrins.h but it means that you also need it!

if you copied this program from some web page you need to now where it got the lcd functions (as it doesn't need only a lcd.h but also an lcd.c file!)

someone got an idea about the other file? the intrins.h ?
 

the lcd header file contain functions like
init_lcd();
cmd_lcd();
etc
 

as thannara123 pointed , if you dont have the header file you will have to write the contained functions yourself
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top