EngineersGarage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise
You are here: Home / Replies / i try to compile the program

i try to compile the program

|

Microcontroller › 8051 › INTERFACING LCD TO 8051 BY Qurat-ul-ain › i try to compile the program

November 1, 2011 at 2:35 pm #6774
sachin
Participant

i try to compile the program using keil uvision4,but these error occurs

 

.
7.c.c(3): warning C318: can’t open file ‘my.h’
7.c.c(18): warning C206: ‘delay’: missing function-prototype
7.c.c(18): error C267: ‘delay’: requires ANSI-style prototype
Target not created

 

what is its mean????

 

 

 

but my program to show “A” character

is there is any mictake plz tell meee…..

 

 

 

 

#include<reg51.h>
sfr lcd_data_pin=0xA0;
sbit rs=P3^0;  //Register select pin
sbit rw=P3^1;  // Read write pin
sbit en=P3^6;  //Enable pin

void delay(unsigned int count)  // Function to provide time delay in msec.
{
int i,j;
for(i=0;i<count;i++)
  for(j=0;j<1275;j++);
}

void lcd_command(unsigned char comm)  //Function to send commands to LCD.
{
lcd_data_pin=comm;
en=1;
rs=0;
rw=0;
delay(1);
en=0;
}

void lcd_data(unsigned char disp)  //Function to send data to LCD
{
lcd_data_pin=disp;
en=1;
rs=1;
rw=0;
delay(1);
en=0;
}

void lcd_ini()  //Function to initialize the LCD
{
lcd_command(0x38); 
delay(2);
lcd_command(0x0F);
delay(2);
lcd_command(0x82);  //Set cursor to blink at line 1 positon 2
delay(2);
}

void character()
{
lcd_command(64);  //Address where values of the first custom character is stored
lcd_data(0);
lcd_data(10);
lcd_data(21);
lcd_data(17);
lcd_data(10);
lcd_data(4);
lcd_data(0);
lcd_data(0);
lcd_command(0xC0);  //Address of the location where the character is to be displayed
lcd_data(0);  // Displaying the character created at address 0x64
delay(10);

lcd_command(72);
lcd_data(0);
lcd_data(0);
lcd_data(0);
lcd_data(10);
lcd_data(0);
lcd_data(4);
lcd_data(17);
lcd_data(14);
lcd_command(0x80);
lcd_data(1);
delay(10);

lcd_command(80);
lcd_data(0);
lcd_data(0);
lcd_data(10);
lcd_data(0);
lcd_data(4);
lcd_data(0);
lcd_data(14);
lcd_data(17);
lcd_command(0x82);
lcd_data(2);
delay(10);
lcd_command(88);
lcd_data(1);
lcd_data(3);
lcd_data(5);
lcd_data(9);
lcd_data(9);
lcd_data(11);
lcd_data(27);
lcd_data(24);
lcd_command(0x84);
lcd_data(3);
delay(10);

lcd_command(96);
lcd_data(0);
lcd_data(10);
lcd_data(0);
lcd_data(31);
lcd_data(17);
lcd_data(14);
lcd_data(0);
lcd_data(0);
lcd_command(0x86);
lcd_data(4);
delay(10);

lcd_command(104);
lcd_data(10);
lcd_data(0);
lcd_data(4);
lcd_data(0);
lcd_data(14);
lcd_data(17);
lcd_data(17);
lcd_data(14);
lcd_command(0xC2);
lcd_data(5);
delay(10);

lcd_command(112);
lcd_data(0);
lcd_data(10);
lcd_data(0);
lcd_data(0);
lcd_data(4);
lcd_data(0);
lcd_data(31);
lcd_data(0);
lcd_command(0xC4);
lcd_data(6);
delay(10);

lcd_command(120);
lcd_data(0);
lcd_data(17);
lcd_data(10);
lcd_data(17);
lcd_data(4);
lcd_data(0);
lcd_data(14);
lcd_data(17);
lcd_command(0xC6);
lcd_data(7);
delay(10);
}

void main()
{
lcd_ini();
character();
}

RSS Recent Posts

  • More fun with ws2812 this time XC8 and CLC July 16, 2025
  • Pickit 5 July 16, 2025
  • Pic18f25q10 osccon1 settings swordfish basic July 16, 2025
  • turbo jet fan - feedback appreciated. July 16, 2025
  • I Wanna build a robot July 16, 2025

Stay Up To Date

Newsletter Signup
EngineersGarage

Copyright © 2025 WTWH Media LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media
Privacy Policy | Advertising | About Us

Search Engineers Garage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise