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 Not working

LCD Not working

|

Microcontroller › PIC › LCD Not working

  • This topic has 0 replies, 1 voice, and was last updated 12 years, 5 months ago by kite.
Viewing 1 post (of 1 total)
  • Author
    Posts
  • May 18, 2013 at 11:01 am #2417
    kite
    Participant

     

    Hi ,

     

    I am new to PIC and have been trying  the Circuit diagram of LCD interfacing with PIC 18F4550 of the engineering garage website but in my  lcd all i see  is just black boxes . please help !!!

     

     

     

    #include<p18f4550.h>
    #include<Delays.h>
    #pragma config FOSC =INTOSC_EC
    #pragma WDT = OFF
    //LCD Control pins
    #define rs LATAbits.LATA0
    #define rw LATAbits.LATA1
    #define en LATAbits.LATA2
     
    //LCD Data pins
    #define lcdport LATB
     
    void lcd_ini(void);
    void lcdcmd(unsigned char n);
    void lcddata(unsigned char n);
    unsigned int i=0;
     
    void main(void)
    {
    TRISA=0; // Configure Port A as output port
    LATA=0;
    TRISB=0; // Configure Port B as output port
    LATB=0;
    lcd_ini(); // LCD initialization
    lcddata(‘E’); // Print ‘E’
    Delay10KTCYx(200);
    lcdcmd(0x85); // Position 1st Line, 6th Column
    lcddata(‘G’); // Print ‘G’
     
    }
    void lcd_ini()
    {
    lcdcmd(0x38); // Configure the LCD in 8-bit mode, 2 line and 5×7 font
    Delay10KTCYx(0.31 );
    lcdcmd(0x0C); // Display On and Cursor Off
    Delay10KTCYx(0.31 );
    lcdcmd(0x01); // Clear display screen
    Delay10KTCYx(0.31 );
    lcdcmd(0x06); // Increment cursor
    Delay10KTCYx(0.31 );
    lcdcmd(0x80); // Set cursor position to 1st line, 1st column
    Delay10KTCYx(0.31 );
    }
     
    void lcdcmd(unsigned char cmdout)
    {
    lcdport=cmdout; //Send command to lcdport=PORTB
    rs=0;
    rw=0;
    en=1;
    Delay10KTCYx(2);
    en=0;
    }
     
    void lcddata(unsigned char dataout)
    {
    lcdport=dataout; //Send data to lcdport=PORTB
    rs=1;
    rw=0;
    en=1;
    Delay10KTCYx(2);
    en=0;
    }
  • Author
    Posts
Viewing 1 post (of 1 total)
  • You must be logged in to reply to this topic.
Log In

RSS Recent Posts

  • WTB: "The Theory Of Servicing AM, FM, And FM Receivers" by Clarence R. Green and Robert M. Bourque November 10, 2025
  • Anyone In The US Ordered From AliExpress Recently? November 10, 2025
  • Calculation of A Class amplifier November 10, 2025
  • strange laptop problem November 10, 2025
  • restarting this Christmas project November 10, 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