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 / /*hi shylaja ref the code

/*hi shylaja ref the code

|

Microcontroller › 8051 › 89c52 › /*hi shylaja ref the code

December 6, 2013 at 3:56 am #10702
balaji.n
Participant
/*hi shylaja ref the code */
/*program for lcd interfacing programed by  balaji any bug report [email protected]*/
 
#include <reg51.h>
sfr ldata = 0x90; //P1=LCD data pins
sbit rs = P2^0;
sbit rw = P2^1;
sbit en = P2^2;
sbit busy = P1^7;
void lcdcmd(unsigned char value);
void MSDelay(unsigned int itime);
void lcddata(unsigned char value);
void lcdready();
   void lcdstring(char *string);
void main()
{
lcdcmd(0x38);
lcdcmd(0x0E);
lcdcmd(0x01);
lcdcmd(0x06);
lcdcmd(0x80); //line 1, position 6
while(1)
{
lcdcmd(0x80);
lcdstring(” welcmoe”);
}
}
 
void lcdcmd(unsigned char value)
{
lcdready(); //check the LCD busy flag
ldata = value; //put the value on the pins
rs = 0;
rw = 0;
en = 1; //strobe the enable pin
MSDelay(1);
en = 0;
return;
}
void lcddata(unsigned char value)
{
lcdready(); //check the LCD busy flag
ldata = value; //put the value on the pins
rs = 1;
rw = 0;
en = 1; //strobe the enable pin
MSDelay(1);
en = 0;
return;
}
void lcdready()
{
busy = 1; //make the busy pin at input
rs = 0;
rw = 1;
while(busy==1)
{ //wait here for busy flag
en = 0; //strobe the enable pin
MSDelay(1);
en = 1;
}
}
void MSDelay(unsigned int itime)
{
unsigned int i, j;
for(i=0;i<itime;i++)
for(j=0;j<1275;j++);
}
void lcdstring(char *string)
{
 while(*string++)
 lcddata(*string);
 }

RSS Recent Posts

  • Funny Images Thread! March 7, 2026
  • energising a solenoid March 7, 2026
  • LM016L + PCF8574 I2C Backpack Schematic with Backlight Control March 7, 2026
  • ESP32 Sub Forum March 7, 2026
  • What diode should I use? March 7, 2026

Stay Up To Date

Newsletter Signup
EngineersGarage

Copyright © 2026 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