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 lee.  i think u r using

hi lee.  i think u r using

|

Microcontroller › 8051 › INTERFACING LCD TO 8051 BY Qurat-ul-ain › hi lee.  i think u r using

November 20, 2011 at 6:54 am #6857
Qaisar
Participant

hi lee. 

 i think u r using s52 . this code will for s52 too . 

tha above code is correct as i shown its simulating diagram  . i modified delay function .simulate this code now and run it on proteus . 

but plz follow the above diagram to run this code . 

 

 

 

#include <AT89X51.H>
 
#define lcd_data P2
sbit en=P0^1;
sbit rs=P0^0;
 
 
unsigned char z;
unsigned int i;
 
 
 
void delay(unsigned int time)
 {
   unsigned int i,j;
   for(i=0;i<time;i++)
   for(j=0;j<1275;j++);
   }
         void lcdcmd(unsigned char value)
        {
              lcd_data=value;
               rs=0;
  en=1;
  delay(100);
  en=0;
  return;
 }
 
void lcddata(unsigned char value)
{
  lcd_data=value;
rs=1;
en=1;
delay(100);
en=0;
return;
   }
 
void main(void)
{
   lcdcmd(0X38);//5X7 matrix
  lcdcmd(0X0E);//lcd on ,curor on
  lcdcmd(0X01); // clear lcd command
  lcdcmd(0X80);//move cursor to line1
 
  {
unsigned char name[]=” TEST PROGRAMME “;
 
for(z=0;z<=16;z++)
lcddata(name[z]);
 
  lcdcmd(0XC2); // move cursor to line2, position 2
 
for(i=48;i<=57;i++)   
  lcddata(i);
 
while(1);
 }
 
} 
 

RSS Recent Posts

  • Saga 1400sv vinyl cutter motherboard issue June 20, 2025
  • PIC KIT 3 not able to program dsPIC June 20, 2025
  • Wideband matching an electrically short bowtie antenna; 50 ohm, 434 MHz June 20, 2025
  • using a RTC in SF basic June 20, 2025
  • Relay buzzing after transformer change? June 20, 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