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 / follow this code and diagram

follow this code and diagram

|

Microcontroller › 8051 › INTERFACING LCD TO 8051 BY Qurat-ul-ain › follow this code and diagram

November 1, 2011 at 8:32 am #6771
Qaisar
Participant

follow this code and diagram to display text and numbers on lcd..

 

 

#include <AT89X51.H>
#include < my.h > // built in delay function
 
#define lcd_data P2
sbit en=P0^1;
sbit rs=P0^0;
 
 
unsigned char z;
unsigned int i;
 
         void lcdcmd(unsigned char value)
        {
              lcd_data=value;
               rs=0;
  en=1;
  delay(200);
  en=0;
  return;
 }
 
void lcddata(unsigned char value)
{
  lcd_data=value;
rs=1;
en=1;
delay(200);
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);
 }
 
} 
 
 
wysiwyg_imageupload:3061:

RSS feed: Recent Posts Recent Posts

  • Advice for an ESP32 Soil Tensiometer project with 5V sensors September 9, 2026
  • Marantz SR4500 – CS49400 DSP reverse-engineering / custom active crossover September 9, 2026
  • How does an air tag work? September 9, 2026
  • Cheap ways to link 5 Keithley units and 4 BNC units? September 8, 2026
  • Sony KV-29VL40 - 4 Blink error - IC001 Pin 17 high September 8, 2026

Stay Up To Date

Newsletter Signup
EngineersGarage

Copyright © 2026 Arrowfly 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 Arrowfly
Privacy Policy | Advertising

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