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 / Topics / LCD Programming

LCD Programming

|

Miscellaneous › Others › LCD Programming

  • This topic has 7 replies, 5 voices, and was last updated 12 years ago by SHAH DISHANT H..
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • December 4, 2012 at 5:45 pm #2010
    Vicky
    Participant

    Can anyone suggest me a complete tutorial for LCD Programming with any microcontroller………………..

    January 19, 2013 at 4:42 am #8982
    nidhin.k
    Participant

     

     
    /********************************* MAIN PROGRAM START*************************************/
     
    #include<reg51.h>
    #include”lcd8.h”
    unsigned char xx,xxx,zz,zzz;
    void main()
    {
    EA=1;
    TMOD=0x11;
    ET0=1;ET1=1;
    TH0=0x3c;TL0=0xaf;
    TH1=0x3c;TL1=0xaf;
    Lcd8_Init();
    Lcd8_Display(0x80,”TIMER 0″,7);
    Lcd8_Display(0xc0,”TIMER 1″,7);
    TR0=1;
    while(1)
    {
     Lcd8_Decimal3(0x88,xxx);
     Lcd8_Decimal3(0xc8,zzz);
     if(xxx>9){TR0=0;TR1=1;xxx=0;}
     if(zzz>9){TR1=0;TR0=1;zzz=0;}
    }
    }
    void timer0()interrupt 1
    {
    xx++;
    if(xx>19){xxx++;xx=0;}
        TH0=0x3c;TL0=0xaf;
    }
    void timer1()interrupt 3
    {
    zz++;
    if(zz>19){zzz++;zz=0;}
        TH1=0x3c;TL1=0xaf;
    }
     
     
    /********************************* MAIN PROGRAM END*************************************/
     
     
     
    /*********************************LCD HEADER FILE START*************************************/
     
    #define First_Line 0x80
    #define Second_Line 0xc0
    #define Curser_On  0x0f
    #define Curser_Off 0x0c
    #define Clear_Display 0x01
    #define Data_Port P0
     
    sbit Lcd_rs = P2^7;
    sbit Lcd_rw = P2^6;
    sbit Lcd_en = P2^5;
     
    void Lcd8_Init();
    void Lcd8_Command(unsigned char);
    void Lcd8_Write(unsigned char,unsigned char);
    void Lcd8_Display(unsigned char,const unsigned char*,unsigned int);
    void Lcd8_Decimal2(unsigned char,unsigned char);
    void Lcd8_Decimal3(unsigned char,unsigned char);
    void Lcd8_Decimal4(unsigned char,unsigned int);
    void Delay(unsigned int);
    void del();
    void Lcd8_Init()
    {
    Lcd8_Command(0x38); //to select function set
    Lcd8_Command(0x06); //entry mode set
    Lcd8_Command(0x0c); //display on
    Lcd8_Command(0x01); //clear display
    }
     
    void Lcd8_Command(unsigned char com)
    {
    Data_Port=com;
    Lcd_en=1;
    Lcd_rs=Lcd_rw=0;
    Delay(125);
    Lcd_en=0;
    Delay(125);
    }
     
    void Lcd8_Write(unsigned char com,unsigned char lr)
    {
    Lcd8_Command(com);
     
    Data_Port=lr; // Data 
    Lcd_en=Lcd_rs=1;
    Lcd_rw=0;
    Delay(125);
    Lcd_en=0;
    Delay(125);
    }
     
    void Lcd8_Display(unsigned char com,const unsigned char *word,unsigned int n)
    {
    unsigned char Lcd_i;
     
    for(Lcd_i=0;Lcd_i<n;Lcd_i++)
    { 
    Lcd8_Write(com+Lcd_i,word[Lcd_i]);
      }
    }
     
    void Lcd8_Decimal2(unsigned char com,unsigned char val)
    {
    unsigned int Lcd_hr,Lcd_t,Lcd_o;
     
    Lcd_hr=val%100;
    Lcd_t=Lcd_hr/10;
    Lcd_o=Lcd_hr%10;
     
    Lcd8_Write(com,Lcd_t+0x30);
    Lcd8_Write(com+1,Lcd_o+0x30);
    }
     
     
    void Lcd8_Decimal3(unsigned char com,unsigned char val)
    {
    unsigned int Lcd_h,Lcd_hr,Lcd_t,Lcd_o;
     
    Lcd_h=val/100;
    Lcd_hr=val%100;
    Lcd_t=Lcd_hr/10;
    Lcd_o=Lcd_hr%10;
     
    Lcd8_Write(com,Lcd_h+0x30);
    Lcd8_Write(com+1,Lcd_t+0x30);
    Lcd8_Write(com+2,Lcd_o+0x30);
    }
     
    /*void Lcd8_Decimal4(unsigned char com,unsigned int val) 
    {
    unsigned int Lcd_th,Lcd_thr,Lcd_h,Lcd_hr,Lcd_t,Lcd_o;
     
    val = val%10000;
    Lcd_th=val/1000;
    Lcd_thr=val%1000;
    Lcd_h=Lcd_thr/100;
    Lcd_hr=Lcd_thr%100;
    Lcd_t=Lcd_hr/10;
    Lcd_o=Lcd_hr%10;
     
    Lcd8_Write(com,Lcd_th+0x30);
    Lcd8_Write(com+1,Lcd_h+0x30);
     
    Lcd8_Write(com+2,Lcd_t+0x30);
    Lcd8_Write(com+3,Lcd_o+0x30);
    }  */
     
    void Delay(unsigned int del)
    {
    while(del–);
    }
     
    void del()
    {
    Delay(65000);Delay(65000);
    }
     
     
    /*********************************LCD HEADER FILE END*************************************/
     
    January 19, 2014 at 5:10 am #10865
    shivani sura
    Participant

    while(1)

    {

     Lcd8_Decimal3(0x88,xxx);

     Lcd8_Decimal3(0xc8,zzz);

     if(xxx>9){TR0=0;TR1=1;xxx=0;}

     if(zzz>9){TR1=0;TR0=1;zzz=0;}

    }

    }

    void timer0()interrupt 1

    {

    xx++;

    if(xx>19){xxx++;xx=0;}

        TH0=0x3c;TL0=0xaf;

    }

    void timer1()interrupt 3

    {

    zz++;

    if(zz>19){zzz++;zz=0;}

        TH1=0x3c;TL1=0xaf;

    }Can any

    January 19, 2014 at 5:11 am #10866
    shivani sura
    Participant

    Can any one explain this please

    January 19, 2014 at 5:28 am #10867
    shivani sura
    Participant

    It is in above lcd
    program..
    please someone
    explain this…

    January 19, 2014 at 5:51 am #10868
    AJISH ALFRED
    Participant

    Hi all,

    From the home page of this site, navigate to EG LABS >> MICROCONTROLLER and find projects done on different microcontrollers in which there is an example of LCD interfacing with each and every microcontroller with maximum details.

    January 28, 2014 at 1:07 pm #10901
    shivani sura
    Participant

    Eye blink sensor for
    accident Prevention-for this
    can anyone provide me the complete
    source code please

    April 16, 2014 at 3:53 pm #11576
    SHAH DISHANT H.
    Participant

    Hi,

     

    Go through EG LABS>> MICROCONTROLLER>> ARM7

     

    You will find the perfect solution…!!!

  • Author
    Posts
Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.
Log In

RSS Recent Posts

  • Getting into an LED bulb April 21, 2026
  • understanding of resonance in time domain April 21, 2026
  • Beginner Questions About CNC Machines – G-code, Control Systems & Accuracy April 21, 2026
  • A Must-Watch Video Showing Dangerous Construction of Cheap Lithium-Ion Cells April 21, 2026
  • S1MJ ? April 20, 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