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 interface to PIC16f877a HITECH C Compiler

LCD interface to PIC16f877a HITECH C Compiler

|

Microcontroller › PIC › LCD interface to PIC16f877a HITECH C Compiler

  • This topic has 0 replies, 1 voice, and was last updated 12 years, 7 months ago by Sandeep.
Viewing 1 post (of 1 total)
  • Author
    Posts
  • September 3, 2013 at 3:51 pm #2620
    Sandeep
    Participant

    HI ,

    THIS IS THE CODE FOR MY pic16F877A .I want it to display HELLO WORLD on my LCD ,

    But getting no output , Absolutely

     

     

     
     
    #include<htc.h>
     
    #define LCD_PORT PORTD
    #define LCD_PORT_DIRECTION TRISD
    #define LCD_CON_DIRECTION TRISB
    #define RS RB1
    #define RW RB2
    #define E  RB4
     
     
     
     
    char hello[11]=”HELLO WORLD”;
     
     
     
     
    void delay(int itime)
    {
    int i,j;
    for(i=0;i<itime;i++)
    for(j=0;j<135;j++);
    }
     
    void IO_inti()
    {
    LCD_PORT_DIRECTION=0;
    LCD_CON_DIRECTION =0;
     
    }
     
     
    /************** LCD COMMAND SEND *****************/
    void lcd_cmd(char cmd1)
    {
    LCD_PORT=cmd1;
    RS=0;
    RW=0;
    E=1;
    delay(2);
    E=0;
     
    }
    /*************************************************/
     
     
    /************** LCD DATA SEND ********************/
    void lcd_data(char data1)
    {
    LCD_PORT=data1;
    RS=1;
    RW=0;
    E=1;
    delay(2);
    E=0;
    }  
    /*************************************************/
     
     
    /************** LCD INITIALIZATION ***************/
    void lcd_inti()
    {
    lcd_cmd(0x01); // clear screen
    delay(10);
     
    lcd_cmd(0x06); // 
    delay(10);
    lcd_cmd(0x80); // force cursor to 1st line
        delay(10);
     
    }
    /************************************************/
     
     
     
    /**************** MAIN ROUTIINE ****************/
    void main()
    {
     
    int i,j,k;
    IO_inti();
    lcd_inti();
     
    while(1)
    {
    for(i=0;i<11;i++)
    {
    lcd_data(hello);
    delay(1000);
    }
     
     
     
    }
     
    }
    /**********************************************/
     
     
     
     
     
     
  • Author
    Posts
Viewing 1 post (of 1 total)
  • You must be logged in to reply to this topic.
Log In

RSS Recent Posts

  • EasyEda program has a major bug April 12, 2026
  • understanding transmission line properties from TDR plot April 12, 2026
  • isolating S-params in of PCB board without connectors April 12, 2026
  • Some opamp advice please April 12, 2026
  • want help with microprocessor April 11, 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